From 569748189e0bf2e838dbbf8b5c8dcd3bd833b231 Mon Sep 17 00:00:00 2001 From: Stephen Zhou Date: Tue, 17 Mar 2026 10:56:46 +0800 Subject: [PATCH] refactor: use hoisted modern monaco (#33540) --- .../base/modern-monaco/hoisted-config.ts | 12 + .../base/modern-monaco/import-map.tsx | 38 + web/app/components/base/modern-monaco/init.ts | 20 +- web/app/layout.tsx | 2 + web/package.json | 1 + .../modern-monaco/cache.mjs | 129 + .../modern-monaco/core.mjs | 441 + .../modern-monaco/editor-core.mjs | 205645 +++++++++++++++ .../modern-monaco/editor-worker-main.mjs | 5 + .../modern-monaco/editor-worker.mjs | 14466 + .../modern-monaco/hoist-manifest.json | 23 + .../modern-monaco/index.mjs | 29339 ++ .../modern-monaco/lsp/client.mjs | 2267 + .../modern-monaco/lsp/css/setup.mjs | 58 + .../modern-monaco/lsp/css/worker.mjs | 59415 +++++ .../modern-monaco/lsp/html/setup.mjs | 110 + .../modern-monaco/lsp/html/worker.mjs | 22525 ++ .../modern-monaco/lsp/index.mjs | 20 + .../modern-monaco/lsp/json/setup.mjs | 2740 + .../modern-monaco/lsp/json/worker.mjs | 8652 + .../modern-monaco/lsp/typescript/libs.mjs | 101 + .../modern-monaco/lsp/typescript/setup.mjs | 2874 + .../modern-monaco/lsp/typescript/worker.mjs | 5405 + .../modern-monaco/onig.wasm | Bin 0 -> 466610 bytes .../modern-monaco/shiki-wasm.mjs | 9 + .../modern-monaco/shiki.mjs | 7932 + .../modern-monaco/ssr/index.mjs | 42 + .../modern-monaco/ssr/workerd.mjs | 41 + .../modern-monaco/util.mjs | 198 + .../modern-monaco/workspace.mjs | 579 + .../tm-grammars@1.31.2/grammars/css.json | 1860 + .../tm-grammars@1.31.2/grammars/html.json | 2627 + .../grammars/javascript.json | 5996 + .../tm-grammars@1.31.2/grammars/json.json | 206 + .../tm-grammars@1.31.2/grammars/python.json | 4174 + .../tm-themes@1.12.1/themes/dark-plus.json | 590 + .../tm-themes@1.12.1/themes/light-plus.json | 615 + .../typescript@5.9.3/es2022/typescript.mjs | 454 + web/scripts/hoist-modern-monaco.md | 109 + web/scripts/hoist-modern-monaco.ts | 337 + 40 files changed, 380052 insertions(+), 5 deletions(-) create mode 100644 web/app/components/base/modern-monaco/hoisted-config.ts create mode 100644 web/app/components/base/modern-monaco/import-map.tsx create mode 100644 web/public/hoisted-modern-monaco/modern-monaco/cache.mjs create mode 100644 web/public/hoisted-modern-monaco/modern-monaco/core.mjs create mode 100644 web/public/hoisted-modern-monaco/modern-monaco/editor-core.mjs create mode 100644 web/public/hoisted-modern-monaco/modern-monaco/editor-worker-main.mjs create mode 100644 web/public/hoisted-modern-monaco/modern-monaco/editor-worker.mjs create mode 100644 web/public/hoisted-modern-monaco/modern-monaco/hoist-manifest.json create mode 100644 web/public/hoisted-modern-monaco/modern-monaco/index.mjs create mode 100644 web/public/hoisted-modern-monaco/modern-monaco/lsp/client.mjs create mode 100644 web/public/hoisted-modern-monaco/modern-monaco/lsp/css/setup.mjs create mode 100644 web/public/hoisted-modern-monaco/modern-monaco/lsp/css/worker.mjs create mode 100644 web/public/hoisted-modern-monaco/modern-monaco/lsp/html/setup.mjs create mode 100644 web/public/hoisted-modern-monaco/modern-monaco/lsp/html/worker.mjs create mode 100644 web/public/hoisted-modern-monaco/modern-monaco/lsp/index.mjs create mode 100644 web/public/hoisted-modern-monaco/modern-monaco/lsp/json/setup.mjs create mode 100644 web/public/hoisted-modern-monaco/modern-monaco/lsp/json/worker.mjs create mode 100644 web/public/hoisted-modern-monaco/modern-monaco/lsp/typescript/libs.mjs create mode 100644 web/public/hoisted-modern-monaco/modern-monaco/lsp/typescript/setup.mjs create mode 100644 web/public/hoisted-modern-monaco/modern-monaco/lsp/typescript/worker.mjs create mode 100644 web/public/hoisted-modern-monaco/modern-monaco/onig.wasm create mode 100644 web/public/hoisted-modern-monaco/modern-monaco/shiki-wasm.mjs create mode 100644 web/public/hoisted-modern-monaco/modern-monaco/shiki.mjs create mode 100644 web/public/hoisted-modern-monaco/modern-monaco/ssr/index.mjs create mode 100644 web/public/hoisted-modern-monaco/modern-monaco/ssr/workerd.mjs create mode 100644 web/public/hoisted-modern-monaco/modern-monaco/util.mjs create mode 100644 web/public/hoisted-modern-monaco/modern-monaco/workspace.mjs create mode 100644 web/public/hoisted-modern-monaco/tm-grammars@1.31.2/grammars/css.json create mode 100644 web/public/hoisted-modern-monaco/tm-grammars@1.31.2/grammars/html.json create mode 100644 web/public/hoisted-modern-monaco/tm-grammars@1.31.2/grammars/javascript.json create mode 100644 web/public/hoisted-modern-monaco/tm-grammars@1.31.2/grammars/json.json create mode 100644 web/public/hoisted-modern-monaco/tm-grammars@1.31.2/grammars/python.json create mode 100644 web/public/hoisted-modern-monaco/tm-themes@1.12.1/themes/dark-plus.json create mode 100644 web/public/hoisted-modern-monaco/tm-themes@1.12.1/themes/light-plus.json create mode 100644 web/public/hoisted-modern-monaco/typescript@5.9.3/es2022/typescript.mjs create mode 100644 web/scripts/hoist-modern-monaco.md create mode 100644 web/scripts/hoist-modern-monaco.ts diff --git a/web/app/components/base/modern-monaco/hoisted-config.ts b/web/app/components/base/modern-monaco/hoisted-config.ts new file mode 100644 index 0000000000..e6082514f1 --- /dev/null +++ b/web/app/components/base/modern-monaco/hoisted-config.ts @@ -0,0 +1,12 @@ +// This file is generated by scripts/hoist-modern-monaco.ts. +// Do not edit it manually. + +export const HOIST_BASE_PATH = '/hoisted-modern-monaco' as const +export const TM_THEMES_VERSION = '1.12.1' as const +export const TM_GRAMMARS_VERSION = '1.31.2' as const +export const HOIST_THEME_IDS = ['light-plus', 'dark-plus'] as const +export const HOIST_LANGUAGE_IDS = ['javascript', 'json', 'python', 'html', 'css'] as const +export const MODERN_MONACO_IMPORT_MAP = { + 'modern-monaco/editor-core': '/hoisted-modern-monaco/modern-monaco/editor-core.mjs', + 'modern-monaco/lsp': '/hoisted-modern-monaco/modern-monaco/lsp/index.mjs', +} as const diff --git a/web/app/components/base/modern-monaco/import-map.tsx b/web/app/components/base/modern-monaco/import-map.tsx new file mode 100644 index 0000000000..825719e11b --- /dev/null +++ b/web/app/components/base/modern-monaco/import-map.tsx @@ -0,0 +1,38 @@ +import { headers } from 'next/headers' +import { env } from '@/env' +import { MODERN_MONACO_IMPORT_MAP } from './hoisted-config' + +function withBasePath(pathname: string) { + return `${env.NEXT_PUBLIC_BASE_PATH}${pathname}` +} + +function getRequestOrigin(requestHeaders: Headers) { + const protocol = requestHeaders.get('x-forwarded-proto') ?? 'http' + const host = requestHeaders.get('x-forwarded-host') ?? requestHeaders.get('host') + if (!host) + return null + return `${protocol}://${host}` +} + +const MonacoImportMap = async () => { + const requestHeaders = await headers() + const nonce = process.env.NODE_ENV === 'production' ? requestHeaders.get('x-nonce') ?? '' : '' + const requestOrigin = getRequestOrigin(requestHeaders) + const importMap = JSON.stringify({ + imports: Object.fromEntries( + Object.entries(MODERN_MONACO_IMPORT_MAP).map(([specifier, pathname]) => { + const modulePath = withBasePath(pathname) + const moduleUrl = requestOrigin ? new URL(modulePath, requestOrigin).toString() : modulePath + return [specifier, moduleUrl] + }), + ), + }) + + return ( + + ) +} + +export default MonacoImportMap diff --git a/web/app/components/base/modern-monaco/init.ts b/web/app/components/base/modern-monaco/init.ts index 5c0f1f2743..521f589cd7 100644 --- a/web/app/components/base/modern-monaco/init.ts +++ b/web/app/components/base/modern-monaco/init.ts @@ -1,14 +1,24 @@ import type { InitOptions } from 'modern-monaco' +import { basePath } from '@/utils/var' +import { + HOIST_BASE_PATH, + HOIST_LANGUAGE_IDS, + HOIST_THEME_IDS, + TM_GRAMMARS_VERSION, + TM_THEMES_VERSION, +} from './hoisted-config' export const LIGHT_THEME_ID = 'light-plus' export const DARK_THEME_ID = 'dark-plus' +const assetPath = (pathname: string) => `${basePath}${HOIST_BASE_PATH}${pathname}` +const themeAssetPath = (themeId: string) => assetPath(`/tm-themes@${TM_THEMES_VERSION}/themes/${themeId}.json`) +const grammarAssetPath = (languageId: string) => assetPath(`/tm-grammars@${TM_GRAMMARS_VERSION}/grammars/${languageId}.json`) + const DEFAULT_INIT_OPTIONS: InitOptions = { - defaultTheme: DARK_THEME_ID, - themes: [ - LIGHT_THEME_ID, - DARK_THEME_ID, - ], + defaultTheme: themeAssetPath(DARK_THEME_ID), + themes: HOIST_THEME_IDS.map(themeAssetPath), + langs: HOIST_LANGUAGE_IDS.map(grammarAssetPath), } let monacoInitPromise: Promise | null = null diff --git a/web/app/layout.tsx b/web/app/layout.tsx index fd9548600c..c5bd4638c8 100644 --- a/web/app/layout.tsx +++ b/web/app/layout.tsx @@ -8,6 +8,7 @@ import GlobalPublicStoreProvider from '@/context/global-public-context' import { TanstackQueryInitializer } from '@/context/query-client' import { getDatasetMap } from '@/env' import { getLocaleOnServer } from '@/i18n-config/server' +import MonacoImportMap from './components/base/modern-monaco/import-map' import { ToastProvider } from './components/base/toast' import { TooltipProvider } from './components/base/ui/tooltip' import BrowserInitializer from './components/browser-initializer' @@ -37,6 +38,7 @@ const LocaleLayout = async ({ return ( + diff --git a/web/package.json b/web/package.json index 9853976424..558264fae6 100644 --- a/web/package.json +++ b/web/package.json @@ -36,6 +36,7 @@ "dev:vinext": "vinext dev", "gen-doc-paths": "tsx ./scripts/gen-doc-paths.ts", "gen-icons": "node ./scripts/gen-icons.mjs && eslint --fix app/components/base/icons/src/", + "hoist:modern-monaco": "tsx ./scripts/hoist-modern-monaco.ts", "i18n:check": "tsx ./scripts/check-i18n.js", "knip": "knip", "lint": "eslint --cache --concurrency=auto", diff --git a/web/public/hoisted-modern-monaco/modern-monaco/cache.mjs b/web/public/hoisted-modern-monaco/modern-monaco/cache.mjs new file mode 100644 index 0000000000..a70f23642a --- /dev/null +++ b/web/public/hoisted-modern-monaco/modern-monaco/cache.mjs @@ -0,0 +1,129 @@ +// src/cache.ts +import { defineProperty, normalizeURL, openIDB, promisifyIDBRequest } from "./util.mjs"; +var IndexedDB = class { + #db; + constructor(name) { + this.#db = this.#openDB(name); + } + #openDB(name) { + return openIDB(name, 1, { name: "store", keyPath: "url" }).then((db) => { + db.onclose = () => { + this.#db = this.#openDB(name); + }; + return this.#db = db; + }); + } + async get(url) { + const db = await this.#db; + const tx = db.transaction("store", "readonly").objectStore("store"); + return promisifyIDBRequest(tx.get(url)); + } + async put(file) { + const db = await this.#db; + const tx = db.transaction("store", "readwrite").objectStore("store"); + await promisifyIDBRequest(tx.put(file)); + } + async delete(url) { + const db = await this.#db; + const tx = db.transaction("store", "readwrite").objectStore("store"); + await promisifyIDBRequest(tx.delete(url)); + } +}; +var MemoryCache = class { + #cache = /* @__PURE__ */ new Map(); + async get(url) { + return this.#cache.get(url) ?? null; + } + async put(file) { + this.#cache.set(file.url, file); + } + async delete(url) { + this.#cache.delete(url); + } +}; +var Cache = class { + _db; + constructor(name) { + if (globalThis.indexedDB) { + this._db = new IndexedDB(name); + } else { + this._db = new MemoryCache(); + } + } + async fetch(url) { + const storedRes = await this.query(url); + if (storedRes) { + return storedRes; + } + const res = await fetch(url); + if (!res.ok || !res.headers.has("cache-control")) { + return res; + } + const cacheControl = res.headers.get("cache-control"); + const maxAgeStr = cacheControl.match(/max-age=(\d+)/)?.[1]; + if (!maxAgeStr) { + return res; + } + const maxAge = parseInt(maxAgeStr); + if (isNaN(maxAge) || maxAge <= 0) { + return res; + } + const createdAt = Date.now(); + const expiresAt = createdAt + maxAge * 1e3; + const file = { + url: res.url, + content: null, + createdAt, + expiresAt, + headers: [] + }; + if (res.redirected) { + await this._db.put({ + ...file, + url: url instanceof URL ? url.href : url, + // raw url + headers: [["location", res.url]] + }); + } + for (const header of ["content-type", "x-typescript-types"]) { + if (res.headers.has(header)) { + file.headers.push([header, res.headers.get(header)]); + } + } + file.content = await res.arrayBuffer(); + await this._db.put(file); + const resp = new Response(file.content, { headers: file.headers }); + defineProperty(resp, "url", res.url); + defineProperty(resp, "redirected", res.redirected); + return resp; + } + async query(key) { + const url = normalizeURL(key).href; + const file = await this._db.get(url); + if (file) { + if (file.expiresAt < Date.now()) { + await this._db.delete(url); + return null; + } + const headers = new Headers(file.headers); + if (headers.has("location")) { + const redirectedUrl = headers.get("location"); + const res2 = await this.query(redirectedUrl); + if (res2) { + defineProperty(res2, "redirected", true); + } + return res2; + } + const res = new Response(file.content, { headers }); + defineProperty(res, "url", url); + return res; + } + return null; + } +}; +var cache = new Cache("modern-monaco-cache"); +var cache_default = cache; +export { + cache, + cache_default as default +}; diff --git a/web/public/hoisted-modern-monaco/modern-monaco/core.mjs b/web/public/hoisted-modern-monaco/modern-monaco/core.mjs new file mode 100644 index 0000000000..658e903805 --- /dev/null +++ b/web/public/hoisted-modern-monaco/modern-monaco/core.mjs @@ -0,0 +1,441 @@ +// package.json +var version = "0.4.0"; + +// src/core.ts +import { getExtnameFromLanguageId, getLanguageIdFromPath, grammars, initShiki, setDefaultWasmLoader, themes } from "./shiki.mjs"; +import { initShikiMonacoTokenizer, registerShikiMonacoTokenizer } from "./shiki.mjs"; +import { render } from "./shiki.mjs"; +import { getWasmInstance } from "./shiki-wasm.mjs"; +import { NotFoundError, Workspace } from "./workspace.mjs"; +import { debunce, decode, isDigital } from "./util.mjs"; +var editorProps = [ + "autoDetectHighContrast", + "automaticLayout", + "contextmenu", + "cursorBlinking", + "cursorSmoothCaretAnimation", + "cursorStyle", + "cursorWidth", + "fontFamily", + "fontLigatures", + "fontSize", + "fontVariations", + "fontWeight", + "letterSpacing", + "lineHeight", + "lineNumbers", + "lineNumbersMinChars", + "matchBrackets", + "minimap", + "mouseStyle", + "multiCursorModifier", + "padding", + "readOnly", + "readOnlyMessage", + "rulers", + "scrollbar", + "stickyScroll", + "tabSize", + "theme", + "wordWrap" +]; +var errors = { + NotFound: NotFoundError +}; +var syntaxes = []; +var lspProviders = {}; +var getAttr = (el, name) => el.getAttribute(name); +var setStyle = (el, style) => Object.assign(el.style, style); +async function init(options) { + const langs = (options?.langs ?? []).concat(syntaxes); + const shiki = await initShiki({ ...options, langs }); + return loadMonaco(shiki, options?.workspace, options?.lsp); +} +function lazy(options) { + if (!customElements.get("monaco-editor")) { + let monacoPromise = null; + customElements.define( + "monaco-editor", + class extends HTMLElement { + async connectedCallback() { + const workspace = options?.workspace; + const renderOptions = {}; + for (const attrName of this.getAttributeNames()) { + const key = editorProps.find((k) => k.toLowerCase() === attrName); + if (key) { + let value = getAttr(this, attrName); + if (value === "") { + value = key === "minimap" || key === "stickyScroll" ? { enabled: true } : true; + } else { + value = value.trim(); + if (value === "true") { + value = true; + } else if (value === "false") { + value = false; + } else if (value === "null") { + value = null; + } else if (/^\d+$/.test(value)) { + value = Number(value); + } else if (/^\{.+\}$/.test(value)) { + try { + value = JSON.parse(value); + } catch (error) { + value = void 0; + } + } + } + if (key === "padding") { + if (typeof value === "number") { + value = { top: value, bottom: value }; + } else if (/^\d+\s+\d+$/.test(value)) { + const [top, bottom] = value.split(/\s+/); + if (top && bottom) { + value = { top: Number(top), bottom: Number(bottom) }; + } + } else { + value = void 0; + } + } + if (key === "wordWrap" && (value === "on" || value === true)) { + value = "on"; + } + if (value !== void 0) { + renderOptions[key] = value; + } + } + } + let filename; + let code; + const firstEl = this.firstElementChild; + if (firstEl && firstEl.tagName === "SCRIPT" && firstEl.className === "monaco-editor-options") { + try { + const v = JSON.parse(firstEl.textContent); + if (Array.isArray(v) && v.length === 2) { + const [input, opts] = v; + Object.assign(renderOptions, opts); + if (opts.fontDigitWidth) { + Reflect.set(globalThis, "__monaco_maxDigitWidth", opts.fontDigitWidth); + } + if (typeof input === "string") { + code = input; + } else { + filename = input.filename; + code = input.code; + } + } + } catch { + } + firstEl.remove(); + } + setStyle(this, { display: "block", position: "relative" }); + let widthAttr = getAttr(this, "width"); + let heightAttr = getAttr(this, "height"); + if (isDigital(widthAttr) && isDigital(heightAttr)) { + const width = Number(widthAttr); + const height = Number(heightAttr); + setStyle(this, { width: width + "px", height: height + "px" }); + renderOptions.dimension = { width, height }; + } else { + if (isDigital(widthAttr)) { + widthAttr += "px"; + } + if (isDigital(heightAttr)) { + heightAttr += "px"; + } + this.style.width ||= widthAttr ?? "100%"; + this.style.height ||= heightAttr ?? "100%"; + } + const containerEl = document.createElement("div"); + containerEl.className = "monaco-editor-container"; + setStyle(containerEl, { width: "100%", height: "100%" }); + this.appendChild(containerEl); + if (!filename && workspace) { + if (workspace.history.state.current) { + filename = workspace.history.state.current; + } else if (workspace.entryFile) { + filename = workspace.entryFile; + workspace.history.replace(filename); + } else { + const rootFiles = (await workspace.fs.readDirectory("/")).filter(([name, type]) => type === 1).map(([name]) => name); + filename = rootFiles.includes("index.html") ? "index.html" : rootFiles[0]; + if (filename) { + workspace.history.replace(filename); + } + } + } + const langs = (options?.langs ?? []).concat(syntaxes); + if (renderOptions.language || filename) { + const lang = renderOptions.language ?? getLanguageIdFromPath(filename) ?? "plaintext"; + if (!syntaxes.find((s) => s.name === lang)) { + langs.push(lang); + } + } + let theme = options?.theme ?? renderOptions.theme; + if (typeof theme === "string") { + theme = theme.toLowerCase().replace(/ +/g, "-"); + } + const highlighter = await initShiki({ ...options, theme, langs }); + renderOptions.theme = highlighter.getLoadedThemes()[0]; + let prerenderEl; + for (const el of this.children) { + if (el.className === "monaco-editor-prerender") { + prerenderEl = el; + break; + } + } + if (!prerenderEl && filename && workspace) { + try { + const code2 = await workspace.fs.readFile(filename); + const language = getLanguageIdFromPath(filename); + prerenderEl = containerEl.cloneNode(true); + prerenderEl.className = "monaco-editor-prerender"; + prerenderEl.innerHTML = render(highlighter, decode(code2), { ...renderOptions, language }); + } catch (error) { + if (error instanceof NotFoundError) { + } else { + throw error; + } + } + } + if (prerenderEl) { + setStyle(prerenderEl, { position: "absolute", top: "0", left: "0" }); + this.appendChild(prerenderEl); + if (filename && workspace) { + const viewState = await workspace.viewState.get(filename); + const scrollTop = viewState?.viewState.scrollTop ?? 0; + if (scrollTop) { + const mockEl = prerenderEl.querySelector(".mock-monaco-editor"); + if (mockEl) { + mockEl.scrollTop = scrollTop; + } + } + } + } + { + const monaco = await (monacoPromise ?? (monacoPromise = loadMonaco(highlighter, workspace, options?.lsp))); + const editor = monaco.editor.create(containerEl, renderOptions); + if (workspace) { + const storeViewState = () => { + const currentModel = editor.getModel(); + if (currentModel?.uri.scheme === "file") { + const state = editor.saveViewState(); + if (state) { + state.viewState.scrollTop ??= editor.getScrollTop(); + workspace.viewState.save(currentModel.uri.toString(), Object.freeze(state)); + } + } + }; + editor.onDidChangeCursorSelection(debunce(storeViewState, 500)); + editor.onDidScrollChange(debunce(storeViewState, 500)); + workspace.history.onChange((state) => { + if (editor.getModel()?.uri.toString() !== state.current) { + workspace._openTextDocument(monaco, editor, state.current); + } + }); + } + if (filename && workspace) { + try { + const model = await workspace._openTextDocument(monaco, editor, filename); + if (code && code !== model.getValue()) { + model.setValue(code); + } + } catch (error) { + if (error instanceof NotFoundError) { + if (code) { + const dirname = filename.split("/").slice(0, -1).join("/"); + if (dirname) { + await workspace.fs.createDirectory(dirname); + } + await workspace.fs.writeFile(filename, code); + workspace._openTextDocument(monaco, editor, filename); + } else { + editor.setModel(monaco.editor.createModel("")); + } + } else { + throw error; + } + } + } else if (code && (renderOptions.language || filename)) { + const modelUri = filename ? monaco.Uri.file(filename) : void 0; + let model = modelUri ? monaco.editor.getModel(modelUri) : null; + if (!model) { + model = monaco.editor.createModel(code, renderOptions.language, modelUri); + } else if (code !== model.getValue()) { + model.setValue(code); + } + editor.setModel(model); + } else { + editor.setModel(monaco.editor.createModel("")); + } + if (prerenderEl) { + setTimeout(() => { + const animate = prerenderEl.animate?.([{ opacity: 1 }, { opacity: 0 }], { duration: 200 }); + if (animate) { + animate.finished.then(() => prerenderEl.remove()); + } else { + setTimeout(() => prerenderEl.remove(), 200); + } + }, 200); + } + } + } + } + ); + } +} +function hydrate(options) { + return lazy(options); +} +async function loadMonaco(highlighter, workspace, lsp) { + let cdnUrl = `https://esm.sh/modern-monaco@${version}`; + let editorCoreModuleUrl = `${cdnUrl}/es2022/editor-core.mjs`; + let lspModuleUrl = `${cdnUrl}/es2022/lsp.mjs`; + let importmapEl = null; + if (importmapEl = document.querySelector("script[type='importmap']")) { + try { + const { imports = {} } = JSON.parse(importmapEl.textContent); + if (imports["modern-monaco/editor-core"]) { + editorCoreModuleUrl = imports["modern-monaco/editor-core"]; + } + if (imports["modern-monaco/lsp"]) { + lspModuleUrl = imports["modern-monaco/lsp"]; + } + } catch (error) { + } + } + const useBuiltinLSP = globalThis.MonacoEnvironment?.useBuiltinLSP; + const [monaco, { builtinLSPProviders }] = await Promise.all([ + import( + /* webpackIgnore: true */ + editorCoreModuleUrl + ), + useBuiltinLSP ? import( + /* webpackIgnore: true */ + lspModuleUrl + ) : Promise.resolve({ builtinLSPProviders: {} }) + ]); + const allLspProviders = { ...builtinLSPProviders, ...lspProviders, ...lsp?.providers }; + workspace?.setupMonaco(monaco); + if (!document.getElementById("monaco-editor-core-css")) { + const styleEl = document.createElement("style"); + styleEl.id = "monaco-editor-core-css"; + styleEl.media = "screen"; + styleEl.textContent = monaco.cssBundle; + document.head.appendChild(styleEl); + } + Reflect.set(globalThis, "MonacoEnvironment", { + getWorker: async (_workerId, label) => { + if (label === "editorWorkerService") { + return monaco.createEditorWorkerMain(); + } + }, + getLanguageIdFromUri: (uri) => getLanguageIdFromPath(uri.path), + getExtnameFromLanguageId + }); + monaco.editor.registerLinkOpener({ + async open(link) { + if ((link.scheme === "https" || link.scheme === "http") && monaco.editor.getModel(link)) { + return true; + } + return false; + } + }); + monaco.editor.registerEditorOpener({ + openCodeEditor: async (editor, resource, selectionOrPosition) => { + if (workspace && resource.scheme === "file") { + try { + await workspace._openTextDocument(monaco, editor, resource.toString(), selectionOrPosition); + return true; + } catch (err) { + if (err instanceof NotFoundError) { + return false; + } + throw err; + } + } + try { + const model = monaco.editor.getModel(resource); + if (model) { + editor.setModel(model); + if (selectionOrPosition) { + if ("startLineNumber" in selectionOrPosition) { + editor.setSelection(selectionOrPosition); + } else { + editor.setPosition(selectionOrPosition); + } + const pos = editor.getPosition(); + if (pos) { + const svp = editor.getScrolledVisiblePosition(new monaco.Position(pos.lineNumber - 7, pos.column)); + if (svp) { + editor.setScrollTop(svp.top); + } + } + } + const isHttpUrl = resource.scheme === "https" || resource.scheme === "http"; + editor.updateOptions({ readOnly: isHttpUrl }); + return true; + } + } catch (error) { + } + return false; + } + }); + if (globalThis.navigator?.userAgent?.includes("Macintosh")) { + monaco.editor.addKeybindingRule({ + keybinding: monaco.KeyMod.CtrlCmd | monaco.KeyCode.KeyK, + command: "editor.action.quickCommand" + }); + } + const allLanguages = new Set(grammars.filter((g) => !g.injectTo).map((g) => g.name)); + allLanguages.forEach((id) => { + const languages = monaco.languages; + languages.register({ id, aliases: grammars.find((g) => g.name === id)?.aliases }); + languages.onLanguage(id, async () => { + const config = monaco.languageConfigurations[monaco.languageConfigurationAliases[id] ?? id]; + const loadedGrammars = new Set(highlighter.getLoadedLanguages()); + const reqiredGrammars = [id].concat(grammars.find((g) => g.name === id)?.embedded ?? []).filter((id2) => !loadedGrammars.has(id2)); + if (config) { + languages.setLanguageConfiguration(id, monaco.convertVscodeLanguageConfiguration(config)); + } + if (reqiredGrammars.length > 0) { + await highlighter.loadGrammarFromCDN(...reqiredGrammars); + } + registerShikiMonacoTokenizer(monaco, highlighter, id); + let lspLabel = id; + let lspProvider = allLspProviders[lspLabel]; + if (!lspProvider) { + const alias = Object.entries(allLspProviders).find(([, lsp2]) => lsp2.aliases?.includes(id)); + if (alias) { + [lspLabel, lspProvider] = alias; + } + } + if (lspProvider) { + lspProvider.import().then(({ setup }) => setup(monaco, id, lsp?.[lspLabel], lsp?.formatting, workspace)); + } + }); + }); + initShikiMonacoTokenizer(monaco, highlighter); + return monaco; +} +function registerSyntax(syntax) { + syntaxes.push(syntax); +} +function registerTheme(theme) { + if (theme.name) { + themes.set(theme.name, theme); + } +} +function registerLSPProvider(lang, provider) { + lspProviders[lang] = provider; +} +setDefaultWasmLoader(getWasmInstance); +export { + Workspace, + errors, + hydrate, + init, + lazy, + registerLSPProvider, + registerSyntax, + registerTheme +}; diff --git a/web/public/hoisted-modern-monaco/modern-monaco/editor-core.mjs b/web/public/hoisted-modern-monaco/modern-monaco/editor-core.mjs new file mode 100644 index 0000000000..3e0488cec4 --- /dev/null +++ b/web/public/hoisted-modern-monaco/modern-monaco/editor-core.mjs @@ -0,0 +1,205645 @@ +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __esm = (fn, res) => function __init() { + return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res; +}; +var __commonJS = (cb, mod) => function __require() { + return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); + +// node_modules/monaco-editor-core/esm/vs/nls.messages.js +function getNLSMessages() { + return globalThis._VSCODE_NLS_MESSAGES; +} +function getNLSLanguage() { + return globalThis._VSCODE_NLS_LANGUAGE; +} +var init_nls_messages = __esm({ + "node_modules/monaco-editor-core/esm/vs/nls.messages.js"() { + } +}); + +// node_modules/monaco-editor-core/esm/vs/nls.js +function _format(message, args) { + let result; + if (args.length === 0) { + result = message; + } else { + result = message.replace(/\{(\d+)\}/g, (match2, rest) => { + const index = rest[0]; + const arg = args[index]; + let result2 = match2; + if (typeof arg === "string") { + result2 = arg; + } else if (typeof arg === "number" || typeof arg === "boolean" || arg === void 0 || arg === null) { + result2 = String(arg); + } + return result2; + }); + } + if (isPseudo) { + result = "\uFF3B" + result.replace(/[aouei]/g, "$&$&") + "\uFF3D"; + } + return result; +} +function localize(data, message, ...args) { + if (typeof data === "number") { + return _format(lookupMessage(data, message), args); + } + return _format(message, args); +} +function lookupMessage(index, fallback2) { + const message = getNLSMessages()?.[index]; + if (typeof message !== "string") { + if (typeof fallback2 === "string") { + return fallback2; + } + throw new Error(`!!! NLS MISSING: ${index} !!!`); + } + return message; +} +function localize2(data, originalMessage, ...args) { + let message; + if (typeof data === "number") { + message = lookupMessage(data, originalMessage); + } else { + message = originalMessage; + } + const value = _format(message, args); + return { + value, + original: originalMessage === message ? value : _format(originalMessage, args) + }; +} +var isPseudo; +var init_nls = __esm({ + "node_modules/monaco-editor-core/esm/vs/nls.js"() { + init_nls_messages(); + init_nls_messages(); + isPseudo = getNLSLanguage() === "pseudo" || typeof document !== "undefined" && document.location && typeof document.location.hash === "string" && document.location.hash.indexOf("pseudo=true") >= 0; + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/browser/window.js +function ensureCodeWindow(targetWindow, fallbackWindowId) { + const codeWindow = targetWindow; + if (typeof codeWindow.vscodeWindowId !== "number") { + Object.defineProperty(codeWindow, "vscodeWindowId", { + get: () => fallbackWindowId + }); + } +} +var mainWindow; +var init_window = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/browser/window.js"() { + mainWindow = window; + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/browser/browser.js +function addMatchMediaChangeListener(targetWindow, query, callback) { + if (typeof query === "string") { + query = targetWindow.matchMedia(query); + } + query.addEventListener("change", callback); +} +function getZoomFactor(targetWindow) { + return WindowManager.INSTANCE.getZoomFactor(targetWindow); +} +function isStandalone() { + return standalone; +} +function getMonacoEnvironment() { + return globalThis.MonacoEnvironment; +} +var WindowManager, userAgent, isFirefox, isWebKit, isChrome, isSafari, isWebkitWebView, isElectron, isAndroid, standalone; +var init_browser = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/browser/browser.js"() { + init_window(); + WindowManager = class _WindowManager { + constructor() { + this.mapWindowIdToZoomFactor = /* @__PURE__ */ new Map(); + } + static { + this.INSTANCE = new _WindowManager(); + } + getZoomFactor(targetWindow) { + return this.mapWindowIdToZoomFactor.get(this.getWindowId(targetWindow)) ?? 1; + } + getWindowId(targetWindow) { + return targetWindow.vscodeWindowId; + } + }; + userAgent = navigator.userAgent; + isFirefox = userAgent.indexOf("Firefox") >= 0; + isWebKit = userAgent.indexOf("AppleWebKit") >= 0; + isChrome = userAgent.indexOf("Chrome") >= 0; + isSafari = !isChrome && userAgent.indexOf("Safari") >= 0; + isWebkitWebView = !isChrome && !isSafari && isWebKit; + isElectron = userAgent.indexOf("Electron/") >= 0; + isAndroid = userAgent.indexOf("Android") >= 0; + standalone = false; + if (typeof mainWindow.matchMedia === "function") { + const standaloneMatchMedia = mainWindow.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"); + const fullScreenMatchMedia = mainWindow.matchMedia("(display-mode: fullscreen)"); + standalone = standaloneMatchMedia.matches; + addMatchMediaChangeListener(mainWindow, standaloneMatchMedia, ({ matches }) => { + if (standalone && fullScreenMatchMedia.matches) { + return; + } + standalone = matches; + }); + } + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/common/errors.js +function onBugIndicatingError(e) { + errorHandler.onUnexpectedError(e); + return void 0; +} +function onUnexpectedError(e) { + if (!isCancellationError(e)) { + errorHandler.onUnexpectedError(e); + } + return void 0; +} +function onUnexpectedExternalError(e) { + if (!isCancellationError(e)) { + errorHandler.onUnexpectedExternalError(e); + } + return void 0; +} +function transformErrorForSerialization(error) { + if (error instanceof Error) { + const { name, message, cause } = error; + const stack = error.stacktrace || error.stack; + return { + $isError: true, + name, + message, + stack, + noTelemetry: ErrorNoTelemetry.isErrorNoTelemetry(error), + cause: cause ? transformErrorForSerialization(cause) : void 0, + code: error.code + }; + } + return error; +} +function isCancellationError(error) { + if (error instanceof CancellationError) { + return true; + } + return error instanceof Error && error.name === canceledName && error.message === canceledName; +} +function canceled() { + const error = new Error(canceledName); + error.name = error.message; + return error; +} +function illegalArgument(name) { + if (name) { + return new Error(`Illegal argument: ${name}`); + } else { + return new Error("Illegal argument"); + } +} +function illegalState(name) { + if (name) { + return new Error(`Illegal state: ${name}`); + } else { + return new Error("Illegal state"); + } +} +var ErrorHandler, errorHandler, canceledName, CancellationError, NotSupportedError, ErrorNoTelemetry, BugIndicatingError; +var init_errors = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/common/errors.js"() { + ErrorHandler = class { + constructor() { + this.listeners = []; + this.unexpectedErrorHandler = function(e) { + setTimeout(() => { + if (e.stack) { + if (ErrorNoTelemetry.isErrorNoTelemetry(e)) { + throw new ErrorNoTelemetry(e.message + "\n\n" + e.stack); + } + throw new Error(e.message + "\n\n" + e.stack); + } + throw e; + }, 0); + }; + } + emit(e) { + this.listeners.forEach((listener) => { + listener(e); + }); + } + onUnexpectedError(e) { + this.unexpectedErrorHandler(e); + this.emit(e); + } + // For external errors, we don't want the listeners to be called + onUnexpectedExternalError(e) { + this.unexpectedErrorHandler(e); + } + }; + errorHandler = new ErrorHandler(); + canceledName = "Canceled"; + CancellationError = class extends Error { + constructor() { + super(canceledName); + this.name = this.message; + } + }; + NotSupportedError = class extends Error { + constructor(message) { + super("NotSupported"); + if (message) { + this.message = message; + } + } + }; + ErrorNoTelemetry = class _ErrorNoTelemetry extends Error { + constructor(msg) { + super(msg); + this.name = "CodeExpectedError"; + } + static fromError(err) { + if (err instanceof _ErrorNoTelemetry) { + return err; + } + const result = new _ErrorNoTelemetry(); + result.message = err.message; + result.stack = err.stack; + return result; + } + static isErrorNoTelemetry(err) { + return err.name === "CodeExpectedError"; + } + }; + BugIndicatingError = class _BugIndicatingError extends Error { + constructor(message) { + super(message || "An unexpected bug occurred."); + Object.setPrototypeOf(this, _BugIndicatingError.prototype); + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/common/assert.js +function ok(value, message) { + if (!value) { + throw new Error(message ? `Assertion failed (${message})` : "Assertion Failed"); + } +} +function assertNever(value, message = "Unreachable") { + throw new Error(message); +} +function assert(condition, messageOrError = "unexpected state") { + if (!condition) { + const errorToThrow = typeof messageOrError === "string" ? new BugIndicatingError(`Assertion Failed: ${messageOrError}`) : messageOrError; + throw errorToThrow; + } +} +function softAssert(condition, message = "Soft Assertion Failed") { + if (!condition) { + onUnexpectedError(new BugIndicatingError(message)); + } +} +function assertFn(condition) { + if (!condition()) { + debugger; + condition(); + onUnexpectedError(new BugIndicatingError("Assertion Failed")); + } +} +function checkAdjacentItems(items, predicate) { + let i2 = 0; + while (i2 < items.length - 1) { + const a = items[i2]; + const b = items[i2 + 1]; + if (!predicate(a, b)) { + return false; + } + i2++; + } + return true; +} +var init_assert = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/common/assert.js"() { + init_errors(); + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/common/types.js +function isString(str) { + return typeof str === "string"; +} +function isArrayOf(value, check) { + return Array.isArray(value) && value.every(check); +} +function isObject(obj) { + return typeof obj === "object" && obj !== null && !Array.isArray(obj) && !(obj instanceof RegExp) && !(obj instanceof Date); +} +function isTypedArray(obj) { + const TypedArray = Object.getPrototypeOf(Uint8Array); + return typeof obj === "object" && obj instanceof TypedArray; +} +function isNumber(obj) { + return typeof obj === "number" && !isNaN(obj); +} +function isIterable(obj) { + return !!obj && typeof obj[Symbol.iterator] === "function"; +} +function isBoolean(obj) { + return obj === true || obj === false; +} +function isUndefined(obj) { + return typeof obj === "undefined"; +} +function isDefined(arg) { + return !isUndefinedOrNull(arg); +} +function isUndefinedOrNull(obj) { + return isUndefined(obj) || obj === null; +} +function assertType(condition, type) { + if (!condition) { + throw new Error(type ? `Unexpected type, expected '${type}'` : "Unexpected type"); + } +} +function assertReturnsDefined(arg) { + assert(arg !== null && arg !== void 0, "Argument is `undefined` or `null`."); + return arg; +} +function isFunction(obj) { + return typeof obj === "function"; +} +function validateConstraints(args, constraints) { + const len = Math.min(args.length, constraints.length); + for (let i2 = 0; i2 < len; i2++) { + validateConstraint(args[i2], constraints[i2]); + } +} +function validateConstraint(arg, constraint) { + if (isString(constraint)) { + if (typeof arg !== constraint) { + throw new Error(`argument does not match constraint: typeof ${constraint}`); + } + } else if (isFunction(constraint)) { + try { + if (arg instanceof constraint) { + return; + } + } catch { + } + if (!isUndefinedOrNull(arg) && arg.constructor === constraint) { + return; + } + if (constraint.length === 1 && constraint.call(void 0, arg) === true) { + return; + } + throw new Error(`argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true`); + } +} +function upcast(x) { + return x; +} +var init_types = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/common/types.js"() { + init_assert(); + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/common/platform.js +function isLittleEndian() { + if (!_isLittleEndianComputed) { + _isLittleEndianComputed = true; + const test = new Uint8Array(2); + test[0] = 1; + test[1] = 2; + const view = new Uint16Array(test.buffer); + _isLittleEndian = view[0] === (2 << 8) + 1; + } + return _isLittleEndian; +} +var LANGUAGE_DEFAULT, _isWindows, _isMacintosh, _isLinux, _isLinuxSnap, _isNative, _isWeb, _isElectron, _isIOS, _isCI, _isMobile, _locale, _language, _platformLocale, _translationsConfigFile, _userAgent, $globalThis, nodeProcess, isElectronProcess, isElectronRenderer, _platform, isWindows, isMacintosh, isLinux, isNative, isWeb, isWebWorker, webWorkerOrigin, isIOS, isMobile, platform, userAgent2, language, setTimeout0IsFaster, setTimeout0, OS, _isLittleEndian, _isLittleEndianComputed, isChrome2, isFirefox2, isSafari2, isEdge, isAndroid2; +var init_platform = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/common/platform.js"() { + init_nls(); + LANGUAGE_DEFAULT = "en"; + _isWindows = false; + _isMacintosh = false; + _isLinux = false; + _isLinuxSnap = false; + _isNative = false; + _isWeb = false; + _isElectron = false; + _isIOS = false; + _isCI = false; + _isMobile = false; + _locale = void 0; + _language = LANGUAGE_DEFAULT; + _platformLocale = LANGUAGE_DEFAULT; + _translationsConfigFile = void 0; + _userAgent = void 0; + $globalThis = globalThis; + nodeProcess = void 0; + if (typeof $globalThis.vscode !== "undefined" && typeof $globalThis.vscode.process !== "undefined") { + nodeProcess = $globalThis.vscode.process; + } else if (typeof process !== "undefined" && typeof process?.versions?.node === "string") { + nodeProcess = process; + } + isElectronProcess = typeof nodeProcess?.versions?.electron === "string"; + isElectronRenderer = isElectronProcess && nodeProcess?.type === "renderer"; + if (typeof nodeProcess === "object") { + _isWindows = nodeProcess.platform === "win32"; + _isMacintosh = nodeProcess.platform === "darwin"; + _isLinux = nodeProcess.platform === "linux"; + _isLinuxSnap = _isLinux && !!nodeProcess.env["SNAP"] && !!nodeProcess.env["SNAP_REVISION"]; + _isElectron = isElectronProcess; + _isCI = !!nodeProcess.env["CI"] || !!nodeProcess.env["BUILD_ARTIFACTSTAGINGDIRECTORY"] || !!nodeProcess.env["GITHUB_WORKSPACE"]; + _locale = LANGUAGE_DEFAULT; + _language = LANGUAGE_DEFAULT; + const rawNlsConfig = nodeProcess.env["VSCODE_NLS_CONFIG"]; + if (rawNlsConfig) { + try { + const nlsConfig = JSON.parse(rawNlsConfig); + _locale = nlsConfig.userLocale; + _platformLocale = nlsConfig.osLocale; + _language = nlsConfig.resolvedLanguage || LANGUAGE_DEFAULT; + _translationsConfigFile = nlsConfig.languagePack?.translationsConfigFile; + } catch (e) { + } + } + _isNative = true; + } else if (typeof navigator === "object" && !isElectronRenderer) { + _userAgent = navigator.userAgent; + _isWindows = _userAgent.indexOf("Windows") >= 0; + _isMacintosh = _userAgent.indexOf("Macintosh") >= 0; + _isIOS = (_userAgent.indexOf("Macintosh") >= 0 || _userAgent.indexOf("iPad") >= 0 || _userAgent.indexOf("iPhone") >= 0) && !!navigator.maxTouchPoints && navigator.maxTouchPoints > 0; + _isLinux = _userAgent.indexOf("Linux") >= 0; + _isMobile = _userAgent?.indexOf("Mobi") >= 0; + _isWeb = true; + _language = getNLSLanguage() || LANGUAGE_DEFAULT; + _locale = navigator.language.toLowerCase(); + _platformLocale = _locale; + } else { + console.error("Unable to resolve platform."); + } + _platform = 0; + if (_isMacintosh) { + _platform = 1; + } else if (_isWindows) { + _platform = 3; + } else if (_isLinux) { + _platform = 2; + } + isWindows = _isWindows; + isMacintosh = _isMacintosh; + isLinux = _isLinux; + isNative = _isNative; + isWeb = _isWeb; + isWebWorker = _isWeb && typeof $globalThis.importScripts === "function"; + webWorkerOrigin = isWebWorker ? $globalThis.origin : void 0; + isIOS = _isIOS; + isMobile = _isMobile; + platform = _platform; + userAgent2 = _userAgent; + language = _language; + setTimeout0IsFaster = typeof $globalThis.postMessage === "function" && !$globalThis.importScripts; + setTimeout0 = (() => { + if (setTimeout0IsFaster) { + const pending = []; + $globalThis.addEventListener("message", (e) => { + if (e.data && e.data.vscodeScheduleAsyncWork) { + for (let i2 = 0, len = pending.length; i2 < len; i2++) { + const candidate = pending[i2]; + if (candidate.id === e.data.vscodeScheduleAsyncWork) { + pending.splice(i2, 1); + candidate.callback(); + return; + } + } + } + }); + let lastId = 0; + return (callback) => { + const myId = ++lastId; + pending.push({ + id: myId, + callback + }); + $globalThis.postMessage({ vscodeScheduleAsyncWork: myId }, "*"); + }; + } + return (callback) => setTimeout(callback); + })(); + OS = _isMacintosh || _isIOS ? 2 : _isWindows ? 1 : 3; + _isLittleEndian = true; + _isLittleEndianComputed = false; + isChrome2 = !!(userAgent2 && userAgent2.indexOf("Chrome") >= 0); + isFirefox2 = !!(userAgent2 && userAgent2.indexOf("Firefox") >= 0); + isSafari2 = !!(!isChrome2 && (userAgent2 && userAgent2.indexOf("Safari") >= 0)); + isEdge = !!(userAgent2 && userAgent2.indexOf("Edg/") >= 0); + isAndroid2 = !!(userAgent2 && userAgent2.indexOf("Android") >= 0); + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/browser/canIUse.js +var BrowserFeatures; +var init_canIUse = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/browser/canIUse.js"() { + init_browser(); + init_window(); + init_platform(); + BrowserFeatures = { + clipboard: { + writeText: isNative || document.queryCommandSupported && document.queryCommandSupported("copy") || !!(navigator && navigator.clipboard && navigator.clipboard.writeText), + readText: isNative || !!(navigator && navigator.clipboard && navigator.clipboard.readText) + }, + keyboard: (() => { + if (isNative || isStandalone()) { + return 0; + } + if (navigator.keyboard || isSafari) { + return 1; + } + return 2; + })(), + // 'ontouchstart' in window always evaluates to true with typescript's modern typings. This causes `window` to be + // `never` later in `window.navigator`. That's why we need the explicit `window as Window` cast + touch: "ontouchstart" in mainWindow || navigator.maxTouchPoints > 0, + pointerEvents: mainWindow.PointerEvent && ("ontouchstart" in mainWindow || navigator.maxTouchPoints > 0) + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/common/keyCodes.js +function KeyChord(firstPart, secondPart) { + const chordPart = (secondPart & 65535) << 16 >>> 0; + return (firstPart | chordPart) >>> 0; +} +var KeyCodeStrMap, uiMap, userSettingsUSMap, userSettingsGeneralMap, EVENT_KEY_CODE_MAP, NATIVE_WINDOWS_KEY_CODE_TO_KEY_CODE, scanCodeIntToStr, scanCodeStrToInt, scanCodeLowerCaseStrToInt, IMMUTABLE_CODE_TO_KEY_CODE, IMMUTABLE_KEY_CODE_TO_CODE, KeyCodeUtils; +var init_keyCodes = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/common/keyCodes.js"() { + KeyCodeStrMap = class { + constructor() { + this._keyCodeToStr = []; + this._strToKeyCode = /* @__PURE__ */ Object.create(null); + } + define(keyCode, str) { + this._keyCodeToStr[keyCode] = str; + this._strToKeyCode[str.toLowerCase()] = keyCode; + } + keyCodeToStr(keyCode) { + return this._keyCodeToStr[keyCode]; + } + strToKeyCode(str) { + return this._strToKeyCode[str.toLowerCase()] || 0; + } + }; + uiMap = new KeyCodeStrMap(); + userSettingsUSMap = new KeyCodeStrMap(); + userSettingsGeneralMap = new KeyCodeStrMap(); + EVENT_KEY_CODE_MAP = new Array(230); + NATIVE_WINDOWS_KEY_CODE_TO_KEY_CODE = {}; + scanCodeIntToStr = []; + scanCodeStrToInt = /* @__PURE__ */ Object.create(null); + scanCodeLowerCaseStrToInt = /* @__PURE__ */ Object.create(null); + IMMUTABLE_CODE_TO_KEY_CODE = []; + IMMUTABLE_KEY_CODE_TO_CODE = []; + for (let i2 = 0; i2 <= 193; i2++) { + IMMUTABLE_CODE_TO_KEY_CODE[i2] = -1; + } + for (let i2 = 0; i2 <= 132; i2++) { + IMMUTABLE_KEY_CODE_TO_CODE[i2] = -1; + } + (function() { + const empty2 = ""; + const mappings = [ + // immutable, scanCode, scanCodeStr, keyCode, keyCodeStr, eventKeyCode, vkey, usUserSettingsLabel, generalUserSettingsLabel + [1, 0, "None", 0, "unknown", 0, "VK_UNKNOWN", empty2, empty2], + [1, 1, "Hyper", 0, empty2, 0, empty2, empty2, empty2], + [1, 2, "Super", 0, empty2, 0, empty2, empty2, empty2], + [1, 3, "Fn", 0, empty2, 0, empty2, empty2, empty2], + [1, 4, "FnLock", 0, empty2, 0, empty2, empty2, empty2], + [1, 5, "Suspend", 0, empty2, 0, empty2, empty2, empty2], + [1, 6, "Resume", 0, empty2, 0, empty2, empty2, empty2], + [1, 7, "Turbo", 0, empty2, 0, empty2, empty2, empty2], + [1, 8, "Sleep", 0, empty2, 0, "VK_SLEEP", empty2, empty2], + [1, 9, "WakeUp", 0, empty2, 0, empty2, empty2, empty2], + [0, 10, "KeyA", 31, "A", 65, "VK_A", empty2, empty2], + [0, 11, "KeyB", 32, "B", 66, "VK_B", empty2, empty2], + [0, 12, "KeyC", 33, "C", 67, "VK_C", empty2, empty2], + [0, 13, "KeyD", 34, "D", 68, "VK_D", empty2, empty2], + [0, 14, "KeyE", 35, "E", 69, "VK_E", empty2, empty2], + [0, 15, "KeyF", 36, "F", 70, "VK_F", empty2, empty2], + [0, 16, "KeyG", 37, "G", 71, "VK_G", empty2, empty2], + [0, 17, "KeyH", 38, "H", 72, "VK_H", empty2, empty2], + [0, 18, "KeyI", 39, "I", 73, "VK_I", empty2, empty2], + [0, 19, "KeyJ", 40, "J", 74, "VK_J", empty2, empty2], + [0, 20, "KeyK", 41, "K", 75, "VK_K", empty2, empty2], + [0, 21, "KeyL", 42, "L", 76, "VK_L", empty2, empty2], + [0, 22, "KeyM", 43, "M", 77, "VK_M", empty2, empty2], + [0, 23, "KeyN", 44, "N", 78, "VK_N", empty2, empty2], + [0, 24, "KeyO", 45, "O", 79, "VK_O", empty2, empty2], + [0, 25, "KeyP", 46, "P", 80, "VK_P", empty2, empty2], + [0, 26, "KeyQ", 47, "Q", 81, "VK_Q", empty2, empty2], + [0, 27, "KeyR", 48, "R", 82, "VK_R", empty2, empty2], + [0, 28, "KeyS", 49, "S", 83, "VK_S", empty2, empty2], + [0, 29, "KeyT", 50, "T", 84, "VK_T", empty2, empty2], + [0, 30, "KeyU", 51, "U", 85, "VK_U", empty2, empty2], + [0, 31, "KeyV", 52, "V", 86, "VK_V", empty2, empty2], + [0, 32, "KeyW", 53, "W", 87, "VK_W", empty2, empty2], + [0, 33, "KeyX", 54, "X", 88, "VK_X", empty2, empty2], + [0, 34, "KeyY", 55, "Y", 89, "VK_Y", empty2, empty2], + [0, 35, "KeyZ", 56, "Z", 90, "VK_Z", empty2, empty2], + [0, 36, "Digit1", 22, "1", 49, "VK_1", empty2, empty2], + [0, 37, "Digit2", 23, "2", 50, "VK_2", empty2, empty2], + [0, 38, "Digit3", 24, "3", 51, "VK_3", empty2, empty2], + [0, 39, "Digit4", 25, "4", 52, "VK_4", empty2, empty2], + [0, 40, "Digit5", 26, "5", 53, "VK_5", empty2, empty2], + [0, 41, "Digit6", 27, "6", 54, "VK_6", empty2, empty2], + [0, 42, "Digit7", 28, "7", 55, "VK_7", empty2, empty2], + [0, 43, "Digit8", 29, "8", 56, "VK_8", empty2, empty2], + [0, 44, "Digit9", 30, "9", 57, "VK_9", empty2, empty2], + [0, 45, "Digit0", 21, "0", 48, "VK_0", empty2, empty2], + [1, 46, "Enter", 3, "Enter", 13, "VK_RETURN", empty2, empty2], + [1, 47, "Escape", 9, "Escape", 27, "VK_ESCAPE", empty2, empty2], + [1, 48, "Backspace", 1, "Backspace", 8, "VK_BACK", empty2, empty2], + [1, 49, "Tab", 2, "Tab", 9, "VK_TAB", empty2, empty2], + [1, 50, "Space", 10, "Space", 32, "VK_SPACE", empty2, empty2], + [0, 51, "Minus", 88, "-", 189, "VK_OEM_MINUS", "-", "OEM_MINUS"], + [0, 52, "Equal", 86, "=", 187, "VK_OEM_PLUS", "=", "OEM_PLUS"], + [0, 53, "BracketLeft", 92, "[", 219, "VK_OEM_4", "[", "OEM_4"], + [0, 54, "BracketRight", 94, "]", 221, "VK_OEM_6", "]", "OEM_6"], + [0, 55, "Backslash", 93, "\\", 220, "VK_OEM_5", "\\", "OEM_5"], + [0, 56, "IntlHash", 0, empty2, 0, empty2, empty2, empty2], + // has been dropped from the w3c spec + [0, 57, "Semicolon", 85, ";", 186, "VK_OEM_1", ";", "OEM_1"], + [0, 58, "Quote", 95, "'", 222, "VK_OEM_7", "'", "OEM_7"], + [0, 59, "Backquote", 91, "`", 192, "VK_OEM_3", "`", "OEM_3"], + [0, 60, "Comma", 87, ",", 188, "VK_OEM_COMMA", ",", "OEM_COMMA"], + [0, 61, "Period", 89, ".", 190, "VK_OEM_PERIOD", ".", "OEM_PERIOD"], + [0, 62, "Slash", 90, "/", 191, "VK_OEM_2", "/", "OEM_2"], + [1, 63, "CapsLock", 8, "CapsLock", 20, "VK_CAPITAL", empty2, empty2], + [1, 64, "F1", 59, "F1", 112, "VK_F1", empty2, empty2], + [1, 65, "F2", 60, "F2", 113, "VK_F2", empty2, empty2], + [1, 66, "F3", 61, "F3", 114, "VK_F3", empty2, empty2], + [1, 67, "F4", 62, "F4", 115, "VK_F4", empty2, empty2], + [1, 68, "F5", 63, "F5", 116, "VK_F5", empty2, empty2], + [1, 69, "F6", 64, "F6", 117, "VK_F6", empty2, empty2], + [1, 70, "F7", 65, "F7", 118, "VK_F7", empty2, empty2], + [1, 71, "F8", 66, "F8", 119, "VK_F8", empty2, empty2], + [1, 72, "F9", 67, "F9", 120, "VK_F9", empty2, empty2], + [1, 73, "F10", 68, "F10", 121, "VK_F10", empty2, empty2], + [1, 74, "F11", 69, "F11", 122, "VK_F11", empty2, empty2], + [1, 75, "F12", 70, "F12", 123, "VK_F12", empty2, empty2], + [1, 76, "PrintScreen", 0, empty2, 0, empty2, empty2, empty2], + [1, 77, "ScrollLock", 84, "ScrollLock", 145, "VK_SCROLL", empty2, empty2], + [1, 78, "Pause", 7, "PauseBreak", 19, "VK_PAUSE", empty2, empty2], + [1, 79, "Insert", 19, "Insert", 45, "VK_INSERT", empty2, empty2], + [1, 80, "Home", 14, "Home", 36, "VK_HOME", empty2, empty2], + [1, 81, "PageUp", 11, "PageUp", 33, "VK_PRIOR", empty2, empty2], + [1, 82, "Delete", 20, "Delete", 46, "VK_DELETE", empty2, empty2], + [1, 83, "End", 13, "End", 35, "VK_END", empty2, empty2], + [1, 84, "PageDown", 12, "PageDown", 34, "VK_NEXT", empty2, empty2], + [1, 85, "ArrowRight", 17, "RightArrow", 39, "VK_RIGHT", "Right", empty2], + [1, 86, "ArrowLeft", 15, "LeftArrow", 37, "VK_LEFT", "Left", empty2], + [1, 87, "ArrowDown", 18, "DownArrow", 40, "VK_DOWN", "Down", empty2], + [1, 88, "ArrowUp", 16, "UpArrow", 38, "VK_UP", "Up", empty2], + [1, 89, "NumLock", 83, "NumLock", 144, "VK_NUMLOCK", empty2, empty2], + [1, 90, "NumpadDivide", 113, "NumPad_Divide", 111, "VK_DIVIDE", empty2, empty2], + [1, 91, "NumpadMultiply", 108, "NumPad_Multiply", 106, "VK_MULTIPLY", empty2, empty2], + [1, 92, "NumpadSubtract", 111, "NumPad_Subtract", 109, "VK_SUBTRACT", empty2, empty2], + [1, 93, "NumpadAdd", 109, "NumPad_Add", 107, "VK_ADD", empty2, empty2], + [1, 94, "NumpadEnter", 3, empty2, 0, empty2, empty2, empty2], + [1, 95, "Numpad1", 99, "NumPad1", 97, "VK_NUMPAD1", empty2, empty2], + [1, 96, "Numpad2", 100, "NumPad2", 98, "VK_NUMPAD2", empty2, empty2], + [1, 97, "Numpad3", 101, "NumPad3", 99, "VK_NUMPAD3", empty2, empty2], + [1, 98, "Numpad4", 102, "NumPad4", 100, "VK_NUMPAD4", empty2, empty2], + [1, 99, "Numpad5", 103, "NumPad5", 101, "VK_NUMPAD5", empty2, empty2], + [1, 100, "Numpad6", 104, "NumPad6", 102, "VK_NUMPAD6", empty2, empty2], + [1, 101, "Numpad7", 105, "NumPad7", 103, "VK_NUMPAD7", empty2, empty2], + [1, 102, "Numpad8", 106, "NumPad8", 104, "VK_NUMPAD8", empty2, empty2], + [1, 103, "Numpad9", 107, "NumPad9", 105, "VK_NUMPAD9", empty2, empty2], + [1, 104, "Numpad0", 98, "NumPad0", 96, "VK_NUMPAD0", empty2, empty2], + [1, 105, "NumpadDecimal", 112, "NumPad_Decimal", 110, "VK_DECIMAL", empty2, empty2], + [0, 106, "IntlBackslash", 97, "OEM_102", 226, "VK_OEM_102", empty2, empty2], + [1, 107, "ContextMenu", 58, "ContextMenu", 93, empty2, empty2, empty2], + [1, 108, "Power", 0, empty2, 0, empty2, empty2, empty2], + [1, 109, "NumpadEqual", 0, empty2, 0, empty2, empty2, empty2], + [1, 110, "F13", 71, "F13", 124, "VK_F13", empty2, empty2], + [1, 111, "F14", 72, "F14", 125, "VK_F14", empty2, empty2], + [1, 112, "F15", 73, "F15", 126, "VK_F15", empty2, empty2], + [1, 113, "F16", 74, "F16", 127, "VK_F16", empty2, empty2], + [1, 114, "F17", 75, "F17", 128, "VK_F17", empty2, empty2], + [1, 115, "F18", 76, "F18", 129, "VK_F18", empty2, empty2], + [1, 116, "F19", 77, "F19", 130, "VK_F19", empty2, empty2], + [1, 117, "F20", 78, "F20", 131, "VK_F20", empty2, empty2], + [1, 118, "F21", 79, "F21", 132, "VK_F21", empty2, empty2], + [1, 119, "F22", 80, "F22", 133, "VK_F22", empty2, empty2], + [1, 120, "F23", 81, "F23", 134, "VK_F23", empty2, empty2], + [1, 121, "F24", 82, "F24", 135, "VK_F24", empty2, empty2], + [1, 122, "Open", 0, empty2, 0, empty2, empty2, empty2], + [1, 123, "Help", 0, empty2, 0, empty2, empty2, empty2], + [1, 124, "Select", 0, empty2, 0, empty2, empty2, empty2], + [1, 125, "Again", 0, empty2, 0, empty2, empty2, empty2], + [1, 126, "Undo", 0, empty2, 0, empty2, empty2, empty2], + [1, 127, "Cut", 0, empty2, 0, empty2, empty2, empty2], + [1, 128, "Copy", 0, empty2, 0, empty2, empty2, empty2], + [1, 129, "Paste", 0, empty2, 0, empty2, empty2, empty2], + [1, 130, "Find", 0, empty2, 0, empty2, empty2, empty2], + [1, 131, "AudioVolumeMute", 117, "AudioVolumeMute", 173, "VK_VOLUME_MUTE", empty2, empty2], + [1, 132, "AudioVolumeUp", 118, "AudioVolumeUp", 175, "VK_VOLUME_UP", empty2, empty2], + [1, 133, "AudioVolumeDown", 119, "AudioVolumeDown", 174, "VK_VOLUME_DOWN", empty2, empty2], + [1, 134, "NumpadComma", 110, "NumPad_Separator", 108, "VK_SEPARATOR", empty2, empty2], + [0, 135, "IntlRo", 115, "ABNT_C1", 193, "VK_ABNT_C1", empty2, empty2], + [1, 136, "KanaMode", 0, empty2, 0, empty2, empty2, empty2], + [0, 137, "IntlYen", 0, empty2, 0, empty2, empty2, empty2], + [1, 138, "Convert", 0, empty2, 0, empty2, empty2, empty2], + [1, 139, "NonConvert", 0, empty2, 0, empty2, empty2, empty2], + [1, 140, "Lang1", 0, empty2, 0, empty2, empty2, empty2], + [1, 141, "Lang2", 0, empty2, 0, empty2, empty2, empty2], + [1, 142, "Lang3", 0, empty2, 0, empty2, empty2, empty2], + [1, 143, "Lang4", 0, empty2, 0, empty2, empty2, empty2], + [1, 144, "Lang5", 0, empty2, 0, empty2, empty2, empty2], + [1, 145, "Abort", 0, empty2, 0, empty2, empty2, empty2], + [1, 146, "Props", 0, empty2, 0, empty2, empty2, empty2], + [1, 147, "NumpadParenLeft", 0, empty2, 0, empty2, empty2, empty2], + [1, 148, "NumpadParenRight", 0, empty2, 0, empty2, empty2, empty2], + [1, 149, "NumpadBackspace", 0, empty2, 0, empty2, empty2, empty2], + [1, 150, "NumpadMemoryStore", 0, empty2, 0, empty2, empty2, empty2], + [1, 151, "NumpadMemoryRecall", 0, empty2, 0, empty2, empty2, empty2], + [1, 152, "NumpadMemoryClear", 0, empty2, 0, empty2, empty2, empty2], + [1, 153, "NumpadMemoryAdd", 0, empty2, 0, empty2, empty2, empty2], + [1, 154, "NumpadMemorySubtract", 0, empty2, 0, empty2, empty2, empty2], + [1, 155, "NumpadClear", 131, "Clear", 12, "VK_CLEAR", empty2, empty2], + [1, 156, "NumpadClearEntry", 0, empty2, 0, empty2, empty2, empty2], + [1, 0, empty2, 5, "Ctrl", 17, "VK_CONTROL", empty2, empty2], + [1, 0, empty2, 4, "Shift", 16, "VK_SHIFT", empty2, empty2], + [1, 0, empty2, 6, "Alt", 18, "VK_MENU", empty2, empty2], + [1, 0, empty2, 57, "Meta", 91, "VK_COMMAND", empty2, empty2], + [1, 157, "ControlLeft", 5, empty2, 0, "VK_LCONTROL", empty2, empty2], + [1, 158, "ShiftLeft", 4, empty2, 0, "VK_LSHIFT", empty2, empty2], + [1, 159, "AltLeft", 6, empty2, 0, "VK_LMENU", empty2, empty2], + [1, 160, "MetaLeft", 57, empty2, 0, "VK_LWIN", empty2, empty2], + [1, 161, "ControlRight", 5, empty2, 0, "VK_RCONTROL", empty2, empty2], + [1, 162, "ShiftRight", 4, empty2, 0, "VK_RSHIFT", empty2, empty2], + [1, 163, "AltRight", 6, empty2, 0, "VK_RMENU", empty2, empty2], + [1, 164, "MetaRight", 57, empty2, 0, "VK_RWIN", empty2, empty2], + [1, 165, "BrightnessUp", 0, empty2, 0, empty2, empty2, empty2], + [1, 166, "BrightnessDown", 0, empty2, 0, empty2, empty2, empty2], + [1, 167, "MediaPlay", 0, empty2, 0, empty2, empty2, empty2], + [1, 168, "MediaRecord", 0, empty2, 0, empty2, empty2, empty2], + [1, 169, "MediaFastForward", 0, empty2, 0, empty2, empty2, empty2], + [1, 170, "MediaRewind", 0, empty2, 0, empty2, empty2, empty2], + [1, 171, "MediaTrackNext", 124, "MediaTrackNext", 176, "VK_MEDIA_NEXT_TRACK", empty2, empty2], + [1, 172, "MediaTrackPrevious", 125, "MediaTrackPrevious", 177, "VK_MEDIA_PREV_TRACK", empty2, empty2], + [1, 173, "MediaStop", 126, "MediaStop", 178, "VK_MEDIA_STOP", empty2, empty2], + [1, 174, "Eject", 0, empty2, 0, empty2, empty2, empty2], + [1, 175, "MediaPlayPause", 127, "MediaPlayPause", 179, "VK_MEDIA_PLAY_PAUSE", empty2, empty2], + [1, 176, "MediaSelect", 128, "LaunchMediaPlayer", 181, "VK_MEDIA_LAUNCH_MEDIA_SELECT", empty2, empty2], + [1, 177, "LaunchMail", 129, "LaunchMail", 180, "VK_MEDIA_LAUNCH_MAIL", empty2, empty2], + [1, 178, "LaunchApp2", 130, "LaunchApp2", 183, "VK_MEDIA_LAUNCH_APP2", empty2, empty2], + [1, 179, "LaunchApp1", 0, empty2, 0, "VK_MEDIA_LAUNCH_APP1", empty2, empty2], + [1, 180, "SelectTask", 0, empty2, 0, empty2, empty2, empty2], + [1, 181, "LaunchScreenSaver", 0, empty2, 0, empty2, empty2, empty2], + [1, 182, "BrowserSearch", 120, "BrowserSearch", 170, "VK_BROWSER_SEARCH", empty2, empty2], + [1, 183, "BrowserHome", 121, "BrowserHome", 172, "VK_BROWSER_HOME", empty2, empty2], + [1, 184, "BrowserBack", 122, "BrowserBack", 166, "VK_BROWSER_BACK", empty2, empty2], + [1, 185, "BrowserForward", 123, "BrowserForward", 167, "VK_BROWSER_FORWARD", empty2, empty2], + [1, 186, "BrowserStop", 0, empty2, 0, "VK_BROWSER_STOP", empty2, empty2], + [1, 187, "BrowserRefresh", 0, empty2, 0, "VK_BROWSER_REFRESH", empty2, empty2], + [1, 188, "BrowserFavorites", 0, empty2, 0, "VK_BROWSER_FAVORITES", empty2, empty2], + [1, 189, "ZoomToggle", 0, empty2, 0, empty2, empty2, empty2], + [1, 190, "MailReply", 0, empty2, 0, empty2, empty2, empty2], + [1, 191, "MailForward", 0, empty2, 0, empty2, empty2, empty2], + [1, 192, "MailSend", 0, empty2, 0, empty2, empty2, empty2], + // See https://lists.w3.org/Archives/Public/www-dom/2010JulSep/att-0182/keyCode-spec.html + // If an Input Method Editor is processing key input and the event is keydown, return 229. + [1, 0, empty2, 114, "KeyInComposition", 229, empty2, empty2, empty2], + [1, 0, empty2, 116, "ABNT_C2", 194, "VK_ABNT_C2", empty2, empty2], + [1, 0, empty2, 96, "OEM_8", 223, "VK_OEM_8", empty2, empty2], + [1, 0, empty2, 0, empty2, 0, "VK_KANA", empty2, empty2], + [1, 0, empty2, 0, empty2, 0, "VK_HANGUL", empty2, empty2], + [1, 0, empty2, 0, empty2, 0, "VK_JUNJA", empty2, empty2], + [1, 0, empty2, 0, empty2, 0, "VK_FINAL", empty2, empty2], + [1, 0, empty2, 0, empty2, 0, "VK_HANJA", empty2, empty2], + [1, 0, empty2, 0, empty2, 0, "VK_KANJI", empty2, empty2], + [1, 0, empty2, 0, empty2, 0, "VK_CONVERT", empty2, empty2], + [1, 0, empty2, 0, empty2, 0, "VK_NONCONVERT", empty2, empty2], + [1, 0, empty2, 0, empty2, 0, "VK_ACCEPT", empty2, empty2], + [1, 0, empty2, 0, empty2, 0, "VK_MODECHANGE", empty2, empty2], + [1, 0, empty2, 0, empty2, 0, "VK_SELECT", empty2, empty2], + [1, 0, empty2, 0, empty2, 0, "VK_PRINT", empty2, empty2], + [1, 0, empty2, 0, empty2, 0, "VK_EXECUTE", empty2, empty2], + [1, 0, empty2, 0, empty2, 0, "VK_SNAPSHOT", empty2, empty2], + [1, 0, empty2, 0, empty2, 0, "VK_HELP", empty2, empty2], + [1, 0, empty2, 0, empty2, 0, "VK_APPS", empty2, empty2], + [1, 0, empty2, 0, empty2, 0, "VK_PROCESSKEY", empty2, empty2], + [1, 0, empty2, 0, empty2, 0, "VK_PACKET", empty2, empty2], + [1, 0, empty2, 0, empty2, 0, "VK_DBE_SBCSCHAR", empty2, empty2], + [1, 0, empty2, 0, empty2, 0, "VK_DBE_DBCSCHAR", empty2, empty2], + [1, 0, empty2, 0, empty2, 0, "VK_ATTN", empty2, empty2], + [1, 0, empty2, 0, empty2, 0, "VK_CRSEL", empty2, empty2], + [1, 0, empty2, 0, empty2, 0, "VK_EXSEL", empty2, empty2], + [1, 0, empty2, 0, empty2, 0, "VK_EREOF", empty2, empty2], + [1, 0, empty2, 0, empty2, 0, "VK_PLAY", empty2, empty2], + [1, 0, empty2, 0, empty2, 0, "VK_ZOOM", empty2, empty2], + [1, 0, empty2, 0, empty2, 0, "VK_NONAME", empty2, empty2], + [1, 0, empty2, 0, empty2, 0, "VK_PA1", empty2, empty2], + [1, 0, empty2, 0, empty2, 0, "VK_OEM_CLEAR", empty2, empty2] + ]; + const seenKeyCode = []; + const seenScanCode = []; + for (const mapping of mappings) { + const [immutable, scanCode, scanCodeStr, keyCode, keyCodeStr, eventKeyCode, vkey, usUserSettingsLabel, generalUserSettingsLabel] = mapping; + if (!seenScanCode[scanCode]) { + seenScanCode[scanCode] = true; + scanCodeIntToStr[scanCode] = scanCodeStr; + scanCodeStrToInt[scanCodeStr] = scanCode; + scanCodeLowerCaseStrToInt[scanCodeStr.toLowerCase()] = scanCode; + if (immutable) { + IMMUTABLE_CODE_TO_KEY_CODE[scanCode] = keyCode; + if (keyCode !== 0 && keyCode !== 3 && keyCode !== 5 && keyCode !== 4 && keyCode !== 6 && keyCode !== 57) { + IMMUTABLE_KEY_CODE_TO_CODE[keyCode] = scanCode; + } + } + } + if (!seenKeyCode[keyCode]) { + seenKeyCode[keyCode] = true; + if (!keyCodeStr) { + throw new Error(`String representation missing for key code ${keyCode} around scan code ${scanCodeStr}`); + } + uiMap.define(keyCode, keyCodeStr); + userSettingsUSMap.define(keyCode, usUserSettingsLabel || keyCodeStr); + userSettingsGeneralMap.define(keyCode, generalUserSettingsLabel || usUserSettingsLabel || keyCodeStr); + } + if (eventKeyCode) { + EVENT_KEY_CODE_MAP[eventKeyCode] = keyCode; + } + if (vkey) { + NATIVE_WINDOWS_KEY_CODE_TO_KEY_CODE[vkey] = keyCode; + } + } + IMMUTABLE_KEY_CODE_TO_CODE[ + 3 + /* KeyCode.Enter */ + ] = 46; + })(); + (function(KeyCodeUtils2) { + function toString(keyCode) { + return uiMap.keyCodeToStr(keyCode); + } + KeyCodeUtils2.toString = toString; + function fromString(key) { + return uiMap.strToKeyCode(key); + } + KeyCodeUtils2.fromString = fromString; + function toUserSettingsUS(keyCode) { + return userSettingsUSMap.keyCodeToStr(keyCode); + } + KeyCodeUtils2.toUserSettingsUS = toUserSettingsUS; + function toUserSettingsGeneral(keyCode) { + return userSettingsGeneralMap.keyCodeToStr(keyCode); + } + KeyCodeUtils2.toUserSettingsGeneral = toUserSettingsGeneral; + function fromUserSettings(key) { + return userSettingsUSMap.strToKeyCode(key) || userSettingsGeneralMap.strToKeyCode(key); + } + KeyCodeUtils2.fromUserSettings = fromUserSettings; + function toElectronAccelerator(keyCode) { + if (keyCode >= 98 && keyCode <= 113) { + return null; + } + switch (keyCode) { + case 16: + return "Up"; + case 18: + return "Down"; + case 15: + return "Left"; + case 17: + return "Right"; + } + return uiMap.keyCodeToStr(keyCode); + } + KeyCodeUtils2.toElectronAccelerator = toElectronAccelerator; + })(KeyCodeUtils || (KeyCodeUtils = {})); + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/common/keybindings.js +function decodeKeybinding(keybinding, OS2) { + if (typeof keybinding === "number") { + if (keybinding === 0) { + return null; + } + const firstChord = (keybinding & 65535) >>> 0; + const secondChord = (keybinding & 4294901760) >>> 16; + if (secondChord !== 0) { + return new Keybinding([ + createSimpleKeybinding(firstChord, OS2), + createSimpleKeybinding(secondChord, OS2) + ]); + } + return new Keybinding([createSimpleKeybinding(firstChord, OS2)]); + } else { + const chords = []; + for (let i2 = 0; i2 < keybinding.length; i2++) { + chords.push(createSimpleKeybinding(keybinding[i2], OS2)); + } + return new Keybinding(chords); + } +} +function createSimpleKeybinding(keybinding, OS2) { + const ctrlCmd = keybinding & 2048 ? true : false; + const winCtrl = keybinding & 256 ? true : false; + const ctrlKey = OS2 === 2 ? winCtrl : ctrlCmd; + const shiftKey = keybinding & 1024 ? true : false; + const altKey = keybinding & 512 ? true : false; + const metaKey = OS2 === 2 ? ctrlCmd : winCtrl; + const keyCode = keybinding & 255; + return new KeyCodeChord(ctrlKey, shiftKey, altKey, metaKey, keyCode); +} +var KeyCodeChord, Keybinding, ResolvedChord, ResolvedKeybinding; +var init_keybindings = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/common/keybindings.js"() { + init_errors(); + KeyCodeChord = class _KeyCodeChord { + constructor(ctrlKey, shiftKey, altKey, metaKey, keyCode) { + this.ctrlKey = ctrlKey; + this.shiftKey = shiftKey; + this.altKey = altKey; + this.metaKey = metaKey; + this.keyCode = keyCode; + } + equals(other) { + return other instanceof _KeyCodeChord && this.ctrlKey === other.ctrlKey && this.shiftKey === other.shiftKey && this.altKey === other.altKey && this.metaKey === other.metaKey && this.keyCode === other.keyCode; + } + isModifierKey() { + return this.keyCode === 0 || this.keyCode === 5 || this.keyCode === 57 || this.keyCode === 6 || this.keyCode === 4; + } + /** + * Does this keybinding refer to the key code of a modifier and it also has the modifier flag? + */ + isDuplicateModifierCase() { + return this.ctrlKey && this.keyCode === 5 || this.shiftKey && this.keyCode === 4 || this.altKey && this.keyCode === 6 || this.metaKey && this.keyCode === 57; + } + }; + Keybinding = class { + constructor(chords) { + if (chords.length === 0) { + throw illegalArgument(`chords`); + } + this.chords = chords; + } + }; + ResolvedChord = class { + constructor(ctrlKey, shiftKey, altKey, metaKey, keyLabel, keyAriaLabel) { + this.ctrlKey = ctrlKey; + this.shiftKey = shiftKey; + this.altKey = altKey; + this.metaKey = metaKey; + this.keyLabel = keyLabel; + this.keyAriaLabel = keyAriaLabel; + } + }; + ResolvedKeybinding = class { + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/browser/keyboardEvent.js +function extractKeyCode(e) { + if (e.charCode) { + const char = String.fromCharCode(e.charCode).toUpperCase(); + return KeyCodeUtils.fromString(char); + } + const keyCode = e.keyCode; + if (keyCode === 3) { + return 7; + } else if (isFirefox) { + switch (keyCode) { + case 59: + return 85; + case 60: + if (isLinux) { + return 97; + } + break; + case 61: + return 86; + // based on: https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode#numpad_keys + case 107: + return 109; + case 109: + return 111; + case 173: + return 88; + case 224: + if (isMacintosh) { + return 57; + } + break; + } + } else if (isWebKit) { + if (isMacintosh && keyCode === 93) { + return 57; + } else if (!isMacintosh && keyCode === 92) { + return 57; + } + } + return EVENT_KEY_CODE_MAP[keyCode] || 0; +} +var ctrlKeyMod, altKeyMod, shiftKeyMod, metaKeyMod, StandardKeyboardEvent; +var init_keyboardEvent = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/browser/keyboardEvent.js"() { + init_browser(); + init_keyCodes(); + init_keybindings(); + init_platform(); + ctrlKeyMod = isMacintosh ? 256 : 2048; + altKeyMod = 512; + shiftKeyMod = 1024; + metaKeyMod = isMacintosh ? 2048 : 256; + StandardKeyboardEvent = class { + constructor(source) { + this._standardKeyboardEventBrand = true; + const e = source; + this.browserEvent = e; + this.target = e.target; + this.ctrlKey = e.ctrlKey; + this.shiftKey = e.shiftKey; + this.altKey = e.altKey; + this.metaKey = e.metaKey; + this.altGraphKey = e.getModifierState?.("AltGraph"); + this.keyCode = extractKeyCode(e); + this.code = e.code; + this.ctrlKey = this.ctrlKey || this.keyCode === 5; + this.altKey = this.altKey || this.keyCode === 6; + this.shiftKey = this.shiftKey || this.keyCode === 4; + this.metaKey = this.metaKey || this.keyCode === 57; + this._asKeybinding = this._computeKeybinding(); + this._asKeyCodeChord = this._computeKeyCodeChord(); + } + preventDefault() { + if (this.browserEvent && this.browserEvent.preventDefault) { + this.browserEvent.preventDefault(); + } + } + stopPropagation() { + if (this.browserEvent && this.browserEvent.stopPropagation) { + this.browserEvent.stopPropagation(); + } + } + toKeyCodeChord() { + return this._asKeyCodeChord; + } + equals(other) { + return this._asKeybinding === other; + } + _computeKeybinding() { + let key = 0; + if (this.keyCode !== 5 && this.keyCode !== 4 && this.keyCode !== 6 && this.keyCode !== 57) { + key = this.keyCode; + } + let result = 0; + if (this.ctrlKey) { + result |= ctrlKeyMod; + } + if (this.altKey) { + result |= altKeyMod; + } + if (this.shiftKey) { + result |= shiftKeyMod; + } + if (this.metaKey) { + result |= metaKeyMod; + } + result |= key; + return result; + } + _computeKeyCodeChord() { + let key = 0; + if (this.keyCode !== 5 && this.keyCode !== 4 && this.keyCode !== 6 && this.keyCode !== 57) { + key = this.keyCode; + } + return new KeyCodeChord(this.ctrlKey, this.shiftKey, this.altKey, this.metaKey, key); + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/browser/iframe.js +function getParentWindowIfSameOrigin(w) { + if (!w.parent || w.parent === w) { + return null; + } + try { + const location2 = w.location; + const parentLocation = w.parent.location; + if (location2.origin !== "null" && parentLocation.origin !== "null" && location2.origin !== parentLocation.origin) { + return null; + } + } catch (e) { + return null; + } + return w.parent; +} +var sameOriginWindowChainCache, IframeUtils; +var init_iframe = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/browser/iframe.js"() { + sameOriginWindowChainCache = /* @__PURE__ */ new WeakMap(); + IframeUtils = class { + /** + * Returns a chain of embedded windows with the same origin (which can be accessed programmatically). + * Having a chain of length 1 might mean that the current execution environment is running outside of an iframe or inside an iframe embedded in a window with a different origin. + */ + static getSameOriginWindowChain(targetWindow) { + let windowChainCache = sameOriginWindowChainCache.get(targetWindow); + if (!windowChainCache) { + windowChainCache = []; + sameOriginWindowChainCache.set(targetWindow, windowChainCache); + let w = targetWindow; + let parent; + do { + parent = getParentWindowIfSameOrigin(w); + if (parent) { + windowChainCache.push({ + window: new WeakRef(w), + iframeElement: w.frameElement || null + }); + } else { + windowChainCache.push({ + window: new WeakRef(w), + iframeElement: null + }); + } + w = parent; + } while (w); + } + return windowChainCache.slice(0); + } + /** + * Returns the position of `childWindow` relative to `ancestorWindow` + */ + static getPositionOfChildWindowRelativeToAncestorWindow(childWindow, ancestorWindow) { + if (!ancestorWindow || childWindow === ancestorWindow) { + return { + top: 0, + left: 0 + }; + } + let top = 0, left = 0; + const windowChain = this.getSameOriginWindowChain(childWindow); + for (const windowChainEl of windowChain) { + const windowInChain = windowChainEl.window.deref(); + top += windowInChain?.scrollY ?? 0; + left += windowInChain?.scrollX ?? 0; + if (windowInChain === ancestorWindow) { + break; + } + if (!windowChainEl.iframeElement) { + break; + } + const boundingRect = windowChainEl.iframeElement.getBoundingClientRect(); + top += boundingRect.top; + left += boundingRect.left; + } + return { + top, + left + }; + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/browser/mouseEvent.js +var StandardMouseEvent, StandardWheelEvent; +var init_mouseEvent = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/browser/mouseEvent.js"() { + init_browser(); + init_iframe(); + init_platform(); + StandardMouseEvent = class { + constructor(targetWindow, e) { + this.timestamp = Date.now(); + this.browserEvent = e; + this.leftButton = e.button === 0; + this.middleButton = e.button === 1; + this.rightButton = e.button === 2; + this.buttons = e.buttons; + this.defaultPrevented = e.defaultPrevented; + this.target = e.target; + this.detail = e.detail || 1; + if (e.type === "dblclick") { + this.detail = 2; + } + this.ctrlKey = e.ctrlKey; + this.shiftKey = e.shiftKey; + this.altKey = e.altKey; + this.metaKey = e.metaKey; + if (typeof e.pageX === "number") { + this.posx = e.pageX; + this.posy = e.pageY; + } else { + this.posx = e.clientX + this.target.ownerDocument.body.scrollLeft + this.target.ownerDocument.documentElement.scrollLeft; + this.posy = e.clientY + this.target.ownerDocument.body.scrollTop + this.target.ownerDocument.documentElement.scrollTop; + } + const iframeOffsets = IframeUtils.getPositionOfChildWindowRelativeToAncestorWindow(targetWindow, e.view); + this.posx -= iframeOffsets.left; + this.posy -= iframeOffsets.top; + } + preventDefault() { + this.browserEvent.preventDefault(); + } + stopPropagation() { + this.browserEvent.stopPropagation(); + } + }; + StandardWheelEvent = class { + constructor(e, deltaX = 0, deltaY = 0) { + this.browserEvent = e || null; + this.target = e ? e.target || e.targetNode || e.srcElement : null; + this.deltaY = deltaY; + this.deltaX = deltaX; + let shouldFactorDPR = false; + if (isChrome) { + const chromeVersionMatch = navigator.userAgent.match(/Chrome\/(\d+)/); + const chromeMajorVersion = chromeVersionMatch ? parseInt(chromeVersionMatch[1]) : 123; + shouldFactorDPR = chromeMajorVersion <= 122; + } + if (e) { + const e1 = e; + const e2 = e; + const devicePixelRatio = e.view?.devicePixelRatio || 1; + if (typeof e1.wheelDeltaY !== "undefined") { + if (shouldFactorDPR) { + this.deltaY = e1.wheelDeltaY / (120 * devicePixelRatio); + } else { + this.deltaY = e1.wheelDeltaY / 120; + } + } else if (typeof e2.VERTICAL_AXIS !== "undefined" && e2.axis === e2.VERTICAL_AXIS) { + this.deltaY = -e2.detail / 3; + } else if (e.type === "wheel") { + const ev = e; + if (ev.deltaMode === ev.DOM_DELTA_LINE) { + if (isFirefox && !isMacintosh) { + this.deltaY = -e.deltaY / 3; + } else { + this.deltaY = -e.deltaY; + } + } else { + this.deltaY = -e.deltaY / 40; + } + } + if (typeof e1.wheelDeltaX !== "undefined") { + if (isSafari && isWindows) { + this.deltaX = -(e1.wheelDeltaX / 120); + } else if (shouldFactorDPR) { + this.deltaX = e1.wheelDeltaX / (120 * devicePixelRatio); + } else { + this.deltaX = e1.wheelDeltaX / 120; + } + } else if (typeof e2.HORIZONTAL_AXIS !== "undefined" && e2.axis === e2.HORIZONTAL_AXIS) { + this.deltaX = -e.detail / 3; + } else if (e.type === "wheel") { + const ev = e; + if (ev.deltaMode === ev.DOM_DELTA_LINE) { + if (isFirefox && !isMacintosh) { + this.deltaX = -e.deltaX / 3; + } else { + this.deltaX = -e.deltaX; + } + } else { + this.deltaX = -e.deltaX / 40; + } + } + if (this.deltaY === 0 && this.deltaX === 0 && e.wheelDelta) { + if (shouldFactorDPR) { + this.deltaY = e.wheelDelta / (120 * devicePixelRatio); + } else { + this.deltaY = e.wheelDelta / 120; + } + } + } + } + preventDefault() { + this.browserEvent?.preventDefault(); + } + stopPropagation() { + this.browserEvent?.stopPropagation(); + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/common/functional.js +function createSingleCallFunction(fn, fnDidRunCallback) { + const _this = this; + let didCall = false; + let result; + return function() { + if (didCall) { + return result; + } + didCall = true; + if (fnDidRunCallback) { + try { + result = fn.apply(_this, arguments); + } finally { + fnDidRunCallback(); + } + } else { + result = fn.apply(_this, arguments); + } + return result; + }; +} +var init_functional = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/common/functional.js"() { + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/common/iterator.js +var Iterable; +var init_iterator = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/common/iterator.js"() { + init_types(); + (function(Iterable2) { + function is(thing) { + return !!thing && typeof thing === "object" && typeof thing[Symbol.iterator] === "function"; + } + Iterable2.is = is; + const _empty2 = Object.freeze([]); + function empty2() { + return _empty2; + } + Iterable2.empty = empty2; + function* single(element) { + yield element; + } + Iterable2.single = single; + function wrap(iterableOrElement) { + if (is(iterableOrElement)) { + return iterableOrElement; + } else { + return single(iterableOrElement); + } + } + Iterable2.wrap = wrap; + function from(iterable) { + return iterable || _empty2; + } + Iterable2.from = from; + function* reverse(array2) { + for (let i2 = array2.length - 1; i2 >= 0; i2--) { + yield array2[i2]; + } + } + Iterable2.reverse = reverse; + function isEmpty(iterable) { + return !iterable || iterable[Symbol.iterator]().next().done === true; + } + Iterable2.isEmpty = isEmpty; + function first2(iterable) { + return iterable[Symbol.iterator]().next().value; + } + Iterable2.first = first2; + function some(iterable, predicate) { + let i2 = 0; + for (const element of iterable) { + if (predicate(element, i2++)) { + return true; + } + } + return false; + } + Iterable2.some = some; + function every(iterable, predicate) { + let i2 = 0; + for (const element of iterable) { + if (!predicate(element, i2++)) { + return false; + } + } + return true; + } + Iterable2.every = every; + function find(iterable, predicate) { + for (const element of iterable) { + if (predicate(element)) { + return element; + } + } + return void 0; + } + Iterable2.find = find; + function* filter(iterable, predicate) { + for (const element of iterable) { + if (predicate(element)) { + yield element; + } + } + } + Iterable2.filter = filter; + function* map(iterable, fn) { + let index = 0; + for (const element of iterable) { + yield fn(element, index++); + } + } + Iterable2.map = map; + function* flatMap(iterable, fn) { + let index = 0; + for (const element of iterable) { + yield* fn(element, index++); + } + } + Iterable2.flatMap = flatMap; + function* concat4(...iterables) { + for (const item of iterables) { + if (isIterable(item)) { + yield* item; + } else { + yield item; + } + } + } + Iterable2.concat = concat4; + function reduce(iterable, reducer, initialValue) { + let value = initialValue; + for (const element of iterable) { + value = reducer(value, element); + } + return value; + } + Iterable2.reduce = reduce; + function length(iterable) { + let count = 0; + for (const _ of iterable) { + count++; + } + return count; + } + Iterable2.length = length; + function* slice(arr, from2, to = arr.length) { + if (from2 < -arr.length) { + from2 = 0; + } + if (from2 < 0) { + from2 += arr.length; + } + if (to < 0) { + to += arr.length; + } else if (to > arr.length) { + to = arr.length; + } + for (; from2 < to; from2++) { + yield arr[from2]; + } + } + Iterable2.slice = slice; + function consume(iterable, atMost = Number.POSITIVE_INFINITY) { + const consumed = []; + if (atMost === 0) { + return [consumed, iterable]; + } + const iterator = iterable[Symbol.iterator](); + for (let i2 = 0; i2 < atMost; i2++) { + const next = iterator.next(); + if (next.done) { + return [consumed, Iterable2.empty()]; + } + consumed.push(next.value); + } + return [consumed, { [Symbol.iterator]() { + return iterator; + } }]; + } + Iterable2.consume = consume; + async function asyncToArray(iterable) { + const result = []; + for await (const item of iterable) { + result.push(item); + } + return result; + } + Iterable2.asyncToArray = asyncToArray; + async function asyncToArrayFlat(iterable) { + let result = []; + for await (const item of iterable) { + result = result.concat(item); + } + return result; + } + Iterable2.asyncToArrayFlat = asyncToArrayFlat; + })(Iterable || (Iterable = {})); + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/common/lifecycle.js +function setDisposableTracker(tracker) { + disposableTracker = tracker; +} +function trackDisposable(x) { + disposableTracker?.trackDisposable(x); + return x; +} +function markAsDisposed(disposable) { + disposableTracker?.markAsDisposed(disposable); +} +function setParentOfDisposable(child, parent) { + disposableTracker?.setParent(child, parent); +} +function setParentOfDisposables(children, parent) { + if (!disposableTracker) { + return; + } + for (const child of children) { + disposableTracker.setParent(child, parent); + } +} +function markAsSingleton(singleton) { + disposableTracker?.markAsSingleton(singleton); + return singleton; +} +function isDisposable(thing) { + return typeof thing === "object" && thing !== null && typeof thing.dispose === "function" && thing.dispose.length === 0; +} +function dispose(arg) { + if (Iterable.is(arg)) { + const errors = []; + for (const d of arg) { + if (d) { + try { + d.dispose(); + } catch (e) { + errors.push(e); + } + } + } + if (errors.length === 1) { + throw errors[0]; + } else if (errors.length > 1) { + throw new AggregateError(errors, "Encountered errors while disposing of store"); + } + return Array.isArray(arg) ? [] : arg; + } else if (arg) { + arg.dispose(); + return arg; + } +} +function combinedDisposable(...disposables) { + const parent = toDisposable(() => dispose(disposables)); + setParentOfDisposables(disposables, parent); + return parent; +} +function toDisposable(fn) { + return new FunctionDisposable(fn); +} +var TRACK_DISPOSABLES, disposableTracker, FunctionDisposable, DisposableStore, Disposable, MutableDisposable, RefCountedDisposable, ImmortalReference, DisposableMap; +var init_lifecycle = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/common/lifecycle.js"() { + init_iterator(); + TRACK_DISPOSABLES = false; + disposableTracker = null; + if (TRACK_DISPOSABLES) { + const __is_disposable_tracked__ = "__is_disposable_tracked__"; + setDisposableTracker(new class { + trackDisposable(x) { + const stack = new Error("Potentially leaked disposable").stack; + setTimeout(() => { + if (!x[__is_disposable_tracked__]) { + console.log(stack); + } + }, 3e3); + } + setParent(child, parent) { + if (child && child !== Disposable.None) { + try { + child[__is_disposable_tracked__] = true; + } catch { + } + } + } + markAsDisposed(disposable) { + if (disposable && disposable !== Disposable.None) { + try { + disposable[__is_disposable_tracked__] = true; + } catch { + } + } + } + markAsSingleton(disposable) { + } + }()); + } + FunctionDisposable = class { + constructor(fn) { + this._isDisposed = false; + this._fn = fn; + trackDisposable(this); + } + dispose() { + if (this._isDisposed) { + return; + } + if (!this._fn) { + throw new Error(`Unbound disposable context: Need to use an arrow function to preserve the value of this`); + } + this._isDisposed = true; + markAsDisposed(this); + this._fn(); + } + }; + DisposableStore = class _DisposableStore { + static { + this.DISABLE_DISPOSED_WARNING = false; + } + constructor() { + this._toDispose = /* @__PURE__ */ new Set(); + this._isDisposed = false; + trackDisposable(this); + } + /** + * Dispose of all registered disposables and mark this object as disposed. + * + * Any future disposables added to this object will be disposed of on `add`. + */ + dispose() { + if (this._isDisposed) { + return; + } + markAsDisposed(this); + this._isDisposed = true; + this.clear(); + } + /** + * @return `true` if this object has been disposed of. + */ + get isDisposed() { + return this._isDisposed; + } + /** + * Dispose of all registered disposables but do not mark this object as disposed. + */ + clear() { + if (this._toDispose.size === 0) { + return; + } + try { + dispose(this._toDispose); + } finally { + this._toDispose.clear(); + } + } + /** + * Add a new {@link IDisposable disposable} to the collection. + */ + add(o) { + if (!o || o === Disposable.None) { + return o; + } + if (o === this) { + throw new Error("Cannot register a disposable on itself!"); + } + setParentOfDisposable(o, this); + if (this._isDisposed) { + if (!_DisposableStore.DISABLE_DISPOSED_WARNING) { + console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack); + } + } else { + this._toDispose.add(o); + } + return o; + } + /** + * Deletes a disposable from store and disposes of it. This will not throw or warn and proceed to dispose the + * disposable even when the disposable is not part in the store. + */ + delete(o) { + if (!o) { + return; + } + if (o === this) { + throw new Error("Cannot dispose a disposable on itself!"); + } + this._toDispose.delete(o); + o.dispose(); + } + }; + Disposable = class { + static { + this.None = Object.freeze({ dispose() { + } }); + } + constructor() { + this._store = new DisposableStore(); + trackDisposable(this); + setParentOfDisposable(this._store, this); + } + dispose() { + markAsDisposed(this); + this._store.dispose(); + } + /** + * Adds `o` to the collection of disposables managed by this object. + */ + _register(o) { + if (o === this) { + throw new Error("Cannot register a disposable on itself!"); + } + return this._store.add(o); + } + }; + MutableDisposable = class { + constructor() { + this._isDisposed = false; + trackDisposable(this); + } + /** + * Get the currently held disposable value, or `undefined` if this MutableDisposable has been disposed + */ + get value() { + return this._isDisposed ? void 0 : this._value; + } + /** + * Set a new disposable value. + * + * Behaviour: + * - If the MutableDisposable has been disposed, the setter is a no-op. + * - If the new value is strictly equal to the current value, the setter is a no-op. + * - Otherwise the previous value (if any) is disposed and the new value is stored. + * + * Related helpers: + * - clear() resets the value to `undefined` (and disposes the previous value). + * - clearAndLeak() returns the old value without disposing it and removes its parent. + */ + set value(value) { + if (this._isDisposed || value === this._value) { + return; + } + this._value?.dispose(); + if (value) { + setParentOfDisposable(value, this); + } + this._value = value; + } + /** + * Resets the stored value and disposed of the previously stored value. + */ + clear() { + this.value = void 0; + } + dispose() { + this._isDisposed = true; + markAsDisposed(this); + this._value?.dispose(); + this._value = void 0; + } + }; + RefCountedDisposable = class { + constructor(_disposable) { + this._disposable = _disposable; + this._counter = 1; + } + acquire() { + this._counter++; + return this; + } + release() { + if (--this._counter === 0) { + this._disposable.dispose(); + } + return this; + } + }; + ImmortalReference = class { + constructor(object) { + this.object = object; + } + dispose() { + } + }; + DisposableMap = class { + constructor() { + this._store = /* @__PURE__ */ new Map(); + this._isDisposed = false; + trackDisposable(this); + } + /** + * Disposes of all stored values and mark this object as disposed. + * + * Trying to use this object after it has been disposed of is an error. + */ + dispose() { + markAsDisposed(this); + this._isDisposed = true; + this.clearAndDisposeAll(); + } + /** + * Disposes of all stored values and clear the map, but DO NOT mark this object as disposed. + */ + clearAndDisposeAll() { + if (!this._store.size) { + return; + } + try { + dispose(this._store.values()); + } finally { + this._store.clear(); + } + } + get(key) { + return this._store.get(key); + } + set(key, value, skipDisposeOnOverwrite = false) { + if (this._isDisposed) { + console.warn(new Error("Trying to add a disposable to a DisposableMap that has already been disposed of. The added object will be leaked!").stack); + } + if (!skipDisposeOnOverwrite) { + this._store.get(key)?.dispose(); + } + this._store.set(key, value); + setParentOfDisposable(value, this); + } + /** + * Delete the value stored for `key` from this map and also dispose of it. + */ + deleteAndDispose(key) { + this._store.get(key)?.dispose(); + this._store.delete(key); + } + values() { + return this._store.values(); + } + [Symbol.iterator]() { + return this._store[Symbol.iterator](); + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/common/linkedList.js +var Node2, LinkedList; +var init_linkedList = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/common/linkedList.js"() { + Node2 = class _Node { + static { + this.Undefined = new _Node(void 0); + } + constructor(element) { + this.element = element; + this.next = _Node.Undefined; + this.prev = _Node.Undefined; + } + }; + LinkedList = class { + constructor() { + this._first = Node2.Undefined; + this._last = Node2.Undefined; + this._size = 0; + } + get size() { + return this._size; + } + isEmpty() { + return this._first === Node2.Undefined; + } + clear() { + let node = this._first; + while (node !== Node2.Undefined) { + const next = node.next; + node.prev = Node2.Undefined; + node.next = Node2.Undefined; + node = next; + } + this._first = Node2.Undefined; + this._last = Node2.Undefined; + this._size = 0; + } + unshift(element) { + return this._insert(element, false); + } + push(element) { + return this._insert(element, true); + } + _insert(element, atTheEnd) { + const newNode = new Node2(element); + if (this._first === Node2.Undefined) { + this._first = newNode; + this._last = newNode; + } else if (atTheEnd) { + const oldLast = this._last; + this._last = newNode; + newNode.prev = oldLast; + oldLast.next = newNode; + } else { + const oldFirst = this._first; + this._first = newNode; + newNode.next = oldFirst; + oldFirst.prev = newNode; + } + this._size += 1; + let didRemove = false; + return () => { + if (!didRemove) { + didRemove = true; + this._remove(newNode); + } + }; + } + shift() { + if (this._first === Node2.Undefined) { + return void 0; + } else { + const res = this._first.element; + this._remove(this._first); + return res; + } + } + pop() { + if (this._last === Node2.Undefined) { + return void 0; + } else { + const res = this._last.element; + this._remove(this._last); + return res; + } + } + _remove(node) { + if (node.prev !== Node2.Undefined && node.next !== Node2.Undefined) { + const anchor = node.prev; + anchor.next = node.next; + node.next.prev = anchor; + } else if (node.prev === Node2.Undefined && node.next === Node2.Undefined) { + this._first = Node2.Undefined; + this._last = Node2.Undefined; + } else if (node.next === Node2.Undefined) { + this._last = this._last.prev; + this._last.next = Node2.Undefined; + } else if (node.prev === Node2.Undefined) { + this._first = this._first.next; + this._first.prev = Node2.Undefined; + } + this._size -= 1; + } + *[Symbol.iterator]() { + let node = this._first; + while (node !== Node2.Undefined) { + yield node.element; + node = node.next; + } + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/common/stopwatch.js +var performanceNow, StopWatch; +var init_stopwatch = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/common/stopwatch.js"() { + performanceNow = globalThis.performance.now.bind(globalThis.performance); + StopWatch = class _StopWatch { + static create(highResolution) { + return new _StopWatch(highResolution); + } + constructor(highResolution) { + this._now = highResolution === false ? Date.now : performanceNow; + this._startTime = this._now(); + this._stopTime = -1; + } + stop() { + this._stopTime = this._now(); + } + reset() { + this._startTime = this._now(); + this._stopTime = -1; + } + elapsed() { + if (this._stopTime !== -1) { + return this._stopTime - this._startTime; + } + return this._now() - this._startTime; + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/common/event.js +var _enableDisposeWithListenerWarning, _enableSnapshotPotentialLeakWarning, Event, EventProfiling, _globalLeakWarningThreshold, LeakageMonitor, Stacktrace, ListenerLeakError, ListenerRefusalError, UniqueContainer, compactionThreshold, forEachListener, Emitter, createEventDeliveryQueue, EventDeliveryQueuePrivate, PauseableEmitter, DebounceEmitter, MicrotaskEmitter, EventMultiplexer, EventBufferer, Relay; +var init_event = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/common/event.js"() { + init_errors(); + init_functional(); + init_lifecycle(); + init_linkedList(); + init_stopwatch(); + _enableDisposeWithListenerWarning = false; + _enableSnapshotPotentialLeakWarning = false; + (function(Event2) { + Event2.None = () => Disposable.None; + function _addLeakageTraceLogic(options2) { + if (_enableSnapshotPotentialLeakWarning) { + const { onDidAddListener: origListenerDidAdd } = options2; + const stack = Stacktrace.create(); + let count = 0; + options2.onDidAddListener = () => { + if (++count === 2) { + console.warn("snapshotted emitter LIKELY used public and SHOULD HAVE BEEN created with DisposableStore. snapshotted here"); + stack.print(); + } + origListenerDidAdd?.(); + }; + } + } + function defer(event, disposable) { + return debounce(event, () => void 0, 0, void 0, true, void 0, disposable); + } + Event2.defer = defer; + function once(event) { + return (listener, thisArgs = null, disposables) => { + let didFire = false; + let result = void 0; + result = event((e) => { + if (didFire) { + return; + } else if (result) { + result.dispose(); + } else { + didFire = true; + } + return listener.call(thisArgs, e); + }, null, disposables); + if (didFire) { + result.dispose(); + } + return result; + }; + } + Event2.once = once; + function onceIf(event, condition) { + return Event2.once(Event2.filter(event, condition)); + } + Event2.onceIf = onceIf; + function map(event, map2, disposable) { + return snapshot((listener, thisArgs = null, disposables) => event((i2) => listener.call(thisArgs, map2(i2)), null, disposables), disposable); + } + Event2.map = map; + function forEach(event, each, disposable) { + return snapshot((listener, thisArgs = null, disposables) => event((i2) => { + each(i2); + listener.call(thisArgs, i2); + }, null, disposables), disposable); + } + Event2.forEach = forEach; + function filter(event, filter2, disposable) { + return snapshot((listener, thisArgs = null, disposables) => event((e) => filter2(e) && listener.call(thisArgs, e), null, disposables), disposable); + } + Event2.filter = filter; + function signal(event) { + return event; + } + Event2.signal = signal; + function any(...events) { + return (listener, thisArgs = null, disposables) => { + const disposable = combinedDisposable(...events.map((event) => event((e) => listener.call(thisArgs, e)))); + return addAndReturnDisposable(disposable, disposables); + }; + } + Event2.any = any; + function reduce(event, merge, initial, disposable) { + let output = initial; + return map(event, (e) => { + output = merge(output, e); + return output; + }, disposable); + } + Event2.reduce = reduce; + function snapshot(event, disposable) { + let listener; + const options2 = { + onWillAddFirstListener() { + listener = event(emitter.fire, emitter); + }, + onDidRemoveLastListener() { + listener?.dispose(); + } + }; + if (!disposable) { + _addLeakageTraceLogic(options2); + } + const emitter = new Emitter(options2); + disposable?.add(emitter); + return emitter.event; + } + function addAndReturnDisposable(d, store) { + if (store instanceof Array) { + store.push(d); + } else if (store) { + store.add(d); + } + return d; + } + function debounce(event, merge, delay = 100, leading = false, flushOnListenerRemove = false, leakWarningThreshold, disposable) { + let subscription; + let output = void 0; + let handle = void 0; + let numDebouncedCalls = 0; + let doFire; + const options2 = { + leakWarningThreshold, + onWillAddFirstListener() { + subscription = event((cur) => { + numDebouncedCalls++; + output = merge(output, cur); + if (leading && !handle) { + emitter.fire(output); + output = void 0; + } + doFire = () => { + const _output = output; + output = void 0; + handle = void 0; + if (!leading || numDebouncedCalls > 1) { + emitter.fire(_output); + } + numDebouncedCalls = 0; + }; + if (typeof delay === "number") { + if (handle) { + clearTimeout(handle); + } + handle = setTimeout(doFire, delay); + } else { + if (handle === void 0) { + handle = null; + queueMicrotask(doFire); + } + } + }); + }, + onWillRemoveListener() { + if (flushOnListenerRemove && numDebouncedCalls > 0) { + doFire?.(); + } + }, + onDidRemoveLastListener() { + doFire = void 0; + subscription.dispose(); + } + }; + if (!disposable) { + _addLeakageTraceLogic(options2); + } + const emitter = new Emitter(options2); + disposable?.add(emitter); + return emitter.event; + } + Event2.debounce = debounce; + function accumulate(event, delay = 0, disposable) { + return Event2.debounce(event, (last, e) => { + if (!last) { + return [e]; + } + last.push(e); + return last; + }, delay, void 0, true, void 0, disposable); + } + Event2.accumulate = accumulate; + function latch(event, equals3 = (a, b) => a === b, disposable) { + let firstCall = true; + let cache; + return filter(event, (value) => { + const shouldEmit = firstCall || !equals3(value, cache); + firstCall = false; + cache = value; + return shouldEmit; + }, disposable); + } + Event2.latch = latch; + function split(event, isT, disposable) { + return [ + Event2.filter(event, isT, disposable), + Event2.filter(event, (e) => !isT(e), disposable) + ]; + } + Event2.split = split; + function buffer(event, flushAfterTimeout = false, _buffer = [], disposable) { + let buffer2 = _buffer.slice(); + let listener = event((e) => { + if (buffer2) { + buffer2.push(e); + } else { + emitter.fire(e); + } + }); + if (disposable) { + disposable.add(listener); + } + const flush = () => { + buffer2?.forEach((e) => emitter.fire(e)); + buffer2 = null; + }; + const emitter = new Emitter({ + onWillAddFirstListener() { + if (!listener) { + listener = event((e) => emitter.fire(e)); + if (disposable) { + disposable.add(listener); + } + } + }, + onDidAddFirstListener() { + if (buffer2) { + if (flushAfterTimeout) { + setTimeout(flush); + } else { + flush(); + } + } + }, + onDidRemoveLastListener() { + if (listener) { + listener.dispose(); + } + listener = null; + } + }); + if (disposable) { + disposable.add(emitter); + } + return emitter.event; + } + Event2.buffer = buffer; + function chain(event, sythensize) { + const fn = (listener, thisArgs, disposables) => { + const cs = sythensize(new ChainableSynthesis()); + return event(function(value) { + const result = cs.evaluate(value); + if (result !== HaltChainable) { + listener.call(thisArgs, result); + } + }, void 0, disposables); + }; + return fn; + } + Event2.chain = chain; + const HaltChainable = /* @__PURE__ */ Symbol("HaltChainable"); + class ChainableSynthesis { + constructor() { + this.steps = []; + } + map(fn) { + this.steps.push(fn); + return this; + } + forEach(fn) { + this.steps.push((v) => { + fn(v); + return v; + }); + return this; + } + filter(fn) { + this.steps.push((v) => fn(v) ? v : HaltChainable); + return this; + } + reduce(merge, initial) { + let last = initial; + this.steps.push((v) => { + last = merge(last, v); + return last; + }); + return this; + } + latch(equals3 = (a, b) => a === b) { + let firstCall = true; + let cache; + this.steps.push((value) => { + const shouldEmit = firstCall || !equals3(value, cache); + firstCall = false; + cache = value; + return shouldEmit ? value : HaltChainable; + }); + return this; + } + evaluate(value) { + for (const step of this.steps) { + value = step(value); + if (value === HaltChainable) { + break; + } + } + return value; + } + } + function fromNodeEventEmitter(emitter, eventName, map2 = (id) => id) { + const fn = (...args) => result.fire(map2(...args)); + const onFirstListenerAdd = () => emitter.on(eventName, fn); + const onLastListenerRemove = () => emitter.removeListener(eventName, fn); + const result = new Emitter({ onWillAddFirstListener: onFirstListenerAdd, onDidRemoveLastListener: onLastListenerRemove }); + return result.event; + } + Event2.fromNodeEventEmitter = fromNodeEventEmitter; + function fromDOMEventEmitter(emitter, eventName, map2 = (id) => id) { + const fn = (...args) => result.fire(map2(...args)); + const onFirstListenerAdd = () => emitter.addEventListener(eventName, fn); + const onLastListenerRemove = () => emitter.removeEventListener(eventName, fn); + const result = new Emitter({ onWillAddFirstListener: onFirstListenerAdd, onDidRemoveLastListener: onLastListenerRemove }); + return result.event; + } + Event2.fromDOMEventEmitter = fromDOMEventEmitter; + function toPromise(event, disposables) { + let cancelRef; + const promise = new Promise((resolve3, reject) => { + const listener = once(event)(resolve3, null, disposables); + cancelRef = () => listener.dispose(); + }); + promise.cancel = cancelRef; + return promise; + } + Event2.toPromise = toPromise; + function forward(from, to) { + return from((e) => to.fire(e)); + } + Event2.forward = forward; + function runAndSubscribe(event, handler, initial) { + handler(initial); + return event((e) => handler(e)); + } + Event2.runAndSubscribe = runAndSubscribe; + class EmitterObserver { + constructor(_observable, store) { + this._observable = _observable; + this._counter = 0; + this._hasChanged = false; + const options2 = { + onWillAddFirstListener: () => { + _observable.addObserver(this); + this._observable.reportChanges(); + }, + onDidRemoveLastListener: () => { + _observable.removeObserver(this); + } + }; + if (!store) { + _addLeakageTraceLogic(options2); + } + this.emitter = new Emitter(options2); + if (store) { + store.add(this.emitter); + } + } + beginUpdate(_observable) { + this._counter++; + } + handlePossibleChange(_observable) { + } + handleChange(_observable, _change) { + this._hasChanged = true; + } + endUpdate(_observable) { + this._counter--; + if (this._counter === 0) { + this._observable.reportChanges(); + if (this._hasChanged) { + this._hasChanged = false; + this.emitter.fire(this._observable.get()); + } + } + } + } + function fromObservable(obs, store) { + const observer = new EmitterObserver(obs, store); + return observer.emitter.event; + } + Event2.fromObservable = fromObservable; + function fromObservableLight(observable) { + return (listener, thisArgs, disposables) => { + let count = 0; + let didChange = false; + const observer = { + beginUpdate() { + count++; + }, + endUpdate() { + count--; + if (count === 0) { + observable.reportChanges(); + if (didChange) { + didChange = false; + listener.call(thisArgs); + } + } + }, + handlePossibleChange() { + }, + handleChange() { + didChange = true; + } + }; + observable.addObserver(observer); + observable.reportChanges(); + const disposable = { + dispose() { + observable.removeObserver(observer); + } + }; + if (disposables instanceof DisposableStore) { + disposables.add(disposable); + } else if (Array.isArray(disposables)) { + disposables.push(disposable); + } + return disposable; + }; + } + Event2.fromObservableLight = fromObservableLight; + })(Event || (Event = {})); + EventProfiling = class _EventProfiling { + static { + this.all = /* @__PURE__ */ new Set(); + } + static { + this._idPool = 0; + } + constructor(name) { + this.listenerCount = 0; + this.invocationCount = 0; + this.elapsedOverall = 0; + this.durations = []; + this.name = `${name}_${_EventProfiling._idPool++}`; + _EventProfiling.all.add(this); + } + start(listenerCount) { + this._stopWatch = new StopWatch(); + this.listenerCount = listenerCount; + } + stop() { + if (this._stopWatch) { + const elapsed = this._stopWatch.elapsed(); + this.durations.push(elapsed); + this.elapsedOverall += elapsed; + this.invocationCount += 1; + this._stopWatch = void 0; + } + } + }; + _globalLeakWarningThreshold = -1; + LeakageMonitor = class _LeakageMonitor { + static { + this._idPool = 1; + } + constructor(_errorHandler, threshold, name = (_LeakageMonitor._idPool++).toString(16).padStart(3, "0")) { + this._errorHandler = _errorHandler; + this.threshold = threshold; + this.name = name; + this._warnCountdown = 0; + } + dispose() { + this._stacks?.clear(); + } + check(stack, listenerCount) { + const threshold = this.threshold; + if (threshold <= 0 || listenerCount < threshold) { + return void 0; + } + if (!this._stacks) { + this._stacks = /* @__PURE__ */ new Map(); + } + const count = this._stacks.get(stack.value) || 0; + this._stacks.set(stack.value, count + 1); + this._warnCountdown -= 1; + if (this._warnCountdown <= 0) { + this._warnCountdown = threshold * 0.5; + const [topStack, topCount] = this.getMostFrequentStack(); + const message = `[${this.name}] potential listener LEAK detected, having ${listenerCount} listeners already. MOST frequent listener (${topCount}):`; + console.warn(message); + console.warn(topStack); + const error = new ListenerLeakError(message, topStack); + this._errorHandler(error); + } + return () => { + const count2 = this._stacks.get(stack.value) || 0; + this._stacks.set(stack.value, count2 - 1); + }; + } + getMostFrequentStack() { + if (!this._stacks) { + return void 0; + } + let topStack; + let topCount = 0; + for (const [stack, count] of this._stacks) { + if (!topStack || topCount < count) { + topStack = [stack, count]; + topCount = count; + } + } + return topStack; + } + }; + Stacktrace = class _Stacktrace { + static create() { + const err = new Error(); + return new _Stacktrace(err.stack ?? ""); + } + constructor(value) { + this.value = value; + } + print() { + console.warn(this.value.split("\n").slice(2).join("\n")); + } + }; + ListenerLeakError = class extends Error { + constructor(message, stack) { + super(message); + this.name = "ListenerLeakError"; + this.stack = stack; + } + }; + ListenerRefusalError = class extends Error { + constructor(message, stack) { + super(message); + this.name = "ListenerRefusalError"; + this.stack = stack; + } + }; + UniqueContainer = class { + constructor(value) { + this.value = value; + } + }; + compactionThreshold = 2; + forEachListener = (listeners, fn) => { + if (listeners instanceof UniqueContainer) { + fn(listeners); + } else { + for (let i2 = 0; i2 < listeners.length; i2++) { + const l = listeners[i2]; + if (l) { + fn(l); + } + } + } + }; + Emitter = class { + constructor(options2) { + this._size = 0; + this._options = options2; + this._leakageMon = _globalLeakWarningThreshold > 0 || this._options?.leakWarningThreshold ? new LeakageMonitor(options2?.onListenerError ?? onUnexpectedError, this._options?.leakWarningThreshold ?? _globalLeakWarningThreshold) : void 0; + this._perfMon = this._options?._profName ? new EventProfiling(this._options._profName) : void 0; + this._deliveryQueue = this._options?.deliveryQueue; + } + dispose() { + if (!this._disposed) { + this._disposed = true; + if (this._deliveryQueue?.current === this) { + this._deliveryQueue.reset(); + } + if (this._listeners) { + if (_enableDisposeWithListenerWarning) { + const listeners = this._listeners; + queueMicrotask(() => { + forEachListener(listeners, (l) => l.stack?.print()); + }); + } + this._listeners = void 0; + this._size = 0; + } + this._options?.onDidRemoveLastListener?.(); + this._leakageMon?.dispose(); + } + } + /** + * For the public to allow to subscribe + * to events from this Emitter + */ + get event() { + this._event ??= (callback, thisArgs, disposables) => { + if (this._leakageMon && this._size > this._leakageMon.threshold ** 2) { + const message = `[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`; + console.warn(message); + const tuple = this._leakageMon.getMostFrequentStack() ?? ["UNKNOWN stack", -1]; + const error = new ListenerRefusalError(`${message}. HINT: Stack shows most frequent listener (${tuple[1]}-times)`, tuple[0]); + const errorHandler2 = this._options?.onListenerError || onUnexpectedError; + errorHandler2(error); + return Disposable.None; + } + if (this._disposed) { + return Disposable.None; + } + if (thisArgs) { + callback = callback.bind(thisArgs); + } + const contained = new UniqueContainer(callback); + let removeMonitor; + let stack; + if (this._leakageMon && this._size >= Math.ceil(this._leakageMon.threshold * 0.2)) { + contained.stack = Stacktrace.create(); + removeMonitor = this._leakageMon.check(contained.stack, this._size + 1); + } + if (_enableDisposeWithListenerWarning) { + contained.stack = stack ?? Stacktrace.create(); + } + if (!this._listeners) { + this._options?.onWillAddFirstListener?.(this); + this._listeners = contained; + this._options?.onDidAddFirstListener?.(this); + } else if (this._listeners instanceof UniqueContainer) { + this._deliveryQueue ??= new EventDeliveryQueuePrivate(); + this._listeners = [this._listeners, contained]; + } else { + this._listeners.push(contained); + } + this._options?.onDidAddListener?.(this); + this._size++; + const result = toDisposable(() => { + removeMonitor?.(); + this._removeListener(contained); + }); + if (disposables instanceof DisposableStore) { + disposables.add(result); + } else if (Array.isArray(disposables)) { + disposables.push(result); + } + return result; + }; + return this._event; + } + _removeListener(listener) { + this._options?.onWillRemoveListener?.(this); + if (!this._listeners) { + return; + } + if (this._size === 1) { + this._listeners = void 0; + this._options?.onDidRemoveLastListener?.(this); + this._size = 0; + return; + } + const listeners = this._listeners; + const index = listeners.indexOf(listener); + if (index === -1) { + console.log("disposed?", this._disposed); + console.log("size?", this._size); + console.log("arr?", JSON.stringify(this._listeners)); + throw new Error("Attempted to dispose unknown listener"); + } + this._size--; + listeners[index] = void 0; + const adjustDeliveryQueue = this._deliveryQueue.current === this; + if (this._size * compactionThreshold <= listeners.length) { + let n2 = 0; + for (let i2 = 0; i2 < listeners.length; i2++) { + if (listeners[i2]) { + listeners[n2++] = listeners[i2]; + } else if (adjustDeliveryQueue && n2 < this._deliveryQueue.end) { + this._deliveryQueue.end--; + if (n2 < this._deliveryQueue.i) { + this._deliveryQueue.i--; + } + } + } + listeners.length = n2; + } + } + _deliver(listener, value) { + if (!listener) { + return; + } + const errorHandler2 = this._options?.onListenerError || onUnexpectedError; + if (!errorHandler2) { + listener.value(value); + return; + } + try { + listener.value(value); + } catch (e) { + errorHandler2(e); + } + } + /** Delivers items in the queue. Assumes the queue is ready to go. */ + _deliverQueue(dq) { + const listeners = dq.current._listeners; + while (dq.i < dq.end) { + this._deliver(listeners[dq.i++], dq.value); + } + dq.reset(); + } + /** + * To be kept private to fire an event to + * subscribers + */ + fire(event) { + if (this._deliveryQueue?.current) { + this._deliverQueue(this._deliveryQueue); + this._perfMon?.stop(); + } + this._perfMon?.start(this._size); + if (!this._listeners) { + } else if (this._listeners instanceof UniqueContainer) { + this._deliver(this._listeners, event); + } else { + const dq = this._deliveryQueue; + dq.enqueue(this, event, this._listeners.length); + this._deliverQueue(dq); + } + this._perfMon?.stop(); + } + hasListeners() { + return this._size > 0; + } + }; + createEventDeliveryQueue = () => new EventDeliveryQueuePrivate(); + EventDeliveryQueuePrivate = class { + constructor() { + this.i = -1; + this.end = 0; + } + enqueue(emitter, value, end) { + this.i = 0; + this.end = end; + this.current = emitter; + this.value = value; + } + reset() { + this.i = this.end; + this.current = void 0; + this.value = void 0; + } + }; + PauseableEmitter = class extends Emitter { + constructor(options2) { + super(options2); + this._isPaused = 0; + this._eventQueue = new LinkedList(); + this._mergeFn = options2?.merge; + } + pause() { + this._isPaused++; + } + resume() { + if (this._isPaused !== 0 && --this._isPaused === 0) { + if (this._mergeFn) { + if (this._eventQueue.size > 0) { + const events = Array.from(this._eventQueue); + this._eventQueue.clear(); + super.fire(this._mergeFn(events)); + } + } else { + while (!this._isPaused && this._eventQueue.size !== 0) { + super.fire(this._eventQueue.shift()); + } + } + } + } + fire(event) { + if (this._size) { + if (this._isPaused !== 0) { + this._eventQueue.push(event); + } else { + super.fire(event); + } + } + } + }; + DebounceEmitter = class extends PauseableEmitter { + constructor(options2) { + super(options2); + this._delay = options2.delay ?? 100; + } + fire(event) { + if (!this._handle) { + this.pause(); + this._handle = setTimeout(() => { + this._handle = void 0; + this.resume(); + }, this._delay); + } + super.fire(event); + } + }; + MicrotaskEmitter = class extends Emitter { + constructor(options2) { + super(options2); + this._queuedEvents = []; + this._mergeFn = options2?.merge; + } + fire(event) { + if (!this.hasListeners()) { + return; + } + this._queuedEvents.push(event); + if (this._queuedEvents.length === 1) { + queueMicrotask(() => { + if (this._mergeFn) { + super.fire(this._mergeFn(this._queuedEvents)); + } else { + this._queuedEvents.forEach((e) => super.fire(e)); + } + this._queuedEvents = []; + }); + } + } + }; + EventMultiplexer = class { + constructor() { + this.hasListeners = false; + this.events = []; + this.emitter = new Emitter({ + onWillAddFirstListener: () => this.onFirstListenerAdd(), + onDidRemoveLastListener: () => this.onLastListenerRemove() + }); + } + get event() { + return this.emitter.event; + } + add(event) { + const e = { event, listener: null }; + this.events.push(e); + if (this.hasListeners) { + this.hook(e); + } + const dispose2 = () => { + if (this.hasListeners) { + this.unhook(e); + } + const idx = this.events.indexOf(e); + this.events.splice(idx, 1); + }; + return toDisposable(createSingleCallFunction(dispose2)); + } + onFirstListenerAdd() { + this.hasListeners = true; + this.events.forEach((e) => this.hook(e)); + } + onLastListenerRemove() { + this.hasListeners = false; + this.events.forEach((e) => this.unhook(e)); + } + hook(e) { + e.listener = e.event((r) => this.emitter.fire(r)); + } + unhook(e) { + e.listener?.dispose(); + e.listener = null; + } + dispose() { + this.emitter.dispose(); + for (const e of this.events) { + e.listener?.dispose(); + } + this.events = []; + } + }; + EventBufferer = class { + constructor() { + this.data = []; + } + wrapEvent(event, reduce, initial) { + return (listener, thisArgs, disposables) => { + return event((i2) => { + const data = this.data[this.data.length - 1]; + if (!reduce) { + if (data) { + data.buffers.push(() => listener.call(thisArgs, i2)); + } else { + listener.call(thisArgs, i2); + } + return; + } + const reduceData = data; + if (!reduceData) { + listener.call(thisArgs, reduce(initial, i2)); + return; + } + reduceData.items ??= []; + reduceData.items.push(i2); + if (reduceData.buffers.length === 0) { + data.buffers.push(() => { + reduceData.reducedResult ??= initial ? reduceData.items.reduce(reduce, initial) : reduceData.items.reduce(reduce); + listener.call(thisArgs, reduceData.reducedResult); + }); + } + }, void 0, disposables); + }; + } + bufferEvents(fn) { + const data = { buffers: new Array() }; + this.data.push(data); + const r = fn(); + this.data.pop(); + data.buffers.forEach((flush) => flush()); + return r; + } + }; + Relay = class { + constructor() { + this.listening = false; + this.inputEvent = Event.None; + this.inputEventListener = Disposable.None; + this.emitter = new Emitter({ + onDidAddFirstListener: () => { + this.listening = true; + this.inputEventListener = this.inputEvent(this.emitter.fire, this.emitter); + }, + onDidRemoveLastListener: () => { + this.listening = false; + this.inputEventListener.dispose(); + } + }); + this.event = this.emitter.event; + } + set input(event) { + this.inputEvent = event; + if (this.listening) { + this.inputEventListener.dispose(); + this.inputEventListener = event(this.emitter.fire, this.emitter); + } + } + dispose() { + this.inputEventListener.dispose(); + this.emitter.dispose(); + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/common/cancellation.js +function cancelOnDispose(store) { + const source = new CancellationTokenSource(); + store.add({ dispose() { + source.cancel(); + } }); + return source.token; +} +var shortcutEvent, CancellationToken, MutableToken, CancellationTokenSource; +var init_cancellation = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/common/cancellation.js"() { + init_event(); + shortcutEvent = Object.freeze(function(callback, context) { + const handle = setTimeout(callback.bind(context), 0); + return { dispose() { + clearTimeout(handle); + } }; + }); + (function(CancellationToken2) { + function isCancellationToken(thing) { + if (thing === CancellationToken2.None || thing === CancellationToken2.Cancelled) { + return true; + } + if (thing instanceof MutableToken) { + return true; + } + if (!thing || typeof thing !== "object") { + return false; + } + return typeof thing.isCancellationRequested === "boolean" && typeof thing.onCancellationRequested === "function"; + } + CancellationToken2.isCancellationToken = isCancellationToken; + CancellationToken2.None = Object.freeze({ + isCancellationRequested: false, + onCancellationRequested: Event.None + }); + CancellationToken2.Cancelled = Object.freeze({ + isCancellationRequested: true, + onCancellationRequested: shortcutEvent + }); + })(CancellationToken || (CancellationToken = {})); + MutableToken = class { + constructor() { + this._isCancelled = false; + this._emitter = null; + } + cancel() { + if (!this._isCancelled) { + this._isCancelled = true; + if (this._emitter) { + this._emitter.fire(void 0); + this.dispose(); + } + } + } + get isCancellationRequested() { + return this._isCancelled; + } + get onCancellationRequested() { + if (this._isCancelled) { + return shortcutEvent; + } + if (!this._emitter) { + this._emitter = new Emitter(); + } + return this._emitter.event; + } + dispose() { + if (this._emitter) { + this._emitter.dispose(); + this._emitter = null; + } + } + }; + CancellationTokenSource = class { + constructor(parent) { + this._token = void 0; + this._parentListener = void 0; + this._parentListener = parent && parent.onCancellationRequested(this.cancel, this); + } + get token() { + if (!this._token) { + this._token = new MutableToken(); + } + return this._token; + } + cancel() { + if (!this._token) { + this._token = CancellationToken.Cancelled; + } else if (this._token instanceof MutableToken) { + this._token.cancel(); + } + } + dispose(cancel = false) { + if (cancel) { + this.cancel(); + } + this._parentListener?.dispose(); + if (!this._token) { + this._token = CancellationToken.None; + } else if (this._token instanceof MutableToken) { + this._token.dispose(); + } + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/common/symbols.js +var MicrotaskDelay; +var init_symbols = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/common/symbols.js"() { + MicrotaskDelay = /* @__PURE__ */ Symbol("MicrotaskDelay"); + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/common/async.js +function isThenable(obj) { + return !!obj && typeof obj.then === "function"; +} +function createCancelablePromise(callback) { + const source = new CancellationTokenSource(); + const thenable = callback(source.token); + let isCancelled = false; + const promise = new Promise((resolve3, reject) => { + const subscription = source.token.onCancellationRequested(() => { + isCancelled = true; + subscription.dispose(); + reject(new CancellationError()); + }); + Promise.resolve(thenable).then((value) => { + subscription.dispose(); + source.dispose(); + if (!isCancelled) { + resolve3(value); + } else if (isDisposable(value)) { + value.dispose(); + } + }, (err) => { + subscription.dispose(); + source.dispose(); + reject(err); + }); + }); + return new class { + cancel() { + source.cancel(); + source.dispose(); + } + then(resolve3, reject) { + return promise.then(resolve3, reject); + } + catch(reject) { + return this.then(void 0, reject); + } + finally(onfinally) { + return promise.finally(onfinally); + } + }(); +} +function raceCancellation(promise, token, defaultValue) { + return new Promise((resolve3, reject) => { + const ref = token.onCancellationRequested(() => { + ref.dispose(); + resolve3(defaultValue); + }); + promise.then(resolve3, reject).finally(() => ref.dispose()); + }); +} +function raceCancellationError(promise, token) { + return new Promise((resolve3, reject) => { + const ref = token.onCancellationRequested(() => { + ref.dispose(); + reject(new CancellationError()); + }); + promise.then(resolve3, reject).finally(() => ref.dispose()); + }); +} +function timeout(millis, token) { + if (!token) { + return createCancelablePromise((token2) => timeout(millis, token2)); + } + return new Promise((resolve3, reject) => { + const handle = setTimeout(() => { + disposable.dispose(); + resolve3(); + }, millis); + const disposable = token.onCancellationRequested(() => { + clearTimeout(handle); + disposable.dispose(); + reject(new CancellationError()); + }); + }); +} +function disposableTimeout(handler, timeout2 = 0, store) { + const timer = setTimeout(() => { + handler(); + if (store) { + disposable.dispose(); + } + }, timeout2); + const disposable = toDisposable(() => { + clearTimeout(timer); + store?.delete(disposable); + }); + store?.add(disposable); + return disposable; +} +function first(promiseFactories, shouldStop = (t) => !!t, defaultValue = null) { + let index = 0; + const len = promiseFactories.length; + const loop = () => { + if (index >= len) { + return Promise.resolve(defaultValue); + } + const factory = promiseFactories[index++]; + const promise = Promise.resolve(factory()); + return promise.then((result) => { + if (shouldStop(result)) { + return Promise.resolve(result); + } + return loop(); + }); + }; + return loop(); +} +function createCancelableAsyncIterableProducer(callback) { + const source = new CancellationTokenSource(); + const innerIterable = callback(source.token); + return new CancelableAsyncIterableProducer(source, async (emitter) => { + const subscription = source.token.onCancellationRequested(() => { + subscription.dispose(); + source.dispose(); + emitter.reject(new CancellationError()); + }); + try { + for await (const item of innerIterable) { + if (source.token.isCancellationRequested) { + return; + } + emitter.emitOne(item); + } + subscription.dispose(); + source.dispose(); + } catch (err) { + subscription.dispose(); + source.dispose(); + emitter.reject(err); + } + }); +} +var Throttler, timeoutDeferred, microtaskDeferred, Delayer, ThrottledDelayer, TaskQueue, TimeoutTimer, IntervalTimer, RunOnceScheduler, runWhenGlobalIdle, _runWhenIdle, AbstractIdleValue, GlobalIdleValue, DeferredPromise, Promises, ProducerConsumer, AsyncIterableProducer, CancelableAsyncIterableProducer; +var init_async = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/common/async.js"() { + init_cancellation(); + init_errors(); + init_lifecycle(); + init_platform(); + init_symbols(); + Throttler = class { + constructor() { + this.activePromise = null; + this.queuedPromise = null; + this.queuedPromiseFactory = null; + this.cancellationTokenSource = new CancellationTokenSource(); + } + queue(promiseFactory) { + if (this.cancellationTokenSource.token.isCancellationRequested) { + return Promise.reject(new Error("Throttler is disposed")); + } + if (this.activePromise) { + this.queuedPromiseFactory = promiseFactory; + if (!this.queuedPromise) { + const onComplete = () => { + this.queuedPromise = null; + if (this.cancellationTokenSource.token.isCancellationRequested) { + return; + } + const result = this.queue(this.queuedPromiseFactory); + this.queuedPromiseFactory = null; + return result; + }; + this.queuedPromise = new Promise((resolve3) => { + this.activePromise.then(onComplete, onComplete).then(resolve3); + }); + } + return new Promise((resolve3, reject) => { + this.queuedPromise.then(resolve3, reject); + }); + } + this.activePromise = promiseFactory(this.cancellationTokenSource.token); + return new Promise((resolve3, reject) => { + this.activePromise.then((result) => { + this.activePromise = null; + resolve3(result); + }, (err) => { + this.activePromise = null; + reject(err); + }); + }); + } + dispose() { + this.cancellationTokenSource.cancel(); + } + }; + timeoutDeferred = (timeout2, fn) => { + let scheduled = true; + const handle = setTimeout(() => { + scheduled = false; + fn(); + }, timeout2); + return { + isTriggered: () => scheduled, + dispose: () => { + clearTimeout(handle); + scheduled = false; + } + }; + }; + microtaskDeferred = (fn) => { + let scheduled = true; + queueMicrotask(() => { + if (scheduled) { + scheduled = false; + fn(); + } + }); + return { + isTriggered: () => scheduled, + dispose: () => { + scheduled = false; + } + }; + }; + Delayer = class { + constructor(defaultDelay) { + this.defaultDelay = defaultDelay; + this.deferred = null; + this.completionPromise = null; + this.doResolve = null; + this.doReject = null; + this.task = null; + } + trigger(task, delay = this.defaultDelay) { + this.task = task; + this.cancelTimeout(); + if (!this.completionPromise) { + this.completionPromise = new Promise((resolve3, reject) => { + this.doResolve = resolve3; + this.doReject = reject; + }).then(() => { + this.completionPromise = null; + this.doResolve = null; + if (this.task) { + const task2 = this.task; + this.task = null; + return task2(); + } + return void 0; + }); + } + const fn = () => { + this.deferred = null; + this.doResolve?.(null); + }; + this.deferred = delay === MicrotaskDelay ? microtaskDeferred(fn) : timeoutDeferred(delay, fn); + return this.completionPromise; + } + isTriggered() { + return !!this.deferred?.isTriggered(); + } + cancel() { + this.cancelTimeout(); + if (this.completionPromise) { + this.doReject?.(new CancellationError()); + this.completionPromise = null; + } + } + cancelTimeout() { + this.deferred?.dispose(); + this.deferred = null; + } + dispose() { + this.cancel(); + } + }; + ThrottledDelayer = class { + constructor(defaultDelay) { + this.delayer = new Delayer(defaultDelay); + this.throttler = new Throttler(); + } + trigger(promiseFactory, delay) { + return this.delayer.trigger(() => this.throttler.queue(promiseFactory), delay); + } + cancel() { + this.delayer.cancel(); + } + dispose() { + this.delayer.dispose(); + this.throttler.dispose(); + } + }; + TaskQueue = class { + constructor() { + this._runningTask = void 0; + this._pendingTasks = []; + } + /** + * Waits for the current and pending tasks to finish, then runs and awaits the given task. + * If the task is skipped because of clearPending, the promise is rejected with a CancellationError. + */ + schedule(task) { + const deferred = new DeferredPromise(); + this._pendingTasks.push({ task, deferred, setUndefinedWhenCleared: false }); + this._runIfNotRunning(); + return deferred.p; + } + _runIfNotRunning() { + if (this._runningTask === void 0) { + this._processQueue(); + } + } + async _processQueue() { + if (this._pendingTasks.length === 0) { + return; + } + const next = this._pendingTasks.shift(); + if (!next) { + return; + } + if (this._runningTask) { + throw new BugIndicatingError(); + } + this._runningTask = next.task; + try { + const result = await next.task(); + next.deferred.complete(result); + } catch (e) { + next.deferred.error(e); + } finally { + this._runningTask = void 0; + this._processQueue(); + } + } + /** + * Clears all pending tasks. Does not cancel the currently running task. + */ + clearPending() { + const tasks = this._pendingTasks; + this._pendingTasks = []; + for (const task of tasks) { + if (task.setUndefinedWhenCleared) { + task.deferred.complete(void 0); + } else { + task.deferred.error(new CancellationError()); + } + } + } + }; + TimeoutTimer = class { + constructor(runner, timeout2) { + this._isDisposed = false; + this._token = void 0; + if (typeof runner === "function" && typeof timeout2 === "number") { + this.setIfNotSet(runner, timeout2); + } + } + dispose() { + this.cancel(); + this._isDisposed = true; + } + cancel() { + if (this._token !== void 0) { + clearTimeout(this._token); + this._token = void 0; + } + } + cancelAndSet(runner, timeout2) { + if (this._isDisposed) { + throw new BugIndicatingError(`Calling 'cancelAndSet' on a disposed TimeoutTimer`); + } + this.cancel(); + this._token = setTimeout(() => { + this._token = void 0; + runner(); + }, timeout2); + } + setIfNotSet(runner, timeout2) { + if (this._isDisposed) { + throw new BugIndicatingError(`Calling 'setIfNotSet' on a disposed TimeoutTimer`); + } + if (this._token !== void 0) { + return; + } + this._token = setTimeout(() => { + this._token = void 0; + runner(); + }, timeout2); + } + }; + IntervalTimer = class { + constructor() { + this.disposable = void 0; + this.isDisposed = false; + } + cancel() { + this.disposable?.dispose(); + this.disposable = void 0; + } + cancelAndSet(runner, interval, context = globalThis) { + if (this.isDisposed) { + throw new BugIndicatingError(`Calling 'cancelAndSet' on a disposed IntervalTimer`); + } + this.cancel(); + const handle = context.setInterval(() => { + runner(); + }, interval); + this.disposable = toDisposable(() => { + context.clearInterval(handle); + this.disposable = void 0; + }); + } + dispose() { + this.cancel(); + this.isDisposed = true; + } + }; + RunOnceScheduler = class { + constructor(runner, delay) { + this.timeoutToken = void 0; + this.runner = runner; + this.timeout = delay; + this.timeoutHandler = this.onTimeout.bind(this); + } + /** + * Dispose RunOnceScheduler + */ + dispose() { + this.cancel(); + this.runner = null; + } + /** + * Cancel current scheduled runner (if any). + */ + cancel() { + if (this.isScheduled()) { + clearTimeout(this.timeoutToken); + this.timeoutToken = void 0; + } + } + /** + * Cancel previous runner (if any) & schedule a new runner. + */ + schedule(delay = this.timeout) { + this.cancel(); + this.timeoutToken = setTimeout(this.timeoutHandler, delay); + } + get delay() { + return this.timeout; + } + set delay(value) { + this.timeout = value; + } + /** + * Returns true if scheduled. + */ + isScheduled() { + return this.timeoutToken !== void 0; + } + onTimeout() { + this.timeoutToken = void 0; + if (this.runner) { + this.doRun(); + } + } + doRun() { + this.runner?.(); + } + }; + (function() { + const safeGlobal = globalThis; + if (typeof safeGlobal.requestIdleCallback !== "function" || typeof safeGlobal.cancelIdleCallback !== "function") { + _runWhenIdle = (_targetWindow, runner, timeout2) => { + setTimeout0(() => { + if (disposed) { + return; + } + const end = Date.now() + 15; + const deadline = { + didTimeout: true, + timeRemaining() { + return Math.max(0, end - Date.now()); + } + }; + runner(Object.freeze(deadline)); + }); + let disposed = false; + return { + dispose() { + if (disposed) { + return; + } + disposed = true; + } + }; + }; + } else { + _runWhenIdle = (targetWindow, runner, timeout2) => { + const handle = targetWindow.requestIdleCallback(runner, typeof timeout2 === "number" ? { timeout: timeout2 } : void 0); + let disposed = false; + return { + dispose() { + if (disposed) { + return; + } + disposed = true; + targetWindow.cancelIdleCallback(handle); + } + }; + }; + } + runWhenGlobalIdle = (runner, timeout2) => _runWhenIdle(globalThis, runner, timeout2); + })(); + AbstractIdleValue = class { + constructor(targetWindow, executor) { + this._didRun = false; + this._executor = () => { + try { + this._value = executor(); + } catch (err) { + this._error = err; + } finally { + this._didRun = true; + } + }; + this._handle = _runWhenIdle(targetWindow, () => this._executor()); + } + dispose() { + this._handle.dispose(); + } + get value() { + if (!this._didRun) { + this._handle.dispose(); + this._executor(); + } + if (this._error) { + throw this._error; + } + return this._value; + } + get isInitialized() { + return this._didRun; + } + }; + GlobalIdleValue = class extends AbstractIdleValue { + constructor(executor) { + super(globalThis, executor); + } + }; + DeferredPromise = class { + get isRejected() { + return this.outcome?.outcome === 1; + } + get isSettled() { + return !!this.outcome; + } + constructor() { + this.p = new Promise((c, e) => { + this.completeCallback = c; + this.errorCallback = e; + }); + } + complete(value) { + if (this.isSettled) { + return Promise.resolve(); + } + return new Promise((resolve3) => { + this.completeCallback(value); + this.outcome = { outcome: 0, value }; + resolve3(); + }); + } + error(err) { + if (this.isSettled) { + return Promise.resolve(); + } + return new Promise((resolve3) => { + this.errorCallback(err); + this.outcome = { outcome: 1, value: err }; + resolve3(); + }); + } + cancel() { + return this.error(new CancellationError()); + } + }; + (function(Promises2) { + async function settled(promises) { + let firstError = void 0; + const result = await Promise.all(promises.map((promise) => promise.then((value) => value, (error) => { + if (!firstError) { + firstError = error; + } + return void 0; + }))); + if (typeof firstError !== "undefined") { + throw firstError; + } + return result; + } + Promises2.settled = settled; + function withAsyncBody(bodyFn) { + return new Promise(async (resolve3, reject) => { + try { + await bodyFn(resolve3, reject); + } catch (error) { + reject(error); + } + }); + } + Promises2.withAsyncBody = withAsyncBody; + })(Promises || (Promises = {})); + ProducerConsumer = class { + constructor() { + this._unsatisfiedConsumers = []; + this._unconsumedValues = []; + } + get hasFinalValue() { + return !!this._finalValue; + } + produce(value) { + this._ensureNoFinalValue(); + if (this._unsatisfiedConsumers.length > 0) { + const deferred = this._unsatisfiedConsumers.shift(); + this._resolveOrRejectDeferred(deferred, value); + } else { + this._unconsumedValues.push(value); + } + } + produceFinal(value) { + this._ensureNoFinalValue(); + this._finalValue = value; + for (const deferred of this._unsatisfiedConsumers) { + this._resolveOrRejectDeferred(deferred, value); + } + this._unsatisfiedConsumers.length = 0; + } + _ensureNoFinalValue() { + if (this._finalValue) { + throw new BugIndicatingError("ProducerConsumer: cannot produce after final value has been set"); + } + } + _resolveOrRejectDeferred(deferred, value) { + if (value.ok) { + deferred.complete(value.value); + } else { + deferred.error(value.error); + } + } + consume() { + if (this._unconsumedValues.length > 0 || this._finalValue) { + const value = this._unconsumedValues.length > 0 ? this._unconsumedValues.shift() : this._finalValue; + if (value.ok) { + return Promise.resolve(value.value); + } else { + return Promise.reject(value.error); + } + } else { + const deferred = new DeferredPromise(); + this._unsatisfiedConsumers.push(deferred); + return deferred.p; + } + } + }; + AsyncIterableProducer = class _AsyncIterableProducer { + constructor(executor, _onReturn) { + this._onReturn = _onReturn; + this._producerConsumer = new ProducerConsumer(); + this._iterator = { + next: () => this._producerConsumer.consume(), + return: () => { + this._onReturn?.(); + return Promise.resolve({ done: true, value: void 0 }); + }, + throw: async (e) => { + this._finishError(e); + return { done: true, value: void 0 }; + } + }; + queueMicrotask(async () => { + const p = executor({ + emitOne: (value) => this._producerConsumer.produce({ ok: true, value: { done: false, value } }), + emitMany: (values) => { + for (const value of values) { + this._producerConsumer.produce({ ok: true, value: { done: false, value } }); + } + }, + reject: (error) => this._finishError(error) + }); + if (!this._producerConsumer.hasFinalValue) { + try { + await p; + this._finishOk(); + } catch (error) { + this._finishError(error); + } + } + }); + } + static fromArray(items) { + return new _AsyncIterableProducer((writer) => { + writer.emitMany(items); + }); + } + static fromPromise(promise) { + return new _AsyncIterableProducer(async (emitter) => { + emitter.emitMany(await promise); + }); + } + static fromPromisesResolveOrder(promises) { + return new _AsyncIterableProducer(async (emitter) => { + await Promise.all(promises.map(async (p) => emitter.emitOne(await p))); + }); + } + static merge(iterables) { + return new _AsyncIterableProducer(async (emitter) => { + await Promise.all(iterables.map(async (iterable) => { + for await (const item of iterable) { + emitter.emitOne(item); + } + })); + }); + } + static { + this.EMPTY = _AsyncIterableProducer.fromArray([]); + } + static map(iterable, mapFn) { + return new _AsyncIterableProducer(async (emitter) => { + for await (const item of iterable) { + emitter.emitOne(mapFn(item)); + } + }); + } + map(mapFn) { + return _AsyncIterableProducer.map(this, mapFn); + } + static coalesce(iterable) { + return _AsyncIterableProducer.filter(iterable, (item) => !!item); + } + coalesce() { + return _AsyncIterableProducer.coalesce(this); + } + static filter(iterable, filterFn) { + return new _AsyncIterableProducer(async (emitter) => { + for await (const item of iterable) { + if (filterFn(item)) { + emitter.emitOne(item); + } + } + }); + } + filter(filterFn) { + return _AsyncIterableProducer.filter(this, filterFn); + } + _finishOk() { + if (!this._producerConsumer.hasFinalValue) { + this._producerConsumer.produceFinal({ ok: true, value: { done: true, value: void 0 } }); + } + } + _finishError(error) { + if (!this._producerConsumer.hasFinalValue) { + this._producerConsumer.produceFinal({ ok: false, error }); + } + } + [Symbol.asyncIterator]() { + return this._iterator; + } + }; + CancelableAsyncIterableProducer = class extends AsyncIterableProducer { + constructor(_source, executor) { + super(executor); + this._source = _source; + } + cancel() { + this._source.cancel(); + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/common/cache.js +function identity(t) { + return t; +} +var LRUCachedFunction, CachedFunction; +var init_cache = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/common/cache.js"() { + LRUCachedFunction = class { + constructor(arg1, arg2) { + this.lastCache = void 0; + this.lastArgKey = void 0; + if (typeof arg1 === "function") { + this._fn = arg1; + this._computeKey = identity; + } else { + this._fn = arg2; + this._computeKey = arg1.getCacheKey; + } + } + get(arg) { + const key = this._computeKey(arg); + if (this.lastArgKey !== key) { + this.lastArgKey = key; + this.lastCache = this._fn(arg); + } + return this.lastCache; + } + }; + CachedFunction = class { + get cachedValues() { + return this._map; + } + constructor(arg1, arg2) { + this._map = /* @__PURE__ */ new Map(); + this._map2 = /* @__PURE__ */ new Map(); + if (typeof arg1 === "function") { + this._fn = arg1; + this._computeKey = identity; + } else { + this._fn = arg2; + this._computeKey = arg1.getCacheKey; + } + } + get(arg) { + const key = this._computeKey(arg); + if (this._map2.has(key)) { + return this._map2.get(key); + } + const value = this._fn(arg); + this._map.set(arg, value); + this._map2.set(key, value); + return value; + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/common/lazy.js +var LazyValueState, Lazy; +var init_lazy = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/common/lazy.js"() { + (function(LazyValueState2) { + LazyValueState2[LazyValueState2["Uninitialized"] = 0] = "Uninitialized"; + LazyValueState2[LazyValueState2["Running"] = 1] = "Running"; + LazyValueState2[LazyValueState2["Completed"] = 2] = "Completed"; + })(LazyValueState || (LazyValueState = {})); + Lazy = class { + constructor(executor) { + this.executor = executor; + this._state = LazyValueState.Uninitialized; + } + /** + * Get the wrapped value. + * + * This will force evaluation of the lazy value if it has not been resolved yet. Lazy values are only + * resolved once. `getValue` will re-throw exceptions that are hit while resolving the value + */ + get value() { + if (this._state === LazyValueState.Uninitialized) { + this._state = LazyValueState.Running; + try { + this._value = this.executor(); + } catch (err) { + this._error = err; + } finally { + this._state = LazyValueState.Completed; + } + } else if (this._state === LazyValueState.Running) { + throw new Error("Cannot read the value of a lazy that is being initialized"); + } + if (this._error) { + throw this._error; + } + return this._value; + } + /** + * Get the wrapped value without forcing evaluation. + */ + get rawValue() { + return this._value; + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/common/strings.js +function isFalsyOrWhitespace(str) { + if (!str || typeof str !== "string") { + return true; + } + return str.trim().length === 0; +} +function format(value, ...args) { + if (args.length === 0) { + return value; + } + return value.replace(_formatRegexp, function(match2, group) { + const idx = parseInt(group, 10); + return isNaN(idx) || idx < 0 || idx >= args.length ? match2 : args[idx]; + }); +} +function htmlAttributeEncodeValue(value) { + return value.replace(/[<>"'&]/g, (ch) => { + switch (ch) { + case "<": + return "<"; + case ">": + return ">"; + case '"': + return """; + case "'": + return "'"; + case "&": + return "&"; + } + return ch; + }); +} +function escape(html3) { + return html3.replace(/[<>&]/g, function(match2) { + switch (match2) { + case "<": + return "<"; + case ">": + return ">"; + case "&": + return "&"; + default: + return match2; + } + }); +} +function escapeRegExpCharacters(value) { + return value.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g, "\\$&"); +} +function trim(haystack, needle = " ") { + const trimmed = ltrim(haystack, needle); + return rtrim(trimmed, needle); +} +function ltrim(haystack, needle) { + if (!haystack || !needle) { + return haystack; + } + const needleLen = needle.length; + if (needleLen === 0 || haystack.length === 0) { + return haystack; + } + let offset = 0; + while (haystack.indexOf(needle, offset) === offset) { + offset = offset + needleLen; + } + return haystack.substring(offset); +} +function rtrim(haystack, needle) { + if (!haystack || !needle) { + return haystack; + } + const needleLen = needle.length, haystackLen = haystack.length; + if (needleLen === 0 || haystackLen === 0) { + return haystack; + } + let offset = haystackLen, idx = -1; + while (true) { + idx = haystack.lastIndexOf(needle, offset - 1); + if (idx === -1 || idx + needleLen !== offset) { + break; + } + if (idx === 0) { + return ""; + } + offset = idx; + } + return haystack.substring(0, offset); +} +function convertSimple2RegExpPattern(pattern) { + return pattern.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g, "\\$&").replace(/[\*]/g, ".*"); +} +function createRegExp(searchString, isRegex, options2 = {}) { + if (!searchString) { + throw new Error("Cannot create regex from empty string"); + } + if (!isRegex) { + searchString = escapeRegExpCharacters(searchString); + } + if (options2.wholeWord) { + if (!/\B/.test(searchString.charAt(0))) { + searchString = "\\b" + searchString; + } + if (!/\B/.test(searchString.charAt(searchString.length - 1))) { + searchString = searchString + "\\b"; + } + } + let modifiers = ""; + if (options2.global) { + modifiers += "g"; + } + if (!options2.matchCase) { + modifiers += "i"; + } + if (options2.multiline) { + modifiers += "m"; + } + if (options2.unicode) { + modifiers += "u"; + } + return new RegExp(searchString, modifiers); +} +function regExpLeadsToEndlessLoop(regexp) { + if (regexp.source === "^" || regexp.source === "^$" || regexp.source === "$" || regexp.source === "^\\s*$") { + return false; + } + const match2 = regexp.exec(""); + return !!(match2 && regexp.lastIndex === 0); +} +function splitLines(str) { + return str.split(/\r\n|\r|\n/); +} +function firstNonWhitespaceIndex(str) { + for (let i2 = 0, len = str.length; i2 < len; i2++) { + const chCode = str.charCodeAt(i2); + if (chCode !== 32 && chCode !== 9) { + return i2; + } + } + return -1; +} +function getLeadingWhitespace(str, start = 0, end = str.length) { + for (let i2 = start; i2 < end; i2++) { + const chCode = str.charCodeAt(i2); + if (chCode !== 32 && chCode !== 9) { + return str.substring(start, i2); + } + } + return str.substring(start, end); +} +function lastNonWhitespaceIndex(str, startIndex = str.length - 1) { + for (let i2 = startIndex; i2 >= 0; i2--) { + const chCode = str.charCodeAt(i2); + if (chCode !== 32 && chCode !== 9) { + return i2; + } + } + return -1; +} +function compare(a, b) { + if (a < b) { + return -1; + } else if (a > b) { + return 1; + } else { + return 0; + } +} +function compareSubstring(a, b, aStart = 0, aEnd = a.length, bStart = 0, bEnd = b.length) { + for (; aStart < aEnd && bStart < bEnd; aStart++, bStart++) { + const codeA = a.charCodeAt(aStart); + const codeB = b.charCodeAt(bStart); + if (codeA < codeB) { + return -1; + } else if (codeA > codeB) { + return 1; + } + } + const aLen = aEnd - aStart; + const bLen = bEnd - bStart; + if (aLen < bLen) { + return -1; + } else if (aLen > bLen) { + return 1; + } + return 0; +} +function compareIgnoreCase(a, b) { + return compareSubstringIgnoreCase(a, b, 0, a.length, 0, b.length); +} +function compareSubstringIgnoreCase(a, b, aStart = 0, aEnd = a.length, bStart = 0, bEnd = b.length) { + for (; aStart < aEnd && bStart < bEnd; aStart++, bStart++) { + let codeA = a.charCodeAt(aStart); + let codeB = b.charCodeAt(bStart); + if (codeA === codeB) { + continue; + } + if (codeA >= 128 || codeB >= 128) { + return compareSubstring(a.toLowerCase(), b.toLowerCase(), aStart, aEnd, bStart, bEnd); + } + if (isLowerAsciiLetter(codeA)) { + codeA -= 32; + } + if (isLowerAsciiLetter(codeB)) { + codeB -= 32; + } + const diff = codeA - codeB; + if (diff === 0) { + continue; + } + return diff; + } + const aLen = aEnd - aStart; + const bLen = bEnd - bStart; + if (aLen < bLen) { + return -1; + } else if (aLen > bLen) { + return 1; + } + return 0; +} +function isAsciiDigit(code) { + return code >= 48 && code <= 57; +} +function isLowerAsciiLetter(code) { + return code >= 97 && code <= 122; +} +function isUpperAsciiLetter(code) { + return code >= 65 && code <= 90; +} +function equalsIgnoreCase(a, b) { + return a.length === b.length && compareSubstringIgnoreCase(a, b) === 0; +} +function startsWithIgnoreCase(str, candidate) { + const len = candidate.length; + return len <= str.length && compareSubstringIgnoreCase(str, candidate, 0, len) === 0; +} +function endsWithIgnoreCase(str, candidate) { + const len = str.length; + const start = len - candidate.length; + return start >= 0 && compareSubstringIgnoreCase(str, candidate, start, len) === 0; +} +function commonPrefixLength(a, b) { + const len = Math.min(a.length, b.length); + let i2; + for (i2 = 0; i2 < len; i2++) { + if (a.charCodeAt(i2) !== b.charCodeAt(i2)) { + return i2; + } + } + return len; +} +function commonSuffixLength(a, b) { + const len = Math.min(a.length, b.length); + let i2; + const aLastIndex = a.length - 1; + const bLastIndex = b.length - 1; + for (i2 = 0; i2 < len; i2++) { + if (a.charCodeAt(aLastIndex - i2) !== b.charCodeAt(bLastIndex - i2)) { + return i2; + } + } + return len; +} +function isHighSurrogate(charCode) { + return 55296 <= charCode && charCode <= 56319; +} +function isLowSurrogate(charCode) { + return 56320 <= charCode && charCode <= 57343; +} +function computeCodePoint(highSurrogate, lowSurrogate) { + return (highSurrogate - 55296 << 10) + (lowSurrogate - 56320) + 65536; +} +function getNextCodePoint(str, len, offset) { + const charCode = str.charCodeAt(offset); + if (isHighSurrogate(charCode) && offset + 1 < len) { + const nextCharCode = str.charCodeAt(offset + 1); + if (isLowSurrogate(nextCharCode)) { + return computeCodePoint(charCode, nextCharCode); + } + } + return charCode; +} +function getPrevCodePoint(str, offset) { + const charCode = str.charCodeAt(offset - 1); + if (isLowSurrogate(charCode) && offset > 1) { + const prevCharCode = str.charCodeAt(offset - 2); + if (isHighSurrogate(prevCharCode)) { + return computeCodePoint(prevCharCode, charCode); + } + } + return charCode; +} +function nextCharLength(str, initialOffset) { + const iterator = new GraphemeIterator(str, initialOffset); + return iterator.nextGraphemeLength(); +} +function prevCharLength(str, initialOffset) { + const iterator = new GraphemeIterator(str, initialOffset); + return iterator.prevGraphemeLength(); +} +function getCharContainingOffset(str, offset) { + if (offset > 0 && isLowSurrogate(str.charCodeAt(offset))) { + offset--; + } + const endOffset = offset + nextCharLength(str, offset); + const startOffset = endOffset - prevCharLength(str, endOffset); + return [startOffset, endOffset]; +} +function makeContainsRtl() { + return /(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA\u07FE-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u088E\u08A0-\u08C9\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDC7\uFDF0-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE35\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDD23\uDE80-\uDEA9\uDEAD-\uDF45\uDF51-\uDF81\uDF86-\uDFF6]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD4B-\uDFFF]|\uD83B[\uDC00-\uDEBB])/; +} +function containsRTL(str) { + if (!CONTAINS_RTL) { + CONTAINS_RTL = makeContainsRtl(); + } + return CONTAINS_RTL.test(str); +} +function isBasicASCII(str) { + return IS_BASIC_ASCII.test(str); +} +function containsUnusualLineTerminators(str) { + return UNUSUAL_LINE_TERMINATORS.test(str); +} +function isFullWidthCharacter(charCode) { + return charCode >= 11904 && charCode <= 55215 || charCode >= 63744 && charCode <= 64255 || charCode >= 65281 && charCode <= 65374; +} +function isEmojiImprecise(x) { + return x >= 127462 && x <= 127487 || x === 8986 || x === 8987 || x === 9200 || x === 9203 || x >= 9728 && x <= 10175 || x === 11088 || x === 11093 || x >= 127744 && x <= 128591 || x >= 128640 && x <= 128764 || x >= 128992 && x <= 129008 || x >= 129280 && x <= 129535 || x >= 129648 && x <= 129782; +} +function startsWithUTF8BOM(str) { + return !!(str && str.length > 0 && str.charCodeAt(0) === 65279); +} +function containsUppercaseCharacter(target, ignoreEscapedChars = false) { + if (!target) { + return false; + } + if (ignoreEscapedChars) { + target = target.replace(/\\./g, ""); + } + return target.toLowerCase() !== target; +} +function singleLetterHash(n2) { + const LETTERS_CNT = 90 - 65 + 1; + n2 = n2 % (2 * LETTERS_CNT); + if (n2 < LETTERS_CNT) { + return String.fromCharCode(97 + n2); + } + return String.fromCharCode(65 + n2 - LETTERS_CNT); +} +function breakBetweenGraphemeBreakType(breakTypeA, breakTypeB) { + if (breakTypeA === 0) { + return breakTypeB !== 5 && breakTypeB !== 7; + } + if (breakTypeA === 2) { + if (breakTypeB === 3) { + return false; + } + } + if (breakTypeA === 4 || breakTypeA === 2 || breakTypeA === 3) { + return true; + } + if (breakTypeB === 4 || breakTypeB === 2 || breakTypeB === 3) { + return true; + } + if (breakTypeA === 8) { + if (breakTypeB === 8 || breakTypeB === 9 || breakTypeB === 11 || breakTypeB === 12) { + return false; + } + } + if (breakTypeA === 11 || breakTypeA === 9) { + if (breakTypeB === 9 || breakTypeB === 10) { + return false; + } + } + if (breakTypeA === 12 || breakTypeA === 10) { + if (breakTypeB === 10) { + return false; + } + } + if (breakTypeB === 5 || breakTypeB === 13) { + return false; + } + if (breakTypeB === 7) { + return false; + } + if (breakTypeA === 1) { + return false; + } + if (breakTypeA === 13 && breakTypeB === 14) { + return false; + } + if (breakTypeA === 6 && breakTypeB === 6) { + return false; + } + return true; +} +function getGraphemeBreakRawData() { + return JSON.parse("[0,0,0,51229,51255,12,44061,44087,12,127462,127487,6,7083,7085,5,47645,47671,12,54813,54839,12,128678,128678,14,3270,3270,5,9919,9923,14,45853,45879,12,49437,49463,12,53021,53047,12,71216,71218,7,128398,128399,14,129360,129374,14,2519,2519,5,4448,4519,9,9742,9742,14,12336,12336,14,44957,44983,12,46749,46775,12,48541,48567,12,50333,50359,12,52125,52151,12,53917,53943,12,69888,69890,5,73018,73018,5,127990,127990,14,128558,128559,14,128759,128760,14,129653,129655,14,2027,2035,5,2891,2892,7,3761,3761,5,6683,6683,5,8293,8293,4,9825,9826,14,9999,9999,14,43452,43453,5,44509,44535,12,45405,45431,12,46301,46327,12,47197,47223,12,48093,48119,12,48989,49015,12,49885,49911,12,50781,50807,12,51677,51703,12,52573,52599,12,53469,53495,12,54365,54391,12,65279,65279,4,70471,70472,7,72145,72147,7,119173,119179,5,127799,127818,14,128240,128244,14,128512,128512,14,128652,128652,14,128721,128722,14,129292,129292,14,129445,129450,14,129734,129743,14,1476,1477,5,2366,2368,7,2750,2752,7,3076,3076,5,3415,3415,5,4141,4144,5,6109,6109,5,6964,6964,5,7394,7400,5,9197,9198,14,9770,9770,14,9877,9877,14,9968,9969,14,10084,10084,14,43052,43052,5,43713,43713,5,44285,44311,12,44733,44759,12,45181,45207,12,45629,45655,12,46077,46103,12,46525,46551,12,46973,46999,12,47421,47447,12,47869,47895,12,48317,48343,12,48765,48791,12,49213,49239,12,49661,49687,12,50109,50135,12,50557,50583,12,51005,51031,12,51453,51479,12,51901,51927,12,52349,52375,12,52797,52823,12,53245,53271,12,53693,53719,12,54141,54167,12,54589,54615,12,55037,55063,12,69506,69509,5,70191,70193,5,70841,70841,7,71463,71467,5,72330,72342,5,94031,94031,5,123628,123631,5,127763,127765,14,127941,127941,14,128043,128062,14,128302,128317,14,128465,128467,14,128539,128539,14,128640,128640,14,128662,128662,14,128703,128703,14,128745,128745,14,129004,129007,14,129329,129330,14,129402,129402,14,129483,129483,14,129686,129704,14,130048,131069,14,173,173,4,1757,1757,1,2200,2207,5,2434,2435,7,2631,2632,5,2817,2817,5,3008,3008,5,3201,3201,5,3387,3388,5,3542,3542,5,3902,3903,7,4190,4192,5,6002,6003,5,6439,6440,5,6765,6770,7,7019,7027,5,7154,7155,7,8205,8205,13,8505,8505,14,9654,9654,14,9757,9757,14,9792,9792,14,9852,9853,14,9890,9894,14,9937,9937,14,9981,9981,14,10035,10036,14,11035,11036,14,42654,42655,5,43346,43347,7,43587,43587,5,44006,44007,7,44173,44199,12,44397,44423,12,44621,44647,12,44845,44871,12,45069,45095,12,45293,45319,12,45517,45543,12,45741,45767,12,45965,45991,12,46189,46215,12,46413,46439,12,46637,46663,12,46861,46887,12,47085,47111,12,47309,47335,12,47533,47559,12,47757,47783,12,47981,48007,12,48205,48231,12,48429,48455,12,48653,48679,12,48877,48903,12,49101,49127,12,49325,49351,12,49549,49575,12,49773,49799,12,49997,50023,12,50221,50247,12,50445,50471,12,50669,50695,12,50893,50919,12,51117,51143,12,51341,51367,12,51565,51591,12,51789,51815,12,52013,52039,12,52237,52263,12,52461,52487,12,52685,52711,12,52909,52935,12,53133,53159,12,53357,53383,12,53581,53607,12,53805,53831,12,54029,54055,12,54253,54279,12,54477,54503,12,54701,54727,12,54925,54951,12,55149,55175,12,68101,68102,5,69762,69762,7,70067,70069,7,70371,70378,5,70720,70721,7,71087,71087,5,71341,71341,5,71995,71996,5,72249,72249,7,72850,72871,5,73109,73109,5,118576,118598,5,121505,121519,5,127245,127247,14,127568,127569,14,127777,127777,14,127872,127891,14,127956,127967,14,128015,128016,14,128110,128172,14,128259,128259,14,128367,128368,14,128424,128424,14,128488,128488,14,128530,128532,14,128550,128551,14,128566,128566,14,128647,128647,14,128656,128656,14,128667,128673,14,128691,128693,14,128715,128715,14,128728,128732,14,128752,128752,14,128765,128767,14,129096,129103,14,129311,129311,14,129344,129349,14,129394,129394,14,129413,129425,14,129466,129471,14,129511,129535,14,129664,129666,14,129719,129722,14,129760,129767,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2307,2307,7,2382,2383,7,2497,2500,5,2563,2563,7,2677,2677,5,2763,2764,7,2879,2879,5,2914,2915,5,3021,3021,5,3142,3144,5,3263,3263,5,3285,3286,5,3398,3400,7,3530,3530,5,3633,3633,5,3864,3865,5,3974,3975,5,4155,4156,7,4229,4230,5,5909,5909,7,6078,6085,7,6277,6278,5,6451,6456,7,6744,6750,5,6846,6846,5,6972,6972,5,7074,7077,5,7146,7148,7,7222,7223,5,7416,7417,5,8234,8238,4,8417,8417,5,9000,9000,14,9203,9203,14,9730,9731,14,9748,9749,14,9762,9763,14,9776,9783,14,9800,9811,14,9831,9831,14,9872,9873,14,9882,9882,14,9900,9903,14,9929,9933,14,9941,9960,14,9974,9974,14,9989,9989,14,10006,10006,14,10062,10062,14,10160,10160,14,11647,11647,5,12953,12953,14,43019,43019,5,43232,43249,5,43443,43443,5,43567,43568,7,43696,43696,5,43765,43765,7,44013,44013,5,44117,44143,12,44229,44255,12,44341,44367,12,44453,44479,12,44565,44591,12,44677,44703,12,44789,44815,12,44901,44927,12,45013,45039,12,45125,45151,12,45237,45263,12,45349,45375,12,45461,45487,12,45573,45599,12,45685,45711,12,45797,45823,12,45909,45935,12,46021,46047,12,46133,46159,12,46245,46271,12,46357,46383,12,46469,46495,12,46581,46607,12,46693,46719,12,46805,46831,12,46917,46943,12,47029,47055,12,47141,47167,12,47253,47279,12,47365,47391,12,47477,47503,12,47589,47615,12,47701,47727,12,47813,47839,12,47925,47951,12,48037,48063,12,48149,48175,12,48261,48287,12,48373,48399,12,48485,48511,12,48597,48623,12,48709,48735,12,48821,48847,12,48933,48959,12,49045,49071,12,49157,49183,12,49269,49295,12,49381,49407,12,49493,49519,12,49605,49631,12,49717,49743,12,49829,49855,12,49941,49967,12,50053,50079,12,50165,50191,12,50277,50303,12,50389,50415,12,50501,50527,12,50613,50639,12,50725,50751,12,50837,50863,12,50949,50975,12,51061,51087,12,51173,51199,12,51285,51311,12,51397,51423,12,51509,51535,12,51621,51647,12,51733,51759,12,51845,51871,12,51957,51983,12,52069,52095,12,52181,52207,12,52293,52319,12,52405,52431,12,52517,52543,12,52629,52655,12,52741,52767,12,52853,52879,12,52965,52991,12,53077,53103,12,53189,53215,12,53301,53327,12,53413,53439,12,53525,53551,12,53637,53663,12,53749,53775,12,53861,53887,12,53973,53999,12,54085,54111,12,54197,54223,12,54309,54335,12,54421,54447,12,54533,54559,12,54645,54671,12,54757,54783,12,54869,54895,12,54981,55007,12,55093,55119,12,55243,55291,10,66045,66045,5,68325,68326,5,69688,69702,5,69817,69818,5,69957,69958,7,70089,70092,5,70198,70199,5,70462,70462,5,70502,70508,5,70750,70750,5,70846,70846,7,71100,71101,5,71230,71230,7,71351,71351,5,71737,71738,5,72000,72000,7,72160,72160,5,72273,72278,5,72752,72758,5,72882,72883,5,73031,73031,5,73461,73462,7,94192,94193,7,119149,119149,7,121403,121452,5,122915,122916,5,126980,126980,14,127358,127359,14,127535,127535,14,127759,127759,14,127771,127771,14,127792,127793,14,127825,127867,14,127897,127899,14,127945,127945,14,127985,127986,14,128000,128007,14,128021,128021,14,128066,128100,14,128184,128235,14,128249,128252,14,128266,128276,14,128335,128335,14,128379,128390,14,128407,128419,14,128444,128444,14,128481,128481,14,128499,128499,14,128526,128526,14,128536,128536,14,128543,128543,14,128556,128556,14,128564,128564,14,128577,128580,14,128643,128645,14,128649,128649,14,128654,128654,14,128660,128660,14,128664,128664,14,128675,128675,14,128686,128689,14,128695,128696,14,128705,128709,14,128717,128719,14,128725,128725,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129009,129023,14,129160,129167,14,129296,129304,14,129320,129327,14,129340,129342,14,129356,129356,14,129388,129392,14,129399,129400,14,129404,129407,14,129432,129442,14,129454,129455,14,129473,129474,14,129485,129487,14,129648,129651,14,129659,129660,14,129671,129679,14,129709,129711,14,129728,129730,14,129751,129753,14,129776,129782,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2274,2274,1,2363,2363,7,2377,2380,7,2402,2403,5,2494,2494,5,2507,2508,7,2558,2558,5,2622,2624,7,2641,2641,5,2691,2691,7,2759,2760,5,2786,2787,5,2876,2876,5,2881,2884,5,2901,2902,5,3006,3006,5,3014,3016,7,3072,3072,5,3134,3136,5,3157,3158,5,3260,3260,5,3266,3266,5,3274,3275,7,3328,3329,5,3391,3392,7,3405,3405,5,3457,3457,5,3536,3537,7,3551,3551,5,3636,3642,5,3764,3772,5,3895,3895,5,3967,3967,7,3993,4028,5,4146,4151,5,4182,4183,7,4226,4226,5,4253,4253,5,4957,4959,5,5940,5940,7,6070,6070,7,6087,6088,7,6158,6158,4,6432,6434,5,6448,6449,7,6679,6680,5,6742,6742,5,6754,6754,5,6783,6783,5,6912,6915,5,6966,6970,5,6978,6978,5,7042,7042,7,7080,7081,5,7143,7143,7,7150,7150,7,7212,7219,5,7380,7392,5,7412,7412,5,8203,8203,4,8232,8232,4,8265,8265,14,8400,8412,5,8421,8432,5,8617,8618,14,9167,9167,14,9200,9200,14,9410,9410,14,9723,9726,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9774,14,9786,9786,14,9794,9794,14,9823,9823,14,9828,9828,14,9833,9850,14,9855,9855,14,9875,9875,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9935,9935,14,9939,9939,14,9962,9962,14,9972,9972,14,9978,9978,14,9986,9986,14,9997,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10133,10135,14,10548,10549,14,11093,11093,14,12330,12333,5,12441,12442,5,42608,42610,5,43010,43010,5,43045,43046,5,43188,43203,7,43302,43309,5,43392,43394,5,43446,43449,5,43493,43493,5,43571,43572,7,43597,43597,7,43703,43704,5,43756,43757,5,44003,44004,7,44009,44010,7,44033,44059,12,44089,44115,12,44145,44171,12,44201,44227,12,44257,44283,12,44313,44339,12,44369,44395,12,44425,44451,12,44481,44507,12,44537,44563,12,44593,44619,12,44649,44675,12,44705,44731,12,44761,44787,12,44817,44843,12,44873,44899,12,44929,44955,12,44985,45011,12,45041,45067,12,45097,45123,12,45153,45179,12,45209,45235,12,45265,45291,12,45321,45347,12,45377,45403,12,45433,45459,12,45489,45515,12,45545,45571,12,45601,45627,12,45657,45683,12,45713,45739,12,45769,45795,12,45825,45851,12,45881,45907,12,45937,45963,12,45993,46019,12,46049,46075,12,46105,46131,12,46161,46187,12,46217,46243,12,46273,46299,12,46329,46355,12,46385,46411,12,46441,46467,12,46497,46523,12,46553,46579,12,46609,46635,12,46665,46691,12,46721,46747,12,46777,46803,12,46833,46859,12,46889,46915,12,46945,46971,12,47001,47027,12,47057,47083,12,47113,47139,12,47169,47195,12,47225,47251,12,47281,47307,12,47337,47363,12,47393,47419,12,47449,47475,12,47505,47531,12,47561,47587,12,47617,47643,12,47673,47699,12,47729,47755,12,47785,47811,12,47841,47867,12,47897,47923,12,47953,47979,12,48009,48035,12,48065,48091,12,48121,48147,12,48177,48203,12,48233,48259,12,48289,48315,12,48345,48371,12,48401,48427,12,48457,48483,12,48513,48539,12,48569,48595,12,48625,48651,12,48681,48707,12,48737,48763,12,48793,48819,12,48849,48875,12,48905,48931,12,48961,48987,12,49017,49043,12,49073,49099,12,49129,49155,12,49185,49211,12,49241,49267,12,49297,49323,12,49353,49379,12,49409,49435,12,49465,49491,12,49521,49547,12,49577,49603,12,49633,49659,12,49689,49715,12,49745,49771,12,49801,49827,12,49857,49883,12,49913,49939,12,49969,49995,12,50025,50051,12,50081,50107,12,50137,50163,12,50193,50219,12,50249,50275,12,50305,50331,12,50361,50387,12,50417,50443,12,50473,50499,12,50529,50555,12,50585,50611,12,50641,50667,12,50697,50723,12,50753,50779,12,50809,50835,12,50865,50891,12,50921,50947,12,50977,51003,12,51033,51059,12,51089,51115,12,51145,51171,12,51201,51227,12,51257,51283,12,51313,51339,12,51369,51395,12,51425,51451,12,51481,51507,12,51537,51563,12,51593,51619,12,51649,51675,12,51705,51731,12,51761,51787,12,51817,51843,12,51873,51899,12,51929,51955,12,51985,52011,12,52041,52067,12,52097,52123,12,52153,52179,12,52209,52235,12,52265,52291,12,52321,52347,12,52377,52403,12,52433,52459,12,52489,52515,12,52545,52571,12,52601,52627,12,52657,52683,12,52713,52739,12,52769,52795,12,52825,52851,12,52881,52907,12,52937,52963,12,52993,53019,12,53049,53075,12,53105,53131,12,53161,53187,12,53217,53243,12,53273,53299,12,53329,53355,12,53385,53411,12,53441,53467,12,53497,53523,12,53553,53579,12,53609,53635,12,53665,53691,12,53721,53747,12,53777,53803,12,53833,53859,12,53889,53915,12,53945,53971,12,54001,54027,12,54057,54083,12,54113,54139,12,54169,54195,12,54225,54251,12,54281,54307,12,54337,54363,12,54393,54419,12,54449,54475,12,54505,54531,12,54561,54587,12,54617,54643,12,54673,54699,12,54729,54755,12,54785,54811,12,54841,54867,12,54897,54923,12,54953,54979,12,55009,55035,12,55065,55091,12,55121,55147,12,55177,55203,12,65024,65039,5,65520,65528,4,66422,66426,5,68152,68154,5,69291,69292,5,69633,69633,5,69747,69748,5,69811,69814,5,69826,69826,5,69932,69932,7,70016,70017,5,70079,70080,7,70095,70095,5,70196,70196,5,70367,70367,5,70402,70403,7,70464,70464,5,70487,70487,5,70709,70711,7,70725,70725,7,70833,70834,7,70843,70844,7,70849,70849,7,71090,71093,5,71103,71104,5,71227,71228,7,71339,71339,5,71344,71349,5,71458,71461,5,71727,71735,5,71985,71989,7,71998,71998,5,72002,72002,7,72154,72155,5,72193,72202,5,72251,72254,5,72281,72283,5,72344,72345,5,72766,72766,7,72874,72880,5,72885,72886,5,73023,73029,5,73104,73105,5,73111,73111,5,92912,92916,5,94095,94098,5,113824,113827,4,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,125252,125258,5,127183,127183,14,127340,127343,14,127377,127386,14,127491,127503,14,127548,127551,14,127744,127756,14,127761,127761,14,127769,127769,14,127773,127774,14,127780,127788,14,127796,127797,14,127820,127823,14,127869,127869,14,127894,127895,14,127902,127903,14,127943,127943,14,127947,127950,14,127972,127972,14,127988,127988,14,127992,127994,14,128009,128011,14,128019,128019,14,128023,128041,14,128064,128064,14,128102,128107,14,128174,128181,14,128238,128238,14,128246,128247,14,128254,128254,14,128264,128264,14,128278,128299,14,128329,128330,14,128348,128359,14,128371,128377,14,128392,128393,14,128401,128404,14,128421,128421,14,128433,128434,14,128450,128452,14,128476,128478,14,128483,128483,14,128495,128495,14,128506,128506,14,128519,128520,14,128528,128528,14,128534,128534,14,128538,128538,14,128540,128542,14,128544,128549,14,128552,128555,14,128557,128557,14,128560,128563,14,128565,128565,14,128567,128576,14,128581,128591,14,128641,128642,14,128646,128646,14,128648,128648,14,128650,128651,14,128653,128653,14,128655,128655,14,128657,128659,14,128661,128661,14,128663,128663,14,128665,128666,14,128674,128674,14,128676,128677,14,128679,128685,14,128690,128690,14,128694,128694,14,128697,128702,14,128704,128704,14,128710,128714,14,128716,128716,14,128720,128720,14,128723,128724,14,128726,128727,14,128733,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129008,129008,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129661,129663,14,129667,129670,14,129680,129685,14,129705,129708,14,129712,129718,14,129723,129727,14,129731,129733,14,129744,129750,14,129754,129759,14,129768,129775,14,129783,129791,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2192,2193,1,2250,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3132,3132,5,3137,3140,7,3146,3149,5,3170,3171,5,3202,3203,7,3262,3262,7,3264,3265,7,3267,3268,7,3271,3272,7,3276,3277,5,3298,3299,5,3330,3331,7,3390,3390,5,3393,3396,5,3402,3404,7,3406,3406,1,3426,3427,5,3458,3459,7,3535,3535,5,3538,3540,5,3544,3550,7,3570,3571,7,3635,3635,7,3655,3662,5,3763,3763,7,3784,3789,5,3893,3893,5,3897,3897,5,3953,3966,5,3968,3972,5,3981,3991,5,4038,4038,5,4145,4145,7,4153,4154,5,4157,4158,5,4184,4185,5,4209,4212,5,4228,4228,7,4237,4237,5,4352,4447,8,4520,4607,10,5906,5908,5,5938,5939,5,5970,5971,5,6068,6069,5,6071,6077,5,6086,6086,5,6089,6099,5,6155,6157,5,6159,6159,5,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6862,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7679,5,8204,8204,5,8206,8207,4,8233,8233,4,8252,8252,14,8288,8292,4,8294,8303,4,8413,8416,5,8418,8420,5,8482,8482,14,8596,8601,14,8986,8987,14,9096,9096,14,9193,9196,14,9199,9199,14,9201,9202,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9729,14,9732,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9775,9775,14,9784,9785,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9874,14,9876,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9934,14,9936,9936,14,9938,9938,14,9940,9940,14,9961,9961,14,9963,9967,14,9970,9971,14,9973,9973,14,9975,9977,14,9979,9980,14,9982,9985,14,9987,9988,14,9992,9996,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10083,14,10085,10087,14,10145,10145,14,10175,10175,14,11013,11015,14,11088,11088,14,11503,11505,5,11744,11775,5,12334,12335,5,12349,12349,14,12951,12951,14,42607,42607,5,42612,42621,5,42736,42737,5,43014,43014,5,43043,43044,7,43047,43047,7,43136,43137,7,43204,43205,5,43263,43263,5,43335,43345,5,43360,43388,8,43395,43395,7,43444,43445,7,43450,43451,7,43454,43456,7,43561,43566,5,43569,43570,5,43573,43574,5,43596,43596,5,43644,43644,5,43698,43700,5,43710,43711,5,43755,43755,7,43758,43759,7,43766,43766,5,44005,44005,5,44008,44008,5,44012,44012,7,44032,44032,11,44060,44060,11,44088,44088,11,44116,44116,11,44144,44144,11,44172,44172,11,44200,44200,11,44228,44228,11,44256,44256,11,44284,44284,11,44312,44312,11,44340,44340,11,44368,44368,11,44396,44396,11,44424,44424,11,44452,44452,11,44480,44480,11,44508,44508,11,44536,44536,11,44564,44564,11,44592,44592,11,44620,44620,11,44648,44648,11,44676,44676,11,44704,44704,11,44732,44732,11,44760,44760,11,44788,44788,11,44816,44816,11,44844,44844,11,44872,44872,11,44900,44900,11,44928,44928,11,44956,44956,11,44984,44984,11,45012,45012,11,45040,45040,11,45068,45068,11,45096,45096,11,45124,45124,11,45152,45152,11,45180,45180,11,45208,45208,11,45236,45236,11,45264,45264,11,45292,45292,11,45320,45320,11,45348,45348,11,45376,45376,11,45404,45404,11,45432,45432,11,45460,45460,11,45488,45488,11,45516,45516,11,45544,45544,11,45572,45572,11,45600,45600,11,45628,45628,11,45656,45656,11,45684,45684,11,45712,45712,11,45740,45740,11,45768,45768,11,45796,45796,11,45824,45824,11,45852,45852,11,45880,45880,11,45908,45908,11,45936,45936,11,45964,45964,11,45992,45992,11,46020,46020,11,46048,46048,11,46076,46076,11,46104,46104,11,46132,46132,11,46160,46160,11,46188,46188,11,46216,46216,11,46244,46244,11,46272,46272,11,46300,46300,11,46328,46328,11,46356,46356,11,46384,46384,11,46412,46412,11,46440,46440,11,46468,46468,11,46496,46496,11,46524,46524,11,46552,46552,11,46580,46580,11,46608,46608,11,46636,46636,11,46664,46664,11,46692,46692,11,46720,46720,11,46748,46748,11,46776,46776,11,46804,46804,11,46832,46832,11,46860,46860,11,46888,46888,11,46916,46916,11,46944,46944,11,46972,46972,11,47000,47000,11,47028,47028,11,47056,47056,11,47084,47084,11,47112,47112,11,47140,47140,11,47168,47168,11,47196,47196,11,47224,47224,11,47252,47252,11,47280,47280,11,47308,47308,11,47336,47336,11,47364,47364,11,47392,47392,11,47420,47420,11,47448,47448,11,47476,47476,11,47504,47504,11,47532,47532,11,47560,47560,11,47588,47588,11,47616,47616,11,47644,47644,11,47672,47672,11,47700,47700,11,47728,47728,11,47756,47756,11,47784,47784,11,47812,47812,11,47840,47840,11,47868,47868,11,47896,47896,11,47924,47924,11,47952,47952,11,47980,47980,11,48008,48008,11,48036,48036,11,48064,48064,11,48092,48092,11,48120,48120,11,48148,48148,11,48176,48176,11,48204,48204,11,48232,48232,11,48260,48260,11,48288,48288,11,48316,48316,11,48344,48344,11,48372,48372,11,48400,48400,11,48428,48428,11,48456,48456,11,48484,48484,11,48512,48512,11,48540,48540,11,48568,48568,11,48596,48596,11,48624,48624,11,48652,48652,11,48680,48680,11,48708,48708,11,48736,48736,11,48764,48764,11,48792,48792,11,48820,48820,11,48848,48848,11,48876,48876,11,48904,48904,11,48932,48932,11,48960,48960,11,48988,48988,11,49016,49016,11,49044,49044,11,49072,49072,11,49100,49100,11,49128,49128,11,49156,49156,11,49184,49184,11,49212,49212,11,49240,49240,11,49268,49268,11,49296,49296,11,49324,49324,11,49352,49352,11,49380,49380,11,49408,49408,11,49436,49436,11,49464,49464,11,49492,49492,11,49520,49520,11,49548,49548,11,49576,49576,11,49604,49604,11,49632,49632,11,49660,49660,11,49688,49688,11,49716,49716,11,49744,49744,11,49772,49772,11,49800,49800,11,49828,49828,11,49856,49856,11,49884,49884,11,49912,49912,11,49940,49940,11,49968,49968,11,49996,49996,11,50024,50024,11,50052,50052,11,50080,50080,11,50108,50108,11,50136,50136,11,50164,50164,11,50192,50192,11,50220,50220,11,50248,50248,11,50276,50276,11,50304,50304,11,50332,50332,11,50360,50360,11,50388,50388,11,50416,50416,11,50444,50444,11,50472,50472,11,50500,50500,11,50528,50528,11,50556,50556,11,50584,50584,11,50612,50612,11,50640,50640,11,50668,50668,11,50696,50696,11,50724,50724,11,50752,50752,11,50780,50780,11,50808,50808,11,50836,50836,11,50864,50864,11,50892,50892,11,50920,50920,11,50948,50948,11,50976,50976,11,51004,51004,11,51032,51032,11,51060,51060,11,51088,51088,11,51116,51116,11,51144,51144,11,51172,51172,11,51200,51200,11,51228,51228,11,51256,51256,11,51284,51284,11,51312,51312,11,51340,51340,11,51368,51368,11,51396,51396,11,51424,51424,11,51452,51452,11,51480,51480,11,51508,51508,11,51536,51536,11,51564,51564,11,51592,51592,11,51620,51620,11,51648,51648,11,51676,51676,11,51704,51704,11,51732,51732,11,51760,51760,11,51788,51788,11,51816,51816,11,51844,51844,11,51872,51872,11,51900,51900,11,51928,51928,11,51956,51956,11,51984,51984,11,52012,52012,11,52040,52040,11,52068,52068,11,52096,52096,11,52124,52124,11,52152,52152,11,52180,52180,11,52208,52208,11,52236,52236,11,52264,52264,11,52292,52292,11,52320,52320,11,52348,52348,11,52376,52376,11,52404,52404,11,52432,52432,11,52460,52460,11,52488,52488,11,52516,52516,11,52544,52544,11,52572,52572,11,52600,52600,11,52628,52628,11,52656,52656,11,52684,52684,11,52712,52712,11,52740,52740,11,52768,52768,11,52796,52796,11,52824,52824,11,52852,52852,11,52880,52880,11,52908,52908,11,52936,52936,11,52964,52964,11,52992,52992,11,53020,53020,11,53048,53048,11,53076,53076,11,53104,53104,11,53132,53132,11,53160,53160,11,53188,53188,11,53216,53216,11,53244,53244,11,53272,53272,11,53300,53300,11,53328,53328,11,53356,53356,11,53384,53384,11,53412,53412,11,53440,53440,11,53468,53468,11,53496,53496,11,53524,53524,11,53552,53552,11,53580,53580,11,53608,53608,11,53636,53636,11,53664,53664,11,53692,53692,11,53720,53720,11,53748,53748,11,53776,53776,11,53804,53804,11,53832,53832,11,53860,53860,11,53888,53888,11,53916,53916,11,53944,53944,11,53972,53972,11,54000,54000,11,54028,54028,11,54056,54056,11,54084,54084,11,54112,54112,11,54140,54140,11,54168,54168,11,54196,54196,11,54224,54224,11,54252,54252,11,54280,54280,11,54308,54308,11,54336,54336,11,54364,54364,11,54392,54392,11,54420,54420,11,54448,54448,11,54476,54476,11,54504,54504,11,54532,54532,11,54560,54560,11,54588,54588,11,54616,54616,11,54644,54644,11,54672,54672,11,54700,54700,11,54728,54728,11,54756,54756,11,54784,54784,11,54812,54812,11,54840,54840,11,54868,54868,11,54896,54896,11,54924,54924,11,54952,54952,11,54980,54980,11,55008,55008,11,55036,55036,11,55064,55064,11,55092,55092,11,55120,55120,11,55148,55148,11,55176,55176,11,55216,55238,9,64286,64286,5,65056,65071,5,65438,65439,5,65529,65531,4,66272,66272,5,68097,68099,5,68108,68111,5,68159,68159,5,68900,68903,5,69446,69456,5,69632,69632,7,69634,69634,7,69744,69744,5,69759,69761,5,69808,69810,7,69815,69816,7,69821,69821,1,69837,69837,1,69927,69931,5,69933,69940,5,70003,70003,5,70018,70018,7,70070,70078,5,70082,70083,1,70094,70094,7,70188,70190,7,70194,70195,7,70197,70197,7,70206,70206,5,70368,70370,7,70400,70401,5,70459,70460,5,70463,70463,7,70465,70468,7,70475,70477,7,70498,70499,7,70512,70516,5,70712,70719,5,70722,70724,5,70726,70726,5,70832,70832,5,70835,70840,5,70842,70842,5,70845,70845,5,70847,70848,5,70850,70851,5,71088,71089,7,71096,71099,7,71102,71102,7,71132,71133,5,71219,71226,5,71229,71229,5,71231,71232,5,71340,71340,7,71342,71343,7,71350,71350,7,71453,71455,5,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,118528,118573,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123566,123566,5,125136,125142,5,126976,126979,14,126981,127182,14,127184,127231,14,127279,127279,14,127344,127345,14,127374,127374,14,127405,127461,14,127489,127490,14,127514,127514,14,127538,127546,14,127561,127567,14,127570,127743,14,127757,127758,14,127760,127760,14,127762,127762,14,127766,127768,14,127770,127770,14,127772,127772,14,127775,127776,14,127778,127779,14,127789,127791,14,127794,127795,14,127798,127798,14,127819,127819,14,127824,127824,14,127868,127868,14,127870,127871,14,127892,127893,14,127896,127896,14,127900,127901,14,127904,127940,14,127942,127942,14,127944,127944,14,127946,127946,14,127951,127955,14,127968,127971,14,127973,127984,14,127987,127987,14,127989,127989,14,127991,127991,14,127995,127999,5,128008,128008,14,128012,128014,14,128017,128018,14,128020,128020,14,128022,128022,14,128042,128042,14,128063,128063,14,128065,128065,14,128101,128101,14,128108,128109,14,128173,128173,14,128182,128183,14,128236,128237,14,128239,128239,14,128245,128245,14,128248,128248,14,128253,128253,14,128255,128258,14,128260,128263,14,128265,128265,14,128277,128277,14,128300,128301,14,128326,128328,14,128331,128334,14,128336,128347,14,128360,128366,14,128369,128370,14,128378,128378,14,128391,128391,14,128394,128397,14,128400,128400,14,128405,128406,14,128420,128420,14,128422,128423,14,128425,128432,14,128435,128443,14,128445,128449,14,128453,128464,14,128468,128475,14,128479,128480,14,128482,128482,14,128484,128487,14,128489,128494,14,128496,128498,14,128500,128505,14,128507,128511,14,128513,128518,14,128521,128525,14,128527,128527,14,128529,128529,14,128533,128533,14,128535,128535,14,128537,128537,14]"); +} +function getLeftDeleteOffset(offset, str) { + if (offset === 0) { + return 0; + } + const emojiOffset = getOffsetBeforeLastEmojiComponent(offset, str); + if (emojiOffset !== void 0) { + return emojiOffset; + } + const iterator = new CodePointIterator(str, offset); + iterator.prevCodePoint(); + return iterator.offset; +} +function getOffsetBeforeLastEmojiComponent(initialOffset, str) { + const iterator = new CodePointIterator(str, initialOffset); + let codePoint = iterator.prevCodePoint(); + while (isEmojiModifier(codePoint) || codePoint === 65039 || codePoint === 8419) { + if (iterator.offset === 0) { + return void 0; + } + codePoint = iterator.prevCodePoint(); + } + if (!isEmojiImprecise(codePoint)) { + return void 0; + } + let resultOffset = iterator.offset; + if (resultOffset > 0) { + const optionalZwjCodePoint = iterator.prevCodePoint(); + if (optionalZwjCodePoint === 8205) { + resultOffset = iterator.offset; + } + } + return resultOffset; +} +function isEmojiModifier(codePoint) { + return 127995 <= codePoint && codePoint <= 127999; +} +var _formatRegexp, CodePointIterator, GraphemeIterator, CONTAINS_RTL, IS_BASIC_ASCII, UNUSUAL_LINE_TERMINATORS, CSI_SEQUENCE, OSC_SEQUENCE, ESC_SEQUENCE, CONTROL_SEQUENCES, UTF8_BOM_CHARACTER, GraphemeBreakTree, noBreakWhitespace, AmbiguousCharacters, InvisibleCharacters; +var init_strings = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/common/strings.js"() { + init_cache(); + init_lazy(); + _formatRegexp = /{(\d+)}/g; + CodePointIterator = class { + get offset() { + return this._offset; + } + constructor(str, offset = 0) { + this._str = str; + this._len = str.length; + this._offset = offset; + } + setOffset(offset) { + this._offset = offset; + } + prevCodePoint() { + const codePoint = getPrevCodePoint(this._str, this._offset); + this._offset -= codePoint >= 65536 ? 2 : 1; + return codePoint; + } + nextCodePoint() { + const codePoint = getNextCodePoint(this._str, this._len, this._offset); + this._offset += codePoint >= 65536 ? 2 : 1; + return codePoint; + } + eol() { + return this._offset >= this._len; + } + }; + GraphemeIterator = class { + get offset() { + return this._iterator.offset; + } + constructor(str, offset = 0) { + this._iterator = new CodePointIterator(str, offset); + } + nextGraphemeLength() { + const graphemeBreakTree = GraphemeBreakTree.getInstance(); + const iterator = this._iterator; + const initialOffset = iterator.offset; + let graphemeBreakType = graphemeBreakTree.getGraphemeBreakType(iterator.nextCodePoint()); + while (!iterator.eol()) { + const offset = iterator.offset; + const nextGraphemeBreakType = graphemeBreakTree.getGraphemeBreakType(iterator.nextCodePoint()); + if (breakBetweenGraphemeBreakType(graphemeBreakType, nextGraphemeBreakType)) { + iterator.setOffset(offset); + break; + } + graphemeBreakType = nextGraphemeBreakType; + } + return iterator.offset - initialOffset; + } + prevGraphemeLength() { + const graphemeBreakTree = GraphemeBreakTree.getInstance(); + const iterator = this._iterator; + const initialOffset = iterator.offset; + let graphemeBreakType = graphemeBreakTree.getGraphemeBreakType(iterator.prevCodePoint()); + while (iterator.offset > 0) { + const offset = iterator.offset; + const prevGraphemeBreakType = graphemeBreakTree.getGraphemeBreakType(iterator.prevCodePoint()); + if (breakBetweenGraphemeBreakType(prevGraphemeBreakType, graphemeBreakType)) { + iterator.setOffset(offset); + break; + } + graphemeBreakType = prevGraphemeBreakType; + } + return initialOffset - iterator.offset; + } + eol() { + return this._iterator.eol(); + } + }; + CONTAINS_RTL = void 0; + IS_BASIC_ASCII = /^[\t\n\r\x20-\x7E]*$/; + UNUSUAL_LINE_TERMINATORS = /[\u2028\u2029]/; + CSI_SEQUENCE = /(?:\x1b\[|\x9b)[=?>!]?[\d;:]*["$#'* ]?[a-zA-Z@^`{}|~]/; + OSC_SEQUENCE = /(?:\x1b\]|\x9d).*?(?:\x1b\\|\x07|\x9c)/; + ESC_SEQUENCE = /\x1b(?:[ #%\(\)\*\+\-\.\/]?[a-zA-Z0-9\|}~@])/; + CONTROL_SEQUENCES = new RegExp("(?:" + [ + CSI_SEQUENCE.source, + OSC_SEQUENCE.source, + ESC_SEQUENCE.source + ].join("|") + ")", "g"); + UTF8_BOM_CHARACTER = String.fromCharCode( + 65279 + /* CharCode.UTF8_BOM */ + ); + GraphemeBreakTree = class _GraphemeBreakTree { + static { + this._INSTANCE = null; + } + static getInstance() { + if (!_GraphemeBreakTree._INSTANCE) { + _GraphemeBreakTree._INSTANCE = new _GraphemeBreakTree(); + } + return _GraphemeBreakTree._INSTANCE; + } + constructor() { + this._data = getGraphemeBreakRawData(); + } + getGraphemeBreakType(codePoint) { + if (codePoint < 32) { + if (codePoint === 10) { + return 3; + } + if (codePoint === 13) { + return 2; + } + return 4; + } + if (codePoint < 127) { + return 0; + } + const data = this._data; + const nodeCount = data.length / 3; + let nodeIndex = 1; + while (nodeIndex <= nodeCount) { + if (codePoint < data[3 * nodeIndex]) { + nodeIndex = 2 * nodeIndex; + } else if (codePoint > data[3 * nodeIndex + 1]) { + nodeIndex = 2 * nodeIndex + 1; + } else { + return data[3 * nodeIndex + 2]; + } + } + return 0; + } + }; + noBreakWhitespace = "\xA0"; + AmbiguousCharacters = class _AmbiguousCharacters { + static { + this.ambiguousCharacterData = new Lazy(() => { + return JSON.parse('{"_common":[8232,32,8233,32,5760,32,8192,32,8193,32,8194,32,8195,32,8196,32,8197,32,8198,32,8200,32,8201,32,8202,32,8287,32,8199,32,8239,32,2042,95,65101,95,65102,95,65103,95,8208,45,8209,45,8210,45,65112,45,1748,45,8259,45,727,45,8722,45,10134,45,11450,45,1549,44,1643,44,184,44,42233,44,894,59,2307,58,2691,58,1417,58,1795,58,1796,58,5868,58,65072,58,6147,58,6153,58,8282,58,1475,58,760,58,42889,58,8758,58,720,58,42237,58,451,33,11601,33,660,63,577,63,2429,63,5038,63,42731,63,119149,46,8228,46,1793,46,1794,46,42510,46,68176,46,1632,46,1776,46,42232,46,1373,96,65287,96,8219,96,1523,96,8242,96,1370,96,8175,96,65344,96,900,96,8189,96,8125,96,8127,96,8190,96,697,96,884,96,712,96,714,96,715,96,756,96,699,96,701,96,700,96,702,96,42892,96,1497,96,2036,96,2037,96,5194,96,5836,96,94033,96,94034,96,65339,91,10088,40,10098,40,12308,40,64830,40,65341,93,10089,41,10099,41,12309,41,64831,41,10100,123,119060,123,10101,125,65342,94,8270,42,1645,42,8727,42,66335,42,5941,47,8257,47,8725,47,8260,47,9585,47,10187,47,10744,47,119354,47,12755,47,12339,47,11462,47,20031,47,12035,47,65340,92,65128,92,8726,92,10189,92,10741,92,10745,92,119311,92,119355,92,12756,92,20022,92,12034,92,42872,38,708,94,710,94,5869,43,10133,43,66203,43,8249,60,10094,60,706,60,119350,60,5176,60,5810,60,5120,61,11840,61,12448,61,42239,61,8250,62,10095,62,707,62,119351,62,5171,62,94015,62,8275,126,732,126,8128,126,8764,126,65372,124,65293,45,118002,50,120784,50,120794,50,120804,50,120814,50,120824,50,130034,50,42842,50,423,50,1000,50,42564,50,5311,50,42735,50,119302,51,118003,51,120785,51,120795,51,120805,51,120815,51,120825,51,130035,51,42923,51,540,51,439,51,42858,51,11468,51,1248,51,94011,51,71882,51,118004,52,120786,52,120796,52,120806,52,120816,52,120826,52,130036,52,5070,52,71855,52,118005,53,120787,53,120797,53,120807,53,120817,53,120827,53,130037,53,444,53,71867,53,118006,54,120788,54,120798,54,120808,54,120818,54,120828,54,130038,54,11474,54,5102,54,71893,54,119314,55,118007,55,120789,55,120799,55,120809,55,120819,55,120829,55,130039,55,66770,55,71878,55,2819,56,2538,56,2666,56,125131,56,118008,56,120790,56,120800,56,120810,56,120820,56,120830,56,130040,56,547,56,546,56,66330,56,2663,57,2920,57,2541,57,3437,57,118009,57,120791,57,120801,57,120811,57,120821,57,120831,57,130041,57,42862,57,11466,57,71884,57,71852,57,71894,57,9082,97,65345,97,119834,97,119886,97,119938,97,119990,97,120042,97,120094,97,120146,97,120198,97,120250,97,120302,97,120354,97,120406,97,120458,97,593,97,945,97,120514,97,120572,97,120630,97,120688,97,120746,97,65313,65,117974,65,119808,65,119860,65,119912,65,119964,65,120016,65,120068,65,120120,65,120172,65,120224,65,120276,65,120328,65,120380,65,120432,65,913,65,120488,65,120546,65,120604,65,120662,65,120720,65,5034,65,5573,65,42222,65,94016,65,66208,65,119835,98,119887,98,119939,98,119991,98,120043,98,120095,98,120147,98,120199,98,120251,98,120303,98,120355,98,120407,98,120459,98,388,98,5071,98,5234,98,5551,98,65314,66,8492,66,117975,66,119809,66,119861,66,119913,66,120017,66,120069,66,120121,66,120173,66,120225,66,120277,66,120329,66,120381,66,120433,66,42932,66,914,66,120489,66,120547,66,120605,66,120663,66,120721,66,5108,66,5623,66,42192,66,66178,66,66209,66,66305,66,65347,99,8573,99,119836,99,119888,99,119940,99,119992,99,120044,99,120096,99,120148,99,120200,99,120252,99,120304,99,120356,99,120408,99,120460,99,7428,99,1010,99,11429,99,43951,99,66621,99,128844,67,71913,67,71922,67,65315,67,8557,67,8450,67,8493,67,117976,67,119810,67,119862,67,119914,67,119966,67,120018,67,120174,67,120226,67,120278,67,120330,67,120382,67,120434,67,1017,67,11428,67,5087,67,42202,67,66210,67,66306,67,66581,67,66844,67,8574,100,8518,100,119837,100,119889,100,119941,100,119993,100,120045,100,120097,100,120149,100,120201,100,120253,100,120305,100,120357,100,120409,100,120461,100,1281,100,5095,100,5231,100,42194,100,8558,68,8517,68,117977,68,119811,68,119863,68,119915,68,119967,68,120019,68,120071,68,120123,68,120175,68,120227,68,120279,68,120331,68,120383,68,120435,68,5024,68,5598,68,5610,68,42195,68,8494,101,65349,101,8495,101,8519,101,119838,101,119890,101,119942,101,120046,101,120098,101,120150,101,120202,101,120254,101,120306,101,120358,101,120410,101,120462,101,43826,101,1213,101,8959,69,65317,69,8496,69,117978,69,119812,69,119864,69,119916,69,120020,69,120072,69,120124,69,120176,69,120228,69,120280,69,120332,69,120384,69,120436,69,917,69,120492,69,120550,69,120608,69,120666,69,120724,69,11577,69,5036,69,42224,69,71846,69,71854,69,66182,69,119839,102,119891,102,119943,102,119995,102,120047,102,120099,102,120151,102,120203,102,120255,102,120307,102,120359,102,120411,102,120463,102,43829,102,42905,102,383,102,7837,102,1412,102,119315,70,8497,70,117979,70,119813,70,119865,70,119917,70,120021,70,120073,70,120125,70,120177,70,120229,70,120281,70,120333,70,120385,70,120437,70,42904,70,988,70,120778,70,5556,70,42205,70,71874,70,71842,70,66183,70,66213,70,66853,70,65351,103,8458,103,119840,103,119892,103,119944,103,120048,103,120100,103,120152,103,120204,103,120256,103,120308,103,120360,103,120412,103,120464,103,609,103,7555,103,397,103,1409,103,117980,71,119814,71,119866,71,119918,71,119970,71,120022,71,120074,71,120126,71,120178,71,120230,71,120282,71,120334,71,120386,71,120438,71,1292,71,5056,71,5107,71,42198,71,65352,104,8462,104,119841,104,119945,104,119997,104,120049,104,120101,104,120153,104,120205,104,120257,104,120309,104,120361,104,120413,104,120465,104,1211,104,1392,104,5058,104,65320,72,8459,72,8460,72,8461,72,117981,72,119815,72,119867,72,119919,72,120023,72,120179,72,120231,72,120283,72,120335,72,120387,72,120439,72,919,72,120494,72,120552,72,120610,72,120668,72,120726,72,11406,72,5051,72,5500,72,42215,72,66255,72,731,105,9075,105,65353,105,8560,105,8505,105,8520,105,119842,105,119894,105,119946,105,119998,105,120050,105,120102,105,120154,105,120206,105,120258,105,120310,105,120362,105,120414,105,120466,105,120484,105,618,105,617,105,953,105,8126,105,890,105,120522,105,120580,105,120638,105,120696,105,120754,105,1110,105,42567,105,1231,105,43893,105,5029,105,71875,105,65354,106,8521,106,119843,106,119895,106,119947,106,119999,106,120051,106,120103,106,120155,106,120207,106,120259,106,120311,106,120363,106,120415,106,120467,106,1011,106,1112,106,65322,74,117983,74,119817,74,119869,74,119921,74,119973,74,120025,74,120077,74,120129,74,120181,74,120233,74,120285,74,120337,74,120389,74,120441,74,42930,74,895,74,1032,74,5035,74,5261,74,42201,74,119844,107,119896,107,119948,107,120000,107,120052,107,120104,107,120156,107,120208,107,120260,107,120312,107,120364,107,120416,107,120468,107,8490,75,65323,75,117984,75,119818,75,119870,75,119922,75,119974,75,120026,75,120078,75,120130,75,120182,75,120234,75,120286,75,120338,75,120390,75,120442,75,922,75,120497,75,120555,75,120613,75,120671,75,120729,75,11412,75,5094,75,5845,75,42199,75,66840,75,1472,108,8739,73,9213,73,65512,73,1633,108,1777,73,66336,108,125127,108,118001,108,120783,73,120793,73,120803,73,120813,73,120823,73,130033,73,65321,73,8544,73,8464,73,8465,73,117982,108,119816,73,119868,73,119920,73,120024,73,120128,73,120180,73,120232,73,120284,73,120336,73,120388,73,120440,73,65356,108,8572,73,8467,108,119845,108,119897,108,119949,108,120001,108,120053,108,120105,73,120157,73,120209,73,120261,73,120313,73,120365,73,120417,73,120469,73,448,73,120496,73,120554,73,120612,73,120670,73,120728,73,11410,73,1030,73,1216,73,1493,108,1503,108,1575,108,126464,108,126592,108,65166,108,65165,108,1994,108,11599,73,5825,73,42226,73,93992,73,66186,124,66313,124,119338,76,8556,76,8466,76,117985,76,119819,76,119871,76,119923,76,120027,76,120079,76,120131,76,120183,76,120235,76,120287,76,120339,76,120391,76,120443,76,11472,76,5086,76,5290,76,42209,76,93974,76,71843,76,71858,76,66587,76,66854,76,65325,77,8559,77,8499,77,117986,77,119820,77,119872,77,119924,77,120028,77,120080,77,120132,77,120184,77,120236,77,120288,77,120340,77,120392,77,120444,77,924,77,120499,77,120557,77,120615,77,120673,77,120731,77,1018,77,11416,77,5047,77,5616,77,5846,77,42207,77,66224,77,66321,77,119847,110,119899,110,119951,110,120003,110,120055,110,120107,110,120159,110,120211,110,120263,110,120315,110,120367,110,120419,110,120471,110,1400,110,1404,110,65326,78,8469,78,117987,78,119821,78,119873,78,119925,78,119977,78,120029,78,120081,78,120185,78,120237,78,120289,78,120341,78,120393,78,120445,78,925,78,120500,78,120558,78,120616,78,120674,78,120732,78,11418,78,42208,78,66835,78,3074,111,3202,111,3330,111,3458,111,2406,111,2662,111,2790,111,3046,111,3174,111,3302,111,3430,111,3664,111,3792,111,4160,111,1637,111,1781,111,65359,111,8500,111,119848,111,119900,111,119952,111,120056,111,120108,111,120160,111,120212,111,120264,111,120316,111,120368,111,120420,111,120472,111,7439,111,7441,111,43837,111,959,111,120528,111,120586,111,120644,111,120702,111,120760,111,963,111,120532,111,120590,111,120648,111,120706,111,120764,111,11423,111,4351,111,1413,111,1505,111,1607,111,126500,111,126564,111,126596,111,65259,111,65260,111,65258,111,65257,111,1726,111,64428,111,64429,111,64427,111,64426,111,1729,111,64424,111,64425,111,64423,111,64422,111,1749,111,3360,111,4125,111,66794,111,71880,111,71895,111,66604,111,1984,79,2534,79,2918,79,12295,79,70864,79,71904,79,118000,79,120782,79,120792,79,120802,79,120812,79,120822,79,130032,79,65327,79,117988,79,119822,79,119874,79,119926,79,119978,79,120030,79,120082,79,120134,79,120186,79,120238,79,120290,79,120342,79,120394,79,120446,79,927,79,120502,79,120560,79,120618,79,120676,79,120734,79,11422,79,1365,79,11604,79,4816,79,2848,79,66754,79,42227,79,71861,79,66194,79,66219,79,66564,79,66838,79,9076,112,65360,112,119849,112,119901,112,119953,112,120005,112,120057,112,120109,112,120161,112,120213,112,120265,112,120317,112,120369,112,120421,112,120473,112,961,112,120530,112,120544,112,120588,112,120602,112,120646,112,120660,112,120704,112,120718,112,120762,112,120776,112,11427,112,65328,80,8473,80,117989,80,119823,80,119875,80,119927,80,119979,80,120031,80,120083,80,120187,80,120239,80,120291,80,120343,80,120395,80,120447,80,929,80,120504,80,120562,80,120620,80,120678,80,120736,80,11426,80,5090,80,5229,80,42193,80,66197,80,119850,113,119902,113,119954,113,120006,113,120058,113,120110,113,120162,113,120214,113,120266,113,120318,113,120370,113,120422,113,120474,113,1307,113,1379,113,1382,113,8474,81,117990,81,119824,81,119876,81,119928,81,119980,81,120032,81,120084,81,120188,81,120240,81,120292,81,120344,81,120396,81,120448,81,11605,81,119851,114,119903,114,119955,114,120007,114,120059,114,120111,114,120163,114,120215,114,120267,114,120319,114,120371,114,120423,114,120475,114,43847,114,43848,114,7462,114,11397,114,43905,114,119318,82,8475,82,8476,82,8477,82,117991,82,119825,82,119877,82,119929,82,120033,82,120189,82,120241,82,120293,82,120345,82,120397,82,120449,82,422,82,5025,82,5074,82,66740,82,5511,82,42211,82,94005,82,65363,115,119852,115,119904,115,119956,115,120008,115,120060,115,120112,115,120164,115,120216,115,120268,115,120320,115,120372,115,120424,115,120476,115,42801,115,445,115,1109,115,43946,115,71873,115,66632,115,65331,83,117992,83,119826,83,119878,83,119930,83,119982,83,120034,83,120086,83,120138,83,120190,83,120242,83,120294,83,120346,83,120398,83,120450,83,1029,83,1359,83,5077,83,5082,83,42210,83,94010,83,66198,83,66592,83,119853,116,119905,116,119957,116,120009,116,120061,116,120113,116,120165,116,120217,116,120269,116,120321,116,120373,116,120425,116,120477,116,8868,84,10201,84,128872,84,65332,84,117993,84,119827,84,119879,84,119931,84,119983,84,120035,84,120087,84,120139,84,120191,84,120243,84,120295,84,120347,84,120399,84,120451,84,932,84,120507,84,120565,84,120623,84,120681,84,120739,84,11430,84,5026,84,42196,84,93962,84,71868,84,66199,84,66225,84,66325,84,119854,117,119906,117,119958,117,120010,117,120062,117,120114,117,120166,117,120218,117,120270,117,120322,117,120374,117,120426,117,120478,117,42911,117,7452,117,43854,117,43858,117,651,117,965,117,120534,117,120592,117,120650,117,120708,117,120766,117,1405,117,66806,117,71896,117,8746,85,8899,85,117994,85,119828,85,119880,85,119932,85,119984,85,120036,85,120088,85,120140,85,120192,85,120244,85,120296,85,120348,85,120400,85,120452,85,1357,85,4608,85,66766,85,5196,85,42228,85,94018,85,71864,85,8744,118,8897,118,65366,118,8564,118,119855,118,119907,118,119959,118,120011,118,120063,118,120115,118,120167,118,120219,118,120271,118,120323,118,120375,118,120427,118,120479,118,7456,118,957,118,120526,118,120584,118,120642,118,120700,118,120758,118,1141,118,1496,118,71430,118,43945,118,71872,118,119309,86,1639,86,1783,86,8548,86,117995,86,119829,86,119881,86,119933,86,119985,86,120037,86,120089,86,120141,86,120193,86,120245,86,120297,86,120349,86,120401,86,120453,86,1140,86,11576,86,5081,86,5167,86,42719,86,42214,86,93960,86,71840,86,66845,86,623,119,119856,119,119908,119,119960,119,120012,119,120064,119,120116,119,120168,119,120220,119,120272,119,120324,119,120376,119,120428,119,120480,119,7457,119,1121,119,1309,119,1377,119,71434,119,71438,119,71439,119,43907,119,71910,87,71919,87,117996,87,119830,87,119882,87,119934,87,119986,87,120038,87,120090,87,120142,87,120194,87,120246,87,120298,87,120350,87,120402,87,120454,87,1308,87,5043,87,5076,87,42218,87,5742,120,10539,120,10540,120,10799,120,65368,120,8569,120,119857,120,119909,120,119961,120,120013,120,120065,120,120117,120,120169,120,120221,120,120273,120,120325,120,120377,120,120429,120,120481,120,5441,120,5501,120,5741,88,9587,88,66338,88,71916,88,65336,88,8553,88,117997,88,119831,88,119883,88,119935,88,119987,88,120039,88,120091,88,120143,88,120195,88,120247,88,120299,88,120351,88,120403,88,120455,88,42931,88,935,88,120510,88,120568,88,120626,88,120684,88,120742,88,11436,88,11613,88,5815,88,42219,88,66192,88,66228,88,66327,88,66855,88,611,121,7564,121,65369,121,119858,121,119910,121,119962,121,120014,121,120066,121,120118,121,120170,121,120222,121,120274,121,120326,121,120378,121,120430,121,120482,121,655,121,7935,121,43866,121,947,121,8509,121,120516,121,120574,121,120632,121,120690,121,120748,121,1199,121,4327,121,71900,121,65337,89,117998,89,119832,89,119884,89,119936,89,119988,89,120040,89,120092,89,120144,89,120196,89,120248,89,120300,89,120352,89,120404,89,120456,89,933,89,978,89,120508,89,120566,89,120624,89,120682,89,120740,89,11432,89,1198,89,5033,89,5053,89,42220,89,94019,89,71844,89,66226,89,119859,122,119911,122,119963,122,120015,122,120067,122,120119,122,120171,122,120223,122,120275,122,120327,122,120379,122,120431,122,120483,122,7458,122,43923,122,71876,122,71909,90,66293,90,65338,90,8484,90,8488,90,117999,90,119833,90,119885,90,119937,90,119989,90,120041,90,120197,90,120249,90,120301,90,120353,90,120405,90,120457,90,918,90,120493,90,120551,90,120609,90,120667,90,120725,90,5059,90,42204,90,71849,90,65282,34,65283,35,65284,36,65285,37,65286,38,65290,42,65291,43,65294,46,65295,47,65296,48,65298,50,65299,51,65300,52,65301,53,65302,54,65303,55,65304,56,65305,57,65308,60,65309,61,65310,62,65312,64,65316,68,65318,70,65319,71,65324,76,65329,81,65330,82,65333,85,65334,86,65335,87,65343,95,65346,98,65348,100,65350,102,65355,107,65357,109,65358,110,65361,113,65362,114,65364,116,65365,117,65367,119,65370,122,65371,123,65373,125,119846,109],"_default":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"cs":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"de":[65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"es":[8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"fr":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"it":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"ja":[8211,45,8218,44,65281,33,8216,96,8245,96,180,96,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65292,44,65297,49,65307,59],"ko":[8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"pl":[65374,126,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"pt-BR":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"qps-ploc":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"ru":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,305,105,921,73,1009,112,215,120,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"tr":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"zh-hans":[160,32,65374,126,8218,44,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65297,49],"zh-hant":[8211,45,65374,126,8218,44,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89]}'); + }); + } + static { + this.cache = new LRUCachedFunction({ getCacheKey: JSON.stringify }, (locales) => { + function arrayToMap(arr) { + const result = /* @__PURE__ */ new Map(); + for (let i2 = 0; i2 < arr.length; i2 += 2) { + result.set(arr[i2], arr[i2 + 1]); + } + return result; + } + function mergeMaps(map1, map2) { + const result = new Map(map1); + for (const [key, value] of map2) { + result.set(key, value); + } + return result; + } + function intersectMaps(map1, map2) { + if (!map1) { + return map2; + } + const result = /* @__PURE__ */ new Map(); + for (const [key, value] of map1) { + if (map2.has(key)) { + result.set(key, value); + } + } + return result; + } + const data = this.ambiguousCharacterData.value; + let filteredLocales = locales.filter((l) => !l.startsWith("_") && Object.hasOwn(data, l)); + if (filteredLocales.length === 0) { + filteredLocales = ["_default"]; + } + let languageSpecificMap = void 0; + for (const locale of filteredLocales) { + const map2 = arrayToMap(data[locale]); + languageSpecificMap = intersectMaps(languageSpecificMap, map2); + } + const commonMap = arrayToMap(data["_common"]); + const map = mergeMaps(commonMap, languageSpecificMap); + return new _AmbiguousCharacters(map); + }); + } + static getInstance(locales) { + return _AmbiguousCharacters.cache.get(Array.from(locales)); + } + static { + this._locales = new Lazy(() => Object.keys(_AmbiguousCharacters.ambiguousCharacterData.value).filter((k) => !k.startsWith("_"))); + } + static getLocales() { + return _AmbiguousCharacters._locales.value; + } + constructor(confusableDictionary) { + this.confusableDictionary = confusableDictionary; + } + isAmbiguous(codePoint) { + return this.confusableDictionary.has(codePoint); + } + /** + * Returns the non basic ASCII code point that the given code point can be confused, + * or undefined if such code point does note exist. + */ + getPrimaryConfusable(codePoint) { + return this.confusableDictionary.get(codePoint); + } + getConfusableCodePoints() { + return new Set(this.confusableDictionary.keys()); + } + }; + InvisibleCharacters = class _InvisibleCharacters { + static getRawData() { + return JSON.parse('{"_common":[11,12,13,127,847,1564,4447,4448,6068,6069,6155,6156,6157,6158,7355,7356,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8204,8205,8206,8207,8234,8235,8236,8237,8238,8239,8287,8288,8289,8290,8291,8292,8293,8294,8295,8296,8297,8298,8299,8300,8301,8302,8303,10240,12644,65024,65025,65026,65027,65028,65029,65030,65031,65032,65033,65034,65035,65036,65037,65038,65039,65279,65440,65520,65521,65522,65523,65524,65525,65526,65527,65528,65532,78844,119155,119156,119157,119158,119159,119160,119161,119162,917504,917505,917506,917507,917508,917509,917510,917511,917512,917513,917514,917515,917516,917517,917518,917519,917520,917521,917522,917523,917524,917525,917526,917527,917528,917529,917530,917531,917532,917533,917534,917535,917536,917537,917538,917539,917540,917541,917542,917543,917544,917545,917546,917547,917548,917549,917550,917551,917552,917553,917554,917555,917556,917557,917558,917559,917560,917561,917562,917563,917564,917565,917566,917567,917568,917569,917570,917571,917572,917573,917574,917575,917576,917577,917578,917579,917580,917581,917582,917583,917584,917585,917586,917587,917588,917589,917590,917591,917592,917593,917594,917595,917596,917597,917598,917599,917600,917601,917602,917603,917604,917605,917606,917607,917608,917609,917610,917611,917612,917613,917614,917615,917616,917617,917618,917619,917620,917621,917622,917623,917624,917625,917626,917627,917628,917629,917630,917631,917760,917761,917762,917763,917764,917765,917766,917767,917768,917769,917770,917771,917772,917773,917774,917775,917776,917777,917778,917779,917780,917781,917782,917783,917784,917785,917786,917787,917788,917789,917790,917791,917792,917793,917794,917795,917796,917797,917798,917799,917800,917801,917802,917803,917804,917805,917806,917807,917808,917809,917810,917811,917812,917813,917814,917815,917816,917817,917818,917819,917820,917821,917822,917823,917824,917825,917826,917827,917828,917829,917830,917831,917832,917833,917834,917835,917836,917837,917838,917839,917840,917841,917842,917843,917844,917845,917846,917847,917848,917849,917850,917851,917852,917853,917854,917855,917856,917857,917858,917859,917860,917861,917862,917863,917864,917865,917866,917867,917868,917869,917870,917871,917872,917873,917874,917875,917876,917877,917878,917879,917880,917881,917882,917883,917884,917885,917886,917887,917888,917889,917890,917891,917892,917893,917894,917895,917896,917897,917898,917899,917900,917901,917902,917903,917904,917905,917906,917907,917908,917909,917910,917911,917912,917913,917914,917915,917916,917917,917918,917919,917920,917921,917922,917923,917924,917925,917926,917927,917928,917929,917930,917931,917932,917933,917934,917935,917936,917937,917938,917939,917940,917941,917942,917943,917944,917945,917946,917947,917948,917949,917950,917951,917952,917953,917954,917955,917956,917957,917958,917959,917960,917961,917962,917963,917964,917965,917966,917967,917968,917969,917970,917971,917972,917973,917974,917975,917976,917977,917978,917979,917980,917981,917982,917983,917984,917985,917986,917987,917988,917989,917990,917991,917992,917993,917994,917995,917996,917997,917998,917999],"cs":[173,8203,12288],"de":[173,8203,12288],"es":[8203,12288],"fr":[173,8203,12288],"it":[160,173,12288],"ja":[173],"ko":[173,12288],"pl":[173,8203,12288],"pt-BR":[173,8203,12288],"qps-ploc":[160,173,8203,12288],"ru":[173,12288],"tr":[160,173,8203,12288],"zh-hans":[160,173,8203,12288],"zh-hant":[173,12288]}'); + } + static { + this._data = void 0; + } + static getData() { + if (!this._data) { + this._data = new Set([...Object.values(_InvisibleCharacters.getRawData())].flat()); + } + return this._data; + } + static isInvisibleCharacter(codePoint) { + return _InvisibleCharacters.getData().has(codePoint); + } + static get codePoints() { + return _InvisibleCharacters.getData(); + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/common/process.js +var safeProcess, vscodeGlobal, cwd, env, platform2; +var init_process = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/common/process.js"() { + init_platform(); + vscodeGlobal = globalThis.vscode; + if (typeof vscodeGlobal !== "undefined" && typeof vscodeGlobal.process !== "undefined") { + const sandboxProcess = vscodeGlobal.process; + safeProcess = { + get platform() { + return sandboxProcess.platform; + }, + get arch() { + return sandboxProcess.arch; + }, + get env() { + return sandboxProcess.env; + }, + cwd() { + return sandboxProcess.cwd(); + } + }; + } else if (typeof process !== "undefined" && typeof process?.versions?.node === "string") { + safeProcess = { + get platform() { + return process.platform; + }, + get arch() { + return process.arch; + }, + get env() { + return process.env; + }, + cwd() { + return process.env["VSCODE_CWD"] || process.cwd(); + } + }; + } else { + safeProcess = { + // Supported + get platform() { + return isWindows ? "win32" : isMacintosh ? "darwin" : "linux"; + }, + get arch() { + return void 0; + }, + // Unsupported + get env() { + return {}; + }, + cwd() { + return "/"; + } + }; + } + cwd = safeProcess.cwd; + env = safeProcess.env; + platform2 = safeProcess.platform; + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/common/path.js +function validateObject(pathObject, name) { + if (pathObject === null || typeof pathObject !== "object") { + throw new ErrorInvalidArgType(name, "Object", pathObject); + } +} +function validateString(value, name) { + if (typeof value !== "string") { + throw new ErrorInvalidArgType(name, "string", value); + } +} +function isPathSeparator(code) { + return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH; +} +function isPosixPathSeparator(code) { + return code === CHAR_FORWARD_SLASH; +} +function isWindowsDeviceRoot(code) { + return code >= CHAR_UPPERCASE_A && code <= CHAR_UPPERCASE_Z || code >= CHAR_LOWERCASE_A && code <= CHAR_LOWERCASE_Z; +} +function normalizeString(path, allowAboveRoot, separator2, isPathSeparator3) { + let res = ""; + let lastSegmentLength = 0; + let lastSlash = -1; + let dots = 0; + let code = 0; + for (let i2 = 0; i2 <= path.length; ++i2) { + if (i2 < path.length) { + code = path.charCodeAt(i2); + } else if (isPathSeparator3(code)) { + break; + } else { + code = CHAR_FORWARD_SLASH; + } + if (isPathSeparator3(code)) { + if (lastSlash === i2 - 1 || dots === 1) { + } else if (dots === 2) { + if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== CHAR_DOT || res.charCodeAt(res.length - 2) !== CHAR_DOT) { + if (res.length > 2) { + const lastSlashIndex = res.lastIndexOf(separator2); + if (lastSlashIndex === -1) { + res = ""; + lastSegmentLength = 0; + } else { + res = res.slice(0, lastSlashIndex); + lastSegmentLength = res.length - 1 - res.lastIndexOf(separator2); + } + lastSlash = i2; + dots = 0; + continue; + } else if (res.length !== 0) { + res = ""; + lastSegmentLength = 0; + lastSlash = i2; + dots = 0; + continue; + } + } + if (allowAboveRoot) { + res += res.length > 0 ? `${separator2}..` : ".."; + lastSegmentLength = 2; + } + } else { + if (res.length > 0) { + res += `${separator2}${path.slice(lastSlash + 1, i2)}`; + } else { + res = path.slice(lastSlash + 1, i2); + } + lastSegmentLength = i2 - lastSlash - 1; + } + lastSlash = i2; + dots = 0; + } else if (code === CHAR_DOT && dots !== -1) { + ++dots; + } else { + dots = -1; + } + } + return res; +} +function formatExt(ext) { + return ext ? `${ext[0] === "." ? "" : "."}${ext}` : ""; +} +function _format2(sep2, pathObject) { + validateObject(pathObject, "pathObject"); + const dir = pathObject.dir || pathObject.root; + const base = pathObject.base || `${pathObject.name || ""}${formatExt(pathObject.ext)}`; + if (!dir) { + return base; + } + return dir === pathObject.root ? `${dir}${base}` : `${dir}${sep2}${base}`; +} +var CHAR_UPPERCASE_A, CHAR_LOWERCASE_A, CHAR_UPPERCASE_Z, CHAR_LOWERCASE_Z, CHAR_DOT, CHAR_FORWARD_SLASH, CHAR_BACKWARD_SLASH, CHAR_COLON, CHAR_QUESTION_MARK, ErrorInvalidArgType, platformIsWin32, win32, posixCwd, posix, normalize, resolve, relative, dirname, basename, extname, sep; +var init_path = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/common/path.js"() { + init_process(); + CHAR_UPPERCASE_A = 65; + CHAR_LOWERCASE_A = 97; + CHAR_UPPERCASE_Z = 90; + CHAR_LOWERCASE_Z = 122; + CHAR_DOT = 46; + CHAR_FORWARD_SLASH = 47; + CHAR_BACKWARD_SLASH = 92; + CHAR_COLON = 58; + CHAR_QUESTION_MARK = 63; + ErrorInvalidArgType = class extends Error { + constructor(name, expected, actual) { + let determiner; + if (typeof expected === "string" && expected.indexOf("not ") === 0) { + determiner = "must not be"; + expected = expected.replace(/^not /, ""); + } else { + determiner = "must be"; + } + const type = name.indexOf(".") !== -1 ? "property" : "argument"; + let msg = `The "${name}" ${type} ${determiner} of type ${expected}`; + msg += `. Received type ${typeof actual}`; + super(msg); + this.code = "ERR_INVALID_ARG_TYPE"; + } + }; + platformIsWin32 = platform2 === "win32"; + win32 = { + // path.resolve([from ...], to) + resolve(...pathSegments) { + let resolvedDevice = ""; + let resolvedTail = ""; + let resolvedAbsolute = false; + for (let i2 = pathSegments.length - 1; i2 >= -1; i2--) { + let path; + if (i2 >= 0) { + path = pathSegments[i2]; + validateString(path, `paths[${i2}]`); + if (path.length === 0) { + continue; + } + } else if (resolvedDevice.length === 0) { + path = cwd(); + } else { + path = env[`=${resolvedDevice}`] || cwd(); + if (path === void 0 || path.slice(0, 2).toLowerCase() !== resolvedDevice.toLowerCase() && path.charCodeAt(2) === CHAR_BACKWARD_SLASH) { + path = `${resolvedDevice}\\`; + } + } + const len = path.length; + let rootEnd = 0; + let device = ""; + let isAbsolute = false; + const code = path.charCodeAt(0); + if (len === 1) { + if (isPathSeparator(code)) { + rootEnd = 1; + isAbsolute = true; + } + } else if (isPathSeparator(code)) { + isAbsolute = true; + if (isPathSeparator(path.charCodeAt(1))) { + let j = 2; + let last = j; + while (j < len && !isPathSeparator(path.charCodeAt(j))) { + j++; + } + if (j < len && j !== last) { + const firstPart = path.slice(last, j); + last = j; + while (j < len && isPathSeparator(path.charCodeAt(j))) { + j++; + } + if (j < len && j !== last) { + last = j; + while (j < len && !isPathSeparator(path.charCodeAt(j))) { + j++; + } + if (j === len || j !== last) { + device = `\\\\${firstPart}\\${path.slice(last, j)}`; + rootEnd = j; + } + } + } + } else { + rootEnd = 1; + } + } else if (isWindowsDeviceRoot(code) && path.charCodeAt(1) === CHAR_COLON) { + device = path.slice(0, 2); + rootEnd = 2; + if (len > 2 && isPathSeparator(path.charCodeAt(2))) { + isAbsolute = true; + rootEnd = 3; + } + } + if (device.length > 0) { + if (resolvedDevice.length > 0) { + if (device.toLowerCase() !== resolvedDevice.toLowerCase()) { + continue; + } + } else { + resolvedDevice = device; + } + } + if (resolvedAbsolute) { + if (resolvedDevice.length > 0) { + break; + } + } else { + resolvedTail = `${path.slice(rootEnd)}\\${resolvedTail}`; + resolvedAbsolute = isAbsolute; + if (isAbsolute && resolvedDevice.length > 0) { + break; + } + } + } + resolvedTail = normalizeString(resolvedTail, !resolvedAbsolute, "\\", isPathSeparator); + return resolvedAbsolute ? `${resolvedDevice}\\${resolvedTail}` : `${resolvedDevice}${resolvedTail}` || "."; + }, + normalize(path) { + validateString(path, "path"); + const len = path.length; + if (len === 0) { + return "."; + } + let rootEnd = 0; + let device; + let isAbsolute = false; + const code = path.charCodeAt(0); + if (len === 1) { + return isPosixPathSeparator(code) ? "\\" : path; + } + if (isPathSeparator(code)) { + isAbsolute = true; + if (isPathSeparator(path.charCodeAt(1))) { + let j = 2; + let last = j; + while (j < len && !isPathSeparator(path.charCodeAt(j))) { + j++; + } + if (j < len && j !== last) { + const firstPart = path.slice(last, j); + last = j; + while (j < len && isPathSeparator(path.charCodeAt(j))) { + j++; + } + if (j < len && j !== last) { + last = j; + while (j < len && !isPathSeparator(path.charCodeAt(j))) { + j++; + } + if (j === len) { + return `\\\\${firstPart}\\${path.slice(last)}\\`; + } + if (j !== last) { + device = `\\\\${firstPart}\\${path.slice(last, j)}`; + rootEnd = j; + } + } + } + } else { + rootEnd = 1; + } + } else if (isWindowsDeviceRoot(code) && path.charCodeAt(1) === CHAR_COLON) { + device = path.slice(0, 2); + rootEnd = 2; + if (len > 2 && isPathSeparator(path.charCodeAt(2))) { + isAbsolute = true; + rootEnd = 3; + } + } + let tail2 = rootEnd < len ? normalizeString(path.slice(rootEnd), !isAbsolute, "\\", isPathSeparator) : ""; + if (tail2.length === 0 && !isAbsolute) { + tail2 = "."; + } + if (tail2.length > 0 && isPathSeparator(path.charCodeAt(len - 1))) { + tail2 += "\\"; + } + if (!isAbsolute && device === void 0 && path.includes(":")) { + if (tail2.length >= 2 && isWindowsDeviceRoot(tail2.charCodeAt(0)) && tail2.charCodeAt(1) === CHAR_COLON) { + return `.\\${tail2}`; + } + let index = path.indexOf(":"); + do { + if (index === len - 1 || isPathSeparator(path.charCodeAt(index + 1))) { + return `.\\${tail2}`; + } + } while ((index = path.indexOf(":", index + 1)) !== -1); + } + if (device === void 0) { + return isAbsolute ? `\\${tail2}` : tail2; + } + return isAbsolute ? `${device}\\${tail2}` : `${device}${tail2}`; + }, + isAbsolute(path) { + validateString(path, "path"); + const len = path.length; + if (len === 0) { + return false; + } + const code = path.charCodeAt(0); + return isPathSeparator(code) || // Possible device root + len > 2 && isWindowsDeviceRoot(code) && path.charCodeAt(1) === CHAR_COLON && isPathSeparator(path.charCodeAt(2)); + }, + join(...paths) { + if (paths.length === 0) { + return "."; + } + let joined; + let firstPart; + for (let i2 = 0; i2 < paths.length; ++i2) { + const arg = paths[i2]; + validateString(arg, "path"); + if (arg.length > 0) { + if (joined === void 0) { + joined = firstPart = arg; + } else { + joined += `\\${arg}`; + } + } + } + if (joined === void 0) { + return "."; + } + let needsReplace = true; + let slashCount = 0; + if (typeof firstPart === "string" && isPathSeparator(firstPart.charCodeAt(0))) { + ++slashCount; + const firstLen = firstPart.length; + if (firstLen > 1 && isPathSeparator(firstPart.charCodeAt(1))) { + ++slashCount; + if (firstLen > 2) { + if (isPathSeparator(firstPart.charCodeAt(2))) { + ++slashCount; + } else { + needsReplace = false; + } + } + } + } + if (needsReplace) { + while (slashCount < joined.length && isPathSeparator(joined.charCodeAt(slashCount))) { + slashCount++; + } + if (slashCount >= 2) { + joined = `\\${joined.slice(slashCount)}`; + } + } + return win32.normalize(joined); + }, + // It will solve the relative path from `from` to `to`, for instance: + // from = 'C:\\orandea\\test\\aaa' + // to = 'C:\\orandea\\impl\\bbb' + // The output of the function should be: '..\\..\\impl\\bbb' + relative(from, to) { + validateString(from, "from"); + validateString(to, "to"); + if (from === to) { + return ""; + } + const fromOrig = win32.resolve(from); + const toOrig = win32.resolve(to); + if (fromOrig === toOrig) { + return ""; + } + from = fromOrig.toLowerCase(); + to = toOrig.toLowerCase(); + if (from === to) { + return ""; + } + if (fromOrig.length !== from.length || toOrig.length !== to.length) { + const fromSplit = fromOrig.split("\\"); + const toSplit = toOrig.split("\\"); + if (fromSplit[fromSplit.length - 1] === "") { + fromSplit.pop(); + } + if (toSplit[toSplit.length - 1] === "") { + toSplit.pop(); + } + const fromLen2 = fromSplit.length; + const toLen2 = toSplit.length; + const length2 = fromLen2 < toLen2 ? fromLen2 : toLen2; + let i3; + for (i3 = 0; i3 < length2; i3++) { + if (fromSplit[i3].toLowerCase() !== toSplit[i3].toLowerCase()) { + break; + } + } + if (i3 === 0) { + return toOrig; + } else if (i3 === length2) { + if (toLen2 > length2) { + return toSplit.slice(i3).join("\\"); + } + if (fromLen2 > length2) { + return "..\\".repeat(fromLen2 - 1 - i3) + ".."; + } + return ""; + } + return "..\\".repeat(fromLen2 - i3) + toSplit.slice(i3).join("\\"); + } + let fromStart = 0; + while (fromStart < from.length && from.charCodeAt(fromStart) === CHAR_BACKWARD_SLASH) { + fromStart++; + } + let fromEnd = from.length; + while (fromEnd - 1 > fromStart && from.charCodeAt(fromEnd - 1) === CHAR_BACKWARD_SLASH) { + fromEnd--; + } + const fromLen = fromEnd - fromStart; + let toStart = 0; + while (toStart < to.length && to.charCodeAt(toStart) === CHAR_BACKWARD_SLASH) { + toStart++; + } + let toEnd = to.length; + while (toEnd - 1 > toStart && to.charCodeAt(toEnd - 1) === CHAR_BACKWARD_SLASH) { + toEnd--; + } + const toLen = toEnd - toStart; + const length = fromLen < toLen ? fromLen : toLen; + let lastCommonSep = -1; + let i2 = 0; + for (; i2 < length; i2++) { + const fromCode = from.charCodeAt(fromStart + i2); + if (fromCode !== to.charCodeAt(toStart + i2)) { + break; + } else if (fromCode === CHAR_BACKWARD_SLASH) { + lastCommonSep = i2; + } + } + if (i2 !== length) { + if (lastCommonSep === -1) { + return toOrig; + } + } else { + if (toLen > length) { + if (to.charCodeAt(toStart + i2) === CHAR_BACKWARD_SLASH) { + return toOrig.slice(toStart + i2 + 1); + } + if (i2 === 2) { + return toOrig.slice(toStart + i2); + } + } + if (fromLen > length) { + if (from.charCodeAt(fromStart + i2) === CHAR_BACKWARD_SLASH) { + lastCommonSep = i2; + } else if (i2 === 2) { + lastCommonSep = 3; + } + } + if (lastCommonSep === -1) { + lastCommonSep = 0; + } + } + let out = ""; + for (i2 = fromStart + lastCommonSep + 1; i2 <= fromEnd; ++i2) { + if (i2 === fromEnd || from.charCodeAt(i2) === CHAR_BACKWARD_SLASH) { + out += out.length === 0 ? ".." : "\\.."; + } + } + toStart += lastCommonSep; + if (out.length > 0) { + return `${out}${toOrig.slice(toStart, toEnd)}`; + } + if (toOrig.charCodeAt(toStart) === CHAR_BACKWARD_SLASH) { + ++toStart; + } + return toOrig.slice(toStart, toEnd); + }, + toNamespacedPath(path) { + if (typeof path !== "string" || path.length === 0) { + return path; + } + const resolvedPath = win32.resolve(path); + if (resolvedPath.length <= 2) { + return path; + } + if (resolvedPath.charCodeAt(0) === CHAR_BACKWARD_SLASH) { + if (resolvedPath.charCodeAt(1) === CHAR_BACKWARD_SLASH) { + const code = resolvedPath.charCodeAt(2); + if (code !== CHAR_QUESTION_MARK && code !== CHAR_DOT) { + return `\\\\?\\UNC\\${resolvedPath.slice(2)}`; + } + } + } else if (isWindowsDeviceRoot(resolvedPath.charCodeAt(0)) && resolvedPath.charCodeAt(1) === CHAR_COLON && resolvedPath.charCodeAt(2) === CHAR_BACKWARD_SLASH) { + return `\\\\?\\${resolvedPath}`; + } + return resolvedPath; + }, + dirname(path) { + validateString(path, "path"); + const len = path.length; + if (len === 0) { + return "."; + } + let rootEnd = -1; + let offset = 0; + const code = path.charCodeAt(0); + if (len === 1) { + return isPathSeparator(code) ? path : "."; + } + if (isPathSeparator(code)) { + rootEnd = offset = 1; + if (isPathSeparator(path.charCodeAt(1))) { + let j = 2; + let last = j; + while (j < len && !isPathSeparator(path.charCodeAt(j))) { + j++; + } + if (j < len && j !== last) { + last = j; + while (j < len && isPathSeparator(path.charCodeAt(j))) { + j++; + } + if (j < len && j !== last) { + last = j; + while (j < len && !isPathSeparator(path.charCodeAt(j))) { + j++; + } + if (j === len) { + return path; + } + if (j !== last) { + rootEnd = offset = j + 1; + } + } + } + } + } else if (isWindowsDeviceRoot(code) && path.charCodeAt(1) === CHAR_COLON) { + rootEnd = len > 2 && isPathSeparator(path.charCodeAt(2)) ? 3 : 2; + offset = rootEnd; + } + let end = -1; + let matchedSlash = true; + for (let i2 = len - 1; i2 >= offset; --i2) { + if (isPathSeparator(path.charCodeAt(i2))) { + if (!matchedSlash) { + end = i2; + break; + } + } else { + matchedSlash = false; + } + } + if (end === -1) { + if (rootEnd === -1) { + return "."; + } + end = rootEnd; + } + return path.slice(0, end); + }, + basename(path, suffix) { + if (suffix !== void 0) { + validateString(suffix, "suffix"); + } + validateString(path, "path"); + let start = 0; + let end = -1; + let matchedSlash = true; + let i2; + if (path.length >= 2 && isWindowsDeviceRoot(path.charCodeAt(0)) && path.charCodeAt(1) === CHAR_COLON) { + start = 2; + } + if (suffix !== void 0 && suffix.length > 0 && suffix.length <= path.length) { + if (suffix === path) { + return ""; + } + let extIdx = suffix.length - 1; + let firstNonSlashEnd = -1; + for (i2 = path.length - 1; i2 >= start; --i2) { + const code = path.charCodeAt(i2); + if (isPathSeparator(code)) { + if (!matchedSlash) { + start = i2 + 1; + break; + } + } else { + if (firstNonSlashEnd === -1) { + matchedSlash = false; + firstNonSlashEnd = i2 + 1; + } + if (extIdx >= 0) { + if (code === suffix.charCodeAt(extIdx)) { + if (--extIdx === -1) { + end = i2; + } + } else { + extIdx = -1; + end = firstNonSlashEnd; + } + } + } + } + if (start === end) { + end = firstNonSlashEnd; + } else if (end === -1) { + end = path.length; + } + return path.slice(start, end); + } + for (i2 = path.length - 1; i2 >= start; --i2) { + if (isPathSeparator(path.charCodeAt(i2))) { + if (!matchedSlash) { + start = i2 + 1; + break; + } + } else if (end === -1) { + matchedSlash = false; + end = i2 + 1; + } + } + if (end === -1) { + return ""; + } + return path.slice(start, end); + }, + extname(path) { + validateString(path, "path"); + let start = 0; + let startDot = -1; + let startPart = 0; + let end = -1; + let matchedSlash = true; + let preDotState = 0; + if (path.length >= 2 && path.charCodeAt(1) === CHAR_COLON && isWindowsDeviceRoot(path.charCodeAt(0))) { + start = startPart = 2; + } + for (let i2 = path.length - 1; i2 >= start; --i2) { + const code = path.charCodeAt(i2); + if (isPathSeparator(code)) { + if (!matchedSlash) { + startPart = i2 + 1; + break; + } + continue; + } + if (end === -1) { + matchedSlash = false; + end = i2 + 1; + } + if (code === CHAR_DOT) { + if (startDot === -1) { + startDot = i2; + } else if (preDotState !== 1) { + preDotState = 1; + } + } else if (startDot !== -1) { + preDotState = -1; + } + } + if (startDot === -1 || end === -1 || // We saw a non-dot character immediately before the dot + preDotState === 0 || // The (right-most) trimmed path component is exactly '..' + preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) { + return ""; + } + return path.slice(startDot, end); + }, + format: _format2.bind(null, "\\"), + parse(path) { + validateString(path, "path"); + const ret = { root: "", dir: "", base: "", ext: "", name: "" }; + if (path.length === 0) { + return ret; + } + const len = path.length; + let rootEnd = 0; + let code = path.charCodeAt(0); + if (len === 1) { + if (isPathSeparator(code)) { + ret.root = ret.dir = path; + return ret; + } + ret.base = ret.name = path; + return ret; + } + if (isPathSeparator(code)) { + rootEnd = 1; + if (isPathSeparator(path.charCodeAt(1))) { + let j = 2; + let last = j; + while (j < len && !isPathSeparator(path.charCodeAt(j))) { + j++; + } + if (j < len && j !== last) { + last = j; + while (j < len && isPathSeparator(path.charCodeAt(j))) { + j++; + } + if (j < len && j !== last) { + last = j; + while (j < len && !isPathSeparator(path.charCodeAt(j))) { + j++; + } + if (j === len) { + rootEnd = j; + } else if (j !== last) { + rootEnd = j + 1; + } + } + } + } + } else if (isWindowsDeviceRoot(code) && path.charCodeAt(1) === CHAR_COLON) { + if (len <= 2) { + ret.root = ret.dir = path; + return ret; + } + rootEnd = 2; + if (isPathSeparator(path.charCodeAt(2))) { + if (len === 3) { + ret.root = ret.dir = path; + return ret; + } + rootEnd = 3; + } + } + if (rootEnd > 0) { + ret.root = path.slice(0, rootEnd); + } + let startDot = -1; + let startPart = rootEnd; + let end = -1; + let matchedSlash = true; + let i2 = path.length - 1; + let preDotState = 0; + for (; i2 >= rootEnd; --i2) { + code = path.charCodeAt(i2); + if (isPathSeparator(code)) { + if (!matchedSlash) { + startPart = i2 + 1; + break; + } + continue; + } + if (end === -1) { + matchedSlash = false; + end = i2 + 1; + } + if (code === CHAR_DOT) { + if (startDot === -1) { + startDot = i2; + } else if (preDotState !== 1) { + preDotState = 1; + } + } else if (startDot !== -1) { + preDotState = -1; + } + } + if (end !== -1) { + if (startDot === -1 || // We saw a non-dot character immediately before the dot + preDotState === 0 || // The (right-most) trimmed path component is exactly '..' + preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) { + ret.base = ret.name = path.slice(startPart, end); + } else { + ret.name = path.slice(startPart, startDot); + ret.base = path.slice(startPart, end); + ret.ext = path.slice(startDot, end); + } + } + if (startPart > 0 && startPart !== rootEnd) { + ret.dir = path.slice(0, startPart - 1); + } else { + ret.dir = ret.root; + } + return ret; + }, + sep: "\\", + delimiter: ";", + win32: null, + posix: null + }; + posixCwd = (() => { + if (platformIsWin32) { + const regexp = /\\/g; + return () => { + const cwd2 = cwd().replace(regexp, "/"); + return cwd2.slice(cwd2.indexOf("/")); + }; + } + return () => cwd(); + })(); + posix = { + // path.resolve([from ...], to) + resolve(...pathSegments) { + let resolvedPath = ""; + let resolvedAbsolute = false; + for (let i2 = pathSegments.length - 1; i2 >= 0 && !resolvedAbsolute; i2--) { + const path = pathSegments[i2]; + validateString(path, `paths[${i2}]`); + if (path.length === 0) { + continue; + } + resolvedPath = `${path}/${resolvedPath}`; + resolvedAbsolute = path.charCodeAt(0) === CHAR_FORWARD_SLASH; + } + if (!resolvedAbsolute) { + const cwd2 = posixCwd(); + resolvedPath = `${cwd2}/${resolvedPath}`; + resolvedAbsolute = cwd2.charCodeAt(0) === CHAR_FORWARD_SLASH; + } + resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute, "/", isPosixPathSeparator); + if (resolvedAbsolute) { + return `/${resolvedPath}`; + } + return resolvedPath.length > 0 ? resolvedPath : "."; + }, + normalize(path) { + validateString(path, "path"); + if (path.length === 0) { + return "."; + } + const isAbsolute = path.charCodeAt(0) === CHAR_FORWARD_SLASH; + const trailingSeparator = path.charCodeAt(path.length - 1) === CHAR_FORWARD_SLASH; + path = normalizeString(path, !isAbsolute, "/", isPosixPathSeparator); + if (path.length === 0) { + if (isAbsolute) { + return "/"; + } + return trailingSeparator ? "./" : "."; + } + if (trailingSeparator) { + path += "/"; + } + return isAbsolute ? `/${path}` : path; + }, + isAbsolute(path) { + validateString(path, "path"); + return path.length > 0 && path.charCodeAt(0) === CHAR_FORWARD_SLASH; + }, + join(...paths) { + if (paths.length === 0) { + return "."; + } + const path = []; + for (let i2 = 0; i2 < paths.length; ++i2) { + const arg = paths[i2]; + validateString(arg, "path"); + if (arg.length > 0) { + path.push(arg); + } + } + if (path.length === 0) { + return "."; + } + return posix.normalize(path.join("/")); + }, + relative(from, to) { + validateString(from, "from"); + validateString(to, "to"); + if (from === to) { + return ""; + } + from = posix.resolve(from); + to = posix.resolve(to); + if (from === to) { + return ""; + } + const fromStart = 1; + const fromEnd = from.length; + const fromLen = fromEnd - fromStart; + const toStart = 1; + const toLen = to.length - toStart; + const length = fromLen < toLen ? fromLen : toLen; + let lastCommonSep = -1; + let i2 = 0; + for (; i2 < length; i2++) { + const fromCode = from.charCodeAt(fromStart + i2); + if (fromCode !== to.charCodeAt(toStart + i2)) { + break; + } else if (fromCode === CHAR_FORWARD_SLASH) { + lastCommonSep = i2; + } + } + if (i2 === length) { + if (toLen > length) { + if (to.charCodeAt(toStart + i2) === CHAR_FORWARD_SLASH) { + return to.slice(toStart + i2 + 1); + } + if (i2 === 0) { + return to.slice(toStart + i2); + } + } else if (fromLen > length) { + if (from.charCodeAt(fromStart + i2) === CHAR_FORWARD_SLASH) { + lastCommonSep = i2; + } else if (i2 === 0) { + lastCommonSep = 0; + } + } + } + let out = ""; + for (i2 = fromStart + lastCommonSep + 1; i2 <= fromEnd; ++i2) { + if (i2 === fromEnd || from.charCodeAt(i2) === CHAR_FORWARD_SLASH) { + out += out.length === 0 ? ".." : "/.."; + } + } + return `${out}${to.slice(toStart + lastCommonSep)}`; + }, + toNamespacedPath(path) { + return path; + }, + dirname(path) { + validateString(path, "path"); + if (path.length === 0) { + return "."; + } + const hasRoot = path.charCodeAt(0) === CHAR_FORWARD_SLASH; + let end = -1; + let matchedSlash = true; + for (let i2 = path.length - 1; i2 >= 1; --i2) { + if (path.charCodeAt(i2) === CHAR_FORWARD_SLASH) { + if (!matchedSlash) { + end = i2; + break; + } + } else { + matchedSlash = false; + } + } + if (end === -1) { + return hasRoot ? "/" : "."; + } + if (hasRoot && end === 1) { + return "//"; + } + return path.slice(0, end); + }, + basename(path, suffix) { + if (suffix !== void 0) { + validateString(suffix, "suffix"); + } + validateString(path, "path"); + let start = 0; + let end = -1; + let matchedSlash = true; + let i2; + if (suffix !== void 0 && suffix.length > 0 && suffix.length <= path.length) { + if (suffix === path) { + return ""; + } + let extIdx = suffix.length - 1; + let firstNonSlashEnd = -1; + for (i2 = path.length - 1; i2 >= 0; --i2) { + const code = path.charCodeAt(i2); + if (code === CHAR_FORWARD_SLASH) { + if (!matchedSlash) { + start = i2 + 1; + break; + } + } else { + if (firstNonSlashEnd === -1) { + matchedSlash = false; + firstNonSlashEnd = i2 + 1; + } + if (extIdx >= 0) { + if (code === suffix.charCodeAt(extIdx)) { + if (--extIdx === -1) { + end = i2; + } + } else { + extIdx = -1; + end = firstNonSlashEnd; + } + } + } + } + if (start === end) { + end = firstNonSlashEnd; + } else if (end === -1) { + end = path.length; + } + return path.slice(start, end); + } + for (i2 = path.length - 1; i2 >= 0; --i2) { + if (path.charCodeAt(i2) === CHAR_FORWARD_SLASH) { + if (!matchedSlash) { + start = i2 + 1; + break; + } + } else if (end === -1) { + matchedSlash = false; + end = i2 + 1; + } + } + if (end === -1) { + return ""; + } + return path.slice(start, end); + }, + extname(path) { + validateString(path, "path"); + let startDot = -1; + let startPart = 0; + let end = -1; + let matchedSlash = true; + let preDotState = 0; + for (let i2 = path.length - 1; i2 >= 0; --i2) { + const char = path[i2]; + if (char === "/") { + if (!matchedSlash) { + startPart = i2 + 1; + break; + } + continue; + } + if (end === -1) { + matchedSlash = false; + end = i2 + 1; + } + if (char === ".") { + if (startDot === -1) { + startDot = i2; + } else if (preDotState !== 1) { + preDotState = 1; + } + } else if (startDot !== -1) { + preDotState = -1; + } + } + if (startDot === -1 || end === -1 || // We saw a non-dot character immediately before the dot + preDotState === 0 || // The (right-most) trimmed path component is exactly '..' + preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) { + return ""; + } + return path.slice(startDot, end); + }, + format: _format2.bind(null, "/"), + parse(path) { + validateString(path, "path"); + const ret = { root: "", dir: "", base: "", ext: "", name: "" }; + if (path.length === 0) { + return ret; + } + const isAbsolute = path.charCodeAt(0) === CHAR_FORWARD_SLASH; + let start; + if (isAbsolute) { + ret.root = "/"; + start = 1; + } else { + start = 0; + } + let startDot = -1; + let startPart = 0; + let end = -1; + let matchedSlash = true; + let i2 = path.length - 1; + let preDotState = 0; + for (; i2 >= start; --i2) { + const code = path.charCodeAt(i2); + if (code === CHAR_FORWARD_SLASH) { + if (!matchedSlash) { + startPart = i2 + 1; + break; + } + continue; + } + if (end === -1) { + matchedSlash = false; + end = i2 + 1; + } + if (code === CHAR_DOT) { + if (startDot === -1) { + startDot = i2; + } else if (preDotState !== 1) { + preDotState = 1; + } + } else if (startDot !== -1) { + preDotState = -1; + } + } + if (end !== -1) { + const start2 = startPart === 0 && isAbsolute ? 1 : startPart; + if (startDot === -1 || // We saw a non-dot character immediately before the dot + preDotState === 0 || // The (right-most) trimmed path component is exactly '..' + preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) { + ret.base = ret.name = path.slice(start2, end); + } else { + ret.name = path.slice(start2, startDot); + ret.base = path.slice(start2, end); + ret.ext = path.slice(startDot, end); + } + } + if (startPart > 0) { + ret.dir = path.slice(0, startPart - 1); + } else if (isAbsolute) { + ret.dir = "/"; + } + return ret; + }, + sep: "/", + delimiter: ":", + win32: null, + posix: null + }; + posix.win32 = win32.win32 = win32; + posix.posix = win32.posix = posix; + normalize = platformIsWin32 ? win32.normalize : posix.normalize; + resolve = platformIsWin32 ? win32.resolve : posix.resolve; + relative = platformIsWin32 ? win32.relative : posix.relative; + dirname = platformIsWin32 ? win32.dirname : posix.dirname; + basename = platformIsWin32 ? win32.basename : posix.basename; + extname = platformIsWin32 ? win32.extname : posix.extname; + sep = platformIsWin32 ? win32.sep : posix.sep; + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/common/uri.js +function _validateUri(ret, _strict) { + if (!ret.scheme && _strict) { + throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${ret.authority}", path: "${ret.path}", query: "${ret.query}", fragment: "${ret.fragment}"}`); + } + if (ret.scheme && !_schemePattern.test(ret.scheme)) { + throw new Error("[UriError]: Scheme contains illegal characters."); + } + if (ret.path) { + if (ret.authority) { + if (!_singleSlashStart.test(ret.path)) { + throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character'); + } + } else { + if (_doubleSlashStart.test(ret.path)) { + throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")'); + } + } + } +} +function _schemeFix(scheme, _strict) { + if (!scheme && !_strict) { + return "file"; + } + return scheme; +} +function _referenceResolution(scheme, path) { + switch (scheme) { + case "https": + case "http": + case "file": + if (!path) { + path = _slash; + } else if (path[0] !== _slash) { + path = _slash + path; + } + break; + } + return path; +} +function encodeURIComponentFast(uriComponent, isPath, isAuthority) { + let res = void 0; + let nativeEncodePos = -1; + for (let pos = 0; pos < uriComponent.length; pos++) { + const code = uriComponent.charCodeAt(pos); + if (code >= 97 && code <= 122 || code >= 65 && code <= 90 || code >= 48 && code <= 57 || code === 45 || code === 46 || code === 95 || code === 126 || isPath && code === 47 || isAuthority && code === 91 || isAuthority && code === 93 || isAuthority && code === 58) { + if (nativeEncodePos !== -1) { + res += encodeURIComponent(uriComponent.substring(nativeEncodePos, pos)); + nativeEncodePos = -1; + } + if (res !== void 0) { + res += uriComponent.charAt(pos); + } + } else { + if (res === void 0) { + res = uriComponent.substr(0, pos); + } + const escaped = encodeTable[code]; + if (escaped !== void 0) { + if (nativeEncodePos !== -1) { + res += encodeURIComponent(uriComponent.substring(nativeEncodePos, pos)); + nativeEncodePos = -1; + } + res += escaped; + } else if (nativeEncodePos === -1) { + nativeEncodePos = pos; + } + } + } + if (nativeEncodePos !== -1) { + res += encodeURIComponent(uriComponent.substring(nativeEncodePos)); + } + return res !== void 0 ? res : uriComponent; +} +function encodeURIComponentMinimal(path) { + let res = void 0; + for (let pos = 0; pos < path.length; pos++) { + const code = path.charCodeAt(pos); + if (code === 35 || code === 63) { + if (res === void 0) { + res = path.substr(0, pos); + } + res += encodeTable[code]; + } else { + if (res !== void 0) { + res += path[pos]; + } + } + } + return res !== void 0 ? res : path; +} +function uriToFsPath(uri, keepDriveLetterCasing) { + let value; + if (uri.authority && uri.path.length > 1 && uri.scheme === "file") { + value = `//${uri.authority}${uri.path}`; + } else if (uri.path.charCodeAt(0) === 47 && (uri.path.charCodeAt(1) >= 65 && uri.path.charCodeAt(1) <= 90 || uri.path.charCodeAt(1) >= 97 && uri.path.charCodeAt(1) <= 122) && uri.path.charCodeAt(2) === 58) { + if (!keepDriveLetterCasing) { + value = uri.path[1].toLowerCase() + uri.path.substr(2); + } else { + value = uri.path.substr(1); + } + } else { + value = uri.path; + } + if (isWindows) { + value = value.replace(/\//g, "\\"); + } + return value; +} +function _asFormatted(uri, skipEncoding) { + const encoder = !skipEncoding ? encodeURIComponentFast : encodeURIComponentMinimal; + let res = ""; + let { scheme, authority, path, query, fragment } = uri; + if (scheme) { + res += scheme; + res += ":"; + } + if (authority || scheme === "file") { + res += _slash; + res += _slash; + } + if (authority) { + let idx = authority.indexOf("@"); + if (idx !== -1) { + const userinfo = authority.substr(0, idx); + authority = authority.substr(idx + 1); + idx = userinfo.lastIndexOf(":"); + if (idx === -1) { + res += encoder(userinfo, false, false); + } else { + res += encoder(userinfo.substr(0, idx), false, false); + res += ":"; + res += encoder(userinfo.substr(idx + 1), false, true); + } + res += "@"; + } + authority = authority.toLowerCase(); + idx = authority.lastIndexOf(":"); + if (idx === -1) { + res += encoder(authority, false, true); + } else { + res += encoder(authority.substr(0, idx), false, true); + res += authority.substr(idx); + } + } + if (path) { + if (path.length >= 3 && path.charCodeAt(0) === 47 && path.charCodeAt(2) === 58) { + const code = path.charCodeAt(1); + if (code >= 65 && code <= 90) { + path = `/${String.fromCharCode(code + 32)}:${path.substr(3)}`; + } + } else if (path.length >= 2 && path.charCodeAt(1) === 58) { + const code = path.charCodeAt(0); + if (code >= 65 && code <= 90) { + path = `${String.fromCharCode(code + 32)}:${path.substr(2)}`; + } + } + res += encoder(path, true, false); + } + if (query) { + res += "?"; + res += encoder(query, false, false); + } + if (fragment) { + res += "#"; + res += !skipEncoding ? encodeURIComponentFast(fragment, false, false) : fragment; + } + return res; +} +function decodeURIComponentGraceful(str) { + try { + return decodeURIComponent(str); + } catch { + if (str.length > 3) { + return str.substr(0, 3) + decodeURIComponentGraceful(str.substr(3)); + } else { + return str; + } + } +} +function percentDecode(str) { + if (!str.match(_rEncodedAsHex)) { + return str; + } + return str.replace(_rEncodedAsHex, (match2) => decodeURIComponentGraceful(match2)); +} +var _schemePattern, _singleSlashStart, _doubleSlashStart, _empty, _slash, _regexp, URI, _pathSepMarker, Uri, encodeTable, _rEncodedAsHex; +var init_uri = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/common/uri.js"() { + init_path(); + init_platform(); + _schemePattern = /^\w[\w\d+.-]*$/; + _singleSlashStart = /^\//; + _doubleSlashStart = /^\/\//; + _empty = ""; + _slash = "/"; + _regexp = /^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/; + URI = class _URI { + static isUri(thing) { + if (thing instanceof _URI) { + return true; + } + if (!thing || typeof thing !== "object") { + return false; + } + return typeof thing.authority === "string" && typeof thing.fragment === "string" && typeof thing.path === "string" && typeof thing.query === "string" && typeof thing.scheme === "string" && typeof thing.fsPath === "string" && typeof thing.with === "function" && typeof thing.toString === "function"; + } + /** + * @internal + */ + constructor(schemeOrData, authority, path, query, fragment, _strict = false) { + if (typeof schemeOrData === "object") { + this.scheme = schemeOrData.scheme || _empty; + this.authority = schemeOrData.authority || _empty; + this.path = schemeOrData.path || _empty; + this.query = schemeOrData.query || _empty; + this.fragment = schemeOrData.fragment || _empty; + } else { + this.scheme = _schemeFix(schemeOrData, _strict); + this.authority = authority || _empty; + this.path = _referenceResolution(this.scheme, path || _empty); + this.query = query || _empty; + this.fragment = fragment || _empty; + _validateUri(this, _strict); + } + } + // ---- filesystem path ----------------------- + /** + * Returns a string representing the corresponding file system path of this URI. + * Will handle UNC paths, normalizes windows drive letters to lower-case, and uses the + * platform specific path separator. + * + * * Will *not* validate the path for invalid characters and semantics. + * * Will *not* look at the scheme of this URI. + * * The result shall *not* be used for display purposes but for accessing a file on disk. + * + * + * The *difference* to `URI#path` is the use of the platform specific separator and the handling + * of UNC paths. See the below sample of a file-uri with an authority (UNC path). + * + * ```ts + const u = URI.parse('file://server/c$/folder/file.txt') + u.authority === 'server' + u.path === '/shares/c$/file.txt' + u.fsPath === '\\server\c$\folder\file.txt' + ``` + * + * Using `URI#path` to read a file (using fs-apis) would not be enough because parts of the path, + * namely the server name, would be missing. Therefore `URI#fsPath` exists - it's sugar to ease working + * with URIs that represent files on disk (`file` scheme). + */ + get fsPath() { + return uriToFsPath(this, false); + } + // ---- modify to new ------------------------- + with(change) { + if (!change) { + return this; + } + let { scheme, authority, path, query, fragment } = change; + if (scheme === void 0) { + scheme = this.scheme; + } else if (scheme === null) { + scheme = _empty; + } + if (authority === void 0) { + authority = this.authority; + } else if (authority === null) { + authority = _empty; + } + if (path === void 0) { + path = this.path; + } else if (path === null) { + path = _empty; + } + if (query === void 0) { + query = this.query; + } else if (query === null) { + query = _empty; + } + if (fragment === void 0) { + fragment = this.fragment; + } else if (fragment === null) { + fragment = _empty; + } + if (scheme === this.scheme && authority === this.authority && path === this.path && query === this.query && fragment === this.fragment) { + return this; + } + return new Uri(scheme, authority, path, query, fragment); + } + // ---- parse & validate ------------------------ + /** + * Creates a new URI from a string, e.g. `http://www.example.com/some/path`, + * `file:///usr/home`, or `scheme:with/path`. + * + * @param value A string which represents an URI (see `URI#toString`). + */ + static parse(value, _strict = false) { + const match2 = _regexp.exec(value); + if (!match2) { + return new Uri(_empty, _empty, _empty, _empty, _empty); + } + return new Uri(match2[2] || _empty, percentDecode(match2[4] || _empty), percentDecode(match2[5] || _empty), percentDecode(match2[7] || _empty), percentDecode(match2[9] || _empty), _strict); + } + /** + * Creates a new URI from a file system path, e.g. `c:\my\files`, + * `/usr/home`, or `\\server\share\some\path`. + * + * The *difference* between `URI#parse` and `URI#file` is that the latter treats the argument + * as path, not as stringified-uri. E.g. `URI.file(path)` is **not the same as** + * `URI.parse('file://' + path)` because the path might contain characters that are + * interpreted (# and ?). See the following sample: + * ```ts + const good = URI.file('/coding/c#/project1'); + good.scheme === 'file'; + good.path === '/coding/c#/project1'; + good.fragment === ''; + const bad = URI.parse('file://' + '/coding/c#/project1'); + bad.scheme === 'file'; + bad.path === '/coding/c'; // path is now broken + bad.fragment === '/project1'; + ``` + * + * @param path A file system path (see `URI#fsPath`) + */ + static file(path) { + let authority = _empty; + if (isWindows) { + path = path.replace(/\\/g, _slash); + } + if (path[0] === _slash && path[1] === _slash) { + const idx = path.indexOf(_slash, 2); + if (idx === -1) { + authority = path.substring(2); + path = _slash; + } else { + authority = path.substring(2, idx); + path = path.substring(idx) || _slash; + } + } + return new Uri("file", authority, path, _empty, _empty); + } + /** + * Creates new URI from uri components. + * + * Unless `strict` is `true` the scheme is defaults to be `file`. This function performs + * validation and should be used for untrusted uri components retrieved from storage, + * user input, command arguments etc + */ + static from(components, strict) { + const result = new Uri(components.scheme, components.authority, components.path, components.query, components.fragment, strict); + return result; + } + /** + * Join a URI path with path fragments and normalizes the resulting path. + * + * @param uri The input URI. + * @param pathFragment The path fragment to add to the URI path. + * @returns The resulting URI. + */ + static joinPath(uri, ...pathFragment) { + if (!uri.path) { + throw new Error(`[UriError]: cannot call joinPath on URI without path`); + } + let newPath; + if (isWindows && uri.scheme === "file") { + newPath = _URI.file(win32.join(uriToFsPath(uri, true), ...pathFragment)).path; + } else { + newPath = posix.join(uri.path, ...pathFragment); + } + return uri.with({ path: newPath }); + } + // ---- printing/externalize --------------------------- + /** + * Creates a string representation for this URI. It's guaranteed that calling + * `URI.parse` with the result of this function creates an URI which is equal + * to this URI. + * + * * The result shall *not* be used for display purposes but for externalization or transport. + * * The result will be encoded using the percentage encoding and encoding happens mostly + * ignore the scheme-specific encoding rules. + * + * @param skipEncoding Do not encode the result, default is `false` + */ + toString(skipEncoding = false) { + return _asFormatted(this, skipEncoding); + } + toJSON() { + return this; + } + static revive(data) { + if (!data) { + return data; + } else if (data instanceof _URI) { + return data; + } else { + const result = new Uri(data); + result._formatted = data.external ?? null; + result._fsPath = data._sep === _pathSepMarker ? data.fsPath ?? null : null; + return result; + } + } + }; + _pathSepMarker = isWindows ? 1 : void 0; + Uri = class extends URI { + constructor() { + super(...arguments); + this._formatted = null; + this._fsPath = null; + } + get fsPath() { + if (!this._fsPath) { + this._fsPath = uriToFsPath(this, false); + } + return this._fsPath; + } + toString(skipEncoding = false) { + if (!skipEncoding) { + if (!this._formatted) { + this._formatted = _asFormatted(this, false); + } + return this._formatted; + } else { + return _asFormatted(this, true); + } + } + toJSON() { + const res = { + $mid: 1 + /* MarshalledId.Uri */ + }; + if (this._fsPath) { + res.fsPath = this._fsPath; + res._sep = _pathSepMarker; + } + if (this._formatted) { + res.external = this._formatted; + } + if (this.path) { + res.path = this.path; + } + if (this.scheme) { + res.scheme = this.scheme; + } + if (this.authority) { + res.authority = this.authority; + } + if (this.query) { + res.query = this.query; + } + if (this.fragment) { + res.fragment = this.fragment; + } + return res; + } + }; + encodeTable = { + [ + 58 + /* CharCode.Colon */ + ]: "%3A", + // gen-delims + [ + 47 + /* CharCode.Slash */ + ]: "%2F", + [ + 63 + /* CharCode.QuestionMark */ + ]: "%3F", + [ + 35 + /* CharCode.Hash */ + ]: "%23", + [ + 91 + /* CharCode.OpenSquareBracket */ + ]: "%5B", + [ + 93 + /* CharCode.CloseSquareBracket */ + ]: "%5D", + [ + 64 + /* CharCode.AtSign */ + ]: "%40", + [ + 33 + /* CharCode.ExclamationMark */ + ]: "%21", + // sub-delims + [ + 36 + /* CharCode.DollarSign */ + ]: "%24", + [ + 38 + /* CharCode.Ampersand */ + ]: "%26", + [ + 39 + /* CharCode.SingleQuote */ + ]: "%27", + [ + 40 + /* CharCode.OpenParen */ + ]: "%28", + [ + 41 + /* CharCode.CloseParen */ + ]: "%29", + [ + 42 + /* CharCode.Asterisk */ + ]: "%2A", + [ + 43 + /* CharCode.Plus */ + ]: "%2B", + [ + 44 + /* CharCode.Comma */ + ]: "%2C", + [ + 59 + /* CharCode.Semicolon */ + ]: "%3B", + [ + 61 + /* CharCode.Equals */ + ]: "%3D", + [ + 32 + /* CharCode.Space */ + ]: "%20" + }; + _rEncodedAsHex = /(%[0-9A-Za-z][0-9A-Za-z])+/g; + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/common/network.js +function matchesScheme(target, scheme) { + if (URI.isUri(target)) { + return equalsIgnoreCase(target.scheme, scheme); + } else { + return startsWithIgnoreCase(target, scheme + ":"); + } +} +function matchesSomeScheme(target, ...schemes) { + return schemes.some((scheme) => matchesScheme(target, scheme)); +} +var Schemas, connectionTokenQueryName, RemoteAuthoritiesImpl, RemoteAuthorities, VSCODE_AUTHORITY, FileAccessImpl, FileAccess, CacheControlheaders, DocumentPolicyheaders, COI; +var init_network = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/common/network.js"() { + init_errors(); + init_platform(); + init_strings(); + init_uri(); + init_path(); + (function(Schemas2) { + Schemas2.inMemory = "inmemory"; + Schemas2.vscode = "vscode"; + Schemas2.internal = "private"; + Schemas2.walkThrough = "walkThrough"; + Schemas2.walkThroughSnippet = "walkThroughSnippet"; + Schemas2.http = "http"; + Schemas2.https = "https"; + Schemas2.file = "file"; + Schemas2.mailto = "mailto"; + Schemas2.untitled = "untitled"; + Schemas2.data = "data"; + Schemas2.command = "command"; + Schemas2.vscodeRemote = "vscode-remote"; + Schemas2.vscodeRemoteResource = "vscode-remote-resource"; + Schemas2.vscodeManagedRemoteResource = "vscode-managed-remote-resource"; + Schemas2.vscodeUserData = "vscode-userdata"; + Schemas2.vscodeCustomEditor = "vscode-custom-editor"; + Schemas2.vscodeNotebookCell = "vscode-notebook-cell"; + Schemas2.vscodeNotebookCellMetadata = "vscode-notebook-cell-metadata"; + Schemas2.vscodeNotebookCellMetadataDiff = "vscode-notebook-cell-metadata-diff"; + Schemas2.vscodeNotebookCellOutput = "vscode-notebook-cell-output"; + Schemas2.vscodeNotebookCellOutputDiff = "vscode-notebook-cell-output-diff"; + Schemas2.vscodeNotebookMetadata = "vscode-notebook-metadata"; + Schemas2.vscodeInteractiveInput = "vscode-interactive-input"; + Schemas2.vscodeSettings = "vscode-settings"; + Schemas2.vscodeWorkspaceTrust = "vscode-workspace-trust"; + Schemas2.vscodeTerminal = "vscode-terminal"; + Schemas2.vscodeChatCodeBlock = "vscode-chat-code-block"; + Schemas2.vscodeChatCodeCompareBlock = "vscode-chat-code-compare-block"; + Schemas2.vscodeChatEditor = "vscode-chat-editor"; + Schemas2.vscodeChatInput = "chatSessionInput"; + Schemas2.vscodeLocalChatSession = "vscode-chat-session"; + Schemas2.webviewPanel = "webview-panel"; + Schemas2.vscodeWebview = "vscode-webview"; + Schemas2.extension = "extension"; + Schemas2.vscodeFileResource = "vscode-file"; + Schemas2.tmp = "tmp"; + Schemas2.vsls = "vsls"; + Schemas2.vscodeSourceControl = "vscode-scm"; + Schemas2.commentsInput = "comment"; + Schemas2.codeSetting = "code-setting"; + Schemas2.outputChannel = "output"; + Schemas2.accessibleView = "accessible-view"; + Schemas2.chatEditingSnapshotScheme = "chat-editing-snapshot-text-model"; + Schemas2.chatEditingModel = "chat-editing-text-model"; + Schemas2.copilotPr = "copilot-pr"; + })(Schemas || (Schemas = {})); + connectionTokenQueryName = "tkn"; + RemoteAuthoritiesImpl = class { + constructor() { + this._hosts = /* @__PURE__ */ Object.create(null); + this._ports = /* @__PURE__ */ Object.create(null); + this._connectionTokens = /* @__PURE__ */ Object.create(null); + this._preferredWebSchema = "http"; + this._delegate = null; + this._serverRootPath = "/"; + } + setPreferredWebSchema(schema) { + this._preferredWebSchema = schema; + } + get _remoteResourcesPath() { + return posix.join(this._serverRootPath, Schemas.vscodeRemoteResource); + } + rewrite(uri) { + if (this._delegate) { + try { + return this._delegate(uri); + } catch (err) { + onUnexpectedError(err); + return uri; + } + } + const authority = uri.authority; + let host = this._hosts[authority]; + if (host && host.indexOf(":") !== -1 && host.indexOf("[") === -1) { + host = `[${host}]`; + } + const port = this._ports[authority]; + const connectionToken = this._connectionTokens[authority]; + let query = `path=${encodeURIComponent(uri.path)}`; + if (typeof connectionToken === "string") { + query += `&${connectionTokenQueryName}=${encodeURIComponent(connectionToken)}`; + } + return URI.from({ + scheme: isWeb ? this._preferredWebSchema : Schemas.vscodeRemoteResource, + authority: `${host}:${port}`, + path: this._remoteResourcesPath, + query + }); + } + }; + RemoteAuthorities = new RemoteAuthoritiesImpl(); + VSCODE_AUTHORITY = "vscode-app"; + FileAccessImpl = class _FileAccessImpl { + static { + this.FALLBACK_AUTHORITY = VSCODE_AUTHORITY; + } + /** + * Returns a URI to use in contexts where the browser is responsible + * for loading (e.g. fetch()) or when used within the DOM. + * + * **Note:** use `dom.ts#asCSSUrl` whenever the URL is to be used in CSS context. + */ + uriToBrowserUri(uri) { + if (uri.scheme === Schemas.vscodeRemote) { + return RemoteAuthorities.rewrite(uri); + } + if ( + // ...only ever for `file` resources + uri.scheme === Schemas.file && // ...and we run in native environments + (isNative || // ...or web worker extensions on desktop + webWorkerOrigin === `${Schemas.vscodeFileResource}://${_FileAccessImpl.FALLBACK_AUTHORITY}`) + ) { + return uri.with({ + scheme: Schemas.vscodeFileResource, + // We need to provide an authority here so that it can serve + // as origin for network and loading matters in chromium. + // If the URI is not coming with an authority already, we + // add our own + authority: uri.authority || _FileAccessImpl.FALLBACK_AUTHORITY, + query: null, + fragment: null + }); + } + return uri; + } + }; + FileAccess = new FileAccessImpl(); + CacheControlheaders = Object.freeze({ + "Cache-Control": "no-cache, no-store" + }); + DocumentPolicyheaders = Object.freeze({ + "Document-Policy": "include-js-call-stacks-in-crash-reports" + }); + (function(COI2) { + const coiHeaders = /* @__PURE__ */ new Map([ + ["1", { "Cross-Origin-Opener-Policy": "same-origin" }], + ["2", { "Cross-Origin-Embedder-Policy": "require-corp" }], + ["3", { "Cross-Origin-Opener-Policy": "same-origin", "Cross-Origin-Embedder-Policy": "require-corp" }] + ]); + COI2.CoopAndCoep = Object.freeze(coiHeaders.get("3")); + const coiSearchParamName = "vscode-coi"; + function getHeadersFromQuery(url) { + let params; + if (typeof url === "string") { + params = new URL(url).searchParams; + } else if (url instanceof URL) { + params = url.searchParams; + } else if (URI.isUri(url)) { + params = new URL(url.toString(true)).searchParams; + } + const value = params?.get(coiSearchParamName); + if (!value) { + return void 0; + } + return coiHeaders.get(value); + } + COI2.getHeadersFromQuery = getHeadersFromQuery; + function addSearchParam(urlOrSearch, coop, coep) { + if (!globalThis.crossOriginIsolated) { + return; + } + const value = coop && coep ? "3" : coep ? "2" : "1"; + if (urlOrSearch instanceof URLSearchParams) { + urlOrSearch.set(coiSearchParamName, value); + } else { + urlOrSearch[coiSearchParamName] = value; + } + } + COI2.addSearchParam = addSearchParam; + })(COI || (COI = {})); + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/common/buffer.js +function readUInt16LE(source, offset) { + return source[offset + 0] << 0 >>> 0 | source[offset + 1] << 8 >>> 0; +} +function writeUInt16LE(destination, value, offset) { + destination[offset + 0] = value & 255; + value = value >>> 8; + destination[offset + 1] = value & 255; +} +function readUInt32BE(source, offset) { + return source[offset] * 2 ** 24 + source[offset + 1] * 2 ** 16 + source[offset + 2] * 2 ** 8 + source[offset + 3]; +} +function writeUInt32BE(destination, value, offset) { + destination[offset + 3] = value; + value = value >>> 8; + destination[offset + 2] = value; + value = value >>> 8; + destination[offset + 1] = value; + value = value >>> 8; + destination[offset] = value; +} +function readUInt8(source, offset) { + return source[offset]; +} +function writeUInt8(destination, value, offset) { + destination[offset] = value; +} +function encodeHex({ buffer }) { + let result = ""; + for (let i2 = 0; i2 < buffer.length; i2++) { + const byte = buffer[i2]; + result += hexChars[byte >>> 4]; + result += hexChars[byte & 15]; + } + return result; +} +var hasBuffer, indexOfTable, textDecoder, VSBuffer, hexChars; +var init_buffer = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/common/buffer.js"() { + init_lazy(); + hasBuffer = typeof Buffer !== "undefined"; + indexOfTable = new Lazy(() => new Uint8Array(256)); + VSBuffer = class _VSBuffer { + /** + * When running in a nodejs context, if `actual` is not a nodejs Buffer, the backing store for + * the returned `VSBuffer` instance might use a nodejs Buffer allocated from node's Buffer pool, + * which is not transferrable. + */ + static wrap(actual) { + if (hasBuffer && !Buffer.isBuffer(actual)) { + actual = Buffer.from(actual.buffer, actual.byteOffset, actual.byteLength); + } + return new _VSBuffer(actual); + } + constructor(buffer) { + this.buffer = buffer; + this.byteLength = this.buffer.byteLength; + } + toString() { + if (hasBuffer) { + return this.buffer.toString(); + } else { + if (!textDecoder) { + textDecoder = new TextDecoder(); + } + return textDecoder.decode(this.buffer); + } + } + }; + hexChars = "0123456789abcdef"; + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/common/hash.js +function hash(obj) { + return doHash(obj, 0); +} +function doHash(obj, hashVal) { + switch (typeof obj) { + case "object": + if (obj === null) { + return numberHash(349, hashVal); + } else if (Array.isArray(obj)) { + return arrayHash(obj, hashVal); + } + return objectHash(obj, hashVal); + case "string": + return stringHash(obj, hashVal); + case "boolean": + return booleanHash(obj, hashVal); + case "number": + return numberHash(obj, hashVal); + case "undefined": + return numberHash(937, hashVal); + default: + return numberHash(617, hashVal); + } +} +function numberHash(val, initialHashVal) { + return (initialHashVal << 5) - initialHashVal + val | 0; +} +function booleanHash(b, initialHashVal) { + return numberHash(b ? 433 : 863, initialHashVal); +} +function stringHash(s, hashVal) { + hashVal = numberHash(149417, hashVal); + for (let i2 = 0, length = s.length; i2 < length; i2++) { + hashVal = numberHash(s.charCodeAt(i2), hashVal); + } + return hashVal; +} +function arrayHash(arr, initialHashVal) { + initialHashVal = numberHash(104579, initialHashVal); + return arr.reduce((hashVal, item) => doHash(item, hashVal), initialHashVal); +} +function objectHash(obj, initialHashVal) { + initialHashVal = numberHash(181387, initialHashVal); + return Object.keys(obj).sort().reduce((hashVal, key) => { + hashVal = stringHash(key, hashVal); + return doHash(obj[key], hashVal); + }, initialHashVal); +} +function leftRotate(value, bits, totalBits = 32) { + const delta = totalBits - bits; + const mask = ~((1 << delta) - 1); + return (value << bits | (mask & value) >>> delta) >>> 0; +} +function toHexString(bufferOrValue, bitsize = 32) { + if (bufferOrValue instanceof ArrayBuffer) { + return encodeHex(VSBuffer.wrap(new Uint8Array(bufferOrValue))); + } + return (bufferOrValue >>> 0).toString(16).padStart(bitsize / 4, "0"); +} +var StringSHA1; +var init_hash = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/common/hash.js"() { + init_buffer(); + init_strings(); + StringSHA1 = class _StringSHA1 { + static { + this._bigBlock32 = new DataView(new ArrayBuffer(320)); + } + // 80 * 4 = 320 + constructor() { + this._h0 = 1732584193; + this._h1 = 4023233417; + this._h2 = 2562383102; + this._h3 = 271733878; + this._h4 = 3285377520; + this._buff = new Uint8Array( + 64 + 3 + /* to fit any utf-8 */ + ); + this._buffDV = new DataView(this._buff.buffer); + this._buffLen = 0; + this._totalLen = 0; + this._leftoverHighSurrogate = 0; + this._finished = false; + } + update(str) { + const strLen = str.length; + if (strLen === 0) { + return; + } + const buff = this._buff; + let buffLen = this._buffLen; + let leftoverHighSurrogate = this._leftoverHighSurrogate; + let charCode; + let offset; + if (leftoverHighSurrogate !== 0) { + charCode = leftoverHighSurrogate; + offset = -1; + leftoverHighSurrogate = 0; + } else { + charCode = str.charCodeAt(0); + offset = 0; + } + while (true) { + let codePoint = charCode; + if (isHighSurrogate(charCode)) { + if (offset + 1 < strLen) { + const nextCharCode = str.charCodeAt(offset + 1); + if (isLowSurrogate(nextCharCode)) { + offset++; + codePoint = computeCodePoint(charCode, nextCharCode); + } else { + codePoint = 65533; + } + } else { + leftoverHighSurrogate = charCode; + break; + } + } else if (isLowSurrogate(charCode)) { + codePoint = 65533; + } + buffLen = this._push(buff, buffLen, codePoint); + offset++; + if (offset < strLen) { + charCode = str.charCodeAt(offset); + } else { + break; + } + } + this._buffLen = buffLen; + this._leftoverHighSurrogate = leftoverHighSurrogate; + } + _push(buff, buffLen, codePoint) { + if (codePoint < 128) { + buff[buffLen++] = codePoint; + } else if (codePoint < 2048) { + buff[buffLen++] = 192 | (codePoint & 1984) >>> 6; + buff[buffLen++] = 128 | (codePoint & 63) >>> 0; + } else if (codePoint < 65536) { + buff[buffLen++] = 224 | (codePoint & 61440) >>> 12; + buff[buffLen++] = 128 | (codePoint & 4032) >>> 6; + buff[buffLen++] = 128 | (codePoint & 63) >>> 0; + } else { + buff[buffLen++] = 240 | (codePoint & 1835008) >>> 18; + buff[buffLen++] = 128 | (codePoint & 258048) >>> 12; + buff[buffLen++] = 128 | (codePoint & 4032) >>> 6; + buff[buffLen++] = 128 | (codePoint & 63) >>> 0; + } + if (buffLen >= 64) { + this._step(); + buffLen -= 64; + this._totalLen += 64; + buff[0] = buff[64 + 0]; + buff[1] = buff[64 + 1]; + buff[2] = buff[64 + 2]; + } + return buffLen; + } + digest() { + if (!this._finished) { + this._finished = true; + if (this._leftoverHighSurrogate) { + this._leftoverHighSurrogate = 0; + this._buffLen = this._push( + this._buff, + this._buffLen, + 65533 + /* SHA1Constant.UNICODE_REPLACEMENT */ + ); + } + this._totalLen += this._buffLen; + this._wrapUp(); + } + return toHexString(this._h0) + toHexString(this._h1) + toHexString(this._h2) + toHexString(this._h3) + toHexString(this._h4); + } + _wrapUp() { + this._buff[this._buffLen++] = 128; + this._buff.subarray(this._buffLen).fill(0); + if (this._buffLen > 56) { + this._step(); + this._buff.fill(0); + } + const ml = 8 * this._totalLen; + this._buffDV.setUint32(56, Math.floor(ml / 4294967296), false); + this._buffDV.setUint32(60, ml % 4294967296, false); + this._step(); + } + _step() { + const bigBlock32 = _StringSHA1._bigBlock32; + const data = this._buffDV; + for (let j = 0; j < 64; j += 4) { + bigBlock32.setUint32(j, data.getUint32(j, false), false); + } + for (let j = 64; j < 320; j += 4) { + bigBlock32.setUint32(j, leftRotate(bigBlock32.getUint32(j - 12, false) ^ bigBlock32.getUint32(j - 32, false) ^ bigBlock32.getUint32(j - 56, false) ^ bigBlock32.getUint32(j - 64, false), 1), false); + } + let a = this._h0; + let b = this._h1; + let c = this._h2; + let d = this._h3; + let e = this._h4; + let f, k; + let temp; + for (let j = 0; j < 80; j++) { + if (j < 20) { + f = b & c | ~b & d; + k = 1518500249; + } else if (j < 40) { + f = b ^ c ^ d; + k = 1859775393; + } else if (j < 60) { + f = b & c | b & d | c & d; + k = 2400959708; + } else { + f = b ^ c ^ d; + k = 3395469782; + } + temp = leftRotate(a, 5) + f + e + k + bigBlock32.getUint32(j * 4, false) & 4294967295; + e = d; + d = c; + c = leftRotate(b, 30); + b = a; + a = temp; + } + this._h0 = this._h0 + a & 4294967295; + this._h1 = this._h1 + b & 4294967295; + this._h2 = this._h2 + c & 4294967295; + this._h3 = this._h3 + d & 4294967295; + this._h4 = this._h4 + e & 4294967295; + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/common/observableInternal/debugName.js +function getDebugName(target, data) { + const cached = cachedDebugName.get(target); + if (cached) { + return cached; + } + const dbgName = computeDebugName(target, data); + if (dbgName) { + let count = countPerName.get(dbgName) ?? 0; + count++; + countPerName.set(dbgName, count); + const result = count === 1 ? dbgName : `${dbgName}#${count}`; + cachedDebugName.set(target, result); + return result; + } + return void 0; +} +function computeDebugName(self2, data) { + const cached = cachedDebugName.get(self2); + if (cached) { + return cached; + } + const ownerStr = data.owner ? formatOwner(data.owner) + `.` : ""; + let result; + const debugNameSource = data.debugNameSource; + if (debugNameSource !== void 0) { + if (typeof debugNameSource === "function") { + result = debugNameSource(); + if (result !== void 0) { + return ownerStr + result; + } + } else { + return ownerStr + debugNameSource; + } + } + const referenceFn = data.referenceFn; + if (referenceFn !== void 0) { + result = getFunctionName(referenceFn); + if (result !== void 0) { + return ownerStr + result; + } + } + if (data.owner !== void 0) { + const key = findKey(data.owner, self2); + if (key !== void 0) { + return ownerStr + key; + } + } + return void 0; +} +function findKey(obj, value) { + for (const key in obj) { + if (obj[key] === value) { + return key; + } + } + return void 0; +} +function formatOwner(owner) { + const id = ownerId.get(owner); + if (id) { + return id; + } + const className2 = getClassName(owner) ?? "Object"; + let count = countPerClassName.get(className2) ?? 0; + count++; + countPerClassName.set(className2, count); + const result = count === 1 ? className2 : `${className2}#${count}`; + ownerId.set(owner, result); + return result; +} +function getClassName(obj) { + const ctor = obj.constructor; + if (ctor) { + if (ctor.name === "Object") { + return void 0; + } + return ctor.name; + } + return void 0; +} +function getFunctionName(fn) { + const fnSrc = fn.toString(); + const regexp = /\/\*\*\s*@description\s*([^*]*)\*\//; + const match2 = regexp.exec(fnSrc); + const result = match2 ? match2[1] : void 0; + return result?.trim(); +} +var DebugNameData, countPerName, cachedDebugName, countPerClassName, ownerId; +var init_debugName = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/common/observableInternal/debugName.js"() { + DebugNameData = class { + constructor(owner, debugNameSource, referenceFn) { + this.owner = owner; + this.debugNameSource = debugNameSource; + this.referenceFn = referenceFn; + } + getDebugName(target) { + return getDebugName(target, this); + } + }; + countPerName = /* @__PURE__ */ new Map(); + cachedDebugName = /* @__PURE__ */ new WeakMap(); + countPerClassName = /* @__PURE__ */ new Map(); + ownerId = /* @__PURE__ */ new WeakMap(); + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/common/arrays.js +function tail(arr) { + if (arr.length === 0) { + throw new Error("Invalid tail call"); + } + return [arr.slice(0, arr.length - 1), arr[arr.length - 1]]; +} +function equals(one, other, itemEquals2 = (a, b) => a === b) { + if (one === other) { + return true; + } + if (!one || !other) { + return false; + } + if (one.length !== other.length) { + return false; + } + for (let i2 = 0, len = one.length; i2 < len; i2++) { + if (!itemEquals2(one[i2], other[i2])) { + return false; + } + } + return true; +} +function removeFastWithoutKeepingOrder(array2, index) { + const last = array2.length - 1; + if (index < last) { + array2[index] = array2[last]; + } + array2.pop(); +} +function binarySearch(array2, key, comparator) { + return binarySearch2(array2.length, (i2) => comparator(array2[i2], key)); +} +function binarySearch2(length, compareToKey) { + let low = 0, high = length - 1; + while (low <= high) { + const mid = (low + high) / 2 | 0; + const comp = compareToKey(mid); + if (comp < 0) { + low = mid + 1; + } else if (comp > 0) { + high = mid - 1; + } else { + return mid; + } + } + return -(low + 1); +} +function quickSelect(nth, data, compare2) { + nth = nth | 0; + if (nth >= data.length) { + throw new TypeError("invalid index"); + } + const pivotValue = data[Math.floor(data.length * Math.random())]; + const lower = []; + const higher = []; + const pivots = []; + for (const value of data) { + const val = compare2(value, pivotValue); + if (val < 0) { + lower.push(value); + } else if (val > 0) { + higher.push(value); + } else { + pivots.push(value); + } + } + if (nth < lower.length) { + return quickSelect(nth, lower, compare2); + } else if (nth < lower.length + pivots.length) { + return pivots[0]; + } else { + return quickSelect(nth - (lower.length + pivots.length), higher, compare2); + } +} +function groupBy(data, compare2) { + const result = []; + let currentGroup = void 0; + for (const element of data.slice(0).sort(compare2)) { + if (!currentGroup || compare2(currentGroup[0], element) !== 0) { + currentGroup = [element]; + result.push(currentGroup); + } else { + currentGroup.push(element); + } + } + return result; +} +function* groupAdjacentBy(items, shouldBeGrouped) { + let currentGroup; + let last; + for (const item of items) { + if (last !== void 0 && shouldBeGrouped(last, item)) { + currentGroup.push(item); + } else { + if (currentGroup) { + yield currentGroup; + } + currentGroup = [item]; + } + last = item; + } + if (currentGroup) { + yield currentGroup; + } +} +function forEachAdjacent(arr, f) { + for (let i2 = 0; i2 <= arr.length; i2++) { + f(i2 === 0 ? void 0 : arr[i2 - 1], i2 === arr.length ? void 0 : arr[i2]); + } +} +function forEachWithNeighbors(arr, f) { + for (let i2 = 0; i2 < arr.length; i2++) { + f(i2 === 0 ? void 0 : arr[i2 - 1], arr[i2], i2 + 1 === arr.length ? void 0 : arr[i2 + 1]); + } +} +function coalesce(array2) { + return array2.filter((e) => !!e); +} +function coalesceInPlace(array2) { + let to = 0; + for (let i2 = 0; i2 < array2.length; i2++) { + if (!!array2[i2]) { + array2[to] = array2[i2]; + to += 1; + } + } + array2.length = to; +} +function isFalsyOrEmpty(obj) { + return !Array.isArray(obj) || obj.length === 0; +} +function isNonEmptyArray(obj) { + return Array.isArray(obj) && obj.length > 0; +} +function distinct(array2, keyFn = (value) => value) { + const seen = /* @__PURE__ */ new Set(); + return array2.filter((element) => { + const key = keyFn(element); + if (seen.has(key)) { + return false; + } + seen.add(key); + return true; + }); +} +function range(arg, to) { + let from = typeof to === "number" ? arg : 0; + if (typeof to === "number") { + from = arg; + } else { + from = 0; + to = arg; + } + const result = []; + if (from <= to) { + for (let i2 = from; i2 < to; i2++) { + result.push(i2); + } + } else { + for (let i2 = from; i2 > to; i2--) { + result.push(i2); + } + } + return result; +} +function arrayInsert(target, insertIndex, insertArr) { + const before = target.slice(0, insertIndex); + const after2 = target.slice(insertIndex); + return before.concat(insertArr, after2); +} +function pushToStart(arr, value) { + const index = arr.indexOf(value); + if (index > -1) { + arr.splice(index, 1); + arr.unshift(value); + } +} +function pushToEnd(arr, value) { + const index = arr.indexOf(value); + if (index > -1) { + arr.splice(index, 1); + arr.push(value); + } +} +function pushMany(arr, items) { + for (const item of items) { + arr.push(item); + } +} +function mapFilter(array2, fn) { + const result = []; + for (const item of array2) { + const mapped = fn(item); + if (mapped !== void 0) { + result.push(mapped); + } + } + return result; +} +function asArray(x) { + return Array.isArray(x) ? x : [x]; +} +function insertInto(array2, start, newItems) { + const startIdx = getActualStartIndex(array2, start); + const originalLength = array2.length; + const newItemsLength = newItems.length; + array2.length = originalLength + newItemsLength; + for (let i2 = originalLength - 1; i2 >= startIdx; i2--) { + array2[i2 + newItemsLength] = array2[i2]; + } + for (let i2 = 0; i2 < newItemsLength; i2++) { + array2[i2 + startIdx] = newItems[i2]; + } +} +function splice(array2, start, deleteCount, newItems) { + const index = getActualStartIndex(array2, start); + let result = array2.splice(index, deleteCount); + if (result === void 0) { + result = []; + } + insertInto(array2, index, newItems); + return result; +} +function getActualStartIndex(array2, start) { + return start < 0 ? Math.max(start + array2.length, 0) : Math.min(start, array2.length); +} +function compareBy(selector, comparator) { + return (a, b) => comparator(selector(a), selector(b)); +} +function tieBreakComparators(...comparators) { + return (item1, item2) => { + for (const comparator of comparators) { + const result = comparator(item1, item2); + if (!CompareResult.isNeitherLessOrGreaterThan(result)) { + return result; + } + } + return CompareResult.neitherLessOrGreaterThan; + }; +} +function reverseOrder(comparator) { + return (a, b) => -comparator(a, b); +} +function compareUndefinedSmallest(comparator) { + return (a, b) => { + if (a === void 0) { + return b === void 0 ? CompareResult.neitherLessOrGreaterThan : CompareResult.lessThan; + } else if (b === void 0) { + return CompareResult.greaterThan; + } + return comparator(a, b); + }; +} +function sum(array2) { + return array2.reduce((acc, value) => acc + value, 0); +} +var CompareResult, numberComparator, booleanComparator, ArrayQueue, CallbackIterable, Permutation; +var init_arrays = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/common/arrays.js"() { + (function(CompareResult2) { + function isLessThan(result) { + return result < 0; + } + CompareResult2.isLessThan = isLessThan; + function isLessThanOrEqual(result) { + return result <= 0; + } + CompareResult2.isLessThanOrEqual = isLessThanOrEqual; + function isGreaterThan(result) { + return result > 0; + } + CompareResult2.isGreaterThan = isGreaterThan; + function isNeitherLessOrGreaterThan(result) { + return result === 0; + } + CompareResult2.isNeitherLessOrGreaterThan = isNeitherLessOrGreaterThan; + CompareResult2.greaterThan = 1; + CompareResult2.lessThan = -1; + CompareResult2.neitherLessOrGreaterThan = 0; + })(CompareResult || (CompareResult = {})); + numberComparator = (a, b) => a - b; + booleanComparator = (a, b) => numberComparator(a ? 1 : 0, b ? 1 : 0); + ArrayQueue = class { + /** + * Constructs a queue that is backed by the given array. Runtime is O(1). + */ + constructor(items) { + this.firstIdx = 0; + this.items = items; + this.lastIdx = this.items.length - 1; + } + get length() { + return this.lastIdx - this.firstIdx + 1; + } + /** + * Consumes elements from the beginning of the queue as long as the predicate returns true. + * If no elements were consumed, `null` is returned. Has a runtime of O(result.length). + */ + takeWhile(predicate) { + let startIdx = this.firstIdx; + while (startIdx < this.items.length && predicate(this.items[startIdx])) { + startIdx++; + } + const result = startIdx === this.firstIdx ? null : this.items.slice(this.firstIdx, startIdx); + this.firstIdx = startIdx; + return result; + } + /** + * Consumes elements from the end of the queue as long as the predicate returns true. + * If no elements were consumed, `null` is returned. + * The result has the same order as the underlying array! + */ + takeFromEndWhile(predicate) { + let endIdx = this.lastIdx; + while (endIdx >= 0 && predicate(this.items[endIdx])) { + endIdx--; + } + const result = endIdx === this.lastIdx ? null : this.items.slice(endIdx + 1, this.lastIdx + 1); + this.lastIdx = endIdx; + return result; + } + peek() { + if (this.length === 0) { + return void 0; + } + return this.items[this.firstIdx]; + } + dequeue() { + const result = this.items[this.firstIdx]; + this.firstIdx++; + return result; + } + takeCount(count) { + const result = this.items.slice(this.firstIdx, this.firstIdx + count); + this.firstIdx += count; + return result; + } + }; + CallbackIterable = class _CallbackIterable { + static { + this.empty = new _CallbackIterable((_callback) => { + }); + } + constructor(iterate) { + this.iterate = iterate; + } + toArray() { + const result = []; + this.iterate((item) => { + result.push(item); + return true; + }); + return result; + } + filter(predicate) { + return new _CallbackIterable((cb) => this.iterate((item) => predicate(item) ? cb(item) : true)); + } + map(mapFn) { + return new _CallbackIterable((cb) => this.iterate((item) => cb(mapFn(item)))); + } + findLast(predicate) { + let result; + this.iterate((item) => { + if (predicate(item)) { + result = item; + } + return true; + }); + return result; + } + findLastMaxBy(comparator) { + let result; + let first2 = true; + this.iterate((item) => { + if (first2 || CompareResult.isGreaterThan(comparator(item, result))) { + first2 = false; + result = item; + } + return true; + }); + return result; + } + }; + Permutation = class _Permutation { + constructor(_indexMap) { + this._indexMap = _indexMap; + } + /** + * Returns a permutation that sorts the given array according to the given compare function. + */ + static createSortPermutation(arr, compareFn) { + const sortIndices = Array.from(arr.keys()).sort((index1, index2) => compareFn(arr[index1], arr[index2])); + return new _Permutation(sortIndices); + } + /** + * Returns a new array with the elements of the given array re-arranged according to this permutation. + */ + apply(arr) { + return arr.map((_, index) => arr[this._indexMap[index]]); + } + /** + * Returns a new permutation that undoes the re-arrangement of this permutation. + */ + inverse() { + const inverseIndexMap = this._indexMap.slice(); + for (let i2 = 0; i2 < this._indexMap.length; i2++) { + inverseIndexMap[this._indexMap[i2]] = i2; + } + return new _Permutation(inverseIndexMap); + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/common/equals.js +function itemsEquals(itemEquals2 = strictEquals) { + return (a, b) => equals(a, b, itemEquals2); +} +function itemEquals() { + return (a, b) => a.equals(b); +} +function equalsIfDefined(equalsOrV1, v2, equals3) { + if (equals3 !== void 0) { + const v1 = equalsOrV1; + if (v1 === void 0 || v1 === null || v2 === void 0 || v2 === null) { + return v2 === v1; + } + return equals3(v1, v2); + } else { + const equals4 = equalsOrV1; + return (v1, v22) => { + if (v1 === void 0 || v1 === null || v22 === void 0 || v22 === null) { + return v22 === v1; + } + return equals4(v1, v22); + }; + } +} +function structuralEquals(a, b) { + if (a === b) { + return true; + } + if (Array.isArray(a) && Array.isArray(b)) { + if (a.length !== b.length) { + return false; + } + for (let i2 = 0; i2 < a.length; i2++) { + if (!structuralEquals(a[i2], b[i2])) { + return false; + } + } + return true; + } + if (a && typeof a === "object" && b && typeof b === "object") { + if (Object.getPrototypeOf(a) === Object.prototype && Object.getPrototypeOf(b) === Object.prototype) { + const aObj = a; + const bObj = b; + const keysA = Object.keys(aObj); + const keysB = Object.keys(bObj); + const keysBSet = new Set(keysB); + if (keysA.length !== keysB.length) { + return false; + } + for (const key of keysA) { + if (!keysBSet.has(key)) { + return false; + } + if (!structuralEquals(aObj[key], bObj[key])) { + return false; + } + } + return true; + } + } + return false; +} +var strictEquals; +var init_equals = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/common/equals.js"() { + init_arrays(); + strictEquals = (a, b) => a === b; + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/common/observableInternal/commonFacade/deps.js +var init_deps = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/common/observableInternal/commonFacade/deps.js"() { + init_assert(); + init_equals(); + init_errors(); + init_event(); + init_lifecycle(); + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/common/observableInternal/base.js +function handleBugIndicatingErrorRecovery(message) { + const err = new Error("BugIndicatingErrorRecovery: " + message); + onUnexpectedError(err); + console.error("recovered from an error that indicates a bug", err); +} +var init_base = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/common/observableInternal/base.js"() { + init_deps(); + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/common/observableInternal/logging/logging.js +function addLogger(logger) { + if (!globalObservableLogger) { + globalObservableLogger = logger; + } else if (globalObservableLogger instanceof ComposedLogger) { + globalObservableLogger.loggers.push(logger); + } else { + globalObservableLogger = new ComposedLogger([globalObservableLogger, logger]); + } +} +function getLogger() { + return globalObservableLogger; +} +function setLogObservableFn(fn) { + globalObservableLoggerFn = fn; +} +var globalObservableLogger, globalObservableLoggerFn, ComposedLogger; +var init_logging = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/common/observableInternal/logging/logging.js"() { + globalObservableLoggerFn = void 0; + ComposedLogger = class { + constructor(loggers) { + this.loggers = loggers; + } + handleObservableCreated(observable, location2) { + for (const logger of this.loggers) { + logger.handleObservableCreated(observable, location2); + } + } + handleOnListenerCountChanged(observable, newCount) { + for (const logger of this.loggers) { + logger.handleOnListenerCountChanged(observable, newCount); + } + } + handleObservableUpdated(observable, info) { + for (const logger of this.loggers) { + logger.handleObservableUpdated(observable, info); + } + } + handleAutorunCreated(autorun2, location2) { + for (const logger of this.loggers) { + logger.handleAutorunCreated(autorun2, location2); + } + } + handleAutorunDisposed(autorun2) { + for (const logger of this.loggers) { + logger.handleAutorunDisposed(autorun2); + } + } + handleAutorunDependencyChanged(autorun2, observable, change) { + for (const logger of this.loggers) { + logger.handleAutorunDependencyChanged(autorun2, observable, change); + } + } + handleAutorunStarted(autorun2) { + for (const logger of this.loggers) { + logger.handleAutorunStarted(autorun2); + } + } + handleAutorunFinished(autorun2) { + for (const logger of this.loggers) { + logger.handleAutorunFinished(autorun2); + } + } + handleDerivedDependencyChanged(derived2, observable, change) { + for (const logger of this.loggers) { + logger.handleDerivedDependencyChanged(derived2, observable, change); + } + } + handleDerivedCleared(observable) { + for (const logger of this.loggers) { + logger.handleDerivedCleared(observable); + } + } + handleBeginTransaction(transaction2) { + for (const logger of this.loggers) { + logger.handleBeginTransaction(transaction2); + } + } + handleEndTransaction(transaction2) { + for (const logger of this.loggers) { + logger.handleEndTransaction(transaction2); + } + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/common/observableInternal/transaction.js +function transaction(fn, getDebugName2) { + const tx = new TransactionImpl(fn, getDebugName2); + try { + fn(tx); + } finally { + tx.finish(); + } +} +function globalTransaction(fn) { + if (_globalTransaction) { + fn(_globalTransaction); + } else { + const tx = new TransactionImpl(fn, void 0); + _globalTransaction = tx; + try { + fn(tx); + } finally { + tx.finish(); + _globalTransaction = void 0; + } + } +} +async function asyncTransaction(fn, getDebugName2) { + const tx = new TransactionImpl(fn, getDebugName2); + try { + await fn(tx); + } finally { + tx.finish(); + } +} +function subtransaction(tx, fn, getDebugName2) { + if (!tx) { + transaction(fn, getDebugName2); + } else { + fn(tx); + } +} +var _globalTransaction, TransactionImpl; +var init_transaction = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/common/observableInternal/transaction.js"() { + init_base(); + init_debugName(); + init_logging(); + _globalTransaction = void 0; + TransactionImpl = class { + constructor(_fn, _getDebugName) { + this._fn = _fn; + this._getDebugName = _getDebugName; + this._updatingObservers = []; + getLogger()?.handleBeginTransaction(this); + } + getDebugName() { + if (this._getDebugName) { + return this._getDebugName(); + } + return getFunctionName(this._fn); + } + updateObserver(observer, observable) { + if (!this._updatingObservers) { + handleBugIndicatingErrorRecovery("Transaction already finished!"); + transaction((tx) => { + tx.updateObserver(observer, observable); + }); + return; + } + this._updatingObservers.push({ observer, observable }); + observer.beginUpdate(observable); + } + finish() { + const updatingObservers = this._updatingObservers; + if (!updatingObservers) { + handleBugIndicatingErrorRecovery("transaction.finish() has already been called!"); + return; + } + for (let i2 = 0; i2 < updatingObservers.length; i2++) { + const { observer, observable } = updatingObservers[i2]; + observer.endUpdate(observable); + } + this._updatingObservers = null; + getLogger()?.handleEndTransaction(this); + } + debugGetUpdatingObservers() { + return this._updatingObservers; + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/common/observableInternal/debugLocation.js +function parseLine(stackLine) { + const match2 = stackLine.match(/\((.*):(\d+):(\d+)\)/); + if (match2) { + return { + fileName: match2[1], + line: parseInt(match2[2]), + column: parseInt(match2[3]), + id: stackLine + }; + } + const match22 = stackLine.match(/at ([^\(\)]*):(\d+):(\d+)/); + if (match22) { + return { + fileName: match22[1], + line: parseInt(match22[2]), + column: parseInt(match22[3]), + id: stackLine + }; + } + return void 0; +} +var DebugLocation, DebugLocationImpl; +var init_debugLocation = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/common/observableInternal/debugLocation.js"() { + (function(DebugLocation2) { + let enabled = false; + function enable() { + enabled = true; + } + DebugLocation2.enable = enable; + function ofCaller() { + if (!enabled) { + return void 0; + } + const Err = Error; + const l = Err.stackTraceLimit; + Err.stackTraceLimit = 3; + const stack = new Error().stack; + Err.stackTraceLimit = l; + return DebugLocationImpl.fromStack(stack, 2); + } + DebugLocation2.ofCaller = ofCaller; + })(DebugLocation || (DebugLocation = {})); + DebugLocationImpl = class _DebugLocationImpl { + static fromStack(stack, parentIdx) { + const lines = stack.split("\n"); + const location2 = parseLine(lines[parentIdx + 1]); + if (location2) { + return new _DebugLocationImpl(location2.fileName, location2.line, location2.column, location2.id); + } else { + return void 0; + } + } + constructor(fileName, line, column, id) { + this.fileName = fileName; + this.line = line; + this.column = column; + this.id = id; + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/common/observableInternal/observables/baseObservable.js +function _setDerivedOpts(derived2) { + _derived = derived2; +} +function _setRecomputeInitiallyAndOnChange(recomputeInitiallyAndOnChange2) { + _recomputeInitiallyAndOnChange = recomputeInitiallyAndOnChange2; +} +function _setKeepObserved(keepObserved2) { + _keepObserved = keepObserved2; +} +function _setDebugGetDependencyGraph(debugGetDependencyGraph2) { + _debugGetDependencyGraph = debugGetDependencyGraph2; +} +var _derived, _recomputeInitiallyAndOnChange, _keepObserved, _debugGetDependencyGraph, ConvenientObservable, BaseObservable; +var init_baseObservable = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/common/observableInternal/observables/baseObservable.js"() { + init_debugLocation(); + init_debugName(); + init_logging(); + ConvenientObservable = class { + get TChange() { + return null; + } + reportChanges() { + this.get(); + } + /** @sealed */ + read(reader) { + if (reader) { + return reader.readObservable(this); + } else { + return this.get(); + } + } + map(fnOrOwner, fnOrUndefined, debugLocation = DebugLocation.ofCaller()) { + const owner = fnOrUndefined === void 0 ? void 0 : fnOrOwner; + const fn = fnOrUndefined === void 0 ? fnOrOwner : fnOrUndefined; + return _derived({ + owner, + debugName: () => { + const name = getFunctionName(fn); + if (name !== void 0) { + return name; + } + const regexp = /^\s*\(?\s*([a-zA-Z_$][a-zA-Z_$0-9]*)\s*\)?\s*=>\s*\1(?:\??)\.([a-zA-Z_$][a-zA-Z_$0-9]*)\s*$/; + const match2 = regexp.exec(fn.toString()); + if (match2) { + return `${this.debugName}.${match2[2]}`; + } + if (!owner) { + return `${this.debugName} (mapped)`; + } + return void 0; + }, + debugReferenceFn: fn + }, (reader) => fn(this.read(reader), reader), debugLocation); + } + /** + * @sealed + * Converts an observable of an observable value into a direct observable of the value. + */ + flatten() { + return _derived({ + owner: void 0, + debugName: () => `${this.debugName} (flattened)` + }, (reader) => this.read(reader).read(reader)); + } + recomputeInitiallyAndOnChange(store, handleValue) { + store.add(_recomputeInitiallyAndOnChange(this, handleValue)); + return this; + } + }; + BaseObservable = class extends ConvenientObservable { + constructor(debugLocation) { + super(); + this._observers = /* @__PURE__ */ new Set(); + getLogger()?.handleObservableCreated(this, debugLocation); + } + addObserver(observer) { + const len = this._observers.size; + this._observers.add(observer); + if (len === 0) { + this.onFirstObserverAdded(); + } + if (len !== this._observers.size) { + getLogger()?.handleOnListenerCountChanged(this, this._observers.size); + } + } + removeObserver(observer) { + const deleted = this._observers.delete(observer); + if (deleted && this._observers.size === 0) { + this.onLastObserverRemoved(); + } + if (deleted) { + getLogger()?.handleOnListenerCountChanged(this, this._observers.size); + } + } + onFirstObserverAdded() { + } + onLastObserverRemoved() { + } + debugGetObservers() { + return this._observers; + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/common/observableInternal/observables/observableValue.js +function observableValue(nameOrOwner, initialValue, debugLocation = DebugLocation.ofCaller()) { + let debugNameData; + if (typeof nameOrOwner === "string") { + debugNameData = new DebugNameData(void 0, nameOrOwner, void 0); + } else { + debugNameData = new DebugNameData(nameOrOwner, void 0, void 0); + } + return new ObservableValue(debugNameData, initialValue, strictEquals, debugLocation); +} +function disposableObservableValue(nameOrOwner, initialValue, debugLocation = DebugLocation.ofCaller()) { + let debugNameData; + if (typeof nameOrOwner === "string") { + debugNameData = new DebugNameData(void 0, nameOrOwner, void 0); + } else { + debugNameData = new DebugNameData(nameOrOwner, void 0, void 0); + } + return new DisposableObservableValue(debugNameData, initialValue, strictEquals, debugLocation); +} +var ObservableValue, DisposableObservableValue; +var init_observableValue = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/common/observableInternal/observables/observableValue.js"() { + init_transaction(); + init_baseObservable(); + init_deps(); + init_debugName(); + init_logging(); + init_debugLocation(); + ObservableValue = class extends BaseObservable { + get debugName() { + return this._debugNameData.getDebugName(this) ?? "ObservableValue"; + } + constructor(_debugNameData, initialValue, _equalityComparator, debugLocation) { + super(debugLocation); + this._debugNameData = _debugNameData; + this._equalityComparator = _equalityComparator; + this._value = initialValue; + getLogger()?.handleObservableUpdated(this, { hadValue: false, newValue: initialValue, change: void 0, didChange: true, oldValue: void 0 }); + } + get() { + return this._value; + } + set(value, tx, change) { + if (change === void 0 && this._equalityComparator(this._value, value)) { + return; + } + let _tx; + if (!tx) { + tx = _tx = new TransactionImpl(() => { + }, () => `Setting ${this.debugName}`); + } + try { + const oldValue = this._value; + this._setValue(value); + getLogger()?.handleObservableUpdated(this, { oldValue, newValue: value, change, didChange: true, hadValue: true }); + for (const observer of this._observers) { + tx.updateObserver(observer, this); + observer.handleChange(this, change); + } + } finally { + if (_tx) { + _tx.finish(); + } + } + } + toString() { + return `${this.debugName}: ${this._value}`; + } + _setValue(newValue) { + this._value = newValue; + } + debugGetState() { + return { + value: this._value + }; + } + debugSetValue(value) { + this._value = value; + } + }; + DisposableObservableValue = class extends ObservableValue { + _setValue(newValue) { + if (this._value === newValue) { + return; + } + if (this._value) { + this._value.dispose(); + } + this._value = newValue; + } + dispose() { + this._value?.dispose(); + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/common/observableInternal/observables/lazyObservableValue.js +var LazyObservableValue; +var init_lazyObservableValue = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/common/observableInternal/observables/lazyObservableValue.js"() { + init_transaction(); + init_logging(); + init_baseObservable(); + LazyObservableValue = class extends BaseObservable { + get debugName() { + return this._debugNameData.getDebugName(this) ?? "LazyObservableValue"; + } + constructor(_debugNameData, initialValue, _equalityComparator, debugLocation) { + super(debugLocation); + this._debugNameData = _debugNameData; + this._equalityComparator = _equalityComparator; + this._isUpToDate = true; + this._deltas = []; + this._updateCounter = 0; + this._value = initialValue; + } + get() { + this._update(); + return this._value; + } + _update() { + if (this._isUpToDate) { + return; + } + this._isUpToDate = true; + if (this._deltas.length > 0) { + for (const change of this._deltas) { + getLogger()?.handleObservableUpdated(this, { change, didChange: true, oldValue: "(unknown)", newValue: this._value, hadValue: true }); + for (const observer of this._observers) { + observer.handleChange(this, change); + } + } + this._deltas.length = 0; + } else { + getLogger()?.handleObservableUpdated(this, { change: void 0, didChange: true, oldValue: "(unknown)", newValue: this._value, hadValue: true }); + for (const observer of this._observers) { + observer.handleChange(this, void 0); + } + } + } + _beginUpdate() { + this._updateCounter++; + if (this._updateCounter === 1) { + for (const observer of this._observers) { + observer.beginUpdate(this); + } + } + } + _endUpdate() { + this._updateCounter--; + if (this._updateCounter === 0) { + this._update(); + const observers = [...this._observers]; + for (const r of observers) { + r.endUpdate(this); + } + } + } + addObserver(observer) { + const shouldCallBeginUpdate = !this._observers.has(observer) && this._updateCounter > 0; + super.addObserver(observer); + if (shouldCallBeginUpdate) { + observer.beginUpdate(this); + } + } + removeObserver(observer) { + const shouldCallEndUpdate = this._observers.has(observer) && this._updateCounter > 0; + super.removeObserver(observer); + if (shouldCallEndUpdate) { + observer.endUpdate(this); + } + } + set(value, tx, change) { + if (change === void 0 && this._equalityComparator(this._value, value)) { + return; + } + let _tx; + if (!tx) { + tx = _tx = new TransactionImpl(() => { + }, () => `Setting ${this.debugName}`); + } + try { + this._isUpToDate = false; + this._setValue(value); + if (change !== void 0) { + this._deltas.push(change); + } + tx.updateObserver({ + beginUpdate: () => this._beginUpdate(), + endUpdate: () => this._endUpdate(), + handleChange: (observable, change2) => { + }, + handlePossibleChange: (observable) => { + } + }, this); + if (this._updateCounter > 1) { + for (const observer of this._observers) { + observer.handlePossibleChange(this); + } + } + } finally { + if (_tx) { + _tx.finish(); + } + } + } + toString() { + return `${this.debugName}: ${this._value}`; + } + _setValue(newValue) { + this._value = newValue; + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/common/observableInternal/observables/observableValueOpts.js +function observableValueOpts(options2, initialValue, debugLocation = DebugLocation.ofCaller()) { + if (options2.lazy) { + return new LazyObservableValue(new DebugNameData(options2.owner, options2.debugName, void 0), initialValue, options2.equalsFn ?? strictEquals, debugLocation); + } + return new ObservableValue(new DebugNameData(options2.owner, options2.debugName, void 0), initialValue, options2.equalsFn ?? strictEquals, debugLocation); +} +var init_observableValueOpts = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/common/observableInternal/observables/observableValueOpts.js"() { + init_debugName(); + init_deps(); + init_observableValue(); + init_lazyObservableValue(); + init_debugLocation(); + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/common/observableInternal/reactions/autorunImpl.js +function autorunStateToString(state) { + switch (state) { + case 1: + return "dependenciesMightHaveChanged"; + case 2: + return "stale"; + case 3: + return "upToDate"; + default: + return ""; + } +} +var AutorunObserver; +var init_autorunImpl = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/common/observableInternal/reactions/autorunImpl.js"() { + init_deps(); + init_logging(); + AutorunObserver = class { + get debugName() { + return this._debugNameData.getDebugName(this) ?? "(anonymous)"; + } + constructor(_debugNameData, _runFn, _changeTracker, debugLocation) { + this._debugNameData = _debugNameData; + this._runFn = _runFn; + this._changeTracker = _changeTracker; + this._state = 2; + this._updateCount = 0; + this._disposed = false; + this._dependencies = /* @__PURE__ */ new Set(); + this._dependenciesToBeRemoved = /* @__PURE__ */ new Set(); + this._isRunning = false; + this._store = void 0; + this._delayedStore = void 0; + this._changeSummary = this._changeTracker?.createChangeSummary(void 0); + getLogger()?.handleAutorunCreated(this, debugLocation); + this._run(); + trackDisposable(this); + } + dispose() { + if (this._disposed) { + return; + } + this._disposed = true; + for (const o of this._dependencies) { + o.removeObserver(this); + } + this._dependencies.clear(); + if (this._store !== void 0) { + this._store.dispose(); + } + if (this._delayedStore !== void 0) { + this._delayedStore.dispose(); + } + getLogger()?.handleAutorunDisposed(this); + markAsDisposed(this); + } + _run() { + const emptySet = this._dependenciesToBeRemoved; + this._dependenciesToBeRemoved = this._dependencies; + this._dependencies = emptySet; + this._state = 3; + try { + if (!this._disposed) { + getLogger()?.handleAutorunStarted(this); + const changeSummary = this._changeSummary; + const delayedStore = this._delayedStore; + if (delayedStore !== void 0) { + this._delayedStore = void 0; + } + try { + this._isRunning = true; + if (this._changeTracker) { + this._changeTracker.beforeUpdate?.(this, changeSummary); + this._changeSummary = this._changeTracker.createChangeSummary(changeSummary); + } + if (this._store !== void 0) { + this._store.dispose(); + this._store = void 0; + } + this._runFn(this, changeSummary); + } catch (e) { + onBugIndicatingError(e); + } finally { + this._isRunning = false; + if (delayedStore !== void 0) { + delayedStore.dispose(); + } + } + } + } finally { + if (!this._disposed) { + getLogger()?.handleAutorunFinished(this); + } + for (const o of this._dependenciesToBeRemoved) { + o.removeObserver(this); + } + this._dependenciesToBeRemoved.clear(); + } + } + toString() { + return `Autorun<${this.debugName}>`; + } + // IObserver implementation + beginUpdate(_observable) { + if (this._state === 3) { + this._state = 1; + } + this._updateCount++; + } + endUpdate(_observable) { + try { + if (this._updateCount === 1) { + do { + if (this._state === 1) { + this._state = 3; + for (const d of this._dependencies) { + d.reportChanges(); + if (this._state === 2) { + break; + } + } + } + if (this._state !== 3) { + this._run(); + } + } while (this._state !== 3); + } + } finally { + this._updateCount--; + } + assertFn(() => this._updateCount >= 0); + } + handlePossibleChange(observable) { + if (this._state === 3 && this._isDependency(observable)) { + this._state = 1; + } + } + handleChange(observable, change) { + if (this._isDependency(observable)) { + getLogger()?.handleAutorunDependencyChanged(this, observable, change); + try { + const shouldReact = this._changeTracker ? this._changeTracker.handleChange({ + changedObservable: observable, + change, + // eslint-disable-next-line local/code-no-any-casts + didChange: (o) => o === observable + }, this._changeSummary) : true; + if (shouldReact) { + this._state = 2; + } + } catch (e) { + onBugIndicatingError(e); + } + } + } + _isDependency(observable) { + return this._dependencies.has(observable) && !this._dependenciesToBeRemoved.has(observable); + } + // IReader implementation + _ensureNoRunning() { + if (!this._isRunning) { + throw new BugIndicatingError("The reader object cannot be used outside its compute function!"); + } + } + readObservable(observable) { + this._ensureNoRunning(); + if (this._disposed) { + return observable.get(); + } + observable.addObserver(this); + const value = observable.get(); + this._dependencies.add(observable); + this._dependenciesToBeRemoved.delete(observable); + return value; + } + get store() { + this._ensureNoRunning(); + if (this._disposed) { + throw new BugIndicatingError("Cannot access store after dispose"); + } + if (this._store === void 0) { + this._store = new DisposableStore(); + } + return this._store; + } + debugGetState() { + return { + isRunning: this._isRunning, + updateCount: this._updateCount, + dependencies: this._dependencies, + state: this._state, + stateStr: autorunStateToString(this._state) + }; + } + debugRerun() { + if (!this._isRunning) { + this._run(); + } else { + this._state = 2; + } + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/common/observableInternal/reactions/autorun.js +function autorun(fn, debugLocation = DebugLocation.ofCaller()) { + return new AutorunObserver(new DebugNameData(void 0, void 0, fn), fn, void 0, debugLocation); +} +function autorunOpts(options2, fn, debugLocation = DebugLocation.ofCaller()) { + return new AutorunObserver(new DebugNameData(options2.owner, options2.debugName, options2.debugReferenceFn ?? fn), fn, void 0, debugLocation); +} +function autorunHandleChanges(options2, fn, debugLocation = DebugLocation.ofCaller()) { + return new AutorunObserver(new DebugNameData(options2.owner, options2.debugName, options2.debugReferenceFn ?? fn), fn, options2.changeTracker, debugLocation); +} +function autorunWithStoreHandleChanges(options2, fn) { + const store = new DisposableStore(); + const disposable = autorunHandleChanges({ + owner: options2.owner, + debugName: options2.debugName, + debugReferenceFn: options2.debugReferenceFn ?? fn, + changeTracker: options2.changeTracker + }, (reader, changeSummary) => { + store.clear(); + fn(reader, changeSummary, store); + }); + return toDisposable(() => { + disposable.dispose(); + store.dispose(); + }); +} +function autorunWithStore(fn) { + const store = new DisposableStore(); + const disposable = autorunOpts({ + owner: void 0, + debugName: void 0, + debugReferenceFn: fn + }, (reader) => { + store.clear(); + fn(reader, store); + }); + return toDisposable(() => { + disposable.dispose(); + store.dispose(); + }); +} +function autorunDelta(observable, handler) { + let _lastValue; + return autorunOpts({ debugReferenceFn: handler }, (reader) => { + const newValue = observable.read(reader); + const lastValue = _lastValue; + _lastValue = newValue; + handler({ lastValue, newValue }); + }); +} +var init_autorun = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/common/observableInternal/reactions/autorun.js"() { + init_deps(); + init_debugName(); + init_autorunImpl(); + init_debugLocation(); + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/common/observableInternal/observables/derivedImpl.js +function derivedStateToString(state) { + switch (state) { + case 0: + return "initial"; + case 1: + return "dependenciesMightHaveChanged"; + case 2: + return "stale"; + case 3: + return "upToDate"; + default: + return ""; + } +} +var Derived, DerivedWithSetter; +var init_derivedImpl = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/common/observableInternal/observables/derivedImpl.js"() { + init_baseObservable(); + init_deps(); + init_logging(); + Derived = class extends BaseObservable { + get debugName() { + return this._debugNameData.getDebugName(this) ?? "(anonymous)"; + } + constructor(_debugNameData, _computeFn, _changeTracker, _handleLastObserverRemoved = void 0, _equalityComparator, debugLocation) { + super(debugLocation); + this._debugNameData = _debugNameData; + this._computeFn = _computeFn; + this._changeTracker = _changeTracker; + this._handleLastObserverRemoved = _handleLastObserverRemoved; + this._equalityComparator = _equalityComparator; + this._state = 0; + this._value = void 0; + this._updateCount = 0; + this._dependencies = /* @__PURE__ */ new Set(); + this._dependenciesToBeRemoved = /* @__PURE__ */ new Set(); + this._changeSummary = void 0; + this._isUpdating = false; + this._isComputing = false; + this._didReportChange = false; + this._isInBeforeUpdate = false; + this._isReaderValid = false; + this._store = void 0; + this._delayedStore = void 0; + this._removedObserverToCallEndUpdateOn = null; + this._changeSummary = this._changeTracker?.createChangeSummary(void 0); + } + onLastObserverRemoved() { + this._state = 0; + this._value = void 0; + getLogger()?.handleDerivedCleared(this); + for (const d of this._dependencies) { + d.removeObserver(this); + } + this._dependencies.clear(); + if (this._store !== void 0) { + this._store.dispose(); + this._store = void 0; + } + if (this._delayedStore !== void 0) { + this._delayedStore.dispose(); + this._delayedStore = void 0; + } + this._handleLastObserverRemoved?.(); + } + get() { + const checkEnabled = false; + if (this._isComputing && checkEnabled) { + throw new BugIndicatingError("Cyclic deriveds are not supported yet!"); + } + if (this._observers.size === 0) { + let result; + try { + this._isReaderValid = true; + let changeSummary = void 0; + if (this._changeTracker) { + changeSummary = this._changeTracker.createChangeSummary(void 0); + this._changeTracker.beforeUpdate?.(this, changeSummary); + } + result = this._computeFn(this, changeSummary); + } finally { + this._isReaderValid = false; + } + this.onLastObserverRemoved(); + return result; + } else { + do { + if (this._state === 1) { + for (const d of this._dependencies) { + d.reportChanges(); + if (this._state === 2) { + break; + } + } + } + if (this._state === 1) { + this._state = 3; + } + if (this._state !== 3) { + this._recompute(); + } + } while (this._state !== 3); + return this._value; + } + } + _recompute() { + let didChange = false; + this._isComputing = true; + this._didReportChange = false; + const emptySet = this._dependenciesToBeRemoved; + this._dependenciesToBeRemoved = this._dependencies; + this._dependencies = emptySet; + try { + const changeSummary = this._changeSummary; + this._isReaderValid = true; + if (this._changeTracker) { + this._isInBeforeUpdate = true; + this._changeTracker.beforeUpdate?.(this, changeSummary); + this._isInBeforeUpdate = false; + this._changeSummary = this._changeTracker?.createChangeSummary(changeSummary); + } + const hadValue = this._state !== 0; + const oldValue = this._value; + this._state = 3; + const delayedStore = this._delayedStore; + if (delayedStore !== void 0) { + this._delayedStore = void 0; + } + try { + if (this._store !== void 0) { + this._store.dispose(); + this._store = void 0; + } + this._value = this._computeFn(this, changeSummary); + } finally { + this._isReaderValid = false; + for (const o of this._dependenciesToBeRemoved) { + o.removeObserver(this); + } + this._dependenciesToBeRemoved.clear(); + if (delayedStore !== void 0) { + delayedStore.dispose(); + } + } + didChange = this._didReportChange || hadValue && !this._equalityComparator(oldValue, this._value); + getLogger()?.handleObservableUpdated(this, { + oldValue, + newValue: this._value, + change: void 0, + didChange, + hadValue + }); + } catch (e) { + onBugIndicatingError(e); + } + this._isComputing = false; + if (!this._didReportChange && didChange) { + for (const r of this._observers) { + r.handleChange(this, void 0); + } + } else { + this._didReportChange = false; + } + } + toString() { + return `LazyDerived<${this.debugName}>`; + } + // IObserver Implementation + beginUpdate(_observable) { + if (this._isUpdating) { + throw new BugIndicatingError("Cyclic deriveds are not supported yet!"); + } + this._updateCount++; + this._isUpdating = true; + try { + const propagateBeginUpdate = this._updateCount === 1; + if (this._state === 3) { + this._state = 1; + if (!propagateBeginUpdate) { + for (const r of this._observers) { + r.handlePossibleChange(this); + } + } + } + if (propagateBeginUpdate) { + for (const r of this._observers) { + r.beginUpdate(this); + } + } + } finally { + this._isUpdating = false; + } + } + endUpdate(_observable) { + this._updateCount--; + if (this._updateCount === 0) { + const observers = [...this._observers]; + for (const r of observers) { + r.endUpdate(this); + } + if (this._removedObserverToCallEndUpdateOn) { + const observers2 = [...this._removedObserverToCallEndUpdateOn]; + this._removedObserverToCallEndUpdateOn = null; + for (const r of observers2) { + r.endUpdate(this); + } + } + } + assertFn(() => this._updateCount >= 0); + } + handlePossibleChange(observable) { + if (this._state === 3 && this._dependencies.has(observable) && !this._dependenciesToBeRemoved.has(observable)) { + this._state = 1; + for (const r of this._observers) { + r.handlePossibleChange(this); + } + } + } + handleChange(observable, change) { + if (this._dependencies.has(observable) && !this._dependenciesToBeRemoved.has(observable) || this._isInBeforeUpdate) { + getLogger()?.handleDerivedDependencyChanged(this, observable, change); + let shouldReact = false; + try { + shouldReact = this._changeTracker ? this._changeTracker.handleChange({ + changedObservable: observable, + change, + // eslint-disable-next-line local/code-no-any-casts + didChange: (o) => o === observable + }, this._changeSummary) : true; + } catch (e) { + onBugIndicatingError(e); + } + const wasUpToDate = this._state === 3; + if (shouldReact && (this._state === 1 || wasUpToDate)) { + this._state = 2; + if (wasUpToDate) { + for (const r of this._observers) { + r.handlePossibleChange(this); + } + } + } + } + } + // IReader Implementation + _ensureReaderValid() { + if (!this._isReaderValid) { + throw new BugIndicatingError("The reader object cannot be used outside its compute function!"); + } + } + readObservable(observable) { + this._ensureReaderValid(); + observable.addObserver(this); + const value = observable.get(); + this._dependencies.add(observable); + this._dependenciesToBeRemoved.delete(observable); + return value; + } + get store() { + this._ensureReaderValid(); + if (this._store === void 0) { + this._store = new DisposableStore(); + } + return this._store; + } + addObserver(observer) { + const shouldCallBeginUpdate = !this._observers.has(observer) && this._updateCount > 0; + super.addObserver(observer); + if (shouldCallBeginUpdate) { + if (this._removedObserverToCallEndUpdateOn && this._removedObserverToCallEndUpdateOn.has(observer)) { + this._removedObserverToCallEndUpdateOn.delete(observer); + } else { + observer.beginUpdate(this); + } + } + } + removeObserver(observer) { + if (this._observers.has(observer) && this._updateCount > 0) { + if (!this._removedObserverToCallEndUpdateOn) { + this._removedObserverToCallEndUpdateOn = /* @__PURE__ */ new Set(); + } + this._removedObserverToCallEndUpdateOn.add(observer); + } + super.removeObserver(observer); + } + debugGetState() { + return { + state: this._state, + stateStr: derivedStateToString(this._state), + updateCount: this._updateCount, + isComputing: this._isComputing, + dependencies: this._dependencies, + value: this._value + }; + } + debugSetValue(newValue) { + this._value = newValue; + } + debugRecompute() { + if (!this._isComputing) { + this._recompute(); + } else { + this._state = 2; + } + } + setValue(newValue, tx, change) { + this._value = newValue; + const observers = this._observers; + tx.updateObserver(this, this); + for (const d of observers) { + d.handleChange(this, change); + } + } + }; + DerivedWithSetter = class extends Derived { + constructor(debugNameData, computeFn, changeTracker, handleLastObserverRemoved = void 0, equalityComparator, set, debugLocation) { + super(debugNameData, computeFn, changeTracker, handleLastObserverRemoved, equalityComparator, debugLocation); + this.set = set; + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/common/observableInternal/observables/derived.js +function derived(computeFnOrOwner, computeFn, debugLocation = DebugLocation.ofCaller()) { + if (computeFn !== void 0) { + return new Derived(new DebugNameData(computeFnOrOwner, void 0, computeFn), computeFn, void 0, void 0, strictEquals, debugLocation); + } + return new Derived( + // eslint-disable-next-line local/code-no-any-casts + new DebugNameData(void 0, void 0, computeFnOrOwner), + // eslint-disable-next-line local/code-no-any-casts + computeFnOrOwner, + void 0, + void 0, + strictEquals, + debugLocation + ); +} +function derivedWithSetter(owner, computeFn, setter, debugLocation = DebugLocation.ofCaller()) { + return new DerivedWithSetter(new DebugNameData(owner, void 0, computeFn), computeFn, void 0, void 0, strictEquals, setter, debugLocation); +} +function derivedOpts(options2, computeFn, debugLocation = DebugLocation.ofCaller()) { + return new Derived(new DebugNameData(options2.owner, options2.debugName, options2.debugReferenceFn), computeFn, void 0, options2.onLastObserverRemoved, options2.equalsFn ?? strictEquals, debugLocation); +} +function derivedHandleChanges(options2, computeFn, debugLocation = DebugLocation.ofCaller()) { + return new Derived(new DebugNameData(options2.owner, options2.debugName, void 0), computeFn, options2.changeTracker, void 0, options2.equalityComparer ?? strictEquals, debugLocation); +} +function derivedDisposable(computeFnOrOwner, computeFnOrUndefined, debugLocation = DebugLocation.ofCaller()) { + let computeFn; + let owner; + if (computeFnOrUndefined === void 0) { + computeFn = computeFnOrOwner; + owner = void 0; + } else { + owner = computeFnOrOwner; + computeFn = computeFnOrUndefined; + } + let store = void 0; + return new Derived(new DebugNameData(owner, void 0, computeFn), (r) => { + if (!store) { + store = new DisposableStore(); + } else { + store.clear(); + } + const result = computeFn(r); + if (result) { + store.add(result); + } + return result; + }, void 0, () => { + if (store) { + store.dispose(); + store = void 0; + } + }, strictEquals, debugLocation); +} +var init_derived = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/common/observableInternal/observables/derived.js"() { + init_deps(); + init_debugLocation(); + init_debugName(); + init_baseObservable(); + init_derivedImpl(); + _setDerivedOpts(derivedOpts); + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/common/observableInternal/utils/promise.js +var ObservablePromise, PromiseResult; +var init_promise = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/common/observableInternal/utils/promise.js"() { + init_transaction(); + init_observableValue(); + ObservablePromise = class { + constructor(promise) { + this._value = observableValue(this, void 0); + this.promiseResult = this._value; + this.promise = promise.then((value) => { + transaction((tx) => { + this._value.set(new PromiseResult(value, void 0), tx); + }); + return value; + }, (error) => { + transaction((tx) => { + this._value.set(new PromiseResult(void 0, error), tx); + }); + throw error; + }); + } + }; + PromiseResult = class { + constructor(data, error) { + this.data = data; + this.error = error; + } + /** + * Returns the value if the promise resolved, otherwise throws the error. + */ + getDataOrThrow() { + if (this.error) { + throw this.error; + } + return this.data; + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/common/observableInternal/commonFacade/cancellation.js +var init_cancellation2 = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/common/observableInternal/commonFacade/cancellation.js"() { + init_errors(); + init_cancellation(); + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/common/observableInternal/utils/utilsCancellation.js +function waitForState(observable, predicate, isError, cancellationToken) { + if (!predicate) { + predicate = (state) => state !== null && state !== void 0; + } + return new Promise((resolve3, reject) => { + let isImmediateRun = true; + let shouldDispose = false; + const stateObs = observable.map((state) => { + return { + isFinished: predicate(state), + error: isError ? isError(state) : false, + state + }; + }); + const d = autorun((reader) => { + const { isFinished, error, state } = stateObs.read(reader); + if (isFinished || error) { + if (isImmediateRun) { + shouldDispose = true; + } else { + d.dispose(); + } + if (error) { + reject(error === true ? state : error); + } else { + resolve3(state); + } + } + }); + if (cancellationToken) { + const dc = cancellationToken.onCancellationRequested(() => { + d.dispose(); + dc.dispose(); + reject(new CancellationError()); + }); + if (cancellationToken.isCancellationRequested) { + d.dispose(); + dc.dispose(); + reject(new CancellationError()); + return; + } + } + isImmediateRun = false; + if (shouldDispose) { + d.dispose(); + } + }); +} +var init_utilsCancellation = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/common/observableInternal/utils/utilsCancellation.js"() { + init_cancellation2(); + init_autorun(); + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/common/observableInternal/observables/observableFromEvent.js +function observableFromEvent(...args) { + let owner; + let event; + let getValue; + let debugLocation; + if (args.length === 2) { + [event, getValue] = args; + } else { + [owner, event, getValue, debugLocation] = args; + } + return new FromEventObservable(new DebugNameData(owner, void 0, getValue), event, getValue, () => FromEventObservable.globalTransaction, strictEquals, debugLocation ?? DebugLocation.ofCaller()); +} +function observableFromEventOpts(options2, event, getValue, debugLocation = DebugLocation.ofCaller()) { + return new FromEventObservable(new DebugNameData(options2.owner, options2.debugName, options2.debugReferenceFn ?? getValue), event, getValue, () => FromEventObservable.globalTransaction, options2.equalsFn ?? strictEquals, debugLocation); +} +var FromEventObservable; +var init_observableFromEvent = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/common/observableInternal/observables/observableFromEvent.js"() { + init_transaction(); + init_deps(); + init_debugName(); + init_logging(); + init_baseObservable(); + init_debugLocation(); + FromEventObservable = class extends BaseObservable { + constructor(_debugNameData, event, _getValue, _getTransaction, _equalityComparator, debugLocation) { + super(debugLocation); + this._debugNameData = _debugNameData; + this.event = event; + this._getValue = _getValue; + this._getTransaction = _getTransaction; + this._equalityComparator = _equalityComparator; + this._hasValue = false; + this.handleEvent = (args) => { + const newValue = this._getValue(args); + const oldValue = this._value; + const didChange = !this._hasValue || !this._equalityComparator(oldValue, newValue); + let didRunTransaction = false; + if (didChange) { + this._value = newValue; + if (this._hasValue) { + didRunTransaction = true; + subtransaction(this._getTransaction(), (tx) => { + getLogger()?.handleObservableUpdated(this, { oldValue, newValue, change: void 0, didChange, hadValue: this._hasValue }); + for (const o of this._observers) { + tx.updateObserver(o, this); + o.handleChange(this, void 0); + } + }, () => { + const name = this.getDebugName(); + return "Event fired" + (name ? `: ${name}` : ""); + }); + } + this._hasValue = true; + } + if (!didRunTransaction) { + getLogger()?.handleObservableUpdated(this, { oldValue, newValue, change: void 0, didChange, hadValue: this._hasValue }); + } + }; + } + getDebugName() { + return this._debugNameData.getDebugName(this); + } + get debugName() { + const name = this.getDebugName(); + return "From Event" + (name ? `: ${name}` : ""); + } + onFirstObserverAdded() { + this._subscription = this.event(this.handleEvent); + } + onLastObserverRemoved() { + this._subscription.dispose(); + this._subscription = void 0; + this._hasValue = false; + this._value = void 0; + } + get() { + if (this._subscription) { + if (!this._hasValue) { + this.handleEvent(void 0); + } + return this._value; + } else { + const value = this._getValue(void 0); + return value; + } + } + debugSetValue(value) { + this._value = value; + } + debugGetState() { + return { value: this._value, hasValue: this._hasValue }; + } + }; + (function(observableFromEvent2) { + observableFromEvent2.Observer = FromEventObservable; + function batchEventsGlobally(tx, fn) { + let didSet = false; + if (FromEventObservable.globalTransaction === void 0) { + FromEventObservable.globalTransaction = tx; + didSet = true; + } + try { + fn(); + } finally { + if (didSet) { + FromEventObservable.globalTransaction = void 0; + } + } + } + observableFromEvent2.batchEventsGlobally = batchEventsGlobally; + })(observableFromEvent || (observableFromEvent = {})); + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/common/observableInternal/observables/observableSignal.js +function observableSignal(debugNameOrOwner, debugLocation = DebugLocation.ofCaller()) { + if (typeof debugNameOrOwner === "string") { + return new ObservableSignal(debugNameOrOwner, void 0, debugLocation); + } else { + return new ObservableSignal(void 0, debugNameOrOwner, debugLocation); + } +} +var ObservableSignal; +var init_observableSignal = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/common/observableInternal/observables/observableSignal.js"() { + init_transaction(); + init_debugName(); + init_baseObservable(); + init_debugLocation(); + ObservableSignal = class extends BaseObservable { + get debugName() { + return new DebugNameData(this._owner, this._debugName, void 0).getDebugName(this) ?? "Observable Signal"; + } + toString() { + return this.debugName; + } + constructor(_debugName, _owner, debugLocation) { + super(debugLocation); + this._debugName = _debugName; + this._owner = _owner; + } + trigger(tx, change) { + if (!tx) { + transaction((tx2) => { + this.trigger(tx2, change); + }, () => `Trigger signal ${this.debugName}`); + return; + } + for (const o of this._observers) { + tx.updateObserver(o, this); + o.handleChange(this, change); + } + } + get() { + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/common/observableInternal/utils/utils.js +function debouncedObservable(observable, debounceMs) { + let hasValue = false; + let lastValue; + let timeout2 = void 0; + return observableFromEvent((cb) => { + const d = autorun((reader) => { + const value = observable.read(reader); + if (!hasValue) { + hasValue = true; + lastValue = value; + } else { + if (timeout2) { + clearTimeout(timeout2); + } + timeout2 = setTimeout(() => { + lastValue = value; + cb(); + }, debounceMs); + } + }); + return { + dispose() { + d.dispose(); + hasValue = false; + lastValue = void 0; + } + }; + }, () => { + if (hasValue) { + return lastValue; + } else { + return observable.get(); + } + }); +} +function keepObserved(observable) { + const o = new KeepAliveObserver(false, void 0); + observable.addObserver(o); + return toDisposable(() => { + observable.removeObserver(o); + }); +} +function recomputeInitiallyAndOnChange(observable, handleValue) { + const o = new KeepAliveObserver(true, handleValue); + observable.addObserver(o); + try { + o.beginUpdate(observable); + } finally { + o.endUpdate(observable); + } + return toDisposable(() => { + observable.removeObserver(o); + }); +} +function derivedObservableWithCache(owner, computeFn) { + let lastValue = void 0; + const observable = derivedOpts({ owner, debugReferenceFn: computeFn }, (reader) => { + lastValue = computeFn(reader, lastValue); + return lastValue; + }); + return observable; +} +function mapObservableArrayCached(owner, items, map, keySelector) { + let m = new ArrayMap(map, keySelector); + const self2 = derivedOpts({ + debugReferenceFn: map, + owner, + onLastObserverRemoved: () => { + m.dispose(); + m = new ArrayMap(map); + } + }, (reader) => { + m.setItems(items.read(reader)); + return m.getItems(); + }); + return self2; +} +var KeepAliveObserver, ArrayMap; +var init_utils = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/common/observableInternal/utils/utils.js"() { + init_autorun(); + init_deps(); + init_derived(); + init_observableFromEvent(); + init_observableSignal(); + init_baseObservable(); + _setKeepObserved(keepObserved); + _setRecomputeInitiallyAndOnChange(recomputeInitiallyAndOnChange); + KeepAliveObserver = class { + constructor(_forceRecompute, _handleValue) { + this._forceRecompute = _forceRecompute; + this._handleValue = _handleValue; + this._counter = 0; + } + beginUpdate(observable) { + this._counter++; + } + endUpdate(observable) { + if (this._counter === 1 && this._forceRecompute) { + if (this._handleValue) { + this._handleValue(observable.get()); + } else { + observable.reportChanges(); + } + } + this._counter--; + } + handlePossibleChange(observable) { + } + handleChange(observable, change) { + } + }; + ArrayMap = class { + constructor(_map, _keySelector) { + this._map = _map; + this._keySelector = _keySelector; + this._cache = /* @__PURE__ */ new Map(); + this._items = []; + } + dispose() { + this._cache.forEach((entry) => entry.store.dispose()); + this._cache.clear(); + } + setItems(items) { + const newItems = []; + const itemsToRemove = new Set(this._cache.keys()); + for (const item of items) { + const key = this._keySelector ? this._keySelector(item) : item; + let entry = this._cache.get(key); + if (!entry) { + const store = new DisposableStore(); + const out = this._map(item, store); + entry = { out, store }; + this._cache.set(key, entry); + } else { + itemsToRemove.delete(key); + } + newItems.push(entry.out); + } + for (const item of itemsToRemove) { + const entry = this._cache.get(item); + entry.store.dispose(); + this._cache.delete(item); + } + this._items = newItems; + } + getItems() { + return this._items; + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/common/observableInternal/changeTracker.js +function recordChanges(obs) { + return { + createChangeSummary: (_previousChangeSummary) => { + return { + changes: [] + }; + }, + handleChange(ctx, changeSummary) { + for (const key in obs) { + if (ctx.didChange(obs[key])) { + changeSummary.changes.push({ key, change: ctx.change }); + } + } + return true; + }, + beforeUpdate(reader, changeSummary) { + for (const key in obs) { + if (key === "changes") { + throw new BugIndicatingError('property name "changes" is reserved for change tracking'); + } + changeSummary[key] = obs[key].read(reader); + } + } + }; +} +function recordChangesLazy(getObs) { + let obs = void 0; + return { + createChangeSummary: (_previousChangeSummary) => { + return { + changes: [] + }; + }, + handleChange(ctx, changeSummary) { + if (!obs) { + obs = getObs(); + } + for (const key in obs) { + if (ctx.didChange(obs[key])) { + changeSummary.changes.push({ key, change: ctx.change }); + } + } + return true; + }, + beforeUpdate(reader, changeSummary) { + if (!obs) { + obs = getObs(); + } + for (const key in obs) { + if (key === "changes") { + throw new BugIndicatingError('property name "changes" is reserved for change tracking'); + } + changeSummary[key] = obs[key].read(reader); + } + } + }; +} +var init_changeTracker = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/common/observableInternal/changeTracker.js"() { + init_deps(); + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/common/observableInternal/observables/constObservable.js +function constObservable(value) { + return new ConstObservable(value); +} +var ConstObservable; +var init_constObservable = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/common/observableInternal/observables/constObservable.js"() { + init_baseObservable(); + ConstObservable = class extends ConvenientObservable { + constructor(value) { + super(); + this.value = value; + } + get debugName() { + return this.toString(); + } + get() { + return this.value; + } + addObserver(observer) { + } + removeObserver(observer) { + } + toString() { + return `Const: ${this.value}`; + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/common/observableInternal/observables/observableSignalFromEvent.js +function observableSignalFromEvent(owner, event, debugLocation = DebugLocation.ofCaller()) { + return new FromEventObservableSignal(typeof owner === "string" ? owner : new DebugNameData(owner, void 0, void 0), event, debugLocation); +} +var FromEventObservableSignal; +var init_observableSignalFromEvent = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/common/observableInternal/observables/observableSignalFromEvent.js"() { + init_transaction(); + init_debugName(); + init_baseObservable(); + init_debugLocation(); + FromEventObservableSignal = class extends BaseObservable { + constructor(debugNameDataOrName, event, debugLocation) { + super(debugLocation); + this.event = event; + this.handleEvent = () => { + transaction((tx) => { + for (const o of this._observers) { + tx.updateObserver(o, this); + o.handleChange(this, void 0); + } + }, () => this.debugName); + }; + this.debugName = typeof debugNameDataOrName === "string" ? debugNameDataOrName : debugNameDataOrName.getDebugName(this) ?? "Observable Signal From Event"; + } + onFirstObserverAdded() { + this.subscription = this.event(this.handleEvent); + } + onLastObserverRemoved() { + this.subscription.dispose(); + this.subscription = void 0; + } + get() { + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/common/observableInternal/utils/valueWithChangeEvent.js +var init_valueWithChangeEvent = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/common/observableInternal/utils/valueWithChangeEvent.js"() { + init_deps(); + init_observableFromEvent(); + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/common/observableInternal/utils/runOnChange.js +function runOnChange(observable, cb) { + let _previousValue; + let _firstRun = true; + return autorunWithStoreHandleChanges({ + changeTracker: { + createChangeSummary: () => ({ deltas: [], didChange: false }), + handleChange: (context, changeSummary) => { + if (context.didChange(observable)) { + const e = context.change; + if (e !== void 0) { + changeSummary.deltas.push(e); + } + changeSummary.didChange = true; + } + return true; + } + } + }, (reader, changeSummary) => { + const value = observable.read(reader); + const previousValue = _previousValue; + if (changeSummary.didChange) { + _previousValue = value; + cb(value, previousValue, changeSummary.deltas); + } + if (_firstRun) { + _firstRun = false; + _previousValue = value; + } + }); +} +function runOnChangeWithStore(observable, cb) { + const store = new DisposableStore(); + const disposable = runOnChange(observable, (value, previousValue, deltas) => { + store.clear(); + cb(value, previousValue, deltas, store); + }); + return { + dispose() { + disposable.dispose(); + store.dispose(); + } + }; +} +function runOnChangeWithCancellationToken(observable, cb) { + return runOnChangeWithStore(observable, (value, previousValue, deltas, store) => { + cb(value, previousValue, deltas, cancelOnDispose(store)); + }); +} +var init_runOnChange = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/common/observableInternal/utils/runOnChange.js"() { + init_cancellation2(); + init_deps(); + init_autorun(); + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/common/observableInternal/experimental/utils.js +function derivedConstOnceDefined(owner, fn) { + return derivedObservableWithCache(owner, (reader, lastValue) => lastValue ?? fn(reader)); +} +var init_utils2 = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/common/observableInternal/experimental/utils.js"() { + init_utils(); + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/common/observableInternal/logging/consoleObservableLogger.js +function logObservableToConsole(obs) { + if (!consoleObservableLogger) { + consoleObservableLogger = new ConsoleObservableLogger(); + addLogger(consoleObservableLogger); + } + consoleObservableLogger.addFilteredObj(obs); +} +function consoleTextToArgs(text2) { + const styles = new Array(); + const data = []; + let firstArg = ""; + function process2(t) { + if ("length" in t) { + for (const item of t) { + if (item) { + process2(item); + } + } + } else if ("text" in t) { + firstArg += `%c${t.text}`; + styles.push(t.style); + if (t.data) { + data.push(...t.data); + } + } else if ("data" in t) { + data.push(...t.data); + } + } + process2(text2); + const result = [firstArg, ...styles]; + result.push(...data); + return result; +} +function normalText(text2) { + return styled(text2, { color: "black" }); +} +function formatKind(kind) { + return styled(padStr(`${kind}: `, 10), { color: "black", bold: true }); +} +function styled(text2, options2 = { + color: "black" +}) { + function objToCss(styleObj) { + return Object.entries(styleObj).reduce((styleString, [propName, propValue]) => { + return `${styleString}${propName}:${propValue};`; + }, ""); + } + const style = { + color: options2.color + }; + if (options2.strikeThrough) { + style["text-decoration"] = "line-through"; + } + if (options2.bold) { + style["font-weight"] = "bold"; + } + return { + text: text2, + style: objToCss(style) + }; +} +function formatValue(value, availableLen) { + switch (typeof value) { + case "number": + return "" + value; + case "string": + if (value.length + 2 <= availableLen) { + return `"${value}"`; + } + return `"${value.substr(0, availableLen - 7)}"+...`; + case "boolean": + return value ? "true" : "false"; + case "undefined": + return "undefined"; + case "object": + if (value === null) { + return "null"; + } + if (Array.isArray(value)) { + return formatArray(value, availableLen); + } + return formatObject(value, availableLen); + case "symbol": + return value.toString(); + case "function": + return `[[Function${value.name ? " " + value.name : ""}]]`; + default: + return "" + value; + } +} +function formatArray(value, availableLen) { + let result = "[ "; + let first2 = true; + for (const val of value) { + if (!first2) { + result += ", "; + } + if (result.length - 5 > availableLen) { + result += "..."; + break; + } + first2 = false; + result += `${formatValue(val, availableLen - result.length)}`; + } + result += " ]"; + return result; +} +function formatObject(value, availableLen) { + if (typeof value.toString === "function" && value.toString !== Object.prototype.toString) { + const val = value.toString(); + if (val.length <= availableLen) { + return val; + } + return val.substring(0, availableLen - 3) + "..."; + } + const className2 = getClassName(value); + let result = className2 ? className2 + "(" : "{ "; + let first2 = true; + for (const [key, val] of Object.entries(value)) { + if (!first2) { + result += ", "; + } + if (result.length - 5 > availableLen) { + result += "..."; + break; + } + first2 = false; + result += `${key}: ${formatValue(val, availableLen - result.length)}`; + } + result += className2 ? ")" : " }"; + return result; +} +function repeat(str, count) { + let result = ""; + for (let i2 = 1; i2 <= count; i2++) { + result += str; + } + return result; +} +function padStr(str, length) { + while (str.length < length) { + str += " "; + } + return str; +} +var consoleObservableLogger, ConsoleObservableLogger; +var init_consoleObservableLogger = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/common/observableInternal/logging/consoleObservableLogger.js"() { + init_logging(); + init_debugName(); + init_derivedImpl(); + ConsoleObservableLogger = class { + constructor() { + this.indentation = 0; + this.changedObservablesSets = /* @__PURE__ */ new WeakMap(); + } + addFilteredObj(obj) { + if (!this._filteredObjects) { + this._filteredObjects = /* @__PURE__ */ new Set(); + } + this._filteredObjects.add(obj); + } + _isIncluded(obj) { + return this._filteredObjects?.has(obj) ?? true; + } + textToConsoleArgs(text2) { + return consoleTextToArgs([ + normalText(repeat("| ", this.indentation)), + text2 + ]); + } + formatInfo(info) { + if (!info.hadValue) { + return [ + normalText(` `), + styled(formatValue(info.newValue, 60), { + color: "green" + }), + normalText(` (initial)`) + ]; + } + return info.didChange ? [ + normalText(` `), + styled(formatValue(info.oldValue, 70), { + color: "red", + strikeThrough: true + }), + normalText(` `), + styled(formatValue(info.newValue, 60), { + color: "green" + }) + ] : [normalText(` (unchanged)`)]; + } + handleObservableCreated(observable) { + if (observable instanceof Derived) { + const derived2 = observable; + this.changedObservablesSets.set(derived2, /* @__PURE__ */ new Set()); + const debugTrackUpdating = false; + if (debugTrackUpdating) { + const updating = []; + derived2.__debugUpdating = updating; + const existingBeginUpdate = derived2.beginUpdate; + derived2.beginUpdate = (obs) => { + updating.push(obs); + return existingBeginUpdate.apply(derived2, [obs]); + }; + const existingEndUpdate = derived2.endUpdate; + derived2.endUpdate = (obs) => { + const idx = updating.indexOf(obs); + if (idx === -1) { + console.error("endUpdate called without beginUpdate", derived2.debugName, obs.debugName); + } + updating.splice(idx, 1); + return existingEndUpdate.apply(derived2, [obs]); + }; + } + } + } + handleOnListenerCountChanged(observable, newCount) { + } + handleObservableUpdated(observable, info) { + if (!this._isIncluded(observable)) { + return; + } + if (observable instanceof Derived) { + this._handleDerivedRecomputed(observable, info); + return; + } + console.log(...this.textToConsoleArgs([ + formatKind("observable value changed"), + styled(observable.debugName, { color: "BlueViolet" }), + ...this.formatInfo(info) + ])); + } + formatChanges(changes) { + if (changes.size === 0) { + return void 0; + } + return styled(" (changed deps: " + [...changes].map((o) => o.debugName).join(", ") + ")", { color: "gray" }); + } + handleDerivedDependencyChanged(derived2, observable, change) { + if (!this._isIncluded(derived2)) { + return; + } + this.changedObservablesSets.get(derived2)?.add(observable); + } + _handleDerivedRecomputed(derived2, info) { + if (!this._isIncluded(derived2)) { + return; + } + const changedObservables = this.changedObservablesSets.get(derived2); + if (!changedObservables) { + return; + } + console.log(...this.textToConsoleArgs([ + formatKind("derived recomputed"), + styled(derived2.debugName, { color: "BlueViolet" }), + ...this.formatInfo(info), + this.formatChanges(changedObservables), + { data: [{ fn: derived2._debugNameData.referenceFn ?? derived2._computeFn }] } + ])); + changedObservables.clear(); + } + handleDerivedCleared(derived2) { + if (!this._isIncluded(derived2)) { + return; + } + console.log(...this.textToConsoleArgs([ + formatKind("derived cleared"), + styled(derived2.debugName, { color: "BlueViolet" }) + ])); + } + handleAutorunCreated(autorun2) { + if (!this._isIncluded(autorun2)) { + return; + } + this.changedObservablesSets.set(autorun2, /* @__PURE__ */ new Set()); + } + handleAutorunDisposed(autorun2) { + } + handleAutorunDependencyChanged(autorun2, observable, change) { + if (!this._isIncluded(autorun2)) { + return; + } + this.changedObservablesSets.get(autorun2).add(observable); + } + handleAutorunStarted(autorun2) { + const changedObservables = this.changedObservablesSets.get(autorun2); + if (!changedObservables) { + return; + } + if (this._isIncluded(autorun2)) { + console.log(...this.textToConsoleArgs([ + formatKind("autorun"), + styled(autorun2.debugName, { color: "BlueViolet" }), + this.formatChanges(changedObservables), + { data: [{ fn: autorun2._debugNameData.referenceFn ?? autorun2._runFn }] } + ])); + } + changedObservables.clear(); + this.indentation++; + } + handleAutorunFinished(autorun2) { + this.indentation--; + } + handleBeginTransaction(transaction2) { + let transactionName = transaction2.getDebugName(); + if (transactionName === void 0) { + transactionName = ""; + } + if (this._isIncluded(transaction2)) { + console.log(...this.textToConsoleArgs([ + formatKind("transaction"), + styled(transactionName, { color: "BlueViolet" }), + { data: [{ fn: transaction2._fn }] } + ])); + } + this.indentation++; + } + handleEndTransaction() { + this.indentation--; + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/common/observableInternal/logging/debugger/rpc.js +var SimpleTypedRpcConnection; +var init_rpc = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/common/observableInternal/logging/debugger/rpc.js"() { + SimpleTypedRpcConnection = class _SimpleTypedRpcConnection { + static createClient(channelFactory, getHandler) { + return new _SimpleTypedRpcConnection(channelFactory, getHandler); + } + constructor(_channelFactory, _getHandler) { + this._channelFactory = _channelFactory; + this._getHandler = _getHandler; + this._channel = this._channelFactory({ + handleNotification: (notificationData) => { + const m = notificationData; + const fn = this._getHandler().notifications[m[0]]; + if (!fn) { + throw new Error(`Unknown notification "${m[0]}"!`); + } + fn(...m[1]); + }, + handleRequest: (requestData) => { + const m = requestData; + try { + const result = this._getHandler().requests[m[0]](...m[1]); + return { type: "result", value: result }; + } catch (e) { + return { type: "error", value: e }; + } + } + }); + const requests = new Proxy({}, { + get: (target, key) => { + return async (...args) => { + const result = await this._channel.sendRequest([key, args]); + if (result.type === "error") { + throw result.value; + } else { + return result.value; + } + }; + } + }); + const notifications = new Proxy({}, { + get: (target, key) => { + return (...args) => { + this._channel.sendNotification([key, args]); + }; + } + }); + this.api = { notifications, requests }; + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/common/observableInternal/logging/debugger/debuggerRpc.js +function registerDebugChannel(channelId, createClient) { + const g = globalThis; + let queuedNotifications = []; + let curHost = void 0; + const { channel, handler } = createChannelFactoryFromDebugChannel({ + sendNotification: (data) => { + if (curHost) { + curHost.sendNotification(data); + } else { + queuedNotifications.push(data); + } + } + }); + let curClient = void 0; + (g.$$debugValueEditor_debugChannels ?? (g.$$debugValueEditor_debugChannels = {}))[channelId] = (host) => { + curClient = createClient(); + curHost = host; + for (const n2 of queuedNotifications) { + host.sendNotification(n2); + } + queuedNotifications = []; + return handler; + }; + return SimpleTypedRpcConnection.createClient(channel, () => { + if (!curClient) { + throw new Error("Not supported"); + } + return curClient; + }); +} +function createChannelFactoryFromDebugChannel(host) { + let h2; + const channel = (handler) => { + h2 = handler; + return { + sendNotification: (data) => { + host.sendNotification(data); + }, + sendRequest: (data) => { + throw new Error("not supported"); + } + }; + }; + return { + channel, + handler: { + handleRequest: (data) => { + if (data.type === "notification") { + return h2?.handleNotification(data.data); + } else { + return h2?.handleRequest(data.data); + } + } + } + }; +} +var init_debuggerRpc = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/common/observableInternal/logging/debugger/debuggerRpc.js"() { + init_rpc(); + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/common/observableInternal/logging/debugger/utils.js +function deepAssign(target, source) { + for (const key in source) { + if (!!target[key] && typeof target[key] === "object" && !!source[key] && typeof source[key] === "object") { + deepAssign(target[key], source[key]); + } else { + target[key] = source[key]; + } + } +} +function deepAssignDeleteNulls(target, source) { + for (const key in source) { + if (source[key] === null) { + delete target[key]; + } else if (!!target[key] && typeof target[key] === "object" && !!source[key] && typeof source[key] === "object") { + deepAssignDeleteNulls(target[key], source[key]); + } else { + target[key] = source[key]; + } + } +} +var Throttler2; +var init_utils3 = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/common/observableInternal/logging/debugger/utils.js"() { + Throttler2 = class { + constructor() { + this._timeout = void 0; + } + throttle(fn, timeoutMs) { + if (this._timeout === void 0) { + this._timeout = setTimeout(() => { + this._timeout = void 0; + fn(); + }, timeoutMs); + } + } + dispose() { + if (this._timeout !== void 0) { + clearTimeout(this._timeout); + } + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/common/observableInternal/logging/debugger/devToolsLogger.js +var DevToolsLogger; +var init_devToolsLogger = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/common/observableInternal/logging/debugger/devToolsLogger.js"() { + init_autorunImpl(); + init_consoleObservableLogger(); + init_debuggerRpc(); + init_utils3(); + init_types(); + init_observableFromEvent(); + init_errors(); + init_derivedImpl(); + init_observableValue(); + init_debugLocation(); + DevToolsLogger = class _DevToolsLogger { + static { + this._instance = void 0; + } + static getInstance() { + if (_DevToolsLogger._instance === void 0) { + _DevToolsLogger._instance = new _DevToolsLogger(); + } + return _DevToolsLogger._instance; + } + getTransactionState() { + const affected = []; + const txs = [...this._activeTransactions]; + if (txs.length === 0) { + return void 0; + } + const observerQueue = txs.flatMap((t) => t.debugGetUpdatingObservers() ?? []).map((o) => o.observer); + const processedObservers = /* @__PURE__ */ new Set(); + while (observerQueue.length > 0) { + const observer = observerQueue.shift(); + if (processedObservers.has(observer)) { + continue; + } + processedObservers.add(observer); + const state = this._getInfo(observer, (d) => { + if (!processedObservers.has(d)) { + observerQueue.push(d); + } + }); + if (state) { + affected.push(state); + } + } + return { names: txs.map((t) => t.getDebugName() ?? "tx"), affected }; + } + _getObservableInfo(observable) { + const info = this._instanceInfos.get(observable); + if (!info) { + onUnexpectedError(new BugIndicatingError("No info found")); + return void 0; + } + return info; + } + _getAutorunInfo(autorun2) { + const info = this._instanceInfos.get(autorun2); + if (!info) { + onUnexpectedError(new BugIndicatingError("No info found")); + return void 0; + } + return info; + } + _getInfo(observer, queue) { + if (observer instanceof Derived) { + const observersToUpdate = [...observer.debugGetObservers()]; + for (const o of observersToUpdate) { + queue(o); + } + const info = this._getObservableInfo(observer); + if (!info) { + return; + } + const observerState = observer.debugGetState(); + const base = { name: observer.debugName, instanceId: info.instanceId, updateCount: observerState.updateCount }; + const changedDependencies = [...info.changedObservables].map((o) => this._instanceInfos.get(o)?.instanceId).filter(isDefined); + if (observerState.isComputing) { + return { ...base, type: "observable/derived", state: "updating", changedDependencies, initialComputation: false }; + } + switch (observerState.state) { + case 0: + return { ...base, type: "observable/derived", state: "noValue" }; + case 3: + return { ...base, type: "observable/derived", state: "upToDate" }; + case 2: + return { ...base, type: "observable/derived", state: "stale", changedDependencies }; + case 1: + return { ...base, type: "observable/derived", state: "possiblyStale" }; + } + } else if (observer instanceof AutorunObserver) { + const info = this._getAutorunInfo(observer); + if (!info) { + return void 0; + } + const base = { name: observer.debugName, instanceId: info.instanceId, updateCount: info.updateCount }; + const changedDependencies = [...info.changedObservables].map((o) => this._instanceInfos.get(o).instanceId); + if (observer.debugGetState().isRunning) { + return { ...base, type: "autorun", state: "updating", changedDependencies }; + } + switch (observer.debugGetState().state) { + case 3: + return { ...base, type: "autorun", state: "upToDate" }; + case 2: + return { ...base, type: "autorun", state: "stale", changedDependencies }; + case 1: + return { ...base, type: "autorun", state: "possiblyStale" }; + } + } + return void 0; + } + _formatObservable(obs) { + const info = this._getObservableInfo(obs); + if (!info) { + return void 0; + } + return { name: obs.debugName, instanceId: info.instanceId }; + } + _formatObserver(obs) { + if (obs instanceof Derived) { + return { name: obs.toString(), instanceId: this._getObservableInfo(obs)?.instanceId }; + } + const autorunInfo = this._getAutorunInfo(obs); + if (autorunInfo) { + return { name: obs.toString(), instanceId: autorunInfo.instanceId }; + } + return void 0; + } + constructor() { + this._declarationId = 0; + this._instanceId = 0; + this._declarations = /* @__PURE__ */ new Map(); + this._instanceInfos = /* @__PURE__ */ new WeakMap(); + this._aliveInstances = /* @__PURE__ */ new Map(); + this._activeTransactions = /* @__PURE__ */ new Set(); + this._channel = registerDebugChannel("observableDevTools", () => { + return { + notifications: { + setDeclarationIdFilter: (declarationIds) => { + }, + logObservableValue: (observableId) => { + console.log("logObservableValue", observableId); + }, + flushUpdates: () => { + this._flushUpdates(); + }, + resetUpdates: () => { + this._pendingChanges = null; + this._channel.api.notifications.handleChange(this._fullState, true); + } + }, + requests: { + getDeclarations: () => { + const result = {}; + for (const decl of this._declarations.values()) { + result[decl.id] = decl; + } + return { decls: result }; + }, + getSummarizedInstances: () => { + return null; + }, + getObservableValueInfo: (instanceId) => { + const obs = this._aliveInstances.get(instanceId); + return { + observers: [...obs.debugGetObservers()].map((d) => this._formatObserver(d)).filter(isDefined) + }; + }, + getDerivedInfo: (instanceId) => { + const d = this._aliveInstances.get(instanceId); + return { + dependencies: [...d.debugGetState().dependencies].map((d2) => this._formatObservable(d2)).filter(isDefined), + observers: [...d.debugGetObservers()].map((d2) => this._formatObserver(d2)).filter(isDefined) + }; + }, + getAutorunInfo: (instanceId) => { + const obs = this._aliveInstances.get(instanceId); + return { + dependencies: [...obs.debugGetState().dependencies].map((d) => this._formatObservable(d)).filter(isDefined) + }; + }, + getTransactionState: () => { + return this.getTransactionState(); + }, + setValue: (instanceId, jsonValue) => { + const obs = this._aliveInstances.get(instanceId); + if (obs instanceof Derived) { + obs.debugSetValue(jsonValue); + } else if (obs instanceof ObservableValue) { + obs.debugSetValue(jsonValue); + } else if (obs instanceof FromEventObservable) { + obs.debugSetValue(jsonValue); + } else { + throw new BugIndicatingError("Observable is not supported"); + } + const observers = [...obs.debugGetObservers()]; + for (const d of observers) { + d.beginUpdate(obs); + } + for (const d of observers) { + d.handleChange(obs, void 0); + } + for (const d of observers) { + d.endUpdate(obs); + } + }, + getValue: (instanceId) => { + const obs = this._aliveInstances.get(instanceId); + if (obs instanceof Derived) { + return formatValue(obs.debugGetState().value, 200); + } else if (obs instanceof ObservableValue) { + return formatValue(obs.debugGetState().value, 200); + } + return void 0; + }, + logValue: (instanceId) => { + const obs = this._aliveInstances.get(instanceId); + if (obs && "get" in obs) { + console.log("Logged Value:", obs.get()); + } else { + throw new BugIndicatingError("Observable is not supported"); + } + }, + rerun: (instanceId) => { + const obs = this._aliveInstances.get(instanceId); + if (obs instanceof Derived) { + obs.debugRecompute(); + } else if (obs instanceof AutorunObserver) { + obs.debugRerun(); + } else { + throw new BugIndicatingError("Observable is not supported"); + } + } + } + }; + }); + this._pendingChanges = null; + this._changeThrottler = new Throttler2(); + this._fullState = {}; + this._flushUpdates = () => { + if (this._pendingChanges !== null) { + this._channel.api.notifications.handleChange(this._pendingChanges, false); + this._pendingChanges = null; + } + }; + DebugLocation.enable(); + } + _handleChange(update) { + deepAssignDeleteNulls(this._fullState, update); + if (this._pendingChanges === null) { + this._pendingChanges = update; + } else { + deepAssign(this._pendingChanges, update); + } + this._changeThrottler.throttle(this._flushUpdates, 10); + } + _getDeclarationId(type, location2) { + if (!location2) { + return -1; + } + let decInfo = this._declarations.get(location2.id); + if (decInfo === void 0) { + decInfo = { + id: this._declarationId++, + type, + url: location2.fileName, + line: location2.line, + column: location2.column + }; + this._declarations.set(location2.id, decInfo); + this._handleChange({ decls: { [decInfo.id]: decInfo } }); + } + return decInfo.id; + } + handleObservableCreated(observable, location2) { + const declarationId = this._getDeclarationId("observable/value", location2); + const info = { + declarationId, + instanceId: this._instanceId++, + listenerCount: 0, + lastValue: void 0, + updateCount: 0, + changedObservables: /* @__PURE__ */ new Set() + }; + this._instanceInfos.set(observable, info); + } + handleOnListenerCountChanged(observable, newCount) { + const info = this._getObservableInfo(observable); + if (!info) { + return; + } + if (info.listenerCount === 0 && newCount > 0) { + const type = observable instanceof Derived ? "observable/derived" : "observable/value"; + this._aliveInstances.set(info.instanceId, observable); + this._handleChange({ + instances: { + [info.instanceId]: { + instanceId: info.instanceId, + declarationId: info.declarationId, + formattedValue: info.lastValue, + type, + name: observable.debugName + } + } + }); + } else if (info.listenerCount > 0 && newCount === 0) { + this._handleChange({ + instances: { [info.instanceId]: null } + }); + this._aliveInstances.delete(info.instanceId); + } + info.listenerCount = newCount; + } + handleObservableUpdated(observable, changeInfo) { + if (observable instanceof Derived) { + this._handleDerivedRecomputed(observable, changeInfo); + return; + } + const info = this._getObservableInfo(observable); + if (info) { + if (changeInfo.didChange) { + info.lastValue = formatValue(changeInfo.newValue, 30); + if (info.listenerCount > 0) { + this._handleChange({ + instances: { [info.instanceId]: { formattedValue: info.lastValue } } + }); + } + } + } + } + handleAutorunCreated(autorun2, location2) { + const declarationId = this._getDeclarationId("autorun", location2); + const info = { + declarationId, + instanceId: this._instanceId++, + updateCount: 0, + changedObservables: /* @__PURE__ */ new Set() + }; + this._instanceInfos.set(autorun2, info); + this._aliveInstances.set(info.instanceId, autorun2); + if (info) { + this._handleChange({ + instances: { + [info.instanceId]: { + instanceId: info.instanceId, + declarationId: info.declarationId, + runCount: 0, + type: "autorun", + name: autorun2.debugName + } + } + }); + } + } + handleAutorunDisposed(autorun2) { + const info = this._getAutorunInfo(autorun2); + if (!info) { + return; + } + this._handleChange({ + instances: { [info.instanceId]: null } + }); + this._instanceInfos.delete(autorun2); + this._aliveInstances.delete(info.instanceId); + } + handleAutorunDependencyChanged(autorun2, observable, change) { + const info = this._getAutorunInfo(autorun2); + if (!info) { + return; + } + info.changedObservables.add(observable); + } + handleAutorunStarted(autorun2) { + } + handleAutorunFinished(autorun2) { + const info = this._getAutorunInfo(autorun2); + if (!info) { + return; + } + info.changedObservables.clear(); + info.updateCount++; + this._handleChange({ + instances: { [info.instanceId]: { runCount: info.updateCount } } + }); + } + handleDerivedDependencyChanged(derived2, observable, change) { + const info = this._getObservableInfo(derived2); + if (info) { + info.changedObservables.add(observable); + } + } + _handleDerivedRecomputed(observable, changeInfo) { + const info = this._getObservableInfo(observable); + if (!info) { + return; + } + const formattedValue = formatValue(changeInfo.newValue, 30); + info.updateCount++; + info.changedObservables.clear(); + info.lastValue = formattedValue; + if (info.listenerCount > 0) { + this._handleChange({ + instances: { [info.instanceId]: { formattedValue, recomputationCount: info.updateCount } } + }); + } + } + handleDerivedCleared(observable) { + const info = this._getObservableInfo(observable); + if (!info) { + return; + } + info.lastValue = void 0; + info.changedObservables.clear(); + if (info.listenerCount > 0) { + this._handleChange({ + instances: { + [info.instanceId]: { + formattedValue: void 0 + } + } + }); + } + } + handleBeginTransaction(transaction2) { + this._activeTransactions.add(transaction2); + } + handleEndTransaction(transaction2) { + this._activeTransactions.delete(transaction2); + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/common/observableInternal/logging/debugGetDependencyGraph.js +function debugGetDependencyGraph(obs, options2) { + const debugNamePostProcessor = options2?.debugNamePostProcessor ?? ((str) => str); + const info = Info.from(obs, debugNamePostProcessor); + if (!info) { + return ""; + } + const alreadyListed = /* @__PURE__ */ new Set(); + return formatObservableInfo(info, 0, alreadyListed).trim(); +} +function formatObservableInfo(info, indentLevel, alreadyListed) { + const indent = " ".repeat(indentLevel); + const lines = []; + const isAlreadyListed = alreadyListed.has(info.sourceObj); + if (isAlreadyListed) { + lines.push(`${indent}* ${info.type} ${info.name} (already listed)`); + return lines.join("\n"); + } + alreadyListed.add(info.sourceObj); + lines.push(`${indent}* ${info.type} ${info.name}:`); + lines.push(`${indent} value: ${formatValue(info.value, 50)}`); + lines.push(`${indent} state: ${info.state}`); + if (info.dependencies.length > 0) { + lines.push(`${indent} dependencies:`); + for (const dep of info.dependencies) { + lines.push(formatObservableInfo(dep, indentLevel + 1, alreadyListed)); + } + } + return lines.join("\n"); +} +var Info; +var init_debugGetDependencyGraph = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/common/observableInternal/logging/debugGetDependencyGraph.js"() { + init_derivedImpl(); + init_observableFromEvent(); + init_observableValue(); + init_autorunImpl(); + init_consoleObservableLogger(); + Info = class _Info { + static from(obs, debugNamePostProcessor) { + if (obs instanceof AutorunObserver) { + const state = obs.debugGetState(); + return new _Info(obs, debugNamePostProcessor(obs.debugName), "autorun", void 0, state.stateStr, Array.from(state.dependencies).map((dep) => _Info.from(dep, debugNamePostProcessor) || _Info.unknown(dep))); + } else if (obs instanceof Derived) { + const state = obs.debugGetState(); + return new _Info(obs, debugNamePostProcessor(obs.debugName), "derived", state.value, state.stateStr, Array.from(state.dependencies).map((dep) => _Info.from(dep, debugNamePostProcessor) || _Info.unknown(dep))); + } else if (obs instanceof ObservableValue) { + const state = obs.debugGetState(); + return new _Info(obs, debugNamePostProcessor(obs.debugName), "observableValue", state.value, "upToDate", []); + } else if (obs instanceof FromEventObservable) { + const state = obs.debugGetState(); + return new _Info(obs, debugNamePostProcessor(obs.debugName), "fromEvent", state.value, state.hasValue ? "upToDate" : "initial", []); + } + return void 0; + } + static unknown(obs) { + return new _Info(obs, "(unknown)", "unknown", void 0, "unknown", []); + } + constructor(sourceObj, name, type, value, state, dependencies) { + this.sourceObj = sourceObj; + this.name = name; + this.type = type; + this.value = value; + this.state = state; + this.dependencies = dependencies; + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/common/observableInternal/index.js +var enableLogging; +var init_observableInternal = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/common/observableInternal/index.js"() { + init_observableValueOpts(); + init_autorun(); + init_observableValue(); + init_derived(); + init_promise(); + init_utilsCancellation(); + init_utils(); + init_changeTracker(); + init_constObservable(); + init_observableSignal(); + init_observableFromEvent(); + init_observableSignalFromEvent(); + init_transaction(); + init_valueWithChangeEvent(); + init_runOnChange(); + init_utils2(); + init_observableFromEvent(); + init_observableValue(); + init_debugLocation(); + init_logging(); + init_consoleObservableLogger(); + init_devToolsLogger(); + init_process(); + init_baseObservable(); + init_debugGetDependencyGraph(); + _setDebugGetDependencyGraph(debugGetDependencyGraph); + setLogObservableFn(logObservableToConsole); + enableLogging = false; + if (enableLogging) { + addLogger(new ConsoleObservableLogger()); + } + if (env && env["VSCODE_DEV_DEBUG_OBSERVABLES"]) { + addLogger(DevToolsLogger.getInstance()); + } + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/common/observable.js +var init_observable = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/common/observable.js"() { + init_observableInternal(); + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/browser/dom.js +function clearNode(node) { + while (node.firstChild) { + node.firstChild.remove(); + } +} +function addDisposableListener(node, type, handler, useCaptureOrOptions) { + return new DomListener(node, type, handler, useCaptureOrOptions); +} +function _wrapAsStandardMouseEvent(targetWindow, handler) { + return function(e) { + return handler(new StandardMouseEvent(targetWindow, e)); + }; +} +function _wrapAsStandardKeyboardEvent(handler) { + return function(e) { + return handler(new StandardKeyboardEvent(e)); + }; +} +function addDisposableGenericMouseDownListener(node, handler, useCapture) { + return addDisposableListener(node, isIOS && BrowserFeatures.pointerEvents ? EventType.POINTER_DOWN : EventType.MOUSE_DOWN, handler, useCapture); +} +function addDisposableGenericMouseMoveListener(node, handler, useCapture) { + return addDisposableListener(node, isIOS && BrowserFeatures.pointerEvents ? EventType.POINTER_MOVE : EventType.MOUSE_MOVE, handler, useCapture); +} +function addDisposableGenericMouseUpListener(node, handler, useCapture) { + return addDisposableListener(node, isIOS && BrowserFeatures.pointerEvents ? EventType.POINTER_UP : EventType.MOUSE_UP, handler, useCapture); +} +function runWhenWindowIdle(targetWindow, callback, timeout2) { + return _runWhenIdle(targetWindow, callback, timeout2); +} +function getComputedStyle(el) { + return getWindow(el).getComputedStyle(el, null); +} +function getClientArea(element, defaultValue, fallbackElement) { + const elWindow = getWindow(element); + const elDocument = elWindow.document; + if (element !== elDocument.body) { + return new Dimension(element.clientWidth, element.clientHeight); + } + if (isIOS && elWindow?.visualViewport) { + return new Dimension(elWindow.visualViewport.width, elWindow.visualViewport.height); + } + if (elWindow?.innerWidth && elWindow.innerHeight) { + return new Dimension(elWindow.innerWidth, elWindow.innerHeight); + } + if (elDocument.body && elDocument.body.clientWidth && elDocument.body.clientHeight) { + return new Dimension(elDocument.body.clientWidth, elDocument.body.clientHeight); + } + if (elDocument.documentElement && elDocument.documentElement.clientWidth && elDocument.documentElement.clientHeight) { + return new Dimension(elDocument.documentElement.clientWidth, elDocument.documentElement.clientHeight); + } + if (fallbackElement) { + return getClientArea(fallbackElement, defaultValue); + } + if (defaultValue) { + return defaultValue; + } + throw new Error("Unable to figure out browser width and height"); +} +function getTopLeftOffset(element) { + let offsetParent = element.offsetParent; + let top = element.offsetTop; + let left = element.offsetLeft; + while ((element = element.parentNode) !== null && element !== element.ownerDocument.body && element !== element.ownerDocument.documentElement) { + top -= element.scrollTop; + const c = isShadowRoot(element) ? null : getComputedStyle(element); + if (c) { + left -= c.direction !== "rtl" ? element.scrollLeft : -element.scrollLeft; + } + if (element === offsetParent) { + left += SizeUtils.getBorderLeftWidth(element); + top += SizeUtils.getBorderTopWidth(element); + top += element.offsetTop; + left += element.offsetLeft; + offsetParent = element.offsetParent; + } + } + return { + left, + top + }; +} +function size(element, width2, height) { + if (typeof width2 === "number") { + element.style.width = `${width2}px`; + } + if (typeof height === "number") { + element.style.height = `${height}px`; + } +} +function getDomNodePagePosition(domNode) { + const bb = domNode.getBoundingClientRect(); + const window2 = getWindow(domNode); + return { + left: bb.left + window2.scrollX, + top: bb.top + window2.scrollY, + width: bb.width, + height: bb.height + }; +} +function getDomNodeZoomLevel(domNode) { + let testElement = domNode; + let zoom = 1; + do { + const elementZoomLevel = getComputedStyle(testElement).zoom; + if (elementZoomLevel !== null && elementZoomLevel !== void 0 && elementZoomLevel !== "1") { + zoom *= elementZoomLevel; + } + testElement = testElement.parentElement; + } while (testElement !== null && testElement !== testElement.ownerDocument.documentElement); + return zoom; +} +function getTotalWidth(element) { + const margin = SizeUtils.getMarginLeft(element) + SizeUtils.getMarginRight(element); + return element.offsetWidth + margin; +} +function getContentWidth(element) { + const border = SizeUtils.getBorderLeftWidth(element) + SizeUtils.getBorderRightWidth(element); + const padding = SizeUtils.getPaddingLeft(element) + SizeUtils.getPaddingRight(element); + return element.offsetWidth - border - padding; +} +function getContentHeight(element) { + const border = SizeUtils.getBorderTopWidth(element) + SizeUtils.getBorderBottomWidth(element); + const padding = SizeUtils.getPaddingTop(element) + SizeUtils.getPaddingBottom(element); + return element.offsetHeight - border - padding; +} +function getTotalHeight(element) { + const margin = SizeUtils.getMarginTop(element) + SizeUtils.getMarginBottom(element); + return element.offsetHeight + margin; +} +function isAncestor(testChild, testAncestor) { + return Boolean(testAncestor?.contains(testChild)); +} +function findParentWithClass(node, clazz, stopAtClazzOrNode) { + while (node && node.nodeType === node.ELEMENT_NODE) { + if (node.classList.contains(clazz)) { + return node; + } + if (stopAtClazzOrNode) { + if (typeof stopAtClazzOrNode === "string") { + if (node.classList.contains(stopAtClazzOrNode)) { + return null; + } + } else { + if (node === stopAtClazzOrNode) { + return null; + } + } + } + node = node.parentNode; + } + return null; +} +function hasParentWithClass(node, clazz, stopAtClazzOrNode) { + return !!findParentWithClass(node, clazz, stopAtClazzOrNode); +} +function isShadowRoot(node) { + return node && !!node.host && !!node.mode; +} +function isInShadowDOM(domNode) { + return !!getShadowRoot(domNode); +} +function getShadowRoot(domNode) { + while (domNode.parentNode) { + if (domNode === domNode.ownerDocument?.body) { + return null; + } + domNode = domNode.parentNode; + } + return isShadowRoot(domNode) ? domNode : null; +} +function getActiveElement() { + let result = getActiveDocument().activeElement; + while (result?.shadowRoot) { + result = result.shadowRoot.activeElement; + } + return result; +} +function isActiveElement(element) { + return getActiveElement() === element; +} +function isAncestorOfActiveElement(ancestor) { + return isAncestor(getActiveElement(), ancestor); +} +function getActiveDocument() { + if (getWindowsCount() <= 1) { + return mainWindow.document; + } + const documents = Array.from(getWindows()).map(({ window: window2 }) => window2.document); + return documents.find((doc) => doc.hasFocus()) ?? mainWindow.document; +} +function getActiveWindow() { + const document2 = getActiveDocument(); + return document2.defaultView?.window ?? mainWindow; +} +function isHTMLElement(e) { + return e instanceof HTMLElement || e instanceof getWindow(e).HTMLElement; +} +function isHTMLAnchorElement(e) { + return e instanceof HTMLAnchorElement || e instanceof getWindow(e).HTMLAnchorElement; +} +function isSVGElement(e) { + return e instanceof SVGElement || e instanceof getWindow(e).SVGElement; +} +function isMouseEvent(e) { + return e instanceof MouseEvent || e instanceof getWindow(e).MouseEvent; +} +function isKeyboardEvent(e) { + return e instanceof KeyboardEvent || e instanceof getWindow(e).KeyboardEvent; +} +function isEventLike(obj) { + const candidate = obj; + return !!(candidate && typeof candidate.preventDefault === "function" && typeof candidate.stopPropagation === "function"); +} +function saveParentsScrollTop(node) { + const r = []; + for (let i2 = 0; node && node.nodeType === node.ELEMENT_NODE; i2++) { + r[i2] = node.scrollTop; + node = node.parentNode; + } + return r; +} +function restoreParentsScrollTop(node, state) { + for (let i2 = 0; node && node.nodeType === node.ELEMENT_NODE; i2++) { + if (node.scrollTop !== state[i2]) { + node.scrollTop = state[i2]; + } + node = node.parentNode; + } +} +function trackFocus(element) { + return new FocusTracker(element); +} +function after(sibling, child) { + sibling.after(child); + return child; +} +function append(parent, ...children) { + parent.append(...children); + if (children.length === 1 && typeof children[0] !== "string") { + return children[0]; + } +} +function prepend(parent, child) { + parent.insertBefore(child, parent.firstChild); + return child; +} +function reset(parent, ...children) { + parent.textContent = ""; + append(parent, ...children); +} +function _$(namespace, description, attrs, ...children) { + const match2 = SELECTOR_REGEX.exec(description); + if (!match2) { + throw new Error("Bad use of emmet"); + } + const tagName = match2[1] || "div"; + let result; + if (namespace !== Namespace.HTML) { + result = document.createElementNS(namespace, tagName); + } else { + result = document.createElement(tagName); + } + if (match2[3]) { + result.id = match2[3]; + } + if (match2[4]) { + result.className = match2[4].replace(/\./g, " ").trim(); + } + if (attrs) { + Object.entries(attrs).forEach(([name, value]) => { + if (typeof value === "undefined") { + return; + } + if (/^on\w+$/.test(name)) { + result[name] = value; + } else if (name === "selected") { + if (value) { + result.setAttribute(name, "true"); + } + } else { + result.setAttribute(name, value); + } + }); + } + result.append(...children); + return result; +} +function $(description, attrs, ...children) { + return _$(Namespace.HTML, description, attrs, ...children); +} +function setVisibility(visible, ...elements) { + if (visible) { + show(...elements); + } else { + hide(...elements); + } +} +function show(...elements) { + for (const element of elements) { + element.style.display = ""; + element.removeAttribute("aria-hidden"); + } +} +function hide(...elements) { + for (const element of elements) { + element.style.display = "none"; + element.setAttribute("aria-hidden", "true"); + } +} +function computeScreenAwareSize(window2, cssPx) { + const screenPx = window2.devicePixelRatio * cssPx; + return Math.max(1, Math.floor(screenPx)) / window2.devicePixelRatio; +} +function windowOpenNoOpener(url) { + mainWindow.open(url, "_blank", "noopener"); +} +function animate(targetWindow, fn) { + const step = () => { + fn(); + stepDisposable = scheduleAtNextAnimationFrame(targetWindow, step); + }; + let stepDisposable = scheduleAtNextAnimationFrame(targetWindow, step); + return toDisposable(() => stepDisposable.dispose()); +} +function h(tag2, ...args) { + let attributes; + let children; + if (Array.isArray(args[0])) { + attributes = {}; + children = args[0]; + } else { + attributes = args[0] || {}; + children = args[1]; + } + const match2 = H_REGEX.exec(tag2); + if (!match2 || !match2.groups) { + throw new Error("Bad use of h"); + } + const tagName = match2.groups["tag"] || "div"; + const el = document.createElement(tagName); + if (match2.groups["id"]) { + el.id = match2.groups["id"]; + } + const classNames2 = []; + if (match2.groups["class"]) { + for (const className2 of match2.groups["class"].split(".")) { + if (className2 !== "") { + classNames2.push(className2); + } + } + } + if (attributes.className !== void 0) { + for (const className2 of attributes.className.split(".")) { + if (className2 !== "") { + classNames2.push(className2); + } + } + } + if (classNames2.length > 0) { + el.className = classNames2.join(" "); + } + const result = {}; + if (match2.groups["name"]) { + result[match2.groups["name"]] = el; + } + if (children) { + for (const c of children) { + if (isHTMLElement(c)) { + el.appendChild(c); + } else if (typeof c === "string") { + el.append(c); + } else if ("root" in c) { + Object.assign(result, c); + el.appendChild(c.root); + } + } + } + for (const [key, value] of Object.entries(attributes)) { + if (key === "className") { + continue; + } else if (key === "style") { + for (const [cssKey, cssValue] of Object.entries(value)) { + el.style.setProperty(camelCaseToHyphenCase(cssKey), typeof cssValue === "number" ? cssValue + "px" : "" + cssValue); + } + } else if (key === "tabIndex") { + el.tabIndex = value; + } else { + el.setAttribute(camelCaseToHyphenCase(key), value.toString()); + } + } + result["root"] = el; + return result; +} +function camelCaseToHyphenCase(str) { + return str.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase(); +} +function isEditableElement(element) { + return element.tagName.toLowerCase() === "input" || element.tagName.toLowerCase() === "textarea" || isHTMLElement(element) && !!element.editContext; +} +function setClassName(domNode, className2) { + if (isSVGElement(domNode)) { + domNode.setAttribute("class", className2); + } else { + domNode.className = className2; + } +} +function resolve2(value, reader, cb) { + if (isObservable(value)) { + cb(value.read(reader)); + return; + } + if (Array.isArray(value)) { + for (const v of value) { + resolve2(v, reader, cb); + } + return; + } + cb(value); +} +function getClassName2(className2, reader) { + let result = ""; + resolve2(className2, reader, (val) => { + if (val) { + if (result.length === 0) { + result = val; + } else { + result += " " + val; + } + } + }); + return result; +} +function hasObservable(value) { + if (isObservable(value)) { + return true; + } + if (Array.isArray(value)) { + return value.some((v) => hasObservable(v)); + } + return false; +} +function convertCssValue(value) { + if (typeof value === "number") { + return value + "px"; + } + return value; +} +function childrenIsObservable(children) { + if (isObservable(children)) { + return true; + } + if (Array.isArray(children)) { + return children.some((c) => childrenIsObservable(c)); + } + return false; +} +function setOrRemoveAttribute(element, key, value) { + if (value === null || value === void 0) { + element.removeAttribute(camelCaseToHyphenCase(key)); + } else { + element.setAttribute(camelCaseToHyphenCase(key), String(value)); + } +} +function isObservable(obj) { + return !!obj && obj.read !== void 0 && obj.reportChanges !== void 0; +} +var registerWindow, getWindow, getDocument, getWindows, getWindowsCount, getWindowId, getWindowById, hasWindow, onDidRegisterWindow, onWillUnregisterWindow, onDidUnregisterWindow, DomListener, addStandardDisposableListener, addStandardDisposableGenericMouseDownListener, WindowIdleValue, runAtThisOrScheduleAtNextAnimationFrame, scheduleAtNextAnimationFrame, WindowIntervalTimer, AnimationFrameQueueItem, SizeUtils, Dimension, sharedMutationObserver, EventType, EventHelper, FocusTracker, SELECTOR_REGEX, Namespace, ModifierKeyEmitter, DragAndDropObserver, H_REGEX, n, ObserverNode, LiveElement, ObserverNodeWithElement; +var init_dom = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/browser/dom.js"() { + init_browser(); + init_canIUse(); + init_keyboardEvent(); + init_mouseEvent(); + init_async(); + init_errors(); + init_event(); + init_lifecycle(); + init_network(); + init_platform(); + init_hash(); + init_window(); + init_observable(); + ({ registerWindow, getWindow, getDocument, getWindows, getWindowsCount, getWindowId, getWindowById, hasWindow, onDidRegisterWindow, onWillUnregisterWindow, onDidUnregisterWindow } = (function() { + const windows = /* @__PURE__ */ new Map(); + ensureCodeWindow(mainWindow, 1); + const mainWindowRegistration = { window: mainWindow, disposables: new DisposableStore() }; + windows.set(mainWindow.vscodeWindowId, mainWindowRegistration); + const onDidRegisterWindow2 = new Emitter(); + const onDidUnregisterWindow2 = new Emitter(); + const onWillUnregisterWindow2 = new Emitter(); + function getWindowById2(windowId, fallbackToMain) { + const window2 = typeof windowId === "number" ? windows.get(windowId) : void 0; + return window2 ?? (fallbackToMain ? mainWindowRegistration : void 0); + } + return { + onDidRegisterWindow: onDidRegisterWindow2.event, + onWillUnregisterWindow: onWillUnregisterWindow2.event, + onDidUnregisterWindow: onDidUnregisterWindow2.event, + registerWindow(window2) { + if (windows.has(window2.vscodeWindowId)) { + return Disposable.None; + } + const disposables = new DisposableStore(); + const registeredWindow = { + window: window2, + disposables: disposables.add(new DisposableStore()) + }; + windows.set(window2.vscodeWindowId, registeredWindow); + disposables.add(toDisposable(() => { + windows.delete(window2.vscodeWindowId); + onDidUnregisterWindow2.fire(window2); + })); + disposables.add(addDisposableListener(window2, EventType.BEFORE_UNLOAD, () => { + onWillUnregisterWindow2.fire(window2); + })); + onDidRegisterWindow2.fire(registeredWindow); + return disposables; + }, + getWindows() { + return windows.values(); + }, + getWindowsCount() { + return windows.size; + }, + getWindowId(targetWindow) { + return targetWindow.vscodeWindowId; + }, + hasWindow(windowId) { + return windows.has(windowId); + }, + getWindowById: getWindowById2, + getWindow(e) { + const candidateNode = e; + if (candidateNode?.ownerDocument?.defaultView) { + return candidateNode.ownerDocument.defaultView.window; + } + const candidateEvent = e; + if (candidateEvent?.view) { + return candidateEvent.view.window; + } + return mainWindow; + }, + getDocument(e) { + const candidateNode = e; + return getWindow(candidateNode).document; + } + }; + })()); + DomListener = class { + constructor(node, type, handler, options2) { + this._node = node; + this._type = type; + this._handler = handler; + this._options = options2 || false; + this._node.addEventListener(this._type, this._handler, this._options); + } + dispose() { + if (!this._handler) { + return; + } + this._node.removeEventListener(this._type, this._handler, this._options); + this._node = null; + this._handler = null; + } + }; + addStandardDisposableListener = function addStandardDisposableListener2(node, type, handler, useCapture) { + let wrapHandler = handler; + if (type === "click" || type === "mousedown" || type === "contextmenu") { + wrapHandler = _wrapAsStandardMouseEvent(getWindow(node), handler); + } else if (type === "keydown" || type === "keypress" || type === "keyup") { + wrapHandler = _wrapAsStandardKeyboardEvent(handler); + } + return addDisposableListener(node, type, wrapHandler, useCapture); + }; + addStandardDisposableGenericMouseDownListener = function addStandardDisposableListener3(node, handler, useCapture) { + const wrapHandler = _wrapAsStandardMouseEvent(getWindow(node), handler); + return addDisposableGenericMouseDownListener(node, wrapHandler, useCapture); + }; + WindowIdleValue = class extends AbstractIdleValue { + constructor(targetWindow, executor) { + super(targetWindow, executor); + } + }; + WindowIntervalTimer = class extends IntervalTimer { + /** + * + * @param node The optional node from which the target window is determined + */ + constructor(node) { + super(); + this.defaultTarget = node && getWindow(node); + } + cancelAndSet(runner, interval, targetWindow) { + return super.cancelAndSet(runner, interval, targetWindow ?? this.defaultTarget); + } + }; + AnimationFrameQueueItem = class { + constructor(runner, priority = 0) { + this._runner = runner; + this.priority = priority; + this._canceled = false; + } + dispose() { + this._canceled = true; + } + execute() { + if (this._canceled) { + return; + } + try { + this._runner(); + } catch (e) { + onUnexpectedError(e); + } + } + // Sort by priority (largest to lowest) + static sort(a, b) { + return b.priority - a.priority; + } + }; + (function() { + const NEXT_QUEUE = /* @__PURE__ */ new Map(); + const CURRENT_QUEUE = /* @__PURE__ */ new Map(); + const animFrameRequested = /* @__PURE__ */ new Map(); + const inAnimationFrameRunner = /* @__PURE__ */ new Map(); + const animationFrameRunner = (targetWindowId) => { + animFrameRequested.set(targetWindowId, false); + const currentQueue = NEXT_QUEUE.get(targetWindowId) ?? []; + CURRENT_QUEUE.set(targetWindowId, currentQueue); + NEXT_QUEUE.set(targetWindowId, []); + inAnimationFrameRunner.set(targetWindowId, true); + while (currentQueue.length > 0) { + currentQueue.sort(AnimationFrameQueueItem.sort); + const top = currentQueue.shift(); + top.execute(); + } + inAnimationFrameRunner.set(targetWindowId, false); + }; + scheduleAtNextAnimationFrame = (targetWindow, runner, priority = 0) => { + const targetWindowId = getWindowId(targetWindow); + const item = new AnimationFrameQueueItem(runner, priority); + let nextQueue = NEXT_QUEUE.get(targetWindowId); + if (!nextQueue) { + nextQueue = []; + NEXT_QUEUE.set(targetWindowId, nextQueue); + } + nextQueue.push(item); + if (!animFrameRequested.get(targetWindowId)) { + animFrameRequested.set(targetWindowId, true); + targetWindow.requestAnimationFrame(() => animationFrameRunner(targetWindowId)); + } + return item; + }; + runAtThisOrScheduleAtNextAnimationFrame = (targetWindow, runner, priority) => { + const targetWindowId = getWindowId(targetWindow); + if (inAnimationFrameRunner.get(targetWindowId)) { + const item = new AnimationFrameQueueItem(runner, priority); + let currentQueue = CURRENT_QUEUE.get(targetWindowId); + if (!currentQueue) { + currentQueue = []; + CURRENT_QUEUE.set(targetWindowId, currentQueue); + } + currentQueue.push(item); + return item; + } else { + return scheduleAtNextAnimationFrame(targetWindow, runner, priority); + } + }; + })(); + SizeUtils = class _SizeUtils { + // Adapted from WinJS + // Converts a CSS positioning string for the specified element to pixels. + static convertToPixels(element, value) { + return parseFloat(value) || 0; + } + static getDimension(element, cssPropertyName) { + const computedStyle = getComputedStyle(element); + const value = computedStyle ? computedStyle.getPropertyValue(cssPropertyName) : "0"; + return _SizeUtils.convertToPixels(element, value); + } + static getBorderLeftWidth(element) { + return _SizeUtils.getDimension(element, "border-left-width"); + } + static getBorderRightWidth(element) { + return _SizeUtils.getDimension(element, "border-right-width"); + } + static getBorderTopWidth(element) { + return _SizeUtils.getDimension(element, "border-top-width"); + } + static getBorderBottomWidth(element) { + return _SizeUtils.getDimension(element, "border-bottom-width"); + } + static getPaddingLeft(element) { + return _SizeUtils.getDimension(element, "padding-left"); + } + static getPaddingRight(element) { + return _SizeUtils.getDimension(element, "padding-right"); + } + static getPaddingTop(element) { + return _SizeUtils.getDimension(element, "padding-top"); + } + static getPaddingBottom(element) { + return _SizeUtils.getDimension(element, "padding-bottom"); + } + static getMarginLeft(element) { + return _SizeUtils.getDimension(element, "margin-left"); + } + static getMarginTop(element) { + return _SizeUtils.getDimension(element, "margin-top"); + } + static getMarginRight(element) { + return _SizeUtils.getDimension(element, "margin-right"); + } + static getMarginBottom(element) { + return _SizeUtils.getDimension(element, "margin-bottom"); + } + }; + Dimension = class _Dimension { + static { + this.None = new _Dimension(0, 0); + } + constructor(width2, height) { + this.width = width2; + this.height = height; + } + with(width2 = this.width, height = this.height) { + if (width2 !== this.width || height !== this.height) { + return new _Dimension(width2, height); + } else { + return this; + } + } + static is(obj) { + return typeof obj === "object" && typeof obj.height === "number" && typeof obj.width === "number"; + } + static lift(obj) { + if (obj instanceof _Dimension) { + return obj; + } else { + return new _Dimension(obj.width, obj.height); + } + } + static equals(a, b) { + if (a === b) { + return true; + } + if (!a || !b) { + return false; + } + return a.width === b.width && a.height === b.height; + } + }; + sharedMutationObserver = new class { + constructor() { + this.mutationObservers = /* @__PURE__ */ new Map(); + } + observe(target, disposables, options2) { + let mutationObserversPerTarget = this.mutationObservers.get(target); + if (!mutationObserversPerTarget) { + mutationObserversPerTarget = /* @__PURE__ */ new Map(); + this.mutationObservers.set(target, mutationObserversPerTarget); + } + const optionsHash = hash(options2); + let mutationObserverPerOptions = mutationObserversPerTarget.get(optionsHash); + if (!mutationObserverPerOptions) { + const onDidMutate = new Emitter(); + const observer = new MutationObserver((mutations) => onDidMutate.fire(mutations)); + observer.observe(target, options2); + const resolvedMutationObserverPerOptions = mutationObserverPerOptions = { + users: 1, + observer, + onDidMutate: onDidMutate.event + }; + disposables.add(toDisposable(() => { + resolvedMutationObserverPerOptions.users -= 1; + if (resolvedMutationObserverPerOptions.users === 0) { + onDidMutate.dispose(); + observer.disconnect(); + mutationObserversPerTarget?.delete(optionsHash); + if (mutationObserversPerTarget?.size === 0) { + this.mutationObservers.delete(target); + } + } + })); + mutationObserversPerTarget.set(optionsHash, mutationObserverPerOptions); + } else { + mutationObserverPerOptions.users += 1; + } + return mutationObserverPerOptions.onDidMutate; + } + }(); + EventType = { + // Mouse + CLICK: "click", + AUXCLICK: "auxclick", + DBLCLICK: "dblclick", + MOUSE_UP: "mouseup", + MOUSE_DOWN: "mousedown", + MOUSE_OVER: "mouseover", + MOUSE_MOVE: "mousemove", + MOUSE_OUT: "mouseout", + MOUSE_ENTER: "mouseenter", + MOUSE_LEAVE: "mouseleave", + MOUSE_WHEEL: "wheel", + POINTER_UP: "pointerup", + POINTER_DOWN: "pointerdown", + POINTER_MOVE: "pointermove", + POINTER_LEAVE: "pointerleave", + CONTEXT_MENU: "contextmenu", + WHEEL: "wheel", + // Keyboard + KEY_DOWN: "keydown", + KEY_PRESS: "keypress", + KEY_UP: "keyup", + // HTML Document + LOAD: "load", + BEFORE_UNLOAD: "beforeunload", + UNLOAD: "unload", + PAGE_SHOW: "pageshow", + PAGE_HIDE: "pagehide", + PASTE: "paste", + ABORT: "abort", + ERROR: "error", + RESIZE: "resize", + SCROLL: "scroll", + FULLSCREEN_CHANGE: "fullscreenchange", + WK_FULLSCREEN_CHANGE: "webkitfullscreenchange", + // Form + SELECT: "select", + CHANGE: "change", + SUBMIT: "submit", + RESET: "reset", + FOCUS: "focus", + FOCUS_IN: "focusin", + FOCUS_OUT: "focusout", + BLUR: "blur", + INPUT: "input", + // Local Storage + STORAGE: "storage", + // Drag + DRAG_START: "dragstart", + DRAG: "drag", + DRAG_ENTER: "dragenter", + DRAG_LEAVE: "dragleave", + DRAG_OVER: "dragover", + DROP: "drop", + DRAG_END: "dragend", + // Animation + ANIMATION_START: isWebKit ? "webkitAnimationStart" : "animationstart", + ANIMATION_END: isWebKit ? "webkitAnimationEnd" : "animationend", + ANIMATION_ITERATION: isWebKit ? "webkitAnimationIteration" : "animationiteration" + }; + EventHelper = { + stop: (e, cancelBubble) => { + e.preventDefault(); + if (cancelBubble) { + e.stopPropagation(); + } + return e; + } + }; + FocusTracker = class _FocusTracker extends Disposable { + get onDidFocus() { + return this._onDidFocus.event; + } + get onDidBlur() { + return this._onDidBlur.event; + } + static hasFocusWithin(element) { + if (isHTMLElement(element)) { + const shadowRoot = getShadowRoot(element); + const activeElement = shadowRoot ? shadowRoot.activeElement : element.ownerDocument.activeElement; + return isAncestor(activeElement, element); + } else { + const window2 = element; + return isAncestor(window2.document.activeElement, window2.document); + } + } + constructor(element) { + super(); + this._onDidFocus = this._register(new Emitter()); + this._onDidBlur = this._register(new Emitter()); + let hasFocus = _FocusTracker.hasFocusWithin(element); + let loosingFocus = false; + const onFocus = () => { + loosingFocus = false; + if (!hasFocus) { + hasFocus = true; + this._onDidFocus.fire(); + } + }; + const onBlur = () => { + if (hasFocus) { + loosingFocus = true; + (isHTMLElement(element) ? getWindow(element) : element).setTimeout(() => { + if (loosingFocus) { + loosingFocus = false; + hasFocus = false; + this._onDidBlur.fire(); + } + }, 0); + } + }; + this._refreshStateHandler = () => { + const currentNodeHasFocus = _FocusTracker.hasFocusWithin(element); + if (currentNodeHasFocus !== hasFocus) { + if (hasFocus) { + onBlur(); + } else { + onFocus(); + } + } + }; + this._register(addDisposableListener(element, EventType.FOCUS, onFocus, true)); + this._register(addDisposableListener(element, EventType.BLUR, onBlur, true)); + if (isHTMLElement(element)) { + this._register(addDisposableListener(element, EventType.FOCUS_IN, () => this._refreshStateHandler())); + this._register(addDisposableListener(element, EventType.FOCUS_OUT, () => this._refreshStateHandler())); + } + } + }; + SELECTOR_REGEX = /([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/; + (function(Namespace2) { + Namespace2["HTML"] = "http://www.w3.org/1999/xhtml"; + Namespace2["SVG"] = "http://www.w3.org/2000/svg"; + })(Namespace || (Namespace = {})); + $.SVG = function(description, attrs, ...children) { + return _$(Namespace.SVG, description, attrs, ...children); + }; + RemoteAuthorities.setPreferredWebSchema(/^https:/.test(mainWindow.location.href) ? "https" : "http"); + ModifierKeyEmitter = class _ModifierKeyEmitter extends Emitter { + constructor() { + super(); + this._subscriptions = new DisposableStore(); + this._keyStatus = { + altKey: false, + shiftKey: false, + ctrlKey: false, + metaKey: false + }; + this._subscriptions.add(Event.runAndSubscribe(onDidRegisterWindow, ({ window: window2, disposables }) => this.registerListeners(window2, disposables), { window: mainWindow, disposables: this._subscriptions })); + } + registerListeners(window2, disposables) { + disposables.add(addDisposableListener(window2, "keydown", (e) => { + if (e.defaultPrevented) { + return; + } + const event = new StandardKeyboardEvent(e); + if (event.keyCode === 6 && e.repeat) { + return; + } + if (e.altKey && !this._keyStatus.altKey) { + this._keyStatus.lastKeyPressed = "alt"; + } else if (e.ctrlKey && !this._keyStatus.ctrlKey) { + this._keyStatus.lastKeyPressed = "ctrl"; + } else if (e.metaKey && !this._keyStatus.metaKey) { + this._keyStatus.lastKeyPressed = "meta"; + } else if (e.shiftKey && !this._keyStatus.shiftKey) { + this._keyStatus.lastKeyPressed = "shift"; + } else if (event.keyCode !== 6) { + this._keyStatus.lastKeyPressed = void 0; + } else { + return; + } + this._keyStatus.altKey = e.altKey; + this._keyStatus.ctrlKey = e.ctrlKey; + this._keyStatus.metaKey = e.metaKey; + this._keyStatus.shiftKey = e.shiftKey; + if (this._keyStatus.lastKeyPressed) { + this._keyStatus.event = e; + this.fire(this._keyStatus); + } + }, true)); + disposables.add(addDisposableListener(window2, "keyup", (e) => { + if (e.defaultPrevented) { + return; + } + if (!e.altKey && this._keyStatus.altKey) { + this._keyStatus.lastKeyReleased = "alt"; + } else if (!e.ctrlKey && this._keyStatus.ctrlKey) { + this._keyStatus.lastKeyReleased = "ctrl"; + } else if (!e.metaKey && this._keyStatus.metaKey) { + this._keyStatus.lastKeyReleased = "meta"; + } else if (!e.shiftKey && this._keyStatus.shiftKey) { + this._keyStatus.lastKeyReleased = "shift"; + } else { + this._keyStatus.lastKeyReleased = void 0; + } + if (this._keyStatus.lastKeyPressed !== this._keyStatus.lastKeyReleased) { + this._keyStatus.lastKeyPressed = void 0; + } + this._keyStatus.altKey = e.altKey; + this._keyStatus.ctrlKey = e.ctrlKey; + this._keyStatus.metaKey = e.metaKey; + this._keyStatus.shiftKey = e.shiftKey; + if (this._keyStatus.lastKeyReleased) { + this._keyStatus.event = e; + this.fire(this._keyStatus); + } + }, true)); + disposables.add(addDisposableListener(window2.document.body, "mousedown", () => { + this._keyStatus.lastKeyPressed = void 0; + }, true)); + disposables.add(addDisposableListener(window2.document.body, "mouseup", () => { + this._keyStatus.lastKeyPressed = void 0; + }, true)); + disposables.add(addDisposableListener(window2.document.body, "mousemove", (e) => { + if (e.buttons) { + this._keyStatus.lastKeyPressed = void 0; + } + }, true)); + disposables.add(addDisposableListener(window2, "blur", () => { + this.resetKeyStatus(); + })); + } + get keyStatus() { + return this._keyStatus; + } + /** + * Allows to explicitly reset the key status based on more knowledge (#109062) + */ + resetKeyStatus() { + this.doResetKeyStatus(); + this.fire(this._keyStatus); + } + doResetKeyStatus() { + this._keyStatus = { + altKey: false, + shiftKey: false, + ctrlKey: false, + metaKey: false + }; + } + static getInstance() { + if (!_ModifierKeyEmitter.instance) { + _ModifierKeyEmitter.instance = new _ModifierKeyEmitter(); + } + return _ModifierKeyEmitter.instance; + } + dispose() { + super.dispose(); + this._subscriptions.dispose(); + } + }; + DragAndDropObserver = class extends Disposable { + constructor(element, callbacks) { + super(); + this.element = element; + this.callbacks = callbacks; + this.counter = 0; + this.dragStartTime = 0; + this.registerListeners(); + } + registerListeners() { + if (this.callbacks.onDragStart) { + this._register(addDisposableListener(this.element, EventType.DRAG_START, (e) => { + this.callbacks.onDragStart?.(e); + })); + } + if (this.callbacks.onDrag) { + this._register(addDisposableListener(this.element, EventType.DRAG, (e) => { + this.callbacks.onDrag?.(e); + })); + } + this._register(addDisposableListener(this.element, EventType.DRAG_ENTER, (e) => { + this.counter++; + this.dragStartTime = e.timeStamp; + this.callbacks.onDragEnter?.(e); + })); + this._register(addDisposableListener(this.element, EventType.DRAG_OVER, (e) => { + e.preventDefault(); + this.callbacks.onDragOver?.(e, e.timeStamp - this.dragStartTime); + })); + this._register(addDisposableListener(this.element, EventType.DRAG_LEAVE, (e) => { + this.counter--; + if (this.counter === 0) { + this.dragStartTime = 0; + this.callbacks.onDragLeave?.(e); + } + })); + this._register(addDisposableListener(this.element, EventType.DRAG_END, (e) => { + this.counter = 0; + this.dragStartTime = 0; + this.callbacks.onDragEnd?.(e); + })); + this._register(addDisposableListener(this.element, EventType.DROP, (e) => { + this.counter = 0; + this.dragStartTime = 0; + this.callbacks.onDrop?.(e); + })); + } + }; + H_REGEX = /(?[\w\-]+)?(?:#(?[\w\-]+))?(?(?:\.(?:[\w\-]+))*)(?:@(?(?:[\w\_])+))?/; + (function(n2) { + function nodeNs(elementNs = void 0) { + return (tag2, attributes, children) => { + const className2 = attributes.class; + delete attributes.class; + const ref2 = attributes.ref; + delete attributes.ref; + const obsRef = attributes.obsRef; + delete attributes.obsRef; + return new ObserverNodeWithElement(tag2, ref2, obsRef, elementNs, className2, attributes, children); + }; + } + function node(tag2, elementNs = void 0) { + const f = nodeNs(elementNs); + return (attributes, children) => { + return f(tag2, attributes, children); + }; + } + n2.div = node("div"); + n2.elem = nodeNs(void 0); + n2.svg = node("svg", "http://www.w3.org/2000/svg"); + n2.svgElem = nodeNs("http://www.w3.org/2000/svg"); + function ref() { + let value = void 0; + const result = function(val) { + value = val; + }; + Object.defineProperty(result, "element", { + get() { + if (!value) { + throw new BugIndicatingError("Make sure the ref is set before accessing the element. Maybe wrong initialization order?"); + } + return value; + } + }); + return result; + } + n2.ref = ref; + })(n || (n = {})); + ObserverNode = class _ObserverNode { + constructor(tag2, ref, obsRef, ns, className2, attributes, children) { + this._deriveds = []; + this._element = ns ? document.createElementNS(ns, tag2) : document.createElement(tag2); + if (ref) { + ref(this._element); + } + if (obsRef) { + this._deriveds.push(derived((_reader) => { + obsRef(this); + _reader.store.add({ + dispose: () => { + obsRef(null); + } + }); + })); + } + if (className2) { + if (hasObservable(className2)) { + this._deriveds.push(derived(this, (reader) => { + setClassName(this._element, getClassName2(className2, reader)); + })); + } else { + setClassName(this._element, getClassName2(className2, void 0)); + } + } + for (const [key, value] of Object.entries(attributes)) { + if (key === "style") { + for (const [cssKey, cssValue] of Object.entries(value)) { + const key2 = camelCaseToHyphenCase(cssKey); + if (isObservable(cssValue)) { + this._deriveds.push(derivedOpts({ owner: this, debugName: () => `set.style.${key2}` }, (reader) => { + this._element.style.setProperty(key2, convertCssValue(cssValue.read(reader))); + })); + } else { + this._element.style.setProperty(key2, convertCssValue(cssValue)); + } + } + } else if (key === "tabIndex") { + if (isObservable(value)) { + this._deriveds.push(derived(this, (reader) => { + this._element.tabIndex = value.read(reader); + })); + } else { + this._element.tabIndex = value; + } + } else if (key.startsWith("on")) { + this._element[key] = value; + } else { + if (isObservable(value)) { + this._deriveds.push(derivedOpts({ owner: this, debugName: () => `set.${key}` }, (reader) => { + setOrRemoveAttribute(this._element, key, value.read(reader)); + })); + } else { + setOrRemoveAttribute(this._element, key, value); + } + } + } + if (children) { + let getChildren = function(reader, children2) { + if (isObservable(children2)) { + return getChildren(reader, children2.read(reader)); + } + if (Array.isArray(children2)) { + return children2.flatMap((c) => getChildren(reader, c)); + } + if (children2 instanceof _ObserverNode) { + if (reader) { + children2.readEffect(reader); + } + return [children2._element]; + } + if (children2) { + return [children2]; + } + return []; + }; + const d = derived(this, (reader) => { + this._element.replaceChildren(...getChildren(reader, children)); + }); + this._deriveds.push(d); + if (!childrenIsObservable(children)) { + d.get(); + } + } + } + readEffect(reader) { + for (const d of this._deriveds) { + d.read(reader); + } + } + keepUpdated(store) { + derived((reader) => { + this.readEffect(reader); + }).recomputeInitiallyAndOnChange(store); + return this; + } + /** + * Creates a live element that will keep the element updated as long as the returned object is not disposed. + */ + toDisposableLiveElement() { + const store = new DisposableStore(); + this.keepUpdated(store); + return new LiveElement(this._element, store); + } + }; + LiveElement = class { + constructor(element, _disposable) { + this.element = element; + this._disposable = _disposable; + } + dispose() { + this._disposable.dispose(); + } + }; + ObserverNodeWithElement = class extends ObserverNode { + constructor() { + super(...arguments); + this._isHovered = void 0; + this._didMouseMoveDuringHover = void 0; + } + get element() { + return this._element; + } + get isHovered() { + if (!this._isHovered) { + const hovered = observableValue("hovered", false); + this._element.addEventListener("mouseenter", (_e) => hovered.set(true, void 0)); + this._element.addEventListener("mouseleave", (_e) => hovered.set(false, void 0)); + this._isHovered = hovered; + } + return this._isHovered; + } + get didMouseMoveDuringHover() { + if (!this._didMouseMoveDuringHover) { + let _hovering = false; + const hovered = observableValue("didMouseMoveDuringHover", false); + this._element.addEventListener("mouseenter", (_e) => { + _hovering = true; + }); + this._element.addEventListener("mousemove", (_e) => { + if (_hovering) { + hovered.set(true, void 0); + } + }); + this._element.addEventListener("mouseleave", (_e) => { + _hovering = false; + hovered.set(false, void 0); + }); + this._didMouseMoveDuringHover = hovered; + } + return this._didMouseMoveDuringHover; + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/platform/instantiation/common/instantiation.js +function storeServiceDependency(id, target, index) { + if (target[_util.DI_TARGET] === target) { + target[_util.DI_DEPENDENCIES].push({ id, index }); + } else { + target[_util.DI_DEPENDENCIES] = [{ id, index }]; + target[_util.DI_TARGET] = target; + } +} +function createDecorator(serviceId) { + if (_util.serviceIds.has(serviceId)) { + return _util.serviceIds.get(serviceId); + } + const id = function(target, key, index) { + if (arguments.length !== 3) { + throw new Error("@IServiceName-decorator can only be used to decorate a parameter"); + } + storeServiceDependency(id, target, index); + }; + id.toString = () => serviceId; + _util.serviceIds.set(serviceId, id); + return id; +} +var _util, IInstantiationService; +var init_instantiation = __esm({ + "node_modules/monaco-editor-core/esm/vs/platform/instantiation/common/instantiation.js"() { + (function(_util2) { + _util2.serviceIds = /* @__PURE__ */ new Map(); + _util2.DI_TARGET = "$di$target"; + _util2.DI_DEPENDENCIES = "$di$dependencies"; + function getServiceDependencies(ctor) { + return ctor[_util2.DI_DEPENDENCIES] || []; + } + _util2.getServiceDependencies = getServiceDependencies; + })(_util || (_util = {})); + IInstantiationService = createDecorator("instantiationService"); + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/browser/services/codeEditorService.js +var ICodeEditorService; +var init_codeEditorService = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/browser/services/codeEditorService.js"() { + init_instantiation(); + ICodeEditorService = createDecorator("codeEditorService"); + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/common/core/position.js +var Position; +var init_position = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/common/core/position.js"() { + Position = class _Position { + constructor(lineNumber, column) { + this.lineNumber = lineNumber; + this.column = column; + } + /** + * Create a new position from this position. + * + * @param newLineNumber new line number + * @param newColumn new column + */ + with(newLineNumber = this.lineNumber, newColumn = this.column) { + if (newLineNumber === this.lineNumber && newColumn === this.column) { + return this; + } else { + return new _Position(newLineNumber, newColumn); + } + } + /** + * Derive a new position from this position. + * + * @param deltaLineNumber line number delta + * @param deltaColumn column delta + */ + delta(deltaLineNumber = 0, deltaColumn = 0) { + return this.with(Math.max(1, this.lineNumber + deltaLineNumber), Math.max(1, this.column + deltaColumn)); + } + /** + * Test if this position equals other position + */ + equals(other) { + return _Position.equals(this, other); + } + /** + * Test if position `a` equals position `b` + */ + static equals(a, b) { + if (!a && !b) { + return true; + } + return !!a && !!b && a.lineNumber === b.lineNumber && a.column === b.column; + } + /** + * Test if this position is before other position. + * If the two positions are equal, the result will be false. + */ + isBefore(other) { + return _Position.isBefore(this, other); + } + /** + * Test if position `a` is before position `b`. + * If the two positions are equal, the result will be false. + */ + static isBefore(a, b) { + if (a.lineNumber < b.lineNumber) { + return true; + } + if (b.lineNumber < a.lineNumber) { + return false; + } + return a.column < b.column; + } + /** + * Test if this position is before other position. + * If the two positions are equal, the result will be true. + */ + isBeforeOrEqual(other) { + return _Position.isBeforeOrEqual(this, other); + } + /** + * Test if position `a` is before position `b`. + * If the two positions are equal, the result will be true. + */ + static isBeforeOrEqual(a, b) { + if (a.lineNumber < b.lineNumber) { + return true; + } + if (b.lineNumber < a.lineNumber) { + return false; + } + return a.column <= b.column; + } + /** + * A function that compares positions, useful for sorting + */ + static compare(a, b) { + const aLineNumber = a.lineNumber | 0; + const bLineNumber = b.lineNumber | 0; + if (aLineNumber === bLineNumber) { + const aColumn = a.column | 0; + const bColumn = b.column | 0; + return aColumn - bColumn; + } + return aLineNumber - bLineNumber; + } + /** + * Clone this position. + */ + clone() { + return new _Position(this.lineNumber, this.column); + } + /** + * Convert to a human-readable representation. + */ + toString() { + return "(" + this.lineNumber + "," + this.column + ")"; + } + // --- + /** + * Create a `Position` from an `IPosition`. + */ + static lift(pos) { + return new _Position(pos.lineNumber, pos.column); + } + /** + * Test if `obj` is an `IPosition`. + */ + static isIPosition(obj) { + return !!obj && typeof obj.lineNumber === "number" && typeof obj.column === "number"; + } + toJSON() { + return { + lineNumber: this.lineNumber, + column: this.column + }; + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/common/services/model.js +var IModelService; +var init_model = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/common/services/model.js"() { + init_instantiation(); + IModelService = createDecorator("modelService"); + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/common/services/resolverService.js +var ITextModelService; +var init_resolverService = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/common/services/resolverService.js"() { + init_instantiation(); + ITextModelService = createDecorator("textModelService"); + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/common/actions.js +function toAction(props) { + return { + id: props.id, + label: props.label, + tooltip: props.tooltip ?? props.label, + class: props.class, + enabled: props.enabled ?? true, + checked: props.checked, + run: async (...args) => props.run(...args) + }; +} +var Action, ActionRunner, Separator, SubmenuAction, EmptySubmenuAction; +var init_actions = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/common/actions.js"() { + init_event(); + init_lifecycle(); + init_nls(); + Action = class extends Disposable { + get onDidChange() { + return this._onDidChange.event; + } + constructor(id, label = "", cssClass = "", enabled = true, actionCallback) { + super(); + this._onDidChange = this._register(new Emitter()); + this._enabled = true; + this._id = id; + this._label = label; + this._cssClass = cssClass; + this._enabled = enabled; + this._actionCallback = actionCallback; + } + get id() { + return this._id; + } + get label() { + return this._label; + } + set label(value) { + this._setLabel(value); + } + _setLabel(value) { + if (this._label !== value) { + this._label = value; + this._onDidChange.fire({ label: value }); + } + } + get tooltip() { + return this._tooltip || ""; + } + set tooltip(value) { + this._setTooltip(value); + } + _setTooltip(value) { + if (this._tooltip !== value) { + this._tooltip = value; + this._onDidChange.fire({ tooltip: value }); + } + } + get class() { + return this._cssClass; + } + set class(value) { + this._setClass(value); + } + _setClass(value) { + if (this._cssClass !== value) { + this._cssClass = value; + this._onDidChange.fire({ class: value }); + } + } + get enabled() { + return this._enabled; + } + set enabled(value) { + this._setEnabled(value); + } + _setEnabled(value) { + if (this._enabled !== value) { + this._enabled = value; + this._onDidChange.fire({ enabled: value }); + } + } + get checked() { + return this._checked; + } + set checked(value) { + this._setChecked(value); + } + _setChecked(value) { + if (this._checked !== value) { + this._checked = value; + this._onDidChange.fire({ checked: value }); + } + } + async run(event, data) { + if (this._actionCallback) { + await this._actionCallback(event); + } + } + }; + ActionRunner = class extends Disposable { + constructor() { + super(...arguments); + this._onWillRun = this._register(new Emitter()); + this._onDidRun = this._register(new Emitter()); + } + get onWillRun() { + return this._onWillRun.event; + } + get onDidRun() { + return this._onDidRun.event; + } + async run(action, context) { + if (!action.enabled) { + return; + } + this._onWillRun.fire({ action }); + let error = void 0; + try { + await this.runAction(action, context); + } catch (e) { + error = e; + } + this._onDidRun.fire({ action, error }); + } + async runAction(action, context) { + await action.run(context); + } + }; + Separator = class _Separator { + constructor() { + this.id = _Separator.ID; + this.label = ""; + this.tooltip = ""; + this.class = "separator"; + this.enabled = false; + this.checked = false; + } + /** + * Joins all non-empty lists of actions with separators. + */ + static join(...actionLists) { + let out = []; + for (const list2 of actionLists) { + if (!list2.length) { + } else if (out.length) { + out = [...out, new _Separator(), ...list2]; + } else { + out = list2; + } + } + return out; + } + static { + this.ID = "vs.actions.separator"; + } + async run() { + } + }; + SubmenuAction = class { + get actions() { + return this._actions; + } + constructor(id, label, actions, cssClass) { + this.tooltip = ""; + this.enabled = true; + this.checked = void 0; + this.id = id; + this.label = label; + this.class = cssClass; + this._actions = actions; + } + async run() { + } + }; + EmptySubmenuAction = class _EmptySubmenuAction extends Action { + static { + this.ID = "vs.actions.empty"; + } + constructor() { + super(_EmptySubmenuAction.ID, localize(28, "(empty)"), void 0, false); + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/common/codiconsUtil.js +function register(id, fontCharacter) { + if (isString(fontCharacter)) { + const val = _codiconFontCharacters[fontCharacter]; + if (val === void 0) { + throw new Error(`${id} references an unknown codicon: ${fontCharacter}`); + } + fontCharacter = val; + } + _codiconFontCharacters[id] = fontCharacter; + return { id }; +} +function getCodiconFontCharacters() { + return _codiconFontCharacters; +} +var _codiconFontCharacters; +var init_codiconsUtil = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/common/codiconsUtil.js"() { + init_types(); + _codiconFontCharacters = /* @__PURE__ */ Object.create(null); + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/common/codiconsLibrary.js +var codiconsLibrary; +var init_codiconsLibrary = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/common/codiconsLibrary.js"() { + init_codiconsUtil(); + codiconsLibrary = { + add: register("add", 6e4), + plus: register("plus", 6e4), + gistNew: register("gist-new", 6e4), + repoCreate: register("repo-create", 6e4), + lightbulb: register("lightbulb", 60001), + lightBulb: register("light-bulb", 60001), + repo: register("repo", 60002), + repoDelete: register("repo-delete", 60002), + gistFork: register("gist-fork", 60003), + repoForked: register("repo-forked", 60003), + gitPullRequest: register("git-pull-request", 60004), + gitPullRequestAbandoned: register("git-pull-request-abandoned", 60004), + recordKeys: register("record-keys", 60005), + keyboard: register("keyboard", 60005), + tag: register("tag", 60006), + gitPullRequestLabel: register("git-pull-request-label", 60006), + tagAdd: register("tag-add", 60006), + tagRemove: register("tag-remove", 60006), + person: register("person", 60007), + personFollow: register("person-follow", 60007), + personOutline: register("person-outline", 60007), + personFilled: register("person-filled", 60007), + sourceControl: register("source-control", 60008), + mirror: register("mirror", 60009), + mirrorPublic: register("mirror-public", 60009), + star: register("star", 60010), + starAdd: register("star-add", 60010), + starDelete: register("star-delete", 60010), + starEmpty: register("star-empty", 60010), + comment: register("comment", 60011), + commentAdd: register("comment-add", 60011), + alert: register("alert", 60012), + warning: register("warning", 60012), + search: register("search", 60013), + searchSave: register("search-save", 60013), + logOut: register("log-out", 60014), + signOut: register("sign-out", 60014), + logIn: register("log-in", 60015), + signIn: register("sign-in", 60015), + eye: register("eye", 60016), + eyeUnwatch: register("eye-unwatch", 60016), + eyeWatch: register("eye-watch", 60016), + circleFilled: register("circle-filled", 60017), + primitiveDot: register("primitive-dot", 60017), + closeDirty: register("close-dirty", 60017), + debugBreakpoint: register("debug-breakpoint", 60017), + debugBreakpointDisabled: register("debug-breakpoint-disabled", 60017), + debugHint: register("debug-hint", 60017), + terminalDecorationSuccess: register("terminal-decoration-success", 60017), + primitiveSquare: register("primitive-square", 60018), + edit: register("edit", 60019), + pencil: register("pencil", 60019), + info: register("info", 60020), + issueOpened: register("issue-opened", 60020), + gistPrivate: register("gist-private", 60021), + gitForkPrivate: register("git-fork-private", 60021), + lock: register("lock", 60021), + mirrorPrivate: register("mirror-private", 60021), + close: register("close", 60022), + removeClose: register("remove-close", 60022), + x: register("x", 60022), + repoSync: register("repo-sync", 60023), + sync: register("sync", 60023), + clone: register("clone", 60024), + desktopDownload: register("desktop-download", 60024), + beaker: register("beaker", 60025), + microscope: register("microscope", 60025), + vm: register("vm", 60026), + deviceDesktop: register("device-desktop", 60026), + file: register("file", 60027), + more: register("more", 60028), + ellipsis: register("ellipsis", 60028), + kebabHorizontal: register("kebab-horizontal", 60028), + mailReply: register("mail-reply", 60029), + reply: register("reply", 60029), + organization: register("organization", 60030), + organizationFilled: register("organization-filled", 60030), + organizationOutline: register("organization-outline", 60030), + newFile: register("new-file", 60031), + fileAdd: register("file-add", 60031), + newFolder: register("new-folder", 60032), + fileDirectoryCreate: register("file-directory-create", 60032), + trash: register("trash", 60033), + trashcan: register("trashcan", 60033), + history: register("history", 60034), + clock: register("clock", 60034), + folder: register("folder", 60035), + fileDirectory: register("file-directory", 60035), + symbolFolder: register("symbol-folder", 60035), + logoGithub: register("logo-github", 60036), + markGithub: register("mark-github", 60036), + github: register("github", 60036), + terminal: register("terminal", 60037), + console: register("console", 60037), + repl: register("repl", 60037), + zap: register("zap", 60038), + symbolEvent: register("symbol-event", 60038), + error: register("error", 60039), + stop: register("stop", 60039), + variable: register("variable", 60040), + symbolVariable: register("symbol-variable", 60040), + array: register("array", 60042), + symbolArray: register("symbol-array", 60042), + symbolModule: register("symbol-module", 60043), + symbolPackage: register("symbol-package", 60043), + symbolNamespace: register("symbol-namespace", 60043), + symbolObject: register("symbol-object", 60043), + symbolMethod: register("symbol-method", 60044), + symbolFunction: register("symbol-function", 60044), + symbolConstructor: register("symbol-constructor", 60044), + symbolBoolean: register("symbol-boolean", 60047), + symbolNull: register("symbol-null", 60047), + symbolNumeric: register("symbol-numeric", 60048), + symbolNumber: register("symbol-number", 60048), + symbolStructure: register("symbol-structure", 60049), + symbolStruct: register("symbol-struct", 60049), + symbolParameter: register("symbol-parameter", 60050), + symbolTypeParameter: register("symbol-type-parameter", 60050), + symbolKey: register("symbol-key", 60051), + symbolText: register("symbol-text", 60051), + symbolReference: register("symbol-reference", 60052), + goToFile: register("go-to-file", 60052), + symbolEnum: register("symbol-enum", 60053), + symbolValue: register("symbol-value", 60053), + symbolRuler: register("symbol-ruler", 60054), + symbolUnit: register("symbol-unit", 60054), + activateBreakpoints: register("activate-breakpoints", 60055), + archive: register("archive", 60056), + arrowBoth: register("arrow-both", 60057), + arrowDown: register("arrow-down", 60058), + arrowLeft: register("arrow-left", 60059), + arrowRight: register("arrow-right", 60060), + arrowSmallDown: register("arrow-small-down", 60061), + arrowSmallLeft: register("arrow-small-left", 60062), + arrowSmallRight: register("arrow-small-right", 60063), + arrowSmallUp: register("arrow-small-up", 60064), + arrowUp: register("arrow-up", 60065), + bell: register("bell", 60066), + bold: register("bold", 60067), + book: register("book", 60068), + bookmark: register("bookmark", 60069), + debugBreakpointConditionalUnverified: register("debug-breakpoint-conditional-unverified", 60070), + debugBreakpointConditional: register("debug-breakpoint-conditional", 60071), + debugBreakpointConditionalDisabled: register("debug-breakpoint-conditional-disabled", 60071), + debugBreakpointDataUnverified: register("debug-breakpoint-data-unverified", 60072), + debugBreakpointData: register("debug-breakpoint-data", 60073), + debugBreakpointDataDisabled: register("debug-breakpoint-data-disabled", 60073), + debugBreakpointLogUnverified: register("debug-breakpoint-log-unverified", 60074), + debugBreakpointLog: register("debug-breakpoint-log", 60075), + debugBreakpointLogDisabled: register("debug-breakpoint-log-disabled", 60075), + briefcase: register("briefcase", 60076), + broadcast: register("broadcast", 60077), + browser: register("browser", 60078), + bug: register("bug", 60079), + calendar: register("calendar", 60080), + caseSensitive: register("case-sensitive", 60081), + check: register("check", 60082), + checklist: register("checklist", 60083), + chevronDown: register("chevron-down", 60084), + chevronLeft: register("chevron-left", 60085), + chevronRight: register("chevron-right", 60086), + chevronUp: register("chevron-up", 60087), + chromeClose: register("chrome-close", 60088), + chromeMaximize: register("chrome-maximize", 60089), + chromeMinimize: register("chrome-minimize", 60090), + chromeRestore: register("chrome-restore", 60091), + circleOutline: register("circle-outline", 60092), + circle: register("circle", 60092), + debugBreakpointUnverified: register("debug-breakpoint-unverified", 60092), + terminalDecorationIncomplete: register("terminal-decoration-incomplete", 60092), + circleSlash: register("circle-slash", 60093), + circuitBoard: register("circuit-board", 60094), + clearAll: register("clear-all", 60095), + clippy: register("clippy", 60096), + closeAll: register("close-all", 60097), + cloudDownload: register("cloud-download", 60098), + cloudUpload: register("cloud-upload", 60099), + code: register("code", 60100), + collapseAll: register("collapse-all", 60101), + colorMode: register("color-mode", 60102), + commentDiscussion: register("comment-discussion", 60103), + creditCard: register("credit-card", 60105), + dash: register("dash", 60108), + dashboard: register("dashboard", 60109), + database: register("database", 60110), + debugContinue: register("debug-continue", 60111), + debugDisconnect: register("debug-disconnect", 60112), + debugPause: register("debug-pause", 60113), + debugRestart: register("debug-restart", 60114), + debugStart: register("debug-start", 60115), + debugStepInto: register("debug-step-into", 60116), + debugStepOut: register("debug-step-out", 60117), + debugStepOver: register("debug-step-over", 60118), + debugStop: register("debug-stop", 60119), + debug: register("debug", 60120), + deviceCameraVideo: register("device-camera-video", 60121), + deviceCamera: register("device-camera", 60122), + deviceMobile: register("device-mobile", 60123), + diffAdded: register("diff-added", 60124), + diffIgnored: register("diff-ignored", 60125), + diffModified: register("diff-modified", 60126), + diffRemoved: register("diff-removed", 60127), + diffRenamed: register("diff-renamed", 60128), + diff: register("diff", 60129), + diffSidebyside: register("diff-sidebyside", 60129), + discard: register("discard", 60130), + editorLayout: register("editor-layout", 60131), + emptyWindow: register("empty-window", 60132), + exclude: register("exclude", 60133), + extensions: register("extensions", 60134), + eyeClosed: register("eye-closed", 60135), + fileBinary: register("file-binary", 60136), + fileCode: register("file-code", 60137), + fileMedia: register("file-media", 60138), + filePdf: register("file-pdf", 60139), + fileSubmodule: register("file-submodule", 60140), + fileSymlinkDirectory: register("file-symlink-directory", 60141), + fileSymlinkFile: register("file-symlink-file", 60142), + fileZip: register("file-zip", 60143), + files: register("files", 60144), + filter: register("filter", 60145), + flame: register("flame", 60146), + foldDown: register("fold-down", 60147), + foldUp: register("fold-up", 60148), + fold: register("fold", 60149), + folderActive: register("folder-active", 60150), + folderOpened: register("folder-opened", 60151), + gear: register("gear", 60152), + gift: register("gift", 60153), + gistSecret: register("gist-secret", 60154), + gist: register("gist", 60155), + gitCommit: register("git-commit", 60156), + gitCompare: register("git-compare", 60157), + compareChanges: register("compare-changes", 60157), + gitMerge: register("git-merge", 60158), + githubAction: register("github-action", 60159), + githubAlt: register("github-alt", 60160), + globe: register("globe", 60161), + grabber: register("grabber", 60162), + graph: register("graph", 60163), + gripper: register("gripper", 60164), + heart: register("heart", 60165), + home: register("home", 60166), + horizontalRule: register("horizontal-rule", 60167), + hubot: register("hubot", 60168), + inbox: register("inbox", 60169), + issueReopened: register("issue-reopened", 60171), + issues: register("issues", 60172), + italic: register("italic", 60173), + jersey: register("jersey", 60174), + json: register("json", 60175), + kebabVertical: register("kebab-vertical", 60176), + key: register("key", 60177), + law: register("law", 60178), + lightbulbAutofix: register("lightbulb-autofix", 60179), + linkExternal: register("link-external", 60180), + link: register("link", 60181), + listOrdered: register("list-ordered", 60182), + listUnordered: register("list-unordered", 60183), + liveShare: register("live-share", 60184), + loading: register("loading", 60185), + location: register("location", 60186), + mailRead: register("mail-read", 60187), + mail: register("mail", 60188), + markdown: register("markdown", 60189), + megaphone: register("megaphone", 60190), + mention: register("mention", 60191), + milestone: register("milestone", 60192), + gitPullRequestMilestone: register("git-pull-request-milestone", 60192), + mortarBoard: register("mortar-board", 60193), + move: register("move", 60194), + multipleWindows: register("multiple-windows", 60195), + mute: register("mute", 60196), + noNewline: register("no-newline", 60197), + note: register("note", 60198), + octoface: register("octoface", 60199), + openPreview: register("open-preview", 60200), + package: register("package", 60201), + paintcan: register("paintcan", 60202), + pin: register("pin", 60203), + play: register("play", 60204), + run: register("run", 60204), + plug: register("plug", 60205), + preserveCase: register("preserve-case", 60206), + preview: register("preview", 60207), + project: register("project", 60208), + pulse: register("pulse", 60209), + question: register("question", 60210), + quote: register("quote", 60211), + radioTower: register("radio-tower", 60212), + reactions: register("reactions", 60213), + references: register("references", 60214), + refresh: register("refresh", 60215), + regex: register("regex", 60216), + remoteExplorer: register("remote-explorer", 60217), + remote: register("remote", 60218), + remove: register("remove", 60219), + replaceAll: register("replace-all", 60220), + replace: register("replace", 60221), + repoClone: register("repo-clone", 60222), + repoForcePush: register("repo-force-push", 60223), + repoPull: register("repo-pull", 60224), + repoPush: register("repo-push", 60225), + report: register("report", 60226), + requestChanges: register("request-changes", 60227), + rocket: register("rocket", 60228), + rootFolderOpened: register("root-folder-opened", 60229), + rootFolder: register("root-folder", 60230), + rss: register("rss", 60231), + ruby: register("ruby", 60232), + saveAll: register("save-all", 60233), + saveAs: register("save-as", 60234), + save: register("save", 60235), + screenFull: register("screen-full", 60236), + screenNormal: register("screen-normal", 60237), + searchStop: register("search-stop", 60238), + server: register("server", 60240), + settingsGear: register("settings-gear", 60241), + settings: register("settings", 60242), + shield: register("shield", 60243), + smiley: register("smiley", 60244), + sortPrecedence: register("sort-precedence", 60245), + splitHorizontal: register("split-horizontal", 60246), + splitVertical: register("split-vertical", 60247), + squirrel: register("squirrel", 60248), + starFull: register("star-full", 60249), + starHalf: register("star-half", 60250), + symbolClass: register("symbol-class", 60251), + symbolColor: register("symbol-color", 60252), + symbolConstant: register("symbol-constant", 60253), + symbolEnumMember: register("symbol-enum-member", 60254), + symbolField: register("symbol-field", 60255), + symbolFile: register("symbol-file", 60256), + symbolInterface: register("symbol-interface", 60257), + symbolKeyword: register("symbol-keyword", 60258), + symbolMisc: register("symbol-misc", 60259), + symbolOperator: register("symbol-operator", 60260), + symbolProperty: register("symbol-property", 60261), + wrench: register("wrench", 60261), + wrenchSubaction: register("wrench-subaction", 60261), + symbolSnippet: register("symbol-snippet", 60262), + tasklist: register("tasklist", 60263), + telescope: register("telescope", 60264), + textSize: register("text-size", 60265), + threeBars: register("three-bars", 60266), + thumbsdown: register("thumbsdown", 60267), + thumbsup: register("thumbsup", 60268), + tools: register("tools", 60269), + triangleDown: register("triangle-down", 60270), + triangleLeft: register("triangle-left", 60271), + triangleRight: register("triangle-right", 60272), + triangleUp: register("triangle-up", 60273), + twitter: register("twitter", 60274), + unfold: register("unfold", 60275), + unlock: register("unlock", 60276), + unmute: register("unmute", 60277), + unverified: register("unverified", 60278), + verified: register("verified", 60279), + versions: register("versions", 60280), + vmActive: register("vm-active", 60281), + vmOutline: register("vm-outline", 60282), + vmRunning: register("vm-running", 60283), + watch: register("watch", 60284), + whitespace: register("whitespace", 60285), + wholeWord: register("whole-word", 60286), + window: register("window", 60287), + wordWrap: register("word-wrap", 60288), + zoomIn: register("zoom-in", 60289), + zoomOut: register("zoom-out", 60290), + listFilter: register("list-filter", 60291), + listFlat: register("list-flat", 60292), + listSelection: register("list-selection", 60293), + selection: register("selection", 60293), + listTree: register("list-tree", 60294), + debugBreakpointFunctionUnverified: register("debug-breakpoint-function-unverified", 60295), + debugBreakpointFunction: register("debug-breakpoint-function", 60296), + debugBreakpointFunctionDisabled: register("debug-breakpoint-function-disabled", 60296), + debugStackframeActive: register("debug-stackframe-active", 60297), + circleSmallFilled: register("circle-small-filled", 60298), + debugStackframeDot: register("debug-stackframe-dot", 60298), + terminalDecorationMark: register("terminal-decoration-mark", 60298), + debugStackframe: register("debug-stackframe", 60299), + debugStackframeFocused: register("debug-stackframe-focused", 60299), + debugBreakpointUnsupported: register("debug-breakpoint-unsupported", 60300), + symbolString: register("symbol-string", 60301), + debugReverseContinue: register("debug-reverse-continue", 60302), + debugStepBack: register("debug-step-back", 60303), + debugRestartFrame: register("debug-restart-frame", 60304), + debugAlt: register("debug-alt", 60305), + callIncoming: register("call-incoming", 60306), + callOutgoing: register("call-outgoing", 60307), + menu: register("menu", 60308), + expandAll: register("expand-all", 60309), + feedback: register("feedback", 60310), + gitPullRequestReviewer: register("git-pull-request-reviewer", 60310), + groupByRefType: register("group-by-ref-type", 60311), + ungroupByRefType: register("ungroup-by-ref-type", 60312), + account: register("account", 60313), + gitPullRequestAssignee: register("git-pull-request-assignee", 60313), + bellDot: register("bell-dot", 60314), + debugConsole: register("debug-console", 60315), + library: register("library", 60316), + output: register("output", 60317), + runAll: register("run-all", 60318), + syncIgnored: register("sync-ignored", 60319), + pinned: register("pinned", 60320), + githubInverted: register("github-inverted", 60321), + serverProcess: register("server-process", 60322), + serverEnvironment: register("server-environment", 60323), + pass: register("pass", 60324), + issueClosed: register("issue-closed", 60324), + stopCircle: register("stop-circle", 60325), + playCircle: register("play-circle", 60326), + record: register("record", 60327), + debugAltSmall: register("debug-alt-small", 60328), + vmConnect: register("vm-connect", 60329), + cloud: register("cloud", 60330), + merge: register("merge", 60331), + export: register("export", 60332), + graphLeft: register("graph-left", 60333), + magnet: register("magnet", 60334), + notebook: register("notebook", 60335), + redo: register("redo", 60336), + checkAll: register("check-all", 60337), + pinnedDirty: register("pinned-dirty", 60338), + passFilled: register("pass-filled", 60339), + circleLargeFilled: register("circle-large-filled", 60340), + circleLarge: register("circle-large", 60341), + circleLargeOutline: register("circle-large-outline", 60341), + combine: register("combine", 60342), + gather: register("gather", 60342), + table: register("table", 60343), + variableGroup: register("variable-group", 60344), + typeHierarchy: register("type-hierarchy", 60345), + typeHierarchySub: register("type-hierarchy-sub", 60346), + typeHierarchySuper: register("type-hierarchy-super", 60347), + gitPullRequestCreate: register("git-pull-request-create", 60348), + runAbove: register("run-above", 60349), + runBelow: register("run-below", 60350), + notebookTemplate: register("notebook-template", 60351), + debugRerun: register("debug-rerun", 60352), + workspaceTrusted: register("workspace-trusted", 60353), + workspaceUntrusted: register("workspace-untrusted", 60354), + workspaceUnknown: register("workspace-unknown", 60355), + terminalCmd: register("terminal-cmd", 60356), + terminalDebian: register("terminal-debian", 60357), + terminalLinux: register("terminal-linux", 60358), + terminalPowershell: register("terminal-powershell", 60359), + terminalTmux: register("terminal-tmux", 60360), + terminalUbuntu: register("terminal-ubuntu", 60361), + terminalBash: register("terminal-bash", 60362), + arrowSwap: register("arrow-swap", 60363), + copy: register("copy", 60364), + personAdd: register("person-add", 60365), + filterFilled: register("filter-filled", 60366), + wand: register("wand", 60367), + debugLineByLine: register("debug-line-by-line", 60368), + inspect: register("inspect", 60369), + layers: register("layers", 60370), + layersDot: register("layers-dot", 60371), + layersActive: register("layers-active", 60372), + compass: register("compass", 60373), + compassDot: register("compass-dot", 60374), + compassActive: register("compass-active", 60375), + azure: register("azure", 60376), + issueDraft: register("issue-draft", 60377), + gitPullRequestClosed: register("git-pull-request-closed", 60378), + gitPullRequestDraft: register("git-pull-request-draft", 60379), + debugAll: register("debug-all", 60380), + debugCoverage: register("debug-coverage", 60381), + runErrors: register("run-errors", 60382), + folderLibrary: register("folder-library", 60383), + debugContinueSmall: register("debug-continue-small", 60384), + beakerStop: register("beaker-stop", 60385), + graphLine: register("graph-line", 60386), + graphScatter: register("graph-scatter", 60387), + pieChart: register("pie-chart", 60388), + bracket: register("bracket", 60175), + bracketDot: register("bracket-dot", 60389), + bracketError: register("bracket-error", 60390), + lockSmall: register("lock-small", 60391), + azureDevops: register("azure-devops", 60392), + verifiedFilled: register("verified-filled", 60393), + newline: register("newline", 60394), + layout: register("layout", 60395), + layoutActivitybarLeft: register("layout-activitybar-left", 60396), + layoutActivitybarRight: register("layout-activitybar-right", 60397), + layoutPanelLeft: register("layout-panel-left", 60398), + layoutPanelCenter: register("layout-panel-center", 60399), + layoutPanelJustify: register("layout-panel-justify", 60400), + layoutPanelRight: register("layout-panel-right", 60401), + layoutPanel: register("layout-panel", 60402), + layoutSidebarLeft: register("layout-sidebar-left", 60403), + layoutSidebarRight: register("layout-sidebar-right", 60404), + layoutStatusbar: register("layout-statusbar", 60405), + layoutMenubar: register("layout-menubar", 60406), + layoutCentered: register("layout-centered", 60407), + target: register("target", 60408), + indent: register("indent", 60409), + recordSmall: register("record-small", 60410), + errorSmall: register("error-small", 60411), + terminalDecorationError: register("terminal-decoration-error", 60411), + arrowCircleDown: register("arrow-circle-down", 60412), + arrowCircleLeft: register("arrow-circle-left", 60413), + arrowCircleRight: register("arrow-circle-right", 60414), + arrowCircleUp: register("arrow-circle-up", 60415), + layoutSidebarRightOff: register("layout-sidebar-right-off", 60416), + layoutPanelOff: register("layout-panel-off", 60417), + layoutSidebarLeftOff: register("layout-sidebar-left-off", 60418), + blank: register("blank", 60419), + heartFilled: register("heart-filled", 60420), + map: register("map", 60421), + mapHorizontal: register("map-horizontal", 60421), + foldHorizontal: register("fold-horizontal", 60421), + mapFilled: register("map-filled", 60422), + mapHorizontalFilled: register("map-horizontal-filled", 60422), + foldHorizontalFilled: register("fold-horizontal-filled", 60422), + circleSmall: register("circle-small", 60423), + bellSlash: register("bell-slash", 60424), + bellSlashDot: register("bell-slash-dot", 60425), + commentUnresolved: register("comment-unresolved", 60426), + gitPullRequestGoToChanges: register("git-pull-request-go-to-changes", 60427), + gitPullRequestNewChanges: register("git-pull-request-new-changes", 60428), + searchFuzzy: register("search-fuzzy", 60429), + commentDraft: register("comment-draft", 60430), + send: register("send", 60431), + sparkle: register("sparkle", 60432), + insert: register("insert", 60433), + mic: register("mic", 60434), + thumbsdownFilled: register("thumbsdown-filled", 60435), + thumbsupFilled: register("thumbsup-filled", 60436), + coffee: register("coffee", 60437), + snake: register("snake", 60438), + game: register("game", 60439), + vr: register("vr", 60440), + chip: register("chip", 60441), + piano: register("piano", 60442), + music: register("music", 60443), + micFilled: register("mic-filled", 60444), + repoFetch: register("repo-fetch", 60445), + copilot: register("copilot", 60446), + lightbulbSparkle: register("lightbulb-sparkle", 60447), + robot: register("robot", 60448), + sparkleFilled: register("sparkle-filled", 60449), + diffSingle: register("diff-single", 60450), + diffMultiple: register("diff-multiple", 60451), + surroundWith: register("surround-with", 60452), + share: register("share", 60453), + gitStash: register("git-stash", 60454), + gitStashApply: register("git-stash-apply", 60455), + gitStashPop: register("git-stash-pop", 60456), + vscode: register("vscode", 60457), + vscodeInsiders: register("vscode-insiders", 60458), + codeOss: register("code-oss", 60459), + runCoverage: register("run-coverage", 60460), + runAllCoverage: register("run-all-coverage", 60461), + coverage: register("coverage", 60462), + githubProject: register("github-project", 60463), + mapVertical: register("map-vertical", 60464), + foldVertical: register("fold-vertical", 60464), + mapVerticalFilled: register("map-vertical-filled", 60465), + foldVerticalFilled: register("fold-vertical-filled", 60465), + goToSearch: register("go-to-search", 60466), + percentage: register("percentage", 60467), + sortPercentage: register("sort-percentage", 60467), + attach: register("attach", 60468), + goToEditingSession: register("go-to-editing-session", 60469), + editSession: register("edit-session", 60470), + codeReview: register("code-review", 60471), + copilotWarning: register("copilot-warning", 60472), + python: register("python", 60473), + copilotLarge: register("copilot-large", 60474), + copilotWarningLarge: register("copilot-warning-large", 60475), + keyboardTab: register("keyboard-tab", 60476), + copilotBlocked: register("copilot-blocked", 60477), + copilotNotConnected: register("copilot-not-connected", 60478), + flag: register("flag", 60479), + lightbulbEmpty: register("lightbulb-empty", 60480), + symbolMethodArrow: register("symbol-method-arrow", 60481), + copilotUnavailable: register("copilot-unavailable", 60482), + repoPinned: register("repo-pinned", 60483), + keyboardTabAbove: register("keyboard-tab-above", 60484), + keyboardTabBelow: register("keyboard-tab-below", 60485), + gitPullRequestDone: register("git-pull-request-done", 60486), + mcp: register("mcp", 60487), + extensionsLarge: register("extensions-large", 60488), + layoutPanelDock: register("layout-panel-dock", 60489), + layoutSidebarLeftDock: register("layout-sidebar-left-dock", 60490), + layoutSidebarRightDock: register("layout-sidebar-right-dock", 60491), + copilotInProgress: register("copilot-in-progress", 60492), + copilotError: register("copilot-error", 60493), + copilotSuccess: register("copilot-success", 60494), + chatSparkle: register("chat-sparkle", 60495), + searchSparkle: register("search-sparkle", 60496), + editSparkle: register("edit-sparkle", 60497), + copilotSnooze: register("copilot-snooze", 60498), + sendToRemoteAgent: register("send-to-remote-agent", 60499), + commentDiscussionSparkle: register("comment-discussion-sparkle", 60500), + chatSparkleWarning: register("chat-sparkle-warning", 60501), + chatSparkleError: register("chat-sparkle-error", 60502), + collection: register("collection", 60503), + newCollection: register("new-collection", 60504), + thinking: register("thinking", 60505), + build: register("build", 60506), + commentDiscussionQuote: register("comment-discussion-quote", 60507), + cursor: register("cursor", 60508), + eraser: register("eraser", 60509), + fileText: register("file-text", 60510), + gitLens: register("git-lens", 60511), + quotes: register("quotes", 60512), + rename: register("rename", 60513), + runWithDeps: register("run-with-deps", 60514), + debugConnected: register("debug-connected", 60515), + strikethrough: register("strikethrough", 60516), + openInProduct: register("open-in-product", 60517), + indexZero: register("index-zero", 60518), + agent: register("agent", 60519), + editCode: register("edit-code", 60520), + repoSelected: register("repo-selected", 60521), + skip: register("skip", 60522), + mergeInto: register("merge-into", 60523), + gitBranchChanges: register("git-branch-changes", 60524), + gitBranchStagedChanges: register("git-branch-staged-changes", 60525), + gitBranchConflicts: register("git-branch-conflicts", 60526), + gitBranch: register("git-branch", 60527), + gitBranchCreate: register("git-branch-create", 60527), + gitBranchDelete: register("git-branch-delete", 60527), + searchLarge: register("search-large", 60528), + terminalGitBash: register("terminal-git-bash", 60529) + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/common/codicons.js +var codiconsDerived, Codicon; +var init_codicons = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/common/codicons.js"() { + init_codiconsUtil(); + init_codiconsLibrary(); + codiconsDerived = { + dialogError: register("dialog-error", "error"), + dialogWarning: register("dialog-warning", "warning"), + dialogInfo: register("dialog-info", "info"), + dialogClose: register("dialog-close", "close"), + treeItemExpanded: register("tree-item-expanded", "chevron-down"), + // collapsed is done with rotation + treeFilterOnTypeOn: register("tree-filter-on-type-on", "list-filter"), + treeFilterOnTypeOff: register("tree-filter-on-type-off", "list-selection"), + treeFilterClear: register("tree-filter-clear", "close"), + treeItemLoading: register("tree-item-loading", "loading"), + menuSelection: register("menu-selection", "check"), + menuSubmenu: register("menu-submenu", "chevron-right"), + menuBarMore: register("menubar-more", "more"), + scrollbarButtonLeft: register("scrollbar-button-left", "triangle-left"), + scrollbarButtonRight: register("scrollbar-button-right", "triangle-right"), + scrollbarButtonUp: register("scrollbar-button-up", "triangle-up"), + scrollbarButtonDown: register("scrollbar-button-down", "triangle-down"), + toolBarMore: register("toolbar-more", "more"), + quickInputBack: register("quick-input-back", "arrow-left"), + dropDownButton: register("drop-down-button", 60084), + symbolCustomColor: register("symbol-customcolor", 60252), + exportIcon: register("export", 60332), + workspaceUnspecified: register("workspace-unspecified", 60355), + newLine: register("newline", 60394), + thumbsDownFilled: register("thumbsdown-filled", 60435), + thumbsUpFilled: register("thumbsup-filled", 60436), + gitFetch: register("git-fetch", 60445), + lightbulbSparkleAutofix: register("lightbulb-sparkle-autofix", 60447), + debugBreakpointPending: register("debug-breakpoint-pending", 60377) + }; + Codicon = { + ...codiconsLibrary, + ...codiconsDerived + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/common/themables.js +var ThemeColor, ThemeIcon; +var init_themables = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/common/themables.js"() { + init_codicons(); + (function(ThemeColor2) { + function isThemeColor(obj) { + return !!obj && typeof obj === "object" && typeof obj.id === "string"; + } + ThemeColor2.isThemeColor = isThemeColor; + })(ThemeColor || (ThemeColor = {})); + (function(ThemeIcon2) { + ThemeIcon2.iconNameSegment = "[A-Za-z0-9]+"; + ThemeIcon2.iconNameExpression = "[A-Za-z0-9-]+"; + ThemeIcon2.iconModifierExpression = "~[A-Za-z]+"; + ThemeIcon2.iconNameCharacter = "[A-Za-z0-9~-]"; + const ThemeIconIdRegex = new RegExp(`^(${ThemeIcon2.iconNameExpression})(${ThemeIcon2.iconModifierExpression})?$`); + function asClassNameArray(icon) { + const match2 = ThemeIconIdRegex.exec(icon.id); + if (!match2) { + return asClassNameArray(Codicon.error); + } + const [, id, modifier] = match2; + const classNames2 = ["codicon", "codicon-" + id]; + if (modifier) { + classNames2.push("codicon-modifier-" + modifier.substring(1)); + } + return classNames2; + } + ThemeIcon2.asClassNameArray = asClassNameArray; + function asClassName(icon) { + return asClassNameArray(icon).join(" "); + } + ThemeIcon2.asClassName = asClassName; + function asCSSSelector(icon) { + return "." + asClassNameArray(icon).join("."); + } + ThemeIcon2.asCSSSelector = asCSSSelector; + function isThemeIcon(obj) { + return !!obj && typeof obj === "object" && typeof obj.id === "string" && (typeof obj.color === "undefined" || ThemeColor.isThemeColor(obj.color)); + } + ThemeIcon2.isThemeIcon = isThemeIcon; + const _regexFromString = new RegExp(`^\\$\\((${ThemeIcon2.iconNameExpression}(?:${ThemeIcon2.iconModifierExpression})?)\\)$`); + function fromString(str) { + const match2 = _regexFromString.exec(str); + if (!match2) { + return void 0; + } + const [, name] = match2; + return { id: name }; + } + ThemeIcon2.fromString = fromString; + function fromId(id) { + return { id }; + } + ThemeIcon2.fromId = fromId; + function modify(icon, modifier) { + let id = icon.id; + const tildeIndex = id.lastIndexOf("~"); + if (tildeIndex !== -1) { + id = id.substring(0, tildeIndex); + } + if (modifier) { + id = `${id}~${modifier}`; + } + return { id }; + } + ThemeIcon2.modify = modify; + function getModifier(icon) { + const tildeIndex = icon.id.lastIndexOf("~"); + if (tildeIndex !== -1) { + return icon.id.substring(tildeIndex + 1); + } + return void 0; + } + ThemeIcon2.getModifier = getModifier; + function isEqual2(ti1, ti2) { + return ti1.id === ti2.id && ti1.color?.id === ti2.color?.id; + } + ThemeIcon2.isEqual = isEqual2; + function isFile(icon) { + return icon?.id === Codicon.file.id; + } + ThemeIcon2.isFile = isFile; + function isFolder(icon) { + return icon?.id === Codicon.folder.id; + } + ThemeIcon2.isFolder = isFolder; + })(ThemeIcon || (ThemeIcon = {})); + } +}); + +// node_modules/monaco-editor-core/esm/vs/platform/commands/common/commands.js +var ICommandService, CommandsRegistry; +var init_commands = __esm({ + "node_modules/monaco-editor-core/esm/vs/platform/commands/common/commands.js"() { + init_event(); + init_iterator(); + init_lifecycle(); + init_linkedList(); + init_types(); + init_instantiation(); + ICommandService = createDecorator("commandService"); + CommandsRegistry = new class { + constructor() { + this._commands = /* @__PURE__ */ new Map(); + this._onDidRegisterCommand = new Emitter(); + this.onDidRegisterCommand = this._onDidRegisterCommand.event; + } + registerCommand(idOrCommand, handler) { + if (!idOrCommand) { + throw new Error(`invalid command`); + } + if (typeof idOrCommand === "string") { + if (!handler) { + throw new Error(`invalid command`); + } + return this.registerCommand({ id: idOrCommand, handler }); + } + if (idOrCommand.metadata && Array.isArray(idOrCommand.metadata.args)) { + const constraints = []; + for (const arg of idOrCommand.metadata.args) { + constraints.push(arg.constraint); + } + const actualHandler = idOrCommand.handler; + idOrCommand.handler = function(accessor, ...args) { + validateConstraints(args, constraints); + return actualHandler(accessor, ...args); + }; + } + const { id } = idOrCommand; + let commands = this._commands.get(id); + if (!commands) { + commands = new LinkedList(); + this._commands.set(id, commands); + } + const removeFn = commands.unshift(idOrCommand); + const ret = toDisposable(() => { + removeFn(); + const command = this._commands.get(id); + if (command?.isEmpty()) { + this._commands.delete(id); + } + }); + this._onDidRegisterCommand.fire(id); + return markAsSingleton(ret); + } + registerCommandAlias(oldId, newId) { + return CommandsRegistry.registerCommand(oldId, (accessor, ...args) => accessor.get(ICommandService).executeCommand(newId, ...args)); + } + getCommand(id) { + const list2 = this._commands.get(id); + if (!list2 || list2.isEmpty()) { + return void 0; + } + return Iterable.first(list2); + } + getCommands() { + const result = /* @__PURE__ */ new Map(); + for (const key of this._commands.keys()) { + const command = this.getCommand(key); + if (command) { + result.set(key, command); + } + } + return result; + } + }(); + CommandsRegistry.registerCommand("noop", () => { + }); + } +}); + +// node_modules/monaco-editor-core/esm/vs/platform/contextkey/common/scanner.js +function hintDidYouMean(...meant) { + switch (meant.length) { + case 1: + return localize(1693, "Did you mean {0}?", meant[0]); + case 2: + return localize(1694, "Did you mean {0} or {1}?", meant[0], meant[1]); + case 3: + return localize(1695, "Did you mean {0}, {1} or {2}?", meant[0], meant[1], meant[2]); + default: + return void 0; + } +} +var hintDidYouForgetToOpenOrCloseQuote, hintDidYouForgetToEscapeSlash, Scanner; +var init_scanner = __esm({ + "node_modules/monaco-editor-core/esm/vs/platform/contextkey/common/scanner.js"() { + init_errors(); + init_nls(); + hintDidYouForgetToOpenOrCloseQuote = localize(1696, "Did you forget to open or close the quote?"); + hintDidYouForgetToEscapeSlash = localize(1697, "Did you forget to escape the '/' (slash) character? Put two backslashes before it to escape, e.g., '\\\\/'."); + Scanner = class _Scanner { + constructor() { + this._input = ""; + this._start = 0; + this._current = 0; + this._tokens = []; + this._errors = []; + this.stringRe = /[a-zA-Z0-9_<>\-\./\\:\*\?\+\[\]\^,#@;"%\$\p{L}-]+/uy; + } + static getLexeme(token) { + switch (token.type) { + case 0: + return "("; + case 1: + return ")"; + case 2: + return "!"; + case 3: + return token.isTripleEq ? "===" : "=="; + case 4: + return token.isTripleEq ? "!==" : "!="; + case 5: + return "<"; + case 6: + return "<="; + case 7: + return ">="; + case 8: + return ">="; + case 9: + return "=~"; + case 10: + return token.lexeme; + case 11: + return "true"; + case 12: + return "false"; + case 13: + return "in"; + case 14: + return "not"; + case 15: + return "&&"; + case 16: + return "||"; + case 17: + return token.lexeme; + case 18: + return token.lexeme; + case 19: + return token.lexeme; + case 20: + return "EOF"; + default: + throw illegalState(`unhandled token type: ${JSON.stringify(token)}; have you forgotten to add a case?`); + } + } + static { + this._regexFlags = new Set(["i", "g", "s", "m", "y", "u"].map((ch) => ch.charCodeAt(0))); + } + static { + this._keywords = /* @__PURE__ */ new Map([ + [ + "not", + 14 + /* TokenType.Not */ + ], + [ + "in", + 13 + /* TokenType.In */ + ], + [ + "false", + 12 + /* TokenType.False */ + ], + [ + "true", + 11 + /* TokenType.True */ + ] + ]); + } + reset(value) { + this._input = value; + this._start = 0; + this._current = 0; + this._tokens = []; + this._errors = []; + return this; + } + scan() { + while (!this._isAtEnd()) { + this._start = this._current; + const ch = this._advance(); + switch (ch) { + case 40: + this._addToken( + 0 + /* TokenType.LParen */ + ); + break; + case 41: + this._addToken( + 1 + /* TokenType.RParen */ + ); + break; + case 33: + if (this._match( + 61 + /* CharCode.Equals */ + )) { + const isTripleEq = this._match( + 61 + /* CharCode.Equals */ + ); + this._tokens.push({ type: 4, offset: this._start, isTripleEq }); + } else { + this._addToken( + 2 + /* TokenType.Neg */ + ); + } + break; + case 39: + this._quotedString(); + break; + case 47: + this._regex(); + break; + case 61: + if (this._match( + 61 + /* CharCode.Equals */ + )) { + const isTripleEq = this._match( + 61 + /* CharCode.Equals */ + ); + this._tokens.push({ type: 3, offset: this._start, isTripleEq }); + } else if (this._match( + 126 + /* CharCode.Tilde */ + )) { + this._addToken( + 9 + /* TokenType.RegexOp */ + ); + } else { + this._error(hintDidYouMean("==", "=~")); + } + break; + case 60: + this._addToken( + this._match( + 61 + /* CharCode.Equals */ + ) ? 6 : 5 + /* TokenType.Lt */ + ); + break; + case 62: + this._addToken( + this._match( + 61 + /* CharCode.Equals */ + ) ? 8 : 7 + /* TokenType.Gt */ + ); + break; + case 38: + if (this._match( + 38 + /* CharCode.Ampersand */ + )) { + this._addToken( + 15 + /* TokenType.And */ + ); + } else { + this._error(hintDidYouMean("&&")); + } + break; + case 124: + if (this._match( + 124 + /* CharCode.Pipe */ + )) { + this._addToken( + 16 + /* TokenType.Or */ + ); + } else { + this._error(hintDidYouMean("||")); + } + break; + // TODO@ulugbekna: 1) rewrite using a regex 2) reconsider what characters are considered whitespace, including unicode, nbsp, etc. + case 32: + case 13: + case 9: + case 10: + case 160: + break; + default: + this._string(); + } + } + this._start = this._current; + this._addToken( + 20 + /* TokenType.EOF */ + ); + return Array.from(this._tokens); + } + _match(expected) { + if (this._isAtEnd()) { + return false; + } + if (this._input.charCodeAt(this._current) !== expected) { + return false; + } + this._current++; + return true; + } + _advance() { + return this._input.charCodeAt(this._current++); + } + _peek() { + return this._isAtEnd() ? 0 : this._input.charCodeAt(this._current); + } + _addToken(type) { + this._tokens.push({ type, offset: this._start }); + } + _error(additional) { + const offset = this._start; + const lexeme = this._input.substring(this._start, this._current); + const errToken = { type: 19, offset: this._start, lexeme }; + this._errors.push({ offset, lexeme, additionalInfo: additional }); + this._tokens.push(errToken); + } + _string() { + this.stringRe.lastIndex = this._start; + const match2 = this.stringRe.exec(this._input); + if (match2) { + this._current = this._start + match2[0].length; + const lexeme = this._input.substring(this._start, this._current); + const keyword = _Scanner._keywords.get(lexeme); + if (keyword) { + this._addToken(keyword); + } else { + this._tokens.push({ type: 17, lexeme, offset: this._start }); + } + } + } + // captures the lexeme without the leading and trailing ' + _quotedString() { + while (this._peek() !== 39 && !this._isAtEnd()) { + this._advance(); + } + if (this._isAtEnd()) { + this._error(hintDidYouForgetToOpenOrCloseQuote); + return; + } + this._advance(); + this._tokens.push({ type: 18, lexeme: this._input.substring(this._start + 1, this._current - 1), offset: this._start + 1 }); + } + /* + * Lexing a regex expression: /.../[igsmyu]* + * Based on https://github.com/microsoft/TypeScript/blob/9247ef115e617805983740ba795d7a8164babf89/src/compiler/scanner.ts#L2129-L2181 + * + * Note that we want slashes within a regex to be escaped, e.g., /file:\\/\\/\\// should match `file:///` + */ + _regex() { + let p = this._current; + let inEscape = false; + let inCharacterClass = false; + while (true) { + if (p >= this._input.length) { + this._current = p; + this._error(hintDidYouForgetToEscapeSlash); + return; + } + const ch = this._input.charCodeAt(p); + if (inEscape) { + inEscape = false; + } else if (ch === 47 && !inCharacterClass) { + p++; + break; + } else if (ch === 91) { + inCharacterClass = true; + } else if (ch === 92) { + inEscape = true; + } else if (ch === 93) { + inCharacterClass = false; + } + p++; + } + while (p < this._input.length && _Scanner._regexFlags.has(this._input.charCodeAt(p))) { + p++; + } + this._current = p; + const lexeme = this._input.substring(this._start, this._current); + this._tokens.push({ type: 10, lexeme, offset: this._start }); + } + _isAtEnd() { + return this._current >= this._input.length; + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/platform/contextkey/common/contextkey.js +function expressionsAreEqualWithConstantSubstitution(a, b) { + const aExpr = a ? a.substituteConstants() : void 0; + const bExpr = b ? b.substituteConstants() : void 0; + if (!aExpr && !bExpr) { + return true; + } + if (!aExpr || !bExpr) { + return false; + } + return aExpr.equals(bExpr); +} +function cmp(a, b) { + return a.cmp(b); +} +function withFloatOrStr(value, callback) { + if (typeof value === "string") { + const n2 = parseFloat(value); + if (!isNaN(n2)) { + value = n2; + } + } + if (typeof value === "string" || typeof value === "number") { + return callback(value); + } + return ContextKeyFalseExpr.INSTANCE; +} +function eliminateConstantsInArray(arr) { + let newArr = null; + for (let i2 = 0, len = arr.length; i2 < len; i2++) { + const newExpr = arr[i2].substituteConstants(); + if (arr[i2] !== newExpr) { + if (newArr === null) { + newArr = []; + for (let j = 0; j < i2; j++) { + newArr[j] = arr[j]; + } + } + } + if (newArr !== null) { + newArr[i2] = newExpr; + } + } + if (newArr === null) { + return arr; + } + return newArr; +} +function cmp1(key1, key2) { + if (key1 < key2) { + return -1; + } + if (key1 > key2) { + return 1; + } + return 0; +} +function cmp2(key1, value1, key2, value2) { + if (key1 < key2) { + return -1; + } + if (key1 > key2) { + return 1; + } + if (value1 < value2) { + return -1; + } + if (value1 > value2) { + return 1; + } + return 0; +} +function implies(p, q) { + if (p.type === 0 || q.type === 1) { + return true; + } + if (p.type === 9) { + if (q.type === 9) { + return allElementsIncluded(p.expr, q.expr); + } + return false; + } + if (q.type === 9) { + for (const element of q.expr) { + if (implies(p, element)) { + return true; + } + } + return false; + } + if (p.type === 6) { + if (q.type === 6) { + return allElementsIncluded(q.expr, p.expr); + } + for (const element of p.expr) { + if (implies(element, q)) { + return true; + } + } + return false; + } + return p.equals(q); +} +function allElementsIncluded(p, q) { + let pIndex = 0; + let qIndex = 0; + while (pIndex < p.length && qIndex < q.length) { + const cmp3 = p[pIndex].cmp(q[qIndex]); + if (cmp3 < 0) { + return false; + } else if (cmp3 === 0) { + pIndex++; + qIndex++; + } else { + qIndex++; + } + } + return pIndex === p.length; +} +function getTerminals(node) { + if (node.type === 9) { + return node.expr; + } + return [node]; +} +var CONSTANT_VALUES, hasOwnProperty, defaultConfig, errorEmptyString, hintEmptyString, errorNoInAfterNot, errorClosingParenthesis, errorUnexpectedToken, hintUnexpectedToken, errorUnexpectedEOF, hintUnexpectedEOF, Parser, ContextKeyExpr, ContextKeyFalseExpr, ContextKeyTrueExpr, ContextKeyDefinedExpr, ContextKeyEqualsExpr, ContextKeyInExpr, ContextKeyNotInExpr, ContextKeyNotEqualsExpr, ContextKeyNotExpr, ContextKeyGreaterExpr, ContextKeyGreaterEqualsExpr, ContextKeySmallerExpr, ContextKeySmallerEqualsExpr, ContextKeyRegexExpr, ContextKeyNotRegexExpr, ContextKeyAndExpr, ContextKeyOrExpr, RawContextKey, IContextKeyService; +var init_contextkey = __esm({ + "node_modules/monaco-editor-core/esm/vs/platform/contextkey/common/contextkey.js"() { + init_platform(); + init_strings(); + init_scanner(); + init_instantiation(); + init_nls(); + CONSTANT_VALUES = /* @__PURE__ */ new Map(); + CONSTANT_VALUES.set("false", false); + CONSTANT_VALUES.set("true", true); + CONSTANT_VALUES.set("isMac", isMacintosh); + CONSTANT_VALUES.set("isLinux", isLinux); + CONSTANT_VALUES.set("isWindows", isWindows); + CONSTANT_VALUES.set("isWeb", isWeb); + CONSTANT_VALUES.set("isMacNative", isMacintosh && !isWeb); + CONSTANT_VALUES.set("isEdge", isEdge); + CONSTANT_VALUES.set("isFirefox", isFirefox2); + CONSTANT_VALUES.set("isChrome", isChrome2); + CONSTANT_VALUES.set("isSafari", isSafari2); + hasOwnProperty = Object.prototype.hasOwnProperty; + defaultConfig = { + regexParsingWithErrorRecovery: true + }; + errorEmptyString = localize(1675, "Empty context key expression"); + hintEmptyString = localize(1676, "Did you forget to write an expression? You can also put 'false' or 'true' to always evaluate to false or true, respectively."); + errorNoInAfterNot = localize(1677, "'in' after 'not'."); + errorClosingParenthesis = localize(1678, "closing parenthesis ')'"); + errorUnexpectedToken = localize(1679, "Unexpected token"); + hintUnexpectedToken = localize(1680, "Did you forget to put && or || before the token?"); + errorUnexpectedEOF = localize(1681, "Unexpected end of expression"); + hintUnexpectedEOF = localize(1682, "Did you forget to put a context key?"); + Parser = class _Parser2 { + static { + this._parseError = new Error(); + } + constructor(_config = defaultConfig) { + this._config = _config; + this._scanner = new Scanner(); + this._tokens = []; + this._current = 0; + this._parsingErrors = []; + this._flagsGYRe = /g|y/g; + } + /** + * Parse a context key expression. + * + * @param input the expression to parse + * @returns the parsed expression or `undefined` if there's an error - call `lexingErrors` and `parsingErrors` to see the errors + */ + parse(input) { + if (input === "") { + this._parsingErrors.push({ message: errorEmptyString, offset: 0, lexeme: "", additionalInfo: hintEmptyString }); + return void 0; + } + this._tokens = this._scanner.reset(input).scan(); + this._current = 0; + this._parsingErrors = []; + try { + const expr = this._expr(); + if (!this._isAtEnd()) { + const peek = this._peek(); + const additionalInfo = peek.type === 17 ? hintUnexpectedToken : void 0; + this._parsingErrors.push({ message: errorUnexpectedToken, offset: peek.offset, lexeme: Scanner.getLexeme(peek), additionalInfo }); + throw _Parser2._parseError; + } + return expr; + } catch (e) { + if (!(e === _Parser2._parseError)) { + throw e; + } + return void 0; + } + } + _expr() { + return this._or(); + } + _or() { + const expr = [this._and()]; + while (this._matchOne( + 16 + /* TokenType.Or */ + )) { + const right = this._and(); + expr.push(right); + } + return expr.length === 1 ? expr[0] : ContextKeyExpr.or(...expr); + } + _and() { + const expr = [this._term()]; + while (this._matchOne( + 15 + /* TokenType.And */ + )) { + const right = this._term(); + expr.push(right); + } + return expr.length === 1 ? expr[0] : ContextKeyExpr.and(...expr); + } + _term() { + if (this._matchOne( + 2 + /* TokenType.Neg */ + )) { + const peek = this._peek(); + switch (peek.type) { + case 11: + this._advance(); + return ContextKeyFalseExpr.INSTANCE; + case 12: + this._advance(); + return ContextKeyTrueExpr.INSTANCE; + case 0: { + this._advance(); + const expr = this._expr(); + this._consume(1, errorClosingParenthesis); + return expr?.negate(); + } + case 17: + this._advance(); + return ContextKeyNotExpr.create(peek.lexeme); + default: + throw this._errExpectedButGot(`KEY | true | false | '(' expression ')'`, peek); + } + } + return this._primary(); + } + _primary() { + const peek = this._peek(); + switch (peek.type) { + case 11: + this._advance(); + return ContextKeyExpr.true(); + case 12: + this._advance(); + return ContextKeyExpr.false(); + case 0: { + this._advance(); + const expr = this._expr(); + this._consume(1, errorClosingParenthesis); + return expr; + } + case 17: { + const key = peek.lexeme; + this._advance(); + if (this._matchOne( + 9 + /* TokenType.RegexOp */ + )) { + const expr = this._peek(); + if (!this._config.regexParsingWithErrorRecovery) { + this._advance(); + if (expr.type !== 10) { + throw this._errExpectedButGot(`REGEX`, expr); + } + const regexLexeme = expr.lexeme; + const closingSlashIndex = regexLexeme.lastIndexOf("/"); + const flags = closingSlashIndex === regexLexeme.length - 1 ? void 0 : this._removeFlagsGY(regexLexeme.substring(closingSlashIndex + 1)); + let regexp; + try { + regexp = new RegExp(regexLexeme.substring(1, closingSlashIndex), flags); + } catch (e) { + throw this._errExpectedButGot(`REGEX`, expr); + } + return ContextKeyRegexExpr.create(key, regexp); + } + switch (expr.type) { + case 10: + case 19: { + const lexemeReconstruction = [expr.lexeme]; + this._advance(); + let followingToken = this._peek(); + let parenBalance = 0; + for (let i2 = 0; i2 < expr.lexeme.length; i2++) { + if (expr.lexeme.charCodeAt(i2) === 40) { + parenBalance++; + } else if (expr.lexeme.charCodeAt(i2) === 41) { + parenBalance--; + } + } + while (!this._isAtEnd() && followingToken.type !== 15 && followingToken.type !== 16) { + switch (followingToken.type) { + case 0: + parenBalance++; + break; + case 1: + parenBalance--; + break; + case 10: + case 18: + for (let i2 = 0; i2 < followingToken.lexeme.length; i2++) { + if (followingToken.lexeme.charCodeAt(i2) === 40) { + parenBalance++; + } else if (expr.lexeme.charCodeAt(i2) === 41) { + parenBalance--; + } + } + } + if (parenBalance < 0) { + break; + } + lexemeReconstruction.push(Scanner.getLexeme(followingToken)); + this._advance(); + followingToken = this._peek(); + } + const regexLexeme = lexemeReconstruction.join(""); + const closingSlashIndex = regexLexeme.lastIndexOf("/"); + const flags = closingSlashIndex === regexLexeme.length - 1 ? void 0 : this._removeFlagsGY(regexLexeme.substring(closingSlashIndex + 1)); + let regexp; + try { + regexp = new RegExp(regexLexeme.substring(1, closingSlashIndex), flags); + } catch (e) { + throw this._errExpectedButGot(`REGEX`, expr); + } + return ContextKeyExpr.regex(key, regexp); + } + case 18: { + const serializedValue = expr.lexeme; + this._advance(); + let regex = null; + if (!isFalsyOrWhitespace(serializedValue)) { + const start = serializedValue.indexOf("/"); + const end = serializedValue.lastIndexOf("/"); + if (start !== end && start >= 0) { + const value = serializedValue.slice(start + 1, end); + const caseIgnoreFlag = serializedValue[end + 1] === "i" ? "i" : ""; + try { + regex = new RegExp(value, caseIgnoreFlag); + } catch (_e) { + throw this._errExpectedButGot(`REGEX`, expr); + } + } + } + if (regex === null) { + throw this._errExpectedButGot("REGEX", expr); + } + return ContextKeyRegexExpr.create(key, regex); + } + default: + throw this._errExpectedButGot("REGEX", this._peek()); + } + } + if (this._matchOne( + 14 + /* TokenType.Not */ + )) { + this._consume(13, errorNoInAfterNot); + const right = this._value(); + return ContextKeyExpr.notIn(key, right); + } + const maybeOp = this._peek().type; + switch (maybeOp) { + case 3: { + this._advance(); + const right = this._value(); + if (this._previous().type === 18) { + return ContextKeyExpr.equals(key, right); + } + switch (right) { + case "true": + return ContextKeyExpr.has(key); + case "false": + return ContextKeyExpr.not(key); + default: + return ContextKeyExpr.equals(key, right); + } + } + case 4: { + this._advance(); + const right = this._value(); + if (this._previous().type === 18) { + return ContextKeyExpr.notEquals(key, right); + } + switch (right) { + case "true": + return ContextKeyExpr.not(key); + case "false": + return ContextKeyExpr.has(key); + default: + return ContextKeyExpr.notEquals(key, right); + } + } + // TODO: ContextKeyExpr.smaller(key, right) accepts only `number` as `right` AND during eval of this node, we just eval to `false` if `right` is not a number + // consequently, package.json linter should _warn_ the user if they're passing undesired things to ops + case 5: + this._advance(); + return ContextKeySmallerExpr.create(key, this._value()); + case 6: + this._advance(); + return ContextKeySmallerEqualsExpr.create(key, this._value()); + case 7: + this._advance(); + return ContextKeyGreaterExpr.create(key, this._value()); + case 8: + this._advance(); + return ContextKeyGreaterEqualsExpr.create(key, this._value()); + case 13: + this._advance(); + return ContextKeyExpr.in(key, this._value()); + default: + return ContextKeyExpr.has(key); + } + } + case 20: + this._parsingErrors.push({ message: errorUnexpectedEOF, offset: peek.offset, lexeme: "", additionalInfo: hintUnexpectedEOF }); + throw _Parser2._parseError; + default: + throw this._errExpectedButGot(`true | false | KEY + | KEY '=~' REGEX + | KEY ('==' | '!=' | '<' | '<=' | '>' | '>=' | 'in' | 'not' 'in') value`, this._peek()); + } + } + _value() { + const token = this._peek(); + switch (token.type) { + case 17: + case 18: + this._advance(); + return token.lexeme; + case 11: + this._advance(); + return "true"; + case 12: + this._advance(); + return "false"; + case 13: + this._advance(); + return "in"; + default: + return ""; + } + } + _removeFlagsGY(flags) { + return flags.replaceAll(this._flagsGYRe, ""); + } + // careful: this can throw if current token is the initial one (ie index = 0) + _previous() { + return this._tokens[this._current - 1]; + } + _matchOne(token) { + if (this._check(token)) { + this._advance(); + return true; + } + return false; + } + _advance() { + if (!this._isAtEnd()) { + this._current++; + } + return this._previous(); + } + _consume(type, message) { + if (this._check(type)) { + return this._advance(); + } + throw this._errExpectedButGot(message, this._peek()); + } + _errExpectedButGot(expected, got, additionalInfo) { + const message = localize(1683, "Expected: {0}\nReceived: '{1}'.", expected, Scanner.getLexeme(got)); + const offset = got.offset; + const lexeme = Scanner.getLexeme(got); + this._parsingErrors.push({ message, offset, lexeme, additionalInfo }); + return _Parser2._parseError; + } + _check(type) { + return this._peek().type === type; + } + _peek() { + return this._tokens[this._current]; + } + _isAtEnd() { + return this._peek().type === 20; + } + }; + ContextKeyExpr = class { + static false() { + return ContextKeyFalseExpr.INSTANCE; + } + static true() { + return ContextKeyTrueExpr.INSTANCE; + } + static has(key) { + return ContextKeyDefinedExpr.create(key); + } + static equals(key, value) { + return ContextKeyEqualsExpr.create(key, value); + } + static notEquals(key, value) { + return ContextKeyNotEqualsExpr.create(key, value); + } + static regex(key, value) { + return ContextKeyRegexExpr.create(key, value); + } + static in(key, value) { + return ContextKeyInExpr.create(key, value); + } + static notIn(key, value) { + return ContextKeyNotInExpr.create(key, value); + } + static not(key) { + return ContextKeyNotExpr.create(key); + } + static and(...expr) { + return ContextKeyAndExpr.create(expr, null, true); + } + static or(...expr) { + return ContextKeyOrExpr.create(expr, null, true); + } + static { + this._parser = new Parser({ regexParsingWithErrorRecovery: false }); + } + static deserialize(serialized) { + if (serialized === void 0 || serialized === null) { + return void 0; + } + const expr = this._parser.parse(serialized); + return expr; + } + }; + ContextKeyFalseExpr = class _ContextKeyFalseExpr { + static { + this.INSTANCE = new _ContextKeyFalseExpr(); + } + constructor() { + this.type = 0; + } + cmp(other) { + return this.type - other.type; + } + equals(other) { + return other.type === this.type; + } + substituteConstants() { + return this; + } + evaluate(context) { + return false; + } + serialize() { + return "false"; + } + keys() { + return []; + } + negate() { + return ContextKeyTrueExpr.INSTANCE; + } + }; + ContextKeyTrueExpr = class _ContextKeyTrueExpr { + static { + this.INSTANCE = new _ContextKeyTrueExpr(); + } + constructor() { + this.type = 1; + } + cmp(other) { + return this.type - other.type; + } + equals(other) { + return other.type === this.type; + } + substituteConstants() { + return this; + } + evaluate(context) { + return true; + } + serialize() { + return "true"; + } + keys() { + return []; + } + negate() { + return ContextKeyFalseExpr.INSTANCE; + } + }; + ContextKeyDefinedExpr = class _ContextKeyDefinedExpr { + static create(key, negated = null) { + const constantValue = CONSTANT_VALUES.get(key); + if (typeof constantValue === "boolean") { + return constantValue ? ContextKeyTrueExpr.INSTANCE : ContextKeyFalseExpr.INSTANCE; + } + return new _ContextKeyDefinedExpr(key, negated); + } + constructor(key, negated) { + this.key = key; + this.negated = negated; + this.type = 2; + } + cmp(other) { + if (other.type !== this.type) { + return this.type - other.type; + } + return cmp1(this.key, other.key); + } + equals(other) { + if (other.type === this.type) { + return this.key === other.key; + } + return false; + } + substituteConstants() { + const constantValue = CONSTANT_VALUES.get(this.key); + if (typeof constantValue === "boolean") { + return constantValue ? ContextKeyTrueExpr.INSTANCE : ContextKeyFalseExpr.INSTANCE; + } + return this; + } + evaluate(context) { + return !!context.getValue(this.key); + } + serialize() { + return this.key; + } + keys() { + return [this.key]; + } + negate() { + if (!this.negated) { + this.negated = ContextKeyNotExpr.create(this.key, this); + } + return this.negated; + } + }; + ContextKeyEqualsExpr = class _ContextKeyEqualsExpr { + static create(key, value, negated = null) { + if (typeof value === "boolean") { + return value ? ContextKeyDefinedExpr.create(key, negated) : ContextKeyNotExpr.create(key, negated); + } + const constantValue = CONSTANT_VALUES.get(key); + if (typeof constantValue === "boolean") { + const trueValue = constantValue ? "true" : "false"; + return value === trueValue ? ContextKeyTrueExpr.INSTANCE : ContextKeyFalseExpr.INSTANCE; + } + return new _ContextKeyEqualsExpr(key, value, negated); + } + constructor(key, value, negated) { + this.key = key; + this.value = value; + this.negated = negated; + this.type = 4; + } + cmp(other) { + if (other.type !== this.type) { + return this.type - other.type; + } + return cmp2(this.key, this.value, other.key, other.value); + } + equals(other) { + if (other.type === this.type) { + return this.key === other.key && this.value === other.value; + } + return false; + } + substituteConstants() { + const constantValue = CONSTANT_VALUES.get(this.key); + if (typeof constantValue === "boolean") { + const trueValue = constantValue ? "true" : "false"; + return this.value === trueValue ? ContextKeyTrueExpr.INSTANCE : ContextKeyFalseExpr.INSTANCE; + } + return this; + } + evaluate(context) { + return context.getValue(this.key) == this.value; + } + serialize() { + return `${this.key} == '${this.value}'`; + } + keys() { + return [this.key]; + } + negate() { + if (!this.negated) { + this.negated = ContextKeyNotEqualsExpr.create(this.key, this.value, this); + } + return this.negated; + } + }; + ContextKeyInExpr = class _ContextKeyInExpr { + static create(key, valueKey) { + return new _ContextKeyInExpr(key, valueKey); + } + constructor(key, valueKey) { + this.key = key; + this.valueKey = valueKey; + this.type = 10; + this.negated = null; + } + cmp(other) { + if (other.type !== this.type) { + return this.type - other.type; + } + return cmp2(this.key, this.valueKey, other.key, other.valueKey); + } + equals(other) { + if (other.type === this.type) { + return this.key === other.key && this.valueKey === other.valueKey; + } + return false; + } + substituteConstants() { + return this; + } + evaluate(context) { + const source = context.getValue(this.valueKey); + const item = context.getValue(this.key); + if (Array.isArray(source)) { + return source.includes(item); + } + if (typeof item === "string" && typeof source === "object" && source !== null) { + return hasOwnProperty.call(source, item); + } + return false; + } + serialize() { + return `${this.key} in '${this.valueKey}'`; + } + keys() { + return [this.key, this.valueKey]; + } + negate() { + if (!this.negated) { + this.negated = ContextKeyNotInExpr.create(this.key, this.valueKey); + } + return this.negated; + } + }; + ContextKeyNotInExpr = class _ContextKeyNotInExpr { + static create(key, valueKey) { + return new _ContextKeyNotInExpr(key, valueKey); + } + constructor(key, valueKey) { + this.key = key; + this.valueKey = valueKey; + this.type = 11; + this._negated = ContextKeyInExpr.create(key, valueKey); + } + cmp(other) { + if (other.type !== this.type) { + return this.type - other.type; + } + return this._negated.cmp(other._negated); + } + equals(other) { + if (other.type === this.type) { + return this._negated.equals(other._negated); + } + return false; + } + substituteConstants() { + return this; + } + evaluate(context) { + return !this._negated.evaluate(context); + } + serialize() { + return `${this.key} not in '${this.valueKey}'`; + } + keys() { + return this._negated.keys(); + } + negate() { + return this._negated; + } + }; + ContextKeyNotEqualsExpr = class _ContextKeyNotEqualsExpr { + static create(key, value, negated = null) { + if (typeof value === "boolean") { + if (value) { + return ContextKeyNotExpr.create(key, negated); + } + return ContextKeyDefinedExpr.create(key, negated); + } + const constantValue = CONSTANT_VALUES.get(key); + if (typeof constantValue === "boolean") { + const falseValue = constantValue ? "true" : "false"; + return value === falseValue ? ContextKeyFalseExpr.INSTANCE : ContextKeyTrueExpr.INSTANCE; + } + return new _ContextKeyNotEqualsExpr(key, value, negated); + } + constructor(key, value, negated) { + this.key = key; + this.value = value; + this.negated = negated; + this.type = 5; + } + cmp(other) { + if (other.type !== this.type) { + return this.type - other.type; + } + return cmp2(this.key, this.value, other.key, other.value); + } + equals(other) { + if (other.type === this.type) { + return this.key === other.key && this.value === other.value; + } + return false; + } + substituteConstants() { + const constantValue = CONSTANT_VALUES.get(this.key); + if (typeof constantValue === "boolean") { + const falseValue = constantValue ? "true" : "false"; + return this.value === falseValue ? ContextKeyFalseExpr.INSTANCE : ContextKeyTrueExpr.INSTANCE; + } + return this; + } + evaluate(context) { + return context.getValue(this.key) != this.value; + } + serialize() { + return `${this.key} != '${this.value}'`; + } + keys() { + return [this.key]; + } + negate() { + if (!this.negated) { + this.negated = ContextKeyEqualsExpr.create(this.key, this.value, this); + } + return this.negated; + } + }; + ContextKeyNotExpr = class _ContextKeyNotExpr { + static create(key, negated = null) { + const constantValue = CONSTANT_VALUES.get(key); + if (typeof constantValue === "boolean") { + return constantValue ? ContextKeyFalseExpr.INSTANCE : ContextKeyTrueExpr.INSTANCE; + } + return new _ContextKeyNotExpr(key, negated); + } + constructor(key, negated) { + this.key = key; + this.negated = negated; + this.type = 3; + } + cmp(other) { + if (other.type !== this.type) { + return this.type - other.type; + } + return cmp1(this.key, other.key); + } + equals(other) { + if (other.type === this.type) { + return this.key === other.key; + } + return false; + } + substituteConstants() { + const constantValue = CONSTANT_VALUES.get(this.key); + if (typeof constantValue === "boolean") { + return constantValue ? ContextKeyFalseExpr.INSTANCE : ContextKeyTrueExpr.INSTANCE; + } + return this; + } + evaluate(context) { + return !context.getValue(this.key); + } + serialize() { + return `!${this.key}`; + } + keys() { + return [this.key]; + } + negate() { + if (!this.negated) { + this.negated = ContextKeyDefinedExpr.create(this.key, this); + } + return this.negated; + } + }; + ContextKeyGreaterExpr = class _ContextKeyGreaterExpr { + static create(key, _value, negated = null) { + return withFloatOrStr(_value, (value) => new _ContextKeyGreaterExpr(key, value, negated)); + } + constructor(key, value, negated) { + this.key = key; + this.value = value; + this.negated = negated; + this.type = 12; + } + cmp(other) { + if (other.type !== this.type) { + return this.type - other.type; + } + return cmp2(this.key, this.value, other.key, other.value); + } + equals(other) { + if (other.type === this.type) { + return this.key === other.key && this.value === other.value; + } + return false; + } + substituteConstants() { + return this; + } + evaluate(context) { + if (typeof this.value === "string") { + return false; + } + return parseFloat(context.getValue(this.key)) > this.value; + } + serialize() { + return `${this.key} > ${this.value}`; + } + keys() { + return [this.key]; + } + negate() { + if (!this.negated) { + this.negated = ContextKeySmallerEqualsExpr.create(this.key, this.value, this); + } + return this.negated; + } + }; + ContextKeyGreaterEqualsExpr = class _ContextKeyGreaterEqualsExpr { + static create(key, _value, negated = null) { + return withFloatOrStr(_value, (value) => new _ContextKeyGreaterEqualsExpr(key, value, negated)); + } + constructor(key, value, negated) { + this.key = key; + this.value = value; + this.negated = negated; + this.type = 13; + } + cmp(other) { + if (other.type !== this.type) { + return this.type - other.type; + } + return cmp2(this.key, this.value, other.key, other.value); + } + equals(other) { + if (other.type === this.type) { + return this.key === other.key && this.value === other.value; + } + return false; + } + substituteConstants() { + return this; + } + evaluate(context) { + if (typeof this.value === "string") { + return false; + } + return parseFloat(context.getValue(this.key)) >= this.value; + } + serialize() { + return `${this.key} >= ${this.value}`; + } + keys() { + return [this.key]; + } + negate() { + if (!this.negated) { + this.negated = ContextKeySmallerExpr.create(this.key, this.value, this); + } + return this.negated; + } + }; + ContextKeySmallerExpr = class _ContextKeySmallerExpr { + static create(key, _value, negated = null) { + return withFloatOrStr(_value, (value) => new _ContextKeySmallerExpr(key, value, negated)); + } + constructor(key, value, negated) { + this.key = key; + this.value = value; + this.negated = negated; + this.type = 14; + } + cmp(other) { + if (other.type !== this.type) { + return this.type - other.type; + } + return cmp2(this.key, this.value, other.key, other.value); + } + equals(other) { + if (other.type === this.type) { + return this.key === other.key && this.value === other.value; + } + return false; + } + substituteConstants() { + return this; + } + evaluate(context) { + if (typeof this.value === "string") { + return false; + } + return parseFloat(context.getValue(this.key)) < this.value; + } + serialize() { + return `${this.key} < ${this.value}`; + } + keys() { + return [this.key]; + } + negate() { + if (!this.negated) { + this.negated = ContextKeyGreaterEqualsExpr.create(this.key, this.value, this); + } + return this.negated; + } + }; + ContextKeySmallerEqualsExpr = class _ContextKeySmallerEqualsExpr { + static create(key, _value, negated = null) { + return withFloatOrStr(_value, (value) => new _ContextKeySmallerEqualsExpr(key, value, negated)); + } + constructor(key, value, negated) { + this.key = key; + this.value = value; + this.negated = negated; + this.type = 15; + } + cmp(other) { + if (other.type !== this.type) { + return this.type - other.type; + } + return cmp2(this.key, this.value, other.key, other.value); + } + equals(other) { + if (other.type === this.type) { + return this.key === other.key && this.value === other.value; + } + return false; + } + substituteConstants() { + return this; + } + evaluate(context) { + if (typeof this.value === "string") { + return false; + } + return parseFloat(context.getValue(this.key)) <= this.value; + } + serialize() { + return `${this.key} <= ${this.value}`; + } + keys() { + return [this.key]; + } + negate() { + if (!this.negated) { + this.negated = ContextKeyGreaterExpr.create(this.key, this.value, this); + } + return this.negated; + } + }; + ContextKeyRegexExpr = class _ContextKeyRegexExpr { + static create(key, regexp) { + return new _ContextKeyRegexExpr(key, regexp); + } + constructor(key, regexp) { + this.key = key; + this.regexp = regexp; + this.type = 7; + this.negated = null; + } + cmp(other) { + if (other.type !== this.type) { + return this.type - other.type; + } + if (this.key < other.key) { + return -1; + } + if (this.key > other.key) { + return 1; + } + const thisSource = this.regexp ? this.regexp.source : ""; + const otherSource = other.regexp ? other.regexp.source : ""; + if (thisSource < otherSource) { + return -1; + } + if (thisSource > otherSource) { + return 1; + } + return 0; + } + equals(other) { + if (other.type === this.type) { + const thisSource = this.regexp ? this.regexp.source : ""; + const otherSource = other.regexp ? other.regexp.source : ""; + return this.key === other.key && thisSource === otherSource; + } + return false; + } + substituteConstants() { + return this; + } + evaluate(context) { + const value = context.getValue(this.key); + return this.regexp ? this.regexp.test(value) : false; + } + serialize() { + const value = this.regexp ? `/${this.regexp.source}/${this.regexp.flags}` : "/invalid/"; + return `${this.key} =~ ${value}`; + } + keys() { + return [this.key]; + } + negate() { + if (!this.negated) { + this.negated = ContextKeyNotRegexExpr.create(this); + } + return this.negated; + } + }; + ContextKeyNotRegexExpr = class _ContextKeyNotRegexExpr { + static create(actual) { + return new _ContextKeyNotRegexExpr(actual); + } + constructor(_actual) { + this._actual = _actual; + this.type = 8; + } + cmp(other) { + if (other.type !== this.type) { + return this.type - other.type; + } + return this._actual.cmp(other._actual); + } + equals(other) { + if (other.type === this.type) { + return this._actual.equals(other._actual); + } + return false; + } + substituteConstants() { + return this; + } + evaluate(context) { + return !this._actual.evaluate(context); + } + serialize() { + return `!(${this._actual.serialize()})`; + } + keys() { + return this._actual.keys(); + } + negate() { + return this._actual; + } + }; + ContextKeyAndExpr = class _ContextKeyAndExpr { + static create(_expr, negated, extraRedundantCheck) { + return _ContextKeyAndExpr._normalizeArr(_expr, negated, extraRedundantCheck); + } + constructor(expr, negated) { + this.expr = expr; + this.negated = negated; + this.type = 6; + } + cmp(other) { + if (other.type !== this.type) { + return this.type - other.type; + } + if (this.expr.length < other.expr.length) { + return -1; + } + if (this.expr.length > other.expr.length) { + return 1; + } + for (let i2 = 0, len = this.expr.length; i2 < len; i2++) { + const r = cmp(this.expr[i2], other.expr[i2]); + if (r !== 0) { + return r; + } + } + return 0; + } + equals(other) { + if (other.type === this.type) { + if (this.expr.length !== other.expr.length) { + return false; + } + for (let i2 = 0, len = this.expr.length; i2 < len; i2++) { + if (!this.expr[i2].equals(other.expr[i2])) { + return false; + } + } + return true; + } + return false; + } + substituteConstants() { + const exprArr = eliminateConstantsInArray(this.expr); + if (exprArr === this.expr) { + return this; + } + return _ContextKeyAndExpr.create(exprArr, this.negated, false); + } + evaluate(context) { + for (let i2 = 0, len = this.expr.length; i2 < len; i2++) { + if (!this.expr[i2].evaluate(context)) { + return false; + } + } + return true; + } + static _normalizeArr(arr, negated, extraRedundantCheck) { + const expr = []; + let hasTrue = false; + for (const e of arr) { + if (!e) { + continue; + } + if (e.type === 1) { + hasTrue = true; + continue; + } + if (e.type === 0) { + return ContextKeyFalseExpr.INSTANCE; + } + if (e.type === 6) { + expr.push(...e.expr); + continue; + } + expr.push(e); + } + if (expr.length === 0 && hasTrue) { + return ContextKeyTrueExpr.INSTANCE; + } + if (expr.length === 0) { + return void 0; + } + if (expr.length === 1) { + return expr[0]; + } + expr.sort(cmp); + for (let i2 = 1; i2 < expr.length; i2++) { + if (expr[i2 - 1].equals(expr[i2])) { + expr.splice(i2, 1); + i2--; + } + } + if (expr.length === 1) { + return expr[0]; + } + while (expr.length > 1) { + const lastElement = expr[expr.length - 1]; + if (lastElement.type !== 9) { + break; + } + expr.pop(); + const secondToLastElement = expr.pop(); + const isFinished = expr.length === 0; + const resultElement = ContextKeyOrExpr.create(lastElement.expr.map((el) => _ContextKeyAndExpr.create([el, secondToLastElement], null, extraRedundantCheck)), null, isFinished); + if (resultElement) { + expr.push(resultElement); + expr.sort(cmp); + } + } + if (expr.length === 1) { + return expr[0]; + } + if (extraRedundantCheck) { + for (let i2 = 0; i2 < expr.length; i2++) { + for (let j = i2 + 1; j < expr.length; j++) { + if (expr[i2].negate().equals(expr[j])) { + return ContextKeyFalseExpr.INSTANCE; + } + } + } + if (expr.length === 1) { + return expr[0]; + } + } + return new _ContextKeyAndExpr(expr, negated); + } + serialize() { + return this.expr.map((e) => e.serialize()).join(" && "); + } + keys() { + const result = []; + for (const expr of this.expr) { + result.push(...expr.keys()); + } + return result; + } + negate() { + if (!this.negated) { + const result = []; + for (const expr of this.expr) { + result.push(expr.negate()); + } + this.negated = ContextKeyOrExpr.create(result, this, true); + } + return this.negated; + } + }; + ContextKeyOrExpr = class _ContextKeyOrExpr { + static create(_expr, negated, extraRedundantCheck) { + return _ContextKeyOrExpr._normalizeArr(_expr, negated, extraRedundantCheck); + } + constructor(expr, negated) { + this.expr = expr; + this.negated = negated; + this.type = 9; + } + cmp(other) { + if (other.type !== this.type) { + return this.type - other.type; + } + if (this.expr.length < other.expr.length) { + return -1; + } + if (this.expr.length > other.expr.length) { + return 1; + } + for (let i2 = 0, len = this.expr.length; i2 < len; i2++) { + const r = cmp(this.expr[i2], other.expr[i2]); + if (r !== 0) { + return r; + } + } + return 0; + } + equals(other) { + if (other.type === this.type) { + if (this.expr.length !== other.expr.length) { + return false; + } + for (let i2 = 0, len = this.expr.length; i2 < len; i2++) { + if (!this.expr[i2].equals(other.expr[i2])) { + return false; + } + } + return true; + } + return false; + } + substituteConstants() { + const exprArr = eliminateConstantsInArray(this.expr); + if (exprArr === this.expr) { + return this; + } + return _ContextKeyOrExpr.create(exprArr, this.negated, false); + } + evaluate(context) { + for (let i2 = 0, len = this.expr.length; i2 < len; i2++) { + if (this.expr[i2].evaluate(context)) { + return true; + } + } + return false; + } + static _normalizeArr(arr, negated, extraRedundantCheck) { + let expr = []; + let hasFalse = false; + if (arr) { + for (let i2 = 0, len = arr.length; i2 < len; i2++) { + const e = arr[i2]; + if (!e) { + continue; + } + if (e.type === 0) { + hasFalse = true; + continue; + } + if (e.type === 1) { + return ContextKeyTrueExpr.INSTANCE; + } + if (e.type === 9) { + expr = expr.concat(e.expr); + continue; + } + expr.push(e); + } + if (expr.length === 0 && hasFalse) { + return ContextKeyFalseExpr.INSTANCE; + } + expr.sort(cmp); + } + if (expr.length === 0) { + return void 0; + } + if (expr.length === 1) { + return expr[0]; + } + for (let i2 = 1; i2 < expr.length; i2++) { + if (expr[i2 - 1].equals(expr[i2])) { + expr.splice(i2, 1); + i2--; + } + } + if (expr.length === 1) { + return expr[0]; + } + if (extraRedundantCheck) { + for (let i2 = 0; i2 < expr.length; i2++) { + for (let j = i2 + 1; j < expr.length; j++) { + if (expr[i2].negate().equals(expr[j])) { + return ContextKeyTrueExpr.INSTANCE; + } + } + } + if (expr.length === 1) { + return expr[0]; + } + } + return new _ContextKeyOrExpr(expr, negated); + } + serialize() { + return this.expr.map((e) => e.serialize()).join(" || "); + } + keys() { + const result = []; + for (const expr of this.expr) { + result.push(...expr.keys()); + } + return result; + } + negate() { + if (!this.negated) { + const result = []; + for (const expr of this.expr) { + result.push(expr.negate()); + } + while (result.length > 1) { + const LEFT = result.shift(); + const RIGHT = result.shift(); + const all = []; + for (const left of getTerminals(LEFT)) { + for (const right of getTerminals(RIGHT)) { + all.push(ContextKeyAndExpr.create([left, right], null, false)); + } + } + result.unshift(_ContextKeyOrExpr.create(all, null, false)); + } + this.negated = _ContextKeyOrExpr.create(result, this, true); + } + return this.negated; + } + }; + RawContextKey = class _RawContextKey extends ContextKeyDefinedExpr { + static { + this._info = []; + } + static all() { + return _RawContextKey._info.values(); + } + constructor(key, defaultValue, metaOrHide) { + super(key, null); + this._defaultValue = defaultValue; + if (typeof metaOrHide === "object") { + _RawContextKey._info.push({ ...metaOrHide, key }); + } else if (metaOrHide !== true) { + _RawContextKey._info.push({ key, description: metaOrHide, type: defaultValue !== null && defaultValue !== void 0 ? typeof defaultValue : void 0 }); + } + } + bindTo(target) { + return target.createKey(this.key, this._defaultValue); + } + getValue(target) { + return target.getContextKeyValue(this.key); + } + toNegated() { + return this.negate(); + } + isEqualTo(value) { + return ContextKeyEqualsExpr.create(this.key, value); + } + }; + IContextKeyService = createDecorator("contextKeyService"); + } +}); + +// node_modules/monaco-editor-core/esm/vs/platform/registry/common/platform.js +var RegistryImpl, Registry; +var init_platform2 = __esm({ + "node_modules/monaco-editor-core/esm/vs/platform/registry/common/platform.js"() { + init_assert(); + init_types(); + RegistryImpl = class { + constructor() { + this.data = /* @__PURE__ */ new Map(); + } + add(id, data) { + ok(isString(id)); + ok(isObject(data)); + ok(!this.data.has(id), "There is already an extension with this id"); + this.data.set(id, data); + } + as(id) { + return this.data.get(id) || null; + } + dispose() { + this.data.forEach((value) => { + if (isFunction(value.dispose)) { + value.dispose(); + } + }); + this.data.clear(); + } + }; + Registry = new RegistryImpl(); + } +}); + +// node_modules/monaco-editor-core/esm/vs/platform/keybinding/common/keybindingsRegistry.js +function sorter(a, b) { + if (a.weight1 !== b.weight1) { + return a.weight1 - b.weight1; + } + if (a.command && b.command) { + if (a.command < b.command) { + return -1; + } + if (a.command > b.command) { + return 1; + } + } + return a.weight2 - b.weight2; +} +var KeybindingsRegistryImpl, KeybindingsRegistry, Extensions; +var init_keybindingsRegistry = __esm({ + "node_modules/monaco-editor-core/esm/vs/platform/keybinding/common/keybindingsRegistry.js"() { + init_keybindings(); + init_platform(); + init_commands(); + init_platform2(); + init_lifecycle(); + init_linkedList(); + KeybindingsRegistryImpl = class _KeybindingsRegistryImpl { + constructor() { + this._coreKeybindings = new LinkedList(); + this._extensionKeybindings = []; + this._cachedMergedKeybindings = null; + } + /** + * Take current platform into account and reduce to primary & secondary. + */ + static bindToCurrentPlatform(kb) { + if (OS === 1) { + if (kb && kb.win) { + return kb.win; + } + } else if (OS === 2) { + if (kb && kb.mac) { + return kb.mac; + } + } else { + if (kb && kb.linux) { + return kb.linux; + } + } + return kb; + } + registerKeybindingRule(rule) { + const actualKb = _KeybindingsRegistryImpl.bindToCurrentPlatform(rule); + const result = new DisposableStore(); + if (actualKb && actualKb.primary) { + const kk = decodeKeybinding(actualKb.primary, OS); + if (kk) { + result.add(this._registerDefaultKeybinding(kk, rule.id, rule.args, rule.weight, 0, rule.when)); + } + } + if (actualKb && Array.isArray(actualKb.secondary)) { + for (let i2 = 0, len = actualKb.secondary.length; i2 < len; i2++) { + const k = actualKb.secondary[i2]; + const kk = decodeKeybinding(k, OS); + if (kk) { + result.add(this._registerDefaultKeybinding(kk, rule.id, rule.args, rule.weight, -i2 - 1, rule.when)); + } + } + } + return result; + } + registerCommandAndKeybindingRule(desc) { + return combinedDisposable(this.registerKeybindingRule(desc), CommandsRegistry.registerCommand(desc)); + } + _registerDefaultKeybinding(keybinding, commandId, commandArgs, weight1, weight22, when) { + const remove = this._coreKeybindings.push({ + keybinding, + command: commandId, + commandArgs, + when, + weight1, + weight2: weight22, + extensionId: null, + isBuiltinExtension: false + }); + this._cachedMergedKeybindings = null; + return toDisposable(() => { + remove(); + this._cachedMergedKeybindings = null; + }); + } + getDefaultKeybindings() { + if (!this._cachedMergedKeybindings) { + this._cachedMergedKeybindings = Array.from(this._coreKeybindings).concat(this._extensionKeybindings); + this._cachedMergedKeybindings.sort(sorter); + } + return this._cachedMergedKeybindings.slice(0); + } + }; + KeybindingsRegistry = new KeybindingsRegistryImpl(); + Extensions = { + EditorModes: "platform.keybindingsRegistry" + }; + Registry.add(Extensions.EditorModes, KeybindingsRegistry); + } +}); + +// node_modules/monaco-editor-core/esm/vs/platform/actions/common/actions.js +function isIMenuItem(item) { + return item.command !== void 0; +} +function isISubmenuItem(item) { + return item.submenu !== void 0; +} +function registerAction2(ctor) { + const disposables = []; + const action = new ctor(); + const { f1, menu, keybinding, ...command } = action.desc; + if (CommandsRegistry.getCommand(command.id)) { + throw new Error(`Cannot register two commands with the same id: ${command.id}`); + } + disposables.push(CommandsRegistry.registerCommand({ + id: command.id, + handler: (accessor, ...args) => action.run(accessor, ...args), + metadata: command.metadata ?? { description: action.desc.title } + })); + if (Array.isArray(menu)) { + for (const item of menu) { + disposables.push(MenuRegistry.appendMenuItem(item.id, { command: { ...command, precondition: item.precondition === null ? void 0 : command.precondition }, ...item })); + } + } else if (menu) { + disposables.push(MenuRegistry.appendMenuItem(menu.id, { command: { ...command, precondition: menu.precondition === null ? void 0 : command.precondition }, ...menu })); + } + if (f1) { + disposables.push(MenuRegistry.appendMenuItem(MenuId.CommandPalette, { command, when: command.precondition })); + disposables.push(MenuRegistry.addCommand(command)); + } + if (Array.isArray(keybinding)) { + for (const item of keybinding) { + disposables.push(KeybindingsRegistry.registerKeybindingRule({ + ...item, + id: command.id, + when: command.precondition ? ContextKeyExpr.and(command.precondition, item.when) : item.when + })); + } + } else if (keybinding) { + disposables.push(KeybindingsRegistry.registerKeybindingRule({ + ...keybinding, + id: command.id, + when: command.precondition ? ContextKeyExpr.and(command.precondition, keybinding.when) : keybinding.when + })); + } + return { + dispose() { + dispose(disposables); + } + }; +} +var __decorate, __param, MenuItemAction_1, MenuId, IMenuService, MenuRegistryChangeEvent, MenuRegistry, SubmenuItemAction, MenuItemAction, Action2; +var init_actions2 = __esm({ + "node_modules/monaco-editor-core/esm/vs/platform/actions/common/actions.js"() { + init_actions(); + init_event(); + init_lifecycle(); + init_linkedList(); + init_themables(); + init_commands(); + init_contextkey(); + init_instantiation(); + init_keybindingsRegistry(); + __decorate = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + __param = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + MenuId = class _MenuId { + static { + this._instances = /* @__PURE__ */ new Map(); + } + static { + this.CommandPalette = new _MenuId("CommandPalette"); + } + static { + this.DebugBreakpointsContext = new _MenuId("DebugBreakpointsContext"); + } + static { + this.DebugCallStackContext = new _MenuId("DebugCallStackContext"); + } + static { + this.DebugConsoleContext = new _MenuId("DebugConsoleContext"); + } + static { + this.DebugVariablesContext = new _MenuId("DebugVariablesContext"); + } + static { + this.NotebookVariablesContext = new _MenuId("NotebookVariablesContext"); + } + static { + this.DebugHoverContext = new _MenuId("DebugHoverContext"); + } + static { + this.DebugWatchContext = new _MenuId("DebugWatchContext"); + } + static { + this.DebugToolBar = new _MenuId("DebugToolBar"); + } + static { + this.DebugToolBarStop = new _MenuId("DebugToolBarStop"); + } + static { + this.DebugDisassemblyContext = new _MenuId("DebugDisassemblyContext"); + } + static { + this.DebugCallStackToolbar = new _MenuId("DebugCallStackToolbar"); + } + static { + this.DebugCreateConfiguration = new _MenuId("DebugCreateConfiguration"); + } + static { + this.EditorContext = new _MenuId("EditorContext"); + } + static { + this.SimpleEditorContext = new _MenuId("SimpleEditorContext"); + } + static { + this.EditorContent = new _MenuId("EditorContent"); + } + static { + this.EditorLineNumberContext = new _MenuId("EditorLineNumberContext"); + } + static { + this.EditorContextCopy = new _MenuId("EditorContextCopy"); + } + static { + this.EditorContextPeek = new _MenuId("EditorContextPeek"); + } + static { + this.EditorContextShare = new _MenuId("EditorContextShare"); + } + static { + this.EditorTitle = new _MenuId("EditorTitle"); + } + static { + this.CompactWindowEditorTitle = new _MenuId("CompactWindowEditorTitle"); + } + static { + this.EditorTitleRun = new _MenuId("EditorTitleRun"); + } + static { + this.EditorTitleContext = new _MenuId("EditorTitleContext"); + } + static { + this.EditorTitleContextShare = new _MenuId("EditorTitleContextShare"); + } + static { + this.EmptyEditorGroup = new _MenuId("EmptyEditorGroup"); + } + static { + this.EmptyEditorGroupContext = new _MenuId("EmptyEditorGroupContext"); + } + static { + this.EditorTabsBarContext = new _MenuId("EditorTabsBarContext"); + } + static { + this.EditorTabsBarShowTabsSubmenu = new _MenuId("EditorTabsBarShowTabsSubmenu"); + } + static { + this.EditorTabsBarShowTabsZenModeSubmenu = new _MenuId("EditorTabsBarShowTabsZenModeSubmenu"); + } + static { + this.EditorActionsPositionSubmenu = new _MenuId("EditorActionsPositionSubmenu"); + } + static { + this.EditorSplitMoveSubmenu = new _MenuId("EditorSplitMoveSubmenu"); + } + static { + this.ExplorerContext = new _MenuId("ExplorerContext"); + } + static { + this.ExplorerContextShare = new _MenuId("ExplorerContextShare"); + } + static { + this.ExtensionContext = new _MenuId("ExtensionContext"); + } + static { + this.ExtensionEditorContextMenu = new _MenuId("ExtensionEditorContextMenu"); + } + static { + this.GlobalActivity = new _MenuId("GlobalActivity"); + } + static { + this.CommandCenter = new _MenuId("CommandCenter"); + } + static { + this.CommandCenterCenter = new _MenuId("CommandCenterCenter"); + } + static { + this.LayoutControlMenuSubmenu = new _MenuId("LayoutControlMenuSubmenu"); + } + static { + this.LayoutControlMenu = new _MenuId("LayoutControlMenu"); + } + static { + this.MenubarMainMenu = new _MenuId("MenubarMainMenu"); + } + static { + this.MenubarAppearanceMenu = new _MenuId("MenubarAppearanceMenu"); + } + static { + this.MenubarDebugMenu = new _MenuId("MenubarDebugMenu"); + } + static { + this.MenubarEditMenu = new _MenuId("MenubarEditMenu"); + } + static { + this.MenubarCopy = new _MenuId("MenubarCopy"); + } + static { + this.MenubarFileMenu = new _MenuId("MenubarFileMenu"); + } + static { + this.MenubarGoMenu = new _MenuId("MenubarGoMenu"); + } + static { + this.MenubarHelpMenu = new _MenuId("MenubarHelpMenu"); + } + static { + this.MenubarLayoutMenu = new _MenuId("MenubarLayoutMenu"); + } + static { + this.MenubarNewBreakpointMenu = new _MenuId("MenubarNewBreakpointMenu"); + } + static { + this.PanelAlignmentMenu = new _MenuId("PanelAlignmentMenu"); + } + static { + this.PanelPositionMenu = new _MenuId("PanelPositionMenu"); + } + static { + this.ActivityBarPositionMenu = new _MenuId("ActivityBarPositionMenu"); + } + static { + this.MenubarPreferencesMenu = new _MenuId("MenubarPreferencesMenu"); + } + static { + this.MenubarRecentMenu = new _MenuId("MenubarRecentMenu"); + } + static { + this.MenubarSelectionMenu = new _MenuId("MenubarSelectionMenu"); + } + static { + this.MenubarShare = new _MenuId("MenubarShare"); + } + static { + this.MenubarSwitchEditorMenu = new _MenuId("MenubarSwitchEditorMenu"); + } + static { + this.MenubarSwitchGroupMenu = new _MenuId("MenubarSwitchGroupMenu"); + } + static { + this.MenubarTerminalMenu = new _MenuId("MenubarTerminalMenu"); + } + static { + this.MenubarTerminalSuggestStatusMenu = new _MenuId("MenubarTerminalSuggestStatusMenu"); + } + static { + this.MenubarViewMenu = new _MenuId("MenubarViewMenu"); + } + static { + this.MenubarHomeMenu = new _MenuId("MenubarHomeMenu"); + } + static { + this.OpenEditorsContext = new _MenuId("OpenEditorsContext"); + } + static { + this.OpenEditorsContextShare = new _MenuId("OpenEditorsContextShare"); + } + static { + this.ProblemsPanelContext = new _MenuId("ProblemsPanelContext"); + } + static { + this.SCMInputBox = new _MenuId("SCMInputBox"); + } + static { + this.SCMChangeContext = new _MenuId("SCMChangeContext"); + } + static { + this.SCMResourceContext = new _MenuId("SCMResourceContext"); + } + static { + this.SCMResourceContextShare = new _MenuId("SCMResourceContextShare"); + } + static { + this.SCMResourceFolderContext = new _MenuId("SCMResourceFolderContext"); + } + static { + this.SCMResourceGroupContext = new _MenuId("SCMResourceGroupContext"); + } + static { + this.SCMSourceControl = new _MenuId("SCMSourceControl"); + } + static { + this.SCMSourceControlInline = new _MenuId("SCMSourceControlInline"); + } + static { + this.SCMSourceControlTitle = new _MenuId("SCMSourceControlTitle"); + } + static { + this.SCMHistoryTitle = new _MenuId("SCMHistoryTitle"); + } + static { + this.SCMHistoryItemContext = new _MenuId("SCMHistoryItemContext"); + } + static { + this.SCMHistoryItemChangeContext = new _MenuId("SCMHistoryItemChangeContext"); + } + static { + this.SCMHistoryItemRefContext = new _MenuId("SCMHistoryItemRefContext"); + } + static { + this.SCMArtifactGroupContext = new _MenuId("SCMArtifactGroupContext"); + } + static { + this.SCMArtifactContext = new _MenuId("SCMArtifactContext"); + } + static { + this.SCMQuickDiffDecorations = new _MenuId("SCMQuickDiffDecorations"); + } + static { + this.SCMTitle = new _MenuId("SCMTitle"); + } + static { + this.SearchContext = new _MenuId("SearchContext"); + } + static { + this.SearchActionMenu = new _MenuId("SearchActionContext"); + } + static { + this.StatusBarWindowIndicatorMenu = new _MenuId("StatusBarWindowIndicatorMenu"); + } + static { + this.StatusBarRemoteIndicatorMenu = new _MenuId("StatusBarRemoteIndicatorMenu"); + } + static { + this.StickyScrollContext = new _MenuId("StickyScrollContext"); + } + static { + this.TestItem = new _MenuId("TestItem"); + } + static { + this.TestItemGutter = new _MenuId("TestItemGutter"); + } + static { + this.TestProfilesContext = new _MenuId("TestProfilesContext"); + } + static { + this.TestMessageContext = new _MenuId("TestMessageContext"); + } + static { + this.TestMessageContent = new _MenuId("TestMessageContent"); + } + static { + this.TestPeekElement = new _MenuId("TestPeekElement"); + } + static { + this.TestPeekTitle = new _MenuId("TestPeekTitle"); + } + static { + this.TestCallStack = new _MenuId("TestCallStack"); + } + static { + this.TestCoverageFilterItem = new _MenuId("TestCoverageFilterItem"); + } + static { + this.TouchBarContext = new _MenuId("TouchBarContext"); + } + static { + this.TitleBar = new _MenuId("TitleBar"); + } + static { + this.TitleBarContext = new _MenuId("TitleBarContext"); + } + static { + this.TitleBarTitleContext = new _MenuId("TitleBarTitleContext"); + } + static { + this.TunnelContext = new _MenuId("TunnelContext"); + } + static { + this.TunnelPrivacy = new _MenuId("TunnelPrivacy"); + } + static { + this.TunnelProtocol = new _MenuId("TunnelProtocol"); + } + static { + this.TunnelPortInline = new _MenuId("TunnelInline"); + } + static { + this.TunnelTitle = new _MenuId("TunnelTitle"); + } + static { + this.TunnelLocalAddressInline = new _MenuId("TunnelLocalAddressInline"); + } + static { + this.TunnelOriginInline = new _MenuId("TunnelOriginInline"); + } + static { + this.ViewItemContext = new _MenuId("ViewItemContext"); + } + static { + this.ViewContainerTitle = new _MenuId("ViewContainerTitle"); + } + static { + this.ViewContainerTitleContext = new _MenuId("ViewContainerTitleContext"); + } + static { + this.ViewTitle = new _MenuId("ViewTitle"); + } + static { + this.ViewTitleContext = new _MenuId("ViewTitleContext"); + } + static { + this.CommentEditorActions = new _MenuId("CommentEditorActions"); + } + static { + this.CommentThreadTitle = new _MenuId("CommentThreadTitle"); + } + static { + this.CommentThreadActions = new _MenuId("CommentThreadActions"); + } + static { + this.CommentThreadAdditionalActions = new _MenuId("CommentThreadAdditionalActions"); + } + static { + this.CommentThreadTitleContext = new _MenuId("CommentThreadTitleContext"); + } + static { + this.CommentThreadCommentContext = new _MenuId("CommentThreadCommentContext"); + } + static { + this.CommentTitle = new _MenuId("CommentTitle"); + } + static { + this.CommentActions = new _MenuId("CommentActions"); + } + static { + this.CommentsViewThreadActions = new _MenuId("CommentsViewThreadActions"); + } + static { + this.InteractiveToolbar = new _MenuId("InteractiveToolbar"); + } + static { + this.InteractiveCellTitle = new _MenuId("InteractiveCellTitle"); + } + static { + this.InteractiveCellDelete = new _MenuId("InteractiveCellDelete"); + } + static { + this.InteractiveCellExecute = new _MenuId("InteractiveCellExecute"); + } + static { + this.InteractiveInputExecute = new _MenuId("InteractiveInputExecute"); + } + static { + this.InteractiveInputConfig = new _MenuId("InteractiveInputConfig"); + } + static { + this.ReplInputExecute = new _MenuId("ReplInputExecute"); + } + static { + this.IssueReporter = new _MenuId("IssueReporter"); + } + static { + this.NotebookToolbar = new _MenuId("NotebookToolbar"); + } + static { + this.NotebookToolbarContext = new _MenuId("NotebookToolbarContext"); + } + static { + this.NotebookStickyScrollContext = new _MenuId("NotebookStickyScrollContext"); + } + static { + this.NotebookCellTitle = new _MenuId("NotebookCellTitle"); + } + static { + this.NotebookCellDelete = new _MenuId("NotebookCellDelete"); + } + static { + this.NotebookCellInsert = new _MenuId("NotebookCellInsert"); + } + static { + this.NotebookCellBetween = new _MenuId("NotebookCellBetween"); + } + static { + this.NotebookCellListTop = new _MenuId("NotebookCellTop"); + } + static { + this.NotebookCellExecute = new _MenuId("NotebookCellExecute"); + } + static { + this.NotebookCellExecuteGoTo = new _MenuId("NotebookCellExecuteGoTo"); + } + static { + this.NotebookCellExecutePrimary = new _MenuId("NotebookCellExecutePrimary"); + } + static { + this.NotebookDiffCellInputTitle = new _MenuId("NotebookDiffCellInputTitle"); + } + static { + this.NotebookDiffDocumentMetadata = new _MenuId("NotebookDiffDocumentMetadata"); + } + static { + this.NotebookDiffCellMetadataTitle = new _MenuId("NotebookDiffCellMetadataTitle"); + } + static { + this.NotebookDiffCellOutputsTitle = new _MenuId("NotebookDiffCellOutputsTitle"); + } + static { + this.NotebookOutputToolbar = new _MenuId("NotebookOutputToolbar"); + } + static { + this.NotebookOutlineFilter = new _MenuId("NotebookOutlineFilter"); + } + static { + this.NotebookOutlineActionMenu = new _MenuId("NotebookOutlineActionMenu"); + } + static { + this.NotebookEditorLayoutConfigure = new _MenuId("NotebookEditorLayoutConfigure"); + } + static { + this.NotebookKernelSource = new _MenuId("NotebookKernelSource"); + } + static { + this.BulkEditTitle = new _MenuId("BulkEditTitle"); + } + static { + this.BulkEditContext = new _MenuId("BulkEditContext"); + } + static { + this.TimelineItemContext = new _MenuId("TimelineItemContext"); + } + static { + this.TimelineTitle = new _MenuId("TimelineTitle"); + } + static { + this.TimelineTitleContext = new _MenuId("TimelineTitleContext"); + } + static { + this.TimelineFilterSubMenu = new _MenuId("TimelineFilterSubMenu"); + } + static { + this.AccountsContext = new _MenuId("AccountsContext"); + } + static { + this.SidebarTitle = new _MenuId("SidebarTitle"); + } + static { + this.PanelTitle = new _MenuId("PanelTitle"); + } + static { + this.AuxiliaryBarTitle = new _MenuId("AuxiliaryBarTitle"); + } + static { + this.TerminalInstanceContext = new _MenuId("TerminalInstanceContext"); + } + static { + this.TerminalEditorInstanceContext = new _MenuId("TerminalEditorInstanceContext"); + } + static { + this.TerminalNewDropdownContext = new _MenuId("TerminalNewDropdownContext"); + } + static { + this.TerminalTabContext = new _MenuId("TerminalTabContext"); + } + static { + this.TerminalTabEmptyAreaContext = new _MenuId("TerminalTabEmptyAreaContext"); + } + static { + this.TerminalStickyScrollContext = new _MenuId("TerminalStickyScrollContext"); + } + static { + this.WebviewContext = new _MenuId("WebviewContext"); + } + static { + this.InlineCompletionsActions = new _MenuId("InlineCompletionsActions"); + } + static { + this.InlineEditsActions = new _MenuId("InlineEditsActions"); + } + static { + this.NewFile = new _MenuId("NewFile"); + } + static { + this.MergeInput1Toolbar = new _MenuId("MergeToolbar1Toolbar"); + } + static { + this.MergeInput2Toolbar = new _MenuId("MergeToolbar2Toolbar"); + } + static { + this.MergeBaseToolbar = new _MenuId("MergeBaseToolbar"); + } + static { + this.MergeInputResultToolbar = new _MenuId("MergeToolbarResultToolbar"); + } + static { + this.InlineSuggestionToolbar = new _MenuId("InlineSuggestionToolbar"); + } + static { + this.InlineEditToolbar = new _MenuId("InlineEditToolbar"); + } + static { + this.ChatContext = new _MenuId("ChatContext"); + } + static { + this.ChatCodeBlock = new _MenuId("ChatCodeblock"); + } + static { + this.ChatCompareBlock = new _MenuId("ChatCompareBlock"); + } + static { + this.ChatMessageTitle = new _MenuId("ChatMessageTitle"); + } + static { + this.ChatHistory = new _MenuId("ChatHistory"); + } + static { + this.ChatWelcomeContext = new _MenuId("ChatWelcomeContext"); + } + static { + this.ChatMessageFooter = new _MenuId("ChatMessageFooter"); + } + static { + this.ChatExecute = new _MenuId("ChatExecute"); + } + static { + this.ChatInput = new _MenuId("ChatInput"); + } + static { + this.ChatInputSide = new _MenuId("ChatInputSide"); + } + static { + this.ChatModePicker = new _MenuId("ChatModePicker"); + } + static { + this.ChatEditingWidgetToolbar = new _MenuId("ChatEditingWidgetToolbar"); + } + static { + this.ChatEditingEditorContent = new _MenuId("ChatEditingEditorContent"); + } + static { + this.ChatEditingEditorHunk = new _MenuId("ChatEditingEditorHunk"); + } + static { + this.ChatEditingDeletedNotebookCell = new _MenuId("ChatEditingDeletedNotebookCell"); + } + static { + this.ChatInputAttachmentToolbar = new _MenuId("ChatInputAttachmentToolbar"); + } + static { + this.ChatEditingWidgetModifiedFilesToolbar = new _MenuId("ChatEditingWidgetModifiedFilesToolbar"); + } + static { + this.ChatInputResourceAttachmentContext = new _MenuId("ChatInputResourceAttachmentContext"); + } + static { + this.ChatInputSymbolAttachmentContext = new _MenuId("ChatInputSymbolAttachmentContext"); + } + static { + this.ChatInlineResourceAnchorContext = new _MenuId("ChatInlineResourceAnchorContext"); + } + static { + this.ChatInlineSymbolAnchorContext = new _MenuId("ChatInlineSymbolAnchorContext"); + } + static { + this.ChatMessageCheckpoint = new _MenuId("ChatMessageCheckpoint"); + } + static { + this.ChatMessageRestoreCheckpoint = new _MenuId("ChatMessageRestoreCheckpoint"); + } + static { + this.ChatNewMenu = new _MenuId("ChatNewMenu"); + } + static { + this.ChatEditingCodeBlockContext = new _MenuId("ChatEditingCodeBlockContext"); + } + static { + this.ChatTitleBarMenu = new _MenuId("ChatTitleBarMenu"); + } + static { + this.ChatAttachmentsContext = new _MenuId("ChatAttachmentsContext"); + } + static { + this.ChatToolOutputResourceToolbar = new _MenuId("ChatToolOutputResourceToolbar"); + } + static { + this.ChatTextEditorMenu = new _MenuId("ChatTextEditorMenu"); + } + static { + this.ChatToolOutputResourceContext = new _MenuId("ChatToolOutputResourceContext"); + } + static { + this.ChatMultiDiffContext = new _MenuId("ChatMultiDiffContext"); + } + static { + this.ChatSessionsMenu = new _MenuId("ChatSessionsMenu"); + } + static { + this.ChatSessionsCreateSubMenu = new _MenuId("ChatSessionsCreateSubMenu"); + } + static { + this.ChatConfirmationMenu = new _MenuId("ChatConfirmationMenu"); + } + static { + this.ChatEditorInlineExecute = new _MenuId("ChatEditorInputExecute"); + } + static { + this.ChatEditorInlineInputSide = new _MenuId("ChatEditorInputSide"); + } + static { + this.AccessibleView = new _MenuId("AccessibleView"); + } + static { + this.MultiDiffEditorFileToolbar = new _MenuId("MultiDiffEditorFileToolbar"); + } + static { + this.DiffEditorHunkToolbar = new _MenuId("DiffEditorHunkToolbar"); + } + static { + this.DiffEditorSelectionToolbar = new _MenuId("DiffEditorSelectionToolbar"); + } + /** + * Create a new `MenuId` with the unique identifier. Will throw if a menu + * with the identifier already exists, use `MenuId.for(ident)` or a unique + * identifier + */ + constructor(identifier) { + if (_MenuId._instances.has(identifier)) { + throw new TypeError(`MenuId with identifier '${identifier}' already exists. Use MenuId.for(ident) or a unique identifier`); + } + _MenuId._instances.set(identifier, this); + this.id = identifier; + } + }; + IMenuService = createDecorator("menuService"); + MenuRegistryChangeEvent = class _MenuRegistryChangeEvent { + static { + this._all = /* @__PURE__ */ new Map(); + } + static for(id) { + let value = this._all.get(id); + if (!value) { + value = new _MenuRegistryChangeEvent(id); + this._all.set(id, value); + } + return value; + } + static merge(events) { + const ids = /* @__PURE__ */ new Set(); + for (const item of events) { + if (item instanceof _MenuRegistryChangeEvent) { + ids.add(item.id); + } + } + return ids; + } + constructor(id) { + this.id = id; + this.has = (candidate) => candidate === id; + } + }; + MenuRegistry = new class { + constructor() { + this._commands = /* @__PURE__ */ new Map(); + this._menuItems = /* @__PURE__ */ new Map(); + this._onDidChangeMenu = new MicrotaskEmitter({ + merge: MenuRegistryChangeEvent.merge + }); + this.onDidChangeMenu = this._onDidChangeMenu.event; + } + addCommand(command) { + this._commands.set(command.id, command); + this._onDidChangeMenu.fire(MenuRegistryChangeEvent.for(MenuId.CommandPalette)); + return markAsSingleton(toDisposable(() => { + if (this._commands.delete(command.id)) { + this._onDidChangeMenu.fire(MenuRegistryChangeEvent.for(MenuId.CommandPalette)); + } + })); + } + getCommand(id) { + return this._commands.get(id); + } + getCommands() { + const map = /* @__PURE__ */ new Map(); + this._commands.forEach((value, key) => map.set(key, value)); + return map; + } + appendMenuItem(id, item) { + let list2 = this._menuItems.get(id); + if (!list2) { + list2 = new LinkedList(); + this._menuItems.set(id, list2); + } + const rm = list2.push(item); + this._onDidChangeMenu.fire(MenuRegistryChangeEvent.for(id)); + return markAsSingleton(toDisposable(() => { + rm(); + this._onDidChangeMenu.fire(MenuRegistryChangeEvent.for(id)); + })); + } + appendMenuItems(items) { + const result = new DisposableStore(); + for (const { id, item } of items) { + result.add(this.appendMenuItem(id, item)); + } + return result; + } + getMenuItems(id) { + let result; + if (this._menuItems.has(id)) { + result = [...this._menuItems.get(id)]; + } else { + result = []; + } + if (id === MenuId.CommandPalette) { + this._appendImplicitItems(result); + } + return result; + } + _appendImplicitItems(result) { + const set = /* @__PURE__ */ new Set(); + for (const item of result) { + if (isIMenuItem(item)) { + set.add(item.command.id); + if (item.alt) { + set.add(item.alt.id); + } + } + } + this._commands.forEach((command, id) => { + if (!set.has(id)) { + result.push({ command }); + } + }); + } + }(); + SubmenuItemAction = class extends SubmenuAction { + constructor(item, hideActions, actions) { + super(`submenuitem.${item.submenu.id}`, typeof item.title === "string" ? item.title : item.title.value, actions, "submenu"); + this.item = item; + this.hideActions = hideActions; + } + }; + MenuItemAction = MenuItemAction_1 = class MenuItemAction2 { + static label(action, options2) { + return options2?.renderShortTitle && action.shortTitle ? typeof action.shortTitle === "string" ? action.shortTitle : action.shortTitle.value : typeof action.title === "string" ? action.title : action.title.value; + } + constructor(item, alt, options2, hideActions, menuKeybinding, contextKeyService, _commandService) { + this.hideActions = hideActions; + this.menuKeybinding = menuKeybinding; + this._commandService = _commandService; + this.id = item.id; + this.label = MenuItemAction_1.label(item, options2); + this.tooltip = (typeof item.tooltip === "string" ? item.tooltip : item.tooltip?.value) ?? ""; + this.enabled = !item.precondition || contextKeyService.contextMatchesRules(item.precondition); + this.checked = void 0; + let icon; + if (item.toggled) { + const toggled = item.toggled.condition ? item.toggled : { condition: item.toggled }; + this.checked = contextKeyService.contextMatchesRules(toggled.condition); + if (this.checked && toggled.tooltip) { + this.tooltip = typeof toggled.tooltip === "string" ? toggled.tooltip : toggled.tooltip.value; + } + if (this.checked && ThemeIcon.isThemeIcon(toggled.icon)) { + icon = toggled.icon; + } + if (this.checked && toggled.title) { + this.label = typeof toggled.title === "string" ? toggled.title : toggled.title.value; + } + } + if (!icon) { + icon = ThemeIcon.isThemeIcon(item.icon) ? item.icon : void 0; + } + this.item = item; + this.alt = alt ? new MenuItemAction_1(alt, void 0, options2, hideActions, void 0, contextKeyService, _commandService) : void 0; + this._options = options2; + this.class = icon && ThemeIcon.asClassName(icon); + } + run(...args) { + let runArgs = []; + if (this._options?.arg) { + runArgs = [...runArgs, this._options.arg]; + } + if (this._options?.shouldForwardArgs) { + runArgs = [...runArgs, ...args]; + } + return this._commandService.executeCommand(this.id, ...runArgs); + } + }; + MenuItemAction = MenuItemAction_1 = __decorate([ + __param(5, IContextKeyService), + __param(6, ICommandService) + ], MenuItemAction); + Action2 = class { + constructor(desc) { + this.desc = desc; + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/platform/telemetry/common/telemetry.js +var ITelemetryService; +var init_telemetry = __esm({ + "node_modules/monaco-editor-core/esm/vs/platform/telemetry/common/telemetry.js"() { + init_instantiation(); + ITelemetryService = createDecorator("telemetryService"); + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/common/map.js +function isEntries(arg) { + return Array.isArray(arg); +} +var _a, _b, _c, ResourceMapEntry, ResourceMap, ResourceSet, LinkedMap, Cache, LRUCache, BidirectionalMap, SetMap, NKeyMap; +var init_map = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/common/map.js"() { + ResourceMapEntry = class { + constructor(uri, value) { + this.uri = uri; + this.value = value; + } + }; + ResourceMap = class _ResourceMap { + static { + this.defaultToKey = (resource) => resource.toString(); + } + constructor(arg, toKey) { + this[_a] = "ResourceMap"; + if (arg instanceof _ResourceMap) { + this.map = new Map(arg.map); + this.toKey = toKey ?? _ResourceMap.defaultToKey; + } else if (isEntries(arg)) { + this.map = /* @__PURE__ */ new Map(); + this.toKey = toKey ?? _ResourceMap.defaultToKey; + for (const [resource, value] of arg) { + this.set(resource, value); + } + } else { + this.map = /* @__PURE__ */ new Map(); + this.toKey = arg ?? _ResourceMap.defaultToKey; + } + } + set(resource, value) { + this.map.set(this.toKey(resource), new ResourceMapEntry(resource, value)); + return this; + } + get(resource) { + return this.map.get(this.toKey(resource))?.value; + } + has(resource) { + return this.map.has(this.toKey(resource)); + } + get size() { + return this.map.size; + } + clear() { + this.map.clear(); + } + delete(resource) { + return this.map.delete(this.toKey(resource)); + } + forEach(clb, thisArg) { + if (typeof thisArg !== "undefined") { + clb = clb.bind(thisArg); + } + for (const [_, entry] of this.map) { + clb(entry.value, entry.uri, this); + } + } + *values() { + for (const entry of this.map.values()) { + yield entry.value; + } + } + *keys() { + for (const entry of this.map.values()) { + yield entry.uri; + } + } + *entries() { + for (const entry of this.map.values()) { + yield [entry.uri, entry.value]; + } + } + *[(_a = Symbol.toStringTag, Symbol.iterator)]() { + for (const [, entry] of this.map) { + yield [entry.uri, entry.value]; + } + } + }; + ResourceSet = class { + constructor(entriesOrKey, toKey) { + this[_b] = "ResourceSet"; + if (!entriesOrKey || typeof entriesOrKey === "function") { + this._map = new ResourceMap(entriesOrKey); + } else { + this._map = new ResourceMap(toKey); + entriesOrKey.forEach(this.add, this); + } + } + get size() { + return this._map.size; + } + add(value) { + this._map.set(value, value); + return this; + } + clear() { + this._map.clear(); + } + delete(value) { + return this._map.delete(value); + } + forEach(callbackfn, thisArg) { + this._map.forEach((_value, key) => callbackfn.call(thisArg, key, key, this)); + } + has(value) { + return this._map.has(value); + } + entries() { + return this._map.entries(); + } + keys() { + return this._map.keys(); + } + values() { + return this._map.keys(); + } + [(_b = Symbol.toStringTag, Symbol.iterator)]() { + return this.keys(); + } + }; + LinkedMap = class { + constructor() { + this[_c] = "LinkedMap"; + this._map = /* @__PURE__ */ new Map(); + this._head = void 0; + this._tail = void 0; + this._size = 0; + this._state = 0; + } + clear() { + this._map.clear(); + this._head = void 0; + this._tail = void 0; + this._size = 0; + this._state++; + } + isEmpty() { + return !this._head && !this._tail; + } + get size() { + return this._size; + } + get first() { + return this._head?.value; + } + get last() { + return this._tail?.value; + } + has(key) { + return this._map.has(key); + } + get(key, touch = 0) { + const item = this._map.get(key); + if (!item) { + return void 0; + } + if (touch !== 0) { + this.touch(item, touch); + } + return item.value; + } + set(key, value, touch = 0) { + let item = this._map.get(key); + if (item) { + item.value = value; + if (touch !== 0) { + this.touch(item, touch); + } + } else { + item = { key, value, next: void 0, previous: void 0 }; + switch (touch) { + case 0: + this.addItemLast(item); + break; + case 1: + this.addItemFirst(item); + break; + case 2: + this.addItemLast(item); + break; + default: + this.addItemLast(item); + break; + } + this._map.set(key, item); + this._size++; + } + return this; + } + delete(key) { + return !!this.remove(key); + } + remove(key) { + const item = this._map.get(key); + if (!item) { + return void 0; + } + this._map.delete(key); + this.removeItem(item); + this._size--; + return item.value; + } + shift() { + if (!this._head && !this._tail) { + return void 0; + } + if (!this._head || !this._tail) { + throw new Error("Invalid list"); + } + const item = this._head; + this._map.delete(item.key); + this.removeItem(item); + this._size--; + return item.value; + } + forEach(callbackfn, thisArg) { + const state = this._state; + let current = this._head; + while (current) { + if (thisArg) { + callbackfn.bind(thisArg)(current.value, current.key, this); + } else { + callbackfn(current.value, current.key, this); + } + if (this._state !== state) { + throw new Error(`LinkedMap got modified during iteration.`); + } + current = current.next; + } + } + keys() { + const map = this; + const state = this._state; + let current = this._head; + const iterator = { + [Symbol.iterator]() { + return iterator; + }, + next() { + if (map._state !== state) { + throw new Error(`LinkedMap got modified during iteration.`); + } + if (current) { + const result = { value: current.key, done: false }; + current = current.next; + return result; + } else { + return { value: void 0, done: true }; + } + } + }; + return iterator; + } + values() { + const map = this; + const state = this._state; + let current = this._head; + const iterator = { + [Symbol.iterator]() { + return iterator; + }, + next() { + if (map._state !== state) { + throw new Error(`LinkedMap got modified during iteration.`); + } + if (current) { + const result = { value: current.value, done: false }; + current = current.next; + return result; + } else { + return { value: void 0, done: true }; + } + } + }; + return iterator; + } + entries() { + const map = this; + const state = this._state; + let current = this._head; + const iterator = { + [Symbol.iterator]() { + return iterator; + }, + next() { + if (map._state !== state) { + throw new Error(`LinkedMap got modified during iteration.`); + } + if (current) { + const result = { value: [current.key, current.value], done: false }; + current = current.next; + return result; + } else { + return { value: void 0, done: true }; + } + } + }; + return iterator; + } + [(_c = Symbol.toStringTag, Symbol.iterator)]() { + return this.entries(); + } + trimOld(newSize) { + if (newSize >= this.size) { + return; + } + if (newSize === 0) { + this.clear(); + return; + } + let current = this._head; + let currentSize = this.size; + while (current && currentSize > newSize) { + this._map.delete(current.key); + current = current.next; + currentSize--; + } + this._head = current; + this._size = currentSize; + if (current) { + current.previous = void 0; + } + this._state++; + } + trimNew(newSize) { + if (newSize >= this.size) { + return; + } + if (newSize === 0) { + this.clear(); + return; + } + let current = this._tail; + let currentSize = this.size; + while (current && currentSize > newSize) { + this._map.delete(current.key); + current = current.previous; + currentSize--; + } + this._tail = current; + this._size = currentSize; + if (current) { + current.next = void 0; + } + this._state++; + } + addItemFirst(item) { + if (!this._head && !this._tail) { + this._tail = item; + } else if (!this._head) { + throw new Error("Invalid list"); + } else { + item.next = this._head; + this._head.previous = item; + } + this._head = item; + this._state++; + } + addItemLast(item) { + if (!this._head && !this._tail) { + this._head = item; + } else if (!this._tail) { + throw new Error("Invalid list"); + } else { + item.previous = this._tail; + this._tail.next = item; + } + this._tail = item; + this._state++; + } + removeItem(item) { + if (item === this._head && item === this._tail) { + this._head = void 0; + this._tail = void 0; + } else if (item === this._head) { + if (!item.next) { + throw new Error("Invalid list"); + } + item.next.previous = void 0; + this._head = item.next; + } else if (item === this._tail) { + if (!item.previous) { + throw new Error("Invalid list"); + } + item.previous.next = void 0; + this._tail = item.previous; + } else { + const next = item.next; + const previous = item.previous; + if (!next || !previous) { + throw new Error("Invalid list"); + } + next.previous = previous; + previous.next = next; + } + item.next = void 0; + item.previous = void 0; + this._state++; + } + touch(item, touch) { + if (!this._head || !this._tail) { + throw new Error("Invalid list"); + } + if (touch !== 1 && touch !== 2) { + return; + } + if (touch === 1) { + if (item === this._head) { + return; + } + const next = item.next; + const previous = item.previous; + if (item === this._tail) { + previous.next = void 0; + this._tail = previous; + } else { + next.previous = previous; + previous.next = next; + } + item.previous = void 0; + item.next = this._head; + this._head.previous = item; + this._head = item; + this._state++; + } else if (touch === 2) { + if (item === this._tail) { + return; + } + const next = item.next; + const previous = item.previous; + if (item === this._head) { + next.previous = void 0; + this._head = next; + } else { + next.previous = previous; + previous.next = next; + } + item.next = void 0; + item.previous = this._tail; + this._tail.next = item; + this._tail = item; + this._state++; + } + } + toJSON() { + const data = []; + this.forEach((value, key) => { + data.push([key, value]); + }); + return data; + } + fromJSON(data) { + this.clear(); + for (const [key, value] of data) { + this.set(key, value); + } + } + }; + Cache = class extends LinkedMap { + constructor(limit, ratio = 1) { + super(); + this._limit = limit; + this._ratio = Math.min(Math.max(0, ratio), 1); + } + get limit() { + return this._limit; + } + set limit(limit) { + this._limit = limit; + this.checkTrim(); + } + get(key, touch = 2) { + return super.get(key, touch); + } + peek(key) { + return super.get( + key, + 0 + /* Touch.None */ + ); + } + set(key, value) { + super.set( + key, + value, + 2 + /* Touch.AsNew */ + ); + return this; + } + checkTrim() { + if (this.size > this._limit) { + this.trim(Math.round(this._limit * this._ratio)); + } + } + }; + LRUCache = class extends Cache { + constructor(limit, ratio = 1) { + super(limit, ratio); + } + trim(newSize) { + this.trimOld(newSize); + } + set(key, value) { + super.set(key, value); + this.checkTrim(); + return this; + } + }; + BidirectionalMap = class { + constructor(entries2) { + this._m1 = /* @__PURE__ */ new Map(); + this._m2 = /* @__PURE__ */ new Map(); + if (entries2) { + for (const [key, value] of entries2) { + this.set(key, value); + } + } + } + clear() { + this._m1.clear(); + this._m2.clear(); + } + set(key, value) { + this._m1.set(key, value); + this._m2.set(value, key); + } + get(key) { + return this._m1.get(key); + } + getKey(value) { + return this._m2.get(value); + } + delete(key) { + const value = this._m1.get(key); + if (value === void 0) { + return false; + } + this._m1.delete(key); + this._m2.delete(value); + return true; + } + keys() { + return this._m1.keys(); + } + values() { + return this._m1.values(); + } + }; + SetMap = class { + constructor() { + this.map = /* @__PURE__ */ new Map(); + } + add(key, value) { + let values = this.map.get(key); + if (!values) { + values = /* @__PURE__ */ new Set(); + this.map.set(key, values); + } + values.add(value); + } + delete(key, value) { + const values = this.map.get(key); + if (!values) { + return; + } + values.delete(value); + if (values.size === 0) { + this.map.delete(key); + } + } + forEach(key, fn) { + const values = this.map.get(key); + if (!values) { + return; + } + values.forEach(fn); + } + }; + NKeyMap = class { + constructor() { + this._data = /* @__PURE__ */ new Map(); + } + /** + * Sets a value on the map. Note that unlike a standard `Map`, the first argument is the value. + * This is because the spread operator is used for the keys and must be last.. + * @param value The value to set. + * @param keys The keys for the value. + */ + set(value, ...keys) { + let currentMap = this._data; + for (let i2 = 0; i2 < keys.length - 1; i2++) { + if (!currentMap.has(keys[i2])) { + currentMap.set(keys[i2], /* @__PURE__ */ new Map()); + } + currentMap = currentMap.get(keys[i2]); + } + currentMap.set(keys[keys.length - 1], value); + } + get(...keys) { + let currentMap = this._data; + for (let i2 = 0; i2 < keys.length - 1; i2++) { + if (!currentMap.has(keys[i2])) { + return void 0; + } + currentMap = currentMap.get(keys[i2]); + } + return currentMap.get(keys[keys.length - 1]); + } + clear() { + this._data.clear(); + } + /** + * Get a textual representation of the map for debugging purposes. + */ + toString() { + const printMap = (map, depth) => { + let result = ""; + for (const [key, value] of map) { + result += `${" ".repeat(depth)}${key}: `; + if (value instanceof Map) { + result += "\n" + printMap(value, depth + 1); + } else { + result += `${value} +`; + } + } + return result; + }; + return printMap(this._data, 0); + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/common/extpath.js +function isPathSeparator2(code) { + return code === 47 || code === 92; +} +function toSlashes(osPath) { + return osPath.replace(/[\\/]/g, posix.sep); +} +function toPosixPath(osPath) { + if (osPath.indexOf("/") === -1) { + osPath = toSlashes(osPath); + } + if (/^[a-zA-Z]:(\/|$)/.test(osPath)) { + osPath = "/" + osPath; + } + return osPath; +} +function getRoot(path, sep2 = posix.sep) { + if (!path) { + return ""; + } + const len = path.length; + const firstLetter = path.charCodeAt(0); + if (isPathSeparator2(firstLetter)) { + if (isPathSeparator2(path.charCodeAt(1))) { + if (!isPathSeparator2(path.charCodeAt(2))) { + let pos2 = 3; + const start = pos2; + for (; pos2 < len; pos2++) { + if (isPathSeparator2(path.charCodeAt(pos2))) { + break; + } + } + if (start !== pos2 && !isPathSeparator2(path.charCodeAt(pos2 + 1))) { + pos2 += 1; + for (; pos2 < len; pos2++) { + if (isPathSeparator2(path.charCodeAt(pos2))) { + return path.slice(0, pos2 + 1).replace(/[\\/]/g, sep2); + } + } + } + } + } + return sep2; + } else if (isWindowsDriveLetter(firstLetter)) { + if (path.charCodeAt(1) === 58) { + if (isPathSeparator2(path.charCodeAt(2))) { + return path.slice(0, 2) + sep2; + } else { + return path.slice(0, 2); + } + } + } + let pos = path.indexOf("://"); + if (pos !== -1) { + pos += 3; + for (; pos < len; pos++) { + if (isPathSeparator2(path.charCodeAt(pos))) { + return path.slice(0, pos + 1); + } + } + } + return ""; +} +function isEqualOrParent(base, parentCandidate, ignoreCase, separator2 = sep) { + if (base === parentCandidate) { + return true; + } + if (!base || !parentCandidate) { + return false; + } + if (parentCandidate.length > base.length) { + return false; + } + if (ignoreCase) { + const beginsWith = startsWithIgnoreCase(base, parentCandidate); + if (!beginsWith) { + return false; + } + if (parentCandidate.length === base.length) { + return true; + } + let sepOffset = parentCandidate.length; + if (parentCandidate.charAt(parentCandidate.length - 1) === separator2) { + sepOffset--; + } + return base.charAt(sepOffset) === separator2; + } + if (parentCandidate.charAt(parentCandidate.length - 1) !== separator2) { + parentCandidate += separator2; + } + return base.indexOf(parentCandidate) === 0; +} +function isWindowsDriveLetter(char0) { + return char0 >= 65 && char0 <= 90 || char0 >= 97 && char0 <= 122; +} +function hasDriveLetter(path, isWindowsOS = isWindows) { + if (isWindowsOS) { + return isWindowsDriveLetter(path.charCodeAt(0)) && path.charCodeAt(1) === 58; + } + return false; +} +var init_extpath = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/common/extpath.js"() { + init_path(); + init_platform(); + init_strings(); + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/common/resources.js +function originalFSPath(uri) { + return uriToFsPath(uri, true); +} +var ExtUri, extUri, extUriBiasedIgnorePathCase, extUriIgnorePathCase, isEqual, isEqualOrParent2, getComparisonKey, basenameOrAuthority, basename2, extname2, dirname2, joinPath, normalizePath, relativePath, resolvePath, isAbsolutePath, isEqualAuthority, hasTrailingPathSeparator, removeTrailingPathSeparator, addTrailingPathSeparator, DataUri; +var init_resources = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/common/resources.js"() { + init_extpath(); + init_network(); + init_path(); + init_platform(); + init_strings(); + init_uri(); + ExtUri = class { + constructor(_ignorePathCasing) { + this._ignorePathCasing = _ignorePathCasing; + } + compare(uri1, uri2, ignoreFragment = false) { + if (uri1 === uri2) { + return 0; + } + return compare(this.getComparisonKey(uri1, ignoreFragment), this.getComparisonKey(uri2, ignoreFragment)); + } + isEqual(uri1, uri2, ignoreFragment = false) { + if (uri1 === uri2) { + return true; + } + if (!uri1 || !uri2) { + return false; + } + return this.getComparisonKey(uri1, ignoreFragment) === this.getComparisonKey(uri2, ignoreFragment); + } + getComparisonKey(uri, ignoreFragment = false) { + return uri.with({ + path: this._ignorePathCasing(uri) ? uri.path.toLowerCase() : void 0, + fragment: ignoreFragment ? null : void 0 + }).toString(); + } + isEqualOrParent(base, parentCandidate, ignoreFragment = false) { + if (base.scheme === parentCandidate.scheme) { + if (base.scheme === Schemas.file) { + return isEqualOrParent(originalFSPath(base), originalFSPath(parentCandidate), this._ignorePathCasing(base)) && base.query === parentCandidate.query && (ignoreFragment || base.fragment === parentCandidate.fragment); + } + if (isEqualAuthority(base.authority, parentCandidate.authority)) { + return isEqualOrParent(base.path, parentCandidate.path, this._ignorePathCasing(base), "/") && base.query === parentCandidate.query && (ignoreFragment || base.fragment === parentCandidate.fragment); + } + } + return false; + } + // --- path math + joinPath(resource, ...pathFragment) { + return URI.joinPath(resource, ...pathFragment); + } + basenameOrAuthority(resource) { + return basename2(resource) || resource.authority; + } + basename(resource) { + return posix.basename(resource.path); + } + extname(resource) { + return posix.extname(resource.path); + } + dirname(resource) { + if (resource.path.length === 0) { + return resource; + } + let dirname3; + if (resource.scheme === Schemas.file) { + dirname3 = URI.file(dirname(originalFSPath(resource))).path; + } else { + dirname3 = posix.dirname(resource.path); + if (resource.authority && dirname3.length && dirname3.charCodeAt(0) !== 47) { + console.error(`dirname("${resource.toString})) resulted in a relative path`); + dirname3 = "/"; + } + } + return resource.with({ + path: dirname3 + }); + } + normalizePath(resource) { + if (!resource.path.length) { + return resource; + } + let normalizedPath; + if (resource.scheme === Schemas.file) { + normalizedPath = URI.file(normalize(originalFSPath(resource))).path; + } else { + normalizedPath = posix.normalize(resource.path); + } + return resource.with({ + path: normalizedPath + }); + } + relativePath(from, to) { + if (from.scheme !== to.scheme || !isEqualAuthority(from.authority, to.authority)) { + return void 0; + } + if (from.scheme === Schemas.file) { + const relativePath2 = relative(originalFSPath(from), originalFSPath(to)); + return isWindows ? toSlashes(relativePath2) : relativePath2; + } + let fromPath = from.path || "/"; + const toPath = to.path || "/"; + if (this._ignorePathCasing(from)) { + let i2 = 0; + for (const len = Math.min(fromPath.length, toPath.length); i2 < len; i2++) { + if (fromPath.charCodeAt(i2) !== toPath.charCodeAt(i2)) { + if (fromPath.charAt(i2).toLowerCase() !== toPath.charAt(i2).toLowerCase()) { + break; + } + } + } + fromPath = toPath.substr(0, i2) + fromPath.substr(i2); + } + return posix.relative(fromPath, toPath); + } + resolvePath(base, path) { + if (base.scheme === Schemas.file) { + const newURI = URI.file(resolve(originalFSPath(base), path)); + return base.with({ + authority: newURI.authority, + path: newURI.path + }); + } + path = toPosixPath(path); + return base.with({ + path: posix.resolve(base.path, path) + }); + } + // --- misc + isAbsolutePath(resource) { + return !!resource.path && resource.path[0] === "/"; + } + isEqualAuthority(a1, a2) { + return a1 === a2 || a1 !== void 0 && a2 !== void 0 && equalsIgnoreCase(a1, a2); + } + hasTrailingPathSeparator(resource, sep2 = sep) { + if (resource.scheme === Schemas.file) { + const fsp = originalFSPath(resource); + return fsp.length > getRoot(fsp).length && fsp[fsp.length - 1] === sep2; + } else { + const p = resource.path; + return p.length > 1 && p.charCodeAt(p.length - 1) === 47 && !/^[a-zA-Z]:(\/$|\\$)/.test(resource.fsPath); + } + } + removeTrailingPathSeparator(resource, sep2 = sep) { + if (hasTrailingPathSeparator(resource, sep2)) { + return resource.with({ path: resource.path.substr(0, resource.path.length - 1) }); + } + return resource; + } + addTrailingPathSeparator(resource, sep2 = sep) { + let isRootSep = false; + if (resource.scheme === Schemas.file) { + const fsp = originalFSPath(resource); + isRootSep = fsp !== void 0 && fsp.length === getRoot(fsp).length && fsp[fsp.length - 1] === sep2; + } else { + sep2 = "/"; + const p = resource.path; + isRootSep = p.length === 1 && p.charCodeAt(p.length - 1) === 47; + } + if (!isRootSep && !hasTrailingPathSeparator(resource, sep2)) { + return resource.with({ path: resource.path + "/" }); + } + return resource; + } + }; + extUri = new ExtUri(() => false); + extUriBiasedIgnorePathCase = new ExtUri((uri) => { + return uri.scheme === Schemas.file ? !isLinux : true; + }); + extUriIgnorePathCase = new ExtUri((_) => true); + isEqual = extUri.isEqual.bind(extUri); + isEqualOrParent2 = extUri.isEqualOrParent.bind(extUri); + getComparisonKey = extUri.getComparisonKey.bind(extUri); + basenameOrAuthority = extUri.basenameOrAuthority.bind(extUri); + basename2 = extUri.basename.bind(extUri); + extname2 = extUri.extname.bind(extUri); + dirname2 = extUri.dirname.bind(extUri); + joinPath = extUri.joinPath.bind(extUri); + normalizePath = extUri.normalizePath.bind(extUri); + relativePath = extUri.relativePath.bind(extUri); + resolvePath = extUri.resolvePath.bind(extUri); + isAbsolutePath = extUri.isAbsolutePath.bind(extUri); + isEqualAuthority = extUri.isEqualAuthority.bind(extUri); + hasTrailingPathSeparator = extUri.hasTrailingPathSeparator.bind(extUri); + removeTrailingPathSeparator = extUri.removeTrailingPathSeparator.bind(extUri); + addTrailingPathSeparator = extUri.addTrailingPathSeparator.bind(extUri); + (function(DataUri2) { + DataUri2.META_DATA_LABEL = "label"; + DataUri2.META_DATA_DESCRIPTION = "description"; + DataUri2.META_DATA_SIZE = "size"; + DataUri2.META_DATA_MIME = "mime"; + function parseMetaData(dataUri) { + const metadata = /* @__PURE__ */ new Map(); + const meta = dataUri.path.substring(dataUri.path.indexOf(";") + 1, dataUri.path.lastIndexOf(";")); + meta.split(";").forEach((property) => { + const [key, value] = property.split(":"); + if (key && value) { + metadata.set(key, value); + } + }); + const mime = dataUri.path.substring(0, dataUri.path.indexOf(";")); + if (mime) { + metadata.set(DataUri2.META_DATA_MIME, mime); + } + return metadata; + } + DataUri2.parseMetaData = parseMetaData; + })(DataUri || (DataUri = {})); + } +}); + +// node_modules/monaco-editor-core/esm/vs/platform/log/common/log.js +function canLog(loggerLevel, messageLevel) { + return loggerLevel !== LogLevel.Off && loggerLevel <= messageLevel; +} +function LogLevelToString(logLevel) { + switch (logLevel) { + case LogLevel.Trace: + return "trace"; + case LogLevel.Debug: + return "debug"; + case LogLevel.Info: + return "info"; + case LogLevel.Warning: + return "warn"; + case LogLevel.Error: + return "error"; + case LogLevel.Off: + return "off"; + } +} +var ILogService, ILoggerService, LogLevel, DEFAULT_LOG_LEVEL, AbstractLogger, ConsoleLogger, MultiplexLogger, AbstractLoggerService, NullLogger, NullLoggerService, CONTEXT_LOG_LEVEL; +var init_log = __esm({ + "node_modules/monaco-editor-core/esm/vs/platform/log/common/log.js"() { + init_event(); + init_hash(); + init_lifecycle(); + init_map(); + init_resources(); + init_types(); + init_uri(); + init_contextkey(); + init_instantiation(); + ILogService = createDecorator("logService"); + ILoggerService = createDecorator("loggerService"); + (function(LogLevel2) { + LogLevel2[LogLevel2["Off"] = 0] = "Off"; + LogLevel2[LogLevel2["Trace"] = 1] = "Trace"; + LogLevel2[LogLevel2["Debug"] = 2] = "Debug"; + LogLevel2[LogLevel2["Info"] = 3] = "Info"; + LogLevel2[LogLevel2["Warning"] = 4] = "Warning"; + LogLevel2[LogLevel2["Error"] = 5] = "Error"; + })(LogLevel || (LogLevel = {})); + DEFAULT_LOG_LEVEL = LogLevel.Info; + AbstractLogger = class extends Disposable { + constructor() { + super(...arguments); + this.level = DEFAULT_LOG_LEVEL; + this._onDidChangeLogLevel = this._register(new Emitter()); + } + get onDidChangeLogLevel() { + return this._onDidChangeLogLevel.event; + } + setLevel(level) { + if (this.level !== level) { + this.level = level; + this._onDidChangeLogLevel.fire(this.level); + } + } + getLevel() { + return this.level; + } + checkLogLevel(level) { + return canLog(this.level, level); + } + canLog(level) { + if (this._store.isDisposed) { + return false; + } + return this.checkLogLevel(level); + } + }; + ConsoleLogger = class extends AbstractLogger { + constructor(logLevel = DEFAULT_LOG_LEVEL, useColors = true) { + super(); + this.useColors = useColors; + this.setLevel(logLevel); + } + trace(message, ...args) { + if (this.canLog(LogLevel.Trace)) { + if (this.useColors) { + console.log("%cTRACE", "color: #888", message, ...args); + } else { + console.log(message, ...args); + } + } + } + debug(message, ...args) { + if (this.canLog(LogLevel.Debug)) { + if (this.useColors) { + console.log("%cDEBUG", "background: #eee; color: #888", message, ...args); + } else { + console.log(message, ...args); + } + } + } + info(message, ...args) { + if (this.canLog(LogLevel.Info)) { + if (this.useColors) { + console.log("%c INFO", "color: #33f", message, ...args); + } else { + console.log(message, ...args); + } + } + } + warn(message, ...args) { + if (this.canLog(LogLevel.Warning)) { + if (this.useColors) { + console.warn("%c WARN", "color: #993", message, ...args); + } else { + console.log(message, ...args); + } + } + } + error(message, ...args) { + if (this.canLog(LogLevel.Error)) { + if (this.useColors) { + console.error("%c ERR", "color: #f33", message, ...args); + } else { + console.error(message, ...args); + } + } + } + }; + MultiplexLogger = class extends AbstractLogger { + constructor(loggers) { + super(); + this.loggers = loggers; + if (loggers.length) { + this.setLevel(loggers[0].getLevel()); + } + } + setLevel(level) { + for (const logger of this.loggers) { + logger.setLevel(level); + } + super.setLevel(level); + } + trace(message, ...args) { + for (const logger of this.loggers) { + logger.trace(message, ...args); + } + } + debug(message, ...args) { + for (const logger of this.loggers) { + logger.debug(message, ...args); + } + } + info(message, ...args) { + for (const logger of this.loggers) { + logger.info(message, ...args); + } + } + warn(message, ...args) { + for (const logger of this.loggers) { + logger.warn(message, ...args); + } + } + error(message, ...args) { + for (const logger of this.loggers) { + logger.error(message, ...args); + } + } + dispose() { + for (const logger of this.loggers) { + logger.dispose(); + } + super.dispose(); + } + }; + AbstractLoggerService = class extends Disposable { + constructor(logLevel, logsHome, loggerResources) { + super(); + this.logLevel = logLevel; + this.logsHome = logsHome; + this._loggers = new ResourceMap(); + this._onDidChangeLoggers = this._register(new Emitter()); + this._onDidChangeVisibility = this._register(new Emitter()); + if (loggerResources) { + for (const loggerResource of loggerResources) { + this._loggers.set(loggerResource.resource, { logger: void 0, info: loggerResource }); + } + } + } + getLoggerEntry(resourceOrId) { + if (isString(resourceOrId)) { + return [...this._loggers.values()].find((logger) => logger.info.id === resourceOrId); + } + return this._loggers.get(resourceOrId); + } + createLogger(idOrResource, options2) { + const resource = this.toResource(idOrResource); + const id = isString(idOrResource) ? idOrResource : options2?.id ?? hash(resource.toString()).toString(16); + let logger = this._loggers.get(resource)?.logger; + const logLevel = options2?.logLevel === "always" ? LogLevel.Trace : options2?.logLevel; + if (!logger) { + logger = this.doCreateLogger(resource, logLevel ?? this.getLogLevel(resource) ?? this.logLevel, { ...options2, id }); + } + const loggerEntry = { + logger, + info: { + resource, + id, + logLevel, + name: options2?.name, + hidden: options2?.hidden, + group: options2?.group, + extensionId: options2?.extensionId, + when: options2?.when + } + }; + this.registerLogger(loggerEntry.info); + this._loggers.set(resource, loggerEntry); + return logger; + } + toResource(idOrResource) { + return isString(idOrResource) ? joinPath(this.logsHome, `${idOrResource}.log`) : idOrResource; + } + setVisibility(resourceOrId, visibility) { + const logger = this.getLoggerEntry(resourceOrId); + if (logger && visibility !== !logger.info.hidden) { + logger.info.hidden = !visibility; + this._loggers.set(logger.info.resource, logger); + this._onDidChangeVisibility.fire([logger.info.resource, visibility]); + } + } + getLogLevel(resource) { + let logLevel; + if (resource) { + logLevel = this._loggers.get(resource)?.info.logLevel; + } + return logLevel ?? this.logLevel; + } + registerLogger(resource) { + const existing = this._loggers.get(resource.resource); + if (existing) { + if (existing.info.hidden !== resource.hidden) { + this.setVisibility(resource.resource, !resource.hidden); + } + } else { + this._loggers.set(resource.resource, { info: resource, logger: void 0 }); + this._onDidChangeLoggers.fire({ added: [resource], removed: [] }); + } + } + dispose() { + this._loggers.forEach((logger) => logger.logger?.dispose()); + this._loggers.clear(); + super.dispose(); + } + }; + NullLogger = class { + constructor() { + this.onDidChangeLogLevel = new Emitter().event; + } + setLevel(level) { + } + getLevel() { + return LogLevel.Info; + } + trace(message, ...args) { + } + debug(message, ...args) { + } + info(message, ...args) { + } + warn(message, ...args) { + } + error(message, ...args) { + } + dispose() { + } + }; + NullLoggerService = class extends AbstractLoggerService { + constructor() { + super(LogLevel.Off, URI.parse("log:///log")); + } + doCreateLogger(resource, logLevel, options2) { + return new NullLogger(); + } + }; + CONTEXT_LOG_LEVEL = new RawContextKey("logLevel", LogLevelToString(LogLevel.Info)); + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/browser/triggerInlineEditCommandsRegistry.js +var TriggerInlineEditCommandsRegistry; +var init_triggerInlineEditCommandsRegistry = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/browser/triggerInlineEditCommandsRegistry.js"() { + TriggerInlineEditCommandsRegistry = class _TriggerInlineEditCommandsRegistry { + static { + this.REGISTERED_COMMANDS = /* @__PURE__ */ new Set(); + } + static getRegisteredCommands() { + return [..._TriggerInlineEditCommandsRegistry.REGISTERED_COMMANDS]; + } + static registerCommand(commandId) { + _TriggerInlineEditCommandsRegistry.REGISTERED_COMMANDS.add(commandId); + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/browser/editorExtensions.js +function registerModelAndPositionCommand(id, handler) { + CommandsRegistry.registerCommand(id, function(accessor, ...args) { + const instaService = accessor.get(IInstantiationService); + const [resource, position] = args; + assertType(URI.isUri(resource)); + assertType(Position.isIPosition(position)); + const model = accessor.get(IModelService).getModel(resource); + if (model) { + const editorPosition = Position.lift(position); + return instaService.invokeFunction(handler, model, editorPosition, ...args.slice(2)); + } + return accessor.get(ITextModelService).createModelReference(resource).then((reference) => { + return new Promise((resolve3, reject) => { + try { + const result = instaService.invokeFunction(handler, reference.object.textEditorModel, Position.lift(position), args.slice(2)); + resolve3(result); + } catch (err) { + reject(err); + } + }).finally(() => { + reference.dispose(); + }); + }); + }); +} +function registerEditorCommand(editorCommand) { + EditorContributionRegistry.INSTANCE.registerEditorCommand(editorCommand); + return editorCommand; +} +function registerEditorAction(ctor) { + const action = new ctor(); + EditorContributionRegistry.INSTANCE.registerEditorAction(action); + return action; +} +function registerMultiEditorAction(action) { + EditorContributionRegistry.INSTANCE.registerEditorAction(action); + return action; +} +function registerInstantiatedEditorAction(editorAction) { + EditorContributionRegistry.INSTANCE.registerEditorAction(editorAction); +} +function registerEditorContribution(id, ctor, instantiation) { + EditorContributionRegistry.INSTANCE.registerEditorContribution(id, ctor, instantiation); +} +function registerCommand(command) { + command.register(); + return command; +} +var Command, MultiCommand, ProxyCommand, EditorCommand, EditorAction, MultiEditorAction, EditorAction2, EditorExtensionsRegistry, Extensions2, EditorContributionRegistry, UndoCommand, RedoCommand, SelectAllCommand; +var init_editorExtensions = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/browser/editorExtensions.js"() { + init_nls(); + init_uri(); + init_codeEditorService(); + init_position(); + init_model(); + init_resolverService(); + init_actions2(); + init_commands(); + init_contextkey(); + init_instantiation(); + init_keybindingsRegistry(); + init_platform2(); + init_telemetry(); + init_types(); + init_log(); + init_dom(); + init_triggerInlineEditCommandsRegistry(); + Command = class { + constructor(opts) { + this.id = opts.id; + this.precondition = opts.precondition; + this._kbOpts = opts.kbOpts; + this._menuOpts = opts.menuOpts; + this.metadata = opts.metadata; + this.canTriggerInlineEdits = opts.canTriggerInlineEdits; + } + register() { + if (Array.isArray(this._menuOpts)) { + this._menuOpts.forEach(this._registerMenuItem, this); + } else if (this._menuOpts) { + this._registerMenuItem(this._menuOpts); + } + if (this._kbOpts) { + const kbOptsArr = Array.isArray(this._kbOpts) ? this._kbOpts : [this._kbOpts]; + for (const kbOpts of kbOptsArr) { + let kbWhen = kbOpts.kbExpr; + if (this.precondition) { + if (kbWhen) { + kbWhen = ContextKeyExpr.and(kbWhen, this.precondition); + } else { + kbWhen = this.precondition; + } + } + const desc = { + id: this.id, + weight: kbOpts.weight, + args: kbOpts.args, + when: kbWhen, + primary: kbOpts.primary, + secondary: kbOpts.secondary, + win: kbOpts.win, + linux: kbOpts.linux, + mac: kbOpts.mac + }; + KeybindingsRegistry.registerKeybindingRule(desc); + } + } + CommandsRegistry.registerCommand({ + id: this.id, + handler: (accessor, args) => this.runCommand(accessor, args), + metadata: this.metadata + }); + if (this.canTriggerInlineEdits) { + TriggerInlineEditCommandsRegistry.registerCommand(this.id); + } + } + _registerMenuItem(item) { + MenuRegistry.appendMenuItem(item.menuId, { + group: item.group, + command: { + id: this.id, + title: item.title, + icon: item.icon, + precondition: this.precondition + }, + when: item.when, + order: item.order + }); + } + }; + MultiCommand = class extends Command { + constructor() { + super(...arguments); + this._implementations = []; + } + /** + * A higher priority gets to be looked at first + */ + addImplementation(priority, name, implementation, when) { + this._implementations.push({ priority, name, implementation, when }); + this._implementations.sort((a, b) => b.priority - a.priority); + return { + dispose: () => { + for (let i2 = 0; i2 < this._implementations.length; i2++) { + if (this._implementations[i2].implementation === implementation) { + this._implementations.splice(i2, 1); + return; + } + } + } + }; + } + runCommand(accessor, args) { + const logService = accessor.get(ILogService); + const contextKeyService = accessor.get(IContextKeyService); + logService.trace(`Executing Command '${this.id}' which has ${this._implementations.length} bound.`); + for (const impl of this._implementations) { + if (impl.when) { + const context = contextKeyService.getContext(getActiveElement()); + const value = impl.when.evaluate(context); + if (!value) { + continue; + } + } + const result = impl.implementation(accessor, args); + if (result) { + logService.trace(`Command '${this.id}' was handled by '${impl.name}'.`); + if (typeof result === "boolean") { + return; + } + return result; + } + } + logService.trace(`The Command '${this.id}' was not handled by any implementation.`); + } + }; + ProxyCommand = class extends Command { + constructor(command, opts) { + super(opts); + this.command = command; + } + runCommand(accessor, args) { + return this.command.runCommand(accessor, args); + } + }; + EditorCommand = class _EditorCommand extends Command { + /** + * Create a command class that is bound to a certain editor contribution. + */ + static bindToContribution(controllerGetter) { + return class EditorControllerCommandImpl extends _EditorCommand { + constructor(opts) { + super(opts); + this._callback = opts.handler; + } + runEditorCommand(accessor, editor2, args) { + const controller = controllerGetter(editor2); + if (controller) { + this._callback(controller, args); + } + } + }; + } + static runEditorCommand(accessor, args, precondition, runner) { + const codeEditorService = accessor.get(ICodeEditorService); + const editor2 = codeEditorService.getFocusedCodeEditor() || codeEditorService.getActiveCodeEditor(); + if (!editor2) { + return; + } + return editor2.invokeWithinContext((editorAccessor) => { + const kbService = editorAccessor.get(IContextKeyService); + if (!kbService.contextMatchesRules(precondition ?? void 0)) { + return; + } + return runner(editorAccessor, editor2, args); + }); + } + runCommand(accessor, args) { + return _EditorCommand.runEditorCommand(accessor, args, this.precondition, (accessor2, editor2, args2) => this.runEditorCommand(accessor2, editor2, args2)); + } + }; + EditorAction = class _EditorAction extends EditorCommand { + static convertOptions(opts) { + let menuOpts; + if (Array.isArray(opts.menuOpts)) { + menuOpts = opts.menuOpts; + } else if (opts.menuOpts) { + menuOpts = [opts.menuOpts]; + } else { + menuOpts = []; + } + function withDefaults(item) { + if (!item.menuId) { + item.menuId = MenuId.EditorContext; + } + if (!item.title) { + item.title = typeof opts.label === "string" ? opts.label : opts.label.value; + } + item.when = ContextKeyExpr.and(opts.precondition, item.when); + return item; + } + if (Array.isArray(opts.contextMenuOpts)) { + menuOpts.push(...opts.contextMenuOpts.map(withDefaults)); + } else if (opts.contextMenuOpts) { + menuOpts.push(withDefaults(opts.contextMenuOpts)); + } + opts.menuOpts = menuOpts; + return opts; + } + constructor(opts) { + super(_EditorAction.convertOptions(opts)); + if (typeof opts.label === "string") { + this.label = opts.label; + this.alias = opts.alias ?? opts.label; + } else { + this.label = opts.label.value; + this.alias = opts.alias ?? opts.label.original; + } + } + runEditorCommand(accessor, editor2, args) { + this.reportTelemetry(accessor, editor2); + return this.run(accessor, editor2, args || {}); + } + reportTelemetry(accessor, editor2) { + accessor.get(ITelemetryService).publicLog2("editorActionInvoked", { name: this.label, id: this.id }); + } + }; + MultiEditorAction = class extends EditorAction { + constructor() { + super(...arguments); + this._implementations = []; + } + /** + * A higher priority gets to be looked at first + */ + addImplementation(priority, implementation) { + this._implementations.push([priority, implementation]); + this._implementations.sort((a, b) => b[0] - a[0]); + return { + dispose: () => { + for (let i2 = 0; i2 < this._implementations.length; i2++) { + if (this._implementations[i2][1] === implementation) { + this._implementations.splice(i2, 1); + return; + } + } + } + }; + } + run(accessor, editor2, args) { + for (const impl of this._implementations) { + const result = impl[1](accessor, editor2, args); + if (result) { + if (typeof result === "boolean") { + return; + } + return result; + } + } + } + }; + EditorAction2 = class extends Action2 { + run(accessor, ...args) { + const codeEditorService = accessor.get(ICodeEditorService); + const editor2 = codeEditorService.getFocusedCodeEditor() || codeEditorService.getActiveCodeEditor(); + if (!editor2) { + return; + } + return editor2.invokeWithinContext((editorAccessor) => { + const kbService = editorAccessor.get(IContextKeyService); + const logService = editorAccessor.get(ILogService); + const enabled = kbService.contextMatchesRules(this.desc.precondition ?? void 0); + if (!enabled) { + logService.debug(`[EditorAction2] NOT running command because its precondition is FALSE`, this.desc.id, this.desc.precondition?.serialize()); + return; + } + return this.runEditorCommand(editorAccessor, editor2, ...args); + }); + } + }; + (function(EditorExtensionsRegistry2) { + function getEditorCommand(commandId) { + return EditorContributionRegistry.INSTANCE.getEditorCommand(commandId); + } + EditorExtensionsRegistry2.getEditorCommand = getEditorCommand; + function getEditorActions() { + return EditorContributionRegistry.INSTANCE.getEditorActions(); + } + EditorExtensionsRegistry2.getEditorActions = getEditorActions; + function getEditorContributions() { + return EditorContributionRegistry.INSTANCE.getEditorContributions(); + } + EditorExtensionsRegistry2.getEditorContributions = getEditorContributions; + function getSomeEditorContributions(ids) { + return EditorContributionRegistry.INSTANCE.getEditorContributions().filter((c) => ids.indexOf(c.id) >= 0); + } + EditorExtensionsRegistry2.getSomeEditorContributions = getSomeEditorContributions; + function getDiffEditorContributions() { + return EditorContributionRegistry.INSTANCE.getDiffEditorContributions(); + } + EditorExtensionsRegistry2.getDiffEditorContributions = getDiffEditorContributions; + })(EditorExtensionsRegistry || (EditorExtensionsRegistry = {})); + Extensions2 = { + EditorCommonContributions: "editor.contributions" + }; + EditorContributionRegistry = class _EditorContributionRegistry { + static { + this.INSTANCE = new _EditorContributionRegistry(); + } + constructor() { + this.editorContributions = []; + this.diffEditorContributions = []; + this.editorActions = []; + this.editorCommands = /* @__PURE__ */ Object.create(null); + } + registerEditorContribution(id, ctor, instantiation) { + this.editorContributions.push({ id, ctor, instantiation }); + } + getEditorContributions() { + return this.editorContributions.slice(0); + } + getDiffEditorContributions() { + return this.diffEditorContributions.slice(0); + } + registerEditorAction(action) { + action.register(); + this.editorActions.push(action); + } + getEditorActions() { + return this.editorActions; + } + registerEditorCommand(editorCommand) { + editorCommand.register(); + this.editorCommands[editorCommand.id] = editorCommand; + } + getEditorCommand(commandId) { + return this.editorCommands[commandId] || null; + } + }; + Registry.add(Extensions2.EditorCommonContributions, EditorContributionRegistry.INSTANCE); + UndoCommand = registerCommand(new MultiCommand({ + id: "undo", + precondition: void 0, + kbOpts: { + weight: 0, + primary: 2048 | 56 + /* KeyCode.KeyZ */ + }, + menuOpts: [{ + menuId: MenuId.MenubarEditMenu, + group: "1_do", + title: localize(69, "&&Undo"), + order: 1 + }, { + menuId: MenuId.CommandPalette, + group: "", + title: localize(70, "Undo"), + order: 1 + }, { + menuId: MenuId.SimpleEditorContext, + group: "1_do", + title: localize(71, "Undo"), + order: 1 + }] + })); + registerCommand(new ProxyCommand(UndoCommand, { id: "default:undo", precondition: void 0 })); + RedoCommand = registerCommand(new MultiCommand({ + id: "redo", + precondition: void 0, + kbOpts: { + weight: 0, + primary: 2048 | 55, + secondary: [ + 2048 | 1024 | 56 + /* KeyCode.KeyZ */ + ], + mac: { + primary: 2048 | 1024 | 56 + /* KeyCode.KeyZ */ + } + }, + menuOpts: [{ + menuId: MenuId.MenubarEditMenu, + group: "1_do", + title: localize(72, "&&Redo"), + order: 2 + }, { + menuId: MenuId.CommandPalette, + group: "", + title: localize(73, "Redo"), + order: 1 + }, { + menuId: MenuId.SimpleEditorContext, + group: "1_do", + title: localize(74, "Redo"), + order: 2 + }] + })); + registerCommand(new ProxyCommand(RedoCommand, { id: "default:redo", precondition: void 0 })); + SelectAllCommand = registerCommand(new MultiCommand({ + id: "editor.action.selectAll", + precondition: void 0, + kbOpts: { + weight: 0, + kbExpr: null, + primary: 2048 | 31 + /* KeyCode.KeyA */ + }, + menuOpts: [{ + menuId: MenuId.MenubarSelectionMenu, + group: "1_basic", + title: localize(75, "&&Select All"), + order: 1 + }, { + menuId: MenuId.CommandPalette, + group: "", + title: localize(76, "Select All"), + order: 1 + }, { + menuId: MenuId.SimpleEditorContext, + group: "9_select", + title: localize(77, "Select All"), + order: 1 + }] + })); + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/common/core/range.js +var Range; +var init_range = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/common/core/range.js"() { + init_position(); + Range = class _Range { + constructor(startLineNumber, startColumn, endLineNumber, endColumn) { + if (startLineNumber > endLineNumber || startLineNumber === endLineNumber && startColumn > endColumn) { + this.startLineNumber = endLineNumber; + this.startColumn = endColumn; + this.endLineNumber = startLineNumber; + this.endColumn = startColumn; + } else { + this.startLineNumber = startLineNumber; + this.startColumn = startColumn; + this.endLineNumber = endLineNumber; + this.endColumn = endColumn; + } + } + /** + * Test if this range is empty. + */ + isEmpty() { + return _Range.isEmpty(this); + } + /** + * Test if `range` is empty. + */ + static isEmpty(range2) { + return range2.startLineNumber === range2.endLineNumber && range2.startColumn === range2.endColumn; + } + /** + * Test if position is in this range. If the position is at the edges, will return true. + */ + containsPosition(position) { + return _Range.containsPosition(this, position); + } + /** + * Test if `position` is in `range`. If the position is at the edges, will return true. + */ + static containsPosition(range2, position) { + if (position.lineNumber < range2.startLineNumber || position.lineNumber > range2.endLineNumber) { + return false; + } + if (position.lineNumber === range2.startLineNumber && position.column < range2.startColumn) { + return false; + } + if (position.lineNumber === range2.endLineNumber && position.column > range2.endColumn) { + return false; + } + return true; + } + /** + * Test if `position` is in `range`. If the position is at the edges, will return false. + * @internal + */ + static strictContainsPosition(range2, position) { + if (position.lineNumber < range2.startLineNumber || position.lineNumber > range2.endLineNumber) { + return false; + } + if (position.lineNumber === range2.startLineNumber && position.column <= range2.startColumn) { + return false; + } + if (position.lineNumber === range2.endLineNumber && position.column >= range2.endColumn) { + return false; + } + return true; + } + /** + * Test if range is in this range. If the range is equal to this range, will return true. + */ + containsRange(range2) { + return _Range.containsRange(this, range2); + } + /** + * Test if `otherRange` is in `range`. If the ranges are equal, will return true. + */ + static containsRange(range2, otherRange) { + if (otherRange.startLineNumber < range2.startLineNumber || otherRange.endLineNumber < range2.startLineNumber) { + return false; + } + if (otherRange.startLineNumber > range2.endLineNumber || otherRange.endLineNumber > range2.endLineNumber) { + return false; + } + if (otherRange.startLineNumber === range2.startLineNumber && otherRange.startColumn < range2.startColumn) { + return false; + } + if (otherRange.endLineNumber === range2.endLineNumber && otherRange.endColumn > range2.endColumn) { + return false; + } + return true; + } + /** + * Test if `range` is strictly in this range. `range` must start after and end before this range for the result to be true. + */ + strictContainsRange(range2) { + return _Range.strictContainsRange(this, range2); + } + /** + * Test if `otherRange` is strictly in `range` (must start after, and end before). If the ranges are equal, will return false. + */ + static strictContainsRange(range2, otherRange) { + if (otherRange.startLineNumber < range2.startLineNumber || otherRange.endLineNumber < range2.startLineNumber) { + return false; + } + if (otherRange.startLineNumber > range2.endLineNumber || otherRange.endLineNumber > range2.endLineNumber) { + return false; + } + if (otherRange.startLineNumber === range2.startLineNumber && otherRange.startColumn <= range2.startColumn) { + return false; + } + if (otherRange.endLineNumber === range2.endLineNumber && otherRange.endColumn >= range2.endColumn) { + return false; + } + return true; + } + /** + * A reunion of the two ranges. + * The smallest position will be used as the start point, and the largest one as the end point. + */ + plusRange(range2) { + return _Range.plusRange(this, range2); + } + /** + * A reunion of the two ranges. + * The smallest position will be used as the start point, and the largest one as the end point. + */ + static plusRange(a, b) { + let startLineNumber; + let startColumn; + let endLineNumber; + let endColumn; + if (b.startLineNumber < a.startLineNumber) { + startLineNumber = b.startLineNumber; + startColumn = b.startColumn; + } else if (b.startLineNumber === a.startLineNumber) { + startLineNumber = b.startLineNumber; + startColumn = Math.min(b.startColumn, a.startColumn); + } else { + startLineNumber = a.startLineNumber; + startColumn = a.startColumn; + } + if (b.endLineNumber > a.endLineNumber) { + endLineNumber = b.endLineNumber; + endColumn = b.endColumn; + } else if (b.endLineNumber === a.endLineNumber) { + endLineNumber = b.endLineNumber; + endColumn = Math.max(b.endColumn, a.endColumn); + } else { + endLineNumber = a.endLineNumber; + endColumn = a.endColumn; + } + return new _Range(startLineNumber, startColumn, endLineNumber, endColumn); + } + /** + * A intersection of the two ranges. + */ + intersectRanges(range2) { + return _Range.intersectRanges(this, range2); + } + /** + * A intersection of the two ranges. + */ + static intersectRanges(a, b) { + let resultStartLineNumber = a.startLineNumber; + let resultStartColumn = a.startColumn; + let resultEndLineNumber = a.endLineNumber; + let resultEndColumn = a.endColumn; + const otherStartLineNumber = b.startLineNumber; + const otherStartColumn = b.startColumn; + const otherEndLineNumber = b.endLineNumber; + const otherEndColumn = b.endColumn; + if (resultStartLineNumber < otherStartLineNumber) { + resultStartLineNumber = otherStartLineNumber; + resultStartColumn = otherStartColumn; + } else if (resultStartLineNumber === otherStartLineNumber) { + resultStartColumn = Math.max(resultStartColumn, otherStartColumn); + } + if (resultEndLineNumber > otherEndLineNumber) { + resultEndLineNumber = otherEndLineNumber; + resultEndColumn = otherEndColumn; + } else if (resultEndLineNumber === otherEndLineNumber) { + resultEndColumn = Math.min(resultEndColumn, otherEndColumn); + } + if (resultStartLineNumber > resultEndLineNumber) { + return null; + } + if (resultStartLineNumber === resultEndLineNumber && resultStartColumn > resultEndColumn) { + return null; + } + return new _Range(resultStartLineNumber, resultStartColumn, resultEndLineNumber, resultEndColumn); + } + /** + * Test if this range equals other. + */ + equalsRange(other) { + return _Range.equalsRange(this, other); + } + /** + * Test if range `a` equals `b`. + */ + static equalsRange(a, b) { + if (!a && !b) { + return true; + } + return !!a && !!b && a.startLineNumber === b.startLineNumber && a.startColumn === b.startColumn && a.endLineNumber === b.endLineNumber && a.endColumn === b.endColumn; + } + /** + * Return the end position (which will be after or equal to the start position) + */ + getEndPosition() { + return _Range.getEndPosition(this); + } + /** + * Return the end position (which will be after or equal to the start position) + */ + static getEndPosition(range2) { + return new Position(range2.endLineNumber, range2.endColumn); + } + /** + * Return the start position (which will be before or equal to the end position) + */ + getStartPosition() { + return _Range.getStartPosition(this); + } + /** + * Return the start position (which will be before or equal to the end position) + */ + static getStartPosition(range2) { + return new Position(range2.startLineNumber, range2.startColumn); + } + /** + * Transform to a user presentable string representation. + */ + toString() { + return "[" + this.startLineNumber + "," + this.startColumn + " -> " + this.endLineNumber + "," + this.endColumn + "]"; + } + /** + * Create a new range using this range's start position, and using endLineNumber and endColumn as the end position. + */ + setEndPosition(endLineNumber, endColumn) { + return new _Range(this.startLineNumber, this.startColumn, endLineNumber, endColumn); + } + /** + * Create a new range using this range's end position, and using startLineNumber and startColumn as the start position. + */ + setStartPosition(startLineNumber, startColumn) { + return new _Range(startLineNumber, startColumn, this.endLineNumber, this.endColumn); + } + /** + * Create a new empty range using this range's start position. + */ + collapseToStart() { + return _Range.collapseToStart(this); + } + /** + * Create a new empty range using this range's start position. + */ + static collapseToStart(range2) { + return new _Range(range2.startLineNumber, range2.startColumn, range2.startLineNumber, range2.startColumn); + } + /** + * Create a new empty range using this range's end position. + */ + collapseToEnd() { + return _Range.collapseToEnd(this); + } + /** + * Create a new empty range using this range's end position. + */ + static collapseToEnd(range2) { + return new _Range(range2.endLineNumber, range2.endColumn, range2.endLineNumber, range2.endColumn); + } + /** + * Moves the range by the given amount of lines. + */ + delta(lineCount) { + return new _Range(this.startLineNumber + lineCount, this.startColumn, this.endLineNumber + lineCount, this.endColumn); + } + isSingleLine() { + return this.startLineNumber === this.endLineNumber; + } + // --- + static fromPositions(start, end = start) { + return new _Range(start.lineNumber, start.column, end.lineNumber, end.column); + } + static lift(range2) { + if (!range2) { + return null; + } + return new _Range(range2.startLineNumber, range2.startColumn, range2.endLineNumber, range2.endColumn); + } + /** + * Test if `obj` is an `IRange`. + */ + static isIRange(obj) { + return !!obj && typeof obj.startLineNumber === "number" && typeof obj.startColumn === "number" && typeof obj.endLineNumber === "number" && typeof obj.endColumn === "number"; + } + /** + * Test if the two ranges are touching in any way. + */ + static areIntersectingOrTouching(a, b) { + if (a.endLineNumber < b.startLineNumber || a.endLineNumber === b.startLineNumber && a.endColumn < b.startColumn) { + return false; + } + if (b.endLineNumber < a.startLineNumber || b.endLineNumber === a.startLineNumber && b.endColumn < a.startColumn) { + return false; + } + return true; + } + /** + * Test if the two ranges are intersecting. If the ranges are touching it returns true. + */ + static areIntersecting(a, b) { + if (a.endLineNumber < b.startLineNumber || a.endLineNumber === b.startLineNumber && a.endColumn <= b.startColumn) { + return false; + } + if (b.endLineNumber < a.startLineNumber || b.endLineNumber === a.startLineNumber && b.endColumn <= a.startColumn) { + return false; + } + return true; + } + /** + * Test if the two ranges are intersecting, but not touching at all. + */ + static areOnlyIntersecting(a, b) { + if (a.endLineNumber < b.startLineNumber - 1 || a.endLineNumber === b.startLineNumber && a.endColumn < b.startColumn - 1) { + return false; + } + if (b.endLineNumber < a.startLineNumber - 1 || b.endLineNumber === a.startLineNumber && b.endColumn < a.startColumn - 1) { + return false; + } + return true; + } + /** + * A function that compares ranges, useful for sorting ranges + * It will first compare ranges on the startPosition and then on the endPosition + */ + static compareRangesUsingStarts(a, b) { + if (a && b) { + const aStartLineNumber = a.startLineNumber | 0; + const bStartLineNumber = b.startLineNumber | 0; + if (aStartLineNumber === bStartLineNumber) { + const aStartColumn = a.startColumn | 0; + const bStartColumn = b.startColumn | 0; + if (aStartColumn === bStartColumn) { + const aEndLineNumber = a.endLineNumber | 0; + const bEndLineNumber = b.endLineNumber | 0; + if (aEndLineNumber === bEndLineNumber) { + const aEndColumn = a.endColumn | 0; + const bEndColumn = b.endColumn | 0; + return aEndColumn - bEndColumn; + } + return aEndLineNumber - bEndLineNumber; + } + return aStartColumn - bStartColumn; + } + return aStartLineNumber - bStartLineNumber; + } + const aExists = a ? 1 : 0; + const bExists = b ? 1 : 0; + return aExists - bExists; + } + /** + * A function that compares ranges, useful for sorting ranges + * It will first compare ranges on the endPosition and then on the startPosition + */ + static compareRangesUsingEnds(a, b) { + if (a.endLineNumber === b.endLineNumber) { + if (a.endColumn === b.endColumn) { + if (a.startLineNumber === b.startLineNumber) { + return a.startColumn - b.startColumn; + } + return a.startLineNumber - b.startLineNumber; + } + return a.endColumn - b.endColumn; + } + return a.endLineNumber - b.endLineNumber; + } + /** + * Test if the range spans multiple lines. + */ + static spansMultipleLines(range2) { + return range2.endLineNumber > range2.startLineNumber; + } + toJSON() { + return this; + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/common/core/selection.js +var Selection; +var init_selection = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/common/core/selection.js"() { + init_position(); + init_range(); + Selection = class _Selection extends Range { + constructor(selectionStartLineNumber, selectionStartColumn, positionLineNumber, positionColumn) { + super(selectionStartLineNumber, selectionStartColumn, positionLineNumber, positionColumn); + this.selectionStartLineNumber = selectionStartLineNumber; + this.selectionStartColumn = selectionStartColumn; + this.positionLineNumber = positionLineNumber; + this.positionColumn = positionColumn; + } + /** + * Transform to a human-readable representation. + */ + toString() { + return "[" + this.selectionStartLineNumber + "," + this.selectionStartColumn + " -> " + this.positionLineNumber + "," + this.positionColumn + "]"; + } + /** + * Test if equals other selection. + */ + equalsSelection(other) { + return _Selection.selectionsEqual(this, other); + } + /** + * Test if the two selections are equal. + */ + static selectionsEqual(a, b) { + return a.selectionStartLineNumber === b.selectionStartLineNumber && a.selectionStartColumn === b.selectionStartColumn && a.positionLineNumber === b.positionLineNumber && a.positionColumn === b.positionColumn; + } + /** + * Get directions (LTR or RTL). + */ + getDirection() { + if (this.selectionStartLineNumber === this.startLineNumber && this.selectionStartColumn === this.startColumn) { + return 0; + } + return 1; + } + /** + * Create a new selection with a different `positionLineNumber` and `positionColumn`. + */ + setEndPosition(endLineNumber, endColumn) { + if (this.getDirection() === 0) { + return new _Selection(this.startLineNumber, this.startColumn, endLineNumber, endColumn); + } + return new _Selection(endLineNumber, endColumn, this.startLineNumber, this.startColumn); + } + /** + * Get the position at `positionLineNumber` and `positionColumn`. + */ + getPosition() { + return new Position(this.positionLineNumber, this.positionColumn); + } + /** + * Get the position at the start of the selection. + */ + getSelectionStart() { + return new Position(this.selectionStartLineNumber, this.selectionStartColumn); + } + /** + * Create a new selection with a different `selectionStartLineNumber` and `selectionStartColumn`. + */ + setStartPosition(startLineNumber, startColumn) { + if (this.getDirection() === 0) { + return new _Selection(startLineNumber, startColumn, this.endLineNumber, this.endColumn); + } + return new _Selection(this.endLineNumber, this.endColumn, startLineNumber, startColumn); + } + // ---- + /** + * Create a `Selection` from one or two positions + */ + static fromPositions(start, end = start) { + return new _Selection(start.lineNumber, start.column, end.lineNumber, end.column); + } + /** + * Creates a `Selection` from a range, given a direction. + */ + static fromRange(range2, direction) { + if (direction === 0) { + return new _Selection(range2.startLineNumber, range2.startColumn, range2.endLineNumber, range2.endColumn); + } else { + return new _Selection(range2.endLineNumber, range2.endColumn, range2.startLineNumber, range2.startColumn); + } + } + /** + * Create a `Selection` from an `ISelection`. + */ + static liftSelection(sel) { + return new _Selection(sel.selectionStartLineNumber, sel.selectionStartColumn, sel.positionLineNumber, sel.positionColumn); + } + /** + * `a` equals `b`. + */ + static selectionsArrEqual(a, b) { + if (a && !b || !a && b) { + return false; + } + if (!a && !b) { + return true; + } + if (a.length !== b.length) { + return false; + } + for (let i2 = 0, len = a.length; i2 < len; i2++) { + if (!this.selectionsEqual(a[i2], b[i2])) { + return false; + } + } + return true; + } + /** + * Test if `obj` is an `ISelection`. + */ + static isISelection(obj) { + return !!obj && typeof obj.selectionStartLineNumber === "number" && typeof obj.selectionStartColumn === "number" && typeof obj.positionLineNumber === "number" && typeof obj.positionColumn === "number"; + } + /** + * Create with a direction. + */ + static createWithDirection(startLineNumber, startColumn, endLineNumber, endColumn, direction) { + if (direction === 0) { + return new _Selection(startLineNumber, startColumn, endLineNumber, endColumn); + } + return new _Selection(endLineNumber, endColumn, startLineNumber, startColumn); + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/common/languages/supports.js +function createScopedLineTokens(context, offset) { + const tokenCount = context.getCount(); + const tokenIndex = context.findTokenIndexAtOffset(offset); + const desiredLanguageId = context.getLanguageId(tokenIndex); + let lastTokenIndex = tokenIndex; + while (lastTokenIndex + 1 < tokenCount && context.getLanguageId(lastTokenIndex + 1) === desiredLanguageId) { + lastTokenIndex++; + } + let firstTokenIndex = tokenIndex; + while (firstTokenIndex > 0 && context.getLanguageId(firstTokenIndex - 1) === desiredLanguageId) { + firstTokenIndex--; + } + return new ScopedLineTokens(context, desiredLanguageId, firstTokenIndex, lastTokenIndex + 1, context.getStartOffset(firstTokenIndex), context.getEndOffset(lastTokenIndex)); +} +function ignoreBracketsInToken(standardTokenType) { + return (standardTokenType & 3) !== 0; +} +var ScopedLineTokens; +var init_supports = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/common/languages/supports.js"() { + ScopedLineTokens = class { + constructor(actual, languageId, firstTokenIndex, lastTokenIndex, firstCharOffset, lastCharOffset) { + this._scopedLineTokensBrand = void 0; + this._actual = actual; + this.languageId = languageId; + this._firstTokenIndex = firstTokenIndex; + this._lastTokenIndex = lastTokenIndex; + this.firstCharOffset = firstCharOffset; + this._lastCharOffset = lastCharOffset; + this.languageIdCodec = actual.languageIdCodec; + } + getLineContent() { + const actualLineContent = this._actual.getLineContent(); + return actualLineContent.substring(this.firstCharOffset, this._lastCharOffset); + } + getLineLength() { + return this._lastCharOffset - this.firstCharOffset; + } + getActualLineContentBefore(offset) { + const actualLineContent = this._actual.getLineContent(); + return actualLineContent.substring(0, this.firstCharOffset + offset); + } + getTokenCount() { + return this._lastTokenIndex - this._firstTokenIndex; + } + findTokenIndexAtOffset(offset) { + return this._actual.findTokenIndexAtOffset(offset + this.firstCharOffset) - this._firstTokenIndex; + } + getStandardTokenType(tokenIndex) { + return this._actual.getStandardTokenType(tokenIndex + this._firstTokenIndex); + } + toIViewLineTokens() { + return this._actual.sliceAndInflate(this.firstCharOffset, this._lastCharOffset, 0); + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/common/core/cursorColumns.js +var CursorColumns; +var init_cursorColumns = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/common/core/cursorColumns.js"() { + init_strings(); + CursorColumns = class _CursorColumns { + static _nextVisibleColumn(codePoint, visibleColumn, tabSize) { + if (codePoint === 9) { + return _CursorColumns.nextRenderTabStop(visibleColumn, tabSize); + } + if (isFullWidthCharacter(codePoint) || isEmojiImprecise(codePoint)) { + return visibleColumn + 2; + } + return visibleColumn + 1; + } + /** + * Returns a visible column from a column. + * @see {@link CursorColumns} + */ + static visibleColumnFromColumn(lineContent, column, tabSize) { + const textLen = Math.min(column - 1, lineContent.length); + const text2 = lineContent.substring(0, textLen); + const iterator = new GraphemeIterator(text2); + let result = 0; + while (!iterator.eol()) { + const codePoint = getNextCodePoint(text2, textLen, iterator.offset); + iterator.nextGraphemeLength(); + result = this._nextVisibleColumn(codePoint, result, tabSize); + } + return result; + } + /** + * Returns a column from a visible column. + * @see {@link CursorColumns} + */ + static columnFromVisibleColumn(lineContent, visibleColumn, tabSize) { + if (visibleColumn <= 0) { + return 1; + } + const lineContentLength = lineContent.length; + const iterator = new GraphemeIterator(lineContent); + let beforeVisibleColumn = 0; + let beforeColumn = 1; + while (!iterator.eol()) { + const codePoint = getNextCodePoint(lineContent, lineContentLength, iterator.offset); + iterator.nextGraphemeLength(); + const afterVisibleColumn = this._nextVisibleColumn(codePoint, beforeVisibleColumn, tabSize); + const afterColumn = iterator.offset + 1; + if (afterVisibleColumn >= visibleColumn) { + const beforeDelta = visibleColumn - beforeVisibleColumn; + const afterDelta = afterVisibleColumn - visibleColumn; + if (afterDelta < beforeDelta) { + return afterColumn; + } else { + return beforeColumn; + } + } + beforeVisibleColumn = afterVisibleColumn; + beforeColumn = afterColumn; + } + return lineContentLength + 1; + } + /** + * ATTENTION: This works with 0-based columns (as opposed to the regular 1-based columns) + * @see {@link CursorColumns} + */ + static nextRenderTabStop(visibleColumn, tabSize) { + return visibleColumn + tabSize - visibleColumn % tabSize; + } + /** + * ATTENTION: This works with 0-based columns (as opposed to the regular 1-based columns) + * @see {@link CursorColumns} + */ + static nextIndentTabStop(visibleColumn, indentSize) { + return _CursorColumns.nextRenderTabStop(visibleColumn, indentSize); + } + /** + * ATTENTION: This works with 0-based columns (as opposed to the regular 1-based columns) + * @see {@link CursorColumns} + */ + static prevRenderTabStop(column, tabSize) { + return Math.max(0, column - 1 - (column - 1) % tabSize); + } + /** + * ATTENTION: This works with 0-based columns (as opposed to the regular 1-based columns) + * @see {@link CursorColumns} + */ + static prevIndentTabStop(column, indentSize) { + return _CursorColumns.prevRenderTabStop(column, indentSize); + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/common/core/misc/indentation.js +function _normalizeIndentationFromWhitespace(str, indentSize, insertSpaces) { + let spacesCnt = 0; + for (let i2 = 0; i2 < str.length; i2++) { + if (str.charAt(i2) === " ") { + spacesCnt = CursorColumns.nextIndentTabStop(spacesCnt, indentSize); + } else { + spacesCnt++; + } + } + let result = ""; + if (!insertSpaces) { + const tabsCnt = Math.floor(spacesCnt / indentSize); + spacesCnt = spacesCnt % indentSize; + for (let i2 = 0; i2 < tabsCnt; i2++) { + result += " "; + } + } + for (let i2 = 0; i2 < spacesCnt; i2++) { + result += " "; + } + return result; +} +function normalizeIndentation(str, indentSize, insertSpaces) { + let firstNonWhitespaceIndex2 = firstNonWhitespaceIndex(str); + if (firstNonWhitespaceIndex2 === -1) { + firstNonWhitespaceIndex2 = str.length; + } + return _normalizeIndentationFromWhitespace(str.substring(0, firstNonWhitespaceIndex2), indentSize, insertSpaces) + str.substring(firstNonWhitespaceIndex2); +} +var init_indentation = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/common/core/misc/indentation.js"() { + init_strings(); + init_cursorColumns(); + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/common/date.js +var safeIntl; +var init_date = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/common/date.js"() { + init_lazy(); + init_platform(); + safeIntl = { + DateTimeFormat(locales, options2) { + return new Lazy(() => { + try { + return new Intl.DateTimeFormat(locales, options2); + } catch { + return new Intl.DateTimeFormat(void 0, options2); + } + }); + }, + Collator(locales, options2) { + return new Lazy(() => { + try { + return new Intl.Collator(locales, options2); + } catch { + return new Intl.Collator(void 0, options2); + } + }); + }, + Segmenter(locales, options2) { + return new Lazy(() => { + try { + return new Intl.Segmenter(locales, options2); + } catch { + return new Intl.Segmenter(void 0, options2); + } + }); + }, + Locale(tag2, options2) { + return new Lazy(() => { + try { + return new Intl.Locale(tag2, options2); + } catch { + return new Intl.Locale(LANGUAGE_DEFAULT, options2); + } + }); + }, + NumberFormat(locales, options2) { + return new Lazy(() => { + try { + return new Intl.NumberFormat(locales, options2); + } catch { + return new Intl.NumberFormat(void 0, options2); + } + }); + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/common/uint.js +function toUint8(v) { + if (v < 0) { + return 0; + } + if (v > 255) { + return 255; + } + return v | 0; +} +function toUint32(v) { + if (v < 0) { + return 0; + } + if (v > 4294967295) { + return 4294967295; + } + return v | 0; +} +var init_uint = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/common/uint.js"() { + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/common/core/characterClassifier.js +var CharacterClassifier, CharacterSet; +var init_characterClassifier = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/common/core/characterClassifier.js"() { + init_uint(); + CharacterClassifier = class _CharacterClassifier { + constructor(_defaultValue) { + const defaultValue = toUint8(_defaultValue); + this._defaultValue = defaultValue; + this._asciiMap = _CharacterClassifier._createAsciiMap(defaultValue); + this._map = /* @__PURE__ */ new Map(); + } + static _createAsciiMap(defaultValue) { + const asciiMap = new Uint8Array(256); + asciiMap.fill(defaultValue); + return asciiMap; + } + set(charCode, _value) { + const value = toUint8(_value); + if (charCode >= 0 && charCode < 256) { + this._asciiMap[charCode] = value; + } else { + this._map.set(charCode, value); + } + } + get(charCode) { + if (charCode >= 0 && charCode < 256) { + return this._asciiMap[charCode]; + } else { + return this._map.get(charCode) || this._defaultValue; + } + } + clear() { + this._asciiMap.fill(this._defaultValue); + this._map.clear(); + } + }; + CharacterSet = class { + constructor() { + this._actual = new CharacterClassifier( + 0 + /* Boolean.False */ + ); + } + add(charCode) { + this._actual.set( + charCode, + 1 + /* Boolean.True */ + ); + } + has(charCode) { + return this._actual.get(charCode) === 1; + } + clear() { + return this._actual.clear(); + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/common/core/wordCharacterClassifier.js +function getMapForWordSeparators(wordSeparators2, intlSegmenterLocales) { + const key = `${wordSeparators2}/${intlSegmenterLocales.join(",")}`; + let result = wordClassifierCache.get(key); + if (!result) { + result = new WordCharacterClassifier(wordSeparators2, intlSegmenterLocales); + wordClassifierCache.set(key, result); + } + return result; +} +var WordCharacterClassifier, wordClassifierCache; +var init_wordCharacterClassifier = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/common/core/wordCharacterClassifier.js"() { + init_date(); + init_map(); + init_characterClassifier(); + WordCharacterClassifier = class extends CharacterClassifier { + constructor(wordSeparators2, intlSegmenterLocales) { + super( + 0 + /* WordCharacterClass.Regular */ + ); + this._segmenter = null; + this._cachedLine = null; + this._cachedSegments = []; + this.intlSegmenterLocales = intlSegmenterLocales; + if (this.intlSegmenterLocales.length > 0) { + this._segmenter = safeIntl.Segmenter(this.intlSegmenterLocales, { granularity: "word" }); + } else { + this._segmenter = null; + } + for (let i2 = 0, len = wordSeparators2.length; i2 < len; i2++) { + this.set( + wordSeparators2.charCodeAt(i2), + 2 + /* WordCharacterClass.WordSeparator */ + ); + } + this.set( + 32, + 1 + /* WordCharacterClass.Whitespace */ + ); + this.set( + 9, + 1 + /* WordCharacterClass.Whitespace */ + ); + } + findPrevIntlWordBeforeOrAtOffset(line, offset) { + let candidate = null; + for (const segment of this._getIntlSegmenterWordsOnLine(line)) { + if (segment.index > offset) { + break; + } + candidate = segment; + } + return candidate; + } + findNextIntlWordAtOrAfterOffset(lineContent, offset) { + for (const segment of this._getIntlSegmenterWordsOnLine(lineContent)) { + if (segment.index < offset) { + continue; + } + return segment; + } + return null; + } + _getIntlSegmenterWordsOnLine(line) { + if (!this._segmenter) { + return []; + } + if (this._cachedLine === line) { + return this._cachedSegments; + } + this._cachedLine = line; + this._cachedSegments = this._filterWordSegments(this._segmenter.value.segment(line)); + return this._cachedSegments; + } + _filterWordSegments(segments) { + const result = []; + for (const segment of segments) { + if (this._isWordLike(segment)) { + result.push(segment); + } + } + return result; + } + _isWordLike(segment) { + if (segment.isWordLike) { + return true; + } + return false; + } + }; + wordClassifierCache = new LRUCache(10); + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/common/objects.js +function deepClone(obj) { + if (!obj || typeof obj !== "object") { + return obj; + } + if (obj instanceof RegExp) { + return obj; + } + const result = Array.isArray(obj) ? [] : {}; + Object.entries(obj).forEach(([key, value]) => { + result[key] = value && typeof value === "object" ? deepClone(value) : value; + }); + return result; +} +function deepFreeze(obj) { + if (!obj || typeof obj !== "object") { + return obj; + } + const stack = [obj]; + while (stack.length > 0) { + const obj2 = stack.shift(); + Object.freeze(obj2); + for (const key in obj2) { + if (_hasOwnProperty.call(obj2, key)) { + const prop = obj2[key]; + if (typeof prop === "object" && !Object.isFrozen(prop) && !isTypedArray(prop)) { + stack.push(prop); + } + } + } + } + return obj; +} +function cloneAndChange(obj, changer) { + return _cloneAndChange(obj, changer, /* @__PURE__ */ new Set()); +} +function _cloneAndChange(obj, changer, seen) { + if (isUndefinedOrNull(obj)) { + return obj; + } + const changed = changer(obj); + if (typeof changed !== "undefined") { + return changed; + } + if (Array.isArray(obj)) { + const r1 = []; + for (const e of obj) { + r1.push(_cloneAndChange(e, changer, seen)); + } + return r1; + } + if (isObject(obj)) { + if (seen.has(obj)) { + throw new Error("Cannot clone recursive data-structure"); + } + seen.add(obj); + const r2 = {}; + for (const i2 in obj) { + if (_hasOwnProperty.call(obj, i2)) { + r2[i2] = _cloneAndChange(obj[i2], changer, seen); + } + } + seen.delete(obj); + return r2; + } + return obj; +} +function mixin(destination, source, overwrite = true) { + if (!isObject(destination)) { + return source; + } + if (isObject(source)) { + Object.keys(source).forEach((key) => { + if (key in destination) { + if (overwrite) { + if (isObject(destination[key]) && isObject(source[key])) { + mixin(destination[key], source[key], overwrite); + } else { + destination[key] = source[key]; + } + } + } else { + destination[key] = source[key]; + } + }); + } + return destination; +} +function equals2(one, other) { + if (one === other) { + return true; + } + if (one === null || one === void 0 || other === null || other === void 0) { + return false; + } + if (typeof one !== typeof other) { + return false; + } + if (typeof one !== "object") { + return false; + } + if (Array.isArray(one) !== Array.isArray(other)) { + return false; + } + let i2; + let key; + if (Array.isArray(one)) { + if (one.length !== other.length) { + return false; + } + for (i2 = 0; i2 < one.length; i2++) { + if (!equals2(one[i2], other[i2])) { + return false; + } + } + } else { + const oneKeys = []; + for (key in one) { + oneKeys.push(key); + } + oneKeys.sort(); + const otherKeys = []; + for (key in other) { + otherKeys.push(key); + } + otherKeys.sort(); + if (!equals2(oneKeys, otherKeys)) { + return false; + } + for (i2 = 0; i2 < oneKeys.length; i2++) { + if (!equals2(one[oneKeys[i2]], other[oneKeys[i2]])) { + return false; + } + } + } + return true; +} +var _hasOwnProperty; +var init_objects = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/common/objects.js"() { + init_types(); + _hasOwnProperty = Object.prototype.hasOwnProperty; + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/common/model.js +function isITextSnapshot(obj) { + return !!obj && typeof obj.read === "function"; +} +function shouldSynchronizeModel(model) { + return !model.isTooLargeForSyncing() && !model.isForSimpleWidget; +} +var OverviewRulerLane, GlyphMarginLane, TextDirection, InjectedTextCursorStops, TextModelResolvedOptions, FindMatch, ValidAnnotatedEditOperation, SearchData, ApplyEditsResult; +var init_model2 = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/common/model.js"() { + init_objects(); + (function(OverviewRulerLane3) { + OverviewRulerLane3[OverviewRulerLane3["Left"] = 1] = "Left"; + OverviewRulerLane3[OverviewRulerLane3["Center"] = 2] = "Center"; + OverviewRulerLane3[OverviewRulerLane3["Right"] = 4] = "Right"; + OverviewRulerLane3[OverviewRulerLane3["Full"] = 7] = "Full"; + })(OverviewRulerLane || (OverviewRulerLane = {})); + (function(GlyphMarginLane3) { + GlyphMarginLane3[GlyphMarginLane3["Left"] = 1] = "Left"; + GlyphMarginLane3[GlyphMarginLane3["Center"] = 2] = "Center"; + GlyphMarginLane3[GlyphMarginLane3["Right"] = 3] = "Right"; + })(GlyphMarginLane || (GlyphMarginLane = {})); + (function(TextDirection3) { + TextDirection3[TextDirection3["LTR"] = 0] = "LTR"; + TextDirection3[TextDirection3["RTL"] = 1] = "RTL"; + })(TextDirection || (TextDirection = {})); + (function(InjectedTextCursorStops3) { + InjectedTextCursorStops3[InjectedTextCursorStops3["Both"] = 0] = "Both"; + InjectedTextCursorStops3[InjectedTextCursorStops3["Right"] = 1] = "Right"; + InjectedTextCursorStops3[InjectedTextCursorStops3["Left"] = 2] = "Left"; + InjectedTextCursorStops3[InjectedTextCursorStops3["None"] = 3] = "None"; + })(InjectedTextCursorStops || (InjectedTextCursorStops = {})); + TextModelResolvedOptions = class { + get originalIndentSize() { + return this._indentSizeIsTabSize ? "tabSize" : this.indentSize; + } + /** + * @internal + */ + constructor(src) { + this._textModelResolvedOptionsBrand = void 0; + this.tabSize = Math.max(1, src.tabSize | 0); + if (src.indentSize === "tabSize") { + this.indentSize = this.tabSize; + this._indentSizeIsTabSize = true; + } else { + this.indentSize = Math.max(1, src.indentSize | 0); + this._indentSizeIsTabSize = false; + } + this.insertSpaces = Boolean(src.insertSpaces); + this.defaultEOL = src.defaultEOL | 0; + this.trimAutoWhitespace = Boolean(src.trimAutoWhitespace); + this.bracketPairColorizationOptions = src.bracketPairColorizationOptions; + } + /** + * @internal + */ + equals(other) { + return this.tabSize === other.tabSize && this._indentSizeIsTabSize === other._indentSizeIsTabSize && this.indentSize === other.indentSize && this.insertSpaces === other.insertSpaces && this.defaultEOL === other.defaultEOL && this.trimAutoWhitespace === other.trimAutoWhitespace && equals2(this.bracketPairColorizationOptions, other.bracketPairColorizationOptions); + } + /** + * @internal + */ + createChangeEvent(newOpts) { + return { + tabSize: this.tabSize !== newOpts.tabSize, + indentSize: this.indentSize !== newOpts.indentSize, + insertSpaces: this.insertSpaces !== newOpts.insertSpaces, + trimAutoWhitespace: this.trimAutoWhitespace !== newOpts.trimAutoWhitespace + }; + } + }; + FindMatch = class { + /** + * @internal + */ + constructor(range2, matches) { + this._findMatchBrand = void 0; + this.range = range2; + this.matches = matches; + } + }; + ValidAnnotatedEditOperation = class { + constructor(identifier, range2, text2, forceMoveMarkers, isAutoWhitespaceEdit, _isTracked) { + this.identifier = identifier; + this.range = range2; + this.text = text2; + this.forceMoveMarkers = forceMoveMarkers; + this.isAutoWhitespaceEdit = isAutoWhitespaceEdit; + this._isTracked = _isTracked; + } + }; + SearchData = class { + constructor(regex, wordSeparators2, simpleSearch) { + this.regex = regex; + this.wordSeparators = wordSeparators2; + this.simpleSearch = simpleSearch; + } + }; + ApplyEditsResult = class { + constructor(reverseEdits, changes, trimAutoWhitespaceLineNumbers) { + this.reverseEdits = reverseEdits; + this.changes = changes; + this.trimAutoWhitespaceLineNumbers = trimAutoWhitespaceLineNumbers; + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/common/languages/languageConfiguration.js +function appendEntry(target, key, value) { + if (target.has(key)) { + target.get(key).push(value); + } else { + target.set(key, [value]); + } +} +var IndentAction, StandardAutoClosingPairConditional, AutoClosingPairs; +var init_languageConfiguration = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/common/languages/languageConfiguration.js"() { + (function(IndentAction3) { + IndentAction3[IndentAction3["None"] = 0] = "None"; + IndentAction3[IndentAction3["Indent"] = 1] = "Indent"; + IndentAction3[IndentAction3["IndentOutdent"] = 2] = "IndentOutdent"; + IndentAction3[IndentAction3["Outdent"] = 3] = "Outdent"; + })(IndentAction || (IndentAction = {})); + StandardAutoClosingPairConditional = class { + constructor(source) { + this._neutralCharacter = null; + this._neutralCharacterSearched = false; + this.open = source.open; + this.close = source.close; + this._inString = true; + this._inComment = true; + this._inRegEx = true; + if (Array.isArray(source.notIn)) { + for (let i2 = 0, len = source.notIn.length; i2 < len; i2++) { + const notIn = source.notIn[i2]; + switch (notIn) { + case "string": + this._inString = false; + break; + case "comment": + this._inComment = false; + break; + case "regex": + this._inRegEx = false; + break; + } + } + } + } + isOK(standardToken) { + switch (standardToken) { + case 0: + return true; + case 1: + return this._inComment; + case 2: + return this._inString; + case 3: + return this._inRegEx; + } + } + shouldAutoClose(context, column) { + if (context.getTokenCount() === 0) { + return true; + } + const tokenIndex = context.findTokenIndexAtOffset(column - 2); + const standardTokenType = context.getStandardTokenType(tokenIndex); + return this.isOK(standardTokenType); + } + _findNeutralCharacterInRange(fromCharCode, toCharCode) { + for (let charCode = fromCharCode; charCode <= toCharCode; charCode++) { + const character = String.fromCharCode(charCode); + if (!this.open.includes(character) && !this.close.includes(character)) { + return character; + } + } + return null; + } + /** + * Find a character in the range [0-9a-zA-Z] that does not appear in the open or close + */ + findNeutralCharacter() { + if (!this._neutralCharacterSearched) { + this._neutralCharacterSearched = true; + if (!this._neutralCharacter) { + this._neutralCharacter = this._findNeutralCharacterInRange( + 48, + 57 + /* CharCode.Digit9 */ + ); + } + if (!this._neutralCharacter) { + this._neutralCharacter = this._findNeutralCharacterInRange( + 97, + 122 + /* CharCode.z */ + ); + } + if (!this._neutralCharacter) { + this._neutralCharacter = this._findNeutralCharacterInRange( + 65, + 90 + /* CharCode.Z */ + ); + } + } + return this._neutralCharacter; + } + }; + AutoClosingPairs = class { + constructor(autoClosingPairs) { + this.autoClosingPairsOpenByStart = /* @__PURE__ */ new Map(); + this.autoClosingPairsOpenByEnd = /* @__PURE__ */ new Map(); + this.autoClosingPairsCloseByStart = /* @__PURE__ */ new Map(); + this.autoClosingPairsCloseByEnd = /* @__PURE__ */ new Map(); + this.autoClosingPairsCloseSingleChar = /* @__PURE__ */ new Map(); + for (const pair of autoClosingPairs) { + appendEntry(this.autoClosingPairsOpenByStart, pair.open.charAt(0), pair); + appendEntry(this.autoClosingPairsOpenByEnd, pair.open.charAt(pair.open.length - 1), pair); + appendEntry(this.autoClosingPairsCloseByStart, pair.close.charAt(0), pair); + appendEntry(this.autoClosingPairsCloseByEnd, pair.close.charAt(pair.close.length - 1), pair); + if (pair.close.length === 1 && pair.open.length === 1) { + appendEntry(this.autoClosingPairsCloseSingleChar, pair.close, pair); + } + } + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/common/core/wordHelper.js +function createWordRegExp(allowInWords = "") { + let source = "(-?\\d*\\.\\d\\w*)|([^"; + for (const sep2 of USUAL_WORD_SEPARATORS) { + if (allowInWords.indexOf(sep2) >= 0) { + continue; + } + source += "\\" + sep2; + } + source += "\\s]+)"; + return new RegExp(source, "g"); +} +function ensureValidWordDefinition(wordDefinition) { + let result = DEFAULT_WORD_REGEXP; + if (wordDefinition && wordDefinition instanceof RegExp) { + if (!wordDefinition.global) { + let flags = "g"; + if (wordDefinition.ignoreCase) { + flags += "i"; + } + if (wordDefinition.multiline) { + flags += "m"; + } + if (wordDefinition.unicode) { + flags += "u"; + } + result = new RegExp(wordDefinition.source, flags); + } else { + result = wordDefinition; + } + } + result.lastIndex = 0; + return result; +} +function getWordAtText(column, wordDefinition, text2, textOffset, config) { + wordDefinition = ensureValidWordDefinition(wordDefinition); + if (!config) { + config = Iterable.first(_defaultConfig); + } + if (text2.length > config.maxLen) { + let start = column - config.maxLen / 2; + if (start < 0) { + start = 0; + } else { + textOffset += start; + } + text2 = text2.substring(start, column + config.maxLen / 2); + return getWordAtText(column, wordDefinition, text2, textOffset, config); + } + const t1 = Date.now(); + const pos = column - 1 - textOffset; + let prevRegexIndex = -1; + let match2 = null; + for (let i2 = 1; ; i2++) { + if (Date.now() - t1 >= config.timeBudget) { + break; + } + const regexIndex = pos - config.windowSize * i2; + wordDefinition.lastIndex = Math.max(0, regexIndex); + const thisMatch = _findRegexMatchEnclosingPosition(wordDefinition, text2, pos, prevRegexIndex); + if (!thisMatch && match2) { + break; + } + match2 = thisMatch; + if (regexIndex <= 0) { + break; + } + prevRegexIndex = regexIndex; + } + if (match2) { + const result = { + word: match2[0], + startColumn: textOffset + 1 + match2.index, + endColumn: textOffset + 1 + match2.index + match2[0].length + }; + wordDefinition.lastIndex = 0; + return result; + } + return null; +} +function _findRegexMatchEnclosingPosition(wordDefinition, text2, pos, stopPos) { + let match2; + while (match2 = wordDefinition.exec(text2)) { + const matchIndex = match2.index || 0; + if (matchIndex <= pos && wordDefinition.lastIndex >= pos) { + return match2; + } else if (stopPos > 0 && matchIndex > stopPos) { + return null; + } + } + return null; +} +var USUAL_WORD_SEPARATORS, DEFAULT_WORD_REGEXP, _defaultConfig; +var init_wordHelper = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/common/core/wordHelper.js"() { + init_iterator(); + init_linkedList(); + USUAL_WORD_SEPARATORS = "`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?"; + DEFAULT_WORD_REGEXP = createWordRegExp(); + _defaultConfig = new LinkedList(); + _defaultConfig.unshift({ + maxLen: 1e3, + windowSize: 15, + timeBudget: 150 + }); + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/common/languages/supports/characterPair.js +var CharacterPairSupport; +var init_characterPair = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/common/languages/supports/characterPair.js"() { + init_languageConfiguration(); + CharacterPairSupport = class _CharacterPairSupport { + static { + this.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES = ";:.,=}])> \n "; + } + static { + this.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_BRACKETS = "'\"`;:.,=}])> \n "; + } + constructor(config) { + if (config.autoClosingPairs) { + this._autoClosingPairs = config.autoClosingPairs.map((el) => new StandardAutoClosingPairConditional(el)); + } else if (config.brackets) { + this._autoClosingPairs = config.brackets.map((b) => new StandardAutoClosingPairConditional({ open: b[0], close: b[1] })); + } else { + this._autoClosingPairs = []; + } + if (config.__electricCharacterSupport && config.__electricCharacterSupport.docComment) { + const docComment = config.__electricCharacterSupport.docComment; + this._autoClosingPairs.push(new StandardAutoClosingPairConditional({ open: docComment.open, close: docComment.close || "" })); + } + this._autoCloseBeforeForQuotes = typeof config.autoCloseBefore === "string" ? config.autoCloseBefore : _CharacterPairSupport.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES; + this._autoCloseBeforeForBrackets = typeof config.autoCloseBefore === "string" ? config.autoCloseBefore : _CharacterPairSupport.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_BRACKETS; + this._surroundingPairs = config.surroundingPairs || this._autoClosingPairs; + } + getAutoClosingPairs() { + return this._autoClosingPairs; + } + getAutoCloseBeforeSet(forQuotes) { + return forQuotes ? this._autoCloseBeforeForQuotes : this._autoCloseBeforeForBrackets; + } + getSurroundingPairs() { + return this._surroundingPairs; + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/common/core/stringBuilder.js +function getUTF16LE_TextDecoder() { + if (!_utf16LE_TextDecoder) { + _utf16LE_TextDecoder = new TextDecoder("UTF-16LE"); + } + return _utf16LE_TextDecoder; +} +function getUTF16BE_TextDecoder() { + if (!_utf16BE_TextDecoder) { + _utf16BE_TextDecoder = new TextDecoder("UTF-16BE"); + } + return _utf16BE_TextDecoder; +} +function getPlatformTextDecoder() { + if (!_platformTextDecoder) { + _platformTextDecoder = isLittleEndian() ? getUTF16LE_TextDecoder() : getUTF16BE_TextDecoder(); + } + return _platformTextDecoder; +} +function decodeUTF16LE(source, offset, len) { + const view = new Uint16Array(source.buffer, offset, len); + if (len > 0 && (view[0] === 65279 || view[0] === 65534)) { + return compatDecodeUTF16LE(source, offset, len); + } + return getUTF16LE_TextDecoder().decode(view); +} +function compatDecodeUTF16LE(source, offset, len) { + const result = []; + let resultLen = 0; + for (let i2 = 0; i2 < len; i2++) { + const charCode = readUInt16LE(source, offset); + offset += 2; + result[resultLen++] = String.fromCharCode(charCode); + } + return result.join(""); +} +var _utf16LE_TextDecoder, _utf16BE_TextDecoder, _platformTextDecoder, StringBuilder; +var init_stringBuilder = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/common/core/stringBuilder.js"() { + init_strings(); + init_platform(); + init_buffer(); + StringBuilder = class { + constructor(capacity) { + this._capacity = capacity | 0; + this._buffer = new Uint16Array(this._capacity); + this._completedStrings = null; + this._bufferLength = 0; + } + reset() { + this._completedStrings = null; + this._bufferLength = 0; + } + build() { + if (this._completedStrings !== null) { + this._flushBuffer(); + return this._completedStrings.join(""); + } + return this._buildBuffer(); + } + _buildBuffer() { + if (this._bufferLength === 0) { + return ""; + } + const view = new Uint16Array(this._buffer.buffer, 0, this._bufferLength); + return getPlatformTextDecoder().decode(view); + } + _flushBuffer() { + const bufferString = this._buildBuffer(); + this._bufferLength = 0; + if (this._completedStrings === null) { + this._completedStrings = [bufferString]; + } else { + this._completedStrings[this._completedStrings.length] = bufferString; + } + } + /** + * Append a char code (<2^16) + */ + appendCharCode(charCode) { + const remainingSpace = this._capacity - this._bufferLength; + if (remainingSpace <= 1) { + if (remainingSpace === 0 || isHighSurrogate(charCode)) { + this._flushBuffer(); + } + } + this._buffer[this._bufferLength++] = charCode; + } + /** + * Append an ASCII char code (<2^8) + */ + appendASCIICharCode(charCode) { + if (this._bufferLength === this._capacity) { + this._flushBuffer(); + } + this._buffer[this._bufferLength++] = charCode; + } + appendString(str) { + const strLen = str.length; + if (this._bufferLength + strLen >= this._capacity) { + this._flushBuffer(); + this._completedStrings[this._completedStrings.length] = str; + return; + } + for (let i2 = 0; i2 < strLen; i2++) { + this._buffer[this._bufferLength++] = str.charCodeAt(i2); + } + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/common/languages/supports/richEditBrackets.js +function groupFuzzyBrackets(brackets) { + const N = brackets.length; + brackets = brackets.map((b) => [b[0].toLowerCase(), b[1].toLowerCase()]); + const group = []; + for (let i2 = 0; i2 < N; i2++) { + group[i2] = i2; + } + const areOverlapping = (a, b) => { + const [aOpen, aClose] = a; + const [bOpen, bClose] = b; + return aOpen === bOpen || aOpen === bClose || aClose === bOpen || aClose === bClose; + }; + const mergeGroups = (g1, g2) => { + const newG = Math.min(g1, g2); + const oldG = Math.max(g1, g2); + for (let i2 = 0; i2 < N; i2++) { + if (group[i2] === oldG) { + group[i2] = newG; + } + } + }; + for (let i2 = 0; i2 < N; i2++) { + const a = brackets[i2]; + for (let j = i2 + 1; j < N; j++) { + const b = brackets[j]; + if (areOverlapping(a, b)) { + mergeGroups(group[i2], group[j]); + } + } + } + const result = []; + for (let g = 0; g < N; g++) { + const currentOpen = []; + const currentClose = []; + for (let i2 = 0; i2 < N; i2++) { + if (group[i2] === g) { + const [open, close] = brackets[i2]; + currentOpen.push(open); + currentClose.push(close); + } + } + if (currentOpen.length > 0) { + result.push({ + open: currentOpen, + close: currentClose + }); + } + } + return result; +} +function collectSuperstrings(str, brackets, currentIndex, dest) { + for (let i2 = 0, len = brackets.length; i2 < len; i2++) { + if (i2 === currentIndex) { + continue; + } + const bracket = brackets[i2]; + for (const open of bracket.open) { + if (open.indexOf(str) >= 0) { + dest.push(open); + } + } + for (const close of bracket.close) { + if (close.indexOf(str) >= 0) { + dest.push(close); + } + } + } +} +function lengthcmp(a, b) { + return a.length - b.length; +} +function unique(arr) { + if (arr.length <= 1) { + return arr; + } + const result = []; + const seen = /* @__PURE__ */ new Set(); + for (const element of arr) { + if (seen.has(element)) { + continue; + } + result.push(element); + seen.add(element); + } + return result; +} +function getRegexForBracketPair(open, close, brackets, currentIndex) { + let pieces = []; + pieces = pieces.concat(open); + pieces = pieces.concat(close); + for (let i2 = 0, len = pieces.length; i2 < len; i2++) { + collectSuperstrings(pieces[i2], brackets, currentIndex, pieces); + } + pieces = unique(pieces); + pieces.sort(lengthcmp); + pieces.reverse(); + return createBracketOrRegExp(pieces); +} +function getReversedRegexForBracketPair(open, close, brackets, currentIndex) { + let pieces = []; + pieces = pieces.concat(open); + pieces = pieces.concat(close); + for (let i2 = 0, len = pieces.length; i2 < len; i2++) { + collectSuperstrings(pieces[i2], brackets, currentIndex, pieces); + } + pieces = unique(pieces); + pieces.sort(lengthcmp); + pieces.reverse(); + return createBracketOrRegExp(pieces.map(toReversedString)); +} +function getRegexForBrackets(brackets) { + let pieces = []; + for (const bracket of brackets) { + for (const open of bracket.open) { + pieces.push(open); + } + for (const close of bracket.close) { + pieces.push(close); + } + } + pieces = unique(pieces); + return createBracketOrRegExp(pieces); +} +function getReversedRegexForBrackets(brackets) { + let pieces = []; + for (const bracket of brackets) { + for (const open of bracket.open) { + pieces.push(open); + } + for (const close of bracket.close) { + pieces.push(close); + } + } + pieces = unique(pieces); + return createBracketOrRegExp(pieces.map(toReversedString)); +} +function prepareBracketForRegExp(str) { + const insertWordBoundaries = /^[\w ]+$/.test(str); + str = escapeRegExpCharacters(str); + return insertWordBoundaries ? `\\b${str}\\b` : str; +} +function createBracketOrRegExp(pieces, options2) { + const regexStr = `(${pieces.map(prepareBracketForRegExp).join(")|(")})`; + return createRegExp(regexStr, true, options2); +} +var RichEditBracket, RichEditBrackets, toReversedString, BracketsUtils; +var init_richEditBrackets = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/common/languages/supports/richEditBrackets.js"() { + init_strings(); + init_stringBuilder(); + init_range(); + RichEditBracket = class _RichEditBracket { + constructor(languageId, index, open, close, forwardRegex, reversedRegex) { + this._richEditBracketBrand = void 0; + this.languageId = languageId; + this.index = index; + this.open = open; + this.close = close; + this.forwardRegex = forwardRegex; + this.reversedRegex = reversedRegex; + this._openSet = _RichEditBracket._toSet(this.open); + this._closeSet = _RichEditBracket._toSet(this.close); + } + /** + * Check if the provided `text` is an open bracket in this group. + */ + isOpen(text2) { + return this._openSet.has(text2); + } + /** + * Check if the provided `text` is a close bracket in this group. + */ + isClose(text2) { + return this._closeSet.has(text2); + } + static _toSet(arr) { + const result = /* @__PURE__ */ new Set(); + for (const element of arr) { + result.add(element); + } + return result; + } + }; + RichEditBrackets = class { + constructor(languageId, _brackets) { + this._richEditBracketsBrand = void 0; + const brackets = groupFuzzyBrackets(_brackets); + this.brackets = brackets.map((b, index) => { + return new RichEditBracket(languageId, index, b.open, b.close, getRegexForBracketPair(b.open, b.close, brackets, index), getReversedRegexForBracketPair(b.open, b.close, brackets, index)); + }); + this.forwardRegex = getRegexForBrackets(this.brackets); + this.reversedRegex = getReversedRegexForBrackets(this.brackets); + this.textIsBracket = {}; + this.textIsOpenBracket = {}; + this.maxBracketLength = 0; + for (const bracket of this.brackets) { + for (const open of bracket.open) { + this.textIsBracket[open] = bracket; + this.textIsOpenBracket[open] = true; + this.maxBracketLength = Math.max(this.maxBracketLength, open.length); + } + for (const close of bracket.close) { + this.textIsBracket[close] = bracket; + this.textIsOpenBracket[close] = false; + this.maxBracketLength = Math.max(this.maxBracketLength, close.length); + } + } + } + }; + toReversedString = /* @__PURE__ */ (function() { + function reverse(str) { + const arr = new Uint16Array(str.length); + let offset = 0; + for (let i2 = str.length - 1; i2 >= 0; i2--) { + arr[offset++] = str.charCodeAt(i2); + } + return getPlatformTextDecoder().decode(arr); + } + let lastInput = null; + let lastOutput = null; + return function toReversedString2(str) { + if (lastInput !== str) { + lastInput = str; + lastOutput = reverse(lastInput); + } + return lastOutput; + }; + })(); + BracketsUtils = class { + static _findPrevBracketInText(reversedBracketRegex, lineNumber, reversedText, offset) { + const m = reversedText.match(reversedBracketRegex); + if (!m) { + return null; + } + const matchOffset = reversedText.length - (m.index || 0); + const matchLength = m[0].length; + const absoluteMatchOffset = offset + matchOffset; + return new Range(lineNumber, absoluteMatchOffset - matchLength + 1, lineNumber, absoluteMatchOffset + 1); + } + static findPrevBracketInRange(reversedBracketRegex, lineNumber, lineText, startOffset, endOffset) { + const reversedLineText = toReversedString(lineText); + const reversedSubstr = reversedLineText.substring(lineText.length - endOffset, lineText.length - startOffset); + return this._findPrevBracketInText(reversedBracketRegex, lineNumber, reversedSubstr, startOffset); + } + static findNextBracketInText(bracketRegex, lineNumber, text2, offset) { + const m = text2.match(bracketRegex); + if (!m) { + return null; + } + const matchOffset = m.index || 0; + const matchLength = m[0].length; + if (matchLength === 0) { + return null; + } + const absoluteMatchOffset = offset + matchOffset; + return new Range(lineNumber, absoluteMatchOffset + 1, lineNumber, absoluteMatchOffset + 1 + matchLength); + } + static findNextBracketInRange(bracketRegex, lineNumber, lineText, startOffset, endOffset) { + const substr = lineText.substring(startOffset, endOffset); + return this.findNextBracketInText(bracketRegex, lineNumber, substr, startOffset); + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/common/languages/supports/electricCharacter.js +var BracketElectricCharacterSupport; +var init_electricCharacter = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/common/languages/supports/electricCharacter.js"() { + init_arrays(); + init_supports(); + init_richEditBrackets(); + BracketElectricCharacterSupport = class { + constructor(richEditBrackets) { + this._richEditBrackets = richEditBrackets; + } + getElectricCharacters() { + const result = []; + if (this._richEditBrackets) { + for (const bracket of this._richEditBrackets.brackets) { + for (const close of bracket.close) { + const lastChar = close.charAt(close.length - 1); + result.push(lastChar); + } + } + } + return distinct(result); + } + onElectricCharacter(character, context, column) { + if (!this._richEditBrackets || this._richEditBrackets.brackets.length === 0) { + return null; + } + const tokenIndex = context.findTokenIndexAtOffset(column - 1); + if (ignoreBracketsInToken(context.getStandardTokenType(tokenIndex))) { + return null; + } + const reversedBracketRegex = this._richEditBrackets.reversedRegex; + const text2 = context.getLineContent().substring(0, column - 1) + character; + const r = BracketsUtils.findPrevBracketInRange(reversedBracketRegex, 1, text2, 0, text2.length); + if (!r) { + return null; + } + const bracketText = text2.substring(r.startColumn - 1, r.endColumn - 1).toLowerCase(); + const isOpen = this._richEditBrackets.textIsOpenBracket[bracketText]; + if (isOpen) { + return null; + } + const textBeforeBracket = context.getActualLineContentBefore(r.startColumn - 1); + if (!/^\s*$/.test(textBeforeBracket)) { + return null; + } + return { + matchOpenBracket: bracketText + }; + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/common/languages/supports/indentRules.js +function resetGlobalRegex(reg) { + if (reg.global) { + reg.lastIndex = 0; + } + return true; +} +var IndentRulesSupport; +var init_indentRules = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/common/languages/supports/indentRules.js"() { + IndentRulesSupport = class { + constructor(indentationRules) { + this._indentationRules = indentationRules; + } + shouldIncrease(text2) { + if (this._indentationRules) { + if (this._indentationRules.increaseIndentPattern && resetGlobalRegex(this._indentationRules.increaseIndentPattern) && this._indentationRules.increaseIndentPattern.test(text2)) { + return true; + } + } + return false; + } + shouldDecrease(text2) { + if (this._indentationRules && this._indentationRules.decreaseIndentPattern && resetGlobalRegex(this._indentationRules.decreaseIndentPattern) && this._indentationRules.decreaseIndentPattern.test(text2)) { + return true; + } + return false; + } + shouldIndentNextLine(text2) { + if (this._indentationRules && this._indentationRules.indentNextLinePattern && resetGlobalRegex(this._indentationRules.indentNextLinePattern) && this._indentationRules.indentNextLinePattern.test(text2)) { + return true; + } + return false; + } + shouldIgnore(text2) { + if (this._indentationRules && this._indentationRules.unIndentedLinePattern && resetGlobalRegex(this._indentationRules.unIndentedLinePattern) && this._indentationRules.unIndentedLinePattern.test(text2)) { + return true; + } + return false; + } + getIndentMetadata(text2) { + let ret = 0; + if (this.shouldIncrease(text2)) { + ret += 1; + } + if (this.shouldDecrease(text2)) { + ret += 2; + } + if (this.shouldIndentNextLine(text2)) { + ret += 4; + } + if (this.shouldIgnore(text2)) { + ret += 8; + } + return ret; + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/common/languages/supports/onEnter.js +var OnEnterSupport; +var init_onEnter = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/common/languages/supports/onEnter.js"() { + init_errors(); + init_strings(); + init_languageConfiguration(); + OnEnterSupport = class _OnEnterSupport { + constructor(opts) { + opts = opts || {}; + opts.brackets = opts.brackets || [ + ["(", ")"], + ["{", "}"], + ["[", "]"] + ]; + this._brackets = []; + opts.brackets.forEach((bracket) => { + const openRegExp = _OnEnterSupport._createOpenBracketRegExp(bracket[0]); + const closeRegExp = _OnEnterSupport._createCloseBracketRegExp(bracket[1]); + if (openRegExp && closeRegExp) { + this._brackets.push({ + open: bracket[0], + openRegExp, + close: bracket[1], + closeRegExp + }); + } + }); + this._regExpRules = opts.onEnterRules || []; + } + onEnter(autoIndent, previousLineText, beforeEnterText, afterEnterText) { + if (autoIndent >= 3) { + for (let i2 = 0, len = this._regExpRules.length; i2 < len; i2++) { + const rule = this._regExpRules[i2]; + const regResult = [{ + reg: rule.beforeText, + text: beforeEnterText + }, { + reg: rule.afterText, + text: afterEnterText + }, { + reg: rule.previousLineText, + text: previousLineText + }].every((obj) => { + if (!obj.reg) { + return true; + } + obj.reg.lastIndex = 0; + return obj.reg.test(obj.text); + }); + if (regResult) { + return rule.action; + } + } + } + if (autoIndent >= 2) { + if (beforeEnterText.length > 0 && afterEnterText.length > 0) { + for (let i2 = 0, len = this._brackets.length; i2 < len; i2++) { + const bracket = this._brackets[i2]; + if (bracket.openRegExp.test(beforeEnterText) && bracket.closeRegExp.test(afterEnterText)) { + return { indentAction: IndentAction.IndentOutdent }; + } + } + } + } + if (autoIndent >= 2) { + if (beforeEnterText.length > 0) { + for (let i2 = 0, len = this._brackets.length; i2 < len; i2++) { + const bracket = this._brackets[i2]; + if (bracket.openRegExp.test(beforeEnterText)) { + return { indentAction: IndentAction.Indent }; + } + } + } + } + return null; + } + static _createOpenBracketRegExp(bracket) { + let str = escapeRegExpCharacters(bracket); + if (!/\B/.test(str.charAt(0))) { + str = "\\b" + str; + } + str += "\\s*$"; + return _OnEnterSupport._safeRegExp(str); + } + static _createCloseBracketRegExp(bracket) { + let str = escapeRegExpCharacters(bracket); + if (!/\B/.test(str.charAt(str.length - 1))) { + str = str + "\\b"; + } + str = "^\\s*" + str; + return _OnEnterSupport._safeRegExp(str); + } + static _safeRegExp(def2) { + try { + return new RegExp(def2); + } catch (err) { + onUnexpectedError(err); + return null; + } + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/platform/configuration/common/configuration.js +function toValuesTree(properties, conflictReporter) { + const root = /* @__PURE__ */ Object.create(null); + for (const key in properties) { + addToValueTree(root, key, properties[key], conflictReporter); + } + return root; +} +function addToValueTree(settingsTreeRoot, key, value, conflictReporter) { + const segments = key.split("."); + const last = segments.pop(); + let curr = settingsTreeRoot; + for (let i2 = 0; i2 < segments.length; i2++) { + const s = segments[i2]; + let obj = curr[s]; + switch (typeof obj) { + case "undefined": + obj = curr[s] = /* @__PURE__ */ Object.create(null); + break; + case "object": + if (obj === null) { + conflictReporter(`Ignoring ${key} as ${segments.slice(0, i2 + 1).join(".")} is null`); + return; + } + break; + default: + conflictReporter(`Ignoring ${key} as ${segments.slice(0, i2 + 1).join(".")} is ${JSON.stringify(obj)}`); + return; + } + curr = obj; + } + if (typeof curr === "object" && curr !== null) { + try { + curr[last] = value; + } catch (e) { + conflictReporter(`Ignoring ${key} as ${segments.join(".")} is ${JSON.stringify(curr)}`); + } + } else { + conflictReporter(`Ignoring ${key} as ${segments.join(".")} is ${JSON.stringify(curr)}`); + } +} +function removeFromValueTree(valueTree, key) { + const segments = key.split("."); + doRemoveFromValueTree(valueTree, segments); +} +function doRemoveFromValueTree(valueTree, segments) { + if (!valueTree) { + return; + } + const first2 = segments.shift(); + if (segments.length === 0) { + delete valueTree[first2]; + return; + } + if (Object.keys(valueTree).indexOf(first2) !== -1) { + const value = valueTree[first2]; + if (typeof value === "object" && !Array.isArray(value)) { + doRemoveFromValueTree(value, segments); + if (Object.keys(value).length === 0) { + delete valueTree[first2]; + } + } + } +} +function getConfigurationValue(config, settingPath, defaultValue) { + function accessSetting(config2, path2) { + let current = config2; + for (const component of path2) { + if (typeof current !== "object" || current === null) { + return void 0; + } + current = current[component]; + } + return current; + } + const path = settingPath.split("."); + const result = accessSetting(config, path); + return typeof result === "undefined" ? defaultValue : result; +} +function getLanguageTagSettingPlainKey(settingKey) { + return settingKey.replace(/^\[/, "").replace(/]$/g, "").replace(/\]\[/g, ", "); +} +var IConfigurationService; +var init_configuration = __esm({ + "node_modules/monaco-editor-core/esm/vs/platform/configuration/common/configuration.js"() { + init_instantiation(); + IConfigurationService = createDecorator("configurationService"); + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/common/languages/language.js +var ILanguageService; +var init_language = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/common/languages/language.js"() { + init_instantiation(); + ILanguageService = createDecorator("languageService"); + } +}); + +// node_modules/monaco-editor-core/esm/vs/platform/instantiation/common/descriptors.js +var SyncDescriptor; +var init_descriptors = __esm({ + "node_modules/monaco-editor-core/esm/vs/platform/instantiation/common/descriptors.js"() { + SyncDescriptor = class { + constructor(ctor, staticArguments = [], supportsDelayedInstantiation = false) { + this.ctor = ctor; + this.staticArguments = staticArguments; + this.supportsDelayedInstantiation = supportsDelayedInstantiation; + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/platform/instantiation/common/extensions.js +function registerSingleton(id, ctorOrDescriptor, supportsDelayedInstantiation) { + if (!(ctorOrDescriptor instanceof SyncDescriptor)) { + ctorOrDescriptor = new SyncDescriptor(ctorOrDescriptor, [], Boolean(supportsDelayedInstantiation)); + } + _registry.push([id, ctorOrDescriptor]); +} +function getSingletonServiceDescriptors() { + return _registry; +} +var _registry; +var init_extensions = __esm({ + "node_modules/monaco-editor-core/esm/vs/platform/instantiation/common/extensions.js"() { + init_descriptors(); + _registry = []; + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/common/mime.js +var Mimes; +var init_mime = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/common/mime.js"() { + Mimes = Object.freeze({ + text: "text/plain", + binary: "application/octet-stream", + unknown: "application/unknown", + markdown: "text/markdown", + latex: "text/latex", + uriList: "text/uri-list", + html: "text/html" + }); + } +}); + +// node_modules/monaco-editor-core/esm/vs/platform/jsonschemas/common/jsonContributionRegistry.js +function normalizeId(id) { + if (id.length > 0 && id.charAt(id.length - 1) === "#") { + return id.substring(0, id.length - 1); + } + return id; +} +var Extensions3, JSONContributionRegistry, jsonContributionRegistry; +var init_jsonContributionRegistry = __esm({ + "node_modules/monaco-editor-core/esm/vs/platform/jsonschemas/common/jsonContributionRegistry.js"() { + init_event(); + init_lifecycle(); + init_platform2(); + Extensions3 = { + JSONContribution: "base.contributions.json" + }; + JSONContributionRegistry = class extends Disposable { + constructor() { + super(...arguments); + this.schemasById = {}; + this._onDidChangeSchema = this._register(new Emitter()); + } + registerSchema(uri, unresolvedSchemaContent, store) { + const normalizedUri = normalizeId(uri); + this.schemasById[normalizedUri] = unresolvedSchemaContent; + this._onDidChangeSchema.fire(uri); + if (store) { + store.add(toDisposable(() => { + delete this.schemasById[normalizedUri]; + this._onDidChangeSchema.fire(uri); + })); + } + } + notifySchemaChanged(uri) { + this._onDidChangeSchema.fire(uri); + } + }; + jsonContributionRegistry = new JSONContributionRegistry(); + Registry.add(Extensions3.JSONContribution, jsonContributionRegistry); + } +}); + +// node_modules/monaco-editor-core/esm/vs/platform/product/common/product.js +var product, vscodeGlobal2, product_default; +var init_product = __esm({ + "node_modules/monaco-editor-core/esm/vs/platform/product/common/product.js"() { + init_process(); + vscodeGlobal2 = globalThis.vscode; + if (typeof vscodeGlobal2 !== "undefined" && typeof vscodeGlobal2.context !== "undefined") { + const configuration = vscodeGlobal2.context.configuration(); + if (configuration) { + product = configuration.product; + } else { + throw new Error("Sandbox: unable to resolve product configuration from preload script."); + } + } else if (globalThis._VSCODE_PRODUCT_JSON && globalThis._VSCODE_PACKAGE_JSON) { + product = globalThis._VSCODE_PRODUCT_JSON; + if (env["VSCODE_DEV"]) { + Object.assign(product, { + nameShort: `${product.nameShort} Dev`, + nameLong: `${product.nameLong} Dev`, + dataFolderName: `${product.dataFolderName}-dev`, + serverDataFolderName: product.serverDataFolderName ? `${product.serverDataFolderName}-dev` : void 0 + }); + } + if (!product.version) { + const pkg = globalThis._VSCODE_PACKAGE_JSON; + Object.assign(product, { + version: pkg.version + }); + } + } else { + product = { + /*BUILD->INSERT_PRODUCT_CONFIGURATION*/ + }; + if (Object.keys(product).length === 0) { + Object.assign(product, { + version: "1.104.0-dev", + nameShort: "Code - OSS Dev", + nameLong: "Code - OSS Dev", + applicationName: "code-oss", + dataFolderName: ".vscode-oss", + urlProtocol: "code-oss", + reportIssueUrl: "https://github.com/microsoft/vscode/issues/new", + licenseName: "MIT", + licenseUrl: "https://github.com/microsoft/vscode/blob/main/LICENSE.txt", + serverLicenseUrl: "https://github.com/microsoft/vscode/blob/main/LICENSE.txt" + }); + } + } + product_default = product; + } +}); + +// node_modules/monaco-editor-core/esm/vs/platform/configuration/common/configurationRegistry.js +function overrideIdentifiersFromKey(key) { + const identifiers = []; + if (OVERRIDE_PROPERTY_REGEX.test(key)) { + let matches = OVERRIDE_IDENTIFIER_REGEX.exec(key); + while (matches?.length) { + const identifier = matches[1].trim(); + if (identifier) { + identifiers.push(identifier); + } + matches = OVERRIDE_IDENTIFIER_REGEX.exec(key); + } + } + return distinct(identifiers); +} +function getDefaultValue(type) { + const t = Array.isArray(type) ? type[0] : type; + switch (t) { + case "boolean": + return false; + case "integer": + case "number": + return 0; + case "string": + return ""; + case "array": + return []; + case "object": + return {}; + default: + return null; + } +} +function validateProperty(property, schema, extensionId) { + if (!property.trim()) { + return localize(1670, "Cannot register an empty property"); + } + if (OVERRIDE_PROPERTY_REGEX.test(property)) { + return localize(1671, "Cannot register '{0}'. This matches property pattern '\\\\[.*\\\\]$' for describing language specific editor settings. Use 'configurationDefaults' contribution.", property); + } + if (configurationRegistry.getConfigurationProperties()[property] !== void 0 && (!extensionId || !EXTENSION_UNIFICATION_EXTENSION_IDS.has(extensionId.toLowerCase()))) { + return localize(1672, "Cannot register '{0}'. This property is already registered.", property); + } + if (schema.policy?.name && configurationRegistry.getPolicyConfigurations().get(schema.policy?.name) !== void 0) { + return localize(1673, "Cannot register '{0}'. The associated policy {1} is already registered with {2}.", property, schema.policy?.name, configurationRegistry.getPolicyConfigurations().get(schema.policy?.name)); + } + return null; +} +var Extensions4, allSettings, applicationSettings, applicationMachineSettings, machineSettings, machineOverridableSettings, windowSettings, resourceSettings, resourceLanguageSettingsSchemaId, contributionRegistry, ConfigurationRegistry, OVERRIDE_IDENTIFIER_PATTERN, OVERRIDE_IDENTIFIER_REGEX, OVERRIDE_PROPERTY_PATTERN, OVERRIDE_PROPERTY_REGEX, configurationRegistry, EXTENSION_UNIFICATION_EXTENSION_IDS; +var init_configurationRegistry = __esm({ + "node_modules/monaco-editor-core/esm/vs/platform/configuration/common/configurationRegistry.js"() { + init_arrays(); + init_event(); + init_types(); + init_nls(); + init_configuration(); + init_jsonContributionRegistry(); + init_platform2(); + init_lifecycle(); + init_product(); + Extensions4 = { + Configuration: "base.contributions.configuration" + }; + allSettings = { properties: {}, patternProperties: {} }; + applicationSettings = { properties: {}, patternProperties: {} }; + applicationMachineSettings = { properties: {}, patternProperties: {} }; + machineSettings = { properties: {}, patternProperties: {} }; + machineOverridableSettings = { properties: {}, patternProperties: {} }; + windowSettings = { properties: {}, patternProperties: {} }; + resourceSettings = { properties: {}, patternProperties: {} }; + resourceLanguageSettingsSchemaId = "vscode://schemas/settings/resourceLanguage"; + contributionRegistry = Registry.as(Extensions3.JSONContribution); + ConfigurationRegistry = class extends Disposable { + constructor() { + super(); + this.registeredConfigurationDefaults = []; + this.overrideIdentifiers = /* @__PURE__ */ new Set(); + this._onDidSchemaChange = this._register(new Emitter()); + this._onDidUpdateConfiguration = this._register(new Emitter()); + this.configurationDefaultsOverrides = /* @__PURE__ */ new Map(); + this.defaultLanguageConfigurationOverridesNode = { + id: "defaultOverrides", + title: localize(1664, "Default Language Configuration Overrides"), + properties: {} + }; + this.configurationContributors = [this.defaultLanguageConfigurationOverridesNode]; + this.resourceLanguageSettingsSchema = { + properties: {}, + patternProperties: {}, + additionalProperties: true, + allowTrailingCommas: true, + allowComments: true + }; + this.configurationProperties = {}; + this.policyConfigurations = /* @__PURE__ */ new Map(); + this.excludedConfigurationProperties = {}; + contributionRegistry.registerSchema(resourceLanguageSettingsSchemaId, this.resourceLanguageSettingsSchema); + this.registerOverridePropertyPatternKey(); + } + registerConfiguration(configuration, validate = true) { + this.registerConfigurations([configuration], validate); + return configuration; + } + registerConfigurations(configurations, validate = true) { + const properties = /* @__PURE__ */ new Set(); + this.doRegisterConfigurations(configurations, validate, properties); + contributionRegistry.registerSchema(resourceLanguageSettingsSchemaId, this.resourceLanguageSettingsSchema); + this._onDidSchemaChange.fire(); + this._onDidUpdateConfiguration.fire({ properties }); + } + registerDefaultConfigurations(configurationDefaults) { + const properties = /* @__PURE__ */ new Set(); + this.doRegisterDefaultConfigurations(configurationDefaults, properties); + this._onDidSchemaChange.fire(); + this._onDidUpdateConfiguration.fire({ properties, defaultsOverrides: true }); + } + doRegisterDefaultConfigurations(configurationDefaults, bucket) { + this.registeredConfigurationDefaults.push(...configurationDefaults); + const overrideIdentifiers = []; + for (const { overrides, source } of configurationDefaults) { + for (const key in overrides) { + bucket.add(key); + const configurationDefaultOverridesForKey = this.configurationDefaultsOverrides.get(key) ?? this.configurationDefaultsOverrides.set(key, { configurationDefaultOverrides: [] }).get(key); + const value = overrides[key]; + configurationDefaultOverridesForKey.configurationDefaultOverrides.push({ value, source }); + if (OVERRIDE_PROPERTY_REGEX.test(key)) { + const newDefaultOverride = this.mergeDefaultConfigurationsForOverrideIdentifier(key, value, source, configurationDefaultOverridesForKey.configurationDefaultOverrideValue); + if (!newDefaultOverride) { + continue; + } + configurationDefaultOverridesForKey.configurationDefaultOverrideValue = newDefaultOverride; + this.updateDefaultOverrideProperty(key, newDefaultOverride, source); + overrideIdentifiers.push(...overrideIdentifiersFromKey(key)); + } else { + const newDefaultOverride = this.mergeDefaultConfigurationsForConfigurationProperty(key, value, source, configurationDefaultOverridesForKey.configurationDefaultOverrideValue); + if (!newDefaultOverride) { + continue; + } + configurationDefaultOverridesForKey.configurationDefaultOverrideValue = newDefaultOverride; + const property = this.configurationProperties[key]; + if (property) { + this.updatePropertyDefaultValue(key, property); + this.updateSchema(key, property); + } + } + } + } + this.doRegisterOverrideIdentifiers(overrideIdentifiers); + } + updateDefaultOverrideProperty(key, newDefaultOverride, source) { + const property = { + section: { + id: this.defaultLanguageConfigurationOverridesNode.id, + title: this.defaultLanguageConfigurationOverridesNode.title, + order: this.defaultLanguageConfigurationOverridesNode.order, + extensionInfo: this.defaultLanguageConfigurationOverridesNode.extensionInfo + }, + type: "object", + default: newDefaultOverride.value, + description: localize(1665, "Configure settings to be overridden for {0}.", getLanguageTagSettingPlainKey(key)), + $ref: resourceLanguageSettingsSchemaId, + defaultDefaultValue: newDefaultOverride.value, + source, + defaultValueSource: source + }; + this.configurationProperties[key] = property; + this.defaultLanguageConfigurationOverridesNode.properties[key] = property; + } + mergeDefaultConfigurationsForOverrideIdentifier(overrideIdentifier, configurationValueObject, valueSource, existingDefaultOverride) { + const defaultValue = existingDefaultOverride?.value || {}; + const source = existingDefaultOverride?.source ?? /* @__PURE__ */ new Map(); + if (!(source instanceof Map)) { + console.error("objectConfigurationSources is not a Map"); + return void 0; + } + for (const propertyKey of Object.keys(configurationValueObject)) { + const propertyDefaultValue = configurationValueObject[propertyKey]; + const isObjectSetting = isObject(propertyDefaultValue) && (isUndefined(defaultValue[propertyKey]) || isObject(defaultValue[propertyKey])); + if (isObjectSetting) { + defaultValue[propertyKey] = { ...defaultValue[propertyKey] ?? {}, ...propertyDefaultValue }; + if (valueSource) { + for (const objectKey in propertyDefaultValue) { + source.set(`${propertyKey}.${objectKey}`, valueSource); + } + } + } else { + defaultValue[propertyKey] = propertyDefaultValue; + if (valueSource) { + source.set(propertyKey, valueSource); + } else { + source.delete(propertyKey); + } + } + } + return { value: defaultValue, source }; + } + mergeDefaultConfigurationsForConfigurationProperty(propertyKey, value, valuesSource, existingDefaultOverride) { + const property = this.configurationProperties[propertyKey]; + const existingDefaultValue = existingDefaultOverride?.value ?? property?.defaultDefaultValue; + let source = valuesSource; + const isObjectSetting = isObject(value) && (property !== void 0 && property.type === "object" || property === void 0 && (isUndefined(existingDefaultValue) || isObject(existingDefaultValue))); + if (isObjectSetting) { + source = existingDefaultOverride?.source ?? /* @__PURE__ */ new Map(); + if (!(source instanceof Map)) { + console.error("defaultValueSource is not a Map"); + return void 0; + } + for (const objectKey in value) { + if (valuesSource) { + source.set(`${propertyKey}.${objectKey}`, valuesSource); + } + } + value = { ...isObject(existingDefaultValue) ? existingDefaultValue : {}, ...value }; + } + return { value, source }; + } + registerOverrideIdentifiers(overrideIdentifiers) { + this.doRegisterOverrideIdentifiers(overrideIdentifiers); + this._onDidSchemaChange.fire(); + } + doRegisterOverrideIdentifiers(overrideIdentifiers) { + for (const overrideIdentifier of overrideIdentifiers) { + this.overrideIdentifiers.add(overrideIdentifier); + } + this.updateOverridePropertyPatternKey(); + } + doRegisterConfigurations(configurations, validate, bucket) { + configurations.forEach((configuration) => { + this.validateAndRegisterProperties(configuration, validate, configuration.extensionInfo, configuration.restrictedProperties, void 0, bucket); + this.configurationContributors.push(configuration); + this.registerJSONConfiguration(configuration); + }); + } + validateAndRegisterProperties(configuration, validate = true, extensionInfo, restrictedProperties, scope = 4, bucket) { + scope = isUndefinedOrNull(configuration.scope) ? scope : configuration.scope; + const properties = configuration.properties; + if (properties) { + for (const key in properties) { + const property = properties[key]; + property.section = { + id: configuration.id, + title: configuration.title, + order: configuration.order, + extensionInfo: configuration.extensionInfo + }; + if (validate && validateProperty(key, property, extensionInfo?.id)) { + delete properties[key]; + continue; + } + property.source = extensionInfo; + property.defaultDefaultValue = properties[key].default; + this.updatePropertyDefaultValue(key, property); + if (OVERRIDE_PROPERTY_REGEX.test(key)) { + property.scope = void 0; + } else { + property.scope = isUndefinedOrNull(property.scope) ? scope : property.scope; + property.restricted = isUndefinedOrNull(property.restricted) ? !!restrictedProperties?.includes(key) : property.restricted; + } + if (property.experiment) { + if (!property.tags?.some((tag2) => tag2.toLowerCase() === "onexp")) { + property.tags = property.tags ?? []; + property.tags.push("onExP"); + } + } else if (property.tags?.some((tag2) => tag2.toLowerCase() === "onexp")) { + console.error(`Invalid tag 'onExP' found for property '${key}'. Please use 'experiment' property instead.`); + property.experiment = { mode: "startup" }; + } + const excluded = properties[key].hasOwnProperty("included") && !properties[key].included; + const policyName = properties[key].policy?.name; + if (excluded) { + this.excludedConfigurationProperties[key] = properties[key]; + if (policyName) { + this.policyConfigurations.set(policyName, key); + bucket.add(key); + } + delete properties[key]; + } else { + bucket.add(key); + if (policyName) { + this.policyConfigurations.set(policyName, key); + } + this.configurationProperties[key] = properties[key]; + if (!properties[key].deprecationMessage && properties[key].markdownDeprecationMessage) { + properties[key].deprecationMessage = properties[key].markdownDeprecationMessage; + } + } + } + } + const subNodes = configuration.allOf; + if (subNodes) { + for (const node of subNodes) { + this.validateAndRegisterProperties(node, validate, extensionInfo, restrictedProperties, scope, bucket); + } + } + } + getConfigurationProperties() { + return this.configurationProperties; + } + getPolicyConfigurations() { + return this.policyConfigurations; + } + getExcludedConfigurationProperties() { + return this.excludedConfigurationProperties; + } + registerJSONConfiguration(configuration) { + const register4 = (configuration2) => { + const properties = configuration2.properties; + if (properties) { + for (const key in properties) { + this.updateSchema(key, properties[key]); + } + } + const subNodes = configuration2.allOf; + subNodes?.forEach(register4); + }; + register4(configuration); + } + updateSchema(key, property) { + allSettings.properties[key] = property; + switch (property.scope) { + case 1: + applicationSettings.properties[key] = property; + break; + case 2: + machineSettings.properties[key] = property; + break; + case 3: + applicationMachineSettings.properties[key] = property; + break; + case 7: + machineOverridableSettings.properties[key] = property; + break; + case 4: + windowSettings.properties[key] = property; + break; + case 5: + resourceSettings.properties[key] = property; + break; + case 6: + resourceSettings.properties[key] = property; + this.resourceLanguageSettingsSchema.properties[key] = property; + break; + } + } + updateOverridePropertyPatternKey() { + for (const overrideIdentifier of this.overrideIdentifiers.values()) { + const overrideIdentifierProperty = `[${overrideIdentifier}]`; + const resourceLanguagePropertiesSchema = { + type: "object", + description: localize(1666, "Configure editor settings to be overridden for a language."), + errorMessage: localize(1667, "This setting does not support per-language configuration."), + $ref: resourceLanguageSettingsSchemaId + }; + this.updatePropertyDefaultValue(overrideIdentifierProperty, resourceLanguagePropertiesSchema); + allSettings.properties[overrideIdentifierProperty] = resourceLanguagePropertiesSchema; + applicationSettings.properties[overrideIdentifierProperty] = resourceLanguagePropertiesSchema; + applicationMachineSettings.properties[overrideIdentifierProperty] = resourceLanguagePropertiesSchema; + machineSettings.properties[overrideIdentifierProperty] = resourceLanguagePropertiesSchema; + machineOverridableSettings.properties[overrideIdentifierProperty] = resourceLanguagePropertiesSchema; + windowSettings.properties[overrideIdentifierProperty] = resourceLanguagePropertiesSchema; + resourceSettings.properties[overrideIdentifierProperty] = resourceLanguagePropertiesSchema; + } + } + registerOverridePropertyPatternKey() { + const resourceLanguagePropertiesSchema = { + type: "object", + description: localize(1668, "Configure editor settings to be overridden for a language."), + errorMessage: localize(1669, "This setting does not support per-language configuration."), + $ref: resourceLanguageSettingsSchemaId + }; + allSettings.patternProperties[OVERRIDE_PROPERTY_PATTERN] = resourceLanguagePropertiesSchema; + applicationSettings.patternProperties[OVERRIDE_PROPERTY_PATTERN] = resourceLanguagePropertiesSchema; + applicationMachineSettings.patternProperties[OVERRIDE_PROPERTY_PATTERN] = resourceLanguagePropertiesSchema; + machineSettings.patternProperties[OVERRIDE_PROPERTY_PATTERN] = resourceLanguagePropertiesSchema; + machineOverridableSettings.patternProperties[OVERRIDE_PROPERTY_PATTERN] = resourceLanguagePropertiesSchema; + windowSettings.patternProperties[OVERRIDE_PROPERTY_PATTERN] = resourceLanguagePropertiesSchema; + resourceSettings.patternProperties[OVERRIDE_PROPERTY_PATTERN] = resourceLanguagePropertiesSchema; + this._onDidSchemaChange.fire(); + } + updatePropertyDefaultValue(key, property) { + const configurationdefaultOverride = this.configurationDefaultsOverrides.get(key)?.configurationDefaultOverrideValue; + let defaultValue = void 0; + let defaultSource = void 0; + if (configurationdefaultOverride && (!property.disallowConfigurationDefault || !configurationdefaultOverride.source)) { + defaultValue = configurationdefaultOverride.value; + defaultSource = configurationdefaultOverride.source; + } + if (isUndefined(defaultValue)) { + defaultValue = property.defaultDefaultValue; + defaultSource = void 0; + } + if (isUndefined(defaultValue)) { + defaultValue = getDefaultValue(property.type); + } + property.default = defaultValue; + property.defaultValueSource = defaultSource; + } + }; + OVERRIDE_IDENTIFIER_PATTERN = `\\[([^\\]]+)\\]`; + OVERRIDE_IDENTIFIER_REGEX = new RegExp(OVERRIDE_IDENTIFIER_PATTERN, "g"); + OVERRIDE_PROPERTY_PATTERN = `^(${OVERRIDE_IDENTIFIER_PATTERN})+$`; + OVERRIDE_PROPERTY_REGEX = new RegExp(OVERRIDE_PROPERTY_PATTERN); + configurationRegistry = new ConfigurationRegistry(); + Registry.add(Extensions4.Configuration, configurationRegistry); + EXTENSION_UNIFICATION_EXTENSION_IDS = new Set(product_default.defaultChatAgent ? [product_default.defaultChatAgent.extensionId, product_default.defaultChatAgent.chatExtensionId].map((id) => id.toLowerCase()) : []); + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/common/languages/modesRegistry.js +var Extensions5, EditorModesRegistry, ModesRegistry, PLAINTEXT_LANGUAGE_ID, PLAINTEXT_EXTENSION; +var init_modesRegistry = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/common/languages/modesRegistry.js"() { + init_nls(); + init_event(); + init_platform2(); + init_lifecycle(); + init_mime(); + init_configurationRegistry(); + Extensions5 = { + ModesRegistry: "editor.modesRegistry" + }; + EditorModesRegistry = class extends Disposable { + constructor() { + super(); + this._onDidChangeLanguages = this._register(new Emitter()); + this.onDidChangeLanguages = this._onDidChangeLanguages.event; + this._languages = []; + } + registerLanguage(def2) { + this._languages.push(def2); + this._onDidChangeLanguages.fire(void 0); + return { + dispose: () => { + for (let i2 = 0, len = this._languages.length; i2 < len; i2++) { + if (this._languages[i2] === def2) { + this._languages.splice(i2, 1); + return; + } + } + } + }; + } + getLanguages() { + return this._languages; + } + }; + ModesRegistry = new EditorModesRegistry(); + Registry.add(Extensions5.ModesRegistry, ModesRegistry); + PLAINTEXT_LANGUAGE_ID = "plaintext"; + PLAINTEXT_EXTENSION = ".txt"; + ModesRegistry.registerLanguage({ + id: PLAINTEXT_LANGUAGE_ID, + extensions: [PLAINTEXT_EXTENSION], + aliases: [localize(784, "Plain Text"), "text"], + mimetypes: [Mimes.text] + }); + Registry.as(Extensions4.Configuration).registerDefaultConfigurations([{ + overrides: { + "[plaintext]": { + "editor.unicodeHighlight.ambiguousCharacters": false, + "editor.unicodeHighlight.invisibleCharacters": false + }, + // TODO: Below is a workaround for: https://github.com/microsoft/vscode/issues/240567 + "[go]": { + "editor.insertSpaces": false + }, + "[makefile]": { + "editor.insertSpaces": false + }, + "[shellscript]": { + "files.eol": "\n" + }, + "[yaml]": { + "editor.insertSpaces": true, + "editor.tabSize": 2 + } + } + }]); + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/common/languages/supports/languageBracketsConfiguration.js +function filterValidBrackets(bracketPairs) { + return bracketPairs.filter(([open, close]) => open !== "" && close !== ""); +} +var LanguageBracketsConfiguration, BracketKindBase, OpeningBracketKind, ClosingBracketKind; +var init_languageBracketsConfiguration = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/common/languages/supports/languageBracketsConfiguration.js"() { + init_cache(); + init_richEditBrackets(); + LanguageBracketsConfiguration = class { + constructor(languageId, config) { + this.languageId = languageId; + const bracketPairs = config.brackets ? filterValidBrackets(config.brackets) : []; + const openingBracketInfos = new CachedFunction((bracket) => { + const closing = /* @__PURE__ */ new Set(); + return { + info: new OpeningBracketKind(this, bracket, closing), + closing + }; + }); + const closingBracketInfos = new CachedFunction((bracket) => { + const opening = /* @__PURE__ */ new Set(); + const openingColorized = /* @__PURE__ */ new Set(); + return { + info: new ClosingBracketKind(this, bracket, opening, openingColorized), + opening, + openingColorized + }; + }); + for (const [open, close] of bracketPairs) { + const opening = openingBracketInfos.get(open); + const closing = closingBracketInfos.get(close); + opening.closing.add(closing.info); + closing.opening.add(opening.info); + } + const colorizedBracketPairs = config.colorizedBracketPairs ? filterValidBrackets(config.colorizedBracketPairs) : bracketPairs.filter((p) => !(p[0] === "<" && p[1] === ">")); + for (const [open, close] of colorizedBracketPairs) { + const opening = openingBracketInfos.get(open); + const closing = closingBracketInfos.get(close); + opening.closing.add(closing.info); + closing.openingColorized.add(opening.info); + closing.opening.add(opening.info); + } + this._openingBrackets = new Map([...openingBracketInfos.cachedValues].map(([k, v]) => [k, v.info])); + this._closingBrackets = new Map([...closingBracketInfos.cachedValues].map(([k, v]) => [k, v.info])); + } + /** + * No two brackets have the same bracket text. + */ + get openingBrackets() { + return [...this._openingBrackets.values()]; + } + /** + * No two brackets have the same bracket text. + */ + get closingBrackets() { + return [...this._closingBrackets.values()]; + } + getOpeningBracketInfo(bracketText) { + return this._openingBrackets.get(bracketText); + } + getClosingBracketInfo(bracketText) { + return this._closingBrackets.get(bracketText); + } + getBracketInfo(bracketText) { + return this.getOpeningBracketInfo(bracketText) || this.getClosingBracketInfo(bracketText); + } + getBracketRegExp(options2) { + const brackets = Array.from([...this._openingBrackets.keys(), ...this._closingBrackets.keys()]); + return createBracketOrRegExp(brackets, options2); + } + }; + BracketKindBase = class { + constructor(config, bracketText) { + this.config = config; + this.bracketText = bracketText; + } + get languageId() { + return this.config.languageId; + } + }; + OpeningBracketKind = class extends BracketKindBase { + constructor(config, bracketText, openedBrackets) { + super(config, bracketText); + this.openedBrackets = openedBrackets; + this.isOpeningBracket = true; + } + }; + ClosingBracketKind = class extends BracketKindBase { + constructor(config, bracketText, openingBrackets, openingColorizedBrackets) { + super(config, bracketText); + this.openingBrackets = openingBrackets; + this.openingColorizedBrackets = openingColorizedBrackets; + this.isOpeningBracket = false; + } + /** + * Checks if this bracket closes the given other bracket. + * If the bracket infos come from different configurations, this method will return false. + */ + closes(other) { + if (other["config"] !== this.config) { + return false; + } + return this.openingBrackets.has(other); + } + closesColorized(other) { + if (other["config"] !== this.config) { + return false; + } + return this.openingColorizedBrackets.has(other); + } + getOpeningBrackets() { + return [...this.openingBrackets]; + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/common/languages/languageConfigurationRegistry.js +function computeConfig(languageId, registry, configurationService, languageService) { + let languageConfig = registry.getLanguageConfiguration(languageId); + if (!languageConfig) { + if (!languageService.isRegisteredLanguageId(languageId)) { + return new ResolvedLanguageConfiguration(languageId, {}); + } + languageConfig = new ResolvedLanguageConfiguration(languageId, {}); + } + const customizedConfig = getCustomizedLanguageConfig(languageConfig.languageId, configurationService); + const data = combineLanguageConfigurations([languageConfig.underlyingConfig, customizedConfig]); + const config = new ResolvedLanguageConfiguration(languageConfig.languageId, data); + return config; +} +function getCustomizedLanguageConfig(languageId, configurationService) { + const brackets = configurationService.getValue(customizedLanguageConfigKeys.brackets, { + overrideIdentifier: languageId + }); + const colorizedBracketPairs = configurationService.getValue(customizedLanguageConfigKeys.colorizedBracketPairs, { + overrideIdentifier: languageId + }); + return { + brackets: validateBracketPairs(brackets), + colorizedBracketPairs: validateBracketPairs(colorizedBracketPairs) + }; +} +function validateBracketPairs(data) { + if (!Array.isArray(data)) { + return void 0; + } + return data.map((pair) => { + if (!Array.isArray(pair) || pair.length !== 2) { + return void 0; + } + return [pair[0], pair[1]]; + }).filter((p) => !!p); +} +function getIndentationAtPosition(model, lineNumber, column) { + const lineText = model.getLineContent(lineNumber); + let indentation = getLeadingWhitespace(lineText); + if (indentation.length > column - 1) { + indentation = indentation.substring(0, column - 1); + } + return indentation; +} +function combineLanguageConfigurations(configs) { + let result = { + comments: void 0, + brackets: void 0, + wordPattern: void 0, + indentationRules: void 0, + onEnterRules: void 0, + autoClosingPairs: void 0, + surroundingPairs: void 0, + autoCloseBefore: void 0, + folding: void 0, + colorizedBracketPairs: void 0, + __electricCharacterSupport: void 0 + }; + for (const entry of configs) { + result = { + comments: entry.comments || result.comments, + brackets: entry.brackets || result.brackets, + wordPattern: entry.wordPattern || result.wordPattern, + indentationRules: entry.indentationRules || result.indentationRules, + onEnterRules: entry.onEnterRules || result.onEnterRules, + autoClosingPairs: entry.autoClosingPairs || result.autoClosingPairs, + surroundingPairs: entry.surroundingPairs || result.surroundingPairs, + autoCloseBefore: entry.autoCloseBefore || result.autoCloseBefore, + folding: entry.folding || result.folding, + colorizedBracketPairs: entry.colorizedBracketPairs || result.colorizedBracketPairs, + __electricCharacterSupport: entry.__electricCharacterSupport || result.__electricCharacterSupport + }; + } + return result; +} +var __decorate2, __param2, LanguageConfigurationServiceChangeEvent, ILanguageConfigurationService, LanguageConfigurationService, customizedLanguageConfigKeys, ComposedLanguageConfiguration, LanguageConfigurationContribution, LanguageConfigurationChangeEvent, LanguageConfigurationRegistry, ResolvedLanguageConfiguration; +var init_languageConfigurationRegistry = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/common/languages/languageConfigurationRegistry.js"() { + init_event(); + init_lifecycle(); + init_strings(); + init_wordHelper(); + init_languageConfiguration(); + init_characterPair(); + init_electricCharacter(); + init_indentRules(); + init_onEnter(); + init_richEditBrackets(); + init_instantiation(); + init_configuration(); + init_language(); + init_extensions(); + init_modesRegistry(); + init_languageBracketsConfiguration(); + __decorate2 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + __param2 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + LanguageConfigurationServiceChangeEvent = class { + constructor(languageId) { + this.languageId = languageId; + } + affects(languageId) { + return !this.languageId ? true : this.languageId === languageId; + } + }; + ILanguageConfigurationService = createDecorator("languageConfigurationService"); + LanguageConfigurationService = class LanguageConfigurationService2 extends Disposable { + constructor(configurationService, languageService) { + super(); + this.configurationService = configurationService; + this.languageService = languageService; + this._registry = this._register(new LanguageConfigurationRegistry()); + this.onDidChangeEmitter = this._register(new Emitter()); + this.onDidChange = this.onDidChangeEmitter.event; + this.configurations = /* @__PURE__ */ new Map(); + const languageConfigKeys = new Set(Object.values(customizedLanguageConfigKeys)); + this._register(this.configurationService.onDidChangeConfiguration((e) => { + const globalConfigChanged = e.change.keys.some((k) => languageConfigKeys.has(k)); + const localConfigChanged = e.change.overrides.filter(([overrideLangName, keys]) => keys.some((k) => languageConfigKeys.has(k))).map(([overrideLangName]) => overrideLangName); + if (globalConfigChanged) { + this.configurations.clear(); + this.onDidChangeEmitter.fire(new LanguageConfigurationServiceChangeEvent(void 0)); + } else { + for (const languageId of localConfigChanged) { + if (this.languageService.isRegisteredLanguageId(languageId)) { + this.configurations.delete(languageId); + this.onDidChangeEmitter.fire(new LanguageConfigurationServiceChangeEvent(languageId)); + } + } + } + })); + this._register(this._registry.onDidChange((e) => { + this.configurations.delete(e.languageId); + this.onDidChangeEmitter.fire(new LanguageConfigurationServiceChangeEvent(e.languageId)); + })); + } + register(languageId, configuration, priority) { + return this._registry.register(languageId, configuration, priority); + } + getLanguageConfiguration(languageId) { + let result = this.configurations.get(languageId); + if (!result) { + result = computeConfig(languageId, this._registry, this.configurationService, this.languageService); + this.configurations.set(languageId, result); + } + return result; + } + }; + LanguageConfigurationService = __decorate2([ + __param2(0, IConfigurationService), + __param2(1, ILanguageService) + ], LanguageConfigurationService); + customizedLanguageConfigKeys = { + brackets: "editor.language.brackets", + colorizedBracketPairs: "editor.language.colorizedBracketPairs" + }; + ComposedLanguageConfiguration = class { + constructor(languageId) { + this.languageId = languageId; + this._resolved = null; + this._entries = []; + this._order = 0; + this._resolved = null; + } + register(configuration, priority) { + const entry = new LanguageConfigurationContribution(configuration, priority, ++this._order); + this._entries.push(entry); + this._resolved = null; + return markAsSingleton(toDisposable(() => { + for (let i2 = 0; i2 < this._entries.length; i2++) { + if (this._entries[i2] === entry) { + this._entries.splice(i2, 1); + this._resolved = null; + break; + } + } + })); + } + getResolvedConfiguration() { + if (!this._resolved) { + const config = this._resolve(); + if (config) { + this._resolved = new ResolvedLanguageConfiguration(this.languageId, config); + } + } + return this._resolved; + } + _resolve() { + if (this._entries.length === 0) { + return null; + } + this._entries.sort(LanguageConfigurationContribution.cmp); + return combineLanguageConfigurations(this._entries.map((e) => e.configuration)); + } + }; + LanguageConfigurationContribution = class { + constructor(configuration, priority, order) { + this.configuration = configuration; + this.priority = priority; + this.order = order; + } + static cmp(a, b) { + if (a.priority === b.priority) { + return a.order - b.order; + } + return a.priority - b.priority; + } + }; + LanguageConfigurationChangeEvent = class { + constructor(languageId) { + this.languageId = languageId; + } + }; + LanguageConfigurationRegistry = class extends Disposable { + constructor() { + super(); + this._entries = /* @__PURE__ */ new Map(); + this._onDidChange = this._register(new Emitter()); + this.onDidChange = this._onDidChange.event; + this._register(this.register(PLAINTEXT_LANGUAGE_ID, { + brackets: [ + ["(", ")"], + ["[", "]"], + ["{", "}"] + ], + surroundingPairs: [ + { open: "{", close: "}" }, + { open: "[", close: "]" }, + { open: "(", close: ")" }, + { open: "<", close: ">" }, + { open: '"', close: '"' }, + { open: "'", close: "'" }, + { open: "`", close: "`" } + ], + colorizedBracketPairs: [], + folding: { + offSide: true + } + }, 0)); + } + /** + * @param priority Use a higher number for higher priority + */ + register(languageId, configuration, priority = 0) { + let entries2 = this._entries.get(languageId); + if (!entries2) { + entries2 = new ComposedLanguageConfiguration(languageId); + this._entries.set(languageId, entries2); + } + const disposable = entries2.register(configuration, priority); + this._onDidChange.fire(new LanguageConfigurationChangeEvent(languageId)); + return markAsSingleton(toDisposable(() => { + disposable.dispose(); + this._onDidChange.fire(new LanguageConfigurationChangeEvent(languageId)); + })); + } + getLanguageConfiguration(languageId) { + const entries2 = this._entries.get(languageId); + return entries2?.getResolvedConfiguration() || null; + } + }; + ResolvedLanguageConfiguration = class _ResolvedLanguageConfiguration { + constructor(languageId, underlyingConfig) { + this.languageId = languageId; + this.underlyingConfig = underlyingConfig; + this._brackets = null; + this._electricCharacter = null; + this._onEnterSupport = this.underlyingConfig.brackets || this.underlyingConfig.indentationRules || this.underlyingConfig.onEnterRules ? new OnEnterSupport(this.underlyingConfig) : null; + this.comments = _ResolvedLanguageConfiguration._handleComments(this.underlyingConfig); + this.characterPair = new CharacterPairSupport(this.underlyingConfig); + this.wordDefinition = this.underlyingConfig.wordPattern || DEFAULT_WORD_REGEXP; + this.indentationRules = this.underlyingConfig.indentationRules; + if (this.underlyingConfig.indentationRules) { + this.indentRulesSupport = new IndentRulesSupport(this.underlyingConfig.indentationRules); + } else { + this.indentRulesSupport = null; + } + this.foldingRules = this.underlyingConfig.folding || {}; + this.bracketsNew = new LanguageBracketsConfiguration(languageId, this.underlyingConfig); + } + getWordDefinition() { + return ensureValidWordDefinition(this.wordDefinition); + } + get brackets() { + if (!this._brackets && this.underlyingConfig.brackets) { + this._brackets = new RichEditBrackets(this.languageId, this.underlyingConfig.brackets); + } + return this._brackets; + } + get electricCharacter() { + if (!this._electricCharacter) { + this._electricCharacter = new BracketElectricCharacterSupport(this.brackets); + } + return this._electricCharacter; + } + onEnter(autoIndent, previousLineText, beforeEnterText, afterEnterText) { + if (!this._onEnterSupport) { + return null; + } + return this._onEnterSupport.onEnter(autoIndent, previousLineText, beforeEnterText, afterEnterText); + } + getAutoClosingPairs() { + return new AutoClosingPairs(this.characterPair.getAutoClosingPairs()); + } + getAutoCloseBeforeSet(forQuotes) { + return this.characterPair.getAutoCloseBeforeSet(forQuotes); + } + getSurroundingPairs() { + return this.characterPair.getSurroundingPairs(); + } + static _handleComments(conf) { + const commentRule = conf.comments; + if (!commentRule) { + return null; + } + const comments = {}; + if (commentRule.lineComment) { + if (typeof commentRule.lineComment === "string") { + comments.lineCommentToken = commentRule.lineComment; + } else { + comments.lineCommentToken = commentRule.lineComment.comment; + comments.lineCommentNoIndent = commentRule.lineComment.noIndent; + } + } + if (commentRule.blockComment) { + const [blockStart, blockEnd] = commentRule.blockComment; + comments.blockCommentStartToken = blockStart; + comments.blockCommentEndToken = blockEnd; + } + return comments; + } + }; + registerSingleton( + ILanguageConfigurationService, + LanguageConfigurationService, + 1 + /* InstantiationType.Delayed */ + ); + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/common/encodedTokenAttributes.js +var TokenMetadata; +var init_encodedTokenAttributes = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/common/encodedTokenAttributes.js"() { + TokenMetadata = class { + static getLanguageId(metadata) { + return (metadata & 255) >>> 0; + } + static getTokenType(metadata) { + return (metadata & 768) >>> 8; + } + static containsBalancedBrackets(metadata) { + return (metadata & 1024) !== 0; + } + static getFontStyle(metadata) { + return (metadata & 30720) >>> 11; + } + static getForeground(metadata) { + return (metadata & 16744448) >>> 15; + } + static getBackground(metadata) { + return (metadata & 4278190080) >>> 24; + } + static getClassNameFromMetadata(metadata) { + const foreground2 = this.getForeground(metadata); + let className2 = "mtk" + foreground2; + const fontStyle = this.getFontStyle(metadata); + if (fontStyle & 1) { + className2 += " mtki"; + } + if (fontStyle & 2) { + className2 += " mtkb"; + } + if (fontStyle & 4) { + className2 += " mtku"; + } + if (fontStyle & 8) { + className2 += " mtks"; + } + return className2; + } + static getInlineStyleFromMetadata(metadata, colorMap) { + const foreground2 = this.getForeground(metadata); + const fontStyle = this.getFontStyle(metadata); + let result = `color: ${colorMap[foreground2]};`; + if (fontStyle & 1) { + result += "font-style: italic;"; + } + if (fontStyle & 2) { + result += "font-weight: bold;"; + } + let textDecoration = ""; + if (fontStyle & 4) { + textDecoration += " underline"; + } + if (fontStyle & 8) { + textDecoration += " line-through"; + } + if (textDecoration) { + result += `text-decoration:${textDecoration};`; + } + return result; + } + static getPresentationFromMetadata(metadata) { + const foreground2 = this.getForeground(metadata); + const fontStyle = this.getFontStyle(metadata); + return { + foreground: foreground2, + italic: Boolean( + fontStyle & 1 + /* FontStyle.Italic */ + ), + bold: Boolean( + fontStyle & 2 + /* FontStyle.Bold */ + ), + underline: Boolean( + fontStyle & 4 + /* FontStyle.Underline */ + ), + strikethrough: Boolean( + fontStyle & 8 + /* FontStyle.Strikethrough */ + ) + }; + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/common/core/ranges/offsetRange.js +var OffsetRange, OffsetRangeSet; +var init_offsetRange = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/common/core/ranges/offsetRange.js"() { + init_errors(); + OffsetRange = class _OffsetRange { + static fromTo(start, endExclusive) { + return new _OffsetRange(start, endExclusive); + } + static addRange(range2, sortedRanges) { + let i2 = 0; + while (i2 < sortedRanges.length && sortedRanges[i2].endExclusive < range2.start) { + i2++; + } + let j = i2; + while (j < sortedRanges.length && sortedRanges[j].start <= range2.endExclusive) { + j++; + } + if (i2 === j) { + sortedRanges.splice(i2, 0, range2); + } else { + const start = Math.min(range2.start, sortedRanges[i2].start); + const end = Math.max(range2.endExclusive, sortedRanges[j - 1].endExclusive); + sortedRanges.splice(i2, j - i2, new _OffsetRange(start, end)); + } + } + static tryCreate(start, endExclusive) { + if (start > endExclusive) { + return void 0; + } + return new _OffsetRange(start, endExclusive); + } + static ofLength(length) { + return new _OffsetRange(0, length); + } + static ofStartAndLength(start, length) { + return new _OffsetRange(start, start + length); + } + static emptyAt(offset) { + return new _OffsetRange(offset, offset); + } + constructor(start, endExclusive) { + this.start = start; + this.endExclusive = endExclusive; + if (start > endExclusive) { + throw new BugIndicatingError(`Invalid range: ${this.toString()}`); + } + } + get isEmpty() { + return this.start === this.endExclusive; + } + delta(offset) { + return new _OffsetRange(this.start + offset, this.endExclusive + offset); + } + deltaStart(offset) { + return new _OffsetRange(this.start + offset, this.endExclusive); + } + deltaEnd(offset) { + return new _OffsetRange(this.start, this.endExclusive + offset); + } + get length() { + return this.endExclusive - this.start; + } + toString() { + return `[${this.start}, ${this.endExclusive})`; + } + equals(other) { + return this.start === other.start && this.endExclusive === other.endExclusive; + } + contains(offset) { + return this.start <= offset && offset < this.endExclusive; + } + /** + * for all numbers n: range1.contains(n) or range2.contains(n) => range1.join(range2).contains(n) + * The joined range is the smallest range that contains both ranges. + */ + join(other) { + return new _OffsetRange(Math.min(this.start, other.start), Math.max(this.endExclusive, other.endExclusive)); + } + /** + * for all numbers n: range1.contains(n) and range2.contains(n) <=> range1.intersect(range2).contains(n) + * + * The resulting range is empty if the ranges do not intersect, but touch. + * If the ranges don't even touch, the result is undefined. + */ + intersect(other) { + const start = Math.max(this.start, other.start); + const end = Math.min(this.endExclusive, other.endExclusive); + if (start <= end) { + return new _OffsetRange(start, end); + } + return void 0; + } + intersectionLength(range2) { + const start = Math.max(this.start, range2.start); + const end = Math.min(this.endExclusive, range2.endExclusive); + return Math.max(0, end - start); + } + intersects(other) { + const start = Math.max(this.start, other.start); + const end = Math.min(this.endExclusive, other.endExclusive); + return start < end; + } + intersectsOrTouches(other) { + const start = Math.max(this.start, other.start); + const end = Math.min(this.endExclusive, other.endExclusive); + return start <= end; + } + isBefore(other) { + return this.endExclusive <= other.start; + } + isAfter(other) { + return this.start >= other.endExclusive; + } + slice(arr) { + return arr.slice(this.start, this.endExclusive); + } + substring(str) { + return str.substring(this.start, this.endExclusive); + } + /** + * Returns the given value if it is contained in this instance, otherwise the closest value that is contained. + * The range must not be empty. + */ + clip(value) { + if (this.isEmpty) { + throw new BugIndicatingError(`Invalid clipping range: ${this.toString()}`); + } + return Math.max(this.start, Math.min(this.endExclusive - 1, value)); + } + /** + * Returns `r := value + k * length` such that `r` is contained in this range. + * The range must not be empty. + * + * E.g. `[5, 10).clipCyclic(10) === 5`, `[5, 10).clipCyclic(11) === 6` and `[5, 10).clipCyclic(4) === 9`. + */ + clipCyclic(value) { + if (this.isEmpty) { + throw new BugIndicatingError(`Invalid clipping range: ${this.toString()}`); + } + if (value < this.start) { + return this.endExclusive - (this.start - value) % this.length; + } + if (value >= this.endExclusive) { + return this.start + (value - this.start) % this.length; + } + return value; + } + forEach(f) { + for (let i2 = this.start; i2 < this.endExclusive; i2++) { + f(i2); + } + } + /** + * this: [ 5, 10), range: [10, 15) => [5, 15)] + * Throws if the ranges are not touching. + */ + joinRightTouching(range2) { + if (this.endExclusive !== range2.start) { + throw new BugIndicatingError(`Invalid join: ${this.toString()} and ${range2.toString()}`); + } + return new _OffsetRange(this.start, range2.endExclusive); + } + }; + OffsetRangeSet = class _OffsetRangeSet { + constructor() { + this._sortedRanges = []; + } + addRange(range2) { + let i2 = 0; + while (i2 < this._sortedRanges.length && this._sortedRanges[i2].endExclusive < range2.start) { + i2++; + } + let j = i2; + while (j < this._sortedRanges.length && this._sortedRanges[j].start <= range2.endExclusive) { + j++; + } + if (i2 === j) { + this._sortedRanges.splice(i2, 0, range2); + } else { + const start = Math.min(range2.start, this._sortedRanges[i2].start); + const end = Math.max(range2.endExclusive, this._sortedRanges[j - 1].endExclusive); + this._sortedRanges.splice(i2, j - i2, new OffsetRange(start, end)); + } + } + toString() { + return this._sortedRanges.map((r) => r.toString()).join(", "); + } + /** + * Returns of there is a value that is contained in this instance and the given range. + */ + intersectsStrict(other) { + let i2 = 0; + while (i2 < this._sortedRanges.length && this._sortedRanges[i2].endExclusive <= other.start) { + i2++; + } + return i2 < this._sortedRanges.length && this._sortedRanges[i2].start < other.endExclusive; + } + intersectWithRange(other) { + const result = new _OffsetRangeSet(); + for (const range2 of this._sortedRanges) { + const intersection2 = range2.intersect(other); + if (intersection2) { + result.addRange(intersection2); + } + } + return result; + } + intersectWithRangeLength(other) { + return this.intersectWithRange(other).length; + } + get length() { + return this._sortedRanges.reduce((prev, cur) => prev + cur.length, 0); + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/common/tokens/lineTokens.js +function getStandardTokenTypeAtPosition(model, position) { + const lineNumber = position.lineNumber; + if (!model.tokenization.isCheapToTokenize(lineNumber)) { + return void 0; + } + model.tokenization.forceTokenization(lineNumber); + const lineTokens = model.tokenization.getLineTokens(lineNumber); + const tokenIndex = lineTokens.findTokenIndexAtOffset(position.column - 1); + const tokenType = lineTokens.getStandardTokenType(tokenIndex); + return tokenType; +} +var LineTokens, SliceLineTokens, TokenArray, TokenInfo, TokenArrayBuilder; +var init_lineTokens = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/common/tokens/lineTokens.js"() { + init_encodedTokenAttributes(); + init_offsetRange(); + init_errors(); + LineTokens = class _LineTokens { + static createEmpty(lineContent, decoder) { + const defaultMetadata = _LineTokens.defaultTokenMetadata; + const tokens = new Uint32Array(2); + tokens[0] = lineContent.length; + tokens[1] = defaultMetadata; + return new _LineTokens(tokens, lineContent, decoder); + } + static createFromTextAndMetadata(data, decoder) { + let offset = 0; + let fullText = ""; + const tokens = new Array(); + for (const { text: text2, metadata } of data) { + tokens.push(offset + text2.length, metadata); + offset += text2.length; + fullText += text2; + } + return new _LineTokens(new Uint32Array(tokens), fullText, decoder); + } + static convertToEndOffset(tokens, lineTextLength) { + const tokenCount = tokens.length >>> 1; + const lastTokenIndex = tokenCount - 1; + for (let tokenIndex = 0; tokenIndex < lastTokenIndex; tokenIndex++) { + tokens[tokenIndex << 1] = tokens[tokenIndex + 1 << 1]; + } + tokens[lastTokenIndex << 1] = lineTextLength; + } + static findIndexInTokensArray(tokens, desiredIndex) { + if (tokens.length <= 2) { + return 0; + } + let low = 0; + let high = (tokens.length >>> 1) - 1; + while (low < high) { + const mid = low + Math.floor((high - low) / 2); + const endOffset = tokens[mid << 1]; + if (endOffset === desiredIndex) { + return mid + 1; + } else if (endOffset < desiredIndex) { + low = mid + 1; + } else if (endOffset > desiredIndex) { + high = mid; + } + } + return low; + } + static { + this.defaultTokenMetadata = (0 << 11 | 1 << 15 | 2 << 24) >>> 0; + } + constructor(tokens, text2, decoder) { + this._lineTokensBrand = void 0; + const tokensLength = tokens.length > 1 ? tokens[tokens.length - 2] : 0; + if (tokensLength !== text2.length) { + onUnexpectedError(new Error("Token length and text length do not match!")); + } + this._tokens = tokens; + this._tokensCount = this._tokens.length >>> 1; + this._text = text2; + this.languageIdCodec = decoder; + } + getTextLength() { + return this._text.length; + } + equals(other) { + if (other instanceof _LineTokens) { + return this.slicedEquals(other, 0, this._tokensCount); + } + return false; + } + slicedEquals(other, sliceFromTokenIndex, sliceTokenCount) { + if (this._text !== other._text) { + return false; + } + if (this._tokensCount !== other._tokensCount) { + return false; + } + const from = sliceFromTokenIndex << 1; + const to = from + (sliceTokenCount << 1); + for (let i2 = from; i2 < to; i2++) { + if (this._tokens[i2] !== other._tokens[i2]) { + return false; + } + } + return true; + } + getLineContent() { + return this._text; + } + getCount() { + return this._tokensCount; + } + getStartOffset(tokenIndex) { + if (tokenIndex > 0) { + return this._tokens[tokenIndex - 1 << 1]; + } + return 0; + } + getMetadata(tokenIndex) { + const metadata = this._tokens[(tokenIndex << 1) + 1]; + return metadata; + } + getLanguageId(tokenIndex) { + const metadata = this._tokens[(tokenIndex << 1) + 1]; + const languageId = TokenMetadata.getLanguageId(metadata); + return this.languageIdCodec.decodeLanguageId(languageId); + } + getStandardTokenType(tokenIndex) { + const metadata = this._tokens[(tokenIndex << 1) + 1]; + return TokenMetadata.getTokenType(metadata); + } + getForeground(tokenIndex) { + const metadata = this._tokens[(tokenIndex << 1) + 1]; + return TokenMetadata.getForeground(metadata); + } + getClassName(tokenIndex) { + const metadata = this._tokens[(tokenIndex << 1) + 1]; + return TokenMetadata.getClassNameFromMetadata(metadata); + } + getInlineStyle(tokenIndex, colorMap) { + const metadata = this._tokens[(tokenIndex << 1) + 1]; + return TokenMetadata.getInlineStyleFromMetadata(metadata, colorMap); + } + getPresentation(tokenIndex) { + const metadata = this._tokens[(tokenIndex << 1) + 1]; + return TokenMetadata.getPresentationFromMetadata(metadata); + } + getEndOffset(tokenIndex) { + return this._tokens[tokenIndex << 1]; + } + /** + * Find the token containing offset `offset`. + * @param offset The search offset + * @return The index of the token containing the offset. + */ + findTokenIndexAtOffset(offset) { + return _LineTokens.findIndexInTokensArray(this._tokens, offset); + } + inflate() { + return this; + } + sliceAndInflate(startOffset, endOffset, deltaOffset) { + return new SliceLineTokens(this, startOffset, endOffset, deltaOffset); + } + sliceZeroCopy(range2) { + return this.sliceAndInflate(range2.start, range2.endExclusive, 0); + } + /** + * @pure + * @param insertTokens Must be sorted by offset. + */ + withInserted(insertTokens) { + if (insertTokens.length === 0) { + return this; + } + let nextOriginalTokenIdx = 0; + let nextInsertTokenIdx = 0; + let text2 = ""; + const newTokens = new Array(); + let originalEndOffset = 0; + while (true) { + const nextOriginalTokenEndOffset = nextOriginalTokenIdx < this._tokensCount ? this._tokens[nextOriginalTokenIdx << 1] : -1; + const nextInsertToken = nextInsertTokenIdx < insertTokens.length ? insertTokens[nextInsertTokenIdx] : null; + if (nextOriginalTokenEndOffset !== -1 && (nextInsertToken === null || nextOriginalTokenEndOffset <= nextInsertToken.offset)) { + text2 += this._text.substring(originalEndOffset, nextOriginalTokenEndOffset); + const metadata = this._tokens[(nextOriginalTokenIdx << 1) + 1]; + newTokens.push(text2.length, metadata); + nextOriginalTokenIdx++; + originalEndOffset = nextOriginalTokenEndOffset; + } else if (nextInsertToken) { + if (nextInsertToken.offset > originalEndOffset) { + text2 += this._text.substring(originalEndOffset, nextInsertToken.offset); + const metadata = this._tokens[(nextOriginalTokenIdx << 1) + 1]; + newTokens.push(text2.length, metadata); + originalEndOffset = nextInsertToken.offset; + } + text2 += nextInsertToken.text; + newTokens.push(text2.length, nextInsertToken.tokenMetadata); + nextInsertTokenIdx++; + } else { + break; + } + } + return new _LineTokens(new Uint32Array(newTokens), text2, this.languageIdCodec); + } + getTokensInRange(range2) { + const builder = new TokenArrayBuilder(); + const startTokenIndex = this.findTokenIndexAtOffset(range2.start); + const endTokenIndex = this.findTokenIndexAtOffset(range2.endExclusive); + for (let tokenIndex = startTokenIndex; tokenIndex <= endTokenIndex; tokenIndex++) { + const tokenRange = new OffsetRange(this.getStartOffset(tokenIndex), this.getEndOffset(tokenIndex)); + const length = tokenRange.intersectionLength(range2); + if (length > 0) { + builder.add(length, this.getMetadata(tokenIndex)); + } + } + return builder.build(); + } + getTokenText(tokenIndex) { + const startOffset = this.getStartOffset(tokenIndex); + const endOffset = this.getEndOffset(tokenIndex); + const text2 = this._text.substring(startOffset, endOffset); + return text2; + } + forEach(callback) { + const tokenCount = this.getCount(); + for (let tokenIndex = 0; tokenIndex < tokenCount; tokenIndex++) { + callback(tokenIndex); + } + } + toString() { + let result = ""; + this.forEach((i2) => { + result += `[${this.getTokenText(i2)}]{${this.getClassName(i2)}}`; + }); + return result; + } + }; + SliceLineTokens = class _SliceLineTokens { + constructor(source, startOffset, endOffset, deltaOffset) { + this._source = source; + this._startOffset = startOffset; + this._endOffset = endOffset; + this._deltaOffset = deltaOffset; + this._firstTokenIndex = source.findTokenIndexAtOffset(startOffset); + this.languageIdCodec = source.languageIdCodec; + this._tokensCount = 0; + for (let i2 = this._firstTokenIndex, len = source.getCount(); i2 < len; i2++) { + const tokenStartOffset = source.getStartOffset(i2); + if (tokenStartOffset >= endOffset) { + break; + } + this._tokensCount++; + } + } + getMetadata(tokenIndex) { + return this._source.getMetadata(this._firstTokenIndex + tokenIndex); + } + getLanguageId(tokenIndex) { + return this._source.getLanguageId(this._firstTokenIndex + tokenIndex); + } + getLineContent() { + return this._source.getLineContent().substring(this._startOffset, this._endOffset); + } + equals(other) { + if (other instanceof _SliceLineTokens) { + return this._startOffset === other._startOffset && this._endOffset === other._endOffset && this._deltaOffset === other._deltaOffset && this._source.slicedEquals(other._source, this._firstTokenIndex, this._tokensCount); + } + return false; + } + getCount() { + return this._tokensCount; + } + getStandardTokenType(tokenIndex) { + return this._source.getStandardTokenType(this._firstTokenIndex + tokenIndex); + } + getForeground(tokenIndex) { + return this._source.getForeground(this._firstTokenIndex + tokenIndex); + } + getEndOffset(tokenIndex) { + const tokenEndOffset = this._source.getEndOffset(this._firstTokenIndex + tokenIndex); + return Math.min(this._endOffset, tokenEndOffset) - this._startOffset + this._deltaOffset; + } + getClassName(tokenIndex) { + return this._source.getClassName(this._firstTokenIndex + tokenIndex); + } + getInlineStyle(tokenIndex, colorMap) { + return this._source.getInlineStyle(this._firstTokenIndex + tokenIndex, colorMap); + } + getPresentation(tokenIndex) { + return this._source.getPresentation(this._firstTokenIndex + tokenIndex); + } + findTokenIndexAtOffset(offset) { + return this._source.findTokenIndexAtOffset(offset + this._startOffset - this._deltaOffset) - this._firstTokenIndex; + } + getTokenText(tokenIndex) { + const adjustedTokenIndex = this._firstTokenIndex + tokenIndex; + const tokenStartOffset = this._source.getStartOffset(adjustedTokenIndex); + const tokenEndOffset = this._source.getEndOffset(adjustedTokenIndex); + let text2 = this._source.getTokenText(adjustedTokenIndex); + if (tokenStartOffset < this._startOffset) { + text2 = text2.substring(this._startOffset - tokenStartOffset); + } + if (tokenEndOffset > this._endOffset) { + text2 = text2.substring(0, text2.length - (tokenEndOffset - this._endOffset)); + } + return text2; + } + forEach(callback) { + for (let tokenIndex = 0; tokenIndex < this.getCount(); tokenIndex++) { + callback(tokenIndex); + } + } + }; + TokenArray = class _TokenArray { + static fromLineTokens(lineTokens) { + const tokenInfo = []; + for (let i2 = 0; i2 < lineTokens.getCount(); i2++) { + tokenInfo.push(new TokenInfo(lineTokens.getEndOffset(i2) - lineTokens.getStartOffset(i2), lineTokens.getMetadata(i2))); + } + return _TokenArray.create(tokenInfo); + } + static create(tokenInfo) { + return new _TokenArray(tokenInfo); + } + constructor(_tokenInfo) { + this._tokenInfo = _tokenInfo; + } + toLineTokens(lineContent, decoder) { + return LineTokens.createFromTextAndMetadata(this.map((r, t) => ({ text: r.substring(lineContent), metadata: t.metadata })), decoder); + } + forEach(cb) { + let lengthSum = 0; + for (const tokenInfo of this._tokenInfo) { + const range2 = new OffsetRange(lengthSum, lengthSum + tokenInfo.length); + cb(range2, tokenInfo); + lengthSum += tokenInfo.length; + } + } + map(cb) { + const result = []; + let lengthSum = 0; + for (const tokenInfo of this._tokenInfo) { + const range2 = new OffsetRange(lengthSum, lengthSum + tokenInfo.length); + result.push(cb(range2, tokenInfo)); + lengthSum += tokenInfo.length; + } + return result; + } + slice(range2) { + const result = []; + let lengthSum = 0; + for (const tokenInfo of this._tokenInfo) { + const tokenStart = lengthSum; + const tokenEndEx = tokenStart + tokenInfo.length; + if (tokenEndEx > range2.start) { + if (tokenStart >= range2.endExclusive) { + break; + } + const deltaBefore = Math.max(0, range2.start - tokenStart); + const deltaAfter = Math.max(0, tokenEndEx - range2.endExclusive); + result.push(new TokenInfo(tokenInfo.length - deltaBefore - deltaAfter, tokenInfo.metadata)); + } + lengthSum += tokenInfo.length; + } + return _TokenArray.create(result); + } + }; + TokenInfo = class { + constructor(length, metadata) { + this.length = length; + this.metadata = metadata; + } + }; + TokenArrayBuilder = class { + constructor() { + this._tokens = []; + } + add(length, metadata) { + this._tokens.push(new TokenInfo(length, metadata)); + } + build() { + return TokenArray.create(this._tokens); + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/common/editorContextKeys.js +var EditorContextKeys; +var init_editorContextKeys = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/common/editorContextKeys.js"() { + init_nls(); + init_contextkey(); + (function(EditorContextKeys2) { + EditorContextKeys2.editorSimpleInput = new RawContextKey("editorSimpleInput", false, true); + EditorContextKeys2.editorTextFocus = new RawContextKey("editorTextFocus", false, localize(681, "Whether the editor text has focus (cursor is blinking)")); + EditorContextKeys2.focus = new RawContextKey("editorFocus", false, localize(682, "Whether the editor or an editor widget has focus (e.g. focus is in the find widget)")); + EditorContextKeys2.textInputFocus = new RawContextKey("textInputFocus", false, localize(683, "Whether an editor or a rich text input has focus (cursor is blinking)")); + EditorContextKeys2.readOnly = new RawContextKey("editorReadonly", false, localize(684, "Whether the editor is read-only")); + EditorContextKeys2.inDiffEditor = new RawContextKey("inDiffEditor", false, localize(685, "Whether the context is a diff editor")); + EditorContextKeys2.isEmbeddedDiffEditor = new RawContextKey("isEmbeddedDiffEditor", false, localize(686, "Whether the context is an embedded diff editor")); + EditorContextKeys2.inMultiDiffEditor = new RawContextKey("inMultiDiffEditor", false, localize(687, "Whether the context is a multi diff editor")); + EditorContextKeys2.multiDiffEditorAllCollapsed = new RawContextKey("multiDiffEditorAllCollapsed", void 0, localize(688, "Whether all files in multi diff editor are collapsed")); + EditorContextKeys2.hasChanges = new RawContextKey("diffEditorHasChanges", false, localize(689, "Whether the diff editor has changes")); + EditorContextKeys2.comparingMovedCode = new RawContextKey("comparingMovedCode", false, localize(690, "Whether a moved code block is selected for comparison")); + EditorContextKeys2.accessibleDiffViewerVisible = new RawContextKey("accessibleDiffViewerVisible", false, localize(691, "Whether the accessible diff viewer is visible")); + EditorContextKeys2.diffEditorRenderSideBySideInlineBreakpointReached = new RawContextKey("diffEditorRenderSideBySideInlineBreakpointReached", false, localize(692, "Whether the diff editor render side by side inline breakpoint is reached")); + EditorContextKeys2.diffEditorInlineMode = new RawContextKey("diffEditorInlineMode", false, localize(693, "Whether inline mode is active")); + EditorContextKeys2.diffEditorOriginalWritable = new RawContextKey("diffEditorOriginalWritable", false, localize(694, "Whether modified is writable in the diff editor")); + EditorContextKeys2.diffEditorModifiedWritable = new RawContextKey("diffEditorModifiedWritable", false, localize(695, "Whether modified is writable in the diff editor")); + EditorContextKeys2.diffEditorOriginalUri = new RawContextKey("diffEditorOriginalUri", "", localize(696, "The uri of the original document")); + EditorContextKeys2.diffEditorModifiedUri = new RawContextKey("diffEditorModifiedUri", "", localize(697, "The uri of the modified document")); + EditorContextKeys2.columnSelection = new RawContextKey("editorColumnSelection", false, localize(698, "Whether `editor.columnSelection` is enabled")); + EditorContextKeys2.writable = EditorContextKeys2.readOnly.toNegated(); + EditorContextKeys2.hasNonEmptySelection = new RawContextKey("editorHasSelection", false, localize(699, "Whether the editor has text selected")); + EditorContextKeys2.hasOnlyEmptySelection = EditorContextKeys2.hasNonEmptySelection.toNegated(); + EditorContextKeys2.hasMultipleSelections = new RawContextKey("editorHasMultipleSelections", false, localize(700, "Whether the editor has multiple selections")); + EditorContextKeys2.hasSingleSelection = EditorContextKeys2.hasMultipleSelections.toNegated(); + EditorContextKeys2.tabMovesFocus = new RawContextKey("editorTabMovesFocus", false, localize(701, "Whether `Tab` will move focus out of the editor")); + EditorContextKeys2.tabDoesNotMoveFocus = EditorContextKeys2.tabMovesFocus.toNegated(); + EditorContextKeys2.isInEmbeddedEditor = new RawContextKey("isInEmbeddedEditor", false, true); + EditorContextKeys2.canUndo = new RawContextKey("canUndo", false, true); + EditorContextKeys2.canRedo = new RawContextKey("canRedo", false, true); + EditorContextKeys2.hoverVisible = new RawContextKey("editorHoverVisible", false, localize(702, "Whether the editor hover is visible")); + EditorContextKeys2.hoverFocused = new RawContextKey("editorHoverFocused", false, localize(703, "Whether the editor hover is focused")); + EditorContextKeys2.stickyScrollFocused = new RawContextKey("stickyScrollFocused", false, localize(704, "Whether the sticky scroll is focused")); + EditorContextKeys2.stickyScrollVisible = new RawContextKey("stickyScrollVisible", false, localize(705, "Whether the sticky scroll is visible")); + EditorContextKeys2.standaloneColorPickerVisible = new RawContextKey("standaloneColorPickerVisible", false, localize(706, "Whether the standalone color picker is visible")); + EditorContextKeys2.standaloneColorPickerFocused = new RawContextKey("standaloneColorPickerFocused", false, localize(707, "Whether the standalone color picker is focused")); + EditorContextKeys2.inCompositeEditor = new RawContextKey("inCompositeEditor", void 0, localize(708, "Whether the editor is part of a larger editor (e.g. notebooks)")); + EditorContextKeys2.notInCompositeEditor = EditorContextKeys2.inCompositeEditor.toNegated(); + EditorContextKeys2.languageId = new RawContextKey("editorLangId", "", localize(709, "The language identifier of the editor")); + EditorContextKeys2.hasCompletionItemProvider = new RawContextKey("editorHasCompletionItemProvider", false, localize(710, "Whether the editor has a completion item provider")); + EditorContextKeys2.hasCodeActionsProvider = new RawContextKey("editorHasCodeActionsProvider", false, localize(711, "Whether the editor has a code actions provider")); + EditorContextKeys2.hasCodeLensProvider = new RawContextKey("editorHasCodeLensProvider", false, localize(712, "Whether the editor has a code lens provider")); + EditorContextKeys2.hasDefinitionProvider = new RawContextKey("editorHasDefinitionProvider", false, localize(713, "Whether the editor has a definition provider")); + EditorContextKeys2.hasDeclarationProvider = new RawContextKey("editorHasDeclarationProvider", false, localize(714, "Whether the editor has a declaration provider")); + EditorContextKeys2.hasImplementationProvider = new RawContextKey("editorHasImplementationProvider", false, localize(715, "Whether the editor has an implementation provider")); + EditorContextKeys2.hasTypeDefinitionProvider = new RawContextKey("editorHasTypeDefinitionProvider", false, localize(716, "Whether the editor has a type definition provider")); + EditorContextKeys2.hasHoverProvider = new RawContextKey("editorHasHoverProvider", false, localize(717, "Whether the editor has a hover provider")); + EditorContextKeys2.hasDocumentHighlightProvider = new RawContextKey("editorHasDocumentHighlightProvider", false, localize(718, "Whether the editor has a document highlight provider")); + EditorContextKeys2.hasDocumentSymbolProvider = new RawContextKey("editorHasDocumentSymbolProvider", false, localize(719, "Whether the editor has a document symbol provider")); + EditorContextKeys2.hasReferenceProvider = new RawContextKey("editorHasReferenceProvider", false, localize(720, "Whether the editor has a reference provider")); + EditorContextKeys2.hasRenameProvider = new RawContextKey("editorHasRenameProvider", false, localize(721, "Whether the editor has a rename provider")); + EditorContextKeys2.hasSignatureHelpProvider = new RawContextKey("editorHasSignatureHelpProvider", false, localize(722, "Whether the editor has a signature help provider")); + EditorContextKeys2.hasInlayHintsProvider = new RawContextKey("editorHasInlayHintsProvider", false, localize(723, "Whether the editor has an inline hints provider")); + EditorContextKeys2.hasDocumentFormattingProvider = new RawContextKey("editorHasDocumentFormattingProvider", false, localize(724, "Whether the editor has a document formatting provider")); + EditorContextKeys2.hasDocumentSelectionFormattingProvider = new RawContextKey("editorHasDocumentSelectionFormattingProvider", false, localize(725, "Whether the editor has a document selection formatting provider")); + EditorContextKeys2.hasMultipleDocumentFormattingProvider = new RawContextKey("editorHasMultipleDocumentFormattingProvider", false, localize(726, "Whether the editor has multiple document formatting providers")); + EditorContextKeys2.hasMultipleDocumentSelectionFormattingProvider = new RawContextKey("editorHasMultipleDocumentSelectionFormattingProvider", false, localize(727, "Whether the editor has multiple document selection formatting providers")); + })(EditorContextKeys || (EditorContextKeys = {})); + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/browser/config/elementSizeObserver.js +var ElementSizeObserver; +var init_elementSizeObserver = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/browser/config/elementSizeObserver.js"() { + init_lifecycle(); + init_event(); + init_dom(); + ElementSizeObserver = class extends Disposable { + constructor(referenceDomElement, dimension) { + super(); + this._onDidChange = this._register(new Emitter()); + this.onDidChange = this._onDidChange.event; + this._referenceDomElement = referenceDomElement; + this._width = -1; + this._height = -1; + this._resizeObserver = null; + this.measureReferenceDomElement(false, dimension); + } + dispose() { + this.stopObserving(); + super.dispose(); + } + getWidth() { + return this._width; + } + getHeight() { + return this._height; + } + startObserving() { + if (!this._resizeObserver && this._referenceDomElement) { + let observedDimenstion = null; + const observeNow = () => { + if (observedDimenstion) { + this.observe({ width: observedDimenstion.width, height: observedDimenstion.height }); + } else { + this.observe(); + } + }; + let shouldObserve = false; + let alreadyObservedThisAnimationFrame = false; + const update = () => { + if (shouldObserve && !alreadyObservedThisAnimationFrame) { + try { + shouldObserve = false; + alreadyObservedThisAnimationFrame = true; + observeNow(); + } finally { + scheduleAtNextAnimationFrame(getWindow(this._referenceDomElement), () => { + alreadyObservedThisAnimationFrame = false; + update(); + }); + } + } + }; + this._resizeObserver = new ResizeObserver((entries2) => { + if (entries2 && entries2[0] && entries2[0].contentRect) { + observedDimenstion = { width: entries2[0].contentRect.width, height: entries2[0].contentRect.height }; + } else { + observedDimenstion = null; + } + shouldObserve = true; + update(); + }); + this._resizeObserver.observe(this._referenceDomElement); + } + } + stopObserving() { + if (this._resizeObserver) { + this._resizeObserver.disconnect(); + this._resizeObserver = null; + } + } + observe(dimension) { + this.measureReferenceDomElement(true, dimension); + } + measureReferenceDomElement(emitEvent, dimension) { + let observedWidth = 0; + let observedHeight = 0; + if (dimension) { + observedWidth = dimension.width; + observedHeight = dimension.height; + } else if (this._referenceDomElement) { + observedWidth = this._referenceDomElement.clientWidth; + observedHeight = this._referenceDomElement.clientHeight; + } + observedWidth = Math.max(5, observedWidth); + observedHeight = Math.max(5, observedHeight); + if (this._width !== observedWidth || this._height !== observedHeight) { + this._width = observedWidth; + this._height = observedHeight; + if (emitEvent) { + this._onDidChange.fire(); + } + } + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/common/core/misc/textModelDefaults.js +var EDITOR_MODEL_DEFAULTS; +var init_textModelDefaults = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/common/core/misc/textModelDefaults.js"() { + EDITOR_MODEL_DEFAULTS = { + tabSize: 4, + indentSize: 4, + insertSpaces: true, + detectIndentation: true, + trimAutoWhitespace: true, + largeFileOptimizations: true, + bracketPairColorizationOptions: { + enabled: true, + independentColorPoolPerBracketType: false + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/common/color.js +function roundFloat(number, decimalPoints) { + const decimal = Math.pow(10, decimalPoints); + return Math.round(number * decimal) / decimal; +} +var RGBA, HSLA, HSVA, Color; +var init_color = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/common/color.js"() { + RGBA = class { + constructor(r, g, b, a = 1) { + this._rgbaBrand = void 0; + this.r = Math.min(255, Math.max(0, r)) | 0; + this.g = Math.min(255, Math.max(0, g)) | 0; + this.b = Math.min(255, Math.max(0, b)) | 0; + this.a = roundFloat(Math.max(Math.min(1, a), 0), 3); + } + static equals(a, b) { + return a.r === b.r && a.g === b.g && a.b === b.b && a.a === b.a; + } + }; + HSLA = class _HSLA { + constructor(h2, s, l, a) { + this._hslaBrand = void 0; + this.h = Math.max(Math.min(360, h2), 0) | 0; + this.s = roundFloat(Math.max(Math.min(1, s), 0), 3); + this.l = roundFloat(Math.max(Math.min(1, l), 0), 3); + this.a = roundFloat(Math.max(Math.min(1, a), 0), 3); + } + static equals(a, b) { + return a.h === b.h && a.s === b.s && a.l === b.l && a.a === b.a; + } + /** + * Converts an RGB color value to HSL. Conversion formula + * adapted from http://en.wikipedia.org/wiki/HSL_color_space. + * Assumes r, g, and b are contained in the set [0, 255] and + * returns h in the set [0, 360], s, and l in the set [0, 1]. + */ + static fromRGBA(rgba) { + const r = rgba.r / 255; + const g = rgba.g / 255; + const b = rgba.b / 255; + const a = rgba.a; + const max = Math.max(r, g, b); + const min = Math.min(r, g, b); + let h2 = 0; + let s = 0; + const l = (min + max) / 2; + const chroma = max - min; + if (chroma > 0) { + s = Math.min(l <= 0.5 ? chroma / (2 * l) : chroma / (2 - 2 * l), 1); + switch (max) { + case r: + h2 = (g - b) / chroma + (g < b ? 6 : 0); + break; + case g: + h2 = (b - r) / chroma + 2; + break; + case b: + h2 = (r - g) / chroma + 4; + break; + } + h2 *= 60; + h2 = Math.round(h2); + } + return new _HSLA(h2, s, l, a); + } + static _hue2rgb(p, q, t) { + if (t < 0) { + t += 1; + } + if (t > 1) { + t -= 1; + } + if (t < 1 / 6) { + return p + (q - p) * 6 * t; + } + if (t < 1 / 2) { + return q; + } + if (t < 2 / 3) { + return p + (q - p) * (2 / 3 - t) * 6; + } + return p; + } + /** + * Converts an HSL color value to RGB. Conversion formula + * adapted from http://en.wikipedia.org/wiki/HSL_color_space. + * Assumes h in the set [0, 360] s, and l are contained in the set [0, 1] and + * returns r, g, and b in the set [0, 255]. + */ + static toRGBA(hsla) { + const h2 = hsla.h / 360; + const { s, l, a } = hsla; + let r, g, b; + if (s === 0) { + r = g = b = l; + } else { + const q = l < 0.5 ? l * (1 + s) : l + s - l * s; + const p = 2 * l - q; + r = _HSLA._hue2rgb(p, q, h2 + 1 / 3); + g = _HSLA._hue2rgb(p, q, h2); + b = _HSLA._hue2rgb(p, q, h2 - 1 / 3); + } + return new RGBA(Math.round(r * 255), Math.round(g * 255), Math.round(b * 255), a); + } + }; + HSVA = class _HSVA { + constructor(h2, s, v, a) { + this._hsvaBrand = void 0; + this.h = Math.max(Math.min(360, h2), 0) | 0; + this.s = roundFloat(Math.max(Math.min(1, s), 0), 3); + this.v = roundFloat(Math.max(Math.min(1, v), 0), 3); + this.a = roundFloat(Math.max(Math.min(1, a), 0), 3); + } + static equals(a, b) { + return a.h === b.h && a.s === b.s && a.v === b.v && a.a === b.a; + } + // from http://www.rapidtables.com/convert/color/rgb-to-hsv.htm + static fromRGBA(rgba) { + const r = rgba.r / 255; + const g = rgba.g / 255; + const b = rgba.b / 255; + const cmax = Math.max(r, g, b); + const cmin = Math.min(r, g, b); + const delta = cmax - cmin; + const s = cmax === 0 ? 0 : delta / cmax; + let m; + if (delta === 0) { + m = 0; + } else if (cmax === r) { + m = ((g - b) / delta % 6 + 6) % 6; + } else if (cmax === g) { + m = (b - r) / delta + 2; + } else { + m = (r - g) / delta + 4; + } + return new _HSVA(Math.round(m * 60), s, cmax, rgba.a); + } + // from http://www.rapidtables.com/convert/color/hsv-to-rgb.htm + static toRGBA(hsva) { + const { h: h2, s, v, a } = hsva; + const c = v * s; + const x = c * (1 - Math.abs(h2 / 60 % 2 - 1)); + const m = v - c; + let [r, g, b] = [0, 0, 0]; + if (h2 < 60) { + r = c; + g = x; + } else if (h2 < 120) { + r = x; + g = c; + } else if (h2 < 180) { + g = c; + b = x; + } else if (h2 < 240) { + g = x; + b = c; + } else if (h2 < 300) { + r = x; + b = c; + } else if (h2 <= 360) { + r = c; + b = x; + } + r = Math.round((r + m) * 255); + g = Math.round((g + m) * 255); + b = Math.round((b + m) * 255); + return new RGBA(r, g, b, a); + } + }; + Color = class _Color { + static fromHex(hex) { + return _Color.Format.CSS.parseHex(hex) || _Color.red; + } + static equals(a, b) { + if (!a && !b) { + return true; + } + if (!a || !b) { + return false; + } + return a.equals(b); + } + get hsla() { + if (this._hsla) { + return this._hsla; + } else { + return HSLA.fromRGBA(this.rgba); + } + } + get hsva() { + if (this._hsva) { + return this._hsva; + } + return HSVA.fromRGBA(this.rgba); + } + constructor(arg) { + if (!arg) { + throw new Error("Color needs a value"); + } else if (arg instanceof RGBA) { + this.rgba = arg; + } else if (arg instanceof HSLA) { + this._hsla = arg; + this.rgba = HSLA.toRGBA(arg); + } else if (arg instanceof HSVA) { + this._hsva = arg; + this.rgba = HSVA.toRGBA(arg); + } else { + throw new Error("Invalid color ctor argument"); + } + } + equals(other) { + return !!other && RGBA.equals(this.rgba, other.rgba) && HSLA.equals(this.hsla, other.hsla) && HSVA.equals(this.hsva, other.hsva); + } + /** + * http://www.w3.org/TR/WCAG20/#relativeluminancedef + * Returns the number in the set [0, 1]. O => Darkest Black. 1 => Lightest white. + */ + getRelativeLuminance() { + const R = _Color._relativeLuminanceForComponent(this.rgba.r); + const G = _Color._relativeLuminanceForComponent(this.rgba.g); + const B = _Color._relativeLuminanceForComponent(this.rgba.b); + const luminance = 0.2126 * R + 0.7152 * G + 0.0722 * B; + return roundFloat(luminance, 4); + } + static _relativeLuminanceForComponent(color) { + const c = color / 255; + return c <= 0.03928 ? c / 12.92 : Math.pow((c + 0.055) / 1.055, 2.4); + } + /** + * http://24ways.org/2010/calculating-color-contrast + * Return 'true' if lighter color otherwise 'false' + */ + isLighter() { + const yiq = (this.rgba.r * 299 + this.rgba.g * 587 + this.rgba.b * 114) / 1e3; + return yiq >= 128; + } + isLighterThan(another) { + const lum1 = this.getRelativeLuminance(); + const lum2 = another.getRelativeLuminance(); + return lum1 > lum2; + } + isDarkerThan(another) { + const lum1 = this.getRelativeLuminance(); + const lum2 = another.getRelativeLuminance(); + return lum1 < lum2; + } + lighten(factor2) { + return new _Color(new HSLA(this.hsla.h, this.hsla.s, this.hsla.l + this.hsla.l * factor2, this.hsla.a)); + } + darken(factor2) { + return new _Color(new HSLA(this.hsla.h, this.hsla.s, this.hsla.l - this.hsla.l * factor2, this.hsla.a)); + } + transparent(factor2) { + const { r, g, b, a } = this.rgba; + return new _Color(new RGBA(r, g, b, a * factor2)); + } + isTransparent() { + return this.rgba.a === 0; + } + isOpaque() { + return this.rgba.a === 1; + } + opposite() { + return new _Color(new RGBA(255 - this.rgba.r, 255 - this.rgba.g, 255 - this.rgba.b, this.rgba.a)); + } + /** + * Mixes the current color with the provided color based on the given factor. + * @param color The color to mix with + * @param factor The factor of mixing (0 means this color, 1 means the input color, 0.5 means equal mix) + * @returns A new color representing the mix + */ + mix(color, factor2 = 0.5) { + const normalize3 = Math.min(Math.max(factor2, 0), 1); + const thisRGBA = this.rgba; + const otherRGBA = color.rgba; + const r = thisRGBA.r + (otherRGBA.r - thisRGBA.r) * normalize3; + const g = thisRGBA.g + (otherRGBA.g - thisRGBA.g) * normalize3; + const b = thisRGBA.b + (otherRGBA.b - thisRGBA.b) * normalize3; + const a = thisRGBA.a + (otherRGBA.a - thisRGBA.a) * normalize3; + return new _Color(new RGBA(r, g, b, a)); + } + makeOpaque(opaqueBackground) { + if (this.isOpaque() || opaqueBackground.rgba.a !== 1) { + return this; + } + const { r, g, b, a } = this.rgba; + return new _Color(new RGBA(opaqueBackground.rgba.r - a * (opaqueBackground.rgba.r - r), opaqueBackground.rgba.g - a * (opaqueBackground.rgba.g - g), opaqueBackground.rgba.b - a * (opaqueBackground.rgba.b - b), 1)); + } + toString() { + if (!this._toString) { + this._toString = _Color.Format.CSS.format(this); + } + return this._toString; + } + toNumber32Bit() { + if (!this._toNumber32Bit) { + this._toNumber32Bit = (this.rgba.r << 24 | this.rgba.g << 16 | this.rgba.b << 8 | this.rgba.a * 255 << 0) >>> 0; + } + return this._toNumber32Bit; + } + static getLighterColor(of, relative2, factor2) { + if (of.isLighterThan(relative2)) { + return of; + } + factor2 = factor2 ? factor2 : 0.5; + const lum1 = of.getRelativeLuminance(); + const lum2 = relative2.getRelativeLuminance(); + factor2 = factor2 * (lum2 - lum1) / lum2; + return of.lighten(factor2); + } + static getDarkerColor(of, relative2, factor2) { + if (of.isDarkerThan(relative2)) { + return of; + } + factor2 = factor2 ? factor2 : 0.5; + const lum1 = of.getRelativeLuminance(); + const lum2 = relative2.getRelativeLuminance(); + factor2 = factor2 * (lum1 - lum2) / lum1; + return of.darken(factor2); + } + static { + this.white = new _Color(new RGBA(255, 255, 255, 1)); + } + static { + this.black = new _Color(new RGBA(0, 0, 0, 1)); + } + static { + this.red = new _Color(new RGBA(255, 0, 0, 1)); + } + static { + this.blue = new _Color(new RGBA(0, 0, 255, 1)); + } + static { + this.green = new _Color(new RGBA(0, 255, 0, 1)); + } + static { + this.cyan = new _Color(new RGBA(0, 255, 255, 1)); + } + static { + this.lightgrey = new _Color(new RGBA(211, 211, 211, 1)); + } + static { + this.transparent = new _Color(new RGBA(0, 0, 0, 0)); + } + }; + (function(Color2) { + let Format; + (function(Format2) { + let CSS2; + (function(CSS3) { + function formatRGB(color) { + if (color.rgba.a === 1) { + return `rgb(${color.rgba.r}, ${color.rgba.g}, ${color.rgba.b})`; + } + return Color2.Format.CSS.formatRGBA(color); + } + CSS3.formatRGB = formatRGB; + function formatRGBA(color) { + return `rgba(${color.rgba.r}, ${color.rgba.g}, ${color.rgba.b}, ${+color.rgba.a.toFixed(2)})`; + } + CSS3.formatRGBA = formatRGBA; + function formatHSL(color) { + if (color.hsla.a === 1) { + return `hsl(${color.hsla.h}, ${Math.round(color.hsla.s * 100)}%, ${Math.round(color.hsla.l * 100)}%)`; + } + return Color2.Format.CSS.formatHSLA(color); + } + CSS3.formatHSL = formatHSL; + function formatHSLA(color) { + return `hsla(${color.hsla.h}, ${Math.round(color.hsla.s * 100)}%, ${Math.round(color.hsla.l * 100)}%, ${color.hsla.a.toFixed(2)})`; + } + CSS3.formatHSLA = formatHSLA; + function _toTwoDigitHex(n2) { + const r = n2.toString(16); + return r.length !== 2 ? "0" + r : r; + } + function formatHex(color) { + return `#${_toTwoDigitHex(color.rgba.r)}${_toTwoDigitHex(color.rgba.g)}${_toTwoDigitHex(color.rgba.b)}`; + } + CSS3.formatHex = formatHex; + function formatHexA(color, compact = false) { + if (compact && color.rgba.a === 1) { + return Color2.Format.CSS.formatHex(color); + } + return `#${_toTwoDigitHex(color.rgba.r)}${_toTwoDigitHex(color.rgba.g)}${_toTwoDigitHex(color.rgba.b)}${_toTwoDigitHex(Math.round(color.rgba.a * 255))}`; + } + CSS3.formatHexA = formatHexA; + function format2(color) { + if (color.isOpaque()) { + return Color2.Format.CSS.formatHex(color); + } + return Color2.Format.CSS.formatRGBA(color); + } + CSS3.format = format2; + function parse4(css) { + if (css === "transparent") { + return Color2.transparent; + } + if (css.startsWith("#")) { + return parseHex(css); + } + if (css.startsWith("rgba(")) { + const color = css.match(/rgba\((?(?:\+|-)?\d+), *(?(?:\+|-)?\d+), *(?(?:\+|-)?\d+), *(?(?:\+|-)?\d+(\.\d+)?)\)/); + if (!color) { + throw new Error("Invalid color format " + css); + } + const r = parseInt(color.groups?.r ?? "0"); + const g = parseInt(color.groups?.g ?? "0"); + const b = parseInt(color.groups?.b ?? "0"); + const a = parseFloat(color.groups?.a ?? "0"); + return new Color2(new RGBA(r, g, b, a)); + } + if (css.startsWith("rgb(")) { + const color = css.match(/rgb\((?(?:\+|-)?\d+), *(?(?:\+|-)?\d+), *(?(?:\+|-)?\d+)\)/); + if (!color) { + throw new Error("Invalid color format " + css); + } + const r = parseInt(color.groups?.r ?? "0"); + const g = parseInt(color.groups?.g ?? "0"); + const b = parseInt(color.groups?.b ?? "0"); + return new Color2(new RGBA(r, g, b)); + } + return parseNamedKeyword(css); + } + CSS3.parse = parse4; + function parseNamedKeyword(css) { + switch (css) { + case "aliceblue": + return new Color2(new RGBA(240, 248, 255, 1)); + case "antiquewhite": + return new Color2(new RGBA(250, 235, 215, 1)); + case "aqua": + return new Color2(new RGBA(0, 255, 255, 1)); + case "aquamarine": + return new Color2(new RGBA(127, 255, 212, 1)); + case "azure": + return new Color2(new RGBA(240, 255, 255, 1)); + case "beige": + return new Color2(new RGBA(245, 245, 220, 1)); + case "bisque": + return new Color2(new RGBA(255, 228, 196, 1)); + case "black": + return new Color2(new RGBA(0, 0, 0, 1)); + case "blanchedalmond": + return new Color2(new RGBA(255, 235, 205, 1)); + case "blue": + return new Color2(new RGBA(0, 0, 255, 1)); + case "blueviolet": + return new Color2(new RGBA(138, 43, 226, 1)); + case "brown": + return new Color2(new RGBA(165, 42, 42, 1)); + case "burlywood": + return new Color2(new RGBA(222, 184, 135, 1)); + case "cadetblue": + return new Color2(new RGBA(95, 158, 160, 1)); + case "chartreuse": + return new Color2(new RGBA(127, 255, 0, 1)); + case "chocolate": + return new Color2(new RGBA(210, 105, 30, 1)); + case "coral": + return new Color2(new RGBA(255, 127, 80, 1)); + case "cornflowerblue": + return new Color2(new RGBA(100, 149, 237, 1)); + case "cornsilk": + return new Color2(new RGBA(255, 248, 220, 1)); + case "crimson": + return new Color2(new RGBA(220, 20, 60, 1)); + case "cyan": + return new Color2(new RGBA(0, 255, 255, 1)); + case "darkblue": + return new Color2(new RGBA(0, 0, 139, 1)); + case "darkcyan": + return new Color2(new RGBA(0, 139, 139, 1)); + case "darkgoldenrod": + return new Color2(new RGBA(184, 134, 11, 1)); + case "darkgray": + return new Color2(new RGBA(169, 169, 169, 1)); + case "darkgreen": + return new Color2(new RGBA(0, 100, 0, 1)); + case "darkgrey": + return new Color2(new RGBA(169, 169, 169, 1)); + case "darkkhaki": + return new Color2(new RGBA(189, 183, 107, 1)); + case "darkmagenta": + return new Color2(new RGBA(139, 0, 139, 1)); + case "darkolivegreen": + return new Color2(new RGBA(85, 107, 47, 1)); + case "darkorange": + return new Color2(new RGBA(255, 140, 0, 1)); + case "darkorchid": + return new Color2(new RGBA(153, 50, 204, 1)); + case "darkred": + return new Color2(new RGBA(139, 0, 0, 1)); + case "darksalmon": + return new Color2(new RGBA(233, 150, 122, 1)); + case "darkseagreen": + return new Color2(new RGBA(143, 188, 143, 1)); + case "darkslateblue": + return new Color2(new RGBA(72, 61, 139, 1)); + case "darkslategray": + return new Color2(new RGBA(47, 79, 79, 1)); + case "darkslategrey": + return new Color2(new RGBA(47, 79, 79, 1)); + case "darkturquoise": + return new Color2(new RGBA(0, 206, 209, 1)); + case "darkviolet": + return new Color2(new RGBA(148, 0, 211, 1)); + case "deeppink": + return new Color2(new RGBA(255, 20, 147, 1)); + case "deepskyblue": + return new Color2(new RGBA(0, 191, 255, 1)); + case "dimgray": + return new Color2(new RGBA(105, 105, 105, 1)); + case "dimgrey": + return new Color2(new RGBA(105, 105, 105, 1)); + case "dodgerblue": + return new Color2(new RGBA(30, 144, 255, 1)); + case "firebrick": + return new Color2(new RGBA(178, 34, 34, 1)); + case "floralwhite": + return new Color2(new RGBA(255, 250, 240, 1)); + case "forestgreen": + return new Color2(new RGBA(34, 139, 34, 1)); + case "fuchsia": + return new Color2(new RGBA(255, 0, 255, 1)); + case "gainsboro": + return new Color2(new RGBA(220, 220, 220, 1)); + case "ghostwhite": + return new Color2(new RGBA(248, 248, 255, 1)); + case "gold": + return new Color2(new RGBA(255, 215, 0, 1)); + case "goldenrod": + return new Color2(new RGBA(218, 165, 32, 1)); + case "gray": + return new Color2(new RGBA(128, 128, 128, 1)); + case "green": + return new Color2(new RGBA(0, 128, 0, 1)); + case "greenyellow": + return new Color2(new RGBA(173, 255, 47, 1)); + case "grey": + return new Color2(new RGBA(128, 128, 128, 1)); + case "honeydew": + return new Color2(new RGBA(240, 255, 240, 1)); + case "hotpink": + return new Color2(new RGBA(255, 105, 180, 1)); + case "indianred": + return new Color2(new RGBA(205, 92, 92, 1)); + case "indigo": + return new Color2(new RGBA(75, 0, 130, 1)); + case "ivory": + return new Color2(new RGBA(255, 255, 240, 1)); + case "khaki": + return new Color2(new RGBA(240, 230, 140, 1)); + case "lavender": + return new Color2(new RGBA(230, 230, 250, 1)); + case "lavenderblush": + return new Color2(new RGBA(255, 240, 245, 1)); + case "lawngreen": + return new Color2(new RGBA(124, 252, 0, 1)); + case "lemonchiffon": + return new Color2(new RGBA(255, 250, 205, 1)); + case "lightblue": + return new Color2(new RGBA(173, 216, 230, 1)); + case "lightcoral": + return new Color2(new RGBA(240, 128, 128, 1)); + case "lightcyan": + return new Color2(new RGBA(224, 255, 255, 1)); + case "lightgoldenrodyellow": + return new Color2(new RGBA(250, 250, 210, 1)); + case "lightgray": + return new Color2(new RGBA(211, 211, 211, 1)); + case "lightgreen": + return new Color2(new RGBA(144, 238, 144, 1)); + case "lightgrey": + return new Color2(new RGBA(211, 211, 211, 1)); + case "lightpink": + return new Color2(new RGBA(255, 182, 193, 1)); + case "lightsalmon": + return new Color2(new RGBA(255, 160, 122, 1)); + case "lightseagreen": + return new Color2(new RGBA(32, 178, 170, 1)); + case "lightskyblue": + return new Color2(new RGBA(135, 206, 250, 1)); + case "lightslategray": + return new Color2(new RGBA(119, 136, 153, 1)); + case "lightslategrey": + return new Color2(new RGBA(119, 136, 153, 1)); + case "lightsteelblue": + return new Color2(new RGBA(176, 196, 222, 1)); + case "lightyellow": + return new Color2(new RGBA(255, 255, 224, 1)); + case "lime": + return new Color2(new RGBA(0, 255, 0, 1)); + case "limegreen": + return new Color2(new RGBA(50, 205, 50, 1)); + case "linen": + return new Color2(new RGBA(250, 240, 230, 1)); + case "magenta": + return new Color2(new RGBA(255, 0, 255, 1)); + case "maroon": + return new Color2(new RGBA(128, 0, 0, 1)); + case "mediumaquamarine": + return new Color2(new RGBA(102, 205, 170, 1)); + case "mediumblue": + return new Color2(new RGBA(0, 0, 205, 1)); + case "mediumorchid": + return new Color2(new RGBA(186, 85, 211, 1)); + case "mediumpurple": + return new Color2(new RGBA(147, 112, 219, 1)); + case "mediumseagreen": + return new Color2(new RGBA(60, 179, 113, 1)); + case "mediumslateblue": + return new Color2(new RGBA(123, 104, 238, 1)); + case "mediumspringgreen": + return new Color2(new RGBA(0, 250, 154, 1)); + case "mediumturquoise": + return new Color2(new RGBA(72, 209, 204, 1)); + case "mediumvioletred": + return new Color2(new RGBA(199, 21, 133, 1)); + case "midnightblue": + return new Color2(new RGBA(25, 25, 112, 1)); + case "mintcream": + return new Color2(new RGBA(245, 255, 250, 1)); + case "mistyrose": + return new Color2(new RGBA(255, 228, 225, 1)); + case "moccasin": + return new Color2(new RGBA(255, 228, 181, 1)); + case "navajowhite": + return new Color2(new RGBA(255, 222, 173, 1)); + case "navy": + return new Color2(new RGBA(0, 0, 128, 1)); + case "oldlace": + return new Color2(new RGBA(253, 245, 230, 1)); + case "olive": + return new Color2(new RGBA(128, 128, 0, 1)); + case "olivedrab": + return new Color2(new RGBA(107, 142, 35, 1)); + case "orange": + return new Color2(new RGBA(255, 165, 0, 1)); + case "orangered": + return new Color2(new RGBA(255, 69, 0, 1)); + case "orchid": + return new Color2(new RGBA(218, 112, 214, 1)); + case "palegoldenrod": + return new Color2(new RGBA(238, 232, 170, 1)); + case "palegreen": + return new Color2(new RGBA(152, 251, 152, 1)); + case "paleturquoise": + return new Color2(new RGBA(175, 238, 238, 1)); + case "palevioletred": + return new Color2(new RGBA(219, 112, 147, 1)); + case "papayawhip": + return new Color2(new RGBA(255, 239, 213, 1)); + case "peachpuff": + return new Color2(new RGBA(255, 218, 185, 1)); + case "peru": + return new Color2(new RGBA(205, 133, 63, 1)); + case "pink": + return new Color2(new RGBA(255, 192, 203, 1)); + case "plum": + return new Color2(new RGBA(221, 160, 221, 1)); + case "powderblue": + return new Color2(new RGBA(176, 224, 230, 1)); + case "purple": + return new Color2(new RGBA(128, 0, 128, 1)); + case "rebeccapurple": + return new Color2(new RGBA(102, 51, 153, 1)); + case "red": + return new Color2(new RGBA(255, 0, 0, 1)); + case "rosybrown": + return new Color2(new RGBA(188, 143, 143, 1)); + case "royalblue": + return new Color2(new RGBA(65, 105, 225, 1)); + case "saddlebrown": + return new Color2(new RGBA(139, 69, 19, 1)); + case "salmon": + return new Color2(new RGBA(250, 128, 114, 1)); + case "sandybrown": + return new Color2(new RGBA(244, 164, 96, 1)); + case "seagreen": + return new Color2(new RGBA(46, 139, 87, 1)); + case "seashell": + return new Color2(new RGBA(255, 245, 238, 1)); + case "sienna": + return new Color2(new RGBA(160, 82, 45, 1)); + case "silver": + return new Color2(new RGBA(192, 192, 192, 1)); + case "skyblue": + return new Color2(new RGBA(135, 206, 235, 1)); + case "slateblue": + return new Color2(new RGBA(106, 90, 205, 1)); + case "slategray": + return new Color2(new RGBA(112, 128, 144, 1)); + case "slategrey": + return new Color2(new RGBA(112, 128, 144, 1)); + case "snow": + return new Color2(new RGBA(255, 250, 250, 1)); + case "springgreen": + return new Color2(new RGBA(0, 255, 127, 1)); + case "steelblue": + return new Color2(new RGBA(70, 130, 180, 1)); + case "tan": + return new Color2(new RGBA(210, 180, 140, 1)); + case "teal": + return new Color2(new RGBA(0, 128, 128, 1)); + case "thistle": + return new Color2(new RGBA(216, 191, 216, 1)); + case "tomato": + return new Color2(new RGBA(255, 99, 71, 1)); + case "turquoise": + return new Color2(new RGBA(64, 224, 208, 1)); + case "violet": + return new Color2(new RGBA(238, 130, 238, 1)); + case "wheat": + return new Color2(new RGBA(245, 222, 179, 1)); + case "white": + return new Color2(new RGBA(255, 255, 255, 1)); + case "whitesmoke": + return new Color2(new RGBA(245, 245, 245, 1)); + case "yellow": + return new Color2(new RGBA(255, 255, 0, 1)); + case "yellowgreen": + return new Color2(new RGBA(154, 205, 50, 1)); + default: + return null; + } + } + function parseHex(hex) { + const length = hex.length; + if (length === 0) { + return null; + } + if (hex.charCodeAt(0) !== 35) { + return null; + } + if (length === 7) { + const r = 16 * _parseHexDigit(hex.charCodeAt(1)) + _parseHexDigit(hex.charCodeAt(2)); + const g = 16 * _parseHexDigit(hex.charCodeAt(3)) + _parseHexDigit(hex.charCodeAt(4)); + const b = 16 * _parseHexDigit(hex.charCodeAt(5)) + _parseHexDigit(hex.charCodeAt(6)); + return new Color2(new RGBA(r, g, b, 1)); + } + if (length === 9) { + const r = 16 * _parseHexDigit(hex.charCodeAt(1)) + _parseHexDigit(hex.charCodeAt(2)); + const g = 16 * _parseHexDigit(hex.charCodeAt(3)) + _parseHexDigit(hex.charCodeAt(4)); + const b = 16 * _parseHexDigit(hex.charCodeAt(5)) + _parseHexDigit(hex.charCodeAt(6)); + const a = 16 * _parseHexDigit(hex.charCodeAt(7)) + _parseHexDigit(hex.charCodeAt(8)); + return new Color2(new RGBA(r, g, b, a / 255)); + } + if (length === 4) { + const r = _parseHexDigit(hex.charCodeAt(1)); + const g = _parseHexDigit(hex.charCodeAt(2)); + const b = _parseHexDigit(hex.charCodeAt(3)); + return new Color2(new RGBA(16 * r + r, 16 * g + g, 16 * b + b)); + } + if (length === 5) { + const r = _parseHexDigit(hex.charCodeAt(1)); + const g = _parseHexDigit(hex.charCodeAt(2)); + const b = _parseHexDigit(hex.charCodeAt(3)); + const a = _parseHexDigit(hex.charCodeAt(4)); + return new Color2(new RGBA(16 * r + r, 16 * g + g, 16 * b + b, (16 * a + a) / 255)); + } + return null; + } + CSS3.parseHex = parseHex; + function _parseHexDigit(charCode) { + switch (charCode) { + case 48: + return 0; + case 49: + return 1; + case 50: + return 2; + case 51: + return 3; + case 52: + return 4; + case 53: + return 5; + case 54: + return 6; + case 55: + return 7; + case 56: + return 8; + case 57: + return 9; + case 97: + return 10; + case 65: + return 10; + case 98: + return 11; + case 66: + return 11; + case 99: + return 12; + case 67: + return 12; + case 100: + return 13; + case 68: + return 13; + case 101: + return 14; + case 69: + return 14; + case 102: + return 15; + case 70: + return 15; + } + return 0; + } + })(CSS2 = Format2.CSS || (Format2.CSS = {})); + })(Format = Color2.Format || (Color2.Format = {})); + })(Color || (Color = {})); + } +}); + +// node_modules/monaco-editor-core/esm/vs/platform/theme/common/colorUtils.js +function asCssVariableName(colorIdent) { + return `--vscode-${colorIdent.replace(/\./g, "-")}`; +} +function asCssVariable(color) { + return `var(${asCssVariableName(color)})`; +} +function asCssVariableWithDefault(color, defaultCssValue) { + return `var(${asCssVariableName(color)}, ${defaultCssValue})`; +} +function isColorDefaults(value) { + return value !== null && typeof value === "object" && "light" in value && "dark" in value; +} +function registerColor(id, defaults, description, needsTransparency, deprecationMessage) { + return colorRegistry.registerColor(id, defaults, description, needsTransparency, deprecationMessage); +} +function executeTransform(transform, theme) { + switch (transform.op) { + case 0: + return resolveColorValue(transform.value, theme)?.darken(transform.factor); + case 1: + return resolveColorValue(transform.value, theme)?.lighten(transform.factor); + case 2: + return resolveColorValue(transform.value, theme)?.transparent(transform.factor); + case 7: { + const primaryColor = resolveColorValue(transform.color, theme) || Color.transparent; + const otherColor = resolveColorValue(transform.with, theme) || Color.transparent; + return primaryColor.mix(otherColor, transform.ratio); + } + case 3: { + const backgroundColor = resolveColorValue(transform.background, theme); + if (!backgroundColor) { + return resolveColorValue(transform.value, theme); + } + return resolveColorValue(transform.value, theme)?.makeOpaque(backgroundColor); + } + case 4: + for (const candidate of transform.values) { + const color = resolveColorValue(candidate, theme); + if (color) { + return color; + } + } + return void 0; + case 6: + return resolveColorValue(theme.defines(transform.if) ? transform.then : transform.else, theme); + case 5: { + const from = resolveColorValue(transform.value, theme); + if (!from) { + return void 0; + } + const backgroundColor = resolveColorValue(transform.background, theme); + if (!backgroundColor) { + return from.transparent(transform.factor * transform.transparency); + } + return from.isDarkerThan(backgroundColor) ? Color.getLighterColor(from, backgroundColor, transform.factor).transparent(transform.transparency) : Color.getDarkerColor(from, backgroundColor, transform.factor).transparent(transform.transparency); + } + default: + throw assertNever(transform); + } +} +function darken(colorValue, factor2) { + return { op: 0, value: colorValue, factor: factor2 }; +} +function lighten(colorValue, factor2) { + return { op: 1, value: colorValue, factor: factor2 }; +} +function transparent(colorValue, factor2) { + return { op: 2, value: colorValue, factor: factor2 }; +} +function oneOf(...colorValues) { + return { op: 4, values: colorValues }; +} +function ifDefinedThenElse(ifArg, thenArg, elseArg) { + return { op: 6, if: ifArg, then: thenArg, else: elseArg }; +} +function lessProminent(colorValue, backgroundColorValue, factor2, transparency) { + return { op: 5, value: colorValue, background: backgroundColorValue, factor: factor2, transparency }; +} +function resolveColorValue(colorValue, theme) { + if (colorValue === null) { + return void 0; + } else if (typeof colorValue === "string") { + if (colorValue[0] === "#") { + return Color.fromHex(colorValue); + } + return theme.getColor(colorValue); + } else if (colorValue instanceof Color) { + return colorValue; + } else if (typeof colorValue === "object") { + return executeTransform(colorValue, theme); + } + return void 0; +} +var Extensions6, DEFAULT_COLOR_CONFIG_VALUE, ColorRegistry, colorRegistry, workbenchColorsSchemaId, schemaRegistry, delayer; +var init_colorUtils = __esm({ + "node_modules/monaco-editor-core/esm/vs/platform/theme/common/colorUtils.js"() { + init_assert(); + init_async(); + init_color(); + init_event(); + init_jsonContributionRegistry(); + init_platform2(); + init_nls(); + init_lifecycle(); + Extensions6 = { + ColorContribution: "base.contributions.colors" + }; + DEFAULT_COLOR_CONFIG_VALUE = "default"; + ColorRegistry = class extends Disposable { + constructor() { + super(); + this._onDidChangeSchema = this._register(new Emitter()); + this.onDidChangeSchema = this._onDidChangeSchema.event; + this.colorSchema = { type: "object", properties: {} }; + this.colorReferenceSchema = { type: "string", enum: [], enumDescriptions: [] }; + this.colorsById = {}; + } + registerColor(id, defaults, description, needsTransparency = false, deprecationMessage) { + const colorContribution = { id, description, defaults, needsTransparency, deprecationMessage }; + this.colorsById[id] = colorContribution; + const propertySchema = { type: "string", format: "color-hex", defaultSnippets: [{ body: "${1:#ff0000}" }] }; + if (deprecationMessage) { + propertySchema.deprecationMessage = deprecationMessage; + } + if (needsTransparency) { + propertySchema.pattern = "^#(?:(?[0-9a-fA-f]{3}[0-9a-eA-E])|(?:[0-9a-fA-F]{6}(?:(?![fF]{2})(?:[0-9a-fA-F]{2}))))?$"; + propertySchema.patternErrorMessage = localize(2022, "This color must be transparent or it will obscure content"); + } + this.colorSchema.properties[id] = { + description, + oneOf: [ + propertySchema, + { type: "string", const: DEFAULT_COLOR_CONFIG_VALUE, description: localize(2023, "Use the default color.") } + ] + }; + this.colorReferenceSchema.enum.push(id); + this.colorReferenceSchema.enumDescriptions.push(description); + this._onDidChangeSchema.fire(); + return id; + } + getColors() { + return Object.keys(this.colorsById).map((id) => this.colorsById[id]); + } + resolveDefaultColor(id, theme) { + const colorDesc = this.colorsById[id]; + if (colorDesc?.defaults) { + const colorValue = isColorDefaults(colorDesc.defaults) ? colorDesc.defaults[theme.type] : colorDesc.defaults; + return resolveColorValue(colorValue, theme); + } + return void 0; + } + getColorSchema() { + return this.colorSchema; + } + toString() { + const sorter2 = (a, b) => { + const cat1 = a.indexOf(".") === -1 ? 0 : 1; + const cat2 = b.indexOf(".") === -1 ? 0 : 1; + if (cat1 !== cat2) { + return cat1 - cat2; + } + return a.localeCompare(b); + }; + return Object.keys(this.colorsById).sort(sorter2).map((k) => `- \`${k}\`: ${this.colorsById[k].description}`).join("\n"); + } + }; + colorRegistry = new ColorRegistry(); + Registry.add(Extensions6.ColorContribution, colorRegistry); + workbenchColorsSchemaId = "vscode://schemas/workbench-colors"; + schemaRegistry = Registry.as(Extensions3.JSONContribution); + schemaRegistry.registerSchema(workbenchColorsSchemaId, colorRegistry.getColorSchema()); + delayer = new RunOnceScheduler(() => schemaRegistry.notifySchemaChanged(workbenchColorsSchemaId), 200); + colorRegistry.onDidChangeSchema(() => { + if (!delayer.isScheduled()) { + delayer.schedule(); + } + }); + } +}); + +// node_modules/monaco-editor-core/esm/vs/platform/theme/common/colors/baseColors.js +var foreground, disabledForeground, errorForeground, descriptionForeground, iconForeground, focusBorder, contrastBorder, activeContrastBorder, selectionBackground, textLinkForeground, textLinkActiveForeground, textSeparatorForeground, textPreformatForeground, textPreformatBackground, textBlockQuoteBackground, textBlockQuoteBorder, textCodeBlockBackground; +var init_baseColors = __esm({ + "node_modules/monaco-editor-core/esm/vs/platform/theme/common/colors/baseColors.js"() { + init_nls(); + init_color(); + init_colorUtils(); + foreground = registerColor("foreground", { dark: "#CCCCCC", light: "#616161", hcDark: "#FFFFFF", hcLight: "#292929" }, localize(1773, "Overall foreground color. This color is only used if not overridden by a component.")); + disabledForeground = registerColor("disabledForeground", { dark: "#CCCCCC80", light: "#61616180", hcDark: "#A5A5A5", hcLight: "#7F7F7F" }, localize(1774, "Overall foreground for disabled elements. This color is only used if not overridden by a component.")); + errorForeground = registerColor("errorForeground", { dark: "#F48771", light: "#A1260D", hcDark: "#F48771", hcLight: "#B5200D" }, localize(1775, "Overall foreground color for error messages. This color is only used if not overridden by a component.")); + descriptionForeground = registerColor("descriptionForeground", { light: "#717171", dark: transparent(foreground, 0.7), hcDark: transparent(foreground, 0.7), hcLight: transparent(foreground, 0.7) }, localize(1776, "Foreground color for description text providing additional information, for example for a label.")); + iconForeground = registerColor("icon.foreground", { dark: "#C5C5C5", light: "#424242", hcDark: "#FFFFFF", hcLight: "#292929" }, localize(1777, "The default color for icons in the workbench.")); + focusBorder = registerColor("focusBorder", { dark: "#007FD4", light: "#0090F1", hcDark: "#F38518", hcLight: "#006BBD" }, localize(1778, "Overall border color for focused elements. This color is only used if not overridden by a component.")); + contrastBorder = registerColor("contrastBorder", { light: null, dark: null, hcDark: "#6FC3DF", hcLight: "#0F4A85" }, localize(1779, "An extra border around elements to separate them from others for greater contrast.")); + activeContrastBorder = registerColor("contrastActiveBorder", { light: null, dark: null, hcDark: focusBorder, hcLight: focusBorder }, localize(1780, "An extra border around active elements to separate them from others for greater contrast.")); + selectionBackground = registerColor("selection.background", null, localize(1781, "The background color of text selections in the workbench (e.g. for input fields or text areas). Note that this does not apply to selections within the editor.")); + textLinkForeground = registerColor("textLink.foreground", { light: "#006AB1", dark: "#3794FF", hcDark: "#21A6FF", hcLight: "#0F4A85" }, localize(1782, "Foreground color for links in text.")); + textLinkActiveForeground = registerColor("textLink.activeForeground", { light: "#006AB1", dark: "#3794FF", hcDark: "#21A6FF", hcLight: "#0F4A85" }, localize(1783, "Foreground color for links in text when clicked on and on mouse hover.")); + textSeparatorForeground = registerColor("textSeparator.foreground", { light: "#0000002e", dark: "#ffffff2e", hcDark: Color.black, hcLight: "#292929" }, localize(1784, "Color for text separators.")); + textPreformatForeground = registerColor("textPreformat.foreground", { light: "#A31515", dark: "#D7BA7D", hcDark: "#000000", hcLight: "#FFFFFF" }, localize(1785, "Foreground color for preformatted text segments.")); + textPreformatBackground = registerColor("textPreformat.background", { light: "#0000001A", dark: "#FFFFFF1A", hcDark: "#FFFFFF", hcLight: "#09345f" }, localize(1786, "Background color for preformatted text segments.")); + textBlockQuoteBackground = registerColor("textBlockQuote.background", { light: "#f2f2f2", dark: "#222222", hcDark: null, hcLight: "#F2F2F2" }, localize(1787, "Background color for block quotes in text.")); + textBlockQuoteBorder = registerColor("textBlockQuote.border", { light: "#007acc80", dark: "#007acc80", hcDark: Color.white, hcLight: "#292929" }, localize(1788, "Border color for block quotes in text.")); + textCodeBlockBackground = registerColor("textCodeBlock.background", { light: "#dcdcdc66", dark: "#0a0a0a66", hcDark: Color.black, hcLight: "#F2F2F2" }, localize(1789, "Background color for code blocks in text.")); + } +}); + +// node_modules/monaco-editor-core/esm/vs/platform/theme/common/colors/miscColors.js +var sashHoverBorder, badgeBackground, badgeForeground, activityWarningBadgeForeground, activityWarningBadgeBackground, activityErrorBadgeForeground, activityErrorBadgeBackground, scrollbarShadow, scrollbarSliderBackground, scrollbarSliderHoverBackground, scrollbarSliderActiveBackground, scrollbarBackground, progressBarBackground, chartLine, chartAxis, chartGuide; +var init_miscColors = __esm({ + "node_modules/monaco-editor-core/esm/vs/platform/theme/common/colors/miscColors.js"() { + init_nls(); + init_color(); + init_colorUtils(); + init_baseColors(); + sashHoverBorder = registerColor("sash.hoverBorder", focusBorder, localize(1994, "Border color of active sashes.")); + badgeBackground = registerColor("badge.background", { dark: "#4D4D4D", light: "#C4C4C4", hcDark: Color.black, hcLight: "#0F4A85" }, localize(1995, "Badge background color. Badges are small information labels, e.g. for search results count.")); + badgeForeground = registerColor("badge.foreground", { dark: Color.white, light: "#333", hcDark: Color.white, hcLight: Color.white }, localize(1996, "Badge foreground color. Badges are small information labels, e.g. for search results count.")); + activityWarningBadgeForeground = registerColor("activityWarningBadge.foreground", { dark: Color.black.lighten(0.2), light: Color.white, hcDark: null, hcLight: Color.black.lighten(0.2) }, localize(1997, "Foreground color of the warning activity badge")); + activityWarningBadgeBackground = registerColor("activityWarningBadge.background", { dark: "#CCA700", light: "#BF8803", hcDark: null, hcLight: "#CCA700" }, localize(1998, "Background color of the warning activity badge")); + activityErrorBadgeForeground = registerColor("activityErrorBadge.foreground", { dark: Color.black.lighten(0.2), light: Color.white, hcDark: null, hcLight: Color.black.lighten(0.2) }, localize(1999, "Foreground color of the error activity badge")); + activityErrorBadgeBackground = registerColor("activityErrorBadge.background", { dark: "#F14C4C", light: "#E51400", hcDark: null, hcLight: "#F14C4C" }, localize(2e3, "Background color of the error activity badge")); + scrollbarShadow = registerColor("scrollbar.shadow", { dark: "#000000", light: "#DDDDDD", hcDark: null, hcLight: null }, localize(2001, "Scrollbar shadow to indicate that the view is scrolled.")); + scrollbarSliderBackground = registerColor("scrollbarSlider.background", { dark: Color.fromHex("#797979").transparent(0.4), light: Color.fromHex("#646464").transparent(0.4), hcDark: transparent(contrastBorder, 0.6), hcLight: transparent(contrastBorder, 0.4) }, localize(2002, "Scrollbar slider background color.")); + scrollbarSliderHoverBackground = registerColor("scrollbarSlider.hoverBackground", { dark: Color.fromHex("#646464").transparent(0.7), light: Color.fromHex("#646464").transparent(0.7), hcDark: transparent(contrastBorder, 0.8), hcLight: transparent(contrastBorder, 0.8) }, localize(2003, "Scrollbar slider background color when hovering.")); + scrollbarSliderActiveBackground = registerColor("scrollbarSlider.activeBackground", { dark: Color.fromHex("#BFBFBF").transparent(0.4), light: Color.fromHex("#000000").transparent(0.6), hcDark: contrastBorder, hcLight: contrastBorder }, localize(2004, "Scrollbar slider background color when clicked on.")); + scrollbarBackground = registerColor("scrollbar.background", null, localize(2005, "Scrollbar track background color.")); + progressBarBackground = registerColor("progressBar.background", { dark: Color.fromHex("#0E70C0"), light: Color.fromHex("#0E70C0"), hcDark: contrastBorder, hcLight: contrastBorder }, localize(2006, "Background color of the progress bar that can show for long running operations.")); + chartLine = registerColor("chart.line", { dark: "#236B8E", light: "#236B8E", hcDark: "#236B8E", hcLight: "#236B8E" }, localize(2007, "Line color for the chart.")); + chartAxis = registerColor("chart.axis", { dark: Color.fromHex("#BFBFBF").transparent(0.4), light: Color.fromHex("#000000").transparent(0.6), hcDark: contrastBorder, hcLight: contrastBorder }, localize(2008, "Axis color for the chart.")); + chartGuide = registerColor("chart.guide", { dark: Color.fromHex("#BFBFBF").transparent(0.2), light: Color.fromHex("#000000").transparent(0.2), hcDark: contrastBorder, hcLight: contrastBorder }, localize(2009, "Guide line for the chart.")); + } +}); + +// node_modules/monaco-editor-core/esm/vs/platform/theme/common/colors/editorColors.js +var editorBackground, editorForeground, editorStickyScrollBackground, editorStickyScrollGutterBackground, editorStickyScrollHoverBackground, editorStickyScrollBorder, editorStickyScrollShadow, editorWidgetBackground, editorWidgetForeground, editorWidgetBorder, editorWidgetResizeBorder, editorErrorBackground, editorErrorForeground, editorErrorBorder, editorWarningBackground, editorWarningForeground, editorWarningBorder, editorInfoBackground, editorInfoForeground, editorInfoBorder, editorHintForeground, editorHintBorder, editorActiveLinkForeground, editorSelectionBackground, editorSelectionForeground, editorInactiveSelection, editorSelectionHighlight, editorSelectionHighlightBorder, editorCompositionBorder, editorFindMatch, editorFindMatchForeground, editorFindMatchHighlight, editorFindMatchHighlightForeground, editorFindRangeHighlight, editorFindMatchBorder, editorFindMatchHighlightBorder, editorFindRangeHighlightBorder, editorHoverHighlight, editorHoverBackground, editorHoverForeground, editorHoverBorder, editorHoverStatusBarBackground, editorInlayHintForeground, editorInlayHintBackground, editorInlayHintTypeForeground, editorInlayHintTypeBackground, editorInlayHintParameterForeground, editorInlayHintParameterBackground, editorLightBulbForeground, editorLightBulbAutoFixForeground, editorLightBulbAiForeground, snippetTabstopHighlightBackground, snippetTabstopHighlightBorder, snippetFinalTabstopHighlightBackground, snippetFinalTabstopHighlightBorder, defaultInsertColor, defaultRemoveColor, diffInserted, diffRemoved, diffInsertedLine, diffRemovedLine, diffInsertedLineGutter, diffRemovedLineGutter, diffOverviewRulerInserted, diffOverviewRulerRemoved, diffInsertedOutline, diffRemovedOutline, diffBorder, diffDiagonalFill, diffUnchangedRegionBackground, diffUnchangedRegionForeground, diffUnchangedTextBackground, widgetShadow, widgetBorder, toolbarHoverBackground, toolbarHoverOutline, toolbarActiveBackground, breadcrumbsForeground, breadcrumbsBackground, breadcrumbsFocusForeground, breadcrumbsActiveSelectionForeground, breadcrumbsPickerBackground, headerTransparency, currentBaseColor, incomingBaseColor, commonBaseColor, contentTransparency, rulerTransparency, mergeCurrentHeaderBackground, mergeCurrentContentBackground, mergeIncomingHeaderBackground, mergeIncomingContentBackground, mergeCommonHeaderBackground, mergeCommonContentBackground, mergeBorder, overviewRulerCurrentContentForeground, overviewRulerIncomingContentForeground, overviewRulerCommonContentForeground, overviewRulerFindMatchForeground, overviewRulerSelectionHighlightForeground, problemsErrorIconForeground, problemsWarningIconForeground, problemsInfoIconForeground; +var init_editorColors = __esm({ + "node_modules/monaco-editor-core/esm/vs/platform/theme/common/colors/editorColors.js"() { + init_nls(); + init_color(); + init_colorUtils(); + init_baseColors(); + init_miscColors(); + editorBackground = registerColor("editor.background", { light: "#ffffff", dark: "#1E1E1E", hcDark: Color.black, hcLight: Color.white }, localize(1798, "Editor background color.")); + editorForeground = registerColor("editor.foreground", { light: "#333333", dark: "#BBBBBB", hcDark: Color.white, hcLight: foreground }, localize(1799, "Editor default foreground color.")); + editorStickyScrollBackground = registerColor("editorStickyScroll.background", editorBackground, localize(1800, "Background color of sticky scroll in the editor")); + editorStickyScrollGutterBackground = registerColor("editorStickyScrollGutter.background", editorBackground, localize(1801, "Background color of the gutter part of sticky scroll in the editor")); + editorStickyScrollHoverBackground = registerColor("editorStickyScrollHover.background", { dark: "#2A2D2E", light: "#F0F0F0", hcDark: null, hcLight: Color.fromHex("#0F4A85").transparent(0.1) }, localize(1802, "Background color of sticky scroll on hover in the editor")); + editorStickyScrollBorder = registerColor("editorStickyScroll.border", { dark: null, light: null, hcDark: contrastBorder, hcLight: contrastBorder }, localize(1803, "Border color of sticky scroll in the editor")); + editorStickyScrollShadow = registerColor("editorStickyScroll.shadow", scrollbarShadow, localize(1804, " Shadow color of sticky scroll in the editor")); + editorWidgetBackground = registerColor("editorWidget.background", { dark: "#252526", light: "#F3F3F3", hcDark: "#0C141F", hcLight: Color.white }, localize(1805, "Background color of editor widgets, such as find/replace.")); + editorWidgetForeground = registerColor("editorWidget.foreground", foreground, localize(1806, "Foreground color of editor widgets, such as find/replace.")); + editorWidgetBorder = registerColor("editorWidget.border", { dark: "#454545", light: "#C8C8C8", hcDark: contrastBorder, hcLight: contrastBorder }, localize(1807, "Border color of editor widgets. The color is only used if the widget chooses to have a border and if the color is not overridden by a widget.")); + editorWidgetResizeBorder = registerColor("editorWidget.resizeBorder", null, localize(1808, "Border color of the resize bar of editor widgets. The color is only used if the widget chooses to have a resize border and if the color is not overridden by a widget.")); + editorErrorBackground = registerColor("editorError.background", null, localize(1809, "Background color of error text in the editor. The color must not be opaque so as not to hide underlying decorations."), true); + editorErrorForeground = registerColor("editorError.foreground", { dark: "#F14C4C", light: "#E51400", hcDark: "#F48771", hcLight: "#B5200D" }, localize(1810, "Foreground color of error squigglies in the editor.")); + editorErrorBorder = registerColor("editorError.border", { dark: null, light: null, hcDark: Color.fromHex("#E47777").transparent(0.8), hcLight: "#B5200D" }, localize(1811, "If set, color of double underlines for errors in the editor.")); + editorWarningBackground = registerColor("editorWarning.background", null, localize(1812, "Background color of warning text in the editor. The color must not be opaque so as not to hide underlying decorations."), true); + editorWarningForeground = registerColor("editorWarning.foreground", { dark: "#CCA700", light: "#BF8803", hcDark: "#FFD370", hcLight: "#895503" }, localize(1813, "Foreground color of warning squigglies in the editor.")); + editorWarningBorder = registerColor("editorWarning.border", { dark: null, light: null, hcDark: Color.fromHex("#FFCC00").transparent(0.8), hcLight: Color.fromHex("#FFCC00").transparent(0.8) }, localize(1814, "If set, color of double underlines for warnings in the editor.")); + editorInfoBackground = registerColor("editorInfo.background", null, localize(1815, "Background color of info text in the editor. The color must not be opaque so as not to hide underlying decorations."), true); + editorInfoForeground = registerColor("editorInfo.foreground", { dark: "#3794FF", light: "#1a85ff", hcDark: "#3794FF", hcLight: "#1a85ff" }, localize(1816, "Foreground color of info squigglies in the editor.")); + editorInfoBorder = registerColor("editorInfo.border", { dark: null, light: null, hcDark: Color.fromHex("#3794FF").transparent(0.8), hcLight: "#292929" }, localize(1817, "If set, color of double underlines for infos in the editor.")); + editorHintForeground = registerColor("editorHint.foreground", { dark: Color.fromHex("#eeeeee").transparent(0.7), light: "#6c6c6c", hcDark: null, hcLight: null }, localize(1818, "Foreground color of hint squigglies in the editor.")); + editorHintBorder = registerColor("editorHint.border", { dark: null, light: null, hcDark: Color.fromHex("#eeeeee").transparent(0.8), hcLight: "#292929" }, localize(1819, "If set, color of double underlines for hints in the editor.")); + editorActiveLinkForeground = registerColor("editorLink.activeForeground", { dark: "#4E94CE", light: Color.blue, hcDark: Color.cyan, hcLight: "#292929" }, localize(1820, "Color of active links.")); + editorSelectionBackground = registerColor("editor.selectionBackground", { light: "#ADD6FF", dark: "#264F78", hcDark: "#f3f518", hcLight: "#0F4A85" }, localize(1821, "Color of the editor selection.")); + editorSelectionForeground = registerColor("editor.selectionForeground", { light: null, dark: null, hcDark: "#000000", hcLight: Color.white }, localize(1822, "Color of the selected text for high contrast.")); + editorInactiveSelection = registerColor("editor.inactiveSelectionBackground", { light: transparent(editorSelectionBackground, 0.5), dark: transparent(editorSelectionBackground, 0.5), hcDark: transparent(editorSelectionBackground, 0.7), hcLight: transparent(editorSelectionBackground, 0.5) }, localize(1823, "Color of the selection in an inactive editor. The color must not be opaque so as not to hide underlying decorations."), true); + editorSelectionHighlight = registerColor("editor.selectionHighlightBackground", { light: lessProminent(editorSelectionBackground, editorBackground, 0.3, 0.6), dark: lessProminent(editorSelectionBackground, editorBackground, 0.3, 0.6), hcDark: null, hcLight: null }, localize(1824, "Color for regions with the same content as the selection. The color must not be opaque so as not to hide underlying decorations."), true); + editorSelectionHighlightBorder = registerColor("editor.selectionHighlightBorder", { light: null, dark: null, hcDark: activeContrastBorder, hcLight: activeContrastBorder }, localize(1825, "Border color for regions with the same content as the selection.")); + editorCompositionBorder = registerColor("editor.compositionBorder", { light: "#000000", dark: "#ffffff", hcLight: "#000000", hcDark: "#ffffff" }, localize(1826, "The border color for an IME composition.")); + editorFindMatch = registerColor("editor.findMatchBackground", { light: "#A8AC94", dark: "#515C6A", hcDark: null, hcLight: null }, localize(1827, "Color of the current search match.")); + editorFindMatchForeground = registerColor("editor.findMatchForeground", null, localize(1828, "Text color of the current search match.")); + editorFindMatchHighlight = registerColor("editor.findMatchHighlightBackground", { light: "#EA5C0055", dark: "#EA5C0055", hcDark: null, hcLight: null }, localize(1829, "Color of the other search matches. The color must not be opaque so as not to hide underlying decorations."), true); + editorFindMatchHighlightForeground = registerColor("editor.findMatchHighlightForeground", null, localize(1830, "Foreground color of the other search matches."), true); + editorFindRangeHighlight = registerColor("editor.findRangeHighlightBackground", { dark: "#3a3d4166", light: "#b4b4b44d", hcDark: null, hcLight: null }, localize(1831, "Color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."), true); + editorFindMatchBorder = registerColor("editor.findMatchBorder", { light: null, dark: null, hcDark: activeContrastBorder, hcLight: activeContrastBorder }, localize(1832, "Border color of the current search match.")); + editorFindMatchHighlightBorder = registerColor("editor.findMatchHighlightBorder", { light: null, dark: null, hcDark: activeContrastBorder, hcLight: activeContrastBorder }, localize(1833, "Border color of the other search matches.")); + editorFindRangeHighlightBorder = registerColor("editor.findRangeHighlightBorder", { dark: null, light: null, hcDark: transparent(activeContrastBorder, 0.4), hcLight: transparent(activeContrastBorder, 0.4) }, localize(1834, "Border color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."), true); + editorHoverHighlight = registerColor("editor.hoverHighlightBackground", { light: "#ADD6FF26", dark: "#264f7840", hcDark: "#ADD6FF26", hcLight: null }, localize(1835, "Highlight below the word for which a hover is shown. The color must not be opaque so as not to hide underlying decorations."), true); + editorHoverBackground = registerColor("editorHoverWidget.background", editorWidgetBackground, localize(1836, "Background color of the editor hover.")); + editorHoverForeground = registerColor("editorHoverWidget.foreground", editorWidgetForeground, localize(1837, "Foreground color of the editor hover.")); + editorHoverBorder = registerColor("editorHoverWidget.border", editorWidgetBorder, localize(1838, "Border color of the editor hover.")); + editorHoverStatusBarBackground = registerColor("editorHoverWidget.statusBarBackground", { dark: lighten(editorHoverBackground, 0.2), light: darken(editorHoverBackground, 0.05), hcDark: editorWidgetBackground, hcLight: editorWidgetBackground }, localize(1839, "Background color of the editor hover status bar.")); + editorInlayHintForeground = registerColor("editorInlayHint.foreground", { dark: "#969696", light: "#969696", hcDark: Color.white, hcLight: Color.black }, localize(1840, "Foreground color of inline hints")); + editorInlayHintBackground = registerColor("editorInlayHint.background", { dark: transparent(badgeBackground, 0.1), light: transparent(badgeBackground, 0.1), hcDark: transparent(Color.white, 0.1), hcLight: transparent(badgeBackground, 0.1) }, localize(1841, "Background color of inline hints")); + editorInlayHintTypeForeground = registerColor("editorInlayHint.typeForeground", editorInlayHintForeground, localize(1842, "Foreground color of inline hints for types")); + editorInlayHintTypeBackground = registerColor("editorInlayHint.typeBackground", editorInlayHintBackground, localize(1843, "Background color of inline hints for types")); + editorInlayHintParameterForeground = registerColor("editorInlayHint.parameterForeground", editorInlayHintForeground, localize(1844, "Foreground color of inline hints for parameters")); + editorInlayHintParameterBackground = registerColor("editorInlayHint.parameterBackground", editorInlayHintBackground, localize(1845, "Background color of inline hints for parameters")); + editorLightBulbForeground = registerColor("editorLightBulb.foreground", { dark: "#FFCC00", light: "#DDB100", hcDark: "#FFCC00", hcLight: "#007ACC" }, localize(1846, "The color used for the lightbulb actions icon.")); + editorLightBulbAutoFixForeground = registerColor("editorLightBulbAutoFix.foreground", { dark: "#75BEFF", light: "#007ACC", hcDark: "#75BEFF", hcLight: "#007ACC" }, localize(1847, "The color used for the lightbulb auto fix actions icon.")); + editorLightBulbAiForeground = registerColor("editorLightBulbAi.foreground", editorLightBulbForeground, localize(1848, "The color used for the lightbulb AI icon.")); + snippetTabstopHighlightBackground = registerColor("editor.snippetTabstopHighlightBackground", { dark: new Color(new RGBA(124, 124, 124, 0.3)), light: new Color(new RGBA(10, 50, 100, 0.2)), hcDark: new Color(new RGBA(124, 124, 124, 0.3)), hcLight: new Color(new RGBA(10, 50, 100, 0.2)) }, localize(1849, "Highlight background color of a snippet tabstop.")); + snippetTabstopHighlightBorder = registerColor("editor.snippetTabstopHighlightBorder", null, localize(1850, "Highlight border color of a snippet tabstop.")); + snippetFinalTabstopHighlightBackground = registerColor("editor.snippetFinalTabstopHighlightBackground", null, localize(1851, "Highlight background color of the final tabstop of a snippet.")); + snippetFinalTabstopHighlightBorder = registerColor("editor.snippetFinalTabstopHighlightBorder", { dark: "#525252", light: new Color(new RGBA(10, 50, 100, 0.5)), hcDark: "#525252", hcLight: "#292929" }, localize(1852, "Highlight border color of the final tabstop of a snippet.")); + defaultInsertColor = new Color(new RGBA(155, 185, 85, 0.2)); + defaultRemoveColor = new Color(new RGBA(255, 0, 0, 0.2)); + diffInserted = registerColor("diffEditor.insertedTextBackground", { dark: "#9ccc2c33", light: "#9ccc2c40", hcDark: null, hcLight: null }, localize(1853, "Background color for text that got inserted. The color must not be opaque so as not to hide underlying decorations."), true); + diffRemoved = registerColor("diffEditor.removedTextBackground", { dark: "#ff000033", light: "#ff000033", hcDark: null, hcLight: null }, localize(1854, "Background color for text that got removed. The color must not be opaque so as not to hide underlying decorations."), true); + diffInsertedLine = registerColor("diffEditor.insertedLineBackground", { dark: defaultInsertColor, light: defaultInsertColor, hcDark: null, hcLight: null }, localize(1855, "Background color for lines that got inserted. The color must not be opaque so as not to hide underlying decorations."), true); + diffRemovedLine = registerColor("diffEditor.removedLineBackground", { dark: defaultRemoveColor, light: defaultRemoveColor, hcDark: null, hcLight: null }, localize(1856, "Background color for lines that got removed. The color must not be opaque so as not to hide underlying decorations."), true); + diffInsertedLineGutter = registerColor("diffEditorGutter.insertedLineBackground", null, localize(1857, "Background color for the margin where lines got inserted.")); + diffRemovedLineGutter = registerColor("diffEditorGutter.removedLineBackground", null, localize(1858, "Background color for the margin where lines got removed.")); + diffOverviewRulerInserted = registerColor("diffEditorOverview.insertedForeground", null, localize(1859, "Diff overview ruler foreground for inserted content.")); + diffOverviewRulerRemoved = registerColor("diffEditorOverview.removedForeground", null, localize(1860, "Diff overview ruler foreground for removed content.")); + diffInsertedOutline = registerColor("diffEditor.insertedTextBorder", { dark: null, light: null, hcDark: "#33ff2eff", hcLight: "#374E06" }, localize(1861, "Outline color for the text that got inserted.")); + diffRemovedOutline = registerColor("diffEditor.removedTextBorder", { dark: null, light: null, hcDark: "#FF008F", hcLight: "#AD0707" }, localize(1862, "Outline color for text that got removed.")); + diffBorder = registerColor("diffEditor.border", { dark: null, light: null, hcDark: contrastBorder, hcLight: contrastBorder }, localize(1863, "Border color between the two text editors.")); + diffDiagonalFill = registerColor("diffEditor.diagonalFill", { dark: "#cccccc33", light: "#22222233", hcDark: null, hcLight: null }, localize(1864, "Color of the diff editor's diagonal fill. The diagonal fill is used in side-by-side diff views.")); + diffUnchangedRegionBackground = registerColor("diffEditor.unchangedRegionBackground", "sideBar.background", localize(1865, "The background color of unchanged blocks in the diff editor.")); + diffUnchangedRegionForeground = registerColor("diffEditor.unchangedRegionForeground", "foreground", localize(1866, "The foreground color of unchanged blocks in the diff editor.")); + diffUnchangedTextBackground = registerColor("diffEditor.unchangedCodeBackground", { dark: "#74747429", light: "#b8b8b829", hcDark: null, hcLight: null }, localize(1867, "The background color of unchanged code in the diff editor.")); + widgetShadow = registerColor("widget.shadow", { dark: transparent(Color.black, 0.36), light: transparent(Color.black, 0.16), hcDark: null, hcLight: null }, localize(1868, "Shadow color of widgets such as find/replace inside the editor.")); + widgetBorder = registerColor("widget.border", { dark: null, light: null, hcDark: contrastBorder, hcLight: contrastBorder }, localize(1869, "Border color of widgets such as find/replace inside the editor.")); + toolbarHoverBackground = registerColor("toolbar.hoverBackground", { dark: "#5a5d5e50", light: "#b8b8b850", hcDark: null, hcLight: null }, localize(1870, "Toolbar background when hovering over actions using the mouse")); + toolbarHoverOutline = registerColor("toolbar.hoverOutline", { dark: null, light: null, hcDark: activeContrastBorder, hcLight: activeContrastBorder }, localize(1871, "Toolbar outline when hovering over actions using the mouse")); + toolbarActiveBackground = registerColor("toolbar.activeBackground", { dark: lighten(toolbarHoverBackground, 0.1), light: darken(toolbarHoverBackground, 0.1), hcDark: null, hcLight: null }, localize(1872, "Toolbar background when holding the mouse over actions")); + breadcrumbsForeground = registerColor("breadcrumb.foreground", transparent(foreground, 0.8), localize(1873, "Color of focused breadcrumb items.")); + breadcrumbsBackground = registerColor("breadcrumb.background", editorBackground, localize(1874, "Background color of breadcrumb items.")); + breadcrumbsFocusForeground = registerColor("breadcrumb.focusForeground", { light: darken(foreground, 0.2), dark: lighten(foreground, 0.1), hcDark: lighten(foreground, 0.1), hcLight: lighten(foreground, 0.1) }, localize(1875, "Color of focused breadcrumb items.")); + breadcrumbsActiveSelectionForeground = registerColor("breadcrumb.activeSelectionForeground", { light: darken(foreground, 0.2), dark: lighten(foreground, 0.1), hcDark: lighten(foreground, 0.1), hcLight: lighten(foreground, 0.1) }, localize(1876, "Color of selected breadcrumb items.")); + breadcrumbsPickerBackground = registerColor("breadcrumbPicker.background", editorWidgetBackground, localize(1877, "Background color of breadcrumb item picker.")); + headerTransparency = 0.5; + currentBaseColor = Color.fromHex("#40C8AE").transparent(headerTransparency); + incomingBaseColor = Color.fromHex("#40A6FF").transparent(headerTransparency); + commonBaseColor = Color.fromHex("#606060").transparent(0.4); + contentTransparency = 0.4; + rulerTransparency = 1; + mergeCurrentHeaderBackground = registerColor("merge.currentHeaderBackground", { dark: currentBaseColor, light: currentBaseColor, hcDark: null, hcLight: null }, localize(1878, "Current header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."), true); + mergeCurrentContentBackground = registerColor("merge.currentContentBackground", transparent(mergeCurrentHeaderBackground, contentTransparency), localize(1879, "Current content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."), true); + mergeIncomingHeaderBackground = registerColor("merge.incomingHeaderBackground", { dark: incomingBaseColor, light: incomingBaseColor, hcDark: null, hcLight: null }, localize(1880, "Incoming header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."), true); + mergeIncomingContentBackground = registerColor("merge.incomingContentBackground", transparent(mergeIncomingHeaderBackground, contentTransparency), localize(1881, "Incoming content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."), true); + mergeCommonHeaderBackground = registerColor("merge.commonHeaderBackground", { dark: commonBaseColor, light: commonBaseColor, hcDark: null, hcLight: null }, localize(1882, "Common ancestor header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."), true); + mergeCommonContentBackground = registerColor("merge.commonContentBackground", transparent(mergeCommonHeaderBackground, contentTransparency), localize(1883, "Common ancestor content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."), true); + mergeBorder = registerColor("merge.border", { dark: null, light: null, hcDark: "#C3DF6F", hcLight: "#007ACC" }, localize(1884, "Border color on headers and the splitter in inline merge-conflicts.")); + overviewRulerCurrentContentForeground = registerColor("editorOverviewRuler.currentContentForeground", { dark: transparent(mergeCurrentHeaderBackground, rulerTransparency), light: transparent(mergeCurrentHeaderBackground, rulerTransparency), hcDark: mergeBorder, hcLight: mergeBorder }, localize(1885, "Current overview ruler foreground for inline merge-conflicts.")); + overviewRulerIncomingContentForeground = registerColor("editorOverviewRuler.incomingContentForeground", { dark: transparent(mergeIncomingHeaderBackground, rulerTransparency), light: transparent(mergeIncomingHeaderBackground, rulerTransparency), hcDark: mergeBorder, hcLight: mergeBorder }, localize(1886, "Incoming overview ruler foreground for inline merge-conflicts.")); + overviewRulerCommonContentForeground = registerColor("editorOverviewRuler.commonContentForeground", { dark: transparent(mergeCommonHeaderBackground, rulerTransparency), light: transparent(mergeCommonHeaderBackground, rulerTransparency), hcDark: mergeBorder, hcLight: mergeBorder }, localize(1887, "Common ancestor overview ruler foreground for inline merge-conflicts.")); + overviewRulerFindMatchForeground = registerColor("editorOverviewRuler.findMatchForeground", { dark: "#d186167e", light: "#d186167e", hcDark: "#AB5A00", hcLight: "#AB5A00" }, localize(1888, "Overview ruler marker color for find matches. The color must not be opaque so as not to hide underlying decorations."), true); + overviewRulerSelectionHighlightForeground = registerColor("editorOverviewRuler.selectionHighlightForeground", "#A0A0A0CC", localize(1889, "Overview ruler marker color for selection highlights. The color must not be opaque so as not to hide underlying decorations."), true); + problemsErrorIconForeground = registerColor("problemsErrorIcon.foreground", editorErrorForeground, localize(1890, "The color used for the problems error icon.")); + problemsWarningIconForeground = registerColor("problemsWarningIcon.foreground", editorWarningForeground, localize(1891, "The color used for the problems warning icon.")); + problemsInfoIconForeground = registerColor("problemsInfoIcon.foreground", editorInfoForeground, localize(1892, "The color used for the problems info icon.")); + } +}); + +// node_modules/monaco-editor-core/esm/vs/platform/theme/common/colors/minimapColors.js +var minimapFindMatch, minimapSelectionOccurrenceHighlight, minimapSelection, minimapInfo, minimapWarning, minimapError, minimapBackground, minimapForegroundOpacity, minimapSliderBackground, minimapSliderHoverBackground, minimapSliderActiveBackground; +var init_minimapColors = __esm({ + "node_modules/monaco-editor-core/esm/vs/platform/theme/common/colors/minimapColors.js"() { + init_nls(); + init_color(); + init_colorUtils(); + init_editorColors(); + init_miscColors(); + minimapFindMatch = registerColor("minimap.findMatchHighlight", { light: "#d18616", dark: "#d18616", hcDark: "#AB5A00", hcLight: "#0F4A85" }, localize(1983, "Minimap marker color for find matches."), true); + minimapSelectionOccurrenceHighlight = registerColor("minimap.selectionOccurrenceHighlight", { light: "#c9c9c9", dark: "#676767", hcDark: "#ffffff", hcLight: "#0F4A85" }, localize(1984, "Minimap marker color for repeating editor selections."), true); + minimapSelection = registerColor("minimap.selectionHighlight", { light: "#ADD6FF", dark: "#264F78", hcDark: "#ffffff", hcLight: "#0F4A85" }, localize(1985, "Minimap marker color for the editor selection."), true); + minimapInfo = registerColor("minimap.infoHighlight", { dark: editorInfoForeground, light: editorInfoForeground, hcDark: editorInfoBorder, hcLight: editorInfoBorder }, localize(1986, "Minimap marker color for infos.")); + minimapWarning = registerColor("minimap.warningHighlight", { dark: editorWarningForeground, light: editorWarningForeground, hcDark: editorWarningBorder, hcLight: editorWarningBorder }, localize(1987, "Minimap marker color for warnings.")); + minimapError = registerColor("minimap.errorHighlight", { dark: new Color(new RGBA(255, 18, 18, 0.7)), light: new Color(new RGBA(255, 18, 18, 0.7)), hcDark: new Color(new RGBA(255, 50, 50, 1)), hcLight: "#B5200D" }, localize(1988, "Minimap marker color for errors.")); + minimapBackground = registerColor("minimap.background", null, localize(1989, "Minimap background color.")); + minimapForegroundOpacity = registerColor("minimap.foregroundOpacity", Color.fromHex("#000f"), localize(1990, 'Opacity of foreground elements rendered in the minimap. For example, "#000000c0" will render the elements with 75% opacity.')); + minimapSliderBackground = registerColor("minimapSlider.background", transparent(scrollbarSliderBackground, 0.5), localize(1991, "Minimap slider background color.")); + minimapSliderHoverBackground = registerColor("minimapSlider.hoverBackground", transparent(scrollbarSliderHoverBackground, 0.5), localize(1992, "Minimap slider background color when hovering.")); + minimapSliderActiveBackground = registerColor("minimapSlider.activeBackground", transparent(scrollbarSliderActiveBackground, 0.5), localize(1993, "Minimap slider background color when clicked on.")); + } +}); + +// node_modules/monaco-editor-core/esm/vs/platform/theme/common/colors/chartsColors.js +var chartsForeground, chartsLines, chartsRed, chartsBlue, chartsYellow, chartsOrange, chartsGreen, chartsPurple; +var init_chartsColors = __esm({ + "node_modules/monaco-editor-core/esm/vs/platform/theme/common/colors/chartsColors.js"() { + init_nls(); + init_colorUtils(); + init_baseColors(); + init_editorColors(); + init_minimapColors(); + chartsForeground = registerColor("charts.foreground", foreground, localize(1790, "The foreground color used in charts.")); + chartsLines = registerColor("charts.lines", transparent(foreground, 0.5), localize(1791, "The color used for horizontal lines in charts.")); + chartsRed = registerColor("charts.red", editorErrorForeground, localize(1792, "The red color used in chart visualizations.")); + chartsBlue = registerColor("charts.blue", editorInfoForeground, localize(1793, "The blue color used in chart visualizations.")); + chartsYellow = registerColor("charts.yellow", editorWarningForeground, localize(1794, "The yellow color used in chart visualizations.")); + chartsOrange = registerColor("charts.orange", minimapFindMatch, localize(1795, "The orange color used in chart visualizations.")); + chartsGreen = registerColor("charts.green", { dark: "#89D185", light: "#388A34", hcDark: "#89D185", hcLight: "#374e06" }, localize(1796, "The green color used in chart visualizations.")); + chartsPurple = registerColor("charts.purple", { dark: "#B180D7", light: "#652D90", hcDark: "#B180D7", hcLight: "#652D90" }, localize(1797, "The purple color used in chart visualizations.")); + } +}); + +// node_modules/monaco-editor-core/esm/vs/platform/theme/common/colors/inputColors.js +var inputBackground, inputForeground, inputBorder, inputActiveOptionBorder, inputActiveOptionHoverBackground, inputActiveOptionBackground, inputActiveOptionForeground, inputPlaceholderForeground, inputValidationInfoBackground, inputValidationInfoForeground, inputValidationInfoBorder, inputValidationWarningBackground, inputValidationWarningForeground, inputValidationWarningBorder, inputValidationErrorBackground, inputValidationErrorForeground, inputValidationErrorBorder, selectBackground, selectListBackground, selectForeground, selectBorder, buttonForeground, buttonSeparator, buttonBackground, buttonHoverBackground, buttonBorder, buttonSecondaryForeground, buttonSecondaryBackground, buttonSecondaryHoverBackground, radioActiveForeground, radioActiveBackground, radioActiveBorder, radioInactiveForeground, radioInactiveBackground, radioInactiveBorder, radioInactiveHoverBackground, checkboxBackground, checkboxSelectBackground, checkboxForeground, checkboxBorder, checkboxSelectBorder, checkboxDisabledBackground, checkboxDisabledForeground, keybindingLabelBackground, keybindingLabelForeground, keybindingLabelBorder, keybindingLabelBottomBorder; +var init_inputColors = __esm({ + "node_modules/monaco-editor-core/esm/vs/platform/theme/common/colors/inputColors.js"() { + init_nls(); + init_color(); + init_colorUtils(); + init_baseColors(); + init_editorColors(); + inputBackground = registerColor("input.background", { dark: "#3C3C3C", light: Color.white, hcDark: Color.black, hcLight: Color.white }, localize(1893, "Input box background.")); + inputForeground = registerColor("input.foreground", foreground, localize(1894, "Input box foreground.")); + inputBorder = registerColor("input.border", { dark: null, light: null, hcDark: contrastBorder, hcLight: contrastBorder }, localize(1895, "Input box border.")); + inputActiveOptionBorder = registerColor("inputOption.activeBorder", { dark: "#007ACC", light: "#007ACC", hcDark: contrastBorder, hcLight: contrastBorder }, localize(1896, "Border color of activated options in input fields.")); + inputActiveOptionHoverBackground = registerColor("inputOption.hoverBackground", { dark: "#5a5d5e80", light: "#b8b8b850", hcDark: null, hcLight: null }, localize(1897, "Background color of activated options in input fields.")); + inputActiveOptionBackground = registerColor("inputOption.activeBackground", { dark: transparent(focusBorder, 0.4), light: transparent(focusBorder, 0.2), hcDark: Color.transparent, hcLight: Color.transparent }, localize(1898, "Background hover color of options in input fields.")); + inputActiveOptionForeground = registerColor("inputOption.activeForeground", { dark: Color.white, light: Color.black, hcDark: foreground, hcLight: foreground }, localize(1899, "Foreground color of activated options in input fields.")); + inputPlaceholderForeground = registerColor("input.placeholderForeground", { light: transparent(foreground, 0.5), dark: transparent(foreground, 0.5), hcDark: transparent(foreground, 0.7), hcLight: transparent(foreground, 0.7) }, localize(1900, "Input box foreground color for placeholder text.")); + inputValidationInfoBackground = registerColor("inputValidation.infoBackground", { dark: "#063B49", light: "#D6ECF2", hcDark: Color.black, hcLight: Color.white }, localize(1901, "Input validation background color for information severity.")); + inputValidationInfoForeground = registerColor("inputValidation.infoForeground", { dark: null, light: null, hcDark: null, hcLight: foreground }, localize(1902, "Input validation foreground color for information severity.")); + inputValidationInfoBorder = registerColor("inputValidation.infoBorder", { dark: "#007acc", light: "#007acc", hcDark: contrastBorder, hcLight: contrastBorder }, localize(1903, "Input validation border color for information severity.")); + inputValidationWarningBackground = registerColor("inputValidation.warningBackground", { dark: "#352A05", light: "#F6F5D2", hcDark: Color.black, hcLight: Color.white }, localize(1904, "Input validation background color for warning severity.")); + inputValidationWarningForeground = registerColor("inputValidation.warningForeground", { dark: null, light: null, hcDark: null, hcLight: foreground }, localize(1905, "Input validation foreground color for warning severity.")); + inputValidationWarningBorder = registerColor("inputValidation.warningBorder", { dark: "#B89500", light: "#B89500", hcDark: contrastBorder, hcLight: contrastBorder }, localize(1906, "Input validation border color for warning severity.")); + inputValidationErrorBackground = registerColor("inputValidation.errorBackground", { dark: "#5A1D1D", light: "#F2DEDE", hcDark: Color.black, hcLight: Color.white }, localize(1907, "Input validation background color for error severity.")); + inputValidationErrorForeground = registerColor("inputValidation.errorForeground", { dark: null, light: null, hcDark: null, hcLight: foreground }, localize(1908, "Input validation foreground color for error severity.")); + inputValidationErrorBorder = registerColor("inputValidation.errorBorder", { dark: "#BE1100", light: "#BE1100", hcDark: contrastBorder, hcLight: contrastBorder }, localize(1909, "Input validation border color for error severity.")); + selectBackground = registerColor("dropdown.background", { dark: "#3C3C3C", light: Color.white, hcDark: Color.black, hcLight: Color.white }, localize(1910, "Dropdown background.")); + selectListBackground = registerColor("dropdown.listBackground", { dark: null, light: null, hcDark: Color.black, hcLight: Color.white }, localize(1911, "Dropdown list background.")); + selectForeground = registerColor("dropdown.foreground", { dark: "#F0F0F0", light: foreground, hcDark: Color.white, hcLight: foreground }, localize(1912, "Dropdown foreground.")); + selectBorder = registerColor("dropdown.border", { dark: selectBackground, light: "#CECECE", hcDark: contrastBorder, hcLight: contrastBorder }, localize(1913, "Dropdown border.")); + buttonForeground = registerColor("button.foreground", Color.white, localize(1914, "Button foreground color.")); + buttonSeparator = registerColor("button.separator", transparent(buttonForeground, 0.4), localize(1915, "Button separator color.")); + buttonBackground = registerColor("button.background", { dark: "#0E639C", light: "#007ACC", hcDark: Color.black, hcLight: "#0F4A85" }, localize(1916, "Button background color.")); + buttonHoverBackground = registerColor("button.hoverBackground", { dark: lighten(buttonBackground, 0.2), light: darken(buttonBackground, 0.2), hcDark: buttonBackground, hcLight: buttonBackground }, localize(1917, "Button background color when hovering.")); + buttonBorder = registerColor("button.border", contrastBorder, localize(1918, "Button border color.")); + buttonSecondaryForeground = registerColor("button.secondaryForeground", { dark: Color.white, light: Color.white, hcDark: Color.white, hcLight: foreground }, localize(1919, "Secondary button foreground color.")); + buttonSecondaryBackground = registerColor("button.secondaryBackground", { dark: "#3A3D41", light: "#5F6A79", hcDark: null, hcLight: Color.white }, localize(1920, "Secondary button background color.")); + buttonSecondaryHoverBackground = registerColor("button.secondaryHoverBackground", { dark: lighten(buttonSecondaryBackground, 0.2), light: darken(buttonSecondaryBackground, 0.2), hcDark: null, hcLight: null }, localize(1921, "Secondary button background color when hovering.")); + radioActiveForeground = registerColor("radio.activeForeground", inputActiveOptionForeground, localize(1922, "Foreground color of active radio option.")); + radioActiveBackground = registerColor("radio.activeBackground", inputActiveOptionBackground, localize(1923, "Background color of active radio option.")); + radioActiveBorder = registerColor("radio.activeBorder", inputActiveOptionBorder, localize(1924, "Border color of the active radio option.")); + radioInactiveForeground = registerColor("radio.inactiveForeground", null, localize(1925, "Foreground color of inactive radio option.")); + radioInactiveBackground = registerColor("radio.inactiveBackground", null, localize(1926, "Background color of inactive radio option.")); + radioInactiveBorder = registerColor("radio.inactiveBorder", { light: transparent(radioActiveForeground, 0.2), dark: transparent(radioActiveForeground, 0.2), hcDark: transparent(radioActiveForeground, 0.4), hcLight: transparent(radioActiveForeground, 0.2) }, localize(1927, "Border color of the inactive radio option.")); + radioInactiveHoverBackground = registerColor("radio.inactiveHoverBackground", inputActiveOptionHoverBackground, localize(1928, "Background color of inactive active radio option when hovering.")); + checkboxBackground = registerColor("checkbox.background", selectBackground, localize(1929, "Background color of checkbox widget.")); + checkboxSelectBackground = registerColor("checkbox.selectBackground", editorWidgetBackground, localize(1930, "Background color of checkbox widget when the element it's in is selected.")); + checkboxForeground = registerColor("checkbox.foreground", selectForeground, localize(1931, "Foreground color of checkbox widget.")); + checkboxBorder = registerColor("checkbox.border", selectBorder, localize(1932, "Border color of checkbox widget.")); + checkboxSelectBorder = registerColor("checkbox.selectBorder", iconForeground, localize(1933, "Border color of checkbox widget when the element it's in is selected.")); + checkboxDisabledBackground = registerColor("checkbox.disabled.background", { op: 7, color: checkboxBackground, with: checkboxForeground, ratio: 0.33 }, localize(1934, "Background of a disabled checkbox.")); + checkboxDisabledForeground = registerColor("checkbox.disabled.foreground", { op: 7, color: checkboxForeground, with: checkboxBackground, ratio: 0.33 }, localize(1935, "Foreground of a disabled checkbox.")); + keybindingLabelBackground = registerColor("keybindingLabel.background", { dark: new Color(new RGBA(128, 128, 128, 0.17)), light: new Color(new RGBA(221, 221, 221, 0.4)), hcDark: Color.transparent, hcLight: Color.transparent }, localize(1936, "Keybinding label background color. The keybinding label is used to represent a keyboard shortcut.")); + keybindingLabelForeground = registerColor("keybindingLabel.foreground", { dark: Color.fromHex("#CCCCCC"), light: Color.fromHex("#555555"), hcDark: Color.white, hcLight: foreground }, localize(1937, "Keybinding label foreground color. The keybinding label is used to represent a keyboard shortcut.")); + keybindingLabelBorder = registerColor("keybindingLabel.border", { dark: new Color(new RGBA(51, 51, 51, 0.6)), light: new Color(new RGBA(204, 204, 204, 0.4)), hcDark: new Color(new RGBA(111, 195, 223)), hcLight: contrastBorder }, localize(1938, "Keybinding label border color. The keybinding label is used to represent a keyboard shortcut.")); + keybindingLabelBottomBorder = registerColor("keybindingLabel.bottomBorder", { dark: new Color(new RGBA(68, 68, 68, 0.6)), light: new Color(new RGBA(187, 187, 187, 0.4)), hcDark: new Color(new RGBA(111, 195, 223)), hcLight: foreground }, localize(1939, "Keybinding label border bottom color. The keybinding label is used to represent a keyboard shortcut.")); + } +}); + +// node_modules/monaco-editor-core/esm/vs/platform/theme/common/colors/listColors.js +var listFocusBackground, listFocusForeground, listFocusOutline, listFocusAndSelectionOutline, listActiveSelectionBackground, listActiveSelectionForeground, listActiveSelectionIconForeground, listInactiveSelectionBackground, listInactiveSelectionForeground, listInactiveSelectionIconForeground, listInactiveFocusBackground, listInactiveFocusOutline, listHoverBackground, listHoverForeground, listDropOverBackground, listDropBetweenBackground, listHighlightForeground, listFocusHighlightForeground, listInvalidItemForeground, listErrorForeground, listWarningForeground, listFilterWidgetBackground, listFilterWidgetOutline, listFilterWidgetNoMatchesOutline, listFilterWidgetShadow, listFilterMatchHighlight, listFilterMatchHighlightBorder, listDeemphasizedForeground, treeIndentGuidesStroke, treeInactiveIndentGuidesStroke, tableColumnsBorder, tableOddRowsBackgroundColor, editorActionListBackground, editorActionListForeground, editorActionListFocusForeground, editorActionListFocusBackground; +var init_listColors = __esm({ + "node_modules/monaco-editor-core/esm/vs/platform/theme/common/colors/listColors.js"() { + init_nls(); + init_color(); + init_colorUtils(); + init_baseColors(); + init_editorColors(); + listFocusBackground = registerColor("list.focusBackground", null, localize(1940, "List/Tree background color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")); + listFocusForeground = registerColor("list.focusForeground", null, localize(1941, "List/Tree foreground color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")); + listFocusOutline = registerColor("list.focusOutline", { dark: focusBorder, light: focusBorder, hcDark: activeContrastBorder, hcLight: activeContrastBorder }, localize(1942, "List/Tree outline color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")); + listFocusAndSelectionOutline = registerColor("list.focusAndSelectionOutline", null, localize(1943, "List/Tree outline color for the focused item when the list/tree is active and selected. An active list/tree has keyboard focus, an inactive does not.")); + listActiveSelectionBackground = registerColor("list.activeSelectionBackground", { dark: "#04395E", light: "#0060C0", hcDark: null, hcLight: Color.fromHex("#0F4A85").transparent(0.1) }, localize(1944, "List/Tree background color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")); + listActiveSelectionForeground = registerColor("list.activeSelectionForeground", { dark: Color.white, light: Color.white, hcDark: null, hcLight: null }, localize(1945, "List/Tree foreground color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")); + listActiveSelectionIconForeground = registerColor("list.activeSelectionIconForeground", null, localize(1946, "List/Tree icon foreground color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")); + listInactiveSelectionBackground = registerColor("list.inactiveSelectionBackground", { dark: "#37373D", light: "#E4E6F1", hcDark: null, hcLight: Color.fromHex("#0F4A85").transparent(0.1) }, localize(1947, "List/Tree background color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")); + listInactiveSelectionForeground = registerColor("list.inactiveSelectionForeground", null, localize(1948, "List/Tree foreground color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")); + listInactiveSelectionIconForeground = registerColor("list.inactiveSelectionIconForeground", null, localize(1949, "List/Tree icon foreground color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")); + listInactiveFocusBackground = registerColor("list.inactiveFocusBackground", null, localize(1950, "List/Tree background color for the focused item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")); + listInactiveFocusOutline = registerColor("list.inactiveFocusOutline", null, localize(1951, "List/Tree outline color for the focused item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")); + listHoverBackground = registerColor("list.hoverBackground", { dark: "#2A2D2E", light: "#F0F0F0", hcDark: Color.white.transparent(0.1), hcLight: Color.fromHex("#0F4A85").transparent(0.1) }, localize(1952, "List/Tree background when hovering over items using the mouse.")); + listHoverForeground = registerColor("list.hoverForeground", null, localize(1953, "List/Tree foreground when hovering over items using the mouse.")); + listDropOverBackground = registerColor("list.dropBackground", { dark: "#062F4A", light: "#D6EBFF", hcDark: null, hcLight: null }, localize(1954, "List/Tree drag and drop background when moving items over other items when using the mouse.")); + listDropBetweenBackground = registerColor("list.dropBetweenBackground", { dark: iconForeground, light: iconForeground, hcDark: null, hcLight: null }, localize(1955, "List/Tree drag and drop border color when moving items between items when using the mouse.")); + listHighlightForeground = registerColor("list.highlightForeground", { dark: "#2AAAFF", light: "#0066BF", hcDark: focusBorder, hcLight: focusBorder }, localize(1956, "List/Tree foreground color of the match highlights when searching inside the list/tree.")); + listFocusHighlightForeground = registerColor("list.focusHighlightForeground", { dark: listHighlightForeground, light: ifDefinedThenElse(listActiveSelectionBackground, listHighlightForeground, "#BBE7FF"), hcDark: listHighlightForeground, hcLight: listHighlightForeground }, localize(1957, "List/Tree foreground color of the match highlights on actively focused items when searching inside the list/tree.")); + listInvalidItemForeground = registerColor("list.invalidItemForeground", { dark: "#B89500", light: "#B89500", hcDark: "#B89500", hcLight: "#B5200D" }, localize(1958, "List/Tree foreground color for invalid items, for example an unresolved root in explorer.")); + listErrorForeground = registerColor("list.errorForeground", { dark: "#F88070", light: "#B01011", hcDark: null, hcLight: null }, localize(1959, "Foreground color of list items containing errors.")); + listWarningForeground = registerColor("list.warningForeground", { dark: "#CCA700", light: "#855F00", hcDark: null, hcLight: null }, localize(1960, "Foreground color of list items containing warnings.")); + listFilterWidgetBackground = registerColor("listFilterWidget.background", { light: darken(editorWidgetBackground, 0), dark: lighten(editorWidgetBackground, 0), hcDark: editorWidgetBackground, hcLight: editorWidgetBackground }, localize(1961, "Background color of the type filter widget in lists and trees.")); + listFilterWidgetOutline = registerColor("listFilterWidget.outline", { dark: Color.transparent, light: Color.transparent, hcDark: "#f38518", hcLight: "#007ACC" }, localize(1962, "Outline color of the type filter widget in lists and trees.")); + listFilterWidgetNoMatchesOutline = registerColor("listFilterWidget.noMatchesOutline", { dark: "#BE1100", light: "#BE1100", hcDark: contrastBorder, hcLight: contrastBorder }, localize(1963, "Outline color of the type filter widget in lists and trees, when there are no matches.")); + listFilterWidgetShadow = registerColor("listFilterWidget.shadow", widgetShadow, localize(1964, "Shadow color of the type filter widget in lists and trees.")); + listFilterMatchHighlight = registerColor("list.filterMatchBackground", { dark: editorFindMatchHighlight, light: editorFindMatchHighlight, hcDark: null, hcLight: null }, localize(1965, "Background color of the filtered match.")); + listFilterMatchHighlightBorder = registerColor("list.filterMatchBorder", { dark: editorFindMatchHighlightBorder, light: editorFindMatchHighlightBorder, hcDark: contrastBorder, hcLight: activeContrastBorder }, localize(1966, "Border color of the filtered match.")); + listDeemphasizedForeground = registerColor("list.deemphasizedForeground", { dark: "#8C8C8C", light: "#8E8E90", hcDark: "#A7A8A9", hcLight: "#666666" }, localize(1967, "List/Tree foreground color for items that are deemphasized.")); + treeIndentGuidesStroke = registerColor("tree.indentGuidesStroke", { dark: "#585858", light: "#a9a9a9", hcDark: "#a9a9a9", hcLight: "#a5a5a5" }, localize(1968, "Tree stroke color for the indentation guides.")); + treeInactiveIndentGuidesStroke = registerColor("tree.inactiveIndentGuidesStroke", transparent(treeIndentGuidesStroke, 0.4), localize(1969, "Tree stroke color for the indentation guides that are not active.")); + tableColumnsBorder = registerColor("tree.tableColumnsBorder", { dark: "#CCCCCC20", light: "#61616120", hcDark: null, hcLight: null }, localize(1970, "Table border color between columns.")); + tableOddRowsBackgroundColor = registerColor("tree.tableOddRowsBackground", { dark: transparent(foreground, 0.04), light: transparent(foreground, 0.04), hcDark: null, hcLight: null }, localize(1971, "Background color for odd table rows.")); + editorActionListBackground = registerColor("editorActionList.background", editorWidgetBackground, localize(1972, "Action List background color.")); + editorActionListForeground = registerColor("editorActionList.foreground", editorWidgetForeground, localize(1973, "Action List foreground color.")); + editorActionListFocusForeground = registerColor("editorActionList.focusForeground", listActiveSelectionForeground, localize(1974, "Action List foreground color for the focused item.")); + editorActionListFocusBackground = registerColor("editorActionList.focusBackground", listActiveSelectionBackground, localize(1975, "Action List background color for the focused item.")); + } +}); + +// node_modules/monaco-editor-core/esm/vs/platform/theme/common/colors/menuColors.js +var menuBorder, menuForeground, menuBackground, menuSelectionForeground, menuSelectionBackground, menuSelectionBorder, menuSeparatorBackground; +var init_menuColors = __esm({ + "node_modules/monaco-editor-core/esm/vs/platform/theme/common/colors/menuColors.js"() { + init_nls(); + init_colorUtils(); + init_baseColors(); + init_inputColors(); + init_listColors(); + menuBorder = registerColor("menu.border", { dark: null, light: null, hcDark: contrastBorder, hcLight: contrastBorder }, localize(1976, "Border color of menus.")); + menuForeground = registerColor("menu.foreground", selectForeground, localize(1977, "Foreground color of menu items.")); + menuBackground = registerColor("menu.background", selectBackground, localize(1978, "Background color of menu items.")); + menuSelectionForeground = registerColor("menu.selectionForeground", listActiveSelectionForeground, localize(1979, "Foreground color of the selected menu item in menus.")); + menuSelectionBackground = registerColor("menu.selectionBackground", listActiveSelectionBackground, localize(1980, "Background color of the selected menu item in menus.")); + menuSelectionBorder = registerColor("menu.selectionBorder", { dark: null, light: null, hcDark: activeContrastBorder, hcLight: activeContrastBorder }, localize(1981, "Border color of the selected menu item in menus.")); + menuSeparatorBackground = registerColor("menu.separatorBackground", { dark: "#606060", light: "#D4D4D4", hcDark: contrastBorder, hcLight: contrastBorder }, localize(1982, "Color of a separator menu item in menus.")); + } +}); + +// node_modules/monaco-editor-core/esm/vs/platform/theme/common/colors/quickpickColors.js +var quickInputBackground, quickInputForeground, quickInputTitleBackground, pickerGroupForeground, pickerGroupBorder, _deprecatedQuickInputListFocusBackground, quickInputListFocusForeground, quickInputListFocusIconForeground, quickInputListFocusBackground; +var init_quickpickColors = __esm({ + "node_modules/monaco-editor-core/esm/vs/platform/theme/common/colors/quickpickColors.js"() { + init_nls(); + init_color(); + init_colorUtils(); + init_editorColors(); + init_listColors(); + quickInputBackground = registerColor("quickInput.background", editorWidgetBackground, localize(2010, "Quick picker background color. The quick picker widget is the container for pickers like the command palette.")); + quickInputForeground = registerColor("quickInput.foreground", editorWidgetForeground, localize(2011, "Quick picker foreground color. The quick picker widget is the container for pickers like the command palette.")); + quickInputTitleBackground = registerColor("quickInputTitle.background", { dark: new Color(new RGBA(255, 255, 255, 0.105)), light: new Color(new RGBA(0, 0, 0, 0.06)), hcDark: "#000000", hcLight: Color.white }, localize(2012, "Quick picker title background color. The quick picker widget is the container for pickers like the command palette.")); + pickerGroupForeground = registerColor("pickerGroup.foreground", { dark: "#3794FF", light: "#0066BF", hcDark: Color.white, hcLight: "#0F4A85" }, localize(2013, "Quick picker color for grouping labels.")); + pickerGroupBorder = registerColor("pickerGroup.border", { dark: "#3F3F46", light: "#CCCEDB", hcDark: Color.white, hcLight: "#0F4A85" }, localize(2014, "Quick picker color for grouping borders.")); + _deprecatedQuickInputListFocusBackground = registerColor("quickInput.list.focusBackground", null, "", void 0, localize(2015, "Please use quickInputList.focusBackground instead")); + quickInputListFocusForeground = registerColor("quickInputList.focusForeground", listActiveSelectionForeground, localize(2016, "Quick picker foreground color for the focused item.")); + quickInputListFocusIconForeground = registerColor("quickInputList.focusIconForeground", listActiveSelectionIconForeground, localize(2017, "Quick picker icon foreground color for the focused item.")); + quickInputListFocusBackground = registerColor("quickInputList.focusBackground", { dark: oneOf(_deprecatedQuickInputListFocusBackground, listActiveSelectionBackground), light: oneOf(_deprecatedQuickInputListFocusBackground, listActiveSelectionBackground), hcDark: null, hcLight: null }, localize(2018, "Quick picker background color for the focused item.")); + } +}); + +// node_modules/monaco-editor-core/esm/vs/platform/theme/common/colors/searchColors.js +var searchResultsInfoForeground, searchEditorFindMatch, searchEditorFindMatchBorder; +var init_searchColors = __esm({ + "node_modules/monaco-editor-core/esm/vs/platform/theme/common/colors/searchColors.js"() { + init_nls(); + init_colorUtils(); + init_baseColors(); + init_editorColors(); + searchResultsInfoForeground = registerColor("search.resultsInfoForeground", { light: foreground, dark: transparent(foreground, 0.65), hcDark: foreground, hcLight: foreground }, localize(2019, "Color of the text in the search viewlet's completion message.")); + searchEditorFindMatch = registerColor("searchEditor.findMatchBackground", { light: transparent(editorFindMatchHighlight, 0.66), dark: transparent(editorFindMatchHighlight, 0.66), hcDark: editorFindMatchHighlight, hcLight: editorFindMatchHighlight }, localize(2020, "Color of the Search Editor query matches.")); + searchEditorFindMatchBorder = registerColor("searchEditor.findMatchBorder", { light: transparent(editorFindMatchHighlightBorder, 0.66), dark: transparent(editorFindMatchHighlightBorder, 0.66), hcDark: editorFindMatchHighlightBorder, hcLight: editorFindMatchHighlightBorder }, localize(2021, "Border color of the Search Editor query matches.")); + } +}); + +// node_modules/monaco-editor-core/esm/vs/platform/theme/common/colorRegistry.js +var init_colorRegistry = __esm({ + "node_modules/monaco-editor-core/esm/vs/platform/theme/common/colorRegistry.js"() { + init_colorUtils(); + init_baseColors(); + init_chartsColors(); + init_editorColors(); + init_inputColors(); + init_listColors(); + init_menuColors(); + init_minimapColors(); + init_miscColors(); + init_quickpickColors(); + init_searchColors(); + } +}); + +// node_modules/monaco-editor-core/esm/vs/platform/theme/common/theme.js +function isHighContrast(scheme) { + return scheme === ColorScheme.HIGH_CONTRAST_DARK || scheme === ColorScheme.HIGH_CONTRAST_LIGHT; +} +function isDark(scheme) { + return scheme === ColorScheme.DARK || scheme === ColorScheme.HIGH_CONTRAST_DARK; +} +var ColorScheme, ThemeTypeSelector; +var init_theme = __esm({ + "node_modules/monaco-editor-core/esm/vs/platform/theme/common/theme.js"() { + (function(ColorScheme2) { + ColorScheme2["DARK"] = "dark"; + ColorScheme2["LIGHT"] = "light"; + ColorScheme2["HIGH_CONTRAST_DARK"] = "hcDark"; + ColorScheme2["HIGH_CONTRAST_LIGHT"] = "hcLight"; + })(ColorScheme || (ColorScheme = {})); + (function(ThemeTypeSelector2) { + ThemeTypeSelector2["VS"] = "vs"; + ThemeTypeSelector2["VS_DARK"] = "vs-dark"; + ThemeTypeSelector2["HC_BLACK"] = "hc-black"; + ThemeTypeSelector2["HC_LIGHT"] = "hc-light"; + })(ThemeTypeSelector || (ThemeTypeSelector = {})); + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/common/uuid.js +function prefixedUuid(namespace) { + return `${namespace}-${generateUuid()}`; +} +var generateUuid; +var init_uuid = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/common/uuid.js"() { + generateUuid = (function() { + if (typeof crypto.randomUUID === "function") { + return crypto.randomUUID.bind(crypto); + } + const _data = new Uint8Array(16); + const _hex = []; + for (let i2 = 0; i2 < 256; i2++) { + _hex.push(i2.toString(16).padStart(2, "0")); + } + return function generateUuid2() { + crypto.getRandomValues(_data); + _data[6] = _data[6] & 15 | 64; + _data[8] = _data[8] & 63 | 128; + let i2 = 0; + let result = ""; + result += _hex[_data[i2++]]; + result += _hex[_data[i2++]]; + result += _hex[_data[i2++]]; + result += _hex[_data[i2++]]; + result += "-"; + result += _hex[_data[i2++]]; + result += _hex[_data[i2++]]; + result += "-"; + result += _hex[_data[i2++]]; + result += _hex[_data[i2++]]; + result += "-"; + result += _hex[_data[i2++]]; + result += _hex[_data[i2++]]; + result += "-"; + result += _hex[_data[i2++]]; + result += _hex[_data[i2++]]; + result += _hex[_data[i2++]]; + result += _hex[_data[i2++]]; + result += _hex[_data[i2++]]; + result += _hex[_data[i2++]]; + return result; + }; + })(); + } +}); + +// node_modules/monaco-editor-core/esm/vs/platform/theme/common/themeService.js +function themeColorFromId(id) { + return { id }; +} +function getThemeTypeSelector(type) { + switch (type) { + case ColorScheme.DARK: + return ThemeTypeSelector.VS_DARK; + case ColorScheme.HIGH_CONTRAST_DARK: + return ThemeTypeSelector.HC_BLACK; + case ColorScheme.HIGH_CONTRAST_LIGHT: + return ThemeTypeSelector.HC_LIGHT; + default: + return ThemeTypeSelector.VS; + } +} +function registerThemingParticipant(participant) { + return themingRegistry.onColorThemeChange(participant); +} +var IThemeService, Extensions7, ThemingRegistry, themingRegistry, Themable; +var init_themeService = __esm({ + "node_modules/monaco-editor-core/esm/vs/platform/theme/common/themeService.js"() { + init_event(); + init_lifecycle(); + init_instantiation(); + init_platform2(); + init_theme(); + IThemeService = createDecorator("themeService"); + Extensions7 = { + ThemingContribution: "base.contributions.theming" + }; + ThemingRegistry = class extends Disposable { + constructor() { + super(); + this.themingParticipants = []; + this.themingParticipants = []; + this.onThemingParticipantAddedEmitter = this._register(new Emitter()); + } + onColorThemeChange(participant) { + this.themingParticipants.push(participant); + this.onThemingParticipantAddedEmitter.fire(participant); + return toDisposable(() => { + const idx = this.themingParticipants.indexOf(participant); + this.themingParticipants.splice(idx, 1); + }); + } + getThemingParticipants() { + return this.themingParticipants; + } + }; + themingRegistry = new ThemingRegistry(); + Registry.add(Extensions7.ThemingContribution, themingRegistry); + Themable = class extends Disposable { + constructor(themeService) { + super(); + this.themeService = themeService; + this.theme = themeService.getColorTheme(); + this._register(this.themeService.onDidColorThemeChange((theme) => this.onThemeChange(theme))); + } + onThemeChange(theme) { + this.theme = theme; + this.updateStyles(); + } + updateStyles() { + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/common/core/editorColorRegistry.js +var editorLineHighlight, editorLineHighlightBorder, editorRangeHighlight, editorRangeHighlightBorder, editorSymbolHighlight, editorSymbolHighlightBorder, editorCursorForeground, editorCursorBackground, editorMultiCursorPrimaryForeground, editorMultiCursorPrimaryBackground, editorMultiCursorSecondaryForeground, editorMultiCursorSecondaryBackground, editorWhitespaces, editorLineNumbers, deprecatedEditorIndentGuides, deprecatedEditorActiveIndentGuides, editorIndentGuide1, editorIndentGuide2, editorIndentGuide3, editorIndentGuide4, editorIndentGuide5, editorIndentGuide6, editorActiveIndentGuide1, editorActiveIndentGuide2, editorActiveIndentGuide3, editorActiveIndentGuide4, editorActiveIndentGuide5, editorActiveIndentGuide6, deprecatedEditorActiveLineNumber, editorActiveLineNumber, editorDimmedLineNumber, editorRuler, editorCodeLensForeground, editorBracketMatchBackground, editorBracketMatchBorder, editorOverviewRulerBorder, editorOverviewRulerBackground, editorGutter, editorUnnecessaryCodeBorder, editorUnnecessaryCodeOpacity, ghostTextBorder, ghostTextForeground, ghostTextBackground, rulerRangeDefault, overviewRulerRangeHighlight, overviewRulerError, overviewRulerWarning, overviewRulerInfo, editorBracketHighlightingForeground1, editorBracketHighlightingForeground2, editorBracketHighlightingForeground3, editorBracketHighlightingForeground4, editorBracketHighlightingForeground5, editorBracketHighlightingForeground6, editorBracketHighlightingUnexpectedBracketForeground, editorBracketPairGuideBackground1, editorBracketPairGuideBackground2, editorBracketPairGuideBackground3, editorBracketPairGuideBackground4, editorBracketPairGuideBackground5, editorBracketPairGuideBackground6, editorBracketPairGuideActiveBackground1, editorBracketPairGuideActiveBackground2, editorBracketPairGuideActiveBackground3, editorBracketPairGuideActiveBackground4, editorBracketPairGuideActiveBackground5, editorBracketPairGuideActiveBackground6, editorUnicodeHighlightBorder, editorUnicodeHighlightBackground; +var init_editorColorRegistry = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/common/core/editorColorRegistry.js"() { + init_nls(); + init_color(); + init_colorRegistry(); + init_themeService(); + editorLineHighlight = registerColor("editor.lineHighlightBackground", null, localize(610, "Background color for the highlight of line at the cursor position.")); + editorLineHighlightBorder = registerColor("editor.lineHighlightBorder", { dark: "#282828", light: "#eeeeee", hcDark: "#f38518", hcLight: contrastBorder }, localize(611, "Background color for the border around the line at the cursor position.")); + editorRangeHighlight = registerColor("editor.rangeHighlightBackground", { dark: "#ffffff0b", light: "#fdff0033", hcDark: null, hcLight: null }, localize(612, "Background color of highlighted ranges, like by quick open and find features. The color must not be opaque so as not to hide underlying decorations."), true); + editorRangeHighlightBorder = registerColor("editor.rangeHighlightBorder", { dark: null, light: null, hcDark: activeContrastBorder, hcLight: activeContrastBorder }, localize(613, "Background color of the border around highlighted ranges.")); + editorSymbolHighlight = registerColor("editor.symbolHighlightBackground", { dark: editorFindMatchHighlight, light: editorFindMatchHighlight, hcDark: null, hcLight: null }, localize(614, "Background color of highlighted symbol, like for go to definition or go next/previous symbol. The color must not be opaque so as not to hide underlying decorations."), true); + editorSymbolHighlightBorder = registerColor("editor.symbolHighlightBorder", { dark: null, light: null, hcDark: activeContrastBorder, hcLight: activeContrastBorder }, localize(615, "Background color of the border around highlighted symbols.")); + editorCursorForeground = registerColor("editorCursor.foreground", { dark: "#AEAFAD", light: Color.black, hcDark: Color.white, hcLight: "#0F4A85" }, localize(616, "Color of the editor cursor.")); + editorCursorBackground = registerColor("editorCursor.background", null, localize(617, "The background color of the editor cursor. Allows customizing the color of a character overlapped by a block cursor.")); + editorMultiCursorPrimaryForeground = registerColor("editorMultiCursor.primary.foreground", editorCursorForeground, localize(618, "Color of the primary editor cursor when multiple cursors are present.")); + editorMultiCursorPrimaryBackground = registerColor("editorMultiCursor.primary.background", editorCursorBackground, localize(619, "The background color of the primary editor cursor when multiple cursors are present. Allows customizing the color of a character overlapped by a block cursor.")); + editorMultiCursorSecondaryForeground = registerColor("editorMultiCursor.secondary.foreground", editorCursorForeground, localize(620, "Color of secondary editor cursors when multiple cursors are present.")); + editorMultiCursorSecondaryBackground = registerColor("editorMultiCursor.secondary.background", editorCursorBackground, localize(621, "The background color of secondary editor cursors when multiple cursors are present. Allows customizing the color of a character overlapped by a block cursor.")); + editorWhitespaces = registerColor("editorWhitespace.foreground", { dark: "#e3e4e229", light: "#33333333", hcDark: "#e3e4e229", hcLight: "#CCCCCC" }, localize(622, "Color of whitespace characters in the editor.")); + editorLineNumbers = registerColor("editorLineNumber.foreground", { dark: "#858585", light: "#237893", hcDark: Color.white, hcLight: "#292929" }, localize(623, "Color of editor line numbers.")); + deprecatedEditorIndentGuides = registerColor("editorIndentGuide.background", editorWhitespaces, localize(624, "Color of the editor indentation guides."), false, localize(625, "'editorIndentGuide.background' is deprecated. Use 'editorIndentGuide.background1' instead.")); + deprecatedEditorActiveIndentGuides = registerColor("editorIndentGuide.activeBackground", editorWhitespaces, localize(626, "Color of the active editor indentation guides."), false, localize(627, "'editorIndentGuide.activeBackground' is deprecated. Use 'editorIndentGuide.activeBackground1' instead.")); + editorIndentGuide1 = registerColor("editorIndentGuide.background1", deprecatedEditorIndentGuides, localize(628, "Color of the editor indentation guides (1).")); + editorIndentGuide2 = registerColor("editorIndentGuide.background2", "#00000000", localize(629, "Color of the editor indentation guides (2).")); + editorIndentGuide3 = registerColor("editorIndentGuide.background3", "#00000000", localize(630, "Color of the editor indentation guides (3).")); + editorIndentGuide4 = registerColor("editorIndentGuide.background4", "#00000000", localize(631, "Color of the editor indentation guides (4).")); + editorIndentGuide5 = registerColor("editorIndentGuide.background5", "#00000000", localize(632, "Color of the editor indentation guides (5).")); + editorIndentGuide6 = registerColor("editorIndentGuide.background6", "#00000000", localize(633, "Color of the editor indentation guides (6).")); + editorActiveIndentGuide1 = registerColor("editorIndentGuide.activeBackground1", deprecatedEditorActiveIndentGuides, localize(634, "Color of the active editor indentation guides (1).")); + editorActiveIndentGuide2 = registerColor("editorIndentGuide.activeBackground2", "#00000000", localize(635, "Color of the active editor indentation guides (2).")); + editorActiveIndentGuide3 = registerColor("editorIndentGuide.activeBackground3", "#00000000", localize(636, "Color of the active editor indentation guides (3).")); + editorActiveIndentGuide4 = registerColor("editorIndentGuide.activeBackground4", "#00000000", localize(637, "Color of the active editor indentation guides (4).")); + editorActiveIndentGuide5 = registerColor("editorIndentGuide.activeBackground5", "#00000000", localize(638, "Color of the active editor indentation guides (5).")); + editorActiveIndentGuide6 = registerColor("editorIndentGuide.activeBackground6", "#00000000", localize(639, "Color of the active editor indentation guides (6).")); + deprecatedEditorActiveLineNumber = registerColor("editorActiveLineNumber.foreground", { dark: "#c6c6c6", light: "#0B216F", hcDark: activeContrastBorder, hcLight: activeContrastBorder }, localize(640, "Color of editor active line number"), false, localize(641, "Id is deprecated. Use 'editorLineNumber.activeForeground' instead.")); + editorActiveLineNumber = registerColor("editorLineNumber.activeForeground", deprecatedEditorActiveLineNumber, localize(642, "Color of editor active line number")); + editorDimmedLineNumber = registerColor("editorLineNumber.dimmedForeground", null, localize(643, "Color of the final editor line when editor.renderFinalNewline is set to dimmed.")); + editorRuler = registerColor("editorRuler.foreground", { dark: "#5A5A5A", light: Color.lightgrey, hcDark: Color.white, hcLight: "#292929" }, localize(644, "Color of the editor rulers.")); + editorCodeLensForeground = registerColor("editorCodeLens.foreground", { dark: "#999999", light: "#919191", hcDark: "#999999", hcLight: "#292929" }, localize(645, "Foreground color of editor CodeLens")); + editorBracketMatchBackground = registerColor("editorBracketMatch.background", { dark: "#0064001a", light: "#0064001a", hcDark: "#0064001a", hcLight: "#0000" }, localize(646, "Background color behind matching brackets")); + editorBracketMatchBorder = registerColor("editorBracketMatch.border", { dark: "#888", light: "#B9B9B9", hcDark: contrastBorder, hcLight: contrastBorder }, localize(647, "Color for matching brackets boxes")); + editorOverviewRulerBorder = registerColor("editorOverviewRuler.border", { dark: "#7f7f7f4d", light: "#7f7f7f4d", hcDark: "#7f7f7f4d", hcLight: "#666666" }, localize(648, "Color of the overview ruler border.")); + editorOverviewRulerBackground = registerColor("editorOverviewRuler.background", null, localize(649, "Background color of the editor overview ruler.")); + editorGutter = registerColor("editorGutter.background", editorBackground, localize(650, "Background color of the editor gutter. The gutter contains the glyph margins and the line numbers.")); + editorUnnecessaryCodeBorder = registerColor("editorUnnecessaryCode.border", { dark: null, light: null, hcDark: Color.fromHex("#fff").transparent(0.8), hcLight: contrastBorder }, localize(651, "Border color of unnecessary (unused) source code in the editor.")); + editorUnnecessaryCodeOpacity = registerColor("editorUnnecessaryCode.opacity", { dark: Color.fromHex("#000a"), light: Color.fromHex("#0007"), hcDark: null, hcLight: null }, localize(652, `Opacity of unnecessary (unused) source code in the editor. For example, "#000000c0" will render the code with 75% opacity. For high contrast themes, use the 'editorUnnecessaryCode.border' theme color to underline unnecessary code instead of fading it out.`)); + ghostTextBorder = registerColor("editorGhostText.border", { dark: null, light: null, hcDark: Color.fromHex("#fff").transparent(0.8), hcLight: Color.fromHex("#292929").transparent(0.8) }, localize(653, "Border color of ghost text in the editor.")); + ghostTextForeground = registerColor("editorGhostText.foreground", { dark: Color.fromHex("#ffffff56"), light: Color.fromHex("#0007"), hcDark: null, hcLight: null }, localize(654, "Foreground color of the ghost text in the editor.")); + ghostTextBackground = registerColor("editorGhostText.background", null, localize(655, "Background color of the ghost text in the editor.")); + rulerRangeDefault = new Color(new RGBA(0, 122, 204, 0.6)); + overviewRulerRangeHighlight = registerColor("editorOverviewRuler.rangeHighlightForeground", rulerRangeDefault, localize(656, "Overview ruler marker color for range highlights. The color must not be opaque so as not to hide underlying decorations."), true); + overviewRulerError = registerColor("editorOverviewRuler.errorForeground", { dark: new Color(new RGBA(255, 18, 18, 0.7)), light: new Color(new RGBA(255, 18, 18, 0.7)), hcDark: new Color(new RGBA(255, 50, 50, 1)), hcLight: "#B5200D" }, localize(657, "Overview ruler marker color for errors.")); + overviewRulerWarning = registerColor("editorOverviewRuler.warningForeground", { dark: editorWarningForeground, light: editorWarningForeground, hcDark: editorWarningBorder, hcLight: editorWarningBorder }, localize(658, "Overview ruler marker color for warnings.")); + overviewRulerInfo = registerColor("editorOverviewRuler.infoForeground", { dark: editorInfoForeground, light: editorInfoForeground, hcDark: editorInfoBorder, hcLight: editorInfoBorder }, localize(659, "Overview ruler marker color for infos.")); + editorBracketHighlightingForeground1 = registerColor("editorBracketHighlight.foreground1", { dark: "#FFD700", light: "#0431FAFF", hcDark: "#FFD700", hcLight: "#0431FAFF" }, localize(660, "Foreground color of brackets (1). Requires enabling bracket pair colorization.")); + editorBracketHighlightingForeground2 = registerColor("editorBracketHighlight.foreground2", { dark: "#DA70D6", light: "#319331FF", hcDark: "#DA70D6", hcLight: "#319331FF" }, localize(661, "Foreground color of brackets (2). Requires enabling bracket pair colorization.")); + editorBracketHighlightingForeground3 = registerColor("editorBracketHighlight.foreground3", { dark: "#179FFF", light: "#7B3814FF", hcDark: "#87CEFA", hcLight: "#7B3814FF" }, localize(662, "Foreground color of brackets (3). Requires enabling bracket pair colorization.")); + editorBracketHighlightingForeground4 = registerColor("editorBracketHighlight.foreground4", "#00000000", localize(663, "Foreground color of brackets (4). Requires enabling bracket pair colorization.")); + editorBracketHighlightingForeground5 = registerColor("editorBracketHighlight.foreground5", "#00000000", localize(664, "Foreground color of brackets (5). Requires enabling bracket pair colorization.")); + editorBracketHighlightingForeground6 = registerColor("editorBracketHighlight.foreground6", "#00000000", localize(665, "Foreground color of brackets (6). Requires enabling bracket pair colorization.")); + editorBracketHighlightingUnexpectedBracketForeground = registerColor("editorBracketHighlight.unexpectedBracket.foreground", { dark: new Color(new RGBA(255, 18, 18, 0.8)), light: new Color(new RGBA(255, 18, 18, 0.8)), hcDark: new Color(new RGBA(255, 50, 50, 1)), hcLight: "#B5200D" }, localize(666, "Foreground color of unexpected brackets.")); + editorBracketPairGuideBackground1 = registerColor("editorBracketPairGuide.background1", "#00000000", localize(667, "Background color of inactive bracket pair guides (1). Requires enabling bracket pair guides.")); + editorBracketPairGuideBackground2 = registerColor("editorBracketPairGuide.background2", "#00000000", localize(668, "Background color of inactive bracket pair guides (2). Requires enabling bracket pair guides.")); + editorBracketPairGuideBackground3 = registerColor("editorBracketPairGuide.background3", "#00000000", localize(669, "Background color of inactive bracket pair guides (3). Requires enabling bracket pair guides.")); + editorBracketPairGuideBackground4 = registerColor("editorBracketPairGuide.background4", "#00000000", localize(670, "Background color of inactive bracket pair guides (4). Requires enabling bracket pair guides.")); + editorBracketPairGuideBackground5 = registerColor("editorBracketPairGuide.background5", "#00000000", localize(671, "Background color of inactive bracket pair guides (5). Requires enabling bracket pair guides.")); + editorBracketPairGuideBackground6 = registerColor("editorBracketPairGuide.background6", "#00000000", localize(672, "Background color of inactive bracket pair guides (6). Requires enabling bracket pair guides.")); + editorBracketPairGuideActiveBackground1 = registerColor("editorBracketPairGuide.activeBackground1", "#00000000", localize(673, "Background color of active bracket pair guides (1). Requires enabling bracket pair guides.")); + editorBracketPairGuideActiveBackground2 = registerColor("editorBracketPairGuide.activeBackground2", "#00000000", localize(674, "Background color of active bracket pair guides (2). Requires enabling bracket pair guides.")); + editorBracketPairGuideActiveBackground3 = registerColor("editorBracketPairGuide.activeBackground3", "#00000000", localize(675, "Background color of active bracket pair guides (3). Requires enabling bracket pair guides.")); + editorBracketPairGuideActiveBackground4 = registerColor("editorBracketPairGuide.activeBackground4", "#00000000", localize(676, "Background color of active bracket pair guides (4). Requires enabling bracket pair guides.")); + editorBracketPairGuideActiveBackground5 = registerColor("editorBracketPairGuide.activeBackground5", "#00000000", localize(677, "Background color of active bracket pair guides (5). Requires enabling bracket pair guides.")); + editorBracketPairGuideActiveBackground6 = registerColor("editorBracketPairGuide.activeBackground6", "#00000000", localize(678, "Background color of active bracket pair guides (6). Requires enabling bracket pair guides.")); + editorUnicodeHighlightBorder = registerColor("editorUnicodeHighlight.border", editorWarningForeground, localize(679, "Border color used to highlight unicode characters.")); + editorUnicodeHighlightBackground = registerColor("editorUnicodeHighlight.background", editorWarningBackground, localize(680, "Background color used to highlight unicode characters.")); + registerThemingParticipant((theme, collector) => { + const background = theme.getColor(editorBackground); + const lineHighlight = theme.getColor(editorLineHighlight); + const imeBackground = lineHighlight && !lineHighlight.isTransparent() ? lineHighlight : background; + if (imeBackground) { + collector.addRule(`.monaco-editor .inputarea.ime-input { background-color: ${imeBackground}; }`); + } + }); + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/common/arraysFind.js +function findLast(array2, predicate, fromIndex = array2.length - 1) { + const idx = findLastIdx(array2, predicate, fromIndex); + if (idx === -1) { + return void 0; + } + return array2[idx]; +} +function findLastIdx(array2, predicate, fromIndex = array2.length - 1) { + for (let i2 = fromIndex; i2 >= 0; i2--) { + const element = array2[i2]; + if (predicate(element, i2)) { + return i2; + } + } + return -1; +} +function findLastMonotonous(array2, predicate) { + const idx = findLastIdxMonotonous(array2, predicate); + return idx === -1 ? void 0 : array2[idx]; +} +function findLastIdxMonotonous(array2, predicate, startIdx = 0, endIdxEx = array2.length) { + let i2 = startIdx; + let j = endIdxEx; + while (i2 < j) { + const k = Math.floor((i2 + j) / 2); + if (predicate(array2[k])) { + i2 = k + 1; + } else { + j = k; + } + } + return i2 - 1; +} +function findFirstMonotonous(array2, predicate) { + const idx = findFirstIdxMonotonousOrArrLen(array2, predicate); + return idx === array2.length ? void 0 : array2[idx]; +} +function findFirstIdxMonotonousOrArrLen(array2, predicate, startIdx = 0, endIdxEx = array2.length) { + let i2 = startIdx; + let j = endIdxEx; + while (i2 < j) { + const k = Math.floor((i2 + j) / 2); + if (predicate(array2[k])) { + j = k; + } else { + i2 = k + 1; + } + } + return i2; +} +function findFirstMax(array2, comparator) { + if (array2.length === 0) { + return void 0; + } + let max = array2[0]; + for (let i2 = 1; i2 < array2.length; i2++) { + const item = array2[i2]; + if (comparator(item, max) > 0) { + max = item; + } + } + return max; +} +function findLastMax(array2, comparator) { + if (array2.length === 0) { + return void 0; + } + let max = array2[0]; + for (let i2 = 1; i2 < array2.length; i2++) { + const item = array2[i2]; + if (comparator(item, max) >= 0) { + max = item; + } + } + return max; +} +function findFirstMin(array2, comparator) { + return findFirstMax(array2, (a, b) => -comparator(a, b)); +} +function findMaxIdx(array2, comparator) { + if (array2.length === 0) { + return -1; + } + let maxIdx = 0; + for (let i2 = 1; i2 < array2.length; i2++) { + const item = array2[i2]; + if (comparator(item, array2[maxIdx]) > 0) { + maxIdx = i2; + } + } + return maxIdx; +} +function mapFindFirst(items, mapFn) { + for (const value of items) { + const mapped = mapFn(value); + if (mapped !== void 0) { + return mapped; + } + } + return void 0; +} +var MonotonousArray; +var init_arraysFind = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/common/arraysFind.js"() { + MonotonousArray = class _MonotonousArray { + static { + this.assertInvariants = false; + } + constructor(_array) { + this._array = _array; + this._findLastMonotonousLastIdx = 0; + } + /** + * The predicate must be monotonous, i.e. `arr.map(predicate)` must be like `[true, ..., true, false, ..., false]`! + * For subsequent calls, current predicate must be weaker than (or equal to) the previous predicate, i.e. more entries must be `true`. + */ + findLastMonotonous(predicate) { + if (_MonotonousArray.assertInvariants) { + if (this._prevFindLastPredicate) { + for (const item of this._array) { + if (this._prevFindLastPredicate(item) && !predicate(item)) { + throw new Error("MonotonousArray: current predicate must be weaker than (or equal to) the previous predicate."); + } + } + } + this._prevFindLastPredicate = predicate; + } + const idx = findLastIdxMonotonous(this._array, predicate, this._findLastMonotonousLastIdx); + this._findLastMonotonousLastIdx = idx + 1; + return idx === -1 ? void 0 : this._array[idx]; + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/common/model/textModelPart.js +var TextModelPart; +var init_textModelPart = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/common/model/textModelPart.js"() { + init_lifecycle(); + TextModelPart = class extends Disposable { + constructor() { + super(...arguments); + this._isDisposed = false; + } + dispose() { + super.dispose(); + this._isDisposed = true; + } + assertNotDisposed() { + if (this._isDisposed) { + throw new Error("TextModelPart is disposed!"); + } + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/common/model/utils.js +function computeIndentLevel(line, tabSize) { + let indent = 0; + let i2 = 0; + const len = line.length; + while (i2 < len) { + const chCode = line.charCodeAt(i2); + if (chCode === 32) { + indent++; + } else if (chCode === 9) { + indent = indent - indent % tabSize + tabSize; + } else { + break; + } + i2++; + } + if (i2 === len) { + return -1; + } + return indent; +} +var init_utils4 = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/common/model/utils.js"() { + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/common/textModelGuides.js +var HorizontalGuidesState, IndentGuide, IndentGuideHorizontalLine; +var init_textModelGuides = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/common/textModelGuides.js"() { + (function(HorizontalGuidesState2) { + HorizontalGuidesState2[HorizontalGuidesState2["Disabled"] = 0] = "Disabled"; + HorizontalGuidesState2[HorizontalGuidesState2["EnabledForActive"] = 1] = "EnabledForActive"; + HorizontalGuidesState2[HorizontalGuidesState2["Enabled"] = 2] = "Enabled"; + })(HorizontalGuidesState || (HorizontalGuidesState = {})); + IndentGuide = class { + constructor(visibleColumn, column, className2, horizontalLine, forWrappedLinesAfterColumn, forWrappedLinesBeforeOrAtColumn) { + this.visibleColumn = visibleColumn; + this.column = column; + this.className = className2; + this.horizontalLine = horizontalLine; + this.forWrappedLinesAfterColumn = forWrappedLinesAfterColumn; + this.forWrappedLinesBeforeOrAtColumn = forWrappedLinesBeforeOrAtColumn; + if (visibleColumn !== -1 === (column !== -1)) { + throw new Error(); + } + } + }; + IndentGuideHorizontalLine = class { + constructor(top, endColumn) { + this.top = top; + this.endColumn = endColumn; + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/common/model/guidesTextModelPart.js +var GuidesTextModelPart, BracketPairGuidesClassNames; +var init_guidesTextModelPart = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/common/model/guidesTextModelPart.js"() { + init_arraysFind(); + init_strings(); + init_cursorColumns(); + init_range(); + init_textModelPart(); + init_utils4(); + init_textModelGuides(); + init_errors(); + GuidesTextModelPart = class extends TextModelPart { + constructor(textModel, languageConfigurationService) { + super(); + this.textModel = textModel; + this.languageConfigurationService = languageConfigurationService; + } + getLanguageConfiguration(languageId) { + return this.languageConfigurationService.getLanguageConfiguration(languageId); + } + _computeIndentLevel(lineIndex) { + return computeIndentLevel(this.textModel.getLineContent(lineIndex + 1), this.textModel.getOptions().tabSize); + } + getActiveIndentGuide(lineNumber, minLineNumber, maxLineNumber) { + this.assertNotDisposed(); + const lineCount = this.textModel.getLineCount(); + if (lineNumber < 1 || lineNumber > lineCount) { + throw new BugIndicatingError("Illegal value for lineNumber"); + } + const foldingRules = this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules; + const offSide = Boolean(foldingRules && foldingRules.offSide); + let up_aboveContentLineIndex = -2; + let up_aboveContentLineIndent = -1; + let up_belowContentLineIndex = -2; + let up_belowContentLineIndent = -1; + const up_resolveIndents = (lineNumber2) => { + if (up_aboveContentLineIndex !== -1 && (up_aboveContentLineIndex === -2 || up_aboveContentLineIndex > lineNumber2 - 1)) { + up_aboveContentLineIndex = -1; + up_aboveContentLineIndent = -1; + for (let lineIndex = lineNumber2 - 2; lineIndex >= 0; lineIndex--) { + const indent2 = this._computeIndentLevel(lineIndex); + if (indent2 >= 0) { + up_aboveContentLineIndex = lineIndex; + up_aboveContentLineIndent = indent2; + break; + } + } + } + if (up_belowContentLineIndex === -2) { + up_belowContentLineIndex = -1; + up_belowContentLineIndent = -1; + for (let lineIndex = lineNumber2; lineIndex < lineCount; lineIndex++) { + const indent2 = this._computeIndentLevel(lineIndex); + if (indent2 >= 0) { + up_belowContentLineIndex = lineIndex; + up_belowContentLineIndent = indent2; + break; + } + } + } + }; + let down_aboveContentLineIndex = -2; + let down_aboveContentLineIndent = -1; + let down_belowContentLineIndex = -2; + let down_belowContentLineIndent = -1; + const down_resolveIndents = (lineNumber2) => { + if (down_aboveContentLineIndex === -2) { + down_aboveContentLineIndex = -1; + down_aboveContentLineIndent = -1; + for (let lineIndex = lineNumber2 - 2; lineIndex >= 0; lineIndex--) { + const indent2 = this._computeIndentLevel(lineIndex); + if (indent2 >= 0) { + down_aboveContentLineIndex = lineIndex; + down_aboveContentLineIndent = indent2; + break; + } + } + } + if (down_belowContentLineIndex !== -1 && (down_belowContentLineIndex === -2 || down_belowContentLineIndex < lineNumber2 - 1)) { + down_belowContentLineIndex = -1; + down_belowContentLineIndent = -1; + for (let lineIndex = lineNumber2; lineIndex < lineCount; lineIndex++) { + const indent2 = this._computeIndentLevel(lineIndex); + if (indent2 >= 0) { + down_belowContentLineIndex = lineIndex; + down_belowContentLineIndent = indent2; + break; + } + } + } + }; + let startLineNumber = 0; + let goUp = true; + let endLineNumber = 0; + let goDown = true; + let indent = 0; + let initialIndent = 0; + for (let distance = 0; goUp || goDown; distance++) { + const upLineNumber = lineNumber - distance; + const downLineNumber = lineNumber + distance; + if (distance > 1 && (upLineNumber < 1 || upLineNumber < minLineNumber)) { + goUp = false; + } + if (distance > 1 && (downLineNumber > lineCount || downLineNumber > maxLineNumber)) { + goDown = false; + } + if (distance > 5e4) { + goUp = false; + goDown = false; + } + let upLineIndentLevel = -1; + if (goUp && upLineNumber >= 1) { + const currentIndent = this._computeIndentLevel(upLineNumber - 1); + if (currentIndent >= 0) { + up_belowContentLineIndex = upLineNumber - 1; + up_belowContentLineIndent = currentIndent; + upLineIndentLevel = Math.ceil(currentIndent / this.textModel.getOptions().indentSize); + } else { + up_resolveIndents(upLineNumber); + upLineIndentLevel = this._getIndentLevelForWhitespaceLine(offSide, up_aboveContentLineIndent, up_belowContentLineIndent); + } + } + let downLineIndentLevel = -1; + if (goDown && downLineNumber <= lineCount) { + const currentIndent = this._computeIndentLevel(downLineNumber - 1); + if (currentIndent >= 0) { + down_aboveContentLineIndex = downLineNumber - 1; + down_aboveContentLineIndent = currentIndent; + downLineIndentLevel = Math.ceil(currentIndent / this.textModel.getOptions().indentSize); + } else { + down_resolveIndents(downLineNumber); + downLineIndentLevel = this._getIndentLevelForWhitespaceLine(offSide, down_aboveContentLineIndent, down_belowContentLineIndent); + } + } + if (distance === 0) { + initialIndent = upLineIndentLevel; + continue; + } + if (distance === 1) { + if (downLineNumber <= lineCount && downLineIndentLevel >= 0 && initialIndent + 1 === downLineIndentLevel) { + goUp = false; + startLineNumber = downLineNumber; + endLineNumber = downLineNumber; + indent = downLineIndentLevel; + continue; + } + if (upLineNumber >= 1 && upLineIndentLevel >= 0 && upLineIndentLevel - 1 === initialIndent) { + goDown = false; + startLineNumber = upLineNumber; + endLineNumber = upLineNumber; + indent = upLineIndentLevel; + continue; + } + startLineNumber = lineNumber; + endLineNumber = lineNumber; + indent = initialIndent; + if (indent === 0) { + return { startLineNumber, endLineNumber, indent }; + } + } + if (goUp) { + if (upLineIndentLevel >= indent) { + startLineNumber = upLineNumber; + } else { + goUp = false; + } + } + if (goDown) { + if (downLineIndentLevel >= indent) { + endLineNumber = downLineNumber; + } else { + goDown = false; + } + } + } + return { startLineNumber, endLineNumber, indent }; + } + getLinesBracketGuides(startLineNumber, endLineNumber, activePosition, options2) { + const result = []; + for (let lineNumber = startLineNumber; lineNumber <= endLineNumber; lineNumber++) { + result.push([]); + } + const includeSingleLinePairs = true; + const bracketPairs = this.textModel.bracketPairs.getBracketPairsInRangeWithMinIndentation(new Range(startLineNumber, 1, endLineNumber, this.textModel.getLineMaxColumn(endLineNumber))).toArray(); + let activeBracketPairRange = void 0; + if (activePosition && bracketPairs.length > 0) { + const bracketsContainingActivePosition = (startLineNumber <= activePosition.lineNumber && activePosition.lineNumber <= endLineNumber ? bracketPairs : this.textModel.bracketPairs.getBracketPairsInRange(Range.fromPositions(activePosition)).toArray()).filter((bp) => Range.strictContainsPosition(bp.range, activePosition)); + activeBracketPairRange = findLast(bracketsContainingActivePosition, (i2) => includeSingleLinePairs || i2.range.startLineNumber !== i2.range.endLineNumber)?.range; + } + const independentColorPoolPerBracketType = this.textModel.getOptions().bracketPairColorizationOptions.independentColorPoolPerBracketType; + const colorProvider = new BracketPairGuidesClassNames(); + for (const pair of bracketPairs) { + if (!pair.closingBracketRange) { + continue; + } + const isActive = activeBracketPairRange && pair.range.equalsRange(activeBracketPairRange); + if (!isActive && !options2.includeInactive) { + continue; + } + const className2 = colorProvider.getInlineClassName(pair.nestingLevel, pair.nestingLevelOfEqualBracketType, independentColorPoolPerBracketType) + (options2.highlightActive && isActive ? " " + colorProvider.activeClassName : ""); + const start = pair.openingBracketRange.getStartPosition(); + const end = pair.closingBracketRange.getStartPosition(); + const horizontalGuides = options2.horizontalGuides === HorizontalGuidesState.Enabled || options2.horizontalGuides === HorizontalGuidesState.EnabledForActive && isActive; + if (pair.range.startLineNumber === pair.range.endLineNumber) { + if (includeSingleLinePairs && horizontalGuides) { + result[pair.range.startLineNumber - startLineNumber].push(new IndentGuide(-1, pair.openingBracketRange.getEndPosition().column, className2, new IndentGuideHorizontalLine(false, end.column), -1, -1)); + } + continue; + } + const endVisibleColumn = this.getVisibleColumnFromPosition(end); + const startVisibleColumn = this.getVisibleColumnFromPosition(pair.openingBracketRange.getStartPosition()); + const guideVisibleColumn = Math.min(startVisibleColumn, endVisibleColumn, pair.minVisibleColumnIndentation + 1); + let renderHorizontalEndLineAtTheBottom = false; + const firstNonWsIndex = firstNonWhitespaceIndex(this.textModel.getLineContent(pair.closingBracketRange.startLineNumber)); + const hasTextBeforeClosingBracket = firstNonWsIndex < pair.closingBracketRange.startColumn - 1; + if (hasTextBeforeClosingBracket) { + renderHorizontalEndLineAtTheBottom = true; + } + const visibleGuideStartLineNumber = Math.max(start.lineNumber, startLineNumber); + const visibleGuideEndLineNumber = Math.min(end.lineNumber, endLineNumber); + const offset = renderHorizontalEndLineAtTheBottom ? 1 : 0; + for (let l = visibleGuideStartLineNumber; l < visibleGuideEndLineNumber + offset; l++) { + result[l - startLineNumber].push(new IndentGuide(guideVisibleColumn, -1, className2, null, l === start.lineNumber ? start.column : -1, l === end.lineNumber ? end.column : -1)); + } + if (horizontalGuides) { + if (start.lineNumber >= startLineNumber && startVisibleColumn > guideVisibleColumn) { + result[start.lineNumber - startLineNumber].push(new IndentGuide(guideVisibleColumn, -1, className2, new IndentGuideHorizontalLine(false, start.column), -1, -1)); + } + if (end.lineNumber <= endLineNumber && endVisibleColumn > guideVisibleColumn) { + result[end.lineNumber - startLineNumber].push(new IndentGuide(guideVisibleColumn, -1, className2, new IndentGuideHorizontalLine(!renderHorizontalEndLineAtTheBottom, end.column), -1, -1)); + } + } + } + for (const guides of result) { + guides.sort((a, b) => a.visibleColumn - b.visibleColumn); + } + return result; + } + getVisibleColumnFromPosition(position) { + return CursorColumns.visibleColumnFromColumn(this.textModel.getLineContent(position.lineNumber), position.column, this.textModel.getOptions().tabSize) + 1; + } + getLinesIndentGuides(startLineNumber, endLineNumber) { + this.assertNotDisposed(); + const lineCount = this.textModel.getLineCount(); + if (startLineNumber < 1 || startLineNumber > lineCount) { + throw new Error("Illegal value for startLineNumber"); + } + if (endLineNumber < 1 || endLineNumber > lineCount) { + throw new Error("Illegal value for endLineNumber"); + } + const options2 = this.textModel.getOptions(); + const foldingRules = this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules; + const offSide = Boolean(foldingRules && foldingRules.offSide); + const result = new Array(endLineNumber - startLineNumber + 1); + let aboveContentLineIndex = -2; + let aboveContentLineIndent = -1; + let belowContentLineIndex = -2; + let belowContentLineIndent = -1; + for (let lineNumber = startLineNumber; lineNumber <= endLineNumber; lineNumber++) { + const resultIndex = lineNumber - startLineNumber; + const currentIndent = this._computeIndentLevel(lineNumber - 1); + if (currentIndent >= 0) { + aboveContentLineIndex = lineNumber - 1; + aboveContentLineIndent = currentIndent; + result[resultIndex] = Math.ceil(currentIndent / options2.indentSize); + continue; + } + if (aboveContentLineIndex === -2) { + aboveContentLineIndex = -1; + aboveContentLineIndent = -1; + for (let lineIndex = lineNumber - 2; lineIndex >= 0; lineIndex--) { + const indent = this._computeIndentLevel(lineIndex); + if (indent >= 0) { + aboveContentLineIndex = lineIndex; + aboveContentLineIndent = indent; + break; + } + } + } + if (belowContentLineIndex !== -1 && (belowContentLineIndex === -2 || belowContentLineIndex < lineNumber - 1)) { + belowContentLineIndex = -1; + belowContentLineIndent = -1; + for (let lineIndex = lineNumber; lineIndex < lineCount; lineIndex++) { + const indent = this._computeIndentLevel(lineIndex); + if (indent >= 0) { + belowContentLineIndex = lineIndex; + belowContentLineIndent = indent; + break; + } + } + } + result[resultIndex] = this._getIndentLevelForWhitespaceLine(offSide, aboveContentLineIndent, belowContentLineIndent); + } + return result; + } + _getIndentLevelForWhitespaceLine(offSide, aboveContentLineIndent, belowContentLineIndent) { + const options2 = this.textModel.getOptions(); + if (aboveContentLineIndent === -1 || belowContentLineIndent === -1) { + return 0; + } else if (aboveContentLineIndent < belowContentLineIndent) { + return 1 + Math.floor(aboveContentLineIndent / options2.indentSize); + } else if (aboveContentLineIndent === belowContentLineIndent) { + return Math.ceil(belowContentLineIndent / options2.indentSize); + } else { + if (offSide) { + return Math.ceil(belowContentLineIndent / options2.indentSize); + } else { + return 1 + Math.floor(belowContentLineIndent / options2.indentSize); + } + } + } + }; + BracketPairGuidesClassNames = class { + constructor() { + this.activeClassName = "indent-active"; + } + getInlineClassName(nestingLevel, nestingLevelOfEqualBracketType, independentColorPoolPerBracketType) { + return this.getInlineClassNameOfLevel(independentColorPoolPerBracketType ? nestingLevelOfEqualBracketType : nestingLevel); + } + getInlineClassNameOfLevel(level) { + return `bracket-indent-guide lvl-${level % 30}`; + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/common/tokenizationRegistry.js +var TokenizationRegistry, TokenizationSupportFactoryData; +var init_tokenizationRegistry = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/common/tokenizationRegistry.js"() { + init_event(); + init_lifecycle(); + TokenizationRegistry = class { + constructor() { + this._tokenizationSupports = /* @__PURE__ */ new Map(); + this._factories = /* @__PURE__ */ new Map(); + this._onDidChange = new Emitter(); + this.onDidChange = this._onDidChange.event; + this._colorMap = null; + } + handleChange(languageIds) { + this._onDidChange.fire({ + changedLanguages: languageIds, + changedColorMap: false + }); + } + register(languageId, support) { + this._tokenizationSupports.set(languageId, support); + this.handleChange([languageId]); + return toDisposable(() => { + if (this._tokenizationSupports.get(languageId) !== support) { + return; + } + this._tokenizationSupports.delete(languageId); + this.handleChange([languageId]); + }); + } + get(languageId) { + return this._tokenizationSupports.get(languageId) || null; + } + registerFactory(languageId, factory) { + this._factories.get(languageId)?.dispose(); + const myData = new TokenizationSupportFactoryData(this, languageId, factory); + this._factories.set(languageId, myData); + return toDisposable(() => { + const v = this._factories.get(languageId); + if (!v || v !== myData) { + return; + } + this._factories.delete(languageId); + v.dispose(); + }); + } + async getOrCreate(languageId) { + const tokenizationSupport = this.get(languageId); + if (tokenizationSupport) { + return tokenizationSupport; + } + const factory = this._factories.get(languageId); + if (!factory || factory.isResolved) { + return null; + } + await factory.resolve(); + return this.get(languageId); + } + isResolved(languageId) { + const tokenizationSupport = this.get(languageId); + if (tokenizationSupport) { + return true; + } + const factory = this._factories.get(languageId); + if (!factory || factory.isResolved) { + return true; + } + return false; + } + setColorMap(colorMap) { + this._colorMap = colorMap; + this._onDidChange.fire({ + changedLanguages: Array.from(this._tokenizationSupports.keys()), + changedColorMap: true + }); + } + getColorMap() { + return this._colorMap; + } + getDefaultBackground() { + if (this._colorMap && this._colorMap.length > 2) { + return this._colorMap[ + 2 + /* ColorId.DefaultBackground */ + ]; + } + return null; + } + }; + TokenizationSupportFactoryData = class extends Disposable { + get isResolved() { + return this._isResolved; + } + constructor(_registry2, _languageId, _factory) { + super(); + this._registry = _registry2; + this._languageId = _languageId; + this._factory = _factory; + this._isDisposed = false; + this._resolvePromise = null; + this._isResolved = false; + } + dispose() { + this._isDisposed = true; + super.dispose(); + } + async resolve() { + if (!this._resolvePromise) { + this._resolvePromise = this._create(); + } + return this._resolvePromise; + } + async _create() { + const value = await this._factory.tokenizationSupport; + this._isResolved = true; + if (value && !this._isDisposed) { + this._register(this._registry.register(this._languageId, value)); + } + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/common/languages.js +function isLocationLink(thing) { + return !!thing && URI.isUri(thing.uri) && Range.isIRange(thing.range) && (Range.isIRange(thing.originSelectionRange) || Range.isIRange(thing.targetSelectionRange)); +} +function getAriaLabelForSymbol(symbolName, kind) { + return localize(783, "{0} ({1})", symbolName, symbolKindNames[kind]); +} +var Token, TokenizationResult, EncodedTokenizationResult, HoverVerbosityAction, CompletionItemKinds, InlineCompletionTriggerKind, SelectedSuggestionInfo, InlineCompletionHintStyle, ProviderId, InlineCompletionEndOfLifeReasonKind, DocumentPasteTriggerKind, SignatureHelpTriggerKind, DocumentHighlightKind, symbolKindNames, SymbolKinds, FoldingRangeKind, NewSymbolNameTag, NewSymbolNameTriggerKind, Command2, InlayHintKind, LazyTokenizationSupport, TokenizationRegistry2; +var init_languages = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/common/languages.js"() { + init_codicons(); + init_uri(); + init_range(); + init_tokenizationRegistry(); + init_nls(); + Token = class { + constructor(offset, type, language2) { + this.offset = offset; + this.type = type; + this.language = language2; + this._tokenBrand = void 0; + } + toString() { + return "(" + this.offset + ", " + this.type + ")"; + } + }; + TokenizationResult = class { + constructor(tokens, endState) { + this.tokens = tokens; + this.endState = endState; + this._tokenizationResultBrand = void 0; + } + }; + EncodedTokenizationResult = class { + constructor(tokens, endState) { + this.tokens = tokens; + this.endState = endState; + this._encodedTokenizationResultBrand = void 0; + } + }; + (function(HoverVerbosityAction3) { + HoverVerbosityAction3[HoverVerbosityAction3["Increase"] = 0] = "Increase"; + HoverVerbosityAction3[HoverVerbosityAction3["Decrease"] = 1] = "Decrease"; + })(HoverVerbosityAction || (HoverVerbosityAction = {})); + (function(CompletionItemKinds2) { + const byKind = /* @__PURE__ */ new Map(); + byKind.set(0, Codicon.symbolMethod); + byKind.set(1, Codicon.symbolFunction); + byKind.set(2, Codicon.symbolConstructor); + byKind.set(3, Codicon.symbolField); + byKind.set(4, Codicon.symbolVariable); + byKind.set(5, Codicon.symbolClass); + byKind.set(6, Codicon.symbolStruct); + byKind.set(7, Codicon.symbolInterface); + byKind.set(8, Codicon.symbolModule); + byKind.set(9, Codicon.symbolProperty); + byKind.set(10, Codicon.symbolEvent); + byKind.set(11, Codicon.symbolOperator); + byKind.set(12, Codicon.symbolUnit); + byKind.set(13, Codicon.symbolValue); + byKind.set(15, Codicon.symbolEnum); + byKind.set(14, Codicon.symbolConstant); + byKind.set(15, Codicon.symbolEnum); + byKind.set(16, Codicon.symbolEnumMember); + byKind.set(17, Codicon.symbolKeyword); + byKind.set(28, Codicon.symbolSnippet); + byKind.set(18, Codicon.symbolText); + byKind.set(19, Codicon.symbolColor); + byKind.set(20, Codicon.symbolFile); + byKind.set(21, Codicon.symbolReference); + byKind.set(22, Codicon.symbolCustomColor); + byKind.set(23, Codicon.symbolFolder); + byKind.set(24, Codicon.symbolTypeParameter); + byKind.set(25, Codicon.account); + byKind.set(26, Codicon.issues); + byKind.set(27, Codicon.tools); + function toIcon(kind) { + let codicon = byKind.get(kind); + if (!codicon) { + console.info("No codicon found for CompletionItemKind " + kind); + codicon = Codicon.symbolProperty; + } + return codicon; + } + CompletionItemKinds2.toIcon = toIcon; + function toLabel(kind) { + switch (kind) { + case 0: + return localize(728, "Method"); + case 1: + return localize(729, "Function"); + case 2: + return localize(730, "Constructor"); + case 3: + return localize(731, "Field"); + case 4: + return localize(732, "Variable"); + case 5: + return localize(733, "Class"); + case 6: + return localize(734, "Struct"); + case 7: + return localize(735, "Interface"); + case 8: + return localize(736, "Module"); + case 9: + return localize(737, "Property"); + case 10: + return localize(738, "Event"); + case 11: + return localize(739, "Operator"); + case 12: + return localize(740, "Unit"); + case 13: + return localize(741, "Value"); + case 14: + return localize(742, "Constant"); + case 15: + return localize(743, "Enum"); + case 16: + return localize(744, "Enum Member"); + case 17: + return localize(745, "Keyword"); + case 18: + return localize(746, "Text"); + case 19: + return localize(747, "Color"); + case 20: + return localize(748, "File"); + case 21: + return localize(749, "Reference"); + case 22: + return localize(750, "Custom Color"); + case 23: + return localize(751, "Folder"); + case 24: + return localize(752, "Type Parameter"); + case 25: + return localize(753, "User"); + case 26: + return localize(754, "Issue"); + case 27: + return localize(755, "Tool"); + case 28: + return localize(756, "Snippet"); + default: + return ""; + } + } + CompletionItemKinds2.toLabel = toLabel; + const data = /* @__PURE__ */ new Map(); + data.set( + "method", + 0 + /* CompletionItemKind.Method */ + ); + data.set( + "function", + 1 + /* CompletionItemKind.Function */ + ); + data.set( + "constructor", + 2 + /* CompletionItemKind.Constructor */ + ); + data.set( + "field", + 3 + /* CompletionItemKind.Field */ + ); + data.set( + "variable", + 4 + /* CompletionItemKind.Variable */ + ); + data.set( + "class", + 5 + /* CompletionItemKind.Class */ + ); + data.set( + "struct", + 6 + /* CompletionItemKind.Struct */ + ); + data.set( + "interface", + 7 + /* CompletionItemKind.Interface */ + ); + data.set( + "module", + 8 + /* CompletionItemKind.Module */ + ); + data.set( + "property", + 9 + /* CompletionItemKind.Property */ + ); + data.set( + "event", + 10 + /* CompletionItemKind.Event */ + ); + data.set( + "operator", + 11 + /* CompletionItemKind.Operator */ + ); + data.set( + "unit", + 12 + /* CompletionItemKind.Unit */ + ); + data.set( + "value", + 13 + /* CompletionItemKind.Value */ + ); + data.set( + "constant", + 14 + /* CompletionItemKind.Constant */ + ); + data.set( + "enum", + 15 + /* CompletionItemKind.Enum */ + ); + data.set( + "enum-member", + 16 + /* CompletionItemKind.EnumMember */ + ); + data.set( + "enumMember", + 16 + /* CompletionItemKind.EnumMember */ + ); + data.set( + "keyword", + 17 + /* CompletionItemKind.Keyword */ + ); + data.set( + "snippet", + 28 + /* CompletionItemKind.Snippet */ + ); + data.set( + "text", + 18 + /* CompletionItemKind.Text */ + ); + data.set( + "color", + 19 + /* CompletionItemKind.Color */ + ); + data.set( + "file", + 20 + /* CompletionItemKind.File */ + ); + data.set( + "reference", + 21 + /* CompletionItemKind.Reference */ + ); + data.set( + "customcolor", + 22 + /* CompletionItemKind.Customcolor */ + ); + data.set( + "folder", + 23 + /* CompletionItemKind.Folder */ + ); + data.set( + "type-parameter", + 24 + /* CompletionItemKind.TypeParameter */ + ); + data.set( + "typeParameter", + 24 + /* CompletionItemKind.TypeParameter */ + ); + data.set( + "account", + 25 + /* CompletionItemKind.User */ + ); + data.set( + "issue", + 26 + /* CompletionItemKind.Issue */ + ); + data.set( + "tool", + 27 + /* CompletionItemKind.Tool */ + ); + function fromString(value, strict) { + let res = data.get(value); + if (typeof res === "undefined" && !strict) { + res = 9; + } + return res; + } + CompletionItemKinds2.fromString = fromString; + })(CompletionItemKinds || (CompletionItemKinds = {})); + (function(InlineCompletionTriggerKind3) { + InlineCompletionTriggerKind3[InlineCompletionTriggerKind3["Automatic"] = 0] = "Automatic"; + InlineCompletionTriggerKind3[InlineCompletionTriggerKind3["Explicit"] = 1] = "Explicit"; + })(InlineCompletionTriggerKind || (InlineCompletionTriggerKind = {})); + SelectedSuggestionInfo = class { + constructor(range2, text2, completionKind, isSnippetText) { + this.range = range2; + this.text = text2; + this.completionKind = completionKind; + this.isSnippetText = isSnippetText; + } + equals(other) { + return Range.lift(this.range).equalsRange(other.range) && this.text === other.text && this.completionKind === other.completionKind && this.isSnippetText === other.isSnippetText; + } + }; + (function(InlineCompletionHintStyle3) { + InlineCompletionHintStyle3[InlineCompletionHintStyle3["Code"] = 1] = "Code"; + InlineCompletionHintStyle3[InlineCompletionHintStyle3["Label"] = 2] = "Label"; + })(InlineCompletionHintStyle || (InlineCompletionHintStyle = {})); + ProviderId = class _ProviderId { + static fromExtensionId(extensionId) { + return new _ProviderId(extensionId, void 0, void 0); + } + constructor(extensionId, extensionVersion, providerId) { + this.extensionId = extensionId; + this.extensionVersion = extensionVersion; + this.providerId = providerId; + } + toString() { + let result = ""; + if (this.extensionId) { + result += this.extensionId; + } + if (this.extensionVersion) { + result += `@${this.extensionVersion}`; + } + if (this.providerId) { + result += `:${this.providerId}`; + } + if (result.length === 0) { + result = "unknown"; + } + return result; + } + toStringWithoutVersion() { + let result = ""; + if (this.extensionId) { + result += this.extensionId; + } + if (this.providerId) { + result += `:${this.providerId}`; + } + return result; + } + }; + (function(InlineCompletionEndOfLifeReasonKind3) { + InlineCompletionEndOfLifeReasonKind3[InlineCompletionEndOfLifeReasonKind3["Accepted"] = 0] = "Accepted"; + InlineCompletionEndOfLifeReasonKind3[InlineCompletionEndOfLifeReasonKind3["Rejected"] = 1] = "Rejected"; + InlineCompletionEndOfLifeReasonKind3[InlineCompletionEndOfLifeReasonKind3["Ignored"] = 2] = "Ignored"; + })(InlineCompletionEndOfLifeReasonKind || (InlineCompletionEndOfLifeReasonKind = {})); + (function(DocumentPasteTriggerKind2) { + DocumentPasteTriggerKind2[DocumentPasteTriggerKind2["Automatic"] = 0] = "Automatic"; + DocumentPasteTriggerKind2[DocumentPasteTriggerKind2["PasteAs"] = 1] = "PasteAs"; + })(DocumentPasteTriggerKind || (DocumentPasteTriggerKind = {})); + (function(SignatureHelpTriggerKind3) { + SignatureHelpTriggerKind3[SignatureHelpTriggerKind3["Invoke"] = 1] = "Invoke"; + SignatureHelpTriggerKind3[SignatureHelpTriggerKind3["TriggerCharacter"] = 2] = "TriggerCharacter"; + SignatureHelpTriggerKind3[SignatureHelpTriggerKind3["ContentChange"] = 3] = "ContentChange"; + })(SignatureHelpTriggerKind || (SignatureHelpTriggerKind = {})); + (function(DocumentHighlightKind3) { + DocumentHighlightKind3[DocumentHighlightKind3["Text"] = 0] = "Text"; + DocumentHighlightKind3[DocumentHighlightKind3["Read"] = 1] = "Read"; + DocumentHighlightKind3[DocumentHighlightKind3["Write"] = 2] = "Write"; + })(DocumentHighlightKind || (DocumentHighlightKind = {})); + symbolKindNames = { + [ + 17 + /* SymbolKind.Array */ + ]: localize(757, "array"), + [ + 16 + /* SymbolKind.Boolean */ + ]: localize(758, "boolean"), + [ + 4 + /* SymbolKind.Class */ + ]: localize(759, "class"), + [ + 13 + /* SymbolKind.Constant */ + ]: localize(760, "constant"), + [ + 8 + /* SymbolKind.Constructor */ + ]: localize(761, "constructor"), + [ + 9 + /* SymbolKind.Enum */ + ]: localize(762, "enumeration"), + [ + 21 + /* SymbolKind.EnumMember */ + ]: localize(763, "enumeration member"), + [ + 23 + /* SymbolKind.Event */ + ]: localize(764, "event"), + [ + 7 + /* SymbolKind.Field */ + ]: localize(765, "field"), + [ + 0 + /* SymbolKind.File */ + ]: localize(766, "file"), + [ + 11 + /* SymbolKind.Function */ + ]: localize(767, "function"), + [ + 10 + /* SymbolKind.Interface */ + ]: localize(768, "interface"), + [ + 19 + /* SymbolKind.Key */ + ]: localize(769, "key"), + [ + 5 + /* SymbolKind.Method */ + ]: localize(770, "method"), + [ + 1 + /* SymbolKind.Module */ + ]: localize(771, "module"), + [ + 2 + /* SymbolKind.Namespace */ + ]: localize(772, "namespace"), + [ + 20 + /* SymbolKind.Null */ + ]: localize(773, "null"), + [ + 15 + /* SymbolKind.Number */ + ]: localize(774, "number"), + [ + 18 + /* SymbolKind.Object */ + ]: localize(775, "object"), + [ + 24 + /* SymbolKind.Operator */ + ]: localize(776, "operator"), + [ + 3 + /* SymbolKind.Package */ + ]: localize(777, "package"), + [ + 6 + /* SymbolKind.Property */ + ]: localize(778, "property"), + [ + 14 + /* SymbolKind.String */ + ]: localize(779, "string"), + [ + 22 + /* SymbolKind.Struct */ + ]: localize(780, "struct"), + [ + 25 + /* SymbolKind.TypeParameter */ + ]: localize(781, "type parameter"), + [ + 12 + /* SymbolKind.Variable */ + ]: localize(782, "variable") + }; + (function(SymbolKinds2) { + const byKind = /* @__PURE__ */ new Map(); + byKind.set(0, Codicon.symbolFile); + byKind.set(1, Codicon.symbolModule); + byKind.set(2, Codicon.symbolNamespace); + byKind.set(3, Codicon.symbolPackage); + byKind.set(4, Codicon.symbolClass); + byKind.set(5, Codicon.symbolMethod); + byKind.set(6, Codicon.symbolProperty); + byKind.set(7, Codicon.symbolField); + byKind.set(8, Codicon.symbolConstructor); + byKind.set(9, Codicon.symbolEnum); + byKind.set(10, Codicon.symbolInterface); + byKind.set(11, Codicon.symbolFunction); + byKind.set(12, Codicon.symbolVariable); + byKind.set(13, Codicon.symbolConstant); + byKind.set(14, Codicon.symbolString); + byKind.set(15, Codicon.symbolNumber); + byKind.set(16, Codicon.symbolBoolean); + byKind.set(17, Codicon.symbolArray); + byKind.set(18, Codicon.symbolObject); + byKind.set(19, Codicon.symbolKey); + byKind.set(20, Codicon.symbolNull); + byKind.set(21, Codicon.symbolEnumMember); + byKind.set(22, Codicon.symbolStruct); + byKind.set(23, Codicon.symbolEvent); + byKind.set(24, Codicon.symbolOperator); + byKind.set(25, Codicon.symbolTypeParameter); + function toIcon(kind) { + let icon = byKind.get(kind); + if (!icon) { + console.info("No codicon found for SymbolKind " + kind); + icon = Codicon.symbolProperty; + } + return icon; + } + SymbolKinds2.toIcon = toIcon; + const byCompletionKind = /* @__PURE__ */ new Map(); + byCompletionKind.set( + 0, + 20 + /* CompletionItemKind.File */ + ); + byCompletionKind.set( + 1, + 8 + /* CompletionItemKind.Module */ + ); + byCompletionKind.set( + 2, + 8 + /* CompletionItemKind.Module */ + ); + byCompletionKind.set( + 3, + 8 + /* CompletionItemKind.Module */ + ); + byCompletionKind.set( + 4, + 5 + /* CompletionItemKind.Class */ + ); + byCompletionKind.set( + 5, + 0 + /* CompletionItemKind.Method */ + ); + byCompletionKind.set( + 6, + 9 + /* CompletionItemKind.Property */ + ); + byCompletionKind.set( + 7, + 3 + /* CompletionItemKind.Field */ + ); + byCompletionKind.set( + 8, + 2 + /* CompletionItemKind.Constructor */ + ); + byCompletionKind.set( + 9, + 15 + /* CompletionItemKind.Enum */ + ); + byCompletionKind.set( + 10, + 7 + /* CompletionItemKind.Interface */ + ); + byCompletionKind.set( + 11, + 1 + /* CompletionItemKind.Function */ + ); + byCompletionKind.set( + 12, + 4 + /* CompletionItemKind.Variable */ + ); + byCompletionKind.set( + 13, + 14 + /* CompletionItemKind.Constant */ + ); + byCompletionKind.set( + 14, + 18 + /* CompletionItemKind.Text */ + ); + byCompletionKind.set( + 15, + 13 + /* CompletionItemKind.Value */ + ); + byCompletionKind.set( + 16, + 13 + /* CompletionItemKind.Value */ + ); + byCompletionKind.set( + 17, + 13 + /* CompletionItemKind.Value */ + ); + byCompletionKind.set( + 18, + 13 + /* CompletionItemKind.Value */ + ); + byCompletionKind.set( + 19, + 17 + /* CompletionItemKind.Keyword */ + ); + byCompletionKind.set( + 20, + 13 + /* CompletionItemKind.Value */ + ); + byCompletionKind.set( + 21, + 16 + /* CompletionItemKind.EnumMember */ + ); + byCompletionKind.set( + 22, + 6 + /* CompletionItemKind.Struct */ + ); + byCompletionKind.set( + 23, + 10 + /* CompletionItemKind.Event */ + ); + byCompletionKind.set( + 24, + 11 + /* CompletionItemKind.Operator */ + ); + byCompletionKind.set( + 25, + 24 + /* CompletionItemKind.TypeParameter */ + ); + function toCompletionKind(kind) { + let completionKind = byCompletionKind.get(kind); + if (completionKind === void 0) { + console.info("No completion kind found for SymbolKind " + kind); + completionKind = 20; + } + return completionKind; + } + SymbolKinds2.toCompletionKind = toCompletionKind; + })(SymbolKinds || (SymbolKinds = {})); + FoldingRangeKind = class _FoldingRangeKind { + static { + this.Comment = new _FoldingRangeKind("comment"); + } + static { + this.Imports = new _FoldingRangeKind("imports"); + } + static { + this.Region = new _FoldingRangeKind("region"); + } + /** + * Returns a {@link FoldingRangeKind} for the given value. + * + * @param value of the kind. + */ + static fromValue(value) { + switch (value) { + case "comment": + return _FoldingRangeKind.Comment; + case "imports": + return _FoldingRangeKind.Imports; + case "region": + return _FoldingRangeKind.Region; + } + return new _FoldingRangeKind(value); + } + /** + * Creates a new {@link FoldingRangeKind}. + * + * @param value of the kind. + */ + constructor(value) { + this.value = value; + } + }; + (function(NewSymbolNameTag3) { + NewSymbolNameTag3[NewSymbolNameTag3["AIGenerated"] = 1] = "AIGenerated"; + })(NewSymbolNameTag || (NewSymbolNameTag = {})); + (function(NewSymbolNameTriggerKind3) { + NewSymbolNameTriggerKind3[NewSymbolNameTriggerKind3["Invoke"] = 0] = "Invoke"; + NewSymbolNameTriggerKind3[NewSymbolNameTriggerKind3["Automatic"] = 1] = "Automatic"; + })(NewSymbolNameTriggerKind || (NewSymbolNameTriggerKind = {})); + (function(Command3) { + function is(obj) { + if (!obj || typeof obj !== "object") { + return false; + } + return typeof obj.id === "string" && typeof obj.title === "string"; + } + Command3.is = is; + })(Command2 || (Command2 = {})); + (function(InlayHintKind3) { + InlayHintKind3[InlayHintKind3["Type"] = 1] = "Type"; + InlayHintKind3[InlayHintKind3["Parameter"] = 2] = "Parameter"; + })(InlayHintKind || (InlayHintKind = {})); + LazyTokenizationSupport = class { + constructor(createSupport) { + this.createSupport = createSupport; + this._tokenizationSupport = null; + } + dispose() { + if (this._tokenizationSupport) { + this._tokenizationSupport.then((support) => { + if (support) { + support.dispose(); + } + }); + } + } + get tokenizationSupport() { + if (!this._tokenizationSupport) { + this._tokenizationSupport = this.createSupport(); + } + return this._tokenizationSupport; + } + }; + TokenizationRegistry2 = new TokenizationRegistry(); + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/common/core/ranges/lineRange.js +var LineRange, LineRangeSet; +var init_lineRange = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/common/core/ranges/lineRange.js"() { + init_errors(); + init_offsetRange(); + init_range(); + init_arraysFind(); + init_arrays(); + LineRange = class _LineRange { + static ofLength(startLineNumber, length) { + return new _LineRange(startLineNumber, startLineNumber + length); + } + static fromRange(range2) { + return new _LineRange(range2.startLineNumber, range2.endLineNumber); + } + static fromRangeInclusive(range2) { + return new _LineRange(range2.startLineNumber, range2.endLineNumber + 1); + } + static { + this.compareByStart = compareBy((l) => l.startLineNumber, numberComparator); + } + /** + * @param lineRanges An array of arrays of of sorted line ranges. + */ + static joinMany(lineRanges) { + if (lineRanges.length === 0) { + return []; + } + let result = new LineRangeSet(lineRanges[0].slice()); + for (let i2 = 1; i2 < lineRanges.length; i2++) { + result = result.getUnion(new LineRangeSet(lineRanges[i2].slice())); + } + return result.ranges; + } + static join(lineRanges) { + if (lineRanges.length === 0) { + throw new BugIndicatingError("lineRanges cannot be empty"); + } + let startLineNumber = lineRanges[0].startLineNumber; + let endLineNumberExclusive = lineRanges[0].endLineNumberExclusive; + for (let i2 = 1; i2 < lineRanges.length; i2++) { + startLineNumber = Math.min(startLineNumber, lineRanges[i2].startLineNumber); + endLineNumberExclusive = Math.max(endLineNumberExclusive, lineRanges[i2].endLineNumberExclusive); + } + return new _LineRange(startLineNumber, endLineNumberExclusive); + } + /** + * @internal + */ + static deserialize(lineRange) { + return new _LineRange(lineRange[0], lineRange[1]); + } + constructor(startLineNumber, endLineNumberExclusive) { + if (startLineNumber > endLineNumberExclusive) { + throw new BugIndicatingError(`startLineNumber ${startLineNumber} cannot be after endLineNumberExclusive ${endLineNumberExclusive}`); + } + this.startLineNumber = startLineNumber; + this.endLineNumberExclusive = endLineNumberExclusive; + } + /** + * Indicates if this line range contains the given line number. + */ + contains(lineNumber) { + return this.startLineNumber <= lineNumber && lineNumber < this.endLineNumberExclusive; + } + /** + * Indicates if this line range is empty. + */ + get isEmpty() { + return this.startLineNumber === this.endLineNumberExclusive; + } + /** + * Moves this line range by the given offset of line numbers. + */ + delta(offset) { + return new _LineRange(this.startLineNumber + offset, this.endLineNumberExclusive + offset); + } + deltaLength(offset) { + return new _LineRange(this.startLineNumber, this.endLineNumberExclusive + offset); + } + /** + * The number of lines this line range spans. + */ + get length() { + return this.endLineNumberExclusive - this.startLineNumber; + } + /** + * Creates a line range that combines this and the given line range. + */ + join(other) { + return new _LineRange(Math.min(this.startLineNumber, other.startLineNumber), Math.max(this.endLineNumberExclusive, other.endLineNumberExclusive)); + } + toString() { + return `[${this.startLineNumber},${this.endLineNumberExclusive})`; + } + /** + * The resulting range is empty if the ranges do not intersect, but touch. + * If the ranges don't even touch, the result is undefined. + */ + intersect(other) { + const startLineNumber = Math.max(this.startLineNumber, other.startLineNumber); + const endLineNumberExclusive = Math.min(this.endLineNumberExclusive, other.endLineNumberExclusive); + if (startLineNumber <= endLineNumberExclusive) { + return new _LineRange(startLineNumber, endLineNumberExclusive); + } + return void 0; + } + intersectsStrict(other) { + return this.startLineNumber < other.endLineNumberExclusive && other.startLineNumber < this.endLineNumberExclusive; + } + intersectsOrTouches(other) { + return this.startLineNumber <= other.endLineNumberExclusive && other.startLineNumber <= this.endLineNumberExclusive; + } + equals(b) { + return this.startLineNumber === b.startLineNumber && this.endLineNumberExclusive === b.endLineNumberExclusive; + } + toInclusiveRange() { + if (this.isEmpty) { + return null; + } + return new Range(this.startLineNumber, 1, this.endLineNumberExclusive - 1, Number.MAX_SAFE_INTEGER); + } + /** + * @deprecated Using this function is discouraged because it might lead to bugs: The end position is not guaranteed to be a valid position! + */ + toExclusiveRange() { + return new Range(this.startLineNumber, 1, this.endLineNumberExclusive, 1); + } + mapToLineArray(f) { + const result = []; + for (let lineNumber = this.startLineNumber; lineNumber < this.endLineNumberExclusive; lineNumber++) { + result.push(f(lineNumber)); + } + return result; + } + forEach(f) { + for (let lineNumber = this.startLineNumber; lineNumber < this.endLineNumberExclusive; lineNumber++) { + f(lineNumber); + } + } + /** + * @internal + */ + serialize() { + return [this.startLineNumber, this.endLineNumberExclusive]; + } + /** + * Converts this 1-based line range to a 0-based offset range (subtracts 1!). + * @internal + */ + toOffsetRange() { + return new OffsetRange(this.startLineNumber - 1, this.endLineNumberExclusive - 1); + } + addMargin(marginTop, marginBottom) { + return new _LineRange(this.startLineNumber - marginTop, this.endLineNumberExclusive + marginBottom); + } + }; + LineRangeSet = class _LineRangeSet { + constructor(_normalizedRanges = []) { + this._normalizedRanges = _normalizedRanges; + } + get ranges() { + return this._normalizedRanges; + } + addRange(range2) { + if (range2.length === 0) { + return; + } + const joinRangeStartIdx = findFirstIdxMonotonousOrArrLen(this._normalizedRanges, (r) => r.endLineNumberExclusive >= range2.startLineNumber); + const joinRangeEndIdxExclusive = findLastIdxMonotonous(this._normalizedRanges, (r) => r.startLineNumber <= range2.endLineNumberExclusive) + 1; + if (joinRangeStartIdx === joinRangeEndIdxExclusive) { + this._normalizedRanges.splice(joinRangeStartIdx, 0, range2); + } else if (joinRangeStartIdx === joinRangeEndIdxExclusive - 1) { + const joinRange = this._normalizedRanges[joinRangeStartIdx]; + this._normalizedRanges[joinRangeStartIdx] = joinRange.join(range2); + } else { + const joinRange = this._normalizedRanges[joinRangeStartIdx].join(this._normalizedRanges[joinRangeEndIdxExclusive - 1]).join(range2); + this._normalizedRanges.splice(joinRangeStartIdx, joinRangeEndIdxExclusive - joinRangeStartIdx, joinRange); + } + } + contains(lineNumber) { + const rangeThatStartsBeforeEnd = findLastMonotonous(this._normalizedRanges, (r) => r.startLineNumber <= lineNumber); + return !!rangeThatStartsBeforeEnd && rangeThatStartsBeforeEnd.endLineNumberExclusive > lineNumber; + } + intersects(range2) { + const rangeThatStartsBeforeEnd = findLastMonotonous(this._normalizedRanges, (r) => r.startLineNumber < range2.endLineNumberExclusive); + return !!rangeThatStartsBeforeEnd && rangeThatStartsBeforeEnd.endLineNumberExclusive > range2.startLineNumber; + } + getUnion(other) { + if (this._normalizedRanges.length === 0) { + return other; + } + if (other._normalizedRanges.length === 0) { + return this; + } + const result = []; + let i1 = 0; + let i2 = 0; + let current = null; + while (i1 < this._normalizedRanges.length || i2 < other._normalizedRanges.length) { + let next = null; + if (i1 < this._normalizedRanges.length && i2 < other._normalizedRanges.length) { + const lineRange1 = this._normalizedRanges[i1]; + const lineRange2 = other._normalizedRanges[i2]; + if (lineRange1.startLineNumber < lineRange2.startLineNumber) { + next = lineRange1; + i1++; + } else { + next = lineRange2; + i2++; + } + } else if (i1 < this._normalizedRanges.length) { + next = this._normalizedRanges[i1]; + i1++; + } else { + next = other._normalizedRanges[i2]; + i2++; + } + if (current === null) { + current = next; + } else { + if (current.endLineNumberExclusive >= next.startLineNumber) { + current = new LineRange(current.startLineNumber, Math.max(current.endLineNumberExclusive, next.endLineNumberExclusive)); + } else { + result.push(current); + current = next; + } + } + } + if (current !== null) { + result.push(current); + } + return new _LineRangeSet(result); + } + /** + * Subtracts all ranges in this set from `range` and returns the result. + */ + subtractFrom(range2) { + const joinRangeStartIdx = findFirstIdxMonotonousOrArrLen(this._normalizedRanges, (r) => r.endLineNumberExclusive >= range2.startLineNumber); + const joinRangeEndIdxExclusive = findLastIdxMonotonous(this._normalizedRanges, (r) => r.startLineNumber <= range2.endLineNumberExclusive) + 1; + if (joinRangeStartIdx === joinRangeEndIdxExclusive) { + return new _LineRangeSet([range2]); + } + const result = []; + let startLineNumber = range2.startLineNumber; + for (let i2 = joinRangeStartIdx; i2 < joinRangeEndIdxExclusive; i2++) { + const r = this._normalizedRanges[i2]; + if (r.startLineNumber > startLineNumber) { + result.push(new LineRange(startLineNumber, r.startLineNumber)); + } + startLineNumber = r.endLineNumberExclusive; + } + if (startLineNumber < range2.endLineNumberExclusive) { + result.push(new LineRange(startLineNumber, range2.endLineNumberExclusive)); + } + return new _LineRangeSet(result); + } + toString() { + return this._normalizedRanges.map((r) => r.toString()).join(", "); + } + getIntersection(other) { + const result = []; + let i1 = 0; + let i2 = 0; + while (i1 < this._normalizedRanges.length && i2 < other._normalizedRanges.length) { + const r1 = this._normalizedRanges[i1]; + const r2 = other._normalizedRanges[i2]; + const i3 = r1.intersect(r2); + if (i3 && !i3.isEmpty) { + result.push(i3); + } + if (r1.endLineNumberExclusive < r2.endLineNumberExclusive) { + i1++; + } else { + i2++; + } + } + return new _LineRangeSet(result); + } + getWithDelta(value) { + return new _LineRangeSet(this._normalizedRanges.map((r) => r.delta(value))); + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/common/core/text/textLength.js +var TextLength; +var init_textLength = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/common/core/text/textLength.js"() { + init_lineRange(); + init_position(); + init_range(); + TextLength = class _TextLength { + static { + this.zero = new _TextLength(0, 0); + } + static betweenPositions(position1, position2) { + if (position1.lineNumber === position2.lineNumber) { + return new _TextLength(0, position2.column - position1.column); + } else { + return new _TextLength(position2.lineNumber - position1.lineNumber, position2.column - 1); + } + } + static fromPosition(pos) { + return new _TextLength(pos.lineNumber - 1, pos.column - 1); + } + static ofRange(range2) { + return _TextLength.betweenPositions(range2.getStartPosition(), range2.getEndPosition()); + } + static ofText(text2) { + let line = 0; + let column = 0; + for (const c of text2) { + if (c === "\n") { + line++; + column = 0; + } else { + column++; + } + } + return new _TextLength(line, column); + } + constructor(lineCount, columnCount) { + this.lineCount = lineCount; + this.columnCount = columnCount; + } + isGreaterThanOrEqualTo(other) { + if (this.lineCount !== other.lineCount) { + return this.lineCount > other.lineCount; + } + return this.columnCount >= other.columnCount; + } + add(other) { + if (other.lineCount === 0) { + return new _TextLength(this.lineCount, this.columnCount + other.columnCount); + } else { + return new _TextLength(this.lineCount + other.lineCount, other.columnCount); + } + } + createRange(startPosition) { + if (this.lineCount === 0) { + return new Range(startPosition.lineNumber, startPosition.column, startPosition.lineNumber, startPosition.column + this.columnCount); + } else { + return new Range(startPosition.lineNumber, startPosition.column, startPosition.lineNumber + this.lineCount, this.columnCount + 1); + } + } + toRange() { + return new Range(1, 1, this.lineCount + 1, this.columnCount + 1); + } + toLineRange() { + return LineRange.ofLength(1, this.lineCount + 1); + } + addToPosition(position) { + if (this.lineCount === 0) { + return new Position(position.lineNumber, position.column + this.columnCount); + } else { + return new Position(position.lineNumber + this.lineCount, this.columnCount + 1); + } + } + toString() { + return `${this.lineCount},${this.columnCount}`; + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/common/textModelEvents.js +var ModelRawFlush, LineInjectedText, ModelRawLineChanged, ModelLineHeightChanged, ModelFontChanged, ModelRawLinesDeleted, ModelRawLinesInserted, ModelRawEOLChanged, ModelRawContentChangedEvent, ModelInjectedTextChangedEvent, ModelLineHeightChangedEvent, ModelFontChangedEvent, InternalModelContentChangeEvent; +var init_textModelEvents = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/common/textModelEvents.js"() { + ModelRawFlush = class { + constructor() { + this.changeType = 1; + } + }; + LineInjectedText = class _LineInjectedText { + static applyInjectedText(lineText, injectedTexts) { + if (!injectedTexts || injectedTexts.length === 0) { + return lineText; + } + let result = ""; + let lastOriginalOffset = 0; + for (const injectedText of injectedTexts) { + result += lineText.substring(lastOriginalOffset, injectedText.column - 1); + lastOriginalOffset = injectedText.column - 1; + result += injectedText.options.content; + } + result += lineText.substring(lastOriginalOffset); + return result; + } + static fromDecorations(decorations) { + const result = []; + for (const decoration3 of decorations) { + if (decoration3.options.before && decoration3.options.before.content.length > 0) { + result.push(new _LineInjectedText(decoration3.ownerId, decoration3.range.startLineNumber, decoration3.range.startColumn, decoration3.options.before, 0)); + } + if (decoration3.options.after && decoration3.options.after.content.length > 0) { + result.push(new _LineInjectedText(decoration3.ownerId, decoration3.range.endLineNumber, decoration3.range.endColumn, decoration3.options.after, 1)); + } + } + result.sort((a, b) => { + if (a.lineNumber === b.lineNumber) { + if (a.column === b.column) { + return a.order - b.order; + } + return a.column - b.column; + } + return a.lineNumber - b.lineNumber; + }); + return result; + } + constructor(ownerId2, lineNumber, column, options2, order) { + this.ownerId = ownerId2; + this.lineNumber = lineNumber; + this.column = column; + this.options = options2; + this.order = order; + } + }; + ModelRawLineChanged = class { + constructor(lineNumber, detail, injectedText) { + this.changeType = 2; + this.lineNumber = lineNumber; + this.detail = detail; + this.injectedText = injectedText; + } + }; + ModelLineHeightChanged = class { + constructor(ownerId2, decorationId, lineNumber, lineHeight) { + this.ownerId = ownerId2; + this.decorationId = decorationId; + this.lineNumber = lineNumber; + this.lineHeight = lineHeight; + } + }; + ModelFontChanged = class { + constructor(ownerId2, lineNumber) { + this.ownerId = ownerId2; + this.lineNumber = lineNumber; + } + }; + ModelRawLinesDeleted = class { + constructor(fromLineNumber, toLineNumber) { + this.changeType = 3; + this.fromLineNumber = fromLineNumber; + this.toLineNumber = toLineNumber; + } + }; + ModelRawLinesInserted = class { + constructor(fromLineNumber, toLineNumber, detail, injectedTexts) { + this.changeType = 4; + this.injectedTexts = injectedTexts; + this.fromLineNumber = fromLineNumber; + this.toLineNumber = toLineNumber; + this.detail = detail; + } + }; + ModelRawEOLChanged = class { + constructor() { + this.changeType = 5; + } + }; + ModelRawContentChangedEvent = class _ModelRawContentChangedEvent { + constructor(changes, versionId, isUndoing, isRedoing) { + this.changes = changes; + this.versionId = versionId; + this.isUndoing = isUndoing; + this.isRedoing = isRedoing; + this.resultingSelection = null; + } + containsEvent(type) { + for (let i2 = 0, len = this.changes.length; i2 < len; i2++) { + const change = this.changes[i2]; + if (change.changeType === type) { + return true; + } + } + return false; + } + static merge(a, b) { + const changes = [].concat(a.changes).concat(b.changes); + const versionId = b.versionId; + const isUndoing = a.isUndoing || b.isUndoing; + const isRedoing = a.isRedoing || b.isRedoing; + return new _ModelRawContentChangedEvent(changes, versionId, isUndoing, isRedoing); + } + }; + ModelInjectedTextChangedEvent = class { + constructor(changes) { + this.changes = changes; + } + }; + ModelLineHeightChangedEvent = class { + constructor(changes) { + this.changes = changes; + } + }; + ModelFontChangedEvent = class { + constructor(changes) { + this.changes = changes; + } + }; + InternalModelContentChangeEvent = class _InternalModelContentChangeEvent { + constructor(rawContentChangedEvent, contentChangedEvent) { + this.rawContentChangedEvent = rawContentChangedEvent; + this.contentChangedEvent = contentChangedEvent; + } + merge(other) { + const rawContentChangedEvent = ModelRawContentChangedEvent.merge(this.rawContentChangedEvent, other.rawContentChangedEvent); + const contentChangedEvent = _InternalModelContentChangeEvent._mergeChangeEvents(this.contentChangedEvent, other.contentChangedEvent); + return new _InternalModelContentChangeEvent(rawContentChangedEvent, contentChangedEvent); + } + static _mergeChangeEvents(a, b) { + const changes = [].concat(a.changes).concat(b.changes); + const eol = b.eol; + const versionId = b.versionId; + const isUndoing = a.isUndoing || b.isUndoing; + const isRedoing = a.isRedoing || b.isRedoing; + const isFlush = a.isFlush || b.isFlush; + const isEolChange = a.isEolChange && b.isEolChange; + return { + changes, + eol, + isEolChange, + versionId, + isUndoing, + isRedoing, + isFlush, + detailedReasons: a.detailedReasons.concat(b.detailedReasons), + detailedReasonsChangeLengths: a.detailedReasonsChangeLengths.concat(b.detailedReasonsChangeLengths) + }; + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/common/core/misc/eolCounter.js +function countEOL(text2) { + let eolCount = 0; + let firstLineLength = 0; + let lastLineStart = 0; + let eol = 0; + for (let i2 = 0, len = text2.length; i2 < len; i2++) { + const chr = text2.charCodeAt(i2); + if (chr === 13) { + if (eolCount === 0) { + firstLineLength = i2; + } + eolCount++; + if (i2 + 1 < len && text2.charCodeAt(i2 + 1) === 10) { + eol |= 2; + i2++; + } else { + eol |= 3; + } + lastLineStart = i2 + 1; + } else if (chr === 10) { + eol |= 1; + if (eolCount === 0) { + firstLineLength = i2; + } + eolCount++; + lastLineStart = i2 + 1; + } + } + if (eolCount === 0) { + firstLineLength = text2.length; + } + return [eolCount, firstLineLength, text2.length - lastLineStart, eol]; +} +var init_eolCounter = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/common/core/misc/eolCounter.js"() { + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/common/textModelBracketPairs.js +var BracketInfo, BracketPairInfo, BracketPairWithMinIndentationInfo; +var init_textModelBracketPairs = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/common/textModelBracketPairs.js"() { + BracketInfo = class { + constructor(range2, nestingLevel, nestingLevelOfEqualBracketType, isInvalid) { + this.range = range2; + this.nestingLevel = nestingLevel; + this.nestingLevelOfEqualBracketType = nestingLevelOfEqualBracketType; + this.isInvalid = isInvalid; + } + }; + BracketPairInfo = class { + constructor(range2, openingBracketRange, closingBracketRange, nestingLevel, nestingLevelOfEqualBracketType, bracketPairNode) { + this.range = range2; + this.openingBracketRange = openingBracketRange; + this.closingBracketRange = closingBracketRange; + this.nestingLevel = nestingLevel; + this.nestingLevelOfEqualBracketType = nestingLevelOfEqualBracketType; + this.bracketPairNode = bracketPairNode; + } + get openingBracketInfo() { + return this.bracketPairNode.openingBracket.bracketInfo; + } + }; + BracketPairWithMinIndentationInfo = class extends BracketPairInfo { + constructor(range2, openingBracketRange, closingBracketRange, nestingLevel, nestingLevelOfEqualBracketType, bracketPairNode, minVisibleColumnIndentation) { + super(range2, openingBracketRange, closingBracketRange, nestingLevel, nestingLevelOfEqualBracketType, bracketPairNode); + this.minVisibleColumnIndentation = minVisibleColumnIndentation; + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/length.js +function lengthDiff(startLineCount, startColumnCount, endLineCount, endColumnCount) { + return startLineCount !== endLineCount ? toLength(endLineCount - startLineCount, endColumnCount) : toLength(0, endColumnCount - startColumnCount); +} +function lengthIsZero(length) { + return length === 0; +} +function toLength(lineCount, columnCount) { + return lineCount * factor + columnCount; +} +function lengthToObj(length) { + const l = length; + const lineCount = Math.floor(l / factor); + const columnCount = l - lineCount * factor; + return new TextLength(lineCount, columnCount); +} +function lengthGetLineCount(length) { + return Math.floor(length / factor); +} +function lengthGetColumnCountIfZeroLineCount(length) { + return length; +} +function lengthAdd(l1, l2) { + let r = l1 + l2; + if (l2 >= factor) { + r = r - l1 % factor; + } + return r; +} +function sumLengths(items, lengthFn) { + return items.reduce((a, b) => lengthAdd(a, lengthFn(b)), lengthZero); +} +function lengthEquals(length1, length2) { + return length1 === length2; +} +function lengthDiffNonNegative(length1, length2) { + const l1 = length1; + const l2 = length2; + const diff = l2 - l1; + if (diff <= 0) { + return lengthZero; + } + const lineCount1 = Math.floor(l1 / factor); + const lineCount2 = Math.floor(l2 / factor); + const colCount2 = l2 - lineCount2 * factor; + if (lineCount1 === lineCount2) { + const colCount1 = l1 - lineCount1 * factor; + return toLength(0, colCount2 - colCount1); + } else { + return toLength(lineCount2 - lineCount1, colCount2); + } +} +function lengthLessThan(length1, length2) { + return length1 < length2; +} +function lengthLessThanEqual(length1, length2) { + return length1 <= length2; +} +function lengthGreaterThanEqual(length1, length2) { + return length1 >= length2; +} +function positionToLength(position) { + return toLength(position.lineNumber - 1, position.column - 1); +} +function lengthsToRange(lengthStart, lengthEnd) { + const l = lengthStart; + const lineCount = Math.floor(l / factor); + const colCount = l - lineCount * factor; + const l2 = lengthEnd; + const lineCount2 = Math.floor(l2 / factor); + const colCount2 = l2 - lineCount2 * factor; + return new Range(lineCount + 1, colCount + 1, lineCount2 + 1, colCount2 + 1); +} +function lengthOfString(str) { + const lines = splitLines(str); + return toLength(lines.length - 1, lines[lines.length - 1].length); +} +var lengthZero, factor; +var init_length = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/length.js"() { + init_strings(); + init_range(); + init_textLength(); + lengthZero = 0; + factor = 2 ** 26; + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/beforeEditPositionMapper.js +var TextEditInfo, BeforeEditPositionMapper, TextEditInfoCache; +var init_beforeEditPositionMapper = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/beforeEditPositionMapper.js"() { + init_range(); + init_length(); + TextEditInfo = class _TextEditInfo { + static fromModelContentChanges(changes) { + const edits = changes.map((c) => { + const range2 = Range.lift(c.range); + return new _TextEditInfo(positionToLength(range2.getStartPosition()), positionToLength(range2.getEndPosition()), lengthOfString(c.text)); + }).reverse(); + return edits; + } + constructor(startOffset, endOffset, newLength) { + this.startOffset = startOffset; + this.endOffset = endOffset; + this.newLength = newLength; + } + toString() { + return `[${lengthToObj(this.startOffset)}...${lengthToObj(this.endOffset)}) -> ${lengthToObj(this.newLength)}`; + } + }; + BeforeEditPositionMapper = class { + /** + * @param edits Must be sorted by offset in ascending order. + */ + constructor(edits) { + this.nextEditIdx = 0; + this.deltaOldToNewLineCount = 0; + this.deltaOldToNewColumnCount = 0; + this.deltaLineIdxInOld = -1; + this.edits = edits.map((edit2) => TextEditInfoCache.from(edit2)); + } + /** + * @param offset Must be equal to or greater than the last offset this method has been called with. + */ + getOffsetBeforeChange(offset) { + this.adjustNextEdit(offset); + return this.translateCurToOld(offset); + } + /** + * @param offset Must be equal to or greater than the last offset this method has been called with. + * Returns null if there is no edit anymore. + */ + getDistanceToNextChange(offset) { + this.adjustNextEdit(offset); + const nextEdit = this.edits[this.nextEditIdx]; + const nextChangeOffset = nextEdit ? this.translateOldToCur(nextEdit.offsetObj) : null; + if (nextChangeOffset === null) { + return null; + } + return lengthDiffNonNegative(offset, nextChangeOffset); + } + translateOldToCur(oldOffsetObj) { + if (oldOffsetObj.lineCount === this.deltaLineIdxInOld) { + return toLength(oldOffsetObj.lineCount + this.deltaOldToNewLineCount, oldOffsetObj.columnCount + this.deltaOldToNewColumnCount); + } else { + return toLength(oldOffsetObj.lineCount + this.deltaOldToNewLineCount, oldOffsetObj.columnCount); + } + } + translateCurToOld(newOffset) { + const offsetObj = lengthToObj(newOffset); + if (offsetObj.lineCount - this.deltaOldToNewLineCount === this.deltaLineIdxInOld) { + return toLength(offsetObj.lineCount - this.deltaOldToNewLineCount, offsetObj.columnCount - this.deltaOldToNewColumnCount); + } else { + return toLength(offsetObj.lineCount - this.deltaOldToNewLineCount, offsetObj.columnCount); + } + } + adjustNextEdit(offset) { + while (this.nextEditIdx < this.edits.length) { + const nextEdit = this.edits[this.nextEditIdx]; + const nextEditEndOffsetInCur = this.translateOldToCur(nextEdit.endOffsetAfterObj); + if (lengthLessThanEqual(nextEditEndOffsetInCur, offset)) { + this.nextEditIdx++; + const nextEditEndOffsetInCurObj = lengthToObj(nextEditEndOffsetInCur); + const nextEditEndOffsetBeforeInCurObj = lengthToObj(this.translateOldToCur(nextEdit.endOffsetBeforeObj)); + const lineDelta = nextEditEndOffsetInCurObj.lineCount - nextEditEndOffsetBeforeInCurObj.lineCount; + this.deltaOldToNewLineCount += lineDelta; + const previousColumnDelta = this.deltaLineIdxInOld === nextEdit.endOffsetBeforeObj.lineCount ? this.deltaOldToNewColumnCount : 0; + const columnDelta = nextEditEndOffsetInCurObj.columnCount - nextEditEndOffsetBeforeInCurObj.columnCount; + this.deltaOldToNewColumnCount = previousColumnDelta + columnDelta; + this.deltaLineIdxInOld = nextEdit.endOffsetBeforeObj.lineCount; + } else { + break; + } + } + } + }; + TextEditInfoCache = class _TextEditInfoCache { + static from(edit2) { + return new _TextEditInfoCache(edit2.startOffset, edit2.endOffset, edit2.newLength); + } + constructor(startOffset, endOffset, textLength) { + this.endOffsetBeforeObj = lengthToObj(endOffset); + this.endOffsetAfterObj = lengthToObj(lengthAdd(startOffset, textLength)); + this.offsetObj = lengthToObj(startOffset); + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/smallImmutableSet.js +var emptyArr, SmallImmutableSet, identityKeyProvider, DenseKeyProvider; +var init_smallImmutableSet = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/smallImmutableSet.js"() { + emptyArr = []; + SmallImmutableSet = class _SmallImmutableSet { + static { + this.cache = new Array(129); + } + static create(items, additionalItems) { + if (items <= 128 && additionalItems.length === 0) { + let cached = _SmallImmutableSet.cache[items]; + if (!cached) { + cached = new _SmallImmutableSet(items, additionalItems); + _SmallImmutableSet.cache[items] = cached; + } + return cached; + } + return new _SmallImmutableSet(items, additionalItems); + } + static { + this.empty = _SmallImmutableSet.create(0, emptyArr); + } + static getEmpty() { + return this.empty; + } + constructor(items, additionalItems) { + this.items = items; + this.additionalItems = additionalItems; + } + add(value, keyProvider) { + const key = keyProvider.getKey(value); + let idx = key >> 5; + if (idx === 0) { + const newItem = 1 << key | this.items; + if (newItem === this.items) { + return this; + } + return _SmallImmutableSet.create(newItem, this.additionalItems); + } + idx--; + const newItems = this.additionalItems.slice(0); + while (newItems.length < idx) { + newItems.push(0); + } + newItems[idx] |= 1 << (key & 31); + return _SmallImmutableSet.create(this.items, newItems); + } + merge(other) { + const merged = this.items | other.items; + if (this.additionalItems === emptyArr && other.additionalItems === emptyArr) { + if (merged === this.items) { + return this; + } + if (merged === other.items) { + return other; + } + return _SmallImmutableSet.create(merged, emptyArr); + } + const newItems = []; + for (let i2 = 0; i2 < Math.max(this.additionalItems.length, other.additionalItems.length); i2++) { + const item1 = this.additionalItems[i2] || 0; + const item2 = other.additionalItems[i2] || 0; + newItems.push(item1 | item2); + } + return _SmallImmutableSet.create(merged, newItems); + } + intersects(other) { + if ((this.items & other.items) !== 0) { + return true; + } + for (let i2 = 0; i2 < Math.min(this.additionalItems.length, other.additionalItems.length); i2++) { + if ((this.additionalItems[i2] & other.additionalItems[i2]) !== 0) { + return true; + } + } + return false; + } + }; + identityKeyProvider = { + getKey(value) { + return value; + } + }; + DenseKeyProvider = class { + constructor() { + this.items = /* @__PURE__ */ new Map(); + } + getKey(value) { + let existing = this.items.get(value); + if (existing === void 0) { + existing = this.items.size; + this.items.set(value, existing); + } + return existing; + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/ast.js +var BaseAstNode, PairAstNode, ListAstNode, TwoThreeListAstNode, Immutable23ListAstNode, ArrayListAstNode, ImmutableArrayListAstNode, emptyArray, ImmutableLeafAstNode, TextAstNode, BracketAstNode, InvalidBracketAstNode; +var init_ast = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/ast.js"() { + init_errors(); + init_cursorColumns(); + init_length(); + init_smallImmutableSet(); + BaseAstNode = class { + /** + * The length of the entire node, which should equal the sum of lengths of all children. + */ + get length() { + return this._length; + } + constructor(length) { + this._length = length; + } + }; + PairAstNode = class _PairAstNode extends BaseAstNode { + static create(openingBracket, child, closingBracket) { + let length = openingBracket.length; + if (child) { + length = lengthAdd(length, child.length); + } + if (closingBracket) { + length = lengthAdd(length, closingBracket.length); + } + return new _PairAstNode(length, openingBracket, child, closingBracket, child ? child.missingOpeningBracketIds : SmallImmutableSet.getEmpty()); + } + get kind() { + return 2; + } + get listHeight() { + return 0; + } + get childrenLength() { + return 3; + } + getChild(idx) { + switch (idx) { + case 0: + return this.openingBracket; + case 1: + return this.child; + case 2: + return this.closingBracket; + } + throw new Error("Invalid child index"); + } + /** + * Avoid using this property, it allocates an array! + */ + get children() { + const result = []; + result.push(this.openingBracket); + if (this.child) { + result.push(this.child); + } + if (this.closingBracket) { + result.push(this.closingBracket); + } + return result; + } + constructor(length, openingBracket, child, closingBracket, missingOpeningBracketIds) { + super(length); + this.openingBracket = openingBracket; + this.child = child; + this.closingBracket = closingBracket; + this.missingOpeningBracketIds = missingOpeningBracketIds; + } + canBeReused(openBracketIds) { + if (this.closingBracket === null) { + return false; + } + if (openBracketIds.intersects(this.missingOpeningBracketIds)) { + return false; + } + return true; + } + deepClone() { + return new _PairAstNode(this.length, this.openingBracket.deepClone(), this.child && this.child.deepClone(), this.closingBracket && this.closingBracket.deepClone(), this.missingOpeningBracketIds); + } + computeMinIndentation(offset, textModel) { + return this.child ? this.child.computeMinIndentation(lengthAdd(offset, this.openingBracket.length), textModel) : Number.MAX_SAFE_INTEGER; + } + }; + ListAstNode = class extends BaseAstNode { + /** + * This method uses more memory-efficient list nodes that can only store 2 or 3 children. + */ + static create23(item1, item2, item3, immutable = false) { + let length = item1.length; + let missingBracketIds = item1.missingOpeningBracketIds; + if (item1.listHeight !== item2.listHeight) { + throw new Error("Invalid list heights"); + } + length = lengthAdd(length, item2.length); + missingBracketIds = missingBracketIds.merge(item2.missingOpeningBracketIds); + if (item3) { + if (item1.listHeight !== item3.listHeight) { + throw new Error("Invalid list heights"); + } + length = lengthAdd(length, item3.length); + missingBracketIds = missingBracketIds.merge(item3.missingOpeningBracketIds); + } + return immutable ? new Immutable23ListAstNode(length, item1.listHeight + 1, item1, item2, item3, missingBracketIds) : new TwoThreeListAstNode(length, item1.listHeight + 1, item1, item2, item3, missingBracketIds); + } + static getEmpty() { + return new ImmutableArrayListAstNode(lengthZero, 0, [], SmallImmutableSet.getEmpty()); + } + get kind() { + return 4; + } + get missingOpeningBracketIds() { + return this._missingOpeningBracketIds; + } + /** + * Use ListAstNode.create. + */ + constructor(length, listHeight, _missingOpeningBracketIds) { + super(length); + this.listHeight = listHeight; + this._missingOpeningBracketIds = _missingOpeningBracketIds; + this.cachedMinIndentation = -1; + } + throwIfImmutable() { + } + makeLastElementMutable() { + this.throwIfImmutable(); + const childCount = this.childrenLength; + if (childCount === 0) { + return void 0; + } + const lastChild = this.getChild(childCount - 1); + const mutable = lastChild.kind === 4 ? lastChild.toMutable() : lastChild; + if (lastChild !== mutable) { + this.setChild(childCount - 1, mutable); + } + return mutable; + } + makeFirstElementMutable() { + this.throwIfImmutable(); + const childCount = this.childrenLength; + if (childCount === 0) { + return void 0; + } + const firstChild = this.getChild(0); + const mutable = firstChild.kind === 4 ? firstChild.toMutable() : firstChild; + if (firstChild !== mutable) { + this.setChild(0, mutable); + } + return mutable; + } + canBeReused(openBracketIds) { + if (openBracketIds.intersects(this.missingOpeningBracketIds)) { + return false; + } + if (this.childrenLength === 0) { + return false; + } + let lastChild = this; + while (lastChild.kind === 4) { + const lastLength = lastChild.childrenLength; + if (lastLength === 0) { + throw new BugIndicatingError(); + } + lastChild = lastChild.getChild(lastLength - 1); + } + return lastChild.canBeReused(openBracketIds); + } + handleChildrenChanged() { + this.throwIfImmutable(); + const count = this.childrenLength; + let length = this.getChild(0).length; + let unopenedBrackets = this.getChild(0).missingOpeningBracketIds; + for (let i2 = 1; i2 < count; i2++) { + const child = this.getChild(i2); + length = lengthAdd(length, child.length); + unopenedBrackets = unopenedBrackets.merge(child.missingOpeningBracketIds); + } + this._length = length; + this._missingOpeningBracketIds = unopenedBrackets; + this.cachedMinIndentation = -1; + } + computeMinIndentation(offset, textModel) { + if (this.cachedMinIndentation !== -1) { + return this.cachedMinIndentation; + } + let minIndentation = Number.MAX_SAFE_INTEGER; + let childOffset = offset; + for (let i2 = 0; i2 < this.childrenLength; i2++) { + const child = this.getChild(i2); + if (child) { + minIndentation = Math.min(minIndentation, child.computeMinIndentation(childOffset, textModel)); + childOffset = lengthAdd(childOffset, child.length); + } + } + this.cachedMinIndentation = minIndentation; + return minIndentation; + } + }; + TwoThreeListAstNode = class _TwoThreeListAstNode extends ListAstNode { + get childrenLength() { + return this._item3 !== null ? 3 : 2; + } + getChild(idx) { + switch (idx) { + case 0: + return this._item1; + case 1: + return this._item2; + case 2: + return this._item3; + } + throw new Error("Invalid child index"); + } + setChild(idx, node) { + switch (idx) { + case 0: + this._item1 = node; + return; + case 1: + this._item2 = node; + return; + case 2: + this._item3 = node; + return; + } + throw new Error("Invalid child index"); + } + get children() { + return this._item3 ? [this._item1, this._item2, this._item3] : [this._item1, this._item2]; + } + get item1() { + return this._item1; + } + get item2() { + return this._item2; + } + get item3() { + return this._item3; + } + constructor(length, listHeight, _item1, _item2, _item3, missingOpeningBracketIds) { + super(length, listHeight, missingOpeningBracketIds); + this._item1 = _item1; + this._item2 = _item2; + this._item3 = _item3; + } + deepClone() { + return new _TwoThreeListAstNode(this.length, this.listHeight, this._item1.deepClone(), this._item2.deepClone(), this._item3 ? this._item3.deepClone() : null, this.missingOpeningBracketIds); + } + appendChildOfSameHeight(node) { + if (this._item3) { + throw new Error("Cannot append to a full (2,3) tree node"); + } + this.throwIfImmutable(); + this._item3 = node; + this.handleChildrenChanged(); + } + unappendChild() { + if (!this._item3) { + throw new Error("Cannot remove from a non-full (2,3) tree node"); + } + this.throwIfImmutable(); + const result = this._item3; + this._item3 = null; + this.handleChildrenChanged(); + return result; + } + prependChildOfSameHeight(node) { + if (this._item3) { + throw new Error("Cannot prepend to a full (2,3) tree node"); + } + this.throwIfImmutable(); + this._item3 = this._item2; + this._item2 = this._item1; + this._item1 = node; + this.handleChildrenChanged(); + } + unprependChild() { + if (!this._item3) { + throw new Error("Cannot remove from a non-full (2,3) tree node"); + } + this.throwIfImmutable(); + const result = this._item1; + this._item1 = this._item2; + this._item2 = this._item3; + this._item3 = null; + this.handleChildrenChanged(); + return result; + } + toMutable() { + return this; + } + }; + Immutable23ListAstNode = class extends TwoThreeListAstNode { + toMutable() { + return new TwoThreeListAstNode(this.length, this.listHeight, this.item1, this.item2, this.item3, this.missingOpeningBracketIds); + } + throwIfImmutable() { + throw new Error("this instance is immutable"); + } + }; + ArrayListAstNode = class _ArrayListAstNode extends ListAstNode { + get childrenLength() { + return this._children.length; + } + getChild(idx) { + return this._children[idx]; + } + setChild(idx, child) { + this._children[idx] = child; + } + get children() { + return this._children; + } + constructor(length, listHeight, _children, missingOpeningBracketIds) { + super(length, listHeight, missingOpeningBracketIds); + this._children = _children; + } + deepClone() { + const children = new Array(this._children.length); + for (let i2 = 0; i2 < this._children.length; i2++) { + children[i2] = this._children[i2].deepClone(); + } + return new _ArrayListAstNode(this.length, this.listHeight, children, this.missingOpeningBracketIds); + } + appendChildOfSameHeight(node) { + this.throwIfImmutable(); + this._children.push(node); + this.handleChildrenChanged(); + } + unappendChild() { + this.throwIfImmutable(); + const item = this._children.pop(); + this.handleChildrenChanged(); + return item; + } + prependChildOfSameHeight(node) { + this.throwIfImmutable(); + this._children.unshift(node); + this.handleChildrenChanged(); + } + unprependChild() { + this.throwIfImmutable(); + const item = this._children.shift(); + this.handleChildrenChanged(); + return item; + } + toMutable() { + return this; + } + }; + ImmutableArrayListAstNode = class extends ArrayListAstNode { + toMutable() { + return new ArrayListAstNode(this.length, this.listHeight, [...this.children], this.missingOpeningBracketIds); + } + throwIfImmutable() { + throw new Error("this instance is immutable"); + } + }; + emptyArray = []; + ImmutableLeafAstNode = class extends BaseAstNode { + get listHeight() { + return 0; + } + get childrenLength() { + return 0; + } + getChild(idx) { + return null; + } + get children() { + return emptyArray; + } + deepClone() { + return this; + } + }; + TextAstNode = class extends ImmutableLeafAstNode { + get kind() { + return 0; + } + get missingOpeningBracketIds() { + return SmallImmutableSet.getEmpty(); + } + canBeReused(_openedBracketIds) { + return true; + } + computeMinIndentation(offset, textModel) { + const start = lengthToObj(offset); + const startLineNumber = (start.columnCount === 0 ? start.lineCount : start.lineCount + 1) + 1; + const endLineNumber = lengthGetLineCount(lengthAdd(offset, this.length)) + 1; + let result = Number.MAX_SAFE_INTEGER; + for (let lineNumber = startLineNumber; lineNumber <= endLineNumber; lineNumber++) { + const firstNonWsColumn = textModel.getLineFirstNonWhitespaceColumn(lineNumber); + const lineContent = textModel.getLineContent(lineNumber); + if (firstNonWsColumn === 0) { + continue; + } + const visibleColumn = CursorColumns.visibleColumnFromColumn(lineContent, firstNonWsColumn, textModel.getOptions().tabSize); + result = Math.min(result, visibleColumn); + } + return result; + } + }; + BracketAstNode = class _BracketAstNode extends ImmutableLeafAstNode { + static create(length, bracketInfo, bracketIds) { + const node = new _BracketAstNode(length, bracketInfo, bracketIds); + return node; + } + get kind() { + return 1; + } + get missingOpeningBracketIds() { + return SmallImmutableSet.getEmpty(); + } + constructor(length, bracketInfo, bracketIds) { + super(length); + this.bracketInfo = bracketInfo; + this.bracketIds = bracketIds; + } + get text() { + return this.bracketInfo.bracketText; + } + get languageId() { + return this.bracketInfo.languageId; + } + canBeReused(_openedBracketIds) { + return false; + } + computeMinIndentation(offset, textModel) { + return Number.MAX_SAFE_INTEGER; + } + }; + InvalidBracketAstNode = class extends ImmutableLeafAstNode { + get kind() { + return 3; + } + constructor(closingBrackets, length) { + super(length); + this.missingOpeningBracketIds = closingBrackets; + } + canBeReused(openedBracketIds) { + return !openedBracketIds.intersects(this.missingOpeningBracketIds); + } + computeMinIndentation(offset, textModel) { + return Number.MAX_SAFE_INTEGER; + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/tokenizer.js +var Token2, TextBufferTokenizer, NonPeekableTextBufferTokenizer, FastTokenizer; +var init_tokenizer = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/tokenizer.js"() { + init_errors(); + init_encodedTokenAttributes(); + init_ast(); + init_length(); + init_smallImmutableSet(); + Token2 = class { + constructor(length, kind, bracketId, bracketIds, astNode) { + this.length = length; + this.kind = kind; + this.bracketId = bracketId; + this.bracketIds = bracketIds; + this.astNode = astNode; + } + }; + TextBufferTokenizer = class { + constructor(textModel, bracketTokens) { + this.textModel = textModel; + this.bracketTokens = bracketTokens; + this.reader = new NonPeekableTextBufferTokenizer(this.textModel, this.bracketTokens); + this._offset = lengthZero; + this.didPeek = false; + this.peeked = null; + this.textBufferLineCount = textModel.getLineCount(); + this.textBufferLastLineLength = textModel.getLineLength(this.textBufferLineCount); + } + get offset() { + return this._offset; + } + get length() { + return toLength(this.textBufferLineCount - 1, this.textBufferLastLineLength); + } + skip(length) { + this.didPeek = false; + this._offset = lengthAdd(this._offset, length); + const obj = lengthToObj(this._offset); + this.reader.setPosition(obj.lineCount, obj.columnCount); + } + read() { + let token; + if (this.peeked) { + this.didPeek = false; + token = this.peeked; + } else { + token = this.reader.read(); + } + if (token) { + this._offset = lengthAdd(this._offset, token.length); + } + return token; + } + peek() { + if (!this.didPeek) { + this.peeked = this.reader.read(); + this.didPeek = true; + } + return this.peeked; + } + }; + NonPeekableTextBufferTokenizer = class { + constructor(textModel, bracketTokens) { + this.textModel = textModel; + this.bracketTokens = bracketTokens; + this.lineIdx = 0; + this.line = null; + this.lineCharOffset = 0; + this.lineTokens = null; + this.lineTokenOffset = 0; + this.peekedToken = null; + this.textBufferLineCount = textModel.getLineCount(); + this.textBufferLastLineLength = textModel.getLineLength(this.textBufferLineCount); + } + setPosition(lineIdx, column) { + if (lineIdx === this.lineIdx) { + this.lineCharOffset = column; + if (this.line !== null) { + this.lineTokenOffset = this.lineCharOffset === 0 ? 0 : this.lineTokens.findTokenIndexAtOffset(this.lineCharOffset); + } + } else { + this.lineIdx = lineIdx; + this.lineCharOffset = column; + this.line = null; + } + this.peekedToken = null; + } + read() { + if (this.peekedToken) { + const token = this.peekedToken; + this.peekedToken = null; + this.lineCharOffset += lengthGetColumnCountIfZeroLineCount(token.length); + return token; + } + if (this.lineIdx > this.textBufferLineCount - 1 || this.lineIdx === this.textBufferLineCount - 1 && this.lineCharOffset >= this.textBufferLastLineLength) { + return null; + } + if (this.line === null) { + this.lineTokens = this.textModel.tokenization.getLineTokens(this.lineIdx + 1); + this.line = this.lineTokens.getLineContent(); + this.lineTokenOffset = this.lineCharOffset === 0 ? 0 : this.lineTokens.findTokenIndexAtOffset(this.lineCharOffset); + } + const startLineIdx = this.lineIdx; + const startLineCharOffset = this.lineCharOffset; + let lengthHeuristic = 0; + while (true) { + const lineTokens = this.lineTokens; + const tokenCount = lineTokens.getCount(); + let peekedBracketToken = null; + if (this.lineTokenOffset < tokenCount) { + const tokenMetadata = lineTokens.getMetadata(this.lineTokenOffset); + while (this.lineTokenOffset + 1 < tokenCount && tokenMetadata === lineTokens.getMetadata(this.lineTokenOffset + 1)) { + this.lineTokenOffset++; + } + const isOther = TokenMetadata.getTokenType(tokenMetadata) === 0; + const containsBracketType = TokenMetadata.containsBalancedBrackets(tokenMetadata); + const endOffset = lineTokens.getEndOffset(this.lineTokenOffset); + if (containsBracketType && isOther && this.lineCharOffset < endOffset) { + const languageId = lineTokens.getLanguageId(this.lineTokenOffset); + const text2 = this.line.substring(this.lineCharOffset, endOffset); + const brackets = this.bracketTokens.getSingleLanguageBracketTokens(languageId); + const regexp = brackets.regExpGlobal; + if (regexp) { + regexp.lastIndex = 0; + const match2 = regexp.exec(text2); + if (match2) { + peekedBracketToken = brackets.getToken(match2[0]); + if (peekedBracketToken) { + this.lineCharOffset += match2.index; + } + } + } + } + lengthHeuristic += endOffset - this.lineCharOffset; + if (peekedBracketToken) { + if (startLineIdx !== this.lineIdx || startLineCharOffset !== this.lineCharOffset) { + this.peekedToken = peekedBracketToken; + break; + } else { + this.lineCharOffset += lengthGetColumnCountIfZeroLineCount(peekedBracketToken.length); + return peekedBracketToken; + } + } else { + this.lineTokenOffset++; + this.lineCharOffset = endOffset; + } + } else { + if (this.lineIdx === this.textBufferLineCount - 1) { + break; + } + this.lineIdx++; + this.lineTokens = this.textModel.tokenization.getLineTokens(this.lineIdx + 1); + this.lineTokenOffset = 0; + this.line = this.lineTokens.getLineContent(); + this.lineCharOffset = 0; + lengthHeuristic += 33; + if (lengthHeuristic > 1e3) { + break; + } + } + if (lengthHeuristic > 1500) { + break; + } + } + const length = lengthDiff(startLineIdx, startLineCharOffset, this.lineIdx, this.lineCharOffset); + return new Token2(length, 0, -1, SmallImmutableSet.getEmpty(), new TextAstNode(length)); + } + }; + FastTokenizer = class { + constructor(text2, brackets) { + this.text = text2; + this._offset = lengthZero; + this.idx = 0; + const regExpStr = brackets.getRegExpStr(); + const regexp = regExpStr ? new RegExp(regExpStr + "|\n", "gi") : null; + const tokens = []; + let match2; + let curLineCount = 0; + let lastLineBreakOffset = 0; + let lastTokenEndOffset = 0; + let lastTokenEndLine = 0; + const smallTextTokens0Line = []; + for (let i2 = 0; i2 < 60; i2++) { + smallTextTokens0Line.push(new Token2(toLength(0, i2), 0, -1, SmallImmutableSet.getEmpty(), new TextAstNode(toLength(0, i2)))); + } + const smallTextTokens1Line = []; + for (let i2 = 0; i2 < 60; i2++) { + smallTextTokens1Line.push(new Token2(toLength(1, i2), 0, -1, SmallImmutableSet.getEmpty(), new TextAstNode(toLength(1, i2)))); + } + if (regexp) { + regexp.lastIndex = 0; + while ((match2 = regexp.exec(text2)) !== null) { + const curOffset = match2.index; + const value = match2[0]; + if (value === "\n") { + curLineCount++; + lastLineBreakOffset = curOffset + 1; + } else { + if (lastTokenEndOffset !== curOffset) { + let token; + if (lastTokenEndLine === curLineCount) { + const colCount = curOffset - lastTokenEndOffset; + if (colCount < smallTextTokens0Line.length) { + token = smallTextTokens0Line[colCount]; + } else { + const length = toLength(0, colCount); + token = new Token2(length, 0, -1, SmallImmutableSet.getEmpty(), new TextAstNode(length)); + } + } else { + const lineCount = curLineCount - lastTokenEndLine; + const colCount = curOffset - lastLineBreakOffset; + if (lineCount === 1 && colCount < smallTextTokens1Line.length) { + token = smallTextTokens1Line[colCount]; + } else { + const length = toLength(lineCount, colCount); + token = new Token2(length, 0, -1, SmallImmutableSet.getEmpty(), new TextAstNode(length)); + } + } + tokens.push(token); + } + tokens.push(brackets.getToken(value)); + lastTokenEndOffset = curOffset + value.length; + lastTokenEndLine = curLineCount; + } + } + } + const offset = text2.length; + if (lastTokenEndOffset !== offset) { + const length = lastTokenEndLine === curLineCount ? toLength(0, offset - lastTokenEndOffset) : toLength(curLineCount - lastTokenEndLine, offset - lastLineBreakOffset); + tokens.push(new Token2(length, 0, -1, SmallImmutableSet.getEmpty(), new TextAstNode(length))); + } + this.length = toLength(curLineCount, offset - lastLineBreakOffset); + this.tokens = tokens; + } + get offset() { + return this._offset; + } + read() { + return this.tokens[this.idx++] || null; + } + peek() { + return this.tokens[this.idx] || null; + } + skip(length) { + throw new NotSupportedError(); + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/brackets.js +function prepareBracketForRegExp2(str) { + let escaped = escapeRegExpCharacters(str); + if (/^[\w ]+/.test(str)) { + escaped = `\\b${escaped}`; + } + if (/[\w ]+$/.test(str)) { + escaped = `${escaped}\\b`; + } + return escaped; +} +var BracketTokens, LanguageAgnosticBracketTokens; +var init_brackets = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/brackets.js"() { + init_strings(); + init_ast(); + init_length(); + init_smallImmutableSet(); + init_tokenizer(); + BracketTokens = class _BracketTokens { + static createFromLanguage(configuration, denseKeyProvider) { + function getId(bracketInfo) { + return denseKeyProvider.getKey(`${bracketInfo.languageId}:::${bracketInfo.bracketText}`); + } + const map = /* @__PURE__ */ new Map(); + for (const openingBracket of configuration.bracketsNew.openingBrackets) { + const length = toLength(0, openingBracket.bracketText.length); + const openingTextId = getId(openingBracket); + const bracketIds = SmallImmutableSet.getEmpty().add(openingTextId, identityKeyProvider); + map.set(openingBracket.bracketText, new Token2(length, 1, openingTextId, bracketIds, BracketAstNode.create(length, openingBracket, bracketIds))); + } + for (const closingBracket of configuration.bracketsNew.closingBrackets) { + const length = toLength(0, closingBracket.bracketText.length); + let bracketIds = SmallImmutableSet.getEmpty(); + const closingBrackets = closingBracket.getOpeningBrackets(); + for (const bracket of closingBrackets) { + bracketIds = bracketIds.add(getId(bracket), identityKeyProvider); + } + map.set(closingBracket.bracketText, new Token2(length, 2, getId(closingBrackets[0]), bracketIds, BracketAstNode.create(length, closingBracket, bracketIds))); + } + return new _BracketTokens(map); + } + constructor(map) { + this.map = map; + this.hasRegExp = false; + this._regExpGlobal = null; + } + getRegExpStr() { + if (this.isEmpty) { + return null; + } else { + const keys = [...this.map.keys()]; + keys.sort(); + keys.reverse(); + return keys.map((k) => prepareBracketForRegExp2(k)).join("|"); + } + } + /** + * Returns null if there is no such regexp (because there are no brackets). + */ + get regExpGlobal() { + if (!this.hasRegExp) { + const regExpStr = this.getRegExpStr(); + this._regExpGlobal = regExpStr ? new RegExp(regExpStr, "gi") : null; + this.hasRegExp = true; + } + return this._regExpGlobal; + } + getToken(value) { + return this.map.get(value.toLowerCase()); + } + findClosingTokenText(openingBracketIds) { + for (const [closingText, info] of this.map) { + if (info.kind === 2 && info.bracketIds.intersects(openingBracketIds)) { + return closingText; + } + } + return void 0; + } + get isEmpty() { + return this.map.size === 0; + } + }; + LanguageAgnosticBracketTokens = class { + constructor(denseKeyProvider, getLanguageConfiguration) { + this.denseKeyProvider = denseKeyProvider; + this.getLanguageConfiguration = getLanguageConfiguration; + this.languageIdToBracketTokens = /* @__PURE__ */ new Map(); + } + didLanguageChange(languageId) { + return this.languageIdToBracketTokens.has(languageId); + } + getSingleLanguageBracketTokens(languageId) { + let singleLanguageBracketTokens = this.languageIdToBracketTokens.get(languageId); + if (!singleLanguageBracketTokens) { + singleLanguageBracketTokens = BracketTokens.createFromLanguage(this.getLanguageConfiguration(languageId), this.denseKeyProvider); + this.languageIdToBracketTokens.set(languageId, singleLanguageBracketTokens); + } + return singleLanguageBracketTokens; + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/concat23Trees.js +function concat23Trees(items) { + if (items.length === 0) { + return null; + } + if (items.length === 1) { + return items[0]; + } + let i2 = 0; + function readNode() { + if (i2 >= items.length) { + return null; + } + const start = i2; + const height = items[start].listHeight; + i2++; + while (i2 < items.length && items[i2].listHeight === height) { + i2++; + } + if (i2 - start >= 2) { + return concat23TreesOfSameHeight(start === 0 && i2 === items.length ? items : items.slice(start, i2), false); + } else { + return items[start]; + } + } + let first2 = readNode(); + let second = readNode(); + if (!second) { + return first2; + } + for (let item = readNode(); item; item = readNode()) { + if (heightDiff(first2, second) <= heightDiff(second, item)) { + first2 = concat(first2, second); + second = item; + } else { + second = concat(second, item); + } + } + const result = concat(first2, second); + return result; +} +function concat23TreesOfSameHeight(items, createImmutableLists = false) { + if (items.length === 0) { + return null; + } + if (items.length === 1) { + return items[0]; + } + let length = items.length; + while (length > 3) { + const newLength = length >> 1; + for (let i2 = 0; i2 < newLength; i2++) { + const j = i2 << 1; + items[i2] = ListAstNode.create23(items[j], items[j + 1], j + 3 === length ? items[j + 2] : null, createImmutableLists); + } + length = newLength; + } + return ListAstNode.create23(items[0], items[1], length >= 3 ? items[2] : null, createImmutableLists); +} +function heightDiff(node1, node2) { + return Math.abs(node1.listHeight - node2.listHeight); +} +function concat(node1, node2) { + if (node1.listHeight === node2.listHeight) { + return ListAstNode.create23(node1, node2, null, false); + } else if (node1.listHeight > node2.listHeight) { + return append2(node1, node2); + } else { + return prepend2(node2, node1); + } +} +function append2(list2, nodeToAppend) { + list2 = list2.toMutable(); + let curNode = list2; + const parents = []; + let nodeToAppendOfCorrectHeight; + while (true) { + if (nodeToAppend.listHeight === curNode.listHeight) { + nodeToAppendOfCorrectHeight = nodeToAppend; + break; + } + if (curNode.kind !== 4) { + throw new Error("unexpected"); + } + parents.push(curNode); + curNode = curNode.makeLastElementMutable(); + } + for (let i2 = parents.length - 1; i2 >= 0; i2--) { + const parent = parents[i2]; + if (nodeToAppendOfCorrectHeight) { + if (parent.childrenLength >= 3) { + nodeToAppendOfCorrectHeight = ListAstNode.create23(parent.unappendChild(), nodeToAppendOfCorrectHeight, null, false); + } else { + parent.appendChildOfSameHeight(nodeToAppendOfCorrectHeight); + nodeToAppendOfCorrectHeight = void 0; + } + } else { + parent.handleChildrenChanged(); + } + } + if (nodeToAppendOfCorrectHeight) { + return ListAstNode.create23(list2, nodeToAppendOfCorrectHeight, null, false); + } else { + return list2; + } +} +function prepend2(list2, nodeToAppend) { + list2 = list2.toMutable(); + let curNode = list2; + const parents = []; + while (nodeToAppend.listHeight !== curNode.listHeight) { + if (curNode.kind !== 4) { + throw new Error("unexpected"); + } + parents.push(curNode); + curNode = curNode.makeFirstElementMutable(); + } + let nodeToPrependOfCorrectHeight = nodeToAppend; + for (let i2 = parents.length - 1; i2 >= 0; i2--) { + const parent = parents[i2]; + if (nodeToPrependOfCorrectHeight) { + if (parent.childrenLength >= 3) { + nodeToPrependOfCorrectHeight = ListAstNode.create23(nodeToPrependOfCorrectHeight, parent.unprependChild(), null, false); + } else { + parent.prependChildOfSameHeight(nodeToPrependOfCorrectHeight); + nodeToPrependOfCorrectHeight = void 0; + } + } else { + parent.handleChildrenChanged(); + } + } + if (nodeToPrependOfCorrectHeight) { + return ListAstNode.create23(nodeToPrependOfCorrectHeight, list2, null, false); + } else { + return list2; + } +} +var init_concat23Trees = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/concat23Trees.js"() { + init_ast(); + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/nodeReader.js +function getNextChildIdx(node, curIdx = -1) { + while (true) { + curIdx++; + if (curIdx >= node.childrenLength) { + return -1; + } + if (node.getChild(curIdx)) { + return curIdx; + } + } +} +function lastOrUndefined(arr) { + return arr.length > 0 ? arr[arr.length - 1] : void 0; +} +var NodeReader; +var init_nodeReader = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/nodeReader.js"() { + init_length(); + NodeReader = class { + constructor(node) { + this.lastOffset = lengthZero; + this.nextNodes = [node]; + this.offsets = [lengthZero]; + this.idxs = []; + } + /** + * Returns the longest node at `offset` that satisfies the predicate. + * @param offset must be greater than or equal to the last offset this method has been called with! + */ + readLongestNodeAt(offset, predicate) { + if (lengthLessThan(offset, this.lastOffset)) { + throw new Error("Invalid offset"); + } + this.lastOffset = offset; + while (true) { + const curNode = lastOrUndefined(this.nextNodes); + if (!curNode) { + return void 0; + } + const curNodeOffset = lastOrUndefined(this.offsets); + if (lengthLessThan(offset, curNodeOffset)) { + return void 0; + } + if (lengthLessThan(curNodeOffset, offset)) { + if (lengthAdd(curNodeOffset, curNode.length) <= offset) { + this.nextNodeAfterCurrent(); + } else { + const nextChildIdx = getNextChildIdx(curNode); + if (nextChildIdx !== -1) { + this.nextNodes.push(curNode.getChild(nextChildIdx)); + this.offsets.push(curNodeOffset); + this.idxs.push(nextChildIdx); + } else { + this.nextNodeAfterCurrent(); + } + } + } else { + if (predicate(curNode)) { + this.nextNodeAfterCurrent(); + return curNode; + } else { + const nextChildIdx = getNextChildIdx(curNode); + if (nextChildIdx === -1) { + this.nextNodeAfterCurrent(); + return void 0; + } else { + this.nextNodes.push(curNode.getChild(nextChildIdx)); + this.offsets.push(curNodeOffset); + this.idxs.push(nextChildIdx); + } + } + } + } + } + // Navigates to the longest node that continues after the current node. + nextNodeAfterCurrent() { + while (true) { + const currentOffset = lastOrUndefined(this.offsets); + const currentNode = lastOrUndefined(this.nextNodes); + this.nextNodes.pop(); + this.offsets.pop(); + if (this.idxs.length === 0) { + break; + } + const parent = lastOrUndefined(this.nextNodes); + const nextChildIdx = getNextChildIdx(parent, this.idxs[this.idxs.length - 1]); + if (nextChildIdx !== -1) { + this.nextNodes.push(parent.getChild(nextChildIdx)); + this.offsets.push(lengthAdd(currentOffset, currentNode.length)); + this.idxs[this.idxs.length - 1] = nextChildIdx; + break; + } else { + this.idxs.pop(); + } + } + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/parser.js +function parseDocument(tokenizer, edits, oldNode, createImmutableLists) { + const parser2 = new Parser2(tokenizer, edits, oldNode, createImmutableLists); + return parser2.parseDocument(); +} +var Parser2; +var init_parser = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/parser.js"() { + init_ast(); + init_beforeEditPositionMapper(); + init_smallImmutableSet(); + init_length(); + init_concat23Trees(); + init_nodeReader(); + Parser2 = class { + constructor(tokenizer, edits, oldNode, createImmutableLists) { + this.tokenizer = tokenizer; + this.createImmutableLists = createImmutableLists; + this._itemsConstructed = 0; + this._itemsFromCache = 0; + if (oldNode && createImmutableLists) { + throw new Error("Not supported"); + } + this.oldNodeReader = oldNode ? new NodeReader(oldNode) : void 0; + this.positionMapper = new BeforeEditPositionMapper(edits); + } + parseDocument() { + this._itemsConstructed = 0; + this._itemsFromCache = 0; + let result = this.parseList(SmallImmutableSet.getEmpty(), 0); + if (!result) { + result = ListAstNode.getEmpty(); + } + return result; + } + parseList(openedBracketIds, level) { + const items = []; + while (true) { + let child = this.tryReadChildFromCache(openedBracketIds); + if (!child) { + const token = this.tokenizer.peek(); + if (!token || token.kind === 2 && token.bracketIds.intersects(openedBracketIds)) { + break; + } + child = this.parseChild(openedBracketIds, level + 1); + } + if (child.kind === 4 && child.childrenLength === 0) { + continue; + } + items.push(child); + } + const result = this.oldNodeReader ? concat23Trees(items) : concat23TreesOfSameHeight(items, this.createImmutableLists); + return result; + } + tryReadChildFromCache(openedBracketIds) { + if (this.oldNodeReader) { + const maxCacheableLength = this.positionMapper.getDistanceToNextChange(this.tokenizer.offset); + if (maxCacheableLength === null || !lengthIsZero(maxCacheableLength)) { + const cachedNode = this.oldNodeReader.readLongestNodeAt(this.positionMapper.getOffsetBeforeChange(this.tokenizer.offset), (curNode) => { + if (maxCacheableLength !== null && !lengthLessThan(curNode.length, maxCacheableLength)) { + return false; + } + const canBeReused = curNode.canBeReused(openedBracketIds); + return canBeReused; + }); + if (cachedNode) { + this._itemsFromCache++; + this.tokenizer.skip(cachedNode.length); + return cachedNode; + } + } + } + return void 0; + } + parseChild(openedBracketIds, level) { + this._itemsConstructed++; + const token = this.tokenizer.read(); + switch (token.kind) { + case 2: + return new InvalidBracketAstNode(token.bracketIds, token.length); + case 0: + return token.astNode; + case 1: { + if (level > 300) { + return new TextAstNode(token.length); + } + const set = openedBracketIds.merge(token.bracketIds); + const child = this.parseList(set, level + 1); + const nextToken = this.tokenizer.peek(); + if (nextToken && nextToken.kind === 2 && (nextToken.bracketId === token.bracketId || nextToken.bracketIds.intersects(token.bracketIds))) { + this.tokenizer.read(); + return PairAstNode.create(token.astNode, child, nextToken.astNode); + } else { + return PairAstNode.create(token.astNode, child, null); + } + } + default: + throw new Error("unexpected"); + } + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/combineTextEditInfos.js +function combineTextEditInfos(textEditInfoFirst, textEditInfoSecond) { + if (textEditInfoFirst.length === 0) { + return textEditInfoSecond; + } + if (textEditInfoSecond.length === 0) { + return textEditInfoFirst; + } + const s0ToS1Map = new ArrayQueue(toLengthMapping(textEditInfoFirst)); + const s1ToS2Map = toLengthMapping(textEditInfoSecond); + s1ToS2Map.push({ modified: false, lengthBefore: void 0, lengthAfter: void 0 }); + let curItem = s0ToS1Map.dequeue(); + function nextS0ToS1MapWithS1LengthOf(s1Length) { + if (s1Length === void 0) { + const arr = s0ToS1Map.takeWhile((v) => true) || []; + if (curItem) { + arr.unshift(curItem); + } + return arr; + } + const result2 = []; + while (curItem && !lengthIsZero(s1Length)) { + const [item, remainingItem] = curItem.splitAt(s1Length); + result2.push(item); + s1Length = lengthDiffNonNegative(item.lengthAfter, s1Length); + curItem = remainingItem ?? s0ToS1Map.dequeue(); + } + if (!lengthIsZero(s1Length)) { + result2.push(new LengthMapping(false, s1Length, s1Length)); + } + return result2; + } + const result = []; + function pushEdit(startOffset, endOffset, newLength) { + if (result.length > 0 && lengthEquals(result[result.length - 1].endOffset, startOffset)) { + const lastResult = result[result.length - 1]; + result[result.length - 1] = new TextEditInfo(lastResult.startOffset, endOffset, lengthAdd(lastResult.newLength, newLength)); + } else { + result.push({ startOffset, endOffset, newLength }); + } + } + let s0offset = lengthZero; + for (const s1ToS2 of s1ToS2Map) { + const s0ToS1Map2 = nextS0ToS1MapWithS1LengthOf(s1ToS2.lengthBefore); + if (s1ToS2.modified) { + const s0Length = sumLengths(s0ToS1Map2, (s) => s.lengthBefore); + const s0EndOffset = lengthAdd(s0offset, s0Length); + pushEdit(s0offset, s0EndOffset, s1ToS2.lengthAfter); + s0offset = s0EndOffset; + } else { + for (const s1 of s0ToS1Map2) { + const s0startOffset = s0offset; + s0offset = lengthAdd(s0offset, s1.lengthBefore); + if (s1.modified) { + pushEdit(s0startOffset, s0offset, s1.lengthAfter); + } + } + } + } + return result; +} +function toLengthMapping(textEditInfos) { + const result = []; + let lastOffset = lengthZero; + for (const textEditInfo of textEditInfos) { + const spaceLength = lengthDiffNonNegative(lastOffset, textEditInfo.startOffset); + if (!lengthIsZero(spaceLength)) { + result.push(new LengthMapping(false, spaceLength, spaceLength)); + } + const lengthBefore = lengthDiffNonNegative(textEditInfo.startOffset, textEditInfo.endOffset); + result.push(new LengthMapping(true, lengthBefore, textEditInfo.newLength)); + lastOffset = textEditInfo.endOffset; + } + return result; +} +var LengthMapping; +var init_combineTextEditInfos = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/combineTextEditInfos.js"() { + init_arrays(); + init_beforeEditPositionMapper(); + init_length(); + LengthMapping = class _LengthMapping { + constructor(modified, lengthBefore, lengthAfter) { + this.modified = modified; + this.lengthBefore = lengthBefore; + this.lengthAfter = lengthAfter; + } + splitAt(lengthAfter) { + const remainingLengthAfter = lengthDiffNonNegative(lengthAfter, this.lengthAfter); + if (lengthEquals(remainingLengthAfter, lengthZero)) { + return [this, void 0]; + } else if (this.modified) { + return [ + new _LengthMapping(this.modified, this.lengthBefore, lengthAfter), + new _LengthMapping(this.modified, lengthZero, remainingLengthAfter) + ]; + } else { + return [ + new _LengthMapping(this.modified, lengthAfter, lengthAfter), + new _LengthMapping(this.modified, remainingLengthAfter, remainingLengthAfter) + ]; + } + } + toString() { + return `${this.modified ? "M" : "U"}:${lengthToObj(this.lengthBefore)} -> ${lengthToObj(this.lengthAfter)}`; + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/bracketPairsTree.js +function getFirstBracketBefore(node, nodeOffsetStart, nodeOffsetEnd, position) { + if (node.kind === 4 || node.kind === 2) { + const lengths = []; + for (const child of node.children) { + nodeOffsetEnd = lengthAdd(nodeOffsetStart, child.length); + lengths.push({ nodeOffsetStart, nodeOffsetEnd }); + nodeOffsetStart = nodeOffsetEnd; + } + for (let i2 = lengths.length - 1; i2 >= 0; i2--) { + const { nodeOffsetStart: nodeOffsetStart2, nodeOffsetEnd: nodeOffsetEnd2 } = lengths[i2]; + if (lengthLessThan(nodeOffsetStart2, position)) { + const result = getFirstBracketBefore(node.children[i2], nodeOffsetStart2, nodeOffsetEnd2, position); + if (result) { + return result; + } + } + } + return null; + } else if (node.kind === 3) { + return null; + } else if (node.kind === 1) { + const range2 = lengthsToRange(nodeOffsetStart, nodeOffsetEnd); + return { + bracketInfo: node.bracketInfo, + range: range2 + }; + } + return null; +} +function getFirstBracketAfter(node, nodeOffsetStart, nodeOffsetEnd, position) { + if (node.kind === 4 || node.kind === 2) { + for (const child of node.children) { + nodeOffsetEnd = lengthAdd(nodeOffsetStart, child.length); + if (lengthLessThan(position, nodeOffsetEnd)) { + const result = getFirstBracketAfter(child, nodeOffsetStart, nodeOffsetEnd, position); + if (result) { + return result; + } + } + nodeOffsetStart = nodeOffsetEnd; + } + return null; + } else if (node.kind === 3) { + return null; + } else if (node.kind === 1) { + const range2 = lengthsToRange(nodeOffsetStart, nodeOffsetEnd); + return { + bracketInfo: node.bracketInfo, + range: range2 + }; + } + return null; +} +function collectBrackets(node, nodeOffsetStart, nodeOffsetEnd, startOffset, endOffset, push, level, nestingLevelOfEqualBracketType, levelPerBracketType, onlyColorizedBrackets, parentPairIsIncomplete = false) { + if (level > 200) { + return true; + } + whileLoop: while (true) { + switch (node.kind) { + case 4: { + const childCount = node.childrenLength; + for (let i2 = 0; i2 < childCount; i2++) { + const child = node.getChild(i2); + if (!child) { + continue; + } + nodeOffsetEnd = lengthAdd(nodeOffsetStart, child.length); + if (lengthLessThanEqual(nodeOffsetStart, endOffset) && lengthGreaterThanEqual(nodeOffsetEnd, startOffset)) { + const childEndsAfterEnd = lengthGreaterThanEqual(nodeOffsetEnd, endOffset); + if (childEndsAfterEnd) { + node = child; + continue whileLoop; + } + const shouldContinue = collectBrackets(child, nodeOffsetStart, nodeOffsetEnd, startOffset, endOffset, push, level, 0, levelPerBracketType, onlyColorizedBrackets); + if (!shouldContinue) { + return false; + } + } + nodeOffsetStart = nodeOffsetEnd; + } + return true; + } + case 2: { + const colorize2 = !onlyColorizedBrackets || !node.closingBracket || node.closingBracket.bracketInfo.closesColorized(node.openingBracket.bracketInfo); + let levelPerBracket = 0; + if (levelPerBracketType) { + let existing = levelPerBracketType.get(node.openingBracket.text); + if (existing === void 0) { + existing = 0; + } + levelPerBracket = existing; + if (colorize2) { + existing++; + levelPerBracketType.set(node.openingBracket.text, existing); + } + } + const childCount = node.childrenLength; + for (let i2 = 0; i2 < childCount; i2++) { + const child = node.getChild(i2); + if (!child) { + continue; + } + nodeOffsetEnd = lengthAdd(nodeOffsetStart, child.length); + if (lengthLessThanEqual(nodeOffsetStart, endOffset) && lengthGreaterThanEqual(nodeOffsetEnd, startOffset)) { + const childEndsAfterEnd = lengthGreaterThanEqual(nodeOffsetEnd, endOffset); + if (childEndsAfterEnd && child.kind !== 1) { + node = child; + if (colorize2) { + level++; + nestingLevelOfEqualBracketType = levelPerBracket + 1; + } else { + nestingLevelOfEqualBracketType = levelPerBracket; + } + continue whileLoop; + } + if (colorize2 || child.kind !== 1 || !node.closingBracket) { + const shouldContinue = collectBrackets(child, nodeOffsetStart, nodeOffsetEnd, startOffset, endOffset, push, colorize2 ? level + 1 : level, colorize2 ? levelPerBracket + 1 : levelPerBracket, levelPerBracketType, onlyColorizedBrackets, !node.closingBracket); + if (!shouldContinue) { + return false; + } + } + } + nodeOffsetStart = nodeOffsetEnd; + } + levelPerBracketType?.set(node.openingBracket.text, levelPerBracket); + return true; + } + case 3: { + const range2 = lengthsToRange(nodeOffsetStart, nodeOffsetEnd); + return push(new BracketInfo(range2, level - 1, 0, true)); + } + case 1: { + const range2 = lengthsToRange(nodeOffsetStart, nodeOffsetEnd); + return push(new BracketInfo(range2, level - 1, nestingLevelOfEqualBracketType - 1, parentPairIsIncomplete)); + } + case 0: + return true; + } + } +} +function collectBracketPairs(node, nodeOffsetStart, nodeOffsetEnd, startOffset, endOffset, context, level, levelPerBracketType) { + if (level > 200) { + return true; + } + let shouldContinue = true; + if (node.kind === 2) { + let levelPerBracket = 0; + if (levelPerBracketType) { + let existing = levelPerBracketType.get(node.openingBracket.text); + if (existing === void 0) { + existing = 0; + } + levelPerBracket = existing; + existing++; + levelPerBracketType.set(node.openingBracket.text, existing); + } + const openingBracketEnd = lengthAdd(nodeOffsetStart, node.openingBracket.length); + let minIndentation = -1; + if (context.includeMinIndentation) { + minIndentation = node.computeMinIndentation(nodeOffsetStart, context.textModel); + } + shouldContinue = context.push(new BracketPairWithMinIndentationInfo(lengthsToRange(nodeOffsetStart, nodeOffsetEnd), lengthsToRange(nodeOffsetStart, openingBracketEnd), node.closingBracket ? lengthsToRange(lengthAdd(openingBracketEnd, node.child?.length || lengthZero), nodeOffsetEnd) : void 0, level, levelPerBracket, node, minIndentation)); + nodeOffsetStart = openingBracketEnd; + if (shouldContinue && node.child) { + const child = node.child; + nodeOffsetEnd = lengthAdd(nodeOffsetStart, child.length); + if (lengthLessThanEqual(nodeOffsetStart, endOffset) && lengthGreaterThanEqual(nodeOffsetEnd, startOffset)) { + shouldContinue = collectBracketPairs(child, nodeOffsetStart, nodeOffsetEnd, startOffset, endOffset, context, level + 1, levelPerBracketType); + if (!shouldContinue) { + return false; + } + } + } + levelPerBracketType?.set(node.openingBracket.text, levelPerBracket); + } else { + let curOffset = nodeOffsetStart; + for (const child of node.children) { + const childOffset = curOffset; + curOffset = lengthAdd(curOffset, child.length); + if (lengthLessThanEqual(childOffset, endOffset) && lengthLessThanEqual(startOffset, curOffset)) { + shouldContinue = collectBracketPairs(child, childOffset, curOffset, startOffset, endOffset, context, level, levelPerBracketType); + if (!shouldContinue) { + return false; + } + } + } + } + return shouldContinue; +} +var BracketPairsTree, CollectBracketPairsContext; +var init_bracketPairsTree = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/bracketPairsTree.js"() { + init_event(); + init_lifecycle(); + init_textModelBracketPairs(); + init_beforeEditPositionMapper(); + init_brackets(); + init_length(); + init_parser(); + init_smallImmutableSet(); + init_tokenizer(); + init_arrays(); + init_combineTextEditInfos(); + BracketPairsTree = class extends Disposable { + didLanguageChange(languageId) { + return this.brackets.didLanguageChange(languageId); + } + constructor(textModel, getLanguageConfiguration) { + super(); + this.textModel = textModel; + this.getLanguageConfiguration = getLanguageConfiguration; + this.didChangeEmitter = new Emitter(); + this.denseKeyProvider = new DenseKeyProvider(); + this.brackets = new LanguageAgnosticBracketTokens(this.denseKeyProvider, this.getLanguageConfiguration); + this.onDidChange = this.didChangeEmitter.event; + this.queuedTextEditsForInitialAstWithoutTokens = []; + this.queuedTextEdits = []; + if (!textModel.tokenization.hasTokens) { + const brackets = this.brackets.getSingleLanguageBracketTokens(this.textModel.getLanguageId()); + const tokenizer = new FastTokenizer(this.textModel.getValue(), brackets); + this.initialAstWithoutTokens = parseDocument(tokenizer, [], void 0, true); + this.astWithTokens = this.initialAstWithoutTokens; + } else if (textModel.tokenization.backgroundTokenizationState === 2) { + this.initialAstWithoutTokens = void 0; + this.astWithTokens = this.parseDocumentFromTextBuffer([], void 0, false); + } else { + this.initialAstWithoutTokens = this.parseDocumentFromTextBuffer([], void 0, true); + this.astWithTokens = this.initialAstWithoutTokens; + } + } + //#region TextModel events + handleDidChangeBackgroundTokenizationState() { + if (this.textModel.tokenization.backgroundTokenizationState === 2) { + const wasUndefined = this.initialAstWithoutTokens === void 0; + this.initialAstWithoutTokens = void 0; + if (!wasUndefined) { + this.didChangeEmitter.fire(); + } + } + } + handleDidChangeTokens({ ranges }) { + const edits = ranges.map((r) => new TextEditInfo(toLength(r.fromLineNumber - 1, 0), toLength(r.toLineNumber, 0), toLength(r.toLineNumber - r.fromLineNumber + 1, 0))); + this.handleEdits(edits, true); + if (!this.initialAstWithoutTokens) { + this.didChangeEmitter.fire(); + } + } + handleContentChanged(change) { + const edits = TextEditInfo.fromModelContentChanges(change.changes); + this.handleEdits(edits, false); + } + handleEdits(edits, tokenChange) { + const result = combineTextEditInfos(this.queuedTextEdits, edits); + this.queuedTextEdits = result; + if (this.initialAstWithoutTokens && !tokenChange) { + this.queuedTextEditsForInitialAstWithoutTokens = combineTextEditInfos(this.queuedTextEditsForInitialAstWithoutTokens, edits); + } + } + //#endregion + flushQueue() { + if (this.queuedTextEdits.length > 0) { + this.astWithTokens = this.parseDocumentFromTextBuffer(this.queuedTextEdits, this.astWithTokens, false); + this.queuedTextEdits = []; + } + if (this.queuedTextEditsForInitialAstWithoutTokens.length > 0) { + if (this.initialAstWithoutTokens) { + this.initialAstWithoutTokens = this.parseDocumentFromTextBuffer(this.queuedTextEditsForInitialAstWithoutTokens, this.initialAstWithoutTokens, false); + } + this.queuedTextEditsForInitialAstWithoutTokens = []; + } + } + /** + * @pure (only if isPure = true) + */ + parseDocumentFromTextBuffer(edits, previousAst, immutable) { + const isPure = false; + const previousAstClone = isPure ? previousAst?.deepClone() : previousAst; + const tokenizer = new TextBufferTokenizer(this.textModel, this.brackets); + const result = parseDocument(tokenizer, edits, previousAstClone, immutable); + return result; + } + getBracketsInRange(range2, onlyColorizedBrackets) { + this.flushQueue(); + const startOffset = toLength(range2.startLineNumber - 1, range2.startColumn - 1); + const endOffset = toLength(range2.endLineNumber - 1, range2.endColumn - 1); + return new CallbackIterable((cb) => { + const node = this.initialAstWithoutTokens || this.astWithTokens; + collectBrackets(node, lengthZero, node.length, startOffset, endOffset, cb, 0, 0, /* @__PURE__ */ new Map(), onlyColorizedBrackets); + }); + } + getBracketPairsInRange(range2, includeMinIndentation) { + this.flushQueue(); + const startLength = positionToLength(range2.getStartPosition()); + const endLength = positionToLength(range2.getEndPosition()); + return new CallbackIterable((cb) => { + const node = this.initialAstWithoutTokens || this.astWithTokens; + const context = new CollectBracketPairsContext(cb, includeMinIndentation, this.textModel); + collectBracketPairs(node, lengthZero, node.length, startLength, endLength, context, 0, /* @__PURE__ */ new Map()); + }); + } + getFirstBracketAfter(position) { + this.flushQueue(); + const node = this.initialAstWithoutTokens || this.astWithTokens; + return getFirstBracketAfter(node, lengthZero, node.length, positionToLength(position)); + } + getFirstBracketBefore(position) { + this.flushQueue(); + const node = this.initialAstWithoutTokens || this.astWithTokens; + return getFirstBracketBefore(node, lengthZero, node.length, positionToLength(position)); + } + }; + CollectBracketPairsContext = class { + constructor(push, includeMinIndentation, textModel) { + this.push = push; + this.includeMinIndentation = includeMinIndentation; + this.textModel = textModel; + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsImpl.js +function createDisposableRef(object, disposable) { + return { + object, + dispose: () => disposable?.dispose() + }; +} +function createTimeBasedContinueBracketSearchPredicate(maxDuration) { + if (typeof maxDuration === "undefined") { + return () => true; + } else { + const startTime = Date.now(); + return () => { + return Date.now() - startTime <= maxDuration; + }; + } +} +function stripBracketSearchCanceled(result) { + if (result instanceof BracketSearchCanceled) { + return null; + } + return result; +} +var BracketPairsTextModelPart, BracketSearchCanceled; +var init_bracketPairsImpl = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsImpl.js"() { + init_arrays(); + init_event(); + init_lifecycle(); + init_range(); + init_supports(); + init_richEditBrackets(); + init_bracketPairsTree(); + BracketPairsTextModelPart = class extends Disposable { + get canBuildAST() { + const maxSupportedDocumentLength = ( + /* max lines */ + 5e4 * /* average column count */ + 100 + ); + return this.textModel.getValueLength() <= maxSupportedDocumentLength; + } + constructor(textModel, languageConfigurationService) { + super(); + this.textModel = textModel; + this.languageConfigurationService = languageConfigurationService; + this.bracketPairsTree = this._register(new MutableDisposable()); + this.onDidChangeEmitter = new Emitter(); + this.onDidChange = this.onDidChangeEmitter.event; + this.bracketsRequested = false; + } + //#region TextModel events + handleLanguageConfigurationServiceChange(e) { + if (!e.languageId || this.bracketPairsTree.value?.object.didLanguageChange(e.languageId)) { + this.bracketPairsTree.clear(); + this.updateBracketPairsTree(); + } + } + handleDidChangeOptions(e) { + this.bracketPairsTree.clear(); + this.updateBracketPairsTree(); + } + handleDidChangeLanguage(e) { + this.bracketPairsTree.clear(); + this.updateBracketPairsTree(); + } + handleDidChangeContent(change) { + this.bracketPairsTree.value?.object.handleContentChanged(change); + } + handleDidChangeBackgroundTokenizationState() { + this.bracketPairsTree.value?.object.handleDidChangeBackgroundTokenizationState(); + } + handleDidChangeTokens(e) { + this.bracketPairsTree.value?.object.handleDidChangeTokens(e); + } + //#endregion + updateBracketPairsTree() { + if (this.bracketsRequested && this.canBuildAST) { + if (!this.bracketPairsTree.value) { + const store = new DisposableStore(); + this.bracketPairsTree.value = createDisposableRef(store.add(new BracketPairsTree(this.textModel, (languageId) => { + return this.languageConfigurationService.getLanguageConfiguration(languageId); + })), store); + store.add(this.bracketPairsTree.value.object.onDidChange((e) => this.onDidChangeEmitter.fire(e))); + this.onDidChangeEmitter.fire(); + } + } else { + if (this.bracketPairsTree.value) { + this.bracketPairsTree.clear(); + this.onDidChangeEmitter.fire(); + } + } + } + /** + * Returns all bracket pairs that intersect the given range. + * The result is sorted by the start position. + */ + getBracketPairsInRange(range2) { + this.bracketsRequested = true; + this.updateBracketPairsTree(); + return this.bracketPairsTree.value?.object.getBracketPairsInRange(range2, false) || CallbackIterable.empty; + } + getBracketPairsInRangeWithMinIndentation(range2) { + this.bracketsRequested = true; + this.updateBracketPairsTree(); + return this.bracketPairsTree.value?.object.getBracketPairsInRange(range2, true) || CallbackIterable.empty; + } + getBracketsInRange(range2, onlyColorizedBrackets = false) { + this.bracketsRequested = true; + this.updateBracketPairsTree(); + return this.bracketPairsTree.value?.object.getBracketsInRange(range2, onlyColorizedBrackets) || CallbackIterable.empty; + } + findMatchingBracketUp(_bracket, _position, maxDuration) { + const position = this.textModel.validatePosition(_position); + const languageId = this.textModel.getLanguageIdAtPosition(position.lineNumber, position.column); + if (this.canBuildAST) { + const closingBracketInfo = this.languageConfigurationService.getLanguageConfiguration(languageId).bracketsNew.getClosingBracketInfo(_bracket); + if (!closingBracketInfo) { + return null; + } + const bracketPair = this.getBracketPairsInRange(Range.fromPositions(_position, _position)).findLast((b) => closingBracketInfo.closes(b.openingBracketInfo)); + if (bracketPair) { + return bracketPair.openingBracketRange; + } + return null; + } else { + const bracket = _bracket.toLowerCase(); + const bracketsSupport = this.languageConfigurationService.getLanguageConfiguration(languageId).brackets; + if (!bracketsSupport) { + return null; + } + const data = bracketsSupport.textIsBracket[bracket]; + if (!data) { + return null; + } + return stripBracketSearchCanceled(this._findMatchingBracketUp(data, position, createTimeBasedContinueBracketSearchPredicate(maxDuration))); + } + } + matchBracket(position, maxDuration) { + if (this.canBuildAST) { + const bracketPair = this.getBracketPairsInRange(Range.fromPositions(position, position)).filter((item) => item.closingBracketRange !== void 0 && (item.openingBracketRange.containsPosition(position) || item.closingBracketRange.containsPosition(position))).findLastMaxBy(compareBy((item) => item.openingBracketRange.containsPosition(position) ? item.openingBracketRange : item.closingBracketRange, Range.compareRangesUsingStarts)); + if (bracketPair) { + return [bracketPair.openingBracketRange, bracketPair.closingBracketRange]; + } + return null; + } else { + const continueSearchPredicate = createTimeBasedContinueBracketSearchPredicate(maxDuration); + return this._matchBracket(this.textModel.validatePosition(position), continueSearchPredicate); + } + } + _establishBracketSearchOffsets(position, lineTokens, modeBrackets, tokenIndex) { + const tokenCount = lineTokens.getCount(); + const currentLanguageId = lineTokens.getLanguageId(tokenIndex); + let searchStartOffset = Math.max(0, position.column - 1 - modeBrackets.maxBracketLength); + for (let i2 = tokenIndex - 1; i2 >= 0; i2--) { + const tokenEndOffset = lineTokens.getEndOffset(i2); + if (tokenEndOffset <= searchStartOffset) { + break; + } + if (ignoreBracketsInToken(lineTokens.getStandardTokenType(i2)) || lineTokens.getLanguageId(i2) !== currentLanguageId) { + searchStartOffset = tokenEndOffset; + break; + } + } + let searchEndOffset = Math.min(lineTokens.getLineContent().length, position.column - 1 + modeBrackets.maxBracketLength); + for (let i2 = tokenIndex + 1; i2 < tokenCount; i2++) { + const tokenStartOffset = lineTokens.getStartOffset(i2); + if (tokenStartOffset >= searchEndOffset) { + break; + } + if (ignoreBracketsInToken(lineTokens.getStandardTokenType(i2)) || lineTokens.getLanguageId(i2) !== currentLanguageId) { + searchEndOffset = tokenStartOffset; + break; + } + } + return { searchStartOffset, searchEndOffset }; + } + _matchBracket(position, continueSearchPredicate) { + const lineNumber = position.lineNumber; + const lineTokens = this.textModel.tokenization.getLineTokens(lineNumber); + const lineText = this.textModel.getLineContent(lineNumber); + const tokenIndex = lineTokens.findTokenIndexAtOffset(position.column - 1); + if (tokenIndex < 0) { + return null; + } + const currentModeBrackets = this.languageConfigurationService.getLanguageConfiguration(lineTokens.getLanguageId(tokenIndex)).brackets; + if (currentModeBrackets && !ignoreBracketsInToken(lineTokens.getStandardTokenType(tokenIndex))) { + let { searchStartOffset, searchEndOffset } = this._establishBracketSearchOffsets(position, lineTokens, currentModeBrackets, tokenIndex); + let bestResult = null; + while (true) { + const foundBracket = BracketsUtils.findNextBracketInRange(currentModeBrackets.forwardRegex, lineNumber, lineText, searchStartOffset, searchEndOffset); + if (!foundBracket) { + break; + } + if (foundBracket.startColumn <= position.column && position.column <= foundBracket.endColumn) { + const foundBracketText = lineText.substring(foundBracket.startColumn - 1, foundBracket.endColumn - 1).toLowerCase(); + const r = this._matchFoundBracket(foundBracket, currentModeBrackets.textIsBracket[foundBracketText], currentModeBrackets.textIsOpenBracket[foundBracketText], continueSearchPredicate); + if (r) { + if (r instanceof BracketSearchCanceled) { + return null; + } + bestResult = r; + } + } + searchStartOffset = foundBracket.endColumn - 1; + } + if (bestResult) { + return bestResult; + } + } + if (tokenIndex > 0 && lineTokens.getStartOffset(tokenIndex) === position.column - 1) { + const prevTokenIndex = tokenIndex - 1; + const prevModeBrackets = this.languageConfigurationService.getLanguageConfiguration(lineTokens.getLanguageId(prevTokenIndex)).brackets; + if (prevModeBrackets && !ignoreBracketsInToken(lineTokens.getStandardTokenType(prevTokenIndex))) { + const { searchStartOffset, searchEndOffset } = this._establishBracketSearchOffsets(position, lineTokens, prevModeBrackets, prevTokenIndex); + const foundBracket = BracketsUtils.findPrevBracketInRange(prevModeBrackets.reversedRegex, lineNumber, lineText, searchStartOffset, searchEndOffset); + if (foundBracket && foundBracket.startColumn <= position.column && position.column <= foundBracket.endColumn) { + const foundBracketText = lineText.substring(foundBracket.startColumn - 1, foundBracket.endColumn - 1).toLowerCase(); + const r = this._matchFoundBracket(foundBracket, prevModeBrackets.textIsBracket[foundBracketText], prevModeBrackets.textIsOpenBracket[foundBracketText], continueSearchPredicate); + if (r) { + if (r instanceof BracketSearchCanceled) { + return null; + } + return r; + } + } + } + } + return null; + } + _matchFoundBracket(foundBracket, data, isOpen, continueSearchPredicate) { + if (!data) { + return null; + } + const matched = isOpen ? this._findMatchingBracketDown(data, foundBracket.getEndPosition(), continueSearchPredicate) : this._findMatchingBracketUp(data, foundBracket.getStartPosition(), continueSearchPredicate); + if (!matched) { + return null; + } + if (matched instanceof BracketSearchCanceled) { + return matched; + } + return [foundBracket, matched]; + } + _findMatchingBracketUp(bracket, position, continueSearchPredicate) { + const languageId = bracket.languageId; + const reversedBracketRegex = bracket.reversedRegex; + let count = -1; + let totalCallCount = 0; + const searchPrevMatchingBracketInRange = (lineNumber, lineText, searchStartOffset, searchEndOffset) => { + while (true) { + if (continueSearchPredicate && ++totalCallCount % 100 === 0 && !continueSearchPredicate()) { + return BracketSearchCanceled.INSTANCE; + } + const r = BracketsUtils.findPrevBracketInRange(reversedBracketRegex, lineNumber, lineText, searchStartOffset, searchEndOffset); + if (!r) { + break; + } + const hitText = lineText.substring(r.startColumn - 1, r.endColumn - 1).toLowerCase(); + if (bracket.isOpen(hitText)) { + count++; + } else if (bracket.isClose(hitText)) { + count--; + } + if (count === 0) { + return r; + } + searchEndOffset = r.startColumn - 1; + } + return null; + }; + for (let lineNumber = position.lineNumber; lineNumber >= 1; lineNumber--) { + const lineTokens = this.textModel.tokenization.getLineTokens(lineNumber); + const tokenCount = lineTokens.getCount(); + const lineText = this.textModel.getLineContent(lineNumber); + let tokenIndex = tokenCount - 1; + let searchStartOffset = lineText.length; + let searchEndOffset = lineText.length; + if (lineNumber === position.lineNumber) { + tokenIndex = lineTokens.findTokenIndexAtOffset(position.column - 1); + searchStartOffset = position.column - 1; + searchEndOffset = position.column - 1; + } + let prevSearchInToken = true; + for (; tokenIndex >= 0; tokenIndex--) { + const searchInToken = lineTokens.getLanguageId(tokenIndex) === languageId && !ignoreBracketsInToken(lineTokens.getStandardTokenType(tokenIndex)); + if (searchInToken) { + if (prevSearchInToken) { + searchStartOffset = lineTokens.getStartOffset(tokenIndex); + } else { + searchStartOffset = lineTokens.getStartOffset(tokenIndex); + searchEndOffset = lineTokens.getEndOffset(tokenIndex); + } + } else { + if (prevSearchInToken && searchStartOffset !== searchEndOffset) { + const r = searchPrevMatchingBracketInRange(lineNumber, lineText, searchStartOffset, searchEndOffset); + if (r) { + return r; + } + } + } + prevSearchInToken = searchInToken; + } + if (prevSearchInToken && searchStartOffset !== searchEndOffset) { + const r = searchPrevMatchingBracketInRange(lineNumber, lineText, searchStartOffset, searchEndOffset); + if (r) { + return r; + } + } + } + return null; + } + _findMatchingBracketDown(bracket, position, continueSearchPredicate) { + const languageId = bracket.languageId; + const bracketRegex = bracket.forwardRegex; + let count = 1; + let totalCallCount = 0; + const searchNextMatchingBracketInRange = (lineNumber, lineText, searchStartOffset, searchEndOffset) => { + while (true) { + if (continueSearchPredicate && ++totalCallCount % 100 === 0 && !continueSearchPredicate()) { + return BracketSearchCanceled.INSTANCE; + } + const r = BracketsUtils.findNextBracketInRange(bracketRegex, lineNumber, lineText, searchStartOffset, searchEndOffset); + if (!r) { + break; + } + const hitText = lineText.substring(r.startColumn - 1, r.endColumn - 1).toLowerCase(); + if (bracket.isOpen(hitText)) { + count++; + } else if (bracket.isClose(hitText)) { + count--; + } + if (count === 0) { + return r; + } + searchStartOffset = r.endColumn - 1; + } + return null; + }; + const lineCount = this.textModel.getLineCount(); + for (let lineNumber = position.lineNumber; lineNumber <= lineCount; lineNumber++) { + const lineTokens = this.textModel.tokenization.getLineTokens(lineNumber); + const tokenCount = lineTokens.getCount(); + const lineText = this.textModel.getLineContent(lineNumber); + let tokenIndex = 0; + let searchStartOffset = 0; + let searchEndOffset = 0; + if (lineNumber === position.lineNumber) { + tokenIndex = lineTokens.findTokenIndexAtOffset(position.column - 1); + searchStartOffset = position.column - 1; + searchEndOffset = position.column - 1; + } + let prevSearchInToken = true; + for (; tokenIndex < tokenCount; tokenIndex++) { + const searchInToken = lineTokens.getLanguageId(tokenIndex) === languageId && !ignoreBracketsInToken(lineTokens.getStandardTokenType(tokenIndex)); + if (searchInToken) { + if (prevSearchInToken) { + searchEndOffset = lineTokens.getEndOffset(tokenIndex); + } else { + searchStartOffset = lineTokens.getStartOffset(tokenIndex); + searchEndOffset = lineTokens.getEndOffset(tokenIndex); + } + } else { + if (prevSearchInToken && searchStartOffset !== searchEndOffset) { + const r = searchNextMatchingBracketInRange(lineNumber, lineText, searchStartOffset, searchEndOffset); + if (r) { + return r; + } + } + } + prevSearchInToken = searchInToken; + } + if (prevSearchInToken && searchStartOffset !== searchEndOffset) { + const r = searchNextMatchingBracketInRange(lineNumber, lineText, searchStartOffset, searchEndOffset); + if (r) { + return r; + } + } + } + return null; + } + findPrevBracket(_position) { + const position = this.textModel.validatePosition(_position); + if (this.canBuildAST) { + this.bracketsRequested = true; + this.updateBracketPairsTree(); + return this.bracketPairsTree.value?.object.getFirstBracketBefore(position) || null; + } + let languageId = null; + let modeBrackets = null; + let bracketConfig = null; + for (let lineNumber = position.lineNumber; lineNumber >= 1; lineNumber--) { + const lineTokens = this.textModel.tokenization.getLineTokens(lineNumber); + const tokenCount = lineTokens.getCount(); + const lineText = this.textModel.getLineContent(lineNumber); + let tokenIndex = tokenCount - 1; + let searchStartOffset = lineText.length; + let searchEndOffset = lineText.length; + if (lineNumber === position.lineNumber) { + tokenIndex = lineTokens.findTokenIndexAtOffset(position.column - 1); + searchStartOffset = position.column - 1; + searchEndOffset = position.column - 1; + const tokenLanguageId = lineTokens.getLanguageId(tokenIndex); + if (languageId !== tokenLanguageId) { + languageId = tokenLanguageId; + modeBrackets = this.languageConfigurationService.getLanguageConfiguration(languageId).brackets; + bracketConfig = this.languageConfigurationService.getLanguageConfiguration(languageId).bracketsNew; + } + } + let prevSearchInToken = true; + for (; tokenIndex >= 0; tokenIndex--) { + const tokenLanguageId = lineTokens.getLanguageId(tokenIndex); + if (languageId !== tokenLanguageId) { + if (modeBrackets && bracketConfig && prevSearchInToken && searchStartOffset !== searchEndOffset) { + const r = BracketsUtils.findPrevBracketInRange(modeBrackets.reversedRegex, lineNumber, lineText, searchStartOffset, searchEndOffset); + if (r) { + return this._toFoundBracket(bracketConfig, r); + } + prevSearchInToken = false; + } + languageId = tokenLanguageId; + modeBrackets = this.languageConfigurationService.getLanguageConfiguration(languageId).brackets; + bracketConfig = this.languageConfigurationService.getLanguageConfiguration(languageId).bracketsNew; + } + const searchInToken = !!modeBrackets && !ignoreBracketsInToken(lineTokens.getStandardTokenType(tokenIndex)); + if (searchInToken) { + if (prevSearchInToken) { + searchStartOffset = lineTokens.getStartOffset(tokenIndex); + } else { + searchStartOffset = lineTokens.getStartOffset(tokenIndex); + searchEndOffset = lineTokens.getEndOffset(tokenIndex); + } + } else { + if (bracketConfig && modeBrackets && prevSearchInToken && searchStartOffset !== searchEndOffset) { + const r = BracketsUtils.findPrevBracketInRange(modeBrackets.reversedRegex, lineNumber, lineText, searchStartOffset, searchEndOffset); + if (r) { + return this._toFoundBracket(bracketConfig, r); + } + } + } + prevSearchInToken = searchInToken; + } + if (bracketConfig && modeBrackets && prevSearchInToken && searchStartOffset !== searchEndOffset) { + const r = BracketsUtils.findPrevBracketInRange(modeBrackets.reversedRegex, lineNumber, lineText, searchStartOffset, searchEndOffset); + if (r) { + return this._toFoundBracket(bracketConfig, r); + } + } + } + return null; + } + findNextBracket(_position) { + const position = this.textModel.validatePosition(_position); + if (this.canBuildAST) { + this.bracketsRequested = true; + this.updateBracketPairsTree(); + return this.bracketPairsTree.value?.object.getFirstBracketAfter(position) || null; + } + const lineCount = this.textModel.getLineCount(); + let languageId = null; + let modeBrackets = null; + let bracketConfig = null; + for (let lineNumber = position.lineNumber; lineNumber <= lineCount; lineNumber++) { + const lineTokens = this.textModel.tokenization.getLineTokens(lineNumber); + const tokenCount = lineTokens.getCount(); + const lineText = this.textModel.getLineContent(lineNumber); + let tokenIndex = 0; + let searchStartOffset = 0; + let searchEndOffset = 0; + if (lineNumber === position.lineNumber) { + tokenIndex = lineTokens.findTokenIndexAtOffset(position.column - 1); + searchStartOffset = position.column - 1; + searchEndOffset = position.column - 1; + const tokenLanguageId = lineTokens.getLanguageId(tokenIndex); + if (languageId !== tokenLanguageId) { + languageId = tokenLanguageId; + modeBrackets = this.languageConfigurationService.getLanguageConfiguration(languageId).brackets; + bracketConfig = this.languageConfigurationService.getLanguageConfiguration(languageId).bracketsNew; + } + } + let prevSearchInToken = true; + for (; tokenIndex < tokenCount; tokenIndex++) { + const tokenLanguageId = lineTokens.getLanguageId(tokenIndex); + if (languageId !== tokenLanguageId) { + if (bracketConfig && modeBrackets && prevSearchInToken && searchStartOffset !== searchEndOffset) { + const r = BracketsUtils.findNextBracketInRange(modeBrackets.forwardRegex, lineNumber, lineText, searchStartOffset, searchEndOffset); + if (r) { + return this._toFoundBracket(bracketConfig, r); + } + prevSearchInToken = false; + } + languageId = tokenLanguageId; + modeBrackets = this.languageConfigurationService.getLanguageConfiguration(languageId).brackets; + bracketConfig = this.languageConfigurationService.getLanguageConfiguration(languageId).bracketsNew; + } + const searchInToken = !!modeBrackets && !ignoreBracketsInToken(lineTokens.getStandardTokenType(tokenIndex)); + if (searchInToken) { + if (prevSearchInToken) { + searchEndOffset = lineTokens.getEndOffset(tokenIndex); + } else { + searchStartOffset = lineTokens.getStartOffset(tokenIndex); + searchEndOffset = lineTokens.getEndOffset(tokenIndex); + } + } else { + if (bracketConfig && modeBrackets && prevSearchInToken && searchStartOffset !== searchEndOffset) { + const r = BracketsUtils.findNextBracketInRange(modeBrackets.forwardRegex, lineNumber, lineText, searchStartOffset, searchEndOffset); + if (r) { + return this._toFoundBracket(bracketConfig, r); + } + } + } + prevSearchInToken = searchInToken; + } + if (bracketConfig && modeBrackets && prevSearchInToken && searchStartOffset !== searchEndOffset) { + const r = BracketsUtils.findNextBracketInRange(modeBrackets.forwardRegex, lineNumber, lineText, searchStartOffset, searchEndOffset); + if (r) { + return this._toFoundBracket(bracketConfig, r); + } + } + } + return null; + } + findEnclosingBrackets(_position, maxDuration) { + const position = this.textModel.validatePosition(_position); + if (this.canBuildAST) { + const range2 = Range.fromPositions(position); + const bracketPair = this.getBracketPairsInRange(Range.fromPositions(position, position)).findLast((item) => item.closingBracketRange !== void 0 && item.range.strictContainsRange(range2)); + if (bracketPair) { + return [bracketPair.openingBracketRange, bracketPair.closingBracketRange]; + } + return null; + } + const continueSearchPredicate = createTimeBasedContinueBracketSearchPredicate(maxDuration); + const lineCount = this.textModel.getLineCount(); + const savedCounts = /* @__PURE__ */ new Map(); + let counts = []; + const resetCounts = (languageId2, modeBrackets2) => { + if (!savedCounts.has(languageId2)) { + const tmp = []; + for (let i2 = 0, len = modeBrackets2 ? modeBrackets2.brackets.length : 0; i2 < len; i2++) { + tmp[i2] = 0; + } + savedCounts.set(languageId2, tmp); + } + counts = savedCounts.get(languageId2); + }; + let totalCallCount = 0; + const searchInRange = (modeBrackets2, lineNumber, lineText, searchStartOffset, searchEndOffset) => { + while (true) { + if (continueSearchPredicate && ++totalCallCount % 100 === 0 && !continueSearchPredicate()) { + return BracketSearchCanceled.INSTANCE; + } + const r = BracketsUtils.findNextBracketInRange(modeBrackets2.forwardRegex, lineNumber, lineText, searchStartOffset, searchEndOffset); + if (!r) { + break; + } + const hitText = lineText.substring(r.startColumn - 1, r.endColumn - 1).toLowerCase(); + const bracket = modeBrackets2.textIsBracket[hitText]; + if (bracket) { + if (bracket.isOpen(hitText)) { + counts[bracket.index]++; + } else if (bracket.isClose(hitText)) { + counts[bracket.index]--; + } + if (counts[bracket.index] === -1) { + return this._matchFoundBracket(r, bracket, false, continueSearchPredicate); + } + } + searchStartOffset = r.endColumn - 1; + } + return null; + }; + let languageId = null; + let modeBrackets = null; + for (let lineNumber = position.lineNumber; lineNumber <= lineCount; lineNumber++) { + const lineTokens = this.textModel.tokenization.getLineTokens(lineNumber); + const tokenCount = lineTokens.getCount(); + const lineText = this.textModel.getLineContent(lineNumber); + let tokenIndex = 0; + let searchStartOffset = 0; + let searchEndOffset = 0; + if (lineNumber === position.lineNumber) { + tokenIndex = lineTokens.findTokenIndexAtOffset(position.column - 1); + searchStartOffset = position.column - 1; + searchEndOffset = position.column - 1; + const tokenLanguageId = lineTokens.getLanguageId(tokenIndex); + if (languageId !== tokenLanguageId) { + languageId = tokenLanguageId; + modeBrackets = this.languageConfigurationService.getLanguageConfiguration(languageId).brackets; + resetCounts(languageId, modeBrackets); + } + } + let prevSearchInToken = true; + for (; tokenIndex < tokenCount; tokenIndex++) { + const tokenLanguageId = lineTokens.getLanguageId(tokenIndex); + if (languageId !== tokenLanguageId) { + if (modeBrackets && prevSearchInToken && searchStartOffset !== searchEndOffset) { + const r = searchInRange(modeBrackets, lineNumber, lineText, searchStartOffset, searchEndOffset); + if (r) { + return stripBracketSearchCanceled(r); + } + prevSearchInToken = false; + } + languageId = tokenLanguageId; + modeBrackets = this.languageConfigurationService.getLanguageConfiguration(languageId).brackets; + resetCounts(languageId, modeBrackets); + } + const searchInToken = !!modeBrackets && !ignoreBracketsInToken(lineTokens.getStandardTokenType(tokenIndex)); + if (searchInToken) { + if (prevSearchInToken) { + searchEndOffset = lineTokens.getEndOffset(tokenIndex); + } else { + searchStartOffset = lineTokens.getStartOffset(tokenIndex); + searchEndOffset = lineTokens.getEndOffset(tokenIndex); + } + } else { + if (modeBrackets && prevSearchInToken && searchStartOffset !== searchEndOffset) { + const r = searchInRange(modeBrackets, lineNumber, lineText, searchStartOffset, searchEndOffset); + if (r) { + return stripBracketSearchCanceled(r); + } + } + } + prevSearchInToken = searchInToken; + } + if (modeBrackets && prevSearchInToken && searchStartOffset !== searchEndOffset) { + const r = searchInRange(modeBrackets, lineNumber, lineText, searchStartOffset, searchEndOffset); + if (r) { + return stripBracketSearchCanceled(r); + } + } + } + return null; + } + _toFoundBracket(bracketConfig, r) { + if (!r) { + return null; + } + let text2 = this.textModel.getValueInRange(r); + text2 = text2.toLowerCase(); + const bracketInfo = bracketConfig.getBracketInfo(text2); + if (!bracketInfo) { + return null; + } + return { + range: r, + bracketInfo + }; + } + }; + BracketSearchCanceled = class _BracketSearchCanceled { + static { + this.INSTANCE = new _BracketSearchCanceled(); + } + constructor() { + this._searchCanceledBrand = void 0; + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/common/model/bracketPairsTextModelPart/colorizedBracketPairsDecorationProvider.js +var ColorizedBracketPairsDecorationProvider, ColorProvider; +var init_colorizedBracketPairsDecorationProvider = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/common/model/bracketPairsTextModelPart/colorizedBracketPairsDecorationProvider.js"() { + init_event(); + init_lifecycle(); + init_range(); + init_editorColorRegistry(); + init_themeService(); + ColorizedBracketPairsDecorationProvider = class extends Disposable { + constructor(textModel) { + super(); + this.textModel = textModel; + this.colorProvider = new ColorProvider(); + this.onDidChangeEmitter = new Emitter(); + this.onDidChange = this.onDidChangeEmitter.event; + this.colorizationOptions = textModel.getOptions().bracketPairColorizationOptions; + this._register(textModel.bracketPairs.onDidChange((e) => { + this.onDidChangeEmitter.fire(); + })); + } + //#region TextModel events + handleDidChangeOptions(e) { + this.colorizationOptions = this.textModel.getOptions().bracketPairColorizationOptions; + } + //#endregion + getDecorationsInRange(range2, ownerId2, filterOutValidation, onlyMinimapDecorations) { + if (onlyMinimapDecorations) { + return []; + } + if (ownerId2 === void 0) { + return []; + } + if (!this.colorizationOptions.enabled) { + return []; + } + const result = this.textModel.bracketPairs.getBracketsInRange(range2, true).map((bracket) => ({ + id: `bracket${bracket.range.toString()}-${bracket.nestingLevel}`, + options: { + description: "BracketPairColorization", + inlineClassName: this.colorProvider.getInlineClassName(bracket, this.colorizationOptions.independentColorPoolPerBracketType) + }, + ownerId: 0, + range: bracket.range + })).toArray(); + return result; + } + getAllDecorations(ownerId2, filterOutValidation) { + if (ownerId2 === void 0) { + return []; + } + if (!this.colorizationOptions.enabled) { + return []; + } + return this.getDecorationsInRange(new Range(1, 1, this.textModel.getLineCount(), 1), ownerId2, filterOutValidation); + } + }; + ColorProvider = class { + constructor() { + this.unexpectedClosingBracketClassName = "unexpected-closing-bracket"; + } + getInlineClassName(bracket, independentColorPoolPerBracketType) { + if (bracket.isInvalid) { + return this.unexpectedClosingBracketClassName; + } + return this.getInlineClassNameOfLevel(independentColorPoolPerBracketType ? bracket.nestingLevelOfEqualBracketType : bracket.nestingLevel); + } + getInlineClassNameOfLevel(level) { + return `bracket-highlighting-${level % 30}`; + } + }; + registerThemingParticipant((theme, collector) => { + const colors = [ + editorBracketHighlightingForeground1, + editorBracketHighlightingForeground2, + editorBracketHighlightingForeground3, + editorBracketHighlightingForeground4, + editorBracketHighlightingForeground5, + editorBracketHighlightingForeground6 + ]; + const colorProvider = new ColorProvider(); + collector.addRule(`.monaco-editor .${colorProvider.unexpectedClosingBracketClassName} { color: ${theme.getColor(editorBracketHighlightingUnexpectedBracketForeground)}; }`); + const colorValues = colors.map((c) => theme.getColor(c)).filter((c) => !!c).filter((c) => !c.isTransparent()); + for (let level = 0; level < 30; level++) { + const color = colorValues[level % colorValues.length]; + collector.addRule(`.monaco-editor .${colorProvider.getInlineClassNameOfLevel(level)} { color: ${color}; }`); + } + }); + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/common/core/textChange.js +function escapeNewLine(str) { + return str.replace(/\n/g, "\\n").replace(/\r/g, "\\r"); +} +function compressConsecutiveTextChanges(prevEdits, currEdits) { + if (prevEdits === null || prevEdits.length === 0) { + return currEdits; + } + const compressor = new TextChangeCompressor(prevEdits, currEdits); + return compressor.compress(); +} +var TextChange, TextChangeCompressor; +var init_textChange = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/common/core/textChange.js"() { + init_buffer(); + init_stringBuilder(); + TextChange = class _TextChange { + get oldLength() { + return this.oldText.length; + } + get oldEnd() { + return this.oldPosition + this.oldText.length; + } + get newLength() { + return this.newText.length; + } + get newEnd() { + return this.newPosition + this.newText.length; + } + constructor(oldPosition, oldText, newPosition, newText) { + this.oldPosition = oldPosition; + this.oldText = oldText; + this.newPosition = newPosition; + this.newText = newText; + } + toString() { + if (this.oldText.length === 0) { + return `(insert@${this.oldPosition} "${escapeNewLine(this.newText)}")`; + } + if (this.newText.length === 0) { + return `(delete@${this.oldPosition} "${escapeNewLine(this.oldText)}")`; + } + return `(replace@${this.oldPosition} "${escapeNewLine(this.oldText)}" with "${escapeNewLine(this.newText)}")`; + } + static _writeStringSize(str) { + return 4 + 2 * str.length; + } + static _writeString(b, str, offset) { + const len = str.length; + writeUInt32BE(b, len, offset); + offset += 4; + for (let i2 = 0; i2 < len; i2++) { + writeUInt16LE(b, str.charCodeAt(i2), offset); + offset += 2; + } + return offset; + } + static _readString(b, offset) { + const len = readUInt32BE(b, offset); + offset += 4; + return decodeUTF16LE(b, offset, len); + } + writeSize() { + return 4 + 4 + _TextChange._writeStringSize(this.oldText) + _TextChange._writeStringSize(this.newText); + } + write(b, offset) { + writeUInt32BE(b, this.oldPosition, offset); + offset += 4; + writeUInt32BE(b, this.newPosition, offset); + offset += 4; + offset = _TextChange._writeString(b, this.oldText, offset); + offset = _TextChange._writeString(b, this.newText, offset); + return offset; + } + static read(b, offset, dest) { + const oldPosition = readUInt32BE(b, offset); + offset += 4; + const newPosition = readUInt32BE(b, offset); + offset += 4; + const oldText = _TextChange._readString(b, offset); + offset += _TextChange._writeStringSize(oldText); + const newText = _TextChange._readString(b, offset); + offset += _TextChange._writeStringSize(newText); + dest.push(new _TextChange(oldPosition, oldText, newPosition, newText)); + return offset; + } + }; + TextChangeCompressor = class _TextChangeCompressor { + constructor(prevEdits, currEdits) { + this._prevEdits = prevEdits; + this._currEdits = currEdits; + this._result = []; + this._resultLen = 0; + this._prevLen = this._prevEdits.length; + this._prevDeltaOffset = 0; + this._currLen = this._currEdits.length; + this._currDeltaOffset = 0; + } + compress() { + let prevIndex = 0; + let currIndex = 0; + let prevEdit = this._getPrev(prevIndex); + let currEdit = this._getCurr(currIndex); + while (prevIndex < this._prevLen || currIndex < this._currLen) { + if (prevEdit === null) { + this._acceptCurr(currEdit); + currEdit = this._getCurr(++currIndex); + continue; + } + if (currEdit === null) { + this._acceptPrev(prevEdit); + prevEdit = this._getPrev(++prevIndex); + continue; + } + if (currEdit.oldEnd <= prevEdit.newPosition) { + this._acceptCurr(currEdit); + currEdit = this._getCurr(++currIndex); + continue; + } + if (prevEdit.newEnd <= currEdit.oldPosition) { + this._acceptPrev(prevEdit); + prevEdit = this._getPrev(++prevIndex); + continue; + } + if (currEdit.oldPosition < prevEdit.newPosition) { + const [e1, e2] = _TextChangeCompressor._splitCurr(currEdit, prevEdit.newPosition - currEdit.oldPosition); + this._acceptCurr(e1); + currEdit = e2; + continue; + } + if (prevEdit.newPosition < currEdit.oldPosition) { + const [e1, e2] = _TextChangeCompressor._splitPrev(prevEdit, currEdit.oldPosition - prevEdit.newPosition); + this._acceptPrev(e1); + prevEdit = e2; + continue; + } + let mergePrev; + let mergeCurr; + if (currEdit.oldEnd === prevEdit.newEnd) { + mergePrev = prevEdit; + mergeCurr = currEdit; + prevEdit = this._getPrev(++prevIndex); + currEdit = this._getCurr(++currIndex); + } else if (currEdit.oldEnd < prevEdit.newEnd) { + const [e1, e2] = _TextChangeCompressor._splitPrev(prevEdit, currEdit.oldLength); + mergePrev = e1; + mergeCurr = currEdit; + prevEdit = e2; + currEdit = this._getCurr(++currIndex); + } else { + const [e1, e2] = _TextChangeCompressor._splitCurr(currEdit, prevEdit.newLength); + mergePrev = prevEdit; + mergeCurr = e1; + prevEdit = this._getPrev(++prevIndex); + currEdit = e2; + } + this._result[this._resultLen++] = new TextChange(mergePrev.oldPosition, mergePrev.oldText, mergeCurr.newPosition, mergeCurr.newText); + this._prevDeltaOffset += mergePrev.newLength - mergePrev.oldLength; + this._currDeltaOffset += mergeCurr.newLength - mergeCurr.oldLength; + } + const merged = _TextChangeCompressor._merge(this._result); + const cleaned = _TextChangeCompressor._removeNoOps(merged); + return cleaned; + } + _acceptCurr(currEdit) { + this._result[this._resultLen++] = _TextChangeCompressor._rebaseCurr(this._prevDeltaOffset, currEdit); + this._currDeltaOffset += currEdit.newLength - currEdit.oldLength; + } + _getCurr(currIndex) { + return currIndex < this._currLen ? this._currEdits[currIndex] : null; + } + _acceptPrev(prevEdit) { + this._result[this._resultLen++] = _TextChangeCompressor._rebasePrev(this._currDeltaOffset, prevEdit); + this._prevDeltaOffset += prevEdit.newLength - prevEdit.oldLength; + } + _getPrev(prevIndex) { + return prevIndex < this._prevLen ? this._prevEdits[prevIndex] : null; + } + static _rebaseCurr(prevDeltaOffset, currEdit) { + return new TextChange(currEdit.oldPosition - prevDeltaOffset, currEdit.oldText, currEdit.newPosition, currEdit.newText); + } + static _rebasePrev(currDeltaOffset, prevEdit) { + return new TextChange(prevEdit.oldPosition, prevEdit.oldText, prevEdit.newPosition + currDeltaOffset, prevEdit.newText); + } + static _splitPrev(edit2, offset) { + const preText = edit2.newText.substr(0, offset); + const postText = edit2.newText.substr(offset); + return [ + new TextChange(edit2.oldPosition, edit2.oldText, edit2.newPosition, preText), + new TextChange(edit2.oldEnd, "", edit2.newPosition + offset, postText) + ]; + } + static _splitCurr(edit2, offset) { + const preText = edit2.oldText.substr(0, offset); + const postText = edit2.oldText.substr(offset); + return [ + new TextChange(edit2.oldPosition, preText, edit2.newPosition, edit2.newText), + new TextChange(edit2.oldPosition + offset, postText, edit2.newEnd, "") + ]; + } + static _merge(edits) { + if (edits.length === 0) { + return edits; + } + const result = []; + let resultLen = 0; + let prev = edits[0]; + for (let i2 = 1; i2 < edits.length; i2++) { + const curr = edits[i2]; + if (prev.oldEnd === curr.oldPosition) { + prev = new TextChange(prev.oldPosition, prev.oldText + curr.oldText, prev.newPosition, prev.newText + curr.newText); + } else { + result[resultLen++] = prev; + prev = curr; + } + } + result[resultLen++] = prev; + return result; + } + static _removeNoOps(edits) { + if (edits.length === 0) { + return edits; + } + const result = []; + let resultLen = 0; + for (let i2 = 0; i2 < edits.length; i2++) { + const edit2 = edits[i2]; + if (edit2.oldText === edit2.newText) { + continue; + } + result[resultLen++] = edit2; + } + return result; + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/common/textModelEditSource.js +function createEditSource(metadata) { + return new TextModelEditSource(metadata, privateSymbol); +} +function toProperties(version) { + if (!version) { + return {}; + } + return { + $extensionId: version.extensionId, + $extensionVersion: version.extensionVersion, + $providerId: version.providerId + }; +} +function avoidPathRedaction(str) { + if (str === void 0) { + return void 0; + } + return str.replaceAll("/", "|"); +} +function toEditIdentity(id) { + return id; +} +var privateSymbol, TextModelEditSource, EditSources, EditDeltaInfo, EditSuggestionId; +var init_textModelEditSource = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/common/textModelEditSource.js"() { + init_uuid(); + init_textLength(); + privateSymbol = /* @__PURE__ */ Symbol("TextModelEditSource"); + TextModelEditSource = class { + constructor(metadata, _privateCtorGuard) { + this.metadata = metadata; + } + toString() { + return `${this.metadata.source}`; + } + getType() { + const metadata = this.metadata; + switch (metadata.source) { + case "cursor": + return metadata.kind; + case "inlineCompletionAccept": + return metadata.source + (metadata.$nes ? ":nes" : ""); + case "unknown": + return metadata.name || "unknown"; + default: + return metadata.source; + } + } + /** + * Converts the metadata to a key string. + * Only includes properties/values that have `level` many `$` prefixes or less. + */ + toKey(level, filter = {}) { + const metadata = this.metadata; + const keys = Object.entries(metadata).filter(([key, value]) => { + const filterVal = filter[key]; + if (filterVal !== void 0) { + return filterVal; + } + const prefixCount = (key.match(/\$/g) || []).length; + return prefixCount <= level && value !== void 0 && value !== null && value !== ""; + }).map(([key, value]) => `${key}:${value}`); + return keys.join("-"); + } + }; + EditSources = { + unknown(data) { + return createEditSource({ + source: "unknown", + name: data.name + }); + }, + rename: () => createEditSource({ source: "rename" }), + chatApplyEdits(data) { + return createEditSource({ + source: "Chat.applyEdits", + $modelId: avoidPathRedaction(data.modelId), + $extensionId: data.extensionId?.extensionId, + $extensionVersion: data.extensionId?.version, + $$languageId: data.languageId, + $$sessionId: data.sessionId, + $$requestId: data.requestId, + $$mode: data.mode, + $$codeBlockSuggestionId: data.codeBlockSuggestionId + }); + }, + chatUndoEdits: () => createEditSource({ source: "Chat.undoEdits" }), + chatReset: () => createEditSource({ source: "Chat.reset" }), + inlineCompletionAccept(data) { + return createEditSource({ + source: "inlineCompletionAccept", + $nes: data.nes, + ...toProperties(data.providerId), + $$requestUuid: data.requestUuid, + $$languageId: data.languageId + }); + }, + inlineCompletionPartialAccept(data) { + return createEditSource({ + source: "inlineCompletionPartialAccept", + type: data.type, + $nes: data.nes, + ...toProperties(data.providerId), + $$requestUuid: data.requestUuid, + $$languageId: data.languageId + }); + }, + inlineChatApplyEdit(data) { + return createEditSource({ + source: "inlineChat.applyEdits", + $modelId: avoidPathRedaction(data.modelId), + $extensionId: data.extensionId?.extensionId, + $extensionVersion: data.extensionId?.version, + $$sessionId: data.sessionId, + $$requestId: data.requestId, + $$languageId: data.languageId + }); + }, + reloadFromDisk: () => createEditSource({ source: "reloadFromDisk" }), + cursor(data) { + return createEditSource({ + source: "cursor", + kind: data.kind, + detailedSource: data.detailedSource + }); + }, + setValue: () => createEditSource({ source: "setValue" }), + eolChange: () => createEditSource({ source: "eolChange" }), + applyEdits: () => createEditSource({ source: "applyEdits" }), + snippet: () => createEditSource({ source: "snippet" }), + suggest: (data) => createEditSource({ source: "suggest", ...toProperties(data.providerId) }), + codeAction: (data) => createEditSource({ source: "codeAction", $kind: data.kind, ...toProperties(data.providerId) }) + }; + EditDeltaInfo = class _EditDeltaInfo { + static fromText(text2) { + const linesAdded = TextLength.ofText(text2).lineCount; + const charsAdded = text2.length; + return new _EditDeltaInfo(linesAdded, 0, charsAdded, 0); + } + static tryCreate(linesAdded, linesRemoved, charsAdded, charsRemoved) { + if (linesAdded === void 0 || linesRemoved === void 0 || charsAdded === void 0 || charsRemoved === void 0) { + return void 0; + } + return new _EditDeltaInfo(linesAdded, linesRemoved, charsAdded, charsRemoved); + } + constructor(linesAdded, linesRemoved, charsAdded, charsRemoved) { + this.linesAdded = linesAdded; + this.linesRemoved = linesRemoved; + this.charsAdded = charsAdded; + this.charsRemoved = charsRemoved; + } + }; + (function(EditSuggestionId2) { + function newId(genPrefixedUuid) { + const id = genPrefixedUuid ? genPrefixedUuid("sgt") : prefixedUuid("sgt"); + return toEditIdentity(id); + } + EditSuggestionId2.newId = newId; + })(EditSuggestionId || (EditSuggestionId = {})); + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/common/model/editStack.js +function uriGetComparisonKey(resource) { + return resource.toString(); +} +function getModelEOL(model) { + const eol = model.getEOL(); + if (eol === "\n") { + return 0; + } else { + return 1; + } +} +function isEditStackElement(element) { + if (!element) { + return false; + } + return element instanceof SingleModelEditStackElement || element instanceof MultiModelEditStackElement; +} +var SingleModelEditStackData, SingleModelEditStackElement, MultiModelEditStackElement, EditStack; +var init_editStack = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/common/model/editStack.js"() { + init_nls(); + init_errors(); + init_selection(); + init_uri(); + init_textChange(); + init_buffer(); + init_resources(); + init_textModelEditSource(); + SingleModelEditStackData = class _SingleModelEditStackData { + static create(model, beforeCursorState) { + const alternativeVersionId = model.getAlternativeVersionId(); + const eol = getModelEOL(model); + return new _SingleModelEditStackData(alternativeVersionId, alternativeVersionId, eol, eol, beforeCursorState, beforeCursorState, []); + } + constructor(beforeVersionId, afterVersionId, beforeEOL, afterEOL, beforeCursorState, afterCursorState, changes) { + this.beforeVersionId = beforeVersionId; + this.afterVersionId = afterVersionId; + this.beforeEOL = beforeEOL; + this.afterEOL = afterEOL; + this.beforeCursorState = beforeCursorState; + this.afterCursorState = afterCursorState; + this.changes = changes; + } + append(model, textChanges, afterEOL, afterVersionId, afterCursorState) { + if (textChanges.length > 0) { + this.changes = compressConsecutiveTextChanges(this.changes, textChanges); + } + this.afterEOL = afterEOL; + this.afterVersionId = afterVersionId; + this.afterCursorState = afterCursorState; + } + static _writeSelectionsSize(selections) { + return 4 + 4 * 4 * (selections ? selections.length : 0); + } + static _writeSelections(b, selections, offset) { + writeUInt32BE(b, selections ? selections.length : 0, offset); + offset += 4; + if (selections) { + for (const selection of selections) { + writeUInt32BE(b, selection.selectionStartLineNumber, offset); + offset += 4; + writeUInt32BE(b, selection.selectionStartColumn, offset); + offset += 4; + writeUInt32BE(b, selection.positionLineNumber, offset); + offset += 4; + writeUInt32BE(b, selection.positionColumn, offset); + offset += 4; + } + } + return offset; + } + static _readSelections(b, offset, dest) { + const count = readUInt32BE(b, offset); + offset += 4; + for (let i2 = 0; i2 < count; i2++) { + const selectionStartLineNumber = readUInt32BE(b, offset); + offset += 4; + const selectionStartColumn = readUInt32BE(b, offset); + offset += 4; + const positionLineNumber = readUInt32BE(b, offset); + offset += 4; + const positionColumn = readUInt32BE(b, offset); + offset += 4; + dest.push(new Selection(selectionStartLineNumber, selectionStartColumn, positionLineNumber, positionColumn)); + } + return offset; + } + serialize() { + let necessarySize = 4 + 4 + 1 + 1 + _SingleModelEditStackData._writeSelectionsSize(this.beforeCursorState) + _SingleModelEditStackData._writeSelectionsSize(this.afterCursorState) + 4; + for (const change of this.changes) { + necessarySize += change.writeSize(); + } + const b = new Uint8Array(necessarySize); + let offset = 0; + writeUInt32BE(b, this.beforeVersionId, offset); + offset += 4; + writeUInt32BE(b, this.afterVersionId, offset); + offset += 4; + writeUInt8(b, this.beforeEOL, offset); + offset += 1; + writeUInt8(b, this.afterEOL, offset); + offset += 1; + offset = _SingleModelEditStackData._writeSelections(b, this.beforeCursorState, offset); + offset = _SingleModelEditStackData._writeSelections(b, this.afterCursorState, offset); + writeUInt32BE(b, this.changes.length, offset); + offset += 4; + for (const change of this.changes) { + offset = change.write(b, offset); + } + return b.buffer; + } + static deserialize(source) { + const b = new Uint8Array(source); + let offset = 0; + const beforeVersionId = readUInt32BE(b, offset); + offset += 4; + const afterVersionId = readUInt32BE(b, offset); + offset += 4; + const beforeEOL = readUInt8(b, offset); + offset += 1; + const afterEOL = readUInt8(b, offset); + offset += 1; + const beforeCursorState = []; + offset = _SingleModelEditStackData._readSelections(b, offset, beforeCursorState); + const afterCursorState = []; + offset = _SingleModelEditStackData._readSelections(b, offset, afterCursorState); + const changeCount = readUInt32BE(b, offset); + offset += 4; + const changes = []; + for (let i2 = 0; i2 < changeCount; i2++) { + offset = TextChange.read(b, offset, changes); + } + return new _SingleModelEditStackData(beforeVersionId, afterVersionId, beforeEOL, afterEOL, beforeCursorState, afterCursorState, changes); + } + }; + SingleModelEditStackElement = class { + get type() { + return 0; + } + get resource() { + if (URI.isUri(this.model)) { + return this.model; + } + return this.model.uri; + } + constructor(label, code, model, beforeCursorState) { + this.label = label; + this.code = code; + this.model = model; + this._data = SingleModelEditStackData.create(model, beforeCursorState); + } + toString() { + const data = this._data instanceof SingleModelEditStackData ? this._data : SingleModelEditStackData.deserialize(this._data); + return data.changes.map((change) => change.toString()).join(", "); + } + matchesResource(resource) { + const uri = URI.isUri(this.model) ? this.model : this.model.uri; + return uri.toString() === resource.toString(); + } + setModel(model) { + this.model = model; + } + canAppend(model) { + return this.model === model && this._data instanceof SingleModelEditStackData; + } + append(model, textChanges, afterEOL, afterVersionId, afterCursorState) { + if (this._data instanceof SingleModelEditStackData) { + this._data.append(model, textChanges, afterEOL, afterVersionId, afterCursorState); + } + } + close() { + if (this._data instanceof SingleModelEditStackData) { + this._data = this._data.serialize(); + } + } + open() { + if (!(this._data instanceof SingleModelEditStackData)) { + this._data = SingleModelEditStackData.deserialize(this._data); + } + } + undo() { + if (URI.isUri(this.model)) { + throw new Error(`Invalid SingleModelEditStackElement`); + } + if (this._data instanceof SingleModelEditStackData) { + this._data = this._data.serialize(); + } + const data = SingleModelEditStackData.deserialize(this._data); + this.model._applyUndo(data.changes, data.beforeEOL, data.beforeVersionId, data.beforeCursorState); + } + redo() { + if (URI.isUri(this.model)) { + throw new Error(`Invalid SingleModelEditStackElement`); + } + if (this._data instanceof SingleModelEditStackData) { + this._data = this._data.serialize(); + } + const data = SingleModelEditStackData.deserialize(this._data); + this.model._applyRedo(data.changes, data.afterEOL, data.afterVersionId, data.afterCursorState); + } + heapSize() { + if (this._data instanceof SingleModelEditStackData) { + this._data = this._data.serialize(); + } + return this._data.byteLength + 168; + } + }; + MultiModelEditStackElement = class { + get resources() { + return this._editStackElementsArr.map((editStackElement) => editStackElement.resource); + } + constructor(label, code, editStackElements) { + this.label = label; + this.code = code; + this.type = 1; + this._isOpen = true; + this._editStackElementsArr = editStackElements.slice(0); + this._editStackElementsMap = /* @__PURE__ */ new Map(); + for (const editStackElement of this._editStackElementsArr) { + const key = uriGetComparisonKey(editStackElement.resource); + this._editStackElementsMap.set(key, editStackElement); + } + this._delegate = null; + } + prepareUndoRedo() { + if (this._delegate) { + return this._delegate.prepareUndoRedo(this); + } + } + matchesResource(resource) { + const key = uriGetComparisonKey(resource); + return this._editStackElementsMap.has(key); + } + setModel(model) { + const key = uriGetComparisonKey(URI.isUri(model) ? model : model.uri); + if (this._editStackElementsMap.has(key)) { + this._editStackElementsMap.get(key).setModel(model); + } + } + canAppend(model) { + if (!this._isOpen) { + return false; + } + const key = uriGetComparisonKey(model.uri); + if (this._editStackElementsMap.has(key)) { + const editStackElement = this._editStackElementsMap.get(key); + return editStackElement.canAppend(model); + } + return false; + } + append(model, textChanges, afterEOL, afterVersionId, afterCursorState) { + const key = uriGetComparisonKey(model.uri); + const editStackElement = this._editStackElementsMap.get(key); + editStackElement.append(model, textChanges, afterEOL, afterVersionId, afterCursorState); + } + close() { + this._isOpen = false; + } + open() { + } + undo() { + this._isOpen = false; + for (const editStackElement of this._editStackElementsArr) { + editStackElement.undo(); + } + } + redo() { + for (const editStackElement of this._editStackElementsArr) { + editStackElement.redo(); + } + } + heapSize(resource) { + const key = uriGetComparisonKey(resource); + if (this._editStackElementsMap.has(key)) { + const editStackElement = this._editStackElementsMap.get(key); + return editStackElement.heapSize(); + } + return 0; + } + split() { + return this._editStackElementsArr; + } + toString() { + const result = []; + for (const editStackElement of this._editStackElementsArr) { + result.push(`${basename2(editStackElement.resource)}: ${editStackElement}`); + } + return `{${result.join(", ")}}`; + } + }; + EditStack = class _EditStack { + constructor(model, undoRedoService) { + this._model = model; + this._undoRedoService = undoRedoService; + } + pushStackElement() { + const lastElement = this._undoRedoService.getLastElement(this._model.uri); + if (isEditStackElement(lastElement)) { + lastElement.close(); + } + } + popStackElement() { + const lastElement = this._undoRedoService.getLastElement(this._model.uri); + if (isEditStackElement(lastElement)) { + lastElement.open(); + } + } + clear() { + this._undoRedoService.removeElements(this._model.uri); + } + _getOrCreateEditStackElement(beforeCursorState, group) { + const lastElement = this._undoRedoService.getLastElement(this._model.uri); + if (isEditStackElement(lastElement) && lastElement.canAppend(this._model)) { + return lastElement; + } + const newElement = new SingleModelEditStackElement(localize(785, "Typing"), "undoredo.textBufferEdit", this._model, beforeCursorState); + this._undoRedoService.pushElement(newElement, group); + return newElement; + } + pushEOL(eol) { + const editStackElement = this._getOrCreateEditStackElement(null, void 0); + this._model.setEOL(eol); + editStackElement.append(this._model, [], getModelEOL(this._model), this._model.getAlternativeVersionId(), null); + } + pushEditOperation(beforeCursorState, editOperations, cursorStateComputer, group, reason = EditSources.unknown({ name: "pushEditOperation" })) { + const editStackElement = this._getOrCreateEditStackElement(beforeCursorState, group); + const inverseEditOperations = this._model.applyEdits(editOperations, true, reason); + const afterCursorState = _EditStack._computeCursorState(cursorStateComputer, inverseEditOperations); + const textChanges = inverseEditOperations.map((op, index) => ({ index, textChange: op.textChange })); + textChanges.sort((a, b) => { + if (a.textChange.oldPosition === b.textChange.oldPosition) { + return a.index - b.index; + } + return a.textChange.oldPosition - b.textChange.oldPosition; + }); + editStackElement.append(this._model, textChanges.map((op) => op.textChange), getModelEOL(this._model), this._model.getAlternativeVersionId(), afterCursorState); + return afterCursorState; + } + static _computeCursorState(cursorStateComputer, inverseEditOperations) { + try { + return cursorStateComputer ? cursorStateComputer(inverseEditOperations) : null; + } catch (e) { + onUnexpectedError(e); + return null; + } + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/common/model/indentationGuesser.js +function spacesDiff(a, aLength, b, bLength, result) { + result.spacesDiff = 0; + result.looksLikeAlignment = false; + let i2; + for (i2 = 0; i2 < aLength && i2 < bLength; i2++) { + const aCharCode = a.charCodeAt(i2); + const bCharCode = b.charCodeAt(i2); + if (aCharCode !== bCharCode) { + break; + } + } + let aSpacesCnt = 0, aTabsCount = 0; + for (let j = i2; j < aLength; j++) { + const aCharCode = a.charCodeAt(j); + if (aCharCode === 32) { + aSpacesCnt++; + } else { + aTabsCount++; + } + } + let bSpacesCnt = 0, bTabsCount = 0; + for (let j = i2; j < bLength; j++) { + const bCharCode = b.charCodeAt(j); + if (bCharCode === 32) { + bSpacesCnt++; + } else { + bTabsCount++; + } + } + if (aSpacesCnt > 0 && aTabsCount > 0) { + return; + } + if (bSpacesCnt > 0 && bTabsCount > 0) { + return; + } + const tabsDiff = Math.abs(aTabsCount - bTabsCount); + const spacesDiff2 = Math.abs(aSpacesCnt - bSpacesCnt); + if (tabsDiff === 0) { + result.spacesDiff = spacesDiff2; + if (spacesDiff2 > 0 && 0 <= bSpacesCnt - 1 && bSpacesCnt - 1 < a.length && bSpacesCnt < b.length) { + if (b.charCodeAt(bSpacesCnt) !== 32 && a.charCodeAt(bSpacesCnt - 1) === 32) { + if (a.charCodeAt(a.length - 1) === 44) { + result.looksLikeAlignment = true; + } + } + } + return; + } + if (spacesDiff2 % tabsDiff === 0) { + result.spacesDiff = spacesDiff2 / tabsDiff; + return; + } +} +function guessIndentation(source, defaultTabSize, defaultInsertSpaces) { + const linesCount = Math.min(source.getLineCount(), 1e4); + let linesIndentedWithTabsCount = 0; + let linesIndentedWithSpacesCount = 0; + let previousLineText = ""; + let previousLineIndentation = 0; + const ALLOWED_TAB_SIZE_GUESSES = [2, 4, 6, 8, 3, 5, 7]; + const MAX_ALLOWED_TAB_SIZE_GUESS = 8; + const spacesDiffCount = [0, 0, 0, 0, 0, 0, 0, 0, 0]; + const tmp = new SpacesDiffResult(); + for (let lineNumber = 1; lineNumber <= linesCount; lineNumber++) { + const currentLineLength = source.getLineLength(lineNumber); + const currentLineText = source.getLineContent(lineNumber); + const useCurrentLineText = currentLineLength <= 65536; + let currentLineHasContent = false; + let currentLineIndentation = 0; + let currentLineSpacesCount = 0; + let currentLineTabsCount = 0; + for (let j = 0, lenJ = currentLineLength; j < lenJ; j++) { + const charCode = useCurrentLineText ? currentLineText.charCodeAt(j) : source.getLineCharCode(lineNumber, j); + if (charCode === 9) { + currentLineTabsCount++; + } else if (charCode === 32) { + currentLineSpacesCount++; + } else { + currentLineHasContent = true; + currentLineIndentation = j; + break; + } + } + if (!currentLineHasContent) { + continue; + } + if (currentLineTabsCount > 0) { + linesIndentedWithTabsCount++; + } else if (currentLineSpacesCount > 1) { + linesIndentedWithSpacesCount++; + } + spacesDiff(previousLineText, previousLineIndentation, currentLineText, currentLineIndentation, tmp); + if (tmp.looksLikeAlignment) { + if (!(defaultInsertSpaces && defaultTabSize === tmp.spacesDiff)) { + continue; + } + } + const currentSpacesDiff = tmp.spacesDiff; + if (currentSpacesDiff <= MAX_ALLOWED_TAB_SIZE_GUESS) { + spacesDiffCount[currentSpacesDiff]++; + } + previousLineText = currentLineText; + previousLineIndentation = currentLineIndentation; + } + let insertSpaces = defaultInsertSpaces; + if (linesIndentedWithTabsCount !== linesIndentedWithSpacesCount) { + insertSpaces = linesIndentedWithTabsCount < linesIndentedWithSpacesCount; + } + let tabSize = defaultTabSize; + if (insertSpaces) { + let tabSizeScore = insertSpaces ? 0 : 0.1 * linesCount; + ALLOWED_TAB_SIZE_GUESSES.forEach((possibleTabSize) => { + const possibleTabSizeScore = spacesDiffCount[possibleTabSize]; + if (possibleTabSizeScore > tabSizeScore) { + tabSizeScore = possibleTabSizeScore; + tabSize = possibleTabSize; + } + }); + if (tabSize === 4 && spacesDiffCount[4] > 0 && spacesDiffCount[2] > 0 && spacesDiffCount[2] >= spacesDiffCount[4] / 2) { + tabSize = 2; + } + } + return { + insertSpaces, + tabSize + }; +} +var SpacesDiffResult; +var init_indentationGuesser = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/common/model/indentationGuesser.js"() { + SpacesDiffResult = class { + constructor() { + this.spacesDiff = 0; + this.looksLikeAlignment = false; + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/common/model/intervalTree.js +function getNodeColor(node) { + return (node.metadata & 1) >>> 0; +} +function setNodeColor(node, color) { + node.metadata = node.metadata & 254 | color << 0; +} +function getNodeIsVisited(node) { + return (node.metadata & 2) >>> 1 === 1; +} +function setNodeIsVisited(node, value) { + node.metadata = node.metadata & 253 | (value ? 1 : 0) << 1; +} +function getNodeIsForValidation(node) { + return (node.metadata & 4) >>> 2 === 1; +} +function setNodeIsForValidation(node, value) { + node.metadata = node.metadata & 251 | (value ? 1 : 0) << 2; +} +function getNodeIsInGlyphMargin(node) { + return (node.metadata & 64) >>> 6 === 1; +} +function setNodeIsInGlyphMargin(node, value) { + node.metadata = node.metadata & 191 | (value ? 1 : 0) << 6; +} +function getNodeAffectsFont(node) { + return (node.metadata & 128) >>> 7 === 1; +} +function setNodeAffectsFont(node, value) { + node.metadata = node.metadata & 127 | (value ? 1 : 0) << 7; +} +function getNodeStickiness(node) { + return (node.metadata & 24) >>> 3; +} +function _setNodeStickiness(node, stickiness) { + node.metadata = node.metadata & 231 | stickiness << 3; +} +function getCollapseOnReplaceEdit(node) { + return (node.metadata & 32) >>> 5 === 1; +} +function setCollapseOnReplaceEdit(node, value) { + node.metadata = node.metadata & 223 | (value ? 1 : 0) << 5; +} +function normalizeDelta(T) { + let node = T.root; + let delta = 0; + while (node !== SENTINEL) { + if (node.left !== SENTINEL && !getNodeIsVisited(node.left)) { + node = node.left; + continue; + } + if (node.right !== SENTINEL && !getNodeIsVisited(node.right)) { + delta += node.delta; + node = node.right; + continue; + } + node.start = delta + node.start; + node.end = delta + node.end; + node.delta = 0; + recomputeMaxEnd(node); + setNodeIsVisited(node, true); + setNodeIsVisited(node.left, false); + setNodeIsVisited(node.right, false); + if (node === node.parent.right) { + delta -= node.parent.delta; + } + node = node.parent; + } + setNodeIsVisited(T.root, false); +} +function adjustMarkerBeforeColumn(markerOffset, markerStickToPreviousCharacter, checkOffset, moveSemantics) { + if (markerOffset < checkOffset) { + return true; + } + if (markerOffset > checkOffset) { + return false; + } + if (moveSemantics === 1) { + return false; + } + if (moveSemantics === 2) { + return true; + } + return markerStickToPreviousCharacter; +} +function nodeAcceptEdit(node, start, end, textLength, forceMoveMarkers) { + const nodeStickiness = getNodeStickiness(node); + const startStickToPreviousCharacter = nodeStickiness === 0 || nodeStickiness === 2; + const endStickToPreviousCharacter = nodeStickiness === 1 || nodeStickiness === 2; + const deletingCnt = end - start; + const insertingCnt = textLength; + const commonLength = Math.min(deletingCnt, insertingCnt); + const nodeStart = node.start; + let startDone = false; + const nodeEnd = node.end; + let endDone = false; + if (start <= nodeStart && nodeEnd <= end && getCollapseOnReplaceEdit(node)) { + node.start = start; + startDone = true; + node.end = start; + endDone = true; + } + { + const moveSemantics = forceMoveMarkers ? 1 : deletingCnt > 0 ? 2 : 0; + if (!startDone && adjustMarkerBeforeColumn(nodeStart, startStickToPreviousCharacter, start, moveSemantics)) { + startDone = true; + } + if (!endDone && adjustMarkerBeforeColumn(nodeEnd, endStickToPreviousCharacter, start, moveSemantics)) { + endDone = true; + } + } + if (commonLength > 0 && !forceMoveMarkers) { + const moveSemantics = deletingCnt > insertingCnt ? 2 : 0; + if (!startDone && adjustMarkerBeforeColumn(nodeStart, startStickToPreviousCharacter, start + commonLength, moveSemantics)) { + startDone = true; + } + if (!endDone && adjustMarkerBeforeColumn(nodeEnd, endStickToPreviousCharacter, start + commonLength, moveSemantics)) { + endDone = true; + } + } + { + const moveSemantics = forceMoveMarkers ? 1 : 0; + if (!startDone && adjustMarkerBeforeColumn(nodeStart, startStickToPreviousCharacter, end, moveSemantics)) { + node.start = start + insertingCnt; + startDone = true; + } + if (!endDone && adjustMarkerBeforeColumn(nodeEnd, endStickToPreviousCharacter, end, moveSemantics)) { + node.end = start + insertingCnt; + endDone = true; + } + } + const deltaColumn = insertingCnt - deletingCnt; + if (!startDone) { + node.start = Math.max(0, nodeStart + deltaColumn); + } + if (!endDone) { + node.end = Math.max(0, nodeEnd + deltaColumn); + } + if (node.start > node.end) { + node.end = node.start; + } +} +function searchForEditing(T, start, end) { + let node = T.root; + let delta = 0; + let nodeMaxEnd = 0; + let nodeStart = 0; + let nodeEnd = 0; + const result = []; + let resultLen = 0; + while (node !== SENTINEL) { + if (getNodeIsVisited(node)) { + setNodeIsVisited(node.left, false); + setNodeIsVisited(node.right, false); + if (node === node.parent.right) { + delta -= node.parent.delta; + } + node = node.parent; + continue; + } + if (!getNodeIsVisited(node.left)) { + nodeMaxEnd = delta + node.maxEnd; + if (nodeMaxEnd < start) { + setNodeIsVisited(node, true); + continue; + } + if (node.left !== SENTINEL) { + node = node.left; + continue; + } + } + nodeStart = delta + node.start; + if (nodeStart > end) { + setNodeIsVisited(node, true); + continue; + } + nodeEnd = delta + node.end; + if (nodeEnd >= start) { + node.setCachedOffsets(nodeStart, nodeEnd, 0); + result[resultLen++] = node; + } + setNodeIsVisited(node, true); + if (node.right !== SENTINEL && !getNodeIsVisited(node.right)) { + delta += node.delta; + node = node.right; + continue; + } + } + setNodeIsVisited(T.root, false); + return result; +} +function noOverlapReplace(T, start, end, textLength) { + let node = T.root; + let delta = 0; + let nodeMaxEnd = 0; + let nodeStart = 0; + const editDelta = textLength - (end - start); + while (node !== SENTINEL) { + if (getNodeIsVisited(node)) { + setNodeIsVisited(node.left, false); + setNodeIsVisited(node.right, false); + if (node === node.parent.right) { + delta -= node.parent.delta; + } + recomputeMaxEnd(node); + node = node.parent; + continue; + } + if (!getNodeIsVisited(node.left)) { + nodeMaxEnd = delta + node.maxEnd; + if (nodeMaxEnd < start) { + setNodeIsVisited(node, true); + continue; + } + if (node.left !== SENTINEL) { + node = node.left; + continue; + } + } + nodeStart = delta + node.start; + if (nodeStart > end) { + node.start += editDelta; + node.end += editDelta; + node.delta += editDelta; + if (node.delta < -1073741824 || node.delta > 1073741824) { + T.requestNormalizeDelta = true; + } + setNodeIsVisited(node, true); + continue; + } + setNodeIsVisited(node, true); + if (node.right !== SENTINEL && !getNodeIsVisited(node.right)) { + delta += node.delta; + node = node.right; + continue; + } + } + setNodeIsVisited(T.root, false); +} +function collectNodesFromOwner(T, ownerId2) { + let node = T.root; + const result = []; + let resultLen = 0; + while (node !== SENTINEL) { + if (getNodeIsVisited(node)) { + setNodeIsVisited(node.left, false); + setNodeIsVisited(node.right, false); + node = node.parent; + continue; + } + if (node.left !== SENTINEL && !getNodeIsVisited(node.left)) { + node = node.left; + continue; + } + if (node.ownerId === ownerId2) { + result[resultLen++] = node; + } + setNodeIsVisited(node, true); + if (node.right !== SENTINEL && !getNodeIsVisited(node.right)) { + node = node.right; + continue; + } + } + setNodeIsVisited(T.root, false); + return result; +} +function collectNodesPostOrder(T) { + let node = T.root; + const result = []; + let resultLen = 0; + while (node !== SENTINEL) { + if (getNodeIsVisited(node)) { + setNodeIsVisited(node.left, false); + setNodeIsVisited(node.right, false); + node = node.parent; + continue; + } + if (node.left !== SENTINEL && !getNodeIsVisited(node.left)) { + node = node.left; + continue; + } + if (node.right !== SENTINEL && !getNodeIsVisited(node.right)) { + node = node.right; + continue; + } + result[resultLen++] = node; + setNodeIsVisited(node, true); + } + setNodeIsVisited(T.root, false); + return result; +} +function search(T, filterOwnerId, filterOutValidation, filterFontDecorations2, cachedVersionId, onlyMarginDecorations) { + let node = T.root; + let delta = 0; + let nodeStart = 0; + let nodeEnd = 0; + const result = []; + let resultLen = 0; + while (node !== SENTINEL) { + if (getNodeIsVisited(node)) { + setNodeIsVisited(node.left, false); + setNodeIsVisited(node.right, false); + if (node === node.parent.right) { + delta -= node.parent.delta; + } + node = node.parent; + continue; + } + if (node.left !== SENTINEL && !getNodeIsVisited(node.left)) { + node = node.left; + continue; + } + nodeStart = delta + node.start; + nodeEnd = delta + node.end; + node.setCachedOffsets(nodeStart, nodeEnd, cachedVersionId); + let include = true; + if (filterOwnerId && node.ownerId && node.ownerId !== filterOwnerId) { + include = false; + } + if (filterOutValidation && getNodeIsForValidation(node)) { + include = false; + } + if (filterFontDecorations2 && getNodeAffectsFont(node)) { + include = false; + } + if (onlyMarginDecorations && !getNodeIsInGlyphMargin(node)) { + include = false; + } + if (include) { + result[resultLen++] = node; + } + setNodeIsVisited(node, true); + if (node.right !== SENTINEL && !getNodeIsVisited(node.right)) { + delta += node.delta; + node = node.right; + continue; + } + } + setNodeIsVisited(T.root, false); + return result; +} +function intervalSearch(T, intervalStart, intervalEnd, filterOwnerId, filterOutValidation, filterFontDecorations2, cachedVersionId, onlyMarginDecorations) { + let node = T.root; + let delta = 0; + let nodeMaxEnd = 0; + let nodeStart = 0; + let nodeEnd = 0; + const result = []; + let resultLen = 0; + while (node !== SENTINEL) { + if (getNodeIsVisited(node)) { + setNodeIsVisited(node.left, false); + setNodeIsVisited(node.right, false); + if (node === node.parent.right) { + delta -= node.parent.delta; + } + node = node.parent; + continue; + } + if (!getNodeIsVisited(node.left)) { + nodeMaxEnd = delta + node.maxEnd; + if (nodeMaxEnd < intervalStart) { + setNodeIsVisited(node, true); + continue; + } + if (node.left !== SENTINEL) { + node = node.left; + continue; + } + } + nodeStart = delta + node.start; + if (nodeStart > intervalEnd) { + setNodeIsVisited(node, true); + continue; + } + nodeEnd = delta + node.end; + if (nodeEnd >= intervalStart) { + node.setCachedOffsets(nodeStart, nodeEnd, cachedVersionId); + let include = true; + if (filterOwnerId && node.ownerId && node.ownerId !== filterOwnerId) { + include = false; + } + if (filterOutValidation && getNodeIsForValidation(node)) { + include = false; + } + if (filterFontDecorations2 && getNodeAffectsFont(node)) { + include = false; + } + if (onlyMarginDecorations && !getNodeIsInGlyphMargin(node)) { + include = false; + } + if (include) { + result[resultLen++] = node; + } + } + setNodeIsVisited(node, true); + if (node.right !== SENTINEL && !getNodeIsVisited(node.right)) { + delta += node.delta; + node = node.right; + continue; + } + } + setNodeIsVisited(T.root, false); + return result; +} +function rbTreeInsert(T, newNode) { + if (T.root === SENTINEL) { + newNode.parent = SENTINEL; + newNode.left = SENTINEL; + newNode.right = SENTINEL; + setNodeColor( + newNode, + 0 + /* NodeColor.Black */ + ); + T.root = newNode; + return T.root; + } + treeInsert(T, newNode); + recomputeMaxEndWalkToRoot(newNode.parent); + let x = newNode; + while (x !== T.root && getNodeColor(x.parent) === 1) { + if (x.parent === x.parent.parent.left) { + const y = x.parent.parent.right; + if (getNodeColor(y) === 1) { + setNodeColor( + x.parent, + 0 + /* NodeColor.Black */ + ); + setNodeColor( + y, + 0 + /* NodeColor.Black */ + ); + setNodeColor( + x.parent.parent, + 1 + /* NodeColor.Red */ + ); + x = x.parent.parent; + } else { + if (x === x.parent.right) { + x = x.parent; + leftRotate2(T, x); + } + setNodeColor( + x.parent, + 0 + /* NodeColor.Black */ + ); + setNodeColor( + x.parent.parent, + 1 + /* NodeColor.Red */ + ); + rightRotate(T, x.parent.parent); + } + } else { + const y = x.parent.parent.left; + if (getNodeColor(y) === 1) { + setNodeColor( + x.parent, + 0 + /* NodeColor.Black */ + ); + setNodeColor( + y, + 0 + /* NodeColor.Black */ + ); + setNodeColor( + x.parent.parent, + 1 + /* NodeColor.Red */ + ); + x = x.parent.parent; + } else { + if (x === x.parent.left) { + x = x.parent; + rightRotate(T, x); + } + setNodeColor( + x.parent, + 0 + /* NodeColor.Black */ + ); + setNodeColor( + x.parent.parent, + 1 + /* NodeColor.Red */ + ); + leftRotate2(T, x.parent.parent); + } + } + } + setNodeColor( + T.root, + 0 + /* NodeColor.Black */ + ); + return newNode; +} +function treeInsert(T, z) { + let delta = 0; + let x = T.root; + const zAbsoluteStart = z.start; + const zAbsoluteEnd = z.end; + while (true) { + const cmp3 = intervalCompare(zAbsoluteStart, zAbsoluteEnd, x.start + delta, x.end + delta); + if (cmp3 < 0) { + if (x.left === SENTINEL) { + z.start -= delta; + z.end -= delta; + z.maxEnd -= delta; + x.left = z; + break; + } else { + x = x.left; + } + } else { + if (x.right === SENTINEL) { + z.start -= delta + x.delta; + z.end -= delta + x.delta; + z.maxEnd -= delta + x.delta; + x.right = z; + break; + } else { + delta += x.delta; + x = x.right; + } + } + } + z.parent = x; + z.left = SENTINEL; + z.right = SENTINEL; + setNodeColor( + z, + 1 + /* NodeColor.Red */ + ); +} +function rbTreeDelete(T, z) { + let x; + let y; + if (z.left === SENTINEL) { + x = z.right; + y = z; + x.delta += z.delta; + if (x.delta < -1073741824 || x.delta > 1073741824) { + T.requestNormalizeDelta = true; + } + x.start += z.delta; + x.end += z.delta; + } else if (z.right === SENTINEL) { + x = z.left; + y = z; + } else { + y = leftest(z.right); + x = y.right; + x.start += y.delta; + x.end += y.delta; + x.delta += y.delta; + if (x.delta < -1073741824 || x.delta > 1073741824) { + T.requestNormalizeDelta = true; + } + y.start += z.delta; + y.end += z.delta; + y.delta = z.delta; + if (y.delta < -1073741824 || y.delta > 1073741824) { + T.requestNormalizeDelta = true; + } + } + if (y === T.root) { + T.root = x; + setNodeColor( + x, + 0 + /* NodeColor.Black */ + ); + z.detach(); + resetSentinel(); + recomputeMaxEnd(x); + T.root.parent = SENTINEL; + return; + } + const yWasRed = getNodeColor(y) === 1; + if (y === y.parent.left) { + y.parent.left = x; + } else { + y.parent.right = x; + } + if (y === z) { + x.parent = y.parent; + } else { + if (y.parent === z) { + x.parent = y; + } else { + x.parent = y.parent; + } + y.left = z.left; + y.right = z.right; + y.parent = z.parent; + setNodeColor(y, getNodeColor(z)); + if (z === T.root) { + T.root = y; + } else { + if (z === z.parent.left) { + z.parent.left = y; + } else { + z.parent.right = y; + } + } + if (y.left !== SENTINEL) { + y.left.parent = y; + } + if (y.right !== SENTINEL) { + y.right.parent = y; + } + } + z.detach(); + if (yWasRed) { + recomputeMaxEndWalkToRoot(x.parent); + if (y !== z) { + recomputeMaxEndWalkToRoot(y); + recomputeMaxEndWalkToRoot(y.parent); + } + resetSentinel(); + return; + } + recomputeMaxEndWalkToRoot(x); + recomputeMaxEndWalkToRoot(x.parent); + if (y !== z) { + recomputeMaxEndWalkToRoot(y); + recomputeMaxEndWalkToRoot(y.parent); + } + let w; + while (x !== T.root && getNodeColor(x) === 0) { + if (x === x.parent.left) { + w = x.parent.right; + if (getNodeColor(w) === 1) { + setNodeColor( + w, + 0 + /* NodeColor.Black */ + ); + setNodeColor( + x.parent, + 1 + /* NodeColor.Red */ + ); + leftRotate2(T, x.parent); + w = x.parent.right; + } + if (getNodeColor(w.left) === 0 && getNodeColor(w.right) === 0) { + setNodeColor( + w, + 1 + /* NodeColor.Red */ + ); + x = x.parent; + } else { + if (getNodeColor(w.right) === 0) { + setNodeColor( + w.left, + 0 + /* NodeColor.Black */ + ); + setNodeColor( + w, + 1 + /* NodeColor.Red */ + ); + rightRotate(T, w); + w = x.parent.right; + } + setNodeColor(w, getNodeColor(x.parent)); + setNodeColor( + x.parent, + 0 + /* NodeColor.Black */ + ); + setNodeColor( + w.right, + 0 + /* NodeColor.Black */ + ); + leftRotate2(T, x.parent); + x = T.root; + } + } else { + w = x.parent.left; + if (getNodeColor(w) === 1) { + setNodeColor( + w, + 0 + /* NodeColor.Black */ + ); + setNodeColor( + x.parent, + 1 + /* NodeColor.Red */ + ); + rightRotate(T, x.parent); + w = x.parent.left; + } + if (getNodeColor(w.left) === 0 && getNodeColor(w.right) === 0) { + setNodeColor( + w, + 1 + /* NodeColor.Red */ + ); + x = x.parent; + } else { + if (getNodeColor(w.left) === 0) { + setNodeColor( + w.right, + 0 + /* NodeColor.Black */ + ); + setNodeColor( + w, + 1 + /* NodeColor.Red */ + ); + leftRotate2(T, w); + w = x.parent.left; + } + setNodeColor(w, getNodeColor(x.parent)); + setNodeColor( + x.parent, + 0 + /* NodeColor.Black */ + ); + setNodeColor( + w.left, + 0 + /* NodeColor.Black */ + ); + rightRotate(T, x.parent); + x = T.root; + } + } + } + setNodeColor( + x, + 0 + /* NodeColor.Black */ + ); + resetSentinel(); +} +function leftest(node) { + while (node.left !== SENTINEL) { + node = node.left; + } + return node; +} +function resetSentinel() { + SENTINEL.parent = SENTINEL; + SENTINEL.delta = 0; + SENTINEL.start = 0; + SENTINEL.end = 0; +} +function leftRotate2(T, x) { + const y = x.right; + y.delta += x.delta; + if (y.delta < -1073741824 || y.delta > 1073741824) { + T.requestNormalizeDelta = true; + } + y.start += x.delta; + y.end += x.delta; + x.right = y.left; + if (y.left !== SENTINEL) { + y.left.parent = x; + } + y.parent = x.parent; + if (x.parent === SENTINEL) { + T.root = y; + } else if (x === x.parent.left) { + x.parent.left = y; + } else { + x.parent.right = y; + } + y.left = x; + x.parent = y; + recomputeMaxEnd(x); + recomputeMaxEnd(y); +} +function rightRotate(T, y) { + const x = y.left; + y.delta -= x.delta; + if (y.delta < -1073741824 || y.delta > 1073741824) { + T.requestNormalizeDelta = true; + } + y.start -= x.delta; + y.end -= x.delta; + y.left = x.right; + if (x.right !== SENTINEL) { + x.right.parent = y; + } + x.parent = y.parent; + if (y.parent === SENTINEL) { + T.root = x; + } else if (y === y.parent.right) { + y.parent.right = x; + } else { + y.parent.left = x; + } + x.right = y; + y.parent = x; + recomputeMaxEnd(y); + recomputeMaxEnd(x); +} +function computeMaxEnd(node) { + let maxEnd = node.end; + if (node.left !== SENTINEL) { + const leftMaxEnd = node.left.maxEnd; + if (leftMaxEnd > maxEnd) { + maxEnd = leftMaxEnd; + } + } + if (node.right !== SENTINEL) { + const rightMaxEnd = node.right.maxEnd + node.delta; + if (rightMaxEnd > maxEnd) { + maxEnd = rightMaxEnd; + } + } + return maxEnd; +} +function recomputeMaxEnd(node) { + node.maxEnd = computeMaxEnd(node); +} +function recomputeMaxEndWalkToRoot(node) { + while (node !== SENTINEL) { + const maxEnd = computeMaxEnd(node); + if (node.maxEnd === maxEnd) { + return; + } + node.maxEnd = maxEnd; + node = node.parent; + } +} +function intervalCompare(aStart, aEnd, bStart, bEnd) { + if (aStart === bStart) { + return aEnd - bEnd; + } + return aStart - bStart; +} +var IntervalNode, SENTINEL, IntervalTree; +var init_intervalTree = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/common/model/intervalTree.js"() { + IntervalNode = class { + constructor(id, start, end) { + this.metadata = 0; + this.parent = this; + this.left = this; + this.right = this; + setNodeColor( + this, + 1 + /* NodeColor.Red */ + ); + this.start = start; + this.end = end; + this.delta = 0; + this.maxEnd = end; + this.id = id; + this.ownerId = 0; + this.options = null; + setNodeIsForValidation(this, false); + setNodeIsInGlyphMargin(this, false); + _setNodeStickiness( + this, + 1 + /* TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges */ + ); + setCollapseOnReplaceEdit(this, false); + setNodeAffectsFont(this, false); + this.cachedVersionId = 0; + this.cachedAbsoluteStart = start; + this.cachedAbsoluteEnd = end; + this.range = null; + setNodeIsVisited(this, false); + } + reset(versionId, start, end, range2) { + this.start = start; + this.end = end; + this.maxEnd = end; + this.cachedVersionId = versionId; + this.cachedAbsoluteStart = start; + this.cachedAbsoluteEnd = end; + this.range = range2; + } + setOptions(options2) { + this.options = options2; + const className2 = this.options.className; + setNodeIsForValidation(this, className2 === "squiggly-error" || className2 === "squiggly-warning" || className2 === "squiggly-info"); + setNodeIsInGlyphMargin(this, this.options.glyphMarginClassName !== null); + _setNodeStickiness(this, this.options.stickiness); + setCollapseOnReplaceEdit(this, this.options.collapseOnReplaceEdit); + setNodeAffectsFont(this, this.options.affectsFont ?? false); + } + setCachedOffsets(absoluteStart, absoluteEnd, cachedVersionId) { + if (this.cachedVersionId !== cachedVersionId) { + this.range = null; + } + this.cachedVersionId = cachedVersionId; + this.cachedAbsoluteStart = absoluteStart; + this.cachedAbsoluteEnd = absoluteEnd; + } + detach() { + this.parent = null; + this.left = null; + this.right = null; + } + }; + SENTINEL = new IntervalNode(null, 0, 0); + SENTINEL.parent = SENTINEL; + SENTINEL.left = SENTINEL; + SENTINEL.right = SENTINEL; + setNodeColor( + SENTINEL, + 0 + /* NodeColor.Black */ + ); + IntervalTree = class { + constructor() { + this.root = SENTINEL; + this.requestNormalizeDelta = false; + } + intervalSearch(start, end, filterOwnerId, filterOutValidation, filterFontDecorations2, cachedVersionId, onlyMarginDecorations) { + if (this.root === SENTINEL) { + return []; + } + return intervalSearch(this, start, end, filterOwnerId, filterOutValidation, filterFontDecorations2, cachedVersionId, onlyMarginDecorations); + } + search(filterOwnerId, filterOutValidation, filterFontDecorations2, cachedVersionId, onlyMarginDecorations) { + if (this.root === SENTINEL) { + return []; + } + return search(this, filterOwnerId, filterOutValidation, filterFontDecorations2, cachedVersionId, onlyMarginDecorations); + } + /** + * Will not set `cachedAbsoluteStart` nor `cachedAbsoluteEnd` on the returned nodes! + */ + collectNodesFromOwner(ownerId2) { + return collectNodesFromOwner(this, ownerId2); + } + /** + * Will not set `cachedAbsoluteStart` nor `cachedAbsoluteEnd` on the returned nodes! + */ + collectNodesPostOrder() { + return collectNodesPostOrder(this); + } + insert(node) { + rbTreeInsert(this, node); + this._normalizeDeltaIfNecessary(); + } + delete(node) { + rbTreeDelete(this, node); + this._normalizeDeltaIfNecessary(); + } + resolveNode(node, cachedVersionId) { + const initialNode = node; + let delta = 0; + while (node !== this.root) { + if (node === node.parent.right) { + delta += node.parent.delta; + } + node = node.parent; + } + const nodeStart = initialNode.start + delta; + const nodeEnd = initialNode.end + delta; + initialNode.setCachedOffsets(nodeStart, nodeEnd, cachedVersionId); + } + acceptReplace(offset, length, textLength, forceMoveMarkers) { + const nodesOfInterest = searchForEditing(this, offset, offset + length); + for (let i2 = 0, len = nodesOfInterest.length; i2 < len; i2++) { + const node = nodesOfInterest[i2]; + rbTreeDelete(this, node); + } + this._normalizeDeltaIfNecessary(); + noOverlapReplace(this, offset, offset + length, textLength); + this._normalizeDeltaIfNecessary(); + for (let i2 = 0, len = nodesOfInterest.length; i2 < len; i2++) { + const node = nodesOfInterest[i2]; + node.start = node.cachedAbsoluteStart; + node.end = node.cachedAbsoluteEnd; + nodeAcceptEdit(node, offset, offset + length, textLength, forceMoveMarkers); + node.maxEnd = node.end; + rbTreeInsert(this, node); + } + this._normalizeDeltaIfNecessary(); + } + _normalizeDeltaIfNecessary() { + if (!this.requestNormalizeDelta) { + return; + } + this.requestNormalizeDelta = false; + normalizeDelta(this); + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/common/model/pieceTreeTextBuffer/rbTreeBase.js +function leftest2(node) { + while (node.left !== SENTINEL2) { + node = node.left; + } + return node; +} +function righttest(node) { + while (node.right !== SENTINEL2) { + node = node.right; + } + return node; +} +function calculateSize(node) { + if (node === SENTINEL2) { + return 0; + } + return node.size_left + node.piece.length + calculateSize(node.right); +} +function calculateLF(node) { + if (node === SENTINEL2) { + return 0; + } + return node.lf_left + node.piece.lineFeedCnt + calculateLF(node.right); +} +function resetSentinel2() { + SENTINEL2.parent = SENTINEL2; +} +function leftRotate3(tree, x) { + const y = x.right; + y.size_left += x.size_left + (x.piece ? x.piece.length : 0); + y.lf_left += x.lf_left + (x.piece ? x.piece.lineFeedCnt : 0); + x.right = y.left; + if (y.left !== SENTINEL2) { + y.left.parent = x; + } + y.parent = x.parent; + if (x.parent === SENTINEL2) { + tree.root = y; + } else if (x.parent.left === x) { + x.parent.left = y; + } else { + x.parent.right = y; + } + y.left = x; + x.parent = y; +} +function rightRotate2(tree, y) { + const x = y.left; + y.left = x.right; + if (x.right !== SENTINEL2) { + x.right.parent = y; + } + x.parent = y.parent; + y.size_left -= x.size_left + (x.piece ? x.piece.length : 0); + y.lf_left -= x.lf_left + (x.piece ? x.piece.lineFeedCnt : 0); + if (y.parent === SENTINEL2) { + tree.root = x; + } else if (y === y.parent.right) { + y.parent.right = x; + } else { + y.parent.left = x; + } + x.right = y; + y.parent = x; +} +function rbDelete(tree, z) { + let x; + let y; + if (z.left === SENTINEL2) { + y = z; + x = y.right; + } else if (z.right === SENTINEL2) { + y = z; + x = y.left; + } else { + y = leftest2(z.right); + x = y.right; + } + if (y === tree.root) { + tree.root = x; + x.color = 0; + z.detach(); + resetSentinel2(); + tree.root.parent = SENTINEL2; + return; + } + const yWasRed = y.color === 1; + if (y === y.parent.left) { + y.parent.left = x; + } else { + y.parent.right = x; + } + if (y === z) { + x.parent = y.parent; + recomputeTreeMetadata(tree, x); + } else { + if (y.parent === z) { + x.parent = y; + } else { + x.parent = y.parent; + } + recomputeTreeMetadata(tree, x); + y.left = z.left; + y.right = z.right; + y.parent = z.parent; + y.color = z.color; + if (z === tree.root) { + tree.root = y; + } else { + if (z === z.parent.left) { + z.parent.left = y; + } else { + z.parent.right = y; + } + } + if (y.left !== SENTINEL2) { + y.left.parent = y; + } + if (y.right !== SENTINEL2) { + y.right.parent = y; + } + y.size_left = z.size_left; + y.lf_left = z.lf_left; + recomputeTreeMetadata(tree, y); + } + z.detach(); + if (x.parent.left === x) { + const newSizeLeft = calculateSize(x); + const newLFLeft = calculateLF(x); + if (newSizeLeft !== x.parent.size_left || newLFLeft !== x.parent.lf_left) { + const delta = newSizeLeft - x.parent.size_left; + const lf_delta = newLFLeft - x.parent.lf_left; + x.parent.size_left = newSizeLeft; + x.parent.lf_left = newLFLeft; + updateTreeMetadata(tree, x.parent, delta, lf_delta); + } + } + recomputeTreeMetadata(tree, x.parent); + if (yWasRed) { + resetSentinel2(); + return; + } + let w; + while (x !== tree.root && x.color === 0) { + if (x === x.parent.left) { + w = x.parent.right; + if (w.color === 1) { + w.color = 0; + x.parent.color = 1; + leftRotate3(tree, x.parent); + w = x.parent.right; + } + if (w.left.color === 0 && w.right.color === 0) { + w.color = 1; + x = x.parent; + } else { + if (w.right.color === 0) { + w.left.color = 0; + w.color = 1; + rightRotate2(tree, w); + w = x.parent.right; + } + w.color = x.parent.color; + x.parent.color = 0; + w.right.color = 0; + leftRotate3(tree, x.parent); + x = tree.root; + } + } else { + w = x.parent.left; + if (w.color === 1) { + w.color = 0; + x.parent.color = 1; + rightRotate2(tree, x.parent); + w = x.parent.left; + } + if (w.left.color === 0 && w.right.color === 0) { + w.color = 1; + x = x.parent; + } else { + if (w.left.color === 0) { + w.right.color = 0; + w.color = 1; + leftRotate3(tree, w); + w = x.parent.left; + } + w.color = x.parent.color; + x.parent.color = 0; + w.left.color = 0; + rightRotate2(tree, x.parent); + x = tree.root; + } + } + } + x.color = 0; + resetSentinel2(); +} +function fixInsert(tree, x) { + recomputeTreeMetadata(tree, x); + while (x !== tree.root && x.parent.color === 1) { + if (x.parent === x.parent.parent.left) { + const y = x.parent.parent.right; + if (y.color === 1) { + x.parent.color = 0; + y.color = 0; + x.parent.parent.color = 1; + x = x.parent.parent; + } else { + if (x === x.parent.right) { + x = x.parent; + leftRotate3(tree, x); + } + x.parent.color = 0; + x.parent.parent.color = 1; + rightRotate2(tree, x.parent.parent); + } + } else { + const y = x.parent.parent.left; + if (y.color === 1) { + x.parent.color = 0; + y.color = 0; + x.parent.parent.color = 1; + x = x.parent.parent; + } else { + if (x === x.parent.left) { + x = x.parent; + rightRotate2(tree, x); + } + x.parent.color = 0; + x.parent.parent.color = 1; + leftRotate3(tree, x.parent.parent); + } + } + } + tree.root.color = 0; +} +function updateTreeMetadata(tree, x, delta, lineFeedCntDelta) { + while (x !== tree.root && x !== SENTINEL2) { + if (x.parent.left === x) { + x.parent.size_left += delta; + x.parent.lf_left += lineFeedCntDelta; + } + x = x.parent; + } +} +function recomputeTreeMetadata(tree, x) { + let delta = 0; + let lf_delta = 0; + if (x === tree.root) { + return; + } + while (x !== tree.root && x === x.parent.right) { + x = x.parent; + } + if (x === tree.root) { + return; + } + x = x.parent; + delta = calculateSize(x.left) - x.size_left; + lf_delta = calculateLF(x.left) - x.lf_left; + x.size_left += delta; + x.lf_left += lf_delta; + while (x !== tree.root && (delta !== 0 || lf_delta !== 0)) { + if (x.parent.left === x) { + x.parent.size_left += delta; + x.parent.lf_left += lf_delta; + } + x = x.parent; + } +} +var TreeNode, SENTINEL2; +var init_rbTreeBase = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/common/model/pieceTreeTextBuffer/rbTreeBase.js"() { + TreeNode = class { + constructor(piece, color) { + this.piece = piece; + this.color = color; + this.size_left = 0; + this.lf_left = 0; + this.parent = this; + this.left = this; + this.right = this; + } + next() { + if (this.right !== SENTINEL2) { + return leftest2(this.right); + } + let node = this; + while (node.parent !== SENTINEL2) { + if (node.parent.left === node) { + break; + } + node = node.parent; + } + if (node.parent === SENTINEL2) { + return SENTINEL2; + } else { + return node.parent; + } + } + prev() { + if (this.left !== SENTINEL2) { + return righttest(this.left); + } + let node = this; + while (node.parent !== SENTINEL2) { + if (node.parent.right === node) { + break; + } + node = node.parent; + } + if (node.parent === SENTINEL2) { + return SENTINEL2; + } else { + return node.parent; + } + } + detach() { + this.parent = null; + this.left = null; + this.right = null; + } + }; + SENTINEL2 = new TreeNode( + null, + 0 + /* NodeColor.Black */ + ); + SENTINEL2.parent = SENTINEL2; + SENTINEL2.left = SENTINEL2; + SENTINEL2.right = SENTINEL2; + SENTINEL2.color = 0; + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/common/model/textModelSearch.js +function isMultilineRegexSource(searchString) { + if (!searchString || searchString.length === 0) { + return false; + } + for (let i2 = 0, len = searchString.length; i2 < len; i2++) { + const chCode = searchString.charCodeAt(i2); + if (chCode === 10) { + return true; + } + if (chCode === 92) { + i2++; + if (i2 >= len) { + break; + } + const nextChCode = searchString.charCodeAt(i2); + if (nextChCode === 110 || nextChCode === 114 || nextChCode === 87) { + return true; + } + } + } + return false; +} +function createFindMatch(range2, rawMatches, captureMatches) { + if (!captureMatches) { + return new FindMatch(range2, null); + } + const matches = []; + for (let i2 = 0, len = rawMatches.length; i2 < len; i2++) { + matches[i2] = rawMatches[i2]; + } + return new FindMatch(range2, matches); +} +function leftIsWordBounday(wordSeparators2, text2, textLength, matchStartIndex, matchLength) { + if (matchStartIndex === 0) { + return true; + } + const charBefore = text2.charCodeAt(matchStartIndex - 1); + if (wordSeparators2.get(charBefore) !== 0) { + return true; + } + if (charBefore === 13 || charBefore === 10) { + return true; + } + if (matchLength > 0) { + const firstCharInMatch = text2.charCodeAt(matchStartIndex); + if (wordSeparators2.get(firstCharInMatch) !== 0) { + return true; + } + } + return false; +} +function rightIsWordBounday(wordSeparators2, text2, textLength, matchStartIndex, matchLength) { + if (matchStartIndex + matchLength === textLength) { + return true; + } + const charAfter = text2.charCodeAt(matchStartIndex + matchLength); + if (wordSeparators2.get(charAfter) !== 0) { + return true; + } + if (charAfter === 13 || charAfter === 10) { + return true; + } + if (matchLength > 0) { + const lastCharInMatch = text2.charCodeAt(matchStartIndex + matchLength - 1); + if (wordSeparators2.get(lastCharInMatch) !== 0) { + return true; + } + } + return false; +} +function isValidMatch(wordSeparators2, text2, textLength, matchStartIndex, matchLength) { + return leftIsWordBounday(wordSeparators2, text2, textLength, matchStartIndex, matchLength) && rightIsWordBounday(wordSeparators2, text2, textLength, matchStartIndex, matchLength); +} +var LIMIT_FIND_COUNT, SearchParams, LineFeedCounter, TextModelSearch, Searcher; +var init_textModelSearch = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/common/model/textModelSearch.js"() { + init_strings(); + init_wordCharacterClassifier(); + init_position(); + init_range(); + init_model2(); + LIMIT_FIND_COUNT = 999; + SearchParams = class { + constructor(searchString, isRegex, matchCase, wordSeparators2) { + this.searchString = searchString; + this.isRegex = isRegex; + this.matchCase = matchCase; + this.wordSeparators = wordSeparators2; + } + parseSearchRequest() { + if (this.searchString === "") { + return null; + } + let multiline; + if (this.isRegex) { + multiline = isMultilineRegexSource(this.searchString); + } else { + multiline = this.searchString.indexOf("\n") >= 0; + } + let regex = null; + try { + regex = createRegExp(this.searchString, this.isRegex, { + matchCase: this.matchCase, + wholeWord: false, + multiline, + global: true, + unicode: true + }); + } catch (err) { + return null; + } + if (!regex) { + return null; + } + let canUseSimpleSearch = !this.isRegex && !multiline; + if (canUseSimpleSearch && this.searchString.toLowerCase() !== this.searchString.toUpperCase()) { + canUseSimpleSearch = this.matchCase; + } + return new SearchData(regex, this.wordSeparators ? getMapForWordSeparators(this.wordSeparators, []) : null, canUseSimpleSearch ? this.searchString : null); + } + }; + LineFeedCounter = class { + constructor(text2) { + const lineFeedsOffsets = []; + let lineFeedsOffsetsLen = 0; + for (let i2 = 0, textLen = text2.length; i2 < textLen; i2++) { + if (text2.charCodeAt(i2) === 10) { + lineFeedsOffsets[lineFeedsOffsetsLen++] = i2; + } + } + this._lineFeedsOffsets = lineFeedsOffsets; + } + findLineFeedCountBeforeOffset(offset) { + const lineFeedsOffsets = this._lineFeedsOffsets; + let min = 0; + let max = lineFeedsOffsets.length - 1; + if (max === -1) { + return 0; + } + if (offset <= lineFeedsOffsets[0]) { + return 0; + } + while (min < max) { + const mid = min + ((max - min) / 2 >> 0); + if (lineFeedsOffsets[mid] >= offset) { + max = mid - 1; + } else { + if (lineFeedsOffsets[mid + 1] >= offset) { + min = mid; + max = mid; + } else { + min = mid + 1; + } + } + } + return min + 1; + } + }; + TextModelSearch = class { + static findMatches(model, searchParams, searchRange, captureMatches, limitResultCount) { + const searchData = searchParams.parseSearchRequest(); + if (!searchData) { + return []; + } + if (searchData.regex.multiline) { + return this._doFindMatchesMultiline(model, searchRange, new Searcher(searchData.wordSeparators, searchData.regex), captureMatches, limitResultCount); + } + return this._doFindMatchesLineByLine(model, searchRange, searchData, captureMatches, limitResultCount); + } + /** + * Multiline search always executes on the lines concatenated with \n. + * We must therefore compensate for the count of \n in case the model is CRLF + */ + static _getMultilineMatchRange(model, deltaOffset, text2, lfCounter, matchIndex, match0) { + let startOffset; + let lineFeedCountBeforeMatch = 0; + if (lfCounter) { + lineFeedCountBeforeMatch = lfCounter.findLineFeedCountBeforeOffset(matchIndex); + startOffset = deltaOffset + matchIndex + lineFeedCountBeforeMatch; + } else { + startOffset = deltaOffset + matchIndex; + } + let endOffset; + if (lfCounter) { + const lineFeedCountBeforeEndOfMatch = lfCounter.findLineFeedCountBeforeOffset(matchIndex + match0.length); + const lineFeedCountInMatch = lineFeedCountBeforeEndOfMatch - lineFeedCountBeforeMatch; + endOffset = startOffset + match0.length + lineFeedCountInMatch; + } else { + endOffset = startOffset + match0.length; + } + const startPosition = model.getPositionAt(startOffset); + const endPosition = model.getPositionAt(endOffset); + return new Range(startPosition.lineNumber, startPosition.column, endPosition.lineNumber, endPosition.column); + } + static _doFindMatchesMultiline(model, searchRange, searcher, captureMatches, limitResultCount) { + const deltaOffset = model.getOffsetAt(searchRange.getStartPosition()); + const text2 = model.getValueInRange( + searchRange, + 1 + /* EndOfLinePreference.LF */ + ); + const lfCounter = model.getEOL() === "\r\n" ? new LineFeedCounter(text2) : null; + const result = []; + let counter = 0; + let m; + searcher.reset(0); + while (m = searcher.next(text2)) { + result[counter++] = createFindMatch(this._getMultilineMatchRange(model, deltaOffset, text2, lfCounter, m.index, m[0]), m, captureMatches); + if (counter >= limitResultCount) { + return result; + } + } + return result; + } + static _doFindMatchesLineByLine(model, searchRange, searchData, captureMatches, limitResultCount) { + const result = []; + let resultLen = 0; + if (searchRange.startLineNumber === searchRange.endLineNumber) { + const text3 = model.getLineContent(searchRange.startLineNumber).substring(searchRange.startColumn - 1, searchRange.endColumn - 1); + resultLen = this._findMatchesInLine(searchData, text3, searchRange.startLineNumber, searchRange.startColumn - 1, resultLen, result, captureMatches, limitResultCount); + return result; + } + const text2 = model.getLineContent(searchRange.startLineNumber).substring(searchRange.startColumn - 1); + resultLen = this._findMatchesInLine(searchData, text2, searchRange.startLineNumber, searchRange.startColumn - 1, resultLen, result, captureMatches, limitResultCount); + for (let lineNumber = searchRange.startLineNumber + 1; lineNumber < searchRange.endLineNumber && resultLen < limitResultCount; lineNumber++) { + resultLen = this._findMatchesInLine(searchData, model.getLineContent(lineNumber), lineNumber, 0, resultLen, result, captureMatches, limitResultCount); + } + if (resultLen < limitResultCount) { + const text3 = model.getLineContent(searchRange.endLineNumber).substring(0, searchRange.endColumn - 1); + resultLen = this._findMatchesInLine(searchData, text3, searchRange.endLineNumber, 0, resultLen, result, captureMatches, limitResultCount); + } + return result; + } + static _findMatchesInLine(searchData, text2, lineNumber, deltaOffset, resultLen, result, captureMatches, limitResultCount) { + const wordSeparators2 = searchData.wordSeparators; + if (!captureMatches && searchData.simpleSearch) { + const searchString = searchData.simpleSearch; + const searchStringLen = searchString.length; + const textLength = text2.length; + let lastMatchIndex = -searchStringLen; + while ((lastMatchIndex = text2.indexOf(searchString, lastMatchIndex + searchStringLen)) !== -1) { + if (!wordSeparators2 || isValidMatch(wordSeparators2, text2, textLength, lastMatchIndex, searchStringLen)) { + result[resultLen++] = new FindMatch(new Range(lineNumber, lastMatchIndex + 1 + deltaOffset, lineNumber, lastMatchIndex + 1 + searchStringLen + deltaOffset), null); + if (resultLen >= limitResultCount) { + return resultLen; + } + } + } + return resultLen; + } + const searcher = new Searcher(searchData.wordSeparators, searchData.regex); + let m; + searcher.reset(0); + do { + m = searcher.next(text2); + if (m) { + result[resultLen++] = createFindMatch(new Range(lineNumber, m.index + 1 + deltaOffset, lineNumber, m.index + 1 + m[0].length + deltaOffset), m, captureMatches); + if (resultLen >= limitResultCount) { + return resultLen; + } + } + } while (m); + return resultLen; + } + static findNextMatch(model, searchParams, searchStart, captureMatches) { + const searchData = searchParams.parseSearchRequest(); + if (!searchData) { + return null; + } + const searcher = new Searcher(searchData.wordSeparators, searchData.regex); + if (searchData.regex.multiline) { + return this._doFindNextMatchMultiline(model, searchStart, searcher, captureMatches); + } + return this._doFindNextMatchLineByLine(model, searchStart, searcher, captureMatches); + } + static _doFindNextMatchMultiline(model, searchStart, searcher, captureMatches) { + const searchTextStart = new Position(searchStart.lineNumber, 1); + const deltaOffset = model.getOffsetAt(searchTextStart); + const lineCount = model.getLineCount(); + const text2 = model.getValueInRange( + new Range(searchTextStart.lineNumber, searchTextStart.column, lineCount, model.getLineMaxColumn(lineCount)), + 1 + /* EndOfLinePreference.LF */ + ); + const lfCounter = model.getEOL() === "\r\n" ? new LineFeedCounter(text2) : null; + searcher.reset(searchStart.column - 1); + const m = searcher.next(text2); + if (m) { + return createFindMatch(this._getMultilineMatchRange(model, deltaOffset, text2, lfCounter, m.index, m[0]), m, captureMatches); + } + if (searchStart.lineNumber !== 1 || searchStart.column !== 1) { + return this._doFindNextMatchMultiline(model, new Position(1, 1), searcher, captureMatches); + } + return null; + } + static _doFindNextMatchLineByLine(model, searchStart, searcher, captureMatches) { + const lineCount = model.getLineCount(); + const startLineNumber = searchStart.lineNumber; + const text2 = model.getLineContent(startLineNumber); + const r = this._findFirstMatchInLine(searcher, text2, startLineNumber, searchStart.column, captureMatches); + if (r) { + return r; + } + for (let i2 = 1; i2 <= lineCount; i2++) { + const lineIndex = (startLineNumber + i2 - 1) % lineCount; + const text3 = model.getLineContent(lineIndex + 1); + const r2 = this._findFirstMatchInLine(searcher, text3, lineIndex + 1, 1, captureMatches); + if (r2) { + return r2; + } + } + return null; + } + static _findFirstMatchInLine(searcher, text2, lineNumber, fromColumn, captureMatches) { + searcher.reset(fromColumn - 1); + const m = searcher.next(text2); + if (m) { + return createFindMatch(new Range(lineNumber, m.index + 1, lineNumber, m.index + 1 + m[0].length), m, captureMatches); + } + return null; + } + static findPreviousMatch(model, searchParams, searchStart, captureMatches) { + const searchData = searchParams.parseSearchRequest(); + if (!searchData) { + return null; + } + const searcher = new Searcher(searchData.wordSeparators, searchData.regex); + if (searchData.regex.multiline) { + return this._doFindPreviousMatchMultiline(model, searchStart, searcher, captureMatches); + } + return this._doFindPreviousMatchLineByLine(model, searchStart, searcher, captureMatches); + } + static _doFindPreviousMatchMultiline(model, searchStart, searcher, captureMatches) { + const matches = this._doFindMatchesMultiline(model, new Range(1, 1, searchStart.lineNumber, searchStart.column), searcher, captureMatches, 10 * LIMIT_FIND_COUNT); + if (matches.length > 0) { + return matches[matches.length - 1]; + } + const lineCount = model.getLineCount(); + if (searchStart.lineNumber !== lineCount || searchStart.column !== model.getLineMaxColumn(lineCount)) { + return this._doFindPreviousMatchMultiline(model, new Position(lineCount, model.getLineMaxColumn(lineCount)), searcher, captureMatches); + } + return null; + } + static _doFindPreviousMatchLineByLine(model, searchStart, searcher, captureMatches) { + const lineCount = model.getLineCount(); + const startLineNumber = searchStart.lineNumber; + const text2 = model.getLineContent(startLineNumber).substring(0, searchStart.column - 1); + const r = this._findLastMatchInLine(searcher, text2, startLineNumber, captureMatches); + if (r) { + return r; + } + for (let i2 = 1; i2 <= lineCount; i2++) { + const lineIndex = (lineCount + startLineNumber - i2 - 1) % lineCount; + const text3 = model.getLineContent(lineIndex + 1); + const r2 = this._findLastMatchInLine(searcher, text3, lineIndex + 1, captureMatches); + if (r2) { + return r2; + } + } + return null; + } + static _findLastMatchInLine(searcher, text2, lineNumber, captureMatches) { + let bestResult = null; + let m; + searcher.reset(0); + while (m = searcher.next(text2)) { + bestResult = createFindMatch(new Range(lineNumber, m.index + 1, lineNumber, m.index + 1 + m[0].length), m, captureMatches); + } + return bestResult; + } + }; + Searcher = class { + constructor(wordSeparators2, searchRegex) { + this._wordSeparators = wordSeparators2; + this._searchRegex = searchRegex; + this._prevMatchStartIndex = -1; + this._prevMatchLength = 0; + } + reset(lastIndex) { + this._searchRegex.lastIndex = lastIndex; + this._prevMatchStartIndex = -1; + this._prevMatchLength = 0; + } + next(text2) { + const textLength = text2.length; + let m; + do { + if (this._prevMatchStartIndex + this._prevMatchLength === textLength) { + return null; + } + m = this._searchRegex.exec(text2); + if (!m) { + return null; + } + const matchStartIndex = m.index; + const matchLength = m[0].length; + if (matchStartIndex === this._prevMatchStartIndex && matchLength === this._prevMatchLength) { + if (matchLength === 0) { + if (getNextCodePoint(text2, textLength, this._searchRegex.lastIndex) > 65535) { + this._searchRegex.lastIndex += 2; + } else { + this._searchRegex.lastIndex += 1; + } + continue; + } + return null; + } + this._prevMatchStartIndex = matchStartIndex; + this._prevMatchLength = matchLength; + if (!this._wordSeparators || isValidMatch(this._wordSeparators, text2, textLength, matchStartIndex, matchLength)) { + return m; + } + } while (m); + return null; + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeBase.js +function createUintArray(arr) { + let r; + if (arr[arr.length - 1] < 65536) { + r = new Uint16Array(arr.length); + } else { + r = new Uint32Array(arr.length); + } + r.set(arr, 0); + return r; +} +function createLineStartsFast(str, readonly = true) { + const r = [0]; + let rLength = 1; + for (let i2 = 0, len = str.length; i2 < len; i2++) { + const chr = str.charCodeAt(i2); + if (chr === 13) { + if (i2 + 1 < len && str.charCodeAt(i2 + 1) === 10) { + r[rLength++] = i2 + 2; + i2++; + } else { + r[rLength++] = i2 + 1; + } + } else if (chr === 10) { + r[rLength++] = i2 + 1; + } + } + if (readonly) { + return createUintArray(r); + } else { + return r; + } +} +function createLineStarts(r, str) { + r.length = 0; + r[0] = 0; + let rLength = 1; + let cr = 0, lf = 0, crlf = 0; + let isBasicASCII2 = true; + for (let i2 = 0, len = str.length; i2 < len; i2++) { + const chr = str.charCodeAt(i2); + if (chr === 13) { + if (i2 + 1 < len && str.charCodeAt(i2 + 1) === 10) { + crlf++; + r[rLength++] = i2 + 2; + i2++; + } else { + cr++; + r[rLength++] = i2 + 1; + } + } else if (chr === 10) { + lf++; + r[rLength++] = i2 + 1; + } else { + if (isBasicASCII2) { + if (chr !== 9 && (chr < 32 || chr > 126)) { + isBasicASCII2 = false; + } + } + } + } + const result = new LineStarts(createUintArray(r), cr, lf, crlf, isBasicASCII2); + r.length = 0; + return result; +} +var AverageBufferSize, LineStarts, Piece, StringBuffer, PieceTreeSnapshot, PieceTreeSearchCache, PieceTreeBase; +var init_pieceTreeBase = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeBase.js"() { + init_position(); + init_range(); + init_model2(); + init_rbTreeBase(); + init_textModelSearch(); + AverageBufferSize = 65535; + LineStarts = class { + constructor(lineStarts, cr, lf, crlf, isBasicASCII2) { + this.lineStarts = lineStarts; + this.cr = cr; + this.lf = lf; + this.crlf = crlf; + this.isBasicASCII = isBasicASCII2; + } + }; + Piece = class { + constructor(bufferIndex, start, end, lineFeedCnt, length) { + this.bufferIndex = bufferIndex; + this.start = start; + this.end = end; + this.lineFeedCnt = lineFeedCnt; + this.length = length; + } + }; + StringBuffer = class { + constructor(buffer, lineStarts) { + this.buffer = buffer; + this.lineStarts = lineStarts; + } + }; + PieceTreeSnapshot = class { + constructor(tree, BOM) { + this._pieces = []; + this._tree = tree; + this._BOM = BOM; + this._index = 0; + if (tree.root !== SENTINEL2) { + tree.iterate(tree.root, (node) => { + if (node !== SENTINEL2) { + this._pieces.push(node.piece); + } + return true; + }); + } + } + read() { + if (this._pieces.length === 0) { + if (this._index === 0) { + this._index++; + return this._BOM; + } else { + return null; + } + } + if (this._index > this._pieces.length - 1) { + return null; + } + if (this._index === 0) { + return this._BOM + this._tree.getPieceContent(this._pieces[this._index++]); + } + return this._tree.getPieceContent(this._pieces[this._index++]); + } + }; + PieceTreeSearchCache = class { + constructor(limit) { + this._limit = limit; + this._cache = []; + } + get(offset) { + for (let i2 = this._cache.length - 1; i2 >= 0; i2--) { + const nodePos = this._cache[i2]; + if (nodePos.nodeStartOffset <= offset && nodePos.nodeStartOffset + nodePos.node.piece.length >= offset) { + return nodePos; + } + } + return null; + } + get2(lineNumber) { + for (let i2 = this._cache.length - 1; i2 >= 0; i2--) { + const nodePos = this._cache[i2]; + if (nodePos.nodeStartLineNumber && nodePos.nodeStartLineNumber < lineNumber && nodePos.nodeStartLineNumber + nodePos.node.piece.lineFeedCnt >= lineNumber) { + return nodePos; + } + } + return null; + } + set(nodePosition) { + if (this._cache.length >= this._limit) { + this._cache.shift(); + } + this._cache.push(nodePosition); + } + validate(offset) { + let hasInvalidVal = false; + const tmp = this._cache; + for (let i2 = 0; i2 < tmp.length; i2++) { + const nodePos = tmp[i2]; + if (nodePos.node.parent === null || nodePos.nodeStartOffset >= offset) { + tmp[i2] = null; + hasInvalidVal = true; + continue; + } + } + if (hasInvalidVal) { + const newArr = []; + for (const entry of tmp) { + if (entry !== null) { + newArr.push(entry); + } + } + this._cache = newArr; + } + } + }; + PieceTreeBase = class { + constructor(chunks, eol, eolNormalized) { + this.create(chunks, eol, eolNormalized); + } + create(chunks, eol, eolNormalized) { + this._buffers = [ + new StringBuffer("", [0]) + ]; + this._lastChangeBufferPos = { line: 0, column: 0 }; + this.root = SENTINEL2; + this._lineCnt = 1; + this._length = 0; + this._EOL = eol; + this._EOLLength = eol.length; + this._EOLNormalized = eolNormalized; + let lastNode = null; + for (let i2 = 0, len = chunks.length; i2 < len; i2++) { + if (chunks[i2].buffer.length > 0) { + if (!chunks[i2].lineStarts) { + chunks[i2].lineStarts = createLineStartsFast(chunks[i2].buffer); + } + const piece = new Piece(i2 + 1, { line: 0, column: 0 }, { line: chunks[i2].lineStarts.length - 1, column: chunks[i2].buffer.length - chunks[i2].lineStarts[chunks[i2].lineStarts.length - 1] }, chunks[i2].lineStarts.length - 1, chunks[i2].buffer.length); + this._buffers.push(chunks[i2]); + lastNode = this.rbInsertRight(lastNode, piece); + } + } + this._searchCache = new PieceTreeSearchCache(1); + this._lastVisitedLine = { lineNumber: 0, value: "" }; + this.computeBufferMetadata(); + } + normalizeEOL(eol) { + const averageBufferSize = AverageBufferSize; + const min = averageBufferSize - Math.floor(averageBufferSize / 3); + const max = min * 2; + let tempChunk = ""; + let tempChunkLen = 0; + const chunks = []; + this.iterate(this.root, (node) => { + const str = this.getNodeContent(node); + const len = str.length; + if (tempChunkLen <= min || tempChunkLen + len < max) { + tempChunk += str; + tempChunkLen += len; + return true; + } + const text2 = tempChunk.replace(/\r\n|\r|\n/g, eol); + chunks.push(new StringBuffer(text2, createLineStartsFast(text2))); + tempChunk = str; + tempChunkLen = len; + return true; + }); + if (tempChunkLen > 0) { + const text2 = tempChunk.replace(/\r\n|\r|\n/g, eol); + chunks.push(new StringBuffer(text2, createLineStartsFast(text2))); + } + this.create(chunks, eol, true); + } + // #region Buffer API + getEOL() { + return this._EOL; + } + setEOL(newEOL) { + this._EOL = newEOL; + this._EOLLength = this._EOL.length; + this.normalizeEOL(newEOL); + } + createSnapshot(BOM) { + return new PieceTreeSnapshot(this, BOM); + } + getOffsetAt(lineNumber, column) { + let leftLen = 0; + let x = this.root; + while (x !== SENTINEL2) { + if (x.left !== SENTINEL2 && x.lf_left + 1 >= lineNumber) { + x = x.left; + } else if (x.lf_left + x.piece.lineFeedCnt + 1 >= lineNumber) { + leftLen += x.size_left; + const accumualtedValInCurrentIndex = this.getAccumulatedValue(x, lineNumber - x.lf_left - 2); + return leftLen += accumualtedValInCurrentIndex + column - 1; + } else { + lineNumber -= x.lf_left + x.piece.lineFeedCnt; + leftLen += x.size_left + x.piece.length; + x = x.right; + } + } + return leftLen; + } + getPositionAt(offset) { + offset = Math.floor(offset); + offset = Math.max(0, offset); + let x = this.root; + let lfCnt = 0; + const originalOffset = offset; + while (x !== SENTINEL2) { + if (x.size_left !== 0 && x.size_left >= offset) { + x = x.left; + } else if (x.size_left + x.piece.length >= offset) { + const out = this.getIndexOf(x, offset - x.size_left); + lfCnt += x.lf_left + out.index; + if (out.index === 0) { + const lineStartOffset = this.getOffsetAt(lfCnt + 1, 1); + const column = originalOffset - lineStartOffset; + return new Position(lfCnt + 1, column + 1); + } + return new Position(lfCnt + 1, out.remainder + 1); + } else { + offset -= x.size_left + x.piece.length; + lfCnt += x.lf_left + x.piece.lineFeedCnt; + if (x.right === SENTINEL2) { + const lineStartOffset = this.getOffsetAt(lfCnt + 1, 1); + const column = originalOffset - offset - lineStartOffset; + return new Position(lfCnt + 1, column + 1); + } else { + x = x.right; + } + } + } + return new Position(1, 1); + } + getValueInRange(range2, eol) { + if (range2.startLineNumber === range2.endLineNumber && range2.startColumn === range2.endColumn) { + return ""; + } + const startPosition = this.nodeAt2(range2.startLineNumber, range2.startColumn); + const endPosition = this.nodeAt2(range2.endLineNumber, range2.endColumn); + const value = this.getValueInRange2(startPosition, endPosition); + if (eol) { + if (eol !== this._EOL || !this._EOLNormalized) { + return value.replace(/\r\n|\r|\n/g, eol); + } + if (eol === this.getEOL() && this._EOLNormalized) { + if (eol === "\r\n") { + } + return value; + } + return value.replace(/\r\n|\r|\n/g, eol); + } + return value; + } + getValueInRange2(startPosition, endPosition) { + if (startPosition.node === endPosition.node) { + const node = startPosition.node; + const buffer2 = this._buffers[node.piece.bufferIndex].buffer; + const startOffset2 = this.offsetInBuffer(node.piece.bufferIndex, node.piece.start); + return buffer2.substring(startOffset2 + startPosition.remainder, startOffset2 + endPosition.remainder); + } + let x = startPosition.node; + const buffer = this._buffers[x.piece.bufferIndex].buffer; + const startOffset = this.offsetInBuffer(x.piece.bufferIndex, x.piece.start); + let ret = buffer.substring(startOffset + startPosition.remainder, startOffset + x.piece.length); + x = x.next(); + while (x !== SENTINEL2) { + const buffer2 = this._buffers[x.piece.bufferIndex].buffer; + const startOffset2 = this.offsetInBuffer(x.piece.bufferIndex, x.piece.start); + if (x === endPosition.node) { + ret += buffer2.substring(startOffset2, startOffset2 + endPosition.remainder); + break; + } else { + ret += buffer2.substr(startOffset2, x.piece.length); + } + x = x.next(); + } + return ret; + } + getLinesContent() { + const lines = []; + let linesLength = 0; + let currentLine = ""; + let danglingCR = false; + this.iterate(this.root, (node) => { + if (node === SENTINEL2) { + return true; + } + const piece = node.piece; + let pieceLength = piece.length; + if (pieceLength === 0) { + return true; + } + const buffer = this._buffers[piece.bufferIndex].buffer; + const lineStarts = this._buffers[piece.bufferIndex].lineStarts; + const pieceStartLine = piece.start.line; + const pieceEndLine = piece.end.line; + let pieceStartOffset = lineStarts[pieceStartLine] + piece.start.column; + if (danglingCR) { + if (buffer.charCodeAt(pieceStartOffset) === 10) { + pieceStartOffset++; + pieceLength--; + } + lines[linesLength++] = currentLine; + currentLine = ""; + danglingCR = false; + if (pieceLength === 0) { + return true; + } + } + if (pieceStartLine === pieceEndLine) { + if (!this._EOLNormalized && buffer.charCodeAt(pieceStartOffset + pieceLength - 1) === 13) { + danglingCR = true; + currentLine += buffer.substr(pieceStartOffset, pieceLength - 1); + } else { + currentLine += buffer.substr(pieceStartOffset, pieceLength); + } + return true; + } + currentLine += this._EOLNormalized ? buffer.substring(pieceStartOffset, Math.max(pieceStartOffset, lineStarts[pieceStartLine + 1] - this._EOLLength)) : buffer.substring(pieceStartOffset, lineStarts[pieceStartLine + 1]).replace(/(\r\n|\r|\n)$/, ""); + lines[linesLength++] = currentLine; + for (let line = pieceStartLine + 1; line < pieceEndLine; line++) { + currentLine = this._EOLNormalized ? buffer.substring(lineStarts[line], lineStarts[line + 1] - this._EOLLength) : buffer.substring(lineStarts[line], lineStarts[line + 1]).replace(/(\r\n|\r|\n)$/, ""); + lines[linesLength++] = currentLine; + } + if (!this._EOLNormalized && buffer.charCodeAt(lineStarts[pieceEndLine] + piece.end.column - 1) === 13) { + danglingCR = true; + if (piece.end.column === 0) { + linesLength--; + } else { + currentLine = buffer.substr(lineStarts[pieceEndLine], piece.end.column - 1); + } + } else { + currentLine = buffer.substr(lineStarts[pieceEndLine], piece.end.column); + } + return true; + }); + if (danglingCR) { + lines[linesLength++] = currentLine; + currentLine = ""; + } + lines[linesLength++] = currentLine; + return lines; + } + getLength() { + return this._length; + } + getLineCount() { + return this._lineCnt; + } + getLineContent(lineNumber) { + if (this._lastVisitedLine.lineNumber === lineNumber) { + return this._lastVisitedLine.value; + } + this._lastVisitedLine.lineNumber = lineNumber; + if (lineNumber === this._lineCnt) { + this._lastVisitedLine.value = this.getLineRawContent(lineNumber); + } else if (this._EOLNormalized) { + this._lastVisitedLine.value = this.getLineRawContent(lineNumber, this._EOLLength); + } else { + this._lastVisitedLine.value = this.getLineRawContent(lineNumber).replace(/(\r\n|\r|\n)$/, ""); + } + return this._lastVisitedLine.value; + } + _getCharCode(nodePos) { + if (nodePos.remainder === nodePos.node.piece.length) { + const matchingNode = nodePos.node.next(); + if (!matchingNode) { + return 0; + } + const buffer = this._buffers[matchingNode.piece.bufferIndex]; + const startOffset = this.offsetInBuffer(matchingNode.piece.bufferIndex, matchingNode.piece.start); + return buffer.buffer.charCodeAt(startOffset); + } else { + const buffer = this._buffers[nodePos.node.piece.bufferIndex]; + const startOffset = this.offsetInBuffer(nodePos.node.piece.bufferIndex, nodePos.node.piece.start); + const targetOffset = startOffset + nodePos.remainder; + return buffer.buffer.charCodeAt(targetOffset); + } + } + getLineCharCode(lineNumber, index) { + const nodePos = this.nodeAt2(lineNumber, index + 1); + return this._getCharCode(nodePos); + } + getLineLength(lineNumber) { + if (lineNumber === this.getLineCount()) { + const startOffset = this.getOffsetAt(lineNumber, 1); + return this.getLength() - startOffset; + } + return this.getOffsetAt(lineNumber + 1, 1) - this.getOffsetAt(lineNumber, 1) - this._EOLLength; + } + getNearestChunk(offset) { + const nodePos = this.nodeAt(offset); + if (nodePos.remainder === nodePos.node.piece.length) { + const matchingNode = nodePos.node.next(); + if (!matchingNode || matchingNode === SENTINEL2) { + return ""; + } + const buffer = this._buffers[matchingNode.piece.bufferIndex]; + const startOffset = this.offsetInBuffer(matchingNode.piece.bufferIndex, matchingNode.piece.start); + return buffer.buffer.substring(startOffset, startOffset + matchingNode.piece.length); + } else { + const buffer = this._buffers[nodePos.node.piece.bufferIndex]; + const startOffset = this.offsetInBuffer(nodePos.node.piece.bufferIndex, nodePos.node.piece.start); + const targetOffset = startOffset + nodePos.remainder; + const targetEnd = startOffset + nodePos.node.piece.length; + return buffer.buffer.substring(targetOffset, targetEnd); + } + } + findMatchesInNode(node, searcher, startLineNumber, startColumn, startCursor, endCursor, searchData, captureMatches, limitResultCount, resultLen, result) { + const buffer = this._buffers[node.piece.bufferIndex]; + const startOffsetInBuffer = this.offsetInBuffer(node.piece.bufferIndex, node.piece.start); + const start = this.offsetInBuffer(node.piece.bufferIndex, startCursor); + const end = this.offsetInBuffer(node.piece.bufferIndex, endCursor); + let m; + const ret = { line: 0, column: 0 }; + let searchText; + let offsetInBuffer; + if (searcher._wordSeparators) { + searchText = buffer.buffer.substring(start, end); + offsetInBuffer = (offset) => offset + start; + searcher.reset(0); + } else { + searchText = buffer.buffer; + offsetInBuffer = (offset) => offset; + searcher.reset(start); + } + do { + m = searcher.next(searchText); + if (m) { + if (offsetInBuffer(m.index) >= end) { + return resultLen; + } + this.positionInBuffer(node, offsetInBuffer(m.index) - startOffsetInBuffer, ret); + const lineFeedCnt = this.getLineFeedCnt(node.piece.bufferIndex, startCursor, ret); + const retStartColumn = ret.line === startCursor.line ? ret.column - startCursor.column + startColumn : ret.column + 1; + const retEndColumn = retStartColumn + m[0].length; + result[resultLen++] = createFindMatch(new Range(startLineNumber + lineFeedCnt, retStartColumn, startLineNumber + lineFeedCnt, retEndColumn), m, captureMatches); + if (offsetInBuffer(m.index) + m[0].length >= end) { + return resultLen; + } + if (resultLen >= limitResultCount) { + return resultLen; + } + } + } while (m); + return resultLen; + } + findMatchesLineByLine(searchRange, searchData, captureMatches, limitResultCount) { + const result = []; + let resultLen = 0; + const searcher = new Searcher(searchData.wordSeparators, searchData.regex); + let startPosition = this.nodeAt2(searchRange.startLineNumber, searchRange.startColumn); + if (startPosition === null) { + return []; + } + const endPosition = this.nodeAt2(searchRange.endLineNumber, searchRange.endColumn); + if (endPosition === null) { + return []; + } + let start = this.positionInBuffer(startPosition.node, startPosition.remainder); + const end = this.positionInBuffer(endPosition.node, endPosition.remainder); + if (startPosition.node === endPosition.node) { + this.findMatchesInNode(startPosition.node, searcher, searchRange.startLineNumber, searchRange.startColumn, start, end, searchData, captureMatches, limitResultCount, resultLen, result); + return result; + } + let startLineNumber = searchRange.startLineNumber; + let currentNode = startPosition.node; + while (currentNode !== endPosition.node) { + const lineBreakCnt = this.getLineFeedCnt(currentNode.piece.bufferIndex, start, currentNode.piece.end); + if (lineBreakCnt >= 1) { + const lineStarts = this._buffers[currentNode.piece.bufferIndex].lineStarts; + const startOffsetInBuffer = this.offsetInBuffer(currentNode.piece.bufferIndex, currentNode.piece.start); + const nextLineStartOffset = lineStarts[start.line + lineBreakCnt]; + const startColumn3 = startLineNumber === searchRange.startLineNumber ? searchRange.startColumn : 1; + resultLen = this.findMatchesInNode(currentNode, searcher, startLineNumber, startColumn3, start, this.positionInBuffer(currentNode, nextLineStartOffset - startOffsetInBuffer), searchData, captureMatches, limitResultCount, resultLen, result); + if (resultLen >= limitResultCount) { + return result; + } + startLineNumber += lineBreakCnt; + } + const startColumn2 = startLineNumber === searchRange.startLineNumber ? searchRange.startColumn - 1 : 0; + if (startLineNumber === searchRange.endLineNumber) { + const text2 = this.getLineContent(startLineNumber).substring(startColumn2, searchRange.endColumn - 1); + resultLen = this._findMatchesInLine(searchData, searcher, text2, searchRange.endLineNumber, startColumn2, resultLen, result, captureMatches, limitResultCount); + return result; + } + resultLen = this._findMatchesInLine(searchData, searcher, this.getLineContent(startLineNumber).substr(startColumn2), startLineNumber, startColumn2, resultLen, result, captureMatches, limitResultCount); + if (resultLen >= limitResultCount) { + return result; + } + startLineNumber++; + startPosition = this.nodeAt2(startLineNumber, 1); + currentNode = startPosition.node; + start = this.positionInBuffer(startPosition.node, startPosition.remainder); + } + if (startLineNumber === searchRange.endLineNumber) { + const startColumn2 = startLineNumber === searchRange.startLineNumber ? searchRange.startColumn - 1 : 0; + const text2 = this.getLineContent(startLineNumber).substring(startColumn2, searchRange.endColumn - 1); + resultLen = this._findMatchesInLine(searchData, searcher, text2, searchRange.endLineNumber, startColumn2, resultLen, result, captureMatches, limitResultCount); + return result; + } + const startColumn = startLineNumber === searchRange.startLineNumber ? searchRange.startColumn : 1; + resultLen = this.findMatchesInNode(endPosition.node, searcher, startLineNumber, startColumn, start, end, searchData, captureMatches, limitResultCount, resultLen, result); + return result; + } + _findMatchesInLine(searchData, searcher, text2, lineNumber, deltaOffset, resultLen, result, captureMatches, limitResultCount) { + const wordSeparators2 = searchData.wordSeparators; + if (!captureMatches && searchData.simpleSearch) { + const searchString = searchData.simpleSearch; + const searchStringLen = searchString.length; + const textLength = text2.length; + let lastMatchIndex = -searchStringLen; + while ((lastMatchIndex = text2.indexOf(searchString, lastMatchIndex + searchStringLen)) !== -1) { + if (!wordSeparators2 || isValidMatch(wordSeparators2, text2, textLength, lastMatchIndex, searchStringLen)) { + result[resultLen++] = new FindMatch(new Range(lineNumber, lastMatchIndex + 1 + deltaOffset, lineNumber, lastMatchIndex + 1 + searchStringLen + deltaOffset), null); + if (resultLen >= limitResultCount) { + return resultLen; + } + } + } + return resultLen; + } + let m; + searcher.reset(0); + do { + m = searcher.next(text2); + if (m) { + result[resultLen++] = createFindMatch(new Range(lineNumber, m.index + 1 + deltaOffset, lineNumber, m.index + 1 + m[0].length + deltaOffset), m, captureMatches); + if (resultLen >= limitResultCount) { + return resultLen; + } + } + } while (m); + return resultLen; + } + // #endregion + // #region Piece Table + insert(offset, value, eolNormalized = false) { + this._EOLNormalized = this._EOLNormalized && eolNormalized; + this._lastVisitedLine.lineNumber = 0; + this._lastVisitedLine.value = ""; + if (this.root !== SENTINEL2) { + const { node, remainder, nodeStartOffset } = this.nodeAt(offset); + const piece = node.piece; + const bufferIndex = piece.bufferIndex; + const insertPosInBuffer = this.positionInBuffer(node, remainder); + if (node.piece.bufferIndex === 0 && piece.end.line === this._lastChangeBufferPos.line && piece.end.column === this._lastChangeBufferPos.column && nodeStartOffset + piece.length === offset && value.length < AverageBufferSize) { + this.appendToNode(node, value); + this.computeBufferMetadata(); + return; + } + if (nodeStartOffset === offset) { + this.insertContentToNodeLeft(value, node); + this._searchCache.validate(offset); + } else if (nodeStartOffset + node.piece.length > offset) { + const nodesToDel = []; + let newRightPiece = new Piece(piece.bufferIndex, insertPosInBuffer, piece.end, this.getLineFeedCnt(piece.bufferIndex, insertPosInBuffer, piece.end), this.offsetInBuffer(bufferIndex, piece.end) - this.offsetInBuffer(bufferIndex, insertPosInBuffer)); + if (this.shouldCheckCRLF() && this.endWithCR(value)) { + const headOfRight = this.nodeCharCodeAt(node, remainder); + if (headOfRight === 10) { + const newStart = { line: newRightPiece.start.line + 1, column: 0 }; + newRightPiece = new Piece(newRightPiece.bufferIndex, newStart, newRightPiece.end, this.getLineFeedCnt(newRightPiece.bufferIndex, newStart, newRightPiece.end), newRightPiece.length - 1); + value += "\n"; + } + } + if (this.shouldCheckCRLF() && this.startWithLF(value)) { + const tailOfLeft = this.nodeCharCodeAt(node, remainder - 1); + if (tailOfLeft === 13) { + const previousPos = this.positionInBuffer(node, remainder - 1); + this.deleteNodeTail(node, previousPos); + value = "\r" + value; + if (node.piece.length === 0) { + nodesToDel.push(node); + } + } else { + this.deleteNodeTail(node, insertPosInBuffer); + } + } else { + this.deleteNodeTail(node, insertPosInBuffer); + } + const newPieces = this.createNewPieces(value); + if (newRightPiece.length > 0) { + this.rbInsertRight(node, newRightPiece); + } + let tmpNode = node; + for (let k = 0; k < newPieces.length; k++) { + tmpNode = this.rbInsertRight(tmpNode, newPieces[k]); + } + this.deleteNodes(nodesToDel); + } else { + this.insertContentToNodeRight(value, node); + } + } else { + const pieces = this.createNewPieces(value); + let node = this.rbInsertLeft(null, pieces[0]); + for (let k = 1; k < pieces.length; k++) { + node = this.rbInsertRight(node, pieces[k]); + } + } + this.computeBufferMetadata(); + } + delete(offset, cnt) { + this._lastVisitedLine.lineNumber = 0; + this._lastVisitedLine.value = ""; + if (cnt <= 0 || this.root === SENTINEL2) { + return; + } + const startPosition = this.nodeAt(offset); + const endPosition = this.nodeAt(offset + cnt); + const startNode = startPosition.node; + const endNode = endPosition.node; + if (startNode === endNode) { + const startSplitPosInBuffer2 = this.positionInBuffer(startNode, startPosition.remainder); + const endSplitPosInBuffer2 = this.positionInBuffer(startNode, endPosition.remainder); + if (startPosition.nodeStartOffset === offset) { + if (cnt === startNode.piece.length) { + const next = startNode.next(); + rbDelete(this, startNode); + this.validateCRLFWithPrevNode(next); + this.computeBufferMetadata(); + return; + } + this.deleteNodeHead(startNode, endSplitPosInBuffer2); + this._searchCache.validate(offset); + this.validateCRLFWithPrevNode(startNode); + this.computeBufferMetadata(); + return; + } + if (startPosition.nodeStartOffset + startNode.piece.length === offset + cnt) { + this.deleteNodeTail(startNode, startSplitPosInBuffer2); + this.validateCRLFWithNextNode(startNode); + this.computeBufferMetadata(); + return; + } + this.shrinkNode(startNode, startSplitPosInBuffer2, endSplitPosInBuffer2); + this.computeBufferMetadata(); + return; + } + const nodesToDel = []; + const startSplitPosInBuffer = this.positionInBuffer(startNode, startPosition.remainder); + this.deleteNodeTail(startNode, startSplitPosInBuffer); + this._searchCache.validate(offset); + if (startNode.piece.length === 0) { + nodesToDel.push(startNode); + } + const endSplitPosInBuffer = this.positionInBuffer(endNode, endPosition.remainder); + this.deleteNodeHead(endNode, endSplitPosInBuffer); + if (endNode.piece.length === 0) { + nodesToDel.push(endNode); + } + const secondNode = startNode.next(); + for (let node = secondNode; node !== SENTINEL2 && node !== endNode; node = node.next()) { + nodesToDel.push(node); + } + const prev = startNode.piece.length === 0 ? startNode.prev() : startNode; + this.deleteNodes(nodesToDel); + this.validateCRLFWithNextNode(prev); + this.computeBufferMetadata(); + } + insertContentToNodeLeft(value, node) { + const nodesToDel = []; + if (this.shouldCheckCRLF() && this.endWithCR(value) && this.startWithLF(node)) { + const piece = node.piece; + const newStart = { line: piece.start.line + 1, column: 0 }; + const nPiece = new Piece(piece.bufferIndex, newStart, piece.end, this.getLineFeedCnt(piece.bufferIndex, newStart, piece.end), piece.length - 1); + node.piece = nPiece; + value += "\n"; + updateTreeMetadata(this, node, -1, -1); + if (node.piece.length === 0) { + nodesToDel.push(node); + } + } + const newPieces = this.createNewPieces(value); + let newNode = this.rbInsertLeft(node, newPieces[newPieces.length - 1]); + for (let k = newPieces.length - 2; k >= 0; k--) { + newNode = this.rbInsertLeft(newNode, newPieces[k]); + } + this.validateCRLFWithPrevNode(newNode); + this.deleteNodes(nodesToDel); + } + insertContentToNodeRight(value, node) { + if (this.adjustCarriageReturnFromNext(value, node)) { + value += "\n"; + } + const newPieces = this.createNewPieces(value); + const newNode = this.rbInsertRight(node, newPieces[0]); + let tmpNode = newNode; + for (let k = 1; k < newPieces.length; k++) { + tmpNode = this.rbInsertRight(tmpNode, newPieces[k]); + } + this.validateCRLFWithPrevNode(newNode); + } + positionInBuffer(node, remainder, ret) { + const piece = node.piece; + const bufferIndex = node.piece.bufferIndex; + const lineStarts = this._buffers[bufferIndex].lineStarts; + const startOffset = lineStarts[piece.start.line] + piece.start.column; + const offset = startOffset + remainder; + let low = piece.start.line; + let high = piece.end.line; + let mid = 0; + let midStop = 0; + let midStart = 0; + while (low <= high) { + mid = low + (high - low) / 2 | 0; + midStart = lineStarts[mid]; + if (mid === high) { + break; + } + midStop = lineStarts[mid + 1]; + if (offset < midStart) { + high = mid - 1; + } else if (offset >= midStop) { + low = mid + 1; + } else { + break; + } + } + if (ret) { + ret.line = mid; + ret.column = offset - midStart; + return null; + } + return { + line: mid, + column: offset - midStart + }; + } + getLineFeedCnt(bufferIndex, start, end) { + if (end.column === 0) { + return end.line - start.line; + } + const lineStarts = this._buffers[bufferIndex].lineStarts; + if (end.line === lineStarts.length - 1) { + return end.line - start.line; + } + const nextLineStartOffset = lineStarts[end.line + 1]; + const endOffset = lineStarts[end.line] + end.column; + if (nextLineStartOffset > endOffset + 1) { + return end.line - start.line; + } + const previousCharOffset = endOffset - 1; + const buffer = this._buffers[bufferIndex].buffer; + if (buffer.charCodeAt(previousCharOffset) === 13) { + return end.line - start.line + 1; + } else { + return end.line - start.line; + } + } + offsetInBuffer(bufferIndex, cursor) { + const lineStarts = this._buffers[bufferIndex].lineStarts; + return lineStarts[cursor.line] + cursor.column; + } + deleteNodes(nodes) { + for (let i2 = 0; i2 < nodes.length; i2++) { + rbDelete(this, nodes[i2]); + } + } + createNewPieces(text2) { + if (text2.length > AverageBufferSize) { + const newPieces = []; + while (text2.length > AverageBufferSize) { + const lastChar = text2.charCodeAt(AverageBufferSize - 1); + let splitText; + if (lastChar === 13 || lastChar >= 55296 && lastChar <= 56319) { + splitText = text2.substring(0, AverageBufferSize - 1); + text2 = text2.substring(AverageBufferSize - 1); + } else { + splitText = text2.substring(0, AverageBufferSize); + text2 = text2.substring(AverageBufferSize); + } + const lineStarts3 = createLineStartsFast(splitText); + newPieces.push(new Piece( + this._buffers.length, + /* buffer index */ + { line: 0, column: 0 }, + { line: lineStarts3.length - 1, column: splitText.length - lineStarts3[lineStarts3.length - 1] }, + lineStarts3.length - 1, + splitText.length + )); + this._buffers.push(new StringBuffer(splitText, lineStarts3)); + } + const lineStarts2 = createLineStartsFast(text2); + newPieces.push(new Piece( + this._buffers.length, + /* buffer index */ + { line: 0, column: 0 }, + { line: lineStarts2.length - 1, column: text2.length - lineStarts2[lineStarts2.length - 1] }, + lineStarts2.length - 1, + text2.length + )); + this._buffers.push(new StringBuffer(text2, lineStarts2)); + return newPieces; + } + let startOffset = this._buffers[0].buffer.length; + const lineStarts = createLineStartsFast(text2, false); + let start = this._lastChangeBufferPos; + if (this._buffers[0].lineStarts[this._buffers[0].lineStarts.length - 1] === startOffset && startOffset !== 0 && this.startWithLF(text2) && this.endWithCR(this._buffers[0].buffer)) { + this._lastChangeBufferPos = { line: this._lastChangeBufferPos.line, column: this._lastChangeBufferPos.column + 1 }; + start = this._lastChangeBufferPos; + for (let i2 = 0; i2 < lineStarts.length; i2++) { + lineStarts[i2] += startOffset + 1; + } + this._buffers[0].lineStarts = this._buffers[0].lineStarts.concat(lineStarts.slice(1)); + this._buffers[0].buffer += "_" + text2; + startOffset += 1; + } else { + if (startOffset !== 0) { + for (let i2 = 0; i2 < lineStarts.length; i2++) { + lineStarts[i2] += startOffset; + } + } + this._buffers[0].lineStarts = this._buffers[0].lineStarts.concat(lineStarts.slice(1)); + this._buffers[0].buffer += text2; + } + const endOffset = this._buffers[0].buffer.length; + const endIndex = this._buffers[0].lineStarts.length - 1; + const endColumn = endOffset - this._buffers[0].lineStarts[endIndex]; + const endPos = { line: endIndex, column: endColumn }; + const newPiece = new Piece( + 0, + /** todo@peng */ + start, + endPos, + this.getLineFeedCnt(0, start, endPos), + endOffset - startOffset + ); + this._lastChangeBufferPos = endPos; + return [newPiece]; + } + getLineRawContent(lineNumber, endOffset = 0) { + let x = this.root; + let ret = ""; + const cache = this._searchCache.get2(lineNumber); + if (cache) { + x = cache.node; + const prevAccumulatedValue = this.getAccumulatedValue(x, lineNumber - cache.nodeStartLineNumber - 1); + const buffer = this._buffers[x.piece.bufferIndex].buffer; + const startOffset = this.offsetInBuffer(x.piece.bufferIndex, x.piece.start); + if (cache.nodeStartLineNumber + x.piece.lineFeedCnt === lineNumber) { + ret = buffer.substring(startOffset + prevAccumulatedValue, startOffset + x.piece.length); + } else { + const accumulatedValue = this.getAccumulatedValue(x, lineNumber - cache.nodeStartLineNumber); + return buffer.substring(startOffset + prevAccumulatedValue, startOffset + accumulatedValue - endOffset); + } + } else { + let nodeStartOffset = 0; + const originalLineNumber = lineNumber; + while (x !== SENTINEL2) { + if (x.left !== SENTINEL2 && x.lf_left >= lineNumber - 1) { + x = x.left; + } else if (x.lf_left + x.piece.lineFeedCnt > lineNumber - 1) { + const prevAccumulatedValue = this.getAccumulatedValue(x, lineNumber - x.lf_left - 2); + const accumulatedValue = this.getAccumulatedValue(x, lineNumber - x.lf_left - 1); + const buffer = this._buffers[x.piece.bufferIndex].buffer; + const startOffset = this.offsetInBuffer(x.piece.bufferIndex, x.piece.start); + nodeStartOffset += x.size_left; + this._searchCache.set({ + node: x, + nodeStartOffset, + nodeStartLineNumber: originalLineNumber - (lineNumber - 1 - x.lf_left) + }); + return buffer.substring(startOffset + prevAccumulatedValue, startOffset + accumulatedValue - endOffset); + } else if (x.lf_left + x.piece.lineFeedCnt === lineNumber - 1) { + const prevAccumulatedValue = this.getAccumulatedValue(x, lineNumber - x.lf_left - 2); + const buffer = this._buffers[x.piece.bufferIndex].buffer; + const startOffset = this.offsetInBuffer(x.piece.bufferIndex, x.piece.start); + ret = buffer.substring(startOffset + prevAccumulatedValue, startOffset + x.piece.length); + break; + } else { + lineNumber -= x.lf_left + x.piece.lineFeedCnt; + nodeStartOffset += x.size_left + x.piece.length; + x = x.right; + } + } + } + x = x.next(); + while (x !== SENTINEL2) { + const buffer = this._buffers[x.piece.bufferIndex].buffer; + if (x.piece.lineFeedCnt > 0) { + const accumulatedValue = this.getAccumulatedValue(x, 0); + const startOffset = this.offsetInBuffer(x.piece.bufferIndex, x.piece.start); + ret += buffer.substring(startOffset, startOffset + accumulatedValue - endOffset); + return ret; + } else { + const startOffset = this.offsetInBuffer(x.piece.bufferIndex, x.piece.start); + ret += buffer.substr(startOffset, x.piece.length); + } + x = x.next(); + } + return ret; + } + computeBufferMetadata() { + let x = this.root; + let lfCnt = 1; + let len = 0; + while (x !== SENTINEL2) { + lfCnt += x.lf_left + x.piece.lineFeedCnt; + len += x.size_left + x.piece.length; + x = x.right; + } + this._lineCnt = lfCnt; + this._length = len; + this._searchCache.validate(this._length); + } + // #region node operations + getIndexOf(node, accumulatedValue) { + const piece = node.piece; + const pos = this.positionInBuffer(node, accumulatedValue); + const lineCnt = pos.line - piece.start.line; + if (this.offsetInBuffer(piece.bufferIndex, piece.end) - this.offsetInBuffer(piece.bufferIndex, piece.start) === accumulatedValue) { + const realLineCnt = this.getLineFeedCnt(node.piece.bufferIndex, piece.start, pos); + if (realLineCnt !== lineCnt) { + return { index: realLineCnt, remainder: 0 }; + } + } + return { index: lineCnt, remainder: pos.column }; + } + getAccumulatedValue(node, index) { + if (index < 0) { + return 0; + } + const piece = node.piece; + const lineStarts = this._buffers[piece.bufferIndex].lineStarts; + const expectedLineStartIndex = piece.start.line + index + 1; + if (expectedLineStartIndex > piece.end.line) { + return lineStarts[piece.end.line] + piece.end.column - lineStarts[piece.start.line] - piece.start.column; + } else { + return lineStarts[expectedLineStartIndex] - lineStarts[piece.start.line] - piece.start.column; + } + } + deleteNodeTail(node, pos) { + const piece = node.piece; + const originalLFCnt = piece.lineFeedCnt; + const originalEndOffset = this.offsetInBuffer(piece.bufferIndex, piece.end); + const newEnd = pos; + const newEndOffset = this.offsetInBuffer(piece.bufferIndex, newEnd); + const newLineFeedCnt = this.getLineFeedCnt(piece.bufferIndex, piece.start, newEnd); + const lf_delta = newLineFeedCnt - originalLFCnt; + const size_delta = newEndOffset - originalEndOffset; + const newLength = piece.length + size_delta; + node.piece = new Piece(piece.bufferIndex, piece.start, newEnd, newLineFeedCnt, newLength); + updateTreeMetadata(this, node, size_delta, lf_delta); + } + deleteNodeHead(node, pos) { + const piece = node.piece; + const originalLFCnt = piece.lineFeedCnt; + const originalStartOffset = this.offsetInBuffer(piece.bufferIndex, piece.start); + const newStart = pos; + const newLineFeedCnt = this.getLineFeedCnt(piece.bufferIndex, newStart, piece.end); + const newStartOffset = this.offsetInBuffer(piece.bufferIndex, newStart); + const lf_delta = newLineFeedCnt - originalLFCnt; + const size_delta = originalStartOffset - newStartOffset; + const newLength = piece.length + size_delta; + node.piece = new Piece(piece.bufferIndex, newStart, piece.end, newLineFeedCnt, newLength); + updateTreeMetadata(this, node, size_delta, lf_delta); + } + shrinkNode(node, start, end) { + const piece = node.piece; + const originalStartPos = piece.start; + const originalEndPos = piece.end; + const oldLength = piece.length; + const oldLFCnt = piece.lineFeedCnt; + const newEnd = start; + const newLineFeedCnt = this.getLineFeedCnt(piece.bufferIndex, piece.start, newEnd); + const newLength = this.offsetInBuffer(piece.bufferIndex, start) - this.offsetInBuffer(piece.bufferIndex, originalStartPos); + node.piece = new Piece(piece.bufferIndex, piece.start, newEnd, newLineFeedCnt, newLength); + updateTreeMetadata(this, node, newLength - oldLength, newLineFeedCnt - oldLFCnt); + const newPiece = new Piece(piece.bufferIndex, end, originalEndPos, this.getLineFeedCnt(piece.bufferIndex, end, originalEndPos), this.offsetInBuffer(piece.bufferIndex, originalEndPos) - this.offsetInBuffer(piece.bufferIndex, end)); + const newNode = this.rbInsertRight(node, newPiece); + this.validateCRLFWithPrevNode(newNode); + } + appendToNode(node, value) { + if (this.adjustCarriageReturnFromNext(value, node)) { + value += "\n"; + } + const hitCRLF = this.shouldCheckCRLF() && this.startWithLF(value) && this.endWithCR(node); + const startOffset = this._buffers[0].buffer.length; + this._buffers[0].buffer += value; + const lineStarts = createLineStartsFast(value, false); + for (let i2 = 0; i2 < lineStarts.length; i2++) { + lineStarts[i2] += startOffset; + } + if (hitCRLF) { + const prevStartOffset = this._buffers[0].lineStarts[this._buffers[0].lineStarts.length - 2]; + this._buffers[0].lineStarts.pop(); + this._lastChangeBufferPos = { line: this._lastChangeBufferPos.line - 1, column: startOffset - prevStartOffset }; + } + this._buffers[0].lineStarts = this._buffers[0].lineStarts.concat(lineStarts.slice(1)); + const endIndex = this._buffers[0].lineStarts.length - 1; + const endColumn = this._buffers[0].buffer.length - this._buffers[0].lineStarts[endIndex]; + const newEnd = { line: endIndex, column: endColumn }; + const newLength = node.piece.length + value.length; + const oldLineFeedCnt = node.piece.lineFeedCnt; + const newLineFeedCnt = this.getLineFeedCnt(0, node.piece.start, newEnd); + const lf_delta = newLineFeedCnt - oldLineFeedCnt; + node.piece = new Piece(node.piece.bufferIndex, node.piece.start, newEnd, newLineFeedCnt, newLength); + this._lastChangeBufferPos = newEnd; + updateTreeMetadata(this, node, value.length, lf_delta); + } + nodeAt(offset) { + let x = this.root; + const cache = this._searchCache.get(offset); + if (cache) { + return { + node: cache.node, + nodeStartOffset: cache.nodeStartOffset, + remainder: offset - cache.nodeStartOffset + }; + } + let nodeStartOffset = 0; + while (x !== SENTINEL2) { + if (x.size_left > offset) { + x = x.left; + } else if (x.size_left + x.piece.length >= offset) { + nodeStartOffset += x.size_left; + const ret = { + node: x, + remainder: offset - x.size_left, + nodeStartOffset + }; + this._searchCache.set(ret); + return ret; + } else { + offset -= x.size_left + x.piece.length; + nodeStartOffset += x.size_left + x.piece.length; + x = x.right; + } + } + return null; + } + nodeAt2(lineNumber, column) { + let x = this.root; + let nodeStartOffset = 0; + while (x !== SENTINEL2) { + if (x.left !== SENTINEL2 && x.lf_left >= lineNumber - 1) { + x = x.left; + } else if (x.lf_left + x.piece.lineFeedCnt > lineNumber - 1) { + const prevAccumualtedValue = this.getAccumulatedValue(x, lineNumber - x.lf_left - 2); + const accumulatedValue = this.getAccumulatedValue(x, lineNumber - x.lf_left - 1); + nodeStartOffset += x.size_left; + return { + node: x, + remainder: Math.min(prevAccumualtedValue + column - 1, accumulatedValue), + nodeStartOffset + }; + } else if (x.lf_left + x.piece.lineFeedCnt === lineNumber - 1) { + const prevAccumualtedValue = this.getAccumulatedValue(x, lineNumber - x.lf_left - 2); + if (prevAccumualtedValue + column - 1 <= x.piece.length) { + return { + node: x, + remainder: prevAccumualtedValue + column - 1, + nodeStartOffset + }; + } else { + column -= x.piece.length - prevAccumualtedValue; + break; + } + } else { + lineNumber -= x.lf_left + x.piece.lineFeedCnt; + nodeStartOffset += x.size_left + x.piece.length; + x = x.right; + } + } + x = x.next(); + while (x !== SENTINEL2) { + if (x.piece.lineFeedCnt > 0) { + const accumulatedValue = this.getAccumulatedValue(x, 0); + const nodeStartOffset2 = this.offsetOfNode(x); + return { + node: x, + remainder: Math.min(column - 1, accumulatedValue), + nodeStartOffset: nodeStartOffset2 + }; + } else { + if (x.piece.length >= column - 1) { + const nodeStartOffset2 = this.offsetOfNode(x); + return { + node: x, + remainder: column - 1, + nodeStartOffset: nodeStartOffset2 + }; + } else { + column -= x.piece.length; + } + } + x = x.next(); + } + return null; + } + nodeCharCodeAt(node, offset) { + if (node.piece.lineFeedCnt < 1) { + return -1; + } + const buffer = this._buffers[node.piece.bufferIndex]; + const newOffset = this.offsetInBuffer(node.piece.bufferIndex, node.piece.start) + offset; + return buffer.buffer.charCodeAt(newOffset); + } + offsetOfNode(node) { + if (!node) { + return 0; + } + let pos = node.size_left; + while (node !== this.root) { + if (node.parent.right === node) { + pos += node.parent.size_left + node.parent.piece.length; + } + node = node.parent; + } + return pos; + } + // #endregion + // #region CRLF + shouldCheckCRLF() { + return !(this._EOLNormalized && this._EOL === "\n"); + } + startWithLF(val) { + if (typeof val === "string") { + return val.charCodeAt(0) === 10; + } + if (val === SENTINEL2 || val.piece.lineFeedCnt === 0) { + return false; + } + const piece = val.piece; + const lineStarts = this._buffers[piece.bufferIndex].lineStarts; + const line = piece.start.line; + const startOffset = lineStarts[line] + piece.start.column; + if (line === lineStarts.length - 1) { + return false; + } + const nextLineOffset = lineStarts[line + 1]; + if (nextLineOffset > startOffset + 1) { + return false; + } + return this._buffers[piece.bufferIndex].buffer.charCodeAt(startOffset) === 10; + } + endWithCR(val) { + if (typeof val === "string") { + return val.charCodeAt(val.length - 1) === 13; + } + if (val === SENTINEL2 || val.piece.lineFeedCnt === 0) { + return false; + } + return this.nodeCharCodeAt(val, val.piece.length - 1) === 13; + } + validateCRLFWithPrevNode(nextNode) { + if (this.shouldCheckCRLF() && this.startWithLF(nextNode)) { + const node = nextNode.prev(); + if (this.endWithCR(node)) { + this.fixCRLF(node, nextNode); + } + } + } + validateCRLFWithNextNode(node) { + if (this.shouldCheckCRLF() && this.endWithCR(node)) { + const nextNode = node.next(); + if (this.startWithLF(nextNode)) { + this.fixCRLF(node, nextNode); + } + } + } + fixCRLF(prev, next) { + const nodesToDel = []; + const lineStarts = this._buffers[prev.piece.bufferIndex].lineStarts; + let newEnd; + if (prev.piece.end.column === 0) { + newEnd = { line: prev.piece.end.line - 1, column: lineStarts[prev.piece.end.line] - lineStarts[prev.piece.end.line - 1] - 1 }; + } else { + newEnd = { line: prev.piece.end.line, column: prev.piece.end.column - 1 }; + } + const prevNewLength = prev.piece.length - 1; + const prevNewLFCnt = prev.piece.lineFeedCnt - 1; + prev.piece = new Piece(prev.piece.bufferIndex, prev.piece.start, newEnd, prevNewLFCnt, prevNewLength); + updateTreeMetadata(this, prev, -1, -1); + if (prev.piece.length === 0) { + nodesToDel.push(prev); + } + const newStart = { line: next.piece.start.line + 1, column: 0 }; + const newLength = next.piece.length - 1; + const newLineFeedCnt = this.getLineFeedCnt(next.piece.bufferIndex, newStart, next.piece.end); + next.piece = new Piece(next.piece.bufferIndex, newStart, next.piece.end, newLineFeedCnt, newLength); + updateTreeMetadata(this, next, -1, -1); + if (next.piece.length === 0) { + nodesToDel.push(next); + } + const pieces = this.createNewPieces("\r\n"); + this.rbInsertRight(prev, pieces[0]); + for (let i2 = 0; i2 < nodesToDel.length; i2++) { + rbDelete(this, nodesToDel[i2]); + } + } + adjustCarriageReturnFromNext(value, node) { + if (this.shouldCheckCRLF() && this.endWithCR(value)) { + const nextNode = node.next(); + if (this.startWithLF(nextNode)) { + value += "\n"; + if (nextNode.piece.length === 1) { + rbDelete(this, nextNode); + } else { + const piece = nextNode.piece; + const newStart = { line: piece.start.line + 1, column: 0 }; + const newLength = piece.length - 1; + const newLineFeedCnt = this.getLineFeedCnt(piece.bufferIndex, newStart, piece.end); + nextNode.piece = new Piece(piece.bufferIndex, newStart, piece.end, newLineFeedCnt, newLength); + updateTreeMetadata(this, nextNode, -1, -1); + } + return true; + } + } + return false; + } + // #endregion + // #endregion + // #region Tree operations + iterate(node, callback) { + if (node === SENTINEL2) { + return callback(SENTINEL2); + } + const leftRet = this.iterate(node.left, callback); + if (!leftRet) { + return leftRet; + } + return callback(node) && this.iterate(node.right, callback); + } + getNodeContent(node) { + if (node === SENTINEL2) { + return ""; + } + const buffer = this._buffers[node.piece.bufferIndex]; + const piece = node.piece; + const startOffset = this.offsetInBuffer(piece.bufferIndex, piece.start); + const endOffset = this.offsetInBuffer(piece.bufferIndex, piece.end); + const currentContent = buffer.buffer.substring(startOffset, endOffset); + return currentContent; + } + getPieceContent(piece) { + const buffer = this._buffers[piece.bufferIndex]; + const startOffset = this.offsetInBuffer(piece.bufferIndex, piece.start); + const endOffset = this.offsetInBuffer(piece.bufferIndex, piece.end); + const currentContent = buffer.buffer.substring(startOffset, endOffset); + return currentContent; + } + /** + * node node + * / \ / \ + * a b <---- a b + * / + * z + */ + rbInsertRight(node, p) { + const z = new TreeNode( + p, + 1 + /* NodeColor.Red */ + ); + z.left = SENTINEL2; + z.right = SENTINEL2; + z.parent = SENTINEL2; + z.size_left = 0; + z.lf_left = 0; + const x = this.root; + if (x === SENTINEL2) { + this.root = z; + z.color = 0; + } else if (node.right === SENTINEL2) { + node.right = z; + z.parent = node; + } else { + const nextNode = leftest2(node.right); + nextNode.left = z; + z.parent = nextNode; + } + fixInsert(this, z); + return z; + } + /** + * node node + * / \ / \ + * a b ----> a b + * \ + * z + */ + rbInsertLeft(node, p) { + const z = new TreeNode( + p, + 1 + /* NodeColor.Red */ + ); + z.left = SENTINEL2; + z.right = SENTINEL2; + z.parent = SENTINEL2; + z.size_left = 0; + z.lf_left = 0; + if (this.root === SENTINEL2) { + this.root = z; + z.color = 0; + } else if (node.left === SENTINEL2) { + node.left = z; + z.parent = node; + } else { + const prevNode = righttest(node.left); + prevNode.right = z; + z.parent = prevNode; + } + fixInsert(this, z); + return z; + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeTextBuffer.js +var PieceTreeTextBuffer; +var init_pieceTreeTextBuffer = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeTextBuffer.js"() { + init_event(); + init_strings(); + init_range(); + init_model2(); + init_pieceTreeBase(); + init_eolCounter(); + init_textChange(); + init_lifecycle(); + PieceTreeTextBuffer = class _PieceTreeTextBuffer extends Disposable { + constructor(chunks, BOM, eol, containsRTL2, containsUnusualLineTerminators2, isBasicASCII2, eolNormalized) { + super(); + this._onDidChangeContent = this._register(new Emitter()); + this._BOM = BOM; + this._mightContainNonBasicASCII = !isBasicASCII2; + this._mightContainRTL = containsRTL2; + this._mightContainUnusualLineTerminators = containsUnusualLineTerminators2; + this._pieceTree = new PieceTreeBase(chunks, eol, eolNormalized); + } + mightContainRTL() { + return this._mightContainRTL; + } + mightContainUnusualLineTerminators() { + return this._mightContainUnusualLineTerminators; + } + resetMightContainUnusualLineTerminators() { + this._mightContainUnusualLineTerminators = false; + } + mightContainNonBasicASCII() { + return this._mightContainNonBasicASCII; + } + getBOM() { + return this._BOM; + } + getEOL() { + return this._pieceTree.getEOL(); + } + createSnapshot(preserveBOM) { + return this._pieceTree.createSnapshot(preserveBOM ? this._BOM : ""); + } + getOffsetAt(lineNumber, column) { + return this._pieceTree.getOffsetAt(lineNumber, column); + } + getPositionAt(offset) { + return this._pieceTree.getPositionAt(offset); + } + getRangeAt(start, length) { + const end = start + length; + const startPosition = this.getPositionAt(start); + const endPosition = this.getPositionAt(end); + return new Range(startPosition.lineNumber, startPosition.column, endPosition.lineNumber, endPosition.column); + } + getValueInRange(range2, eol = 0) { + if (range2.isEmpty()) { + return ""; + } + const lineEnding = this._getEndOfLine(eol); + return this._pieceTree.getValueInRange(range2, lineEnding); + } + getValueLengthInRange(range2, eol = 0) { + if (range2.isEmpty()) { + return 0; + } + if (range2.startLineNumber === range2.endLineNumber) { + return range2.endColumn - range2.startColumn; + } + const startOffset = this.getOffsetAt(range2.startLineNumber, range2.startColumn); + const endOffset = this.getOffsetAt(range2.endLineNumber, range2.endColumn); + let eolOffsetCompensation = 0; + const desiredEOL = this._getEndOfLine(eol); + const actualEOL = this.getEOL(); + if (desiredEOL.length !== actualEOL.length) { + const delta = desiredEOL.length - actualEOL.length; + const eolCount = range2.endLineNumber - range2.startLineNumber; + eolOffsetCompensation = delta * eolCount; + } + return endOffset - startOffset + eolOffsetCompensation; + } + getCharacterCountInRange(range2, eol = 0) { + if (this._mightContainNonBasicASCII) { + let result = 0; + const fromLineNumber = range2.startLineNumber; + const toLineNumber = range2.endLineNumber; + for (let lineNumber = fromLineNumber; lineNumber <= toLineNumber; lineNumber++) { + const lineContent = this.getLineContent(lineNumber); + const fromOffset = lineNumber === fromLineNumber ? range2.startColumn - 1 : 0; + const toOffset = lineNumber === toLineNumber ? range2.endColumn - 1 : lineContent.length; + for (let offset = fromOffset; offset < toOffset; offset++) { + if (isHighSurrogate(lineContent.charCodeAt(offset))) { + result = result + 1; + offset = offset + 1; + } else { + result = result + 1; + } + } + } + result += this._getEndOfLine(eol).length * (toLineNumber - fromLineNumber); + return result; + } + return this.getValueLengthInRange(range2, eol); + } + getNearestChunk(offset) { + return this._pieceTree.getNearestChunk(offset); + } + getLength() { + return this._pieceTree.getLength(); + } + getLineCount() { + return this._pieceTree.getLineCount(); + } + getLinesContent() { + return this._pieceTree.getLinesContent(); + } + getLineContent(lineNumber) { + return this._pieceTree.getLineContent(lineNumber); + } + getLineCharCode(lineNumber, index) { + return this._pieceTree.getLineCharCode(lineNumber, index); + } + getLineLength(lineNumber) { + return this._pieceTree.getLineLength(lineNumber); + } + getLineFirstNonWhitespaceColumn(lineNumber) { + const result = firstNonWhitespaceIndex(this.getLineContent(lineNumber)); + if (result === -1) { + return 0; + } + return result + 1; + } + getLineLastNonWhitespaceColumn(lineNumber) { + const result = lastNonWhitespaceIndex(this.getLineContent(lineNumber)); + if (result === -1) { + return 0; + } + return result + 2; + } + _getEndOfLine(eol) { + switch (eol) { + case 1: + return "\n"; + case 2: + return "\r\n"; + case 0: + return this.getEOL(); + default: + throw new Error("Unknown EOL preference"); + } + } + setEOL(newEOL) { + this._pieceTree.setEOL(newEOL); + } + applyEdits(rawOperations, recordTrimAutoWhitespace, computeUndoEdits) { + let mightContainRTL = this._mightContainRTL; + let mightContainUnusualLineTerminators = this._mightContainUnusualLineTerminators; + let mightContainNonBasicASCII = this._mightContainNonBasicASCII; + let canReduceOperations = true; + let operations = []; + for (let i2 = 0; i2 < rawOperations.length; i2++) { + const op = rawOperations[i2]; + if (canReduceOperations && op._isTracked) { + canReduceOperations = false; + } + const validatedRange = op.range; + if (op.text) { + let textMightContainNonBasicASCII = true; + if (!mightContainNonBasicASCII) { + textMightContainNonBasicASCII = !isBasicASCII(op.text); + mightContainNonBasicASCII = textMightContainNonBasicASCII; + } + if (!mightContainRTL && textMightContainNonBasicASCII) { + mightContainRTL = containsRTL(op.text); + } + if (!mightContainUnusualLineTerminators && textMightContainNonBasicASCII) { + mightContainUnusualLineTerminators = containsUnusualLineTerminators(op.text); + } + } + let validText = ""; + let eolCount = 0; + let firstLineLength = 0; + let lastLineLength = 0; + if (op.text) { + let strEOL; + [eolCount, firstLineLength, lastLineLength, strEOL] = countEOL(op.text); + const bufferEOL = this.getEOL(); + const expectedStrEOL = bufferEOL === "\r\n" ? 2 : 1; + if (strEOL === 0 || strEOL === expectedStrEOL) { + validText = op.text; + } else { + validText = op.text.replace(/\r\n|\r|\n/g, bufferEOL); + } + } + operations[i2] = { + sortIndex: i2, + identifier: op.identifier || null, + range: validatedRange, + rangeOffset: this.getOffsetAt(validatedRange.startLineNumber, validatedRange.startColumn), + rangeLength: this.getValueLengthInRange(validatedRange), + text: validText, + eolCount, + firstLineLength, + lastLineLength, + forceMoveMarkers: Boolean(op.forceMoveMarkers), + isAutoWhitespaceEdit: op.isAutoWhitespaceEdit || false + }; + } + operations.sort(_PieceTreeTextBuffer._sortOpsAscending); + let hasTouchingRanges = false; + for (let i2 = 0, count = operations.length - 1; i2 < count; i2++) { + const rangeEnd = operations[i2].range.getEndPosition(); + const nextRangeStart = operations[i2 + 1].range.getStartPosition(); + if (nextRangeStart.isBeforeOrEqual(rangeEnd)) { + if (nextRangeStart.isBefore(rangeEnd)) { + throw new Error("Overlapping ranges are not allowed!"); + } + hasTouchingRanges = true; + } + } + if (canReduceOperations) { + operations = this._reduceOperations(operations); + } + const reverseRanges = computeUndoEdits || recordTrimAutoWhitespace ? _PieceTreeTextBuffer._getInverseEditRanges(operations) : []; + const newTrimAutoWhitespaceCandidates = []; + if (recordTrimAutoWhitespace) { + for (let i2 = 0; i2 < operations.length; i2++) { + const op = operations[i2]; + const reverseRange = reverseRanges[i2]; + if (op.isAutoWhitespaceEdit && op.range.isEmpty()) { + for (let lineNumber = reverseRange.startLineNumber; lineNumber <= reverseRange.endLineNumber; lineNumber++) { + let currentLineContent = ""; + if (lineNumber === reverseRange.startLineNumber) { + currentLineContent = this.getLineContent(op.range.startLineNumber); + if (firstNonWhitespaceIndex(currentLineContent) !== -1) { + continue; + } + } + newTrimAutoWhitespaceCandidates.push({ lineNumber, oldContent: currentLineContent }); + } + } + } + } + let reverseOperations = null; + if (computeUndoEdits) { + let reverseRangeDeltaOffset = 0; + reverseOperations = []; + for (let i2 = 0; i2 < operations.length; i2++) { + const op = operations[i2]; + const reverseRange = reverseRanges[i2]; + const bufferText = this.getValueInRange(op.range); + const reverseRangeOffset = op.rangeOffset + reverseRangeDeltaOffset; + reverseRangeDeltaOffset += op.text.length - bufferText.length; + reverseOperations[i2] = { + sortIndex: op.sortIndex, + identifier: op.identifier, + range: reverseRange, + text: bufferText, + textChange: new TextChange(op.rangeOffset, bufferText, reverseRangeOffset, op.text) + }; + } + if (!hasTouchingRanges) { + reverseOperations.sort((a, b) => a.sortIndex - b.sortIndex); + } + } + this._mightContainRTL = mightContainRTL; + this._mightContainUnusualLineTerminators = mightContainUnusualLineTerminators; + this._mightContainNonBasicASCII = mightContainNonBasicASCII; + const contentChanges = this._doApplyEdits(operations); + let trimAutoWhitespaceLineNumbers = null; + if (recordTrimAutoWhitespace && newTrimAutoWhitespaceCandidates.length > 0) { + newTrimAutoWhitespaceCandidates.sort((a, b) => b.lineNumber - a.lineNumber); + trimAutoWhitespaceLineNumbers = []; + for (let i2 = 0, len = newTrimAutoWhitespaceCandidates.length; i2 < len; i2++) { + const lineNumber = newTrimAutoWhitespaceCandidates[i2].lineNumber; + if (i2 > 0 && newTrimAutoWhitespaceCandidates[i2 - 1].lineNumber === lineNumber) { + continue; + } + const prevContent = newTrimAutoWhitespaceCandidates[i2].oldContent; + const lineContent = this.getLineContent(lineNumber); + if (lineContent.length === 0 || lineContent === prevContent || firstNonWhitespaceIndex(lineContent) !== -1) { + continue; + } + trimAutoWhitespaceLineNumbers.push(lineNumber); + } + } + this._onDidChangeContent.fire(); + return new ApplyEditsResult(reverseOperations, contentChanges, trimAutoWhitespaceLineNumbers); + } + /** + * Transform operations such that they represent the same logic edit, + * but that they also do not cause OOM crashes. + */ + _reduceOperations(operations) { + if (operations.length < 1e3) { + return operations; + } + return [this._toSingleEditOperation(operations)]; + } + _toSingleEditOperation(operations) { + let forceMoveMarkers = false; + const firstEditRange = operations[0].range; + const lastEditRange = operations[operations.length - 1].range; + const entireEditRange = new Range(firstEditRange.startLineNumber, firstEditRange.startColumn, lastEditRange.endLineNumber, lastEditRange.endColumn); + let lastEndLineNumber = firstEditRange.startLineNumber; + let lastEndColumn = firstEditRange.startColumn; + const result = []; + for (let i2 = 0, len = operations.length; i2 < len; i2++) { + const operation = operations[i2]; + const range2 = operation.range; + forceMoveMarkers = forceMoveMarkers || operation.forceMoveMarkers; + result.push(this.getValueInRange(new Range(lastEndLineNumber, lastEndColumn, range2.startLineNumber, range2.startColumn))); + if (operation.text.length > 0) { + result.push(operation.text); + } + lastEndLineNumber = range2.endLineNumber; + lastEndColumn = range2.endColumn; + } + const text2 = result.join(""); + const [eolCount, firstLineLength, lastLineLength] = countEOL(text2); + return { + sortIndex: 0, + identifier: operations[0].identifier, + range: entireEditRange, + rangeOffset: this.getOffsetAt(entireEditRange.startLineNumber, entireEditRange.startColumn), + rangeLength: this.getValueLengthInRange( + entireEditRange, + 0 + /* EndOfLinePreference.TextDefined */ + ), + text: text2, + eolCount, + firstLineLength, + lastLineLength, + forceMoveMarkers, + isAutoWhitespaceEdit: false + }; + } + _doApplyEdits(operations) { + operations.sort(_PieceTreeTextBuffer._sortOpsDescending); + const contentChanges = []; + for (let i2 = 0; i2 < operations.length; i2++) { + const op = operations[i2]; + const startLineNumber = op.range.startLineNumber; + const startColumn = op.range.startColumn; + const endLineNumber = op.range.endLineNumber; + const endColumn = op.range.endColumn; + if (startLineNumber === endLineNumber && startColumn === endColumn && op.text.length === 0) { + continue; + } + if (op.text) { + this._pieceTree.delete(op.rangeOffset, op.rangeLength); + this._pieceTree.insert(op.rangeOffset, op.text, true); + } else { + this._pieceTree.delete(op.rangeOffset, op.rangeLength); + } + const contentChangeRange = new Range(startLineNumber, startColumn, endLineNumber, endColumn); + contentChanges.push({ + range: contentChangeRange, + rangeLength: op.rangeLength, + text: op.text, + rangeOffset: op.rangeOffset, + forceMoveMarkers: op.forceMoveMarkers + }); + } + return contentChanges; + } + findMatchesLineByLine(searchRange, searchData, captureMatches, limitResultCount) { + return this._pieceTree.findMatchesLineByLine(searchRange, searchData, captureMatches, limitResultCount); + } + /** + * Assumes `operations` are validated and sorted ascending + */ + static _getInverseEditRanges(operations) { + const result = []; + let prevOpEndLineNumber = 0; + let prevOpEndColumn = 0; + let prevOp = null; + for (let i2 = 0, len = operations.length; i2 < len; i2++) { + const op = operations[i2]; + let startLineNumber; + let startColumn; + if (prevOp) { + if (prevOp.range.endLineNumber === op.range.startLineNumber) { + startLineNumber = prevOpEndLineNumber; + startColumn = prevOpEndColumn + (op.range.startColumn - prevOp.range.endColumn); + } else { + startLineNumber = prevOpEndLineNumber + (op.range.startLineNumber - prevOp.range.endLineNumber); + startColumn = op.range.startColumn; + } + } else { + startLineNumber = op.range.startLineNumber; + startColumn = op.range.startColumn; + } + let resultRange; + if (op.text.length > 0) { + const lineCount = op.eolCount + 1; + if (lineCount === 1) { + resultRange = new Range(startLineNumber, startColumn, startLineNumber, startColumn + op.firstLineLength); + } else { + resultRange = new Range(startLineNumber, startColumn, startLineNumber + lineCount - 1, op.lastLineLength + 1); + } + } else { + resultRange = new Range(startLineNumber, startColumn, startLineNumber, startColumn); + } + prevOpEndLineNumber = resultRange.endLineNumber; + prevOpEndColumn = resultRange.endColumn; + result.push(resultRange); + prevOp = op; + } + return result; + } + static _sortOpsAscending(a, b) { + const r = Range.compareRangesUsingEnds(a.range, b.range); + if (r === 0) { + return a.sortIndex - b.sortIndex; + } + return r; + } + static _sortOpsDescending(a, b) { + const r = Range.compareRangesUsingEnds(a.range, b.range); + if (r === 0) { + return b.sortIndex - a.sortIndex; + } + return -r; + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeTextBufferBuilder.js +var PieceTreeTextBufferFactory, PieceTreeTextBufferBuilder; +var init_pieceTreeTextBufferBuilder = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeTextBufferBuilder.js"() { + init_strings(); + init_pieceTreeBase(); + init_pieceTreeTextBuffer(); + PieceTreeTextBufferFactory = class { + constructor(_chunks, _bom, _cr, _lf, _crlf, _containsRTL, _containsUnusualLineTerminators, _isBasicASCII, _normalizeEOL) { + this._chunks = _chunks; + this._bom = _bom; + this._cr = _cr; + this._lf = _lf; + this._crlf = _crlf; + this._containsRTL = _containsRTL; + this._containsUnusualLineTerminators = _containsUnusualLineTerminators; + this._isBasicASCII = _isBasicASCII; + this._normalizeEOL = _normalizeEOL; + } + _getEOL(defaultEOL) { + const totalEOLCount = this._cr + this._lf + this._crlf; + const totalCRCount = this._cr + this._crlf; + if (totalEOLCount === 0) { + return defaultEOL === 1 ? "\n" : "\r\n"; + } + if (totalCRCount > totalEOLCount / 2) { + return "\r\n"; + } + return "\n"; + } + create(defaultEOL) { + const eol = this._getEOL(defaultEOL); + const chunks = this._chunks; + if (this._normalizeEOL && (eol === "\r\n" && (this._cr > 0 || this._lf > 0) || eol === "\n" && (this._cr > 0 || this._crlf > 0))) { + for (let i2 = 0, len = chunks.length; i2 < len; i2++) { + const str = chunks[i2].buffer.replace(/\r\n|\r|\n/g, eol); + const newLineStart = createLineStartsFast(str); + chunks[i2] = new StringBuffer(str, newLineStart); + } + } + const textBuffer = new PieceTreeTextBuffer(chunks, this._bom, eol, this._containsRTL, this._containsUnusualLineTerminators, this._isBasicASCII, this._normalizeEOL); + return { textBuffer, disposable: textBuffer }; + } + }; + PieceTreeTextBufferBuilder = class { + constructor() { + this.chunks = []; + this.BOM = ""; + this._hasPreviousChar = false; + this._previousChar = 0; + this._tmpLineStarts = []; + this.cr = 0; + this.lf = 0; + this.crlf = 0; + this.containsRTL = false; + this.containsUnusualLineTerminators = false; + this.isBasicASCII = true; + } + acceptChunk(chunk) { + if (chunk.length === 0) { + return; + } + if (this.chunks.length === 0) { + if (startsWithUTF8BOM(chunk)) { + this.BOM = UTF8_BOM_CHARACTER; + chunk = chunk.substr(1); + } + } + const lastChar = chunk.charCodeAt(chunk.length - 1); + if (lastChar === 13 || lastChar >= 55296 && lastChar <= 56319) { + this._acceptChunk1(chunk.substr(0, chunk.length - 1), false); + this._hasPreviousChar = true; + this._previousChar = lastChar; + } else { + this._acceptChunk1(chunk, false); + this._hasPreviousChar = false; + this._previousChar = lastChar; + } + } + _acceptChunk1(chunk, allowEmptyStrings) { + if (!allowEmptyStrings && chunk.length === 0) { + return; + } + if (this._hasPreviousChar) { + this._acceptChunk2(String.fromCharCode(this._previousChar) + chunk); + } else { + this._acceptChunk2(chunk); + } + } + _acceptChunk2(chunk) { + const lineStarts = createLineStarts(this._tmpLineStarts, chunk); + this.chunks.push(new StringBuffer(chunk, lineStarts.lineStarts)); + this.cr += lineStarts.cr; + this.lf += lineStarts.lf; + this.crlf += lineStarts.crlf; + if (!lineStarts.isBasicASCII) { + this.isBasicASCII = false; + if (!this.containsRTL) { + this.containsRTL = containsRTL(chunk); + } + if (!this.containsUnusualLineTerminators) { + this.containsUnusualLineTerminators = containsUnusualLineTerminators(chunk); + } + } + } + finish(normalizeEOL = true) { + this._finish(); + return new PieceTreeTextBufferFactory(this.chunks, this.BOM, this.cr, this.lf, this.crlf, this.containsRTL, this.containsUnusualLineTerminators, this.isBasicASCII, normalizeEOL); + } + _finish() { + if (this.chunks.length === 0) { + this._acceptChunk1("", true); + } + if (this._hasPreviousChar) { + this._hasPreviousChar = false; + const lastChunk = this.chunks[this.chunks.length - 1]; + lastChunk.buffer += String.fromCharCode(this._previousChar); + const newLineStarts = createLineStartsFast(lastChunk.buffer); + lastChunk.lineStarts = newLineStarts; + if (this._previousChar === 13) { + this.cr++; + } + } + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/common/model/tokens/abstractSyntaxTokenBackend.js +var AttachedViews, AttachedViewState, AttachedViewImpl, AttachedViewHandler, AbstractSyntaxTokenBackend; +var init_abstractSyntaxTokenBackend = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/common/model/tokens/abstractSyntaxTokenBackend.js"() { + init_arrays(); + init_async(); + init_event(); + init_lifecycle(); + init_lineRange(); + init_observable(); + init_equals(); + AttachedViews = class { + constructor() { + this._onDidChangeVisibleRanges = new Emitter(); + this.onDidChangeVisibleRanges = this._onDidChangeVisibleRanges.event; + this._views = /* @__PURE__ */ new Set(); + this._viewsChanged = observableSignal(this); + this.visibleLineRanges = derivedOpts({ + owner: this, + equalsFn: itemsEquals(itemEquals()) + }, (reader) => { + this._viewsChanged.read(reader); + const ranges = LineRange.joinMany([...this._views].map((view) => view.state.read(reader)?.visibleLineRanges ?? [])); + return ranges; + }); + } + attachView() { + const view = new AttachedViewImpl((state) => { + this._onDidChangeVisibleRanges.fire({ view, state }); + }); + this._views.add(view); + this._viewsChanged.trigger(void 0); + return view; + } + detachView(view) { + this._views.delete(view); + this._onDidChangeVisibleRanges.fire({ view, state: void 0 }); + this._viewsChanged.trigger(void 0); + } + }; + AttachedViewState = class { + constructor(visibleLineRanges, stabilized) { + this.visibleLineRanges = visibleLineRanges; + this.stabilized = stabilized; + } + equals(other) { + if (this === other) { + return true; + } + if (!equals(this.visibleLineRanges, other.visibleLineRanges, (a, b) => a.equals(b))) { + return false; + } + if (this.stabilized !== other.stabilized) { + return false; + } + return true; + } + }; + AttachedViewImpl = class { + get state() { + return this._state; + } + constructor(handleStateChange) { + this.handleStateChange = handleStateChange; + this._state = observableValueOpts({ owner: this, equalsFn: equalsIfDefined((a, b) => a.equals(b)) }, void 0); + } + setVisibleLines(visibleLines, stabilized) { + const visibleLineRanges = visibleLines.map((line) => new LineRange(line.startLineNumber, line.endLineNumber + 1)); + const state = new AttachedViewState(visibleLineRanges, stabilized); + this._state.set(state, void 0, void 0); + this.handleStateChange(state); + } + }; + AttachedViewHandler = class extends Disposable { + get lineRanges() { + return this._lineRanges; + } + constructor(_refreshTokens) { + super(); + this._refreshTokens = _refreshTokens; + this.runner = this._register(new RunOnceScheduler(() => this.update(), 50)); + this._computedLineRanges = []; + this._lineRanges = []; + } + update() { + if (equals(this._computedLineRanges, this._lineRanges, (a, b) => a.equals(b))) { + return; + } + this._computedLineRanges = this._lineRanges; + this._refreshTokens(); + } + handleStateChange(state) { + this._lineRanges = state.visibleLineRanges; + if (state.stabilized) { + this.runner.cancel(); + this.update(); + } else { + this.runner.schedule(); + } + } + }; + AbstractSyntaxTokenBackend = class extends Disposable { + get backgroundTokenizationState() { + return this._backgroundTokenizationState; + } + constructor(_languageIdCodec, _textModel) { + super(); + this._languageIdCodec = _languageIdCodec; + this._textModel = _textModel; + this._onDidChangeTokens = this._register(new Emitter()); + this.onDidChangeTokens = this._onDidChangeTokens.event; + } + tokenizeIfCheap(lineNumber) { + if (this.isCheapToTokenize(lineNumber)) { + this.forceTokenization(lineNumber); + } + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/common/model/tokens/treeSitter/cursorUtils.js +function gotoNextSibling(newCursor, oldCursor) { + const n2 = newCursor.gotoNextSibling(); + const o = oldCursor.gotoNextSibling(); + if (n2 !== o) { + throw new Error("Trees are out of sync"); + } + return n2 && o; +} +function gotoParent(newCursor, oldCursor) { + const n2 = newCursor.gotoParent(); + const o = oldCursor.gotoParent(); + if (n2 !== o) { + throw new Error("Trees are out of sync"); + } + return n2 && o; +} +function gotoNthChild(newCursor, oldCursor, index) { + const n2 = newCursor.gotoFirstChild(); + const o = oldCursor.gotoFirstChild(); + if (n2 !== o) { + throw new Error("Trees are out of sync"); + } + if (index === 0) { + return n2 && o; + } + for (let i2 = 1; i2 <= index; i2++) { + const nn = newCursor.gotoNextSibling(); + const oo = oldCursor.gotoNextSibling(); + if (nn !== oo) { + throw new Error("Trees are out of sync"); + } + if (!nn || !oo) { + return false; + } + } + return n2 && o; +} +function nextSiblingOrParentSibling(newCursor, oldCursor) { + do { + if (newCursor.currentNode.nextSibling) { + return gotoNextSibling(newCursor, oldCursor); + } + if (newCursor.currentNode.parent) { + gotoParent(newCursor, oldCursor); + } + } while (newCursor.currentNode.nextSibling || newCursor.currentNode.parent); + return false; +} +function getClosestPreviousNodes(cursor, tree) { + const findPrev = tree.walk(); + findPrev.resetTo(cursor); + const startingNode = cursor.currentNode; + do { + if (findPrev.currentNode.previousSibling && findPrev.currentNode.endIndex - findPrev.currentNode.startIndex !== 0) { + findPrev.gotoPreviousSibling(); + } else { + while (!findPrev.currentNode.previousSibling && findPrev.currentNode.parent) { + findPrev.gotoParent(); + } + findPrev.gotoPreviousSibling(); + } + } while (findPrev.currentNode.endIndex > startingNode.startIndex && (findPrev.currentNode.parent || findPrev.currentNode.previousSibling) && findPrev.currentNode.id !== startingNode.id); + if (findPrev.currentNode.id !== startingNode.id && findPrev.currentNode.endIndex <= startingNode.startIndex) { + return findPrev.currentNode; + } else { + return void 0; + } +} +var init_cursorUtils = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/common/model/tokens/treeSitter/cursorUtils.js"() { + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/common/model/tokens/treeSitter/treeSitterTree.js +function newTimeOutProgressCallback() { + let lastYieldTime = performance.now(); + return function parseProgressCallback(_state) { + const now = performance.now(); + if (now - lastYieldTime > 50) { + lastYieldTime = now; + return true; + } + return false; + }; +} +function rangesEqual(a, b) { + return a.startPosition.row === b.startPosition.row && a.startPosition.column === b.startPosition.column && a.endPosition.row === b.endPosition.row && a.endPosition.column === b.endPosition.column && a.startIndex === b.startIndex && a.endIndex === b.endIndex; +} +function rangesIntersect(a, b) { + return a.startIndex <= b.startIndex && a.endIndex >= b.startIndex || b.startIndex <= a.startIndex && b.endIndex >= a.startIndex; +} +var __decorate21, __param19, TreeSitterTree; +var init_treeSitterTree = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/common/model/tokens/treeSitter/treeSitterTree.js"() { + init_async(); + init_lifecycle(); + init_observable(); + init_platform(); + init_log(); + init_telemetry(); + init_textLength(); + init_cursorUtils(); + init_range(); + __decorate21 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + __param19 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + TreeSitterTree = class TreeSitterTree2 extends Disposable { + constructor(languageId, _ranges, _parser, _parserClass, textModel, _logService, _telemetryService) { + super(); + this.languageId = languageId; + this._ranges = _ranges; + this._parser = _parser; + this._parserClass = _parserClass; + this.textModel = textModel; + this._logService = _logService; + this._telemetryService = _telemetryService; + this._tree = observableValue(this, void 0); + this.tree = this._tree; + this._treeLastParsedVersion = observableValue(this, -1); + this.treeLastParsedVersion = this._treeLastParsedVersion; + this._onDidChangeContentQueue = new TaskQueue(); + this._tree = observableValue(this, void 0); + this.tree = this._tree; + this._register(toDisposable(() => { + this._tree.get()?.delete(); + this._lastFullyParsed?.delete(); + this._lastFullyParsedWithEdits?.delete(); + this._parser.delete(); + })); + this.handleContentChange(void 0, this._ranges); + } + handleContentChange(e, ranges) { + const version = this.textModel.getVersionId(); + let newRanges = []; + if (ranges) { + newRanges = this._setRanges(ranges); + } + if (e) { + this._applyEdits(e.changes); + } + this._onDidChangeContentQueue.clearPending(); + this._onDidChangeContentQueue.schedule(async () => { + if (this._store.isDisposed) { + return; + } + const oldTree = this._lastFullyParsed; + let changedNodes; + if (this._lastFullyParsedWithEdits && this._lastFullyParsed) { + changedNodes = this._findChangedNodes(this._lastFullyParsedWithEdits, this._lastFullyParsed); + } + const completed = await this._parseAndUpdateTree(version); + if (completed) { + let ranges2; + if (!changedNodes) { + if (this._ranges) { + ranges2 = this._ranges.map((r) => ({ newRange: new Range(r.startPosition.row + 1, r.startPosition.column + 1, r.endPosition.row + 1, r.endPosition.column + 1), oldRangeLength: r.endIndex - r.startIndex, newRangeStartOffset: r.startIndex, newRangeEndOffset: r.endIndex })); + } + } else if (oldTree && changedNodes) { + ranges2 = this._findTreeChanges(completed, changedNodes, newRanges); + } + if (!ranges2) { + ranges2 = [{ newRange: this.textModel.getFullModelRange(), newRangeStartOffset: 0, newRangeEndOffset: this.textModel.getValueLength() }]; + } + const previousTree = this._tree.get(); + transaction((tx) => { + this._tree.set(completed, tx, { ranges: ranges2, versionId: version }); + this._treeLastParsedVersion.set(version, tx); + }); + previousTree?.delete(); + } + }); + } + _applyEdits(changes) { + for (const change of changes) { + const originalTextLength = TextLength.ofRange(Range.lift(change.range)); + const newTextLength = TextLength.ofText(change.text); + const summedTextLengths = change.text.length === 0 ? newTextLength : originalTextLength.add(newTextLength); + const edit2 = { + startIndex: change.rangeOffset, + oldEndIndex: change.rangeOffset + change.rangeLength, + newEndIndex: change.rangeOffset + change.text.length, + startPosition: { row: change.range.startLineNumber - 1, column: change.range.startColumn - 1 }, + oldEndPosition: { row: change.range.endLineNumber - 1, column: change.range.endColumn - 1 }, + newEndPosition: { row: change.range.startLineNumber + summedTextLengths.lineCount - 1, column: summedTextLengths.lineCount ? summedTextLengths.columnCount : change.range.endColumn + summedTextLengths.columnCount } + }; + this._tree.get()?.edit(edit2); + this._lastFullyParsedWithEdits?.edit(edit2); + } + } + _findChangedNodes(newTree, oldTree) { + if (this._ranges && this._ranges.every((range2) => range2.startPosition.row !== newTree.rootNode.startPosition.row) || newTree.rootNode.startPosition.row !== 0) { + return []; + } + const newCursor = newTree.walk(); + const oldCursor = oldTree.walk(); + const nodes = []; + let next = true; + do { + if (newCursor.currentNode.hasChanges) { + const newChildren = newCursor.currentNode.children; + const indexChangedChildren = []; + const changedChildren = newChildren.filter((c, index) => { + if (c?.hasChanges || oldCursor.currentNode.children.length <= index) { + indexChangedChildren.push(index); + return true; + } + return false; + }); + if (changedChildren.length === 0 || newCursor.currentNode.hasError !== oldCursor.currentNode.hasError) { + while (newCursor.currentNode.parent && next && !newCursor.currentNode.isNamed) { + next = gotoParent(newCursor, oldCursor); + } + const newNode = newCursor.currentNode; + const closestPreviousNode = getClosestPreviousNodes(newCursor, newTree) ?? newNode; + nodes.push({ + startIndex: closestPreviousNode.startIndex, + endIndex: newNode.endIndex, + startPosition: closestPreviousNode.startPosition, + endPosition: newNode.endPosition + }); + next = nextSiblingOrParentSibling(newCursor, oldCursor); + } else if (changedChildren.length >= 1) { + next = gotoNthChild(newCursor, oldCursor, indexChangedChildren[0]); + } + } else { + next = nextSiblingOrParentSibling(newCursor, oldCursor); + } + } while (next); + newCursor.delete(); + oldCursor.delete(); + return nodes; + } + _findTreeChanges(newTree, changedNodes, newRanges) { + let newRangeIndex = 0; + const mergedChanges = []; + for (let nodeIndex = 0; nodeIndex < changedNodes.length; nodeIndex++) { + const node = changedNodes[nodeIndex]; + if (mergedChanges.length > 0) { + if (node.startIndex >= mergedChanges[mergedChanges.length - 1].newRangeStartOffset && node.endIndex <= mergedChanges[mergedChanges.length - 1].newRangeEndOffset) { + continue; + } + } + const cursor = newTree.walk(); + const cursorContainersNode = () => cursor.startIndex < node.startIndex && cursor.endIndex > node.endIndex; + while (cursorContainersNode()) { + let child = cursor.gotoFirstChild(); + let foundChild = false; + while (child) { + if (cursorContainersNode() && cursor.currentNode.isNamed) { + foundChild = true; + break; + } else { + child = cursor.gotoNextSibling(); + } + } + if (!foundChild) { + cursor.gotoParent(); + break; + } + if (cursor.currentNode.childCount === 0) { + break; + } + } + const startPosition = cursor.currentNode.startPosition; + const endPosition = cursor.currentNode.endPosition; + const startIndex = cursor.currentNode.startIndex; + const endIndex = cursor.currentNode.endIndex; + const newChange = { newRange: new Range(startPosition.row + 1, startPosition.column + 1, endPosition.row + 1, endPosition.column + 1), newRangeStartOffset: startIndex, newRangeEndOffset: endIndex }; + if (newRangeIndex < newRanges.length && rangesIntersect(newRanges[newRangeIndex], { startIndex, endIndex, startPosition, endPosition })) { + if (newRanges[newRangeIndex].startIndex < newChange.newRangeStartOffset) { + newChange.newRange = newChange.newRange.setStartPosition(newRanges[newRangeIndex].startPosition.row + 1, newRanges[newRangeIndex].startPosition.column + 1); + newChange.newRangeStartOffset = newRanges[newRangeIndex].startIndex; + } + if (newRanges[newRangeIndex].endIndex > newChange.newRangeEndOffset) { + newChange.newRange = newChange.newRange.setEndPosition(newRanges[newRangeIndex].endPosition.row + 1, newRanges[newRangeIndex].endPosition.column + 1); + newChange.newRangeEndOffset = newRanges[newRangeIndex].endIndex; + } + newRangeIndex++; + } else if (newRangeIndex < newRanges.length && newRanges[newRangeIndex].endIndex < newChange.newRangeStartOffset) { + mergedChanges.push({ + newRange: new Range(newRanges[newRangeIndex].startPosition.row + 1, newRanges[newRangeIndex].startPosition.column + 1, newRanges[newRangeIndex].endPosition.row + 1, newRanges[newRangeIndex].endPosition.column + 1), + newRangeStartOffset: newRanges[newRangeIndex].startIndex, + newRangeEndOffset: newRanges[newRangeIndex].endIndex + }); + } + if (mergedChanges.length > 0 && mergedChanges[mergedChanges.length - 1].newRangeEndOffset >= newChange.newRangeStartOffset) { + mergedChanges[mergedChanges.length - 1].newRange = Range.fromPositions(mergedChanges[mergedChanges.length - 1].newRange.getStartPosition(), newChange.newRange.getEndPosition()); + mergedChanges[mergedChanges.length - 1].newRangeEndOffset = newChange.newRangeEndOffset; + } else { + mergedChanges.push(newChange); + } + } + return this._constrainRanges(mergedChanges); + } + _constrainRanges(changes) { + if (!this._ranges) { + return changes; + } + const constrainedChanges = []; + let changesIndex = 0; + let rangesIndex = 0; + while (changesIndex < changes.length && rangesIndex < this._ranges.length) { + const change = changes[changesIndex]; + const range2 = this._ranges[rangesIndex]; + if (change.newRangeEndOffset < range2.startIndex) { + changesIndex++; + } else if (change.newRangeStartOffset > range2.endIndex) { + rangesIndex++; + } else { + const newRangeStartOffset = Math.max(change.newRangeStartOffset, range2.startIndex); + const newRangeEndOffset = Math.min(change.newRangeEndOffset, range2.endIndex); + const newRange = change.newRange.intersectRanges(new Range(range2.startPosition.row + 1, range2.startPosition.column + 1, range2.endPosition.row + 1, range2.endPosition.column + 1)); + constrainedChanges.push({ + newRange, + newRangeEndOffset, + newRangeStartOffset + }); + if (newRangeEndOffset < change.newRangeEndOffset) { + change.newRange = Range.fromPositions(newRange.getEndPosition(), change.newRange.getEndPosition()); + change.newRangeStartOffset = newRangeEndOffset + 1; + } else { + changesIndex++; + } + } + } + return constrainedChanges; + } + async _parseAndUpdateTree(version) { + const tree = await this._parse(); + if (tree) { + this._lastFullyParsed?.delete(); + this._lastFullyParsed = tree.copy(); + this._lastFullyParsedWithEdits?.delete(); + this._lastFullyParsedWithEdits = tree.copy(); + return tree; + } else if (!this._tree.get()) { + this._parser.reset(); + } + return void 0; + } + _parse() { + let parseType = "fullParse"; + if (this._tree.get()) { + parseType = "incrementalParse"; + } + return this._parseAndYield(parseType); + } + async _parseAndYield(parseType) { + let time = 0; + let passes = 0; + const inProgressVersion = this.textModel.getVersionId(); + let newTree; + const progressCallback = newTimeOutProgressCallback(); + do { + const timer = performance.now(); + newTree = this._parser.parse((index, position) => this._parseCallback(index), this._tree.get(), { progressCallback, includedRanges: this._ranges }); + time += performance.now() - timer; + passes++; + await new Promise((resolve3) => setTimeout0(resolve3)); + } while (!this._store.isDisposed && !newTree && inProgressVersion === this.textModel.getVersionId()); + this._sendParseTimeTelemetry(parseType, time, passes); + return newTree && inProgressVersion === this.textModel.getVersionId() ? newTree : void 0; + } + _parseCallback(index) { + try { + return this.textModel.getTextBuffer().getNearestChunk(index); + } catch (e) { + this._logService.debug("Error getting chunk for tree-sitter parsing", e); + } + return void 0; + } + _setRanges(newRanges) { + const unKnownRanges = []; + if (this._ranges) { + for (const newRange of newRanges) { + let isFullyIncluded = false; + for (let i2 = 0; i2 < this._ranges.length; i2++) { + const existingRange = this._ranges[i2]; + if (rangesEqual(existingRange, newRange) || rangesIntersect(existingRange, newRange)) { + isFullyIncluded = true; + break; + } + } + if (!isFullyIncluded) { + unKnownRanges.push(newRange); + } + } + } else { + unKnownRanges.push(...newRanges); + } + this._ranges = newRanges; + return unKnownRanges; + } + _sendParseTimeTelemetry(parseType, time, passes) { + this._logService.debug(`Tree parsing (${parseType}) took ${time} ms and ${passes} passes.`); + if (parseType === "fullParse") { + this._telemetryService.publicLog2(`treeSitter.fullParse`, { languageId: this.languageId, time, passes }); + } else { + this._telemetryService.publicLog2(`treeSitter.incrementalParse`, { languageId: this.languageId, time, passes }); + } + } + createParsedTreeSync(src) { + const parser2 = new this._parserClass(); + parser2.setLanguage(this._parser.language); + const tree = parser2.parse(src); + parser2.delete(); + return tree ?? void 0; + } + }; + TreeSitterTree = __decorate21([ + __param19(5, ILogService), + __param19(6, ITelemetryService) + ], TreeSitterTree); + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/common/languages/nullTokenize.js +function nullTokenize(languageId, state) { + return new TokenizationResult([new Token(0, "", languageId)], state); +} +function nullTokenizeEncoded(languageId, state) { + const tokens = new Uint32Array(2); + tokens[0] = 0; + tokens[1] = (languageId << 0 | 0 << 8 | 0 << 11 | 1 << 15 | 2 << 24) >>> 0; + return new EncodedTokenizationResult(tokens, state === null ? NullState : state); +} +var NullState; +var init_nullTokenize = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/common/languages/nullTokenize.js"() { + init_languages(); + NullState = new class { + clone() { + return this; + } + equals(other) { + return this === other; + } + }(); + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/common/model/fixedArray.js +function arrayFill(length, value) { + const arr = []; + for (let i2 = 0; i2 < length; i2++) { + arr[i2] = value; + } + return arr; +} +var FixedArray; +var init_fixedArray = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/common/model/fixedArray.js"() { + init_arrays(); + FixedArray = class { + constructor(_default) { + this._default = _default; + this._store = []; + } + get(index) { + if (index < this._store.length) { + return this._store[index]; + } + return this._default; + } + set(index, value) { + while (index >= this._store.length) { + this._store[this._store.length] = this._default; + } + this._store[index] = value; + } + replace(index, oldLength, newLength) { + if (index >= this._store.length) { + return; + } + if (oldLength === 0) { + this.insert(index, newLength); + return; + } else if (newLength === 0) { + this.delete(index, oldLength); + return; + } + const before = this._store.slice(0, index); + const after2 = this._store.slice(index + oldLength); + const insertArr = arrayFill(newLength, this._default); + this._store = before.concat(insertArr, after2); + } + delete(deleteIndex, deleteCount) { + if (deleteCount === 0 || deleteIndex >= this._store.length) { + return; + } + this._store.splice(deleteIndex, deleteCount); + } + insert(insertIndex, insertCount) { + if (insertCount === 0 || insertIndex >= this._store.length) { + return; + } + const arr = []; + for (let i2 = 0; i2 < insertCount; i2++) { + arr[i2] = this._default; + } + this._store = arrayInsert(this._store, insertIndex, arr); + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/common/tokens/contiguousMultilineTokens.js +var ContiguousMultilineTokens; +var init_contiguousMultilineTokens = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/common/tokens/contiguousMultilineTokens.js"() { + ContiguousMultilineTokens = class { + /** + * (Inclusive) start line number for these tokens. + */ + get startLineNumber() { + return this._startLineNumber; + } + /** + * (Inclusive) end line number for these tokens. + */ + get endLineNumber() { + return this._startLineNumber + this._tokens.length - 1; + } + constructor(startLineNumber, tokens) { + this._startLineNumber = startLineNumber; + this._tokens = tokens; + } + /** + * @see {@link _tokens} + */ + getLineTokens(lineNumber) { + return this._tokens[lineNumber - this._startLineNumber]; + } + appendLineTokens(lineTokens) { + this._tokens.push(lineTokens); + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/common/tokens/contiguousMultilineTokensBuilder.js +var ContiguousMultilineTokensBuilder; +var init_contiguousMultilineTokensBuilder = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/common/tokens/contiguousMultilineTokensBuilder.js"() { + init_contiguousMultilineTokens(); + ContiguousMultilineTokensBuilder = class { + constructor() { + this._tokens = []; + } + add(lineNumber, lineTokens) { + if (this._tokens.length > 0) { + const last = this._tokens[this._tokens.length - 1]; + if (last.endLineNumber + 1 === lineNumber) { + last.appendLineTokens(lineTokens); + return; + } + } + this._tokens.push(new ContiguousMultilineTokens(lineNumber, [lineTokens])); + } + finalize() { + return this._tokens; + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/common/model/textModelTokens.js +function findLikelyRelevantLines(model, lineNumber, store) { + let nonWhitespaceColumn = model.getLineFirstNonWhitespaceColumn(lineNumber); + const likelyRelevantLines = []; + let initialState = null; + for (let i2 = lineNumber - 1; nonWhitespaceColumn > 1 && i2 >= 1; i2--) { + const newNonWhitespaceIndex = model.getLineFirstNonWhitespaceColumn(i2); + if (newNonWhitespaceIndex === 0) { + continue; + } + if (newNonWhitespaceIndex < nonWhitespaceColumn) { + likelyRelevantLines.push(model.getLineContent(i2)); + nonWhitespaceColumn = newNonWhitespaceIndex; + initialState = store?.getStartState(i2); + if (initialState) { + break; + } + } + } + likelyRelevantLines.reverse(); + return { likelyRelevantLines, initialState: initialState ?? void 0 }; +} +function safeTokenize(languageIdCodec, languageId, tokenizationSupport, text2, hasEOL, state) { + let r = null; + if (tokenizationSupport) { + try { + r = tokenizationSupport.tokenizeEncoded(text2, hasEOL, state.clone()); + } catch (e) { + onUnexpectedError(e); + } + } + if (!r) { + r = nullTokenizeEncoded(languageIdCodec.encodeLanguageId(languageId), state); + } + LineTokens.convertToEndOffset(r.tokens, text2.length); + return r; +} +var TokenizerWithStateStore, TokenizerWithStateStoreAndTextModel, TrackingTokenizationStateStore, TokenizationStateStore, RangePriorityQueueImpl, DefaultBackgroundTokenizer; +var init_textModelTokens = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/common/model/textModelTokens.js"() { + init_async(); + init_errors(); + init_platform(); + init_stopwatch(); + init_eolCounter(); + init_lineRange(); + init_offsetRange(); + init_nullTokenize(); + init_fixedArray(); + init_contiguousMultilineTokensBuilder(); + init_lineTokens(); + TokenizerWithStateStore = class { + constructor(lineCount, tokenizationSupport) { + this.tokenizationSupport = tokenizationSupport; + this.initialState = this.tokenizationSupport.getInitialState(); + this.store = new TrackingTokenizationStateStore(lineCount); + } + getStartState(lineNumber) { + return this.store.getStartState(lineNumber, this.initialState); + } + getFirstInvalidLine() { + return this.store.getFirstInvalidLine(this.initialState); + } + }; + TokenizerWithStateStoreAndTextModel = class extends TokenizerWithStateStore { + constructor(lineCount, tokenizationSupport, _textModel, _languageIdCodec) { + super(lineCount, tokenizationSupport); + this._textModel = _textModel; + this._languageIdCodec = _languageIdCodec; + } + updateTokensUntilLine(builder, lineNumber) { + const languageId = this._textModel.getLanguageId(); + while (true) { + const lineToTokenize = this.getFirstInvalidLine(); + if (!lineToTokenize || lineToTokenize.lineNumber > lineNumber) { + break; + } + const text2 = this._textModel.getLineContent(lineToTokenize.lineNumber); + const r = safeTokenize(this._languageIdCodec, languageId, this.tokenizationSupport, text2, true, lineToTokenize.startState); + builder.add(lineToTokenize.lineNumber, r.tokens); + this.store.setEndState(lineToTokenize.lineNumber, r.endState); + } + } + /** assumes state is up to date */ + getTokenTypeIfInsertingCharacter(position, character) { + const lineStartState = this.getStartState(position.lineNumber); + if (!lineStartState) { + return 0; + } + const languageId = this._textModel.getLanguageId(); + const lineContent = this._textModel.getLineContent(position.lineNumber); + const text2 = lineContent.substring(0, position.column - 1) + character + lineContent.substring(position.column - 1); + const r = safeTokenize(this._languageIdCodec, languageId, this.tokenizationSupport, text2, true, lineStartState); + const lineTokens = new LineTokens(r.tokens, text2, this._languageIdCodec); + if (lineTokens.getCount() === 0) { + return 0; + } + const tokenIndex = lineTokens.findTokenIndexAtOffset(position.column - 1); + return lineTokens.getStandardTokenType(tokenIndex); + } + /** assumes state is up to date */ + tokenizeLinesAt(lineNumber, lines) { + const lineStartState = this.getStartState(lineNumber); + if (!lineStartState) { + return null; + } + const languageId = this._textModel.getLanguageId(); + const result = []; + let state = lineStartState; + for (const line of lines) { + const r = safeTokenize(this._languageIdCodec, languageId, this.tokenizationSupport, line, true, state); + result.push(new LineTokens(r.tokens, line, this._languageIdCodec)); + state = r.endState; + } + return result; + } + hasAccurateTokensForLine(lineNumber) { + const firstInvalidLineNumber = this.store.getFirstInvalidEndStateLineNumberOrMax(); + return lineNumber < firstInvalidLineNumber; + } + isCheapToTokenize(lineNumber) { + const firstInvalidLineNumber = this.store.getFirstInvalidEndStateLineNumberOrMax(); + if (lineNumber < firstInvalidLineNumber) { + return true; + } + if (lineNumber === firstInvalidLineNumber && this._textModel.getLineLength(lineNumber) < 2048) { + return true; + } + return false; + } + /** + * The result is not cached. + */ + tokenizeHeuristically(builder, startLineNumber, endLineNumber) { + if (endLineNumber <= this.store.getFirstInvalidEndStateLineNumberOrMax()) { + return { heuristicTokens: false }; + } + if (startLineNumber <= this.store.getFirstInvalidEndStateLineNumberOrMax()) { + this.updateTokensUntilLine(builder, endLineNumber); + return { heuristicTokens: false }; + } + let state = this.guessStartState(startLineNumber); + const languageId = this._textModel.getLanguageId(); + for (let lineNumber = startLineNumber; lineNumber <= endLineNumber; lineNumber++) { + const text2 = this._textModel.getLineContent(lineNumber); + const r = safeTokenize(this._languageIdCodec, languageId, this.tokenizationSupport, text2, true, state); + builder.add(lineNumber, r.tokens); + state = r.endState; + } + return { heuristicTokens: true }; + } + guessStartState(lineNumber) { + let { likelyRelevantLines, initialState } = findLikelyRelevantLines(this._textModel, lineNumber, this); + if (!initialState) { + initialState = this.tokenizationSupport.getInitialState(); + } + const languageId = this._textModel.getLanguageId(); + let state = initialState; + for (const line of likelyRelevantLines) { + const r = safeTokenize(this._languageIdCodec, languageId, this.tokenizationSupport, line, false, state); + state = r.endState; + } + return state; + } + }; + TrackingTokenizationStateStore = class { + constructor(lineCount) { + this.lineCount = lineCount; + this._tokenizationStateStore = new TokenizationStateStore(); + this._invalidEndStatesLineNumbers = new RangePriorityQueueImpl(); + this._invalidEndStatesLineNumbers.addRange(new OffsetRange(1, lineCount + 1)); + } + getEndState(lineNumber) { + return this._tokenizationStateStore.getEndState(lineNumber); + } + /** + * @returns if the end state has changed. + */ + setEndState(lineNumber, state) { + if (!state) { + throw new BugIndicatingError("Cannot set null/undefined state"); + } + this._invalidEndStatesLineNumbers.delete(lineNumber); + const r = this._tokenizationStateStore.setEndState(lineNumber, state); + if (r && lineNumber < this.lineCount) { + this._invalidEndStatesLineNumbers.addRange(new OffsetRange(lineNumber + 1, lineNumber + 2)); + } + return r; + } + acceptChange(range2, newLineCount) { + this.lineCount += newLineCount - range2.length; + this._tokenizationStateStore.acceptChange(range2, newLineCount); + this._invalidEndStatesLineNumbers.addRangeAndResize(new OffsetRange(range2.startLineNumber, range2.endLineNumberExclusive), newLineCount); + } + acceptChanges(changes) { + for (const c of changes) { + const [eolCount] = countEOL(c.text); + this.acceptChange(new LineRange(c.range.startLineNumber, c.range.endLineNumber + 1), eolCount + 1); + } + } + invalidateEndStateRange(range2) { + this._invalidEndStatesLineNumbers.addRange(new OffsetRange(range2.startLineNumber, range2.endLineNumberExclusive)); + } + getFirstInvalidEndStateLineNumber() { + return this._invalidEndStatesLineNumbers.min; + } + getFirstInvalidEndStateLineNumberOrMax() { + return this.getFirstInvalidEndStateLineNumber() || Number.MAX_SAFE_INTEGER; + } + allStatesValid() { + return this._invalidEndStatesLineNumbers.min === null; + } + getStartState(lineNumber, initialState) { + if (lineNumber === 1) { + return initialState; + } + return this.getEndState(lineNumber - 1); + } + getFirstInvalidLine(initialState) { + const lineNumber = this.getFirstInvalidEndStateLineNumber(); + if (lineNumber === null) { + return null; + } + const startState = this.getStartState(lineNumber, initialState); + if (!startState) { + throw new BugIndicatingError("Start state must be defined"); + } + return { lineNumber, startState }; + } + }; + TokenizationStateStore = class { + constructor() { + this._lineEndStates = new FixedArray(null); + } + getEndState(lineNumber) { + return this._lineEndStates.get(lineNumber); + } + setEndState(lineNumber, state) { + const oldState = this._lineEndStates.get(lineNumber); + if (oldState && oldState.equals(state)) { + return false; + } + this._lineEndStates.set(lineNumber, state); + return true; + } + acceptChange(range2, newLineCount) { + let length = range2.length; + if (newLineCount > 0 && length > 0) { + length--; + newLineCount--; + } + this._lineEndStates.replace(range2.startLineNumber, length, newLineCount); + } + }; + RangePriorityQueueImpl = class { + constructor() { + this._ranges = []; + } + get min() { + if (this._ranges.length === 0) { + return null; + } + return this._ranges[0].start; + } + delete(value) { + const idx = this._ranges.findIndex((r) => r.contains(value)); + if (idx !== -1) { + const range2 = this._ranges[idx]; + if (range2.start === value) { + if (range2.endExclusive === value + 1) { + this._ranges.splice(idx, 1); + } else { + this._ranges[idx] = new OffsetRange(value + 1, range2.endExclusive); + } + } else { + if (range2.endExclusive === value + 1) { + this._ranges[idx] = new OffsetRange(range2.start, value); + } else { + this._ranges.splice(idx, 1, new OffsetRange(range2.start, value), new OffsetRange(value + 1, range2.endExclusive)); + } + } + } + } + addRange(range2) { + OffsetRange.addRange(range2, this._ranges); + } + addRangeAndResize(range2, newLength) { + let idxFirstMightBeIntersecting = 0; + while (!(idxFirstMightBeIntersecting >= this._ranges.length || range2.start <= this._ranges[idxFirstMightBeIntersecting].endExclusive)) { + idxFirstMightBeIntersecting++; + } + let idxFirstIsAfter = idxFirstMightBeIntersecting; + while (!(idxFirstIsAfter >= this._ranges.length || range2.endExclusive < this._ranges[idxFirstIsAfter].start)) { + idxFirstIsAfter++; + } + const delta = newLength - range2.length; + for (let i2 = idxFirstIsAfter; i2 < this._ranges.length; i2++) { + this._ranges[i2] = this._ranges[i2].delta(delta); + } + if (idxFirstMightBeIntersecting === idxFirstIsAfter) { + const newRange = new OffsetRange(range2.start, range2.start + newLength); + if (!newRange.isEmpty) { + this._ranges.splice(idxFirstMightBeIntersecting, 0, newRange); + } + } else { + const start = Math.min(range2.start, this._ranges[idxFirstMightBeIntersecting].start); + const endEx = Math.max(range2.endExclusive, this._ranges[idxFirstIsAfter - 1].endExclusive); + const newRange = new OffsetRange(start, endEx + delta); + if (!newRange.isEmpty) { + this._ranges.splice(idxFirstMightBeIntersecting, idxFirstIsAfter - idxFirstMightBeIntersecting, newRange); + } else { + this._ranges.splice(idxFirstMightBeIntersecting, idxFirstIsAfter - idxFirstMightBeIntersecting); + } + } + } + toString() { + return this._ranges.map((r) => r.toString()).join(" + "); + } + }; + DefaultBackgroundTokenizer = class { + constructor(_tokenizerWithStateStore, _backgroundTokenStore) { + this._tokenizerWithStateStore = _tokenizerWithStateStore; + this._backgroundTokenStore = _backgroundTokenStore; + this._isDisposed = false; + this._isScheduled = false; + } + dispose() { + this._isDisposed = true; + } + handleChanges() { + this._beginBackgroundTokenization(); + } + _beginBackgroundTokenization() { + if (this._isScheduled || !this._tokenizerWithStateStore._textModel.isAttachedToEditor() || !this._hasLinesToTokenize()) { + return; + } + this._isScheduled = true; + runWhenGlobalIdle((deadline) => { + this._isScheduled = false; + this._backgroundTokenizeWithDeadline(deadline); + }); + } + /** + * Tokenize until the deadline occurs, but try to yield every 1-2ms. + */ + _backgroundTokenizeWithDeadline(deadline) { + const endTime = Date.now() + deadline.timeRemaining(); + const execute = () => { + if (this._isDisposed || !this._tokenizerWithStateStore._textModel.isAttachedToEditor() || !this._hasLinesToTokenize()) { + return; + } + this._backgroundTokenizeForAtLeast1ms(); + if (Date.now() < endTime) { + setTimeout0(execute); + } else { + this._beginBackgroundTokenization(); + } + }; + execute(); + } + /** + * Tokenize for at least 1ms. + */ + _backgroundTokenizeForAtLeast1ms() { + const lineCount = this._tokenizerWithStateStore._textModel.getLineCount(); + const builder = new ContiguousMultilineTokensBuilder(); + const sw = StopWatch.create(false); + do { + if (sw.elapsed() > 1) { + break; + } + const tokenizedLineNumber = this._tokenizeOneInvalidLine(builder); + if (tokenizedLineNumber >= lineCount) { + break; + } + } while (this._hasLinesToTokenize()); + this._backgroundTokenStore.setTokens(builder.finalize()); + this.checkFinished(); + } + _hasLinesToTokenize() { + if (!this._tokenizerWithStateStore) { + return false; + } + return !this._tokenizerWithStateStore.store.allStatesValid(); + } + _tokenizeOneInvalidLine(builder) { + const firstInvalidLine = this._tokenizerWithStateStore?.getFirstInvalidLine(); + if (!firstInvalidLine) { + return this._tokenizerWithStateStore._textModel.getLineCount() + 1; + } + this._tokenizerWithStateStore.updateTokensUntilLine(builder, firstInvalidLine.lineNumber); + return firstInvalidLine.lineNumber; + } + checkFinished() { + if (this._isDisposed) { + return; + } + if (this._tokenizerWithStateStore.store.allStatesValid()) { + this._backgroundTokenStore.backgroundTokenizationFinished(); + } + } + requestTokens(startLineNumber, endLineNumberExclusive) { + this._tokenizerWithStateStore.store.invalidateEndStateRange(new LineRange(startLineNumber, endLineNumberExclusive)); + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/common/model/tokens/treeSitter/tokenStore.js +function isLeaf(node) { + return node.token !== void 0; +} +function append3(node, nodeToAppend) { + let curNode = node; + const parents = []; + let nodeToAppendOfCorrectHeight; + while (true) { + if (nodeToAppend.height === curNode.height) { + nodeToAppendOfCorrectHeight = nodeToAppend; + break; + } + if (isLeaf(curNode)) { + throw new Error("unexpected"); + } + parents.push(curNode); + curNode = curNode.lastChild(); + } + for (let i2 = parents.length - 1; i2 >= 0; i2--) { + const parent = parents[i2]; + if (nodeToAppendOfCorrectHeight) { + if (parent.children.length >= 3) { + const newList = ListNode.create(parent.unappendChild(), nodeToAppendOfCorrectHeight); + nodeToAppendOfCorrectHeight = newList; + } else { + parent.appendChild(nodeToAppendOfCorrectHeight); + nodeToAppendOfCorrectHeight = void 0; + } + } + } + if (nodeToAppendOfCorrectHeight) { + const newList = new ListNode(nodeToAppendOfCorrectHeight.height + 1); + newList.appendChild(node); + newList.appendChild(nodeToAppendOfCorrectHeight); + return newList; + } else { + return node; + } +} +function prepend3(list2, nodeToAppend) { + let curNode = list2; + const parents = []; + while (nodeToAppend.height !== curNode.height) { + if (isLeaf(curNode)) { + throw new Error("unexpected"); + } + parents.push(curNode); + curNode = curNode.children[0]; + } + let nodeToPrependOfCorrectHeight = nodeToAppend; + for (let i2 = parents.length - 1; i2 >= 0; i2--) { + const parent = parents[i2]; + if (nodeToPrependOfCorrectHeight) { + if (parent.children.length >= 3) { + nodeToPrependOfCorrectHeight = ListNode.create(nodeToPrependOfCorrectHeight, parent.unprependChild()); + } else { + parent.prependChild(nodeToPrependOfCorrectHeight); + nodeToPrependOfCorrectHeight = void 0; + } + } + } + if (nodeToPrependOfCorrectHeight) { + return ListNode.create(nodeToPrependOfCorrectHeight, list2); + } else { + return list2; + } +} +function concat2(node1, node2) { + if (node1.height === node2.height) { + return ListNode.create(node1, node2); + } else if (node1.height > node2.height) { + return append3(node1, node2); + } else { + return prepend3(node2, node1); + } +} +var ListNode, TokenQuality, TokenStore; +var init_tokenStore = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/common/model/tokens/treeSitter/tokenStore.js"() { + ListNode = class _ListNode { + get children() { + return this._children; + } + get length() { + return this._length; + } + constructor(height) { + this.height = height; + this._children = []; + this._length = 0; + } + static create(node1, node2) { + const list2 = new _ListNode(node1.height + 1); + list2.appendChild(node1); + list2.appendChild(node2); + return list2; + } + canAppendChild() { + return this._children.length < 3; + } + appendChild(node) { + if (!this.canAppendChild()) { + throw new Error("Cannot insert more than 3 children in a ListNode"); + } + this._children.push(node); + this._length += node.length; + this._updateParentLength(node.length); + if (!isLeaf(node)) { + node.parent = this; + } + } + _updateParentLength(delta) { + let updateParent = this.parent; + while (updateParent) { + updateParent._length += delta; + updateParent = updateParent.parent; + } + } + unappendChild() { + const child = this._children.pop(); + this._length -= child.length; + this._updateParentLength(-child.length); + return child; + } + prependChild(node) { + if (this._children.length >= 3) { + throw new Error("Cannot prepend more than 3 children in a ListNode"); + } + this._children.unshift(node); + this._length += node.length; + this._updateParentLength(node.length); + if (!isLeaf(node)) { + node.parent = this; + } + } + unprependChild() { + const child = this._children.shift(); + this._length -= child.length; + this._updateParentLength(-child.length); + return child; + } + lastChild() { + return this._children[this._children.length - 1]; + } + dispose() { + this._children.splice(0, this._children.length); + } + }; + (function(TokenQuality2) { + TokenQuality2[TokenQuality2["None"] = 0] = "None"; + TokenQuality2[TokenQuality2["ViewportGuess"] = 1] = "ViewportGuess"; + TokenQuality2[TokenQuality2["EditGuess"] = 2] = "EditGuess"; + TokenQuality2[TokenQuality2["Accurate"] = 3] = "Accurate"; + })(TokenQuality || (TokenQuality = {})); + TokenStore = class { + constructor(_textModel) { + this._textModel = _textModel; + this._root = this.createEmptyRoot(); + } + createEmptyRoot() { + return { + length: this._textModel.getValueLength(), + token: 0, + height: 0, + tokenQuality: TokenQuality.None + }; + } + /** + * + * @param update all the tokens for the document in sequence + */ + buildStore(tokens, tokenQuality) { + this._root = this.createFromUpdates(tokens, tokenQuality); + } + createFromUpdates(tokens, tokenQuality) { + if (tokens.length === 0) { + return this.createEmptyRoot(); + } + let newRoot = { + length: tokens[0].length, + token: tokens[0].token, + height: 0, + tokenQuality + }; + for (let j = 1; j < tokens.length; j++) { + newRoot = append3(newRoot, { length: tokens[j].length, token: tokens[j].token, height: 0, tokenQuality }); + } + return newRoot; + } + /** + * + * @param tokens tokens are in sequence in the document. + */ + update(length, tokens, tokenQuality) { + if (tokens.length === 0) { + return; + } + this.replace(length, tokens[0].startOffsetInclusive, tokens, tokenQuality); + } + delete(length, startOffset) { + this.replace(length, startOffset, [], TokenQuality.EditGuess); + } + /** + * + * @param tokens tokens are in sequence in the document. + */ + replace(length, updateOffsetStart, tokens, tokenQuality) { + const firstUnchangedOffsetAfterUpdate = updateOffsetStart + length; + const precedingNodes = []; + const postcedingNodes = []; + const stack = [{ node: this._root, offset: 0 }]; + while (stack.length > 0) { + const node = stack.pop(); + const currentOffset = node.offset; + if (currentOffset < updateOffsetStart && currentOffset + node.node.length <= updateOffsetStart) { + if (!isLeaf(node.node)) { + node.node.parent = void 0; + } + precedingNodes.push(node.node); + continue; + } else if (isLeaf(node.node) && currentOffset < updateOffsetStart) { + precedingNodes.push({ length: updateOffsetStart - currentOffset, token: node.node.token, height: 0, tokenQuality: node.node.tokenQuality }); + } + if (updateOffsetStart <= currentOffset && currentOffset + node.node.length <= firstUnchangedOffsetAfterUpdate) { + continue; + } + if (currentOffset >= firstUnchangedOffsetAfterUpdate) { + if (!isLeaf(node.node)) { + node.node.parent = void 0; + } + postcedingNodes.push(node.node); + continue; + } else if (isLeaf(node.node) && currentOffset + node.node.length > firstUnchangedOffsetAfterUpdate) { + postcedingNodes.push({ length: currentOffset + node.node.length - firstUnchangedOffsetAfterUpdate, token: node.node.token, height: 0, tokenQuality: node.node.tokenQuality }); + continue; + } + if (!isLeaf(node.node)) { + let childOffset = currentOffset + node.node.length; + for (let i2 = node.node.children.length - 1; i2 >= 0; i2--) { + childOffset -= node.node.children[i2].length; + stack.push({ node: node.node.children[i2], offset: childOffset }); + } + } + } + let allNodes; + if (tokens.length > 0) { + allNodes = precedingNodes.concat(this.createFromUpdates(tokens, tokenQuality), postcedingNodes); + } else { + allNodes = precedingNodes.concat(postcedingNodes); + } + let newRoot = allNodes[0]; + for (let i2 = 1; i2 < allNodes.length; i2++) { + newRoot = concat2(newRoot, allNodes[i2]); + } + this._root = newRoot ?? this.createEmptyRoot(); + } + /** + * + * @param startOffsetInclusive + * @param endOffsetExclusive + * @param visitor Return true from visitor to exit early + * @returns + */ + traverseInOrderInRange(startOffsetInclusive, endOffsetExclusive, visitor) { + const stack = [{ node: this._root, offset: 0 }]; + while (stack.length > 0) { + const { node, offset } = stack.pop(); + const nodeEnd = offset + node.length; + if (nodeEnd <= startOffsetInclusive || offset >= endOffsetExclusive) { + continue; + } + if (visitor(node, offset)) { + return; + } + if (!isLeaf(node)) { + let childOffset = offset + node.length; + for (let i2 = node.children.length - 1; i2 >= 0; i2--) { + childOffset -= node.children[i2].length; + stack.push({ node: node.children[i2], offset: childOffset }); + } + } + } + } + getTokenAt(offset) { + let result; + this.traverseInOrderInRange(offset, this._root.length, (node, offset2) => { + if (isLeaf(node)) { + result = { token: node.token, startOffsetInclusive: offset2, length: node.length }; + return true; + } + return false; + }); + return result; + } + getTokensInRange(startOffsetInclusive, endOffsetExclusive) { + const result = []; + this.traverseInOrderInRange(startOffsetInclusive, endOffsetExclusive, (node, offset) => { + if (isLeaf(node)) { + let clippedLength = node.length; + let clippedOffset = offset; + if (offset < startOffsetInclusive && offset + node.length > endOffsetExclusive) { + clippedOffset = startOffsetInclusive; + clippedLength = endOffsetExclusive - startOffsetInclusive; + } else if (offset < startOffsetInclusive) { + clippedLength -= startOffsetInclusive - offset; + clippedOffset = startOffsetInclusive; + } else if (offset + node.length > endOffsetExclusive) { + clippedLength -= offset + node.length - endOffsetExclusive; + } + result.push({ token: node.token, startOffsetInclusive: clippedOffset, length: clippedLength }); + } + return false; + }); + return result; + } + markForRefresh(startOffsetInclusive, endOffsetExclusive) { + this.traverseInOrderInRange(startOffsetInclusive, endOffsetExclusive, (node) => { + if (isLeaf(node)) { + node.tokenQuality = TokenQuality.None; + } + return false; + }); + } + rangeHasTokens(startOffsetInclusive, endOffsetExclusive, minimumTokenQuality) { + let hasAny = true; + this.traverseInOrderInRange(startOffsetInclusive, endOffsetExclusive, (node) => { + if (isLeaf(node) && node.tokenQuality < minimumTokenQuality) { + hasAny = false; + } + return false; + }); + return hasAny; + } + rangeNeedsRefresh(startOffsetInclusive, endOffsetExclusive) { + let needsRefresh = false; + this.traverseInOrderInRange(startOffsetInclusive, endOffsetExclusive, (node) => { + if (isLeaf(node) && node.tokenQuality !== TokenQuality.Accurate) { + needsRefresh = true; + } + return false; + }); + return needsRefresh; + } + getNeedsRefresh() { + const result = []; + this.traverseInOrderInRange(0, this._textModel.getValueLength(), (node, offset) => { + if (isLeaf(node) && node.tokenQuality !== TokenQuality.Accurate) { + if (result.length > 0 && result[result.length - 1].endOffset === offset) { + result[result.length - 1].endOffset += node.length; + } else { + result.push({ startOffset: offset, endOffset: offset + node.length }); + } + } + return false; + }); + return result; + } + dispose() { + const stack = [[this._root, false]]; + while (stack.length > 0) { + const [node, visited] = stack.pop(); + if (isLeaf(node)) { + } else if (!visited) { + stack.push([node, true]); + for (let i2 = node.children.length - 1; i2 >= 0; i2--) { + stack.push([node.children[i2], false]); + } + } else { + node.dispose(); + node.parent = void 0; + } + } + this._root = void 0; + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/common/services/treeSitter/treeSitterThemeService.js +var ITreeSitterThemeService; +var init_treeSitterThemeService = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/common/services/treeSitter/treeSitterThemeService.js"() { + init_instantiation(); + ITreeSitterThemeService = createDecorator("treeSitterThemeService"); + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/common/model/tokens/treeSitter/treeSitterTokenizationImpl.js +var __decorate22, __param20, TreeSitterTokenizationImpl, TREESITTER_BASE_SCOPES, BRACKETS; +var init_treeSitterTokenizationImpl = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/common/model/tokens/treeSitter/treeSitterTokenizationImpl.js"() { + init_event(); + init_lifecycle(); + init_platform(); + init_stopwatch(); + init_textModelTokens(); + init_tokenStore(); + init_observable(); + init_lineTokens(); + init_position(); + init_range(); + init_types(); + init_treeSitterThemeService(); + init_errors(); + __decorate22 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + __param20 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + TreeSitterTokenizationImpl = class TreeSitterTokenizationImpl2 extends Disposable { + get _textModel() { + return this._tree.textModel; + } + constructor(_tree, _highlightingQueries, _languageIdCodec, _visibleLineRanges, _treeSitterThemeService) { + super(); + this._tree = _tree; + this._highlightingQueries = _highlightingQueries; + this._languageIdCodec = _languageIdCodec; + this._visibleLineRanges = _visibleLineRanges; + this._treeSitterThemeService = _treeSitterThemeService; + this._onDidChangeTokens = this._register(new Emitter()); + this.onDidChangeTokens = this._onDidChangeTokens.event; + this._onDidCompleteBackgroundTokenization = this._register(new Emitter()); + this.onDidChangeBackgroundTokenization = this._onDidCompleteBackgroundTokenization.event; + this._encodedLanguageId = this._languageIdCodec.encodeLanguageId(this._tree.languageId); + this._register(runOnChange(this._treeSitterThemeService.onChange, () => { + this._updateTheme(); + })); + this._tokenStore = this._register(new TokenStore(this._textModel)); + this._accurateVersion = this._textModel.getVersionId(); + this._guessVersion = this._textModel.getVersionId(); + this._tokenStore.buildStore(this._createEmptyTokens(), TokenQuality.None); + this._register(autorun((reader) => { + const visibleLineRanges = this._visibleLineRanges.read(reader); + this._parseAndTokenizeViewPort(visibleLineRanges); + })); + this._register(autorunHandleChanges({ + owner: this, + changeTracker: recordChanges({ tree: this._tree.tree }) + }, (reader, ctx) => { + const changeEvent = ctx.changes.at(0)?.change; + if (ctx.changes.length > 1) { + throw new BugIndicatingError("The tree changed twice in one transaction. This is currently not supported and should not happen."); + } + if (!changeEvent) { + if (ctx.tree) { + this._firstTreeUpdate(this._tree.treeLastParsedVersion.read(reader)); + } + } else { + if (this.hasTokens()) { + for (const range2 of changeEvent.ranges) { + this._markForRefresh(range2.newRange); + } + } + if (!this.hasTokens()) { + this._firstTreeUpdate(changeEvent.versionId); + } else { + this._handleTreeUpdate(changeEvent.ranges, changeEvent.versionId); + } + } + })); + } + handleContentChanged(e) { + this._guessVersion = e.versionId; + for (const change of e.changes) { + if (change.text.length > change.rangeLength) { + const offset = change.rangeOffset > 0 ? change.rangeOffset - 1 : change.rangeOffset; + const oldToken = this._tokenStore.getTokenAt(offset); + let newToken; + if (oldToken) { + newToken = { startOffsetInclusive: oldToken.startOffsetInclusive, length: oldToken.length + change.text.length - change.rangeLength, token: oldToken.token }; + this._tokenStore.markForRefresh(offset, change.rangeOffset + (change.text.length > change.rangeLength ? change.text.length : change.rangeLength)); + } else { + newToken = { startOffsetInclusive: offset, length: change.text.length, token: 0 }; + } + this._tokenStore.update(oldToken?.length ?? 0, [newToken], TokenQuality.EditGuess); + } else if (change.text.length < change.rangeLength) { + const deletedCharCount = change.rangeLength - change.text.length; + this._tokenStore.delete(deletedCharCount, change.rangeOffset); + } + } + } + getLineTokens(lineNumber) { + const content = this._textModel.getLineContent(lineNumber); + const rawTokens = this.getTokens(lineNumber); + return new LineTokens(rawTokens, content, this._languageIdCodec); + } + _createEmptyTokens() { + const emptyToken = this._emptyToken(); + const modelEndOffset = this._textModel.getValueLength(); + const emptyTokens = [this._emptyTokensForOffsetAndLength(0, modelEndOffset, emptyToken)]; + return emptyTokens; + } + _emptyToken() { + return this._treeSitterThemeService.findMetadata([], this._encodedLanguageId, false, void 0); + } + _emptyTokensForOffsetAndLength(offset, length, emptyToken) { + return { token: emptyToken, length: offset + length, startOffsetInclusive: 0 }; + } + hasAccurateTokensForLine(lineNumber) { + return this.hasTokens(new Range(lineNumber, 1, lineNumber, this._textModel.getLineMaxColumn(lineNumber))); + } + tokenizeLinesAt(lineNumber, lines) { + const rawLineTokens = this._guessTokensForLinesContent(lineNumber, lines); + const lineTokens = []; + if (!rawLineTokens) { + return null; + } + for (let i2 = 0; i2 < rawLineTokens.length; i2++) { + lineTokens.push(new LineTokens(rawLineTokens[i2], lines[i2], this._languageIdCodec)); + } + return lineTokens; + } + _rangeHasTokens(range2, minimumTokenQuality) { + return this._tokenStore.rangeHasTokens(this._textModel.getOffsetAt(range2.getStartPosition()), this._textModel.getOffsetAt(range2.getEndPosition()), minimumTokenQuality); + } + hasTokens(accurateForRange) { + if (!accurateForRange || this._guessVersion === this._accurateVersion) { + return true; + } + return !this._tokenStore.rangeNeedsRefresh(this._textModel.getOffsetAt(accurateForRange.getStartPosition()), this._textModel.getOffsetAt(accurateForRange.getEndPosition())); + } + getTokens(line) { + const lineStartOffset = this._textModel.getOffsetAt({ lineNumber: line, column: 1 }); + const lineEndOffset = this._textModel.getOffsetAt({ lineNumber: line, column: this._textModel.getLineLength(line) + 1 }); + const lineTokens = this._tokenStore.getTokensInRange(lineStartOffset, lineEndOffset); + const result = new Uint32Array(lineTokens.length * 2); + for (let i2 = 0; i2 < lineTokens.length; i2++) { + result[i2 * 2] = lineTokens[i2].startOffsetInclusive - lineStartOffset + lineTokens[i2].length; + result[i2 * 2 + 1] = lineTokens[i2].token; + } + return result; + } + getTokensInRange(range2, rangeStartOffset, rangeEndOffset, captures) { + const tokens = captures ? this._tokenizeCapturesWithMetadata(captures, rangeStartOffset, rangeEndOffset) : this._tokenize(range2, rangeStartOffset, rangeEndOffset); + if (tokens?.endOffsetsAndMetadata) { + return this._rangeTokensAsUpdates(rangeStartOffset, tokens.endOffsetsAndMetadata); + } + return void 0; + } + _updateTokensInStore(version, updates, tokenQuality) { + this._accurateVersion = version; + for (const update of updates) { + const lastToken = update.newTokens.length > 0 ? update.newTokens[update.newTokens.length - 1] : void 0; + let oldRangeLength; + if (lastToken && this._guessVersion >= version) { + oldRangeLength = lastToken.startOffsetInclusive + lastToken.length - update.newTokens[0].startOffsetInclusive; + } else if (update.oldRangeLength) { + oldRangeLength = update.oldRangeLength; + } else { + oldRangeLength = 0; + } + this._tokenStore.update(oldRangeLength, update.newTokens, tokenQuality); + } + } + _markForRefresh(range2) { + this._tokenStore.markForRefresh(this._textModel.getOffsetAt(range2.getStartPosition()), this._textModel.getOffsetAt(range2.getEndPosition())); + } + _getNeedsRefresh() { + const needsRefreshOffsetRanges = this._tokenStore.getNeedsRefresh(); + if (!needsRefreshOffsetRanges) { + return []; + } + return needsRefreshOffsetRanges.map((range2) => ({ + range: Range.fromPositions(this._textModel.getPositionAt(range2.startOffset), this._textModel.getPositionAt(range2.endOffset)), + startOffset: range2.startOffset, + endOffset: range2.endOffset + })); + } + _parseAndTokenizeViewPort(lineRanges) { + const viewportRanges = lineRanges.map((r) => r.toInclusiveRange()).filter(isDefined); + for (const range2 of viewportRanges) { + const startOffsetOfRangeInDocument = this._textModel.getOffsetAt(range2.getStartPosition()); + const endOffsetOfRangeInDocument = this._textModel.getOffsetAt(range2.getEndPosition()); + const version = this._textModel.getVersionId(); + if (this._rangeHasTokens(range2, TokenQuality.ViewportGuess)) { + continue; + } + const content = this._textModel.getValueInRange(range2); + const tokenUpdates = this._forceParseAndTokenizeContent(range2, startOffsetOfRangeInDocument, endOffsetOfRangeInDocument, content, true); + if (!tokenUpdates || this._rangeHasTokens(range2, TokenQuality.ViewportGuess)) { + continue; + } + if (tokenUpdates.length === 0) { + continue; + } + const lastToken = tokenUpdates[tokenUpdates.length - 1]; + const oldRangeLength = lastToken.startOffsetInclusive + lastToken.length - tokenUpdates[0].startOffsetInclusive; + this._updateTokensInStore(version, [{ newTokens: tokenUpdates, oldRangeLength }], TokenQuality.ViewportGuess); + this._onDidChangeTokens.fire({ changes: { semanticTokensApplied: false, ranges: [{ fromLineNumber: range2.startLineNumber, toLineNumber: range2.endLineNumber }] } }); + } + } + _guessTokensForLinesContent(lineNumber, lines) { + if (lines.length === 0) { + return void 0; + } + const lineContent = lines.join(this._textModel.getEOL()); + const range2 = new Range(1, 1, lineNumber + lines.length, lines[lines.length - 1].length + 1); + const startOffset = this._textModel.getOffsetAt({ lineNumber, column: 1 }); + const tokens = this._forceParseAndTokenizeContent(range2, startOffset, startOffset + lineContent.length, lineContent, false); + if (!tokens) { + return void 0; + } + const tokensByLine = new Array(lines.length); + let tokensIndex = 0; + let tokenStartOffset = 0; + let lineStartOffset = 0; + for (let i2 = 0; i2 < lines.length; i2++) { + const tokensForLine = []; + let moveToNextLine = false; + for (let j = tokensIndex; !moveToNextLine && j < tokens.length; j++) { + const token = tokens[j]; + const lineAdjustedEndOffset = token.endOffset - lineStartOffset; + const lineAdjustedStartOffset = tokenStartOffset - lineStartOffset; + if (lineAdjustedEndOffset <= lines[i2].length) { + tokensForLine.push({ endOffset: lineAdjustedEndOffset, metadata: token.metadata }); + tokensIndex++; + } else if (lineAdjustedStartOffset < lines[i2].length) { + const partialToken = { endOffset: lines[i2].length, metadata: token.metadata }; + tokensForLine.push(partialToken); + moveToNextLine = true; + } else { + moveToNextLine = true; + } + tokenStartOffset = token.endOffset; + } + tokensByLine[i2] = this._endOffsetTokensToUint32Array(tokensForLine); + lineStartOffset += lines[i2].length + this._textModel.getEOL().length; + } + return tokensByLine; + } + _forceParseAndTokenizeContent(range2, startOffsetOfRangeInDocument, endOffsetOfRangeInDocument, content, asUpdate) { + const likelyRelevantLines = findLikelyRelevantLines(this._textModel, range2.startLineNumber).likelyRelevantLines; + const likelyRelevantPrefix = likelyRelevantLines.join(this._textModel.getEOL()); + const tree = this._tree.createParsedTreeSync(`${likelyRelevantPrefix}${content}`); + if (!tree) { + return; + } + const treeRange = new Range(1, 1, range2.endLineNumber - range2.startLineNumber + 1 + likelyRelevantLines.length, range2.endColumn); + const captures = this.captureAtRange(treeRange); + const tokens = this._tokenizeCapturesWithMetadata(captures, likelyRelevantPrefix.length, endOffsetOfRangeInDocument - startOffsetOfRangeInDocument + likelyRelevantPrefix.length); + tree.delete(); + if (!tokens) { + return; + } + if (asUpdate) { + return this._rangeTokensAsUpdates(startOffsetOfRangeInDocument, tokens.endOffsetsAndMetadata, likelyRelevantPrefix.length); + } else { + return tokens.endOffsetsAndMetadata; + } + } + _firstTreeUpdate(versionId) { + return this._setViewPortTokens(versionId); + } + _setViewPortTokens(versionId) { + const rangeChanges = this._visibleLineRanges.get().map((lineRange) => { + const range2 = lineRange.toInclusiveRange(); + if (!range2) { + return void 0; + } + const newRangeStartOffset = this._textModel.getOffsetAt(range2.getStartPosition()); + const newRangeEndOffset = this._textModel.getOffsetAt(range2.getEndPosition()); + return { + newRange: range2, + newRangeEndOffset, + newRangeStartOffset + }; + }).filter(isDefined); + return this._handleTreeUpdate(rangeChanges, versionId); + } + /** + * Do not await in this method, it will cause a race + */ + _handleTreeUpdate(ranges, versionId) { + const rangeChanges = []; + const chunkSize = 1e3; + for (let i2 = 0; i2 < ranges.length; i2++) { + const rangeLinesLength = ranges[i2].newRange.endLineNumber - ranges[i2].newRange.startLineNumber; + if (rangeLinesLength > chunkSize) { + const fullRangeEndLineNumber = ranges[i2].newRange.endLineNumber; + let chunkLineStart = ranges[i2].newRange.startLineNumber; + let chunkColumnStart = ranges[i2].newRange.startColumn; + let chunkLineEnd = chunkLineStart + chunkSize; + do { + const chunkStartingPosition = new Position(chunkLineStart, chunkColumnStart); + const chunkEndColumn = chunkLineEnd === ranges[i2].newRange.endLineNumber ? ranges[i2].newRange.endColumn : this._textModel.getLineMaxColumn(chunkLineEnd); + const chunkEndPosition = new Position(chunkLineEnd, chunkEndColumn); + const chunkRange = Range.fromPositions(chunkStartingPosition, chunkEndPosition); + rangeChanges.push({ + range: chunkRange, + startOffset: this._textModel.getOffsetAt(chunkRange.getStartPosition()), + endOffset: this._textModel.getOffsetAt(chunkRange.getEndPosition()) + }); + chunkLineStart = chunkLineEnd + 1; + chunkColumnStart = 1; + if (chunkLineEnd < fullRangeEndLineNumber && chunkLineEnd + chunkSize > fullRangeEndLineNumber) { + chunkLineEnd = fullRangeEndLineNumber; + } else { + chunkLineEnd = chunkLineEnd + chunkSize; + } + } while (chunkLineEnd <= fullRangeEndLineNumber); + } else { + if (i2 === 0 || rangeChanges[i2 - 1].endOffset < ranges[i2].newRangeStartOffset) { + rangeChanges.push({ + range: ranges[i2].newRange, + startOffset: ranges[i2].newRangeStartOffset, + endOffset: ranges[i2].newRangeEndOffset + }); + } else if (rangeChanges[i2 - 1].endOffset < ranges[i2].newRangeEndOffset) { + const startPosition = this._textModel.getPositionAt(rangeChanges[i2 - 1].endOffset + 1); + const range2 = new Range(startPosition.lineNumber, startPosition.column, ranges[i2].newRange.endLineNumber, ranges[i2].newRange.endColumn); + rangeChanges.push({ + range: range2, + startOffset: rangeChanges[i2 - 1].endOffset + 1, + endOffset: ranges[i2].newRangeEndOffset + }); + } + } + } + const captures = rangeChanges.map((range2) => this._getCaptures(range2.range)); + return this._updateTreeForRanges(rangeChanges, versionId, captures).then(() => { + if (!this._textModel.isDisposed() && this._tree.treeLastParsedVersion.get() === this._textModel.getVersionId()) { + this._refreshNeedsRefresh(versionId); + } + }); + } + async _updateTreeForRanges(rangeChanges, versionId, captures) { + let tokenUpdate; + for (let i2 = 0; i2 < rangeChanges.length; i2++) { + if (!this._textModel.isDisposed() && versionId !== this._textModel.getVersionId()) { + break; + } + const capture = captures[i2]; + const range2 = rangeChanges[i2]; + const updates = this.getTokensInRange(range2.range, range2.startOffset, range2.endOffset, capture); + if (updates) { + tokenUpdate = { newTokens: updates }; + } else { + tokenUpdate = { newTokens: [] }; + } + this._updateTokensInStore(versionId, [tokenUpdate], TokenQuality.Accurate); + this._onDidChangeTokens.fire({ + changes: { + semanticTokensApplied: false, + ranges: [{ fromLineNumber: range2.range.getStartPosition().lineNumber, toLineNumber: range2.range.getEndPosition().lineNumber }] + } + }); + await new Promise((resolve3) => setTimeout0(resolve3)); + } + this._onDidCompleteBackgroundTokenization.fire(); + } + _refreshNeedsRefresh(versionId) { + const rangesToRefresh = this._getNeedsRefresh(); + if (rangesToRefresh.length === 0) { + return; + } + const rangeChanges = new Array(rangesToRefresh.length); + for (let i2 = 0; i2 < rangesToRefresh.length; i2++) { + const range2 = rangesToRefresh[i2]; + rangeChanges[i2] = { + newRange: range2.range, + newRangeStartOffset: range2.startOffset, + newRangeEndOffset: range2.endOffset + }; + } + this._handleTreeUpdate(rangeChanges, versionId); + } + _rangeTokensAsUpdates(rangeOffset, endOffsetToken, startingOffsetInArray) { + const updates = []; + let lastEnd = 0; + for (const token of endOffsetToken) { + if (token.endOffset <= lastEnd || startingOffsetInArray && token.endOffset < startingOffsetInArray) { + continue; + } + let tokenUpdate; + if (startingOffsetInArray && lastEnd < startingOffsetInArray) { + tokenUpdate = { startOffsetInclusive: rangeOffset + startingOffsetInArray, length: token.endOffset - startingOffsetInArray, token: token.metadata }; + } else { + tokenUpdate = { startOffsetInclusive: rangeOffset + lastEnd, length: token.endOffset - lastEnd, token: token.metadata }; + } + updates.push(tokenUpdate); + lastEnd = token.endOffset; + } + return updates; + } + _updateTheme() { + const modelRange = this._textModel.getFullModelRange(); + this._markForRefresh(modelRange); + this._parseAndTokenizeViewPort(this._visibleLineRanges.get()); + } + captureAtRange(range2) { + const tree = this._tree.tree.get(); + if (!tree) { + return []; + } + return this._highlightingQueries.captures(tree.rootNode, { startPosition: { row: range2.startLineNumber - 1, column: range2.startColumn - 1 }, endPosition: { row: range2.endLineNumber - 1, column: range2.endColumn - 1 } }).map((capture) => ({ + name: capture.name, + text: capture.node.text, + node: { + startIndex: capture.node.startIndex, + endIndex: capture.node.endIndex, + startPosition: { + lineNumber: capture.node.startPosition.row + 1, + column: capture.node.startPosition.column + 1 + }, + endPosition: { + lineNumber: capture.node.endPosition.row + 1, + column: capture.node.endPosition.column + 1 + } + }, + encodedLanguageId: this._encodedLanguageId + })); + } + captureAtRangeWithInjections(range2) { + const captures = this.captureAtRange(range2); + for (let i2 = 0; i2 < captures.length; i2++) { + const capture = captures[i2]; + const capStartLine = capture.node.startPosition.lineNumber; + const capEndLine = capture.node.endPosition.lineNumber; + const capStartColumn = capture.node.startPosition.column; + const capEndColumn = capture.node.endPosition.column; + const startLine = capStartLine > range2.startLineNumber && capStartLine < range2.endLineNumber ? capStartLine : range2.startLineNumber; + const endLine = capEndLine > range2.startLineNumber && capEndLine < range2.endLineNumber ? capEndLine : range2.endLineNumber; + const startColumn = capStartLine === range2.startLineNumber ? capStartColumn < range2.startColumn ? range2.startColumn : capStartColumn : capStartLine < range2.startLineNumber ? range2.startColumn : capStartColumn; + const endColumn = capEndLine === range2.endLineNumber ? capEndColumn > range2.endColumn ? range2.endColumn : capEndColumn : capEndLine > range2.endLineNumber ? range2.endColumn : capEndColumn; + const injectionRange = new Range(startLine, startColumn, endLine, endColumn); + const injection = this._getInjectionCaptures(capture, injectionRange); + if (injection && injection.length > 0) { + captures.splice(i2 + 1, 0, ...injection); + i2 += injection.length; + } + } + return captures; + } + /** + * Gets the tokens for a given line. + * Each token takes 2 elements in the array. The first element is the offset of the end of the token *in the line, not in the document*, and the second element is the metadata. + * + * @param lineNumber + * @returns + */ + tokenizeEncoded(lineNumber) { + const tokens = this._tokenizeEncoded(lineNumber); + if (!tokens) { + return void 0; + } + const updates = this._rangeTokensAsUpdates(this._textModel.getOffsetAt({ lineNumber, column: 1 }), tokens.result); + if (tokens.versionId === this._textModel.getVersionId()) { + this._updateTokensInStore(tokens.versionId, [{ newTokens: updates, oldRangeLength: this._textModel.getLineLength(lineNumber) }], TokenQuality.Accurate); + } + } + _getCaptures(range2) { + const captures = this.captureAtRangeWithInjections(range2); + return captures; + } + _tokenize(range2, rangeStartOffset, rangeEndOffset) { + const captures = this._getCaptures(range2); + const result = this._tokenizeCapturesWithMetadata(captures, rangeStartOffset, rangeEndOffset); + if (!result) { + return void 0; + } + return { ...result, versionId: this._tree.treeLastParsedVersion.get() }; + } + _createTokensFromCaptures(captures, rangeStartOffset, rangeEndOffset) { + const tree = this._tree.tree.get(); + const stopwatch = StopWatch.create(); + const rangeLength = rangeEndOffset - rangeStartOffset; + const encodedLanguageId = this._languageIdCodec.encodeLanguageId(this._tree.languageId); + const baseScope = TREESITTER_BASE_SCOPES[this._tree.languageId] || "source"; + if (captures.length === 0) { + if (tree) { + stopwatch.stop(); + const endOffsetsAndMetadata = [{ endOffset: rangeLength, scopes: [], encodedLanguageId }]; + return { endOffsets: endOffsetsAndMetadata, captureTime: stopwatch.elapsed() }; + } + return void 0; + } + const endOffsetsAndScopes = Array(captures.length); + endOffsetsAndScopes.fill({ endOffset: 0, scopes: [baseScope], encodedLanguageId }); + let tokenIndex = 0; + const increaseSizeOfTokensByOneToken = () => { + endOffsetsAndScopes.push({ endOffset: 0, scopes: [baseScope], encodedLanguageId }); + }; + const brackets = (capture, startOffset) => { + return capture.name.includes("punctuation") && capture.text ? Array.from(capture.text.matchAll(BRACKETS)).map((match2) => startOffset + match2.index) : void 0; + }; + const addCurrentTokenToArray = (capture, startOffset, endOffset, position) => { + if (position !== void 0) { + const oldScopes = endOffsetsAndScopes[position].scopes; + let oldBracket = endOffsetsAndScopes[position].bracket; + const prevEndOffset = position > 0 ? endOffsetsAndScopes[position - 1].endOffset : 0; + if (prevEndOffset !== startOffset) { + let preInsertBracket = void 0; + if (oldBracket && oldBracket.length > 0) { + preInsertBracket = []; + const postInsertBracket = []; + for (let i2 = 0; i2 < oldBracket.length; i2++) { + const bracket = oldBracket[i2]; + if (bracket < startOffset) { + preInsertBracket.push(bracket); + } else if (bracket > endOffset) { + postInsertBracket.push(bracket); + } + } + if (preInsertBracket.length === 0) { + preInsertBracket = void 0; + } + if (postInsertBracket.length === 0) { + oldBracket = void 0; + } else { + oldBracket = postInsertBracket; + } + } + endOffsetsAndScopes.splice(position, 0, { endOffset: startOffset, scopes: [...oldScopes], bracket: preInsertBracket, encodedLanguageId: capture.encodedLanguageId }); + position++; + increaseSizeOfTokensByOneToken(); + tokenIndex++; + } + endOffsetsAndScopes.splice(position, 0, { endOffset, scopes: [...oldScopes, capture.name], bracket: brackets(capture, startOffset), encodedLanguageId: capture.encodedLanguageId }); + endOffsetsAndScopes[tokenIndex].bracket = oldBracket; + } else { + endOffsetsAndScopes[tokenIndex] = { endOffset, scopes: [baseScope, capture.name], bracket: brackets(capture, startOffset), encodedLanguageId: capture.encodedLanguageId }; + } + tokenIndex++; + }; + for (let captureIndex = 0; captureIndex < captures.length; captureIndex++) { + const capture = captures[captureIndex]; + const tokenEndIndex = capture.node.endIndex < rangeEndOffset ? capture.node.endIndex < rangeStartOffset ? rangeStartOffset : capture.node.endIndex : rangeEndOffset; + const tokenStartIndex = capture.node.startIndex < rangeStartOffset ? rangeStartOffset : capture.node.startIndex; + const endOffset = tokenEndIndex - rangeStartOffset; + let previousEndOffset; + const currentTokenLength = tokenEndIndex - tokenStartIndex; + if (captureIndex > 0) { + previousEndOffset = endOffsetsAndScopes[tokenIndex - 1].endOffset; + } else { + previousEndOffset = tokenStartIndex - rangeStartOffset - 1; + } + const startOffset = endOffset - currentTokenLength; + if (previousEndOffset >= 0 && previousEndOffset < startOffset) { + endOffsetsAndScopes[tokenIndex] = { endOffset: startOffset, scopes: [baseScope], encodedLanguageId: this._encodedLanguageId }; + tokenIndex++; + increaseSizeOfTokensByOneToken(); + } + if (currentTokenLength < 0) { + continue; + } + if (previousEndOffset >= endOffset) { + let withinTokenIndex = tokenIndex - 1; + let previousTokenEndOffset = endOffsetsAndScopes[withinTokenIndex].endOffset; + let previousTokenStartOffset = withinTokenIndex >= 2 ? endOffsetsAndScopes[withinTokenIndex - 1].endOffset : 0; + do { + if (previousTokenStartOffset + currentTokenLength === previousTokenEndOffset) { + if (previousTokenStartOffset === startOffset) { + endOffsetsAndScopes[withinTokenIndex].scopes.push(capture.name); + const oldBracket = endOffsetsAndScopes[withinTokenIndex].bracket; + endOffsetsAndScopes[withinTokenIndex].bracket = oldBracket && oldBracket.length > 0 ? oldBracket : brackets(capture, startOffset); + } + } else if (previousTokenStartOffset <= startOffset) { + addCurrentTokenToArray(capture, startOffset, endOffset, withinTokenIndex); + break; + } + withinTokenIndex--; + previousTokenStartOffset = withinTokenIndex >= 1 ? endOffsetsAndScopes[withinTokenIndex - 1].endOffset : 0; + previousTokenEndOffset = withinTokenIndex >= 0 ? endOffsetsAndScopes[withinTokenIndex].endOffset : 0; + } while (previousTokenEndOffset > startOffset); + } else { + addCurrentTokenToArray(capture, startOffset, endOffset); + } + } + if (endOffsetsAndScopes[tokenIndex - 1].endOffset < rangeLength) { + if (rangeLength - endOffsetsAndScopes[tokenIndex - 1].endOffset > 0) { + increaseSizeOfTokensByOneToken(); + endOffsetsAndScopes[tokenIndex] = { endOffset: rangeLength, scopes: endOffsetsAndScopes[tokenIndex].scopes, encodedLanguageId: this._encodedLanguageId }; + tokenIndex++; + } + } + for (let i2 = 0; i2 < endOffsetsAndScopes.length; i2++) { + const token = endOffsetsAndScopes[i2]; + if (token.endOffset === 0 && i2 !== 0) { + endOffsetsAndScopes.splice(i2, endOffsetsAndScopes.length - i2); + break; + } + } + const captureTime = stopwatch.elapsed(); + return { endOffsets: endOffsetsAndScopes, captureTime }; + } + _getInjectionCaptures(parentCapture, range2) { + return []; + } + _tokenizeCapturesWithMetadata(captures, rangeStartOffset, rangeEndOffset) { + const stopwatch = StopWatch.create(); + const emptyTokens = this._createTokensFromCaptures(captures, rangeStartOffset, rangeEndOffset); + if (!emptyTokens) { + return void 0; + } + const endOffsetsAndScopes = emptyTokens.endOffsets; + for (let i2 = 0; i2 < endOffsetsAndScopes.length; i2++) { + const token = endOffsetsAndScopes[i2]; + token.metadata = this._treeSitterThemeService.findMetadata(token.scopes, token.encodedLanguageId, !!token.bracket && token.bracket.length > 0, void 0); + } + const metadataTime = stopwatch.elapsed(); + return { endOffsetsAndMetadata: endOffsetsAndScopes, captureTime: emptyTokens.captureTime, metadataTime }; + } + _tokenizeEncoded(lineNumber) { + const lineOffset = this._textModel.getOffsetAt({ lineNumber, column: 1 }); + const maxLine = this._textModel.getLineCount(); + const lineEndOffset = lineNumber + 1 <= maxLine ? this._textModel.getOffsetAt({ lineNumber: lineNumber + 1, column: 1 }) : this._textModel.getValueLength(); + const lineLength = lineEndOffset - lineOffset; + const result = this._tokenize(new Range(lineNumber, 1, lineNumber, lineLength + 1), lineOffset, lineEndOffset); + if (!result) { + return void 0; + } + return { result: result.endOffsetsAndMetadata, captureTime: result.captureTime, metadataTime: result.metadataTime, versionId: result.versionId }; + } + _endOffsetTokensToUint32Array(endOffsetsAndMetadata) { + const uint32Array = new Uint32Array(endOffsetsAndMetadata.length * 2); + for (let i2 = 0; i2 < endOffsetsAndMetadata.length; i2++) { + uint32Array[i2 * 2] = endOffsetsAndMetadata[i2].endOffset; + uint32Array[i2 * 2 + 1] = endOffsetsAndMetadata[i2].metadata; + } + return uint32Array; + } + }; + TreeSitterTokenizationImpl = __decorate22([ + __param20(4, ITreeSitterThemeService) + ], TreeSitterTokenizationImpl); + TREESITTER_BASE_SCOPES = { + "css": "source.css", + "typescript": "source.ts", + "ini": "source.ini", + "regex": "source.regex" + }; + BRACKETS = /[\{\}\[\]\<\>\(\)]/g; + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/common/services/treeSitter/treeSitterLibraryService.js +var ITreeSitterLibraryService; +var init_treeSitterLibraryService = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/common/services/treeSitter/treeSitterLibraryService.js"() { + init_instantiation(); + ITreeSitterLibraryService = createDecorator("treeSitterLibraryService"); + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/common/model/tokens/treeSitter/treeSitterSyntaxTokenBackend.js +var __decorate23, __param21, TreeSitterSyntaxTokenBackend; +var init_treeSitterSyntaxTokenBackend = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/common/model/tokens/treeSitter/treeSitterSyntaxTokenBackend.js"() { + init_event(); + init_lifecycle(); + init_lineTokens(); + init_abstractSyntaxTokenBackend(); + init_observable(); + init_treeSitterTree(); + init_instantiation(); + init_treeSitterTokenizationImpl(); + init_treeSitterLibraryService(); + __decorate23 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + __param21 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + TreeSitterSyntaxTokenBackend = class TreeSitterSyntaxTokenBackend2 extends AbstractSyntaxTokenBackend { + constructor(_languageIdObs, languageIdCodec, textModel, visibleLineRanges, _treeSitterLibraryService, _instantiationService) { + super(languageIdCodec, textModel); + this._languageIdObs = _languageIdObs; + this._treeSitterLibraryService = _treeSitterLibraryService; + this._instantiationService = _instantiationService; + this._backgroundTokenizationState = 1; + this._onDidChangeBackgroundTokenizationState = this._register(new Emitter()); + this.onDidChangeBackgroundTokenizationState = this._onDidChangeBackgroundTokenizationState.event; + const parserClassPromise = new ObservablePromise(this._treeSitterLibraryService.getParserClass()); + const parserClassObs = derived(this, (reader) => { + const parser2 = parserClassPromise.promiseResult?.read(reader)?.getDataOrThrow(); + return parser2; + }); + this._tree = derived(this, (reader) => { + const parserClass = parserClassObs.read(reader); + if (!parserClass) { + return void 0; + } + const currentLanguage = this._languageIdObs.read(reader); + const treeSitterLang = this._treeSitterLibraryService.getLanguage(currentLanguage, false, reader); + if (!treeSitterLang) { + return void 0; + } + const parser2 = new parserClass(); + reader.store.add(toDisposable(() => { + parser2.delete(); + })); + parser2.setLanguage(treeSitterLang); + const queries = this._treeSitterLibraryService.getInjectionQueries(currentLanguage, reader); + if (queries === void 0) { + return void 0; + } + return reader.store.add(this._instantiationService.createInstance( + TreeSitterTree, + currentLanguage, + void 0, + parser2, + parserClass, + /*queries, */ + this._textModel + )); + }); + this._tokenizationImpl = derived(this, (reader) => { + const treeModel = this._tree.read(reader); + if (!treeModel) { + return void 0; + } + const queries = this._treeSitterLibraryService.getHighlightingQueries(treeModel.languageId, reader); + if (!queries) { + return void 0; + } + return reader.store.add(this._instantiationService.createInstance(TreeSitterTokenizationImpl, treeModel, queries, this._languageIdCodec, visibleLineRanges)); + }); + this._register(autorun((reader) => { + const tokModel = this._tokenizationImpl.read(reader); + if (!tokModel) { + return; + } + reader.store.add(tokModel.onDidChangeTokens((e) => { + this._onDidChangeTokens.fire(e.changes); + })); + reader.store.add(tokModel.onDidChangeBackgroundTokenization((e) => { + this._backgroundTokenizationState = 2; + this._onDidChangeBackgroundTokenizationState.fire(); + })); + })); + } + getLineTokens(lineNumber) { + const model = this._tokenizationImpl.get(); + if (!model) { + const content = this._textModel.getLineContent(lineNumber); + return LineTokens.createEmpty(content, this._languageIdCodec); + } + return model.getLineTokens(lineNumber); + } + todo_resetTokenization(fireTokenChangeEvent = true) { + if (fireTokenChangeEvent) { + this._onDidChangeTokens.fire({ + semanticTokensApplied: false, + ranges: [ + { + fromLineNumber: 1, + toLineNumber: this._textModel.getLineCount() + } + ] + }); + } + } + handleDidChangeAttached() { + } + handleDidChangeContent(e) { + if (e.isFlush) { + this.todo_resetTokenization(false); + } else { + const model = this._tokenizationImpl.get(); + model?.handleContentChanged(e); + } + const treeModel = this._tree.get(); + treeModel?.handleContentChange(e); + } + forceTokenization(lineNumber) { + const model = this._tokenizationImpl.get(); + if (!model) { + return; + } + if (!model.hasAccurateTokensForLine(lineNumber)) { + model.tokenizeEncoded(lineNumber); + } + } + hasAccurateTokensForLine(lineNumber) { + const model = this._tokenizationImpl.get(); + if (!model) { + return false; + } + return model.hasAccurateTokensForLine(lineNumber); + } + isCheapToTokenize(lineNumber) { + return true; + } + getTokenTypeIfInsertingCharacter(lineNumber, column, character) { + return 0; + } + tokenizeLinesAt(lineNumber, lines) { + const model = this._tokenizationImpl.get(); + if (!model) { + return null; + } + return model.tokenizeLinesAt(lineNumber, lines); + } + get hasTokens() { + const model = this._tokenizationImpl.get(); + if (!model) { + return false; + } + return model.hasTokens(); + } + }; + TreeSitterSyntaxTokenBackend = __decorate23([ + __param21(4, ITreeSitterLibraryService), + __param21(5, IInstantiationService) + ], TreeSitterSyntaxTokenBackend); + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/common/tokens/sparseTokensStore.js +var SparseTokensStore; +var init_sparseTokensStore = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/common/tokens/sparseTokensStore.js"() { + init_arrays(); + init_lineTokens(); + SparseTokensStore = class _SparseTokensStore { + constructor(languageIdCodec) { + this._pieces = []; + this._isComplete = false; + this._languageIdCodec = languageIdCodec; + } + flush() { + this._pieces = []; + this._isComplete = false; + } + isEmpty() { + return this._pieces.length === 0; + } + set(pieces, isComplete, textModel = void 0) { + this._pieces = pieces || []; + this._isComplete = isComplete; + if (textModel) { + for (const p of this._pieces) { + p.reportIfInvalid(textModel); + } + } + } + setPartial(_range, pieces) { + let range2 = _range; + if (pieces.length > 0) { + const _firstRange = pieces[0].getRange(); + const _lastRange = pieces[pieces.length - 1].getRange(); + if (!_firstRange || !_lastRange) { + return _range; + } + range2 = _range.plusRange(_firstRange).plusRange(_lastRange); + } + let insertPosition = null; + for (let i2 = 0, len = this._pieces.length; i2 < len; i2++) { + const piece = this._pieces[i2]; + if (piece.endLineNumber < range2.startLineNumber) { + continue; + } + if (piece.startLineNumber > range2.endLineNumber) { + insertPosition = insertPosition || { index: i2 }; + break; + } + piece.removeTokens(range2); + if (piece.isEmpty()) { + this._pieces.splice(i2, 1); + i2--; + len--; + continue; + } + if (piece.endLineNumber < range2.startLineNumber) { + continue; + } + if (piece.startLineNumber > range2.endLineNumber) { + insertPosition = insertPosition || { index: i2 }; + continue; + } + const [a, b] = piece.split(range2); + if (a.isEmpty()) { + insertPosition = insertPosition || { index: i2 }; + continue; + } + if (b.isEmpty()) { + continue; + } + this._pieces.splice(i2, 1, a, b); + i2++; + len++; + insertPosition = insertPosition || { index: i2 }; + } + insertPosition = insertPosition || { index: this._pieces.length }; + if (pieces.length > 0) { + this._pieces = arrayInsert(this._pieces, insertPosition.index, pieces); + } + return range2; + } + isComplete() { + return this._isComplete; + } + addSparseTokens(lineNumber, aTokens) { + if (aTokens.getTextLength() === 0) { + return aTokens; + } + const pieces = this._pieces; + if (pieces.length === 0) { + return aTokens; + } + const pieceIndex = _SparseTokensStore._findFirstPieceWithLine(pieces, lineNumber); + const bTokens = pieces[pieceIndex].getLineTokens(lineNumber); + if (!bTokens) { + return aTokens; + } + const aLen = aTokens.getCount(); + const bLen = bTokens.getCount(); + let aIndex = 0; + const result = []; + let resultLen = 0; + let lastEndOffset = 0; + const emitToken = (endOffset, metadata) => { + if (endOffset === lastEndOffset) { + return; + } + lastEndOffset = endOffset; + result[resultLen++] = endOffset; + result[resultLen++] = metadata; + }; + for (let bIndex = 0; bIndex < bLen; bIndex++) { + const bStartCharacter = Math.min(bTokens.getStartCharacter(bIndex), aTokens.getTextLength()); + const bEndCharacter = Math.min(bTokens.getEndCharacter(bIndex), aTokens.getTextLength()); + const bMetadata = bTokens.getMetadata(bIndex); + const bMask = ((bMetadata & 1 ? 2048 : 0) | (bMetadata & 2 ? 4096 : 0) | (bMetadata & 4 ? 8192 : 0) | (bMetadata & 8 ? 16384 : 0) | (bMetadata & 16 ? 16744448 : 0) | (bMetadata & 32 ? 4278190080 : 0)) >>> 0; + const aMask = ~bMask >>> 0; + while (aIndex < aLen && aTokens.getEndOffset(aIndex) <= bStartCharacter) { + emitToken(aTokens.getEndOffset(aIndex), aTokens.getMetadata(aIndex)); + aIndex++; + } + if (aIndex < aLen && aTokens.getStartOffset(aIndex) < bStartCharacter) { + emitToken(bStartCharacter, aTokens.getMetadata(aIndex)); + } + while (aIndex < aLen && aTokens.getEndOffset(aIndex) < bEndCharacter) { + emitToken(aTokens.getEndOffset(aIndex), aTokens.getMetadata(aIndex) & aMask | bMetadata & bMask); + aIndex++; + } + if (aIndex < aLen) { + emitToken(bEndCharacter, aTokens.getMetadata(aIndex) & aMask | bMetadata & bMask); + if (aTokens.getEndOffset(aIndex) === bEndCharacter) { + aIndex++; + } + } else { + const aMergeIndex = Math.min(Math.max(0, aIndex - 1), aLen - 1); + emitToken(bEndCharacter, aTokens.getMetadata(aMergeIndex) & aMask | bMetadata & bMask); + } + } + while (aIndex < aLen) { + emitToken(aTokens.getEndOffset(aIndex), aTokens.getMetadata(aIndex)); + aIndex++; + } + return new LineTokens(new Uint32Array(result), aTokens.getLineContent(), this._languageIdCodec); + } + static _findFirstPieceWithLine(pieces, lineNumber) { + let low = 0; + let high = pieces.length - 1; + while (low < high) { + let mid = low + Math.floor((high - low) / 2); + if (pieces[mid].endLineNumber < lineNumber) { + low = mid + 1; + } else if (pieces[mid].startLineNumber > lineNumber) { + high = mid - 1; + } else { + while (mid > low && pieces[mid - 1].startLineNumber <= lineNumber && lineNumber <= pieces[mid - 1].endLineNumber) { + mid--; + } + return mid; + } + } + return low; + } + acceptEdit(range2, eolCount, firstLineLength, lastLineLength, firstCharCode) { + for (let i2 = 0; i2 < this._pieces.length; i2++) { + const piece = this._pieces[i2]; + piece.acceptEdit(range2, eolCount, firstLineLength, lastLineLength, firstCharCode); + if (piece.isEmpty()) { + this._pieces.splice(i2, 1); + i2--; + } + } + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/common/tokens/contiguousTokensEditing.js +function toUint32Array(arr) { + if (arr instanceof Uint32Array) { + return arr; + } else { + return new Uint32Array(arr); + } +} +var EMPTY_LINE_TOKENS, ContiguousTokensEditing; +var init_contiguousTokensEditing = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/common/tokens/contiguousTokensEditing.js"() { + init_lineTokens(); + EMPTY_LINE_TOKENS = new Uint32Array(0).buffer; + ContiguousTokensEditing = class _ContiguousTokensEditing { + static deleteBeginning(lineTokens, toChIndex) { + if (lineTokens === null || lineTokens === EMPTY_LINE_TOKENS) { + return lineTokens; + } + return _ContiguousTokensEditing.delete(lineTokens, 0, toChIndex); + } + static deleteEnding(lineTokens, fromChIndex) { + if (lineTokens === null || lineTokens === EMPTY_LINE_TOKENS) { + return lineTokens; + } + const tokens = toUint32Array(lineTokens); + const lineTextLength = tokens[tokens.length - 2]; + return _ContiguousTokensEditing.delete(lineTokens, fromChIndex, lineTextLength); + } + static delete(lineTokens, fromChIndex, toChIndex) { + if (lineTokens === null || lineTokens === EMPTY_LINE_TOKENS || fromChIndex === toChIndex) { + return lineTokens; + } + const tokens = toUint32Array(lineTokens); + const tokensCount = tokens.length >>> 1; + if (fromChIndex === 0 && tokens[tokens.length - 2] === toChIndex) { + return EMPTY_LINE_TOKENS; + } + const fromTokenIndex = LineTokens.findIndexInTokensArray(tokens, fromChIndex); + const fromTokenStartOffset = fromTokenIndex > 0 ? tokens[fromTokenIndex - 1 << 1] : 0; + const fromTokenEndOffset = tokens[fromTokenIndex << 1]; + if (toChIndex < fromTokenEndOffset) { + const delta2 = toChIndex - fromChIndex; + for (let i2 = fromTokenIndex; i2 < tokensCount; i2++) { + tokens[i2 << 1] -= delta2; + } + return lineTokens; + } + let dest; + let lastEnd; + if (fromTokenStartOffset !== fromChIndex) { + tokens[fromTokenIndex << 1] = fromChIndex; + dest = fromTokenIndex + 1 << 1; + lastEnd = fromChIndex; + } else { + dest = fromTokenIndex << 1; + lastEnd = fromTokenStartOffset; + } + const delta = toChIndex - fromChIndex; + for (let tokenIndex = fromTokenIndex + 1; tokenIndex < tokensCount; tokenIndex++) { + const tokenEndOffset = tokens[tokenIndex << 1] - delta; + if (tokenEndOffset > lastEnd) { + tokens[dest++] = tokenEndOffset; + tokens[dest++] = tokens[(tokenIndex << 1) + 1]; + lastEnd = tokenEndOffset; + } + } + if (dest === tokens.length) { + return lineTokens; + } + const tmp = new Uint32Array(dest); + tmp.set(tokens.subarray(0, dest), 0); + return tmp.buffer; + } + static append(lineTokens, _otherTokens) { + if (_otherTokens === EMPTY_LINE_TOKENS) { + return lineTokens; + } + if (lineTokens === EMPTY_LINE_TOKENS) { + return _otherTokens; + } + if (lineTokens === null) { + return lineTokens; + } + if (_otherTokens === null) { + return null; + } + const myTokens = toUint32Array(lineTokens); + const otherTokens = toUint32Array(_otherTokens); + const otherTokensCount = otherTokens.length >>> 1; + const result = new Uint32Array(myTokens.length + otherTokens.length); + result.set(myTokens, 0); + let dest = myTokens.length; + const delta = myTokens[myTokens.length - 2]; + for (let i2 = 0; i2 < otherTokensCount; i2++) { + result[dest++] = otherTokens[i2 << 1] + delta; + result[dest++] = otherTokens[(i2 << 1) + 1]; + } + return result.buffer; + } + static insert(lineTokens, chIndex, textLength) { + if (lineTokens === null || lineTokens === EMPTY_LINE_TOKENS) { + return lineTokens; + } + const tokens = toUint32Array(lineTokens); + const tokensCount = tokens.length >>> 1; + let fromTokenIndex = LineTokens.findIndexInTokensArray(tokens, chIndex); + if (fromTokenIndex > 0) { + const fromTokenStartOffset = tokens[fromTokenIndex - 1 << 1]; + if (fromTokenStartOffset === chIndex) { + fromTokenIndex--; + } + } + for (let tokenIndex = fromTokenIndex; tokenIndex < tokensCount; tokenIndex++) { + tokens[tokenIndex << 1] += textLength; + } + return lineTokens; + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/common/tokens/contiguousTokensStore.js +function getDefaultMetadata(topLevelLanguageId) { + return (topLevelLanguageId << 0 | 0 << 8 | 0 << 11 | 1 << 15 | 2 << 24 | 1024) >>> 0; +} +var ContiguousTokensStore; +var init_contiguousTokensStore = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/common/tokens/contiguousTokensStore.js"() { + init_arrays(); + init_position(); + init_contiguousTokensEditing(); + init_lineTokens(); + init_encodedTokenAttributes(); + ContiguousTokensStore = class _ContiguousTokensStore { + constructor(languageIdCodec) { + this._lineTokens = []; + this._len = 0; + this._languageIdCodec = languageIdCodec; + } + flush() { + this._lineTokens = []; + this._len = 0; + } + get hasTokens() { + return this._lineTokens.length > 0; + } + getTokens(topLevelLanguageId, lineIndex, lineText) { + let rawLineTokens = null; + if (lineIndex < this._len) { + rawLineTokens = this._lineTokens[lineIndex]; + } + if (rawLineTokens !== null && rawLineTokens !== EMPTY_LINE_TOKENS) { + return new LineTokens(toUint32Array(rawLineTokens), lineText, this._languageIdCodec); + } + const lineTokens = new Uint32Array(2); + lineTokens[0] = lineText.length; + lineTokens[1] = getDefaultMetadata(this._languageIdCodec.encodeLanguageId(topLevelLanguageId)); + return new LineTokens(lineTokens, lineText, this._languageIdCodec); + } + static _massageTokens(topLevelLanguageId, lineTextLength, _tokens) { + const tokens = _tokens ? toUint32Array(_tokens) : null; + if (lineTextLength === 0) { + let hasDifferentLanguageId = false; + if (tokens && tokens.length > 1) { + hasDifferentLanguageId = TokenMetadata.getLanguageId(tokens[1]) !== topLevelLanguageId; + } + if (!hasDifferentLanguageId) { + return EMPTY_LINE_TOKENS; + } + } + if (!tokens || tokens.length === 0) { + const tokens2 = new Uint32Array(2); + tokens2[0] = lineTextLength; + tokens2[1] = getDefaultMetadata(topLevelLanguageId); + return tokens2.buffer; + } + tokens[tokens.length - 2] = lineTextLength; + if (tokens.byteOffset === 0 && tokens.byteLength === tokens.buffer.byteLength) { + return tokens.buffer; + } + return tokens; + } + _ensureLine(lineIndex) { + while (lineIndex >= this._len) { + this._lineTokens[this._len] = null; + this._len++; + } + } + _deleteLines(start, deleteCount) { + if (deleteCount === 0) { + return; + } + if (start + deleteCount > this._len) { + deleteCount = this._len - start; + } + this._lineTokens.splice(start, deleteCount); + this._len -= deleteCount; + } + _insertLines(insertIndex, insertCount) { + if (insertCount === 0) { + return; + } + const lineTokens = []; + for (let i2 = 0; i2 < insertCount; i2++) { + lineTokens[i2] = null; + } + this._lineTokens = arrayInsert(this._lineTokens, insertIndex, lineTokens); + this._len += insertCount; + } + setTokens(topLevelLanguageId, lineIndex, lineTextLength, _tokens, checkEquality) { + const tokens = _ContiguousTokensStore._massageTokens(this._languageIdCodec.encodeLanguageId(topLevelLanguageId), lineTextLength, _tokens); + this._ensureLine(lineIndex); + const oldTokens = this._lineTokens[lineIndex]; + this._lineTokens[lineIndex] = tokens; + if (checkEquality) { + return !_ContiguousTokensStore._equals(oldTokens, tokens); + } + return false; + } + static _equals(_a3, _b2) { + if (!_a3 || !_b2) { + return !_a3 && !_b2; + } + const a = toUint32Array(_a3); + const b = toUint32Array(_b2); + if (a.length !== b.length) { + return false; + } + for (let i2 = 0, len = a.length; i2 < len; i2++) { + if (a[i2] !== b[i2]) { + return false; + } + } + return true; + } + //#region Editing + acceptEdit(range2, eolCount, firstLineLength) { + this._acceptDeleteRange(range2); + this._acceptInsertText(new Position(range2.startLineNumber, range2.startColumn), eolCount, firstLineLength); + } + _acceptDeleteRange(range2) { + const firstLineIndex = range2.startLineNumber - 1; + if (firstLineIndex >= this._len) { + return; + } + if (range2.startLineNumber === range2.endLineNumber) { + if (range2.startColumn === range2.endColumn) { + return; + } + this._lineTokens[firstLineIndex] = ContiguousTokensEditing.delete(this._lineTokens[firstLineIndex], range2.startColumn - 1, range2.endColumn - 1); + return; + } + this._lineTokens[firstLineIndex] = ContiguousTokensEditing.deleteEnding(this._lineTokens[firstLineIndex], range2.startColumn - 1); + const lastLineIndex = range2.endLineNumber - 1; + let lastLineTokens = null; + if (lastLineIndex < this._len) { + lastLineTokens = ContiguousTokensEditing.deleteBeginning(this._lineTokens[lastLineIndex], range2.endColumn - 1); + } + this._lineTokens[firstLineIndex] = ContiguousTokensEditing.append(this._lineTokens[firstLineIndex], lastLineTokens); + this._deleteLines(range2.startLineNumber, range2.endLineNumber - range2.startLineNumber); + } + _acceptInsertText(position, eolCount, firstLineLength) { + if (eolCount === 0 && firstLineLength === 0) { + return; + } + const lineIndex = position.lineNumber - 1; + if (lineIndex >= this._len) { + return; + } + if (eolCount === 0) { + this._lineTokens[lineIndex] = ContiguousTokensEditing.insert(this._lineTokens[lineIndex], position.column - 1, firstLineLength); + return; + } + this._lineTokens[lineIndex] = ContiguousTokensEditing.deleteEnding(this._lineTokens[lineIndex], position.column - 1); + this._lineTokens[lineIndex] = ContiguousTokensEditing.insert(this._lineTokens[lineIndex], position.column - 1, firstLineLength); + this._insertLines(position.lineNumber, eolCount); + } + //#endregion + setMultilineTokens(tokens, textModel) { + if (tokens.length === 0) { + return { changes: [] }; + } + const ranges = []; + for (let i2 = 0, len = tokens.length; i2 < len; i2++) { + const element = tokens[i2]; + let minChangedLineNumber = 0; + let maxChangedLineNumber = 0; + let hasChange = false; + for (let lineNumber = element.startLineNumber; lineNumber <= element.endLineNumber; lineNumber++) { + if (hasChange) { + this.setTokens(textModel.getLanguageId(), lineNumber - 1, textModel.getLineLength(lineNumber), element.getLineTokens(lineNumber), false); + maxChangedLineNumber = lineNumber; + } else { + const lineHasChange = this.setTokens(textModel.getLanguageId(), lineNumber - 1, textModel.getLineLength(lineNumber), element.getLineTokens(lineNumber), true); + if (lineHasChange) { + hasChange = true; + minChangedLineNumber = lineNumber; + maxChangedLineNumber = lineNumber; + } + } + } + if (hasChange) { + ranges.push({ fromLineNumber: minChangedLineNumber, toLineNumber: maxChangedLineNumber }); + } + } + return { changes: ranges }; + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/common/model/tokens/tokenizerSyntaxTokenBackend.js +var TokenizerSyntaxTokenBackend; +var init_tokenizerSyntaxTokenBackend = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/common/model/tokens/tokenizerSyntaxTokenBackend.js"() { + init_errors(); + init_event(); + init_lifecycle(); + init_eolCounter(); + init_position(); + init_lineRange(); + init_languages(); + init_contiguousMultilineTokensBuilder(); + init_contiguousTokensStore(); + init_textModelTokens(); + init_abstractSyntaxTokenBackend(); + TokenizerSyntaxTokenBackend = class extends AbstractSyntaxTokenBackend { + constructor(languageIdCodec, textModel, getLanguageId, attachedViews) { + super(languageIdCodec, textModel); + this.getLanguageId = getLanguageId; + this._tokenizer = null; + this._backgroundTokenizationState = 1; + this._onDidChangeBackgroundTokenizationState = this._register(new Emitter()); + this.onDidChangeBackgroundTokenizationState = this._onDidChangeBackgroundTokenizationState.event; + this._defaultBackgroundTokenizer = null; + this._backgroundTokenizer = this._register(new MutableDisposable()); + this._tokens = new ContiguousTokensStore(this._languageIdCodec); + this._debugBackgroundTokenizer = this._register(new MutableDisposable()); + this._attachedViewStates = this._register(new DisposableMap()); + this._register(TokenizationRegistry2.onDidChange((e) => { + const languageId = this.getLanguageId(); + if (e.changedLanguages.indexOf(languageId) === -1) { + return; + } + this.todo_resetTokenization(); + })); + this.todo_resetTokenization(); + this._register(attachedViews.onDidChangeVisibleRanges(({ view, state }) => { + if (state) { + let existing = this._attachedViewStates.get(view); + if (!existing) { + existing = new AttachedViewHandler(() => this.refreshRanges(existing.lineRanges)); + this._attachedViewStates.set(view, existing); + } + existing.handleStateChange(state); + } else { + this._attachedViewStates.deleteAndDispose(view); + } + })); + } + todo_resetTokenization(fireTokenChangeEvent = true) { + this._tokens.flush(); + this._debugBackgroundTokens?.flush(); + if (this._debugBackgroundStates) { + this._debugBackgroundStates = new TrackingTokenizationStateStore(this._textModel.getLineCount()); + } + if (fireTokenChangeEvent) { + this._onDidChangeTokens.fire({ + semanticTokensApplied: false, + ranges: [ + { + fromLineNumber: 1, + toLineNumber: this._textModel.getLineCount() + } + ] + }); + } + const initializeTokenization = () => { + if (this._textModel.isTooLargeForTokenization()) { + return [null, null]; + } + const tokenizationSupport2 = TokenizationRegistry2.get(this.getLanguageId()); + if (!tokenizationSupport2) { + return [null, null]; + } + let initialState2; + try { + initialState2 = tokenizationSupport2.getInitialState(); + } catch (e) { + onUnexpectedError(e); + return [null, null]; + } + return [tokenizationSupport2, initialState2]; + }; + const [tokenizationSupport, initialState] = initializeTokenization(); + if (tokenizationSupport && initialState) { + this._tokenizer = new TokenizerWithStateStoreAndTextModel(this._textModel.getLineCount(), tokenizationSupport, this._textModel, this._languageIdCodec); + } else { + this._tokenizer = null; + } + this._backgroundTokenizer.clear(); + this._defaultBackgroundTokenizer = null; + if (this._tokenizer) { + const b = { + setTokens: (tokens) => { + this.setTokens(tokens); + }, + backgroundTokenizationFinished: () => { + if (this._backgroundTokenizationState === 2) { + return; + } + const newState = 2; + this._backgroundTokenizationState = newState; + this._onDidChangeBackgroundTokenizationState.fire(); + }, + setEndState: (lineNumber, state) => { + if (!this._tokenizer) { + return; + } + const firstInvalidEndStateLineNumber = this._tokenizer.store.getFirstInvalidEndStateLineNumber(); + if (firstInvalidEndStateLineNumber !== null && lineNumber >= firstInvalidEndStateLineNumber) { + this._tokenizer?.store.setEndState(lineNumber, state); + } + } + }; + if (tokenizationSupport && tokenizationSupport.createBackgroundTokenizer && !tokenizationSupport.backgroundTokenizerShouldOnlyVerifyTokens) { + this._backgroundTokenizer.value = tokenizationSupport.createBackgroundTokenizer(this._textModel, b); + } + if (!this._backgroundTokenizer.value && !this._textModel.isTooLargeForTokenization()) { + this._backgroundTokenizer.value = this._defaultBackgroundTokenizer = new DefaultBackgroundTokenizer(this._tokenizer, b); + this._defaultBackgroundTokenizer.handleChanges(); + } + if (tokenizationSupport?.backgroundTokenizerShouldOnlyVerifyTokens && tokenizationSupport.createBackgroundTokenizer) { + this._debugBackgroundTokens = new ContiguousTokensStore(this._languageIdCodec); + this._debugBackgroundStates = new TrackingTokenizationStateStore(this._textModel.getLineCount()); + this._debugBackgroundTokenizer.clear(); + this._debugBackgroundTokenizer.value = tokenizationSupport.createBackgroundTokenizer(this._textModel, { + setTokens: (tokens) => { + this._debugBackgroundTokens?.setMultilineTokens(tokens, this._textModel); + }, + backgroundTokenizationFinished() { + }, + setEndState: (lineNumber, state) => { + this._debugBackgroundStates?.setEndState(lineNumber, state); + } + }); + } else { + this._debugBackgroundTokens = void 0; + this._debugBackgroundStates = void 0; + this._debugBackgroundTokenizer.value = void 0; + } + } + this.refreshAllVisibleLineTokens(); + } + handleDidChangeAttached() { + this._defaultBackgroundTokenizer?.handleChanges(); + } + handleDidChangeContent(e) { + if (e.isFlush) { + this.todo_resetTokenization(false); + } else if (!e.isEolChange) { + for (const c of e.changes) { + const [eolCount, firstLineLength] = countEOL(c.text); + this._tokens.acceptEdit(c.range, eolCount, firstLineLength); + this._debugBackgroundTokens?.acceptEdit(c.range, eolCount, firstLineLength); + } + this._debugBackgroundStates?.acceptChanges(e.changes); + if (this._tokenizer) { + this._tokenizer.store.acceptChanges(e.changes); + } + this._defaultBackgroundTokenizer?.handleChanges(); + } + } + setTokens(tokens) { + const { changes } = this._tokens.setMultilineTokens(tokens, this._textModel); + if (changes.length > 0) { + this._onDidChangeTokens.fire({ semanticTokensApplied: false, ranges: changes }); + } + return { changes }; + } + refreshAllVisibleLineTokens() { + const ranges = LineRange.joinMany([...this._attachedViewStates].map(([_, s]) => s.lineRanges)); + this.refreshRanges(ranges); + } + refreshRanges(ranges) { + for (const range2 of ranges) { + this.refreshRange(range2.startLineNumber, range2.endLineNumberExclusive - 1); + } + } + refreshRange(startLineNumber, endLineNumber) { + if (!this._tokenizer) { + return; + } + startLineNumber = Math.max(1, Math.min(this._textModel.getLineCount(), startLineNumber)); + endLineNumber = Math.min(this._textModel.getLineCount(), endLineNumber); + const builder = new ContiguousMultilineTokensBuilder(); + const { heuristicTokens } = this._tokenizer.tokenizeHeuristically(builder, startLineNumber, endLineNumber); + const changedTokens = this.setTokens(builder.finalize()); + if (heuristicTokens) { + for (const c of changedTokens.changes) { + this._backgroundTokenizer.value?.requestTokens(c.fromLineNumber, c.toLineNumber + 1); + } + } + this._defaultBackgroundTokenizer?.checkFinished(); + } + forceTokenization(lineNumber) { + const builder = new ContiguousMultilineTokensBuilder(); + this._tokenizer?.updateTokensUntilLine(builder, lineNumber); + this.setTokens(builder.finalize()); + this._defaultBackgroundTokenizer?.checkFinished(); + } + hasAccurateTokensForLine(lineNumber) { + if (!this._tokenizer) { + return true; + } + return this._tokenizer.hasAccurateTokensForLine(lineNumber); + } + isCheapToTokenize(lineNumber) { + if (!this._tokenizer) { + return true; + } + return this._tokenizer.isCheapToTokenize(lineNumber); + } + getLineTokens(lineNumber) { + const lineText = this._textModel.getLineContent(lineNumber); + const result = this._tokens.getTokens(this._textModel.getLanguageId(), lineNumber - 1, lineText); + if (this._debugBackgroundTokens && this._debugBackgroundStates && this._tokenizer) { + if (this._debugBackgroundStates.getFirstInvalidEndStateLineNumberOrMax() > lineNumber && this._tokenizer.store.getFirstInvalidEndStateLineNumberOrMax() > lineNumber) { + const backgroundResult = this._debugBackgroundTokens.getTokens(this._textModel.getLanguageId(), lineNumber - 1, lineText); + if (!result.equals(backgroundResult) && this._debugBackgroundTokenizer.value?.reportMismatchingTokens) { + this._debugBackgroundTokenizer.value.reportMismatchingTokens(lineNumber); + } + } + } + return result; + } + getTokenTypeIfInsertingCharacter(lineNumber, column, character) { + if (!this._tokenizer) { + return 0; + } + const position = this._textModel.validatePosition(new Position(lineNumber, column)); + this.forceTokenization(position.lineNumber); + return this._tokenizer.getTokenTypeIfInsertingCharacter(position, character); + } + tokenizeLinesAt(lineNumber, lines) { + if (!this._tokenizer) { + return null; + } + this.forceTokenization(lineNumber); + return this._tokenizer.tokenizeLinesAt(lineNumber, lines); + } + get hasTokens() { + return this._tokens.hasTokens; + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/common/model/tokens/tokenizationTextModelPart.js +var __decorate24, __param22, TokenizationTextModelPart_1, TokenizationTextModelPart; +var init_tokenizationTextModelPart = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/common/model/tokens/tokenizationTextModelPart.js"() { + init_errors(); + init_event(); + init_eolCounter(); + init_position(); + init_wordHelper(); + init_language(); + init_languageConfigurationRegistry(); + init_textModelPart(); + init_treeSitterSyntaxTokenBackend(); + init_sparseTokensStore(); + init_instantiation(); + init_tokenizerSyntaxTokenBackend(); + init_treeSitterLibraryService(); + init_observable(); + __decorate24 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + __param22 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + TokenizationTextModelPart = TokenizationTextModelPart_1 = class TokenizationTextModelPart2 extends TextModelPart { + constructor(_textModel, _bracketPairsTextModelPart, _languageId, _attachedViews, _languageService, _languageConfigurationService, _instantiationService, _treeSitterLibraryService) { + super(); + this._textModel = _textModel; + this._bracketPairsTextModelPart = _bracketPairsTextModelPart; + this._languageId = _languageId; + this._attachedViews = _attachedViews; + this._languageService = _languageService; + this._languageConfigurationService = _languageConfigurationService; + this._instantiationService = _instantiationService; + this._treeSitterLibraryService = _treeSitterLibraryService; + this._languageIdObs = observableValue(this, this._languageId); + this._useTreeSitter = derived(this, (reader) => { + const languageId = this._languageIdObs.read(reader); + return this._treeSitterLibraryService.supportsLanguage(languageId, reader); + }); + this.tokens = derived(this, (reader) => { + let tokens; + if (this._useTreeSitter.read(reader)) { + tokens = reader.store.add(this._instantiationService.createInstance(TreeSitterSyntaxTokenBackend, this._languageIdObs, this._languageService.languageIdCodec, this._textModel, this._attachedViews.visibleLineRanges)); + } else { + tokens = reader.store.add(new TokenizerSyntaxTokenBackend(this._languageService.languageIdCodec, this._textModel, () => this._languageId, this._attachedViews)); + } + reader.store.add(tokens.onDidChangeTokens((e) => { + this._emitModelTokensChangedEvent(e); + })); + reader.store.add(tokens.onDidChangeBackgroundTokenizationState((e) => { + this._bracketPairsTextModelPart.handleDidChangeBackgroundTokenizationState(); + })); + return tokens; + }); + let hadTokens = false; + this.tokens.recomputeInitiallyAndOnChange(this._store, (value) => { + if (hadTokens) { + value.todo_resetTokenization(); + } + hadTokens = true; + }); + this._semanticTokens = new SparseTokensStore(this._languageService.languageIdCodec); + this._onDidChangeLanguage = this._register(new Emitter()); + this.onDidChangeLanguage = this._onDidChangeLanguage.event; + this._onDidChangeLanguageConfiguration = this._register(new Emitter()); + this.onDidChangeLanguageConfiguration = this._onDidChangeLanguageConfiguration.event; + this._onDidChangeTokens = this._register(new Emitter()); + this.onDidChangeTokens = this._onDidChangeTokens.event; + } + handleLanguageConfigurationServiceChange(e) { + if (e.affects(this._languageId)) { + this._onDidChangeLanguageConfiguration.fire({}); + } + } + handleDidChangeContent(e) { + if (e.isFlush) { + this._semanticTokens.flush(); + } else if (!e.isEolChange) { + for (const c of e.changes) { + const [eolCount, firstLineLength, lastLineLength] = countEOL(c.text); + this._semanticTokens.acceptEdit( + c.range, + eolCount, + firstLineLength, + lastLineLength, + c.text.length > 0 ? c.text.charCodeAt(0) : 0 + /* CharCode.Null */ + ); + } + } + this.tokens.get().handleDidChangeContent(e); + } + handleDidChangeAttached() { + this.tokens.get().handleDidChangeAttached(); + } + /** + * Includes grammar and semantic tokens. + */ + getLineTokens(lineNumber) { + this.validateLineNumber(lineNumber); + const syntacticTokens = this.tokens.get().getLineTokens(lineNumber); + return this._semanticTokens.addSparseTokens(lineNumber, syntacticTokens); + } + _emitModelTokensChangedEvent(e) { + if (!this._textModel._isDisposing()) { + this._bracketPairsTextModelPart.handleDidChangeTokens(e); + this._onDidChangeTokens.fire(e); + } + } + // #region Grammar Tokens + validateLineNumber(lineNumber) { + if (lineNumber < 1 || lineNumber > this._textModel.getLineCount()) { + throw new BugIndicatingError("Illegal value for lineNumber"); + } + } + get hasTokens() { + return this.tokens.get().hasTokens; + } + resetTokenization() { + this.tokens.get().todo_resetTokenization(); + } + get backgroundTokenizationState() { + return this.tokens.get().backgroundTokenizationState; + } + forceTokenization(lineNumber) { + this.validateLineNumber(lineNumber); + this.tokens.get().forceTokenization(lineNumber); + } + hasAccurateTokensForLine(lineNumber) { + this.validateLineNumber(lineNumber); + return this.tokens.get().hasAccurateTokensForLine(lineNumber); + } + isCheapToTokenize(lineNumber) { + this.validateLineNumber(lineNumber); + return this.tokens.get().isCheapToTokenize(lineNumber); + } + tokenizeIfCheap(lineNumber) { + this.validateLineNumber(lineNumber); + this.tokens.get().tokenizeIfCheap(lineNumber); + } + getTokenTypeIfInsertingCharacter(lineNumber, column, character) { + return this.tokens.get().getTokenTypeIfInsertingCharacter(lineNumber, column, character); + } + tokenizeLinesAt(lineNumber, lines) { + return this.tokens.get().tokenizeLinesAt(lineNumber, lines); + } + // #endregion + // #region Semantic Tokens + setSemanticTokens(tokens, isComplete) { + this._semanticTokens.set(tokens, isComplete, this._textModel); + this._emitModelTokensChangedEvent({ + semanticTokensApplied: tokens !== null, + ranges: [{ fromLineNumber: 1, toLineNumber: this._textModel.getLineCount() }] + }); + } + hasCompleteSemanticTokens() { + return this._semanticTokens.isComplete(); + } + hasSomeSemanticTokens() { + return !this._semanticTokens.isEmpty(); + } + setPartialSemanticTokens(range2, tokens) { + if (this.hasCompleteSemanticTokens()) { + return; + } + const changedRange = this._textModel.validateRange(this._semanticTokens.setPartial(range2, tokens)); + this._emitModelTokensChangedEvent({ + semanticTokensApplied: true, + ranges: [ + { + fromLineNumber: changedRange.startLineNumber, + toLineNumber: changedRange.endLineNumber + } + ] + }); + } + // #endregion + // #region Utility Methods + getWordAtPosition(_position) { + this.assertNotDisposed(); + const position = this._textModel.validatePosition(_position); + const lineContent = this._textModel.getLineContent(position.lineNumber); + const lineTokens = this.getLineTokens(position.lineNumber); + const tokenIndex = lineTokens.findTokenIndexAtOffset(position.column - 1); + const [rbStartOffset, rbEndOffset] = TokenizationTextModelPart_1._findLanguageBoundaries(lineTokens, tokenIndex); + const rightBiasedWord = getWordAtText(position.column, this.getLanguageConfiguration(lineTokens.getLanguageId(tokenIndex)).getWordDefinition(), lineContent.substring(rbStartOffset, rbEndOffset), rbStartOffset); + if (rightBiasedWord && rightBiasedWord.startColumn <= _position.column && _position.column <= rightBiasedWord.endColumn) { + return rightBiasedWord; + } + if (tokenIndex > 0 && rbStartOffset === position.column - 1) { + const [lbStartOffset, lbEndOffset] = TokenizationTextModelPart_1._findLanguageBoundaries(lineTokens, tokenIndex - 1); + const leftBiasedWord = getWordAtText(position.column, this.getLanguageConfiguration(lineTokens.getLanguageId(tokenIndex - 1)).getWordDefinition(), lineContent.substring(lbStartOffset, lbEndOffset), lbStartOffset); + if (leftBiasedWord && leftBiasedWord.startColumn <= _position.column && _position.column <= leftBiasedWord.endColumn) { + return leftBiasedWord; + } + } + return null; + } + getLanguageConfiguration(languageId) { + return this._languageConfigurationService.getLanguageConfiguration(languageId); + } + static _findLanguageBoundaries(lineTokens, tokenIndex) { + const languageId = lineTokens.getLanguageId(tokenIndex); + let startOffset = 0; + for (let i2 = tokenIndex; i2 >= 0 && lineTokens.getLanguageId(i2) === languageId; i2--) { + startOffset = lineTokens.getStartOffset(i2); + } + let endOffset = lineTokens.getLineContent().length; + for (let i2 = tokenIndex, tokenCount = lineTokens.getCount(); i2 < tokenCount && lineTokens.getLanguageId(i2) === languageId; i2++) { + endOffset = lineTokens.getEndOffset(i2); + } + return [startOffset, endOffset]; + } + getWordUntilPosition(position) { + const wordAtPosition = this.getWordAtPosition(position); + if (!wordAtPosition) { + return { word: "", startColumn: position.column, endColumn: position.column }; + } + return { + word: wordAtPosition.word.substr(0, position.column - wordAtPosition.startColumn), + startColumn: wordAtPosition.startColumn, + endColumn: position.column + }; + } + // #endregion + // #region Language Id handling + getLanguageId() { + return this._languageId; + } + getLanguageIdAtPosition(lineNumber, column) { + const position = this._textModel.validatePosition(new Position(lineNumber, column)); + const lineTokens = this.getLineTokens(position.lineNumber); + return lineTokens.getLanguageId(lineTokens.findTokenIndexAtOffset(position.column - 1)); + } + setLanguageId(languageId, source = "api") { + if (this._languageId === languageId) { + return; + } + const e = { + oldLanguage: this._languageId, + newLanguage: languageId, + source + }; + this._languageId = languageId; + this._languageIdObs.set(languageId, void 0); + this._bracketPairsTextModelPart.handleDidChangeLanguage(e); + this._onDidChangeLanguage.fire(e); + this._onDidChangeLanguageConfiguration.fire({}); + } + }; + TokenizationTextModelPart = TokenizationTextModelPart_1 = __decorate24([ + __param22(4, ILanguageService), + __param22(5, ILanguageConfigurationService), + __param22(6, IInstantiationService), + __param22(7, ITreeSitterLibraryService) + ], TokenizationTextModelPart); + } +}); + +// node_modules/monaco-editor-core/esm/vs/platform/undoRedo/common/undoRedo.js +var IUndoRedoService, ResourceEditStackSnapshot, UndoRedoGroup, UndoRedoSource; +var init_undoRedo = __esm({ + "node_modules/monaco-editor-core/esm/vs/platform/undoRedo/common/undoRedo.js"() { + init_instantiation(); + IUndoRedoService = createDecorator("undoRedoService"); + ResourceEditStackSnapshot = class { + constructor(resource, elements) { + this.resource = resource; + this.elements = elements; + } + }; + UndoRedoGroup = class _UndoRedoGroup { + static { + this._ID = 0; + } + constructor() { + this.id = _UndoRedoGroup._ID++; + this.order = 1; + } + nextOrder() { + if (this.id === 0) { + return 0; + } + return this.order++; + } + static { + this.None = new _UndoRedoGroup(); + } + }; + UndoRedoSource = class _UndoRedoSource { + static { + this._ID = 0; + } + constructor() { + this.id = _UndoRedoSource._ID++; + this.order = 1; + } + nextOrder() { + if (this.id === 0) { + return 0; + } + return this.order++; + } + static { + this.None = new _UndoRedoSource(); + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/common/collections.js +function groupByMap(data, groupFn) { + const result = /* @__PURE__ */ new Map(); + for (const element of data) { + const key = groupFn(element); + let target = result.get(key); + if (!target) { + target = []; + result.set(key, target); + } + target.push(element); + } + return result; +} +function diffSets(before, after2) { + const removed = []; + const added = []; + for (const element of before) { + if (!after2.has(element)) { + removed.push(element); + } + } + for (const element of after2) { + if (!before.has(element)) { + added.push(element); + } + } + return { removed, added }; +} +function intersection(setA, setB) { + const result = /* @__PURE__ */ new Set(); + for (const elem of setB) { + if (setA.has(elem)) { + result.add(elem); + } + } + return result; +} +var _a2, SetWithKey; +var init_collections = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/common/collections.js"() { + SetWithKey = class { + static { + _a2 = Symbol.toStringTag; + } + constructor(values, toKey) { + this.toKey = toKey; + this._map = /* @__PURE__ */ new Map(); + this[_a2] = "SetWithKey"; + for (const value of values) { + this.add(value); + } + } + get size() { + return this._map.size; + } + add(value) { + const key = this.toKey(value); + this._map.set(key, value); + return this; + } + delete(value) { + return this._map.delete(this.toKey(value)); + } + has(value) { + return this._map.has(this.toKey(value)); + } + *entries() { + for (const entry of this._map.values()) { + yield [entry, entry]; + } + } + keys() { + return this.values(); + } + *values() { + for (const entry of this._map.values()) { + yield entry; + } + } + clear() { + this._map.clear(); + } + forEach(callbackfn, thisArg) { + this._map.forEach((entry) => callbackfn.call(thisArg, entry, entry, this)); + } + [Symbol.iterator]() { + return this.values(); + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/common/model/textModel.js +function createTextBufferFactory(text2) { + const builder = new PieceTreeTextBufferBuilder(); + builder.acceptChunk(text2); + return builder.finish(); +} +function createTextBufferFactoryFromSnapshot(snapshot) { + const builder = new PieceTreeTextBufferBuilder(); + let chunk; + while (typeof (chunk = snapshot.read()) === "string") { + builder.acceptChunk(chunk); + } + return builder.finish(); +} +function createTextBuffer(value, defaultEOL) { + let factory; + if (typeof value === "string") { + factory = createTextBufferFactory(value); + } else if (isITextSnapshot(value)) { + factory = createTextBufferFactoryFromSnapshot(value); + } else { + factory = value; + } + return factory.create(defaultEOL); +} +function indentOfLine(line) { + let indent = 0; + for (const c of line) { + if (c === " " || c === " ") { + indent++; + } else { + break; + } + } + return indent; +} +function isNodeInOverviewRuler(node) { + return node.options.overviewRuler && node.options.overviewRuler.color ? true : false; +} +function isOptionsInjectedText(options2) { + return !!options2.after || !!options2.before; +} +function isNodeInjectedText(node) { + return !!node.options.after || !!node.options.before; +} +function cleanClassName(className2) { + return className2.replace(/[^a-z0-9\-_]/gi, " "); +} +function _normalizeOptions(options2) { + if (options2 instanceof ModelDecorationOptions) { + return options2; + } + return ModelDecorationOptions.createDynamic(options2); +} +var __decorate25, __param23, TextModel_1, MODEL_ID, LIMIT_FIND_COUNT2, LONG_LINE_BOUNDARY, LINE_HEIGHT_CEILING, TextModelSnapshot, invalidFunc2, TextModel, DecorationsTrees, DecorationOptions, ModelDecorationOverviewRulerOptions, ModelDecorationGlyphMarginOptions, ModelDecorationMinimapOptions, ModelDecorationInjectedTextOptions, ModelDecorationOptions, TRACKED_RANGE_OPTIONS, LineHeightChangingDecoration, LineFontChangingDecoration, DidChangeDecorationsEmitter, DidChangeContentEmitter; +var init_textModel = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/common/model/textModel.js"() { + init_arrays(); + init_color(); + init_errors(); + init_event(); + init_lifecycle(); + init_strings(); + init_uri(); + init_eolCounter(); + init_indentation(); + init_position(); + init_range(); + init_selection(); + init_textModelDefaults(); + init_language(); + init_languageConfigurationRegistry(); + init_model2(); + init_bracketPairsImpl(); + init_colorizedBracketPairsDecorationProvider(); + init_editStack(); + init_guidesTextModelPart(); + init_indentationGuesser(); + init_intervalTree(); + init_pieceTreeTextBuffer(); + init_pieceTreeTextBufferBuilder(); + init_textModelSearch(); + init_tokenizationTextModelPart(); + init_abstractSyntaxTokenBackend(); + init_textModelEvents(); + init_instantiation(); + init_undoRedo(); + init_collections(); + init_textModelEditSource(); + init_theme(); + __decorate25 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + __param23 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + MODEL_ID = 0; + LIMIT_FIND_COUNT2 = 999; + LONG_LINE_BOUNDARY = 1e4; + LINE_HEIGHT_CEILING = 300; + TextModelSnapshot = class { + constructor(source) { + this._source = source; + this._eos = false; + } + read() { + if (this._eos) { + return null; + } + const result = []; + let resultCnt = 0; + let resultLength = 0; + do { + const tmp = this._source.read(); + if (tmp === null) { + this._eos = true; + if (resultCnt === 0) { + return null; + } else { + return result.join(""); + } + } + if (tmp.length > 0) { + result[resultCnt++] = tmp; + resultLength += tmp.length; + } + if (resultLength >= 64 * 1024) { + return result.join(""); + } + } while (true); + } + }; + invalidFunc2 = () => { + throw new Error(`Invalid change accessor`); + }; + TextModel = class TextModel2 extends Disposable { + static { + TextModel_1 = this; + } + static { + this._MODEL_SYNC_LIMIT = 50 * 1024 * 1024; + } + static { + this.LARGE_FILE_SIZE_THRESHOLD = 20 * 1024 * 1024; + } + static { + this.LARGE_FILE_LINE_COUNT_THRESHOLD = 300 * 1e3; + } + static { + this.LARGE_FILE_HEAP_OPERATION_THRESHOLD = 256 * 1024 * 1024; + } + static { + this.DEFAULT_CREATION_OPTIONS = { + isForSimpleWidget: false, + tabSize: EDITOR_MODEL_DEFAULTS.tabSize, + indentSize: EDITOR_MODEL_DEFAULTS.indentSize, + insertSpaces: EDITOR_MODEL_DEFAULTS.insertSpaces, + detectIndentation: false, + defaultEOL: 1, + trimAutoWhitespace: EDITOR_MODEL_DEFAULTS.trimAutoWhitespace, + largeFileOptimizations: EDITOR_MODEL_DEFAULTS.largeFileOptimizations, + bracketPairColorizationOptions: EDITOR_MODEL_DEFAULTS.bracketPairColorizationOptions + }; + } + static resolveOptions(textBuffer, options2) { + if (options2.detectIndentation) { + const guessedIndentation = guessIndentation(textBuffer, options2.tabSize, options2.insertSpaces); + return new TextModelResolvedOptions({ + tabSize: guessedIndentation.tabSize, + indentSize: "tabSize", + // TODO@Alex: guess indentSize independent of tabSize + insertSpaces: guessedIndentation.insertSpaces, + trimAutoWhitespace: options2.trimAutoWhitespace, + defaultEOL: options2.defaultEOL, + bracketPairColorizationOptions: options2.bracketPairColorizationOptions + }); + } + return new TextModelResolvedOptions(options2); + } + get onDidChangeLanguage() { + return this._tokenizationTextModelPart.onDidChangeLanguage; + } + get onDidChangeLanguageConfiguration() { + return this._tokenizationTextModelPart.onDidChangeLanguageConfiguration; + } + get onDidChangeTokens() { + return this._tokenizationTextModelPart.onDidChangeTokens; + } + get onDidChangeOptions() { + return this._onDidChangeOptions.event; + } + get onDidChangeAttached() { + return this._onDidChangeAttached.event; + } + get onDidChangeLineHeight() { + return this._onDidChangeLineHeight.event; + } + get onDidChangeFont() { + return this._onDidChangeFont.event; + } + onDidChangeContent(listener) { + return this._eventEmitter.slowEvent((e) => listener(e.contentChangedEvent)); + } + onDidChangeContentOrInjectedText(listener) { + return combinedDisposable(this._eventEmitter.fastEvent((e) => listener(e)), this._onDidChangeInjectedText.event((e) => listener(e))); + } + _isDisposing() { + return this.__isDisposing; + } + get tokenization() { + return this._tokenizationTextModelPart; + } + get bracketPairs() { + return this._bracketPairs; + } + get guides() { + return this._guidesTextModelPart; + } + constructor(source, languageIdOrSelection, creationOptions, associatedResource = null, _undoRedoService, _languageService, _languageConfigurationService, instantiationService) { + super(); + this._undoRedoService = _undoRedoService; + this._languageService = _languageService; + this._languageConfigurationService = _languageConfigurationService; + this.instantiationService = instantiationService; + this._onWillDispose = this._register(new Emitter()); + this.onWillDispose = this._onWillDispose.event; + this._onDidChangeDecorations = this._register(new DidChangeDecorationsEmitter((affectedInjectedTextLines, affectedLineHeights, affectedFontLines) => this.handleBeforeFireDecorationsChangedEvent(affectedInjectedTextLines, affectedLineHeights, affectedFontLines))); + this.onDidChangeDecorations = this._onDidChangeDecorations.event; + this._onDidChangeOptions = this._register(new Emitter()); + this._onDidChangeAttached = this._register(new Emitter()); + this._onDidChangeInjectedText = this._register(new Emitter()); + this._onDidChangeLineHeight = this._register(new Emitter()); + this._onDidChangeFont = this._register(new Emitter()); + this._eventEmitter = this._register(new DidChangeContentEmitter()); + this._languageSelectionListener = this._register(new MutableDisposable()); + this._deltaDecorationCallCnt = 0; + this._attachedViews = new AttachedViews(); + MODEL_ID++; + this.id = "$model" + MODEL_ID; + this.isForSimpleWidget = creationOptions.isForSimpleWidget; + if (typeof associatedResource === "undefined" || associatedResource === null) { + this._associatedResource = URI.parse("inmemory://model/" + MODEL_ID); + } else { + this._associatedResource = associatedResource; + } + this._attachedEditorCount = 0; + const { textBuffer, disposable } = createTextBuffer(source, creationOptions.defaultEOL); + this._buffer = textBuffer; + this._bufferDisposable = disposable; + const bufferLineCount = this._buffer.getLineCount(); + const bufferTextLength = this._buffer.getValueLengthInRange( + new Range(1, 1, bufferLineCount, this._buffer.getLineLength(bufferLineCount) + 1), + 0 + /* model.EndOfLinePreference.TextDefined */ + ); + if (creationOptions.largeFileOptimizations) { + this._isTooLargeForTokenization = bufferTextLength > TextModel_1.LARGE_FILE_SIZE_THRESHOLD || bufferLineCount > TextModel_1.LARGE_FILE_LINE_COUNT_THRESHOLD; + this._isTooLargeForHeapOperation = bufferTextLength > TextModel_1.LARGE_FILE_HEAP_OPERATION_THRESHOLD; + } else { + this._isTooLargeForTokenization = false; + this._isTooLargeForHeapOperation = false; + } + this._options = TextModel_1.resolveOptions(this._buffer, creationOptions); + const languageId = typeof languageIdOrSelection === "string" ? languageIdOrSelection : languageIdOrSelection.languageId; + if (typeof languageIdOrSelection !== "string") { + this._languageSelectionListener.value = languageIdOrSelection.onDidChange(() => this._setLanguage(languageIdOrSelection.languageId)); + } + this._bracketPairs = this._register(new BracketPairsTextModelPart(this, this._languageConfigurationService)); + this._guidesTextModelPart = this._register(new GuidesTextModelPart(this, this._languageConfigurationService)); + this._decorationProvider = this._register(new ColorizedBracketPairsDecorationProvider(this)); + this._tokenizationTextModelPart = this.instantiationService.createInstance(TokenizationTextModelPart, this, this._bracketPairs, languageId, this._attachedViews); + this._isTooLargeForSyncing = bufferTextLength > TextModel_1._MODEL_SYNC_LIMIT; + this._versionId = 1; + this._alternativeVersionId = 1; + this._initialUndoRedoSnapshot = null; + this._isDisposed = false; + this.__isDisposing = false; + this._instanceId = singleLetterHash(MODEL_ID); + this._lastDecorationId = 0; + this._decorations = /* @__PURE__ */ Object.create(null); + this._decorationsTree = new DecorationsTrees(); + this._commandManager = new EditStack(this, this._undoRedoService); + this._isUndoing = false; + this._isRedoing = false; + this._trimAutoWhitespaceLines = null; + this._register(this._decorationProvider.onDidChange(() => { + this._onDidChangeDecorations.beginDeferredEmit(); + this._onDidChangeDecorations.fire(); + this._onDidChangeDecorations.endDeferredEmit(); + })); + this._languageService.requestRichLanguageFeatures(languageId); + this._register(this._languageConfigurationService.onDidChange((e) => { + this._bracketPairs.handleLanguageConfigurationServiceChange(e); + this._tokenizationTextModelPart.handleLanguageConfigurationServiceChange(e); + })); + } + dispose() { + this.__isDisposing = true; + this._onWillDispose.fire(); + this._tokenizationTextModelPart.dispose(); + this._isDisposed = true; + super.dispose(); + this._bufferDisposable.dispose(); + this.__isDisposing = false; + const emptyDisposedTextBuffer = new PieceTreeTextBuffer([], "", "\n", false, false, true, true); + emptyDisposedTextBuffer.dispose(); + this._buffer = emptyDisposedTextBuffer; + this._bufferDisposable = Disposable.None; + } + _assertNotDisposed() { + if (this._isDisposed) { + throw new BugIndicatingError("Model is disposed!"); + } + } + getTextBuffer() { + this._assertNotDisposed(); + return this._buffer; + } + _emitContentChangedEvent(rawChange, change) { + if (this.__isDisposing) { + return; + } + this._tokenizationTextModelPart.handleDidChangeContent(change); + this._bracketPairs.handleDidChangeContent(change); + this._eventEmitter.fire(new InternalModelContentChangeEvent(rawChange, change)); + } + setValue(value, reason = EditSources.setValue()) { + this._assertNotDisposed(); + if (value === null || value === void 0) { + throw illegalArgument(); + } + const { textBuffer, disposable } = createTextBuffer(value, this._options.defaultEOL); + this._setValueFromTextBuffer(textBuffer, disposable, reason); + } + _createContentChanged2(range2, rangeOffset, rangeLength, rangeEndPosition, text2, isUndoing, isRedoing, isFlush, isEolChange, reason) { + return { + changes: [{ + range: range2, + rangeOffset, + rangeLength, + text: text2 + }], + eol: this._buffer.getEOL(), + isEolChange, + versionId: this.getVersionId(), + isUndoing, + isRedoing, + isFlush, + detailedReasons: [reason], + detailedReasonsChangeLengths: [1] + }; + } + _setValueFromTextBuffer(textBuffer, textBufferDisposable, reason) { + this._assertNotDisposed(); + const oldFullModelRange = this.getFullModelRange(); + const oldModelValueLength = this.getValueLengthInRange(oldFullModelRange); + const endLineNumber = this.getLineCount(); + const endColumn = this.getLineMaxColumn(endLineNumber); + this._buffer = textBuffer; + this._bufferDisposable.dispose(); + this._bufferDisposable = textBufferDisposable; + this._increaseVersionId(); + this._decorations = /* @__PURE__ */ Object.create(null); + this._decorationsTree = new DecorationsTrees(); + this._commandManager.clear(); + this._trimAutoWhitespaceLines = null; + this._emitContentChangedEvent(new ModelRawContentChangedEvent([ + new ModelRawFlush() + ], this._versionId, false, false), this._createContentChanged2(new Range(1, 1, endLineNumber, endColumn), 0, oldModelValueLength, new Position(endLineNumber, endColumn), this.getValue(), false, false, true, false, reason)); + } + setEOL(eol) { + this._assertNotDisposed(); + const newEOL = eol === 1 ? "\r\n" : "\n"; + if (this._buffer.getEOL() === newEOL) { + return; + } + const oldFullModelRange = this.getFullModelRange(); + const oldModelValueLength = this.getValueLengthInRange(oldFullModelRange); + const endLineNumber = this.getLineCount(); + const endColumn = this.getLineMaxColumn(endLineNumber); + this._onBeforeEOLChange(); + this._buffer.setEOL(newEOL); + this._increaseVersionId(); + this._onAfterEOLChange(); + this._emitContentChangedEvent(new ModelRawContentChangedEvent([ + new ModelRawEOLChanged() + ], this._versionId, false, false), this._createContentChanged2(new Range(1, 1, endLineNumber, endColumn), 0, oldModelValueLength, new Position(endLineNumber, endColumn), this.getValue(), false, false, false, true, EditSources.eolChange())); + } + _onBeforeEOLChange() { + this._decorationsTree.ensureAllNodesHaveRanges(this); + } + _onAfterEOLChange() { + const versionId = this.getVersionId(); + const allDecorations = this._decorationsTree.collectNodesPostOrder(); + for (let i2 = 0, len = allDecorations.length; i2 < len; i2++) { + const node = allDecorations[i2]; + const range2 = node.range; + const delta = node.cachedAbsoluteStart - node.start; + const startOffset = this._buffer.getOffsetAt(range2.startLineNumber, range2.startColumn); + const endOffset = this._buffer.getOffsetAt(range2.endLineNumber, range2.endColumn); + node.cachedAbsoluteStart = startOffset; + node.cachedAbsoluteEnd = endOffset; + node.cachedVersionId = versionId; + node.start = startOffset - delta; + node.end = endOffset - delta; + recomputeMaxEnd(node); + } + } + onBeforeAttached() { + this._attachedEditorCount++; + if (this._attachedEditorCount === 1) { + this._tokenizationTextModelPart.handleDidChangeAttached(); + this._onDidChangeAttached.fire(void 0); + } + return this._attachedViews.attachView(); + } + onBeforeDetached(view) { + this._attachedEditorCount--; + if (this._attachedEditorCount === 0) { + this._tokenizationTextModelPart.handleDidChangeAttached(); + this._onDidChangeAttached.fire(void 0); + } + this._attachedViews.detachView(view); + } + isAttachedToEditor() { + return this._attachedEditorCount > 0; + } + getAttachedEditorCount() { + return this._attachedEditorCount; + } + isTooLargeForSyncing() { + return this._isTooLargeForSyncing; + } + isTooLargeForTokenization() { + return this._isTooLargeForTokenization; + } + isTooLargeForHeapOperation() { + return this._isTooLargeForHeapOperation; + } + isDisposed() { + return this._isDisposed; + } + isDominatedByLongLines() { + this._assertNotDisposed(); + if (this.isTooLargeForTokenization()) { + return false; + } + let smallLineCharCount = 0; + let longLineCharCount = 0; + const lineCount = this._buffer.getLineCount(); + for (let lineNumber = 1; lineNumber <= lineCount; lineNumber++) { + const lineLength = this._buffer.getLineLength(lineNumber); + if (lineLength >= LONG_LINE_BOUNDARY) { + longLineCharCount += lineLength; + } else { + smallLineCharCount += lineLength; + } + } + return longLineCharCount > smallLineCharCount; + } + get uri() { + return this._associatedResource; + } + //#region Options + getOptions() { + this._assertNotDisposed(); + return this._options; + } + getFormattingOptions() { + return { + tabSize: this._options.indentSize, + insertSpaces: this._options.insertSpaces + }; + } + updateOptions(_newOpts) { + this._assertNotDisposed(); + const tabSize = typeof _newOpts.tabSize !== "undefined" ? _newOpts.tabSize : this._options.tabSize; + const indentSize = typeof _newOpts.indentSize !== "undefined" ? _newOpts.indentSize : this._options.originalIndentSize; + const insertSpaces = typeof _newOpts.insertSpaces !== "undefined" ? _newOpts.insertSpaces : this._options.insertSpaces; + const trimAutoWhitespace = typeof _newOpts.trimAutoWhitespace !== "undefined" ? _newOpts.trimAutoWhitespace : this._options.trimAutoWhitespace; + const bracketPairColorizationOptions = typeof _newOpts.bracketColorizationOptions !== "undefined" ? _newOpts.bracketColorizationOptions : this._options.bracketPairColorizationOptions; + const newOpts = new TextModelResolvedOptions({ + tabSize, + indentSize, + insertSpaces, + defaultEOL: this._options.defaultEOL, + trimAutoWhitespace, + bracketPairColorizationOptions + }); + if (this._options.equals(newOpts)) { + return; + } + const e = this._options.createChangeEvent(newOpts); + this._options = newOpts; + this._bracketPairs.handleDidChangeOptions(e); + this._decorationProvider.handleDidChangeOptions(e); + this._onDidChangeOptions.fire(e); + } + detectIndentation(defaultInsertSpaces, defaultTabSize) { + this._assertNotDisposed(); + const guessedIndentation = guessIndentation(this._buffer, defaultTabSize, defaultInsertSpaces); + this.updateOptions({ + insertSpaces: guessedIndentation.insertSpaces, + tabSize: guessedIndentation.tabSize, + indentSize: guessedIndentation.tabSize + // TODO@Alex: guess indentSize independent of tabSize + }); + } + normalizeIndentation(str) { + this._assertNotDisposed(); + return normalizeIndentation(str, this._options.indentSize, this._options.insertSpaces); + } + //#endregion + //#region Reading + getVersionId() { + this._assertNotDisposed(); + return this._versionId; + } + mightContainRTL() { + return this._buffer.mightContainRTL(); + } + mightContainUnusualLineTerminators() { + return this._buffer.mightContainUnusualLineTerminators(); + } + removeUnusualLineTerminators(selections = null) { + const matches = this.findMatches( + UNUSUAL_LINE_TERMINATORS.source, + false, + true, + false, + null, + false, + 1073741824 + /* Constants.MAX_SAFE_SMALL_INTEGER */ + ); + this._buffer.resetMightContainUnusualLineTerminators(); + this.pushEditOperations(selections, matches.map((m) => ({ range: m.range, text: null })), () => null); + } + mightContainNonBasicASCII() { + return this._buffer.mightContainNonBasicASCII(); + } + getAlternativeVersionId() { + this._assertNotDisposed(); + return this._alternativeVersionId; + } + getInitialUndoRedoSnapshot() { + this._assertNotDisposed(); + return this._initialUndoRedoSnapshot; + } + getOffsetAt(rawPosition) { + this._assertNotDisposed(); + const position = this._validatePosition( + rawPosition.lineNumber, + rawPosition.column, + 0 + /* StringOffsetValidationType.Relaxed */ + ); + return this._buffer.getOffsetAt(position.lineNumber, position.column); + } + getPositionAt(rawOffset) { + this._assertNotDisposed(); + const offset = Math.min(this._buffer.getLength(), Math.max(0, rawOffset)); + return this._buffer.getPositionAt(offset); + } + _increaseVersionId() { + this._versionId = this._versionId + 1; + this._alternativeVersionId = this._versionId; + } + _overwriteVersionId(versionId) { + this._versionId = versionId; + } + _overwriteAlternativeVersionId(newAlternativeVersionId) { + this._alternativeVersionId = newAlternativeVersionId; + } + _overwriteInitialUndoRedoSnapshot(newInitialUndoRedoSnapshot) { + this._initialUndoRedoSnapshot = newInitialUndoRedoSnapshot; + } + getValue(eol, preserveBOM = false) { + this._assertNotDisposed(); + if (this.isTooLargeForHeapOperation()) { + throw new BugIndicatingError("Operation would exceed heap memory limits"); + } + const fullModelRange = this.getFullModelRange(); + const fullModelValue = this.getValueInRange(fullModelRange, eol); + if (preserveBOM) { + return this._buffer.getBOM() + fullModelValue; + } + return fullModelValue; + } + createSnapshot(preserveBOM = false) { + return new TextModelSnapshot(this._buffer.createSnapshot(preserveBOM)); + } + getValueLength(eol, preserveBOM = false) { + this._assertNotDisposed(); + const fullModelRange = this.getFullModelRange(); + const fullModelValue = this.getValueLengthInRange(fullModelRange, eol); + if (preserveBOM) { + return this._buffer.getBOM().length + fullModelValue; + } + return fullModelValue; + } + getValueInRange(rawRange, eol = 0) { + this._assertNotDisposed(); + return this._buffer.getValueInRange(this.validateRange(rawRange), eol); + } + getValueLengthInRange(rawRange, eol = 0) { + this._assertNotDisposed(); + return this._buffer.getValueLengthInRange(this.validateRange(rawRange), eol); + } + getCharacterCountInRange(rawRange, eol = 0) { + this._assertNotDisposed(); + return this._buffer.getCharacterCountInRange(this.validateRange(rawRange), eol); + } + getLineCount() { + this._assertNotDisposed(); + return this._buffer.getLineCount(); + } + getLineContent(lineNumber) { + this._assertNotDisposed(); + if (lineNumber < 1 || lineNumber > this.getLineCount()) { + throw new BugIndicatingError("Illegal value for lineNumber"); + } + return this._buffer.getLineContent(lineNumber); + } + getLineLength(lineNumber) { + this._assertNotDisposed(); + if (lineNumber < 1 || lineNumber > this.getLineCount()) { + throw new BugIndicatingError("Illegal value for lineNumber"); + } + return this._buffer.getLineLength(lineNumber); + } + getLinesContent() { + this._assertNotDisposed(); + if (this.isTooLargeForHeapOperation()) { + throw new BugIndicatingError("Operation would exceed heap memory limits"); + } + return this._buffer.getLinesContent(); + } + getEOL() { + this._assertNotDisposed(); + return this._buffer.getEOL(); + } + getEndOfLineSequence() { + this._assertNotDisposed(); + return this._buffer.getEOL() === "\n" ? 0 : 1; + } + getLineMinColumn(lineNumber) { + this._assertNotDisposed(); + return 1; + } + getLineMaxColumn(lineNumber) { + this._assertNotDisposed(); + if (lineNumber < 1 || lineNumber > this.getLineCount()) { + throw new BugIndicatingError("Illegal value for lineNumber"); + } + return this._buffer.getLineLength(lineNumber) + 1; + } + getLineFirstNonWhitespaceColumn(lineNumber) { + this._assertNotDisposed(); + if (lineNumber < 1 || lineNumber > this.getLineCount()) { + throw new BugIndicatingError("Illegal value for lineNumber"); + } + return this._buffer.getLineFirstNonWhitespaceColumn(lineNumber); + } + getLineLastNonWhitespaceColumn(lineNumber) { + this._assertNotDisposed(); + if (lineNumber < 1 || lineNumber > this.getLineCount()) { + throw new BugIndicatingError("Illegal value for lineNumber"); + } + return this._buffer.getLineLastNonWhitespaceColumn(lineNumber); + } + /** + * Validates `range` is within buffer bounds, but allows it to sit in between surrogate pairs, etc. + * Will try to not allocate if possible. + */ + _validateRangeRelaxedNoAllocations(range2) { + const linesCount = this._buffer.getLineCount(); + const initialStartLineNumber = range2.startLineNumber; + const initialStartColumn = range2.startColumn; + let startLineNumber = Math.floor(typeof initialStartLineNumber === "number" && !isNaN(initialStartLineNumber) ? initialStartLineNumber : 1); + let startColumn = Math.floor(typeof initialStartColumn === "number" && !isNaN(initialStartColumn) ? initialStartColumn : 1); + if (startLineNumber < 1) { + startLineNumber = 1; + startColumn = 1; + } else if (startLineNumber > linesCount) { + startLineNumber = linesCount; + startColumn = this.getLineMaxColumn(startLineNumber); + } else { + if (startColumn <= 1) { + startColumn = 1; + } else { + const maxColumn = this.getLineMaxColumn(startLineNumber); + if (startColumn >= maxColumn) { + startColumn = maxColumn; + } + } + } + const initialEndLineNumber = range2.endLineNumber; + const initialEndColumn = range2.endColumn; + let endLineNumber = Math.floor(typeof initialEndLineNumber === "number" && !isNaN(initialEndLineNumber) ? initialEndLineNumber : 1); + let endColumn = Math.floor(typeof initialEndColumn === "number" && !isNaN(initialEndColumn) ? initialEndColumn : 1); + if (endLineNumber < 1) { + endLineNumber = 1; + endColumn = 1; + } else if (endLineNumber > linesCount) { + endLineNumber = linesCount; + endColumn = this.getLineMaxColumn(endLineNumber); + } else { + if (endColumn <= 1) { + endColumn = 1; + } else { + const maxColumn = this.getLineMaxColumn(endLineNumber); + if (endColumn >= maxColumn) { + endColumn = maxColumn; + } + } + } + if (initialStartLineNumber === startLineNumber && initialStartColumn === startColumn && initialEndLineNumber === endLineNumber && initialEndColumn === endColumn && range2 instanceof Range && !(range2 instanceof Selection)) { + return range2; + } + return new Range(startLineNumber, startColumn, endLineNumber, endColumn); + } + _isValidPosition(lineNumber, column, validationType) { + if (typeof lineNumber !== "number" || typeof column !== "number") { + return false; + } + if (isNaN(lineNumber) || isNaN(column)) { + return false; + } + if (lineNumber < 1 || column < 1) { + return false; + } + if ((lineNumber | 0) !== lineNumber || (column | 0) !== column) { + return false; + } + const lineCount = this._buffer.getLineCount(); + if (lineNumber > lineCount) { + return false; + } + if (column === 1) { + return true; + } + const maxColumn = this.getLineMaxColumn(lineNumber); + if (column > maxColumn) { + return false; + } + if (validationType === 1) { + const charCodeBefore = this._buffer.getLineCharCode(lineNumber, column - 2); + if (isHighSurrogate(charCodeBefore)) { + return false; + } + } + return true; + } + _validatePosition(_lineNumber, _column, validationType) { + const lineNumber = Math.floor(typeof _lineNumber === "number" && !isNaN(_lineNumber) ? _lineNumber : 1); + const column = Math.floor(typeof _column === "number" && !isNaN(_column) ? _column : 1); + const lineCount = this._buffer.getLineCount(); + if (lineNumber < 1) { + return new Position(1, 1); + } + if (lineNumber > lineCount) { + return new Position(lineCount, this.getLineMaxColumn(lineCount)); + } + if (column <= 1) { + return new Position(lineNumber, 1); + } + const maxColumn = this.getLineMaxColumn(lineNumber); + if (column >= maxColumn) { + return new Position(lineNumber, maxColumn); + } + if (validationType === 1) { + const charCodeBefore = this._buffer.getLineCharCode(lineNumber, column - 2); + if (isHighSurrogate(charCodeBefore)) { + return new Position(lineNumber, column - 1); + } + } + return new Position(lineNumber, column); + } + validatePosition(position) { + const validationType = 1; + this._assertNotDisposed(); + if (position instanceof Position) { + if (this._isValidPosition(position.lineNumber, position.column, validationType)) { + return position; + } + } + return this._validatePosition(position.lineNumber, position.column, validationType); + } + isValidRange(range2) { + return this._isValidRange( + range2, + 1 + /* StringOffsetValidationType.SurrogatePairs */ + ); + } + _isValidRange(range2, validationType) { + const startLineNumber = range2.startLineNumber; + const startColumn = range2.startColumn; + const endLineNumber = range2.endLineNumber; + const endColumn = range2.endColumn; + if (!this._isValidPosition( + startLineNumber, + startColumn, + 0 + /* StringOffsetValidationType.Relaxed */ + )) { + return false; + } + if (!this._isValidPosition( + endLineNumber, + endColumn, + 0 + /* StringOffsetValidationType.Relaxed */ + )) { + return false; + } + if (validationType === 1) { + const charCodeBeforeStart = startColumn > 1 ? this._buffer.getLineCharCode(startLineNumber, startColumn - 2) : 0; + const charCodeBeforeEnd = endColumn > 1 && endColumn <= this._buffer.getLineLength(endLineNumber) ? this._buffer.getLineCharCode(endLineNumber, endColumn - 2) : 0; + const startInsideSurrogatePair = isHighSurrogate(charCodeBeforeStart); + const endInsideSurrogatePair = isHighSurrogate(charCodeBeforeEnd); + if (!startInsideSurrogatePair && !endInsideSurrogatePair) { + return true; + } + return false; + } + return true; + } + validateRange(_range) { + const validationType = 1; + this._assertNotDisposed(); + if (_range instanceof Range && !(_range instanceof Selection)) { + if (this._isValidRange(_range, validationType)) { + return _range; + } + } + const start = this._validatePosition( + _range.startLineNumber, + _range.startColumn, + 0 + /* StringOffsetValidationType.Relaxed */ + ); + const end = this._validatePosition( + _range.endLineNumber, + _range.endColumn, + 0 + /* StringOffsetValidationType.Relaxed */ + ); + const startLineNumber = start.lineNumber; + const startColumn = start.column; + const endLineNumber = end.lineNumber; + const endColumn = end.column; + if (validationType === 1) { + const charCodeBeforeStart = startColumn > 1 ? this._buffer.getLineCharCode(startLineNumber, startColumn - 2) : 0; + const charCodeBeforeEnd = endColumn > 1 && endColumn <= this._buffer.getLineLength(endLineNumber) ? this._buffer.getLineCharCode(endLineNumber, endColumn - 2) : 0; + const startInsideSurrogatePair = isHighSurrogate(charCodeBeforeStart); + const endInsideSurrogatePair = isHighSurrogate(charCodeBeforeEnd); + if (!startInsideSurrogatePair && !endInsideSurrogatePair) { + return new Range(startLineNumber, startColumn, endLineNumber, endColumn); + } + if (startLineNumber === endLineNumber && startColumn === endColumn) { + return new Range(startLineNumber, startColumn - 1, endLineNumber, endColumn - 1); + } + if (startInsideSurrogatePair && endInsideSurrogatePair) { + return new Range(startLineNumber, startColumn - 1, endLineNumber, endColumn + 1); + } + if (startInsideSurrogatePair) { + return new Range(startLineNumber, startColumn - 1, endLineNumber, endColumn); + } + return new Range(startLineNumber, startColumn, endLineNumber, endColumn + 1); + } + return new Range(startLineNumber, startColumn, endLineNumber, endColumn); + } + modifyPosition(rawPosition, offset) { + this._assertNotDisposed(); + const candidate = this.getOffsetAt(rawPosition) + offset; + return this.getPositionAt(Math.min(this._buffer.getLength(), Math.max(0, candidate))); + } + getFullModelRange() { + this._assertNotDisposed(); + const lineCount = this.getLineCount(); + return new Range(1, 1, lineCount, this.getLineMaxColumn(lineCount)); + } + findMatchesLineByLine(searchRange, searchData, captureMatches, limitResultCount) { + return this._buffer.findMatchesLineByLine(searchRange, searchData, captureMatches, limitResultCount); + } + findMatches(searchString, rawSearchScope, isRegex, matchCase, wordSeparators2, captureMatches, limitResultCount = LIMIT_FIND_COUNT2) { + this._assertNotDisposed(); + let searchRanges = null; + if (rawSearchScope !== null && typeof rawSearchScope !== "boolean") { + if (!Array.isArray(rawSearchScope)) { + rawSearchScope = [rawSearchScope]; + } + if (rawSearchScope.every((searchScope) => Range.isIRange(searchScope))) { + searchRanges = rawSearchScope.map((searchScope) => this.validateRange(searchScope)); + } + } + if (searchRanges === null) { + searchRanges = [this.getFullModelRange()]; + } + searchRanges = searchRanges.sort((d1, d2) => d1.startLineNumber - d2.startLineNumber || d1.startColumn - d2.startColumn); + const uniqueSearchRanges = []; + uniqueSearchRanges.push(searchRanges.reduce((prev, curr) => { + if (Range.areIntersecting(prev, curr)) { + return prev.plusRange(curr); + } + uniqueSearchRanges.push(prev); + return curr; + })); + let matchMapper; + if (!isRegex && searchString.indexOf("\n") < 0) { + const searchParams = new SearchParams(searchString, isRegex, matchCase, wordSeparators2); + const searchData = searchParams.parseSearchRequest(); + if (!searchData) { + return []; + } + matchMapper = (searchRange) => this.findMatchesLineByLine(searchRange, searchData, captureMatches, limitResultCount); + } else { + matchMapper = (searchRange) => TextModelSearch.findMatches(this, new SearchParams(searchString, isRegex, matchCase, wordSeparators2), searchRange, captureMatches, limitResultCount); + } + return uniqueSearchRanges.map(matchMapper).reduce((arr, matches) => arr.concat(matches), []); + } + findNextMatch(searchString, rawSearchStart, isRegex, matchCase, wordSeparators2, captureMatches) { + this._assertNotDisposed(); + const searchStart = this.validatePosition(rawSearchStart); + if (!isRegex && searchString.indexOf("\n") < 0) { + const searchParams = new SearchParams(searchString, isRegex, matchCase, wordSeparators2); + const searchData = searchParams.parseSearchRequest(); + if (!searchData) { + return null; + } + const lineCount = this.getLineCount(); + let searchRange = new Range(searchStart.lineNumber, searchStart.column, lineCount, this.getLineMaxColumn(lineCount)); + let ret = this.findMatchesLineByLine(searchRange, searchData, captureMatches, 1); + TextModelSearch.findNextMatch(this, new SearchParams(searchString, isRegex, matchCase, wordSeparators2), searchStart, captureMatches); + if (ret.length > 0) { + return ret[0]; + } + searchRange = new Range(1, 1, searchStart.lineNumber, this.getLineMaxColumn(searchStart.lineNumber)); + ret = this.findMatchesLineByLine(searchRange, searchData, captureMatches, 1); + if (ret.length > 0) { + return ret[0]; + } + return null; + } + return TextModelSearch.findNextMatch(this, new SearchParams(searchString, isRegex, matchCase, wordSeparators2), searchStart, captureMatches); + } + findPreviousMatch(searchString, rawSearchStart, isRegex, matchCase, wordSeparators2, captureMatches) { + this._assertNotDisposed(); + const searchStart = this.validatePosition(rawSearchStart); + return TextModelSearch.findPreviousMatch(this, new SearchParams(searchString, isRegex, matchCase, wordSeparators2), searchStart, captureMatches); + } + //#endregion + //#region Editing + pushStackElement() { + this._commandManager.pushStackElement(); + } + popStackElement() { + this._commandManager.popStackElement(); + } + pushEOL(eol) { + const currentEOL = this.getEOL() === "\n" ? 0 : 1; + if (currentEOL === eol) { + return; + } + try { + this._onDidChangeDecorations.beginDeferredEmit(); + this._eventEmitter.beginDeferredEmit(); + if (this._initialUndoRedoSnapshot === null) { + this._initialUndoRedoSnapshot = this._undoRedoService.createSnapshot(this.uri); + } + this._commandManager.pushEOL(eol); + } finally { + this._eventEmitter.endDeferredEmit(); + this._onDidChangeDecorations.endDeferredEmit(); + } + } + _validateEditOperation(rawOperation) { + if (rawOperation instanceof ValidAnnotatedEditOperation) { + return rawOperation; + } + return new ValidAnnotatedEditOperation(rawOperation.identifier || null, this.validateRange(rawOperation.range), rawOperation.text, rawOperation.forceMoveMarkers || false, rawOperation.isAutoWhitespaceEdit || false, rawOperation._isTracked || false); + } + _validateEditOperations(rawOperations) { + const result = []; + for (let i2 = 0, len = rawOperations.length; i2 < len; i2++) { + result[i2] = this._validateEditOperation(rawOperations[i2]); + } + return result; + } + pushEditOperations(beforeCursorState, editOperations, cursorStateComputer, group, reason) { + try { + this._onDidChangeDecorations.beginDeferredEmit(); + this._eventEmitter.beginDeferredEmit(); + return this._pushEditOperations(beforeCursorState, this._validateEditOperations(editOperations), cursorStateComputer, group, reason); + } finally { + this._eventEmitter.endDeferredEmit(); + this._onDidChangeDecorations.endDeferredEmit(); + } + } + _pushEditOperations(beforeCursorState, editOperations, cursorStateComputer, group, reason) { + if (this._options.trimAutoWhitespace && this._trimAutoWhitespaceLines) { + const incomingEdits = editOperations.map((op) => { + return { + range: this.validateRange(op.range), + text: op.text + }; + }); + let editsAreNearCursors = true; + if (beforeCursorState) { + for (let i2 = 0, len = beforeCursorState.length; i2 < len; i2++) { + const sel = beforeCursorState[i2]; + let foundEditNearSel = false; + for (let j = 0, lenJ = incomingEdits.length; j < lenJ; j++) { + const editRange = incomingEdits[j].range; + const selIsAbove = editRange.startLineNumber > sel.endLineNumber; + const selIsBelow = sel.startLineNumber > editRange.endLineNumber; + if (!selIsAbove && !selIsBelow) { + foundEditNearSel = true; + break; + } + } + if (!foundEditNearSel) { + editsAreNearCursors = false; + break; + } + } + } + if (editsAreNearCursors) { + for (let i2 = 0, len = this._trimAutoWhitespaceLines.length; i2 < len; i2++) { + const trimLineNumber = this._trimAutoWhitespaceLines[i2]; + const maxLineColumn = this.getLineMaxColumn(trimLineNumber); + let allowTrimLine = true; + for (let j = 0, lenJ = incomingEdits.length; j < lenJ; j++) { + const editRange = incomingEdits[j].range; + const editText = incomingEdits[j].text; + if (trimLineNumber < editRange.startLineNumber || trimLineNumber > editRange.endLineNumber) { + continue; + } + if (trimLineNumber === editRange.startLineNumber && editRange.startColumn === maxLineColumn && editRange.isEmpty() && editText && editText.length > 0 && editText.charAt(0) === "\n") { + continue; + } + if (trimLineNumber === editRange.startLineNumber && editRange.startColumn === 1 && editRange.isEmpty() && editText && editText.length > 0 && editText.charAt(editText.length - 1) === "\n") { + continue; + } + allowTrimLine = false; + break; + } + if (allowTrimLine) { + const trimRange = new Range(trimLineNumber, 1, trimLineNumber, maxLineColumn); + editOperations.push(new ValidAnnotatedEditOperation(null, trimRange, null, false, false, false)); + } + } + } + this._trimAutoWhitespaceLines = null; + } + if (this._initialUndoRedoSnapshot === null) { + this._initialUndoRedoSnapshot = this._undoRedoService.createSnapshot(this.uri); + } + return this._commandManager.pushEditOperation(beforeCursorState, editOperations, cursorStateComputer, group, reason); + } + _applyUndo(changes, eol, resultingAlternativeVersionId, resultingSelection) { + const edits = changes.map((change) => { + const rangeStart = this.getPositionAt(change.newPosition); + const rangeEnd = this.getPositionAt(change.newEnd); + return { + range: new Range(rangeStart.lineNumber, rangeStart.column, rangeEnd.lineNumber, rangeEnd.column), + text: change.oldText + }; + }); + this._applyUndoRedoEdits(edits, eol, true, false, resultingAlternativeVersionId, resultingSelection); + } + _applyRedo(changes, eol, resultingAlternativeVersionId, resultingSelection) { + const edits = changes.map((change) => { + const rangeStart = this.getPositionAt(change.oldPosition); + const rangeEnd = this.getPositionAt(change.oldEnd); + return { + range: new Range(rangeStart.lineNumber, rangeStart.column, rangeEnd.lineNumber, rangeEnd.column), + text: change.newText + }; + }); + this._applyUndoRedoEdits(edits, eol, false, true, resultingAlternativeVersionId, resultingSelection); + } + _applyUndoRedoEdits(edits, eol, isUndoing, isRedoing, resultingAlternativeVersionId, resultingSelection) { + try { + this._onDidChangeDecorations.beginDeferredEmit(); + this._eventEmitter.beginDeferredEmit(); + this._isUndoing = isUndoing; + this._isRedoing = isRedoing; + this.applyEdits(edits, false); + this.setEOL(eol); + this._overwriteAlternativeVersionId(resultingAlternativeVersionId); + } finally { + this._isUndoing = false; + this._isRedoing = false; + this._eventEmitter.endDeferredEmit(resultingSelection); + this._onDidChangeDecorations.endDeferredEmit(); + } + } + applyEdits(rawOperations, computeUndoEdits, reason) { + try { + this._onDidChangeDecorations.beginDeferredEmit(); + this._eventEmitter.beginDeferredEmit(); + const operations = this._validateEditOperations(rawOperations); + return this._doApplyEdits(operations, computeUndoEdits ?? false, reason ?? EditSources.applyEdits()); + } finally { + this._eventEmitter.endDeferredEmit(); + this._onDidChangeDecorations.endDeferredEmit(); + } + } + _doApplyEdits(rawOperations, computeUndoEdits, reason) { + const oldLineCount = this._buffer.getLineCount(); + const result = this._buffer.applyEdits(rawOperations, this._options.trimAutoWhitespace, computeUndoEdits); + const newLineCount = this._buffer.getLineCount(); + const contentChanges = result.changes; + this._trimAutoWhitespaceLines = result.trimAutoWhitespaceLineNumbers; + if (contentChanges.length !== 0) { + for (let i2 = 0, len = contentChanges.length; i2 < len; i2++) { + const change = contentChanges[i2]; + this._decorationsTree.acceptReplace(change.rangeOffset, change.rangeLength, change.text.length, change.forceMoveMarkers); + } + const rawContentChanges = []; + this._increaseVersionId(); + let lineCount = oldLineCount; + for (let i2 = 0, len = contentChanges.length; i2 < len; i2++) { + const change = contentChanges[i2]; + const [eolCount] = countEOL(change.text); + this._onDidChangeDecorations.fire(); + const startLineNumber = change.range.startLineNumber; + const endLineNumber = change.range.endLineNumber; + const deletingLinesCnt = endLineNumber - startLineNumber; + const insertingLinesCnt = eolCount; + const editingLinesCnt = Math.min(deletingLinesCnt, insertingLinesCnt); + const changeLineCountDelta = insertingLinesCnt - deletingLinesCnt; + const currentEditStartLineNumber = newLineCount - lineCount - changeLineCountDelta + startLineNumber; + const firstEditLineNumber = currentEditStartLineNumber; + const lastInsertedLineNumber = currentEditStartLineNumber + insertingLinesCnt; + const decorationsWithInjectedTextInEditedRange = this._decorationsTree.getInjectedTextInInterval(this, this.getOffsetAt(new Position(firstEditLineNumber, 1)), this.getOffsetAt(new Position(lastInsertedLineNumber, this.getLineMaxColumn(lastInsertedLineNumber))), 0); + const injectedTextInEditedRange = LineInjectedText.fromDecorations(decorationsWithInjectedTextInEditedRange); + const injectedTextInEditedRangeQueue = new ArrayQueue(injectedTextInEditedRange); + for (let j = editingLinesCnt; j >= 0; j--) { + const editLineNumber = startLineNumber + j; + const currentEditLineNumber = currentEditStartLineNumber + j; + injectedTextInEditedRangeQueue.takeFromEndWhile((r) => r.lineNumber > currentEditLineNumber); + const decorationsInCurrentLine = injectedTextInEditedRangeQueue.takeFromEndWhile((r) => r.lineNumber === currentEditLineNumber); + rawContentChanges.push(new ModelRawLineChanged(editLineNumber, this.getLineContent(currentEditLineNumber), decorationsInCurrentLine)); + } + if (editingLinesCnt < deletingLinesCnt) { + const spliceStartLineNumber = startLineNumber + editingLinesCnt; + rawContentChanges.push(new ModelRawLinesDeleted(spliceStartLineNumber + 1, endLineNumber)); + } + if (editingLinesCnt < insertingLinesCnt) { + const injectedTextInEditedRangeQueue2 = new ArrayQueue(injectedTextInEditedRange); + const spliceLineNumber = startLineNumber + editingLinesCnt; + const cnt = insertingLinesCnt - editingLinesCnt; + const fromLineNumber = newLineCount - lineCount - cnt + spliceLineNumber + 1; + const injectedTexts = []; + const newLines = []; + for (let i3 = 0; i3 < cnt; i3++) { + const lineNumber = fromLineNumber + i3; + newLines[i3] = this.getLineContent(lineNumber); + injectedTextInEditedRangeQueue2.takeWhile((r) => r.lineNumber < lineNumber); + injectedTexts[i3] = injectedTextInEditedRangeQueue2.takeWhile((r) => r.lineNumber === lineNumber); + } + rawContentChanges.push(new ModelRawLinesInserted(spliceLineNumber + 1, startLineNumber + insertingLinesCnt, newLines, injectedTexts)); + } + lineCount += changeLineCountDelta; + } + this._emitContentChangedEvent(new ModelRawContentChangedEvent(rawContentChanges, this.getVersionId(), this._isUndoing, this._isRedoing), { + changes: contentChanges, + eol: this._buffer.getEOL(), + isEolChange: false, + versionId: this.getVersionId(), + isUndoing: this._isUndoing, + isRedoing: this._isRedoing, + isFlush: false, + detailedReasons: [reason], + detailedReasonsChangeLengths: [contentChanges.length] + }); + } + return result.reverseEdits === null ? void 0 : result.reverseEdits; + } + undo() { + return this._undoRedoService.undo(this.uri); + } + canUndo() { + return this._undoRedoService.canUndo(this.uri); + } + redo() { + return this._undoRedoService.redo(this.uri); + } + canRedo() { + return this._undoRedoService.canRedo(this.uri); + } + //#endregion + //#region Decorations + handleBeforeFireDecorationsChangedEvent(affectedInjectedTextLines, affectedLineHeights, affectedFontLines) { + if (affectedInjectedTextLines && affectedInjectedTextLines.size > 0) { + const affectedLines = Array.from(affectedInjectedTextLines); + const lineChangeEvents = affectedLines.map((lineNumber) => new ModelRawLineChanged(lineNumber, this.getLineContent(lineNumber), this._getInjectedTextInLine(lineNumber))); + this._onDidChangeInjectedText.fire(new ModelInjectedTextChangedEvent(lineChangeEvents)); + } + if (affectedLineHeights && affectedLineHeights.size > 0) { + const affectedLines = Array.from(affectedLineHeights); + const lineHeightChangeEvent = affectedLines.map((specialLineHeightChange) => new ModelLineHeightChanged(specialLineHeightChange.ownerId, specialLineHeightChange.decorationId, specialLineHeightChange.lineNumber, specialLineHeightChange.lineHeight)); + this._onDidChangeLineHeight.fire(new ModelLineHeightChangedEvent(lineHeightChangeEvent)); + } + if (affectedFontLines && affectedFontLines.size > 0) { + const affectedLines = Array.from(affectedFontLines); + const fontChangeEvent = affectedLines.map((fontChange) => new ModelFontChanged(fontChange.ownerId, fontChange.lineNumber)); + this._onDidChangeFont.fire(new ModelFontChangedEvent(fontChangeEvent)); + } + } + changeDecorations(callback, ownerId2 = 0) { + this._assertNotDisposed(); + try { + this._onDidChangeDecorations.beginDeferredEmit(); + return this._changeDecorations(ownerId2, callback); + } finally { + this._onDidChangeDecorations.endDeferredEmit(); + } + } + _changeDecorations(ownerId2, callback) { + const changeAccessor = { + addDecoration: (range2, options2) => { + return this._deltaDecorationsImpl(ownerId2, [], [{ range: range2, options: options2 }])[0]; + }, + changeDecoration: (id, newRange) => { + this._changeDecorationImpl(ownerId2, id, newRange); + }, + changeDecorationOptions: (id, options2) => { + this._changeDecorationOptionsImpl(ownerId2, id, _normalizeOptions(options2)); + }, + removeDecoration: (id) => { + this._deltaDecorationsImpl(ownerId2, [id], []); + }, + deltaDecorations: (oldDecorations, newDecorations) => { + if (oldDecorations.length === 0 && newDecorations.length === 0) { + return []; + } + return this._deltaDecorationsImpl(ownerId2, oldDecorations, newDecorations); + } + }; + let result = null; + try { + result = callback(changeAccessor); + } catch (e) { + onUnexpectedError(e); + } + changeAccessor.addDecoration = invalidFunc2; + changeAccessor.changeDecoration = invalidFunc2; + changeAccessor.changeDecorationOptions = invalidFunc2; + changeAccessor.removeDecoration = invalidFunc2; + changeAccessor.deltaDecorations = invalidFunc2; + return result; + } + deltaDecorations(oldDecorations, newDecorations, ownerId2 = 0) { + this._assertNotDisposed(); + if (!oldDecorations) { + oldDecorations = []; + } + if (oldDecorations.length === 0 && newDecorations.length === 0) { + return []; + } + try { + this._deltaDecorationCallCnt++; + if (this._deltaDecorationCallCnt > 1) { + console.warn(`Invoking deltaDecorations recursively could lead to leaking decorations.`); + onUnexpectedError(new Error(`Invoking deltaDecorations recursively could lead to leaking decorations.`)); + } + this._onDidChangeDecorations.beginDeferredEmit(); + return this._deltaDecorationsImpl(ownerId2, oldDecorations, newDecorations); + } finally { + this._onDidChangeDecorations.endDeferredEmit(); + this._deltaDecorationCallCnt--; + } + } + _getTrackedRange(id) { + return this.getDecorationRange(id); + } + _setTrackedRange(id, newRange, newStickiness) { + const node = id ? this._decorations[id] : null; + if (!node) { + if (!newRange) { + return null; + } + return this._deltaDecorationsImpl(0, [], [{ range: newRange, options: TRACKED_RANGE_OPTIONS[newStickiness] }], true)[0]; + } + if (!newRange) { + this._decorationsTree.delete(node); + delete this._decorations[node.id]; + return null; + } + const range2 = this._validateRangeRelaxedNoAllocations(newRange); + const startOffset = this._buffer.getOffsetAt(range2.startLineNumber, range2.startColumn); + const endOffset = this._buffer.getOffsetAt(range2.endLineNumber, range2.endColumn); + this._decorationsTree.delete(node); + node.reset(this.getVersionId(), startOffset, endOffset, range2); + node.setOptions(TRACKED_RANGE_OPTIONS[newStickiness]); + this._decorationsTree.insert(node); + return node.id; + } + removeAllDecorationsWithOwnerId(ownerId2) { + if (this._isDisposed) { + return; + } + const nodes = this._decorationsTree.collectNodesFromOwner(ownerId2); + for (let i2 = 0, len = nodes.length; i2 < len; i2++) { + const node = nodes[i2]; + this._decorationsTree.delete(node); + delete this._decorations[node.id]; + } + } + getDecorationOptions(decorationId) { + const node = this._decorations[decorationId]; + if (!node) { + return null; + } + return node.options; + } + getDecorationRange(decorationId) { + const node = this._decorations[decorationId]; + if (!node) { + return null; + } + return this._decorationsTree.getNodeRange(this, node); + } + getLineDecorations(lineNumber, ownerId2 = 0, filterOutValidation = false, filterFontDecorations2 = false) { + if (lineNumber < 1 || lineNumber > this.getLineCount()) { + return []; + } + return this.getLinesDecorations(lineNumber, lineNumber, ownerId2, filterOutValidation, filterFontDecorations2); + } + getLinesDecorations(_startLineNumber, _endLineNumber, ownerId2 = 0, filterOutValidation = false, filterFontDecorations2 = false, onlyMarginDecorations = false) { + const lineCount = this.getLineCount(); + const startLineNumber = Math.min(lineCount, Math.max(1, _startLineNumber)); + const endLineNumber = Math.min(lineCount, Math.max(1, _endLineNumber)); + const endColumn = this.getLineMaxColumn(endLineNumber); + const range2 = new Range(startLineNumber, 1, endLineNumber, endColumn); + const decorations = this._getDecorationsInRange(range2, ownerId2, filterOutValidation, filterFontDecorations2, onlyMarginDecorations); + pushMany(decorations, this._decorationProvider.getDecorationsInRange(range2, ownerId2, filterOutValidation)); + return decorations; + } + getDecorationsInRange(range2, ownerId2 = 0, filterOutValidation = false, filterFontDecorations2 = false, onlyMinimapDecorations = false, onlyMarginDecorations = false) { + const validatedRange = this.validateRange(range2); + const decorations = this._getDecorationsInRange(validatedRange, ownerId2, filterOutValidation, filterFontDecorations2, onlyMarginDecorations); + pushMany(decorations, this._decorationProvider.getDecorationsInRange(validatedRange, ownerId2, filterOutValidation, onlyMinimapDecorations)); + return decorations; + } + getOverviewRulerDecorations(ownerId2 = 0, filterOutValidation = false, filterFontDecorations2 = false) { + return this._decorationsTree.getAll(this, ownerId2, filterOutValidation, filterFontDecorations2, true, false); + } + getInjectedTextDecorations(ownerId2 = 0) { + return this._decorationsTree.getAllInjectedText(this, ownerId2); + } + getCustomLineHeightsDecorations(ownerId2 = 0) { + return this._decorationsTree.getAllCustomLineHeights(this, ownerId2); + } + _getInjectedTextInLine(lineNumber) { + const startOffset = this._buffer.getOffsetAt(lineNumber, 1); + const endOffset = startOffset + this._buffer.getLineLength(lineNumber); + const result = this._decorationsTree.getInjectedTextInInterval(this, startOffset, endOffset, 0); + return LineInjectedText.fromDecorations(result).filter((t) => t.lineNumber === lineNumber); + } + getFontDecorationsInRange(range2, ownerId2 = 0) { + const startOffset = this._buffer.getOffsetAt(range2.startLineNumber, range2.startColumn); + const endOffset = this._buffer.getOffsetAt(range2.endLineNumber, range2.endColumn); + return this._decorationsTree.getFontDecorationsInInterval(this, startOffset, endOffset, ownerId2); + } + getAllDecorations(ownerId2 = 0, filterOutValidation = false, filterFontDecorations2 = false) { + let result = this._decorationsTree.getAll(this, ownerId2, filterOutValidation, filterFontDecorations2, false, false); + result = result.concat(this._decorationProvider.getAllDecorations(ownerId2, filterOutValidation)); + return result; + } + getAllMarginDecorations(ownerId2 = 0) { + return this._decorationsTree.getAll(this, ownerId2, false, false, false, true); + } + _getDecorationsInRange(filterRange, filterOwnerId, filterOutValidation, filterFontDecorations2, onlyMarginDecorations) { + const startOffset = this._buffer.getOffsetAt(filterRange.startLineNumber, filterRange.startColumn); + const endOffset = this._buffer.getOffsetAt(filterRange.endLineNumber, filterRange.endColumn); + return this._decorationsTree.getAllInInterval(this, startOffset, endOffset, filterOwnerId, filterOutValidation, filterFontDecorations2, onlyMarginDecorations); + } + getRangeAt(start, end) { + return this._buffer.getRangeAt(start, end - start); + } + _changeDecorationImpl(ownerId2, decorationId, _range) { + const node = this._decorations[decorationId]; + if (!node) { + return; + } + if (node.options.after) { + const oldRange = this.getDecorationRange(decorationId); + this._onDidChangeDecorations.recordLineAffectedByInjectedText(oldRange.endLineNumber); + } + if (node.options.before) { + const oldRange = this.getDecorationRange(decorationId); + this._onDidChangeDecorations.recordLineAffectedByInjectedText(oldRange.startLineNumber); + } + if (node.options.lineHeight !== null) { + const oldRange = this.getDecorationRange(decorationId); + this._onDidChangeDecorations.recordLineAffectedByLineHeightChange(ownerId2, decorationId, oldRange.startLineNumber, null); + } + if (node.options.affectsFont) { + const oldRange = this.getDecorationRange(decorationId); + this._onDidChangeDecorations.recordLineAffectedByFontChange(ownerId2, node.id, oldRange.startLineNumber); + } + const range2 = this._validateRangeRelaxedNoAllocations(_range); + const startOffset = this._buffer.getOffsetAt(range2.startLineNumber, range2.startColumn); + const endOffset = this._buffer.getOffsetAt(range2.endLineNumber, range2.endColumn); + this._decorationsTree.delete(node); + node.reset(this.getVersionId(), startOffset, endOffset, range2); + this._decorationsTree.insert(node); + this._onDidChangeDecorations.checkAffectedAndFire(node.options); + if (node.options.after) { + this._onDidChangeDecorations.recordLineAffectedByInjectedText(range2.endLineNumber); + } + if (node.options.before) { + this._onDidChangeDecorations.recordLineAffectedByInjectedText(range2.startLineNumber); + } + if (node.options.lineHeight !== null) { + this._onDidChangeDecorations.recordLineAffectedByLineHeightChange(ownerId2, decorationId, range2.startLineNumber, node.options.lineHeight); + } + if (node.options.affectsFont) { + this._onDidChangeDecorations.recordLineAffectedByFontChange(ownerId2, node.id, range2.startLineNumber); + } + } + _changeDecorationOptionsImpl(ownerId2, decorationId, options2) { + const node = this._decorations[decorationId]; + if (!node) { + return; + } + const nodeWasInOverviewRuler = node.options.overviewRuler && node.options.overviewRuler.color ? true : false; + const nodeIsInOverviewRuler = options2.overviewRuler && options2.overviewRuler.color ? true : false; + this._onDidChangeDecorations.checkAffectedAndFire(node.options); + this._onDidChangeDecorations.checkAffectedAndFire(options2); + if (node.options.after || options2.after) { + const nodeRange = this._decorationsTree.getNodeRange(this, node); + this._onDidChangeDecorations.recordLineAffectedByInjectedText(nodeRange.endLineNumber); + } + if (node.options.before || options2.before) { + const nodeRange = this._decorationsTree.getNodeRange(this, node); + this._onDidChangeDecorations.recordLineAffectedByInjectedText(nodeRange.startLineNumber); + } + if (node.options.lineHeight !== null || options2.lineHeight !== null) { + const nodeRange = this._decorationsTree.getNodeRange(this, node); + this._onDidChangeDecorations.recordLineAffectedByLineHeightChange(ownerId2, decorationId, nodeRange.startLineNumber, options2.lineHeight); + } + if (node.options.affectsFont || options2.affectsFont) { + const nodeRange = this._decorationsTree.getNodeRange(this, node); + this._onDidChangeDecorations.recordLineAffectedByFontChange(ownerId2, decorationId, nodeRange.startLineNumber); + } + const movedInOverviewRuler = nodeWasInOverviewRuler !== nodeIsInOverviewRuler; + const changedWhetherInjectedText = isOptionsInjectedText(options2) !== isNodeInjectedText(node); + if (movedInOverviewRuler || changedWhetherInjectedText) { + this._decorationsTree.delete(node); + node.setOptions(options2); + this._decorationsTree.insert(node); + } else { + node.setOptions(options2); + } + } + _deltaDecorationsImpl(ownerId2, oldDecorationsIds, newDecorations, suppressEvents = false) { + const versionId = this.getVersionId(); + const oldDecorationsLen = oldDecorationsIds.length; + let oldDecorationIndex = 0; + const newDecorationsLen = newDecorations.length; + let newDecorationIndex = 0; + this._onDidChangeDecorations.beginDeferredEmit(); + try { + const result = new Array(newDecorationsLen); + while (oldDecorationIndex < oldDecorationsLen || newDecorationIndex < newDecorationsLen) { + let node = null; + if (oldDecorationIndex < oldDecorationsLen) { + let decorationId; + do { + decorationId = oldDecorationsIds[oldDecorationIndex++]; + node = this._decorations[decorationId]; + } while (!node && oldDecorationIndex < oldDecorationsLen); + if (node) { + if (node.options.after) { + const nodeRange = this._decorationsTree.getNodeRange(this, node); + this._onDidChangeDecorations.recordLineAffectedByInjectedText(nodeRange.endLineNumber); + } + if (node.options.before) { + const nodeRange = this._decorationsTree.getNodeRange(this, node); + this._onDidChangeDecorations.recordLineAffectedByInjectedText(nodeRange.startLineNumber); + } + if (node.options.lineHeight !== null) { + const nodeRange = this._decorationsTree.getNodeRange(this, node); + this._onDidChangeDecorations.recordLineAffectedByLineHeightChange(ownerId2, decorationId, nodeRange.startLineNumber, null); + } + if (node.options.affectsFont) { + const nodeRange = this._decorationsTree.getNodeRange(this, node); + this._onDidChangeDecorations.recordLineAffectedByFontChange(ownerId2, decorationId, nodeRange.startLineNumber); + } + this._decorationsTree.delete(node); + if (!suppressEvents) { + this._onDidChangeDecorations.checkAffectedAndFire(node.options); + } + } + } + if (newDecorationIndex < newDecorationsLen) { + if (!node) { + const internalDecorationId = ++this._lastDecorationId; + const decorationId = `${this._instanceId};${internalDecorationId}`; + node = new IntervalNode(decorationId, 0, 0); + this._decorations[decorationId] = node; + } + const newDecoration = newDecorations[newDecorationIndex]; + const range2 = this._validateRangeRelaxedNoAllocations(newDecoration.range); + const options2 = _normalizeOptions(newDecoration.options); + const startOffset = this._buffer.getOffsetAt(range2.startLineNumber, range2.startColumn); + const endOffset = this._buffer.getOffsetAt(range2.endLineNumber, range2.endColumn); + node.ownerId = ownerId2; + node.reset(versionId, startOffset, endOffset, range2); + node.setOptions(options2); + if (node.options.after) { + this._onDidChangeDecorations.recordLineAffectedByInjectedText(range2.endLineNumber); + } + if (node.options.before) { + this._onDidChangeDecorations.recordLineAffectedByInjectedText(range2.startLineNumber); + } + if (node.options.lineHeight !== null) { + this._onDidChangeDecorations.recordLineAffectedByLineHeightChange(ownerId2, node.id, range2.startLineNumber, node.options.lineHeight); + } + if (node.options.affectsFont) { + this._onDidChangeDecorations.recordLineAffectedByFontChange(ownerId2, node.id, range2.startLineNumber); + } + if (!suppressEvents) { + this._onDidChangeDecorations.checkAffectedAndFire(options2); + } + this._decorationsTree.insert(node); + result[newDecorationIndex] = node.id; + newDecorationIndex++; + } else { + if (node) { + delete this._decorations[node.id]; + } + } + } + return result; + } finally { + this._onDidChangeDecorations.endDeferredEmit(); + } + } + //#endregion + //#region Tokenization + // TODO move them to the tokenization part. + getLanguageId() { + return this.tokenization.getLanguageId(); + } + setLanguage(languageIdOrSelection, source) { + if (typeof languageIdOrSelection === "string") { + this._languageSelectionListener.clear(); + this._setLanguage(languageIdOrSelection, source); + } else { + this._languageSelectionListener.value = languageIdOrSelection.onDidChange(() => this._setLanguage(languageIdOrSelection.languageId, source)); + this._setLanguage(languageIdOrSelection.languageId, source); + } + } + _setLanguage(languageId, source) { + this.tokenization.setLanguageId(languageId, source); + this._languageService.requestRichLanguageFeatures(languageId); + } + getLanguageIdAtPosition(lineNumber, column) { + return this.tokenization.getLanguageIdAtPosition(lineNumber, column); + } + getWordAtPosition(position) { + return this._tokenizationTextModelPart.getWordAtPosition(position); + } + getWordUntilPosition(position) { + return this._tokenizationTextModelPart.getWordUntilPosition(position); + } + //#endregion + normalizePosition(position, affinity) { + return position; + } + /** + * Gets the column at which indentation stops at a given line. + * @internal + */ + getLineIndentColumn(lineNumber) { + return indentOfLine(this.getLineContent(lineNumber)) + 1; + } + toString() { + return `TextModel(${this.uri.toString()})`; + } + }; + TextModel = TextModel_1 = __decorate25([ + __param23(4, IUndoRedoService), + __param23(5, ILanguageService), + __param23(6, ILanguageConfigurationService), + __param23(7, IInstantiationService) + ], TextModel); + DecorationsTrees = class { + constructor() { + this._decorationsTree0 = new IntervalTree(); + this._decorationsTree1 = new IntervalTree(); + this._injectedTextDecorationsTree = new IntervalTree(); + } + ensureAllNodesHaveRanges(host) { + this.getAll(host, 0, false, false, false, false); + } + _ensureNodesHaveRanges(host, nodes) { + for (const node of nodes) { + if (node.range === null) { + node.range = host.getRangeAt(node.cachedAbsoluteStart, node.cachedAbsoluteEnd); + } + } + return nodes; + } + getAllInInterval(host, start, end, filterOwnerId, filterOutValidation, filterFontDecorations2, onlyMarginDecorations) { + const versionId = host.getVersionId(); + const result = this._intervalSearch(start, end, filterOwnerId, filterOutValidation, filterFontDecorations2, versionId, onlyMarginDecorations); + return this._ensureNodesHaveRanges(host, result); + } + _intervalSearch(start, end, filterOwnerId, filterOutValidation, filterFontDecorations2, cachedVersionId, onlyMarginDecorations) { + const r0 = this._decorationsTree0.intervalSearch(start, end, filterOwnerId, filterOutValidation, filterFontDecorations2, cachedVersionId, onlyMarginDecorations); + const r1 = this._decorationsTree1.intervalSearch(start, end, filterOwnerId, filterOutValidation, filterFontDecorations2, cachedVersionId, onlyMarginDecorations); + const r2 = this._injectedTextDecorationsTree.intervalSearch(start, end, filterOwnerId, filterOutValidation, filterFontDecorations2, cachedVersionId, onlyMarginDecorations); + return r0.concat(r1).concat(r2); + } + getInjectedTextInInterval(host, start, end, filterOwnerId) { + const versionId = host.getVersionId(); + const result = this._injectedTextDecorationsTree.intervalSearch(start, end, filterOwnerId, false, false, versionId, false); + return this._ensureNodesHaveRanges(host, result).filter((i2) => i2.options.showIfCollapsed || !i2.range.isEmpty()); + } + getFontDecorationsInInterval(host, start, end, filterOwnerId) { + const versionId = host.getVersionId(); + const decorations = this._decorationsTree0.intervalSearch(start, end, filterOwnerId, false, false, versionId, false); + return this._ensureNodesHaveRanges(host, decorations).filter((i2) => i2.options.affectsFont); + } + getAllInjectedText(host, filterOwnerId) { + const versionId = host.getVersionId(); + const result = this._injectedTextDecorationsTree.search(filterOwnerId, false, false, versionId, false); + return this._ensureNodesHaveRanges(host, result).filter((i2) => i2.options.showIfCollapsed || !i2.range.isEmpty()); + } + getAllCustomLineHeights(host, filterOwnerId) { + const versionId = host.getVersionId(); + const result = this._search(filterOwnerId, false, false, false, versionId, false); + return this._ensureNodesHaveRanges(host, result).filter((i2) => typeof i2.options.lineHeight === "number"); + } + getAll(host, filterOwnerId, filterOutValidation, filterFontDecorations2, overviewRulerOnly, onlyMarginDecorations) { + const versionId = host.getVersionId(); + const result = this._search(filterOwnerId, filterOutValidation, filterFontDecorations2, overviewRulerOnly, versionId, onlyMarginDecorations); + return this._ensureNodesHaveRanges(host, result); + } + _search(filterOwnerId, filterOutValidation, filterFontDecorations2, overviewRulerOnly, cachedVersionId, onlyMarginDecorations) { + if (overviewRulerOnly) { + return this._decorationsTree1.search(filterOwnerId, filterOutValidation, filterFontDecorations2, cachedVersionId, onlyMarginDecorations); + } else { + const r0 = this._decorationsTree0.search(filterOwnerId, filterOutValidation, filterFontDecorations2, cachedVersionId, onlyMarginDecorations); + const r1 = this._decorationsTree1.search(filterOwnerId, filterOutValidation, filterFontDecorations2, cachedVersionId, onlyMarginDecorations); + const r2 = this._injectedTextDecorationsTree.search(filterOwnerId, filterOutValidation, filterFontDecorations2, cachedVersionId, onlyMarginDecorations); + return r0.concat(r1).concat(r2); + } + } + collectNodesFromOwner(ownerId2) { + const r0 = this._decorationsTree0.collectNodesFromOwner(ownerId2); + const r1 = this._decorationsTree1.collectNodesFromOwner(ownerId2); + const r2 = this._injectedTextDecorationsTree.collectNodesFromOwner(ownerId2); + return r0.concat(r1).concat(r2); + } + collectNodesPostOrder() { + const r0 = this._decorationsTree0.collectNodesPostOrder(); + const r1 = this._decorationsTree1.collectNodesPostOrder(); + const r2 = this._injectedTextDecorationsTree.collectNodesPostOrder(); + return r0.concat(r1).concat(r2); + } + insert(node) { + if (isNodeInjectedText(node)) { + this._injectedTextDecorationsTree.insert(node); + } else if (isNodeInOverviewRuler(node)) { + this._decorationsTree1.insert(node); + } else { + this._decorationsTree0.insert(node); + } + } + delete(node) { + if (isNodeInjectedText(node)) { + this._injectedTextDecorationsTree.delete(node); + } else if (isNodeInOverviewRuler(node)) { + this._decorationsTree1.delete(node); + } else { + this._decorationsTree0.delete(node); + } + } + getNodeRange(host, node) { + const versionId = host.getVersionId(); + if (node.cachedVersionId !== versionId) { + this._resolveNode(node, versionId); + } + if (node.range === null) { + node.range = host.getRangeAt(node.cachedAbsoluteStart, node.cachedAbsoluteEnd); + } + return node.range; + } + _resolveNode(node, cachedVersionId) { + if (isNodeInjectedText(node)) { + this._injectedTextDecorationsTree.resolveNode(node, cachedVersionId); + } else if (isNodeInOverviewRuler(node)) { + this._decorationsTree1.resolveNode(node, cachedVersionId); + } else { + this._decorationsTree0.resolveNode(node, cachedVersionId); + } + } + acceptReplace(offset, length, textLength, forceMoveMarkers) { + this._decorationsTree0.acceptReplace(offset, length, textLength, forceMoveMarkers); + this._decorationsTree1.acceptReplace(offset, length, textLength, forceMoveMarkers); + this._injectedTextDecorationsTree.acceptReplace(offset, length, textLength, forceMoveMarkers); + } + }; + DecorationOptions = class { + constructor(options2) { + this.color = options2.color || ""; + this.darkColor = options2.darkColor || ""; + } + }; + ModelDecorationOverviewRulerOptions = class extends DecorationOptions { + constructor(options2) { + super(options2); + this._resolvedColor = null; + this.position = typeof options2.position === "number" ? options2.position : OverviewRulerLane.Center; + } + getColor(theme) { + if (!this._resolvedColor) { + if (isDark(theme.type) && this.darkColor) { + this._resolvedColor = this._resolveColor(this.darkColor, theme); + } else { + this._resolvedColor = this._resolveColor(this.color, theme); + } + } + return this._resolvedColor; + } + invalidateCachedColor() { + this._resolvedColor = null; + } + _resolveColor(color, theme) { + if (typeof color === "string") { + return color; + } + const c = color ? theme.getColor(color.id) : null; + if (!c) { + return ""; + } + return c.toString(); + } + }; + ModelDecorationGlyphMarginOptions = class { + constructor(options2) { + this.position = options2?.position ?? GlyphMarginLane.Center; + this.persistLane = options2?.persistLane; + } + }; + ModelDecorationMinimapOptions = class extends DecorationOptions { + constructor(options2) { + super(options2); + this.position = options2.position; + this.sectionHeaderStyle = options2.sectionHeaderStyle ?? null; + this.sectionHeaderText = options2.sectionHeaderText ?? null; + } + getColor(theme) { + if (!this._resolvedColor) { + if (isDark(theme.type) && this.darkColor) { + this._resolvedColor = this._resolveColor(this.darkColor, theme); + } else { + this._resolvedColor = this._resolveColor(this.color, theme); + } + } + return this._resolvedColor; + } + invalidateCachedColor() { + this._resolvedColor = void 0; + } + _resolveColor(color, theme) { + if (typeof color === "string") { + return Color.fromHex(color); + } + return theme.getColor(color.id); + } + }; + ModelDecorationInjectedTextOptions = class _ModelDecorationInjectedTextOptions { + static from(options2) { + if (options2 instanceof _ModelDecorationInjectedTextOptions) { + return options2; + } + return new _ModelDecorationInjectedTextOptions(options2); + } + constructor(options2) { + this.content = options2.content || ""; + this.tokens = options2.tokens ?? null; + this.inlineClassName = options2.inlineClassName || null; + this.inlineClassNameAffectsLetterSpacing = options2.inlineClassNameAffectsLetterSpacing || false; + this.attachedData = options2.attachedData || null; + this.cursorStops = options2.cursorStops || null; + } + }; + ModelDecorationOptions = class _ModelDecorationOptions { + static register(options2) { + return new _ModelDecorationOptions(options2); + } + static createDynamic(options2) { + return new _ModelDecorationOptions(options2); + } + constructor(options2) { + this.description = options2.description; + this.blockClassName = options2.blockClassName ? cleanClassName(options2.blockClassName) : null; + this.blockDoesNotCollapse = options2.blockDoesNotCollapse ?? null; + this.blockIsAfterEnd = options2.blockIsAfterEnd ?? null; + this.blockPadding = options2.blockPadding ?? null; + this.stickiness = options2.stickiness || 0; + this.zIndex = options2.zIndex || 0; + this.className = options2.className ? cleanClassName(options2.className) : null; + this.shouldFillLineOnLineBreak = options2.shouldFillLineOnLineBreak ?? null; + this.hoverMessage = options2.hoverMessage || null; + this.glyphMarginHoverMessage = options2.glyphMarginHoverMessage || null; + this.lineNumberHoverMessage = options2.lineNumberHoverMessage || null; + this.isWholeLine = options2.isWholeLine || false; + this.lineHeight = options2.lineHeight ? Math.min(options2.lineHeight, LINE_HEIGHT_CEILING) : null; + this.fontSize = options2.fontSize || null; + this.affectsFont = !!options2.fontSize || !!options2.fontFamily || !!options2.fontWeight || !!options2.fontStyle; + this.showIfCollapsed = options2.showIfCollapsed || false; + this.collapseOnReplaceEdit = options2.collapseOnReplaceEdit || false; + this.overviewRuler = options2.overviewRuler ? new ModelDecorationOverviewRulerOptions(options2.overviewRuler) : null; + this.minimap = options2.minimap ? new ModelDecorationMinimapOptions(options2.minimap) : null; + this.glyphMargin = options2.glyphMarginClassName ? new ModelDecorationGlyphMarginOptions(options2.glyphMargin) : null; + this.glyphMarginClassName = options2.glyphMarginClassName ? cleanClassName(options2.glyphMarginClassName) : null; + this.linesDecorationsClassName = options2.linesDecorationsClassName ? cleanClassName(options2.linesDecorationsClassName) : null; + this.lineNumberClassName = options2.lineNumberClassName ? cleanClassName(options2.lineNumberClassName) : null; + this.linesDecorationsTooltip = options2.linesDecorationsTooltip ? htmlAttributeEncodeValue(options2.linesDecorationsTooltip) : null; + this.firstLineDecorationClassName = options2.firstLineDecorationClassName ? cleanClassName(options2.firstLineDecorationClassName) : null; + this.marginClassName = options2.marginClassName ? cleanClassName(options2.marginClassName) : null; + this.inlineClassName = options2.inlineClassName ? cleanClassName(options2.inlineClassName) : null; + this.inlineClassNameAffectsLetterSpacing = options2.inlineClassNameAffectsLetterSpacing || false; + this.beforeContentClassName = options2.beforeContentClassName ? cleanClassName(options2.beforeContentClassName) : null; + this.afterContentClassName = options2.afterContentClassName ? cleanClassName(options2.afterContentClassName) : null; + this.after = options2.after ? ModelDecorationInjectedTextOptions.from(options2.after) : null; + this.before = options2.before ? ModelDecorationInjectedTextOptions.from(options2.before) : null; + this.hideInCommentTokens = options2.hideInCommentTokens ?? false; + this.hideInStringTokens = options2.hideInStringTokens ?? false; + this.textDirection = options2.textDirection ?? null; + } + }; + ModelDecorationOptions.EMPTY = ModelDecorationOptions.register({ description: "empty" }); + TRACKED_RANGE_OPTIONS = [ + ModelDecorationOptions.register({ + description: "tracked-range-always-grows-when-typing-at-edges", + stickiness: 0 + /* model.TrackedRangeStickiness.AlwaysGrowsWhenTypingAtEdges */ + }), + ModelDecorationOptions.register({ + description: "tracked-range-never-grows-when-typing-at-edges", + stickiness: 1 + /* model.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges */ + }), + ModelDecorationOptions.register({ + description: "tracked-range-grows-only-when-typing-before", + stickiness: 2 + /* model.TrackedRangeStickiness.GrowsOnlyWhenTypingBefore */ + }), + ModelDecorationOptions.register({ + description: "tracked-range-grows-only-when-typing-after", + stickiness: 3 + /* model.TrackedRangeStickiness.GrowsOnlyWhenTypingAfter */ + }) + ]; + LineHeightChangingDecoration = class { + static toKey(obj) { + return `${obj.ownerId};${obj.decorationId};${obj.lineNumber}`; + } + constructor(ownerId2, decorationId, lineNumber, lineHeight) { + this.ownerId = ownerId2; + this.decorationId = decorationId; + this.lineNumber = lineNumber; + this.lineHeight = lineHeight; + } + }; + LineFontChangingDecoration = class { + static toKey(obj) { + return `${obj.ownerId};${obj.decorationId};${obj.lineNumber}`; + } + constructor(ownerId2, decorationId, lineNumber) { + this.ownerId = ownerId2; + this.decorationId = decorationId; + this.lineNumber = lineNumber; + } + }; + DidChangeDecorationsEmitter = class extends Disposable { + constructor(handleBeforeFire) { + super(); + this.handleBeforeFire = handleBeforeFire; + this._actual = this._register(new Emitter()); + this.event = this._actual.event; + this._affectedInjectedTextLines = null; + this._affectedLineHeights = null; + this._affectedFontLines = null; + this._deferredCnt = 0; + this._shouldFireDeferred = false; + this._affectsMinimap = false; + this._affectsOverviewRuler = false; + this._affectsGlyphMargin = false; + this._affectsLineNumber = false; + } + beginDeferredEmit() { + this._deferredCnt++; + } + endDeferredEmit() { + this._deferredCnt--; + if (this._deferredCnt === 0) { + if (this._shouldFireDeferred) { + this.doFire(); + } + this._affectedInjectedTextLines?.clear(); + this._affectedInjectedTextLines = null; + this._affectedLineHeights?.clear(); + this._affectedLineHeights = null; + this._affectedFontLines?.clear(); + this._affectedFontLines = null; + } + } + recordLineAffectedByInjectedText(lineNumber) { + if (!this._affectedInjectedTextLines) { + this._affectedInjectedTextLines = /* @__PURE__ */ new Set(); + } + this._affectedInjectedTextLines.add(lineNumber); + } + recordLineAffectedByLineHeightChange(ownerId2, decorationId, lineNumber, lineHeight) { + if (!this._affectedLineHeights) { + this._affectedLineHeights = new SetWithKey([], LineHeightChangingDecoration.toKey); + } + this._affectedLineHeights.add(new LineHeightChangingDecoration(ownerId2, decorationId, lineNumber, lineHeight)); + } + recordLineAffectedByFontChange(ownerId2, decorationId, lineNumber) { + if (!this._affectedFontLines) { + this._affectedFontLines = new SetWithKey([], LineFontChangingDecoration.toKey); + } + this._affectedFontLines.add(new LineFontChangingDecoration(ownerId2, decorationId, lineNumber)); + } + checkAffectedAndFire(options2) { + this._affectsMinimap ||= !!options2.minimap?.position; + this._affectsOverviewRuler ||= !!options2.overviewRuler?.color; + this._affectsGlyphMargin ||= !!options2.glyphMarginClassName; + this._affectsLineNumber ||= !!options2.lineNumberClassName; + this.tryFire(); + } + fire() { + this._affectsMinimap = true; + this._affectsOverviewRuler = true; + this._affectsGlyphMargin = true; + this.tryFire(); + } + tryFire() { + if (this._deferredCnt === 0) { + this.doFire(); + } else { + this._shouldFireDeferred = true; + } + } + doFire() { + this.handleBeforeFire(this._affectedInjectedTextLines, this._affectedLineHeights, this._affectedFontLines); + const event = { + affectsMinimap: this._affectsMinimap, + affectsOverviewRuler: this._affectsOverviewRuler, + affectsGlyphMargin: this._affectsGlyphMargin, + affectsLineNumber: this._affectsLineNumber + }; + this._shouldFireDeferred = false; + this._affectsMinimap = false; + this._affectsOverviewRuler = false; + this._affectsGlyphMargin = false; + this._actual.fire(event); + } + }; + DidChangeContentEmitter = class extends Disposable { + constructor() { + super(); + this._fastEmitter = this._register(new Emitter()); + this.fastEvent = this._fastEmitter.event; + this._slowEmitter = this._register(new Emitter()); + this.slowEvent = this._slowEmitter.event; + this._deferredCnt = 0; + this._deferredEvent = null; + } + beginDeferredEmit() { + this._deferredCnt++; + } + endDeferredEmit(resultingSelection = null) { + this._deferredCnt--; + if (this._deferredCnt === 0) { + if (this._deferredEvent !== null) { + this._deferredEvent.rawContentChangedEvent.resultingSelection = resultingSelection; + const e = this._deferredEvent; + this._deferredEvent = null; + this._fastEmitter.fire(e); + this._slowEmitter.fire(e); + } + } + } + fire(e) { + if (this._deferredCnt > 0) { + if (this._deferredEvent) { + this._deferredEvent = this._deferredEvent.merge(e); + } else { + this._deferredEvent = e; + } + return; + } + this._fastEmitter.fire(e); + this._slowEmitter.fire(e); + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/common/services/languageFeatures.js +var ILanguageFeaturesService; +var init_languageFeatures = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/common/services/languageFeatures.js"() { + init_instantiation(); + ILanguageFeaturesService = createDecorator("ILanguageFeaturesService"); + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/common/naturalLanguage/korean.js +function getKoreanAltChars(code) { + const result = disassembleKorean(code); + if (result && result.length > 0) { + return new Uint32Array(result); + } + return void 0; +} +function disassembleKorean(code) { + codeBufferLength = 0; + getCodesFromArray( + code, + modernConsonants, + 4352 + /* HangulRangeStartCode.InitialConsonant */ + ); + if (codeBufferLength > 0) { + return codeBuffer.subarray(0, codeBufferLength); + } + getCodesFromArray( + code, + modernVowels, + 4449 + /* HangulRangeStartCode.Vowel */ + ); + if (codeBufferLength > 0) { + return codeBuffer.subarray(0, codeBufferLength); + } + getCodesFromArray( + code, + modernFinalConsonants, + 4520 + /* HangulRangeStartCode.FinalConsonant */ + ); + if (codeBufferLength > 0) { + return codeBuffer.subarray(0, codeBufferLength); + } + getCodesFromArray( + code, + compatibilityJamo, + 12593 + /* HangulRangeStartCode.CompatibilityJamo */ + ); + if (codeBufferLength) { + return codeBuffer.subarray(0, codeBufferLength); + } + if (code >= 44032 && code <= 55203) { + const hangulIndex = code - 44032; + const vowelAndFinalConsonantProduct = hangulIndex % 588; + const initialConsonantIndex = Math.floor(hangulIndex / 588); + const vowelIndex = Math.floor(vowelAndFinalConsonantProduct / 28); + const finalConsonantIndex = vowelAndFinalConsonantProduct % 28 - 1; + if (initialConsonantIndex < modernConsonants.length) { + getCodesFromArray(initialConsonantIndex, modernConsonants, 0); + } else if (4352 + initialConsonantIndex - 12593 < compatibilityJamo.length) { + getCodesFromArray( + 4352 + initialConsonantIndex, + compatibilityJamo, + 12593 + /* HangulRangeStartCode.CompatibilityJamo */ + ); + } + if (vowelIndex < modernVowels.length) { + getCodesFromArray(vowelIndex, modernVowels, 0); + } else if (4449 + vowelIndex - 12593 < compatibilityJamo.length) { + getCodesFromArray( + 4449 + vowelIndex - 12593, + compatibilityJamo, + 12593 + /* HangulRangeStartCode.CompatibilityJamo */ + ); + } + if (finalConsonantIndex >= 0) { + if (finalConsonantIndex < modernFinalConsonants.length) { + getCodesFromArray(finalConsonantIndex, modernFinalConsonants, 0); + } else if (4520 + finalConsonantIndex - 12593 < compatibilityJamo.length) { + getCodesFromArray( + 4520 + finalConsonantIndex - 12593, + compatibilityJamo, + 12593 + /* HangulRangeStartCode.CompatibilityJamo */ + ); + } + } + if (codeBufferLength > 0) { + return codeBuffer.subarray(0, codeBufferLength); + } + } + return void 0; +} +function getCodesFromArray(code, array2, arrayStartIndex) { + if (code >= arrayStartIndex && code < arrayStartIndex + array2.length) { + addCodesToBuffer(array2[code - arrayStartIndex]); + } +} +function addCodesToBuffer(codes) { + if (codes === 0) { + return; + } + codeBuffer[codeBufferLength++] = codes & 255; + if (codes >> 8) { + codeBuffer[codeBufferLength++] = codes >> 8 & 255; + } + if (codes >> 16) { + codeBuffer[codeBufferLength++] = codes >> 16 & 255; + } +} +var codeBufferLength, codeBuffer, modernConsonants, modernVowels, modernFinalConsonants, compatibilityJamo; +var init_korean = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/common/naturalLanguage/korean.js"() { + codeBufferLength = 0; + codeBuffer = new Uint32Array(10); + modernConsonants = new Uint8Array([ + 114, + // ㄱ + 82, + // ㄲ + 115, + // ㄴ + 101, + // ㄷ + 69, + // ㄸ + 102, + // ㄹ + 97, + // ㅁ + 113, + // ㅂ + 81, + // ㅃ + 116, + // ㅅ + 84, + // ㅆ + 100, + // ㅇ + 119, + // ㅈ + 87, + // ㅉ + 99, + // ㅊ + 122, + // ㅋ + 120, + // ㅌ + 118, + // ㅍ + 103 + // ㅎ + ]); + modernVowels = new Uint16Array([ + 107, + // -> ㅏ + 111, + // -> ㅐ + 105, + // -> ㅑ + 79, + // -> ㅒ + 106, + // -> ㅓ + 112, + // -> ㅔ + 117, + // -> ㅕ + 80, + // -> ㅖ + 104, + // -> ㅗ + 27496, + // -> ㅘ + 28520, + // -> ㅙ + 27752, + // -> ㅚ + 121, + // -> ㅛ + 110, + // -> ㅜ + 27246, + // -> ㅝ + 28782, + // -> ㅞ + 27758, + // -> ㅟ + 98, + // -> ㅠ + 109, + // -> ㅡ + 27757, + // -> ㅢ + 108 + // -> ㅣ + ]); + modernFinalConsonants = new Uint16Array([ + 114, + // ㄱ + 82, + // ㄲ + 29810, + // ㄳ + 115, + // ㄴ + 30579, + // ㄵ + 26483, + // ㄶ + 101, + // ㄷ + 102, + // ㄹ + 29286, + // ㄺ + 24934, + // ㄻ + 29030, + // ㄼ + 29798, + // ㄽ + 30822, + // ㄾ + 30310, + // ㄿ + 26470, + // ㅀ + 97, + // ㅁ + 113, + // ㅂ + 29809, + // ㅄ + 116, + // ㅅ + 84, + // ㅆ + 100, + // ㅇ + 119, + // ㅈ + 99, + // ㅊ + 122, + // ㅋ + 120, + // ㅌ + 118, + // ㅍ + 103 + // ㅎ + ]); + compatibilityJamo = new Uint16Array([ + 114, + // ㄱ + 82, + // ㄲ + 29810, + // ㄳ + 115, + // ㄴ + 30579, + // ㄵ + 26483, + // ㄶ + 101, + // ㄷ + 69, + // ㄸ + 102, + // ㄹ + 29286, + // ㄺ + 24934, + // ㄻ + 29030, + // ㄼ + 29798, + // ㄽ + 30822, + // ㄾ + 30310, + // ㄿ + 26470, + // ㅀ + 97, + // ㅁ + 113, + // ㅂ + 81, + // ㅃ + 29809, + // ㅄ + 116, + // ㅅ + 84, + // ㅆ + 100, + // ㅇ + 119, + // ㅈ + 87, + // ㅉ + 99, + // ㅊ + 122, + // ㅋ + 120, + // ㅌ + 118, + // ㅍ + 103, + // ㅎ + 107, + // ㅏ + 111, + // ㅐ + 105, + // ㅑ + 79, + // ㅒ + 106, + // ㅓ + 112, + // ㅔ + 117, + // ㅕ + 80, + // ㅖ + 104, + // ㅗ + 27496, + // ㅘ + 28520, + // ㅙ + 27752, + // ㅚ + 121, + // ㅛ + 110, + // ㅜ + 27246, + // ㅝ + 28782, + // ㅞ + 27758, + // ㅟ + 98, + // ㅠ + 109, + // ㅡ + 27757, + // ㅢ + 108 + // ㅣ + // HF: Hangul Filler (everything after this is archaic) + // ㅥ + // ㅦ + // ㅧ + // ㅨ + // ㅩ + // ㅪ + // ㅫ + // ㅬ + // ㅮ + // ㅯ + // ㅰ + // ㅱ + // ㅲ + // ㅳ + // ㅴ + // ㅵ + // ㅶ + // ㅷ + // ㅸ + // ㅹ + // ㅺ + // ㅻ + // ㅼ + // ㅽ + // ㅾ + // ㅿ + // ㆀ + // ㆁ + // ㆂ + // ㆃ + // ㆄ + // ㆅ + // ㆆ + // ㆇ + // ㆈ + // ㆉ + // ㆊ + // ㆋ + // ㆌ + // ㆍ + // ㆎ + ]); + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/common/filters.js +function or(...filter) { + return function(word, wordToMatchAgainst) { + for (let i2 = 0, len = filter.length; i2 < len; i2++) { + const match2 = filter[i2](word, wordToMatchAgainst); + if (match2) { + return match2; + } + } + return null; + }; +} +function _matchesPrefix(ignoreCase, word, wordToMatchAgainst) { + if (!wordToMatchAgainst || wordToMatchAgainst.length < word.length) { + return null; + } + let matches; + if (ignoreCase) { + matches = startsWithIgnoreCase(wordToMatchAgainst, word); + } else { + matches = wordToMatchAgainst.indexOf(word) === 0; + } + if (!matches) { + return null; + } + return word.length > 0 ? [{ start: 0, end: word.length }] : []; +} +function matchesContiguousSubString(word, wordToMatchAgainst) { + const index = wordToMatchAgainst.toLowerCase().indexOf(word.toLowerCase()); + if (index === -1) { + return null; + } + return [{ start: index, end: index + word.length }]; +} +function matchesSubString(word, wordToMatchAgainst) { + return _matchesSubString(word.toLowerCase(), wordToMatchAgainst.toLowerCase(), 0, 0); +} +function _matchesSubString(word, wordToMatchAgainst, i2, j) { + if (i2 === word.length) { + return []; + } else if (j === wordToMatchAgainst.length) { + return null; + } else { + if (word[i2] === wordToMatchAgainst[j]) { + let result = null; + if (result = _matchesSubString(word, wordToMatchAgainst, i2 + 1, j + 1)) { + return join({ start: j, end: j + 1 }, result); + } + return null; + } + return _matchesSubString(word, wordToMatchAgainst, i2, j + 1); + } +} +function isLower(code) { + return 97 <= code && code <= 122; +} +function isUpper(code) { + return 65 <= code && code <= 90; +} +function isNumber2(code) { + return 48 <= code && code <= 57; +} +function isWhitespace(code) { + return code === 32 || code === 9 || code === 10 || code === 13; +} +function isWordSeparator(code) { + return isWhitespace(code) || wordSeparators.has(code); +} +function charactersMatch(codeA, codeB) { + return codeA === codeB || isWordSeparator(codeA) && isWordSeparator(codeB); +} +function getAlternateCodes(code) { + if (alternateCharsCache.has(code)) { + return alternateCharsCache.get(code); + } + let result; + const codes = getKoreanAltChars(code); + if (codes) { + result = codes; + } + alternateCharsCache.set(code, result); + return result; +} +function isAlphanumeric(code) { + return isLower(code) || isUpper(code) || isNumber2(code); +} +function join(head, tail2) { + if (tail2.length === 0) { + tail2 = [head]; + } else if (head.end === tail2[0].start) { + tail2[0].start = head.start; + } else { + tail2.unshift(head); + } + return tail2; +} +function nextAnchor(camelCaseWord, start) { + for (let i2 = start; i2 < camelCaseWord.length; i2++) { + const c = camelCaseWord.charCodeAt(i2); + if (isUpper(c) || isNumber2(c) || i2 > 0 && !isAlphanumeric(camelCaseWord.charCodeAt(i2 - 1))) { + return i2; + } + } + return camelCaseWord.length; +} +function _matchesCamelCase(word, camelCaseWord, i2, j) { + if (i2 === word.length) { + return []; + } else if (j === camelCaseWord.length) { + return null; + } else if (word[i2] !== camelCaseWord[j].toLowerCase()) { + return null; + } else { + let result = null; + let nextUpperIndex = j + 1; + result = _matchesCamelCase(word, camelCaseWord, i2 + 1, j + 1); + while (!result && (nextUpperIndex = nextAnchor(camelCaseWord, nextUpperIndex)) < camelCaseWord.length) { + result = _matchesCamelCase(word, camelCaseWord, i2 + 1, nextUpperIndex); + nextUpperIndex++; + } + return result === null ? null : join({ start: j, end: j + 1 }, result); + } +} +function analyzeCamelCaseWord(word) { + let upper = 0, lower = 0, alpha = 0, numeric = 0, code = 0; + for (let i2 = 0; i2 < word.length; i2++) { + code = word.charCodeAt(i2); + if (isUpper(code)) { + upper++; + } + if (isLower(code)) { + lower++; + } + if (isAlphanumeric(code)) { + alpha++; + } + if (isNumber2(code)) { + numeric++; + } + } + const upperPercent = upper / word.length; + const lowerPercent = lower / word.length; + const alphaPercent = alpha / word.length; + const numericPercent = numeric / word.length; + return { upperPercent, lowerPercent, alphaPercent, numericPercent }; +} +function isUpperCaseWord(analysis) { + const { upperPercent, lowerPercent } = analysis; + return lowerPercent === 0 && upperPercent > 0.6; +} +function isCamelCaseWord(analysis) { + const { upperPercent, lowerPercent, alphaPercent, numericPercent } = analysis; + return lowerPercent > 0.2 && upperPercent < 0.8 && alphaPercent > 0.6 && numericPercent < 0.2; +} +function isCamelCasePattern(word) { + let upper = 0, lower = 0, code = 0, whitespace = 0; + for (let i2 = 0; i2 < word.length; i2++) { + code = word.charCodeAt(i2); + if (isUpper(code)) { + upper++; + } + if (isLower(code)) { + lower++; + } + if (isWhitespace(code)) { + whitespace++; + } + } + if ((upper === 0 || lower === 0) && whitespace === 0) { + return word.length <= 30; + } else { + return upper <= 5; + } +} +function matchesCamelCase(word, camelCaseWord) { + if (!camelCaseWord) { + return null; + } + camelCaseWord = camelCaseWord.trim(); + if (camelCaseWord.length === 0) { + return null; + } + if (!isCamelCasePattern(word)) { + return null; + } + if (camelCaseWord.length > 60) { + camelCaseWord = camelCaseWord.substring(0, 60); + } + const analysis = analyzeCamelCaseWord(camelCaseWord); + if (!isCamelCaseWord(analysis)) { + if (!isUpperCaseWord(analysis)) { + return null; + } + camelCaseWord = camelCaseWord.toLowerCase(); + } + let result = null; + let i2 = 0; + word = word.toLowerCase(); + while (i2 < camelCaseWord.length && (result = _matchesCamelCase(word, camelCaseWord, 0, i2)) === null) { + i2 = nextAnchor(camelCaseWord, i2 + 1); + } + return result; +} +function matchesWords(word, target, contiguous = false) { + if (!target || target.length === 0) { + return null; + } + let result = null; + let targetIndex = 0; + word = word.toLowerCase(); + target = target.toLowerCase(); + while (targetIndex < target.length) { + result = _matchesWords(word, target, 0, targetIndex, contiguous); + if (result !== null) { + break; + } + targetIndex = nextWord(target, targetIndex + 1); + } + return result; +} +function _matchesWords(word, target, wordIndex, targetIndex, contiguous) { + let targetIndexOffset = 0; + if (wordIndex === word.length) { + return []; + } else if (targetIndex === target.length) { + return null; + } else if (!charactersMatch(word.charCodeAt(wordIndex), target.charCodeAt(targetIndex))) { + const altChars = getAlternateCodes(word.charCodeAt(wordIndex)); + if (!altChars) { + return null; + } + for (let k = 0; k < altChars.length; k++) { + if (!charactersMatch(altChars[k], target.charCodeAt(targetIndex + k))) { + return null; + } + } + targetIndexOffset += altChars.length - 1; + } + let result = null; + let nextWordIndex = targetIndex + targetIndexOffset + 1; + result = _matchesWords(word, target, wordIndex + 1, nextWordIndex, contiguous); + if (!contiguous) { + while (!result && (nextWordIndex = nextWord(target, nextWordIndex)) < target.length) { + result = _matchesWords(word, target, wordIndex + 1, nextWordIndex, contiguous); + nextWordIndex++; + } + } + if (!result) { + return null; + } + if (word.charCodeAt(wordIndex) !== target.charCodeAt(targetIndex)) { + const altChars = getAlternateCodes(word.charCodeAt(wordIndex)); + if (!altChars) { + return result; + } + for (let k = 0; k < altChars.length; k++) { + if (altChars[k] !== target.charCodeAt(targetIndex + k)) { + return result; + } + } + } + return join({ start: targetIndex, end: targetIndex + targetIndexOffset + 1 }, result); +} +function nextWord(word, start) { + for (let i2 = start; i2 < word.length; i2++) { + if (isWordSeparator(word.charCodeAt(i2)) || i2 > 0 && isWordSeparator(word.charCodeAt(i2 - 1))) { + return i2; + } + } + return word.length; +} +function matchesFuzzy(word, wordToMatchAgainst, enableSeparateSubstringMatching = false) { + if (typeof word !== "string" || typeof wordToMatchAgainst !== "string") { + return null; + } + let regexp = fuzzyRegExpCache.get(word); + if (!regexp) { + regexp = new RegExp(convertSimple2RegExpPattern(word), "i"); + fuzzyRegExpCache.set(word, regexp); + } + const match2 = regexp.exec(wordToMatchAgainst); + if (match2) { + return [{ start: match2.index, end: match2.index + match2[0].length }]; + } + return enableSeparateSubstringMatching ? fuzzySeparateFilter(word, wordToMatchAgainst) : fuzzyContiguousFilter(word, wordToMatchAgainst); +} +function matchesFuzzy2(pattern, word) { + const score3 = fuzzyScore(pattern, pattern.toLowerCase(), 0, word, word.toLowerCase(), 0, { firstMatchCanBeWeak: true, boostFullMatch: true }); + return score3 ? createMatches(score3) : null; +} +function anyScore(pattern, lowPattern, patternPos, word, lowWord, wordPos) { + const max = Math.min(13, pattern.length); + for (; patternPos < max; patternPos++) { + const result = fuzzyScore(pattern, lowPattern, patternPos, word, lowWord, wordPos, { firstMatchCanBeWeak: true, boostFullMatch: true }); + if (result) { + return result; + } + } + return [0, wordPos]; +} +function createMatches(score3) { + if (typeof score3 === "undefined") { + return []; + } + const res = []; + const wordPos = score3[1]; + for (let i2 = score3.length - 1; i2 > 1; i2--) { + const pos = score3[i2] + wordPos; + const last = res[res.length - 1]; + if (last && last.end === pos) { + last.end = pos + 1; + } else { + res.push({ start: pos, end: pos + 1 }); + } + } + return res; +} +function initTable() { + const table = []; + const row = []; + for (let i2 = 0; i2 <= _maxLen; i2++) { + row[i2] = 0; + } + for (let i2 = 0; i2 <= _maxLen; i2++) { + table.push(row.slice(0)); + } + return table; +} +function initArr(maxLen) { + const row = []; + for (let i2 = 0; i2 <= maxLen; i2++) { + row[i2] = 0; + } + return row; +} +function printTable(table, pattern, patternLen, word, wordLen) { + function pad(s, n2, pad2 = " ") { + while (s.length < n2) { + s = pad2 + s; + } + return s; + } + let ret = ` | |${word.split("").map((c) => pad(c, 3)).join("|")} +`; + for (let i2 = 0; i2 <= patternLen; i2++) { + if (i2 === 0) { + ret += " |"; + } else { + ret += `${pattern[i2 - 1]}|`; + } + ret += table[i2].slice(0, wordLen + 1).map((n2) => pad(n2.toString(), 3)).join("|") + "\n"; + } + return ret; +} +function printTables(pattern, patternStart, word, wordStart) { + pattern = pattern.substr(patternStart); + word = word.substr(wordStart); + console.log(printTable(_table, pattern, pattern.length, word, word.length)); + console.log(printTable(_arrows, pattern, pattern.length, word, word.length)); + console.log(printTable(_diag, pattern, pattern.length, word, word.length)); +} +function isSeparatorAtPos(value, index) { + if (index < 0 || index >= value.length) { + return false; + } + const code = value.codePointAt(index); + switch (code) { + case 95: + case 45: + case 46: + case 32: + case 47: + case 92: + case 39: + case 34: + case 58: + case 36: + case 60: + case 62: + case 40: + case 41: + case 91: + case 93: + case 123: + case 125: + return true; + case void 0: + return false; + default: + if (isEmojiImprecise(code)) { + return true; + } + return false; + } +} +function isWhitespaceAtPos(value, index) { + if (index < 0 || index >= value.length) { + return false; + } + const code = value.charCodeAt(index); + switch (code) { + case 32: + case 9: + return true; + default: + return false; + } +} +function isUpperCaseAtPos(pos, word, wordLow) { + return word[pos] !== wordLow[pos]; +} +function isPatternInWord(patternLow, patternPos, patternLen, wordLow, wordPos, wordLen, fillMinWordPosArr = false) { + while (patternPos < patternLen && wordPos < wordLen) { + if (patternLow[patternPos] === wordLow[wordPos]) { + if (fillMinWordPosArr) { + _minWordMatchPos[patternPos] = wordPos; + } + patternPos += 1; + } + wordPos += 1; + } + return patternPos === patternLen; +} +function fuzzyScore(pattern, patternLow, patternStart, word, wordLow, wordStart, options2 = FuzzyScoreOptions.default) { + const patternLen = pattern.length > _maxLen ? _maxLen : pattern.length; + const wordLen = word.length > _maxLen ? _maxLen : word.length; + if (patternStart >= patternLen || wordStart >= wordLen || patternLen - patternStart > wordLen - wordStart) { + return void 0; + } + if (!isPatternInWord(patternLow, patternStart, patternLen, wordLow, wordStart, wordLen, true)) { + return void 0; + } + _fillInMaxWordMatchPos(patternLen, wordLen, patternStart, wordStart, patternLow, wordLow); + let row = 1; + let column = 1; + let patternPos = patternStart; + let wordPos = wordStart; + const hasStrongFirstMatch = [false]; + for (row = 1, patternPos = patternStart; patternPos < patternLen; row++, patternPos++) { + const minWordMatchPos = _minWordMatchPos[patternPos]; + const maxWordMatchPos = _maxWordMatchPos[patternPos]; + const nextMaxWordMatchPos = patternPos + 1 < patternLen ? _maxWordMatchPos[patternPos + 1] : wordLen; + for (column = minWordMatchPos - wordStart + 1, wordPos = minWordMatchPos; wordPos < nextMaxWordMatchPos; column++, wordPos++) { + let score3 = Number.MIN_SAFE_INTEGER; + let canComeDiag = false; + if (wordPos <= maxWordMatchPos) { + score3 = _doScore(pattern, patternLow, patternPos, patternStart, word, wordLow, wordPos, wordLen, wordStart, _diag[row - 1][column - 1] === 0, hasStrongFirstMatch); + } + let diagScore = 0; + if (score3 !== Number.MIN_SAFE_INTEGER) { + canComeDiag = true; + diagScore = score3 + _table[row - 1][column - 1]; + } + const canComeLeft = wordPos > minWordMatchPos; + const leftScore = canComeLeft ? _table[row][column - 1] + (_diag[row][column - 1] > 0 ? -5 : 0) : 0; + const canComeLeftLeft = wordPos > minWordMatchPos + 1 && _diag[row][column - 1] > 0; + const leftLeftScore = canComeLeftLeft ? _table[row][column - 2] + (_diag[row][column - 2] > 0 ? -5 : 0) : 0; + if (canComeLeftLeft && (!canComeLeft || leftLeftScore >= leftScore) && (!canComeDiag || leftLeftScore >= diagScore)) { + _table[row][column] = leftLeftScore; + _arrows[row][column] = 3; + _diag[row][column] = 0; + } else if (canComeLeft && (!canComeDiag || leftScore >= diagScore)) { + _table[row][column] = leftScore; + _arrows[row][column] = 2; + _diag[row][column] = 0; + } else if (canComeDiag) { + _table[row][column] = diagScore; + _arrows[row][column] = 1; + _diag[row][column] = _diag[row - 1][column - 1] + 1; + } else { + throw new Error(`not possible`); + } + } + } + if (_debug) { + printTables(pattern, patternStart, word, wordStart); + } + if (!hasStrongFirstMatch[0] && !options2.firstMatchCanBeWeak) { + return void 0; + } + row--; + column--; + const result = [_table[row][column], wordStart]; + let backwardsDiagLength = 0; + let maxMatchColumn = 0; + while (row >= 1) { + let diagColumn = column; + do { + const arrow = _arrows[row][diagColumn]; + if (arrow === 3) { + diagColumn = diagColumn - 2; + } else if (arrow === 2) { + diagColumn = diagColumn - 1; + } else { + break; + } + } while (diagColumn >= 1); + if (backwardsDiagLength > 1 && patternLow[patternStart + row - 1] === wordLow[wordStart + column - 1] && !isUpperCaseAtPos(diagColumn + wordStart - 1, word, wordLow) && backwardsDiagLength + 1 > _diag[row][diagColumn]) { + diagColumn = column; + } + if (diagColumn === column) { + backwardsDiagLength++; + } else { + backwardsDiagLength = 1; + } + if (!maxMatchColumn) { + maxMatchColumn = diagColumn; + } + row--; + column = diagColumn - 1; + result.push(column); + } + if (wordLen - wordStart === patternLen && options2.boostFullMatch) { + result[0] += 2; + } + const skippedCharsCount = maxMatchColumn - patternLen; + result[0] -= skippedCharsCount; + return result; +} +function _fillInMaxWordMatchPos(patternLen, wordLen, patternStart, wordStart, patternLow, wordLow) { + let patternPos = patternLen - 1; + let wordPos = wordLen - 1; + while (patternPos >= patternStart && wordPos >= wordStart) { + if (patternLow[patternPos] === wordLow[wordPos]) { + _maxWordMatchPos[patternPos] = wordPos; + patternPos--; + } + wordPos--; + } +} +function _doScore(pattern, patternLow, patternPos, patternStart, word, wordLow, wordPos, wordLen, wordStart, newMatchStart, outFirstMatchStrong) { + if (patternLow[patternPos] !== wordLow[wordPos]) { + return Number.MIN_SAFE_INTEGER; + } + let score3 = 1; + let isGapLocation = false; + if (wordPos === patternPos - patternStart) { + score3 = pattern[patternPos] === word[wordPos] ? 7 : 5; + } else if (isUpperCaseAtPos(wordPos, word, wordLow) && (wordPos === 0 || !isUpperCaseAtPos(wordPos - 1, word, wordLow))) { + score3 = pattern[patternPos] === word[wordPos] ? 7 : 5; + isGapLocation = true; + } else if (isSeparatorAtPos(wordLow, wordPos) && (wordPos === 0 || !isSeparatorAtPos(wordLow, wordPos - 1))) { + score3 = 5; + } else if (isSeparatorAtPos(wordLow, wordPos - 1) || isWhitespaceAtPos(wordLow, wordPos - 1)) { + score3 = 5; + isGapLocation = true; + } + if (score3 > 1 && patternPos === patternStart) { + outFirstMatchStrong[0] = true; + } + if (!isGapLocation) { + isGapLocation = isUpperCaseAtPos(wordPos, word, wordLow) || isSeparatorAtPos(wordLow, wordPos - 1) || isWhitespaceAtPos(wordLow, wordPos - 1); + } + if (patternPos === patternStart) { + if (wordPos > wordStart) { + score3 -= isGapLocation ? 3 : 5; + } + } else { + if (newMatchStart) { + score3 += isGapLocation ? 2 : 0; + } else { + score3 += isGapLocation ? 0 : 1; + } + } + if (wordPos + 1 === wordLen) { + score3 -= isGapLocation ? 3 : 5; + } + return score3; +} +function fuzzyScoreGracefulAggressive(pattern, lowPattern, patternPos, word, lowWord, wordPos, options2) { + return fuzzyScoreWithPermutations(pattern, lowPattern, patternPos, word, lowWord, wordPos, true, options2); +} +function fuzzyScoreWithPermutations(pattern, lowPattern, patternPos, word, lowWord, wordPos, aggressive, options2) { + let top = fuzzyScore(pattern, lowPattern, patternPos, word, lowWord, wordPos, options2); + if (top && !aggressive) { + return top; + } + if (pattern.length >= 3) { + const tries = Math.min(7, pattern.length - 1); + for (let movingPatternPos = patternPos + 1; movingPatternPos < tries; movingPatternPos++) { + const newPattern = nextTypoPermutation(pattern, movingPatternPos); + if (newPattern) { + const candidate = fuzzyScore(newPattern, newPattern.toLowerCase(), patternPos, word, lowWord, wordPos, options2); + if (candidate) { + candidate[0] -= 3; + if (!top || candidate[0] > top[0]) { + top = candidate; + } + } + } + } + } + return top; +} +function nextTypoPermutation(pattern, patternPos) { + if (patternPos + 1 >= pattern.length) { + return void 0; + } + const swap1 = pattern[patternPos]; + const swap2 = pattern[patternPos + 1]; + if (swap1 === swap2) { + return void 0; + } + return pattern.slice(0, patternPos) + swap2 + swap1 + pattern.slice(patternPos + 2); +} +var matchesStrictPrefix, matchesPrefix, wordSeparators, alternateCharsCache, fuzzyContiguousFilter, fuzzySeparateFilter, fuzzyRegExpCache, _maxLen, _minWordMatchPos, _maxWordMatchPos, _diag, _table, _arrows, _debug, FuzzyScore, FuzzyScoreOptions; +var init_filters = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/common/filters.js"() { + init_map(); + init_korean(); + init_strings(); + matchesStrictPrefix = _matchesPrefix.bind(void 0, false); + matchesPrefix = _matchesPrefix.bind(void 0, true); + wordSeparators = /* @__PURE__ */ new Set(); + "()[]{}<>`'\"-/;:,.?!".split("").forEach((s) => wordSeparators.add(s.charCodeAt(0))); + alternateCharsCache = /* @__PURE__ */ new Map(); + fuzzyContiguousFilter = or(matchesPrefix, matchesCamelCase, matchesContiguousSubString); + fuzzySeparateFilter = or(matchesPrefix, matchesCamelCase, matchesSubString); + fuzzyRegExpCache = new LRUCache(1e4); + _maxLen = 128; + _minWordMatchPos = initArr(2 * _maxLen); + _maxWordMatchPos = initArr(2 * _maxLen); + _diag = initTable(); + _table = initTable(); + _arrows = initTable(); + _debug = false; + (function(FuzzyScore2) { + FuzzyScore2.Default = [-100, 0]; + function isDefault(score3) { + return !score3 || score3.length === 2 && score3[0] === -100 && score3[1] === 0; + } + FuzzyScore2.isDefault = isDefault; + })(FuzzyScore || (FuzzyScore = {})); + FuzzyScoreOptions = class { + static { + this.default = { boostFullMatch: true, firstMatchCanBeWeak: false }; + } + constructor(firstMatchCanBeWeak, boostFullMatch) { + this.firstMatchCanBeWeak = firstMatchCanBeWeak; + this.boostFullMatch = boostFullMatch; + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/common/iconLabels.js +function escapeIcons(text2) { + return text2.replace(escapeIconsRegex, (match2, escaped) => escaped ? match2 : `\\${match2}`); +} +function markdownEscapeEscapedIcons(text2) { + return text2.replace(markdownEscapedIconsRegex, (match2) => `\\${match2}`); +} +function stripIcons(text2) { + if (text2.indexOf(iconStartMarker) === -1) { + return text2; + } + return text2.replace(stripIconsRegex, (match2, preWhitespace, escaped, postWhitespace) => escaped ? match2 : preWhitespace || postWhitespace || ""); +} +function getCodiconAriaLabel(text2) { + if (!text2) { + return ""; + } + return text2.replace(/\$\((.*?)\)/g, (_match, codiconName) => ` ${codiconName} `).trim(); +} +function parseLabelWithIcons(input) { + _parseIconsRegex.lastIndex = 0; + let text2 = ""; + const iconOffsets = []; + let iconsOffset = 0; + while (true) { + const pos = _parseIconsRegex.lastIndex; + const match2 = _parseIconsRegex.exec(input); + const chars = input.substring(pos, match2?.index); + if (chars.length > 0) { + text2 += chars; + for (let i2 = 0; i2 < chars.length; i2++) { + iconOffsets.push(iconsOffset); + } + } + if (!match2) { + break; + } + iconsOffset += match2[0].length; + } + return { text: text2, iconOffsets }; +} +function matchesFuzzyIconAware(query, target, enableSeparateSubstringMatching = false) { + const { text: text2, iconOffsets } = target; + if (!iconOffsets || iconOffsets.length === 0) { + return matchesFuzzy(query, text2, enableSeparateSubstringMatching); + } + const wordToMatchAgainstWithoutIconsTrimmed = ltrim(text2, " "); + const leadingWhitespaceOffset = text2.length - wordToMatchAgainstWithoutIconsTrimmed.length; + const matches = matchesFuzzy(query, wordToMatchAgainstWithoutIconsTrimmed, enableSeparateSubstringMatching); + if (matches) { + for (const match2 of matches) { + const iconOffset = iconOffsets[match2.start + leadingWhitespaceOffset] + leadingWhitespaceOffset; + match2.start += iconOffset; + match2.end += iconOffset; + } + } + return matches; +} +var iconStartMarker, iconsRegex, escapeIconsRegex, markdownEscapedIconsRegex, stripIconsRegex, _parseIconsRegex; +var init_iconLabels = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/common/iconLabels.js"() { + init_filters(); + init_strings(); + init_themables(); + iconStartMarker = "$("; + iconsRegex = new RegExp(`\\$\\(${ThemeIcon.iconNameExpression}(?:${ThemeIcon.iconModifierExpression})?\\)`, "g"); + escapeIconsRegex = new RegExp(`(\\\\)?${iconsRegex.source}`, "g"); + markdownEscapedIconsRegex = new RegExp(`\\\\${iconsRegex.source}`, "g"); + stripIconsRegex = new RegExp(`(\\s)?(\\\\)?${iconsRegex.source}(\\s)?`, "g"); + _parseIconsRegex = new RegExp(`\\$\\(${ThemeIcon.iconNameCharacter}+\\)`, "g"); + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/common/htmlContent.js +function isEmptyMarkdownString(oneOrMany) { + if (isMarkdownString(oneOrMany)) { + return !oneOrMany.value; + } else if (Array.isArray(oneOrMany)) { + return oneOrMany.every(isEmptyMarkdownString); + } else { + return true; + } +} +function isMarkdownString(thing) { + if (thing instanceof MarkdownString) { + return true; + } else if (thing && typeof thing === "object") { + return typeof thing.value === "string" && (typeof thing.isTrusted === "boolean" || typeof thing.isTrusted === "object" || thing.isTrusted === void 0) && (typeof thing.supportThemeIcons === "boolean" || thing.supportThemeIcons === void 0) && (typeof thing.supportAlertSyntax === "boolean" || thing.supportAlertSyntax === void 0); + } + return false; +} +function markdownStringEqual(a, b) { + if (a === b) { + return true; + } else if (!a || !b) { + return false; + } else { + return a.value === b.value && a.isTrusted === b.isTrusted && a.supportThemeIcons === b.supportThemeIcons && a.supportHtml === b.supportHtml && a.supportAlertSyntax === b.supportAlertSyntax && (a.baseUri === b.baseUri || !!a.baseUri && !!b.baseUri && isEqual(URI.from(a.baseUri), URI.from(b.baseUri))); + } +} +function escapeMarkdownSyntaxTokens(text2) { + return text2.replace(/[\\`*_{}[\]()#+\-!~]/g, "\\$&"); +} +function appendEscapedMarkdownCodeBlockFence(code, langId) { + const longestFenceLength = code.match(/^`+/gm)?.reduce((a, b) => a.length > b.length ? a : b).length ?? 0; + const desiredFenceLength = longestFenceLength >= 3 ? longestFenceLength + 1 : 3; + return [ + `${"`".repeat(desiredFenceLength)}${langId}`, + code, + `${"`".repeat(desiredFenceLength)}` + ].join("\n"); +} +function escapeDoubleQuotes(input) { + return input.replace(/"/g, """); +} +function removeMarkdownEscapes(text2) { + if (!text2) { + return text2; + } + return text2.replace(/\\([\\`*_{}[\]()#+\-.!~])/g, "$1"); +} +function parseHrefAndDimensions(href) { + const dimensions = []; + const splitted = href.split("|").map((s) => s.trim()); + href = splitted[0]; + const parameters = splitted[1]; + if (parameters) { + const heightFromParams = /height=(\d+)/.exec(parameters); + const widthFromParams = /width=(\d+)/.exec(parameters); + const height = heightFromParams ? heightFromParams[1] : ""; + const width2 = widthFromParams ? widthFromParams[1] : ""; + const widthIsFinite = isFinite(parseInt(width2)); + const heightIsFinite = isFinite(parseInt(height)); + if (widthIsFinite) { + dimensions.push(`width="${width2}"`); + } + if (heightIsFinite) { + dimensions.push(`height="${height}"`); + } + } + return { href, dimensions }; +} +function createCommandUri(commandId, ...commandArgs) { + return URI.from({ + scheme: Schemas.command, + path: commandId, + query: commandArgs.length ? encodeURIComponent(JSON.stringify(commandArgs)) : void 0 + }); +} +var MarkdownString; +var init_htmlContent = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/common/htmlContent.js"() { + init_errors(); + init_iconLabels(); + init_network(); + init_resources(); + init_strings(); + init_uri(); + MarkdownString = class { + constructor(value = "", isTrustedOrOptions = false) { + this.value = value; + if (typeof this.value !== "string") { + throw illegalArgument("value"); + } + if (typeof isTrustedOrOptions === "boolean") { + this.isTrusted = isTrustedOrOptions; + this.supportThemeIcons = false; + this.supportHtml = false; + this.supportAlertSyntax = false; + } else { + this.isTrusted = isTrustedOrOptions.isTrusted ?? void 0; + this.supportThemeIcons = isTrustedOrOptions.supportThemeIcons ?? false; + this.supportHtml = isTrustedOrOptions.supportHtml ?? false; + this.supportAlertSyntax = isTrustedOrOptions.supportAlertSyntax ?? false; + } + } + appendText(value, newlineStyle = 0) { + this.value += escapeMarkdownSyntaxTokens(this.supportThemeIcons ? escapeIcons(value) : value).replace(/([ \t]+)/g, (_match, g1) => " ".repeat(g1.length)).replace(/\>/gm, "\\>").replace(/\n/g, newlineStyle === 1 ? "\\\n" : "\n\n"); + return this; + } + appendMarkdown(value) { + this.value += value; + return this; + } + appendCodeblock(langId, code) { + this.value += ` +${appendEscapedMarkdownCodeBlockFence(code, langId)} +`; + return this; + } + appendLink(target, label, title) { + this.value += "["; + this.value += this._escape(label, "]"); + this.value += "]("; + this.value += this._escape(String(target), ")"); + if (title) { + this.value += ` "${this._escape(this._escape(title, '"'), ")")}"`; + } + this.value += ")"; + return this; + } + _escape(value, ch) { + const r = new RegExp(escapeRegExpCharacters(ch), "g"); + return value.replace(r, (match2, offset) => { + if (value.charAt(offset - 1) !== "\\") { + return `\\${match2}`; + } else { + return match2; + } + }); + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/browser/ui/iconLabel/iconLabels.js +function renderLabelWithIcons(text2) { + const elements = new Array(); + let match2; + let textStart = 0, textStop = 0; + while ((match2 = labelWithIconsRegex.exec(text2)) !== null) { + textStop = match2.index || 0; + if (textStart < textStop) { + elements.push(text2.substring(textStart, textStop)); + } + textStart = (match2.index || 0) + match2[0].length; + const [, escaped, codicon] = match2; + elements.push(escaped ? `$(${codicon})` : renderIcon({ id: codicon })); + } + if (textStart < text2.length) { + elements.push(text2.substring(textStart)); + } + return elements; +} +function renderIcon(icon) { + const node = $(`span`); + node.classList.add(...ThemeIcon.asClassNameArray(icon)); + return node; +} +var labelWithIconsRegex; +var init_iconLabels2 = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/browser/ui/iconLabel/iconLabels.js"() { + init_dom(); + init_themables(); + labelWithIconsRegex = new RegExp(`(\\\\)?\\$\\((${ThemeIcon.iconNameExpression}(?:${ThemeIcon.iconModifierExpression})?)\\)`, "g"); + } +}); + +// node_modules/monaco-editor-core/esm/vs/base/common/numbers.js +function clamp(value, min, max) { + return Math.min(Math.max(value, min), max); +} +var MovingAverage, SlidingWindowAverage; +var init_numbers = __esm({ + "node_modules/monaco-editor-core/esm/vs/base/common/numbers.js"() { + MovingAverage = class { + constructor() { + this._n = 1; + this._val = 0; + } + update(value) { + this._val = this._val + (value - this._val) / this._n; + this._n += 1; + return this._val; + } + get value() { + return this._val; + } + }; + SlidingWindowAverage = class { + constructor(size2) { + this._n = 0; + this._val = 0; + this._values = []; + this._index = 0; + this._sum = 0; + this._values = new Array(size2); + this._values.fill(0, 0, size2); + } + update(value) { + const oldValue = this._values[this._index]; + this._values[this._index] = value; + this._index = (this._index + 1) % this._values.length; + this._sum -= oldValue; + this._sum += value; + if (this._n < this._values.length) { + this._n += 1; + } + this._val = this._sum / this._n; + return this._val; + } + get value() { + return this._val; + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/browser/widget/diffEditor/utils.js +function joinCombine(arr1, arr2, keySelector, combine) { + if (arr1.length === 0) { + return arr2; + } + if (arr2.length === 0) { + return arr1; + } + const result = []; + let i2 = 0; + let j = 0; + while (i2 < arr1.length && j < arr2.length) { + const val1 = arr1[i2]; + const val2 = arr2[j]; + const key1 = keySelector(val1); + const key2 = keySelector(val2); + if (key1 < key2) { + result.push(val1); + i2++; + } else if (key1 > key2) { + result.push(val2); + j++; + } else { + result.push(combine(val1, val2)); + i2++; + j++; + } + } + while (i2 < arr1.length) { + result.push(arr1[i2]); + i2++; + } + while (j < arr2.length) { + result.push(arr2[j]); + j++; + } + return result; +} +function applyObservableDecorations(editor2, decorations) { + const d = new DisposableStore(); + const decorationsCollection = editor2.createDecorationsCollection(); + d.add(autorunOpts({ debugName: () => `Apply decorations from ${decorations.debugName}` }, (reader) => { + const d2 = decorations.read(reader); + decorationsCollection.set(d2); + })); + d.add({ + dispose: () => { + decorationsCollection.clear(); + } + }); + return d; +} +function appendRemoveOnDispose(parent, child) { + parent.appendChild(child); + return toDisposable(() => { + child.remove(); + }); +} +function prependRemoveOnDispose(parent, child) { + parent.prepend(child); + return toDisposable(() => { + child.remove(); + }); +} +function animatedObservable(targetWindow, base, store) { + let targetVal = base.get(); + let startVal = targetVal; + let curVal = targetVal; + const result = observableValue("animatedValue", targetVal); + let animationStartMs = -1; + const durationMs = 300; + let animationFrame = void 0; + store.add(autorunHandleChanges({ + changeTracker: { + createChangeSummary: () => ({ animate: false }), + handleChange: (ctx, s) => { + if (ctx.didChange(base)) { + s.animate = s.animate || ctx.change; + } + return true; + } + } + }, (reader, s) => { + if (animationFrame !== void 0) { + targetWindow.cancelAnimationFrame(animationFrame); + animationFrame = void 0; + } + startVal = curVal; + targetVal = base.read(reader); + animationStartMs = Date.now() - (s.animate ? 0 : durationMs); + update(); + })); + function update() { + const passedMs = Date.now() - animationStartMs; + curVal = Math.floor(easeOutExpo(passedMs, startVal, targetVal - startVal, durationMs)); + if (passedMs < durationMs) { + animationFrame = targetWindow.requestAnimationFrame(update); + } else { + curVal = targetVal; + } + result.set(curVal, void 0); + } + return result; +} +function easeOutExpo(t, b, c, d) { + return t === d ? b + c : c * (-Math.pow(2, -10 * t / d) + 1) + b; +} +function applyStyle(domNode, style) { + return autorun((reader) => { + for (let [key, val] of Object.entries(style)) { + if (val && typeof val === "object" && "read" in val) { + val = val.read(reader); + } + if (typeof val === "number") { + val = `${val}px`; + } + key = key.replace(/[A-Z]/g, (m) => "-" + m.toLowerCase()); + domNode.style[key] = val; + } + }); +} +function applyViewZones(editor2, viewZones, setIsUpdating, zoneIds) { + const store = new DisposableStore(); + const lastViewZoneIds = []; + store.add(autorunWithStore((reader, store2) => { + const curViewZones = viewZones.read(reader); + const viewZonIdsPerViewZone = /* @__PURE__ */ new Map(); + const viewZoneIdPerOnChangeObservable = /* @__PURE__ */ new Map(); + if (setIsUpdating) { + setIsUpdating(true); + } + editor2.changeViewZones((a) => { + for (const id of lastViewZoneIds) { + a.removeZone(id); + zoneIds?.delete(id); + } + lastViewZoneIds.length = 0; + for (const z of curViewZones) { + const id = a.addZone(z); + if (z.setZoneId) { + z.setZoneId(id); + } + lastViewZoneIds.push(id); + zoneIds?.add(id); + viewZonIdsPerViewZone.set(z, id); + } + }); + if (setIsUpdating) { + setIsUpdating(false); + } + store2.add(autorunHandleChanges({ + changeTracker: { + createChangeSummary() { + return { zoneIds: [] }; + }, + handleChange(context, changeSummary) { + const id = viewZoneIdPerOnChangeObservable.get(context.changedObservable); + if (id !== void 0) { + changeSummary.zoneIds.push(id); + } + return true; + } + } + }, (reader2, changeSummary) => { + for (const vz of curViewZones) { + if (vz.onChange) { + viewZoneIdPerOnChangeObservable.set(vz.onChange, viewZonIdsPerViewZone.get(vz)); + vz.onChange.read(reader2); + } + } + if (setIsUpdating) { + setIsUpdating(true); + } + editor2.changeViewZones((a) => { + for (const id of changeSummary.zoneIds) { + a.layoutZone(id); + } + }); + if (setIsUpdating) { + setIsUpdating(false); + } + })); + })); + store.add({ + dispose() { + if (setIsUpdating) { + setIsUpdating(true); + } + editor2.changeViewZones((a) => { + for (const id of lastViewZoneIds) { + a.removeZone(id); + } + }); + zoneIds?.clear(); + if (setIsUpdating) { + setIsUpdating(false); + } + } + }); + return store; +} +function translatePosition(posInOriginal, mappings) { + const mapping = findLast(mappings, (m) => m.original.startLineNumber <= posInOriginal.lineNumber); + if (!mapping) { + return Range.fromPositions(posInOriginal); + } + if (mapping.original.endLineNumberExclusive <= posInOriginal.lineNumber) { + const newLineNumber = posInOriginal.lineNumber - mapping.original.endLineNumberExclusive + mapping.modified.endLineNumberExclusive; + return Range.fromPositions(new Position(newLineNumber, posInOriginal.column)); + } + if (!mapping.innerChanges) { + return Range.fromPositions(new Position(mapping.modified.startLineNumber, 1)); + } + const innerMapping = findLast(mapping.innerChanges, (m) => m.originalRange.getStartPosition().isBeforeOrEqual(posInOriginal)); + if (!innerMapping) { + const newLineNumber = posInOriginal.lineNumber - mapping.original.startLineNumber + mapping.modified.startLineNumber; + return Range.fromPositions(new Position(newLineNumber, posInOriginal.column)); + } + if (innerMapping.originalRange.containsPosition(posInOriginal)) { + return innerMapping.modifiedRange; + } else { + const l = lengthBetweenPositions(innerMapping.originalRange.getEndPosition(), posInOriginal); + return Range.fromPositions(l.addToPosition(innerMapping.modifiedRange.getEndPosition())); + } +} +function lengthBetweenPositions(position1, position2) { + if (position1.lineNumber === position2.lineNumber) { + return new TextLength(0, position2.column - position1.column); + } else { + return new TextLength(position2.lineNumber - position1.lineNumber, position2.column - 1); + } +} +function filterWithPrevious(arr, filter) { + let prev; + return arr.filter((cur) => { + const result = filter(cur, prev); + prev = cur; + return result; + }); +} +var ObservableElementSizeObserver, ViewZoneOverlayWidget, PlaceholderViewZone, ManagedOverlayWidget, DisposableCancellationTokenSource, RefCounted, BaseRefCounted, ClonedRefCounted; +var init_utils5 = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/browser/widget/diffEditor/utils.js"() { + init_arraysFind(); + init_cancellation(); + init_lifecycle(); + init_observable(); + init_elementSizeObserver(); + init_position(); + init_range(); + init_textLength(); + ObservableElementSizeObserver = class extends Disposable { + get width() { + return this._width; + } + get height() { + return this._height; + } + get automaticLayout() { + return this._automaticLayout; + } + constructor(element, dimension) { + super(); + this._automaticLayout = false; + this.elementSizeObserver = this._register(new ElementSizeObserver(element, dimension)); + this._width = observableValue(this, this.elementSizeObserver.getWidth()); + this._height = observableValue(this, this.elementSizeObserver.getHeight()); + this._register(this.elementSizeObserver.onDidChange((e) => transaction((tx) => { + this._width.set(this.elementSizeObserver.getWidth(), tx); + this._height.set(this.elementSizeObserver.getHeight(), tx); + }))); + } + observe(dimension) { + this.elementSizeObserver.observe(dimension); + } + setAutomaticLayout(automaticLayout) { + this._automaticLayout = automaticLayout; + if (automaticLayout) { + this.elementSizeObserver.startObserving(); + } else { + this.elementSizeObserver.stopObserving(); + } + } + }; + ViewZoneOverlayWidget = class extends Disposable { + constructor(editor2, viewZone, htmlElement) { + super(); + this._register(new ManagedOverlayWidget(editor2, htmlElement)); + this._register(applyStyle(htmlElement, { + height: viewZone.actualHeight, + top: viewZone.actualTop + })); + } + }; + PlaceholderViewZone = class { + get afterLineNumber() { + return this._afterLineNumber.get(); + } + constructor(_afterLineNumber, heightInPx) { + this._afterLineNumber = _afterLineNumber; + this.heightInPx = heightInPx; + this.domNode = document.createElement("div"); + this._actualTop = observableValue(this, void 0); + this._actualHeight = observableValue(this, void 0); + this.actualTop = this._actualTop; + this.actualHeight = this._actualHeight; + this.showInHiddenAreas = true; + this.onChange = this._afterLineNumber; + this.onDomNodeTop = (top) => { + this._actualTop.set(top, void 0); + }; + this.onComputedHeight = (height) => { + this._actualHeight.set(height, void 0); + }; + } + }; + ManagedOverlayWidget = class _ManagedOverlayWidget { + static { + this._counter = 0; + } + constructor(_editor, _domElement) { + this._editor = _editor; + this._domElement = _domElement; + this._overlayWidgetId = `managedOverlayWidget-${_ManagedOverlayWidget._counter++}`; + this._overlayWidget = { + getId: () => this._overlayWidgetId, + getDomNode: () => this._domElement, + getPosition: () => null + }; + this._editor.addOverlayWidget(this._overlayWidget); + } + dispose() { + this._editor.removeOverlayWidget(this._overlayWidget); + } + }; + DisposableCancellationTokenSource = class extends CancellationTokenSource { + dispose() { + super.dispose(true); + } + }; + RefCounted = class { + static create(value, debugOwner = void 0) { + return new BaseRefCounted(value, value, debugOwner); + } + static createWithDisposable(value, disposable, debugOwner = void 0) { + const store = new DisposableStore(); + store.add(disposable); + store.add(value); + return new BaseRefCounted(value, store, debugOwner); + } + }; + BaseRefCounted = class extends RefCounted { + constructor(object, _disposable, _debugOwner) { + super(); + this.object = object; + this._disposable = _disposable; + this._debugOwner = _debugOwner; + this._refCount = 1; + this._isDisposed = false; + this._owners = []; + if (_debugOwner) { + this._addOwner(_debugOwner); + } + } + _addOwner(debugOwner) { + if (debugOwner) { + this._owners.push(debugOwner); + } + } + createNewRef(debugOwner) { + this._refCount++; + if (debugOwner) { + this._addOwner(debugOwner); + } + return new ClonedRefCounted(this, debugOwner); + } + dispose() { + if (this._isDisposed) { + return; + } + this._isDisposed = true; + this._decreaseRefCount(this._debugOwner); + } + _decreaseRefCount(debugOwner) { + this._refCount--; + if (this._refCount === 0) { + this._disposable.dispose(); + } + if (debugOwner) { + const idx = this._owners.indexOf(debugOwner); + if (idx !== -1) { + this._owners.splice(idx, 1); + } + } + } + }; + ClonedRefCounted = class extends RefCounted { + constructor(_base, _debugOwner) { + super(); + this._base = _base; + this._debugOwner = _debugOwner; + this._isDisposed = false; + } + get object() { + return this._base.object; + } + createNewRef(debugOwner) { + return this._base.createNewRef(debugOwner); + } + dispose() { + if (this._isDisposed) { + return; + } + this._isDisposed = true; + this._base._decreaseRefCount(this._debugOwner); + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/common/services/editorWorker.js +var IEditorWorkerService; +var init_editorWorker = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/common/services/editorWorker.js"() { + init_instantiation(); + IEditorWorkerService = createDecorator("editorWorkerService"); + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/common/core/2d/point.js +var Point; +var init_point = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/common/core/2d/point.js"() { + Point = class _Point { + static equals(a, b) { + return a.x === b.x && a.y === b.y; + } + constructor(x, y) { + this.x = x; + this.y = y; + } + add(other) { + return new _Point(this.x + other.x, this.y + other.y); + } + deltaX(delta) { + return new _Point(this.x + delta, this.y); + } + deltaY(delta) { + return new _Point(this.x, this.y + delta); + } + toString() { + return `(${this.x},${this.y})`; + } + subtract(other) { + return new _Point(this.x - other.x, this.y - other.y); + } + scale(factor2) { + return new _Point(this.x * factor2, this.y * factor2); + } + mapComponents(map) { + return new _Point(map(this.x), map(this.y)); + } + isZero() { + return this.x === 0 && this.y === 0; + } + withThreshold(threshold) { + return this.mapComponents((axisVal) => { + if (axisVal > threshold) { + return axisVal - threshold; + } else if (axisVal < -threshold) { + return axisVal + threshold; + } + return 0; + }); + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/browser/observableCodeEditor.js +function observableCodeEditor(editor2) { + return ObservableCodeEditor.get(editor2); +} +var ObservableCodeEditor; +var init_observableCodeEditor = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/browser/observableCodeEditor.js"() { + init_equals(); + init_lifecycle(); + init_observable(); + init_lineRange(); + init_offsetRange(); + init_position(); + init_selection(); + init_point(); + ObservableCodeEditor = class _ObservableCodeEditor extends Disposable { + static { + this._map = /* @__PURE__ */ new Map(); + } + /** + * Make sure that editor is not disposed yet! + */ + static get(editor2) { + let result = _ObservableCodeEditor._map.get(editor2); + if (!result) { + result = new _ObservableCodeEditor(editor2); + _ObservableCodeEditor._map.set(editor2, result); + const d = editor2.onDidDispose(() => { + const item = _ObservableCodeEditor._map.get(editor2); + if (item) { + _ObservableCodeEditor._map.delete(editor2); + item.dispose(); + d.dispose(); + } + }); + } + return result; + } + _beginUpdate() { + this._updateCounter++; + if (this._updateCounter === 1) { + this._currentTransaction = new TransactionImpl(() => { + }); + } + } + _endUpdate() { + this._updateCounter--; + if (this._updateCounter === 0) { + const t = this._currentTransaction; + this._currentTransaction = void 0; + t.finish(); + } + } + constructor(editor2) { + super(); + this.editor = editor2; + this._updateCounter = 0; + this._currentTransaction = void 0; + this._model = observableValue(this, this.editor.getModel()); + this.model = this._model; + this.isReadonly = observableFromEvent(this, this.editor.onDidChangeConfiguration, () => this.editor.getOption( + 104 + /* EditorOption.readOnly */ + )); + this._versionId = observableValueOpts({ owner: this, lazy: true }, this.editor.getModel()?.getVersionId() ?? null); + this.versionId = this._versionId; + this._selections = observableValueOpts({ owner: this, equalsFn: equalsIfDefined(itemsEquals(Selection.selectionsEqual)), lazy: true }, this.editor.getSelections() ?? null); + this.selections = this._selections; + this.positions = derivedOpts({ owner: this, equalsFn: equalsIfDefined(itemsEquals(Position.equals)) }, (reader) => this.selections.read(reader)?.map((s) => s.getStartPosition()) ?? null); + this.isFocused = observableFromEvent(this, (e) => { + const d1 = this.editor.onDidFocusEditorWidget(e); + const d2 = this.editor.onDidBlurEditorWidget(e); + return { + dispose() { + d1.dispose(); + d2.dispose(); + } + }; + }, () => this.editor.hasWidgetFocus()); + this.isTextFocused = observableFromEvent(this, (e) => { + const d1 = this.editor.onDidFocusEditorText(e); + const d2 = this.editor.onDidBlurEditorText(e); + return { + dispose() { + d1.dispose(); + d2.dispose(); + } + }; + }, () => this.editor.hasTextFocus()); + this.inComposition = observableFromEvent(this, (e) => { + const d1 = this.editor.onDidCompositionStart(() => { + e(void 0); + }); + const d2 = this.editor.onDidCompositionEnd(() => { + e(void 0); + }); + return { + dispose() { + d1.dispose(); + d2.dispose(); + } + }; + }, () => this.editor.inComposition); + this.value = derivedWithSetter(this, (reader) => { + this.versionId.read(reader); + return this.model.read(reader)?.getValue() ?? ""; + }, (value, tx) => { + const model = this.model.get(); + if (model !== null) { + if (value !== model.getValue()) { + model.setValue(value); + } + } + }); + this.valueIsEmpty = derived(this, (reader) => { + this.versionId.read(reader); + return this.editor.getModel()?.getValueLength() === 0; + }); + this.cursorSelection = derivedOpts({ owner: this, equalsFn: equalsIfDefined(Selection.selectionsEqual) }, (reader) => this.selections.read(reader)?.[0] ?? null); + this.cursorPosition = derivedOpts({ owner: this, equalsFn: Position.equals }, (reader) => this.selections.read(reader)?.[0]?.getPosition() ?? null); + this.cursorLineNumber = derived(this, (reader) => this.cursorPosition.read(reader)?.lineNumber ?? null); + this.onDidType = observableSignal(this); + this.onDidPaste = observableSignal(this); + this.scrollTop = observableFromEvent(this.editor.onDidScrollChange, () => this.editor.getScrollTop()); + this.scrollLeft = observableFromEvent(this.editor.onDidScrollChange, () => this.editor.getScrollLeft()); + this.layoutInfo = observableFromEvent(this.editor.onDidLayoutChange, () => this.editor.getLayoutInfo()); + this.layoutInfoContentLeft = this.layoutInfo.map((l) => l.contentLeft); + this.layoutInfoDecorationsLeft = this.layoutInfo.map((l) => l.decorationsLeft); + this.layoutInfoWidth = this.layoutInfo.map((l) => l.width); + this.layoutInfoHeight = this.layoutInfo.map((l) => l.height); + this.layoutInfoMinimap = this.layoutInfo.map((l) => l.minimap); + this.layoutInfoVerticalScrollbarWidth = this.layoutInfo.map((l) => l.verticalScrollbarWidth); + this.contentWidth = observableFromEvent(this.editor.onDidContentSizeChange, () => this.editor.getContentWidth()); + this.contentHeight = observableFromEvent(this.editor.onDidContentSizeChange, () => this.editor.getContentHeight()); + this._widgetCounter = 0; + this.openedPeekWidgets = observableValue(this, 0); + this._register(this.editor.onBeginUpdate(() => this._beginUpdate())); + this._register(this.editor.onEndUpdate(() => this._endUpdate())); + this._register(this.editor.onDidChangeModel(() => { + this._beginUpdate(); + try { + this._model.set(this.editor.getModel(), this._currentTransaction); + this._forceUpdate(); + } finally { + this._endUpdate(); + } + })); + this._register(this.editor.onDidType((e) => { + this._beginUpdate(); + try { + this._forceUpdate(); + this.onDidType.trigger(this._currentTransaction, e); + } finally { + this._endUpdate(); + } + })); + this._register(this.editor.onDidPaste((e) => { + this._beginUpdate(); + try { + this._forceUpdate(); + this.onDidPaste.trigger(this._currentTransaction, e); + } finally { + this._endUpdate(); + } + })); + this._register(this.editor.onDidChangeModelContent((e) => { + this._beginUpdate(); + try { + this._versionId.set(this.editor.getModel()?.getVersionId() ?? null, this._currentTransaction, e); + this._forceUpdate(); + } finally { + this._endUpdate(); + } + })); + this._register(this.editor.onDidChangeCursorSelection((e) => { + this._beginUpdate(); + try { + this._selections.set(this.editor.getSelections(), this._currentTransaction, e); + this._forceUpdate(); + } finally { + this._endUpdate(); + } + })); + this.domNode = derived((reader) => { + this.model.read(reader); + return this.editor.getDomNode(); + }); + } + forceUpdate(cb) { + this._beginUpdate(); + try { + this._forceUpdate(); + if (!cb) { + return void 0; + } + return cb(this._currentTransaction); + } finally { + this._endUpdate(); + } + } + _forceUpdate() { + this._beginUpdate(); + try { + this._model.set(this.editor.getModel(), this._currentTransaction); + this._versionId.set(this.editor.getModel()?.getVersionId() ?? null, this._currentTransaction, void 0); + this._selections.set(this.editor.getSelections(), this._currentTransaction, void 0); + } finally { + this._endUpdate(); + } + } + getOption(id, debugLocation = DebugLocation.ofCaller()) { + return observableFromEvent(this, (cb) => this.editor.onDidChangeConfiguration((e) => { + if (e.hasChanged(id)) { + cb(void 0); + } + }), () => this.editor.getOption(id), debugLocation); + } + setDecorations(decorations) { + const d = new DisposableStore(); + const decorationsCollection = this.editor.createDecorationsCollection(); + d.add(autorunOpts({ owner: this, debugName: () => `Apply decorations from ${decorations.debugName}` }, (reader) => { + const d2 = decorations.read(reader); + decorationsCollection.set(d2); + })); + d.add({ + dispose: () => { + decorationsCollection.clear(); + } + }); + return d; + } + createOverlayWidget(widget) { + const overlayWidgetId = "observableOverlayWidget" + this._widgetCounter++; + const w = { + getDomNode: () => widget.domNode, + getPosition: () => widget.position.get(), + getId: () => overlayWidgetId, + allowEditorOverflow: widget.allowEditorOverflow, + getMinContentWidthInPx: () => widget.minContentWidthInPx.get() + }; + this.editor.addOverlayWidget(w); + const d = autorun((reader) => { + widget.position.read(reader); + widget.minContentWidthInPx.read(reader); + this.editor.layoutOverlayWidget(w); + }); + return toDisposable(() => { + d.dispose(); + this.editor.removeOverlayWidget(w); + }); + } + createContentWidget(widget) { + const contentWidgetId = "observableContentWidget" + this._widgetCounter++; + const w = { + getDomNode: () => widget.domNode, + getPosition: () => widget.position.get(), + getId: () => contentWidgetId, + allowEditorOverflow: widget.allowEditorOverflow + }; + this.editor.addContentWidget(w); + const d = autorun((reader) => { + widget.position.read(reader); + this.editor.layoutContentWidget(w); + }); + return toDisposable(() => { + d.dispose(); + this.editor.removeContentWidget(w); + }); + } + observeLineOffsetRange(lineRange, store) { + const start = this.observePosition(lineRange.map((r) => new Position(r.startLineNumber, 1)), store); + const end = this.observePosition(lineRange.map((r) => new Position(r.endLineNumberExclusive + 1, 1)), store); + return derived((reader) => { + start.read(reader); + end.read(reader); + const range2 = lineRange.read(reader); + const lineCount = this.model.read(reader)?.getLineCount(); + const s = (typeof lineCount !== "undefined" && range2.startLineNumber > lineCount ? this.editor.getBottomForLineNumber(lineCount) : this.editor.getTopForLineNumber(range2.startLineNumber)) - this.scrollTop.read(reader); + const e = range2.isEmpty ? s : this.editor.getBottomForLineNumber(range2.endLineNumberExclusive - 1) - this.scrollTop.read(reader); + return new OffsetRange(s, e); + }); + } + observePosition(position, store) { + let pos = position.get(); + const result = observableValueOpts({ owner: this, debugName: () => `topLeftOfPosition${pos?.toString()}`, equalsFn: equalsIfDefined(Point.equals) }, new Point(0, 0)); + const contentWidgetId = `observablePositionWidget` + this._widgetCounter++; + const domNode = document.createElement("div"); + const w = { + getDomNode: () => domNode, + getPosition: () => { + return pos ? { preference: [ + 0 + /* ContentWidgetPositionPreference.EXACT */ + ], position: position.get() } : null; + }, + getId: () => contentWidgetId, + allowEditorOverflow: false, + afterRender: (position2, coordinate) => { + const model = this._model.get(); + if (model && pos && pos.lineNumber > model.getLineCount()) { + result.set(new Point(0, this.editor.getBottomForLineNumber(model.getLineCount()) - this.scrollTop.get()), void 0); + } else { + result.set(coordinate ? new Point(coordinate.left, coordinate.top) : null, void 0); + } + } + }; + this.editor.addContentWidget(w); + store.add(autorun((reader) => { + pos = position.read(reader); + this.editor.layoutContentWidget(w); + })); + store.add(toDisposable(() => { + this.editor.removeContentWidget(w); + })); + return result; + } + isTargetHovered(predicate, store) { + const isHovered = observableValue("isInjectedTextHovered", false); + store.add(this.editor.onMouseMove((e) => { + const val = predicate(e); + isHovered.set(val, void 0); + })); + store.add(this.editor.onMouseLeave((E) => { + isHovered.set(false, void 0); + })); + return isHovered; + } + observeLineHeightForPosition(position) { + return derived((reader) => { + const pos = position instanceof Position ? position : position.read(reader); + if (pos === null) { + return null; + } + this.getOption( + 75 + /* EditorOption.lineHeight */ + ).read(reader); + return this.editor.getLineHeightForPosition(pos); + }); + } + observeLineHeightForLine(lineNumber) { + if (typeof lineNumber === "number") { + return this.observeLineHeightForPosition(new Position(lineNumber, 1)); + } + return derived((reader) => { + const line = lineNumber.read(reader); + if (line === null) { + return null; + } + return this.observeLineHeightForPosition(new Position(line, 1)).read(reader); + }); + } + observeLineHeightsForLineRange(lineNumber) { + return derived((reader) => { + const range2 = lineNumber instanceof LineRange ? lineNumber : lineNumber.read(reader); + const heights = []; + for (let i2 = range2.startLineNumber; i2 < range2.endLineNumberExclusive; i2++) { + heights.push(this.observeLineHeightForLine(i2).read(reader)); + } + return heights; + }); + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/browser/widget/diffEditor/features/hideUnchangedRegionsFeature.js +var __decorate42, __param37, HideUnchangedRegionsFeature_1, HideUnchangedRegionsFeature, CompactCollapsedCodeOverlayWidget, CollapsedCodeOverlayWidget; +var init_hideUnchangedRegionsFeature = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/browser/widget/diffEditor/features/hideUnchangedRegionsFeature.js"() { + init_dom(); + init_iconLabels2(); + init_codicons(); + init_htmlContent(); + init_lifecycle(); + init_observable(); + init_themables(); + init_types(); + init_nls(); + init_instantiation(); + init_lineRange(); + init_position(); + init_range(); + init_languages(); + init_observableCodeEditor(); + init_utils5(); + __decorate42 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + __param37 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + HideUnchangedRegionsFeature = class HideUnchangedRegionsFeature2 extends Disposable { + static { + HideUnchangedRegionsFeature_1 = this; + } + static { + this._breadcrumbsSourceFactory = observableValue(this, () => ({ + dispose() { + }, + getBreadcrumbItems(startRange, reader) { + return []; + } + })); + } + static setBreadcrumbsSourceFactory(factory) { + this._breadcrumbsSourceFactory.set(factory, void 0); + } + get isUpdatingHiddenAreas() { + return this._isUpdatingHiddenAreas; + } + constructor(_editors, _diffModel, _options, _instantiationService) { + super(); + this._editors = _editors; + this._diffModel = _diffModel; + this._options = _options; + this._instantiationService = _instantiationService; + this._modifiedOutlineSource = derivedDisposable(this, (reader) => { + const m = this._editors.modifiedModel.read(reader); + const factory = HideUnchangedRegionsFeature_1._breadcrumbsSourceFactory.read(reader); + return !m || !factory ? void 0 : factory(m, this._instantiationService); + }); + this._isUpdatingHiddenAreas = false; + this._register(this._editors.original.onDidChangeCursorPosition((e) => { + if (e.reason === 1) { + return; + } + const m = this._diffModel.get(); + transaction((tx) => { + for (const s of this._editors.original.getSelections() || []) { + m?.ensureOriginalLineIsVisible(s.getStartPosition().lineNumber, 0, tx); + m?.ensureOriginalLineIsVisible(s.getEndPosition().lineNumber, 0, tx); + } + }); + })); + this._register(this._editors.modified.onDidChangeCursorPosition((e) => { + if (e.reason === 1) { + return; + } + const m = this._diffModel.get(); + transaction((tx) => { + for (const s of this._editors.modified.getSelections() || []) { + m?.ensureModifiedLineIsVisible(s.getStartPosition().lineNumber, 0, tx); + m?.ensureModifiedLineIsVisible(s.getEndPosition().lineNumber, 0, tx); + } + }); + })); + const unchangedRegions = this._diffModel.map((m, reader) => { + const regions = m?.unchangedRegions.read(reader) ?? []; + if (regions.length === 1 && regions[0].modifiedLineNumber === 1 && regions[0].lineCount === this._editors.modifiedModel.read(reader)?.getLineCount()) { + return []; + } + return regions; + }); + this.viewZones = derived(this, (reader) => { + const modifiedOutlineSource = this._modifiedOutlineSource.read(reader); + if (!modifiedOutlineSource) { + return { origViewZones: [], modViewZones: [] }; + } + const origViewZones = []; + const modViewZones = []; + const sideBySide = this._options.renderSideBySide.read(reader); + const compactMode = this._options.compactMode.read(reader); + const curUnchangedRegions = unchangedRegions.read(reader); + for (let i2 = 0; i2 < curUnchangedRegions.length; i2++) { + const r = curUnchangedRegions[i2]; + if (r.shouldHideControls(reader)) { + continue; + } + if (compactMode && (i2 === 0 || i2 === curUnchangedRegions.length - 1)) { + continue; + } + if (compactMode) { + { + const d = derived(this, (reader2) => ( + /** @description hiddenOriginalRangeStart */ + r.getHiddenOriginalRange(reader2).startLineNumber - 1 + )); + const origVz = new PlaceholderViewZone(d, 12); + origViewZones.push(origVz); + reader.store.add(new CompactCollapsedCodeOverlayWidget(this._editors.original, origVz, r, !sideBySide)); + } + { + const d = derived(this, (reader2) => ( + /** @description hiddenModifiedRangeStart */ + r.getHiddenModifiedRange(reader2).startLineNumber - 1 + )); + const modViewZone = new PlaceholderViewZone(d, 12); + modViewZones.push(modViewZone); + reader.store.add(new CompactCollapsedCodeOverlayWidget(this._editors.modified, modViewZone, r)); + } + } else { + { + const d = derived(this, (reader2) => ( + /** @description hiddenOriginalRangeStart */ + r.getHiddenOriginalRange(reader2).startLineNumber - 1 + )); + const origVz = new PlaceholderViewZone(d, 24); + origViewZones.push(origVz); + reader.store.add(new CollapsedCodeOverlayWidget(this._editors.original, origVz, r, r.originalUnchangedRange, !sideBySide, modifiedOutlineSource, (l) => this._diffModel.get().ensureModifiedLineIsVisible(l, 2, void 0), this._options)); + } + { + const d = derived(this, (reader2) => ( + /** @description hiddenModifiedRangeStart */ + r.getHiddenModifiedRange(reader2).startLineNumber - 1 + )); + const modViewZone = new PlaceholderViewZone(d, 24); + modViewZones.push(modViewZone); + reader.store.add(new CollapsedCodeOverlayWidget(this._editors.modified, modViewZone, r, r.modifiedUnchangedRange, false, modifiedOutlineSource, (l) => this._diffModel.get().ensureModifiedLineIsVisible(l, 2, void 0), this._options)); + } + } + } + return { origViewZones, modViewZones }; + }); + const unchangedLinesDecoration = { + description: "unchanged lines", + className: "diff-unchanged-lines", + isWholeLine: true + }; + const unchangedLinesDecorationShow = { + description: "Fold Unchanged", + glyphMarginHoverMessage: new MarkdownString(void 0, { isTrusted: true, supportThemeIcons: true }).appendMarkdown(localize(124, "Fold Unchanged Region")), + glyphMarginClassName: "fold-unchanged " + ThemeIcon.asClassName(Codicon.fold), + zIndex: 10001 + }; + this._register(applyObservableDecorations(this._editors.original, derived(this, (reader) => { + const curUnchangedRegions = unchangedRegions.read(reader); + const result = curUnchangedRegions.map((r) => ({ + range: r.originalUnchangedRange.toInclusiveRange(), + options: unchangedLinesDecoration + })); + for (const r of curUnchangedRegions) { + if (r.shouldHideControls(reader)) { + result.push({ + range: Range.fromPositions(new Position(r.originalLineNumber, 1)), + options: unchangedLinesDecorationShow + }); + } + } + return result; + }))); + this._register(applyObservableDecorations(this._editors.modified, derived(this, (reader) => { + const curUnchangedRegions = unchangedRegions.read(reader); + const result = curUnchangedRegions.map((r) => ({ + range: r.modifiedUnchangedRange.toInclusiveRange(), + options: unchangedLinesDecoration + })); + for (const r of curUnchangedRegions) { + if (r.shouldHideControls(reader)) { + result.push({ + range: LineRange.ofLength(r.modifiedLineNumber, 1).toInclusiveRange(), + options: unchangedLinesDecorationShow + }); + } + } + return result; + }))); + this._register(autorun((reader) => { + const curUnchangedRegions = unchangedRegions.read(reader); + this._isUpdatingHiddenAreas = true; + try { + this._editors.original.setHiddenAreas(curUnchangedRegions.map((r) => r.getHiddenOriginalRange(reader).toInclusiveRange()).filter(isDefined)); + this._editors.modified.setHiddenAreas(curUnchangedRegions.map((r) => r.getHiddenModifiedRange(reader).toInclusiveRange()).filter(isDefined)); + } finally { + this._isUpdatingHiddenAreas = false; + } + })); + this._register(this._editors.modified.onMouseUp((event) => { + if (!event.event.rightButton && event.target.position && event.target.element?.className.includes("fold-unchanged")) { + const lineNumber = event.target.position.lineNumber; + const model = this._diffModel.get(); + if (!model) { + return; + } + const region = model.unchangedRegions.get().find((r) => r.modifiedUnchangedRange.contains(lineNumber)); + if (!region) { + return; + } + region.collapseAll(void 0); + event.event.stopPropagation(); + event.event.preventDefault(); + } + })); + this._register(this._editors.original.onMouseUp((event) => { + if (!event.event.rightButton && event.target.position && event.target.element?.className.includes("fold-unchanged")) { + const lineNumber = event.target.position.lineNumber; + const model = this._diffModel.get(); + if (!model) { + return; + } + const region = model.unchangedRegions.get().find((r) => r.originalUnchangedRange.contains(lineNumber)); + if (!region) { + return; + } + region.collapseAll(void 0); + event.event.stopPropagation(); + event.event.preventDefault(); + } + })); + } + }; + HideUnchangedRegionsFeature = HideUnchangedRegionsFeature_1 = __decorate42([ + __param37(3, IInstantiationService) + ], HideUnchangedRegionsFeature); + CompactCollapsedCodeOverlayWidget = class extends ViewZoneOverlayWidget { + constructor(editor2, _viewZone, _unchangedRegion, _hide = false) { + const root = h("div.diff-hidden-lines-widget"); + super(editor2, _viewZone, root.root); + this._unchangedRegion = _unchangedRegion; + this._hide = _hide; + this._nodes = h("div.diff-hidden-lines-compact", [ + h("div.line-left", []), + h("div.text@text", []), + h("div.line-right", []) + ]); + root.root.appendChild(this._nodes.root); + if (this._hide) { + this._nodes.root.replaceChildren(); + } + this._register(autorun((reader) => { + if (!this._hide) { + const lineCount = this._unchangedRegion.getHiddenModifiedRange(reader).length; + const linesHiddenText = localize(125, "{0} hidden lines", lineCount); + this._nodes.text.innerText = linesHiddenText; + } + })); + } + }; + CollapsedCodeOverlayWidget = class extends ViewZoneOverlayWidget { + constructor(_editor, _viewZone, _unchangedRegion, _unchangedRegionRange, _hide, _modifiedOutlineSource, _revealModifiedHiddenLine, _options) { + const root = h("div.diff-hidden-lines-widget"); + super(_editor, _viewZone, root.root); + this._editor = _editor; + this._unchangedRegion = _unchangedRegion; + this._unchangedRegionRange = _unchangedRegionRange; + this._hide = _hide; + this._modifiedOutlineSource = _modifiedOutlineSource; + this._revealModifiedHiddenLine = _revealModifiedHiddenLine; + this._options = _options; + this._nodes = h("div.diff-hidden-lines", [ + h("div.top@top", { title: localize(126, "Click or drag to show more above") }), + h("div.center@content", { style: { display: "flex" } }, [ + h("div@first", { style: { display: "flex", justifyContent: "center", alignItems: "center", flexShrink: "0" } }, [$("a", { title: localize(127, "Show Unchanged Region"), role: "button", onclick: () => { + this._unchangedRegion.showAll(void 0); + } }, ...renderLabelWithIcons("$(unfold)"))]), + h("div@others", { style: { display: "flex", justifyContent: "center", alignItems: "center" } }) + ]), + h("div.bottom@bottom", { title: localize(128, "Click or drag to show more below"), role: "button" }) + ]); + root.root.appendChild(this._nodes.root); + if (!this._hide) { + this._register(applyStyle(this._nodes.first, { width: observableCodeEditor(this._editor).layoutInfoContentLeft })); + } else { + reset(this._nodes.first); + } + this._register(autorun((reader) => { + const isFullyRevealed = this._unchangedRegion.visibleLineCountTop.read(reader) + this._unchangedRegion.visibleLineCountBottom.read(reader) === this._unchangedRegion.lineCount; + this._nodes.bottom.classList.toggle("canMoveTop", !isFullyRevealed); + this._nodes.bottom.classList.toggle("canMoveBottom", this._unchangedRegion.visibleLineCountBottom.read(reader) > 0); + this._nodes.top.classList.toggle("canMoveTop", this._unchangedRegion.visibleLineCountTop.read(reader) > 0); + this._nodes.top.classList.toggle("canMoveBottom", !isFullyRevealed); + const isDragged = this._unchangedRegion.isDragged.read(reader); + const domNode = this._editor.getDomNode(); + if (domNode) { + domNode.classList.toggle("draggingUnchangedRegion", !!isDragged); + if (isDragged === "top") { + domNode.classList.toggle("canMoveTop", this._unchangedRegion.visibleLineCountTop.read(reader) > 0); + domNode.classList.toggle("canMoveBottom", !isFullyRevealed); + } else if (isDragged === "bottom") { + domNode.classList.toggle("canMoveTop", !isFullyRevealed); + domNode.classList.toggle("canMoveBottom", this._unchangedRegion.visibleLineCountBottom.read(reader) > 0); + } else { + domNode.classList.toggle("canMoveTop", false); + domNode.classList.toggle("canMoveBottom", false); + } + } + })); + const editor2 = this._editor; + this._register(addDisposableListener(this._nodes.top, "mousedown", (e) => { + if (e.button !== 0) { + return; + } + this._nodes.top.classList.toggle("dragging", true); + this._nodes.root.classList.toggle("dragging", true); + e.preventDefault(); + const startTop = e.clientY; + let didMove = false; + const cur = this._unchangedRegion.visibleLineCountTop.get(); + this._unchangedRegion.isDragged.set("top", void 0); + const window2 = getWindow(this._nodes.top); + const mouseMoveListener = addDisposableListener(window2, "mousemove", (e2) => { + const currentTop = e2.clientY; + const delta = currentTop - startTop; + didMove = didMove || Math.abs(delta) > 2; + const lineDelta = Math.round(delta / editor2.getOption( + 75 + /* EditorOption.lineHeight */ + )); + const newVal = Math.max(0, Math.min(cur + lineDelta, this._unchangedRegion.getMaxVisibleLineCountTop())); + this._unchangedRegion.visibleLineCountTop.set(newVal, void 0); + }); + const mouseUpListener = addDisposableListener(window2, "mouseup", (e2) => { + if (!didMove) { + this._unchangedRegion.showMoreAbove(this._options.hideUnchangedRegionsRevealLineCount.get(), void 0); + } + this._nodes.top.classList.toggle("dragging", false); + this._nodes.root.classList.toggle("dragging", false); + this._unchangedRegion.isDragged.set(void 0, void 0); + mouseMoveListener.dispose(); + mouseUpListener.dispose(); + }); + })); + this._register(addDisposableListener(this._nodes.bottom, "mousedown", (e) => { + if (e.button !== 0) { + return; + } + this._nodes.bottom.classList.toggle("dragging", true); + this._nodes.root.classList.toggle("dragging", true); + e.preventDefault(); + const startTop = e.clientY; + let didMove = false; + const cur = this._unchangedRegion.visibleLineCountBottom.get(); + this._unchangedRegion.isDragged.set("bottom", void 0); + const window2 = getWindow(this._nodes.bottom); + const mouseMoveListener = addDisposableListener(window2, "mousemove", (e2) => { + const currentTop = e2.clientY; + const delta = currentTop - startTop; + didMove = didMove || Math.abs(delta) > 2; + const lineDelta = Math.round(delta / editor2.getOption( + 75 + /* EditorOption.lineHeight */ + )); + const newVal = Math.max(0, Math.min(cur - lineDelta, this._unchangedRegion.getMaxVisibleLineCountBottom())); + const top = this._unchangedRegionRange.endLineNumberExclusive > editor2.getModel().getLineCount() ? editor2.getContentHeight() : editor2.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive); + this._unchangedRegion.visibleLineCountBottom.set(newVal, void 0); + const top2 = this._unchangedRegionRange.endLineNumberExclusive > editor2.getModel().getLineCount() ? editor2.getContentHeight() : editor2.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive); + editor2.setScrollTop(editor2.getScrollTop() + (top2 - top)); + }); + const mouseUpListener = addDisposableListener(window2, "mouseup", (e2) => { + this._unchangedRegion.isDragged.set(void 0, void 0); + if (!didMove) { + const top = editor2.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive); + this._unchangedRegion.showMoreBelow(this._options.hideUnchangedRegionsRevealLineCount.get(), void 0); + const top2 = editor2.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive); + editor2.setScrollTop(editor2.getScrollTop() + (top2 - top)); + } + this._nodes.bottom.classList.toggle("dragging", false); + this._nodes.root.classList.toggle("dragging", false); + mouseMoveListener.dispose(); + mouseUpListener.dispose(); + }); + })); + this._register(autorun((reader) => { + const children = []; + if (!this._hide) { + const lineCount = _unchangedRegion.getHiddenModifiedRange(reader).length; + const linesHiddenText = localize(129, "{0} hidden lines", lineCount); + const span = $("span", { title: localize(130, "Double click to unfold") }, linesHiddenText); + span.addEventListener("dblclick", (e) => { + if (e.button !== 0) { + return; + } + e.preventDefault(); + this._unchangedRegion.showAll(void 0); + }); + children.push(span); + const range2 = this._unchangedRegion.getHiddenModifiedRange(reader); + const items = this._modifiedOutlineSource.getBreadcrumbItems(range2, reader); + if (items.length > 0) { + children.push($("span", void 0, "\xA0\xA0|\xA0\xA0")); + for (let i2 = 0; i2 < items.length; i2++) { + const item = items[i2]; + const icon = SymbolKinds.toIcon(item.kind); + const divItem = h("div.breadcrumb-item", { + style: { display: "flex", alignItems: "center" } + }, [ + renderIcon(icon), + "\xA0", + item.name, + ...i2 === items.length - 1 ? [] : [renderIcon(Codicon.chevronRight)] + ]).root; + children.push(divItem); + divItem.onclick = () => { + this._revealModifiedHiddenLine(item.startLineNumber); + }; + } + } + } + reset(this._nodes.others, ...children); + })); + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/editorState/browser/keybindingCancellation.js +var IEditorCancellationTokens, ctxCancellableOperation, EditorKeybindingCancellationTokenSource; +var init_keybindingCancellation = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/contrib/editorState/browser/keybindingCancellation.js"() { + init_editorExtensions(); + init_contextkey(); + init_cancellation(); + init_linkedList(); + init_instantiation(); + init_extensions(); + init_nls(); + IEditorCancellationTokens = createDecorator("IEditorCancelService"); + ctxCancellableOperation = new RawContextKey("cancellableOperation", false, localize(939, "Whether the editor runs a cancellable operation, e.g. like 'Peek References'")); + registerSingleton( + IEditorCancellationTokens, + class { + constructor() { + this._tokens = /* @__PURE__ */ new WeakMap(); + } + add(editor2, cts) { + let data = this._tokens.get(editor2); + if (!data) { + data = editor2.invokeWithinContext((accessor) => { + const key = ctxCancellableOperation.bindTo(accessor.get(IContextKeyService)); + const tokens = new LinkedList(); + return { key, tokens }; + }); + this._tokens.set(editor2, data); + } + let removeFn; + data.key.set(true); + removeFn = data.tokens.push(cts); + return () => { + if (removeFn) { + removeFn(); + data.key.set(!data.tokens.isEmpty()); + removeFn = void 0; + } + }; + } + cancel(editor2) { + const data = this._tokens.get(editor2); + if (!data) { + return; + } + const cts = data.tokens.pop(); + if (cts) { + cts.cancel(); + data.key.set(!data.tokens.isEmpty()); + } + } + }, + 1 + /* InstantiationType.Delayed */ + ); + EditorKeybindingCancellationTokenSource = class extends CancellationTokenSource { + constructor(editor2, parent) { + super(parent); + this.editor = editor2; + this._unregister = editor2.invokeWithinContext((accessor) => accessor.get(IEditorCancellationTokens).add(editor2, this)); + } + dispose() { + this._unregister(); + super.dispose(); + } + }; + registerEditorCommand(new class extends EditorCommand { + constructor() { + super({ + id: "editor.cancelOperation", + kbOpts: { + weight: 100, + primary: 9 + /* KeyCode.Escape */ + }, + precondition: ctxCancellableOperation + }); + } + runEditorCommand(accessor, editor2) { + accessor.get(IEditorCancellationTokens).cancel(editor2); + } + }()); + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/editorState/browser/editorState.js +var EditorState, EditorStateCancellationTokenSource, TextModelCancellationTokenSource; +var init_editorState = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/contrib/editorState/browser/editorState.js"() { + init_strings(); + init_range(); + init_cancellation(); + init_lifecycle(); + init_keybindingCancellation(); + EditorState = class _EditorState { + constructor(editor2, flags) { + this.flags = flags; + if ((this.flags & 1) !== 0) { + const model = editor2.getModel(); + this.modelVersionId = model ? format("{0}#{1}", model.uri.toString(), model.getVersionId()) : null; + } else { + this.modelVersionId = null; + } + if ((this.flags & 4) !== 0) { + this.position = editor2.getPosition(); + } else { + this.position = null; + } + if ((this.flags & 2) !== 0) { + this.selection = editor2.getSelection(); + } else { + this.selection = null; + } + if ((this.flags & 8) !== 0) { + this.scrollLeft = editor2.getScrollLeft(); + this.scrollTop = editor2.getScrollTop(); + } else { + this.scrollLeft = -1; + this.scrollTop = -1; + } + } + _equals(other) { + if (!(other instanceof _EditorState)) { + return false; + } + const state = other; + if (this.modelVersionId !== state.modelVersionId) { + return false; + } + if (this.scrollLeft !== state.scrollLeft || this.scrollTop !== state.scrollTop) { + return false; + } + if (!this.position && state.position || this.position && !state.position || this.position && state.position && !this.position.equals(state.position)) { + return false; + } + if (!this.selection && state.selection || this.selection && !state.selection || this.selection && state.selection && !this.selection.equalsRange(state.selection)) { + return false; + } + return true; + } + validate(editor2) { + return this._equals(new _EditorState(editor2, this.flags)); + } + }; + EditorStateCancellationTokenSource = class extends EditorKeybindingCancellationTokenSource { + constructor(editor2, flags, range2, parent) { + super(editor2, parent); + this._listener = new DisposableStore(); + if (flags & 4) { + this._listener.add(editor2.onDidChangeCursorPosition((e) => { + if (!range2 || !Range.containsPosition(range2, e.position)) { + this.cancel(); + } + })); + } + if (flags & 2) { + this._listener.add(editor2.onDidChangeCursorSelection((e) => { + if (!range2 || !Range.containsRange(range2, e.selection)) { + this.cancel(); + } + })); + } + if (flags & 8) { + this._listener.add(editor2.onDidScrollChange((_) => this.cancel())); + } + if (flags & 1) { + this._listener.add(editor2.onDidChangeModel((_) => this.cancel())); + this._listener.add(editor2.onDidChangeModelContent((_) => this.cancel())); + } + } + dispose() { + this._listener.dispose(); + super.dispose(); + } + }; + TextModelCancellationTokenSource = class extends CancellationTokenSource { + constructor(model, parent) { + super(parent); + this._listener = model.onDidChangeContent(() => this.cancel()); + } + dispose() { + this._listener.dispose(); + super.dispose(); + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/platform/environment/common/environment.js +var IEnvironmentService; +var init_environment = __esm({ + "node_modules/monaco-editor-core/esm/vs/platform/environment/common/environment.js"() { + init_instantiation(); + IEnvironmentService = createDecorator("environmentService"); + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/common/services/languageFeatureDebounce.js +var __decorate57, __param52, ILanguageFeatureDebounceService, IdentityHash, NullDebounceInformation, FeatureDebounceInformation, LanguageFeatureDebounceService; +var init_languageFeatureDebounce = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/common/services/languageFeatureDebounce.js"() { + init_hash(); + init_map(); + init_numbers(); + init_environment(); + init_extensions(); + init_instantiation(); + init_log(); + init_network(); + __decorate57 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + __param52 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + ILanguageFeatureDebounceService = createDecorator("ILanguageFeatureDebounceService"); + (function(IdentityHash2) { + const _hashes = /* @__PURE__ */ new WeakMap(); + let pool = 0; + function of(obj) { + let value = _hashes.get(obj); + if (value === void 0) { + value = ++pool; + _hashes.set(obj, value); + } + return value; + } + IdentityHash2.of = of; + })(IdentityHash || (IdentityHash = {})); + NullDebounceInformation = class { + constructor(_default) { + this._default = _default; + } + get(_model) { + return this._default; + } + update(_model, _value) { + return this._default; + } + default() { + return this._default; + } + }; + FeatureDebounceInformation = class { + constructor(_logService, _name, _registry2, _default, _min, _max) { + this._logService = _logService; + this._name = _name; + this._registry = _registry2; + this._default = _default; + this._min = _min; + this._max = _max; + this._cache = new LRUCache(50, 0.7); + } + _key(model) { + return model.id + this._registry.all(model).reduce((hashVal, obj) => doHash(IdentityHash.of(obj), hashVal), 0); + } + get(model) { + const key = this._key(model); + const avg = this._cache.get(key); + return avg ? clamp(avg.value, this._min, this._max) : this.default(); + } + update(model, value) { + const key = this._key(model); + let avg = this._cache.get(key); + if (!avg) { + avg = new SlidingWindowAverage(6); + this._cache.set(key, avg); + } + const newValue = clamp(avg.update(value), this._min, this._max); + if (!matchesScheme(model.uri, "output")) { + this._logService.trace(`[DEBOUNCE: ${this._name}] for ${model.uri.toString()} is ${newValue}ms`); + } + return newValue; + } + _overall() { + const result = new MovingAverage(); + for (const [, avg] of this._cache) { + result.update(avg.value); + } + return result.value; + } + default() { + const value = this._overall() | 0 || this._default; + return clamp(value, this._min, this._max); + } + }; + LanguageFeatureDebounceService = class LanguageFeatureDebounceService2 { + constructor(_logService, envService) { + this._logService = _logService; + this._data = /* @__PURE__ */ new Map(); + this._isDev = envService.isExtensionDevelopment || !envService.isBuilt; + } + for(feature, name, config) { + const min = config?.min ?? 50; + const max = config?.max ?? min ** 2; + const extra = config?.key ?? void 0; + const key = `${IdentityHash.of(feature)},${min}${extra ? "," + extra : ""}`; + let info = this._data.get(key); + if (!info) { + if (this._isDev) { + this._logService.debug(`[DEBOUNCE: ${name}] is disabled in developed mode`); + info = new NullDebounceInformation(min * 1.5); + } else { + info = new FeatureDebounceInformation( + this._logService, + name, + feature, + this._overallAverage() | 0 || min * 1.5, + // default is overall default or derived from min-value + min, + max + ); + } + this._data.set(key, info); + } + return info; + } + _overallAverage() { + const result = new MovingAverage(); + for (const info of this._data.values()) { + result.update(info.default()); + } + return result.value; + } + }; + LanguageFeatureDebounceService = __decorate57([ + __param52(0, ILogService), + __param52(1, IEnvironmentService) + ], LanguageFeatureDebounceService); + registerSingleton( + ILanguageFeatureDebounceService, + LanguageFeatureDebounceService, + 1 + /* InstantiationType.Delayed */ + ); + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/documentSymbols/browser/outlineModel.js +var __decorate95, __param89, TreeElement, OutlineElement, OutlineGroup, OutlineModel, IOutlineModelService, OutlineModelService; +var init_outlineModel = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/contrib/documentSymbols/browser/outlineModel.js"() { + init_arrays(); + init_cancellation(); + init_errors(); + init_iterator(); + init_map(); + init_position(); + init_range(); + init_languageFeatureDebounce(); + init_instantiation(); + init_extensions(); + init_model(); + init_lifecycle(); + init_languageFeatures(); + __decorate95 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + __param89 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + TreeElement = class { + remove() { + this.parent?.children.delete(this.id); + } + static findId(candidate, container) { + let candidateId; + if (typeof candidate === "string") { + candidateId = `${container.id}/${candidate}`; + } else { + candidateId = `${container.id}/${candidate.name}`; + if (container.children.get(candidateId) !== void 0) { + candidateId = `${container.id}/${candidate.name}_${candidate.range.startLineNumber}_${candidate.range.startColumn}`; + } + } + let id = candidateId; + for (let i2 = 0; container.children.get(id) !== void 0; i2++) { + id = `${candidateId}_${i2}`; + } + return id; + } + static empty(element) { + return element.children.size === 0; + } + }; + OutlineElement = class extends TreeElement { + constructor(id, parent, symbol) { + super(); + this.id = id; + this.parent = parent; + this.symbol = symbol; + this.children = /* @__PURE__ */ new Map(); + } + }; + OutlineGroup = class extends TreeElement { + constructor(id, parent, label, order) { + super(); + this.id = id; + this.parent = parent; + this.label = label; + this.order = order; + this.children = /* @__PURE__ */ new Map(); + } + }; + OutlineModel = class _OutlineModel extends TreeElement { + static create(registry, textModel, token) { + const cts = new CancellationTokenSource(token); + const result = new _OutlineModel(textModel.uri); + const provider = registry.ordered(textModel); + const promises = provider.map((provider2, index) => { + const id = TreeElement.findId(`provider_${index}`, result); + const group = new OutlineGroup(id, result, provider2.displayName ?? "Unknown Outline Provider", index); + return Promise.resolve(provider2.provideDocumentSymbols(textModel, cts.token)).then((result2) => { + for (const info of result2 || []) { + _OutlineModel._makeOutlineElement(info, group); + } + return group; + }, (err) => { + onUnexpectedExternalError(err); + return group; + }).then((group2) => { + if (!TreeElement.empty(group2)) { + result._groups.set(id, group2); + } else { + group2.remove(); + } + }); + }); + const listener = registry.onDidChange(() => { + const newProvider = registry.ordered(textModel); + if (!equals(newProvider, provider)) { + cts.cancel(); + } + }); + return Promise.all(promises).then(() => { + if (cts.token.isCancellationRequested && !token.isCancellationRequested) { + return _OutlineModel.create(registry, textModel, token); + } else { + return result._compact(); + } + }).finally(() => { + cts.dispose(); + listener.dispose(); + cts.dispose(); + }); + } + static _makeOutlineElement(info, container) { + const id = TreeElement.findId(info, container); + const res = new OutlineElement(id, container, info); + if (info.children) { + for (const childInfo of info.children) { + _OutlineModel._makeOutlineElement(childInfo, res); + } + } + container.children.set(res.id, res); + } + constructor(uri) { + super(); + this.uri = uri; + this.id = "root"; + this.parent = void 0; + this._groups = /* @__PURE__ */ new Map(); + this.children = /* @__PURE__ */ new Map(); + this.id = "root"; + this.parent = void 0; + } + _compact() { + let count = 0; + for (const [key, group] of this._groups) { + if (group.children.size === 0) { + this._groups.delete(key); + } else { + count += 1; + } + } + if (count !== 1) { + this.children = this._groups; + } else { + const group = Iterable.first(this._groups.values()); + for (const [, child] of group.children) { + child.parent = this; + this.children.set(child.id, child); + } + } + return this; + } + getTopLevelSymbols() { + const roots = []; + for (const child of this.children.values()) { + if (child instanceof OutlineElement) { + roots.push(child.symbol); + } else { + roots.push(...Iterable.map(child.children.values(), (child2) => child2.symbol)); + } + } + return roots.sort((a, b) => Range.compareRangesUsingStarts(a.range, b.range)); + } + asListOfDocumentSymbols() { + const roots = this.getTopLevelSymbols(); + const bucket = []; + _OutlineModel._flattenDocumentSymbols(bucket, roots, ""); + return bucket.sort((a, b) => Position.compare(Range.getStartPosition(a.range), Range.getStartPosition(b.range)) || Position.compare(Range.getEndPosition(b.range), Range.getEndPosition(a.range))); + } + static _flattenDocumentSymbols(bucket, entries2, overrideContainerLabel) { + for (const entry of entries2) { + bucket.push({ + kind: entry.kind, + tags: entry.tags, + name: entry.name, + detail: entry.detail, + containerName: entry.containerName || overrideContainerLabel, + range: entry.range, + selectionRange: entry.selectionRange, + children: void 0 + // we flatten it... + }); + if (entry.children) { + _OutlineModel._flattenDocumentSymbols(bucket, entry.children, entry.name); + } + } + } + }; + IOutlineModelService = createDecorator("IOutlineModelService"); + OutlineModelService = class OutlineModelService2 { + constructor(_languageFeaturesService, debounces, modelService) { + this._languageFeaturesService = _languageFeaturesService; + this._disposables = new DisposableStore(); + this._cache = new LRUCache(15, 0.7); + this._debounceInformation = debounces.for(_languageFeaturesService.documentSymbolProvider, "DocumentSymbols", { min: 350 }); + this._disposables.add(modelService.onModelRemoved((textModel) => { + this._cache.delete(textModel.id); + })); + } + dispose() { + this._disposables.dispose(); + } + async getOrCreate(textModel, token) { + const registry = this._languageFeaturesService.documentSymbolProvider; + const provider = registry.ordered(textModel); + let data = this._cache.get(textModel.id); + if (!data || data.versionId !== textModel.getVersionId() || !equals(data.provider, provider)) { + const source = new CancellationTokenSource(); + data = { + versionId: textModel.getVersionId(), + provider, + promiseCnt: 0, + source, + promise: OutlineModel.create(registry, textModel, source.token), + model: void 0 + }; + this._cache.set(textModel.id, data); + const now = Date.now(); + data.promise.then((outlineModel) => { + data.model = outlineModel; + this._debounceInformation.update(textModel, Date.now() - now); + }).catch((_err) => { + this._cache.delete(textModel.id); + }); + } + if (data.model) { + return data.model; + } + data.promiseCnt += 1; + const listener = token.onCancellationRequested(() => { + if (--data.promiseCnt === 0) { + data.source.cancel(); + this._cache.delete(textModel.id); + } + }); + try { + return await data.promise; + } finally { + listener.dispose(); + } + } + }; + OutlineModelService = __decorate95([ + __param89(0, ILanguageFeaturesService), + __param89(1, ILanguageFeatureDebounceService), + __param89(2, IModelService) + ], OutlineModelService); + registerSingleton( + IOutlineModelService, + OutlineModelService, + 1 + /* InstantiationType.Delayed */ + ); + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/inPlaceReplace/browser/inPlaceReplaceCommand.js +var InPlaceReplaceCommand; +var init_inPlaceReplaceCommand = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/contrib/inPlaceReplace/browser/inPlaceReplaceCommand.js"() { + init_selection(); + InPlaceReplaceCommand = class { + constructor(editRange, originalSelection, text2) { + this._editRange = editRange; + this._originalSelection = originalSelection; + this._text = text2; + } + getEditOperations(model, builder) { + builder.addTrackedEditOperation(this._editRange, this._text); + } + computeCursorState(model, helper) { + const inverseEditOperations = helper.getInverseEditOperations(); + const srcRange = inverseEditOperations[0].range; + if (!this._originalSelection.isEmpty()) { + return new Selection(srcRange.endLineNumber, srcRange.endColumn - this._text.length, srcRange.endLineNumber, srcRange.endColumn); + } + return new Selection(srcRange.endLineNumber, Math.min(this._originalSelection.positionColumn, srcRange.endColumn), srcRange.endLineNumber, Math.min(this._originalSelection.positionColumn, srcRange.endColumn)); + } + }; + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/inPlaceReplace/browser/inPlaceReplace.css +var init_inPlaceReplace = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/contrib/inPlaceReplace/browser/inPlaceReplace.css"() { + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/inPlaceReplace/browser/inPlaceReplace.js +var require_inPlaceReplace = __commonJS({ + "node_modules/monaco-editor-core/esm/vs/editor/contrib/inPlaceReplace/browser/inPlaceReplace.js"(exports) { + init_async(); + init_errors(); + init_editorState(); + init_editorExtensions(); + init_range(); + init_selection(); + init_editorContextKeys(); + init_textModel(); + init_editorWorker(); + init_nls(); + init_inPlaceReplaceCommand(); + init_inPlaceReplace(); + var __decorate198 = exports && exports.__decorate || function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + var __param191 = exports && exports.__param || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var InPlaceReplaceController_1; + var InPlaceReplaceController = class InPlaceReplaceController { + static { + InPlaceReplaceController_1 = this; + } + static { + this.ID = "editor.contrib.inPlaceReplaceController"; + } + static get(editor2) { + return editor2.getContribution(InPlaceReplaceController_1.ID); + } + static { + this.DECORATION = ModelDecorationOptions.register({ + description: "in-place-replace", + className: "valueSetReplacement" + }); + } + constructor(editor2, editorWorkerService) { + this.editor = editor2; + this.editorWorkerService = editorWorkerService; + this.decorations = this.editor.createDecorationsCollection(); + } + dispose() { + } + run(source, up) { + this.currentRequest?.cancel(); + const editorSelection = this.editor.getSelection(); + const model = this.editor.getModel(); + if (!model || !editorSelection) { + return void 0; + } + let selection = editorSelection; + if (selection.startLineNumber !== selection.endLineNumber) { + return void 0; + } + const state = new EditorState( + this.editor, + 1 | 4 + /* CodeEditorStateFlag.Position */ + ); + const modelURI = model.uri; + if (!this.editorWorkerService.canNavigateValueSet(modelURI)) { + return Promise.resolve(void 0); + } + this.currentRequest = createCancelablePromise((token) => this.editorWorkerService.navigateValueSet(modelURI, selection, up)); + return this.currentRequest.then((result) => { + if (!result || !result.range || !result.value) { + return; + } + if (!state.validate(this.editor)) { + return; + } + const editRange = Range.lift(result.range); + let highlightRange2 = result.range; + const diff = result.value.length - (selection.endColumn - selection.startColumn); + highlightRange2 = { + startLineNumber: highlightRange2.startLineNumber, + startColumn: highlightRange2.startColumn, + endLineNumber: highlightRange2.endLineNumber, + endColumn: highlightRange2.startColumn + result.value.length + }; + if (diff > 1) { + selection = new Selection(selection.startLineNumber, selection.startColumn, selection.endLineNumber, selection.endColumn + diff - 1); + } + const command = new InPlaceReplaceCommand(editRange, selection, result.value); + this.editor.pushUndoStop(); + this.editor.executeCommand(source, command); + this.editor.pushUndoStop(); + this.decorations.set([{ + range: highlightRange2, + options: InPlaceReplaceController_1.DECORATION + }]); + this.decorationRemover?.cancel(); + this.decorationRemover = timeout(350); + this.decorationRemover.then(() => this.decorations.clear()).catch(onUnexpectedError); + }).catch(onUnexpectedError); + } + }; + InPlaceReplaceController = InPlaceReplaceController_1 = __decorate198([ + __param191(1, IEditorWorkerService) + ], InPlaceReplaceController); + var InPlaceReplaceUp = class extends EditorAction { + constructor() { + super({ + id: "editor.action.inPlaceReplace.up", + label: localize2(1240, "Replace with Previous Value"), + precondition: EditorContextKeys.writable, + kbOpts: { + kbExpr: EditorContextKeys.editorTextFocus, + primary: 2048 | 1024 | 87, + weight: 100 + /* KeybindingWeight.EditorContrib */ + } + }); + } + run(accessor, editor2) { + const controller = InPlaceReplaceController.get(editor2); + if (!controller) { + return Promise.resolve(void 0); + } + return controller.run(this.id, false); + } + }; + var InPlaceReplaceDown = class extends EditorAction { + constructor() { + super({ + id: "editor.action.inPlaceReplace.down", + label: localize2(1241, "Replace with Next Value"), + precondition: EditorContextKeys.writable, + kbOpts: { + kbExpr: EditorContextKeys.editorTextFocus, + primary: 2048 | 1024 | 89, + weight: 100 + /* KeybindingWeight.EditorContrib */ + } + }); + } + run(accessor, editor2) { + const controller = InPlaceReplaceController.get(editor2); + if (!controller) { + return Promise.resolve(void 0); + } + return controller.run(this.id, true); + } + }; + registerEditorContribution( + InPlaceReplaceController.ID, + InPlaceReplaceController, + 4 + /* EditorContributionInstantiation.Lazy */ + ); + registerEditorAction(InPlaceReplaceUp); + registerEditorAction(InPlaceReplaceDown); + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/diffEditorBreadcrumbs/browser/contribution.js +var require_contribution = __commonJS({ + "node_modules/monaco-editor-core/esm/vs/editor/contrib/diffEditorBreadcrumbs/browser/contribution.js"(exports) { + init_arrays(); + init_observable(); + init_hideUnchangedRegionsFeature(); + init_utils5(); + init_languageFeatures(); + init_outlineModel(); + init_lifecycle(); + init_event(); + var __decorate198 = exports && exports.__decorate || function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + var __param191 = exports && exports.__param || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var DiffEditorBreadcrumbsSource = class DiffEditorBreadcrumbsSource extends Disposable { + constructor(_textModel, _languageFeaturesService, _outlineModelService) { + super(); + this._textModel = _textModel; + this._languageFeaturesService = _languageFeaturesService; + this._outlineModelService = _outlineModelService; + this._currentModel = observableValue(this, void 0); + const documentSymbolProviderChanged = observableSignalFromEvent("documentSymbolProvider.onDidChange", this._languageFeaturesService.documentSymbolProvider.onDidChange); + const textModelChanged = observableSignalFromEvent("_textModel.onDidChangeContent", Event.debounce((e) => this._textModel.onDidChangeContent(e), () => void 0, 100)); + this._register(autorunWithStore(async (reader, store) => { + documentSymbolProviderChanged.read(reader); + textModelChanged.read(reader); + const src = store.add(new DisposableCancellationTokenSource()); + const model = await this._outlineModelService.getOrCreate(this._textModel, src.token); + if (store.isDisposed) { + return; + } + this._currentModel.set(model, void 0); + })); + } + getBreadcrumbItems(startRange, reader) { + const m = this._currentModel.read(reader); + if (!m) { + return []; + } + const symbols = m.asListOfDocumentSymbols().filter((s) => startRange.contains(s.range.startLineNumber) && !startRange.contains(s.range.endLineNumber)); + symbols.sort(reverseOrder(compareBy((s) => s.range.endLineNumber - s.range.startLineNumber, numberComparator))); + return symbols.map((s) => ({ name: s.name, kind: s.kind, startLineNumber: s.range.startLineNumber })); + } + }; + DiffEditorBreadcrumbsSource = __decorate198([ + __param191(1, ILanguageFeaturesService), + __param191(2, IOutlineModelService) + ], DiffEditorBreadcrumbsSource); + HideUnchangedRegionsFeature.setBreadcrumbsSourceFactory((textModel, instantiationService) => { + return instantiationService.createInstance(DiffEditorBreadcrumbsSource, textModel); + }); + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/common/standaloneStrings.js +var InspectTokensNLS, GoToLineNLS, QuickHelpNLS, QuickCommandNLS, QuickOutlineNLS, StandaloneCodeEditorNLS, ToggleHighContrastNLS, StandaloneServicesNLS; +var init_standaloneStrings = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/common/standaloneStrings.js"() { + init_nls(); + (function(InspectTokensNLS2) { + InspectTokensNLS2.inspectTokensAction = localize(786, "Developer: Inspect Tokens"); + })(InspectTokensNLS || (InspectTokensNLS = {})); + (function(GoToLineNLS2) { + GoToLineNLS2.gotoLineActionLabel = localize(787, "Go to Line/Column..."); + })(GoToLineNLS || (GoToLineNLS = {})); + (function(QuickHelpNLS2) { + QuickHelpNLS2.helpQuickAccessActionLabel = localize(788, "Show all Quick Access Providers"); + })(QuickHelpNLS || (QuickHelpNLS = {})); + (function(QuickCommandNLS2) { + QuickCommandNLS2.quickCommandActionLabel = localize(789, "Command Palette"); + QuickCommandNLS2.quickCommandHelp = localize(790, "Show And Run Commands"); + })(QuickCommandNLS || (QuickCommandNLS = {})); + (function(QuickOutlineNLS2) { + QuickOutlineNLS2.quickOutlineActionLabel = localize(791, "Go to Symbol..."); + QuickOutlineNLS2.quickOutlineByCategoryActionLabel = localize(792, "Go to Symbol by Category..."); + })(QuickOutlineNLS || (QuickOutlineNLS = {})); + (function(StandaloneCodeEditorNLS2) { + StandaloneCodeEditorNLS2.editorViewAccessibleLabel = localize(793, "Editor content"); + })(StandaloneCodeEditorNLS || (StandaloneCodeEditorNLS = {})); + (function(ToggleHighContrastNLS2) { + ToggleHighContrastNLS2.toggleHighContrast = localize(794, "Toggle High Contrast Theme"); + })(ToggleHighContrastNLS || (ToggleHighContrastNLS = {})); + (function(StandaloneServicesNLS2) { + StandaloneServicesNLS2.bulkEditServiceSummary = localize(795, "Made {0} edits in {1} files"); + })(StandaloneServicesNLS || (StandaloneServicesNLS = {})); + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/standalone/browser/inspectTokens/inspectTokens.css +var init_inspectTokens = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/standalone/browser/inspectTokens/inspectTokens.css"() { + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/standalone/common/standaloneTheme.js +var IStandaloneThemeService; +var init_standaloneTheme = __esm({ + "node_modules/monaco-editor-core/esm/vs/editor/standalone/common/standaloneTheme.js"() { + init_instantiation(); + IStandaloneThemeService = createDecorator("themeService"); + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/standalone/browser/inspectTokens/inspectTokens.js +var require_inspectTokens = __commonJS({ + "node_modules/monaco-editor-core/esm/vs/editor/standalone/browser/inspectTokens/inspectTokens.js"(exports) { + init_inspectTokens(); + init_dom(); + init_color(); + init_lifecycle(); + init_editorExtensions(); + init_languages(); + init_encodedTokenAttributes(); + init_nullTokenize(); + init_language(); + init_standaloneTheme(); + init_standaloneStrings(); + var __decorate198 = exports && exports.__decorate || function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + var __param191 = exports && exports.__param || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + var InspectTokensController_1; + var InspectTokensController = class InspectTokensController extends Disposable { + static { + InspectTokensController_1 = this; + } + static { + this.ID = "editor.contrib.inspectTokens"; + } + static get(editor2) { + return editor2.getContribution(InspectTokensController_1.ID); + } + constructor(editor2, standaloneColorService, languageService) { + super(); + this._editor = editor2; + this._languageService = languageService; + this._widget = null; + this._register(this._editor.onDidChangeModel((e) => this.stop())); + this._register(this._editor.onDidChangeModelLanguage((e) => this.stop())); + this._register(TokenizationRegistry2.onDidChange((e) => this.stop())); + this._register(this._editor.onKeyUp((e) => e.keyCode === 9 && this.stop())); + } + dispose() { + this.stop(); + super.dispose(); + } + launch() { + if (this._widget) { + return; + } + if (!this._editor.hasModel()) { + return; + } + this._widget = new InspectTokensWidget(this._editor, this._languageService); + } + stop() { + if (this._widget) { + this._widget.dispose(); + this._widget = null; + } + } + }; + InspectTokensController = InspectTokensController_1 = __decorate198([ + __param191(1, IStandaloneThemeService), + __param191(2, ILanguageService) + ], InspectTokensController); + var InspectTokens = class extends EditorAction { + constructor() { + super({ + id: "editor.action.inspectTokens", + label: InspectTokensNLS.inspectTokensAction, + alias: "Developer: Inspect Tokens", + precondition: void 0 + }); + } + run(accessor, editor2) { + const controller = InspectTokensController.get(editor2); + controller?.launch(); + } + }; + function renderTokenText(tokenText) { + let result = ""; + for (let charIndex = 0, len = tokenText.length; charIndex < len; charIndex++) { + const charCode = tokenText.charCodeAt(charIndex); + switch (charCode) { + case 9: + result += "\u2192"; + break; + case 32: + result += "\xB7"; + break; + default: + result += String.fromCharCode(charCode); + } + } + return result; + } + function getSafeTokenizationSupport2(languageIdCodec, languageId) { + const tokenizationSupport = TokenizationRegistry2.get(languageId); + if (tokenizationSupport) { + return tokenizationSupport; + } + const encodedLanguageId = languageIdCodec.encodeLanguageId(languageId); + return { + getInitialState: () => NullState, + tokenize: (line, hasEOL, state) => nullTokenize(languageId, state), + tokenizeEncoded: (line, hasEOL, state) => nullTokenizeEncoded(encodedLanguageId, state) + }; + } + var InspectTokensWidget = class _InspectTokensWidget extends Disposable { + static { + this._ID = "editor.contrib.inspectTokensWidget"; + } + constructor(editor2, languageService) { + super(); + this.allowEditorOverflow = true; + this._editor = editor2; + this._languageService = languageService; + this._model = this._editor.getModel(); + this._domNode = document.createElement("div"); + this._domNode.className = "tokens-inspect-widget"; + this._tokenizationSupport = getSafeTokenizationSupport2(this._languageService.languageIdCodec, this._model.getLanguageId()); + this._compute(this._editor.getPosition()); + this._register(this._editor.onDidChangeCursorPosition((e) => this._compute(this._editor.getPosition()))); + this._editor.addContentWidget(this); + } + dispose() { + this._editor.removeContentWidget(this); + super.dispose(); + } + getId() { + return _InspectTokensWidget._ID; + } + _compute(position) { + const data = this._getTokensAtLine(position.lineNumber); + let token1Index = 0; + for (let i2 = data.tokens1.length - 1; i2 >= 0; i2--) { + const t = data.tokens1[i2]; + if (position.column - 1 >= t.offset) { + token1Index = i2; + break; + } + } + let token2Index = 0; + for (let i2 = data.tokens2.length >>> 1; i2 >= 0; i2--) { + if (position.column - 1 >= data.tokens2[i2 << 1]) { + token2Index = i2; + break; + } + } + const lineContent = this._model.getLineContent(position.lineNumber); + let tokenText = ""; + if (token1Index < data.tokens1.length) { + const tokenStartIndex = data.tokens1[token1Index].offset; + const tokenEndIndex = token1Index + 1 < data.tokens1.length ? data.tokens1[token1Index + 1].offset : lineContent.length; + tokenText = lineContent.substring(tokenStartIndex, tokenEndIndex); + } + reset(this._domNode, $("h2.tm-token", void 0, renderTokenText(tokenText), $("span.tm-token-length", void 0, `${tokenText.length} ${tokenText.length === 1 ? "char" : "chars"}`))); + append(this._domNode, $("hr.tokens-inspect-separator", { "style": "clear:both" })); + const metadata = (token2Index << 1) + 1 < data.tokens2.length ? this._decodeMetadata(data.tokens2[(token2Index << 1) + 1]) : null; + append(this._domNode, $("table.tm-metadata-table", void 0, $("tbody", void 0, $("tr", void 0, $("td.tm-metadata-key", void 0, "language"), $("td.tm-metadata-value", void 0, `${metadata ? metadata.languageId : "-?-"}`)), $("tr", void 0, $("td.tm-metadata-key", void 0, "token type"), $("td.tm-metadata-value", void 0, `${metadata ? this._tokenTypeToString(metadata.tokenType) : "-?-"}`)), $("tr", void 0, $("td.tm-metadata-key", void 0, "font style"), $("td.tm-metadata-value", void 0, `${metadata ? this._fontStyleToString(metadata.fontStyle) : "-?-"}`)), $("tr", void 0, $("td.tm-metadata-key", void 0, "foreground"), $("td.tm-metadata-value", void 0, `${metadata ? Color.Format.CSS.formatHex(metadata.foreground) : "-?-"}`)), $("tr", void 0, $("td.tm-metadata-key", void 0, "background"), $("td.tm-metadata-value", void 0, `${metadata ? Color.Format.CSS.formatHex(metadata.background) : "-?-"}`))))); + append(this._domNode, $("hr.tokens-inspect-separator")); + if (token1Index < data.tokens1.length) { + append(this._domNode, $("span.tm-token-type", void 0, data.tokens1[token1Index].type)); + } + this._editor.layoutContentWidget(this); + } + _decodeMetadata(metadata) { + const colorMap = TokenizationRegistry2.getColorMap(); + const languageId = TokenMetadata.getLanguageId(metadata); + const tokenType = TokenMetadata.getTokenType(metadata); + const fontStyle = TokenMetadata.getFontStyle(metadata); + const foreground2 = TokenMetadata.getForeground(metadata); + const background = TokenMetadata.getBackground(metadata); + return { + languageId: this._languageService.languageIdCodec.decodeLanguageId(languageId), + tokenType, + fontStyle, + foreground: colorMap[foreground2], + background: colorMap[background] + }; + } + _tokenTypeToString(tokenType) { + switch (tokenType) { + case 0: + return "Other"; + case 1: + return "Comment"; + case 2: + return "String"; + case 3: + return "RegEx"; + default: + return "??"; + } + } + _fontStyleToString(fontStyle) { + let r = ""; + if (fontStyle & 1) { + r += "italic "; + } + if (fontStyle & 2) { + r += "bold "; + } + if (fontStyle & 4) { + r += "underline "; + } + if (fontStyle & 8) { + r += "strikethrough "; + } + if (r.length === 0) { + r = "---"; + } + return r; + } + _getTokensAtLine(lineNumber) { + const stateBeforeLine = this._getStateBeforeLine(lineNumber); + const tokenizationResult1 = this._tokenizationSupport.tokenize(this._model.getLineContent(lineNumber), true, stateBeforeLine); + const tokenizationResult2 = this._tokenizationSupport.tokenizeEncoded(this._model.getLineContent(lineNumber), true, stateBeforeLine); + return { + startState: stateBeforeLine, + tokens1: tokenizationResult1.tokens, + tokens2: tokenizationResult2.tokens, + endState: tokenizationResult1.endState + }; + } + _getStateBeforeLine(lineNumber) { + let state = this._tokenizationSupport.getInitialState(); + for (let i2 = 1; i2 < lineNumber; i2++) { + const tokenizationResult = this._tokenizationSupport.tokenize(this._model.getLineContent(i2), true, state); + state = tokenizationResult.endState; + } + return state; + } + getDomNode() { + return this._domNode; + } + getPosition() { + return { + position: this._editor.getPosition(), + preference: [ + 2, + 1 + /* ContentWidgetPositionPreference.ABOVE */ + ] + }; + } + }; + registerEditorContribution( + InspectTokensController.ID, + InspectTokensController, + 4 + /* EditorContributionInstantiation.Lazy */ + ); + registerEditorAction(InspectTokens); + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/browser/coreCommands.js +init_nls(); +init_browser(); +init_types(); + +// node_modules/monaco-editor-core/esm/vs/base/browser/ui/aria/aria.js +init_dom(); +var MAX_MESSAGE_LENGTH = 2e4; +var ariaContainer; +var alertContainer; +var alertContainer2; +var statusContainer; +var statusContainer2; +function setARIAContainer(parent) { + ariaContainer = document.createElement("div"); + ariaContainer.className = "monaco-aria-container"; + const createAlertContainer = () => { + const element = document.createElement("div"); + element.className = "monaco-alert"; + element.setAttribute("role", "alert"); + element.setAttribute("aria-atomic", "true"); + ariaContainer.appendChild(element); + return element; + }; + alertContainer = createAlertContainer(); + alertContainer2 = createAlertContainer(); + const createStatusContainer = () => { + const element = document.createElement("div"); + element.className = "monaco-status"; + element.setAttribute("aria-live", "polite"); + element.setAttribute("aria-atomic", "true"); + ariaContainer.appendChild(element); + return element; + }; + statusContainer = createStatusContainer(); + statusContainer2 = createStatusContainer(); + parent.appendChild(ariaContainer); +} +function alert(msg) { + if (!ariaContainer) { + return; + } + if (alertContainer.textContent !== msg) { + clearNode(alertContainer2); + insertMessage(alertContainer, msg); + } else { + clearNode(alertContainer); + insertMessage(alertContainer2, msg); + } +} +function status(msg) { + if (!ariaContainer) { + return; + } + if (statusContainer.textContent !== msg) { + clearNode(statusContainer2); + insertMessage(statusContainer, msg); + } else { + clearNode(statusContainer); + insertMessage(statusContainer2, msg); + } +} +function insertMessage(target, msg) { + clearNode(target); + if (msg.length > MAX_MESSAGE_LENGTH) { + msg = msg.substr(0, MAX_MESSAGE_LENGTH); + } + target.textContent = msg; + target.style.visibility = "hidden"; + target.style.visibility = "visible"; +} + +// node_modules/monaco-editor-core/esm/vs/editor/browser/coreCommands.js +init_editorExtensions(); +init_codeEditorService(); + +// node_modules/monaco-editor-core/esm/vs/editor/common/cursorCommon.js +init_position(); +init_range(); +init_selection(); +init_supports(); +init_cursorColumns(); +init_indentation(); + +// node_modules/monaco-editor-core/esm/vs/editor/common/inputMode.js +init_event(); +var InputModeImpl = class { + constructor() { + this._inputMode = "insert"; + this._onDidChangeInputMode = new Emitter(); + this.onDidChangeInputMode = this._onDidChangeInputMode.event; + } + getInputMode() { + return this._inputMode; + } +}; +var InputMode = new InputModeImpl(); + +// node_modules/monaco-editor-core/esm/vs/editor/common/cursorCommon.js +var autoCloseAlways = () => true; +var autoCloseNever = () => false; +var autoCloseBeforeWhitespace = (chr) => chr === " " || chr === " "; +var CursorConfiguration = class { + static shouldRecreate(e) { + return e.hasChanged( + 165 + /* EditorOption.layoutInfo */ + ) || e.hasChanged( + 148 + /* EditorOption.wordSeparators */ + ) || e.hasChanged( + 45 + /* EditorOption.emptySelectionClipboard */ + ) || e.hasChanged( + 85 + /* EditorOption.multiCursorMergeOverlapping */ + ) || e.hasChanged( + 88 + /* EditorOption.multiCursorPaste */ + ) || e.hasChanged( + 89 + /* EditorOption.multiCursorLimit */ + ) || e.hasChanged( + 10 + /* EditorOption.autoClosingBrackets */ + ) || e.hasChanged( + 11 + /* EditorOption.autoClosingComments */ + ) || e.hasChanged( + 15 + /* EditorOption.autoClosingQuotes */ + ) || e.hasChanged( + 13 + /* EditorOption.autoClosingDelete */ + ) || e.hasChanged( + 14 + /* EditorOption.autoClosingOvertype */ + ) || e.hasChanged( + 20 + /* EditorOption.autoSurround */ + ) || e.hasChanged( + 145 + /* EditorOption.useTabStops */ + ) || e.hasChanged( + 141 + /* EditorOption.trimWhitespaceOnDelete */ + ) || e.hasChanged( + 59 + /* EditorOption.fontInfo */ + ) || e.hasChanged( + 104 + /* EditorOption.readOnly */ + ) || e.hasChanged( + 147 + /* EditorOption.wordSegmenterLocales */ + ) || e.hasChanged( + 93 + /* EditorOption.overtypeOnPaste */ + ); + } + constructor(languageId, modelOptions, configuration, languageConfigurationService) { + this.languageConfigurationService = languageConfigurationService; + this._cursorMoveConfigurationBrand = void 0; + this._languageId = languageId; + const options2 = configuration.options; + const layoutInfo = options2.get( + 165 + /* EditorOption.layoutInfo */ + ); + const fontInfo = options2.get( + 59 + /* EditorOption.fontInfo */ + ); + this.readOnly = options2.get( + 104 + /* EditorOption.readOnly */ + ); + this.tabSize = modelOptions.tabSize; + this.indentSize = modelOptions.indentSize; + this.insertSpaces = modelOptions.insertSpaces; + this.stickyTabStops = options2.get( + 132 + /* EditorOption.stickyTabStops */ + ); + this.lineHeight = fontInfo.lineHeight; + this.typicalHalfwidthCharacterWidth = fontInfo.typicalHalfwidthCharacterWidth; + this.pageSize = Math.max(1, Math.floor(layoutInfo.height / this.lineHeight) - 2); + this.useTabStops = options2.get( + 145 + /* EditorOption.useTabStops */ + ); + this.trimWhitespaceOnDelete = options2.get( + 141 + /* EditorOption.trimWhitespaceOnDelete */ + ); + this.wordSeparators = options2.get( + 148 + /* EditorOption.wordSeparators */ + ); + this.emptySelectionClipboard = options2.get( + 45 + /* EditorOption.emptySelectionClipboard */ + ); + this.copyWithSyntaxHighlighting = options2.get( + 31 + /* EditorOption.copyWithSyntaxHighlighting */ + ); + this.multiCursorMergeOverlapping = options2.get( + 85 + /* EditorOption.multiCursorMergeOverlapping */ + ); + this.multiCursorPaste = options2.get( + 88 + /* EditorOption.multiCursorPaste */ + ); + this.multiCursorLimit = options2.get( + 89 + /* EditorOption.multiCursorLimit */ + ); + this.autoClosingBrackets = options2.get( + 10 + /* EditorOption.autoClosingBrackets */ + ); + this.autoClosingComments = options2.get( + 11 + /* EditorOption.autoClosingComments */ + ); + this.autoClosingQuotes = options2.get( + 15 + /* EditorOption.autoClosingQuotes */ + ); + this.autoClosingDelete = options2.get( + 13 + /* EditorOption.autoClosingDelete */ + ); + this.autoClosingOvertype = options2.get( + 14 + /* EditorOption.autoClosingOvertype */ + ); + this.autoSurround = options2.get( + 20 + /* EditorOption.autoSurround */ + ); + this.autoIndent = options2.get( + 16 + /* EditorOption.autoIndent */ + ); + this.wordSegmenterLocales = options2.get( + 147 + /* EditorOption.wordSegmenterLocales */ + ); + this.overtypeOnPaste = options2.get( + 93 + /* EditorOption.overtypeOnPaste */ + ); + this.surroundingPairs = {}; + this._electricChars = null; + this.shouldAutoCloseBefore = { + quote: this._getShouldAutoClose(languageId, this.autoClosingQuotes, true), + comment: this._getShouldAutoClose(languageId, this.autoClosingComments, false), + bracket: this._getShouldAutoClose(languageId, this.autoClosingBrackets, false) + }; + this.autoClosingPairs = this.languageConfigurationService.getLanguageConfiguration(languageId).getAutoClosingPairs(); + const surroundingPairs = this.languageConfigurationService.getLanguageConfiguration(languageId).getSurroundingPairs(); + if (surroundingPairs) { + for (const pair of surroundingPairs) { + this.surroundingPairs[pair.open] = pair.close; + } + } + const commentsConfiguration = this.languageConfigurationService.getLanguageConfiguration(languageId).comments; + this.blockCommentStartToken = commentsConfiguration?.blockCommentStartToken ?? null; + } + get electricChars() { + if (!this._electricChars) { + this._electricChars = {}; + const electricChars = this.languageConfigurationService.getLanguageConfiguration(this._languageId).electricCharacter?.getElectricCharacters(); + if (electricChars) { + for (const char of electricChars) { + this._electricChars[char] = true; + } + } + } + return this._electricChars; + } + get inputMode() { + return InputMode.getInputMode(); + } + /** + * Should return opening bracket type to match indentation with + */ + onElectricCharacter(character, context, column) { + const scopedLineTokens = createScopedLineTokens(context, column - 1); + const electricCharacterSupport = this.languageConfigurationService.getLanguageConfiguration(scopedLineTokens.languageId).electricCharacter; + if (!electricCharacterSupport) { + return null; + } + return electricCharacterSupport.onElectricCharacter(character, scopedLineTokens, column - scopedLineTokens.firstCharOffset); + } + normalizeIndentation(str) { + return normalizeIndentation(str, this.indentSize, this.insertSpaces); + } + _getShouldAutoClose(languageId, autoCloseConfig, forQuotes) { + switch (autoCloseConfig) { + case "beforeWhitespace": + return autoCloseBeforeWhitespace; + case "languageDefined": + return this._getLanguageDefinedShouldAutoClose(languageId, forQuotes); + case "always": + return autoCloseAlways; + case "never": + return autoCloseNever; + } + } + _getLanguageDefinedShouldAutoClose(languageId, forQuotes) { + const autoCloseBeforeSet = this.languageConfigurationService.getLanguageConfiguration(languageId).getAutoCloseBeforeSet(forQuotes); + return (c) => autoCloseBeforeSet.indexOf(c) !== -1; + } + /** + * Returns a visible column from a column. + * @see {@link CursorColumns} + */ + visibleColumnFromColumn(model, position) { + return CursorColumns.visibleColumnFromColumn(model.getLineContent(position.lineNumber), position.column, this.tabSize); + } + /** + * Returns a visible column from a column. + * @see {@link CursorColumns} + */ + columnFromVisibleColumn(model, lineNumber, visibleColumn) { + const result = CursorColumns.columnFromVisibleColumn(model.getLineContent(lineNumber), visibleColumn, this.tabSize); + const minColumn = model.getLineMinColumn(lineNumber); + if (result < minColumn) { + return minColumn; + } + const maxColumn = model.getLineMaxColumn(lineNumber); + if (result > maxColumn) { + return maxColumn; + } + return result; + } +}; +var CursorState = class _CursorState { + static fromModelState(modelState) { + return new PartialModelCursorState(modelState); + } + static fromViewState(viewState) { + return new PartialViewCursorState(viewState); + } + static fromModelSelection(modelSelection) { + const selection = Selection.liftSelection(modelSelection); + const modelState = new SingleCursorState(Range.fromPositions(selection.getSelectionStart()), 0, 0, selection.getPosition(), 0); + return _CursorState.fromModelState(modelState); + } + static fromModelSelections(modelSelections) { + const states = []; + for (let i2 = 0, len = modelSelections.length; i2 < len; i2++) { + states[i2] = this.fromModelSelection(modelSelections[i2]); + } + return states; + } + constructor(modelState, viewState) { + this._cursorStateBrand = void 0; + this.modelState = modelState; + this.viewState = viewState; + } + equals(other) { + return this.viewState.equals(other.viewState) && this.modelState.equals(other.modelState); + } +}; +var PartialModelCursorState = class { + constructor(modelState) { + this.modelState = modelState; + this.viewState = null; + } +}; +var PartialViewCursorState = class { + constructor(viewState) { + this.modelState = null; + this.viewState = viewState; + } +}; +var SingleCursorState = class _SingleCursorState { + constructor(selectionStart, selectionStartKind, selectionStartLeftoverVisibleColumns, position, leftoverVisibleColumns) { + this.selectionStart = selectionStart; + this.selectionStartKind = selectionStartKind; + this.selectionStartLeftoverVisibleColumns = selectionStartLeftoverVisibleColumns; + this.position = position; + this.leftoverVisibleColumns = leftoverVisibleColumns; + this._singleCursorStateBrand = void 0; + this.selection = _SingleCursorState._computeSelection(this.selectionStart, this.position); + } + equals(other) { + return this.selectionStartLeftoverVisibleColumns === other.selectionStartLeftoverVisibleColumns && this.leftoverVisibleColumns === other.leftoverVisibleColumns && this.selectionStartKind === other.selectionStartKind && this.position.equals(other.position) && this.selectionStart.equalsRange(other.selectionStart); + } + hasSelection() { + return !this.selection.isEmpty() || !this.selectionStart.isEmpty(); + } + move(inSelectionMode, lineNumber, column, leftoverVisibleColumns) { + if (inSelectionMode) { + return new _SingleCursorState(this.selectionStart, this.selectionStartKind, this.selectionStartLeftoverVisibleColumns, new Position(lineNumber, column), leftoverVisibleColumns); + } else { + return new _SingleCursorState(new Range(lineNumber, column, lineNumber, column), 0, leftoverVisibleColumns, new Position(lineNumber, column), leftoverVisibleColumns); + } + } + static _computeSelection(selectionStart, position) { + if (selectionStart.isEmpty() || !position.isBeforeOrEqual(selectionStart.getStartPosition())) { + return Selection.fromPositions(selectionStart.getStartPosition(), position); + } else { + return Selection.fromPositions(selectionStart.getEndPosition(), position); + } + } +}; +var EditOperationResult = class { + constructor(type, commands, opts) { + this._editOperationResultBrand = void 0; + this.type = type; + this.commands = commands; + this.shouldPushStackElementBefore = opts.shouldPushStackElementBefore; + this.shouldPushStackElementAfter = opts.shouldPushStackElementAfter; + } +}; +function isQuote(ch) { + return ch === "'" || ch === '"' || ch === "`"; +} + +// node_modules/monaco-editor-core/esm/vs/editor/common/cursor/cursorColumnSelection.js +init_position(); +init_range(); +var ColumnSelection = class _ColumnSelection { + static columnSelect(config, model, fromLineNumber, fromVisibleColumn, toLineNumber, toVisibleColumn) { + const lineCount = Math.abs(toLineNumber - fromLineNumber) + 1; + const reversed = fromLineNumber > toLineNumber; + const isRTL = fromVisibleColumn > toVisibleColumn; + const isLTR = fromVisibleColumn < toVisibleColumn; + const result = []; + for (let i2 = 0; i2 < lineCount; i2++) { + const lineNumber = fromLineNumber + (reversed ? -i2 : i2); + const startColumn = config.columnFromVisibleColumn(model, lineNumber, fromVisibleColumn); + const endColumn = config.columnFromVisibleColumn(model, lineNumber, toVisibleColumn); + const visibleStartColumn = config.visibleColumnFromColumn(model, new Position(lineNumber, startColumn)); + const visibleEndColumn = config.visibleColumnFromColumn(model, new Position(lineNumber, endColumn)); + if (isLTR) { + if (visibleStartColumn > toVisibleColumn) { + continue; + } + if (visibleEndColumn < fromVisibleColumn) { + continue; + } + } + if (isRTL) { + if (visibleEndColumn > fromVisibleColumn) { + continue; + } + if (visibleStartColumn < toVisibleColumn) { + continue; + } + } + result.push(new SingleCursorState(new Range(lineNumber, startColumn, lineNumber, startColumn), 0, 0, new Position(lineNumber, endColumn), 0)); + } + if (result.length === 0) { + for (let i2 = 0; i2 < lineCount; i2++) { + const lineNumber = fromLineNumber + (reversed ? -i2 : i2); + const maxColumn = model.getLineMaxColumn(lineNumber); + result.push(new SingleCursorState(new Range(lineNumber, maxColumn, lineNumber, maxColumn), 0, 0, new Position(lineNumber, maxColumn), 0)); + } + } + return { + viewStates: result, + reversed, + fromLineNumber, + fromVisualColumn: fromVisibleColumn, + toLineNumber, + toVisualColumn: toVisibleColumn + }; + } + static columnSelectLeft(config, model, prevColumnSelectData) { + let toViewVisualColumn = prevColumnSelectData.toViewVisualColumn; + if (toViewVisualColumn > 0) { + toViewVisualColumn--; + } + return _ColumnSelection.columnSelect(config, model, prevColumnSelectData.fromViewLineNumber, prevColumnSelectData.fromViewVisualColumn, prevColumnSelectData.toViewLineNumber, toViewVisualColumn); + } + static columnSelectRight(config, model, prevColumnSelectData) { + let maxVisualViewColumn = 0; + const minViewLineNumber = Math.min(prevColumnSelectData.fromViewLineNumber, prevColumnSelectData.toViewLineNumber); + const maxViewLineNumber = Math.max(prevColumnSelectData.fromViewLineNumber, prevColumnSelectData.toViewLineNumber); + for (let lineNumber = minViewLineNumber; lineNumber <= maxViewLineNumber; lineNumber++) { + const lineMaxViewColumn = model.getLineMaxColumn(lineNumber); + const lineMaxVisualViewColumn = config.visibleColumnFromColumn(model, new Position(lineNumber, lineMaxViewColumn)); + maxVisualViewColumn = Math.max(maxVisualViewColumn, lineMaxVisualViewColumn); + } + let toViewVisualColumn = prevColumnSelectData.toViewVisualColumn; + if (toViewVisualColumn < maxVisualViewColumn) { + toViewVisualColumn++; + } + return this.columnSelect(config, model, prevColumnSelectData.fromViewLineNumber, prevColumnSelectData.fromViewVisualColumn, prevColumnSelectData.toViewLineNumber, toViewVisualColumn); + } + static columnSelectUp(config, model, prevColumnSelectData, isPaged) { + const linesCount = isPaged ? config.pageSize : 1; + const toViewLineNumber = Math.max(1, prevColumnSelectData.toViewLineNumber - linesCount); + return this.columnSelect(config, model, prevColumnSelectData.fromViewLineNumber, prevColumnSelectData.fromViewVisualColumn, toViewLineNumber, prevColumnSelectData.toViewVisualColumn); + } + static columnSelectDown(config, model, prevColumnSelectData, isPaged) { + const linesCount = isPaged ? config.pageSize : 1; + const toViewLineNumber = Math.min(model.getLineCount(), prevColumnSelectData.toViewLineNumber + linesCount); + return this.columnSelect(config, model, prevColumnSelectData.fromViewLineNumber, prevColumnSelectData.fromViewVisualColumn, toViewLineNumber, prevColumnSelectData.toViewVisualColumn); + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/common/cursor/cursorDeleteOperations.js +init_strings(); + +// node_modules/monaco-editor-core/esm/vs/editor/common/commands/replaceCommand.js +init_position(); +init_range(); +init_selection(); +var ReplaceCommand = class { + constructor(range2, text2, insertsAutoWhitespace = false) { + this._range = range2; + this._text = text2; + this.insertsAutoWhitespace = insertsAutoWhitespace; + } + getEditOperations(model, builder) { + builder.addTrackedEditOperation(this._range, this._text); + } + computeCursorState(model, helper) { + const inverseEditOperations = helper.getInverseEditOperations(); + const srcRange = inverseEditOperations[0].range; + return Selection.fromPositions(srcRange.getEndPosition()); + } +}; +var ReplaceOvertypeCommand = class { + constructor(range2, text2, insertsAutoWhitespace = false) { + this._range = range2; + this._text = text2; + this.insertsAutoWhitespace = insertsAutoWhitespace; + } + getEditOperations(model, builder) { + const intialStartPosition = this._range.getStartPosition(); + const initialEndPosition = this._range.getEndPosition(); + const initialEndLineNumber = initialEndPosition.lineNumber; + const offsetDelta = this._text.length + (this._range.isEmpty() ? 0 : -1); + let endPosition = addPositiveOffsetToModelPosition(model, initialEndPosition, offsetDelta); + if (endPosition.lineNumber > initialEndLineNumber) { + endPosition = new Position(initialEndLineNumber, model.getLineMaxColumn(initialEndLineNumber)); + } + const replaceRange = Range.fromPositions(intialStartPosition, endPosition); + builder.addTrackedEditOperation(replaceRange, this._text); + } + computeCursorState(model, helper) { + const inverseEditOperations = helper.getInverseEditOperations(); + const srcRange = inverseEditOperations[0].range; + return Selection.fromPositions(srcRange.getEndPosition()); + } +}; +var ReplaceCommandThatSelectsText = class { + constructor(range2, text2) { + this._range = range2; + this._text = text2; + } + getEditOperations(model, builder) { + builder.addTrackedEditOperation(this._range, this._text); + } + computeCursorState(model, helper) { + const inverseEditOperations = helper.getInverseEditOperations(); + const srcRange = inverseEditOperations[0].range; + return Selection.fromRange( + srcRange, + 0 + /* SelectionDirection.LTR */ + ); + } +}; +var ReplaceCommandWithoutChangingPosition = class { + constructor(range2, text2, insertsAutoWhitespace = false) { + this._range = range2; + this._text = text2; + this.insertsAutoWhitespace = insertsAutoWhitespace; + } + getEditOperations(model, builder) { + builder.addTrackedEditOperation(this._range, this._text); + } + computeCursorState(model, helper) { + const inverseEditOperations = helper.getInverseEditOperations(); + const srcRange = inverseEditOperations[0].range; + return Selection.fromPositions(srcRange.getStartPosition()); + } +}; +var ReplaceCommandWithOffsetCursorState = class { + constructor(range2, text2, lineNumberDeltaOffset, columnDeltaOffset, insertsAutoWhitespace = false) { + this._range = range2; + this._text = text2; + this._columnDeltaOffset = columnDeltaOffset; + this._lineNumberDeltaOffset = lineNumberDeltaOffset; + this.insertsAutoWhitespace = insertsAutoWhitespace; + } + getEditOperations(model, builder) { + builder.addTrackedEditOperation(this._range, this._text); + } + computeCursorState(model, helper) { + const inverseEditOperations = helper.getInverseEditOperations(); + const srcRange = inverseEditOperations[0].range; + return Selection.fromPositions(srcRange.getEndPosition().delta(this._lineNumberDeltaOffset, this._columnDeltaOffset)); + } +}; +var ReplaceOvertypeCommandOnCompositionEnd = class { + constructor(range2) { + this._range = range2; + } + getEditOperations(model, builder) { + const text2 = model.getValueInRange(this._range); + const initialEndPosition = this._range.getEndPosition(); + const initialEndLineNumber = initialEndPosition.lineNumber; + let endPosition = addPositiveOffsetToModelPosition(model, initialEndPosition, text2.length); + if (endPosition.lineNumber > initialEndLineNumber) { + endPosition = new Position(initialEndLineNumber, model.getLineMaxColumn(initialEndLineNumber)); + } + const replaceRange = Range.fromPositions(initialEndPosition, endPosition); + builder.addTrackedEditOperation(replaceRange, ""); + } + computeCursorState(model, helper) { + const inverseEditOperations = helper.getInverseEditOperations(); + const srcRange = inverseEditOperations[0].range; + return Selection.fromPositions(srcRange.getEndPosition()); + } +}; +var ReplaceCommandThatPreservesSelection = class { + constructor(editRange, text2, initialSelection, forceMoveMarkers = false) { + this._range = editRange; + this._text = text2; + this._initialSelection = initialSelection; + this._forceMoveMarkers = forceMoveMarkers; + this._selectionId = null; + } + getEditOperations(model, builder) { + builder.addTrackedEditOperation(this._range, this._text, this._forceMoveMarkers); + this._selectionId = builder.trackSelection(this._initialSelection); + } + computeCursorState(model, helper) { + return helper.getTrackedSelection(this._selectionId); + } +}; +function addPositiveOffsetToModelPosition(model, position, offset) { + if (offset < 0) { + throw new Error("Unexpected negative delta"); + } + const lineCount = model.getLineCount(); + let endPosition = new Position(lineCount, model.getLineMaxColumn(lineCount)); + for (let lineNumber = position.lineNumber; lineNumber <= lineCount; lineNumber++) { + if (lineNumber === position.lineNumber) { + const futureOffset = offset - model.getLineMaxColumn(position.lineNumber) + position.column; + if (futureOffset <= 0) { + endPosition = new Position(position.lineNumber, position.column + offset); + break; + } + offset = futureOffset; + } else { + const futureOffset = offset - model.getLineMaxColumn(lineNumber); + if (futureOffset <= 0) { + endPosition = new Position(lineNumber, offset); + break; + } + offset = futureOffset; + } + } + return endPosition; +} + +// node_modules/monaco-editor-core/esm/vs/editor/common/cursor/cursorDeleteOperations.js +init_cursorColumns(); + +// node_modules/monaco-editor-core/esm/vs/editor/common/cursor/cursorMoveOperations.js +init_strings(); +init_cursorColumns(); +init_position(); +init_range(); + +// node_modules/monaco-editor-core/esm/vs/editor/common/cursor/cursorAtomicMoveOperations.js +init_cursorColumns(); +var AtomicTabMoveOperations = class _AtomicTabMoveOperations { + /** + * Get the visible column at the position. If we get to a non-whitespace character first + * or past the end of string then return -1. + * + * **Note** `position` and the return value are 0-based. + */ + static whitespaceVisibleColumn(lineContent, position, tabSize) { + const lineLength = lineContent.length; + let visibleColumn = 0; + let prevTabStopPosition = -1; + let prevTabStopVisibleColumn = -1; + for (let i2 = 0; i2 < lineLength; i2++) { + if (i2 === position) { + return [prevTabStopPosition, prevTabStopVisibleColumn, visibleColumn]; + } + if (visibleColumn % tabSize === 0) { + prevTabStopPosition = i2; + prevTabStopVisibleColumn = visibleColumn; + } + const chCode = lineContent.charCodeAt(i2); + switch (chCode) { + case 32: + visibleColumn += 1; + break; + case 9: + visibleColumn = CursorColumns.nextRenderTabStop(visibleColumn, tabSize); + break; + default: + return [-1, -1, -1]; + } + } + if (position === lineLength) { + return [prevTabStopPosition, prevTabStopVisibleColumn, visibleColumn]; + } + return [-1, -1, -1]; + } + /** + * Return the position that should result from a move left, right or to the + * nearest tab, if atomic tabs are enabled. Left and right are used for the + * arrow key movements, nearest is used for mouse selection. It returns + * -1 if atomic tabs are not relevant and you should fall back to normal + * behaviour. + * + * **Note**: `position` and the return value are 0-based. + */ + static atomicPosition(lineContent, position, tabSize, direction) { + const lineLength = lineContent.length; + const [prevTabStopPosition, prevTabStopVisibleColumn, visibleColumn] = _AtomicTabMoveOperations.whitespaceVisibleColumn(lineContent, position, tabSize); + if (visibleColumn === -1) { + return -1; + } + let left; + switch (direction) { + case 0: + left = true; + break; + case 1: + left = false; + break; + case 2: + if (visibleColumn % tabSize === 0) { + return position; + } + left = visibleColumn % tabSize <= tabSize / 2; + break; + } + if (left) { + if (prevTabStopPosition === -1) { + return -1; + } + let currentVisibleColumn2 = prevTabStopVisibleColumn; + for (let i2 = prevTabStopPosition; i2 < lineLength; ++i2) { + if (currentVisibleColumn2 === prevTabStopVisibleColumn + tabSize) { + return prevTabStopPosition; + } + const chCode = lineContent.charCodeAt(i2); + switch (chCode) { + case 32: + currentVisibleColumn2 += 1; + break; + case 9: + currentVisibleColumn2 = CursorColumns.nextRenderTabStop(currentVisibleColumn2, tabSize); + break; + default: + return -1; + } + } + if (currentVisibleColumn2 === prevTabStopVisibleColumn + tabSize) { + return prevTabStopPosition; + } + return -1; + } + const targetVisibleColumn = CursorColumns.nextRenderTabStop(visibleColumn, tabSize); + let currentVisibleColumn = visibleColumn; + for (let i2 = position; i2 < lineLength; i2++) { + if (currentVisibleColumn === targetVisibleColumn) { + return i2; + } + const chCode = lineContent.charCodeAt(i2); + switch (chCode) { + case 32: + currentVisibleColumn += 1; + break; + case 9: + currentVisibleColumn = CursorColumns.nextRenderTabStop(currentVisibleColumn, tabSize); + break; + default: + return -1; + } + } + if (currentVisibleColumn === targetVisibleColumn) { + return lineLength; + } + return -1; + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/common/cursor/cursorMoveOperations.js +var CursorPosition = class { + constructor(lineNumber, column, leftoverVisibleColumns) { + this._cursorPositionBrand = void 0; + this.lineNumber = lineNumber; + this.column = column; + this.leftoverVisibleColumns = leftoverVisibleColumns; + } +}; +var MoveOperations = class _MoveOperations { + static leftPosition(model, position) { + if (position.column > model.getLineMinColumn(position.lineNumber)) { + return position.delta(void 0, -prevCharLength(model.getLineContent(position.lineNumber), position.column - 1)); + } else if (position.lineNumber > 1) { + const newLineNumber = position.lineNumber - 1; + return new Position(newLineNumber, model.getLineMaxColumn(newLineNumber)); + } else { + return position; + } + } + static leftPositionAtomicSoftTabs(model, position, tabSize) { + if (position.column <= model.getLineIndentColumn(position.lineNumber)) { + const minColumn = model.getLineMinColumn(position.lineNumber); + const lineContent = model.getLineContent(position.lineNumber); + const newPosition = AtomicTabMoveOperations.atomicPosition( + lineContent, + position.column - 1, + tabSize, + 0 + /* Direction.Left */ + ); + if (newPosition !== -1 && newPosition + 1 >= minColumn) { + return new Position(position.lineNumber, newPosition + 1); + } + } + return this.leftPosition(model, position); + } + static left(config, model, position) { + const pos = config.stickyTabStops ? _MoveOperations.leftPositionAtomicSoftTabs(model, position, config.tabSize) : _MoveOperations.leftPosition(model, position); + return new CursorPosition(pos.lineNumber, pos.column, 0); + } + /** + * @param noOfColumns Must be either `1` + * or `Math.round(viewModel.getLineContent(viewLineNumber).length / 2)` (for half lines). + */ + static moveLeft(config, model, cursor, inSelectionMode, noOfColumns) { + let lineNumber, column; + if (cursor.hasSelection() && !inSelectionMode) { + lineNumber = cursor.selection.startLineNumber; + column = cursor.selection.startColumn; + } else { + const pos = cursor.position.delta(void 0, -(noOfColumns - 1)); + const normalizedPos = model.normalizePosition( + _MoveOperations.clipPositionColumn(pos, model), + 0 + /* PositionAffinity.Left */ + ); + const p = _MoveOperations.left(config, model, normalizedPos); + lineNumber = p.lineNumber; + column = p.column; + } + return cursor.move(inSelectionMode, lineNumber, column, 0); + } + /** + * Adjusts the column so that it is within min/max of the line. + */ + static clipPositionColumn(position, model) { + return new Position(position.lineNumber, _MoveOperations.clipRange(position.column, model.getLineMinColumn(position.lineNumber), model.getLineMaxColumn(position.lineNumber))); + } + static clipRange(value, min, max) { + if (value < min) { + return min; + } + if (value > max) { + return max; + } + return value; + } + static rightPosition(model, lineNumber, column) { + if (column < model.getLineMaxColumn(lineNumber)) { + column = column + nextCharLength(model.getLineContent(lineNumber), column - 1); + } else if (lineNumber < model.getLineCount()) { + lineNumber = lineNumber + 1; + column = model.getLineMinColumn(lineNumber); + } + return new Position(lineNumber, column); + } + static rightPositionAtomicSoftTabs(model, lineNumber, column, tabSize, indentSize) { + if (column < model.getLineIndentColumn(lineNumber)) { + const lineContent = model.getLineContent(lineNumber); + const newPosition = AtomicTabMoveOperations.atomicPosition( + lineContent, + column - 1, + tabSize, + 1 + /* Direction.Right */ + ); + if (newPosition !== -1) { + return new Position(lineNumber, newPosition + 1); + } + } + return this.rightPosition(model, lineNumber, column); + } + static right(config, model, position) { + const pos = config.stickyTabStops ? _MoveOperations.rightPositionAtomicSoftTabs(model, position.lineNumber, position.column, config.tabSize, config.indentSize) : _MoveOperations.rightPosition(model, position.lineNumber, position.column); + return new CursorPosition(pos.lineNumber, pos.column, 0); + } + static moveRight(config, model, cursor, inSelectionMode, noOfColumns) { + let lineNumber, column; + if (cursor.hasSelection() && !inSelectionMode) { + lineNumber = cursor.selection.endLineNumber; + column = cursor.selection.endColumn; + } else { + const pos = cursor.position.delta(void 0, noOfColumns - 1); + const normalizedPos = model.normalizePosition( + _MoveOperations.clipPositionColumn(pos, model), + 1 + /* PositionAffinity.Right */ + ); + const r = _MoveOperations.right(config, model, normalizedPos); + lineNumber = r.lineNumber; + column = r.column; + } + return cursor.move(inSelectionMode, lineNumber, column, 0); + } + static vertical(config, model, lineNumber, column, leftoverVisibleColumns, newLineNumber, allowMoveOnEdgeLine, normalizationAffinity) { + const currentVisibleColumn = CursorColumns.visibleColumnFromColumn(model.getLineContent(lineNumber), column, config.tabSize) + leftoverVisibleColumns; + const lineCount = model.getLineCount(); + const wasOnFirstPosition = lineNumber === 1 && column === 1; + const wasOnLastPosition = lineNumber === lineCount && column === model.getLineMaxColumn(lineNumber); + const wasAtEdgePosition = newLineNumber < lineNumber ? wasOnFirstPosition : wasOnLastPosition; + lineNumber = newLineNumber; + if (lineNumber < 1) { + lineNumber = 1; + if (allowMoveOnEdgeLine) { + column = model.getLineMinColumn(lineNumber); + } else { + column = Math.min(model.getLineMaxColumn(lineNumber), column); + } + } else if (lineNumber > lineCount) { + lineNumber = lineCount; + if (allowMoveOnEdgeLine) { + column = model.getLineMaxColumn(lineNumber); + } else { + column = Math.min(model.getLineMaxColumn(lineNumber), column); + } + } else { + column = config.columnFromVisibleColumn(model, lineNumber, currentVisibleColumn); + } + if (wasAtEdgePosition) { + leftoverVisibleColumns = 0; + } else { + leftoverVisibleColumns = currentVisibleColumn - CursorColumns.visibleColumnFromColumn(model.getLineContent(lineNumber), column, config.tabSize); + } + if (normalizationAffinity !== void 0) { + const position = new Position(lineNumber, column); + const newPosition = model.normalizePosition(position, normalizationAffinity); + leftoverVisibleColumns = leftoverVisibleColumns + (column - newPosition.column); + lineNumber = newPosition.lineNumber; + column = newPosition.column; + } + return new CursorPosition(lineNumber, column, leftoverVisibleColumns); + } + static down(config, model, lineNumber, column, leftoverVisibleColumns, count, allowMoveOnLastLine) { + return this.vertical( + config, + model, + lineNumber, + column, + leftoverVisibleColumns, + lineNumber + count, + allowMoveOnLastLine, + 4 + /* PositionAffinity.RightOfInjectedText */ + ); + } + static moveDown(config, model, cursor, inSelectionMode, linesCount) { + let lineNumber, column; + if (cursor.hasSelection() && !inSelectionMode) { + lineNumber = cursor.selection.endLineNumber; + column = cursor.selection.endColumn; + } else { + lineNumber = cursor.position.lineNumber; + column = cursor.position.column; + } + let i2 = 0; + let r; + do { + r = _MoveOperations.down(config, model, lineNumber + i2, column, cursor.leftoverVisibleColumns, linesCount, true); + const np = model.normalizePosition( + new Position(r.lineNumber, r.column), + 2 + /* PositionAffinity.None */ + ); + if (np.lineNumber > lineNumber) { + break; + } + } while (i2++ < 10 && lineNumber + i2 < model.getLineCount()); + return cursor.move(inSelectionMode, r.lineNumber, r.column, r.leftoverVisibleColumns); + } + static translateDown(config, model, cursor) { + const selection = cursor.selection; + const selectionStart = _MoveOperations.down(config, model, selection.selectionStartLineNumber, selection.selectionStartColumn, cursor.selectionStartLeftoverVisibleColumns, 1, false); + const position = _MoveOperations.down(config, model, selection.positionLineNumber, selection.positionColumn, cursor.leftoverVisibleColumns, 1, false); + return new SingleCursorState(new Range(selectionStart.lineNumber, selectionStart.column, selectionStart.lineNumber, selectionStart.column), 0, selectionStart.leftoverVisibleColumns, new Position(position.lineNumber, position.column), position.leftoverVisibleColumns); + } + static up(config, model, lineNumber, column, leftoverVisibleColumns, count, allowMoveOnFirstLine) { + return this.vertical( + config, + model, + lineNumber, + column, + leftoverVisibleColumns, + lineNumber - count, + allowMoveOnFirstLine, + 3 + /* PositionAffinity.LeftOfInjectedText */ + ); + } + static moveUp(config, model, cursor, inSelectionMode, linesCount) { + let lineNumber, column; + if (cursor.hasSelection() && !inSelectionMode) { + lineNumber = cursor.selection.startLineNumber; + column = cursor.selection.startColumn; + } else { + lineNumber = cursor.position.lineNumber; + column = cursor.position.column; + } + const r = _MoveOperations.up(config, model, lineNumber, column, cursor.leftoverVisibleColumns, linesCount, true); + return cursor.move(inSelectionMode, r.lineNumber, r.column, r.leftoverVisibleColumns); + } + static translateUp(config, model, cursor) { + const selection = cursor.selection; + const selectionStart = _MoveOperations.up(config, model, selection.selectionStartLineNumber, selection.selectionStartColumn, cursor.selectionStartLeftoverVisibleColumns, 1, false); + const position = _MoveOperations.up(config, model, selection.positionLineNumber, selection.positionColumn, cursor.leftoverVisibleColumns, 1, false); + return new SingleCursorState(new Range(selectionStart.lineNumber, selectionStart.column, selectionStart.lineNumber, selectionStart.column), 0, selectionStart.leftoverVisibleColumns, new Position(position.lineNumber, position.column), position.leftoverVisibleColumns); + } + static _isBlankLine(model, lineNumber) { + if (model.getLineFirstNonWhitespaceColumn(lineNumber) === 0) { + return true; + } + return false; + } + static moveToPrevBlankLine(config, model, cursor, inSelectionMode) { + let lineNumber = cursor.position.lineNumber; + while (lineNumber > 1 && this._isBlankLine(model, lineNumber)) { + lineNumber--; + } + while (lineNumber > 1 && !this._isBlankLine(model, lineNumber)) { + lineNumber--; + } + return cursor.move(inSelectionMode, lineNumber, model.getLineMinColumn(lineNumber), 0); + } + static moveToNextBlankLine(config, model, cursor, inSelectionMode) { + const lineCount = model.getLineCount(); + let lineNumber = cursor.position.lineNumber; + while (lineNumber < lineCount && this._isBlankLine(model, lineNumber)) { + lineNumber++; + } + while (lineNumber < lineCount && !this._isBlankLine(model, lineNumber)) { + lineNumber++; + } + return cursor.move(inSelectionMode, lineNumber, model.getLineMinColumn(lineNumber), 0); + } + static moveToBeginningOfLine(config, model, cursor, inSelectionMode) { + const lineNumber = cursor.position.lineNumber; + const minColumn = model.getLineMinColumn(lineNumber); + const firstNonBlankColumn = model.getLineFirstNonWhitespaceColumn(lineNumber) || minColumn; + let column; + const relevantColumnNumber = cursor.position.column; + if (relevantColumnNumber === firstNonBlankColumn) { + column = minColumn; + } else { + column = firstNonBlankColumn; + } + return cursor.move(inSelectionMode, lineNumber, column, 0); + } + static moveToEndOfLine(config, model, cursor, inSelectionMode, sticky) { + const lineNumber = cursor.position.lineNumber; + const maxColumn = model.getLineMaxColumn(lineNumber); + return cursor.move(inSelectionMode, lineNumber, maxColumn, sticky ? 1073741824 - maxColumn : 0); + } + static moveToBeginningOfBuffer(config, model, cursor, inSelectionMode) { + return cursor.move(inSelectionMode, 1, 1, 0); + } + static moveToEndOfBuffer(config, model, cursor, inSelectionMode) { + const lastLineNumber = model.getLineCount(); + const lastColumn = model.getLineMaxColumn(lastLineNumber); + return cursor.move(inSelectionMode, lastLineNumber, lastColumn, 0); + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/common/cursor/cursorDeleteOperations.js +init_range(); +init_position(); +var DeleteOperations = class _DeleteOperations { + static deleteRight(prevEditOperationType, config, model, selections) { + const commands = []; + let shouldPushStackElementBefore = prevEditOperationType !== 3; + for (let i2 = 0, len = selections.length; i2 < len; i2++) { + const selection = selections[i2]; + const deleteSelection = this.getDeleteRightRange(selection, model, config); + if (deleteSelection.isEmpty()) { + commands[i2] = null; + continue; + } + if (deleteSelection.startLineNumber !== deleteSelection.endLineNumber) { + shouldPushStackElementBefore = true; + } + commands[i2] = new ReplaceCommand(deleteSelection, ""); + } + return [shouldPushStackElementBefore, commands]; + } + static getDeleteRightRange(selection, model, config) { + if (!selection.isEmpty()) { + return selection; + } + const position = selection.getPosition(); + const rightOfPosition = MoveOperations.right(config, model, position); + if (config.trimWhitespaceOnDelete && rightOfPosition.lineNumber !== position.lineNumber) { + const currentLineHasContent = model.getLineFirstNonWhitespaceColumn(position.lineNumber) > 0; + const firstNonWhitespaceColumn = model.getLineFirstNonWhitespaceColumn(rightOfPosition.lineNumber); + if (currentLineHasContent && firstNonWhitespaceColumn > 0) { + return new Range(rightOfPosition.lineNumber, firstNonWhitespaceColumn, position.lineNumber, position.column); + } + } + return new Range(rightOfPosition.lineNumber, rightOfPosition.column, position.lineNumber, position.column); + } + static isAutoClosingPairDelete(autoClosingDelete, autoClosingBrackets, autoClosingQuotes, autoClosingPairsOpen, model, selections, autoClosedCharacters) { + if (autoClosingBrackets === "never" && autoClosingQuotes === "never") { + return false; + } + if (autoClosingDelete === "never") { + return false; + } + for (let i2 = 0, len = selections.length; i2 < len; i2++) { + const selection = selections[i2]; + const position = selection.getPosition(); + if (!selection.isEmpty()) { + return false; + } + const lineText = model.getLineContent(position.lineNumber); + if (position.column < 2 || position.column >= lineText.length + 1) { + return false; + } + const character = lineText.charAt(position.column - 2); + const autoClosingPairCandidates = autoClosingPairsOpen.get(character); + if (!autoClosingPairCandidates) { + return false; + } + if (isQuote(character)) { + if (autoClosingQuotes === "never") { + return false; + } + } else { + if (autoClosingBrackets === "never") { + return false; + } + } + const afterCharacter = lineText.charAt(position.column - 1); + let foundAutoClosingPair = false; + for (const autoClosingPairCandidate of autoClosingPairCandidates) { + if (autoClosingPairCandidate.open === character && autoClosingPairCandidate.close === afterCharacter) { + foundAutoClosingPair = true; + } + } + if (!foundAutoClosingPair) { + return false; + } + if (autoClosingDelete === "auto") { + let found = false; + for (let j = 0, lenJ = autoClosedCharacters.length; j < lenJ; j++) { + const autoClosedCharacter = autoClosedCharacters[j]; + if (position.lineNumber === autoClosedCharacter.startLineNumber && position.column === autoClosedCharacter.startColumn) { + found = true; + break; + } + } + if (!found) { + return false; + } + } + } + return true; + } + static _runAutoClosingPairDelete(config, model, selections) { + const commands = []; + for (let i2 = 0, len = selections.length; i2 < len; i2++) { + const position = selections[i2].getPosition(); + const deleteSelection = new Range(position.lineNumber, position.column - 1, position.lineNumber, position.column + 1); + commands[i2] = new ReplaceCommand(deleteSelection, ""); + } + return [true, commands]; + } + static deleteLeft(prevEditOperationType, config, model, selections, autoClosedCharacters) { + if (this.isAutoClosingPairDelete(config.autoClosingDelete, config.autoClosingBrackets, config.autoClosingQuotes, config.autoClosingPairs.autoClosingPairsOpenByEnd, model, selections, autoClosedCharacters)) { + return this._runAutoClosingPairDelete(config, model, selections); + } + const commands = []; + let shouldPushStackElementBefore = prevEditOperationType !== 2; + for (let i2 = 0, len = selections.length; i2 < len; i2++) { + const deleteRange = _DeleteOperations.getDeleteLeftRange(selections[i2], model, config); + if (deleteRange.isEmpty()) { + commands[i2] = null; + continue; + } + if (deleteRange.startLineNumber !== deleteRange.endLineNumber) { + shouldPushStackElementBefore = true; + } + commands[i2] = new ReplaceCommand(deleteRange, ""); + } + return [shouldPushStackElementBefore, commands]; + } + static getDeleteLeftRange(selection, model, config) { + if (!selection.isEmpty()) { + return selection; + } + const position = selection.getPosition(); + if (config.useTabStops && position.column > 1) { + const lineContent = model.getLineContent(position.lineNumber); + const firstNonWhitespaceIndex2 = firstNonWhitespaceIndex(lineContent); + const lastIndentationColumn = firstNonWhitespaceIndex2 === -1 ? ( + /* entire string is whitespace */ + lineContent.length + 1 + ) : firstNonWhitespaceIndex2 + 1; + if (position.column <= lastIndentationColumn) { + const fromVisibleColumn = config.visibleColumnFromColumn(model, position); + const toVisibleColumn = CursorColumns.prevIndentTabStop(fromVisibleColumn, config.indentSize); + const toColumn = config.columnFromVisibleColumn(model, position.lineNumber, toVisibleColumn); + return new Range(position.lineNumber, toColumn, position.lineNumber, position.column); + } + } + return Range.fromPositions(_DeleteOperations.getPositionAfterDeleteLeft(position, model), position); + } + static getPositionAfterDeleteLeft(position, model) { + if (position.column > 1) { + const idx = getLeftDeleteOffset(position.column - 1, model.getLineContent(position.lineNumber)); + return position.with(void 0, idx + 1); + } else if (position.lineNumber > 1) { + const newLine = position.lineNumber - 1; + return new Position(newLine, model.getLineMaxColumn(newLine)); + } else { + return position; + } + } + static cut(config, model, selections) { + const commands = []; + let lastCutRange = null; + selections.sort((a, b) => Position.compare(a.getStartPosition(), b.getEndPosition())); + for (let i2 = 0, len = selections.length; i2 < len; i2++) { + const selection = selections[i2]; + if (selection.isEmpty()) { + if (config.emptySelectionClipboard) { + const position = selection.getPosition(); + let startLineNumber, startColumn, endLineNumber, endColumn; + if (position.lineNumber < model.getLineCount()) { + startLineNumber = position.lineNumber; + startColumn = 1; + endLineNumber = position.lineNumber + 1; + endColumn = 1; + } else if (position.lineNumber > 1 && lastCutRange?.endLineNumber !== position.lineNumber) { + startLineNumber = position.lineNumber - 1; + startColumn = model.getLineMaxColumn(position.lineNumber - 1); + endLineNumber = position.lineNumber; + endColumn = model.getLineMaxColumn(position.lineNumber); + } else { + startLineNumber = position.lineNumber; + startColumn = 1; + endLineNumber = position.lineNumber; + endColumn = model.getLineMaxColumn(position.lineNumber); + } + const deleteSelection = new Range(startLineNumber, startColumn, endLineNumber, endColumn); + lastCutRange = deleteSelection; + if (!deleteSelection.isEmpty()) { + commands[i2] = new ReplaceCommand(deleteSelection, ""); + } else { + commands[i2] = null; + } + } else { + commands[i2] = null; + } + } else { + commands[i2] = new ReplaceCommand(selection, ""); + } + } + return new EditOperationResult(0, commands, { + shouldPushStackElementBefore: true, + shouldPushStackElementAfter: true + }); + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/common/cursor/cursorMoveCommands.js +init_types(); + +// node_modules/monaco-editor-core/esm/vs/editor/common/cursor/cursorWordOperations.js +init_strings(); +init_wordCharacterClassifier(); +init_position(); +init_range(); +var WordOperations = class _WordOperations { + static _createWord(lineContent, wordType, nextCharClass, start, end) { + return { start, end, wordType, nextCharClass }; + } + static _createIntlWord(intlWord, nextCharClass) { + return { start: intlWord.index, end: intlWord.index + intlWord.segment.length, wordType: 1, nextCharClass }; + } + static _findPreviousWordOnLine(wordSeparators2, model, position) { + const lineContent = model.getLineContent(position.lineNumber); + return this._doFindPreviousWordOnLine(lineContent, wordSeparators2, position); + } + static _doFindPreviousWordOnLine(lineContent, wordSeparators2, position) { + let wordType = 0; + const previousIntlWord = wordSeparators2.findPrevIntlWordBeforeOrAtOffset(lineContent, position.column - 2); + for (let chIndex = position.column - 2; chIndex >= 0; chIndex--) { + const chCode = lineContent.charCodeAt(chIndex); + const chClass = wordSeparators2.get(chCode); + if (previousIntlWord && chIndex === previousIntlWord.index) { + return this._createIntlWord(previousIntlWord, chClass); + } + if (chClass === 0) { + if (wordType === 2) { + return this._createWord(lineContent, wordType, chClass, chIndex + 1, this._findEndOfWord(lineContent, wordSeparators2, wordType, chIndex + 1)); + } + wordType = 1; + } else if (chClass === 2) { + if (wordType === 1) { + return this._createWord(lineContent, wordType, chClass, chIndex + 1, this._findEndOfWord(lineContent, wordSeparators2, wordType, chIndex + 1)); + } + wordType = 2; + } else if (chClass === 1) { + if (wordType !== 0) { + return this._createWord(lineContent, wordType, chClass, chIndex + 1, this._findEndOfWord(lineContent, wordSeparators2, wordType, chIndex + 1)); + } + } + } + if (wordType !== 0) { + return this._createWord(lineContent, wordType, 1, 0, this._findEndOfWord(lineContent, wordSeparators2, wordType, 0)); + } + return null; + } + static _findEndOfWord(lineContent, wordSeparators2, wordType, startIndex) { + const nextIntlWord = wordSeparators2.findNextIntlWordAtOrAfterOffset(lineContent, startIndex); + const len = lineContent.length; + for (let chIndex = startIndex; chIndex < len; chIndex++) { + const chCode = lineContent.charCodeAt(chIndex); + const chClass = wordSeparators2.get(chCode); + if (nextIntlWord && chIndex === nextIntlWord.index + nextIntlWord.segment.length) { + return chIndex; + } + if (chClass === 1) { + return chIndex; + } + if (wordType === 1 && chClass === 2) { + return chIndex; + } + if (wordType === 2 && chClass === 0) { + return chIndex; + } + } + return len; + } + static _findNextWordOnLine(wordSeparators2, model, position) { + const lineContent = model.getLineContent(position.lineNumber); + return this._doFindNextWordOnLine(lineContent, wordSeparators2, position); + } + static _doFindNextWordOnLine(lineContent, wordSeparators2, position) { + let wordType = 0; + const len = lineContent.length; + const nextIntlWord = wordSeparators2.findNextIntlWordAtOrAfterOffset(lineContent, position.column - 1); + for (let chIndex = position.column - 1; chIndex < len; chIndex++) { + const chCode = lineContent.charCodeAt(chIndex); + const chClass = wordSeparators2.get(chCode); + if (nextIntlWord && chIndex === nextIntlWord.index) { + return this._createIntlWord(nextIntlWord, chClass); + } + if (chClass === 0) { + if (wordType === 2) { + return this._createWord(lineContent, wordType, chClass, this._findStartOfWord(lineContent, wordSeparators2, wordType, chIndex - 1), chIndex); + } + wordType = 1; + } else if (chClass === 2) { + if (wordType === 1) { + return this._createWord(lineContent, wordType, chClass, this._findStartOfWord(lineContent, wordSeparators2, wordType, chIndex - 1), chIndex); + } + wordType = 2; + } else if (chClass === 1) { + if (wordType !== 0) { + return this._createWord(lineContent, wordType, chClass, this._findStartOfWord(lineContent, wordSeparators2, wordType, chIndex - 1), chIndex); + } + } + } + if (wordType !== 0) { + return this._createWord(lineContent, wordType, 1, this._findStartOfWord(lineContent, wordSeparators2, wordType, len - 1), len); + } + return null; + } + static _findStartOfWord(lineContent, wordSeparators2, wordType, startIndex) { + const previousIntlWord = wordSeparators2.findPrevIntlWordBeforeOrAtOffset(lineContent, startIndex); + for (let chIndex = startIndex; chIndex >= 0; chIndex--) { + const chCode = lineContent.charCodeAt(chIndex); + const chClass = wordSeparators2.get(chCode); + if (previousIntlWord && chIndex === previousIntlWord.index) { + return chIndex; + } + if (chClass === 1) { + return chIndex + 1; + } + if (wordType === 1 && chClass === 2) { + return chIndex + 1; + } + if (wordType === 2 && chClass === 0) { + return chIndex + 1; + } + } + return 0; + } + static moveWordLeft(wordSeparators2, model, position, wordNavigationType, hasMulticursor) { + let lineNumber = position.lineNumber; + let column = position.column; + if (column === 1) { + if (lineNumber > 1) { + lineNumber = lineNumber - 1; + column = model.getLineMaxColumn(lineNumber); + } + } + let prevWordOnLine = _WordOperations._findPreviousWordOnLine(wordSeparators2, model, new Position(lineNumber, column)); + if (wordNavigationType === 0) { + return new Position(lineNumber, prevWordOnLine ? prevWordOnLine.start + 1 : 1); + } + if (wordNavigationType === 1) { + if (!hasMulticursor && prevWordOnLine && prevWordOnLine.wordType === 2 && prevWordOnLine.end - prevWordOnLine.start === 1 && prevWordOnLine.nextCharClass === 0) { + prevWordOnLine = _WordOperations._findPreviousWordOnLine(wordSeparators2, model, new Position(lineNumber, prevWordOnLine.start + 1)); + } + return new Position(lineNumber, prevWordOnLine ? prevWordOnLine.start + 1 : 1); + } + if (wordNavigationType === 3) { + while (prevWordOnLine && prevWordOnLine.wordType === 2) { + prevWordOnLine = _WordOperations._findPreviousWordOnLine(wordSeparators2, model, new Position(lineNumber, prevWordOnLine.start + 1)); + } + return new Position(lineNumber, prevWordOnLine ? prevWordOnLine.start + 1 : 1); + } + if (prevWordOnLine && column <= prevWordOnLine.end + 1) { + prevWordOnLine = _WordOperations._findPreviousWordOnLine(wordSeparators2, model, new Position(lineNumber, prevWordOnLine.start + 1)); + } + return new Position(lineNumber, prevWordOnLine ? prevWordOnLine.end + 1 : 1); + } + static _moveWordPartLeft(model, position) { + const lineNumber = position.lineNumber; + const maxColumn = model.getLineMaxColumn(lineNumber); + if (position.column === 1) { + return lineNumber > 1 ? new Position(lineNumber - 1, model.getLineMaxColumn(lineNumber - 1)) : position; + } + const lineContent = model.getLineContent(lineNumber); + for (let column = position.column - 1; column > 1; column--) { + const left = lineContent.charCodeAt(column - 2); + const right = lineContent.charCodeAt(column - 1); + if (left === 95 && right !== 95) { + return new Position(lineNumber, column); + } + if (left === 45 && right !== 45) { + return new Position(lineNumber, column); + } + if ((isLowerAsciiLetter(left) || isAsciiDigit(left)) && isUpperAsciiLetter(right)) { + return new Position(lineNumber, column); + } + if (isUpperAsciiLetter(left) && isUpperAsciiLetter(right)) { + if (column + 1 < maxColumn) { + const rightRight = lineContent.charCodeAt(column); + if (isLowerAsciiLetter(rightRight) || isAsciiDigit(rightRight)) { + return new Position(lineNumber, column); + } + } + } + } + return new Position(lineNumber, 1); + } + static moveWordRight(wordSeparators2, model, position, wordNavigationType) { + let lineNumber = position.lineNumber; + let column = position.column; + let movedDown = false; + if (column === model.getLineMaxColumn(lineNumber)) { + if (lineNumber < model.getLineCount()) { + movedDown = true; + lineNumber = lineNumber + 1; + column = 1; + } + } + let nextWordOnLine = _WordOperations._findNextWordOnLine(wordSeparators2, model, new Position(lineNumber, column)); + if (wordNavigationType === 2) { + if (nextWordOnLine && nextWordOnLine.wordType === 2) { + if (nextWordOnLine.end - nextWordOnLine.start === 1 && nextWordOnLine.nextCharClass === 0) { + nextWordOnLine = _WordOperations._findNextWordOnLine(wordSeparators2, model, new Position(lineNumber, nextWordOnLine.end + 1)); + } + } + if (nextWordOnLine) { + column = nextWordOnLine.end + 1; + } else { + column = model.getLineMaxColumn(lineNumber); + } + } else if (wordNavigationType === 3) { + if (movedDown) { + column = 0; + } + while (nextWordOnLine && (nextWordOnLine.wordType === 2 || nextWordOnLine.start + 1 <= column)) { + nextWordOnLine = _WordOperations._findNextWordOnLine(wordSeparators2, model, new Position(lineNumber, nextWordOnLine.end + 1)); + } + if (nextWordOnLine) { + column = nextWordOnLine.start + 1; + } else { + column = model.getLineMaxColumn(lineNumber); + } + } else { + if (nextWordOnLine && !movedDown && column >= nextWordOnLine.start + 1) { + nextWordOnLine = _WordOperations._findNextWordOnLine(wordSeparators2, model, new Position(lineNumber, nextWordOnLine.end + 1)); + } + if (nextWordOnLine) { + column = nextWordOnLine.start + 1; + } else { + column = model.getLineMaxColumn(lineNumber); + } + } + return new Position(lineNumber, column); + } + static _moveWordPartRight(model, position) { + const lineNumber = position.lineNumber; + const maxColumn = model.getLineMaxColumn(lineNumber); + if (position.column === maxColumn) { + return lineNumber < model.getLineCount() ? new Position(lineNumber + 1, 1) : position; + } + const lineContent = model.getLineContent(lineNumber); + for (let column = position.column + 1; column < maxColumn; column++) { + const left = lineContent.charCodeAt(column - 2); + const right = lineContent.charCodeAt(column - 1); + if (left !== 95 && right === 95) { + return new Position(lineNumber, column); + } + if (left !== 45 && right === 45) { + return new Position(lineNumber, column); + } + if ((isLowerAsciiLetter(left) || isAsciiDigit(left)) && isUpperAsciiLetter(right)) { + return new Position(lineNumber, column); + } + if (isUpperAsciiLetter(left) && isUpperAsciiLetter(right)) { + if (column + 1 < maxColumn) { + const rightRight = lineContent.charCodeAt(column); + if (isLowerAsciiLetter(rightRight) || isAsciiDigit(rightRight)) { + return new Position(lineNumber, column); + } + } + } + } + return new Position(lineNumber, maxColumn); + } + static _deleteWordLeftWhitespace(model, position) { + const lineContent = model.getLineContent(position.lineNumber); + const startIndex = position.column - 2; + const lastNonWhitespace = lastNonWhitespaceIndex(lineContent, startIndex); + if (lastNonWhitespace + 1 < startIndex) { + return new Range(position.lineNumber, lastNonWhitespace + 2, position.lineNumber, position.column); + } + return null; + } + static deleteWordLeft(ctx, wordNavigationType) { + const wordSeparators2 = ctx.wordSeparators; + const model = ctx.model; + const selection = ctx.selection; + const whitespaceHeuristics = ctx.whitespaceHeuristics; + if (!selection.isEmpty()) { + return selection; + } + if (DeleteOperations.isAutoClosingPairDelete(ctx.autoClosingDelete, ctx.autoClosingBrackets, ctx.autoClosingQuotes, ctx.autoClosingPairs.autoClosingPairsOpenByEnd, ctx.model, [ctx.selection], ctx.autoClosedCharacters)) { + const position2 = ctx.selection.getPosition(); + return new Range(position2.lineNumber, position2.column - 1, position2.lineNumber, position2.column + 1); + } + const position = new Position(selection.positionLineNumber, selection.positionColumn); + let lineNumber = position.lineNumber; + let column = position.column; + if (lineNumber === 1 && column === 1) { + return null; + } + if (whitespaceHeuristics) { + const r = this._deleteWordLeftWhitespace(model, position); + if (r) { + return r; + } + } + let prevWordOnLine = _WordOperations._findPreviousWordOnLine(wordSeparators2, model, position); + if (wordNavigationType === 0) { + if (prevWordOnLine) { + column = prevWordOnLine.start + 1; + } else { + if (column > 1) { + column = 1; + } else { + lineNumber--; + column = model.getLineMaxColumn(lineNumber); + } + } + } else { + if (prevWordOnLine && column <= prevWordOnLine.end + 1) { + prevWordOnLine = _WordOperations._findPreviousWordOnLine(wordSeparators2, model, new Position(lineNumber, prevWordOnLine.start + 1)); + } + if (prevWordOnLine) { + column = prevWordOnLine.end + 1; + } else { + if (column > 1) { + column = 1; + } else { + lineNumber--; + column = model.getLineMaxColumn(lineNumber); + } + } + } + return new Range(lineNumber, column, position.lineNumber, position.column); + } + static deleteInsideWord(wordSeparators2, model, selection) { + if (!selection.isEmpty()) { + return selection; + } + const position = new Position(selection.positionLineNumber, selection.positionColumn); + const r = this._deleteInsideWordWhitespace(model, position); + if (r) { + return r; + } + return this._deleteInsideWordDetermineDeleteRange(wordSeparators2, model, position); + } + static _charAtIsWhitespace(str, index) { + const charCode = str.charCodeAt(index); + return charCode === 32 || charCode === 9; + } + static _deleteInsideWordWhitespace(model, position) { + const lineContent = model.getLineContent(position.lineNumber); + const lineContentLength = lineContent.length; + if (lineContentLength === 0) { + return null; + } + let leftIndex = Math.max(position.column - 2, 0); + if (!this._charAtIsWhitespace(lineContent, leftIndex)) { + return null; + } + let rightIndex = Math.min(position.column - 1, lineContentLength - 1); + if (!this._charAtIsWhitespace(lineContent, rightIndex)) { + return null; + } + while (leftIndex > 0 && this._charAtIsWhitespace(lineContent, leftIndex - 1)) { + leftIndex--; + } + while (rightIndex + 1 < lineContentLength && this._charAtIsWhitespace(lineContent, rightIndex + 1)) { + rightIndex++; + } + return new Range(position.lineNumber, leftIndex + 1, position.lineNumber, rightIndex + 2); + } + static _deleteInsideWordDetermineDeleteRange(wordSeparators2, model, position) { + const lineContent = model.getLineContent(position.lineNumber); + const lineLength = lineContent.length; + if (lineLength === 0) { + if (position.lineNumber > 1) { + return new Range(position.lineNumber - 1, model.getLineMaxColumn(position.lineNumber - 1), position.lineNumber, 1); + } else { + if (position.lineNumber < model.getLineCount()) { + return new Range(position.lineNumber, 1, position.lineNumber + 1, 1); + } else { + return new Range(position.lineNumber, 1, position.lineNumber, 1); + } + } + } + const touchesWord = (word) => { + return word.start + 1 <= position.column && position.column <= word.end + 1; + }; + const createRangeWithPosition = (startColumn, endColumn) => { + startColumn = Math.min(startColumn, position.column); + endColumn = Math.max(endColumn, position.column); + return new Range(position.lineNumber, startColumn, position.lineNumber, endColumn); + }; + const deleteWordAndAdjacentWhitespace = (word) => { + let startColumn = word.start + 1; + let endColumn = word.end + 1; + let expandedToTheRight = false; + while (endColumn - 1 < lineLength && this._charAtIsWhitespace(lineContent, endColumn - 1)) { + expandedToTheRight = true; + endColumn++; + } + if (!expandedToTheRight) { + while (startColumn > 1 && this._charAtIsWhitespace(lineContent, startColumn - 2)) { + startColumn--; + } + } + return createRangeWithPosition(startColumn, endColumn); + }; + const prevWordOnLine = _WordOperations._findPreviousWordOnLine(wordSeparators2, model, position); + if (prevWordOnLine && touchesWord(prevWordOnLine)) { + return deleteWordAndAdjacentWhitespace(prevWordOnLine); + } + const nextWordOnLine = _WordOperations._findNextWordOnLine(wordSeparators2, model, position); + if (nextWordOnLine && touchesWord(nextWordOnLine)) { + return deleteWordAndAdjacentWhitespace(nextWordOnLine); + } + if (prevWordOnLine && nextWordOnLine) { + return createRangeWithPosition(prevWordOnLine.end + 1, nextWordOnLine.start + 1); + } + if (prevWordOnLine) { + return createRangeWithPosition(prevWordOnLine.start + 1, prevWordOnLine.end + 1); + } + if (nextWordOnLine) { + return createRangeWithPosition(nextWordOnLine.start + 1, nextWordOnLine.end + 1); + } + return createRangeWithPosition(1, lineLength + 1); + } + static _deleteWordPartLeft(model, selection) { + if (!selection.isEmpty()) { + return selection; + } + const pos = selection.getPosition(); + const toPosition = _WordOperations._moveWordPartLeft(model, pos); + return new Range(pos.lineNumber, pos.column, toPosition.lineNumber, toPosition.column); + } + static _findFirstNonWhitespaceChar(str, startIndex) { + const len = str.length; + for (let chIndex = startIndex; chIndex < len; chIndex++) { + const ch = str.charAt(chIndex); + if (ch !== " " && ch !== " ") { + return chIndex; + } + } + return len; + } + static _deleteWordRightWhitespace(model, position) { + const lineContent = model.getLineContent(position.lineNumber); + const startIndex = position.column - 1; + const firstNonWhitespace = this._findFirstNonWhitespaceChar(lineContent, startIndex); + if (startIndex + 1 < firstNonWhitespace) { + return new Range(position.lineNumber, position.column, position.lineNumber, firstNonWhitespace + 1); + } + return null; + } + static deleteWordRight(ctx, wordNavigationType) { + const wordSeparators2 = ctx.wordSeparators; + const model = ctx.model; + const selection = ctx.selection; + const whitespaceHeuristics = ctx.whitespaceHeuristics; + if (!selection.isEmpty()) { + return selection; + } + const position = new Position(selection.positionLineNumber, selection.positionColumn); + let lineNumber = position.lineNumber; + let column = position.column; + const lineCount = model.getLineCount(); + const maxColumn = model.getLineMaxColumn(lineNumber); + if (lineNumber === lineCount && column === maxColumn) { + return null; + } + if (whitespaceHeuristics) { + const r = this._deleteWordRightWhitespace(model, position); + if (r) { + return r; + } + } + let nextWordOnLine = _WordOperations._findNextWordOnLine(wordSeparators2, model, position); + if (wordNavigationType === 2) { + if (nextWordOnLine) { + column = nextWordOnLine.end + 1; + } else { + if (column < maxColumn || lineNumber === lineCount) { + column = maxColumn; + } else { + lineNumber++; + nextWordOnLine = _WordOperations._findNextWordOnLine(wordSeparators2, model, new Position(lineNumber, 1)); + if (nextWordOnLine) { + column = nextWordOnLine.start + 1; + } else { + column = model.getLineMaxColumn(lineNumber); + } + } + } + } else { + if (nextWordOnLine && column >= nextWordOnLine.start + 1) { + nextWordOnLine = _WordOperations._findNextWordOnLine(wordSeparators2, model, new Position(lineNumber, nextWordOnLine.end + 1)); + } + if (nextWordOnLine) { + column = nextWordOnLine.start + 1; + } else { + if (column < maxColumn || lineNumber === lineCount) { + column = maxColumn; + } else { + lineNumber++; + nextWordOnLine = _WordOperations._findNextWordOnLine(wordSeparators2, model, new Position(lineNumber, 1)); + if (nextWordOnLine) { + column = nextWordOnLine.start + 1; + } else { + column = model.getLineMaxColumn(lineNumber); + } + } + } + } + return new Range(lineNumber, column, position.lineNumber, position.column); + } + static _deleteWordPartRight(model, selection) { + if (!selection.isEmpty()) { + return selection; + } + const pos = selection.getPosition(); + const toPosition = _WordOperations._moveWordPartRight(model, pos); + return new Range(pos.lineNumber, pos.column, toPosition.lineNumber, toPosition.column); + } + static _createWordAtPosition(model, lineNumber, word) { + const range2 = new Range(lineNumber, word.start + 1, lineNumber, word.end + 1); + return { + word: model.getValueInRange(range2), + startColumn: range2.startColumn, + endColumn: range2.endColumn + }; + } + static getWordAtPosition(model, _wordSeparators, _intlSegmenterLocales, position) { + const wordSeparators2 = getMapForWordSeparators(_wordSeparators, _intlSegmenterLocales); + const prevWord = _WordOperations._findPreviousWordOnLine(wordSeparators2, model, position); + if (prevWord && prevWord.wordType === 1 && prevWord.start <= position.column - 1 && position.column - 1 <= prevWord.end) { + return _WordOperations._createWordAtPosition(model, position.lineNumber, prevWord); + } + const nextWord2 = _WordOperations._findNextWordOnLine(wordSeparators2, model, position); + if (nextWord2 && nextWord2.wordType === 1 && nextWord2.start <= position.column - 1 && position.column - 1 <= nextWord2.end) { + return _WordOperations._createWordAtPosition(model, position.lineNumber, nextWord2); + } + return null; + } + static word(config, model, cursor, inSelectionMode, position) { + const wordSeparators2 = getMapForWordSeparators(config.wordSeparators, config.wordSegmenterLocales); + const prevWord = _WordOperations._findPreviousWordOnLine(wordSeparators2, model, position); + const nextWord2 = _WordOperations._findNextWordOnLine(wordSeparators2, model, position); + if (!inSelectionMode) { + let startColumn2; + let endColumn2; + if (prevWord && prevWord.wordType === 1 && prevWord.start <= position.column - 1 && position.column - 1 <= prevWord.end) { + startColumn2 = prevWord.start + 1; + endColumn2 = prevWord.end + 1; + } else if (prevWord && prevWord.wordType === 2 && prevWord.start <= position.column - 1 && position.column - 1 < prevWord.end) { + startColumn2 = prevWord.start + 1; + endColumn2 = prevWord.end + 1; + } else if (nextWord2 && nextWord2.wordType === 1 && nextWord2.start <= position.column - 1 && position.column - 1 <= nextWord2.end) { + startColumn2 = nextWord2.start + 1; + endColumn2 = nextWord2.end + 1; + } else if (nextWord2 && nextWord2.wordType === 2 && nextWord2.start <= position.column - 1 && position.column - 1 < nextWord2.end) { + startColumn2 = nextWord2.start + 1; + endColumn2 = nextWord2.end + 1; + } else { + if (prevWord) { + startColumn2 = prevWord.end + 1; + } else { + startColumn2 = 1; + } + if (nextWord2) { + endColumn2 = nextWord2.start + 1; + } else { + endColumn2 = model.getLineMaxColumn(position.lineNumber); + } + } + return new SingleCursorState(new Range(position.lineNumber, startColumn2, position.lineNumber, endColumn2), 1, 0, new Position(position.lineNumber, endColumn2), 0); + } + let startColumn; + let endColumn; + if (prevWord && prevWord.wordType === 1 && prevWord.start < position.column - 1 && position.column - 1 < prevWord.end) { + startColumn = prevWord.start + 1; + endColumn = prevWord.end + 1; + } else if (nextWord2 && nextWord2.wordType === 1 && nextWord2.start < position.column - 1 && position.column - 1 < nextWord2.end) { + startColumn = nextWord2.start + 1; + endColumn = nextWord2.end + 1; + } else { + startColumn = position.column; + endColumn = position.column; + } + const lineNumber = position.lineNumber; + let column; + if (cursor.selectionStart.containsPosition(position)) { + column = cursor.selectionStart.endColumn; + } else if (position.isBeforeOrEqual(cursor.selectionStart.getStartPosition())) { + column = startColumn; + const possiblePosition = new Position(lineNumber, column); + if (cursor.selectionStart.containsPosition(possiblePosition)) { + column = cursor.selectionStart.endColumn; + } + } else { + column = endColumn; + const possiblePosition = new Position(lineNumber, column); + if (cursor.selectionStart.containsPosition(possiblePosition)) { + column = cursor.selectionStart.startColumn; + } + } + return cursor.move(true, lineNumber, column, 0); + } +}; +var WordPartOperations = class extends WordOperations { + static deleteWordPartLeft(ctx) { + const candidates = enforceDefined([ + WordOperations.deleteWordLeft( + ctx, + 0 + /* WordNavigationType.WordStart */ + ), + WordOperations.deleteWordLeft( + ctx, + 2 + /* WordNavigationType.WordEnd */ + ), + WordOperations._deleteWordPartLeft(ctx.model, ctx.selection) + ]); + candidates.sort(Range.compareRangesUsingEnds); + return candidates[2]; + } + static deleteWordPartRight(ctx) { + const candidates = enforceDefined([ + WordOperations.deleteWordRight( + ctx, + 0 + /* WordNavigationType.WordStart */ + ), + WordOperations.deleteWordRight( + ctx, + 2 + /* WordNavigationType.WordEnd */ + ), + WordOperations._deleteWordPartRight(ctx.model, ctx.selection) + ]); + candidates.sort(Range.compareRangesUsingStarts); + return candidates[0]; + } + static moveWordPartLeft(wordSeparators2, model, position, hasMulticursor) { + const candidates = enforceDefined([ + WordOperations.moveWordLeft(wordSeparators2, model, position, 0, hasMulticursor), + WordOperations.moveWordLeft(wordSeparators2, model, position, 2, hasMulticursor), + WordOperations._moveWordPartLeft(model, position) + ]); + candidates.sort(Position.compare); + return candidates[2]; + } + static moveWordPartRight(wordSeparators2, model, position) { + const candidates = enforceDefined([ + WordOperations.moveWordRight( + wordSeparators2, + model, + position, + 0 + /* WordNavigationType.WordStart */ + ), + WordOperations.moveWordRight( + wordSeparators2, + model, + position, + 2 + /* WordNavigationType.WordEnd */ + ), + WordOperations._moveWordPartRight(model, position) + ]); + candidates.sort(Position.compare); + return candidates[0]; + } +}; +function enforceDefined(arr) { + return arr.filter((el) => Boolean(el)); +} + +// node_modules/monaco-editor-core/esm/vs/editor/common/cursor/cursorMoveCommands.js +init_position(); +init_range(); +init_model2(); +var CursorMoveCommands = class { + static addCursorDown(viewModel, cursors, useLogicalLine) { + const result = []; + let resultLen = 0; + for (let i2 = 0, len = cursors.length; i2 < len; i2++) { + const cursor = cursors[i2]; + result[resultLen++] = new CursorState(cursor.modelState, cursor.viewState); + if (useLogicalLine) { + result[resultLen++] = CursorState.fromModelState(MoveOperations.translateDown(viewModel.cursorConfig, viewModel.model, cursor.modelState)); + } else { + result[resultLen++] = CursorState.fromViewState(MoveOperations.translateDown(viewModel.cursorConfig, viewModel, cursor.viewState)); + } + } + return result; + } + static addCursorUp(viewModel, cursors, useLogicalLine) { + const result = []; + let resultLen = 0; + for (let i2 = 0, len = cursors.length; i2 < len; i2++) { + const cursor = cursors[i2]; + result[resultLen++] = new CursorState(cursor.modelState, cursor.viewState); + if (useLogicalLine) { + result[resultLen++] = CursorState.fromModelState(MoveOperations.translateUp(viewModel.cursorConfig, viewModel.model, cursor.modelState)); + } else { + result[resultLen++] = CursorState.fromViewState(MoveOperations.translateUp(viewModel.cursorConfig, viewModel, cursor.viewState)); + } + } + return result; + } + static moveToBeginningOfLine(viewModel, cursors, inSelectionMode) { + const result = []; + for (let i2 = 0, len = cursors.length; i2 < len; i2++) { + const cursor = cursors[i2]; + result[i2] = this._moveToLineStart(viewModel, cursor, inSelectionMode); + } + return result; + } + static _moveToLineStart(viewModel, cursor, inSelectionMode) { + const currentViewStateColumn = cursor.viewState.position.column; + const currentModelStateColumn = cursor.modelState.position.column; + const isFirstLineOfWrappedLine = currentViewStateColumn === currentModelStateColumn; + const currentViewStatelineNumber = cursor.viewState.position.lineNumber; + const firstNonBlankColumn = viewModel.getLineFirstNonWhitespaceColumn(currentViewStatelineNumber); + const isBeginningOfViewLine = currentViewStateColumn === firstNonBlankColumn; + if (!isFirstLineOfWrappedLine && !isBeginningOfViewLine) { + return this._moveToLineStartByView(viewModel, cursor, inSelectionMode); + } else { + return this._moveToLineStartByModel(viewModel, cursor, inSelectionMode); + } + } + static _moveToLineStartByView(viewModel, cursor, inSelectionMode) { + return CursorState.fromViewState(MoveOperations.moveToBeginningOfLine(viewModel.cursorConfig, viewModel, cursor.viewState, inSelectionMode)); + } + static _moveToLineStartByModel(viewModel, cursor, inSelectionMode) { + return CursorState.fromModelState(MoveOperations.moveToBeginningOfLine(viewModel.cursorConfig, viewModel.model, cursor.modelState, inSelectionMode)); + } + static moveToEndOfLine(viewModel, cursors, inSelectionMode, sticky) { + const result = []; + for (let i2 = 0, len = cursors.length; i2 < len; i2++) { + const cursor = cursors[i2]; + result[i2] = this._moveToLineEnd(viewModel, cursor, inSelectionMode, sticky); + } + return result; + } + static _moveToLineEnd(viewModel, cursor, inSelectionMode, sticky) { + const viewStatePosition = cursor.viewState.position; + const viewModelMaxColumn = viewModel.getLineMaxColumn(viewStatePosition.lineNumber); + const isEndOfViewLine = viewStatePosition.column === viewModelMaxColumn; + const modelStatePosition = cursor.modelState.position; + const modelMaxColumn = viewModel.model.getLineMaxColumn(modelStatePosition.lineNumber); + const isEndLineOfWrappedLine = viewModelMaxColumn - viewStatePosition.column === modelMaxColumn - modelStatePosition.column; + if (isEndOfViewLine || isEndLineOfWrappedLine) { + return this._moveToLineEndByModel(viewModel, cursor, inSelectionMode, sticky); + } else { + return this._moveToLineEndByView(viewModel, cursor, inSelectionMode, sticky); + } + } + static _moveToLineEndByView(viewModel, cursor, inSelectionMode, sticky) { + return CursorState.fromViewState(MoveOperations.moveToEndOfLine(viewModel.cursorConfig, viewModel, cursor.viewState, inSelectionMode, sticky)); + } + static _moveToLineEndByModel(viewModel, cursor, inSelectionMode, sticky) { + return CursorState.fromModelState(MoveOperations.moveToEndOfLine(viewModel.cursorConfig, viewModel.model, cursor.modelState, inSelectionMode, sticky)); + } + static expandLineSelection(viewModel, cursors) { + const result = []; + for (let i2 = 0, len = cursors.length; i2 < len; i2++) { + const cursor = cursors[i2]; + const startLineNumber = cursor.modelState.selection.startLineNumber; + const lineCount = viewModel.model.getLineCount(); + let endLineNumber = cursor.modelState.selection.endLineNumber; + let endColumn; + if (endLineNumber === lineCount) { + endColumn = viewModel.model.getLineMaxColumn(lineCount); + } else { + endLineNumber++; + endColumn = 1; + } + result[i2] = CursorState.fromModelState(new SingleCursorState(new Range(startLineNumber, 1, startLineNumber, 1), 0, 0, new Position(endLineNumber, endColumn), 0)); + } + return result; + } + static moveToBeginningOfBuffer(viewModel, cursors, inSelectionMode) { + const result = []; + for (let i2 = 0, len = cursors.length; i2 < len; i2++) { + const cursor = cursors[i2]; + result[i2] = CursorState.fromModelState(MoveOperations.moveToBeginningOfBuffer(viewModel.cursorConfig, viewModel.model, cursor.modelState, inSelectionMode)); + } + return result; + } + static moveToEndOfBuffer(viewModel, cursors, inSelectionMode) { + const result = []; + for (let i2 = 0, len = cursors.length; i2 < len; i2++) { + const cursor = cursors[i2]; + result[i2] = CursorState.fromModelState(MoveOperations.moveToEndOfBuffer(viewModel.cursorConfig, viewModel.model, cursor.modelState, inSelectionMode)); + } + return result; + } + static selectAll(viewModel, cursor) { + const lineCount = viewModel.model.getLineCount(); + const maxColumn = viewModel.model.getLineMaxColumn(lineCount); + return CursorState.fromModelState(new SingleCursorState(new Range(1, 1, 1, 1), 0, 0, new Position(lineCount, maxColumn), 0)); + } + static line(viewModel, cursor, inSelectionMode, _position, _viewPosition) { + const position = viewModel.model.validatePosition(_position); + const viewPosition = _viewPosition ? viewModel.coordinatesConverter.validateViewPosition(new Position(_viewPosition.lineNumber, _viewPosition.column), position) : viewModel.coordinatesConverter.convertModelPositionToViewPosition(position); + if (!inSelectionMode) { + const lineCount = viewModel.model.getLineCount(); + let selectToLineNumber = position.lineNumber + 1; + let selectToColumn = 1; + if (selectToLineNumber > lineCount) { + selectToLineNumber = lineCount; + selectToColumn = viewModel.model.getLineMaxColumn(selectToLineNumber); + } + return CursorState.fromModelState(new SingleCursorState(new Range(position.lineNumber, 1, selectToLineNumber, selectToColumn), 2, 0, new Position(selectToLineNumber, selectToColumn), 0)); + } + const enteringLineNumber = cursor.modelState.selectionStart.getStartPosition().lineNumber; + if (position.lineNumber < enteringLineNumber) { + return CursorState.fromViewState(cursor.viewState.move(true, viewPosition.lineNumber, 1, 0)); + } else if (position.lineNumber > enteringLineNumber) { + const lineCount = viewModel.getLineCount(); + let selectToViewLineNumber = viewPosition.lineNumber + 1; + let selectToViewColumn = 1; + if (selectToViewLineNumber > lineCount) { + selectToViewLineNumber = lineCount; + selectToViewColumn = viewModel.getLineMaxColumn(selectToViewLineNumber); + } + return CursorState.fromViewState(cursor.viewState.move(true, selectToViewLineNumber, selectToViewColumn, 0)); + } else { + const endPositionOfSelectionStart = cursor.modelState.selectionStart.getEndPosition(); + return CursorState.fromModelState(cursor.modelState.move(true, endPositionOfSelectionStart.lineNumber, endPositionOfSelectionStart.column, 0)); + } + } + static word(viewModel, cursor, inSelectionMode, _position) { + const position = viewModel.model.validatePosition(_position); + return CursorState.fromModelState(WordOperations.word(viewModel.cursorConfig, viewModel.model, cursor.modelState, inSelectionMode, position)); + } + static cancelSelection(viewModel, cursor) { + if (!cursor.modelState.hasSelection()) { + return new CursorState(cursor.modelState, cursor.viewState); + } + const lineNumber = cursor.viewState.position.lineNumber; + const column = cursor.viewState.position.column; + return CursorState.fromViewState(new SingleCursorState(new Range(lineNumber, column, lineNumber, column), 0, 0, new Position(lineNumber, column), 0)); + } + static moveTo(viewModel, cursor, inSelectionMode, _position, _viewPosition) { + if (inSelectionMode) { + if (cursor.modelState.selectionStartKind === 1) { + return this.word(viewModel, cursor, inSelectionMode, _position); + } + if (cursor.modelState.selectionStartKind === 2) { + return this.line(viewModel, cursor, inSelectionMode, _position, _viewPosition); + } + } + const position = viewModel.model.validatePosition(_position); + const viewPosition = _viewPosition ? viewModel.coordinatesConverter.validateViewPosition(new Position(_viewPosition.lineNumber, _viewPosition.column), position) : viewModel.coordinatesConverter.convertModelPositionToViewPosition(position); + return CursorState.fromViewState(cursor.viewState.move(inSelectionMode, viewPosition.lineNumber, viewPosition.column, 0)); + } + static simpleMove(viewModel, cursors, direction, inSelectionMode, value, unit) { + switch (direction) { + case 0: { + if (unit === 4) { + return this._moveHalfLineLeft(viewModel, cursors, inSelectionMode); + } else { + return this._moveLeft(viewModel, cursors, inSelectionMode, value); + } + } + case 1: { + if (unit === 4) { + return this._moveHalfLineRight(viewModel, cursors, inSelectionMode); + } else { + return this._moveRight(viewModel, cursors, inSelectionMode, value); + } + } + case 2: { + if (unit === 2) { + return this._moveUpByViewLines(viewModel, cursors, inSelectionMode, value); + } else { + return this._moveUpByModelLines(viewModel, cursors, inSelectionMode, value); + } + } + case 3: { + if (unit === 2) { + return this._moveDownByViewLines(viewModel, cursors, inSelectionMode, value); + } else { + return this._moveDownByModelLines(viewModel, cursors, inSelectionMode, value); + } + } + case 4: { + if (unit === 2) { + return cursors.map((cursor) => CursorState.fromViewState(MoveOperations.moveToPrevBlankLine(viewModel.cursorConfig, viewModel, cursor.viewState, inSelectionMode))); + } else { + return cursors.map((cursor) => CursorState.fromModelState(MoveOperations.moveToPrevBlankLine(viewModel.cursorConfig, viewModel.model, cursor.modelState, inSelectionMode))); + } + } + case 5: { + if (unit === 2) { + return cursors.map((cursor) => CursorState.fromViewState(MoveOperations.moveToNextBlankLine(viewModel.cursorConfig, viewModel, cursor.viewState, inSelectionMode))); + } else { + return cursors.map((cursor) => CursorState.fromModelState(MoveOperations.moveToNextBlankLine(viewModel.cursorConfig, viewModel.model, cursor.modelState, inSelectionMode))); + } + } + case 6: { + return this._moveToViewMinColumn(viewModel, cursors, inSelectionMode); + } + case 7: { + return this._moveToViewFirstNonWhitespaceColumn(viewModel, cursors, inSelectionMode); + } + case 8: { + return this._moveToViewCenterColumn(viewModel, cursors, inSelectionMode); + } + case 9: { + return this._moveToViewMaxColumn(viewModel, cursors, inSelectionMode); + } + case 10: { + return this._moveToViewLastNonWhitespaceColumn(viewModel, cursors, inSelectionMode); + } + default: + return null; + } + } + static viewportMove(viewModel, cursors, direction, inSelectionMode, value) { + const visibleViewRange = viewModel.getCompletelyVisibleViewRange(); + const visibleModelRange = viewModel.coordinatesConverter.convertViewRangeToModelRange(visibleViewRange); + switch (direction) { + case 11: { + const modelLineNumber = this._firstLineNumberInRange(viewModel.model, visibleModelRange, value); + const modelColumn = viewModel.model.getLineFirstNonWhitespaceColumn(modelLineNumber); + return [this._moveToModelPosition(viewModel, cursors[0], inSelectionMode, modelLineNumber, modelColumn)]; + } + case 13: { + const modelLineNumber = this._lastLineNumberInRange(viewModel.model, visibleModelRange, value); + const modelColumn = viewModel.model.getLineFirstNonWhitespaceColumn(modelLineNumber); + return [this._moveToModelPosition(viewModel, cursors[0], inSelectionMode, modelLineNumber, modelColumn)]; + } + case 12: { + const modelLineNumber = Math.round((visibleModelRange.startLineNumber + visibleModelRange.endLineNumber) / 2); + const modelColumn = viewModel.model.getLineFirstNonWhitespaceColumn(modelLineNumber); + return [this._moveToModelPosition(viewModel, cursors[0], inSelectionMode, modelLineNumber, modelColumn)]; + } + case 14: { + const result = []; + for (let i2 = 0, len = cursors.length; i2 < len; i2++) { + const cursor = cursors[i2]; + result[i2] = this.findPositionInViewportIfOutside(viewModel, cursor, visibleViewRange, inSelectionMode); + } + return result; + } + default: + return null; + } + } + static findPositionInViewportIfOutside(viewModel, cursor, visibleViewRange, inSelectionMode) { + const viewLineNumber = cursor.viewState.position.lineNumber; + if (visibleViewRange.startLineNumber <= viewLineNumber && viewLineNumber <= visibleViewRange.endLineNumber - 1) { + return new CursorState(cursor.modelState, cursor.viewState); + } else { + let newViewLineNumber; + if (viewLineNumber > visibleViewRange.endLineNumber - 1) { + newViewLineNumber = visibleViewRange.endLineNumber - 1; + } else if (viewLineNumber < visibleViewRange.startLineNumber) { + newViewLineNumber = visibleViewRange.startLineNumber; + } else { + newViewLineNumber = viewLineNumber; + } + const position = MoveOperations.vertical(viewModel.cursorConfig, viewModel, viewLineNumber, cursor.viewState.position.column, cursor.viewState.leftoverVisibleColumns, newViewLineNumber, false); + return CursorState.fromViewState(cursor.viewState.move(inSelectionMode, position.lineNumber, position.column, position.leftoverVisibleColumns)); + } + } + /** + * Find the nth line start included in the range (from the start). + */ + static _firstLineNumberInRange(model, range2, count) { + let startLineNumber = range2.startLineNumber; + if (range2.startColumn !== model.getLineMinColumn(startLineNumber)) { + startLineNumber++; + } + return Math.min(range2.endLineNumber, startLineNumber + count - 1); + } + /** + * Find the nth line start included in the range (from the end). + */ + static _lastLineNumberInRange(model, range2, count) { + let startLineNumber = range2.startLineNumber; + if (range2.startColumn !== model.getLineMinColumn(startLineNumber)) { + startLineNumber++; + } + return Math.max(startLineNumber, range2.endLineNumber - count + 1); + } + static _moveLeft(viewModel, cursors, inSelectionMode, noOfColumns) { + return cursors.map((cursor) => { + const direction = viewModel.getTextDirection(cursor.viewState.position.lineNumber); + const isRtl = direction === TextDirection.RTL; + return CursorState.fromViewState(isRtl ? MoveOperations.moveRight(viewModel.cursorConfig, viewModel, cursor.viewState, inSelectionMode, noOfColumns) : MoveOperations.moveLeft(viewModel.cursorConfig, viewModel, cursor.viewState, inSelectionMode, noOfColumns)); + }); + } + static _moveHalfLineLeft(viewModel, cursors, inSelectionMode) { + const result = []; + for (let i2 = 0, len = cursors.length; i2 < len; i2++) { + const cursor = cursors[i2]; + const viewLineNumber = cursor.viewState.position.lineNumber; + const halfLine = Math.round(viewModel.getLineLength(viewLineNumber) / 2); + result[i2] = CursorState.fromViewState(MoveOperations.moveLeft(viewModel.cursorConfig, viewModel, cursor.viewState, inSelectionMode, halfLine)); + } + return result; + } + static _moveRight(viewModel, cursors, inSelectionMode, noOfColumns) { + return cursors.map((cursor) => { + const direction = viewModel.getTextDirection(cursor.viewState.position.lineNumber); + const isRtl = direction === TextDirection.RTL; + return CursorState.fromViewState(isRtl ? MoveOperations.moveLeft(viewModel.cursorConfig, viewModel, cursor.viewState, inSelectionMode, noOfColumns) : MoveOperations.moveRight(viewModel.cursorConfig, viewModel, cursor.viewState, inSelectionMode, noOfColumns)); + }); + } + static _moveHalfLineRight(viewModel, cursors, inSelectionMode) { + const result = []; + for (let i2 = 0, len = cursors.length; i2 < len; i2++) { + const cursor = cursors[i2]; + const viewLineNumber = cursor.viewState.position.lineNumber; + const halfLine = Math.round(viewModel.getLineLength(viewLineNumber) / 2); + result[i2] = CursorState.fromViewState(MoveOperations.moveRight(viewModel.cursorConfig, viewModel, cursor.viewState, inSelectionMode, halfLine)); + } + return result; + } + static _moveDownByViewLines(viewModel, cursors, inSelectionMode, linesCount) { + const result = []; + for (let i2 = 0, len = cursors.length; i2 < len; i2++) { + const cursor = cursors[i2]; + result[i2] = CursorState.fromViewState(MoveOperations.moveDown(viewModel.cursorConfig, viewModel, cursor.viewState, inSelectionMode, linesCount)); + } + return result; + } + static _moveDownByModelLines(viewModel, cursors, inSelectionMode, linesCount) { + const result = []; + for (let i2 = 0, len = cursors.length; i2 < len; i2++) { + const cursor = cursors[i2]; + result[i2] = CursorState.fromModelState(MoveOperations.moveDown(viewModel.cursorConfig, viewModel.model, cursor.modelState, inSelectionMode, linesCount)); + } + return result; + } + static _moveUpByViewLines(viewModel, cursors, inSelectionMode, linesCount) { + const result = []; + for (let i2 = 0, len = cursors.length; i2 < len; i2++) { + const cursor = cursors[i2]; + result[i2] = CursorState.fromViewState(MoveOperations.moveUp(viewModel.cursorConfig, viewModel, cursor.viewState, inSelectionMode, linesCount)); + } + return result; + } + static _moveUpByModelLines(viewModel, cursors, inSelectionMode, linesCount) { + const result = []; + for (let i2 = 0, len = cursors.length; i2 < len; i2++) { + const cursor = cursors[i2]; + result[i2] = CursorState.fromModelState(MoveOperations.moveUp(viewModel.cursorConfig, viewModel.model, cursor.modelState, inSelectionMode, linesCount)); + } + return result; + } + static _moveToViewPosition(viewModel, cursor, inSelectionMode, toViewLineNumber, toViewColumn) { + return CursorState.fromViewState(cursor.viewState.move(inSelectionMode, toViewLineNumber, toViewColumn, 0)); + } + static _moveToModelPosition(viewModel, cursor, inSelectionMode, toModelLineNumber, toModelColumn) { + return CursorState.fromModelState(cursor.modelState.move(inSelectionMode, toModelLineNumber, toModelColumn, 0)); + } + static _moveToViewMinColumn(viewModel, cursors, inSelectionMode) { + const result = []; + for (let i2 = 0, len = cursors.length; i2 < len; i2++) { + const cursor = cursors[i2]; + const viewLineNumber = cursor.viewState.position.lineNumber; + const viewColumn = viewModel.getLineMinColumn(viewLineNumber); + result[i2] = this._moveToViewPosition(viewModel, cursor, inSelectionMode, viewLineNumber, viewColumn); + } + return result; + } + static _moveToViewFirstNonWhitespaceColumn(viewModel, cursors, inSelectionMode) { + const result = []; + for (let i2 = 0, len = cursors.length; i2 < len; i2++) { + const cursor = cursors[i2]; + const viewLineNumber = cursor.viewState.position.lineNumber; + const viewColumn = viewModel.getLineFirstNonWhitespaceColumn(viewLineNumber); + result[i2] = this._moveToViewPosition(viewModel, cursor, inSelectionMode, viewLineNumber, viewColumn); + } + return result; + } + static _moveToViewCenterColumn(viewModel, cursors, inSelectionMode) { + const result = []; + for (let i2 = 0, len = cursors.length; i2 < len; i2++) { + const cursor = cursors[i2]; + const viewLineNumber = cursor.viewState.position.lineNumber; + const viewColumn = Math.round((viewModel.getLineMaxColumn(viewLineNumber) + viewModel.getLineMinColumn(viewLineNumber)) / 2); + result[i2] = this._moveToViewPosition(viewModel, cursor, inSelectionMode, viewLineNumber, viewColumn); + } + return result; + } + static _moveToViewMaxColumn(viewModel, cursors, inSelectionMode) { + const result = []; + for (let i2 = 0, len = cursors.length; i2 < len; i2++) { + const cursor = cursors[i2]; + const viewLineNumber = cursor.viewState.position.lineNumber; + const viewColumn = viewModel.getLineMaxColumn(viewLineNumber); + result[i2] = this._moveToViewPosition(viewModel, cursor, inSelectionMode, viewLineNumber, viewColumn); + } + return result; + } + static _moveToViewLastNonWhitespaceColumn(viewModel, cursors, inSelectionMode) { + const result = []; + for (let i2 = 0, len = cursors.length; i2 < len; i2++) { + const cursor = cursors[i2]; + const viewLineNumber = cursor.viewState.position.lineNumber; + const viewColumn = viewModel.getLineLastNonWhitespaceColumn(viewLineNumber); + result[i2] = this._moveToViewPosition(viewModel, cursor, inSelectionMode, viewLineNumber, viewColumn); + } + return result; + } +}; +var CursorMove; +(function(CursorMove2) { + const isCursorMoveArgs = function(arg) { + if (!isObject(arg)) { + return false; + } + const cursorMoveArg = arg; + if (!isString(cursorMoveArg.to)) { + return false; + } + if (!isUndefined(cursorMoveArg.select) && !isBoolean(cursorMoveArg.select)) { + return false; + } + if (!isUndefined(cursorMoveArg.by) && !isString(cursorMoveArg.by)) { + return false; + } + if (!isUndefined(cursorMoveArg.value) && !isNumber(cursorMoveArg.value)) { + return false; + } + if (!isUndefined(cursorMoveArg.noHistory) && !isBoolean(cursorMoveArg.noHistory)) { + return false; + } + return true; + }; + CursorMove2.metadata = { + description: "Move cursor to a logical position in the view", + args: [ + { + name: "Cursor move argument object", + description: `Property-value pairs that can be passed through this argument: + * 'to': A mandatory logical position value providing where to move the cursor. + \`\`\` + 'left', 'right', 'up', 'down', 'prevBlankLine', 'nextBlankLine', + 'wrappedLineStart', 'wrappedLineEnd', 'wrappedLineColumnCenter' + 'wrappedLineFirstNonWhitespaceCharacter', 'wrappedLineLastNonWhitespaceCharacter' + 'viewPortTop', 'viewPortCenter', 'viewPortBottom', 'viewPortIfOutside' + \`\`\` + * 'by': Unit to move. Default is computed based on 'to' value. + \`\`\` + 'line', 'wrappedLine', 'character', 'halfLine' + \`\`\` + * 'value': Number of units to move. Default is '1'. + * 'select': If 'true' makes the selection. Default is 'false'. + * 'noHistory': If 'true' does not add the movement to navigation history. Default is 'false'. + `, + constraint: isCursorMoveArgs, + schema: { + "type": "object", + "required": ["to"], + "properties": { + "to": { + "type": "string", + "enum": ["left", "right", "up", "down", "prevBlankLine", "nextBlankLine", "wrappedLineStart", "wrappedLineEnd", "wrappedLineColumnCenter", "wrappedLineFirstNonWhitespaceCharacter", "wrappedLineLastNonWhitespaceCharacter", "viewPortTop", "viewPortCenter", "viewPortBottom", "viewPortIfOutside"] + }, + "by": { + "type": "string", + "enum": ["line", "wrappedLine", "character", "halfLine"] + }, + "value": { + "type": "number", + "default": 1 + }, + "select": { + "type": "boolean", + "default": false + }, + "noHistory": { + "type": "boolean", + "default": false + } + } + } + } + ] + }; + CursorMove2.RawDirection = { + Left: "left", + Right: "right", + Up: "up", + Down: "down", + PrevBlankLine: "prevBlankLine", + NextBlankLine: "nextBlankLine", + WrappedLineStart: "wrappedLineStart", + WrappedLineFirstNonWhitespaceCharacter: "wrappedLineFirstNonWhitespaceCharacter", + WrappedLineColumnCenter: "wrappedLineColumnCenter", + WrappedLineEnd: "wrappedLineEnd", + WrappedLineLastNonWhitespaceCharacter: "wrappedLineLastNonWhitespaceCharacter", + ViewPortTop: "viewPortTop", + ViewPortCenter: "viewPortCenter", + ViewPortBottom: "viewPortBottom", + ViewPortIfOutside: "viewPortIfOutside" + }; + CursorMove2.RawUnit = { + Line: "line", + WrappedLine: "wrappedLine", + Character: "character", + HalfLine: "halfLine" + }; + function parse4(args) { + if (!args.to) { + return null; + } + let direction; + switch (args.to) { + case CursorMove2.RawDirection.Left: + direction = 0; + break; + case CursorMove2.RawDirection.Right: + direction = 1; + break; + case CursorMove2.RawDirection.Up: + direction = 2; + break; + case CursorMove2.RawDirection.Down: + direction = 3; + break; + case CursorMove2.RawDirection.PrevBlankLine: + direction = 4; + break; + case CursorMove2.RawDirection.NextBlankLine: + direction = 5; + break; + case CursorMove2.RawDirection.WrappedLineStart: + direction = 6; + break; + case CursorMove2.RawDirection.WrappedLineFirstNonWhitespaceCharacter: + direction = 7; + break; + case CursorMove2.RawDirection.WrappedLineColumnCenter: + direction = 8; + break; + case CursorMove2.RawDirection.WrappedLineEnd: + direction = 9; + break; + case CursorMove2.RawDirection.WrappedLineLastNonWhitespaceCharacter: + direction = 10; + break; + case CursorMove2.RawDirection.ViewPortTop: + direction = 11; + break; + case CursorMove2.RawDirection.ViewPortBottom: + direction = 13; + break; + case CursorMove2.RawDirection.ViewPortCenter: + direction = 12; + break; + case CursorMove2.RawDirection.ViewPortIfOutside: + direction = 14; + break; + default: + return null; + } + let unit = 0; + switch (args.by) { + case CursorMove2.RawUnit.Line: + unit = 1; + break; + case CursorMove2.RawUnit.WrappedLine: + unit = 2; + break; + case CursorMove2.RawUnit.Character: + unit = 3; + break; + case CursorMove2.RawUnit.HalfLine: + unit = 4; + break; + } + return { + direction, + unit, + select: !!args.select, + value: args.value || 1, + noHistory: !!args.noHistory + }; + } + CursorMove2.parse = parse4; +})(CursorMove || (CursorMove = {})); + +// node_modules/monaco-editor-core/esm/vs/editor/common/commands/shiftCommand.js +init_strings(); +init_cursorColumns(); +init_range(); +init_selection(); + +// node_modules/monaco-editor-core/esm/vs/editor/common/languages/enterAction.js +init_languageConfiguration(); +init_languageConfigurationRegistry(); + +// node_modules/monaco-editor-core/esm/vs/editor/common/languages/supports/indentationLineProcessor.js +init_strings(); +init_supports(); +init_lineTokens(); +var ProcessedIndentRulesSupport = class { + constructor(model, indentRulesSupport, languageConfigurationService) { + this._indentRulesSupport = indentRulesSupport; + this._indentationLineProcessor = new IndentationLineProcessor(model, languageConfigurationService); + } + /** + * Apply the new indentation and return whether the indentation level should be increased after the given line number + */ + shouldIncrease(lineNumber, newIndentation) { + const processedLine = this._indentationLineProcessor.getProcessedLine(lineNumber, newIndentation); + return this._indentRulesSupport.shouldIncrease(processedLine); + } + /** + * Apply the new indentation and return whether the indentation level should be decreased after the given line number + */ + shouldDecrease(lineNumber, newIndentation) { + const processedLine = this._indentationLineProcessor.getProcessedLine(lineNumber, newIndentation); + return this._indentRulesSupport.shouldDecrease(processedLine); + } + /** + * Apply the new indentation and return whether the indentation level should remain unchanged at the given line number + */ + shouldIgnore(lineNumber, newIndentation) { + const processedLine = this._indentationLineProcessor.getProcessedLine(lineNumber, newIndentation); + return this._indentRulesSupport.shouldIgnore(processedLine); + } + /** + * Apply the new indentation and return whether the indentation level should increase on the line after the given line number + */ + shouldIndentNextLine(lineNumber, newIndentation) { + const processedLine = this._indentationLineProcessor.getProcessedLine(lineNumber, newIndentation); + return this._indentRulesSupport.shouldIndentNextLine(processedLine); + } +}; +var IndentationContextProcessor = class { + constructor(model, languageConfigurationService) { + this.model = model; + this.indentationLineProcessor = new IndentationLineProcessor(model, languageConfigurationService); + } + /** + * Returns the processed text, stripped from the language configuration brackets within the string, comment and regex tokens, around the given range + */ + getProcessedTokenContextAroundRange(range2) { + const beforeRangeProcessedTokens = this._getProcessedTokensBeforeRange(range2); + const afterRangeProcessedTokens = this._getProcessedTokensAfterRange(range2); + const previousLineProcessedTokens = this._getProcessedPreviousLineTokens(range2); + return { beforeRangeProcessedTokens, afterRangeProcessedTokens, previousLineProcessedTokens }; + } + _getProcessedTokensBeforeRange(range2) { + this.model.tokenization.forceTokenization(range2.startLineNumber); + const lineTokens = this.model.tokenization.getLineTokens(range2.startLineNumber); + const scopedLineTokens = createScopedLineTokens(lineTokens, range2.startColumn - 1); + let slicedTokens; + if (isLanguageDifferentFromLineStart(this.model, range2.getStartPosition())) { + const columnIndexWithinScope = range2.startColumn - 1 - scopedLineTokens.firstCharOffset; + const firstCharacterOffset = scopedLineTokens.firstCharOffset; + const lastCharacterOffset = firstCharacterOffset + columnIndexWithinScope; + slicedTokens = lineTokens.sliceAndInflate(firstCharacterOffset, lastCharacterOffset, 0); + } else { + const columnWithinLine = range2.startColumn - 1; + slicedTokens = lineTokens.sliceAndInflate(0, columnWithinLine, 0); + } + const processedTokens = this.indentationLineProcessor.getProcessedTokens(slicedTokens); + return processedTokens; + } + _getProcessedTokensAfterRange(range2) { + const position = range2.isEmpty() ? range2.getStartPosition() : range2.getEndPosition(); + this.model.tokenization.forceTokenization(position.lineNumber); + const lineTokens = this.model.tokenization.getLineTokens(position.lineNumber); + const scopedLineTokens = createScopedLineTokens(lineTokens, position.column - 1); + const columnIndexWithinScope = position.column - 1 - scopedLineTokens.firstCharOffset; + const firstCharacterOffset = scopedLineTokens.firstCharOffset + columnIndexWithinScope; + const lastCharacterOffset = scopedLineTokens.firstCharOffset + scopedLineTokens.getLineLength(); + const slicedTokens = lineTokens.sliceAndInflate(firstCharacterOffset, lastCharacterOffset, 0); + const processedTokens = this.indentationLineProcessor.getProcessedTokens(slicedTokens); + return processedTokens; + } + _getProcessedPreviousLineTokens(range2) { + const getScopedLineTokensAtEndColumnOfLine = (lineNumber) => { + this.model.tokenization.forceTokenization(lineNumber); + const lineTokens2 = this.model.tokenization.getLineTokens(lineNumber); + const endColumnOfLine = this.model.getLineMaxColumn(lineNumber) - 1; + const scopedLineTokensAtEndColumn = createScopedLineTokens(lineTokens2, endColumnOfLine); + return scopedLineTokensAtEndColumn; + }; + this.model.tokenization.forceTokenization(range2.startLineNumber); + const lineTokens = this.model.tokenization.getLineTokens(range2.startLineNumber); + const scopedLineTokens = createScopedLineTokens(lineTokens, range2.startColumn - 1); + const emptyTokens = LineTokens.createEmpty("", scopedLineTokens.languageIdCodec); + const previousLineNumber = range2.startLineNumber - 1; + const isFirstLine = previousLineNumber === 0; + if (isFirstLine) { + return emptyTokens; + } + const canScopeExtendOnPreviousLine = scopedLineTokens.firstCharOffset === 0; + if (!canScopeExtendOnPreviousLine) { + return emptyTokens; + } + const scopedLineTokensAtEndColumnOfPreviousLine = getScopedLineTokensAtEndColumnOfLine(previousLineNumber); + const doesLanguageContinueOnPreviousLine = scopedLineTokens.languageId === scopedLineTokensAtEndColumnOfPreviousLine.languageId; + if (!doesLanguageContinueOnPreviousLine) { + return emptyTokens; + } + const previousSlicedLineTokens = scopedLineTokensAtEndColumnOfPreviousLine.toIViewLineTokens(); + const processedTokens = this.indentationLineProcessor.getProcessedTokens(previousSlicedLineTokens); + return processedTokens; + } +}; +var IndentationLineProcessor = class { + constructor(model, languageConfigurationService) { + this.model = model; + this.languageConfigurationService = languageConfigurationService; + } + /** + * Get the processed line for the given line number and potentially adjust the indentation level. + * Remove the language configuration brackets from the regex, string and comment tokens. + */ + getProcessedLine(lineNumber, newIndentation) { + const replaceIndentation = (line, newIndentation2) => { + const currentIndentation = getLeadingWhitespace(line); + const adjustedLine = newIndentation2 + line.substring(currentIndentation.length); + return adjustedLine; + }; + this.model.tokenization.forceTokenization?.(lineNumber); + const tokens = this.model.tokenization.getLineTokens(lineNumber); + let processedLine = this.getProcessedTokens(tokens).getLineContent(); + if (newIndentation !== void 0) { + processedLine = replaceIndentation(processedLine, newIndentation); + } + return processedLine; + } + /** + * Process the line with the given tokens, remove the language configuration brackets from the regex, string and comment tokens. + */ + getProcessedTokens(tokens) { + const shouldRemoveBracketsFromTokenType = (tokenType) => { + return tokenType === 2 || tokenType === 3 || tokenType === 1; + }; + const languageId = tokens.getLanguageId(0); + const bracketsConfiguration = this.languageConfigurationService.getLanguageConfiguration(languageId).bracketsNew; + const bracketsRegExp = bracketsConfiguration.getBracketRegExp({ global: true }); + const textAndMetadata = []; + tokens.forEach((tokenIndex) => { + const tokenType = tokens.getStandardTokenType(tokenIndex); + let text2 = tokens.getTokenText(tokenIndex); + if (shouldRemoveBracketsFromTokenType(tokenType)) { + text2 = text2.replace(bracketsRegExp, ""); + } + const metadata = tokens.getMetadata(tokenIndex); + textAndMetadata.push({ text: text2, metadata }); + }); + const processedLineTokens = LineTokens.createFromTextAndMetadata(textAndMetadata, tokens.languageIdCodec); + return processedLineTokens; + } +}; +function isLanguageDifferentFromLineStart(model, position) { + model.tokenization.forceTokenization(position.lineNumber); + const lineTokens = model.tokenization.getLineTokens(position.lineNumber); + const scopedLineTokens = createScopedLineTokens(lineTokens, position.column - 1); + const doesScopeStartAtOffsetZero = scopedLineTokens.firstCharOffset === 0; + const isScopedLanguageEqualToFirstLanguageOnLine = lineTokens.getLanguageId(0) === scopedLineTokens.languageId; + const languageIsDifferentFromLineStart = !doesScopeStartAtOffsetZero && !isScopedLanguageEqualToFirstLanguageOnLine; + return languageIsDifferentFromLineStart; +} + +// node_modules/monaco-editor-core/esm/vs/editor/common/languages/enterAction.js +function getEnterAction(autoIndent, model, range2, languageConfigurationService) { + model.tokenization.forceTokenization(range2.startLineNumber); + const languageId = model.getLanguageIdAtPosition(range2.startLineNumber, range2.startColumn); + const richEditSupport = languageConfigurationService.getLanguageConfiguration(languageId); + if (!richEditSupport) { + return null; + } + const indentationContextProcessor = new IndentationContextProcessor(model, languageConfigurationService); + const processedContextTokens = indentationContextProcessor.getProcessedTokenContextAroundRange(range2); + const previousLineText = processedContextTokens.previousLineProcessedTokens.getLineContent(); + const beforeEnterText = processedContextTokens.beforeRangeProcessedTokens.getLineContent(); + const afterEnterText = processedContextTokens.afterRangeProcessedTokens.getLineContent(); + const enterResult = richEditSupport.onEnter(autoIndent, previousLineText, beforeEnterText, afterEnterText); + if (!enterResult) { + return null; + } + const indentAction = enterResult.indentAction; + let appendText = enterResult.appendText; + const removeText = enterResult.removeText || 0; + if (!appendText) { + if (indentAction === IndentAction.Indent || indentAction === IndentAction.IndentOutdent) { + appendText = " "; + } else { + appendText = ""; + } + } else if (indentAction === IndentAction.Indent) { + appendText = " " + appendText; + } + let indentation = getIndentationAtPosition(model, range2.startLineNumber, range2.startColumn); + if (removeText) { + indentation = indentation.substring(0, indentation.length - removeText); + } + return { + indentAction, + appendText, + removeText, + indentation + }; +} + +// node_modules/monaco-editor-core/esm/vs/editor/common/commands/shiftCommand.js +init_languageConfigurationRegistry(); +var __decorate3 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param3 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var ShiftCommand_1; +var repeatCache = /* @__PURE__ */ Object.create(null); +function cachedStringRepeat(str, count) { + if (count <= 0) { + return ""; + } + if (!repeatCache[str]) { + repeatCache[str] = ["", str]; + } + const cache = repeatCache[str]; + for (let i2 = cache.length; i2 <= count; i2++) { + cache[i2] = cache[i2 - 1] + str; + } + return cache[count]; +} +var ShiftCommand = ShiftCommand_1 = class ShiftCommand2 { + static unshiftIndent(line, column, tabSize, indentSize, insertSpaces) { + const contentStartVisibleColumn = CursorColumns.visibleColumnFromColumn(line, column, tabSize); + if (insertSpaces) { + const indent = cachedStringRepeat(" ", indentSize); + const desiredTabStop = CursorColumns.prevIndentTabStop(contentStartVisibleColumn, indentSize); + const indentCount = desiredTabStop / indentSize; + return cachedStringRepeat(indent, indentCount); + } else { + const indent = " "; + const desiredTabStop = CursorColumns.prevRenderTabStop(contentStartVisibleColumn, tabSize); + const indentCount = desiredTabStop / tabSize; + return cachedStringRepeat(indent, indentCount); + } + } + static shiftIndent(line, column, tabSize, indentSize, insertSpaces) { + const contentStartVisibleColumn = CursorColumns.visibleColumnFromColumn(line, column, tabSize); + if (insertSpaces) { + const indent = cachedStringRepeat(" ", indentSize); + const desiredTabStop = CursorColumns.nextIndentTabStop(contentStartVisibleColumn, indentSize); + const indentCount = desiredTabStop / indentSize; + return cachedStringRepeat(indent, indentCount); + } else { + const indent = " "; + const desiredTabStop = CursorColumns.nextRenderTabStop(contentStartVisibleColumn, tabSize); + const indentCount = desiredTabStop / tabSize; + return cachedStringRepeat(indent, indentCount); + } + } + constructor(range2, opts, _languageConfigurationService) { + this._languageConfigurationService = _languageConfigurationService; + this._opts = opts; + this._selection = range2; + this._selectionId = null; + this._useLastEditRangeForCursorEndPosition = false; + this._selectionStartColumnStaysPut = false; + } + _addEditOperation(builder, range2, text2) { + if (this._useLastEditRangeForCursorEndPosition) { + builder.addTrackedEditOperation(range2, text2); + } else { + builder.addEditOperation(range2, text2); + } + } + getEditOperations(model, builder) { + const startLine = this._selection.startLineNumber; + let endLine = this._selection.endLineNumber; + if (this._selection.endColumn === 1 && startLine !== endLine) { + endLine = endLine - 1; + } + const { tabSize, indentSize, insertSpaces } = this._opts; + const shouldIndentEmptyLines = startLine === endLine; + if (this._opts.useTabStops) { + if (this._selection.isEmpty()) { + if (/^\s*$/.test(model.getLineContent(startLine))) { + this._useLastEditRangeForCursorEndPosition = true; + } + } + let previousLineExtraSpaces = 0, extraSpaces = 0; + for (let lineNumber = startLine; lineNumber <= endLine; lineNumber++, previousLineExtraSpaces = extraSpaces) { + extraSpaces = 0; + const lineText = model.getLineContent(lineNumber); + let indentationEndIndex = firstNonWhitespaceIndex(lineText); + if (this._opts.isUnshift && (lineText.length === 0 || indentationEndIndex === 0)) { + continue; + } + if (!shouldIndentEmptyLines && !this._opts.isUnshift && lineText.length === 0) { + continue; + } + if (indentationEndIndex === -1) { + indentationEndIndex = lineText.length; + } + if (lineNumber > 1) { + const contentStartVisibleColumn = CursorColumns.visibleColumnFromColumn(lineText, indentationEndIndex + 1, tabSize); + if (contentStartVisibleColumn % indentSize !== 0) { + if (model.tokenization.isCheapToTokenize(lineNumber - 1)) { + const enterAction = getEnterAction(this._opts.autoIndent, model, new Range(lineNumber - 1, model.getLineMaxColumn(lineNumber - 1), lineNumber - 1, model.getLineMaxColumn(lineNumber - 1)), this._languageConfigurationService); + if (enterAction) { + extraSpaces = previousLineExtraSpaces; + if (enterAction.appendText) { + for (let j = 0, lenJ = enterAction.appendText.length; j < lenJ && extraSpaces < indentSize; j++) { + if (enterAction.appendText.charCodeAt(j) === 32) { + extraSpaces++; + } else { + break; + } + } + } + if (enterAction.removeText) { + extraSpaces = Math.max(0, extraSpaces - enterAction.removeText); + } + for (let j = 0; j < extraSpaces; j++) { + if (indentationEndIndex === 0 || lineText.charCodeAt(indentationEndIndex - 1) !== 32) { + break; + } + indentationEndIndex--; + } + } + } + } + } + if (this._opts.isUnshift && indentationEndIndex === 0) { + continue; + } + let desiredIndent; + if (this._opts.isUnshift) { + desiredIndent = ShiftCommand_1.unshiftIndent(lineText, indentationEndIndex + 1, tabSize, indentSize, insertSpaces); + } else { + desiredIndent = ShiftCommand_1.shiftIndent(lineText, indentationEndIndex + 1, tabSize, indentSize, insertSpaces); + } + this._addEditOperation(builder, new Range(lineNumber, 1, lineNumber, indentationEndIndex + 1), desiredIndent); + if (lineNumber === startLine && !this._selection.isEmpty()) { + this._selectionStartColumnStaysPut = this._selection.startColumn <= indentationEndIndex + 1; + } + } + } else { + if (!this._opts.isUnshift && this._selection.isEmpty() && model.getLineLength(startLine) === 0) { + this._useLastEditRangeForCursorEndPosition = true; + } + const oneIndent = insertSpaces ? cachedStringRepeat(" ", indentSize) : " "; + for (let lineNumber = startLine; lineNumber <= endLine; lineNumber++) { + const lineText = model.getLineContent(lineNumber); + let indentationEndIndex = firstNonWhitespaceIndex(lineText); + if (this._opts.isUnshift && (lineText.length === 0 || indentationEndIndex === 0)) { + continue; + } + if (!shouldIndentEmptyLines && !this._opts.isUnshift && lineText.length === 0) { + continue; + } + if (indentationEndIndex === -1) { + indentationEndIndex = lineText.length; + } + if (this._opts.isUnshift && indentationEndIndex === 0) { + continue; + } + if (this._opts.isUnshift) { + indentationEndIndex = Math.min(indentationEndIndex, indentSize); + for (let i2 = 0; i2 < indentationEndIndex; i2++) { + const chr = lineText.charCodeAt(i2); + if (chr === 9) { + indentationEndIndex = i2 + 1; + break; + } + } + this._addEditOperation(builder, new Range(lineNumber, 1, lineNumber, indentationEndIndex + 1), ""); + } else { + this._addEditOperation(builder, new Range(lineNumber, 1, lineNumber, 1), oneIndent); + if (lineNumber === startLine && !this._selection.isEmpty()) { + this._selectionStartColumnStaysPut = this._selection.startColumn === 1; + } + } + } + } + this._selectionId = builder.trackSelection(this._selection); + } + computeCursorState(model, helper) { + if (this._useLastEditRangeForCursorEndPosition) { + const lastOp = helper.getInverseEditOperations()[0]; + return new Selection(lastOp.range.endLineNumber, lastOp.range.endColumn, lastOp.range.endLineNumber, lastOp.range.endColumn); + } + const result = helper.getTrackedSelection(this._selectionId); + if (this._selectionStartColumnStaysPut) { + const initialStartColumn = this._selection.startColumn; + const resultStartColumn = result.startColumn; + if (resultStartColumn <= initialStartColumn) { + return result; + } + if (result.getDirection() === 0) { + return new Selection(result.startLineNumber, initialStartColumn, result.endLineNumber, result.endColumn); + } + return new Selection(result.endLineNumber, result.endColumn, result.startLineNumber, initialStartColumn); + } + return result; + } +}; +ShiftCommand = ShiftCommand_1 = __decorate3([ + __param3(2, ILanguageConfigurationService) +], ShiftCommand); + +// node_modules/monaco-editor-core/esm/vs/editor/common/commands/surroundSelectionCommand.js +init_range(); +init_selection(); +var SurroundSelectionCommand = class { + constructor(range2, charBeforeSelection, charAfterSelection) { + this._range = range2; + this._charBeforeSelection = charBeforeSelection; + this._charAfterSelection = charAfterSelection; + } + getEditOperations(model, builder) { + builder.addTrackedEditOperation(new Range(this._range.startLineNumber, this._range.startColumn, this._range.startLineNumber, this._range.startColumn), this._charBeforeSelection); + builder.addTrackedEditOperation(new Range(this._range.endLineNumber, this._range.endColumn, this._range.endLineNumber, this._range.endColumn), this._charAfterSelection || null); + } + computeCursorState(model, helper) { + const inverseEditOperations = helper.getInverseEditOperations(); + const firstOperationRange = inverseEditOperations[0].range; + const secondOperationRange = inverseEditOperations[1].range; + return new Selection(firstOperationRange.endLineNumber, firstOperationRange.endColumn, secondOperationRange.endLineNumber, secondOperationRange.endColumn - this._charAfterSelection.length); + } +}; +var CompositionSurroundSelectionCommand = class { + constructor(_position, _text, _charAfter) { + this._position = _position; + this._text = _text; + this._charAfter = _charAfter; + } + getEditOperations(model, builder) { + builder.addTrackedEditOperation(new Range(this._position.lineNumber, this._position.column, this._position.lineNumber, this._position.column), this._text + this._charAfter); + } + computeCursorState(model, helper) { + const inverseEditOperations = helper.getInverseEditOperations(); + const opRange = inverseEditOperations[0].range; + return new Selection(opRange.endLineNumber, opRange.startColumn, opRange.endLineNumber, opRange.endColumn - this._charAfter.length); + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/common/cursor/cursorTypeEditOperations.js +init_errors(); +init_strings(); +init_wordCharacterClassifier(); +init_range(); +init_position(); +init_languageConfiguration(); +init_languageConfigurationRegistry(); +init_supports(); + +// node_modules/monaco-editor-core/esm/vs/editor/common/languages/autoIndent.js +init_strings(); +init_languageConfiguration(); +function getPrecedingValidLine(model, lineNumber, processedIndentRulesSupport) { + const languageId = model.tokenization.getLanguageIdAtPosition(lineNumber, 0); + if (lineNumber > 1) { + let lastLineNumber; + let resultLineNumber = -1; + for (lastLineNumber = lineNumber - 1; lastLineNumber >= 1; lastLineNumber--) { + if (model.tokenization.getLanguageIdAtPosition(lastLineNumber, 0) !== languageId) { + return resultLineNumber; + } + const text2 = model.getLineContent(lastLineNumber); + if (processedIndentRulesSupport.shouldIgnore(lastLineNumber) || /^\s+$/.test(text2) || text2 === "") { + resultLineNumber = lastLineNumber; + continue; + } + return lastLineNumber; + } + } + return -1; +} +function getInheritIndentForLine(autoIndent, model, lineNumber, honorIntentialIndent = true, languageConfigurationService) { + if (autoIndent < 4) { + return null; + } + const indentRulesSupport = languageConfigurationService.getLanguageConfiguration(model.tokenization.getLanguageId()).indentRulesSupport; + if (!indentRulesSupport) { + return null; + } + const processedIndentRulesSupport = new ProcessedIndentRulesSupport(model, indentRulesSupport, languageConfigurationService); + if (lineNumber <= 1) { + return { + indentation: "", + action: null + }; + } + for (let priorLineNumber = lineNumber - 1; priorLineNumber > 0; priorLineNumber--) { + if (model.getLineContent(priorLineNumber) !== "") { + break; + } + if (priorLineNumber === 1) { + return { + indentation: "", + action: null + }; + } + } + const precedingUnIgnoredLine = getPrecedingValidLine(model, lineNumber, processedIndentRulesSupport); + if (precedingUnIgnoredLine < 0) { + return null; + } else if (precedingUnIgnoredLine < 1) { + return { + indentation: "", + action: null + }; + } + if (processedIndentRulesSupport.shouldIncrease(precedingUnIgnoredLine) || processedIndentRulesSupport.shouldIndentNextLine(precedingUnIgnoredLine)) { + const precedingUnIgnoredLineContent = model.getLineContent(precedingUnIgnoredLine); + return { + indentation: getLeadingWhitespace(precedingUnIgnoredLineContent), + action: IndentAction.Indent, + line: precedingUnIgnoredLine + }; + } else if (processedIndentRulesSupport.shouldDecrease(precedingUnIgnoredLine)) { + const precedingUnIgnoredLineContent = model.getLineContent(precedingUnIgnoredLine); + return { + indentation: getLeadingWhitespace(precedingUnIgnoredLineContent), + action: null, + line: precedingUnIgnoredLine + }; + } else { + if (precedingUnIgnoredLine === 1) { + return { + indentation: getLeadingWhitespace(model.getLineContent(precedingUnIgnoredLine)), + action: null, + line: precedingUnIgnoredLine + }; + } + const previousLine = precedingUnIgnoredLine - 1; + const previousLineIndentMetadata = indentRulesSupport.getIndentMetadata(model.getLineContent(previousLine)); + if (!(previousLineIndentMetadata & (1 | 2)) && previousLineIndentMetadata & 4) { + let stopLine = 0; + for (let i2 = previousLine - 1; i2 > 0; i2--) { + if (processedIndentRulesSupport.shouldIndentNextLine(i2)) { + continue; + } + stopLine = i2; + break; + } + return { + indentation: getLeadingWhitespace(model.getLineContent(stopLine + 1)), + action: null, + line: stopLine + 1 + }; + } + if (honorIntentialIndent) { + return { + indentation: getLeadingWhitespace(model.getLineContent(precedingUnIgnoredLine)), + action: null, + line: precedingUnIgnoredLine + }; + } else { + for (let i2 = precedingUnIgnoredLine; i2 > 0; i2--) { + if (processedIndentRulesSupport.shouldIncrease(i2)) { + return { + indentation: getLeadingWhitespace(model.getLineContent(i2)), + action: IndentAction.Indent, + line: i2 + }; + } else if (processedIndentRulesSupport.shouldIndentNextLine(i2)) { + let stopLine = 0; + for (let j = i2 - 1; j > 0; j--) { + if (processedIndentRulesSupport.shouldIndentNextLine(i2)) { + continue; + } + stopLine = j; + break; + } + return { + indentation: getLeadingWhitespace(model.getLineContent(stopLine + 1)), + action: null, + line: stopLine + 1 + }; + } else if (processedIndentRulesSupport.shouldDecrease(i2)) { + return { + indentation: getLeadingWhitespace(model.getLineContent(i2)), + action: null, + line: i2 + }; + } + } + return { + indentation: getLeadingWhitespace(model.getLineContent(1)), + action: null, + line: 1 + }; + } + } +} +function getGoodIndentForLine(autoIndent, virtualModel, languageId, lineNumber, indentConverter, languageConfigurationService) { + if (autoIndent < 4) { + return null; + } + const richEditSupport = languageConfigurationService.getLanguageConfiguration(languageId); + if (!richEditSupport) { + return null; + } + const indentRulesSupport = languageConfigurationService.getLanguageConfiguration(languageId).indentRulesSupport; + if (!indentRulesSupport) { + return null; + } + const processedIndentRulesSupport = new ProcessedIndentRulesSupport(virtualModel, indentRulesSupport, languageConfigurationService); + const indent = getInheritIndentForLine(autoIndent, virtualModel, lineNumber, void 0, languageConfigurationService); + if (indent) { + const inheritLine = indent.line; + if (inheritLine !== void 0) { + let shouldApplyEnterRules = true; + for (let inBetweenLine = inheritLine; inBetweenLine < lineNumber - 1; inBetweenLine++) { + if (!/^\s*$/.test(virtualModel.getLineContent(inBetweenLine))) { + shouldApplyEnterRules = false; + break; + } + } + if (shouldApplyEnterRules) { + const enterResult = richEditSupport.onEnter(autoIndent, "", virtualModel.getLineContent(inheritLine), ""); + if (enterResult) { + let indentation = getLeadingWhitespace(virtualModel.getLineContent(inheritLine)); + if (enterResult.removeText) { + indentation = indentation.substring(0, indentation.length - enterResult.removeText); + } + if (enterResult.indentAction === IndentAction.Indent || enterResult.indentAction === IndentAction.IndentOutdent) { + indentation = indentConverter.shiftIndent(indentation); + } else if (enterResult.indentAction === IndentAction.Outdent) { + indentation = indentConverter.unshiftIndent(indentation); + } + if (processedIndentRulesSupport.shouldDecrease(lineNumber)) { + indentation = indentConverter.unshiftIndent(indentation); + } + if (enterResult.appendText) { + indentation += enterResult.appendText; + } + return getLeadingWhitespace(indentation); + } + } + } + if (processedIndentRulesSupport.shouldDecrease(lineNumber)) { + if (indent.action === IndentAction.Indent) { + return indent.indentation; + } else { + return indentConverter.unshiftIndent(indent.indentation); + } + } else { + if (indent.action === IndentAction.Indent) { + return indentConverter.shiftIndent(indent.indentation); + } else { + return indent.indentation; + } + } + } + return null; +} +function getIndentForEnter(autoIndent, model, range2, indentConverter, languageConfigurationService) { + if (autoIndent < 4) { + return null; + } + const languageId = model.getLanguageIdAtPosition(range2.startLineNumber, range2.startColumn); + const indentRulesSupport = languageConfigurationService.getLanguageConfiguration(languageId).indentRulesSupport; + if (!indentRulesSupport) { + return null; + } + model.tokenization.forceTokenization(range2.startLineNumber); + const indentationContextProcessor = new IndentationContextProcessor(model, languageConfigurationService); + const processedContextTokens = indentationContextProcessor.getProcessedTokenContextAroundRange(range2); + const afterEnterProcessedTokens = processedContextTokens.afterRangeProcessedTokens; + const beforeEnterProcessedTokens = processedContextTokens.beforeRangeProcessedTokens; + const beforeEnterIndent = getLeadingWhitespace(beforeEnterProcessedTokens.getLineContent()); + const virtualModel = createVirtualModelWithModifiedTokensAtLine(model, range2.startLineNumber, beforeEnterProcessedTokens); + const languageIsDifferentFromLineStart = isLanguageDifferentFromLineStart(model, range2.getStartPosition()); + const currentLine = model.getLineContent(range2.startLineNumber); + const currentLineIndent = getLeadingWhitespace(currentLine); + const afterEnterAction = getInheritIndentForLine(autoIndent, virtualModel, range2.startLineNumber + 1, void 0, languageConfigurationService); + if (!afterEnterAction) { + const beforeEnter = languageIsDifferentFromLineStart ? currentLineIndent : beforeEnterIndent; + return { + beforeEnter, + afterEnter: beforeEnter + }; + } + let afterEnterIndent = languageIsDifferentFromLineStart ? currentLineIndent : afterEnterAction.indentation; + if (afterEnterAction.action === IndentAction.Indent) { + afterEnterIndent = indentConverter.shiftIndent(afterEnterIndent); + } + if (indentRulesSupport.shouldDecrease(afterEnterProcessedTokens.getLineContent())) { + afterEnterIndent = indentConverter.unshiftIndent(afterEnterIndent); + } + return { + beforeEnter: languageIsDifferentFromLineStart ? currentLineIndent : beforeEnterIndent, + afterEnter: afterEnterIndent + }; +} +function getIndentActionForType(cursorConfig, model, range2, ch, indentConverter, languageConfigurationService) { + const autoIndent = cursorConfig.autoIndent; + if (autoIndent < 4) { + return null; + } + const languageIsDifferentFromLineStart = isLanguageDifferentFromLineStart(model, range2.getStartPosition()); + if (languageIsDifferentFromLineStart) { + return null; + } + const languageId = model.getLanguageIdAtPosition(range2.startLineNumber, range2.startColumn); + const indentRulesSupport = languageConfigurationService.getLanguageConfiguration(languageId).indentRulesSupport; + if (!indentRulesSupport) { + return null; + } + const indentationContextProcessor = new IndentationContextProcessor(model, languageConfigurationService); + const processedContextTokens = indentationContextProcessor.getProcessedTokenContextAroundRange(range2); + const beforeRangeText = processedContextTokens.beforeRangeProcessedTokens.getLineContent(); + const afterRangeText = processedContextTokens.afterRangeProcessedTokens.getLineContent(); + const textAroundRange = beforeRangeText + afterRangeText; + const textAroundRangeWithCharacter = beforeRangeText + ch + afterRangeText; + if (!indentRulesSupport.shouldDecrease(textAroundRange) && indentRulesSupport.shouldDecrease(textAroundRangeWithCharacter)) { + const r = getInheritIndentForLine(autoIndent, model, range2.startLineNumber, false, languageConfigurationService); + if (!r) { + return null; + } + let indentation = r.indentation; + if (r.action !== IndentAction.Indent) { + indentation = indentConverter.unshiftIndent(indentation); + } + return indentation; + } + const previousLineNumber = range2.startLineNumber - 1; + if (previousLineNumber > 0) { + const previousLine = model.getLineContent(previousLineNumber); + if (indentRulesSupport.shouldIndentNextLine(previousLine) && indentRulesSupport.shouldIncrease(textAroundRangeWithCharacter)) { + const inheritedIndentationData = getInheritIndentForLine(autoIndent, model, range2.startLineNumber, false, languageConfigurationService); + const inheritedIndentation = inheritedIndentationData?.indentation; + if (inheritedIndentation !== void 0) { + const currentLine = model.getLineContent(range2.startLineNumber); + const actualCurrentIndentation = getLeadingWhitespace(currentLine); + const inferredCurrentIndentation = indentConverter.shiftIndent(inheritedIndentation); + const inferredIndentationEqualsActual = inferredCurrentIndentation === actualCurrentIndentation; + const textAroundRangeContainsOnlyWhitespace = /^\s*$/.test(textAroundRange); + const autoClosingPairs = cursorConfig.autoClosingPairs.autoClosingPairsOpenByEnd.get(ch); + const autoClosingPairExists = autoClosingPairs && autoClosingPairs.length > 0; + const isChFirstNonWhitespaceCharacterAndInAutoClosingPair = autoClosingPairExists && textAroundRangeContainsOnlyWhitespace; + if (inferredIndentationEqualsActual && isChFirstNonWhitespaceCharacterAndInAutoClosingPair) { + return inheritedIndentation; + } + } + } + } + return null; +} +function getIndentMetadata(model, lineNumber, languageConfigurationService) { + const indentRulesSupport = languageConfigurationService.getLanguageConfiguration(model.getLanguageId()).indentRulesSupport; + if (!indentRulesSupport) { + return null; + } + if (lineNumber < 1 || lineNumber > model.getLineCount()) { + return null; + } + return indentRulesSupport.getIndentMetadata(model.getLineContent(lineNumber)); +} +function createVirtualModelWithModifiedTokensAtLine(model, modifiedLineNumber, modifiedTokens) { + const virtualModel = { + tokenization: { + getLineTokens: (lineNumber) => { + if (lineNumber === modifiedLineNumber) { + return modifiedTokens; + } else { + return model.tokenization.getLineTokens(lineNumber); + } + }, + getLanguageId: () => { + return model.getLanguageId(); + }, + getLanguageIdAtPosition: (lineNumber, column) => { + return model.getLanguageIdAtPosition(lineNumber, column); + } + }, + getLineContent: (lineNumber) => { + if (lineNumber === modifiedLineNumber) { + return modifiedTokens.getLineContent(); + } else { + return model.getLineContent(lineNumber); + } + } + }; + return virtualModel; +} + +// node_modules/monaco-editor-core/esm/vs/editor/common/cursor/cursorTypeEditOperations.js +var AutoIndentOperation = class { + static getEdits(config, model, selections, ch, isDoingComposition) { + if (!isDoingComposition && this._isAutoIndentType(config, model, selections)) { + const indentationForSelections = []; + for (const selection of selections) { + const indentation = this._findActualIndentationForSelection(config, model, selection, ch); + if (indentation === null) { + return; + } + indentationForSelections.push({ selection, indentation }); + } + const autoClosingPairClose = AutoClosingOpenCharTypeOperation.getAutoClosingPairClose(config, model, selections, ch, false); + return this._getIndentationAndAutoClosingPairEdits(config, model, indentationForSelections, ch, autoClosingPairClose); + } + return; + } + static _isAutoIndentType(config, model, selections) { + if (config.autoIndent < 4) { + return false; + } + for (let i2 = 0, len = selections.length; i2 < len; i2++) { + if (!model.tokenization.isCheapToTokenize(selections[i2].getEndPosition().lineNumber)) { + return false; + } + } + return true; + } + static _findActualIndentationForSelection(config, model, selection, ch) { + const actualIndentation = getIndentActionForType(config, model, selection, ch, { + shiftIndent: (indentation) => { + return shiftIndent(config, indentation); + }, + unshiftIndent: (indentation) => { + return unshiftIndent(config, indentation); + } + }, config.languageConfigurationService); + if (actualIndentation === null) { + return null; + } + const currentIndentation = getIndentationAtPosition(model, selection.startLineNumber, selection.startColumn); + if (actualIndentation === config.normalizeIndentation(currentIndentation)) { + return null; + } + return actualIndentation; + } + static _getIndentationAndAutoClosingPairEdits(config, model, indentationForSelections, ch, autoClosingPairClose) { + const commands = indentationForSelections.map(({ selection, indentation }) => { + if (autoClosingPairClose !== null) { + const indentationEdit = this._getEditFromIndentationAndSelection(config, model, indentation, selection, ch, false); + return new TypeWithIndentationAndAutoClosingCommand(indentationEdit, selection, ch, autoClosingPairClose); + } else { + const indentationEdit = this._getEditFromIndentationAndSelection(config, model, indentation, selection, ch, true); + return typeCommand(indentationEdit.range, indentationEdit.text, false); + } + }); + const editOptions = { shouldPushStackElementBefore: true, shouldPushStackElementAfter: false }; + return new EditOperationResult(4, commands, editOptions); + } + static _getEditFromIndentationAndSelection(config, model, indentation, selection, ch, includeChInEdit = true) { + const startLineNumber = selection.startLineNumber; + const firstNonWhitespaceColumn = model.getLineFirstNonWhitespaceColumn(startLineNumber); + let text2 = config.normalizeIndentation(indentation); + if (firstNonWhitespaceColumn !== 0) { + const startLine = model.getLineContent(startLineNumber); + text2 += startLine.substring(firstNonWhitespaceColumn - 1, selection.startColumn - 1); + } + text2 += includeChInEdit ? ch : ""; + const range2 = new Range(startLineNumber, 1, selection.endLineNumber, selection.endColumn); + return { range: range2, text: text2 }; + } +}; +var AutoClosingOvertypeOperation = class { + static getEdits(prevEditOperationType, config, model, selections, autoClosedCharacters, ch) { + if (isAutoClosingOvertype(config, model, selections, autoClosedCharacters, ch)) { + return this._runAutoClosingOvertype(prevEditOperationType, selections, ch); + } + return; + } + static _runAutoClosingOvertype(prevEditOperationType, selections, ch) { + const commands = []; + for (let i2 = 0, len = selections.length; i2 < len; i2++) { + const selection = selections[i2]; + const position = selection.getPosition(); + const typeSelection = new Range(position.lineNumber, position.column, position.lineNumber, position.column + 1); + commands[i2] = new ReplaceCommand(typeSelection, ch); + } + return new EditOperationResult(4, commands, { + shouldPushStackElementBefore: shouldPushStackElementBetween( + prevEditOperationType, + 4 + /* EditOperationType.TypingOther */ + ), + shouldPushStackElementAfter: false + }); + } +}; +var AutoClosingOvertypeWithInterceptorsOperation = class { + static getEdits(config, model, selections, autoClosedCharacters, ch) { + if (isAutoClosingOvertype(config, model, selections, autoClosedCharacters, ch)) { + const commands = selections.map((s) => new ReplaceCommand(new Range(s.positionLineNumber, s.positionColumn, s.positionLineNumber, s.positionColumn + 1), "", false)); + return new EditOperationResult(4, commands, { + shouldPushStackElementBefore: true, + shouldPushStackElementAfter: false + }); + } + return; + } +}; +var AutoClosingOpenCharTypeOperation = class { + static getEdits(config, model, selections, ch, chIsAlreadyTyped, isDoingComposition) { + if (!isDoingComposition) { + const autoClosingPairClose = this.getAutoClosingPairClose(config, model, selections, ch, chIsAlreadyTyped); + if (autoClosingPairClose !== null) { + return this._runAutoClosingOpenCharType(selections, ch, chIsAlreadyTyped, autoClosingPairClose); + } + } + return; + } + static _runAutoClosingOpenCharType(selections, ch, chIsAlreadyTyped, autoClosingPairClose) { + const commands = []; + for (let i2 = 0, len = selections.length; i2 < len; i2++) { + const selection = selections[i2]; + commands[i2] = new TypeWithAutoClosingCommand(selection, ch, !chIsAlreadyTyped, autoClosingPairClose); + } + return new EditOperationResult(4, commands, { + shouldPushStackElementBefore: true, + shouldPushStackElementAfter: false + }); + } + static getAutoClosingPairClose(config, model, selections, ch, chIsAlreadyTyped) { + for (const selection of selections) { + if (!selection.isEmpty()) { + return null; + } + } + const positions = selections.map((s) => { + const position = s.getPosition(); + if (chIsAlreadyTyped) { + return { lineNumber: position.lineNumber, beforeColumn: position.column - ch.length, afterColumn: position.column }; + } else { + return { lineNumber: position.lineNumber, beforeColumn: position.column, afterColumn: position.column }; + } + }); + const pair = this._findAutoClosingPairOpen(config, model, positions.map((p) => new Position(p.lineNumber, p.beforeColumn)), ch); + if (!pair) { + return null; + } + let autoCloseConfig; + let shouldAutoCloseBefore; + const chIsQuote = isQuote(ch); + if (chIsQuote) { + autoCloseConfig = config.autoClosingQuotes; + shouldAutoCloseBefore = config.shouldAutoCloseBefore.quote; + } else { + const pairIsForComments = config.blockCommentStartToken ? pair.open.includes(config.blockCommentStartToken) : false; + if (pairIsForComments) { + autoCloseConfig = config.autoClosingComments; + shouldAutoCloseBefore = config.shouldAutoCloseBefore.comment; + } else { + autoCloseConfig = config.autoClosingBrackets; + shouldAutoCloseBefore = config.shouldAutoCloseBefore.bracket; + } + } + if (autoCloseConfig === "never") { + return null; + } + const containedPair = this._findContainedAutoClosingPair(config, pair); + const containedPairClose = containedPair ? containedPair.close : ""; + let isContainedPairPresent = true; + for (const position of positions) { + const { lineNumber, beforeColumn, afterColumn } = position; + const lineText = model.getLineContent(lineNumber); + const lineBefore = lineText.substring(0, beforeColumn - 1); + const lineAfter = lineText.substring(afterColumn - 1); + if (!lineAfter.startsWith(containedPairClose)) { + isContainedPairPresent = false; + } + if (lineAfter.length > 0) { + const characterAfter = lineAfter.charAt(0); + const isBeforeCloseBrace = this._isBeforeClosingBrace(config, lineAfter); + if (!isBeforeCloseBrace && !shouldAutoCloseBefore(characterAfter)) { + return null; + } + } + if (pair.open.length === 1 && (ch === "'" || ch === '"') && autoCloseConfig !== "always") { + const wordSeparators2 = getMapForWordSeparators(config.wordSeparators, []); + if (lineBefore.length > 0) { + const characterBefore = lineBefore.charCodeAt(lineBefore.length - 1); + if (wordSeparators2.get(characterBefore) === 0) { + return null; + } + } + } + if (!model.tokenization.isCheapToTokenize(lineNumber)) { + return null; + } + model.tokenization.forceTokenization(lineNumber); + const lineTokens = model.tokenization.getLineTokens(lineNumber); + const scopedLineTokens = createScopedLineTokens(lineTokens, beforeColumn - 1); + if (!pair.shouldAutoClose(scopedLineTokens, beforeColumn - scopedLineTokens.firstCharOffset)) { + return null; + } + const neutralCharacter = pair.findNeutralCharacter(); + if (neutralCharacter) { + const tokenType = model.tokenization.getTokenTypeIfInsertingCharacter(lineNumber, beforeColumn, neutralCharacter); + if (!pair.isOK(tokenType)) { + return null; + } + } + } + if (isContainedPairPresent) { + return pair.close.substring(0, pair.close.length - containedPairClose.length); + } else { + return pair.close; + } + } + /** + * Find another auto-closing pair that is contained by the one passed in. + * + * e.g. when having [(,)] and [(*,*)] as auto-closing pairs + * this method will find [(,)] as a containment pair for [(*,*)] + */ + static _findContainedAutoClosingPair(config, pair) { + if (pair.open.length <= 1) { + return null; + } + const lastChar = pair.close.charAt(pair.close.length - 1); + const candidates = config.autoClosingPairs.autoClosingPairsCloseByEnd.get(lastChar) || []; + let result = null; + for (const candidate of candidates) { + if (candidate.open !== pair.open && pair.open.includes(candidate.open) && pair.close.endsWith(candidate.close)) { + if (!result || candidate.open.length > result.open.length) { + result = candidate; + } + } + } + return result; + } + /** + * Determine if typing `ch` at all `positions` in the `model` results in an + * auto closing open sequence being typed. + * + * Auto closing open sequences can consist of multiple characters, which + * can lead to ambiguities. In such a case, the longest auto-closing open + * sequence is returned. + */ + static _findAutoClosingPairOpen(config, model, positions, ch) { + const candidates = config.autoClosingPairs.autoClosingPairsOpenByEnd.get(ch); + if (!candidates) { + return null; + } + let result = null; + for (const candidate of candidates) { + if (result === null || candidate.open.length > result.open.length) { + let candidateIsMatch = true; + for (const position of positions) { + const relevantText = model.getValueInRange(new Range(position.lineNumber, position.column - candidate.open.length + 1, position.lineNumber, position.column)); + if (relevantText + ch !== candidate.open) { + candidateIsMatch = false; + break; + } + } + if (candidateIsMatch) { + result = candidate; + } + } + } + return result; + } + static _isBeforeClosingBrace(config, lineAfter) { + const nextChar = lineAfter.charAt(0); + const potentialStartingBraces = config.autoClosingPairs.autoClosingPairsOpenByStart.get(nextChar) || []; + const potentialClosingBraces = config.autoClosingPairs.autoClosingPairsCloseByStart.get(nextChar) || []; + const isBeforeStartingBrace = potentialStartingBraces.some((x) => lineAfter.startsWith(x.open)); + const isBeforeClosingBrace = potentialClosingBraces.some((x) => lineAfter.startsWith(x.close)); + return !isBeforeStartingBrace && isBeforeClosingBrace; + } +}; +var CompositionEndOvertypeOperation = class { + static getEdits(config, compositions) { + const isOvertypeMode = config.inputMode === "overtype"; + if (!isOvertypeMode) { + return null; + } + const commands = compositions.map((composition) => new ReplaceOvertypeCommandOnCompositionEnd(composition.insertedTextRange)); + return new EditOperationResult(4, commands, { + shouldPushStackElementBefore: true, + shouldPushStackElementAfter: false + }); + } +}; +var SurroundSelectionOperation = class { + static getEdits(config, model, selections, ch, isDoingComposition) { + if (!isDoingComposition && this._isSurroundSelectionType(config, model, selections, ch)) { + return this._runSurroundSelectionType(config, selections, ch); + } + return; + } + static _runSurroundSelectionType(config, selections, ch) { + const commands = []; + for (let i2 = 0, len = selections.length; i2 < len; i2++) { + const selection = selections[i2]; + const closeCharacter = config.surroundingPairs[ch]; + commands[i2] = new SurroundSelectionCommand(selection, ch, closeCharacter); + } + return new EditOperationResult(0, commands, { + shouldPushStackElementBefore: true, + shouldPushStackElementAfter: true + }); + } + static _isSurroundSelectionType(config, model, selections, ch) { + if (!shouldSurroundChar(config, ch) || !config.surroundingPairs.hasOwnProperty(ch)) { + return false; + } + const isTypingAQuoteCharacter = isQuote(ch); + for (const selection of selections) { + if (selection.isEmpty()) { + return false; + } + let selectionContainsOnlyWhitespace = true; + for (let lineNumber = selection.startLineNumber; lineNumber <= selection.endLineNumber; lineNumber++) { + const lineText = model.getLineContent(lineNumber); + const startIndex = lineNumber === selection.startLineNumber ? selection.startColumn - 1 : 0; + const endIndex = lineNumber === selection.endLineNumber ? selection.endColumn - 1 : lineText.length; + const selectedText = lineText.substring(startIndex, endIndex); + if (/[^ \t]/.test(selectedText)) { + selectionContainsOnlyWhitespace = false; + break; + } + } + if (selectionContainsOnlyWhitespace) { + return false; + } + if (isTypingAQuoteCharacter && selection.startLineNumber === selection.endLineNumber && selection.startColumn + 1 === selection.endColumn) { + const selectionText = model.getValueInRange(selection); + if (isQuote(selectionText)) { + return false; + } + } + } + return true; + } +}; +var InterceptorElectricCharOperation = class { + static getEdits(prevEditOperationType, config, model, selections, ch, isDoingComposition) { + if (!isDoingComposition && this._isTypeInterceptorElectricChar(config, model, selections)) { + const r = this._typeInterceptorElectricChar(prevEditOperationType, config, model, selections[0], ch); + if (r) { + return r; + } + } + return; + } + static _isTypeInterceptorElectricChar(config, model, selections) { + if (selections.length === 1 && model.tokenization.isCheapToTokenize(selections[0].getEndPosition().lineNumber)) { + return true; + } + return false; + } + static _typeInterceptorElectricChar(prevEditOperationType, config, model, selection, ch) { + if (!config.electricChars.hasOwnProperty(ch) || !selection.isEmpty()) { + return null; + } + const position = selection.getPosition(); + model.tokenization.forceTokenization(position.lineNumber); + const lineTokens = model.tokenization.getLineTokens(position.lineNumber); + let electricAction; + try { + electricAction = config.onElectricCharacter(ch, lineTokens, position.column); + } catch (e) { + onUnexpectedError(e); + return null; + } + if (!electricAction) { + return null; + } + if (electricAction.matchOpenBracket) { + const endColumn = (lineTokens.getLineContent() + ch).lastIndexOf(electricAction.matchOpenBracket) + 1; + const match2 = model.bracketPairs.findMatchingBracketUp( + electricAction.matchOpenBracket, + { + lineNumber: position.lineNumber, + column: endColumn + }, + 500 + /* give at most 500ms to compute */ + ); + if (match2) { + if (match2.startLineNumber === position.lineNumber) { + return null; + } + const matchLine = model.getLineContent(match2.startLineNumber); + const matchLineIndentation = getLeadingWhitespace(matchLine); + const newIndentation = config.normalizeIndentation(matchLineIndentation); + const lineText = model.getLineContent(position.lineNumber); + const lineFirstNonBlankColumn = model.getLineFirstNonWhitespaceColumn(position.lineNumber) || position.column; + const prefix = lineText.substring(lineFirstNonBlankColumn - 1, position.column - 1); + const typeText = newIndentation + prefix + ch; + const typeSelection = new Range(position.lineNumber, 1, position.lineNumber, position.column); + const command = new ReplaceCommand(typeSelection, typeText); + return new EditOperationResult(getTypingOperation(typeText, prevEditOperationType), [command], { + shouldPushStackElementBefore: false, + shouldPushStackElementAfter: true + }); + } + } + return null; + } +}; +var SimpleCharacterTypeOperation = class { + static getEdits(config, prevEditOperationType, selections, ch, isDoingComposition) { + const commands = []; + for (let i2 = 0, len = selections.length; i2 < len; i2++) { + const ChosenReplaceCommand = config.inputMode === "overtype" && !isDoingComposition ? ReplaceOvertypeCommand : ReplaceCommand; + commands[i2] = new ChosenReplaceCommand(selections[i2], ch); + } + const opType = getTypingOperation(ch, prevEditOperationType); + return new EditOperationResult(opType, commands, { + shouldPushStackElementBefore: shouldPushStackElementBetween(prevEditOperationType, opType), + shouldPushStackElementAfter: false + }); + } +}; +var EnterOperation = class { + static getEdits(config, model, selections, ch, isDoingComposition) { + if (!isDoingComposition && ch === "\n") { + const commands = []; + for (let i2 = 0, len = selections.length; i2 < len; i2++) { + commands[i2] = this._enter(config, model, false, selections[i2]); + } + return new EditOperationResult(4, commands, { + shouldPushStackElementBefore: true, + shouldPushStackElementAfter: false + }); + } + return; + } + static _enter(config, model, keepPosition, range2) { + if (config.autoIndent === 0) { + return typeCommand(range2, "\n", keepPosition); + } + if (!model.tokenization.isCheapToTokenize(range2.getStartPosition().lineNumber) || config.autoIndent === 1) { + const lineText2 = model.getLineContent(range2.startLineNumber); + const indentation2 = getLeadingWhitespace(lineText2).substring(0, range2.startColumn - 1); + return typeCommand(range2, "\n" + config.normalizeIndentation(indentation2), keepPosition); + } + const r = getEnterAction(config.autoIndent, model, range2, config.languageConfigurationService); + if (r) { + if (r.indentAction === IndentAction.None) { + return typeCommand(range2, "\n" + config.normalizeIndentation(r.indentation + r.appendText), keepPosition); + } else if (r.indentAction === IndentAction.Indent) { + return typeCommand(range2, "\n" + config.normalizeIndentation(r.indentation + r.appendText), keepPosition); + } else if (r.indentAction === IndentAction.IndentOutdent) { + const normalIndent = config.normalizeIndentation(r.indentation); + const increasedIndent = config.normalizeIndentation(r.indentation + r.appendText); + const typeText = "\n" + increasedIndent + "\n" + normalIndent; + if (keepPosition) { + return new ReplaceCommandWithoutChangingPosition(range2, typeText, true); + } else { + return new ReplaceCommandWithOffsetCursorState(range2, typeText, -1, increasedIndent.length - normalIndent.length, true); + } + } else if (r.indentAction === IndentAction.Outdent) { + const actualIndentation = unshiftIndent(config, r.indentation); + return typeCommand(range2, "\n" + config.normalizeIndentation(actualIndentation + r.appendText), keepPosition); + } + } + const lineText = model.getLineContent(range2.startLineNumber); + const indentation = getLeadingWhitespace(lineText).substring(0, range2.startColumn - 1); + if (config.autoIndent >= 4) { + const ir = getIndentForEnter(config.autoIndent, model, range2, { + unshiftIndent: (indent) => { + return unshiftIndent(config, indent); + }, + shiftIndent: (indent) => { + return shiftIndent(config, indent); + }, + normalizeIndentation: (indent) => { + return config.normalizeIndentation(indent); + } + }, config.languageConfigurationService); + if (ir) { + let oldEndViewColumn = config.visibleColumnFromColumn(model, range2.getEndPosition()); + const oldEndColumn = range2.endColumn; + const newLineContent = model.getLineContent(range2.endLineNumber); + const firstNonWhitespace = firstNonWhitespaceIndex(newLineContent); + if (firstNonWhitespace >= 0) { + range2 = range2.setEndPosition(range2.endLineNumber, Math.max(range2.endColumn, firstNonWhitespace + 1)); + } else { + range2 = range2.setEndPosition(range2.endLineNumber, model.getLineMaxColumn(range2.endLineNumber)); + } + if (keepPosition) { + return new ReplaceCommandWithoutChangingPosition(range2, "\n" + config.normalizeIndentation(ir.afterEnter), true); + } else { + let offset = 0; + if (oldEndColumn <= firstNonWhitespace + 1) { + if (!config.insertSpaces) { + oldEndViewColumn = Math.ceil(oldEndViewColumn / config.indentSize); + } + offset = Math.min(oldEndViewColumn + 1 - config.normalizeIndentation(ir.afterEnter).length - 1, 0); + } + return new ReplaceCommandWithOffsetCursorState(range2, "\n" + config.normalizeIndentation(ir.afterEnter), 0, offset, true); + } + } + } + return typeCommand(range2, "\n" + config.normalizeIndentation(indentation), keepPosition); + } + static lineInsertBefore(config, model, selections) { + if (model === null || selections === null) { + return []; + } + const commands = []; + for (let i2 = 0, len = selections.length; i2 < len; i2++) { + let lineNumber = selections[i2].positionLineNumber; + if (lineNumber === 1) { + commands[i2] = new ReplaceCommandWithoutChangingPosition(new Range(1, 1, 1, 1), "\n"); + } else { + lineNumber--; + const column = model.getLineMaxColumn(lineNumber); + commands[i2] = this._enter(config, model, false, new Range(lineNumber, column, lineNumber, column)); + } + } + return commands; + } + static lineInsertAfter(config, model, selections) { + if (model === null || selections === null) { + return []; + } + const commands = []; + for (let i2 = 0, len = selections.length; i2 < len; i2++) { + const lineNumber = selections[i2].positionLineNumber; + const column = model.getLineMaxColumn(lineNumber); + commands[i2] = this._enter(config, model, false, new Range(lineNumber, column, lineNumber, column)); + } + return commands; + } + static lineBreakInsert(config, model, selections) { + const commands = []; + for (let i2 = 0, len = selections.length; i2 < len; i2++) { + commands[i2] = this._enter(config, model, true, selections[i2]); + } + return commands; + } +}; +var PasteOperation = class { + static getEdits(config, model, selections, text2, pasteOnNewLine, multicursorText) { + const distributedPaste = this._distributePasteToCursors(config, selections, text2, pasteOnNewLine, multicursorText); + if (distributedPaste) { + selections = selections.sort(Range.compareRangesUsingStarts); + return this._distributedPaste(config, model, selections, distributedPaste); + } else { + return this._simplePaste(config, model, selections, text2, pasteOnNewLine); + } + } + static _distributePasteToCursors(config, selections, text2, pasteOnNewLine, multicursorText) { + if (pasteOnNewLine) { + return null; + } + if (selections.length === 1) { + return null; + } + if (multicursorText && multicursorText.length === selections.length) { + return multicursorText; + } + if (config.multiCursorPaste === "spread") { + if (text2.charCodeAt(text2.length - 1) === 10) { + text2 = text2.substring(0, text2.length - 1); + } + if (text2.charCodeAt(text2.length - 1) === 13) { + text2 = text2.substring(0, text2.length - 1); + } + const lines = splitLines(text2); + if (lines.length === selections.length) { + return lines; + } + } + return null; + } + static _distributedPaste(config, model, selections, text2) { + const commands = []; + for (let i2 = 0, len = selections.length; i2 < len; i2++) { + const shouldOvertypeOnPaste = config.overtypeOnPaste && config.inputMode === "overtype"; + const ChosenReplaceCommand = shouldOvertypeOnPaste ? ReplaceOvertypeCommand : ReplaceCommand; + commands[i2] = new ChosenReplaceCommand(selections[i2], text2[i2]); + } + return new EditOperationResult(0, commands, { + shouldPushStackElementBefore: true, + shouldPushStackElementAfter: true + }); + } + static _simplePaste(config, model, selections, text2, pasteOnNewLine) { + const commands = []; + for (let i2 = 0, len = selections.length; i2 < len; i2++) { + const selection = selections[i2]; + const position = selection.getPosition(); + if (pasteOnNewLine && !selection.isEmpty()) { + pasteOnNewLine = false; + } + if (pasteOnNewLine && text2.indexOf("\n") !== text2.length - 1) { + pasteOnNewLine = false; + } + if (pasteOnNewLine) { + const typeSelection = new Range(position.lineNumber, 1, position.lineNumber, 1); + commands[i2] = new ReplaceCommandThatPreservesSelection(typeSelection, text2, selection, true); + } else { + const shouldOvertypeOnPaste = config.overtypeOnPaste && config.inputMode === "overtype"; + const ChosenReplaceCommand = shouldOvertypeOnPaste ? ReplaceOvertypeCommand : ReplaceCommand; + commands[i2] = new ChosenReplaceCommand(selection, text2); + } + } + return new EditOperationResult(0, commands, { + shouldPushStackElementBefore: true, + shouldPushStackElementAfter: true + }); + } +}; +var CompositionOperation = class { + static getEdits(prevEditOperationType, config, model, selections, text2, replacePrevCharCnt, replaceNextCharCnt, positionDelta) { + const commands = selections.map((selection) => this._compositionType(model, selection, text2, replacePrevCharCnt, replaceNextCharCnt, positionDelta)); + return new EditOperationResult(4, commands, { + shouldPushStackElementBefore: shouldPushStackElementBetween( + prevEditOperationType, + 4 + /* EditOperationType.TypingOther */ + ), + shouldPushStackElementAfter: false + }); + } + static _compositionType(model, selection, text2, replacePrevCharCnt, replaceNextCharCnt, positionDelta) { + if (!selection.isEmpty()) { + return null; + } + const pos = selection.getPosition(); + const startColumn = Math.max(1, pos.column - replacePrevCharCnt); + const endColumn = Math.min(model.getLineMaxColumn(pos.lineNumber), pos.column + replaceNextCharCnt); + const range2 = new Range(pos.lineNumber, startColumn, pos.lineNumber, endColumn); + return new ReplaceCommandWithOffsetCursorState(range2, text2, 0, positionDelta); + } +}; +var TypeWithoutInterceptorsOperation = class { + static getEdits(prevEditOperationType, selections, str) { + const commands = []; + for (let i2 = 0, len = selections.length; i2 < len; i2++) { + commands[i2] = new ReplaceCommand(selections[i2], str); + } + const opType = getTypingOperation(str, prevEditOperationType); + return new EditOperationResult(opType, commands, { + shouldPushStackElementBefore: shouldPushStackElementBetween(prevEditOperationType, opType), + shouldPushStackElementAfter: false + }); + } +}; +var TabOperation = class { + static getCommands(config, model, selections) { + const commands = []; + for (let i2 = 0, len = selections.length; i2 < len; i2++) { + const selection = selections[i2]; + if (selection.isEmpty()) { + const lineText = model.getLineContent(selection.startLineNumber); + if (/^\s*$/.test(lineText) && model.tokenization.isCheapToTokenize(selection.startLineNumber)) { + let goodIndent = this._goodIndentForLine(config, model, selection.startLineNumber); + goodIndent = goodIndent || " "; + const possibleTypeText = config.normalizeIndentation(goodIndent); + if (!lineText.startsWith(possibleTypeText)) { + commands[i2] = new ReplaceCommand(new Range(selection.startLineNumber, 1, selection.startLineNumber, lineText.length + 1), possibleTypeText, true); + continue; + } + } + commands[i2] = this._replaceJumpToNextIndent(config, model, selection, true); + } else { + if (selection.startLineNumber === selection.endLineNumber) { + const lineMaxColumn = model.getLineMaxColumn(selection.startLineNumber); + if (selection.startColumn !== 1 || selection.endColumn !== lineMaxColumn) { + commands[i2] = this._replaceJumpToNextIndent(config, model, selection, false); + continue; + } + } + commands[i2] = new ShiftCommand(selection, { + isUnshift: false, + tabSize: config.tabSize, + indentSize: config.indentSize, + insertSpaces: config.insertSpaces, + useTabStops: config.useTabStops, + autoIndent: config.autoIndent + }, config.languageConfigurationService); + } + } + return commands; + } + static _goodIndentForLine(config, model, lineNumber) { + let action = null; + let indentation = ""; + const expectedIndentAction = getInheritIndentForLine(config.autoIndent, model, lineNumber, false, config.languageConfigurationService); + if (expectedIndentAction) { + action = expectedIndentAction.action; + indentation = expectedIndentAction.indentation; + } else if (lineNumber > 1) { + let lastLineNumber; + for (lastLineNumber = lineNumber - 1; lastLineNumber >= 1; lastLineNumber--) { + const lineText = model.getLineContent(lastLineNumber); + const nonWhitespaceIdx = lastNonWhitespaceIndex(lineText); + if (nonWhitespaceIdx >= 0) { + break; + } + } + if (lastLineNumber < 1) { + return null; + } + const maxColumn = model.getLineMaxColumn(lastLineNumber); + const expectedEnterAction = getEnterAction(config.autoIndent, model, new Range(lastLineNumber, maxColumn, lastLineNumber, maxColumn), config.languageConfigurationService); + if (expectedEnterAction) { + indentation = expectedEnterAction.indentation + expectedEnterAction.appendText; + } + } + if (action) { + if (action === IndentAction.Indent) { + indentation = shiftIndent(config, indentation); + } + if (action === IndentAction.Outdent) { + indentation = unshiftIndent(config, indentation); + } + indentation = config.normalizeIndentation(indentation); + } + if (!indentation) { + return null; + } + return indentation; + } + static _replaceJumpToNextIndent(config, model, selection, insertsAutoWhitespace) { + let typeText = ""; + const position = selection.getStartPosition(); + if (config.insertSpaces) { + const visibleColumnFromColumn = config.visibleColumnFromColumn(model, position); + const indentSize = config.indentSize; + const spacesCnt = indentSize - visibleColumnFromColumn % indentSize; + for (let i2 = 0; i2 < spacesCnt; i2++) { + typeText += " "; + } + } else { + typeText = " "; + } + return new ReplaceCommand(selection, typeText, insertsAutoWhitespace); + } +}; +var BaseTypeWithAutoClosingCommand = class extends ReplaceCommandWithOffsetCursorState { + constructor(selection, text2, lineNumberDeltaOffset, columnDeltaOffset, openCharacter, closeCharacter) { + super(selection, text2, lineNumberDeltaOffset, columnDeltaOffset); + this._openCharacter = openCharacter; + this._closeCharacter = closeCharacter; + this.closeCharacterRange = null; + this.enclosingRange = null; + } + _computeCursorStateWithRange(model, range2, helper) { + this.closeCharacterRange = new Range(range2.startLineNumber, range2.endColumn - this._closeCharacter.length, range2.endLineNumber, range2.endColumn); + this.enclosingRange = new Range(range2.startLineNumber, range2.endColumn - this._openCharacter.length - this._closeCharacter.length, range2.endLineNumber, range2.endColumn); + return super.computeCursorState(model, helper); + } +}; +var TypeWithAutoClosingCommand = class extends BaseTypeWithAutoClosingCommand { + constructor(selection, openCharacter, insertOpenCharacter, closeCharacter) { + const text2 = (insertOpenCharacter ? openCharacter : "") + closeCharacter; + const lineNumberDeltaOffset = 0; + const columnDeltaOffset = -closeCharacter.length; + super(selection, text2, lineNumberDeltaOffset, columnDeltaOffset, openCharacter, closeCharacter); + } + computeCursorState(model, helper) { + const inverseEditOperations = helper.getInverseEditOperations(); + const range2 = inverseEditOperations[0].range; + return this._computeCursorStateWithRange(model, range2, helper); + } +}; +var TypeWithIndentationAndAutoClosingCommand = class extends BaseTypeWithAutoClosingCommand { + constructor(autoIndentationEdit, selection, openCharacter, closeCharacter) { + const text2 = openCharacter + closeCharacter; + const lineNumberDeltaOffset = 0; + const columnDeltaOffset = openCharacter.length; + super(selection, text2, lineNumberDeltaOffset, columnDeltaOffset, openCharacter, closeCharacter); + this._autoIndentationEdit = autoIndentationEdit; + this._autoClosingEdit = { range: selection, text: text2 }; + } + getEditOperations(model, builder) { + builder.addTrackedEditOperation(this._autoIndentationEdit.range, this._autoIndentationEdit.text); + builder.addTrackedEditOperation(this._autoClosingEdit.range, this._autoClosingEdit.text); + } + computeCursorState(model, helper) { + const inverseEditOperations = helper.getInverseEditOperations(); + if (inverseEditOperations.length !== 2) { + throw new Error("There should be two inverse edit operations!"); + } + const range1 = inverseEditOperations[0].range; + const range2 = inverseEditOperations[1].range; + const range3 = range1.plusRange(range2); + return this._computeCursorStateWithRange(model, range3, helper); + } +}; +function getTypingOperation(typedText, previousTypingOperation) { + if (typedText === " ") { + return previousTypingOperation === 5 || previousTypingOperation === 6 ? 6 : 5; + } + return 4; +} +function shouldPushStackElementBetween(previousTypingOperation, typingOperation) { + if (isTypingOperation(previousTypingOperation) && !isTypingOperation(typingOperation)) { + return true; + } + if (previousTypingOperation === 5) { + return false; + } + return normalizeOperationType(previousTypingOperation) !== normalizeOperationType(typingOperation); +} +function normalizeOperationType(type) { + return type === 6 || type === 5 ? "space" : type; +} +function isTypingOperation(type) { + return type === 4 || type === 5 || type === 6; +} +function isAutoClosingOvertype(config, model, selections, autoClosedCharacters, ch) { + if (config.autoClosingOvertype === "never") { + return false; + } + if (!config.autoClosingPairs.autoClosingPairsCloseSingleChar.has(ch)) { + return false; + } + for (let i2 = 0, len = selections.length; i2 < len; i2++) { + const selection = selections[i2]; + if (!selection.isEmpty()) { + return false; + } + const position = selection.getPosition(); + const lineText = model.getLineContent(position.lineNumber); + const afterCharacter = lineText.charAt(position.column - 1); + if (afterCharacter !== ch) { + return false; + } + const chIsQuote = isQuote(ch); + const beforeCharacter = position.column > 2 ? lineText.charCodeAt(position.column - 2) : 0; + if (beforeCharacter === 92 && chIsQuote) { + return false; + } + if (config.autoClosingOvertype === "auto") { + let found = false; + for (let j = 0, lenJ = autoClosedCharacters.length; j < lenJ; j++) { + const autoClosedCharacter = autoClosedCharacters[j]; + if (position.lineNumber === autoClosedCharacter.startLineNumber && position.column === autoClosedCharacter.startColumn) { + found = true; + break; + } + } + if (!found) { + return false; + } + } + } + return true; +} +function typeCommand(range2, text2, keepPosition) { + if (keepPosition) { + return new ReplaceCommandWithoutChangingPosition(range2, text2, true); + } else { + return new ReplaceCommand(range2, text2, true); + } +} +function shiftIndent(config, indentation, count) { + count = count || 1; + return ShiftCommand.shiftIndent(indentation, indentation.length + count, config.tabSize, config.indentSize, config.insertSpaces); +} +function unshiftIndent(config, indentation, count) { + count = count || 1; + return ShiftCommand.unshiftIndent(indentation, indentation.length + count, config.tabSize, config.indentSize, config.insertSpaces); +} +function shouldSurroundChar(config, ch) { + if (isQuote(ch)) { + return config.autoSurround === "quotes" || config.autoSurround === "languageDefined"; + } else { + return config.autoSurround === "brackets" || config.autoSurround === "languageDefined"; + } +} + +// node_modules/monaco-editor-core/esm/vs/editor/common/cursor/cursorTypeOperations.js +var TypeOperations = class { + static indent(config, model, selections) { + if (model === null || selections === null) { + return []; + } + const commands = []; + for (let i2 = 0, len = selections.length; i2 < len; i2++) { + commands[i2] = new ShiftCommand(selections[i2], { + isUnshift: false, + tabSize: config.tabSize, + indentSize: config.indentSize, + insertSpaces: config.insertSpaces, + useTabStops: config.useTabStops, + autoIndent: config.autoIndent + }, config.languageConfigurationService); + } + return commands; + } + static outdent(config, model, selections) { + const commands = []; + for (let i2 = 0, len = selections.length; i2 < len; i2++) { + commands[i2] = new ShiftCommand(selections[i2], { + isUnshift: true, + tabSize: config.tabSize, + indentSize: config.indentSize, + insertSpaces: config.insertSpaces, + useTabStops: config.useTabStops, + autoIndent: config.autoIndent + }, config.languageConfigurationService); + } + return commands; + } + static paste(config, model, selections, text2, pasteOnNewLine, multicursorText) { + return PasteOperation.getEdits(config, model, selections, text2, pasteOnNewLine, multicursorText); + } + static tab(config, model, selections) { + return TabOperation.getCommands(config, model, selections); + } + static compositionType(prevEditOperationType, config, model, selections, text2, replacePrevCharCnt, replaceNextCharCnt, positionDelta) { + return CompositionOperation.getEdits(prevEditOperationType, config, model, selections, text2, replacePrevCharCnt, replaceNextCharCnt, positionDelta); + } + /** + * This is very similar with typing, but the character is already in the text buffer! + */ + static compositionEndWithInterceptors(prevEditOperationType, config, model, compositions, selections, autoClosedCharacters) { + if (!compositions) { + return null; + } + let insertedText = null; + for (const composition of compositions) { + if (insertedText === null) { + insertedText = composition.insertedText; + } else if (insertedText !== composition.insertedText) { + return null; + } + } + if (!insertedText || insertedText.length !== 1) { + return CompositionEndOvertypeOperation.getEdits(config, compositions); + } + const ch = insertedText; + let hasDeletion = false; + for (const composition of compositions) { + if (composition.deletedText.length !== 0) { + hasDeletion = true; + break; + } + } + if (hasDeletion) { + if (!shouldSurroundChar(config, ch) || !config.surroundingPairs.hasOwnProperty(ch)) { + return null; + } + const isTypingAQuoteCharacter = isQuote(ch); + for (const composition of compositions) { + if (composition.deletedSelectionStart !== 0 || composition.deletedSelectionEnd !== composition.deletedText.length) { + return null; + } + if (/^[ \t]+$/.test(composition.deletedText)) { + return null; + } + if (isTypingAQuoteCharacter && isQuote(composition.deletedText)) { + return null; + } + } + const positions = []; + for (const selection of selections) { + if (!selection.isEmpty()) { + return null; + } + positions.push(selection.getPosition()); + } + if (positions.length !== compositions.length) { + return null; + } + const commands = []; + for (let i2 = 0, len = positions.length; i2 < len; i2++) { + commands.push(new CompositionSurroundSelectionCommand(positions[i2], compositions[i2].deletedText, config.surroundingPairs[ch])); + } + return new EditOperationResult(4, commands, { + shouldPushStackElementBefore: true, + shouldPushStackElementAfter: false + }); + } + const autoClosingOvertypeEdits = AutoClosingOvertypeWithInterceptorsOperation.getEdits(config, model, selections, autoClosedCharacters, ch); + if (autoClosingOvertypeEdits !== void 0) { + return autoClosingOvertypeEdits; + } + const autoClosingOpenCharEdits = AutoClosingOpenCharTypeOperation.getEdits(config, model, selections, ch, true, false); + if (autoClosingOpenCharEdits !== void 0) { + return autoClosingOpenCharEdits; + } + return CompositionEndOvertypeOperation.getEdits(config, compositions); + } + static typeWithInterceptors(isDoingComposition, prevEditOperationType, config, model, selections, autoClosedCharacters, ch) { + const enterEdits = EnterOperation.getEdits(config, model, selections, ch, isDoingComposition); + if (enterEdits !== void 0) { + return enterEdits; + } + const autoIndentEdits = AutoIndentOperation.getEdits(config, model, selections, ch, isDoingComposition); + if (autoIndentEdits !== void 0) { + return autoIndentEdits; + } + const autoClosingOverTypeEdits = AutoClosingOvertypeOperation.getEdits(prevEditOperationType, config, model, selections, autoClosedCharacters, ch); + if (autoClosingOverTypeEdits !== void 0) { + return autoClosingOverTypeEdits; + } + const autoClosingOpenCharEdits = AutoClosingOpenCharTypeOperation.getEdits(config, model, selections, ch, false, isDoingComposition); + if (autoClosingOpenCharEdits !== void 0) { + return autoClosingOpenCharEdits; + } + const surroundSelectionEdits = SurroundSelectionOperation.getEdits(config, model, selections, ch, isDoingComposition); + if (surroundSelectionEdits !== void 0) { + return surroundSelectionEdits; + } + const interceptorElectricCharOperation = InterceptorElectricCharOperation.getEdits(prevEditOperationType, config, model, selections, ch, isDoingComposition); + if (interceptorElectricCharOperation !== void 0) { + return interceptorElectricCharOperation; + } + return SimpleCharacterTypeOperation.getEdits(config, prevEditOperationType, selections, ch, isDoingComposition); + } + static typeWithoutInterceptors(prevEditOperationType, config, model, selections, str) { + return TypeWithoutInterceptorsOperation.getEdits(prevEditOperationType, selections, str); + } +}; +var CompositionOutcome = class { + constructor(deletedText, deletedSelectionStart, deletedSelectionEnd, insertedText, insertedSelectionStart, insertedSelectionEnd, insertedTextRange) { + this.deletedText = deletedText; + this.deletedSelectionStart = deletedSelectionStart; + this.deletedSelectionEnd = deletedSelectionEnd; + this.insertedText = insertedText; + this.insertedSelectionStart = insertedSelectionStart; + this.insertedSelectionEnd = insertedSelectionEnd; + this.insertedTextRange = insertedTextRange; + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/browser/coreCommands.js +init_position(); +init_range(); +init_editorContextKeys(); +init_contextkey(); +init_keybindingsRegistry(); +init_dom(); +var CORE_WEIGHT = 0; +var CoreEditorCommand = class extends EditorCommand { + runEditorCommand(accessor, editor2, args) { + const viewModel = editor2._getViewModel(); + if (!viewModel) { + return; + } + this.runCoreEditorCommand(viewModel, args || {}); + } +}; +var EditorScroll_; +(function(EditorScroll_2) { + const isEditorScrollArgs = function(arg) { + if (!isObject(arg)) { + return false; + } + const scrollArg = arg; + if (!isString(scrollArg.to)) { + return false; + } + if (!isUndefined(scrollArg.by) && !isString(scrollArg.by)) { + return false; + } + if (!isUndefined(scrollArg.value) && !isNumber(scrollArg.value)) { + return false; + } + if (!isUndefined(scrollArg.revealCursor) && !isBoolean(scrollArg.revealCursor)) { + return false; + } + return true; + }; + EditorScroll_2.metadata = { + description: "Scroll editor in the given direction", + args: [ + { + name: "Editor scroll argument object", + description: `Property-value pairs that can be passed through this argument: + * 'to': A mandatory direction value. + \`\`\` + 'up', 'down' + \`\`\` + * 'by': Unit to move. Default is computed based on 'to' value. + \`\`\` + 'line', 'wrappedLine', 'page', 'halfPage', 'editor' + \`\`\` + * 'value': Number of units to move. Default is '1'. + * 'revealCursor': If 'true' reveals the cursor if it is outside view port. + `, + constraint: isEditorScrollArgs, + schema: { + "type": "object", + "required": ["to"], + "properties": { + "to": { + "type": "string", + "enum": ["up", "down"] + }, + "by": { + "type": "string", + "enum": ["line", "wrappedLine", "page", "halfPage", "editor"] + }, + "value": { + "type": "number", + "default": 1 + }, + "revealCursor": { + "type": "boolean" + } + } + } + } + ] + }; + EditorScroll_2.RawDirection = { + Up: "up", + Right: "right", + Down: "down", + Left: "left" + }; + EditorScroll_2.RawUnit = { + Line: "line", + WrappedLine: "wrappedLine", + Page: "page", + HalfPage: "halfPage", + Editor: "editor", + Column: "column" + }; + function parse4(args) { + let direction; + switch (args.to) { + case EditorScroll_2.RawDirection.Up: + direction = 1; + break; + case EditorScroll_2.RawDirection.Right: + direction = 2; + break; + case EditorScroll_2.RawDirection.Down: + direction = 3; + break; + case EditorScroll_2.RawDirection.Left: + direction = 4; + break; + default: + return null; + } + let unit; + switch (args.by) { + case EditorScroll_2.RawUnit.Line: + unit = 1; + break; + case EditorScroll_2.RawUnit.WrappedLine: + unit = 2; + break; + case EditorScroll_2.RawUnit.Page: + unit = 3; + break; + case EditorScroll_2.RawUnit.HalfPage: + unit = 4; + break; + case EditorScroll_2.RawUnit.Editor: + unit = 5; + break; + case EditorScroll_2.RawUnit.Column: + unit = 6; + break; + default: + unit = 2; + } + const value = Math.floor(args.value || 1); + const revealCursor = !!args.revealCursor; + return { + direction, + unit, + value, + revealCursor, + select: !!args.select + }; + } + EditorScroll_2.parse = parse4; +})(EditorScroll_ || (EditorScroll_ = {})); +var RevealLine_; +(function(RevealLine_2) { + const isRevealLineArgs = function(arg) { + if (!isObject(arg)) { + return false; + } + const reveaLineArg = arg; + if (!isNumber(reveaLineArg.lineNumber) && !isString(reveaLineArg.lineNumber)) { + return false; + } + if (!isUndefined(reveaLineArg.at) && !isString(reveaLineArg.at)) { + return false; + } + return true; + }; + RevealLine_2.metadata = { + description: "Reveal the given line at the given logical position", + args: [ + { + name: "Reveal line argument object", + description: `Property-value pairs that can be passed through this argument: + * 'lineNumber': A mandatory line number value. + * 'at': Logical position at which line has to be revealed. + \`\`\` + 'top', 'center', 'bottom' + \`\`\` + `, + constraint: isRevealLineArgs, + schema: { + "type": "object", + "required": ["lineNumber"], + "properties": { + "lineNumber": { + "type": ["number", "string"] + }, + "at": { + "type": "string", + "enum": ["top", "center", "bottom"] + } + } + } + } + ] + }; + RevealLine_2.RawAtArgument = { + Top: "top", + Center: "center", + Bottom: "bottom" + }; +})(RevealLine_ || (RevealLine_ = {})); +var EditorOrNativeTextInputCommand = class { + constructor(target) { + target.addImplementation(1e4, "code-editor", (accessor, args) => { + const focusedEditor = accessor.get(ICodeEditorService).getFocusedCodeEditor(); + if (focusedEditor && focusedEditor.hasTextFocus()) { + return this._runEditorCommand(accessor, focusedEditor, args); + } + return false; + }); + target.addImplementation(1e3, "generic-dom-input-textarea", (accessor, args) => { + const activeElement = getActiveElement(); + if (activeElement && isEditableElement(activeElement)) { + this.runDOMCommand(activeElement); + return true; + } + return false; + }); + target.addImplementation(0, "generic-dom", (accessor, args) => { + const activeEditor = accessor.get(ICodeEditorService).getActiveCodeEditor(); + if (activeEditor) { + activeEditor.focus(); + return this._runEditorCommand(accessor, activeEditor, args); + } + return false; + }); + } + _runEditorCommand(accessor, editor2, args) { + const result = this.runEditorCommand(accessor, editor2, args); + if (result) { + return result; + } + return true; + } +}; +var CoreNavigationCommands; +(function(CoreNavigationCommands2) { + class BaseMoveToCommand extends CoreEditorCommand { + constructor(opts) { + super(opts); + this._inSelectionMode = opts.inSelectionMode; + } + runCoreEditorCommand(viewModel, args) { + if (!args.position) { + return; + } + viewModel.model.pushStackElement(); + const cursorStateChanged = viewModel.setCursorStates(args.source, 3, [ + CursorMoveCommands.moveTo(viewModel, viewModel.getPrimaryCursorState(), this._inSelectionMode, args.position, args.viewPosition) + ]); + if (cursorStateChanged && args.revealType !== 2) { + viewModel.revealAllCursors(args.source, true, true); + } + } + } + CoreNavigationCommands2.MoveTo = registerEditorCommand(new BaseMoveToCommand({ + id: "_moveTo", + inSelectionMode: false, + precondition: void 0 + })); + CoreNavigationCommands2.MoveToSelect = registerEditorCommand(new BaseMoveToCommand({ + id: "_moveToSelect", + inSelectionMode: true, + precondition: void 0 + })); + class ColumnSelectCommand extends CoreEditorCommand { + runCoreEditorCommand(viewModel, args) { + viewModel.model.pushStackElement(); + const result = this._getColumnSelectResult(viewModel, viewModel.getPrimaryCursorState(), viewModel.getCursorColumnSelectData(), args); + if (result === null) { + return; + } + viewModel.setCursorStates(args.source, 3, result.viewStates.map((viewState) => CursorState.fromViewState(viewState))); + viewModel.setCursorColumnSelectData({ + isReal: true, + fromViewLineNumber: result.fromLineNumber, + fromViewVisualColumn: result.fromVisualColumn, + toViewLineNumber: result.toLineNumber, + toViewVisualColumn: result.toVisualColumn + }); + if (result.reversed) { + viewModel.revealTopMostCursor(args.source); + } else { + viewModel.revealBottomMostCursor(args.source); + } + } + } + CoreNavigationCommands2.ColumnSelect = registerEditorCommand(new class extends ColumnSelectCommand { + constructor() { + super({ + id: "columnSelect", + precondition: void 0 + }); + } + _getColumnSelectResult(viewModel, primary, prevColumnSelectData, args) { + if (typeof args.position === "undefined" || typeof args.viewPosition === "undefined" || typeof args.mouseColumn === "undefined") { + return null; + } + const validatedPosition = viewModel.model.validatePosition(args.position); + const validatedViewPosition = viewModel.coordinatesConverter.validateViewPosition(new Position(args.viewPosition.lineNumber, args.viewPosition.column), validatedPosition); + const fromViewLineNumber = args.doColumnSelect ? prevColumnSelectData.fromViewLineNumber : validatedViewPosition.lineNumber; + const fromViewVisualColumn = args.doColumnSelect ? prevColumnSelectData.fromViewVisualColumn : args.mouseColumn - 1; + return ColumnSelection.columnSelect(viewModel.cursorConfig, viewModel, fromViewLineNumber, fromViewVisualColumn, validatedViewPosition.lineNumber, args.mouseColumn - 1); + } + }()); + CoreNavigationCommands2.CursorColumnSelectLeft = registerEditorCommand(new class extends ColumnSelectCommand { + constructor() { + super({ + id: "cursorColumnSelectLeft", + precondition: void 0, + kbOpts: { + weight: CORE_WEIGHT, + kbExpr: EditorContextKeys.textInputFocus, + primary: 2048 | 1024 | 512 | 15, + linux: { primary: 0 } + } + }); + } + _getColumnSelectResult(viewModel, primary, prevColumnSelectData, args) { + return ColumnSelection.columnSelectLeft(viewModel.cursorConfig, viewModel, prevColumnSelectData); + } + }()); + CoreNavigationCommands2.CursorColumnSelectRight = registerEditorCommand(new class extends ColumnSelectCommand { + constructor() { + super({ + id: "cursorColumnSelectRight", + precondition: void 0, + kbOpts: { + weight: CORE_WEIGHT, + kbExpr: EditorContextKeys.textInputFocus, + primary: 2048 | 1024 | 512 | 17, + linux: { primary: 0 } + } + }); + } + _getColumnSelectResult(viewModel, primary, prevColumnSelectData, args) { + return ColumnSelection.columnSelectRight(viewModel.cursorConfig, viewModel, prevColumnSelectData); + } + }()); + class ColumnSelectUpCommand extends ColumnSelectCommand { + constructor(opts) { + super(opts); + this._isPaged = opts.isPaged; + } + _getColumnSelectResult(viewModel, primary, prevColumnSelectData, args) { + return ColumnSelection.columnSelectUp(viewModel.cursorConfig, viewModel, prevColumnSelectData, this._isPaged); + } + } + CoreNavigationCommands2.CursorColumnSelectUp = registerEditorCommand(new ColumnSelectUpCommand({ + isPaged: false, + id: "cursorColumnSelectUp", + precondition: void 0, + kbOpts: { + weight: CORE_WEIGHT, + kbExpr: EditorContextKeys.textInputFocus, + primary: 2048 | 1024 | 512 | 16, + linux: { primary: 0 } + } + })); + CoreNavigationCommands2.CursorColumnSelectPageUp = registerEditorCommand(new ColumnSelectUpCommand({ + isPaged: true, + id: "cursorColumnSelectPageUp", + precondition: void 0, + kbOpts: { + weight: CORE_WEIGHT, + kbExpr: EditorContextKeys.textInputFocus, + primary: 2048 | 1024 | 512 | 11, + linux: { primary: 0 } + } + })); + class ColumnSelectDownCommand extends ColumnSelectCommand { + constructor(opts) { + super(opts); + this._isPaged = opts.isPaged; + } + _getColumnSelectResult(viewModel, primary, prevColumnSelectData, args) { + return ColumnSelection.columnSelectDown(viewModel.cursorConfig, viewModel, prevColumnSelectData, this._isPaged); + } + } + CoreNavigationCommands2.CursorColumnSelectDown = registerEditorCommand(new ColumnSelectDownCommand({ + isPaged: false, + id: "cursorColumnSelectDown", + precondition: void 0, + kbOpts: { + weight: CORE_WEIGHT, + kbExpr: EditorContextKeys.textInputFocus, + primary: 2048 | 1024 | 512 | 18, + linux: { primary: 0 } + } + })); + CoreNavigationCommands2.CursorColumnSelectPageDown = registerEditorCommand(new ColumnSelectDownCommand({ + isPaged: true, + id: "cursorColumnSelectPageDown", + precondition: void 0, + kbOpts: { + weight: CORE_WEIGHT, + kbExpr: EditorContextKeys.textInputFocus, + primary: 2048 | 1024 | 512 | 12, + linux: { primary: 0 } + } + })); + class CursorMoveImpl extends CoreEditorCommand { + constructor() { + super({ + id: "cursorMove", + precondition: void 0, + metadata: CursorMove.metadata + }); + } + runCoreEditorCommand(viewModel, args) { + const parsed = CursorMove.parse(args); + if (!parsed) { + return; + } + this._runCursorMove(viewModel, args.source, parsed); + } + _runCursorMove(viewModel, source, args) { + const effectiveSource = args.noHistory ? "api" : source; + viewModel.model.pushStackElement(); + viewModel.setCursorStates(effectiveSource, 3, CursorMoveImpl._move(viewModel, viewModel.getCursorStates(), args)); + viewModel.revealAllCursors(effectiveSource, true); + } + static _move(viewModel, cursors, args) { + const inSelectionMode = args.select; + const value = args.value; + switch (args.direction) { + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + return CursorMoveCommands.simpleMove(viewModel, cursors, args.direction, inSelectionMode, value, args.unit); + case 11: + case 13: + case 12: + case 14: + return CursorMoveCommands.viewportMove(viewModel, cursors, args.direction, inSelectionMode, value); + default: + return null; + } + } + } + CoreNavigationCommands2.CursorMoveImpl = CursorMoveImpl; + CoreNavigationCommands2.CursorMove = registerEditorCommand(new CursorMoveImpl()); + class CursorMoveBasedCommand extends CoreEditorCommand { + constructor(opts) { + super(opts); + this._staticArgs = opts.args; + } + runCoreEditorCommand(viewModel, dynamicArgs) { + let args = this._staticArgs; + if (this._staticArgs.value === -1) { + args = { + direction: this._staticArgs.direction, + unit: this._staticArgs.unit, + select: this._staticArgs.select, + value: dynamicArgs.pageSize || viewModel.cursorConfig.pageSize + }; + } + viewModel.model.pushStackElement(); + viewModel.setCursorStates(dynamicArgs.source, 3, CursorMoveCommands.simpleMove(viewModel, viewModel.getCursorStates(), args.direction, args.select, args.value, args.unit)); + viewModel.revealAllCursors(dynamicArgs.source, true); + } + } + CoreNavigationCommands2.CursorLeft = registerEditorCommand(new CursorMoveBasedCommand({ + args: { + direction: 0, + unit: 0, + select: false, + value: 1 + }, + id: "cursorLeft", + precondition: void 0, + kbOpts: { + weight: CORE_WEIGHT, + kbExpr: EditorContextKeys.textInputFocus, + primary: 15, + mac: { primary: 15, secondary: [ + 256 | 32 + /* KeyCode.KeyB */ + ] } + } + })); + CoreNavigationCommands2.CursorLeftSelect = registerEditorCommand(new CursorMoveBasedCommand({ + args: { + direction: 0, + unit: 0, + select: true, + value: 1 + }, + id: "cursorLeftSelect", + precondition: void 0, + kbOpts: { + weight: CORE_WEIGHT, + kbExpr: EditorContextKeys.textInputFocus, + primary: 1024 | 15 + /* KeyCode.LeftArrow */ + } + })); + CoreNavigationCommands2.CursorRight = registerEditorCommand(new CursorMoveBasedCommand({ + args: { + direction: 1, + unit: 0, + select: false, + value: 1 + }, + id: "cursorRight", + precondition: void 0, + kbOpts: { + weight: CORE_WEIGHT, + kbExpr: EditorContextKeys.textInputFocus, + primary: 17, + mac: { primary: 17, secondary: [ + 256 | 36 + /* KeyCode.KeyF */ + ] } + } + })); + CoreNavigationCommands2.CursorRightSelect = registerEditorCommand(new CursorMoveBasedCommand({ + args: { + direction: 1, + unit: 0, + select: true, + value: 1 + }, + id: "cursorRightSelect", + precondition: void 0, + kbOpts: { + weight: CORE_WEIGHT, + kbExpr: EditorContextKeys.textInputFocus, + primary: 1024 | 17 + /* KeyCode.RightArrow */ + } + })); + CoreNavigationCommands2.CursorUp = registerEditorCommand(new CursorMoveBasedCommand({ + args: { + direction: 2, + unit: 2, + select: false, + value: 1 + }, + id: "cursorUp", + precondition: void 0, + kbOpts: { + weight: CORE_WEIGHT, + kbExpr: EditorContextKeys.textInputFocus, + primary: 16, + mac: { primary: 16, secondary: [ + 256 | 46 + /* KeyCode.KeyP */ + ] } + } + })); + CoreNavigationCommands2.CursorUpSelect = registerEditorCommand(new CursorMoveBasedCommand({ + args: { + direction: 2, + unit: 2, + select: true, + value: 1 + }, + id: "cursorUpSelect", + precondition: void 0, + kbOpts: { + weight: CORE_WEIGHT, + kbExpr: EditorContextKeys.textInputFocus, + primary: 1024 | 16, + secondary: [ + 2048 | 1024 | 16 + /* KeyCode.UpArrow */ + ], + mac: { + primary: 1024 | 16 + /* KeyCode.UpArrow */ + }, + linux: { + primary: 1024 | 16 + /* KeyCode.UpArrow */ + } + } + })); + CoreNavigationCommands2.CursorPageUp = registerEditorCommand(new CursorMoveBasedCommand({ + args: { + direction: 2, + unit: 2, + select: false, + value: -1 + /* Constants.PAGE_SIZE_MARKER */ + }, + id: "cursorPageUp", + precondition: void 0, + kbOpts: { + weight: CORE_WEIGHT, + kbExpr: EditorContextKeys.textInputFocus, + primary: 11 + /* KeyCode.PageUp */ + } + })); + CoreNavigationCommands2.CursorPageUpSelect = registerEditorCommand(new CursorMoveBasedCommand({ + args: { + direction: 2, + unit: 2, + select: true, + value: -1 + /* Constants.PAGE_SIZE_MARKER */ + }, + id: "cursorPageUpSelect", + precondition: void 0, + kbOpts: { + weight: CORE_WEIGHT, + kbExpr: EditorContextKeys.textInputFocus, + primary: 1024 | 11 + /* KeyCode.PageUp */ + } + })); + CoreNavigationCommands2.CursorDown = registerEditorCommand(new CursorMoveBasedCommand({ + args: { + direction: 3, + unit: 2, + select: false, + value: 1 + }, + id: "cursorDown", + precondition: void 0, + kbOpts: { + weight: CORE_WEIGHT, + kbExpr: EditorContextKeys.textInputFocus, + primary: 18, + mac: { primary: 18, secondary: [ + 256 | 44 + /* KeyCode.KeyN */ + ] } + } + })); + CoreNavigationCommands2.CursorDownSelect = registerEditorCommand(new CursorMoveBasedCommand({ + args: { + direction: 3, + unit: 2, + select: true, + value: 1 + }, + id: "cursorDownSelect", + precondition: void 0, + kbOpts: { + weight: CORE_WEIGHT, + kbExpr: EditorContextKeys.textInputFocus, + primary: 1024 | 18, + secondary: [ + 2048 | 1024 | 18 + /* KeyCode.DownArrow */ + ], + mac: { + primary: 1024 | 18 + /* KeyCode.DownArrow */ + }, + linux: { + primary: 1024 | 18 + /* KeyCode.DownArrow */ + } + } + })); + CoreNavigationCommands2.CursorPageDown = registerEditorCommand(new CursorMoveBasedCommand({ + args: { + direction: 3, + unit: 2, + select: false, + value: -1 + /* Constants.PAGE_SIZE_MARKER */ + }, + id: "cursorPageDown", + precondition: void 0, + kbOpts: { + weight: CORE_WEIGHT, + kbExpr: EditorContextKeys.textInputFocus, + primary: 12 + /* KeyCode.PageDown */ + } + })); + CoreNavigationCommands2.CursorPageDownSelect = registerEditorCommand(new CursorMoveBasedCommand({ + args: { + direction: 3, + unit: 2, + select: true, + value: -1 + /* Constants.PAGE_SIZE_MARKER */ + }, + id: "cursorPageDownSelect", + precondition: void 0, + kbOpts: { + weight: CORE_WEIGHT, + kbExpr: EditorContextKeys.textInputFocus, + primary: 1024 | 12 + /* KeyCode.PageDown */ + } + })); + CoreNavigationCommands2.CreateCursor = registerEditorCommand(new class extends CoreEditorCommand { + constructor() { + super({ + id: "createCursor", + precondition: void 0 + }); + } + runCoreEditorCommand(viewModel, args) { + if (!args.position) { + return; + } + let newState; + if (args.wholeLine) { + newState = CursorMoveCommands.line(viewModel, viewModel.getPrimaryCursorState(), false, args.position, args.viewPosition); + } else { + newState = CursorMoveCommands.moveTo(viewModel, viewModel.getPrimaryCursorState(), false, args.position, args.viewPosition); + } + const states = viewModel.getCursorStates(); + if (states.length > 1) { + const newModelPosition = newState.modelState ? newState.modelState.position : null; + const newViewPosition = newState.viewState ? newState.viewState.position : null; + for (let i2 = 0, len = states.length; i2 < len; i2++) { + const state = states[i2]; + if (newModelPosition && !state.modelState.selection.containsPosition(newModelPosition)) { + continue; + } + if (newViewPosition && !state.viewState.selection.containsPosition(newViewPosition)) { + continue; + } + states.splice(i2, 1); + viewModel.model.pushStackElement(); + viewModel.setCursorStates(args.source, 3, states); + return; + } + } + states.push(newState); + viewModel.model.pushStackElement(); + viewModel.setCursorStates(args.source, 3, states); + } + }()); + CoreNavigationCommands2.LastCursorMoveToSelect = registerEditorCommand(new class extends CoreEditorCommand { + constructor() { + super({ + id: "_lastCursorMoveToSelect", + precondition: void 0 + }); + } + runCoreEditorCommand(viewModel, args) { + if (!args.position) { + return; + } + const lastAddedCursorIndex = viewModel.getLastAddedCursorIndex(); + const states = viewModel.getCursorStates(); + const newStates = states.slice(0); + newStates[lastAddedCursorIndex] = CursorMoveCommands.moveTo(viewModel, states[lastAddedCursorIndex], true, args.position, args.viewPosition); + viewModel.model.pushStackElement(); + viewModel.setCursorStates(args.source, 3, newStates); + } + }()); + class HomeCommand extends CoreEditorCommand { + constructor(opts) { + super(opts); + this._inSelectionMode = opts.inSelectionMode; + } + runCoreEditorCommand(viewModel, args) { + viewModel.model.pushStackElement(); + viewModel.setCursorStates(args.source, 3, CursorMoveCommands.moveToBeginningOfLine(viewModel, viewModel.getCursorStates(), this._inSelectionMode)); + viewModel.revealAllCursors(args.source, true); + } + } + CoreNavigationCommands2.CursorHome = registerEditorCommand(new HomeCommand({ + inSelectionMode: false, + id: "cursorHome", + precondition: void 0, + kbOpts: { + weight: CORE_WEIGHT, + kbExpr: EditorContextKeys.textInputFocus, + primary: 14, + mac: { primary: 14, secondary: [ + 2048 | 15 + /* KeyCode.LeftArrow */ + ] } + } + })); + CoreNavigationCommands2.CursorHomeSelect = registerEditorCommand(new HomeCommand({ + inSelectionMode: true, + id: "cursorHomeSelect", + precondition: void 0, + kbOpts: { + weight: CORE_WEIGHT, + kbExpr: EditorContextKeys.textInputFocus, + primary: 1024 | 14, + mac: { primary: 1024 | 14, secondary: [ + 2048 | 1024 | 15 + /* KeyCode.LeftArrow */ + ] } + } + })); + class LineStartCommand extends CoreEditorCommand { + constructor(opts) { + super(opts); + this._inSelectionMode = opts.inSelectionMode; + } + runCoreEditorCommand(viewModel, args) { + viewModel.model.pushStackElement(); + viewModel.setCursorStates(args.source, 3, this._exec(viewModel.getCursorStates())); + viewModel.revealAllCursors(args.source, true); + } + _exec(cursors) { + const result = []; + for (let i2 = 0, len = cursors.length; i2 < len; i2++) { + const cursor = cursors[i2]; + const lineNumber = cursor.modelState.position.lineNumber; + result[i2] = CursorState.fromModelState(cursor.modelState.move(this._inSelectionMode, lineNumber, 1, 0)); + } + return result; + } + } + CoreNavigationCommands2.CursorLineStart = registerEditorCommand(new LineStartCommand({ + inSelectionMode: false, + id: "cursorLineStart", + precondition: void 0, + kbOpts: { + weight: CORE_WEIGHT, + kbExpr: EditorContextKeys.textInputFocus, + primary: 0, + mac: { + primary: 256 | 31 + /* KeyCode.KeyA */ + } + } + })); + CoreNavigationCommands2.CursorLineStartSelect = registerEditorCommand(new LineStartCommand({ + inSelectionMode: true, + id: "cursorLineStartSelect", + precondition: void 0, + kbOpts: { + weight: CORE_WEIGHT, + kbExpr: EditorContextKeys.textInputFocus, + primary: 0, + mac: { + primary: 256 | 1024 | 31 + /* KeyCode.KeyA */ + } + } + })); + class EndCommand extends CoreEditorCommand { + constructor(opts) { + super(opts); + this._inSelectionMode = opts.inSelectionMode; + } + runCoreEditorCommand(viewModel, args) { + viewModel.model.pushStackElement(); + viewModel.setCursorStates(args.source, 3, CursorMoveCommands.moveToEndOfLine(viewModel, viewModel.getCursorStates(), this._inSelectionMode, args.sticky || false)); + viewModel.revealAllCursors(args.source, true); + } + } + CoreNavigationCommands2.CursorEnd = registerEditorCommand(new EndCommand({ + inSelectionMode: false, + id: "cursorEnd", + precondition: void 0, + kbOpts: { + args: { sticky: false }, + weight: CORE_WEIGHT, + kbExpr: EditorContextKeys.textInputFocus, + primary: 13, + mac: { primary: 13, secondary: [ + 2048 | 17 + /* KeyCode.RightArrow */ + ] } + }, + metadata: { + description: `Go to End`, + args: [{ + name: "args", + schema: { + type: "object", + properties: { + "sticky": { + description: localize(66, "Stick to the end even when going to longer lines"), + type: "boolean", + default: false + } + } + } + }] + } + })); + CoreNavigationCommands2.CursorEndSelect = registerEditorCommand(new EndCommand({ + inSelectionMode: true, + id: "cursorEndSelect", + precondition: void 0, + kbOpts: { + args: { sticky: false }, + weight: CORE_WEIGHT, + kbExpr: EditorContextKeys.textInputFocus, + primary: 1024 | 13, + mac: { primary: 1024 | 13, secondary: [ + 2048 | 1024 | 17 + /* KeyCode.RightArrow */ + ] } + }, + metadata: { + description: `Select to End`, + args: [{ + name: "args", + schema: { + type: "object", + properties: { + "sticky": { + description: localize(67, "Stick to the end even when going to longer lines"), + type: "boolean", + default: false + } + } + } + }] + } + })); + class LineEndCommand extends CoreEditorCommand { + constructor(opts) { + super(opts); + this._inSelectionMode = opts.inSelectionMode; + } + runCoreEditorCommand(viewModel, args) { + viewModel.model.pushStackElement(); + viewModel.setCursorStates(args.source, 3, this._exec(viewModel, viewModel.getCursorStates())); + viewModel.revealAllCursors(args.source, true); + } + _exec(viewModel, cursors) { + const result = []; + for (let i2 = 0, len = cursors.length; i2 < len; i2++) { + const cursor = cursors[i2]; + const lineNumber = cursor.modelState.position.lineNumber; + const maxColumn = viewModel.model.getLineMaxColumn(lineNumber); + result[i2] = CursorState.fromModelState(cursor.modelState.move(this._inSelectionMode, lineNumber, maxColumn, 0)); + } + return result; + } + } + CoreNavigationCommands2.CursorLineEnd = registerEditorCommand(new LineEndCommand({ + inSelectionMode: false, + id: "cursorLineEnd", + precondition: void 0, + kbOpts: { + weight: CORE_WEIGHT, + kbExpr: EditorContextKeys.textInputFocus, + primary: 0, + mac: { + primary: 256 | 35 + /* KeyCode.KeyE */ + } + } + })); + CoreNavigationCommands2.CursorLineEndSelect = registerEditorCommand(new LineEndCommand({ + inSelectionMode: true, + id: "cursorLineEndSelect", + precondition: void 0, + kbOpts: { + weight: CORE_WEIGHT, + kbExpr: EditorContextKeys.textInputFocus, + primary: 0, + mac: { + primary: 256 | 1024 | 35 + /* KeyCode.KeyE */ + } + } + })); + class TopCommand extends CoreEditorCommand { + constructor(opts) { + super(opts); + this._inSelectionMode = opts.inSelectionMode; + } + runCoreEditorCommand(viewModel, args) { + viewModel.model.pushStackElement(); + viewModel.setCursorStates(args.source, 3, CursorMoveCommands.moveToBeginningOfBuffer(viewModel, viewModel.getCursorStates(), this._inSelectionMode)); + viewModel.revealAllCursors(args.source, true); + } + } + CoreNavigationCommands2.CursorTop = registerEditorCommand(new TopCommand({ + inSelectionMode: false, + id: "cursorTop", + precondition: void 0, + kbOpts: { + weight: CORE_WEIGHT, + kbExpr: EditorContextKeys.textInputFocus, + primary: 2048 | 14, + mac: { + primary: 2048 | 16 + /* KeyCode.UpArrow */ + } + } + })); + CoreNavigationCommands2.CursorTopSelect = registerEditorCommand(new TopCommand({ + inSelectionMode: true, + id: "cursorTopSelect", + precondition: void 0, + kbOpts: { + weight: CORE_WEIGHT, + kbExpr: EditorContextKeys.textInputFocus, + primary: 2048 | 1024 | 14, + mac: { + primary: 2048 | 1024 | 16 + /* KeyCode.UpArrow */ + } + } + })); + class BottomCommand extends CoreEditorCommand { + constructor(opts) { + super(opts); + this._inSelectionMode = opts.inSelectionMode; + } + runCoreEditorCommand(viewModel, args) { + viewModel.model.pushStackElement(); + viewModel.setCursorStates(args.source, 3, CursorMoveCommands.moveToEndOfBuffer(viewModel, viewModel.getCursorStates(), this._inSelectionMode)); + viewModel.revealAllCursors(args.source, true); + } + } + CoreNavigationCommands2.CursorBottom = registerEditorCommand(new BottomCommand({ + inSelectionMode: false, + id: "cursorBottom", + precondition: void 0, + kbOpts: { + weight: CORE_WEIGHT, + kbExpr: EditorContextKeys.textInputFocus, + primary: 2048 | 13, + mac: { + primary: 2048 | 18 + /* KeyCode.DownArrow */ + } + } + })); + CoreNavigationCommands2.CursorBottomSelect = registerEditorCommand(new BottomCommand({ + inSelectionMode: true, + id: "cursorBottomSelect", + precondition: void 0, + kbOpts: { + weight: CORE_WEIGHT, + kbExpr: EditorContextKeys.textInputFocus, + primary: 2048 | 1024 | 13, + mac: { + primary: 2048 | 1024 | 18 + /* KeyCode.DownArrow */ + } + } + })); + class EditorScrollImpl extends CoreEditorCommand { + constructor() { + super({ + id: "editorScroll", + precondition: void 0, + metadata: EditorScroll_.metadata + }); + } + determineScrollMethod(args) { + const horizontalUnits = [ + 6 + /* EditorScroll_.Unit.Column */ + ]; + const verticalUnits = [ + 1, + 2, + 3, + 4, + 5, + 6 + /* EditorScroll_.Unit.Column */ + ]; + const horizontalDirections = [ + 4, + 2 + /* EditorScroll_.Direction.Right */ + ]; + const verticalDirections = [ + 1, + 3 + /* EditorScroll_.Direction.Down */ + ]; + if (horizontalUnits.includes(args.unit) && horizontalDirections.includes(args.direction)) { + return this._runHorizontalEditorScroll.bind(this); + } + if (verticalUnits.includes(args.unit) && verticalDirections.includes(args.direction)) { + return this._runVerticalEditorScroll.bind(this); + } + return null; + } + runCoreEditorCommand(viewModel, args) { + const parsed = EditorScroll_.parse(args); + if (!parsed) { + return; + } + const runEditorScroll = this.determineScrollMethod(parsed); + if (!runEditorScroll) { + return; + } + runEditorScroll(viewModel, args.source, parsed); + } + _runVerticalEditorScroll(viewModel, source, args) { + const desiredScrollTop = this._computeDesiredScrollTop(viewModel, args); + if (args.revealCursor) { + const desiredVisibleViewRange = viewModel.getCompletelyVisibleViewRangeAtScrollTop(desiredScrollTop); + viewModel.setCursorStates(source, 3, [ + CursorMoveCommands.findPositionInViewportIfOutside(viewModel, viewModel.getPrimaryCursorState(), desiredVisibleViewRange, args.select) + ]); + } + viewModel.viewLayout.setScrollPosition( + { scrollTop: desiredScrollTop }, + 0 + /* ScrollType.Smooth */ + ); + } + _computeDesiredScrollTop(viewModel, args) { + if (args.unit === 1) { + const futureViewport = viewModel.viewLayout.getFutureViewport(); + const visibleViewRange = viewModel.getCompletelyVisibleViewRangeAtScrollTop(futureViewport.top); + const visibleModelRange = viewModel.coordinatesConverter.convertViewRangeToModelRange(visibleViewRange); + let desiredTopModelLineNumber; + if (args.direction === 1) { + desiredTopModelLineNumber = Math.max(1, visibleModelRange.startLineNumber - args.value); + } else { + desiredTopModelLineNumber = Math.min(viewModel.model.getLineCount(), visibleModelRange.startLineNumber + args.value); + } + const viewPosition = viewModel.coordinatesConverter.convertModelPositionToViewPosition(new Position(desiredTopModelLineNumber, 1)); + return viewModel.viewLayout.getVerticalOffsetForLineNumber(viewPosition.lineNumber); + } + if (args.unit === 5) { + let desiredTopModelLineNumber = 0; + if (args.direction === 3) { + desiredTopModelLineNumber = viewModel.model.getLineCount() - viewModel.cursorConfig.pageSize; + } + return viewModel.viewLayout.getVerticalOffsetForLineNumber(desiredTopModelLineNumber); + } + let noOfLines; + if (args.unit === 3) { + noOfLines = viewModel.cursorConfig.pageSize * args.value; + } else if (args.unit === 4) { + noOfLines = Math.round(viewModel.cursorConfig.pageSize / 2) * args.value; + } else { + noOfLines = args.value; + } + const deltaLines = (args.direction === 1 ? -1 : 1) * noOfLines; + return viewModel.viewLayout.getCurrentScrollTop() + deltaLines * viewModel.cursorConfig.lineHeight; + } + _runHorizontalEditorScroll(viewModel, source, args) { + const desiredScrollLeft = this._computeDesiredScrollLeft(viewModel, args); + viewModel.viewLayout.setScrollPosition( + { scrollLeft: desiredScrollLeft }, + 0 + /* ScrollType.Smooth */ + ); + } + _computeDesiredScrollLeft(viewModel, args) { + const deltaColumns = (args.direction === 4 ? -1 : 1) * args.value; + return viewModel.viewLayout.getCurrentScrollLeft() + deltaColumns * viewModel.cursorConfig.typicalHalfwidthCharacterWidth; + } + } + CoreNavigationCommands2.EditorScrollImpl = EditorScrollImpl; + CoreNavigationCommands2.EditorScroll = registerEditorCommand(new EditorScrollImpl()); + CoreNavigationCommands2.ScrollLineUp = registerEditorCommand(new class extends CoreEditorCommand { + constructor() { + super({ + id: "scrollLineUp", + precondition: void 0, + kbOpts: { + weight: CORE_WEIGHT, + kbExpr: EditorContextKeys.textInputFocus, + primary: 2048 | 16, + mac: { + primary: 256 | 11 + /* KeyCode.PageUp */ + } + } + }); + } + runCoreEditorCommand(viewModel, args) { + CoreNavigationCommands2.EditorScroll.runCoreEditorCommand(viewModel, { + to: EditorScroll_.RawDirection.Up, + by: EditorScroll_.RawUnit.WrappedLine, + value: 1, + revealCursor: false, + select: false, + source: args.source + }); + } + }()); + CoreNavigationCommands2.ScrollPageUp = registerEditorCommand(new class extends CoreEditorCommand { + constructor() { + super({ + id: "scrollPageUp", + precondition: void 0, + kbOpts: { + weight: CORE_WEIGHT, + kbExpr: EditorContextKeys.textInputFocus, + primary: 2048 | 11, + win: { + primary: 512 | 11 + /* KeyCode.PageUp */ + }, + linux: { + primary: 512 | 11 + /* KeyCode.PageUp */ + } + } + }); + } + runCoreEditorCommand(viewModel, args) { + CoreNavigationCommands2.EditorScroll.runCoreEditorCommand(viewModel, { + to: EditorScroll_.RawDirection.Up, + by: EditorScroll_.RawUnit.Page, + value: 1, + revealCursor: false, + select: false, + source: args.source + }); + } + }()); + CoreNavigationCommands2.ScrollEditorTop = registerEditorCommand(new class extends CoreEditorCommand { + constructor() { + super({ + id: "scrollEditorTop", + precondition: void 0, + kbOpts: { + weight: CORE_WEIGHT, + kbExpr: EditorContextKeys.textInputFocus + } + }); + } + runCoreEditorCommand(viewModel, args) { + CoreNavigationCommands2.EditorScroll.runCoreEditorCommand(viewModel, { + to: EditorScroll_.RawDirection.Up, + by: EditorScroll_.RawUnit.Editor, + value: 1, + revealCursor: false, + select: false, + source: args.source + }); + } + }()); + CoreNavigationCommands2.ScrollLineDown = registerEditorCommand(new class extends CoreEditorCommand { + constructor() { + super({ + id: "scrollLineDown", + precondition: void 0, + kbOpts: { + weight: CORE_WEIGHT, + kbExpr: EditorContextKeys.textInputFocus, + primary: 2048 | 18, + mac: { + primary: 256 | 12 + /* KeyCode.PageDown */ + } + } + }); + } + runCoreEditorCommand(viewModel, args) { + CoreNavigationCommands2.EditorScroll.runCoreEditorCommand(viewModel, { + to: EditorScroll_.RawDirection.Down, + by: EditorScroll_.RawUnit.WrappedLine, + value: 1, + revealCursor: false, + select: false, + source: args.source + }); + } + }()); + CoreNavigationCommands2.ScrollPageDown = registerEditorCommand(new class extends CoreEditorCommand { + constructor() { + super({ + id: "scrollPageDown", + precondition: void 0, + kbOpts: { + weight: CORE_WEIGHT, + kbExpr: EditorContextKeys.textInputFocus, + primary: 2048 | 12, + win: { + primary: 512 | 12 + /* KeyCode.PageDown */ + }, + linux: { + primary: 512 | 12 + /* KeyCode.PageDown */ + } + } + }); + } + runCoreEditorCommand(viewModel, args) { + CoreNavigationCommands2.EditorScroll.runCoreEditorCommand(viewModel, { + to: EditorScroll_.RawDirection.Down, + by: EditorScroll_.RawUnit.Page, + value: 1, + revealCursor: false, + select: false, + source: args.source + }); + } + }()); + CoreNavigationCommands2.ScrollEditorBottom = registerEditorCommand(new class extends CoreEditorCommand { + constructor() { + super({ + id: "scrollEditorBottom", + precondition: void 0, + kbOpts: { + weight: CORE_WEIGHT, + kbExpr: EditorContextKeys.textInputFocus + } + }); + } + runCoreEditorCommand(viewModel, args) { + CoreNavigationCommands2.EditorScroll.runCoreEditorCommand(viewModel, { + to: EditorScroll_.RawDirection.Down, + by: EditorScroll_.RawUnit.Editor, + value: 1, + revealCursor: false, + select: false, + source: args.source + }); + } + }()); + CoreNavigationCommands2.ScrollLeft = registerEditorCommand(new class extends CoreEditorCommand { + constructor() { + super({ + id: "scrollLeft", + precondition: void 0, + kbOpts: { + weight: CORE_WEIGHT, + kbExpr: EditorContextKeys.textInputFocus + } + }); + } + runCoreEditorCommand(viewModel, args) { + CoreNavigationCommands2.EditorScroll.runCoreEditorCommand(viewModel, { + to: EditorScroll_.RawDirection.Left, + by: EditorScroll_.RawUnit.Column, + value: 2, + revealCursor: false, + select: false, + source: args.source + }); + } + }()); + CoreNavigationCommands2.ScrollRight = registerEditorCommand(new class extends CoreEditorCommand { + constructor() { + super({ + id: "scrollRight", + precondition: void 0, + kbOpts: { + weight: CORE_WEIGHT, + kbExpr: EditorContextKeys.textInputFocus + } + }); + } + runCoreEditorCommand(viewModel, args) { + CoreNavigationCommands2.EditorScroll.runCoreEditorCommand(viewModel, { + to: EditorScroll_.RawDirection.Right, + by: EditorScroll_.RawUnit.Column, + value: 2, + revealCursor: false, + select: false, + source: args.source + }); + } + }()); + class WordCommand extends CoreEditorCommand { + constructor(opts) { + super(opts); + this._inSelectionMode = opts.inSelectionMode; + } + runCoreEditorCommand(viewModel, args) { + if (!args.position) { + return; + } + viewModel.model.pushStackElement(); + viewModel.setCursorStates(args.source, 3, [ + CursorMoveCommands.word(viewModel, viewModel.getPrimaryCursorState(), this._inSelectionMode, args.position) + ]); + if (args.revealType !== 2) { + viewModel.revealAllCursors(args.source, true, true); + } + } + } + CoreNavigationCommands2.WordSelect = registerEditorCommand(new WordCommand({ + inSelectionMode: false, + id: "_wordSelect", + precondition: void 0 + })); + CoreNavigationCommands2.WordSelectDrag = registerEditorCommand(new WordCommand({ + inSelectionMode: true, + id: "_wordSelectDrag", + precondition: void 0 + })); + CoreNavigationCommands2.LastCursorWordSelect = registerEditorCommand(new class extends CoreEditorCommand { + constructor() { + super({ + id: "lastCursorWordSelect", + precondition: void 0 + }); + } + runCoreEditorCommand(viewModel, args) { + if (!args.position) { + return; + } + const lastAddedCursorIndex = viewModel.getLastAddedCursorIndex(); + const states = viewModel.getCursorStates(); + const newStates = states.slice(0); + const lastAddedState = states[lastAddedCursorIndex]; + newStates[lastAddedCursorIndex] = CursorMoveCommands.word(viewModel, lastAddedState, lastAddedState.modelState.hasSelection(), args.position); + viewModel.model.pushStackElement(); + viewModel.setCursorStates(args.source, 3, newStates); + } + }()); + class LineCommand extends CoreEditorCommand { + constructor(opts) { + super(opts); + this._inSelectionMode = opts.inSelectionMode; + } + runCoreEditorCommand(viewModel, args) { + if (!args.position) { + return; + } + viewModel.model.pushStackElement(); + viewModel.setCursorStates(args.source, 3, [ + CursorMoveCommands.line(viewModel, viewModel.getPrimaryCursorState(), this._inSelectionMode, args.position, args.viewPosition) + ]); + if (args.revealType !== 2) { + viewModel.revealAllCursors(args.source, false, true); + } + } + } + CoreNavigationCommands2.LineSelect = registerEditorCommand(new LineCommand({ + inSelectionMode: false, + id: "_lineSelect", + precondition: void 0 + })); + CoreNavigationCommands2.LineSelectDrag = registerEditorCommand(new LineCommand({ + inSelectionMode: true, + id: "_lineSelectDrag", + precondition: void 0 + })); + class LastCursorLineCommand extends CoreEditorCommand { + constructor(opts) { + super(opts); + this._inSelectionMode = opts.inSelectionMode; + } + runCoreEditorCommand(viewModel, args) { + if (!args.position) { + return; + } + const lastAddedCursorIndex = viewModel.getLastAddedCursorIndex(); + const states = viewModel.getCursorStates(); + const newStates = states.slice(0); + newStates[lastAddedCursorIndex] = CursorMoveCommands.line(viewModel, states[lastAddedCursorIndex], this._inSelectionMode, args.position, args.viewPosition); + viewModel.model.pushStackElement(); + viewModel.setCursorStates(args.source, 3, newStates); + } + } + CoreNavigationCommands2.LastCursorLineSelect = registerEditorCommand(new LastCursorLineCommand({ + inSelectionMode: false, + id: "lastCursorLineSelect", + precondition: void 0 + })); + CoreNavigationCommands2.LastCursorLineSelectDrag = registerEditorCommand(new LastCursorLineCommand({ + inSelectionMode: true, + id: "lastCursorLineSelectDrag", + precondition: void 0 + })); + CoreNavigationCommands2.CancelSelection = registerEditorCommand(new class extends CoreEditorCommand { + constructor() { + super({ + id: "cancelSelection", + precondition: EditorContextKeys.hasNonEmptySelection, + kbOpts: { + weight: CORE_WEIGHT, + kbExpr: EditorContextKeys.textInputFocus, + primary: 9, + secondary: [ + 1024 | 9 + /* KeyCode.Escape */ + ] + } + }); + } + runCoreEditorCommand(viewModel, args) { + viewModel.model.pushStackElement(); + viewModel.setCursorStates(args.source, 3, [ + CursorMoveCommands.cancelSelection(viewModel, viewModel.getPrimaryCursorState()) + ]); + viewModel.revealAllCursors(args.source, true); + } + }()); + CoreNavigationCommands2.RemoveSecondaryCursors = registerEditorCommand(new class extends CoreEditorCommand { + constructor() { + super({ + id: "removeSecondaryCursors", + precondition: EditorContextKeys.hasMultipleSelections, + kbOpts: { + weight: CORE_WEIGHT + 1, + kbExpr: EditorContextKeys.textInputFocus, + primary: 9, + secondary: [ + 1024 | 9 + /* KeyCode.Escape */ + ] + } + }); + } + runCoreEditorCommand(viewModel, args) { + viewModel.model.pushStackElement(); + viewModel.setCursorStates(args.source, 3, [ + viewModel.getPrimaryCursorState() + ]); + viewModel.revealAllCursors(args.source, true); + status(localize(68, "Removed secondary cursors")); + } + }()); + CoreNavigationCommands2.RevealLine = registerEditorCommand(new class extends CoreEditorCommand { + constructor() { + super({ + id: "revealLine", + precondition: void 0, + metadata: RevealLine_.metadata + }); + } + runCoreEditorCommand(viewModel, args) { + const revealLineArg = args; + const lineNumberArg = revealLineArg.lineNumber || 0; + let lineNumber = typeof lineNumberArg === "number" ? lineNumberArg + 1 : parseInt(lineNumberArg) + 1; + if (lineNumber < 1) { + lineNumber = 1; + } + const lineCount = viewModel.model.getLineCount(); + if (lineNumber > lineCount) { + lineNumber = lineCount; + } + const range2 = new Range(lineNumber, 1, lineNumber, viewModel.model.getLineMaxColumn(lineNumber)); + let revealAt = 0; + if (revealLineArg.at) { + switch (revealLineArg.at) { + case RevealLine_.RawAtArgument.Top: + revealAt = 3; + break; + case RevealLine_.RawAtArgument.Center: + revealAt = 1; + break; + case RevealLine_.RawAtArgument.Bottom: + revealAt = 4; + break; + default: + break; + } + } + const viewRange = viewModel.coordinatesConverter.convertModelRangeToViewRange(range2); + viewModel.revealRange( + args.source, + false, + viewRange, + revealAt, + 0 + /* ScrollType.Smooth */ + ); + } + }()); + CoreNavigationCommands2.SelectAll = new class extends EditorOrNativeTextInputCommand { + constructor() { + super(SelectAllCommand); + } + runDOMCommand(activeElement) { + if (isFirefox) { + activeElement.focus(); + activeElement.select(); + } + activeElement.ownerDocument.execCommand("selectAll"); + } + runEditorCommand(accessor, editor2, args) { + const viewModel = editor2._getViewModel(); + if (!viewModel) { + return; + } + this.runCoreEditorCommand(viewModel, args); + } + runCoreEditorCommand(viewModel, args) { + viewModel.model.pushStackElement(); + viewModel.setCursorStates("keyboard", 3, [ + CursorMoveCommands.selectAll(viewModel, viewModel.getPrimaryCursorState()) + ]); + } + }(); + CoreNavigationCommands2.SetSelection = registerEditorCommand(new class extends CoreEditorCommand { + constructor() { + super({ + id: "setSelection", + precondition: void 0 + }); + } + runCoreEditorCommand(viewModel, args) { + if (!args.selection) { + return; + } + viewModel.model.pushStackElement(); + viewModel.setCursorStates(args.source, 3, [ + CursorState.fromModelSelection(args.selection) + ]); + } + }()); +})(CoreNavigationCommands || (CoreNavigationCommands = {})); +var columnSelectionCondition = ContextKeyExpr.and(EditorContextKeys.textInputFocus, EditorContextKeys.columnSelection); +function registerColumnSelection(id, keybinding) { + KeybindingsRegistry.registerKeybindingRule({ + id, + primary: keybinding, + when: columnSelectionCondition, + weight: CORE_WEIGHT + 1 + }); +} +registerColumnSelection( + CoreNavigationCommands.CursorColumnSelectLeft.id, + 1024 | 15 + /* KeyCode.LeftArrow */ +); +registerColumnSelection( + CoreNavigationCommands.CursorColumnSelectRight.id, + 1024 | 17 + /* KeyCode.RightArrow */ +); +registerColumnSelection( + CoreNavigationCommands.CursorColumnSelectUp.id, + 1024 | 16 + /* KeyCode.UpArrow */ +); +registerColumnSelection( + CoreNavigationCommands.CursorColumnSelectPageUp.id, + 1024 | 11 + /* KeyCode.PageUp */ +); +registerColumnSelection( + CoreNavigationCommands.CursorColumnSelectDown.id, + 1024 | 18 + /* KeyCode.DownArrow */ +); +registerColumnSelection( + CoreNavigationCommands.CursorColumnSelectPageDown.id, + 1024 | 12 + /* KeyCode.PageDown */ +); +function registerCommand2(command) { + command.register(); + return command; +} +var CoreEditingCommands; +(function(CoreEditingCommands2) { + class CoreEditingCommand extends EditorCommand { + runEditorCommand(accessor, editor2, args) { + const viewModel = editor2._getViewModel(); + if (!viewModel) { + return; + } + this.runCoreEditingCommand(editor2, viewModel, args || {}); + } + } + CoreEditingCommands2.CoreEditingCommand = CoreEditingCommand; + CoreEditingCommands2.LineBreakInsert = registerEditorCommand(new class extends CoreEditingCommand { + constructor() { + super({ + id: "lineBreakInsert", + precondition: EditorContextKeys.writable, + kbOpts: { + weight: CORE_WEIGHT, + kbExpr: EditorContextKeys.textInputFocus, + primary: 0, + mac: { + primary: 256 | 45 + /* KeyCode.KeyO */ + } + } + }); + } + runCoreEditingCommand(editor2, viewModel, args) { + editor2.pushUndoStop(); + editor2.executeCommands(this.id, EnterOperation.lineBreakInsert(viewModel.cursorConfig, viewModel.model, viewModel.getCursorStates().map((s) => s.modelState.selection))); + } + }()); + CoreEditingCommands2.Outdent = registerEditorCommand(new class extends CoreEditingCommand { + constructor() { + super({ + id: "outdent", + precondition: EditorContextKeys.writable, + kbOpts: { + weight: CORE_WEIGHT, + kbExpr: ContextKeyExpr.and(EditorContextKeys.editorTextFocus, EditorContextKeys.tabDoesNotMoveFocus), + primary: 1024 | 2 + /* KeyCode.Tab */ + } + }); + } + runCoreEditingCommand(editor2, viewModel, args) { + editor2.pushUndoStop(); + editor2.executeCommands(this.id, TypeOperations.outdent(viewModel.cursorConfig, viewModel.model, viewModel.getCursorStates().map((s) => s.modelState.selection))); + editor2.pushUndoStop(); + } + }()); + CoreEditingCommands2.Tab = registerEditorCommand(new class extends CoreEditingCommand { + constructor() { + super({ + id: "tab", + precondition: EditorContextKeys.writable, + kbOpts: { + weight: CORE_WEIGHT, + kbExpr: ContextKeyExpr.and(EditorContextKeys.editorTextFocus, EditorContextKeys.tabDoesNotMoveFocus), + primary: 2 + /* KeyCode.Tab */ + } + }); + } + runCoreEditingCommand(editor2, viewModel, args) { + editor2.pushUndoStop(); + editor2.executeCommands(this.id, TypeOperations.tab(viewModel.cursorConfig, viewModel.model, viewModel.getCursorStates().map((s) => s.modelState.selection))); + editor2.pushUndoStop(); + } + }()); + CoreEditingCommands2.DeleteLeft = registerEditorCommand(new class extends CoreEditingCommand { + constructor() { + super({ + id: "deleteLeft", + precondition: void 0, + kbOpts: { + weight: CORE_WEIGHT, + kbExpr: EditorContextKeys.textInputFocus, + primary: 1, + secondary: [ + 1024 | 1 + /* KeyCode.Backspace */ + ], + mac: { primary: 1, secondary: [ + 1024 | 1, + 256 | 38, + 256 | 1 + /* KeyCode.Backspace */ + ] } + } + }); + } + runCoreEditingCommand(editor2, viewModel, args) { + const [shouldPushStackElementBefore, commands] = DeleteOperations.deleteLeft(viewModel.getPrevEditOperationType(), viewModel.cursorConfig, viewModel.model, viewModel.getCursorStates().map((s) => s.modelState.selection), viewModel.getCursorAutoClosedCharacters()); + if (shouldPushStackElementBefore) { + editor2.pushUndoStop(); + } + editor2.executeCommands(this.id, commands); + viewModel.setPrevEditOperationType( + 2 + /* EditOperationType.DeletingLeft */ + ); + } + }()); + CoreEditingCommands2.DeleteRight = registerEditorCommand(new class extends CoreEditingCommand { + constructor() { + super({ + id: "deleteRight", + precondition: void 0, + kbOpts: { + weight: CORE_WEIGHT, + kbExpr: EditorContextKeys.textInputFocus, + primary: 20, + mac: { primary: 20, secondary: [ + 256 | 34, + 256 | 20 + /* KeyCode.Delete */ + ] } + } + }); + } + runCoreEditingCommand(editor2, viewModel, args) { + const [shouldPushStackElementBefore, commands] = DeleteOperations.deleteRight(viewModel.getPrevEditOperationType(), viewModel.cursorConfig, viewModel.model, viewModel.getCursorStates().map((s) => s.modelState.selection)); + if (shouldPushStackElementBefore) { + editor2.pushUndoStop(); + } + editor2.executeCommands(this.id, commands); + viewModel.setPrevEditOperationType( + 3 + /* EditOperationType.DeletingRight */ + ); + } + }()); + CoreEditingCommands2.Undo = new class extends EditorOrNativeTextInputCommand { + constructor() { + super(UndoCommand); + } + runDOMCommand(activeElement) { + activeElement.ownerDocument.execCommand("undo"); + } + runEditorCommand(accessor, editor2, args) { + if (!editor2.hasModel() || editor2.getOption( + 104 + /* EditorOption.readOnly */ + ) === true) { + return; + } + return editor2.getModel().undo(); + } + }(); + CoreEditingCommands2.Redo = new class extends EditorOrNativeTextInputCommand { + constructor() { + super(RedoCommand); + } + runDOMCommand(activeElement) { + activeElement.ownerDocument.execCommand("redo"); + } + runEditorCommand(accessor, editor2, args) { + if (!editor2.hasModel() || editor2.getOption( + 104 + /* EditorOption.readOnly */ + ) === true) { + return; + } + return editor2.getModel().redo(); + } + }(); +})(CoreEditingCommands || (CoreEditingCommands = {})); +var EditorHandlerCommand = class extends Command { + constructor(id, handlerId, metadata) { + super({ + id, + precondition: void 0, + metadata + }); + this._handlerId = handlerId; + } + runCommand(accessor, args) { + const editor2 = accessor.get(ICodeEditorService).getFocusedCodeEditor(); + if (!editor2) { + return; + } + editor2.trigger("keyboard", this._handlerId, args); + } +}; +function registerOverwritableCommand(handlerId, metadata) { + registerCommand2(new EditorHandlerCommand("default:" + handlerId, handlerId)); + registerCommand2(new EditorHandlerCommand(handlerId, handlerId, metadata)); +} +registerOverwritableCommand("type", { + description: `Type`, + args: [{ + name: "args", + schema: { + "type": "object", + "required": ["text"], + "properties": { + "text": { + "type": "string" + } + } + } + }] +}); +registerOverwritableCommand( + "replacePreviousChar" + /* Handler.ReplacePreviousChar */ +); +registerOverwritableCommand( + "compositionType" + /* Handler.CompositionType */ +); +registerOverwritableCommand( + "compositionStart" + /* Handler.CompositionStart */ +); +registerOverwritableCommand( + "compositionEnd" + /* Handler.CompositionEnd */ +); +registerOverwritableCommand( + "paste" + /* Handler.Paste */ +); +registerOverwritableCommand( + "cut" + /* Handler.Cut */ +); + +// node_modules/monaco-editor-core/esm/vs/editor/common/services/markerDecorations.js +init_instantiation(); +var IMarkerDecorationsService = createDecorator("markerDecorationsService"); + +// node_modules/monaco-editor-core/esm/vs/editor/browser/services/markerDecorations.js +init_editorExtensions(); +var __decorate4 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param4 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var MarkerDecorationsContribution = class MarkerDecorationsContribution2 { + static { + this.ID = "editor.contrib.markerDecorations"; + } + constructor(_editor, _markerDecorationsService) { + } + dispose() { + } +}; +MarkerDecorationsContribution = __decorate4([ + __param4(1, IMarkerDecorationsService) +], MarkerDecorationsContribution); +registerEditorContribution( + MarkerDecorationsContribution.ID, + MarkerDecorationsContribution, + 0 + /* EditorContributionInstantiation.Eager */ +); + +// node_modules/monaco-editor-core/esm/vs/editor/browser/widget/codeEditor/codeEditorWidget.js +init_dom(); +init_errors(); +init_event(); +init_lifecycle(); +init_network(); + +// node_modules/monaco-editor-core/esm/vs/base/browser/fastDomNode.js +var FastDomNode = class { + constructor(domNode) { + this.domNode = domNode; + this._maxWidth = ""; + this._width = ""; + this._height = ""; + this._top = ""; + this._left = ""; + this._bottom = ""; + this._right = ""; + this._paddingLeft = ""; + this._fontFamily = ""; + this._fontWeight = ""; + this._fontSize = ""; + this._fontStyle = ""; + this._fontFeatureSettings = ""; + this._fontVariationSettings = ""; + this._textDecoration = ""; + this._lineHeight = ""; + this._letterSpacing = ""; + this._className = ""; + this._display = ""; + this._position = ""; + this._visibility = ""; + this._color = ""; + this._backgroundColor = ""; + this._layerHint = false; + this._contain = "none"; + this._boxShadow = ""; + } + focus() { + this.domNode.focus(); + } + setMaxWidth(_maxWidth) { + const maxWidth = numberAsPixels(_maxWidth); + if (this._maxWidth === maxWidth) { + return; + } + this._maxWidth = maxWidth; + this.domNode.style.maxWidth = this._maxWidth; + } + setWidth(_width) { + const width2 = numberAsPixels(_width); + if (this._width === width2) { + return; + } + this._width = width2; + this.domNode.style.width = this._width; + } + setHeight(_height) { + const height = numberAsPixels(_height); + if (this._height === height) { + return; + } + this._height = height; + this.domNode.style.height = this._height; + } + setTop(_top) { + const top = numberAsPixels(_top); + if (this._top === top) { + return; + } + this._top = top; + this.domNode.style.top = this._top; + } + setLeft(_left) { + const left = numberAsPixels(_left); + if (this._left === left) { + return; + } + this._left = left; + this.domNode.style.left = this._left; + } + setBottom(_bottom) { + const bottom = numberAsPixels(_bottom); + if (this._bottom === bottom) { + return; + } + this._bottom = bottom; + this.domNode.style.bottom = this._bottom; + } + setRight(_right) { + const right = numberAsPixels(_right); + if (this._right === right) { + return; + } + this._right = right; + this.domNode.style.right = this._right; + } + setPaddingLeft(_paddingLeft) { + const paddingLeft = numberAsPixels(_paddingLeft); + if (this._paddingLeft === paddingLeft) { + return; + } + this._paddingLeft = paddingLeft; + this.domNode.style.paddingLeft = this._paddingLeft; + } + setFontFamily(fontFamily) { + if (this._fontFamily === fontFamily) { + return; + } + this._fontFamily = fontFamily; + this.domNode.style.fontFamily = this._fontFamily; + } + setFontWeight(fontWeight) { + if (this._fontWeight === fontWeight) { + return; + } + this._fontWeight = fontWeight; + this.domNode.style.fontWeight = this._fontWeight; + } + setFontSize(_fontSize) { + const fontSize = numberAsPixels(_fontSize); + if (this._fontSize === fontSize) { + return; + } + this._fontSize = fontSize; + this.domNode.style.fontSize = this._fontSize; + } + setFontStyle(fontStyle) { + if (this._fontStyle === fontStyle) { + return; + } + this._fontStyle = fontStyle; + this.domNode.style.fontStyle = this._fontStyle; + } + setFontFeatureSettings(fontFeatureSettings) { + if (this._fontFeatureSettings === fontFeatureSettings) { + return; + } + this._fontFeatureSettings = fontFeatureSettings; + this.domNode.style.fontFeatureSettings = this._fontFeatureSettings; + } + setFontVariationSettings(fontVariationSettings) { + if (this._fontVariationSettings === fontVariationSettings) { + return; + } + this._fontVariationSettings = fontVariationSettings; + this.domNode.style.fontVariationSettings = this._fontVariationSettings; + } + setTextDecoration(textDecoration) { + if (this._textDecoration === textDecoration) { + return; + } + this._textDecoration = textDecoration; + this.domNode.style.textDecoration = this._textDecoration; + } + setLineHeight(_lineHeight) { + const lineHeight = numberAsPixels(_lineHeight); + if (this._lineHeight === lineHeight) { + return; + } + this._lineHeight = lineHeight; + this.domNode.style.lineHeight = this._lineHeight; + } + setLetterSpacing(_letterSpacing) { + const letterSpacing = numberAsPixels(_letterSpacing); + if (this._letterSpacing === letterSpacing) { + return; + } + this._letterSpacing = letterSpacing; + this.domNode.style.letterSpacing = this._letterSpacing; + } + setClassName(className2) { + if (this._className === className2) { + return; + } + this._className = className2; + this.domNode.className = this._className; + } + toggleClassName(className2, shouldHaveIt) { + this.domNode.classList.toggle(className2, shouldHaveIt); + this._className = this.domNode.className; + } + setDisplay(display) { + if (this._display === display) { + return; + } + this._display = display; + this.domNode.style.display = this._display; + } + setPosition(position) { + if (this._position === position) { + return; + } + this._position = position; + this.domNode.style.position = this._position; + } + setVisibility(visibility) { + if (this._visibility === visibility) { + return; + } + this._visibility = visibility; + this.domNode.style.visibility = this._visibility; + } + setColor(color) { + if (this._color === color) { + return; + } + this._color = color; + this.domNode.style.color = this._color; + } + setBackgroundColor(backgroundColor) { + if (this._backgroundColor === backgroundColor) { + return; + } + this._backgroundColor = backgroundColor; + this.domNode.style.backgroundColor = this._backgroundColor; + } + setLayerHinting(layerHint) { + if (this._layerHint === layerHint) { + return; + } + this._layerHint = layerHint; + this.domNode.style.transform = this._layerHint ? "translate3d(0px, 0px, 0px)" : ""; + } + setBoxShadow(boxShadow) { + if (this._boxShadow === boxShadow) { + return; + } + this._boxShadow = boxShadow; + this.domNode.style.boxShadow = boxShadow; + } + setContain(contain) { + if (this._contain === contain) { + return; + } + this._contain = contain; + this.domNode.style.contain = this._contain; + } + setAttribute(name, value) { + this.domNode.setAttribute(name, value); + } + removeAttribute(name) { + this.domNode.removeAttribute(name); + } + appendChild(child) { + this.domNode.appendChild(child.domNode); + } + removeChild(child) { + this.domNode.removeChild(child.domNode); + } +}; +function numberAsPixels(value) { + return typeof value === "number" ? `${value}px` : value; +} +function createFastDomNode(domNode) { + return new FastDomNode(domNode); +} + +// node_modules/monaco-editor-core/esm/vs/editor/browser/config/domFontInfo.js +function applyFontInfo(domNode, fontInfo) { + if (domNode instanceof FastDomNode) { + domNode.setFontFamily(fontInfo.getMassagedFontFamily()); + domNode.setFontWeight(fontInfo.fontWeight); + domNode.setFontSize(fontInfo.fontSize); + domNode.setFontFeatureSettings(fontInfo.fontFeatureSettings); + domNode.setFontVariationSettings(fontInfo.fontVariationSettings); + domNode.setLineHeight(fontInfo.lineHeight); + domNode.setLetterSpacing(fontInfo.letterSpacing); + } else { + domNode.style.fontFamily = fontInfo.getMassagedFontFamily(); + domNode.style.fontWeight = fontInfo.fontWeight; + domNode.style.fontSize = fontInfo.fontSize + "px"; + domNode.style.fontFeatureSettings = fontInfo.fontFeatureSettings; + domNode.style.fontVariationSettings = fontInfo.fontVariationSettings; + domNode.style.lineHeight = fontInfo.lineHeight + "px"; + domNode.style.letterSpacing = fontInfo.letterSpacing + "px"; + } +} + +// node_modules/monaco-editor-core/esm/vs/editor/browser/config/editorConfiguration.js +init_browser(); +init_arrays(); +init_event(); +init_lifecycle(); +init_objects(); +init_platform(); +init_elementSizeObserver(); + +// node_modules/monaco-editor-core/esm/vs/editor/browser/config/fontMeasurements.js +init_dom(); + +// node_modules/monaco-editor-core/esm/vs/base/browser/pixelRatio.js +init_dom(); +init_event(); +init_lifecycle(); +var DevicePixelRatioMonitor = class extends Disposable { + constructor(targetWindow) { + super(); + this._onDidChange = this._register(new Emitter()); + this.onDidChange = this._onDidChange.event; + this._listener = () => this._handleChange(targetWindow, true); + this._mediaQueryList = null; + this._handleChange(targetWindow, false); + } + _handleChange(targetWindow, fireEvent) { + this._mediaQueryList?.removeEventListener("change", this._listener); + this._mediaQueryList = targetWindow.matchMedia(`(resolution: ${targetWindow.devicePixelRatio}dppx)`); + this._mediaQueryList.addEventListener("change", this._listener); + if (fireEvent) { + this._onDidChange.fire(); + } + } +}; +var PixelRatioMonitorImpl = class extends Disposable { + get value() { + return this._value; + } + constructor(targetWindow) { + super(); + this._onDidChange = this._register(new Emitter()); + this.onDidChange = this._onDidChange.event; + this._value = this._getPixelRatio(targetWindow); + const dprMonitor = this._register(new DevicePixelRatioMonitor(targetWindow)); + this._register(dprMonitor.onDidChange(() => { + this._value = this._getPixelRatio(targetWindow); + this._onDidChange.fire(this._value); + })); + } + _getPixelRatio(targetWindow) { + const ctx = document.createElement("canvas").getContext("2d"); + const dpr = targetWindow.devicePixelRatio || 1; + const bsr = ctx.webkitBackingStorePixelRatio || ctx.mozBackingStorePixelRatio || ctx.msBackingStorePixelRatio || ctx.oBackingStorePixelRatio || ctx.backingStorePixelRatio || 1; + return dpr / bsr; + } +}; +var PixelRatioMonitorFacade = class { + constructor() { + this.mapWindowIdToPixelRatioMonitor = /* @__PURE__ */ new Map(); + } + _getOrCreatePixelRatioMonitor(targetWindow) { + const targetWindowId = getWindowId(targetWindow); + let pixelRatioMonitor = this.mapWindowIdToPixelRatioMonitor.get(targetWindowId); + if (!pixelRatioMonitor) { + pixelRatioMonitor = markAsSingleton(new PixelRatioMonitorImpl(targetWindow)); + this.mapWindowIdToPixelRatioMonitor.set(targetWindowId, pixelRatioMonitor); + markAsSingleton(Event.once(onDidUnregisterWindow)(({ vscodeWindowId }) => { + if (vscodeWindowId === targetWindowId) { + pixelRatioMonitor?.dispose(); + this.mapWindowIdToPixelRatioMonitor.delete(targetWindowId); + } + })); + } + return pixelRatioMonitor; + } + getInstance(targetWindow) { + return this._getOrCreatePixelRatioMonitor(targetWindow); + } +}; +var PixelRatio = new PixelRatioMonitorFacade(); + +// node_modules/monaco-editor-core/esm/vs/editor/browser/config/fontMeasurements.js +init_event(); +init_lifecycle(); + +// node_modules/monaco-editor-core/esm/vs/editor/browser/config/charWidthReader.js +var CharWidthRequest = class { + constructor(chr, type) { + this.chr = chr; + this.type = type; + this.width = 0; + } + fulfill(width2) { + this.width = width2; + } +}; +var DomCharWidthReader = class _DomCharWidthReader { + constructor(bareFontInfo, requests) { + this._bareFontInfo = bareFontInfo; + this._requests = requests; + this._container = null; + this._testElements = null; + } + read(targetWindow) { + this._createDomElements(); + targetWindow.document.body.appendChild(this._container); + this._readFromDomElements(); + this._container?.remove(); + this._container = null; + this._testElements = null; + } + _createDomElements() { + const container = document.createElement("div"); + container.style.position = "absolute"; + container.style.top = "-50000px"; + container.style.width = "50000px"; + const regularDomNode = document.createElement("div"); + applyFontInfo(regularDomNode, this._bareFontInfo); + container.appendChild(regularDomNode); + const boldDomNode = document.createElement("div"); + applyFontInfo(boldDomNode, this._bareFontInfo); + boldDomNode.style.fontWeight = "bold"; + container.appendChild(boldDomNode); + const italicDomNode = document.createElement("div"); + applyFontInfo(italicDomNode, this._bareFontInfo); + italicDomNode.style.fontStyle = "italic"; + container.appendChild(italicDomNode); + const testElements = []; + for (const request of this._requests) { + let parent; + if (request.type === 0) { + parent = regularDomNode; + } + if (request.type === 2) { + parent = boldDomNode; + } + if (request.type === 1) { + parent = italicDomNode; + } + parent.appendChild(document.createElement("br")); + const testElement = document.createElement("span"); + _DomCharWidthReader._render(testElement, request); + parent.appendChild(testElement); + testElements.push(testElement); + } + this._container = container; + this._testElements = testElements; + } + static _render(testElement, request) { + if (request.chr === " ") { + let htmlString = "\xA0"; + for (let i2 = 0; i2 < 8; i2++) { + htmlString += htmlString; + } + testElement.innerText = htmlString; + } else { + let testString = request.chr; + for (let i2 = 0; i2 < 8; i2++) { + testString += testString; + } + testElement.textContent = testString; + } + } + _readFromDomElements() { + for (let i2 = 0, len = this._requests.length; i2 < len; i2++) { + const request = this._requests[i2]; + const testElement = this._testElements[i2]; + request.fulfill(testElement.offsetWidth / 256); + } + } +}; +function readCharWidths(targetWindow, bareFontInfo, requests) { + const reader = new DomCharWidthReader(bareFontInfo, requests); + reader.read(targetWindow); +} + +// node_modules/monaco-editor-core/esm/vs/editor/common/config/editorOptions.js +init_arrays(); +init_objects(); +init_platform(); + +// node_modules/monaco-editor-core/esm/vs/editor/common/config/fontInfo.js +init_platform(); + +// node_modules/monaco-editor-core/esm/vs/editor/common/config/editorZoom.js +init_event(); +var EditorZoom = new class { + constructor() { + this._zoomLevel = 0; + this._onDidChangeZoomLevel = new Emitter(); + this.onDidChangeZoomLevel = this._onDidChangeZoomLevel.event; + } + getZoomLevel() { + return this._zoomLevel; + } + setZoomLevel(zoomLevel) { + zoomLevel = Math.min(Math.max(-5, zoomLevel), 20); + if (this._zoomLevel === zoomLevel) { + return; + } + this._zoomLevel = zoomLevel; + this._onDidChangeZoomLevel.fire(this._zoomLevel); + } +}(); + +// node_modules/monaco-editor-core/esm/vs/editor/common/config/fontInfo.js +var GOLDEN_LINE_HEIGHT_RATIO = isMacintosh ? 1.5 : 1.35; +var MINIMUM_LINE_HEIGHT = 8; +var BareFontInfo = class _BareFontInfo { + /** + * @internal + */ + static _create(fontFamily, fontWeight, fontSize, fontFeatureSettings, fontVariationSettings, lineHeight, letterSpacing, pixelRatio, ignoreEditorZoom) { + if (lineHeight === 0) { + lineHeight = GOLDEN_LINE_HEIGHT_RATIO * fontSize; + } else if (lineHeight < MINIMUM_LINE_HEIGHT) { + lineHeight = lineHeight * fontSize; + } + lineHeight = Math.round(lineHeight); + if (lineHeight < MINIMUM_LINE_HEIGHT) { + lineHeight = MINIMUM_LINE_HEIGHT; + } + const editorZoomLevelMultiplier = 1 + (ignoreEditorZoom ? 0 : EditorZoom.getZoomLevel() * 0.1); + fontSize *= editorZoomLevelMultiplier; + lineHeight *= editorZoomLevelMultiplier; + if (fontVariationSettings === FONT_VARIATION_TRANSLATE) { + if (fontWeight === "normal" || fontWeight === "bold") { + fontVariationSettings = FONT_VARIATION_OFF; + } else { + const fontWeightAsNumber = parseInt(fontWeight, 10); + fontVariationSettings = `'wght' ${fontWeightAsNumber}`; + fontWeight = "normal"; + } + } + return new _BareFontInfo({ + pixelRatio, + fontFamily, + fontWeight, + fontSize, + fontFeatureSettings, + fontVariationSettings, + lineHeight, + letterSpacing + }); + } + /** + * @internal + */ + constructor(opts) { + this._bareFontInfoBrand = void 0; + this.pixelRatio = opts.pixelRatio; + this.fontFamily = String(opts.fontFamily); + this.fontWeight = String(opts.fontWeight); + this.fontSize = opts.fontSize; + this.fontFeatureSettings = opts.fontFeatureSettings; + this.fontVariationSettings = opts.fontVariationSettings; + this.lineHeight = opts.lineHeight | 0; + this.letterSpacing = opts.letterSpacing; + } + /** + * @internal + */ + getId() { + return `${this.pixelRatio}-${this.fontFamily}-${this.fontWeight}-${this.fontSize}-${this.fontFeatureSettings}-${this.fontVariationSettings}-${this.lineHeight}-${this.letterSpacing}`; + } + /** + * @internal + */ + getMassagedFontFamily() { + const fallbackFontFamily = EDITOR_FONT_DEFAULTS.fontFamily; + const fontFamily = _BareFontInfo._wrapInQuotes(this.fontFamily); + if (fallbackFontFamily && this.fontFamily !== fallbackFontFamily) { + return `${fontFamily}, ${fallbackFontFamily}`; + } + return fontFamily; + } + static _wrapInQuotes(fontFamily) { + if (/[,"']/.test(fontFamily)) { + return fontFamily; + } + if (/[+ ]/.test(fontFamily)) { + return `"${fontFamily}"`; + } + return fontFamily; + } +}; +var SERIALIZED_FONT_INFO_VERSION = 2; +var FontInfo = class extends BareFontInfo { + /** + * @internal + */ + constructor(opts, isTrusted) { + super(opts); + this._editorStylingBrand = void 0; + this.version = SERIALIZED_FONT_INFO_VERSION; + this.isTrusted = isTrusted; + this.isMonospace = opts.isMonospace; + this.typicalHalfwidthCharacterWidth = opts.typicalHalfwidthCharacterWidth; + this.typicalFullwidthCharacterWidth = opts.typicalFullwidthCharacterWidth; + this.canUseHalfwidthRightwardsArrow = opts.canUseHalfwidthRightwardsArrow; + this.spaceWidth = opts.spaceWidth; + this.middotWidth = opts.middotWidth; + this.wsmiddotWidth = opts.wsmiddotWidth; + this.maxDigitWidth = opts.maxDigitWidth; + } + /** + * @internal + */ + equals(other) { + return this.fontFamily === other.fontFamily && this.fontWeight === other.fontWeight && this.fontSize === other.fontSize && this.fontFeatureSettings === other.fontFeatureSettings && this.fontVariationSettings === other.fontVariationSettings && this.lineHeight === other.lineHeight && this.letterSpacing === other.letterSpacing && this.typicalHalfwidthCharacterWidth === other.typicalHalfwidthCharacterWidth && this.typicalFullwidthCharacterWidth === other.typicalFullwidthCharacterWidth && this.canUseHalfwidthRightwardsArrow === other.canUseHalfwidthRightwardsArrow && this.spaceWidth === other.spaceWidth && this.middotWidth === other.middotWidth && this.wsmiddotWidth === other.wsmiddotWidth && this.maxDigitWidth === other.maxDigitWidth; + } +}; +var FONT_VARIATION_OFF = "normal"; +var FONT_VARIATION_TRANSLATE = "translate"; +var DEFAULT_WINDOWS_FONT_FAMILY = "Consolas, 'Courier New', monospace"; +var DEFAULT_MAC_FONT_FAMILY = "Menlo, Monaco, 'Courier New', monospace"; +var DEFAULT_LINUX_FONT_FAMILY = "'Droid Sans Mono', 'monospace', monospace"; +var EDITOR_FONT_DEFAULTS = { + fontFamily: isMacintosh ? DEFAULT_MAC_FONT_FAMILY : isWindows ? DEFAULT_WINDOWS_FONT_FAMILY : DEFAULT_LINUX_FONT_FAMILY, + fontWeight: "normal", + fontSize: isMacintosh ? 12 : 14, + lineHeight: 0, + letterSpacing: 0 +}; + +// node_modules/monaco-editor-core/esm/vs/editor/common/config/editorOptions.js +init_textModelDefaults(); +init_wordHelper(); +init_nls(); +var MINIMAP_GUTTER_WIDTH = 8; +var ConfigurationChangedEvent = class { + /** + * @internal + */ + constructor(values) { + this._values = values; + } + hasChanged(id) { + return this._values[id]; + } +}; +var ComputeOptionsMemory = class { + constructor() { + this.stableMinimapLayoutInput = null; + this.stableFitMaxMinimapScale = 0; + this.stableFitRemainingWidth = 0; + } +}; +var BaseEditorOption = class { + constructor(id, name, defaultValue, schema) { + this.id = id; + this.name = name; + this.defaultValue = defaultValue; + this.schema = schema; + } + applyUpdate(value, update) { + return applyUpdate(value, update); + } + compute(env2, options2, value) { + return value; + } +}; +var ApplyUpdateResult = class { + constructor(newValue, didChange) { + this.newValue = newValue; + this.didChange = didChange; + } +}; +function applyUpdate(value, update) { + if (typeof value !== "object" || typeof update !== "object" || !value || !update) { + return new ApplyUpdateResult(update, value !== update); + } + if (Array.isArray(value) || Array.isArray(update)) { + const arrayEquals = Array.isArray(value) && Array.isArray(update) && equals(value, update); + return new ApplyUpdateResult(update, !arrayEquals); + } + let didChange = false; + for (const key in update) { + if (update.hasOwnProperty(key)) { + const result = applyUpdate(value[key], update[key]); + if (result.didChange) { + value[key] = result.newValue; + didChange = true; + } + } + } + return new ApplyUpdateResult(value, didChange); +} +var ComputedEditorOption = class { + constructor(id, defaultValue) { + this.schema = void 0; + this.id = id; + this.name = "_never_"; + this.defaultValue = defaultValue; + } + applyUpdate(value, update) { + return applyUpdate(value, update); + } + validate(input) { + return this.defaultValue; + } +}; +var SimpleEditorOption = class { + constructor(id, name, defaultValue, schema) { + this.id = id; + this.name = name; + this.defaultValue = defaultValue; + this.schema = schema; + } + applyUpdate(value, update) { + return applyUpdate(value, update); + } + compute(env2, options2, value) { + return value; + } +}; +function boolean(value, defaultValue) { + if (typeof value === "undefined") { + return defaultValue; + } + if (value === "false") { + return false; + } + return Boolean(value); +} +var EditorBooleanOption = class extends SimpleEditorOption { + constructor(id, name, defaultValue, schema = void 0) { + if (typeof schema !== "undefined") { + schema.type = "boolean"; + schema.default = defaultValue; + } + super(id, name, defaultValue, schema); + } + validate(input) { + return boolean(input, this.defaultValue); + } +}; +function clampedInt(value, defaultValue, minimum, maximum) { + if (typeof value === "string") { + value = parseInt(value, 10); + } + if (typeof value !== "number" || isNaN(value)) { + return defaultValue; + } + let r = value; + r = Math.max(minimum, r); + r = Math.min(maximum, r); + return r | 0; +} +var EditorIntOption = class _EditorIntOption extends SimpleEditorOption { + static clampedInt(value, defaultValue, minimum, maximum) { + return clampedInt(value, defaultValue, minimum, maximum); + } + constructor(id, name, defaultValue, minimum, maximum, schema = void 0) { + if (typeof schema !== "undefined") { + schema.type = "integer"; + schema.default = defaultValue; + schema.minimum = minimum; + schema.maximum = maximum; + } + super(id, name, defaultValue, schema); + this.minimum = minimum; + this.maximum = maximum; + } + validate(input) { + return _EditorIntOption.clampedInt(input, this.defaultValue, this.minimum, this.maximum); + } +}; +function clampedFloat(value, defaultValue, minimum, maximum) { + if (typeof value === "undefined") { + return defaultValue; + } + const r = EditorFloatOption.float(value, defaultValue); + return EditorFloatOption.clamp(r, minimum, maximum); +} +var EditorFloatOption = class _EditorFloatOption extends SimpleEditorOption { + static clamp(n2, min, max) { + if (n2 < min) { + return min; + } + if (n2 > max) { + return max; + } + return n2; + } + static float(value, defaultValue) { + if (typeof value === "string") { + value = parseFloat(value); + } + if (typeof value !== "number" || isNaN(value)) { + return defaultValue; + } + return value; + } + constructor(id, name, defaultValue, validationFn, schema, minimum, maximum) { + if (typeof schema !== "undefined") { + schema.type = "number"; + schema.default = defaultValue; + schema.minimum = minimum; + schema.maximum = maximum; + } + super(id, name, defaultValue, schema); + this.validationFn = validationFn; + this.minimum = minimum; + this.maximum = maximum; + } + validate(input) { + return this.validationFn(_EditorFloatOption.float(input, this.defaultValue)); + } +}; +var EditorStringOption = class _EditorStringOption extends SimpleEditorOption { + static string(value, defaultValue) { + if (typeof value !== "string") { + return defaultValue; + } + return value; + } + constructor(id, name, defaultValue, schema = void 0) { + if (typeof schema !== "undefined") { + schema.type = "string"; + schema.default = defaultValue; + } + super(id, name, defaultValue, schema); + } + validate(input) { + return _EditorStringOption.string(input, this.defaultValue); + } +}; +function stringSet(value, defaultValue, allowedValues, renamedValues) { + if (typeof value !== "string") { + return defaultValue; + } + if (renamedValues && value in renamedValues) { + return renamedValues[value]; + } + if (allowedValues.indexOf(value) === -1) { + return defaultValue; + } + return value; +} +var EditorStringEnumOption = class extends SimpleEditorOption { + constructor(id, name, defaultValue, allowedValues, schema = void 0) { + if (typeof schema !== "undefined") { + schema.type = "string"; + schema.enum = allowedValues.slice(0); + schema.default = defaultValue; + } + super(id, name, defaultValue, schema); + this._allowedValues = allowedValues; + } + validate(input) { + return stringSet(input, this.defaultValue, this._allowedValues); + } +}; +var EditorEnumOption = class extends BaseEditorOption { + constructor(id, name, defaultValue, defaultStringValue, allowedValues, convert, schema = void 0) { + if (typeof schema !== "undefined") { + schema.type = "string"; + schema.enum = allowedValues; + schema.default = defaultStringValue; + } + super(id, name, defaultValue, schema); + this._allowedValues = allowedValues; + this._convert = convert; + } + validate(input) { + if (typeof input !== "string") { + return this.defaultValue; + } + if (this._allowedValues.indexOf(input) === -1) { + return this.defaultValue; + } + return this._convert(input); + } +}; +function _autoIndentFromString(autoIndent) { + switch (autoIndent) { + case "none": + return 0; + case "keep": + return 1; + case "brackets": + return 2; + case "advanced": + return 3; + case "full": + return 4; + } +} +var EditorAccessibilitySupport = class extends BaseEditorOption { + constructor() { + super(2, "accessibilitySupport", 0, { + type: "string", + enum: ["auto", "on", "off"], + enumDescriptions: [ + localize(201, "Use platform APIs to detect when a Screen Reader is attached."), + localize(202, "Optimize for usage with a Screen Reader."), + localize(203, "Assume a screen reader is not attached.") + ], + default: "auto", + tags: ["accessibility"], + description: localize(204, "Controls if the UI should run in a mode where it is optimized for screen readers.") + }); + } + validate(input) { + switch (input) { + case "auto": + return 0; + case "off": + return 1; + case "on": + return 2; + } + return this.defaultValue; + } + compute(env2, options2, value) { + if (value === 0) { + return env2.accessibilitySupport; + } + return value; + } +}; +var EditorComments = class extends BaseEditorOption { + constructor() { + const defaults = { + insertSpace: true, + ignoreEmptyLines: true + }; + super(29, "comments", defaults, { + "editor.comments.insertSpace": { + type: "boolean", + default: defaults.insertSpace, + description: localize(205, "Controls whether a space character is inserted when commenting.") + }, + "editor.comments.ignoreEmptyLines": { + type: "boolean", + default: defaults.ignoreEmptyLines, + description: localize(206, "Controls if empty lines should be ignored with toggle, add or remove actions for line comments.") + } + }); + } + validate(_input) { + if (!_input || typeof _input !== "object") { + return this.defaultValue; + } + const input = _input; + return { + insertSpace: boolean(input.insertSpace, this.defaultValue.insertSpace), + ignoreEmptyLines: boolean(input.ignoreEmptyLines, this.defaultValue.ignoreEmptyLines) + }; + } +}; +function cursorBlinkingStyleFromString(cursorBlinkingStyle) { + switch (cursorBlinkingStyle) { + case "blink": + return 1; + case "smooth": + return 2; + case "phase": + return 3; + case "expand": + return 4; + case "solid": + return 5; + } +} +var TextEditorCursorStyle; +(function(TextEditorCursorStyle3) { + TextEditorCursorStyle3[TextEditorCursorStyle3["Line"] = 1] = "Line"; + TextEditorCursorStyle3[TextEditorCursorStyle3["Block"] = 2] = "Block"; + TextEditorCursorStyle3[TextEditorCursorStyle3["Underline"] = 3] = "Underline"; + TextEditorCursorStyle3[TextEditorCursorStyle3["LineThin"] = 4] = "LineThin"; + TextEditorCursorStyle3[TextEditorCursorStyle3["BlockOutline"] = 5] = "BlockOutline"; + TextEditorCursorStyle3[TextEditorCursorStyle3["UnderlineThin"] = 6] = "UnderlineThin"; +})(TextEditorCursorStyle || (TextEditorCursorStyle = {})); +function cursorStyleFromString(cursorStyle) { + switch (cursorStyle) { + case "line": + return TextEditorCursorStyle.Line; + case "block": + return TextEditorCursorStyle.Block; + case "underline": + return TextEditorCursorStyle.Underline; + case "line-thin": + return TextEditorCursorStyle.LineThin; + case "block-outline": + return TextEditorCursorStyle.BlockOutline; + case "underline-thin": + return TextEditorCursorStyle.UnderlineThin; + } +} +var EditorClassName = class extends ComputedEditorOption { + constructor() { + super(162, ""); + } + compute(env2, options2, _) { + const classNames2 = ["monaco-editor"]; + if (options2.get( + 48 + /* EditorOption.extraEditorClassName */ + )) { + classNames2.push(options2.get( + 48 + /* EditorOption.extraEditorClassName */ + )); + } + if (env2.extraEditorClassName) { + classNames2.push(env2.extraEditorClassName); + } + if (options2.get( + 82 + /* EditorOption.mouseStyle */ + ) === "default") { + classNames2.push("mouse-default"); + } else if (options2.get( + 82 + /* EditorOption.mouseStyle */ + ) === "copy") { + classNames2.push("mouse-copy"); + } + if (options2.get( + 127 + /* EditorOption.showUnused */ + )) { + classNames2.push("showUnused"); + } + if (options2.get( + 157 + /* EditorOption.showDeprecated */ + )) { + classNames2.push("showDeprecated"); + } + return classNames2.join(" "); + } +}; +var EditorEmptySelectionClipboard = class extends EditorBooleanOption { + constructor() { + super(45, "emptySelectionClipboard", true, { description: localize(207, "Controls whether copying without a selection copies the current line.") }); + } + compute(env2, options2, value) { + return value && env2.emptySelectionClipboard; + } +}; +var EditorFind = class extends BaseEditorOption { + constructor() { + const defaults = { + cursorMoveOnType: true, + findOnType: true, + seedSearchStringFromSelection: "always", + autoFindInSelection: "never", + globalFindClipboard: false, + addExtraSpaceOnTop: true, + loop: true, + history: "workspace", + replaceHistory: "workspace" + }; + super(50, "find", defaults, { + "editor.find.cursorMoveOnType": { + type: "boolean", + default: defaults.cursorMoveOnType, + description: localize(208, "Controls whether the cursor should jump to find matches while typing.") + }, + "editor.find.seedSearchStringFromSelection": { + type: "string", + enum: ["never", "always", "selection"], + default: defaults.seedSearchStringFromSelection, + enumDescriptions: [ + localize(209, "Never seed search string from the editor selection."), + localize(210, "Always seed search string from the editor selection, including word at cursor position."), + localize(211, "Only seed search string from the editor selection.") + ], + description: localize(212, "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: defaults.autoFindInSelection, + enumDescriptions: [ + localize(213, "Never turn on Find in Selection automatically (default)."), + localize(214, "Always turn on Find in Selection automatically."), + localize(215, "Turn on Find in Selection automatically when multiple lines of content are selected.") + ], + description: localize(216, "Controls the condition for turning on Find in Selection automatically.") + }, + "editor.find.globalFindClipboard": { + type: "boolean", + default: defaults.globalFindClipboard, + description: localize(217, "Controls whether the Find Widget should read or modify the shared find clipboard on macOS."), + included: isMacintosh + }, + "editor.find.addExtraSpaceOnTop": { + type: "boolean", + default: defaults.addExtraSpaceOnTop, + description: localize(218, "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: defaults.loop, + description: localize(219, "Controls whether the search automatically restarts from the beginning (or the end) when no further matches can be found.") + }, + "editor.find.history": { + type: "string", + enum: ["never", "workspace"], + default: "workspace", + enumDescriptions: [ + localize(220, "Do not store search history from the find widget."), + localize(221, "Store search history across the active workspace") + ], + description: localize(222, "Controls how the find widget history should be stored") + }, + "editor.find.replaceHistory": { + type: "string", + enum: ["never", "workspace"], + default: "workspace", + enumDescriptions: [ + localize(223, "Do not store history from the replace widget."), + localize(224, "Store replace history across the active workspace") + ], + description: localize(225, "Controls how the replace widget history should be stored") + }, + "editor.find.findOnType": { + type: "boolean", + default: defaults.findOnType, + description: localize(226, "Controls whether the Find Widget should search as you type.") + } + }); + } + validate(_input) { + if (!_input || typeof _input !== "object") { + return this.defaultValue; + } + const input = _input; + return { + cursorMoveOnType: boolean(input.cursorMoveOnType, this.defaultValue.cursorMoveOnType), + findOnType: boolean(input.findOnType, this.defaultValue.findOnType), + seedSearchStringFromSelection: typeof input.seedSearchStringFromSelection === "boolean" ? input.seedSearchStringFromSelection ? "always" : "never" : stringSet(input.seedSearchStringFromSelection, this.defaultValue.seedSearchStringFromSelection, ["never", "always", "selection"]), + autoFindInSelection: typeof input.autoFindInSelection === "boolean" ? input.autoFindInSelection ? "always" : "never" : stringSet(input.autoFindInSelection, this.defaultValue.autoFindInSelection, ["never", "always", "multiline"]), + globalFindClipboard: boolean(input.globalFindClipboard, this.defaultValue.globalFindClipboard), + addExtraSpaceOnTop: boolean(input.addExtraSpaceOnTop, this.defaultValue.addExtraSpaceOnTop), + loop: boolean(input.loop, this.defaultValue.loop), + history: stringSet(input.history, this.defaultValue.history, ["never", "workspace"]), + replaceHistory: stringSet(input.replaceHistory, this.defaultValue.replaceHistory, ["never", "workspace"]) + }; + } +}; +var EditorFontLigatures = class _EditorFontLigatures extends BaseEditorOption { + static { + this.OFF = '"liga" off, "calt" off'; + } + static { + this.ON = '"liga" on, "calt" on'; + } + constructor() { + super(60, "fontLigatures", _EditorFontLigatures.OFF, { + anyOf: [ + { + type: "boolean", + description: localize(227, "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: localize(228, "Explicit 'font-feature-settings' CSS property. A boolean can be passed instead if one only needs to turn on/off ligatures.") + } + ], + description: localize(229, "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: false + }); + } + validate(input) { + if (typeof input === "undefined") { + return this.defaultValue; + } + if (typeof input === "string") { + if (input === "false" || input.length === 0) { + return _EditorFontLigatures.OFF; + } + if (input === "true") { + return _EditorFontLigatures.ON; + } + return input; + } + if (Boolean(input)) { + return _EditorFontLigatures.ON; + } + return _EditorFontLigatures.OFF; + } +}; +var EditorFontVariations = class _EditorFontVariations extends BaseEditorOption { + static { + this.OFF = FONT_VARIATION_OFF; + } + static { + this.TRANSLATE = FONT_VARIATION_TRANSLATE; + } + constructor() { + super(63, "fontVariations", _EditorFontVariations.OFF, { + anyOf: [ + { + type: "boolean", + description: localize(230, "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: localize(231, "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: localize(232, "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: false + }); + } + validate(input) { + if (typeof input === "undefined") { + return this.defaultValue; + } + if (typeof input === "string") { + if (input === "false") { + return _EditorFontVariations.OFF; + } + if (input === "true") { + return _EditorFontVariations.TRANSLATE; + } + return input; + } + if (Boolean(input)) { + return _EditorFontVariations.TRANSLATE; + } + return _EditorFontVariations.OFF; + } + compute(env2, options2, value) { + return env2.fontInfo.fontVariationSettings; + } +}; +var EditorFontInfo = class extends ComputedEditorOption { + constructor() { + super(59, new FontInfo({ + pixelRatio: 0, + fontFamily: "", + fontWeight: "", + fontSize: 0, + fontFeatureSettings: "", + fontVariationSettings: "", + lineHeight: 0, + letterSpacing: 0, + isMonospace: false, + typicalHalfwidthCharacterWidth: 0, + typicalFullwidthCharacterWidth: 0, + canUseHalfwidthRightwardsArrow: false, + spaceWidth: 0, + middotWidth: 0, + wsmiddotWidth: 0, + maxDigitWidth: 0 + }, false)); + } + compute(env2, options2, _) { + return env2.fontInfo; + } +}; +var EffectiveCursorStyle = class extends ComputedEditorOption { + constructor() { + super(161, TextEditorCursorStyle.Line); + } + compute(env2, options2, _) { + return env2.inputMode === "overtype" ? options2.get( + 92 + /* EditorOption.overtypeCursorStyle */ + ) : options2.get( + 34 + /* EditorOption.cursorStyle */ + ); + } +}; +var EffectiveEditContextEnabled = class extends ComputedEditorOption { + constructor() { + super(170, false); + } + compute(env2, options2) { + return env2.editContextSupported && options2.get( + 44 + /* EditorOption.editContext */ + ); + } +}; +var EffectiveAllowVariableFonts = class extends ComputedEditorOption { + constructor() { + super(172, false); + } + compute(env2, options2) { + const accessibilitySupport = env2.accessibilitySupport; + if (accessibilitySupport === 2) { + return options2.get( + 7 + /* EditorOption.allowVariableFontsInAccessibilityMode */ + ); + } else { + return options2.get( + 6 + /* EditorOption.allowVariableFonts */ + ); + } + } +}; +var EditorFontSize = class extends SimpleEditorOption { + constructor() { + super(61, "fontSize", EDITOR_FONT_DEFAULTS.fontSize, { + type: "number", + minimum: 6, + maximum: 100, + default: EDITOR_FONT_DEFAULTS.fontSize, + description: localize(233, "Controls the font size in pixels.") + }); + } + validate(input) { + const r = EditorFloatOption.float(input, this.defaultValue); + if (r === 0) { + return EDITOR_FONT_DEFAULTS.fontSize; + } + return EditorFloatOption.clamp(r, 6, 100); + } + compute(env2, options2, value) { + return env2.fontInfo.fontSize; + } +}; +var EditorFontWeight = class _EditorFontWeight extends BaseEditorOption { + static { + this.SUGGESTION_VALUES = ["normal", "bold", "100", "200", "300", "400", "500", "600", "700", "800", "900"]; + } + static { + this.MINIMUM_VALUE = 1; + } + static { + this.MAXIMUM_VALUE = 1e3; + } + constructor() { + super(62, "fontWeight", EDITOR_FONT_DEFAULTS.fontWeight, { + anyOf: [ + { + type: "number", + minimum: _EditorFontWeight.MINIMUM_VALUE, + maximum: _EditorFontWeight.MAXIMUM_VALUE, + errorMessage: localize(234, '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: _EditorFontWeight.SUGGESTION_VALUES + } + ], + default: EDITOR_FONT_DEFAULTS.fontWeight, + description: localize(235, 'Controls the font weight. Accepts "normal" and "bold" keywords or numbers between 1 and 1000.') + }); + } + validate(input) { + if (input === "normal" || input === "bold") { + return input; + } + return String(EditorIntOption.clampedInt(input, EDITOR_FONT_DEFAULTS.fontWeight, _EditorFontWeight.MINIMUM_VALUE, _EditorFontWeight.MAXIMUM_VALUE)); + } +}; +var EditorGoToLocation = class extends BaseEditorOption { + constructor() { + const defaults = { + 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: "" + }; + const jsonSubset = { + type: "string", + enum: ["peek", "gotoAndPeek", "goto"], + default: defaults.multiple, + enumDescriptions: [ + localize(236, "Show Peek view of the results (default)"), + localize(237, "Go to the primary result and show a Peek view"), + localize(238, "Go to the primary result and enable Peek-less navigation to others") + ] + }; + const alternativeCommandOptions = ["", "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(67, "gotoLocation", defaults, { + "editor.gotoLocation.multiple": { + deprecationMessage: localize(239, "This setting is deprecated, please use separate settings like 'editor.editor.gotoLocation.multipleDefinitions' or 'editor.editor.gotoLocation.multipleImplementations' instead.") + }, + "editor.gotoLocation.multipleDefinitions": { + description: localize(240, "Controls the behavior the 'Go to Definition'-command when multiple target locations exist."), + ...jsonSubset + }, + "editor.gotoLocation.multipleTypeDefinitions": { + description: localize(241, "Controls the behavior the 'Go to Type Definition'-command when multiple target locations exist."), + ...jsonSubset + }, + "editor.gotoLocation.multipleDeclarations": { + description: localize(242, "Controls the behavior the 'Go to Declaration'-command when multiple target locations exist."), + ...jsonSubset + }, + "editor.gotoLocation.multipleImplementations": { + description: localize(243, "Controls the behavior the 'Go to Implementations'-command when multiple target locations exist."), + ...jsonSubset + }, + "editor.gotoLocation.multipleReferences": { + description: localize(244, "Controls the behavior the 'Go to References'-command when multiple target locations exist."), + ...jsonSubset + }, + "editor.gotoLocation.alternativeDefinitionCommand": { + type: "string", + default: defaults.alternativeDefinitionCommand, + enum: alternativeCommandOptions, + description: localize(245, "Alternative command id that is being executed when the result of 'Go to Definition' is the current location.") + }, + "editor.gotoLocation.alternativeTypeDefinitionCommand": { + type: "string", + default: defaults.alternativeTypeDefinitionCommand, + enum: alternativeCommandOptions, + description: localize(246, "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: defaults.alternativeDeclarationCommand, + enum: alternativeCommandOptions, + description: localize(247, "Alternative command id that is being executed when the result of 'Go to Declaration' is the current location.") + }, + "editor.gotoLocation.alternativeImplementationCommand": { + type: "string", + default: defaults.alternativeImplementationCommand, + enum: alternativeCommandOptions, + description: localize(248, "Alternative command id that is being executed when the result of 'Go to Implementation' is the current location.") + }, + "editor.gotoLocation.alternativeReferenceCommand": { + type: "string", + default: defaults.alternativeReferenceCommand, + enum: alternativeCommandOptions, + description: localize(249, "Alternative command id that is being executed when the result of 'Go to Reference' is the current location.") + } + }); + } + validate(_input) { + if (!_input || typeof _input !== "object") { + return this.defaultValue; + } + const input = _input; + return { + multiple: stringSet(input.multiple, this.defaultValue.multiple, ["peek", "gotoAndPeek", "goto"]), + multipleDefinitions: stringSet(input.multipleDefinitions, "peek", ["peek", "gotoAndPeek", "goto"]), + multipleTypeDefinitions: stringSet(input.multipleTypeDefinitions, "peek", ["peek", "gotoAndPeek", "goto"]), + multipleDeclarations: stringSet(input.multipleDeclarations, "peek", ["peek", "gotoAndPeek", "goto"]), + multipleImplementations: stringSet(input.multipleImplementations, "peek", ["peek", "gotoAndPeek", "goto"]), + multipleReferences: stringSet(input.multipleReferences, "peek", ["peek", "gotoAndPeek", "goto"]), + multipleTests: stringSet(input.multipleTests, "peek", ["peek", "gotoAndPeek", "goto"]), + alternativeDefinitionCommand: EditorStringOption.string(input.alternativeDefinitionCommand, this.defaultValue.alternativeDefinitionCommand), + alternativeTypeDefinitionCommand: EditorStringOption.string(input.alternativeTypeDefinitionCommand, this.defaultValue.alternativeTypeDefinitionCommand), + alternativeDeclarationCommand: EditorStringOption.string(input.alternativeDeclarationCommand, this.defaultValue.alternativeDeclarationCommand), + alternativeImplementationCommand: EditorStringOption.string(input.alternativeImplementationCommand, this.defaultValue.alternativeImplementationCommand), + alternativeReferenceCommand: EditorStringOption.string(input.alternativeReferenceCommand, this.defaultValue.alternativeReferenceCommand), + alternativeTestsCommand: EditorStringOption.string(input.alternativeTestsCommand, this.defaultValue.alternativeTestsCommand) + }; + } +}; +var EditorHover = class extends BaseEditorOption { + constructor() { + const defaults = { + enabled: true, + delay: 300, + hidingDelay: 300, + sticky: true, + above: true + }; + super(69, "hover", defaults, { + "editor.hover.enabled": { + type: "boolean", + default: defaults.enabled, + description: localize(250, "Controls whether the hover is shown.") + }, + "editor.hover.delay": { + type: "number", + default: defaults.delay, + minimum: 0, + maximum: 1e4, + description: localize(251, "Controls the delay in milliseconds after which the hover is shown.") + }, + "editor.hover.sticky": { + type: "boolean", + default: defaults.sticky, + description: localize(252, "Controls whether the hover should remain visible when mouse is moved over it.") + }, + "editor.hover.hidingDelay": { + type: "integer", + minimum: 0, + default: defaults.hidingDelay, + markdownDescription: localize(253, "Controls the delay in milliseconds after which the hover is hidden. Requires `#editor.hover.sticky#` to be enabled.") + }, + "editor.hover.above": { + type: "boolean", + default: defaults.above, + description: localize(254, "Prefer showing hovers above the line, if there's space.") + } + }); + } + validate(_input) { + if (!_input || typeof _input !== "object") { + return this.defaultValue; + } + const input = _input; + return { + enabled: boolean(input.enabled, this.defaultValue.enabled), + delay: EditorIntOption.clampedInt(input.delay, this.defaultValue.delay, 0, 1e4), + sticky: boolean(input.sticky, this.defaultValue.sticky), + hidingDelay: EditorIntOption.clampedInt(input.hidingDelay, this.defaultValue.hidingDelay, 0, 6e5), + above: boolean(input.above, this.defaultValue.above) + }; + } +}; +var EditorLayoutInfoComputer = class _EditorLayoutInfoComputer extends ComputedEditorOption { + constructor() { + super(165, { + width: 0, + height: 0, + glyphMarginLeft: 0, + glyphMarginWidth: 0, + glyphMarginDecorationLaneCount: 0, + lineNumbersLeft: 0, + lineNumbersWidth: 0, + decorationsLeft: 0, + decorationsWidth: 0, + contentLeft: 0, + contentWidth: 0, + minimap: { + renderMinimap: 0, + minimapLeft: 0, + minimapWidth: 0, + minimapHeightIsEditorHeight: false, + minimapIsSampling: false, + minimapScale: 1, + minimapLineHeight: 1, + minimapCanvasInnerWidth: 0, + minimapCanvasInnerHeight: 0, + minimapCanvasOuterWidth: 0, + minimapCanvasOuterHeight: 0 + }, + viewportColumn: 0, + isWordWrapMinified: false, + isViewportWrapping: false, + wrappingColumn: -1, + verticalScrollbarWidth: 0, + horizontalScrollbarHeight: 0, + overviewRuler: { + top: 0, + width: 0, + height: 0, + right: 0 + } + }); + } + compute(env2, options2, _) { + return _EditorLayoutInfoComputer.computeLayout(options2, { + memory: env2.memory, + outerWidth: env2.outerWidth, + outerHeight: env2.outerHeight, + isDominatedByLongLines: env2.isDominatedByLongLines, + lineHeight: env2.fontInfo.lineHeight, + viewLineCount: env2.viewLineCount, + lineNumbersDigitCount: env2.lineNumbersDigitCount, + typicalHalfwidthCharacterWidth: env2.fontInfo.typicalHalfwidthCharacterWidth, + maxDigitWidth: globalThis.__monaco_maxDigitWidth || env2.fontInfo.maxDigitWidth, + pixelRatio: env2.pixelRatio, + glyphMarginDecorationLaneCount: env2.glyphMarginDecorationLaneCount + }); + } + static computeContainedMinimapLineCount(input) { + const typicalViewportLineCount = input.height / input.lineHeight; + const extraLinesBeforeFirstLine = Math.floor(input.paddingTop / input.lineHeight); + let extraLinesBeyondLastLine = Math.floor(input.paddingBottom / input.lineHeight); + if (input.scrollBeyondLastLine) { + extraLinesBeyondLastLine = Math.max(extraLinesBeyondLastLine, typicalViewportLineCount - 1); + } + const desiredRatio = (extraLinesBeforeFirstLine + input.viewLineCount + extraLinesBeyondLastLine) / (input.pixelRatio * input.height); + const minimapLineCount = Math.floor(input.viewLineCount / desiredRatio); + return { typicalViewportLineCount, extraLinesBeforeFirstLine, extraLinesBeyondLastLine, desiredRatio, minimapLineCount }; + } + static _computeMinimapLayout(input, memory) { + const outerWidth = input.outerWidth; + const outerHeight = input.outerHeight; + const pixelRatio = input.pixelRatio; + if (!input.minimap.enabled) { + return { + renderMinimap: 0, + minimapLeft: 0, + minimapWidth: 0, + minimapHeightIsEditorHeight: false, + minimapIsSampling: false, + minimapScale: 1, + minimapLineHeight: 1, + minimapCanvasInnerWidth: 0, + minimapCanvasInnerHeight: Math.floor(pixelRatio * outerHeight), + minimapCanvasOuterWidth: 0, + minimapCanvasOuterHeight: outerHeight + }; + } + const stableMinimapLayoutInput = memory.stableMinimapLayoutInput; + const couldUseMemory = stableMinimapLayoutInput && input.outerHeight === stableMinimapLayoutInput.outerHeight && input.lineHeight === stableMinimapLayoutInput.lineHeight && input.typicalHalfwidthCharacterWidth === stableMinimapLayoutInput.typicalHalfwidthCharacterWidth && input.pixelRatio === stableMinimapLayoutInput.pixelRatio && input.scrollBeyondLastLine === stableMinimapLayoutInput.scrollBeyondLastLine && input.paddingTop === stableMinimapLayoutInput.paddingTop && input.paddingBottom === stableMinimapLayoutInput.paddingBottom && input.minimap.enabled === stableMinimapLayoutInput.minimap.enabled && input.minimap.side === stableMinimapLayoutInput.minimap.side && input.minimap.size === stableMinimapLayoutInput.minimap.size && input.minimap.showSlider === stableMinimapLayoutInput.minimap.showSlider && input.minimap.renderCharacters === stableMinimapLayoutInput.minimap.renderCharacters && input.minimap.maxColumn === stableMinimapLayoutInput.minimap.maxColumn && input.minimap.scale === stableMinimapLayoutInput.minimap.scale && input.verticalScrollbarWidth === stableMinimapLayoutInput.verticalScrollbarWidth && input.isViewportWrapping === stableMinimapLayoutInput.isViewportWrapping; + const lineHeight = input.lineHeight; + const typicalHalfwidthCharacterWidth = input.typicalHalfwidthCharacterWidth; + const scrollBeyondLastLine = input.scrollBeyondLastLine; + const minimapRenderCharacters = input.minimap.renderCharacters; + let minimapScale = pixelRatio >= 2 ? Math.round(input.minimap.scale * 2) : input.minimap.scale; + const minimapMaxColumn = input.minimap.maxColumn; + const minimapSize = input.minimap.size; + const minimapSide = input.minimap.side; + const verticalScrollbarWidth = input.verticalScrollbarWidth; + const viewLineCount = input.viewLineCount; + const remainingWidth = input.remainingWidth; + const isViewportWrapping = input.isViewportWrapping; + const baseCharHeight = minimapRenderCharacters ? 2 : 3; + let minimapCanvasInnerHeight = Math.floor(pixelRatio * outerHeight); + const minimapCanvasOuterHeight = minimapCanvasInnerHeight / pixelRatio; + let minimapHeightIsEditorHeight = false; + let minimapIsSampling = false; + let minimapLineHeight = baseCharHeight * minimapScale; + let minimapCharWidth = minimapScale / pixelRatio; + let minimapWidthMultiplier = 1; + if (minimapSize === "fill" || minimapSize === "fit") { + const { typicalViewportLineCount, extraLinesBeforeFirstLine, extraLinesBeyondLastLine, desiredRatio, minimapLineCount } = _EditorLayoutInfoComputer.computeContainedMinimapLineCount({ + viewLineCount, + scrollBeyondLastLine, + paddingTop: input.paddingTop, + paddingBottom: input.paddingBottom, + height: outerHeight, + lineHeight, + pixelRatio + }); + const ratio = viewLineCount / minimapLineCount; + if (ratio > 1) { + minimapHeightIsEditorHeight = true; + minimapIsSampling = true; + minimapScale = 1; + minimapLineHeight = 1; + minimapCharWidth = minimapScale / pixelRatio; + } else { + let fitBecomesFill = false; + let maxMinimapScale = minimapScale + 1; + if (minimapSize === "fit") { + const effectiveMinimapHeight = Math.ceil((extraLinesBeforeFirstLine + viewLineCount + extraLinesBeyondLastLine) * minimapLineHeight); + if (isViewportWrapping && couldUseMemory && remainingWidth <= memory.stableFitRemainingWidth) { + fitBecomesFill = true; + maxMinimapScale = memory.stableFitMaxMinimapScale; + } else { + fitBecomesFill = effectiveMinimapHeight > minimapCanvasInnerHeight; + } + } + if (minimapSize === "fill" || fitBecomesFill) { + minimapHeightIsEditorHeight = true; + const configuredMinimapScale = minimapScale; + minimapLineHeight = Math.min(lineHeight * pixelRatio, Math.max(1, Math.floor(1 / desiredRatio))); + if (isViewportWrapping && couldUseMemory && remainingWidth <= memory.stableFitRemainingWidth) { + maxMinimapScale = memory.stableFitMaxMinimapScale; + } + minimapScale = Math.min(maxMinimapScale, Math.max(1, Math.floor(minimapLineHeight / baseCharHeight))); + if (minimapScale > configuredMinimapScale) { + minimapWidthMultiplier = Math.min(2, minimapScale / configuredMinimapScale); + } + minimapCharWidth = minimapScale / pixelRatio / minimapWidthMultiplier; + minimapCanvasInnerHeight = Math.ceil(Math.max(typicalViewportLineCount, extraLinesBeforeFirstLine + viewLineCount + extraLinesBeyondLastLine) * minimapLineHeight); + if (isViewportWrapping) { + memory.stableMinimapLayoutInput = input; + memory.stableFitRemainingWidth = remainingWidth; + memory.stableFitMaxMinimapScale = minimapScale; + } else { + memory.stableMinimapLayoutInput = null; + memory.stableFitRemainingWidth = 0; + } + } + } + } + const minimapMaxWidth = Math.floor(minimapMaxColumn * minimapCharWidth); + const minimapWidth = Math.min(minimapMaxWidth, Math.max(0, Math.floor((remainingWidth - verticalScrollbarWidth - 2) * minimapCharWidth / (typicalHalfwidthCharacterWidth + minimapCharWidth))) + MINIMAP_GUTTER_WIDTH); + let minimapCanvasInnerWidth = Math.floor(pixelRatio * minimapWidth); + const minimapCanvasOuterWidth = minimapCanvasInnerWidth / pixelRatio; + minimapCanvasInnerWidth = Math.floor(minimapCanvasInnerWidth * minimapWidthMultiplier); + const renderMinimap = minimapRenderCharacters ? 1 : 2; + const minimapLeft = minimapSide === "left" ? 0 : outerWidth - minimapWidth - verticalScrollbarWidth; + return { + renderMinimap, + minimapLeft, + minimapWidth, + minimapHeightIsEditorHeight, + minimapIsSampling, + minimapScale, + minimapLineHeight, + minimapCanvasInnerWidth, + minimapCanvasInnerHeight, + minimapCanvasOuterWidth, + minimapCanvasOuterHeight + }; + } + static computeLayout(options2, env2) { + const outerWidth = env2.outerWidth | 0; + const outerHeight = env2.outerHeight | 0; + const lineHeight = env2.lineHeight | 0; + const lineNumbersDigitCount = env2.lineNumbersDigitCount | 0; + const typicalHalfwidthCharacterWidth = env2.typicalHalfwidthCharacterWidth; + const maxDigitWidth = env2.maxDigitWidth; + const pixelRatio = env2.pixelRatio; + const viewLineCount = env2.viewLineCount; + const wordWrapOverride2 = options2.get( + 154 + /* EditorOption.wordWrapOverride2 */ + ); + const wordWrapOverride1 = wordWrapOverride2 === "inherit" ? options2.get( + 153 + /* EditorOption.wordWrapOverride1 */ + ) : wordWrapOverride2; + const wordWrap = wordWrapOverride1 === "inherit" ? options2.get( + 149 + /* EditorOption.wordWrap */ + ) : wordWrapOverride1; + const wordWrapColumn = options2.get( + 152 + /* EditorOption.wordWrapColumn */ + ); + const isDominatedByLongLines = env2.isDominatedByLongLines; + const showGlyphMargin = options2.get( + 66 + /* EditorOption.glyphMargin */ + ); + const showLineNumbers = options2.get( + 76 + /* EditorOption.lineNumbers */ + ).renderType !== 0; + const lineNumbersMinChars = options2.get( + 77 + /* EditorOption.lineNumbersMinChars */ + ); + const scrollBeyondLastLine = options2.get( + 119 + /* EditorOption.scrollBeyondLastLine */ + ); + const padding = options2.get( + 96 + /* EditorOption.padding */ + ); + const minimap = options2.get( + 81 + /* EditorOption.minimap */ + ); + const scrollbar = options2.get( + 117 + /* EditorOption.scrollbar */ + ); + const verticalScrollbarWidth = scrollbar.verticalScrollbarSize; + const verticalScrollbarHasArrows = scrollbar.verticalHasArrows; + const scrollbarArrowSize = scrollbar.arrowSize; + const horizontalScrollbarHeight = scrollbar.horizontalScrollbarSize; + const folding = options2.get( + 52 + /* EditorOption.folding */ + ); + const showFoldingDecoration = options2.get( + 126 + /* EditorOption.showFoldingControls */ + ) !== "never"; + let lineDecorationsWidth = options2.get( + 74 + /* EditorOption.lineDecorationsWidth */ + ); + if (folding && showFoldingDecoration) { + lineDecorationsWidth += 16; + } + let lineNumbersWidth = 0; + if (showLineNumbers) { + const digitCount2 = Math.max(lineNumbersDigitCount, lineNumbersMinChars); + lineNumbersWidth = Math.round(digitCount2 * maxDigitWidth); + } + let glyphMarginWidth = 0; + if (showGlyphMargin) { + glyphMarginWidth = lineHeight * env2.glyphMarginDecorationLaneCount; + } + let glyphMarginLeft = 0; + let lineNumbersLeft = glyphMarginLeft + glyphMarginWidth; + let decorationsLeft = lineNumbersLeft + lineNumbersWidth; + let contentLeft = decorationsLeft + lineDecorationsWidth; + const remainingWidth = outerWidth - glyphMarginWidth - lineNumbersWidth - lineDecorationsWidth; + let isWordWrapMinified = false; + let isViewportWrapping = false; + let wrappingColumn = -1; + if (options2.get( + 2 + /* EditorOption.accessibilitySupport */ + ) === 2 && wordWrapOverride1 === "inherit" && isDominatedByLongLines) { + isWordWrapMinified = true; + isViewportWrapping = true; + } else if (wordWrap === "on" || wordWrap === "bounded") { + isViewportWrapping = true; + } else if (wordWrap === "wordWrapColumn") { + wrappingColumn = wordWrapColumn; + } + const minimapLayout = _EditorLayoutInfoComputer._computeMinimapLayout({ + outerWidth, + outerHeight, + lineHeight, + typicalHalfwidthCharacterWidth, + pixelRatio, + scrollBeyondLastLine, + paddingTop: padding.top, + paddingBottom: padding.bottom, + minimap, + verticalScrollbarWidth, + viewLineCount, + remainingWidth, + isViewportWrapping + }, env2.memory || new ComputeOptionsMemory()); + if (minimapLayout.renderMinimap !== 0 && minimapLayout.minimapLeft === 0) { + glyphMarginLeft += minimapLayout.minimapWidth; + lineNumbersLeft += minimapLayout.minimapWidth; + decorationsLeft += minimapLayout.minimapWidth; + contentLeft += minimapLayout.minimapWidth; + } + const contentWidth = remainingWidth - minimapLayout.minimapWidth; + const viewportColumn = Math.max(1, Math.floor((contentWidth - verticalScrollbarWidth - 2) / typicalHalfwidthCharacterWidth)); + const verticalArrowSize = verticalScrollbarHasArrows ? scrollbarArrowSize : 0; + if (isViewportWrapping) { + wrappingColumn = Math.max(1, viewportColumn); + if (wordWrap === "bounded") { + wrappingColumn = Math.min(wrappingColumn, wordWrapColumn); + } + } + return { + width: outerWidth, + height: outerHeight, + glyphMarginLeft, + glyphMarginWidth, + glyphMarginDecorationLaneCount: env2.glyphMarginDecorationLaneCount, + lineNumbersLeft, + lineNumbersWidth, + decorationsLeft, + decorationsWidth: lineDecorationsWidth, + contentLeft, + contentWidth, + minimap: minimapLayout, + viewportColumn, + isWordWrapMinified, + isViewportWrapping, + wrappingColumn, + verticalScrollbarWidth, + horizontalScrollbarHeight, + overviewRuler: { + top: verticalArrowSize, + width: verticalScrollbarWidth, + height: outerHeight - 2 * verticalArrowSize, + right: 0 + } + }; + } +}; +var WrappingStrategy = class extends BaseEditorOption { + constructor() { + super(156, "wrappingStrategy", "simple", { + "editor.wrappingStrategy": { + enumDescriptions: [ + localize(255, "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."), + localize(256, "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: localize(257, "Controls the algorithm that computes wrapping points. Note that when in accessibility mode, advanced will be used for the best experience.") + } + }); + } + validate(input) { + return stringSet(input, "simple", ["simple", "advanced"]); + } + compute(env2, options2, value) { + const accessibilitySupport = options2.get( + 2 + /* EditorOption.accessibilitySupport */ + ); + if (accessibilitySupport === 2) { + return "advanced"; + } + return value; + } +}; +var ShowLightbulbIconMode; +(function(ShowLightbulbIconMode3) { + ShowLightbulbIconMode3["Off"] = "off"; + ShowLightbulbIconMode3["OnCode"] = "onCode"; + ShowLightbulbIconMode3["On"] = "on"; +})(ShowLightbulbIconMode || (ShowLightbulbIconMode = {})); +var EditorLightbulb = class extends BaseEditorOption { + constructor() { + const defaults = { enabled: ShowLightbulbIconMode.OnCode }; + super(73, "lightbulb", defaults, { + "editor.lightbulb.enabled": { + type: "string", + enum: [ShowLightbulbIconMode.Off, ShowLightbulbIconMode.OnCode, ShowLightbulbIconMode.On], + default: defaults.enabled, + enumDescriptions: [ + localize(258, "Disable the code action menu."), + localize(259, "Show the code action menu when the cursor is on lines with code."), + localize(260, "Show the code action menu when the cursor is on lines with code or on empty lines.") + ], + description: localize(261, "Enables the Code Action lightbulb in the editor.") + } + }); + } + validate(_input) { + if (!_input || typeof _input !== "object") { + return this.defaultValue; + } + const input = _input; + return { + enabled: stringSet(input.enabled, this.defaultValue.enabled, [ShowLightbulbIconMode.Off, ShowLightbulbIconMode.OnCode, ShowLightbulbIconMode.On]) + }; + } +}; +var EditorStickyScroll = class extends BaseEditorOption { + constructor() { + const defaults = { enabled: true, maxLineCount: 5, defaultModel: "outlineModel", scrollWithEditor: true }; + super(131, "stickyScroll", defaults, { + "editor.stickyScroll.enabled": { + type: "boolean", + default: defaults.enabled, + description: localize(262, "Shows the nested current scopes during the scroll at the top of the editor.") + }, + "editor.stickyScroll.maxLineCount": { + type: "number", + default: defaults.maxLineCount, + minimum: 1, + maximum: 20, + description: localize(263, "Defines the maximum number of sticky lines to show.") + }, + "editor.stickyScroll.defaultModel": { + type: "string", + enum: ["outlineModel", "foldingProviderModel", "indentationModel"], + default: defaults.defaultModel, + description: localize(264, "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: defaults.scrollWithEditor, + description: localize(265, "Enable scrolling of Sticky Scroll with the editor's horizontal scrollbar.") + } + }); + } + validate(_input) { + if (!_input || typeof _input !== "object") { + return this.defaultValue; + } + const input = _input; + return { + enabled: boolean(input.enabled, this.defaultValue.enabled), + maxLineCount: EditorIntOption.clampedInt(input.maxLineCount, this.defaultValue.maxLineCount, 1, 20), + defaultModel: stringSet(input.defaultModel, this.defaultValue.defaultModel, ["outlineModel", "foldingProviderModel", "indentationModel"]), + scrollWithEditor: boolean(input.scrollWithEditor, this.defaultValue.scrollWithEditor) + }; + } +}; +var EditorInlayHints = class extends BaseEditorOption { + constructor() { + const defaults = { enabled: "on", fontSize: 0, fontFamily: "", padding: false, maximumLength: 43 }; + super(159, "inlayHints", defaults, { + "editor.inlayHints.enabled": { + type: "string", + default: defaults.enabled, + description: localize(266, "Enables the inlay hints in the editor."), + enum: ["on", "onUnlessPressed", "offUnlessPressed", "off"], + markdownEnumDescriptions: [ + localize(267, "Inlay hints are enabled"), + localize(268, "Inlay hints are showing by default and hide when holding {0}", isMacintosh ? `Ctrl+Option` : `Ctrl+Alt`), + localize(269, "Inlay hints are hidden by default and show when holding {0}", isMacintosh ? `Ctrl+Option` : `Ctrl+Alt`), + localize(270, "Inlay hints are disabled") + ] + }, + "editor.inlayHints.fontSize": { + type: "number", + default: defaults.fontSize, + markdownDescription: localize(271, "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: defaults.fontFamily, + markdownDescription: localize(272, "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: defaults.padding, + description: localize(273, "Enables the padding around the inlay hints in the editor.") + }, + "editor.inlayHints.maximumLength": { + type: "number", + default: defaults.maximumLength, + markdownDescription: localize(274, "Maximum overall length of inlay hints, for a single line, before they get truncated by the editor. Set to `0` to never truncate") + } + }); + } + validate(_input) { + if (!_input || typeof _input !== "object") { + return this.defaultValue; + } + const input = _input; + if (typeof input.enabled === "boolean") { + input.enabled = input.enabled ? "on" : "off"; + } + return { + enabled: stringSet(input.enabled, this.defaultValue.enabled, ["on", "off", "offUnlessPressed", "onUnlessPressed"]), + fontSize: EditorIntOption.clampedInt(input.fontSize, this.defaultValue.fontSize, 0, 100), + fontFamily: EditorStringOption.string(input.fontFamily, this.defaultValue.fontFamily), + padding: boolean(input.padding, this.defaultValue.padding), + maximumLength: EditorIntOption.clampedInt(input.maximumLength, this.defaultValue.maximumLength, 0, Number.MAX_SAFE_INTEGER) + }; + } +}; +var EditorLineDecorationsWidth = class extends BaseEditorOption { + constructor() { + super(74, "lineDecorationsWidth", 10); + } + validate(input) { + if (typeof input === "string" && /^\d+(\.\d+)?ch$/.test(input)) { + const multiple = parseFloat(input.substring(0, input.length - 2)); + return -multiple; + } else { + return EditorIntOption.clampedInt(input, this.defaultValue, 0, 1e3); + } + } + compute(env2, options2, value) { + if (value < 0) { + return EditorIntOption.clampedInt(-value * env2.fontInfo.typicalHalfwidthCharacterWidth, this.defaultValue, 0, 1e3); + } else { + return value; + } + } +}; +var EditorLineHeight = class extends EditorFloatOption { + constructor() { + super(75, "lineHeight", EDITOR_FONT_DEFAULTS.lineHeight, (x) => EditorFloatOption.clamp(x, 0, 150), { markdownDescription: localize(275, "Controls the line height. \n - Use 0 to automatically compute the line height from the font size.\n - Values between 0 and 8 will be used as a multiplier with the font size.\n - Values greater than or equal to 8 will be used as effective values.") }, 0, 150); + } + compute(env2, options2, value) { + return env2.fontInfo.lineHeight; + } +}; +var EditorMinimap = class extends BaseEditorOption { + constructor() { + const defaults = { + enabled: true, + size: "proportional", + side: "right", + showSlider: "mouseover", + autohide: "none", + renderCharacters: true, + maxColumn: 120, + scale: 1, + showRegionSectionHeaders: true, + showMarkSectionHeaders: true, + markSectionHeaderRegex: "\\bMARK:\\s*(?-?)\\s*(?/i.test(cap[0])) { + this.lexer.state.inLink = false; + } + if (!this.lexer.state.inRawBlock && /^<(pre|code|kbd|script)(\s|>)/i.test(cap[0])) { + this.lexer.state.inRawBlock = true; + } else if (this.lexer.state.inRawBlock && /^<\/(pre|code|kbd|script)(\s|>)/i.test(cap[0])) { + this.lexer.state.inRawBlock = false; + } + return { + type: "html", + raw: cap[0], + inLink: this.lexer.state.inLink, + inRawBlock: this.lexer.state.inRawBlock, + block: false, + text: cap[0] + }; + } + } + link(src) { + const cap = this.rules.inline.link.exec(src); + if (cap) { + const trimmedUrl = cap[2].trim(); + if (!this.options.pedantic && /^$/.test(trimmedUrl)) { + return; + } + const rtrimSlash = rtrim2(trimmedUrl.slice(0, -1), "\\"); + if ((trimmedUrl.length - rtrimSlash.length) % 2 === 0) { + return; + } + } else { + const lastParenIndex = findClosingBracket(cap[2], "()"); + if (lastParenIndex > -1) { + const start = cap[0].indexOf("!") === 0 ? 5 : 4; + const linkLen = start + cap[1].length + lastParenIndex; + cap[2] = cap[2].substring(0, lastParenIndex); + cap[0] = cap[0].substring(0, linkLen).trim(); + cap[3] = ""; + } + } + let href = cap[2]; + let title = ""; + if (this.options.pedantic) { + const link2 = /^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(href); + if (link2) { + href = link2[1]; + title = link2[3]; + } + } else { + title = cap[3] ? cap[3].slice(1, -1) : ""; + } + href = href.trim(); + if (/^$/.test(trimmedUrl)) { + href = href.slice(1); + } else { + href = href.slice(1, -1); + } + } + return outputLink(cap, { + href: href ? href.replace(this.rules.inline.anyPunctuation, "$1") : href, + title: title ? title.replace(this.rules.inline.anyPunctuation, "$1") : title + }, cap[0], this.lexer); + } + } + reflink(src, links) { + let cap; + if ((cap = this.rules.inline.reflink.exec(src)) || (cap = this.rules.inline.nolink.exec(src))) { + const linkString = (cap[2] || cap[1]).replace(/\s+/g, " "); + const link2 = links[linkString.toLowerCase()]; + if (!link2) { + const text2 = cap[0].charAt(0); + return { + type: "text", + raw: text2, + text: text2 + }; + } + return outputLink(cap, link2, cap[0], this.lexer); + } + } + emStrong(src, maskedSrc, prevChar = "") { + let match2 = this.rules.inline.emStrongLDelim.exec(src); + if (!match2) + return; + if (match2[3] && prevChar.match(/[\p{L}\p{N}]/u)) + return; + const nextChar = match2[1] || match2[2] || ""; + if (!nextChar || !prevChar || this.rules.inline.punctuation.exec(prevChar)) { + const lLength = [...match2[0]].length - 1; + let rDelim, rLength, delimTotal = lLength, midDelimTotal = 0; + const endReg = match2[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd; + endReg.lastIndex = 0; + maskedSrc = maskedSrc.slice(-1 * src.length + lLength); + while ((match2 = endReg.exec(maskedSrc)) != null) { + rDelim = match2[1] || match2[2] || match2[3] || match2[4] || match2[5] || match2[6]; + if (!rDelim) + continue; + rLength = [...rDelim].length; + if (match2[3] || match2[4]) { + delimTotal += rLength; + continue; + } else if (match2[5] || match2[6]) { + if (lLength % 3 && !((lLength + rLength) % 3)) { + midDelimTotal += rLength; + continue; + } + } + delimTotal -= rLength; + if (delimTotal > 0) + continue; + rLength = Math.min(rLength, rLength + delimTotal + midDelimTotal); + const lastCharLength = [...match2[0]][0].length; + const raw = src.slice(0, lLength + match2.index + lastCharLength + rLength); + if (Math.min(lLength, rLength) % 2) { + const text3 = raw.slice(1, -1); + return { + type: "em", + raw, + text: text3, + tokens: this.lexer.inlineTokens(text3) + }; + } + const text2 = raw.slice(2, -2); + return { + type: "strong", + raw, + text: text2, + tokens: this.lexer.inlineTokens(text2) + }; + } + } + } + codespan(src) { + const cap = this.rules.inline.code.exec(src); + if (cap) { + let text2 = cap[2].replace(/\n/g, " "); + const hasNonSpaceChars = /[^ ]/.test(text2); + const hasSpaceCharsOnBothEnds = /^ /.test(text2) && / $/.test(text2); + if (hasNonSpaceChars && hasSpaceCharsOnBothEnds) { + text2 = text2.substring(1, text2.length - 1); + } + text2 = escape$1(text2, true); + return { + type: "codespan", + raw: cap[0], + text: text2 + }; + } + } + br(src) { + const cap = this.rules.inline.br.exec(src); + if (cap) { + return { + type: "br", + raw: cap[0] + }; + } + } + del(src) { + const cap = this.rules.inline.del.exec(src); + if (cap) { + return { + type: "del", + raw: cap[0], + text: cap[2], + tokens: this.lexer.inlineTokens(cap[2]) + }; + } + } + autolink(src) { + const cap = this.rules.inline.autolink.exec(src); + if (cap) { + let text2, href; + if (cap[2] === "@") { + text2 = escape$1(cap[1]); + href = "mailto:" + text2; + } else { + text2 = escape$1(cap[1]); + href = text2; + } + return { + type: "link", + raw: cap[0], + text: text2, + href, + tokens: [ + { + type: "text", + raw: text2, + text: text2 + } + ] + }; + } + } + url(src) { + let cap; + if (cap = this.rules.inline.url.exec(src)) { + let text2, href; + if (cap[2] === "@") { + text2 = escape$1(cap[0]); + href = "mailto:" + text2; + } else { + let prevCapZero; + do { + prevCapZero = cap[0]; + cap[0] = this.rules.inline._backpedal.exec(cap[0])?.[0] ?? ""; + } while (prevCapZero !== cap[0]); + text2 = escape$1(cap[0]); + if (cap[1] === "www.") { + href = "http://" + cap[0]; + } else { + href = cap[0]; + } + } + return { + type: "link", + raw: cap[0], + text: text2, + href, + tokens: [ + { + type: "text", + raw: text2, + text: text2 + } + ] + }; + } + } + inlineText(src) { + const cap = this.rules.inline.text.exec(src); + if (cap) { + let text2; + if (this.lexer.state.inRawBlock) { + text2 = cap[0]; + } else { + text2 = escape$1(cap[0]); + } + return { + type: "text", + raw: cap[0], + text: text2 + }; + } + } +}; +var newline = /^(?: *(?:\n|$))+/; +var blockCode = /^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/; +var fences = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/; +var hr = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/; +var heading = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/; +var bullet = /(?:[*+-]|\d{1,9}[.)])/; +var lheading = edit(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g, bullet).replace(/blockCode/g, / {4}/).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/).getRegex(); +var _paragraph = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/; +var blockText = /^[^\n]+/; +var _blockLabel = /(?!\s*\])(?:\\.|[^\[\]\\])+/; +var def = edit(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label", _blockLabel).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(); +var list = edit(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, bullet).getRegex(); +var _tag = "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"; +var _comment = /|$))/; +var html = edit("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))", "i").replace("comment", _comment).replace("tag", _tag).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(); +var paragraph = edit(_paragraph).replace("hr", hr).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[.)]) ").replace("html", ")|<(?:script|pre|style|textarea|!--)").replace("tag", _tag).getRegex(); +var blockquote = edit(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", paragraph).getRegex(); +var blockNormal = { + blockquote, + code: blockCode, + def, + fences, + heading, + hr, + html, + lheading, + list, + newline, + paragraph, + table: noopTest, + text: blockText +}; +var gfmTable = edit("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", hr).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", " {4}[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", ")|<(?:script|pre|style|textarea|!--)").replace("tag", _tag).getRegex(); +var blockGfm = { + ...blockNormal, + table: gfmTable, + paragraph: edit(_paragraph).replace("hr", hr).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", gfmTable).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", ")|<(?:script|pre|style|textarea|!--)").replace("tag", _tag).getRegex() +}; +var blockPedantic = { + ...blockNormal, + html: edit(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", _comment).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: /^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/, + heading: /^(#{1,6})(.*)(?:\n+|$)/, + fences: noopTest, + // fences not supported + lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, + paragraph: edit(_paragraph).replace("hr", hr).replace("heading", " *#{1,6} *[^\n]").replace("lheading", lheading).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() +}; +var escape2 = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/; +var inlineCode = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/; +var br = /^( {2,}|\\)\n(?!\s*$)/; +var inlineText = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\]*?>/g; +var emStrongLDelim = edit(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/, "u").replace(/punct/g, _punctuation).getRegex(); +var emStrongRDelimAst = edit("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])", "gu").replace(/punct/g, _punctuation).getRegex(); +var emStrongRDelimUnd = edit("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])", "gu").replace(/punct/g, _punctuation).getRegex(); +var anyPunctuation = edit(/\\([punct])/, "gu").replace(/punct/g, _punctuation).getRegex(); +var autolink = edit(/^<(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(); +var _inlineComment = edit(_comment).replace("(?:-->|$)", "-->").getRegex(); +var tag = edit("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment", _inlineComment).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(); +var _inlineLabel = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/; +var link = edit(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label", _inlineLabel).replace("href", /<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(); +var reflink = edit(/^!?\[(label)\]\[(ref)\]/).replace("label", _inlineLabel).replace("ref", _blockLabel).getRegex(); +var nolink = edit(/^!?\[(ref)\](?:\[\])?/).replace("ref", _blockLabel).getRegex(); +var reflinkSearch = edit("reflink|nolink(?!\\()", "g").replace("reflink", reflink).replace("nolink", nolink).getRegex(); +var inlineNormal = { + _backpedal: noopTest, + // only used for GFM url + anyPunctuation, + autolink, + blockSkip, + br, + code: inlineCode, + del: noopTest, + emStrongLDelim, + emStrongRDelimAst, + emStrongRDelimUnd, + escape: escape2, + link, + nolink, + punctuation, + reflink, + reflinkSearch, + tag, + text: inlineText, + url: noopTest +}; +var inlinePedantic = { + ...inlineNormal, + link: edit(/^!?\[(label)\]\((.*?)\)/).replace("label", _inlineLabel).getRegex(), + reflink: edit(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", _inlineLabel).getRegex() +}; +var inlineGfm = { + ...inlineNormal, + escape: edit(escape2).replace("])", "~|])").getRegex(), + url: edit(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/, "i").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~])\1(?=[^~]|$)/, + text: /^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\ { + return leading + " ".repeat(tabs.length); + }); + } + let token; + let lastToken; + let cutSrc; + while (src) { + if (this.options.extensions && this.options.extensions.block && this.options.extensions.block.some((extTokenizer) => { + if (token = extTokenizer.call({ lexer: this }, src, tokens)) { + src = src.substring(token.raw.length); + tokens.push(token); + return true; + } + return false; + })) { + continue; + } + if (token = this.tokenizer.space(src)) { + src = src.substring(token.raw.length); + if (token.raw.length === 1 && tokens.length > 0) { + tokens[tokens.length - 1].raw += "\n"; + } else { + tokens.push(token); + } + continue; + } + if (token = this.tokenizer.code(src)) { + src = src.substring(token.raw.length); + lastToken = tokens[tokens.length - 1]; + if (lastToken && (lastToken.type === "paragraph" || lastToken.type === "text")) { + lastToken.raw += "\n" + token.raw; + lastToken.text += "\n" + token.text; + this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text; + } else { + tokens.push(token); + } + continue; + } + if (token = this.tokenizer.fences(src)) { + src = src.substring(token.raw.length); + tokens.push(token); + continue; + } + if (token = this.tokenizer.heading(src)) { + src = src.substring(token.raw.length); + tokens.push(token); + continue; + } + if (token = this.tokenizer.hr(src)) { + src = src.substring(token.raw.length); + tokens.push(token); + continue; + } + if (token = this.tokenizer.blockquote(src)) { + src = src.substring(token.raw.length); + tokens.push(token); + continue; + } + if (token = this.tokenizer.list(src)) { + src = src.substring(token.raw.length); + tokens.push(token); + continue; + } + if (token = this.tokenizer.html(src)) { + src = src.substring(token.raw.length); + tokens.push(token); + continue; + } + if (token = this.tokenizer.def(src)) { + src = src.substring(token.raw.length); + lastToken = tokens[tokens.length - 1]; + if (lastToken && (lastToken.type === "paragraph" || lastToken.type === "text")) { + lastToken.raw += "\n" + token.raw; + lastToken.text += "\n" + token.raw; + this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text; + } else if (!this.tokens.links[token.tag]) { + this.tokens.links[token.tag] = { + href: token.href, + title: token.title + }; + } + continue; + } + if (token = this.tokenizer.table(src)) { + src = src.substring(token.raw.length); + tokens.push(token); + continue; + } + if (token = this.tokenizer.lheading(src)) { + src = src.substring(token.raw.length); + tokens.push(token); + continue; + } + cutSrc = src; + if (this.options.extensions && this.options.extensions.startBlock) { + let startIndex = Infinity; + const tempSrc = src.slice(1); + let tempStart; + this.options.extensions.startBlock.forEach((getStartIndex) => { + tempStart = getStartIndex.call({ lexer: this }, tempSrc); + if (typeof tempStart === "number" && tempStart >= 0) { + startIndex = Math.min(startIndex, tempStart); + } + }); + if (startIndex < Infinity && startIndex >= 0) { + cutSrc = src.substring(0, startIndex + 1); + } + } + if (this.state.top && (token = this.tokenizer.paragraph(cutSrc))) { + lastToken = tokens[tokens.length - 1]; + if (lastParagraphClipped && lastToken?.type === "paragraph") { + lastToken.raw += "\n" + token.raw; + lastToken.text += "\n" + token.text; + this.inlineQueue.pop(); + this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text; + } else { + tokens.push(token); + } + lastParagraphClipped = cutSrc.length !== src.length; + src = src.substring(token.raw.length); + continue; + } + if (token = this.tokenizer.text(src)) { + src = src.substring(token.raw.length); + lastToken = tokens[tokens.length - 1]; + if (lastToken && lastToken.type === "text") { + lastToken.raw += "\n" + token.raw; + lastToken.text += "\n" + token.text; + this.inlineQueue.pop(); + this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text; + } else { + tokens.push(token); + } + continue; + } + if (src) { + const errMsg = "Infinite loop on byte: " + src.charCodeAt(0); + if (this.options.silent) { + console.error(errMsg); + break; + } else { + throw new Error(errMsg); + } + } + } + this.state.top = true; + return tokens; + } + inline(src, tokens = []) { + this.inlineQueue.push({ src, tokens }); + return tokens; + } + /** + * Lexing/Compiling + */ + inlineTokens(src, tokens = []) { + let token, lastToken, cutSrc; + let maskedSrc = src; + let match2; + let keepPrevChar, prevChar; + if (this.tokens.links) { + const links = Object.keys(this.tokens.links); + if (links.length > 0) { + while ((match2 = this.tokenizer.rules.inline.reflinkSearch.exec(maskedSrc)) != null) { + if (links.includes(match2[0].slice(match2[0].lastIndexOf("[") + 1, -1))) { + maskedSrc = maskedSrc.slice(0, match2.index) + "[" + "a".repeat(match2[0].length - 2) + "]" + maskedSrc.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex); + } + } + } + } + while ((match2 = this.tokenizer.rules.inline.blockSkip.exec(maskedSrc)) != null) { + maskedSrc = maskedSrc.slice(0, match2.index) + "[" + "a".repeat(match2[0].length - 2) + "]" + maskedSrc.slice(this.tokenizer.rules.inline.blockSkip.lastIndex); + } + while ((match2 = this.tokenizer.rules.inline.anyPunctuation.exec(maskedSrc)) != null) { + maskedSrc = maskedSrc.slice(0, match2.index) + "++" + maskedSrc.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex); + } + while (src) { + if (!keepPrevChar) { + prevChar = ""; + } + keepPrevChar = false; + if (this.options.extensions && this.options.extensions.inline && this.options.extensions.inline.some((extTokenizer) => { + if (token = extTokenizer.call({ lexer: this }, src, tokens)) { + src = src.substring(token.raw.length); + tokens.push(token); + return true; + } + return false; + })) { + continue; + } + if (token = this.tokenizer.escape(src)) { + src = src.substring(token.raw.length); + tokens.push(token); + continue; + } + if (token = this.tokenizer.tag(src)) { + src = src.substring(token.raw.length); + lastToken = tokens[tokens.length - 1]; + if (lastToken && token.type === "text" && lastToken.type === "text") { + lastToken.raw += token.raw; + lastToken.text += token.text; + } else { + tokens.push(token); + } + continue; + } + if (token = this.tokenizer.link(src)) { + src = src.substring(token.raw.length); + tokens.push(token); + continue; + } + if (token = this.tokenizer.reflink(src, this.tokens.links)) { + src = src.substring(token.raw.length); + lastToken = tokens[tokens.length - 1]; + if (lastToken && token.type === "text" && lastToken.type === "text") { + lastToken.raw += token.raw; + lastToken.text += token.text; + } else { + tokens.push(token); + } + continue; + } + if (token = this.tokenizer.emStrong(src, maskedSrc, prevChar)) { + src = src.substring(token.raw.length); + tokens.push(token); + continue; + } + if (token = this.tokenizer.codespan(src)) { + src = src.substring(token.raw.length); + tokens.push(token); + continue; + } + if (token = this.tokenizer.br(src)) { + src = src.substring(token.raw.length); + tokens.push(token); + continue; + } + if (token = this.tokenizer.del(src)) { + src = src.substring(token.raw.length); + tokens.push(token); + continue; + } + if (token = this.tokenizer.autolink(src)) { + src = src.substring(token.raw.length); + tokens.push(token); + continue; + } + if (!this.state.inLink && (token = this.tokenizer.url(src))) { + src = src.substring(token.raw.length); + tokens.push(token); + continue; + } + cutSrc = src; + if (this.options.extensions && this.options.extensions.startInline) { + let startIndex = Infinity; + const tempSrc = src.slice(1); + let tempStart; + this.options.extensions.startInline.forEach((getStartIndex) => { + tempStart = getStartIndex.call({ lexer: this }, tempSrc); + if (typeof tempStart === "number" && tempStart >= 0) { + startIndex = Math.min(startIndex, tempStart); + } + }); + if (startIndex < Infinity && startIndex >= 0) { + cutSrc = src.substring(0, startIndex + 1); + } + } + if (token = this.tokenizer.inlineText(cutSrc)) { + src = src.substring(token.raw.length); + if (token.raw.slice(-1) !== "_") { + prevChar = token.raw.slice(-1); + } + keepPrevChar = true; + lastToken = tokens[tokens.length - 1]; + if (lastToken && lastToken.type === "text") { + lastToken.raw += token.raw; + lastToken.text += token.text; + } else { + tokens.push(token); + } + continue; + } + if (src) { + const errMsg = "Infinite loop on byte: " + src.charCodeAt(0); + if (this.options.silent) { + console.error(errMsg); + break; + } else { + throw new Error(errMsg); + } + } + } + return tokens; + } +}; +var _Renderer = class { + options; + parser; + // set by the parser + constructor(options2) { + this.options = options2 || _defaults; + } + space(token) { + return ""; + } + code({ text: text2, lang, escaped }) { + const langString = (lang || "").match(/^\S*/)?.[0]; + const code = text2.replace(/\n$/, "") + "\n"; + if (!langString) { + return "
" + (escaped ? code : escape$1(code, true)) + "
\n"; + } + return '
' + (escaped ? code : escape$1(code, true)) + "
\n"; + } + blockquote({ tokens }) { + const body = this.parser.parse(tokens); + return `
+${body}
+`; + } + html({ text: text2 }) { + return text2; + } + heading({ tokens, depth }) { + return `${this.parser.parseInline(tokens)} +`; + } + hr(token) { + return "
\n"; + } + list(token) { + const ordered = token.ordered; + const start = token.start; + let body = ""; + for (let j = 0; j < token.items.length; j++) { + const item = token.items[j]; + body += this.listitem(item); + } + const type = ordered ? "ol" : "ul"; + const startAttr = ordered && start !== 1 ? ' start="' + start + '"' : ""; + return "<" + type + startAttr + ">\n" + body + "\n"; + } + listitem(item) { + let itemBody = ""; + if (item.task) { + const checkbox = this.checkbox({ checked: !!item.checked }); + if (item.loose) { + if (item.tokens.length > 0 && item.tokens[0].type === "paragraph") { + item.tokens[0].text = checkbox + " " + item.tokens[0].text; + if (item.tokens[0].tokens && item.tokens[0].tokens.length > 0 && item.tokens[0].tokens[0].type === "text") { + item.tokens[0].tokens[0].text = checkbox + " " + item.tokens[0].tokens[0].text; + } + } else { + item.tokens.unshift({ + type: "text", + raw: checkbox + " ", + text: checkbox + " " + }); + } + } else { + itemBody += checkbox + " "; + } + } + itemBody += this.parser.parse(item.tokens, !!item.loose); + return `
  • ${itemBody}
  • +`; + } + checkbox({ checked }) { + return "'; + } + paragraph({ tokens }) { + return `

    ${this.parser.parseInline(tokens)}

    +`; + } + table(token) { + let header2 = ""; + let cell = ""; + for (let j = 0; j < token.header.length; j++) { + cell += this.tablecell(token.header[j]); + } + header2 += this.tablerow({ text: cell }); + let body = ""; + for (let j = 0; j < token.rows.length; j++) { + const row = token.rows[j]; + cell = ""; + for (let k = 0; k < row.length; k++) { + cell += this.tablecell(row[k]); + } + body += this.tablerow({ text: cell }); + } + if (body) + body = `${body}`; + return "\n\n" + header2 + "\n" + body + "
    \n"; + } + tablerow({ text: text2 }) { + return ` +${text2} +`; + } + tablecell(token) { + const content = this.parser.parseInline(token.tokens); + const type = token.header ? "th" : "td"; + const tag2 = token.align ? `<${type} align="${token.align}">` : `<${type}>`; + return tag2 + content + ` +`; + } + /** + * span level renderer + */ + strong({ tokens }) { + return `${this.parser.parseInline(tokens)}`; + } + em({ tokens }) { + return `${this.parser.parseInline(tokens)}`; + } + codespan({ text: text2 }) { + return `${text2}`; + } + br(token) { + return "
    "; + } + del({ tokens }) { + return `${this.parser.parseInline(tokens)}`; + } + link({ href, title, tokens }) { + const text2 = this.parser.parseInline(tokens); + const cleanHref = cleanUrl(href); + if (cleanHref === null) { + return text2; + } + href = cleanHref; + let out = '
    "; + return out; + } + image({ href, title, text: text2 }) { + const cleanHref = cleanUrl(href); + if (cleanHref === null) { + return text2; + } + href = cleanHref; + let out = `${text2} { + const tokens2 = genericToken[childTokens].flat(Infinity); + values = values.concat(this.walkTokens(tokens2, callback)); + }); + } else if (genericToken.tokens) { + values = values.concat(this.walkTokens(genericToken.tokens, callback)); + } + } + } + } + return values; + } + use(...args) { + const extensions = this.defaults.extensions || { renderers: {}, childTokens: {} }; + args.forEach((pack) => { + const opts = { ...pack }; + opts.async = this.defaults.async || opts.async || false; + if (pack.extensions) { + pack.extensions.forEach((ext) => { + if (!ext.name) { + throw new Error("extension name required"); + } + if ("renderer" in ext) { + const prevRenderer = extensions.renderers[ext.name]; + if (prevRenderer) { + extensions.renderers[ext.name] = function(...args2) { + let ret = ext.renderer.apply(this, args2); + if (ret === false) { + ret = prevRenderer.apply(this, args2); + } + return ret; + }; + } else { + extensions.renderers[ext.name] = ext.renderer; + } + } + if ("tokenizer" in ext) { + if (!ext.level || ext.level !== "block" && ext.level !== "inline") { + throw new Error("extension level must be 'block' or 'inline'"); + } + const extLevel = extensions[ext.level]; + if (extLevel) { + extLevel.unshift(ext.tokenizer); + } else { + extensions[ext.level] = [ext.tokenizer]; + } + if (ext.start) { + if (ext.level === "block") { + if (extensions.startBlock) { + extensions.startBlock.push(ext.start); + } else { + extensions.startBlock = [ext.start]; + } + } else if (ext.level === "inline") { + if (extensions.startInline) { + extensions.startInline.push(ext.start); + } else { + extensions.startInline = [ext.start]; + } + } + } + } + if ("childTokens" in ext && ext.childTokens) { + extensions.childTokens[ext.name] = ext.childTokens; + } + }); + opts.extensions = extensions; + } + if (pack.renderer) { + const renderer = this.defaults.renderer || new _Renderer(this.defaults); + for (const prop in pack.renderer) { + if (!(prop in renderer)) { + throw new Error(`renderer '${prop}' does not exist`); + } + if (["options", "parser"].includes(prop)) { + continue; + } + const rendererProp = prop; + const rendererFunc = pack.renderer[rendererProp]; + const prevRenderer = renderer[rendererProp]; + renderer[rendererProp] = (...args2) => { + let ret = rendererFunc.apply(renderer, args2); + if (ret === false) { + ret = prevRenderer.apply(renderer, args2); + } + return ret || ""; + }; + } + opts.renderer = renderer; + } + if (pack.tokenizer) { + const tokenizer = this.defaults.tokenizer || new _Tokenizer(this.defaults); + for (const prop in pack.tokenizer) { + if (!(prop in tokenizer)) { + throw new Error(`tokenizer '${prop}' does not exist`); + } + if (["options", "rules", "lexer"].includes(prop)) { + continue; + } + const tokenizerProp = prop; + const tokenizerFunc = pack.tokenizer[tokenizerProp]; + const prevTokenizer = tokenizer[tokenizerProp]; + tokenizer[tokenizerProp] = (...args2) => { + let ret = tokenizerFunc.apply(tokenizer, args2); + if (ret === false) { + ret = prevTokenizer.apply(tokenizer, args2); + } + return ret; + }; + } + opts.tokenizer = tokenizer; + } + if (pack.hooks) { + const hooks = this.defaults.hooks || new _Hooks(); + for (const prop in pack.hooks) { + if (!(prop in hooks)) { + throw new Error(`hook '${prop}' does not exist`); + } + if (prop === "options") { + continue; + } + const hooksProp = prop; + const hooksFunc = pack.hooks[hooksProp]; + const prevHook = hooks[hooksProp]; + if (_Hooks.passThroughHooks.has(prop)) { + hooks[hooksProp] = (arg) => { + if (this.defaults.async) { + return Promise.resolve(hooksFunc.call(hooks, arg)).then((ret2) => { + return prevHook.call(hooks, ret2); + }); + } + const ret = hooksFunc.call(hooks, arg); + return prevHook.call(hooks, ret); + }; + } else { + hooks[hooksProp] = (...args2) => { + let ret = hooksFunc.apply(hooks, args2); + if (ret === false) { + ret = prevHook.apply(hooks, args2); + } + return ret; + }; + } + } + opts.hooks = hooks; + } + if (pack.walkTokens) { + const walkTokens2 = this.defaults.walkTokens; + const packWalktokens = pack.walkTokens; + opts.walkTokens = function(token) { + let values = []; + values.push(packWalktokens.call(this, token)); + if (walkTokens2) { + values = values.concat(walkTokens2.call(this, token)); + } + return values; + }; + } + this.defaults = { ...this.defaults, ...opts }; + }); + return this; + } + setOptions(opt) { + this.defaults = { ...this.defaults, ...opt }; + return this; + } + lexer(src, options2) { + return _Lexer.lex(src, options2 ?? this.defaults); + } + parser(tokens, options2) { + return _Parser.parse(tokens, options2 ?? this.defaults); + } + parseMarkdown(lexer2, parser2) { + const parse4 = (src, options2) => { + const origOpt = { ...options2 }; + const opt = { ...this.defaults, ...origOpt }; + const throwError = this.onError(!!opt.silent, !!opt.async); + if (this.defaults.async === true && origOpt.async === false) { + return throwError(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 src === "undefined" || src === null) { + return throwError(new Error("marked(): input parameter is undefined or null")); + } + if (typeof src !== "string") { + return throwError(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(src) + ", string expected")); + } + if (opt.hooks) { + opt.hooks.options = opt; + } + if (opt.async) { + return Promise.resolve(opt.hooks ? opt.hooks.preprocess(src) : src).then((src2) => lexer2(src2, opt)).then((tokens) => opt.hooks ? opt.hooks.processAllTokens(tokens) : tokens).then((tokens) => opt.walkTokens ? Promise.all(this.walkTokens(tokens, opt.walkTokens)).then(() => tokens) : tokens).then((tokens) => parser2(tokens, opt)).then((html3) => opt.hooks ? opt.hooks.postprocess(html3) : html3).catch(throwError); + } + try { + if (opt.hooks) { + src = opt.hooks.preprocess(src); + } + let tokens = lexer2(src, opt); + if (opt.hooks) { + tokens = opt.hooks.processAllTokens(tokens); + } + if (opt.walkTokens) { + this.walkTokens(tokens, opt.walkTokens); + } + let html3 = parser2(tokens, opt); + if (opt.hooks) { + html3 = opt.hooks.postprocess(html3); + } + return html3; + } catch (e) { + return throwError(e); + } + }; + return parse4; + } + onError(silent, async) { + return (e) => { + e.message += "\nPlease report this to https://github.com/markedjs/marked."; + if (silent) { + const msg = "

    An error occurred:

    " + escape$1(e.message + "", true) + "
    "; + if (async) { + return Promise.resolve(msg); + } + return msg; + } + if (async) { + return Promise.reject(e); + } + throw e; + }; + } +}; +var markedInstance = new Marked(); +function marked(src, opt) { + return markedInstance.parse(src, opt); +} +marked.options = marked.setOptions = function(options2) { + markedInstance.setOptions(options2); + marked.defaults = markedInstance.defaults; + changeDefaults(marked.defaults); + return marked; +}; +marked.getDefaults = _getDefaults; +marked.defaults = _defaults; +marked.use = function(...args) { + markedInstance.use(...args); + marked.defaults = markedInstance.defaults; + changeDefaults(marked.defaults); + return marked; +}; +marked.walkTokens = function(tokens, callback) { + return markedInstance.walkTokens(tokens, callback); +}; +marked.parseInline = markedInstance.parseInline; +marked.Parser = _Parser; +marked.parser = _Parser.parse; +marked.Renderer = _Renderer; +marked.TextRenderer = _TextRenderer; +marked.Lexer = _Lexer; +marked.lexer = _Lexer.lex; +marked.Tokenizer = _Tokenizer; +marked.Hooks = _Hooks; +marked.parse = marked; +var options = marked.options; +var setOptions = marked.setOptions; +var use = marked.use; +var walkTokens = marked.walkTokens; +var parseInline = marked.parseInline; +var parse = marked; +var parser = _Parser.parse; +var lexer = _Lexer.lex; + +// node_modules/monaco-editor-core/esm/vs/base/common/marshalling.js +init_buffer(); +init_uri(); +function stringify(obj) { + return JSON.stringify(obj, replacer); +} +function parse2(text2) { + let data = JSON.parse(text2); + data = revive(data); + return data; +} +function replacer(key, value) { + if (value instanceof RegExp) { + return { + $mid: 2, + source: value.source, + flags: value.flags + }; + } + return value; +} +function revive(obj, depth = 0) { + if (!obj || depth > 200) { + return obj; + } + if (typeof obj === "object") { + switch (obj.$mid) { + // eslint-disable-next-line local/code-no-any-casts + case 1: + return URI.revive(obj); + // eslint-disable-next-line local/code-no-any-casts + case 2: + return new RegExp(obj.source, obj.flags); + // eslint-disable-next-line local/code-no-any-casts + case 17: + return new Date(obj.source); + } + if (obj instanceof VSBuffer || obj instanceof Uint8Array) { + return obj; + } + if (Array.isArray(obj)) { + for (let i2 = 0; i2 < obj.length; ++i2) { + obj[i2] = revive(obj[i2], depth + 1); + } + } else { + for (const key in obj) { + if (Object.hasOwnProperty.call(obj, key)) { + obj[key] = revive(obj[key], depth + 1); + } + } + } + } + return obj; +} + +// node_modules/monaco-editor-core/esm/vs/base/browser/markdownRenderer.js +init_network(); +init_objects(); +init_resources(); +init_strings(); +init_uri(); +init_dom(); + +// node_modules/monaco-editor-core/esm/vs/base/browser/domSanitize.js +init_network(); +init_dom(); + +// node_modules/monaco-editor-core/esm/vs/base/browser/dompurify/dompurify.js +var { + entries, + setPrototypeOf, + isFrozen, + getPrototypeOf, + getOwnPropertyDescriptor +} = Object; +var { + freeze, + seal, + create +} = Object; +var { + apply, + construct +} = typeof Reflect !== "undefined" && Reflect; +if (!freeze) { + freeze = function freeze3(x) { + return x; + }; +} +if (!seal) { + seal = function seal2(x) { + return x; + }; +} +if (!apply) { + apply = function apply2(func, thisArg) { + for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { + args[_key - 2] = arguments[_key]; + } + return func.apply(thisArg, args); + }; +} +if (!construct) { + construct = function construct2(Func) { + for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { + args[_key2 - 1] = arguments[_key2]; + } + return new Func(...args); + }; +} +var arrayForEach = unapply(Array.prototype.forEach); +var arrayLastIndexOf = unapply(Array.prototype.lastIndexOf); +var arrayPop = unapply(Array.prototype.pop); +var arrayPush = unapply(Array.prototype.push); +var arraySplice = unapply(Array.prototype.splice); +var stringToLowerCase = unapply(String.prototype.toLowerCase); +var stringToString = unapply(String.prototype.toString); +var stringMatch = unapply(String.prototype.match); +var stringReplace = unapply(String.prototype.replace); +var stringIndexOf = unapply(String.prototype.indexOf); +var stringTrim = unapply(String.prototype.trim); +var objectHasOwnProperty = unapply(Object.prototype.hasOwnProperty); +var regExpTest = unapply(RegExp.prototype.test); +var typeErrorCreate = unconstruct(TypeError); +function unapply(func) { + return function(thisArg) { + if (thisArg instanceof RegExp) { + thisArg.lastIndex = 0; + } + for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) { + args[_key3 - 1] = arguments[_key3]; + } + return apply(func, thisArg, args); + }; +} +function unconstruct(Func) { + return function() { + for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { + args[_key4] = arguments[_key4]; + } + return construct(Func, args); + }; +} +function addToSet(set, array2) { + let transformCaseFunc = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : stringToLowerCase; + if (setPrototypeOf) { + setPrototypeOf(set, null); + } + let l = array2.length; + while (l--) { + let element = array2[l]; + if (typeof element === "string") { + const lcElement = transformCaseFunc(element); + if (lcElement !== element) { + if (!isFrozen(array2)) { + array2[l] = lcElement; + } + element = lcElement; + } + } + set[element] = true; + } + return set; +} +function cleanArray(array2) { + for (let index = 0; index < array2.length; index++) { + const isPropertyExist = objectHasOwnProperty(array2, index); + if (!isPropertyExist) { + array2[index] = null; + } + } + return array2; +} +function clone(object) { + const newObject = create(null); + for (const [property, value] of entries(object)) { + const isPropertyExist = objectHasOwnProperty(object, property); + if (isPropertyExist) { + if (Array.isArray(value)) { + newObject[property] = cleanArray(value); + } else if (value && typeof value === "object" && value.constructor === Object) { + newObject[property] = clone(value); + } else { + newObject[property] = value; + } + } + } + return newObject; +} +function lookupGetter(object, prop) { + while (object !== null) { + const desc = getOwnPropertyDescriptor(object, prop); + if (desc) { + if (desc.get) { + return unapply(desc.get); + } + if (typeof desc.value === "function") { + return unapply(desc.value); + } + } + object = getPrototypeOf(object); + } + function fallbackValue() { + return null; + } + return fallbackValue; +} +var html$1 = freeze(["a", "abbr", "acronym", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "decorator", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "element", "em", "fieldset", "figcaption", "figure", "font", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "marquee", "menu", "menuitem", "meter", "nav", "nobr", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "search", "section", "select", "shadow", "slot", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "tt", "u", "ul", "var", "video", "wbr"]); +var svg$1 = freeze(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "circle", "clippath", "defs", "desc", "ellipse", "enterkeyhint", "exportparts", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "inputmode", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "part", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "slot", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"]); +var svgFilters = freeze(["feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence"]); +var svgDisallowed = freeze(["animate", "color-profile", "cursor", "discard", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignobject", "hatch", "hatchpath", "mesh", "meshgradient", "meshpatch", "meshrow", "missing-glyph", "script", "set", "solidcolor", "unknown", "use"]); +var mathMl$1 = freeze(["math", "menclose", "merror", "mfenced", "mfrac", "mglyph", "mi", "mlabeledtr", "mmultiscripts", "mn", "mo", "mover", "mpadded", "mphantom", "mroot", "mrow", "ms", "mspace", "msqrt", "mstyle", "msub", "msup", "msubsup", "mtable", "mtd", "mtext", "mtr", "munder", "munderover", "mprescripts"]); +var mathMlDisallowed = freeze(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]); +var text = freeze(["#text"]); +var html2 = freeze(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "exportparts", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inert", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "part", "pattern", "placeholder", "playsinline", "popover", "popovertarget", "popovertargetaction", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "slot", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "wrap", "xmlns", "slot"]); +var svg = freeze(["accent-height", "accumulate", "additive", "alignment-baseline", "amplitude", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "exponent", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "intercept", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "slope", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "tablevalues", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]); +var mathMl = freeze(["accent", "accentunder", "align", "bevelled", "close", "columnsalign", "columnlines", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lspace", "lquote", "mathbackground", "mathcolor", "mathsize", "mathvariant", "maxsize", "minsize", "movablelimits", "notation", "numalign", "open", "rowalign", "rowlines", "rowspacing", "rowspan", "rspace", "rquote", "scriptlevel", "scriptminsize", "scriptsizemultiplier", "selection", "separator", "separators", "stretchy", "subscriptshift", "supscriptshift", "symmetric", "voffset", "width", "xmlns"]); +var xml = freeze(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]); +var MUSTACHE_EXPR = seal(/\{\{[\w\W]*|[\w\W]*\}\}/gm); +var ERB_EXPR = seal(/<%[\w\W]*|[\w\W]*%>/gm); +var TMPLIT_EXPR = seal(/\$\{[\w\W]*/gm); +var DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]+$/); +var ARIA_ATTR = seal(/^aria-[\-\w]+$/); +var IS_ALLOWED_URI = seal( + /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i + // eslint-disable-line no-useless-escape +); +var IS_SCRIPT_OR_DATA = seal(/^(?:\w+script|data):/i); +var ATTR_WHITESPACE = seal( + /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g + // eslint-disable-line no-control-regex +); +var DOCTYPE_NAME = seal(/^html$/i); +var CUSTOM_ELEMENT = seal(/^[a-z][.\w]*(-[.\w]+)+$/i); +var EXPRESSIONS = /* @__PURE__ */ Object.freeze({ + __proto__: null, + ARIA_ATTR, + ATTR_WHITESPACE, + CUSTOM_ELEMENT, + DATA_ATTR, + DOCTYPE_NAME, + ERB_EXPR, + IS_ALLOWED_URI, + IS_SCRIPT_OR_DATA, + MUSTACHE_EXPR, + TMPLIT_EXPR +}); +var NODE_TYPE = { + element: 1, + attribute: 2, + text: 3, + cdataSection: 4, + entityReference: 5, + // Deprecated + entityNode: 6, + // Deprecated + progressingInstruction: 7, + comment: 8, + document: 9, + documentType: 10, + documentFragment: 11, + notation: 12 + // Deprecated +}; +var getGlobal = function getGlobal2() { + return typeof window === "undefined" ? null : window; +}; +var _createTrustedTypesPolicy = function _createTrustedTypesPolicy2(trustedTypes, purifyHostElement) { + if (typeof trustedTypes !== "object" || typeof trustedTypes.createPolicy !== "function") { + return null; + } + let suffix = null; + const ATTR_NAME = "data-tt-policy-suffix"; + if (purifyHostElement && purifyHostElement.hasAttribute(ATTR_NAME)) { + suffix = purifyHostElement.getAttribute(ATTR_NAME); + } + const policyName = "dompurify" + (suffix ? "#" + suffix : ""); + try { + return trustedTypes.createPolicy(policyName, { + createHTML(html3) { + return html3; + }, + createScriptURL(scriptUrl) { + return scriptUrl; + } + }); + } catch (_) { + console.warn("TrustedTypes policy " + policyName + " could not be created."); + return null; + } +}; +var _createHooksMap = function _createHooksMap2() { + return { + afterSanitizeAttributes: [], + afterSanitizeElements: [], + afterSanitizeShadowDOM: [], + beforeSanitizeAttributes: [], + beforeSanitizeElements: [], + beforeSanitizeShadowDOM: [], + uponSanitizeAttribute: [], + uponSanitizeElement: [], + uponSanitizeShadowNode: [] + }; +}; +function createDOMPurify() { + let window2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : getGlobal(); + const DOMPurify = (root) => createDOMPurify(root); + DOMPurify.version = "3.2.7"; + DOMPurify.removed = []; + if (!window2 || !window2.document || window2.document.nodeType !== NODE_TYPE.document || !window2.Element) { + DOMPurify.isSupported = false; + return DOMPurify; + } + let { + document: document2 + } = window2; + const originalDocument = document2; + const currentScript = originalDocument.currentScript; + const { + DocumentFragment, + HTMLTemplateElement, + Node: Node4, + Element: Element2, + NodeFilter, + NamedNodeMap = window2.NamedNodeMap || window2.MozNamedAttrMap, + HTMLFormElement, + DOMParser, + trustedTypes + } = window2; + const ElementPrototype = Element2.prototype; + const cloneNode = lookupGetter(ElementPrototype, "cloneNode"); + const remove = lookupGetter(ElementPrototype, "remove"); + const getNextSibling = lookupGetter(ElementPrototype, "nextSibling"); + const getChildNodes = lookupGetter(ElementPrototype, "childNodes"); + const getParentNode = lookupGetter(ElementPrototype, "parentNode"); + if (typeof HTMLTemplateElement === "function") { + const template = document2.createElement("template"); + if (template.content && template.content.ownerDocument) { + document2 = template.content.ownerDocument; + } + } + let trustedTypesPolicy; + let emptyHTML = ""; + const { + implementation, + createNodeIterator, + createDocumentFragment, + getElementsByTagName + } = document2; + const { + importNode + } = originalDocument; + let hooks = _createHooksMap(); + DOMPurify.isSupported = typeof entries === "function" && typeof getParentNode === "function" && implementation && implementation.createHTMLDocument !== void 0; + const { + MUSTACHE_EXPR: MUSTACHE_EXPR2, + ERB_EXPR: ERB_EXPR2, + TMPLIT_EXPR: TMPLIT_EXPR2, + DATA_ATTR: DATA_ATTR2, + ARIA_ATTR: ARIA_ATTR2, + IS_SCRIPT_OR_DATA: IS_SCRIPT_OR_DATA2, + ATTR_WHITESPACE: ATTR_WHITESPACE2, + CUSTOM_ELEMENT: CUSTOM_ELEMENT2 + } = EXPRESSIONS; + let { + IS_ALLOWED_URI: IS_ALLOWED_URI$1 + } = EXPRESSIONS; + let ALLOWED_TAGS = null; + const DEFAULT_ALLOWED_TAGS = addToSet({}, [...html$1, ...svg$1, ...svgFilters, ...mathMl$1, ...text]); + let ALLOWED_ATTR = null; + const DEFAULT_ALLOWED_ATTR = addToSet({}, [...html2, ...svg, ...mathMl, ...xml]); + let CUSTOM_ELEMENT_HANDLING = Object.seal(create(null, { + tagNameCheck: { + writable: true, + configurable: false, + enumerable: true, + value: null + }, + attributeNameCheck: { + writable: true, + configurable: false, + enumerable: true, + value: null + }, + allowCustomizedBuiltInElements: { + writable: true, + configurable: false, + enumerable: true, + value: false + } + })); + let FORBID_TAGS = null; + let FORBID_ATTR = null; + let ALLOW_ARIA_ATTR = true; + let ALLOW_DATA_ATTR = true; + let ALLOW_UNKNOWN_PROTOCOLS = false; + let ALLOW_SELF_CLOSE_IN_ATTR = true; + let SAFE_FOR_TEMPLATES = false; + let SAFE_FOR_XML = true; + let WHOLE_DOCUMENT = false; + let SET_CONFIG = false; + let FORCE_BODY = false; + let RETURN_DOM = false; + let RETURN_DOM_FRAGMENT = false; + let RETURN_TRUSTED_TYPE = false; + let SANITIZE_DOM = true; + let SANITIZE_NAMED_PROPS = false; + const SANITIZE_NAMED_PROPS_PREFIX = "user-content-"; + let KEEP_CONTENT = true; + let IN_PLACE = false; + let USE_PROFILES = {}; + let FORBID_CONTENTS = null; + const DEFAULT_FORBID_CONTENTS = addToSet({}, ["annotation-xml", "audio", "colgroup", "desc", "foreignobject", "head", "iframe", "math", "mi", "mn", "mo", "ms", "mtext", "noembed", "noframes", "noscript", "plaintext", "script", "style", "svg", "template", "thead", "title", "video", "xmp"]); + let DATA_URI_TAGS = null; + const DEFAULT_DATA_URI_TAGS = addToSet({}, ["audio", "video", "img", "source", "image", "track"]); + let URI_SAFE_ATTRIBUTES = null; + const DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]); + const MATHML_NAMESPACE = "http://www.w3.org/1998/Math/MathML"; + const SVG_NAMESPACE = "http://www.w3.org/2000/svg"; + const HTML_NAMESPACE = "http://www.w3.org/1999/xhtml"; + let NAMESPACE = HTML_NAMESPACE; + let IS_EMPTY_INPUT = false; + let ALLOWED_NAMESPACES = null; + const DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [MATHML_NAMESPACE, SVG_NAMESPACE, HTML_NAMESPACE], stringToString); + let MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, ["mi", "mo", "mn", "ms", "mtext"]); + let HTML_INTEGRATION_POINTS = addToSet({}, ["annotation-xml"]); + const COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, ["title", "style", "font", "a", "script"]); + let PARSER_MEDIA_TYPE = null; + const SUPPORTED_PARSER_MEDIA_TYPES = ["application/xhtml+xml", "text/html"]; + const DEFAULT_PARSER_MEDIA_TYPE = "text/html"; + let transformCaseFunc = null; + let CONFIG = null; + const formElement = document2.createElement("form"); + const isRegexOrFunction = function isRegexOrFunction2(testValue) { + return testValue instanceof RegExp || testValue instanceof Function; + }; + const _parseConfig = function _parseConfig2() { + let cfg = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; + if (CONFIG && CONFIG === cfg) { + return; + } + if (!cfg || typeof cfg !== "object") { + cfg = {}; + } + cfg = clone(cfg); + PARSER_MEDIA_TYPE = // eslint-disable-next-line unicorn/prefer-includes + SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1 ? DEFAULT_PARSER_MEDIA_TYPE : cfg.PARSER_MEDIA_TYPE; + transformCaseFunc = PARSER_MEDIA_TYPE === "application/xhtml+xml" ? stringToString : stringToLowerCase; + ALLOWED_TAGS = objectHasOwnProperty(cfg, "ALLOWED_TAGS") ? addToSet({}, cfg.ALLOWED_TAGS, transformCaseFunc) : DEFAULT_ALLOWED_TAGS; + ALLOWED_ATTR = objectHasOwnProperty(cfg, "ALLOWED_ATTR") ? addToSet({}, cfg.ALLOWED_ATTR, transformCaseFunc) : DEFAULT_ALLOWED_ATTR; + ALLOWED_NAMESPACES = objectHasOwnProperty(cfg, "ALLOWED_NAMESPACES") ? addToSet({}, cfg.ALLOWED_NAMESPACES, stringToString) : DEFAULT_ALLOWED_NAMESPACES; + URI_SAFE_ATTRIBUTES = objectHasOwnProperty(cfg, "ADD_URI_SAFE_ATTR") ? addToSet(clone(DEFAULT_URI_SAFE_ATTRIBUTES), cfg.ADD_URI_SAFE_ATTR, transformCaseFunc) : DEFAULT_URI_SAFE_ATTRIBUTES; + DATA_URI_TAGS = objectHasOwnProperty(cfg, "ADD_DATA_URI_TAGS") ? addToSet(clone(DEFAULT_DATA_URI_TAGS), cfg.ADD_DATA_URI_TAGS, transformCaseFunc) : DEFAULT_DATA_URI_TAGS; + FORBID_CONTENTS = objectHasOwnProperty(cfg, "FORBID_CONTENTS") ? addToSet({}, cfg.FORBID_CONTENTS, transformCaseFunc) : DEFAULT_FORBID_CONTENTS; + FORBID_TAGS = objectHasOwnProperty(cfg, "FORBID_TAGS") ? addToSet({}, cfg.FORBID_TAGS, transformCaseFunc) : clone({}); + FORBID_ATTR = objectHasOwnProperty(cfg, "FORBID_ATTR") ? addToSet({}, cfg.FORBID_ATTR, transformCaseFunc) : clone({}); + USE_PROFILES = objectHasOwnProperty(cfg, "USE_PROFILES") ? cfg.USE_PROFILES : false; + ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false; + ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false; + ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false; + ALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false; + SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false; + SAFE_FOR_XML = cfg.SAFE_FOR_XML !== false; + WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false; + RETURN_DOM = cfg.RETURN_DOM || false; + RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false; + RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false; + FORCE_BODY = cfg.FORCE_BODY || false; + SANITIZE_DOM = cfg.SANITIZE_DOM !== false; + SANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false; + KEEP_CONTENT = cfg.KEEP_CONTENT !== false; + IN_PLACE = cfg.IN_PLACE || false; + IS_ALLOWED_URI$1 = cfg.ALLOWED_URI_REGEXP || IS_ALLOWED_URI; + NAMESPACE = cfg.NAMESPACE || HTML_NAMESPACE; + MATHML_TEXT_INTEGRATION_POINTS = cfg.MATHML_TEXT_INTEGRATION_POINTS || MATHML_TEXT_INTEGRATION_POINTS; + HTML_INTEGRATION_POINTS = cfg.HTML_INTEGRATION_POINTS || HTML_INTEGRATION_POINTS; + CUSTOM_ELEMENT_HANDLING = cfg.CUSTOM_ELEMENT_HANDLING || {}; + if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck)) { + CUSTOM_ELEMENT_HANDLING.tagNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck; + } + if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)) { + CUSTOM_ELEMENT_HANDLING.attributeNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck; + } + if (cfg.CUSTOM_ELEMENT_HANDLING && typeof cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements === "boolean") { + CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements = cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements; + } + if (SAFE_FOR_TEMPLATES) { + ALLOW_DATA_ATTR = false; + } + if (RETURN_DOM_FRAGMENT) { + RETURN_DOM = true; + } + if (USE_PROFILES) { + ALLOWED_TAGS = addToSet({}, text); + ALLOWED_ATTR = []; + if (USE_PROFILES.html === true) { + addToSet(ALLOWED_TAGS, html$1); + addToSet(ALLOWED_ATTR, html2); + } + if (USE_PROFILES.svg === true) { + addToSet(ALLOWED_TAGS, svg$1); + addToSet(ALLOWED_ATTR, svg); + addToSet(ALLOWED_ATTR, xml); + } + if (USE_PROFILES.svgFilters === true) { + addToSet(ALLOWED_TAGS, svgFilters); + addToSet(ALLOWED_ATTR, svg); + addToSet(ALLOWED_ATTR, xml); + } + if (USE_PROFILES.mathMl === true) { + addToSet(ALLOWED_TAGS, mathMl$1); + addToSet(ALLOWED_ATTR, mathMl); + addToSet(ALLOWED_ATTR, xml); + } + } + if (cfg.ADD_TAGS) { + if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) { + ALLOWED_TAGS = clone(ALLOWED_TAGS); + } + addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc); + } + if (cfg.ADD_ATTR) { + if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) { + ALLOWED_ATTR = clone(ALLOWED_ATTR); + } + addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc); + } + if (cfg.ADD_URI_SAFE_ATTR) { + addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR, transformCaseFunc); + } + if (cfg.FORBID_CONTENTS) { + if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) { + FORBID_CONTENTS = clone(FORBID_CONTENTS); + } + addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS, transformCaseFunc); + } + if (KEEP_CONTENT) { + ALLOWED_TAGS["#text"] = true; + } + if (WHOLE_DOCUMENT) { + addToSet(ALLOWED_TAGS, ["html", "head", "body"]); + } + if (ALLOWED_TAGS.table) { + addToSet(ALLOWED_TAGS, ["tbody"]); + delete FORBID_TAGS.tbody; + } + if (cfg.TRUSTED_TYPES_POLICY) { + if (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== "function") { + throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.'); + } + if (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== "function") { + throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.'); + } + trustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY; + emptyHTML = trustedTypesPolicy.createHTML(""); + } else { + if (trustedTypesPolicy === void 0) { + trustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, currentScript); + } + if (trustedTypesPolicy !== null && typeof emptyHTML === "string") { + emptyHTML = trustedTypesPolicy.createHTML(""); + } + } + if (freeze) { + freeze(cfg); + } + CONFIG = cfg; + }; + const ALL_SVG_TAGS = addToSet({}, [...svg$1, ...svgFilters, ...svgDisallowed]); + const ALL_MATHML_TAGS = addToSet({}, [...mathMl$1, ...mathMlDisallowed]); + const _checkValidNamespace = function _checkValidNamespace2(element) { + let parent = getParentNode(element); + if (!parent || !parent.tagName) { + parent = { + namespaceURI: NAMESPACE, + tagName: "template" + }; + } + const tagName = stringToLowerCase(element.tagName); + const parentTagName = stringToLowerCase(parent.tagName); + if (!ALLOWED_NAMESPACES[element.namespaceURI]) { + return false; + } + if (element.namespaceURI === SVG_NAMESPACE) { + if (parent.namespaceURI === HTML_NAMESPACE) { + return tagName === "svg"; + } + if (parent.namespaceURI === MATHML_NAMESPACE) { + return tagName === "svg" && (parentTagName === "annotation-xml" || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]); + } + return Boolean(ALL_SVG_TAGS[tagName]); + } + if (element.namespaceURI === MATHML_NAMESPACE) { + if (parent.namespaceURI === HTML_NAMESPACE) { + return tagName === "math"; + } + if (parent.namespaceURI === SVG_NAMESPACE) { + return tagName === "math" && HTML_INTEGRATION_POINTS[parentTagName]; + } + return Boolean(ALL_MATHML_TAGS[tagName]); + } + if (element.namespaceURI === HTML_NAMESPACE) { + if (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) { + return false; + } + if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) { + return false; + } + return !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]); + } + if (PARSER_MEDIA_TYPE === "application/xhtml+xml" && ALLOWED_NAMESPACES[element.namespaceURI]) { + return true; + } + return false; + }; + const _forceRemove = function _forceRemove2(node) { + arrayPush(DOMPurify.removed, { + element: node + }); + try { + getParentNode(node).removeChild(node); + } catch (_) { + remove(node); + } + }; + const _removeAttribute = function _removeAttribute2(name, element) { + try { + arrayPush(DOMPurify.removed, { + attribute: element.getAttributeNode(name), + from: element + }); + } catch (_) { + arrayPush(DOMPurify.removed, { + attribute: null, + from: element + }); + } + element.removeAttribute(name); + if (name === "is") { + if (RETURN_DOM || RETURN_DOM_FRAGMENT) { + try { + _forceRemove(element); + } catch (_) { + } + } else { + try { + element.setAttribute(name, ""); + } catch (_) { + } + } + } + }; + const _initDocument = function _initDocument2(dirty) { + let doc = null; + let leadingWhitespace = null; + if (FORCE_BODY) { + dirty = "" + dirty; + } else { + const matches = stringMatch(dirty, /^[\r\n\t ]+/); + leadingWhitespace = matches && matches[0]; + } + if (PARSER_MEDIA_TYPE === "application/xhtml+xml" && NAMESPACE === HTML_NAMESPACE) { + dirty = '' + dirty + ""; + } + const dirtyPayload = trustedTypesPolicy ? trustedTypesPolicy.createHTML(dirty) : dirty; + if (NAMESPACE === HTML_NAMESPACE) { + try { + doc = new DOMParser().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE); + } catch (_) { + } + } + if (!doc || !doc.documentElement) { + doc = implementation.createDocument(NAMESPACE, "template", null); + try { + doc.documentElement.innerHTML = IS_EMPTY_INPUT ? emptyHTML : dirtyPayload; + } catch (_) { + } + } + const body = doc.body || doc.documentElement; + if (dirty && leadingWhitespace) { + body.insertBefore(document2.createTextNode(leadingWhitespace), body.childNodes[0] || null); + } + if (NAMESPACE === HTML_NAMESPACE) { + return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? "html" : "body")[0]; + } + return WHOLE_DOCUMENT ? doc.documentElement : body; + }; + const _createNodeIterator = function _createNodeIterator2(root) { + return createNodeIterator.call( + root.ownerDocument || root, + root, + // eslint-disable-next-line no-bitwise + NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT | NodeFilter.SHOW_PROCESSING_INSTRUCTION | NodeFilter.SHOW_CDATA_SECTION, + null + ); + }; + const _isClobbered = function _isClobbered2(element) { + return element instanceof HTMLFormElement && (typeof element.nodeName !== "string" || typeof element.textContent !== "string" || typeof element.removeChild !== "function" || !(element.attributes instanceof NamedNodeMap) || typeof element.removeAttribute !== "function" || typeof element.setAttribute !== "function" || typeof element.namespaceURI !== "string" || typeof element.insertBefore !== "function" || typeof element.hasChildNodes !== "function"); + }; + const _isNode = function _isNode2(value) { + return typeof Node4 === "function" && value instanceof Node4; + }; + function _executeHooks(hooks2, currentNode, data) { + arrayForEach(hooks2, (hook) => { + hook.call(DOMPurify, currentNode, data, CONFIG); + }); + } + const _sanitizeElements = function _sanitizeElements2(currentNode) { + let content = null; + _executeHooks(hooks.beforeSanitizeElements, currentNode, null); + if (_isClobbered(currentNode)) { + _forceRemove(currentNode); + return true; + } + const tagName = transformCaseFunc(currentNode.nodeName); + _executeHooks(hooks.uponSanitizeElement, currentNode, { + tagName, + allowedTags: ALLOWED_TAGS + }); + if (SAFE_FOR_XML && currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(/<[/\w!]/g, currentNode.innerHTML) && regExpTest(/<[/\w!]/g, currentNode.textContent)) { + _forceRemove(currentNode); + return true; + } + if (currentNode.nodeType === NODE_TYPE.progressingInstruction) { + _forceRemove(currentNode); + return true; + } + if (SAFE_FOR_XML && currentNode.nodeType === NODE_TYPE.comment && regExpTest(/<[/\w]/g, currentNode.data)) { + _forceRemove(currentNode); + return true; + } + if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) { + if (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName)) { + if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)) { + return false; + } + if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(tagName)) { + return false; + } + } + if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) { + const parentNode = getParentNode(currentNode) || currentNode.parentNode; + const childNodes = getChildNodes(currentNode) || currentNode.childNodes; + if (childNodes && parentNode) { + const childCount = childNodes.length; + for (let i2 = childCount - 1; i2 >= 0; --i2) { + const childClone = cloneNode(childNodes[i2], true); + childClone.__removalCount = (currentNode.__removalCount || 0) + 1; + parentNode.insertBefore(childClone, getNextSibling(currentNode)); + } + } + } + _forceRemove(currentNode); + return true; + } + if (currentNode instanceof Element2 && !_checkValidNamespace(currentNode)) { + _forceRemove(currentNode); + return true; + } + if ((tagName === "noscript" || tagName === "noembed" || tagName === "noframes") && regExpTest(/<\/no(script|embed|frames)/i, currentNode.innerHTML)) { + _forceRemove(currentNode); + return true; + } + if (SAFE_FOR_TEMPLATES && currentNode.nodeType === NODE_TYPE.text) { + content = currentNode.textContent; + arrayForEach([MUSTACHE_EXPR2, ERB_EXPR2, TMPLIT_EXPR2], (expr) => { + content = stringReplace(content, expr, " "); + }); + if (currentNode.textContent !== content) { + arrayPush(DOMPurify.removed, { + element: currentNode.cloneNode() + }); + currentNode.textContent = content; + } + } + _executeHooks(hooks.afterSanitizeElements, currentNode, null); + return false; + }; + const _isValidAttribute = function _isValidAttribute2(lcTag, lcName, value) { + if (SANITIZE_DOM && (lcName === "id" || lcName === "name") && (value in document2 || value in formElement)) { + return false; + } + if (ALLOW_DATA_ATTR && !FORBID_ATTR[lcName] && regExpTest(DATA_ATTR2, lcName)) ; + else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR2, lcName)) ; + else if (!ALLOWED_ATTR[lcName] || FORBID_ATTR[lcName]) { + if ( + // First condition does a very basic check if a) it's basically a valid custom element tagname AND + // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck + // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck + _isBasicCustomElement(lcTag) && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, lcTag) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(lcTag)) && (CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.attributeNameCheck, lcName) || CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.attributeNameCheck(lcName, lcTag)) || // Alternative, second condition checks if it's an `is`-attribute, AND + // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck + lcName === "is" && CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, value) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(value)) + ) ; + else { + return false; + } + } else if (URI_SAFE_ATTRIBUTES[lcName]) ; + else if (regExpTest(IS_ALLOWED_URI$1, stringReplace(value, ATTR_WHITESPACE2, ""))) ; + else if ((lcName === "src" || lcName === "xlink:href" || lcName === "href") && lcTag !== "script" && stringIndexOf(value, "data:") === 0 && DATA_URI_TAGS[lcTag]) ; + else if (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA2, stringReplace(value, ATTR_WHITESPACE2, ""))) ; + else if (value) { + return false; + } else ; + return true; + }; + const _isBasicCustomElement = function _isBasicCustomElement2(tagName) { + return tagName !== "annotation-xml" && stringMatch(tagName, CUSTOM_ELEMENT2); + }; + const _sanitizeAttributes = function _sanitizeAttributes2(currentNode) { + _executeHooks(hooks.beforeSanitizeAttributes, currentNode, null); + const { + attributes + } = currentNode; + if (!attributes || _isClobbered(currentNode)) { + return; + } + const hookEvent = { + attrName: "", + attrValue: "", + keepAttr: true, + allowedAttributes: ALLOWED_ATTR, + forceKeepAttr: void 0 + }; + let l = attributes.length; + while (l--) { + const attr = attributes[l]; + const { + name, + namespaceURI, + value: attrValue + } = attr; + const lcName = transformCaseFunc(name); + const initValue = attrValue; + let value = name === "value" ? initValue : stringTrim(initValue); + hookEvent.attrName = lcName; + hookEvent.attrValue = value; + hookEvent.keepAttr = true; + hookEvent.forceKeepAttr = void 0; + _executeHooks(hooks.uponSanitizeAttribute, currentNode, hookEvent); + value = hookEvent.attrValue; + if (SANITIZE_NAMED_PROPS && (lcName === "id" || lcName === "name")) { + _removeAttribute(name, currentNode); + value = SANITIZE_NAMED_PROPS_PREFIX + value; + } + if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\/(style|title|textarea)/i, value)) { + _removeAttribute(name, currentNode); + continue; + } + if (lcName === "attributename" && stringMatch(value, "href")) { + _removeAttribute(name, currentNode); + continue; + } + if (hookEvent.forceKeepAttr) { + continue; + } + if (!hookEvent.keepAttr) { + _removeAttribute(name, currentNode); + continue; + } + if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(/\/>/i, value)) { + _removeAttribute(name, currentNode); + continue; + } + if (SAFE_FOR_TEMPLATES) { + arrayForEach([MUSTACHE_EXPR2, ERB_EXPR2, TMPLIT_EXPR2], (expr) => { + value = stringReplace(value, expr, " "); + }); + } + const lcTag = transformCaseFunc(currentNode.nodeName); + if (!_isValidAttribute(lcTag, lcName, value)) { + _removeAttribute(name, currentNode); + continue; + } + if (trustedTypesPolicy && typeof trustedTypes === "object" && typeof trustedTypes.getAttributeType === "function") { + if (namespaceURI) ; + else { + switch (trustedTypes.getAttributeType(lcTag, lcName)) { + case "TrustedHTML": { + value = trustedTypesPolicy.createHTML(value); + break; + } + case "TrustedScriptURL": { + value = trustedTypesPolicy.createScriptURL(value); + break; + } + } + } + } + if (value !== initValue) { + try { + if (namespaceURI) { + currentNode.setAttributeNS(namespaceURI, name, value); + } else { + currentNode.setAttribute(name, value); + } + if (_isClobbered(currentNode)) { + _forceRemove(currentNode); + } else { + arrayPop(DOMPurify.removed); + } + } catch (_) { + _removeAttribute(name, currentNode); + } + } + } + _executeHooks(hooks.afterSanitizeAttributes, currentNode, null); + }; + const _sanitizeShadowDOM = function _sanitizeShadowDOM2(fragment) { + let shadowNode = null; + const shadowIterator = _createNodeIterator(fragment); + _executeHooks(hooks.beforeSanitizeShadowDOM, fragment, null); + while (shadowNode = shadowIterator.nextNode()) { + _executeHooks(hooks.uponSanitizeShadowNode, shadowNode, null); + _sanitizeElements(shadowNode); + _sanitizeAttributes(shadowNode); + if (shadowNode.content instanceof DocumentFragment) { + _sanitizeShadowDOM2(shadowNode.content); + } + } + _executeHooks(hooks.afterSanitizeShadowDOM, fragment, null); + }; + DOMPurify.sanitize = function(dirty) { + let cfg = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; + let body = null; + let importedNode = null; + let currentNode = null; + let returnNode = null; + IS_EMPTY_INPUT = !dirty; + if (IS_EMPTY_INPUT) { + dirty = ""; + } + if (typeof dirty !== "string" && !_isNode(dirty)) { + if (typeof dirty.toString === "function") { + dirty = dirty.toString(); + if (typeof dirty !== "string") { + throw typeErrorCreate("dirty is not a string, aborting"); + } + } else { + throw typeErrorCreate("toString is not a function"); + } + } + if (!DOMPurify.isSupported) { + return dirty; + } + if (!SET_CONFIG) { + _parseConfig(cfg); + } + DOMPurify.removed = []; + if (typeof dirty === "string") { + IN_PLACE = false; + } + if (IN_PLACE) { + if (dirty.nodeName) { + const tagName = transformCaseFunc(dirty.nodeName); + if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) { + throw typeErrorCreate("root node is forbidden and cannot be sanitized in-place"); + } + } + } else if (dirty instanceof Node4) { + body = _initDocument(""); + importedNode = body.ownerDocument.importNode(dirty, true); + if (importedNode.nodeType === NODE_TYPE.element && importedNode.nodeName === "BODY") { + body = importedNode; + } else if (importedNode.nodeName === "HTML") { + body = importedNode; + } else { + body.appendChild(importedNode); + } + } else { + if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT && // eslint-disable-next-line unicorn/prefer-includes + dirty.indexOf("<") === -1) { + return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(dirty) : dirty; + } + body = _initDocument(dirty); + if (!body) { + return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : ""; + } + } + if (body && FORCE_BODY) { + _forceRemove(body.firstChild); + } + const nodeIterator = _createNodeIterator(IN_PLACE ? dirty : body); + while (currentNode = nodeIterator.nextNode()) { + _sanitizeElements(currentNode); + _sanitizeAttributes(currentNode); + if (currentNode.content instanceof DocumentFragment) { + _sanitizeShadowDOM(currentNode.content); + } + } + if (IN_PLACE) { + return dirty; + } + if (RETURN_DOM) { + if (RETURN_DOM_FRAGMENT) { + returnNode = createDocumentFragment.call(body.ownerDocument); + while (body.firstChild) { + returnNode.appendChild(body.firstChild); + } + } else { + returnNode = body; + } + if (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmode) { + returnNode = importNode.call(originalDocument, returnNode, true); + } + return returnNode; + } + let serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML; + if (WHOLE_DOCUMENT && ALLOWED_TAGS["!doctype"] && body.ownerDocument && body.ownerDocument.doctype && body.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, body.ownerDocument.doctype.name)) { + serializedHTML = "\n" + serializedHTML; + } + if (SAFE_FOR_TEMPLATES) { + arrayForEach([MUSTACHE_EXPR2, ERB_EXPR2, TMPLIT_EXPR2], (expr) => { + serializedHTML = stringReplace(serializedHTML, expr, " "); + }); + } + return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(serializedHTML) : serializedHTML; + }; + DOMPurify.setConfig = function() { + let cfg = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; + _parseConfig(cfg); + SET_CONFIG = true; + }; + DOMPurify.clearConfig = function() { + CONFIG = null; + SET_CONFIG = false; + }; + DOMPurify.isValidAttribute = function(tag2, attr, value) { + if (!CONFIG) { + _parseConfig({}); + } + const lcTag = transformCaseFunc(tag2); + const lcName = transformCaseFunc(attr); + return _isValidAttribute(lcTag, lcName, value); + }; + DOMPurify.addHook = function(entryPoint, hookFunction) { + if (typeof hookFunction !== "function") { + return; + } + arrayPush(hooks[entryPoint], hookFunction); + }; + DOMPurify.removeHook = function(entryPoint, hookFunction) { + if (hookFunction !== void 0) { + const index = arrayLastIndexOf(hooks[entryPoint], hookFunction); + return index === -1 ? void 0 : arraySplice(hooks[entryPoint], index, 1)[0]; + } + return arrayPop(hooks[entryPoint]); + }; + DOMPurify.removeHooks = function(entryPoint) { + hooks[entryPoint] = []; + }; + DOMPurify.removeAllHooks = function() { + hooks = _createHooksMap(); + }; + return DOMPurify; +} +var purify = createDOMPurify(); + +// node_modules/monaco-editor-core/esm/vs/base/browser/domSanitize.js +var basicMarkupHtmlTags = Object.freeze([ + "a", + "abbr", + "b", + "bdo", + "blockquote", + "br", + "caption", + "cite", + "code", + "col", + "colgroup", + "dd", + "del", + "details", + "dfn", + "div", + "dl", + "dt", + "em", + "figcaption", + "figure", + "h1", + "h2", + "h3", + "h4", + "h5", + "h6", + "hr", + "i", + "img", + "ins", + "kbd", + "label", + "li", + "mark", + "ol", + "p", + "pre", + "q", + "rp", + "rt", + "ruby", + "s", + "samp", + "small", + "small", + "source", + "span", + "strike", + "strong", + "sub", + "summary", + "sup", + "table", + "tbody", + "td", + "tfoot", + "th", + "thead", + "time", + "tr", + "tt", + "u", + "ul", + "var", + "video", + "wbr" +]); +var defaultAllowedAttrs = Object.freeze([ + "href", + "target", + "src", + "alt", + "title", + "for", + "name", + "role", + "tabindex", + "x-dispatch", + "required", + "checked", + "placeholder", + "type", + "start", + "width", + "height", + "align" +]); +var fakeRelativeUrlProtocol = "vscode-relative-path"; +function validateLink(value, allowedProtocols) { + if (allowedProtocols.override === "*") { + return true; + } + try { + const url = new URL(value, fakeRelativeUrlProtocol + "://"); + if (allowedProtocols.override.includes(url.protocol.replace(/:$/, ""))) { + return true; + } + if (allowedProtocols.allowRelativePaths && url.protocol === fakeRelativeUrlProtocol + ":" && !value.trim().toLowerCase().startsWith(fakeRelativeUrlProtocol)) { + return true; + } + return false; + } catch (e) { + return false; + } +} +function hookDomPurifyHrefAndSrcSanitizer(allowedLinkProtocols, allowedMediaProtocols) { + purify.addHook("afterSanitizeAttributes", (node) => { + for (const attr of ["href", "src"]) { + if (node.hasAttribute(attr)) { + const attrValue = node.getAttribute(attr); + if (attr === "href") { + if (!attrValue.startsWith("#") && !validateLink(attrValue, allowedLinkProtocols)) { + node.removeAttribute(attr); + } + } else { + if (!validateLink(attrValue, allowedMediaProtocols)) { + node.removeAttribute(attr); + } + } + } + } + }); +} +var defaultDomPurifyConfig = Object.freeze({ + ALLOWED_TAGS: [...basicMarkupHtmlTags], + ALLOWED_ATTR: [...defaultAllowedAttrs], + // We sanitize the src/href attributes later if needed + ALLOW_UNKNOWN_PROTOCOLS: true +}); +function sanitizeHtml(untrusted, config) { + return doSanitizeHtml(untrusted, config, "trusted"); +} +function doSanitizeHtml(untrusted, config, outputType) { + try { + const resolvedConfig = { ...defaultDomPurifyConfig }; + if (config?.allowedTags) { + if (config.allowedTags.override) { + resolvedConfig.ALLOWED_TAGS = [...config.allowedTags.override]; + } + if (config.allowedTags.augment) { + resolvedConfig.ALLOWED_TAGS = [...resolvedConfig.ALLOWED_TAGS ?? [], ...config.allowedTags.augment]; + } + } + let resolvedAttributes = [...defaultAllowedAttrs]; + if (config?.allowedAttributes) { + if (config.allowedAttributes.override) { + resolvedAttributes = [...config.allowedAttributes.override]; + } + if (config.allowedAttributes.augment) { + resolvedAttributes = [...resolvedAttributes, ...config.allowedAttributes.augment]; + } + } + resolvedAttributes = resolvedAttributes.map((attr) => { + if (typeof attr === "string") { + return attr.toLowerCase(); + } + return { + attributeName: attr.attributeName.toLowerCase(), + shouldKeep: attr.shouldKeep + }; + }); + const allowedAttrNames = new Set(resolvedAttributes.map((attr) => typeof attr === "string" ? attr : attr.attributeName)); + const allowedAttrPredicates = /* @__PURE__ */ new Map(); + for (const attr of resolvedAttributes) { + if (typeof attr === "string") { + allowedAttrPredicates.delete(attr); + } else { + allowedAttrPredicates.set(attr.attributeName, attr); + } + } + resolvedConfig.ALLOWED_ATTR = Array.from(allowedAttrNames); + hookDomPurifyHrefAndSrcSanitizer({ + override: config?.allowedLinkProtocols?.override ?? [Schemas.http, Schemas.https], + allowRelativePaths: config?.allowRelativeLinkPaths ?? false + }, { + override: config?.allowedMediaProtocols?.override ?? [Schemas.http, Schemas.https], + allowRelativePaths: config?.allowRelativeMediaPaths ?? false + }); + if (config?.replaceWithPlaintext) { + purify.addHook("uponSanitizeElement", replaceWithPlainTextHook); + } + if (allowedAttrPredicates.size) { + purify.addHook("uponSanitizeAttribute", (node, e) => { + const predicate = allowedAttrPredicates.get(e.attrName); + if (predicate) { + const result = predicate.shouldKeep(node, e); + if (typeof result === "string") { + e.keepAttr = true; + e.attrValue = result; + } else { + e.keepAttr = result; + } + } else { + e.keepAttr = allowedAttrNames.has(e.attrName); + } + }); + } + if (outputType === "dom") { + return purify.sanitize(untrusted, { + ...resolvedConfig, + RETURN_DOM_FRAGMENT: true + }); + } else { + return purify.sanitize(untrusted, { + ...resolvedConfig, + RETURN_TRUSTED_TYPE: true + }); + } + } finally { + purify.removeAllHooks(); + } +} +var selfClosingTags = ["area", "base", "br", "col", "command", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr"]; +var replaceWithPlainTextHook = (node, data, _config) => { + if (!data.allowedTags[data.tagName] && data.tagName !== "body") { + const replacement = convertTagToPlaintext(node); + if (replacement) { + if (node.nodeType === Node.COMMENT_NODE) { + node.parentElement?.insertBefore(replacement, node); + } else { + node.parentElement?.replaceChild(replacement, node); + } + } + } +}; +function convertTagToPlaintext(node) { + if (!node.ownerDocument) { + return; + } + let startTagText; + let endTagText; + if (node.nodeType === Node.COMMENT_NODE) { + startTagText = ``; + } else if (node instanceof Element) { + const tagName = node.tagName.toLowerCase(); + const isSelfClosing = selfClosingTags.includes(tagName); + const attrString = node.attributes.length ? " " + Array.from(node.attributes).map((attr) => `${attr.name}="${attr.value}"`).join(" ") : ""; + startTagText = `<${tagName}${attrString}>`; + if (!isSelfClosing) { + endTagText = ``; + } + } else { + return; + } + const fragment = document.createDocumentFragment(); + const textNode = node.ownerDocument.createTextNode(startTagText); + fragment.appendChild(textNode); + while (node.firstChild) { + fragment.appendChild(node.firstChild); + } + const endTagTextNode = endTagText ? node.ownerDocument.createTextNode(endTagText) : void 0; + if (endTagTextNode) { + fragment.appendChild(endTagTextNode); + } + return fragment; +} +function safeSetInnerHtml(node, untrusted, config) { + const fragment = doSanitizeHtml(untrusted, config, "dom"); + reset(node, fragment); +} + +// node_modules/monaco-editor-core/esm/vs/base/browser/markdownRenderer.js +init_keyboardEvent(); +init_mouseEvent(); +init_iconLabels2(); +var defaultMarkedRenderers = Object.freeze({ + image: ({ href, title, text: text2 }) => { + let dimensions = []; + let attributes = []; + if (href) { + ({ href, dimensions } = parseHrefAndDimensions(href)); + attributes.push(`src="${escapeDoubleQuotes(href)}"`); + } + if (text2) { + attributes.push(`alt="${escapeDoubleQuotes(text2)}"`); + } + if (title) { + attributes.push(`title="${escapeDoubleQuotes(title)}"`); + } + if (dimensions.length) { + attributes = attributes.concat(dimensions); + } + return ""; + }, + paragraph({ tokens }) { + return `

    ${this.parser.parseInline(tokens)}

    `; + }, + link({ href, title, tokens }) { + let text2 = this.parser.parseInline(tokens); + if (typeof href !== "string") { + return ""; + } + if (href === text2) { + text2 = removeMarkdownEscapes(text2); + } + title = typeof title === "string" ? escapeDoubleQuotes(removeMarkdownEscapes(title)) : ""; + href = removeMarkdownEscapes(href); + href = href.replace(/&/g, "&").replace(//g, ">").replace(/"/g, """).replace(/'/g, "'"); + return `
    ${text2}`; + } +}); +function createAlertBlockquoteRenderer(fallbackRenderer) { + return function(token) { + const { tokens } = token; + const firstToken = tokens[0]; + if (firstToken?.type !== "paragraph") { + return fallbackRenderer.call(this, token); + } + const paragraphTokens = firstToken.tokens; + if (!paragraphTokens || paragraphTokens.length === 0) { + return fallbackRenderer.call(this, token); + } + const firstTextToken = paragraphTokens[0]; + if (firstTextToken?.type !== "text") { + return fallbackRenderer.call(this, token); + } + const pattern = /^\s*\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\]\s*?\n*/i; + const match2 = firstTextToken.raw.match(pattern); + if (!match2) { + return fallbackRenderer.call(this, token); + } + firstTextToken.raw = firstTextToken.raw.replace(pattern, ""); + firstTextToken.text = firstTextToken.text.replace(pattern, ""); + const alertIcons = { + "note": "info", + "tip": "light-bulb", + "important": "comment", + "warning": "alert", + "caution": "stop" + }; + const type = match2[1]; + const typeCapitalized = type.charAt(0).toUpperCase() + type.slice(1).toLowerCase(); + const severity = type.toLowerCase(); + const iconHtml = renderIcon({ id: alertIcons[severity] }).outerHTML; + const content = this.parser.parse(tokens); + return `

    ${iconHtml}${typeCapitalized}${content.substring(3)}

    +`; + }; +} +function renderMarkdown(markdown, options2 = {}, target) { + const disposables = new DisposableStore(); + let isDisposed = false; + const markedInstance2 = new Marked(...options2.markedExtensions ?? []); + const { renderer, codeBlocks, syncCodeBlocks } = createMarkdownRenderer(markedInstance2, options2, markdown); + const value = preprocessMarkdownString(markdown); + let renderedMarkdown; + if (options2.fillInIncompleteTokens) { + const opts = { + ...markedInstance2.defaults, + ...options2.markedOptions, + renderer + }; + const tokens = markedInstance2.lexer(value, opts); + const newTokens = fillInIncompleteTokens(tokens); + renderedMarkdown = markedInstance2.parser(newTokens, opts); + } else { + renderedMarkdown = markedInstance2.parse(value, { ...options2?.markedOptions, renderer, async: false }); + } + if (markdown.supportThemeIcons) { + const elements = renderLabelWithIcons(renderedMarkdown); + renderedMarkdown = elements.map((e) => typeof e === "string" ? e : e.outerHTML).join(""); + } + const renderedContent = document.createElement("div"); + const sanitizerConfig = getDomSanitizerConfig(markdown, options2.sanitizerConfig ?? {}); + safeSetInnerHtml(renderedContent, renderedMarkdown, sanitizerConfig); + rewriteRenderedLinks(markdown, options2, renderedContent); + let outElement; + if (target) { + outElement = target; + reset(target, ...renderedContent.children); + } else { + outElement = renderedContent; + } + if (codeBlocks.length > 0) { + Promise.all(codeBlocks).then((tuples) => { + if (isDisposed) { + return; + } + const renderedElements = new Map(tuples); + const placeholderElements = outElement.querySelectorAll(`div[data-code]`); + for (const placeholderElement of placeholderElements) { + const renderedElement = renderedElements.get(placeholderElement.dataset["code"] ?? ""); + if (renderedElement) { + reset(placeholderElement, renderedElement); + } + } + options2.asyncRenderCallback?.(); + }); + } else if (syncCodeBlocks.length > 0) { + const renderedElements = new Map(syncCodeBlocks); + const placeholderElements = outElement.querySelectorAll(`div[data-code]`); + for (const placeholderElement of placeholderElements) { + const renderedElement = renderedElements.get(placeholderElement.dataset["code"] ?? ""); + if (renderedElement) { + reset(placeholderElement, renderedElement); + } + } + } + if (options2.asyncRenderCallback) { + for (const img of outElement.getElementsByTagName("img")) { + const listener = disposables.add(addDisposableListener(img, "load", () => { + listener.dispose(); + options2.asyncRenderCallback(); + })); + } + } + if (options2.actionHandler) { + const clickCb = (e) => { + const mouseEvent = new StandardMouseEvent(getWindow(outElement), e); + if (!mouseEvent.leftButton && !mouseEvent.middleButton) { + return; + } + activateLink(markdown, options2, mouseEvent); + }; + disposables.add(addDisposableListener(outElement, "click", clickCb)); + disposables.add(addDisposableListener(outElement, "auxclick", clickCb)); + disposables.add(addDisposableListener(outElement, "keydown", (e) => { + const keyboardEvent = new StandardKeyboardEvent(e); + if (!keyboardEvent.equals( + 10 + /* KeyCode.Space */ + ) && !keyboardEvent.equals( + 3 + /* KeyCode.Enter */ + )) { + return; + } + activateLink(markdown, options2, keyboardEvent); + })); + } + for (const input of [...outElement.getElementsByTagName("input")]) { + if (input.attributes.getNamedItem("type")?.value === "checkbox") { + input.setAttribute("disabled", ""); + } else { + if (options2.sanitizerConfig?.replaceWithPlaintext) { + const replacement = convertTagToPlaintext(input); + if (replacement) { + input.parentElement?.replaceChild(replacement, input); + } else { + input.remove(); + } + } else { + input.remove(); + } + } + } + return { + element: outElement, + dispose: () => { + isDisposed = true; + disposables.dispose(); + } + }; +} +function rewriteRenderedLinks(markdown, options2, root) { + for (const el of root.querySelectorAll("img, audio, video, source")) { + const src = el.getAttribute("src"); + if (src) { + let href = src; + try { + if (markdown.baseUri) { + href = resolveWithBaseUri(URI.from(markdown.baseUri), href); + } + } catch (err) { + } + el.setAttribute("src", massageHref(markdown, href, true)); + if (options2.sanitizerConfig?.remoteImageIsAllowed) { + const uri = URI.parse(href); + if (uri.scheme !== Schemas.file && uri.scheme !== Schemas.data && !options2.sanitizerConfig.remoteImageIsAllowed(uri)) { + el.replaceWith($("", void 0, el.outerHTML)); + } + } + } + } + for (const el of root.querySelectorAll("a")) { + const href = el.getAttribute("href"); + el.setAttribute("href", ""); + if (!href || /^data:|javascript:/i.test(href) || /^command:/i.test(href) && !markdown.isTrusted || /^command:(\/\/\/)?_workbench\.downloadResource/i.test(href)) { + el.replaceWith(...el.childNodes); + } else { + let resolvedHref = massageHref(markdown, href, false); + if (markdown.baseUri) { + resolvedHref = resolveWithBaseUri(URI.from(markdown.baseUri), href); + } + el.dataset.href = resolvedHref; + } + } +} +function createMarkdownRenderer(marked2, options2, markdown) { + const renderer = new marked2.Renderer(options2.markedOptions); + renderer.image = defaultMarkedRenderers.image; + renderer.link = defaultMarkedRenderers.link; + renderer.paragraph = defaultMarkedRenderers.paragraph; + if (markdown.supportAlertSyntax) { + renderer.blockquote = createAlertBlockquoteRenderer(renderer.blockquote); + } + const codeBlocks = []; + const syncCodeBlocks = []; + if (options2.codeBlockRendererSync) { + renderer.code = ({ text: text2, lang, raw }) => { + const id = defaultGenerator.nextId(); + const value = options2.codeBlockRendererSync(postProcessCodeBlockLanguageId(lang), text2, raw); + syncCodeBlocks.push([id, value]); + return `
    ${escape(text2)}
    `; + }; + } else if (options2.codeBlockRenderer) { + renderer.code = ({ text: text2, lang }) => { + const id = defaultGenerator.nextId(); + const value = options2.codeBlockRenderer(postProcessCodeBlockLanguageId(lang), text2); + codeBlocks.push(value.then((element) => [id, element])); + return `
    ${escape(text2)}
    `; + }; + } + if (!markdown.supportHtml) { + renderer.html = ({ text: text2 }) => { + if (options2.sanitizerConfig?.replaceWithPlaintext) { + return escape(text2); + } + const match2 = markdown.isTrusted ? text2.match(/^(]+>)|(<\/\s*span>)$/) : void 0; + return match2 ? text2 : ""; + }; + } + return { renderer, codeBlocks, syncCodeBlocks }; +} +function preprocessMarkdownString(markdown) { + let value = markdown.value; + if (value.length > 1e5) { + value = `${value.substr(0, 1e5)}\u2026`; + } + if (markdown.supportThemeIcons) { + value = markdownEscapeEscapedIcons(value); + } + return value; +} +function activateLink(mdStr, options2, event) { + const target = event.target.closest("a[data-href]"); + if (!isHTMLElement(target)) { + return; + } + try { + let href = target.dataset["href"]; + if (href) { + if (mdStr.baseUri) { + href = resolveWithBaseUri(URI.from(mdStr.baseUri), href); + } + options2.actionHandler?.(href, mdStr); + } + } catch (err) { + onUnexpectedError(err); + } finally { + event.preventDefault(); + } +} +function uriMassage(markdown, part) { + let data; + try { + data = parse2(decodeURIComponent(part)); + } catch (e) { + } + if (!data) { + return part; + } + data = cloneAndChange(data, (value) => { + if (markdown.uris && markdown.uris[value]) { + return URI.revive(markdown.uris[value]); + } else { + return void 0; + } + }); + return encodeURIComponent(JSON.stringify(data)); +} +function massageHref(markdown, href, isDomUri) { + const data = markdown.uris && markdown.uris[href]; + let uri = URI.revive(data); + if (isDomUri) { + if (href.startsWith(Schemas.data + ":")) { + return href; + } + if (!uri) { + uri = URI.parse(href); + } + return FileAccess.uriToBrowserUri(uri).toString(true); + } + if (!uri) { + return href; + } + if (URI.parse(href).toString() === uri.toString()) { + return href; + } + if (uri.query) { + uri = uri.with({ query: uriMassage(markdown, uri.query) }); + } + return uri.toString(); +} +function postProcessCodeBlockLanguageId(lang) { + if (!lang) { + return ""; + } + const parts = lang.split(/[\s+|:|,|\{|\?]/, 1); + if (parts.length) { + return parts[0]; + } + return lang; +} +function resolveWithBaseUri(baseUri, href) { + const hasScheme = /^\w[\w\d+.-]*:/.test(href); + if (hasScheme) { + return href; + } + if (baseUri.path.endsWith("/")) { + return resolvePath(baseUri, href).toString(); + } else { + return resolvePath(dirname2(baseUri), href).toString(); + } +} +function sanitizeRenderedMarkdown(renderedMarkdown, originalMdStrConfig, options2 = {}) { + const sanitizerConfig = getDomSanitizerConfig(originalMdStrConfig, options2); + return sanitizeHtml(renderedMarkdown, sanitizerConfig); +} +var allowedMarkdownHtmlTags = Object.freeze([ + ...basicMarkupHtmlTags, + "input" + // Allow inputs for rendering checkboxes. Other types of inputs are removed and the inputs are always disabled +]); +var allowedMarkdownHtmlAttributes = Object.freeze([ + "align", + "autoplay", + "alt", + "colspan", + "controls", + "draggable", + "height", + "href", + "loop", + "muted", + "playsinline", + "poster", + "rowspan", + "src", + "target", + "title", + "type", + "width", + "start", + // Input (For disabled inputs) + "checked", + "disabled", + "value", + // Custom markdown attributes + "data-code", + "data-href", + "data-severity", + // Only allow very specific styles + { + attributeName: "style", + shouldKeep: (element, data) => { + if (element.tagName === "SPAN") { + if (data.attrName === "style") { + return /^(color\:(#[0-9a-fA-F]+|var\(--vscode(-[a-zA-Z0-9]+)+\));)?(background-color\:(#[0-9a-fA-F]+|var\(--vscode(-[a-zA-Z0-9]+)+\));)?(border-radius:[0-9]+px;)?$/.test(data.attrValue); + } + } + return false; + } + }, + // Only allow codicons for classes + { + attributeName: "class", + shouldKeep: (element, data) => { + if (element.tagName === "SPAN") { + if (data.attrName === "class") { + return /^codicon codicon-[a-z\-]+( codicon-modifier-[a-z\-]+)?$/.test(data.attrValue); + } + } + return false; + } + } +]); +function getDomSanitizerConfig(mdStrConfig, options2) { + const isTrusted = mdStrConfig.isTrusted ?? false; + const allowedLinkSchemes = [ + Schemas.http, + Schemas.https, + Schemas.mailto, + Schemas.file, + Schemas.vscodeFileResource, + Schemas.vscodeRemote, + Schemas.vscodeRemoteResource, + Schemas.vscodeNotebookCell + ]; + if (isTrusted) { + allowedLinkSchemes.push(Schemas.command); + } + if (options2.allowedLinkSchemes?.augment) { + allowedLinkSchemes.push(...options2.allowedLinkSchemes.augment); + } + return { + // allowedTags should included everything that markdown renders to. + // Since we have our own sanitize function for marked, it's possible we missed some tag so let dompurify make sure. + // HTML tags that can result from markdown are from reading https://spec.commonmark.org/0.29/ + // HTML table tags that can result from markdown are from https://github.github.com/gfm/#tables-extension- + allowedTags: { + override: options2.allowedTags?.override ?? allowedMarkdownHtmlTags + }, + allowedAttributes: { + override: options2.allowedAttributes?.override ?? allowedMarkdownHtmlAttributes + }, + allowedLinkProtocols: { + override: allowedLinkSchemes + }, + allowRelativeLinkPaths: !!mdStrConfig.baseUri, + allowedMediaProtocols: { + override: [ + Schemas.http, + Schemas.https, + Schemas.data, + Schemas.file, + Schemas.vscodeFileResource, + Schemas.vscodeRemote, + Schemas.vscodeRemoteResource + ] + }, + allowRelativeMediaPaths: !!mdStrConfig.baseUri, + replaceWithPlaintext: options2.replaceWithPlaintext + }; +} +function renderAsPlaintext(str, options2) { + if (typeof str === "string") { + return str; + } + let value = str.value ?? ""; + if (value.length > 1e5) { + value = `${value.substr(0, 1e5)}\u2026`; + } + const html3 = parse(value, { async: false, renderer: options2?.includeCodeBlocksFences ? plainTextWithCodeBlocksRenderer.value : plainTextRenderer.value }); + return sanitizeRenderedMarkdown(html3, { isTrusted: false }, {}).toString().replace(/&(#\d+|[a-zA-Z]+);/g, (m) => unescapeInfo.get(m) ?? m).trim(); +} +var unescapeInfo = /* @__PURE__ */ new Map([ + [""", '"'], + [" ", " "], + ["&", "&"], + ["'", "'"], + ["<", "<"], + [">", ">"] +]); +function createPlainTextRenderer() { + const renderer = new _Renderer(); + renderer.code = ({ text: text2 }) => { + return escape(text2); + }; + renderer.blockquote = ({ text: text2 }) => { + return text2 + "\n"; + }; + renderer.html = (_) => { + return ""; + }; + renderer.heading = function({ tokens }) { + return this.parser.parseInline(tokens) + "\n"; + }; + renderer.hr = () => { + return ""; + }; + renderer.list = function({ items }) { + return items.map((x) => this.listitem(x)).join("\n") + "\n"; + }; + renderer.listitem = ({ text: text2 }) => { + return text2 + "\n"; + }; + renderer.paragraph = function({ tokens }) { + return this.parser.parseInline(tokens) + "\n"; + }; + renderer.table = function({ header: header2, rows }) { + return header2.map((cell) => this.tablecell(cell)).join(" ") + "\n" + rows.map((cells) => cells.map((cell) => this.tablecell(cell)).join(" ")).join("\n") + "\n"; + }; + renderer.tablerow = ({ text: text2 }) => { + return text2; + }; + renderer.tablecell = function({ tokens }) { + return this.parser.parseInline(tokens); + }; + renderer.strong = ({ text: text2 }) => { + return text2; + }; + renderer.em = ({ text: text2 }) => { + return text2; + }; + renderer.codespan = ({ text: text2 }) => { + return escape(text2); + }; + renderer.br = (_) => { + return "\n"; + }; + renderer.del = ({ text: text2 }) => { + return text2; + }; + renderer.image = (_) => { + return ""; + }; + renderer.text = ({ text: text2 }) => { + return text2; + }; + renderer.link = ({ text: text2 }) => { + return text2; + }; + return renderer; +} +var plainTextRenderer = new Lazy(createPlainTextRenderer); +var plainTextWithCodeBlocksRenderer = new Lazy(() => { + const renderer = createPlainTextRenderer(); + renderer.code = ({ text: text2 }) => { + return ` +\`\`\` +${escape(text2)} +\`\`\` +`; + }; + return renderer; +}); +function mergeRawTokenText(tokens) { + let mergedTokenText = ""; + tokens.forEach((token) => { + mergedTokenText += token.raw; + }); + return mergedTokenText; +} +function completeSingleLinePattern(token) { + if (!token.tokens) { + return void 0; + } + for (let i2 = token.tokens.length - 1; i2 >= 0; i2--) { + const subtoken = token.tokens[i2]; + if (subtoken.type === "text") { + const lines = subtoken.raw.split("\n"); + const lastLine = lines[lines.length - 1]; + if (lastLine.includes("`")) { + return completeCodespan(token); + } else if (lastLine.includes("**")) { + return completeDoublestar(token); + } else if (lastLine.match(/\*\w/)) { + return completeStar(token); + } else if (lastLine.match(/(^|\s)__\w/)) { + return completeDoubleUnderscore(token); + } else if (lastLine.match(/(^|\s)_\w/)) { + return completeUnderscore(token); + } else if ( + // Text with start of link target + hasLinkTextAndStartOfLinkTarget(lastLine) || // This token doesn't have the link text, eg if it contains other markdown constructs that are in other subtokens. + // But some preceding token does have an unbalanced [ at least + hasStartOfLinkTargetAndNoLinkText(lastLine) && token.tokens.slice(0, i2).some((t) => t.type === "text" && t.raw.match(/\[[^\]]*$/)) + ) { + const nextTwoSubTokens = token.tokens.slice(i2 + 1); + if ( + // If the link was parsed as a link, then look for a link token and a text token with a quote + nextTwoSubTokens[0]?.type === "link" && nextTwoSubTokens[1]?.type === "text" && nextTwoSubTokens[1].raw.match(/^ *"[^"]*$/) || // And if the link was not parsed as a link (eg command link), just look for a single quote in this token + lastLine.match(/^[^"]* +"[^"]*$/) + ) { + return completeLinkTargetArg(token); + } + return completeLinkTarget(token); + } else if (lastLine.match(/(^|\s)\[\w*[^\]]*$/)) { + return completeLinkText(token); + } + } + } + return void 0; +} +function hasLinkTextAndStartOfLinkTarget(str) { + return !!str.match(/(^|\s)\[.*\]\(\w*/); +} +function hasStartOfLinkTargetAndNoLinkText(str) { + return !!str.match(/^[^\[]*\]\([^\)]*$/); +} +function completeListItemPattern(list2) { + const lastListItem = list2.items[list2.items.length - 1]; + const lastListSubToken = lastListItem.tokens ? lastListItem.tokens[lastListItem.tokens.length - 1] : void 0; + const listEndsInHeading = (list3) => { + const lastItem = list3.items.at(-1); + const lastToken = lastItem?.tokens.at(-1); + return lastToken?.type === "heading" || lastToken?.type === "list" && listEndsInHeading(lastToken); + }; + let newToken; + if (lastListSubToken?.type === "text" && !("inRawBlock" in lastListItem)) { + newToken = completeSingleLinePattern(lastListSubToken); + } else if (listEndsInHeading(list2)) { + const newList2 = lexer(list2.raw.trim() + "  ")[0]; + if (newList2.type !== "list") { + return; + } + return newList2; + } + if (!newToken || newToken.type !== "paragraph") { + return; + } + const previousListItemsText = mergeRawTokenText(list2.items.slice(0, -1)); + const lastListItemLead = lastListItem.raw.match(/^(\s*(-|\d+\.|\*) +)/)?.[0]; + if (!lastListItemLead) { + return; + } + const newListItemText = lastListItemLead + mergeRawTokenText(lastListItem.tokens.slice(0, -1)) + newToken.raw; + const newList = lexer(previousListItemsText + newListItemText)[0]; + if (newList.type !== "list") { + return; + } + return newList; +} +function completeHeading(token, fullRawText) { + if (token.raw.match(/-\s*$/)) { + return lexer(fullRawText + "  "); + } +} +var maxIncompleteTokensFixRounds = 3; +function fillInIncompleteTokens(tokens) { + for (let i2 = 0; i2 < maxIncompleteTokensFixRounds; i2++) { + const newTokens = fillInIncompleteTokensOnce(tokens); + if (newTokens) { + tokens = newTokens; + } else { + break; + } + } + return tokens; +} +function fillInIncompleteTokensOnce(tokens) { + let i2; + let newTokens; + for (i2 = 0; i2 < tokens.length; i2++) { + const token = tokens[i2]; + if (token.type === "paragraph" && token.raw.match(/(\n|^)\|/)) { + newTokens = completeTable(tokens.slice(i2)); + break; + } + } + const lastToken = tokens.at(-1); + if (!newTokens && lastToken?.type === "list") { + const newListToken = completeListItemPattern(lastToken); + if (newListToken) { + newTokens = [newListToken]; + i2 = tokens.length - 1; + } + } + if (!newTokens && lastToken?.type === "paragraph") { + const newToken = completeSingleLinePattern(lastToken); + if (newToken) { + newTokens = [newToken]; + i2 = tokens.length - 1; + } + } + if (newTokens) { + const newTokensList = [ + ...tokens.slice(0, i2), + ...newTokens + ]; + newTokensList.links = tokens.links; + return newTokensList; + } + if (lastToken?.type === "heading") { + const completeTokens = completeHeading(lastToken, mergeRawTokenText(tokens)); + if (completeTokens) { + return completeTokens; + } + } + return null; +} +function completeCodespan(token) { + return completeWithString(token, "`"); +} +function completeStar(tokens) { + return completeWithString(tokens, "*"); +} +function completeUnderscore(tokens) { + return completeWithString(tokens, "_"); +} +function completeLinkTarget(tokens) { + return completeWithString(tokens, ")", false); +} +function completeLinkTargetArg(tokens) { + return completeWithString(tokens, '")', false); +} +function completeLinkText(tokens) { + return completeWithString(tokens, "](https://microsoft.com)", false); +} +function completeDoublestar(tokens) { + return completeWithString(tokens, "**"); +} +function completeDoubleUnderscore(tokens) { + return completeWithString(tokens, "__"); +} +function completeWithString(tokens, closingString, shouldTrim = true) { + const mergedRawText = mergeRawTokenText(Array.isArray(tokens) ? tokens : [tokens]); + const trimmedRawText = shouldTrim ? mergedRawText.trimEnd() : mergedRawText; + return lexer(trimmedRawText + closingString)[0]; +} +function completeTable(tokens) { + const mergedRawText = mergeRawTokenText(tokens); + const lines = mergedRawText.split("\n"); + let numCols; + let hasSeparatorRow = false; + for (let i2 = 0; i2 < lines.length; i2++) { + const line = lines[i2].trim(); + if (typeof numCols === "undefined" && line.match(/^\s*\|/)) { + const line1Matches = line.match(/(\|[^\|]+)(?=\||$)/g); + if (line1Matches) { + numCols = line1Matches.length; + } + } else if (typeof numCols === "number") { + if (line.match(/^\s*\|/)) { + if (i2 !== lines.length - 1) { + return void 0; + } + hasSeparatorRow = true; + } else { + return void 0; + } + } + } + if (typeof numCols === "number" && numCols > 0) { + const prefixText = hasSeparatorRow ? lines.slice(0, -1).join("\n") : mergedRawText; + const line1EndsInPipe = !!prefixText.match(/\|\s*$/); + const newRawText = prefixText + (line1EndsInPipe ? "" : "|") + ` +|${" --- |".repeat(numCols)}`; + return lexer(newRawText); + } + return void 0; +} + +// node_modules/monaco-editor-core/esm/vs/base/browser/ui/hover/hoverDelegate2.js +init_lifecycle(); +var baseHoverDelegate = { + showInstantHover: () => void 0, + showDelayedHover: () => void 0, + setupDelayedHover: () => Disposable.None, + setupDelayedHoverAtMouse: () => Disposable.None, + hideHover: () => void 0, + showAndFocusLastHover: () => void 0, + setupManagedHover: () => ({ + dispose: () => void 0, + show: () => void 0, + hide: () => void 0, + update: () => void 0 + }), + showManagedHover: () => void 0 +}; +function setBaseLayerHoverDelegate(hoverDelegate) { + baseHoverDelegate = hoverDelegate; +} +function getBaseLayerHoverDelegate() { + return baseHoverDelegate; +} + +// node_modules/monaco-editor-core/esm/vs/base/browser/ui/list/listWidget.js +init_dom(); +init_keyboardEvent(); + +// node_modules/monaco-editor-core/esm/vs/base/browser/ui/list/splice.js +var CombinedSpliceable = class { + constructor(spliceables) { + this.spliceables = spliceables; + } + splice(start, deleteCount, elements) { + this.spliceables.forEach((s) => s.splice(start, deleteCount, elements)); + } +}; + +// node_modules/monaco-editor-core/esm/vs/base/browser/ui/list/listWidget.js +init_arrays(); +init_async(); +init_color(); +init_event(); +init_filters(); +init_lifecycle(); +init_numbers(); +init_platform(); +init_types(); + +// node_modules/monaco-editor-core/esm/vs/base/browser/ui/list/list.js +var ListError = class extends Error { + constructor(user, message) { + super(`ListError [${user}] ${message}`); + } +}; + +// node_modules/monaco-editor-core/esm/vs/base/browser/ui/list/listView.js +init_dom(); +init_arrays(); +init_async(); +init_event(); +init_lifecycle(); + +// node_modules/monaco-editor-core/esm/vs/base/common/range.js +var Range2; +(function(Range4) { + function intersect(one, other) { + if (one.start >= other.end || other.start >= one.end) { + return { start: 0, end: 0 }; + } + const start = Math.max(one.start, other.start); + const end = Math.min(one.end, other.end); + if (end - start <= 0) { + return { start: 0, end: 0 }; + } + return { start, end }; + } + Range4.intersect = intersect; + function isEmpty(range2) { + return range2.end - range2.start <= 0; + } + Range4.isEmpty = isEmpty; + function intersects2(one, other) { + return !isEmpty(intersect(one, other)); + } + Range4.intersects = intersects2; + function relativeComplement2(one, other) { + const result = []; + const first2 = { start: one.start, end: Math.min(other.start, one.end) }; + const second = { start: Math.max(other.end, one.start), end: one.end }; + if (!isEmpty(first2)) { + result.push(first2); + } + if (!isEmpty(second)) { + result.push(second); + } + return result; + } + Range4.relativeComplement = relativeComplement2; +})(Range2 || (Range2 = {})); + +// node_modules/monaco-editor-core/esm/vs/base/browser/ui/list/rangeMap.js +function groupIntersect(range2, groups) { + const result = []; + for (const r of groups) { + if (range2.start >= r.range.end) { + continue; + } + if (range2.end < r.range.start) { + break; + } + const intersection2 = Range2.intersect(range2, r.range); + if (Range2.isEmpty(intersection2)) { + continue; + } + result.push({ + range: intersection2, + size: r.size + }); + } + return result; +} +function shift({ start, end }, much) { + return { start: start + much, end: end + much }; +} +function consolidate(groups) { + const result = []; + let previousGroup = null; + for (const group of groups) { + const start = group.range.start; + const end = group.range.end; + const size2 = group.size; + if (previousGroup && size2 === previousGroup.size) { + previousGroup.range.end = end; + continue; + } + previousGroup = { range: { start, end }, size: size2 }; + result.push(previousGroup); + } + return result; +} +function concat3(...groups) { + return consolidate(groups.reduce((r, g) => r.concat(g), [])); +} +var RangeMap = class { + get paddingTop() { + return this._paddingTop; + } + set paddingTop(paddingTop) { + this._size = this._size + paddingTop - this._paddingTop; + this._paddingTop = paddingTop; + } + constructor(topPadding) { + this.groups = []; + this._size = 0; + this._paddingTop = 0; + this._paddingTop = topPadding ?? 0; + this._size = this._paddingTop; + } + splice(index, deleteCount, items = []) { + const diff = items.length - deleteCount; + const before = groupIntersect({ start: 0, end: index }, this.groups); + const after2 = groupIntersect({ start: index + deleteCount, end: Number.POSITIVE_INFINITY }, this.groups).map((g) => ({ range: shift(g.range, diff), size: g.size })); + const middle = items.map((item, i2) => ({ + range: { start: index + i2, end: index + i2 + 1 }, + size: item.size + })); + this.groups = concat3(before, middle, after2); + this._size = this._paddingTop + this.groups.reduce((t, g) => t + g.size * (g.range.end - g.range.start), 0); + } + /** + * Returns the number of items in the range map. + */ + get count() { + const len = this.groups.length; + if (!len) { + return 0; + } + return this.groups[len - 1].range.end; + } + /** + * Returns the sum of the sizes of all items in the range map. + */ + get size() { + return this._size; + } + /** + * Returns the index of the item at the given position. + */ + indexAt(position) { + if (position < 0) { + return -1; + } + if (position < this._paddingTop) { + return 0; + } + let index = 0; + let size2 = this._paddingTop; + for (const group of this.groups) { + const count = group.range.end - group.range.start; + const newSize = size2 + count * group.size; + if (position < newSize) { + return index + Math.floor((position - size2) / group.size); + } + index += count; + size2 = newSize; + } + return index; + } + /** + * Returns the index of the item right after the item at the + * index of the given position. + */ + indexAfter(position) { + return Math.min(this.indexAt(position) + 1, this.count); + } + /** + * Returns the start position of the item at the given index. + */ + positionAt(index) { + if (index < 0) { + return -1; + } + let position = 0; + let count = 0; + for (const group of this.groups) { + const groupCount = group.range.end - group.range.start; + const newCount = count + groupCount; + if (index < newCount) { + return this._paddingTop + position + (index - count) * group.size; + } + position += groupCount * group.size; + count = newCount; + } + return -1; + } +}; + +// node_modules/monaco-editor-core/esm/vs/base/browser/ui/list/rowCache.js +init_dom(); +var RowCache = class { + constructor(renderers) { + this.renderers = renderers; + this.cache = /* @__PURE__ */ new Map(); + this.transactionNodesPendingRemoval = /* @__PURE__ */ new Set(); + this.inTransaction = false; + } + /** + * Returns a row either by creating a new one or reusing + * a previously released row which shares the same templateId. + * + * @returns A row and `isReusingConnectedDomNode` if the row's node is already in the dom in a stale position. + */ + alloc(templateId) { + let result = this.getTemplateCache(templateId).pop(); + let isStale = false; + if (result) { + isStale = this.transactionNodesPendingRemoval.has(result.domNode); + if (isStale) { + this.transactionNodesPendingRemoval.delete(result.domNode); + } + } else { + const domNode = $(".monaco-list-row"); + const renderer = this.getRenderer(templateId); + const templateData = renderer.renderTemplate(domNode); + result = { domNode, templateId, templateData }; + } + return { row: result, isReusingConnectedDomNode: isStale }; + } + /** + * Releases the row for eventual reuse. + */ + release(row) { + if (!row) { + return; + } + this.releaseRow(row); + } + /** + * Begin a set of changes that use the cache. This lets us skip work when a row is removed and then inserted again. + */ + transact(makeChanges) { + if (this.inTransaction) { + throw new Error("Already in transaction"); + } + this.inTransaction = true; + try { + makeChanges(); + } finally { + for (const domNode of this.transactionNodesPendingRemoval) { + this.doRemoveNode(domNode); + } + this.transactionNodesPendingRemoval.clear(); + this.inTransaction = false; + } + } + releaseRow(row) { + const { domNode, templateId } = row; + if (domNode) { + if (this.inTransaction) { + this.transactionNodesPendingRemoval.add(domNode); + } else { + this.doRemoveNode(domNode); + } + } + const cache = this.getTemplateCache(templateId); + cache.push(row); + } + doRemoveNode(domNode) { + domNode.classList.remove("scrolling"); + domNode.remove(); + } + getTemplateCache(templateId) { + let result = this.cache.get(templateId); + if (!result) { + result = []; + this.cache.set(templateId, result); + } + return result; + } + dispose() { + this.cache.forEach((cachedRows, templateId) => { + for (const cachedRow of cachedRows) { + const renderer = this.getRenderer(templateId); + renderer.disposeTemplate(cachedRow.templateData); + cachedRow.templateData = null; + } + }); + this.cache.clear(); + this.transactionNodesPendingRemoval.clear(); + } + getRenderer(templateId) { + const renderer = this.renderers.get(templateId); + if (!renderer) { + throw new Error(`No renderer found for ${templateId}`); + } + return renderer; + } +}; + +// node_modules/monaco-editor-core/esm/vs/base/browser/ui/list/listView.js +init_errors(); +init_numbers(); + +// node_modules/monaco-editor-core/esm/vs/base/browser/ui/dnd/dnd.js +init_dom(); +function applyDragImage(event, container, label, extraClasses = []) { + if (!event.dataTransfer) { + return; + } + const dragImage = $(".monaco-drag-image"); + dragImage.textContent = label; + dragImage.classList.add(...extraClasses); + const getDragImageContainer = (e) => { + while (e && !e.classList.contains("monaco-workbench")) { + e = e.parentElement; + } + return e || container.ownerDocument.body; + }; + const dragContainer = getDragImageContainer(container); + dragContainer.appendChild(dragImage); + event.dataTransfer.setDragImage(dragImage, -10, -10); + setTimeout(() => dragImage.remove(), 0); +} + +// node_modules/monaco-editor-core/esm/vs/base/browser/ui/list/listView.js +var __decorate27 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var StaticDND = { + CurrentDragAndDropData: void 0 +}; +var DefaultOptions = { + useShadows: true, + verticalScrollMode: 1, + setRowLineHeight: true, + setRowHeight: true, + supportDynamicHeights: false, + dnd: { + getDragElements(e) { + return [e]; + }, + getDragURI() { + return null; + }, + onDragStart() { + }, + onDragOver() { + return false; + }, + drop() { + }, + dispose() { + } + }, + horizontalScrolling: false, + transformOptimization: true, + alwaysConsumeMouseWheel: true +}; +var ElementsDragAndDropData = class { + constructor(elements) { + this.elements = elements; + } + update() { + } + getData() { + return this.elements; + } +}; +var ExternalElementsDragAndDropData = class { + constructor(elements) { + this.elements = elements; + } + update() { + } + getData() { + return this.elements; + } +}; +var NativeDragAndDropData = class { + constructor() { + this.types = []; + this.files = []; + } + update(dataTransfer) { + if (dataTransfer.types) { + this.types.splice(0, this.types.length, ...dataTransfer.types); + } + if (dataTransfer.files) { + this.files.splice(0, this.files.length); + for (let i2 = 0; i2 < dataTransfer.files.length; i2++) { + const file = dataTransfer.files.item(i2); + if (file && (file.size || file.type)) { + this.files.push(file); + } + } + } + } + getData() { + return { + types: this.types, + files: this.files + }; + } +}; +function equalsDragFeedback(f1, f2) { + if (Array.isArray(f1) && Array.isArray(f2)) { + return equals(f1, f2); + } + return f1 === f2; +} +var ListViewAccessibilityProvider = class { + constructor(accessibilityProvider) { + if (accessibilityProvider?.getSetSize) { + this.getSetSize = accessibilityProvider.getSetSize.bind(accessibilityProvider); + } else { + this.getSetSize = (e, i2, l) => l; + } + if (accessibilityProvider?.getPosInSet) { + this.getPosInSet = accessibilityProvider.getPosInSet.bind(accessibilityProvider); + } else { + this.getPosInSet = (e, i2) => i2 + 1; + } + if (accessibilityProvider?.getRole) { + this.getRole = accessibilityProvider.getRole.bind(accessibilityProvider); + } else { + this.getRole = (_) => "listitem"; + } + if (accessibilityProvider?.isChecked) { + this.isChecked = accessibilityProvider.isChecked.bind(accessibilityProvider); + } else { + this.isChecked = (_) => void 0; + } + } +}; +var ListView = class _ListView { + static { + this.InstanceCount = 0; + } + get contentHeight() { + return this.rangeMap.size; + } + get onDidScroll() { + return this.scrollableElement.onScroll; + } + get scrollableElementDomNode() { + return this.scrollableElement.getDomNode(); + } + get horizontalScrolling() { + return this._horizontalScrolling; + } + set horizontalScrolling(value) { + if (value === this._horizontalScrolling) { + return; + } + if (value && this.supportDynamicHeights) { + throw new Error("Horizontal scrolling and dynamic heights not supported simultaneously"); + } + this._horizontalScrolling = value; + this.domNode.classList.toggle("horizontal-scrolling", this._horizontalScrolling); + if (this._horizontalScrolling) { + for (const item of this.items) { + this.measureItemWidth(item); + } + this.updateScrollWidth(); + this.scrollableElement.setScrollDimensions({ width: getContentWidth(this.domNode) }); + this.rowsContainer.style.width = `${Math.max(this.scrollWidth || 0, this.renderWidth)}px`; + } else { + this.scrollableElementWidthDelayer.cancel(); + this.scrollableElement.setScrollDimensions({ width: this.renderWidth, scrollWidth: this.renderWidth }); + this.rowsContainer.style.width = ""; + } + } + constructor(container, virtualDelegate, renderers, options2 = DefaultOptions) { + this.virtualDelegate = virtualDelegate; + this.domId = `list_id_${++_ListView.InstanceCount}`; + this.renderers = /* @__PURE__ */ new Map(); + this.renderWidth = 0; + this._scrollHeight = 0; + this.scrollableElementUpdateDisposable = null; + this.scrollableElementWidthDelayer = new Delayer(50); + this.splicing = false; + this.dragOverAnimationStopDisposable = Disposable.None; + this.dragOverMouseY = 0; + this.canDrop = false; + this.currentDragFeedbackDisposable = Disposable.None; + this.onDragLeaveTimeout = Disposable.None; + this.currentSelectionDisposable = Disposable.None; + this.disposables = new DisposableStore(); + this._onDidChangeContentHeight = new Emitter(); + this._onDidChangeContentWidth = new Emitter(); + this.onDidChangeContentHeight = Event.latch(this._onDidChangeContentHeight.event, void 0, this.disposables); + this._horizontalScrolling = false; + if (options2.horizontalScrolling && options2.supportDynamicHeights) { + throw new Error("Horizontal scrolling and dynamic heights not supported simultaneously"); + } + this.items = []; + this.itemId = 0; + this.rangeMap = this.createRangeMap(options2.paddingTop ?? 0); + for (const renderer of renderers) { + this.renderers.set(renderer.templateId, renderer); + } + this.cache = this.disposables.add(new RowCache(this.renderers)); + this.lastRenderTop = 0; + this.lastRenderHeight = 0; + this.domNode = document.createElement("div"); + this.domNode.className = "monaco-list"; + this.domNode.classList.add(this.domId); + this.domNode.tabIndex = 0; + this.domNode.classList.toggle("mouse-support", typeof options2.mouseSupport === "boolean" ? options2.mouseSupport : true); + this._horizontalScrolling = options2.horizontalScrolling ?? DefaultOptions.horizontalScrolling; + this.domNode.classList.toggle("horizontal-scrolling", this._horizontalScrolling); + this.paddingBottom = typeof options2.paddingBottom === "undefined" ? 0 : options2.paddingBottom; + this.accessibilityProvider = new ListViewAccessibilityProvider(options2.accessibilityProvider); + this.rowsContainer = document.createElement("div"); + this.rowsContainer.className = "monaco-list-rows"; + const transformOptimization = options2.transformOptimization ?? DefaultOptions.transformOptimization; + if (transformOptimization) { + this.rowsContainer.style.transform = "translate3d(0px, 0px, 0px)"; + this.rowsContainer.style.overflow = "hidden"; + this.rowsContainer.style.contain = "strict"; + } + this.disposables.add(Gesture.addTarget(this.rowsContainer)); + this.scrollable = this.disposables.add(new Scrollable({ + forceIntegerValues: true, + smoothScrollDuration: options2.smoothScrolling ?? false ? 125 : 0, + scheduleAtNextAnimationFrame: (cb) => scheduleAtNextAnimationFrame(getWindow(this.domNode), cb) + })); + this.scrollableElement = this.disposables.add(new SmoothScrollableElement(this.rowsContainer, { + alwaysConsumeMouseWheel: options2.alwaysConsumeMouseWheel ?? DefaultOptions.alwaysConsumeMouseWheel, + horizontal: 1, + vertical: options2.verticalScrollMode ?? DefaultOptions.verticalScrollMode, + useShadows: options2.useShadows ?? DefaultOptions.useShadows, + mouseWheelScrollSensitivity: options2.mouseWheelScrollSensitivity, + fastScrollSensitivity: options2.fastScrollSensitivity, + scrollByPage: options2.scrollByPage + }, this.scrollable)); + this.domNode.appendChild(this.scrollableElement.getDomNode()); + container.appendChild(this.domNode); + this.scrollableElement.onScroll(this.onScroll, this, this.disposables); + this.disposables.add(addDisposableListener(this.rowsContainer, EventType2.Change, (e) => this.onTouchChange(e))); + this.disposables.add(addDisposableListener(this.scrollableElement.getDomNode(), "scroll", (e) => { + const element = e.target; + const scrollValue = element.scrollTop; + element.scrollTop = 0; + if (options2.scrollToActiveElement) { + this.setScrollTop(this.scrollTop + scrollValue); + } + })); + this.disposables.add(addDisposableListener(this.domNode, "dragover", (e) => this.onDragOver(this.toDragEvent(e)))); + this.disposables.add(addDisposableListener(this.domNode, "drop", (e) => this.onDrop(this.toDragEvent(e)))); + this.disposables.add(addDisposableListener(this.domNode, "dragleave", (e) => this.onDragLeave(this.toDragEvent(e)))); + this.disposables.add(addDisposableListener(this.domNode, "dragend", (e) => this.onDragEnd(e))); + if (options2.userSelection) { + if (options2.dnd) { + throw new Error("DND and user selection cannot be used simultaneously"); + } + this.disposables.add(addDisposableListener(this.domNode, "mousedown", (e) => this.onPotentialSelectionStart(e))); + } + this.setRowLineHeight = options2.setRowLineHeight ?? DefaultOptions.setRowLineHeight; + this.setRowHeight = options2.setRowHeight ?? DefaultOptions.setRowHeight; + this.supportDynamicHeights = options2.supportDynamicHeights ?? DefaultOptions.supportDynamicHeights; + this.dnd = options2.dnd ?? this.disposables.add(DefaultOptions.dnd); + this.layout(options2.initialSize?.height, options2.initialSize?.width); + if (options2.scrollToActiveElement) { + this._setupFocusObserver(container); + } + } + _setupFocusObserver(container) { + this.disposables.add(addDisposableListener(container, "focus", () => { + const element = getActiveElement(); + if (this.activeElement !== element && element !== null) { + this.activeElement = element; + this._scrollToActiveElement(this.activeElement, container); + } + }, true)); + } + _scrollToActiveElement(element, container) { + const containerRect = container.getBoundingClientRect(); + const elementRect = element.getBoundingClientRect(); + const topOffset = elementRect.top - containerRect.top; + if (topOffset < 0) { + this.setScrollTop(this.scrollTop + topOffset); + } + } + updateOptions(options2) { + if (options2.paddingBottom !== void 0) { + this.paddingBottom = options2.paddingBottom; + this.scrollableElement.setScrollDimensions({ scrollHeight: this.scrollHeight }); + } + if (options2.smoothScrolling !== void 0) { + this.scrollable.setSmoothScrollDuration(options2.smoothScrolling ? 125 : 0); + } + if (options2.horizontalScrolling !== void 0) { + this.horizontalScrolling = options2.horizontalScrolling; + } + let scrollableOptions; + if (options2.scrollByPage !== void 0) { + scrollableOptions = { ...scrollableOptions ?? {}, scrollByPage: options2.scrollByPage }; + } + if (options2.mouseWheelScrollSensitivity !== void 0) { + scrollableOptions = { ...scrollableOptions ?? {}, mouseWheelScrollSensitivity: options2.mouseWheelScrollSensitivity }; + } + if (options2.fastScrollSensitivity !== void 0) { + scrollableOptions = { ...scrollableOptions ?? {}, fastScrollSensitivity: options2.fastScrollSensitivity }; + } + if (scrollableOptions) { + this.scrollableElement.updateOptions(scrollableOptions); + } + if (options2.paddingTop !== void 0 && options2.paddingTop !== this.rangeMap.paddingTop) { + const lastRenderRange = this.getRenderRange(this.lastRenderTop, this.lastRenderHeight); + const offset = options2.paddingTop - this.rangeMap.paddingTop; + this.rangeMap.paddingTop = options2.paddingTop; + this.render(lastRenderRange, Math.max(0, this.lastRenderTop + offset), this.lastRenderHeight, void 0, void 0, true); + this.setScrollTop(this.lastRenderTop); + this.eventuallyUpdateScrollDimensions(); + if (this.supportDynamicHeights) { + this._rerender(this.lastRenderTop, this.lastRenderHeight); + } + } + } + createRangeMap(paddingTop) { + return new RangeMap(paddingTop); + } + splice(start, deleteCount, elements = []) { + if (this.splicing) { + throw new Error("Can't run recursive splices."); + } + this.splicing = true; + try { + return this._splice(start, deleteCount, elements); + } finally { + this.splicing = false; + this._onDidChangeContentHeight.fire(this.contentHeight); + } + } + _splice(start, deleteCount, elements = []) { + const previousRenderRange = this.getRenderRange(this.lastRenderTop, this.lastRenderHeight); + const deleteRange = { start, end: start + deleteCount }; + const removeRange = Range2.intersect(previousRenderRange, deleteRange); + const rowsToDispose = /* @__PURE__ */ new Map(); + for (let i2 = removeRange.end - 1; i2 >= removeRange.start; i2--) { + const item = this.items[i2]; + item.dragStartDisposable.dispose(); + item.checkedDisposable.dispose(); + if (item.row) { + let rows = rowsToDispose.get(item.templateId); + if (!rows) { + rows = []; + rowsToDispose.set(item.templateId, rows); + } + const renderer = this.renderers.get(item.templateId); + if (renderer && renderer.disposeElement) { + renderer.disposeElement(item.element, i2, item.row.templateData, { height: item.size }); + } + rows.unshift(item.row); + } + item.row = null; + item.stale = true; + } + const previousRestRange = { start: start + deleteCount, end: this.items.length }; + const previousRenderedRestRange = Range2.intersect(previousRestRange, previousRenderRange); + const previousUnrenderedRestRanges = Range2.relativeComplement(previousRestRange, previousRenderRange); + const inserted = elements.map((element) => ({ + id: String(this.itemId++), + element, + templateId: this.virtualDelegate.getTemplateId(element), + size: this.virtualDelegate.getHeight(element), + width: void 0, + hasDynamicHeight: !!this.virtualDelegate.hasDynamicHeight && this.virtualDelegate.hasDynamicHeight(element), + lastDynamicHeightWidth: void 0, + row: null, + uri: void 0, + dropTarget: false, + dragStartDisposable: Disposable.None, + checkedDisposable: Disposable.None, + stale: false + })); + let deleted; + if (start === 0 && deleteCount >= this.items.length) { + this.rangeMap = this.createRangeMap(this.rangeMap.paddingTop); + this.rangeMap.splice(0, 0, inserted); + deleted = this.items; + this.items = inserted; + } else { + this.rangeMap.splice(start, deleteCount, inserted); + deleted = splice(this.items, start, deleteCount, inserted); + } + const delta = elements.length - deleteCount; + const renderRange = this.getRenderRange(this.lastRenderTop, this.lastRenderHeight); + const renderedRestRange = shift(previousRenderedRestRange, delta); + const updateRange = Range2.intersect(renderRange, renderedRestRange); + for (let i2 = updateRange.start; i2 < updateRange.end; i2++) { + this.updateItemInDOM(this.items[i2], i2); + } + const removeRanges = Range2.relativeComplement(renderedRestRange, renderRange); + for (const range2 of removeRanges) { + for (let i2 = range2.start; i2 < range2.end; i2++) { + this.removeItemFromDOM(i2); + } + } + const unrenderedRestRanges = previousUnrenderedRestRanges.map((r) => shift(r, delta)); + const elementsRange = { start, end: start + elements.length }; + const insertRanges = [elementsRange, ...unrenderedRestRanges].map((r) => Range2.intersect(renderRange, r)).reverse(); + for (const range2 of insertRanges) { + for (let i2 = range2.end - 1; i2 >= range2.start; i2--) { + const item = this.items[i2]; + const rows = rowsToDispose.get(item.templateId); + const row = rows?.pop(); + this.insertItemInDOM(i2, row); + } + } + for (const rows of rowsToDispose.values()) { + for (const row of rows) { + this.cache.release(row); + } + } + this.eventuallyUpdateScrollDimensions(); + if (this.supportDynamicHeights) { + this._rerender(this.scrollTop, this.renderHeight); + } + return deleted.map((i2) => i2.element); + } + eventuallyUpdateScrollDimensions() { + this._scrollHeight = this.contentHeight; + this.rowsContainer.style.height = `${this._scrollHeight}px`; + if (!this.scrollableElementUpdateDisposable) { + this.scrollableElementUpdateDisposable = scheduleAtNextAnimationFrame(getWindow(this.domNode), () => { + this.scrollableElement.setScrollDimensions({ scrollHeight: this.scrollHeight }); + this.updateScrollWidth(); + this.scrollableElementUpdateDisposable = null; + }); + } + } + eventuallyUpdateScrollWidth() { + if (!this.horizontalScrolling) { + this.scrollableElementWidthDelayer.cancel(); + return; + } + this.scrollableElementWidthDelayer.trigger(() => this.updateScrollWidth()); + } + updateScrollWidth() { + if (!this.horizontalScrolling) { + return; + } + let scrollWidth = 0; + for (const item of this.items) { + if (typeof item.width !== "undefined") { + scrollWidth = Math.max(scrollWidth, item.width); + } + } + this.scrollWidth = scrollWidth; + this.scrollableElement.setScrollDimensions({ scrollWidth: scrollWidth === 0 ? 0 : scrollWidth + 10 }); + this._onDidChangeContentWidth.fire(this.scrollWidth); + } + rerender() { + if (!this.supportDynamicHeights) { + return; + } + for (const item of this.items) { + item.lastDynamicHeightWidth = void 0; + } + this._rerender(this.lastRenderTop, this.lastRenderHeight); + } + get length() { + return this.items.length; + } + get renderHeight() { + const scrollDimensions = this.scrollableElement.getScrollDimensions(); + return scrollDimensions.height; + } + get firstVisibleIndex() { + const range2 = this.getVisibleRange(this.lastRenderTop, this.lastRenderHeight); + return range2.start; + } + element(index) { + return this.items[index].element; + } + indexOf(element) { + return this.items.findIndex((item) => item.element === element); + } + domElement(index) { + const row = this.items[index].row; + return row && row.domNode; + } + elementHeight(index) { + return this.items[index].size; + } + elementTop(index) { + return this.rangeMap.positionAt(index); + } + indexAt(position) { + return this.rangeMap.indexAt(position); + } + indexAfter(position) { + return this.rangeMap.indexAfter(position); + } + layout(height, width2) { + const scrollDimensions = { + height: typeof height === "number" ? height : getContentHeight(this.domNode) + }; + if (this.scrollableElementUpdateDisposable) { + this.scrollableElementUpdateDisposable.dispose(); + this.scrollableElementUpdateDisposable = null; + scrollDimensions.scrollHeight = this.scrollHeight; + } + this.scrollableElement.setScrollDimensions(scrollDimensions); + if (typeof width2 !== "undefined") { + this.renderWidth = width2; + if (this.supportDynamicHeights) { + this._rerender(this.scrollTop, this.renderHeight); + } + } + if (this.horizontalScrolling) { + this.scrollableElement.setScrollDimensions({ + width: typeof width2 === "number" ? width2 : getContentWidth(this.domNode) + }); + } + } + // Render + render(previousRenderRange, renderTop, renderHeight, renderLeft, scrollWidth, updateItemsInDOM = false, onScroll = false) { + const renderRange = this.getRenderRange(renderTop, renderHeight); + const rangesToInsert = Range2.relativeComplement(renderRange, previousRenderRange).reverse(); + const rangesToRemove = Range2.relativeComplement(previousRenderRange, renderRange); + if (updateItemsInDOM) { + const rangesToUpdate = Range2.intersect(previousRenderRange, renderRange); + for (let i2 = rangesToUpdate.start; i2 < rangesToUpdate.end; i2++) { + this.updateItemInDOM(this.items[i2], i2); + } + } + this.cache.transact(() => { + for (const range2 of rangesToRemove) { + for (let i2 = range2.start; i2 < range2.end; i2++) { + this.removeItemFromDOM(i2, onScroll); + } + } + for (const range2 of rangesToInsert) { + for (let i2 = range2.end - 1; i2 >= range2.start; i2--) { + this.insertItemInDOM(i2); + } + } + }); + if (renderLeft !== void 0) { + this.rowsContainer.style.left = `-${renderLeft}px`; + } + this.rowsContainer.style.top = `-${renderTop}px`; + if (this.horizontalScrolling && scrollWidth !== void 0) { + this.rowsContainer.style.width = `${Math.max(scrollWidth, this.renderWidth)}px`; + } + this.lastRenderTop = renderTop; + this.lastRenderHeight = renderHeight; + } + // DOM operations + insertItemInDOM(index, row) { + const item = this.items[index]; + if (!item.row) { + if (row) { + item.row = row; + item.stale = true; + } else { + const result = this.cache.alloc(item.templateId); + item.row = result.row; + item.stale ||= result.isReusingConnectedDomNode; + } + } + const role = this.accessibilityProvider.getRole(item.element) || "listitem"; + item.row.domNode.setAttribute("role", role); + const checked = this.accessibilityProvider.isChecked(item.element); + const toAriaState = (value) => value === "mixed" ? "mixed" : String(!!value); + if (typeof checked === "boolean" || checked === "mixed") { + item.row.domNode.setAttribute("aria-checked", toAriaState(checked)); + } else if (checked) { + const update = (value) => item.row.domNode.setAttribute("aria-checked", toAriaState(value)); + update(checked.value); + item.checkedDisposable = checked.onDidChange(() => update(checked.value)); + } + if (item.stale || !item.row.domNode.parentElement) { + const referenceNode = this.items.at(index + 1)?.row?.domNode ?? null; + if (item.row.domNode.parentElement !== this.rowsContainer || item.row.domNode.nextElementSibling !== referenceNode) { + this.rowsContainer.insertBefore(item.row.domNode, referenceNode); + } + item.stale = false; + } + this.updateItemInDOM(item, index); + const renderer = this.renderers.get(item.templateId); + if (!renderer) { + throw new Error(`No renderer found for template id ${item.templateId}`); + } + renderer?.renderElement(item.element, index, item.row.templateData, { height: item.size }); + const uri = this.dnd.getDragURI(item.element); + item.dragStartDisposable.dispose(); + item.row.domNode.draggable = !!uri; + if (uri) { + item.dragStartDisposable = addDisposableListener(item.row.domNode, "dragstart", (event) => this.onDragStart(item.element, uri, event)); + } + if (this.horizontalScrolling) { + this.measureItemWidth(item); + this.eventuallyUpdateScrollWidth(); + } + } + measureItemWidth(item) { + if (!item.row || !item.row.domNode) { + return; + } + item.row.domNode.style.width = "fit-content"; + item.width = getContentWidth(item.row.domNode); + const style = getWindow(item.row.domNode).getComputedStyle(item.row.domNode); + if (style.paddingLeft) { + item.width += parseFloat(style.paddingLeft); + } + if (style.paddingRight) { + item.width += parseFloat(style.paddingRight); + } + item.row.domNode.style.width = ""; + } + updateItemInDOM(item, index) { + item.row.domNode.style.top = `${this.elementTop(index)}px`; + if (this.setRowHeight) { + item.row.domNode.style.height = `${item.size}px`; + } + if (this.setRowLineHeight) { + item.row.domNode.style.lineHeight = `${item.size}px`; + } + item.row.domNode.setAttribute("data-index", `${index}`); + item.row.domNode.setAttribute("data-last-element", index === this.length - 1 ? "true" : "false"); + item.row.domNode.setAttribute("data-parity", index % 2 === 0 ? "even" : "odd"); + item.row.domNode.setAttribute("aria-setsize", String(this.accessibilityProvider.getSetSize(item.element, index, this.length))); + item.row.domNode.setAttribute("aria-posinset", String(this.accessibilityProvider.getPosInSet(item.element, index))); + item.row.domNode.setAttribute("id", this.getElementDomId(index)); + item.row.domNode.classList.toggle("drop-target", item.dropTarget); + } + removeItemFromDOM(index, onScroll) { + const item = this.items[index]; + item.dragStartDisposable.dispose(); + item.checkedDisposable.dispose(); + if (item.row) { + const renderer = this.renderers.get(item.templateId); + if (renderer && renderer.disposeElement) { + renderer.disposeElement(item.element, index, item.row.templateData, { height: item.size, onScroll }); + } + this.cache.release(item.row); + item.row = null; + } + if (this.horizontalScrolling) { + this.eventuallyUpdateScrollWidth(); + } + } + getScrollTop() { + const scrollPosition = this.scrollableElement.getScrollPosition(); + return scrollPosition.scrollTop; + } + setScrollTop(scrollTop, reuseAnimation) { + if (this.scrollableElementUpdateDisposable) { + this.scrollableElementUpdateDisposable.dispose(); + this.scrollableElementUpdateDisposable = null; + this.scrollableElement.setScrollDimensions({ scrollHeight: this.scrollHeight }); + } + this.scrollableElement.setScrollPosition({ scrollTop, reuseAnimation }); + } + get scrollTop() { + return this.getScrollTop(); + } + set scrollTop(scrollTop) { + this.setScrollTop(scrollTop); + } + get scrollHeight() { + return this._scrollHeight + (this.horizontalScrolling ? 10 : 0) + this.paddingBottom; + } + // Events + get onMouseClick() { + return Event.map(this.disposables.add(new DomEmitter(this.domNode, "click")).event, (e) => this.toMouseEvent(e), this.disposables); + } + get onMouseDblClick() { + return Event.map(this.disposables.add(new DomEmitter(this.domNode, "dblclick")).event, (e) => this.toMouseEvent(e), this.disposables); + } + get onMouseMiddleClick() { + return Event.filter(Event.map(this.disposables.add(new DomEmitter(this.domNode, "auxclick")).event, (e) => this.toMouseEvent(e), this.disposables), (e) => e.browserEvent.button === 1, this.disposables); + } + get onMouseDown() { + return Event.map(this.disposables.add(new DomEmitter(this.domNode, "mousedown")).event, (e) => this.toMouseEvent(e), this.disposables); + } + get onMouseOver() { + return Event.map(this.disposables.add(new DomEmitter(this.domNode, "mouseover")).event, (e) => this.toMouseEvent(e), this.disposables); + } + get onMouseOut() { + return Event.map(this.disposables.add(new DomEmitter(this.domNode, "mouseout")).event, (e) => this.toMouseEvent(e), this.disposables); + } + get onContextMenu() { + return Event.any(Event.map(this.disposables.add(new DomEmitter(this.domNode, "contextmenu")).event, (e) => this.toMouseEvent(e), this.disposables), Event.map(this.disposables.add(new DomEmitter(this.domNode, EventType2.Contextmenu)).event, (e) => this.toGestureEvent(e), this.disposables)); + } + get onTouchStart() { + return Event.map(this.disposables.add(new DomEmitter(this.domNode, "touchstart")).event, (e) => this.toTouchEvent(e), this.disposables); + } + get onTap() { + return Event.map(this.disposables.add(new DomEmitter(this.rowsContainer, EventType2.Tap)).event, (e) => this.toGestureEvent(e), this.disposables); + } + toMouseEvent(browserEvent) { + const index = this.getItemIndexFromEventTarget(browserEvent.target || null); + const item = typeof index === "undefined" ? void 0 : this.items[index]; + const element = item && item.element; + return { browserEvent, index, element }; + } + toTouchEvent(browserEvent) { + const index = this.getItemIndexFromEventTarget(browserEvent.target || null); + const item = typeof index === "undefined" ? void 0 : this.items[index]; + const element = item && item.element; + return { browserEvent, index, element }; + } + toGestureEvent(browserEvent) { + const index = this.getItemIndexFromEventTarget(browserEvent.initialTarget || null); + const item = typeof index === "undefined" ? void 0 : this.items[index]; + const element = item && item.element; + return { browserEvent, index, element }; + } + toDragEvent(browserEvent) { + const index = this.getItemIndexFromEventTarget(browserEvent.target || null); + const item = typeof index === "undefined" ? void 0 : this.items[index]; + const element = item && item.element; + const sector = this.getTargetSector(browserEvent, index); + return { browserEvent, index, element, sector }; + } + onScroll(e) { + try { + const previousRenderRange = this.getRenderRange(this.lastRenderTop, this.lastRenderHeight); + this.render(previousRenderRange, e.scrollTop, e.height, e.scrollLeft, e.scrollWidth, void 0, true); + if (this.supportDynamicHeights) { + this._rerender(e.scrollTop, e.height, e.inSmoothScrolling); + } + } catch (err) { + console.error("Got bad scroll event:", e); + throw err; + } + } + onTouchChange(event) { + event.preventDefault(); + event.stopPropagation(); + this.scrollTop -= event.translationY; + } + // DND + onDragStart(element, uri, event) { + if (!event.dataTransfer) { + return; + } + const elements = this.dnd.getDragElements(element); + event.dataTransfer.effectAllowed = "copyMove"; + event.dataTransfer.setData(DataTransfers.TEXT, uri); + let label; + if (this.dnd.getDragLabel) { + label = this.dnd.getDragLabel(elements, event); + } + if (typeof label === "undefined") { + label = String(elements.length); + } + applyDragImage(event, this.domNode, label, [ + this.domId + /* add domId to get list specific styling */ + ]); + this.domNode.classList.add("dragging"); + this.currentDragData = new ElementsDragAndDropData(elements); + StaticDND.CurrentDragAndDropData = new ExternalElementsDragAndDropData(elements); + this.dnd.onDragStart?.(this.currentDragData, event); + } + onPotentialSelectionStart(e) { + this.currentSelectionDisposable.dispose(); + const doc = getDocument(this.domNode); + const selectionStore = this.currentSelectionDisposable = new DisposableStore(); + const movementStore = selectionStore.add(new DisposableStore()); + movementStore.add(addDisposableListener(this.domNode, "selectstart", () => { + movementStore.add(addDisposableListener(doc, "mousemove", (e2) => { + if (doc.getSelection()?.isCollapsed === false) { + this.setupDragAndDropScrollTopAnimation(e2); + } + })); + selectionStore.add(toDisposable(() => { + const previousRenderRange = this.getRenderRange(this.lastRenderTop, this.lastRenderHeight); + this.currentSelectionBounds = void 0; + this.render(previousRenderRange, this.lastRenderTop, this.lastRenderHeight, void 0, void 0); + })); + selectionStore.add(addDisposableListener(doc, "selectionchange", () => { + const selection = doc.getSelection(); + if (!selection || selection.isCollapsed) { + if (movementStore.isDisposed) { + selectionStore.dispose(); + } + return; + } + let start = this.getIndexOfListElement(selection.anchorNode); + let end = this.getIndexOfListElement(selection.focusNode); + if (start !== void 0 && end !== void 0) { + if (end < start) { + [start, end] = [end, start]; + } + this.currentSelectionBounds = { start, end }; + } + })); + })); + movementStore.add(addDisposableListener(doc, "mouseup", () => { + movementStore.dispose(); + this.teardownDragAndDropScrollTopAnimation(); + if (doc.getSelection()?.isCollapsed !== false) { + selectionStore.dispose(); + } + })); + } + getIndexOfListElement(element) { + if (!element || !this.domNode.contains(element)) { + return void 0; + } + while (element && element !== this.domNode) { + if (element.dataset?.index) { + return Number(element.dataset.index); + } + element = element.parentElement; + } + return void 0; + } + onDragOver(event) { + event.browserEvent.preventDefault(); + this.onDragLeaveTimeout.dispose(); + if (StaticDND.CurrentDragAndDropData && StaticDND.CurrentDragAndDropData.getData() === "vscode-ui") { + return false; + } + this.setupDragAndDropScrollTopAnimation(event.browserEvent); + if (!event.browserEvent.dataTransfer) { + return false; + } + if (!this.currentDragData) { + if (StaticDND.CurrentDragAndDropData) { + this.currentDragData = StaticDND.CurrentDragAndDropData; + } else { + if (!event.browserEvent.dataTransfer.types) { + return false; + } + this.currentDragData = new NativeDragAndDropData(); + } + } + const result = this.dnd.onDragOver(this.currentDragData, event.element, event.index, event.sector, event.browserEvent); + this.canDrop = typeof result === "boolean" ? result : result.accept; + if (!this.canDrop) { + this.currentDragFeedback = void 0; + this.currentDragFeedbackDisposable.dispose(); + return false; + } + event.browserEvent.dataTransfer.dropEffect = typeof result !== "boolean" && result.effect?.type === 0 ? "copy" : "move"; + let feedback; + if (typeof result !== "boolean" && result.feedback) { + feedback = result.feedback; + } else { + if (typeof event.index === "undefined") { + feedback = [-1]; + } else { + feedback = [event.index]; + } + } + feedback = distinct(feedback).filter((i2) => i2 >= -1 && i2 < this.length).sort((a, b) => a - b); + feedback = feedback[0] === -1 ? [-1] : feedback; + let dragOverEffectPosition = typeof result !== "boolean" && result.effect && result.effect.position ? result.effect.position : "drop-target"; + if (equalsDragFeedback(this.currentDragFeedback, feedback) && this.currentDragFeedbackPosition === dragOverEffectPosition) { + return true; + } + this.currentDragFeedback = feedback; + this.currentDragFeedbackPosition = dragOverEffectPosition; + this.currentDragFeedbackDisposable.dispose(); + if (feedback[0] === -1) { + this.domNode.classList.add(dragOverEffectPosition); + this.rowsContainer.classList.add(dragOverEffectPosition); + this.currentDragFeedbackDisposable = toDisposable(() => { + this.domNode.classList.remove(dragOverEffectPosition); + this.rowsContainer.classList.remove(dragOverEffectPosition); + }); + } else { + if (feedback.length > 1 && dragOverEffectPosition !== "drop-target") { + throw new Error("Can't use multiple feedbacks with position different than 'over'"); + } + if (dragOverEffectPosition === "drop-target-after") { + if (feedback[0] < this.length - 1) { + feedback[0] += 1; + dragOverEffectPosition = "drop-target-before"; + } + } + for (const index of feedback) { + const item = this.items[index]; + item.dropTarget = true; + item.row?.domNode.classList.add(dragOverEffectPosition); + } + this.currentDragFeedbackDisposable = toDisposable(() => { + for (const index of feedback) { + const item = this.items[index]; + item.dropTarget = false; + item.row?.domNode.classList.remove(dragOverEffectPosition); + } + }); + } + return true; + } + onDragLeave(event) { + this.onDragLeaveTimeout.dispose(); + this.onDragLeaveTimeout = disposableTimeout(() => this.clearDragOverFeedback(), 100, this.disposables); + if (this.currentDragData) { + this.dnd.onDragLeave?.(this.currentDragData, event.element, event.index, event.browserEvent); + } + } + onDrop(event) { + if (!this.canDrop) { + return; + } + const dragData = this.currentDragData; + this.teardownDragAndDropScrollTopAnimation(); + this.clearDragOverFeedback(); + this.domNode.classList.remove("dragging"); + this.currentDragData = void 0; + StaticDND.CurrentDragAndDropData = void 0; + if (!dragData || !event.browserEvent.dataTransfer) { + return; + } + event.browserEvent.preventDefault(); + dragData.update(event.browserEvent.dataTransfer); + this.dnd.drop(dragData, event.element, event.index, event.sector, event.browserEvent); + } + onDragEnd(event) { + this.canDrop = false; + this.teardownDragAndDropScrollTopAnimation(); + this.clearDragOverFeedback(); + this.domNode.classList.remove("dragging"); + this.currentDragData = void 0; + StaticDND.CurrentDragAndDropData = void 0; + this.dnd.onDragEnd?.(event); + } + clearDragOverFeedback() { + this.currentDragFeedback = void 0; + this.currentDragFeedbackPosition = void 0; + this.currentDragFeedbackDisposable.dispose(); + this.currentDragFeedbackDisposable = Disposable.None; + } + // DND scroll top animation + setupDragAndDropScrollTopAnimation(event) { + if (!this.dragOverAnimationDisposable) { + const viewTop = getTopLeftOffset(this.domNode).top; + this.dragOverAnimationDisposable = animate(getWindow(this.domNode), this.animateDragAndDropScrollTop.bind(this, viewTop)); + } + this.dragOverAnimationStopDisposable.dispose(); + this.dragOverAnimationStopDisposable = disposableTimeout(() => { + if (this.dragOverAnimationDisposable) { + this.dragOverAnimationDisposable.dispose(); + this.dragOverAnimationDisposable = void 0; + } + }, 1e3, this.disposables); + this.dragOverMouseY = event.pageY; + } + animateDragAndDropScrollTop(viewTop) { + if (this.dragOverMouseY === void 0) { + return; + } + const diff = this.dragOverMouseY - viewTop; + const upperLimit = this.renderHeight - 35; + if (diff < 35) { + this.scrollTop += Math.max(-14, Math.floor(0.3 * (diff - 35))); + } else if (diff > upperLimit) { + this.scrollTop += Math.min(14, Math.floor(0.3 * (diff - upperLimit))); + } + } + teardownDragAndDropScrollTopAnimation() { + this.dragOverAnimationStopDisposable.dispose(); + if (this.dragOverAnimationDisposable) { + this.dragOverAnimationDisposable.dispose(); + this.dragOverAnimationDisposable = void 0; + } + } + // Util + getTargetSector(browserEvent, targetIndex) { + if (targetIndex === void 0) { + return void 0; + } + const relativePosition = browserEvent.offsetY / this.items[targetIndex].size; + const sector = Math.floor(relativePosition / 0.25); + return clamp(sector, 0, 3); + } + getItemIndexFromEventTarget(target) { + const scrollableElement = this.scrollableElement.getDomNode(); + let element = target; + while ((isHTMLElement(element) || isSVGElement(element)) && element !== this.rowsContainer && scrollableElement.contains(element)) { + const rawIndex = element.getAttribute("data-index"); + if (rawIndex) { + const index = Number(rawIndex); + if (!isNaN(index)) { + return index; + } + } + element = element.parentElement; + } + return void 0; + } + getVisibleRange(renderTop, renderHeight) { + return { + start: this.rangeMap.indexAt(renderTop), + end: this.rangeMap.indexAfter(renderTop + renderHeight - 1) + }; + } + getRenderRange(renderTop, renderHeight) { + const range2 = this.getVisibleRange(renderTop, renderHeight); + if (this.currentSelectionBounds) { + const max = this.rangeMap.count; + range2.start = Math.min(range2.start, this.currentSelectionBounds.start, max); + range2.end = Math.min(Math.max(range2.end, this.currentSelectionBounds.end + 1), max); + } + return range2; + } + /** + * Given a stable rendered state, checks every rendered element whether it needs + * to be probed for dynamic height. Adjusts scroll height and top if necessary. + */ + _rerender(renderTop, renderHeight, inSmoothScrolling) { + const previousRenderRange = this.getRenderRange(renderTop, renderHeight); + let anchorElementIndex; + let anchorElementTopDelta; + if (renderTop === this.elementTop(previousRenderRange.start)) { + anchorElementIndex = previousRenderRange.start; + anchorElementTopDelta = 0; + } else if (previousRenderRange.end - previousRenderRange.start > 1) { + anchorElementIndex = previousRenderRange.start + 1; + anchorElementTopDelta = this.elementTop(anchorElementIndex) - renderTop; + } + let heightDiff2 = 0; + while (true) { + const renderRange = this.getRenderRange(renderTop, renderHeight); + let didChange = false; + for (let i2 = renderRange.start; i2 < renderRange.end; i2++) { + const diff = this.probeDynamicHeight(i2); + if (diff !== 0) { + this.rangeMap.splice(i2, 1, [this.items[i2]]); + } + heightDiff2 += diff; + didChange = didChange || diff !== 0; + } + if (!didChange) { + if (heightDiff2 !== 0) { + this.eventuallyUpdateScrollDimensions(); + } + const unrenderRanges = Range2.relativeComplement(previousRenderRange, renderRange); + for (const range2 of unrenderRanges) { + for (let i2 = range2.start; i2 < range2.end; i2++) { + if (this.items[i2].row) { + this.removeItemFromDOM(i2); + } + } + } + const renderRanges = Range2.relativeComplement(renderRange, previousRenderRange).reverse(); + for (const range2 of renderRanges) { + for (let i2 = range2.end - 1; i2 >= range2.start; i2--) { + this.insertItemInDOM(i2); + } + } + for (let i2 = renderRange.start; i2 < renderRange.end; i2++) { + if (this.items[i2].row) { + this.updateItemInDOM(this.items[i2], i2); + } + } + if (typeof anchorElementIndex === "number") { + const deltaScrollTop = this.scrollable.getFutureScrollPosition().scrollTop - renderTop; + const newScrollTop = this.elementTop(anchorElementIndex) - anchorElementTopDelta + deltaScrollTop; + this.setScrollTop(newScrollTop, inSmoothScrolling); + } + this._onDidChangeContentHeight.fire(this.contentHeight); + return; + } + } + } + probeDynamicHeight(index) { + const item = this.items[index]; + if (!!this.virtualDelegate.getDynamicHeight) { + const newSize = this.virtualDelegate.getDynamicHeight(item.element); + if (newSize !== null) { + const size3 = item.size; + item.size = newSize; + item.lastDynamicHeightWidth = this.renderWidth; + return newSize - size3; + } + } + if (!item.hasDynamicHeight || item.lastDynamicHeightWidth === this.renderWidth) { + return 0; + } + if (!!this.virtualDelegate.hasDynamicHeight && !this.virtualDelegate.hasDynamicHeight(item.element)) { + return 0; + } + const size2 = item.size; + if (item.row) { + item.row.domNode.style.height = ""; + item.size = item.row.domNode.offsetHeight; + if (item.size === 0 && !isAncestor(item.row.domNode, getWindow(item.row.domNode).document.body)) { + console.warn("Measuring item node that is not in DOM! Add ListView to the DOM before measuring row height!", new Error().stack); + } + item.lastDynamicHeightWidth = this.renderWidth; + return item.size - size2; + } + const { row } = this.cache.alloc(item.templateId); + row.domNode.style.height = ""; + this.rowsContainer.appendChild(row.domNode); + const renderer = this.renderers.get(item.templateId); + if (!renderer) { + throw new BugIndicatingError("Missing renderer for templateId: " + item.templateId); + } + renderer.renderElement(item.element, index, row.templateData); + item.size = row.domNode.offsetHeight; + renderer.disposeElement?.(item.element, index, row.templateData); + this.virtualDelegate.setDynamicHeight?.(item.element, item.size); + item.lastDynamicHeightWidth = this.renderWidth; + row.domNode.remove(); + this.cache.release(row); + return item.size - size2; + } + getElementDomId(index) { + return `${this.domId}_${index}`; + } + // Dispose + dispose() { + for (const item of this.items) { + item.dragStartDisposable.dispose(); + item.checkedDisposable.dispose(); + if (item.row) { + const renderer = this.renderers.get(item.row.templateId); + if (renderer) { + renderer.disposeElement?.(item.element, -1, item.row.templateData, void 0); + renderer.disposeTemplate(item.row.templateData); + } + } + } + this.items = []; + this.domNode?.remove(); + this.dragOverAnimationDisposable?.dispose(); + this.disposables.dispose(); + } +}; +__decorate27([ + memoize +], ListView.prototype, "onMouseClick", null); +__decorate27([ + memoize +], ListView.prototype, "onMouseDblClick", null); +__decorate27([ + memoize +], ListView.prototype, "onMouseMiddleClick", null); +__decorate27([ + memoize +], ListView.prototype, "onMouseDown", null); +__decorate27([ + memoize +], ListView.prototype, "onMouseOver", null); +__decorate27([ + memoize +], ListView.prototype, "onMouseOut", null); +__decorate27([ + memoize +], ListView.prototype, "onContextMenu", null); +__decorate27([ + memoize +], ListView.prototype, "onTouchStart", null); +__decorate27([ + memoize +], ListView.prototype, "onTap", null); + +// node_modules/monaco-editor-core/esm/vs/base/browser/ui/list/listWidget.js +init_mouseEvent(); +init_observable(); +var __decorate28 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var TraitRenderer = class { + constructor(trait) { + this.trait = trait; + this.renderedElements = []; + } + get templateId() { + return `template:${this.trait.name}`; + } + renderTemplate(container) { + return container; + } + renderElement(element, index, templateData) { + const renderedElementIndex = this.renderedElements.findIndex((el) => el.templateData === templateData); + if (renderedElementIndex >= 0) { + const rendered = this.renderedElements[renderedElementIndex]; + this.trait.unrender(templateData); + rendered.index = index; + } else { + const rendered = { index, templateData }; + this.renderedElements.push(rendered); + } + this.trait.renderIndex(index, templateData); + } + splice(start, deleteCount, insertCount) { + const rendered = []; + for (const renderedElement of this.renderedElements) { + if (renderedElement.index < start) { + rendered.push(renderedElement); + } else if (renderedElement.index >= start + deleteCount) { + rendered.push({ + index: renderedElement.index + insertCount - deleteCount, + templateData: renderedElement.templateData + }); + } + } + this.renderedElements = rendered; + } + renderIndexes(indexes) { + for (const { index, templateData } of this.renderedElements) { + if (indexes.indexOf(index) > -1) { + this.trait.renderIndex(index, templateData); + } + } + } + disposeTemplate(templateData) { + const index = this.renderedElements.findIndex((el) => el.templateData === templateData); + if (index < 0) { + return; + } + this.renderedElements.splice(index, 1); + } +}; +var Trait = class { + get onChange() { + return this._onChange.event; + } + get name() { + return this._trait; + } + get renderer() { + return new TraitRenderer(this); + } + constructor(_trait) { + this._trait = _trait; + this.indexes = []; + this.sortedIndexes = []; + this._onChange = new Emitter(); + } + splice(start, deleteCount, elements) { + const diff = elements.length - deleteCount; + const end = start + deleteCount; + const sortedIndexes = []; + let i2 = 0; + while (i2 < this.sortedIndexes.length && this.sortedIndexes[i2] < start) { + sortedIndexes.push(this.sortedIndexes[i2++]); + } + for (let j = 0; j < elements.length; j++) { + if (elements[j]) { + sortedIndexes.push(j + start); + } + } + while (i2 < this.sortedIndexes.length && this.sortedIndexes[i2] >= end) { + sortedIndexes.push(this.sortedIndexes[i2++] + diff); + } + this.renderer.splice(start, deleteCount, elements.length); + this._set(sortedIndexes, sortedIndexes); + } + renderIndex(index, container) { + container.classList.toggle(this._trait, this.contains(index)); + } + unrender(container) { + container.classList.remove(this._trait); + } + /** + * Sets the indexes which should have this trait. + * + * @param indexes Indexes which should have this trait. + * @return The old indexes which had this trait. + */ + set(indexes, browserEvent) { + return this._set(indexes, [...indexes].sort(numericSort), browserEvent); + } + _set(indexes, sortedIndexes, browserEvent) { + const result = this.indexes; + const sortedResult = this.sortedIndexes; + this.indexes = indexes; + this.sortedIndexes = sortedIndexes; + const toRender = disjunction(sortedResult, indexes); + this.renderer.renderIndexes(toRender); + this._onChange.fire({ indexes, browserEvent }); + return result; + } + get() { + return this.indexes; + } + contains(index) { + return binarySearch(this.sortedIndexes, index, numericSort) >= 0; + } + dispose() { + dispose(this._onChange); + } +}; +__decorate28([ + memoize +], Trait.prototype, "renderer", null); +var SelectionTrait = class extends Trait { + constructor(setAriaSelected) { + super("selected"); + this.setAriaSelected = setAriaSelected; + } + renderIndex(index, container) { + super.renderIndex(index, container); + if (this.setAriaSelected) { + if (this.contains(index)) { + container.setAttribute("aria-selected", "true"); + } else { + container.setAttribute("aria-selected", "false"); + } + } + } +}; +var TraitSpliceable = class { + constructor(trait, view, identityProvider) { + this.trait = trait; + this.view = view; + this.identityProvider = identityProvider; + } + splice(start, deleteCount, elements) { + if (!this.identityProvider) { + return this.trait.splice(start, deleteCount, new Array(elements.length).fill(false)); + } + const pastElementsWithTrait = this.trait.get().map((i2) => this.identityProvider.getId(this.view.element(i2)).toString()); + if (pastElementsWithTrait.length === 0) { + return this.trait.splice(start, deleteCount, new Array(elements.length).fill(false)); + } + const pastElementsWithTraitSet = new Set(pastElementsWithTrait); + const elementsWithTrait = elements.map((e) => pastElementsWithTraitSet.has(this.identityProvider.getId(e).toString())); + this.trait.splice(start, deleteCount, elementsWithTrait); + } +}; +function isListElementDescendantOfClass(e, className2) { + if (e.classList.contains(className2)) { + return true; + } + if (e.classList.contains("monaco-list")) { + return false; + } + if (!e.parentElement) { + return false; + } + return isListElementDescendantOfClass(e.parentElement, className2); +} +function isMonacoEditor(e) { + return isListElementDescendantOfClass(e, "monaco-editor"); +} +function isMonacoCustomToggle(e) { + return isListElementDescendantOfClass(e, "monaco-custom-toggle"); +} +function isActionItem(e) { + return isListElementDescendantOfClass(e, "action-item"); +} +function isStickyScrollElement(e) { + return isListElementDescendantOfClass(e, "monaco-tree-sticky-row"); +} +function isStickyScrollContainer(e) { + return e.classList.contains("monaco-tree-sticky-container"); +} +function isButton(e) { + if (e.tagName === "A" && e.classList.contains("monaco-button") || e.tagName === "DIV" && e.classList.contains("monaco-button-dropdown")) { + return true; + } + if (e.classList.contains("monaco-list")) { + return false; + } + if (!e.parentElement) { + return false; + } + return isButton(e.parentElement); +} +var KeyboardController = class { + get onKeyDown() { + return Event.chain(this.disposables.add(new DomEmitter(this.view.domNode, "keydown")).event, ($23) => $23.filter((e) => !isEditableElement(e.target)).map((e) => new StandardKeyboardEvent(e))); + } + constructor(list2, view, options2) { + this.list = list2; + this.view = view; + this.disposables = new DisposableStore(); + this.multipleSelectionDisposables = new DisposableStore(); + this.multipleSelectionSupport = options2.multipleSelectionSupport; + this.disposables.add(this.onKeyDown((e) => { + switch (e.keyCode) { + case 3: + return this.onEnter(e); + case 16: + return this.onUpArrow(e); + case 18: + return this.onDownArrow(e); + case 11: + return this.onPageUpArrow(e); + case 12: + return this.onPageDownArrow(e); + case 9: + return this.onEscape(e); + case 31: + if (this.multipleSelectionSupport && (isMacintosh ? e.metaKey : e.ctrlKey)) { + this.onCtrlA(e); + } + } + })); + } + updateOptions(optionsUpdate) { + if (optionsUpdate.multipleSelectionSupport !== void 0) { + this.multipleSelectionSupport = optionsUpdate.multipleSelectionSupport; + } + } + onEnter(e) { + e.preventDefault(); + e.stopPropagation(); + this.list.setSelection(this.list.getFocus(), e.browserEvent); + } + onUpArrow(e) { + e.preventDefault(); + e.stopPropagation(); + this.list.focusPrevious(1, false, e.browserEvent); + const el = this.list.getFocus()[0]; + this.list.setAnchor(el); + this.list.reveal(el); + this.view.domNode.focus(); + } + onDownArrow(e) { + e.preventDefault(); + e.stopPropagation(); + this.list.focusNext(1, false, e.browserEvent); + const el = this.list.getFocus()[0]; + this.list.setAnchor(el); + this.list.reveal(el); + this.view.domNode.focus(); + } + onPageUpArrow(e) { + e.preventDefault(); + e.stopPropagation(); + this.list.focusPreviousPage(e.browserEvent); + const el = this.list.getFocus()[0]; + this.list.setAnchor(el); + this.list.reveal(el); + this.view.domNode.focus(); + } + onPageDownArrow(e) { + e.preventDefault(); + e.stopPropagation(); + this.list.focusNextPage(e.browserEvent); + const el = this.list.getFocus()[0]; + this.list.setAnchor(el); + this.list.reveal(el); + this.view.domNode.focus(); + } + onCtrlA(e) { + e.preventDefault(); + e.stopPropagation(); + this.list.setSelection(range(this.list.length), e.browserEvent); + this.list.setAnchor(void 0); + this.view.domNode.focus(); + } + onEscape(e) { + if (this.list.getSelection().length) { + e.preventDefault(); + e.stopPropagation(); + this.list.setSelection([], e.browserEvent); + this.list.setAnchor(void 0); + this.view.domNode.focus(); + } + } + dispose() { + this.disposables.dispose(); + this.multipleSelectionDisposables.dispose(); + } +}; +__decorate28([ + memoize +], KeyboardController.prototype, "onKeyDown", null); +var TypeNavigationMode; +(function(TypeNavigationMode2) { + TypeNavigationMode2[TypeNavigationMode2["Automatic"] = 0] = "Automatic"; + TypeNavigationMode2[TypeNavigationMode2["Trigger"] = 1] = "Trigger"; +})(TypeNavigationMode || (TypeNavigationMode = {})); +var TypeNavigationControllerState; +(function(TypeNavigationControllerState2) { + TypeNavigationControllerState2[TypeNavigationControllerState2["Idle"] = 0] = "Idle"; + TypeNavigationControllerState2[TypeNavigationControllerState2["Typing"] = 1] = "Typing"; +})(TypeNavigationControllerState || (TypeNavigationControllerState = {})); +var DefaultKeyboardNavigationDelegate = new class { + mightProducePrintableCharacter(event) { + if (event.ctrlKey || event.metaKey || event.altKey) { + return false; + } + return event.keyCode >= 31 && event.keyCode <= 56 || event.keyCode >= 21 && event.keyCode <= 30 || event.keyCode >= 98 && event.keyCode <= 107 || event.keyCode >= 85 && event.keyCode <= 95; + } +}(); +var TypeNavigationController = class { + constructor(list2, view, keyboardNavigationLabelProvider, keyboardNavigationEventFilter, delegate) { + this.list = list2; + this.view = view; + this.keyboardNavigationLabelProvider = keyboardNavigationLabelProvider; + this.keyboardNavigationEventFilter = keyboardNavigationEventFilter; + this.delegate = delegate; + this.enabled = false; + this.state = TypeNavigationControllerState.Idle; + this.mode = TypeNavigationMode.Automatic; + this.triggered = false; + this.previouslyFocused = -1; + this.enabledDisposables = new DisposableStore(); + this.disposables = new DisposableStore(); + this.updateOptions(list2.options); + } + updateOptions(options2) { + if (options2.typeNavigationEnabled ?? true) { + this.enable(); + } else { + this.disable(); + } + this.mode = options2.typeNavigationMode ?? TypeNavigationMode.Automatic; + } + enable() { + if (this.enabled) { + return; + } + let typing = false; + const onChar = Event.chain(this.enabledDisposables.add(new DomEmitter(this.view.domNode, "keydown")).event, ($23) => $23.filter((e) => !isEditableElement(e.target)).filter(() => this.mode === TypeNavigationMode.Automatic || this.triggered).map((event) => new StandardKeyboardEvent(event)).filter((e) => typing || this.keyboardNavigationEventFilter(e)).filter((e) => this.delegate.mightProducePrintableCharacter(e)).forEach((e) => EventHelper.stop(e, true)).map((event) => event.browserEvent.key)); + const onClear = Event.debounce(onChar, () => null, 800, void 0, void 0, void 0, this.enabledDisposables); + const onInput = Event.reduce(Event.any(onChar, onClear), (r, i2) => i2 === null ? null : (r || "") + i2, void 0, this.enabledDisposables); + onInput(this.onInput, this, this.enabledDisposables); + onClear(this.onClear, this, this.enabledDisposables); + onChar(() => typing = true, void 0, this.enabledDisposables); + onClear(() => typing = false, void 0, this.enabledDisposables); + this.enabled = true; + this.triggered = false; + } + disable() { + if (!this.enabled) { + return; + } + this.enabledDisposables.clear(); + this.enabled = false; + this.triggered = false; + } + onClear() { + const focus = this.list.getFocus(); + if (focus.length > 0 && focus[0] === this.previouslyFocused) { + const ariaLabel = this.list.options.accessibilityProvider?.getAriaLabel(this.list.element(focus[0])); + if (typeof ariaLabel === "string") { + alert(ariaLabel); + } else if (ariaLabel) { + alert(ariaLabel.get()); + } + } + this.previouslyFocused = -1; + } + onInput(word) { + if (!word) { + this.state = TypeNavigationControllerState.Idle; + this.triggered = false; + return; + } + const focus = this.list.getFocus(); + const start = focus.length > 0 ? focus[0] : 0; + const delta = this.state === TypeNavigationControllerState.Idle ? 1 : 0; + this.state = TypeNavigationControllerState.Typing; + for (let i2 = 0; i2 < this.list.length; i2++) { + const index = (start + i2 + delta) % this.list.length; + const label = this.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(this.view.element(index)); + const labelStr = label && label.toString(); + if (this.list.options.typeNavigationEnabled) { + if (typeof labelStr !== "undefined") { + if (matchesPrefix(word, labelStr)) { + this.previouslyFocused = start; + this.list.setFocus([index]); + this.list.reveal(index); + return; + } + const fuzzy = matchesFuzzy2(word, labelStr); + if (fuzzy) { + const fuzzyScore2 = fuzzy[0].end - fuzzy[0].start; + if (fuzzyScore2 > 1 && fuzzy.length === 1) { + this.previouslyFocused = start; + this.list.setFocus([index]); + this.list.reveal(index); + return; + } + } + } + } else if (typeof labelStr === "undefined" || matchesPrefix(word, labelStr)) { + this.previouslyFocused = start; + this.list.setFocus([index]); + this.list.reveal(index); + return; + } + } + } + dispose() { + this.disable(); + this.enabledDisposables.dispose(); + this.disposables.dispose(); + } +}; +var DOMFocusController = class { + constructor(list2, view) { + this.list = list2; + this.view = view; + this.disposables = new DisposableStore(); + const onKeyDown = Event.chain(this.disposables.add(new DomEmitter(view.domNode, "keydown")).event, ($23) => $23.filter((e) => !isEditableElement(e.target)).map((e) => new StandardKeyboardEvent(e))); + const onTab = Event.chain(onKeyDown, ($23) => $23.filter((e) => e.keyCode === 2 && !e.ctrlKey && !e.metaKey && !e.shiftKey && !e.altKey)); + onTab(this.onTab, this, this.disposables); + } + onTab(e) { + if (e.target !== this.view.domNode) { + return; + } + const focus = this.list.getFocus(); + if (focus.length === 0) { + return; + } + const focusedDomElement = this.view.domElement(focus[0]); + if (!focusedDomElement) { + return; + } + const tabIndexElement = focusedDomElement.querySelector("[tabIndex]"); + if (!tabIndexElement || !isHTMLElement(tabIndexElement) || tabIndexElement.tabIndex === -1) { + return; + } + const style = getWindow(tabIndexElement).getComputedStyle(tabIndexElement); + if (style.visibility === "hidden" || style.display === "none") { + return; + } + e.preventDefault(); + e.stopPropagation(); + tabIndexElement.focus(); + } + dispose() { + this.disposables.dispose(); + } +}; +function isSelectionSingleChangeEvent(event) { + return isMacintosh ? event.browserEvent.metaKey : event.browserEvent.ctrlKey; +} +function isSelectionRangeChangeEvent(event) { + return event.browserEvent.shiftKey; +} +function isMouseRightClick(event) { + return isMouseEvent(event) && event.button === 2; +} +var DefaultMultipleSelectionController = { + isSelectionSingleChangeEvent, + isSelectionRangeChangeEvent +}; +var MouseController = class { + get onPointer() { + return this._onPointer.event; + } + constructor(list2) { + this.list = list2; + this.disposables = new DisposableStore(); + this._onPointer = this.disposables.add(new Emitter()); + if (list2.options.multipleSelectionSupport !== false) { + this.multipleSelectionController = this.list.options.multipleSelectionController || DefaultMultipleSelectionController; + } + this.mouseSupport = typeof list2.options.mouseSupport === "undefined" || !!list2.options.mouseSupport; + if (this.mouseSupport) { + list2.onMouseDown(this.onMouseDown, this, this.disposables); + list2.onContextMenu(this.onContextMenu, this, this.disposables); + list2.onMouseDblClick(this.onDoubleClick, this, this.disposables); + list2.onTouchStart(this.onMouseDown, this, this.disposables); + this.disposables.add(Gesture.addTarget(list2.getHTMLElement())); + } + Event.any(list2.onMouseClick, list2.onMouseMiddleClick, list2.onTap)(this.onViewPointer, this, this.disposables); + } + updateOptions(optionsUpdate) { + if (optionsUpdate.multipleSelectionSupport !== void 0) { + this.multipleSelectionController = void 0; + if (optionsUpdate.multipleSelectionSupport) { + this.multipleSelectionController = this.list.options.multipleSelectionController || DefaultMultipleSelectionController; + } + } + } + isSelectionSingleChangeEvent(event) { + if (!this.multipleSelectionController) { + return false; + } + return this.multipleSelectionController.isSelectionSingleChangeEvent(event); + } + isSelectionRangeChangeEvent(event) { + if (!this.multipleSelectionController) { + return false; + } + return this.multipleSelectionController.isSelectionRangeChangeEvent(event); + } + isSelectionChangeEvent(event) { + return this.isSelectionSingleChangeEvent(event) || this.isSelectionRangeChangeEvent(event); + } + onMouseDown(e) { + if (isMonacoEditor(e.browserEvent.target)) { + return; + } + if (getActiveElement() !== e.browserEvent.target) { + this.list.domFocus(); + } + } + onContextMenu(e) { + if (isEditableElement(e.browserEvent.target) || isMonacoEditor(e.browserEvent.target)) { + return; + } + const focus = typeof e.index === "undefined" ? [] : [e.index]; + this.list.setFocus(focus, e.browserEvent); + } + onViewPointer(e) { + if (!this.mouseSupport) { + return; + } + if (isEditableElement(e.browserEvent.target) || isMonacoEditor(e.browserEvent.target)) { + return; + } + if (e.browserEvent.isHandledByList) { + return; + } + e.browserEvent.isHandledByList = true; + const focus = e.index; + if (typeof focus === "undefined") { + this.list.setFocus([], e.browserEvent); + this.list.setSelection([], e.browserEvent); + this.list.setAnchor(void 0); + return; + } + if (this.isSelectionChangeEvent(e)) { + return this.changeSelection(e); + } + this.list.setFocus([focus], e.browserEvent); + this.list.setAnchor(focus); + if (!isMouseRightClick(e.browserEvent)) { + this.list.setSelection([focus], e.browserEvent); + } + this._onPointer.fire(e); + } + onDoubleClick(e) { + if (isEditableElement(e.browserEvent.target) || isMonacoEditor(e.browserEvent.target)) { + return; + } + if (this.isSelectionChangeEvent(e)) { + return; + } + if (e.browserEvent.isHandledByList) { + return; + } + e.browserEvent.isHandledByList = true; + const focus = this.list.getFocus(); + this.list.setSelection(focus, e.browserEvent); + } + changeSelection(e) { + const focus = e.index; + let anchor = this.list.getAnchor(); + if (this.isSelectionRangeChangeEvent(e)) { + if (typeof anchor === "undefined") { + const currentFocus = this.list.getFocus()[0]; + anchor = currentFocus ?? focus; + this.list.setAnchor(anchor); + } + const min = Math.min(anchor, focus); + const max = Math.max(anchor, focus); + const rangeSelection = range(min, max + 1); + const selection = this.list.getSelection(); + const contiguousRange = getContiguousRangeContaining(disjunction(selection, [anchor]), anchor); + if (contiguousRange.length === 0) { + return; + } + const newSelection = disjunction(rangeSelection, relativeComplement(selection, contiguousRange)); + this.list.setSelection(newSelection, e.browserEvent); + this.list.setFocus([focus], e.browserEvent); + } else if (this.isSelectionSingleChangeEvent(e)) { + const selection = this.list.getSelection(); + const newSelection = selection.filter((i2) => i2 !== focus); + this.list.setFocus([focus]); + this.list.setAnchor(focus); + if (selection.length === newSelection.length) { + this.list.setSelection([...newSelection, focus], e.browserEvent); + } else { + this.list.setSelection(newSelection, e.browserEvent); + } + } + } + dispose() { + this.disposables.dispose(); + } +}; +var DefaultStyleController = class { + constructor(styleElement, selectorSuffix) { + this.styleElement = styleElement; + this.selectorSuffix = selectorSuffix; + } + style(styles) { + const suffix = this.selectorSuffix && `.${this.selectorSuffix}`; + const content = []; + if (styles.listBackground) { + content.push(`.monaco-list${suffix} .monaco-list-rows { background: ${styles.listBackground}; }`); + } + if (styles.listFocusBackground) { + content.push(`.monaco-list${suffix}:focus .monaco-list-row.focused { background-color: ${styles.listFocusBackground}; }`); + content.push(`.monaco-list${suffix}:focus .monaco-list-row.focused:hover { background-color: ${styles.listFocusBackground}; }`); + } + if (styles.listFocusForeground) { + content.push(`.monaco-list${suffix}:focus .monaco-list-row.focused { color: ${styles.listFocusForeground}; }`); + } + if (styles.listActiveSelectionBackground) { + content.push(`.monaco-list${suffix}:focus .monaco-list-row.selected { background-color: ${styles.listActiveSelectionBackground}; }`); + content.push(`.monaco-list${suffix}:focus .monaco-list-row.selected:hover { background-color: ${styles.listActiveSelectionBackground}; }`); + } + if (styles.listActiveSelectionForeground) { + content.push(`.monaco-list${suffix}:focus .monaco-list-row.selected { color: ${styles.listActiveSelectionForeground}; }`); + } + if (styles.listActiveSelectionIconForeground) { + content.push(`.monaco-list${suffix}:focus .monaco-list-row.selected .codicon { color: ${styles.listActiveSelectionIconForeground}; }`); + } + if (styles.listFocusAndSelectionBackground) { + content.push(` + .monaco-drag-image${suffix}, + .monaco-list${suffix}:focus .monaco-list-row.selected.focused { background-color: ${styles.listFocusAndSelectionBackground}; } + `); + } + if (styles.listFocusAndSelectionForeground) { + content.push(` + .monaco-drag-image${suffix}, + .monaco-list${suffix}:focus .monaco-list-row.selected.focused { color: ${styles.listFocusAndSelectionForeground}; } + `); + } + if (styles.listInactiveFocusForeground) { + content.push(`.monaco-list${suffix} .monaco-list-row.focused { color: ${styles.listInactiveFocusForeground}; }`); + content.push(`.monaco-list${suffix} .monaco-list-row.focused:hover { color: ${styles.listInactiveFocusForeground}; }`); + } + if (styles.listInactiveSelectionIconForeground) { + content.push(`.monaco-list${suffix} .monaco-list-row.focused .codicon { color: ${styles.listInactiveSelectionIconForeground}; }`); + } + if (styles.listInactiveFocusBackground) { + content.push(`.monaco-list${suffix} .monaco-list-row.focused { background-color: ${styles.listInactiveFocusBackground}; }`); + content.push(`.monaco-list${suffix} .monaco-list-row.focused:hover { background-color: ${styles.listInactiveFocusBackground}; }`); + } + if (styles.listInactiveSelectionBackground) { + content.push(`.monaco-list${suffix} .monaco-list-row.selected { background-color: ${styles.listInactiveSelectionBackground}; }`); + content.push(`.monaco-list${suffix} .monaco-list-row.selected:hover { background-color: ${styles.listInactiveSelectionBackground}; }`); + } + if (styles.listInactiveSelectionForeground) { + content.push(`.monaco-list${suffix} .monaco-list-row.selected { color: ${styles.listInactiveSelectionForeground}; }`); + } + if (styles.listHoverBackground) { + content.push(`.monaco-list${suffix}:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused) { background-color: ${styles.listHoverBackground}; }`); + } + if (styles.listHoverForeground) { + content.push(`.monaco-list${suffix}:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused) { color: ${styles.listHoverForeground}; }`); + } + const focusAndSelectionOutline = asCssValueWithDefault(styles.listFocusAndSelectionOutline, asCssValueWithDefault(styles.listSelectionOutline, styles.listFocusOutline ?? "")); + if (focusAndSelectionOutline) { + content.push(`.monaco-list${suffix}:focus .monaco-list-row.focused.selected { outline: 1px solid ${focusAndSelectionOutline}; outline-offset: -1px;}`); + } + if (styles.listFocusOutline) { + content.push(` + .monaco-drag-image${suffix}, + .monaco-list${suffix}:focus .monaco-list-row.focused, + .context-menu-visible .monaco-list${suffix}.last-focused .monaco-list-row.focused { outline: 1px solid ${styles.listFocusOutline}; outline-offset: -1px; } + `); + } + const inactiveFocusAndSelectionOutline = asCssValueWithDefault(styles.listSelectionOutline, styles.listInactiveFocusOutline ?? ""); + if (inactiveFocusAndSelectionOutline) { + content.push(`.monaco-list${suffix} .monaco-list-row.focused.selected { outline: 1px dotted ${inactiveFocusAndSelectionOutline}; outline-offset: -1px; }`); + } + if (styles.listSelectionOutline) { + content.push(`.monaco-list${suffix} .monaco-list-row.selected { outline: 1px dotted ${styles.listSelectionOutline}; outline-offset: -1px; }`); + } + if (styles.listInactiveFocusOutline) { + content.push(`.monaco-list${suffix} .monaco-list-row.focused { outline: 1px dotted ${styles.listInactiveFocusOutline}; outline-offset: -1px; }`); + } + if (styles.listHoverOutline) { + content.push(`.monaco-list${suffix} .monaco-list-row:hover { outline: 1px dashed ${styles.listHoverOutline}; outline-offset: -1px; }`); + } + if (styles.listDropOverBackground) { + content.push(` + .monaco-list${suffix}.drop-target, + .monaco-list${suffix} .monaco-list-rows.drop-target, + .monaco-list${suffix} .monaco-list-row.drop-target { background-color: ${styles.listDropOverBackground} !important; color: inherit !important; } + `); + } + if (styles.listDropBetweenBackground) { + content.push(` + .monaco-list${suffix} .monaco-list-rows.drop-target-before .monaco-list-row:first-child::before, + .monaco-list${suffix} .monaco-list-row.drop-target-before::before { + content: ""; position: absolute; top: 0px; left: 0px; width: 100%; height: 1px; + background-color: ${styles.listDropBetweenBackground}; + }`); + content.push(` + .monaco-list${suffix} .monaco-list-rows.drop-target-after .monaco-list-row:last-child::after, + .monaco-list${suffix} .monaco-list-row.drop-target-after::after { + content: ""; position: absolute; bottom: 0px; left: 0px; width: 100%; height: 1px; + background-color: ${styles.listDropBetweenBackground}; + }`); + } + if (styles.tableColumnsBorder) { + content.push(` + .monaco-table > .monaco-split-view2, + .monaco-table > .monaco-split-view2 .monaco-sash.vertical::before, + .monaco-enable-motion .monaco-table:hover > .monaco-split-view2, + .monaco-enable-motion .monaco-table:hover > .monaco-split-view2 .monaco-sash.vertical::before { + border-color: ${styles.tableColumnsBorder}; + } + + .monaco-enable-motion .monaco-table > .monaco-split-view2, + .monaco-enable-motion .monaco-table > .monaco-split-view2 .monaco-sash.vertical::before { + border-color: transparent; + } + `); + } + if (styles.tableOddRowsBackgroundColor) { + content.push(` + .monaco-table .monaco-list-row[data-parity=odd]:not(.focused):not(.selected):not(:hover) .monaco-table-tr, + .monaco-table .monaco-list:not(:focus) .monaco-list-row[data-parity=odd].focused:not(.selected):not(:hover) .monaco-table-tr, + .monaco-table .monaco-list:not(.focused) .monaco-list-row[data-parity=odd].focused:not(.selected):not(:hover) .monaco-table-tr { + background-color: ${styles.tableOddRowsBackgroundColor}; + } + `); + } + this.styleElement.textContent = content.join("\n"); + } +}; +var unthemedListStyles = { + listFocusBackground: "#7FB0D0", + listActiveSelectionBackground: "#0E639C", + listActiveSelectionForeground: "#FFFFFF", + listActiveSelectionIconForeground: "#FFFFFF", + listFocusAndSelectionOutline: "#90C2F9", + listFocusAndSelectionBackground: "#094771", + listFocusAndSelectionForeground: "#FFFFFF", + listInactiveSelectionBackground: "#3F3F46", + listInactiveSelectionIconForeground: "#FFFFFF", + listHoverBackground: "#2A2D2E", + listDropOverBackground: "#383B3D", + listDropBetweenBackground: "#EEEEEE", + treeIndentGuidesStroke: "#a9a9a9", + treeInactiveIndentGuidesStroke: Color.fromHex("#a9a9a9").transparent(0.4).toString(), + tableColumnsBorder: Color.fromHex("#cccccc").transparent(0.2).toString(), + tableOddRowsBackgroundColor: Color.fromHex("#cccccc").transparent(0.04).toString(), + listBackground: void 0, + listFocusForeground: void 0, + listInactiveSelectionForeground: void 0, + listInactiveFocusForeground: void 0, + listInactiveFocusBackground: void 0, + listHoverForeground: void 0, + listFocusOutline: void 0, + listInactiveFocusOutline: void 0, + listSelectionOutline: void 0, + listHoverOutline: void 0, + treeStickyScrollBackground: void 0, + treeStickyScrollBorder: void 0, + treeStickyScrollShadow: void 0 +}; +var DefaultOptions2 = { + keyboardSupport: true, + mouseSupport: true, + multipleSelectionSupport: true, + dnd: { + getDragURI() { + return null; + }, + onDragStart() { + }, + onDragOver() { + return false; + }, + drop() { + }, + dispose() { + } + } +}; +function getContiguousRangeContaining(range2, value) { + const index = range2.indexOf(value); + if (index === -1) { + return []; + } + const result = []; + let i2 = index - 1; + while (i2 >= 0 && range2[i2] === value - (index - i2)) { + result.push(range2[i2--]); + } + result.reverse(); + i2 = index; + while (i2 < range2.length && range2[i2] === value + (i2 - index)) { + result.push(range2[i2++]); + } + return result; +} +function disjunction(one, other) { + const result = []; + let i2 = 0, j = 0; + while (i2 < one.length || j < other.length) { + if (i2 >= one.length) { + result.push(other[j++]); + } else if (j >= other.length) { + result.push(one[i2++]); + } else if (one[i2] === other[j]) { + result.push(one[i2]); + i2++; + j++; + continue; + } else if (one[i2] < other[j]) { + result.push(one[i2++]); + } else { + result.push(other[j++]); + } + } + return result; +} +function relativeComplement(one, other) { + const result = []; + let i2 = 0, j = 0; + while (i2 < one.length || j < other.length) { + if (i2 >= one.length) { + result.push(other[j++]); + } else if (j >= other.length) { + result.push(one[i2++]); + } else if (one[i2] === other[j]) { + i2++; + j++; + continue; + } else if (one[i2] < other[j]) { + result.push(one[i2++]); + } else { + j++; + } + } + return result; +} +var numericSort = (a, b) => a - b; +var PipelineRenderer = class { + constructor(_templateId, renderers) { + this._templateId = _templateId; + this.renderers = renderers; + } + get templateId() { + return this._templateId; + } + renderTemplate(container) { + return this.renderers.map((r) => r.renderTemplate(container)); + } + renderElement(element, index, templateData, renderDetails) { + let i2 = 0; + for (const renderer of this.renderers) { + renderer.renderElement(element, index, templateData[i2++], renderDetails); + } + } + disposeElement(element, index, templateData, renderDetails) { + let i2 = 0; + for (const renderer of this.renderers) { + renderer.disposeElement?.(element, index, templateData[i2], renderDetails); + i2 += 1; + } + } + disposeTemplate(templateData) { + let i2 = 0; + for (const renderer of this.renderers) { + renderer.disposeTemplate(templateData[i2++]); + } + } +}; +var AccessibiltyRenderer = class { + constructor(accessibilityProvider) { + this.accessibilityProvider = accessibilityProvider; + this.templateId = "a18n"; + } + renderTemplate(container) { + return { container, disposables: new DisposableStore() }; + } + renderElement(element, index, data) { + const ariaLabel = this.accessibilityProvider.getAriaLabel(element); + const observable = ariaLabel && typeof ariaLabel !== "string" ? ariaLabel : constObservable(ariaLabel); + data.disposables.add(autorun((reader) => { + this.setAriaLabel(reader.readObservable(observable), data.container); + })); + const ariaLevel = this.accessibilityProvider.getAriaLevel && this.accessibilityProvider.getAriaLevel(element); + if (typeof ariaLevel === "number") { + data.container.setAttribute("aria-level", `${ariaLevel}`); + } else { + data.container.removeAttribute("aria-level"); + } + } + setAriaLabel(ariaLabel, element) { + if (ariaLabel) { + element.setAttribute("aria-label", ariaLabel); + } else { + element.removeAttribute("aria-label"); + } + } + disposeElement(element, index, templateData) { + templateData.disposables.clear(); + } + disposeTemplate(templateData) { + templateData.disposables.dispose(); + } +}; +var ListViewDragAndDrop = class { + constructor(list2, dnd) { + this.list = list2; + this.dnd = dnd; + } + getDragElements(element) { + const selection = this.list.getSelectedElements(); + const elements = selection.indexOf(element) > -1 ? selection : [element]; + return elements; + } + getDragURI(element) { + return this.dnd.getDragURI(element); + } + getDragLabel(elements, originalEvent) { + if (this.dnd.getDragLabel) { + return this.dnd.getDragLabel(elements, originalEvent); + } + return void 0; + } + onDragStart(data, originalEvent) { + this.dnd.onDragStart?.(data, originalEvent); + } + onDragOver(data, targetElement, targetIndex, targetSector, originalEvent) { + return this.dnd.onDragOver(data, targetElement, targetIndex, targetSector, originalEvent); + } + onDragLeave(data, targetElement, targetIndex, originalEvent) { + this.dnd.onDragLeave?.(data, targetElement, targetIndex, originalEvent); + } + onDragEnd(originalEvent) { + this.dnd.onDragEnd?.(originalEvent); + } + drop(data, targetElement, targetIndex, targetSector, originalEvent) { + this.dnd.drop(data, targetElement, targetIndex, targetSector, originalEvent); + } + dispose() { + this.dnd.dispose(); + } +}; +var List = class { + get onDidChangeFocus() { + return Event.map(this.eventBufferer.wrapEvent(this.focus.onChange), (e) => this.toListEvent(e), this.disposables); + } + get onDidChangeSelection() { + return Event.map(this.eventBufferer.wrapEvent(this.selection.onChange), (e) => this.toListEvent(e), this.disposables); + } + get domId() { + return this.view.domId; + } + get onDidScroll() { + return this.view.onDidScroll; + } + get onMouseClick() { + return this.view.onMouseClick; + } + get onMouseDblClick() { + return this.view.onMouseDblClick; + } + get onMouseMiddleClick() { + return this.view.onMouseMiddleClick; + } + get onPointer() { + return this.mouseController.onPointer; + } + get onMouseDown() { + return this.view.onMouseDown; + } + get onMouseOver() { + return this.view.onMouseOver; + } + get onMouseOut() { + return this.view.onMouseOut; + } + get onTouchStart() { + return this.view.onTouchStart; + } + get onTap() { + return this.view.onTap; + } + /** + * Possible context menu trigger events: + * - ContextMenu key + * - Shift F10 + * - Ctrl Option Shift M (macOS with VoiceOver) + * - Mouse right click + */ + get onContextMenu() { + let didJustPressContextMenuKey = false; + const fromKeyDown = Event.chain(this.disposables.add(new DomEmitter(this.view.domNode, "keydown")).event, ($23) => $23.map((e) => new StandardKeyboardEvent(e)).filter((e) => didJustPressContextMenuKey = e.keyCode === 58 || e.shiftKey && e.keyCode === 68).map((e) => EventHelper.stop(e, true)).filter(() => false)); + const fromKeyUp = Event.chain(this.disposables.add(new DomEmitter(this.view.domNode, "keyup")).event, ($23) => $23.forEach(() => didJustPressContextMenuKey = false).map((e) => new StandardKeyboardEvent(e)).filter((e) => e.keyCode === 58 || e.shiftKey && e.keyCode === 68).map((e) => EventHelper.stop(e, true)).map(({ browserEvent }) => { + const focus = this.getFocus(); + const index = focus.length ? focus[0] : void 0; + const element = typeof index !== "undefined" ? this.view.element(index) : void 0; + const anchor = typeof index !== "undefined" ? this.view.domElement(index) : this.view.domNode; + return { index, element, anchor, browserEvent }; + })); + const fromMouse = Event.chain(this.view.onContextMenu, ($23) => $23.filter((_) => !didJustPressContextMenuKey).map(({ element, index, browserEvent }) => ({ element, index, anchor: new StandardMouseEvent(getWindow(this.view.domNode), browserEvent), browserEvent }))); + return Event.any(fromKeyDown, fromKeyUp, fromMouse); + } + get onKeyDown() { + return this.disposables.add(new DomEmitter(this.view.domNode, "keydown")).event; + } + get onDidFocus() { + return Event.signal(this.disposables.add(new DomEmitter(this.view.domNode, "focus", true)).event); + } + get onDidBlur() { + return Event.signal(this.disposables.add(new DomEmitter(this.view.domNode, "blur", true)).event); + } + constructor(user, container, virtualDelegate, renderers, _options = DefaultOptions2) { + this.user = user; + this._options = _options; + this.focus = new Trait("focused"); + this.anchor = new Trait("anchor"); + this.eventBufferer = new EventBufferer(); + this._ariaLabel = ""; + this.disposables = new DisposableStore(); + this._onDidDispose = new Emitter(); + this.onDidDispose = this._onDidDispose.event; + const role = this._options.accessibilityProvider && this._options.accessibilityProvider.getWidgetRole ? this._options.accessibilityProvider?.getWidgetRole() : "list"; + this.selection = new SelectionTrait(role !== "listbox"); + const baseRenderers = [this.focus.renderer, this.selection.renderer]; + this.accessibilityProvider = _options.accessibilityProvider; + if (this.accessibilityProvider) { + baseRenderers.push(new AccessibiltyRenderer(this.accessibilityProvider)); + this.accessibilityProvider.onDidChangeActiveDescendant?.(this.onDidChangeActiveDescendant, this, this.disposables); + } + renderers = renderers.map((r) => new PipelineRenderer(r.templateId, [...baseRenderers, r])); + const viewOptions = { + ..._options, + dnd: _options.dnd && new ListViewDragAndDrop(this, _options.dnd) + }; + this.view = this.createListView(container, virtualDelegate, renderers, viewOptions); + this.view.domNode.setAttribute("role", role); + if (_options.styleController) { + this.styleController = _options.styleController(this.view.domId); + } else { + const styleElement = createStyleSheet(this.view.domNode); + this.styleController = new DefaultStyleController(styleElement, this.view.domId); + } + this.spliceable = new CombinedSpliceable([ + new TraitSpliceable(this.focus, this.view, _options.identityProvider), + new TraitSpliceable(this.selection, this.view, _options.identityProvider), + new TraitSpliceable(this.anchor, this.view, _options.identityProvider), + this.view + ]); + this.disposables.add(this.focus); + this.disposables.add(this.selection); + this.disposables.add(this.anchor); + this.disposables.add(this.view); + this.disposables.add(this._onDidDispose); + this.disposables.add(new DOMFocusController(this, this.view)); + if (typeof _options.keyboardSupport !== "boolean" || _options.keyboardSupport) { + this.keyboardController = new KeyboardController(this, this.view, _options); + this.disposables.add(this.keyboardController); + } + if (_options.keyboardNavigationLabelProvider) { + const delegate = _options.keyboardNavigationDelegate || DefaultKeyboardNavigationDelegate; + this.typeNavigationController = new TypeNavigationController(this, this.view, _options.keyboardNavigationLabelProvider, _options.keyboardNavigationEventFilter ?? (() => true), delegate); + this.disposables.add(this.typeNavigationController); + } + this.mouseController = this.createMouseController(_options); + this.disposables.add(this.mouseController); + this.onDidChangeFocus(this._onFocusChange, this, this.disposables); + this.onDidChangeSelection(this._onSelectionChange, this, this.disposables); + if (this.accessibilityProvider) { + const ariaLabel = this.accessibilityProvider.getWidgetAriaLabel(); + const observable = ariaLabel && typeof ariaLabel !== "string" ? ariaLabel : constObservable(ariaLabel); + this.disposables.add(autorun((reader) => { + this.ariaLabel = reader.readObservable(observable); + })); + } + if (this._options.multipleSelectionSupport !== false) { + this.view.domNode.setAttribute("aria-multiselectable", "true"); + } + } + createListView(container, virtualDelegate, renderers, viewOptions) { + return new ListView(container, virtualDelegate, renderers, viewOptions); + } + createMouseController(options2) { + return new MouseController(this); + } + updateOptions(optionsUpdate = {}) { + this._options = { ...this._options, ...optionsUpdate }; + this.typeNavigationController?.updateOptions(this._options); + if (this._options.multipleSelectionController !== void 0) { + if (this._options.multipleSelectionSupport) { + this.view.domNode.setAttribute("aria-multiselectable", "true"); + } else { + this.view.domNode.removeAttribute("aria-multiselectable"); + } + } + this.mouseController.updateOptions(optionsUpdate); + this.keyboardController?.updateOptions(optionsUpdate); + this.view.updateOptions(optionsUpdate); + } + get options() { + return this._options; + } + splice(start, deleteCount, elements = []) { + if (start < 0 || start > this.view.length) { + throw new ListError(this.user, `Invalid start index: ${start}`); + } + if (deleteCount < 0) { + throw new ListError(this.user, `Invalid delete count: ${deleteCount}`); + } + if (deleteCount === 0 && elements.length === 0) { + return; + } + this.eventBufferer.bufferEvents(() => this.spliceable.splice(start, deleteCount, elements)); + } + rerender() { + this.view.rerender(); + } + element(index) { + return this.view.element(index); + } + indexOf(element) { + return this.view.indexOf(element); + } + indexAt(position) { + return this.view.indexAt(position); + } + get length() { + return this.view.length; + } + get contentHeight() { + return this.view.contentHeight; + } + get onDidChangeContentHeight() { + return this.view.onDidChangeContentHeight; + } + get scrollTop() { + return this.view.getScrollTop(); + } + set scrollTop(scrollTop) { + this.view.setScrollTop(scrollTop); + } + get scrollHeight() { + return this.view.scrollHeight; + } + get renderHeight() { + return this.view.renderHeight; + } + get firstVisibleIndex() { + return this.view.firstVisibleIndex; + } + get ariaLabel() { + return this._ariaLabel; + } + set ariaLabel(value) { + this._ariaLabel = value; + this.view.domNode.setAttribute("aria-label", value); + } + domFocus() { + this.view.domNode.focus({ preventScroll: true }); + } + layout(height, width2) { + this.view.layout(height, width2); + } + setSelection(indexes, browserEvent) { + for (const index of indexes) { + if (index < 0 || index >= this.length) { + throw new ListError(this.user, `Invalid index ${index}`); + } + } + this.selection.set(indexes, browserEvent); + } + getSelection() { + return this.selection.get(); + } + getSelectedElements() { + return this.getSelection().map((i2) => this.view.element(i2)); + } + setAnchor(index) { + if (typeof index === "undefined") { + this.anchor.set([]); + return; + } + if (index < 0 || index >= this.length) { + throw new ListError(this.user, `Invalid index ${index}`); + } + this.anchor.set([index]); + } + getAnchor() { + return this.anchor.get().at(0); + } + getAnchorElement() { + const anchor = this.getAnchor(); + return typeof anchor === "undefined" ? void 0 : this.element(anchor); + } + setFocus(indexes, browserEvent) { + for (const index of indexes) { + if (index < 0 || index >= this.length) { + throw new ListError(this.user, `Invalid index ${index}`); + } + } + this.focus.set(indexes, browserEvent); + } + focusNext(n2 = 1, loop = false, browserEvent, filter) { + if (this.length === 0) { + return; + } + const focus = this.focus.get(); + const index = this.findNextIndex(focus.length > 0 ? focus[0] + n2 : 0, loop, filter); + if (index > -1) { + this.setFocus([index], browserEvent); + } + } + focusPrevious(n2 = 1, loop = false, browserEvent, filter) { + if (this.length === 0) { + return; + } + const focus = this.focus.get(); + const index = this.findPreviousIndex(focus.length > 0 ? focus[0] - n2 : 0, loop, filter); + if (index > -1) { + this.setFocus([index], browserEvent); + } + } + async focusNextPage(browserEvent, filter) { + let lastPageIndex = this.view.indexAt(this.view.getScrollTop() + this.view.renderHeight); + lastPageIndex = lastPageIndex === 0 ? 0 : lastPageIndex - 1; + const currentlyFocusedElementIndex = this.getFocus()[0]; + if (currentlyFocusedElementIndex !== lastPageIndex && (currentlyFocusedElementIndex === void 0 || lastPageIndex > currentlyFocusedElementIndex)) { + const lastGoodPageIndex = this.findPreviousIndex(lastPageIndex, false, filter); + if (lastGoodPageIndex > -1 && currentlyFocusedElementIndex !== lastGoodPageIndex) { + this.setFocus([lastGoodPageIndex], browserEvent); + } else { + this.setFocus([lastPageIndex], browserEvent); + } + } else { + const previousScrollTop = this.view.getScrollTop(); + let nextpageScrollTop = previousScrollTop + this.view.renderHeight; + if (lastPageIndex > currentlyFocusedElementIndex) { + nextpageScrollTop -= this.view.elementHeight(lastPageIndex); + } + this.view.setScrollTop(nextpageScrollTop); + if (this.view.getScrollTop() !== previousScrollTop) { + this.setFocus([]); + await timeout(0); + await this.focusNextPage(browserEvent, filter); + } + } + } + async focusPreviousPage(browserEvent, filter, getPaddingTop = () => 0) { + let firstPageIndex; + const paddingTop = getPaddingTop(); + const scrollTop = this.view.getScrollTop() + paddingTop; + if (scrollTop === 0) { + firstPageIndex = this.view.indexAt(scrollTop); + } else { + firstPageIndex = this.view.indexAfter(scrollTop - 1); + } + const currentlyFocusedElementIndex = this.getFocus()[0]; + if (currentlyFocusedElementIndex !== firstPageIndex && (currentlyFocusedElementIndex === void 0 || currentlyFocusedElementIndex >= firstPageIndex)) { + const firstGoodPageIndex = this.findNextIndex(firstPageIndex, false, filter); + if (firstGoodPageIndex > -1 && currentlyFocusedElementIndex !== firstGoodPageIndex) { + this.setFocus([firstGoodPageIndex], browserEvent); + } else { + this.setFocus([firstPageIndex], browserEvent); + } + } else { + const previousScrollTop = scrollTop; + this.view.setScrollTop(scrollTop - this.view.renderHeight - paddingTop); + if (this.view.getScrollTop() + getPaddingTop() !== previousScrollTop) { + this.setFocus([]); + await timeout(0); + await this.focusPreviousPage(browserEvent, filter, getPaddingTop); + } + } + } + focusLast(browserEvent, filter) { + if (this.length === 0) { + return; + } + const index = this.findPreviousIndex(this.length - 1, false, filter); + if (index > -1) { + this.setFocus([index], browserEvent); + } + } + focusFirst(browserEvent, filter) { + this.focusNth(0, browserEvent, filter); + } + focusNth(n2, browserEvent, filter) { + if (this.length === 0) { + return; + } + const index = this.findNextIndex(n2, false, filter); + if (index > -1) { + this.setFocus([index], browserEvent); + } + } + findNextIndex(index, loop = false, filter) { + for (let i2 = 0; i2 < this.length; i2++) { + if (index >= this.length && !loop) { + return -1; + } + index = index % this.length; + if (!filter || filter(this.element(index))) { + return index; + } + index++; + } + return -1; + } + findPreviousIndex(index, loop = false, filter) { + for (let i2 = 0; i2 < this.length; i2++) { + if (index < 0 && !loop) { + return -1; + } + index = (this.length + index % this.length) % this.length; + if (!filter || filter(this.element(index))) { + return index; + } + index--; + } + return -1; + } + getFocus() { + return this.focus.get(); + } + getFocusedElements() { + return this.getFocus().map((i2) => this.view.element(i2)); + } + reveal(index, relativeTop, paddingTop = 0) { + if (index < 0 || index >= this.length) { + throw new ListError(this.user, `Invalid index ${index}`); + } + const scrollTop = this.view.getScrollTop(); + const elementTop = this.view.elementTop(index); + const elementHeight = this.view.elementHeight(index); + if (isNumber(relativeTop)) { + const m = elementHeight - this.view.renderHeight + paddingTop; + this.view.setScrollTop(m * clamp(relativeTop, 0, 1) + elementTop - paddingTop); + } else { + const viewItemBottom = elementTop + elementHeight; + const scrollBottom = scrollTop + this.view.renderHeight; + if (elementTop < scrollTop + paddingTop && viewItemBottom >= scrollBottom) { + } else if (elementTop < scrollTop + paddingTop || viewItemBottom >= scrollBottom && elementHeight >= this.view.renderHeight) { + this.view.setScrollTop(elementTop - paddingTop); + } else if (viewItemBottom >= scrollBottom) { + this.view.setScrollTop(viewItemBottom - this.view.renderHeight); + } + } + } + /** + * Returns the relative position of an element rendered in the list. + * Returns `null` if the element isn't *entirely* in the visible viewport. + */ + getRelativeTop(index, paddingTop = 0) { + if (index < 0 || index >= this.length) { + throw new ListError(this.user, `Invalid index ${index}`); + } + const scrollTop = this.view.getScrollTop(); + const elementTop = this.view.elementTop(index); + const elementHeight = this.view.elementHeight(index); + if (elementTop < scrollTop + paddingTop || elementTop + elementHeight > scrollTop + this.view.renderHeight) { + return null; + } + const m = elementHeight - this.view.renderHeight + paddingTop; + return Math.abs((scrollTop + paddingTop - elementTop) / m); + } + getHTMLElement() { + return this.view.domNode; + } + getScrollableElement() { + return this.view.scrollableElementDomNode; + } + getElementID(index) { + return this.view.getElementDomId(index); + } + getElementTop(index) { + return this.view.elementTop(index); + } + style(styles) { + this.styleController.style(styles); + } + toListEvent({ indexes, browserEvent }) { + return { indexes, elements: indexes.map((i2) => this.view.element(i2)), browserEvent }; + } + _onFocusChange() { + const focus = this.focus.get(); + this.view.domNode.classList.toggle("element-focused", focus.length > 0); + this.onDidChangeActiveDescendant(); + } + onDidChangeActiveDescendant() { + const focus = this.focus.get(); + if (focus.length > 0) { + let id; + if (this.accessibilityProvider?.getActiveDescendantId) { + id = this.accessibilityProvider.getActiveDescendantId(this.view.element(focus[0])); + } + this.view.domNode.setAttribute("aria-activedescendant", id || this.view.getElementDomId(focus[0])); + } else { + this.view.domNode.removeAttribute("aria-activedescendant"); + } + } + _onSelectionChange() { + const selection = this.selection.get(); + this.view.domNode.classList.toggle("selection-none", selection.length === 0); + this.view.domNode.classList.toggle("selection-single", selection.length === 1); + this.view.domNode.classList.toggle("selection-multiple", selection.length > 1); + } + dispose() { + this._onDidDispose.fire(); + this.disposables.dispose(); + this._onDidDispose.dispose(); + } +}; +__decorate28([ + memoize +], List.prototype, "onDidChangeFocus", null); +__decorate28([ + memoize +], List.prototype, "onDidChangeSelection", null); +__decorate28([ + memoize +], List.prototype, "onContextMenu", null); +__decorate28([ + memoize +], List.prototype, "onKeyDown", null); +__decorate28([ + memoize +], List.prototype, "onDidFocus", null); +__decorate28([ + memoize +], List.prototype, "onDidBlur", null); + +// node_modules/monaco-editor-core/esm/vs/base/browser/ui/selectBox/selectBoxCustom.js +var $2 = $; +var SELECT_OPTION_ENTRY_TEMPLATE_ID = "selectOption.entry.template"; +var SelectListRenderer = class { + get templateId() { + return SELECT_OPTION_ENTRY_TEMPLATE_ID; + } + renderTemplate(container) { + const data = /* @__PURE__ */ Object.create(null); + data.root = container; + data.text = append(container, $2(".option-text")); + data.detail = append(container, $2(".option-detail")); + data.decoratorRight = append(container, $2(".option-decorator-right")); + return data; + } + renderElement(element, index, templateData) { + const data = templateData; + const text2 = element.text; + const detail = element.detail; + const decoratorRight = element.decoratorRight; + const isDisabled = element.isDisabled; + data.text.textContent = text2; + data.detail.textContent = !!detail ? detail : ""; + data.decoratorRight.textContent = !!decoratorRight ? decoratorRight : ""; + if (isDisabled) { + data.root.classList.add("option-disabled"); + } else { + data.root.classList.remove("option-disabled"); + } + } + disposeTemplate(_templateData) { + } +}; +var SelectBoxList = class _SelectBoxList extends Disposable { + static { + this.DEFAULT_DROPDOWN_MINIMUM_BOTTOM_MARGIN = 32; + } + static { + this.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN = 2; + } + static { + this.DEFAULT_MINIMUM_VISIBLE_OPTIONS = 3; + } + constructor(options2, selected, contextViewProvider, styles, selectBoxOptions) { + super(); + this.options = []; + this._currentSelection = 0; + this._hasDetails = false; + this._selectionDetailsDisposables = this._register(new DisposableStore()); + this._skipLayout = false; + this._sticky = false; + this._isVisible = false; + this.styles = styles; + this.selectBoxOptions = selectBoxOptions || /* @__PURE__ */ Object.create(null); + if (typeof this.selectBoxOptions.minBottomMargin !== "number") { + this.selectBoxOptions.minBottomMargin = _SelectBoxList.DEFAULT_DROPDOWN_MINIMUM_BOTTOM_MARGIN; + } else if (this.selectBoxOptions.minBottomMargin < 0) { + this.selectBoxOptions.minBottomMargin = 0; + } + this.selectElement = document.createElement("select"); + this.selectElement.className = "monaco-select-box monaco-select-box-dropdown-padding"; + if (typeof this.selectBoxOptions.ariaLabel === "string") { + this.selectElement.setAttribute("aria-label", this.selectBoxOptions.ariaLabel); + } + if (typeof this.selectBoxOptions.ariaDescription === "string") { + this.selectElement.setAttribute("aria-description", this.selectBoxOptions.ariaDescription); + } + this._onDidSelect = new Emitter(); + this._register(this._onDidSelect); + this.registerListeners(); + this.constructSelectDropDown(contextViewProvider); + this.selected = selected || 0; + if (options2) { + this.setOptions(options2, selected); + } + this.initStyleSheet(); + } + setTitle(title) { + if (!this._hover && title) { + this._hover = this._register(getBaseLayerHoverDelegate().setupManagedHover(getDefaultHoverDelegate("mouse"), this.selectElement, title)); + } else if (this._hover) { + this._hover.update(title); + } + } + // IDelegate - List renderer + getHeight() { + return 22; + } + getTemplateId() { + return SELECT_OPTION_ENTRY_TEMPLATE_ID; + } + constructSelectDropDown(contextViewProvider) { + this.contextViewProvider = contextViewProvider; + this.selectDropDownContainer = $(".monaco-select-box-dropdown-container"); + this.selectDropDownContainer.classList.add("monaco-select-box-dropdown-padding"); + this.selectionDetailsPane = append(this.selectDropDownContainer, $2(".select-box-details-pane")); + const widthControlOuterDiv = append(this.selectDropDownContainer, $2(".select-box-dropdown-container-width-control")); + const widthControlInnerDiv = append(widthControlOuterDiv, $2(".width-control-div")); + this.widthControlElement = document.createElement("span"); + this.widthControlElement.className = "option-text-width-control"; + append(widthControlInnerDiv, this.widthControlElement); + this._dropDownPosition = 0; + this.styleElement = createStyleSheet(this.selectDropDownContainer); + this.selectDropDownContainer.setAttribute("draggable", "true"); + this._register(addDisposableListener(this.selectDropDownContainer, EventType.DRAG_START, (e) => { + EventHelper.stop(e, true); + })); + } + registerListeners() { + this._register(addStandardDisposableListener(this.selectElement, "change", (e) => { + this.selected = e.target.selectedIndex; + this._onDidSelect.fire({ + index: e.target.selectedIndex, + selected: e.target.value + }); + if (!!this.options[this.selected] && !!this.options[this.selected].text) { + this.setTitle(this.options[this.selected].text); + } + })); + this._register(addDisposableListener(this.selectElement, EventType.CLICK, (e) => { + EventHelper.stop(e); + if (this._isVisible) { + this.hideSelectDropDown(true); + } else { + this.showSelectDropDown(); + } + })); + this._register(addDisposableListener(this.selectElement, EventType.MOUSE_DOWN, (e) => { + EventHelper.stop(e); + })); + let listIsVisibleOnTouchStart; + this._register(addDisposableListener(this.selectElement, "touchstart", (e) => { + listIsVisibleOnTouchStart = this._isVisible; + })); + this._register(addDisposableListener(this.selectElement, "touchend", (e) => { + EventHelper.stop(e); + if (listIsVisibleOnTouchStart) { + this.hideSelectDropDown(true); + } else { + this.showSelectDropDown(); + } + })); + this._register(addDisposableListener(this.selectElement, EventType.KEY_DOWN, (e) => { + const event = new StandardKeyboardEvent(e); + let showDropDown = false; + if (isMacintosh) { + if (event.keyCode === 18 || event.keyCode === 16 || event.keyCode === 10 || event.keyCode === 3) { + showDropDown = true; + } + } else { + if (event.keyCode === 18 && event.altKey || event.keyCode === 16 && event.altKey || event.keyCode === 10 || event.keyCode === 3) { + showDropDown = true; + } + } + if (showDropDown) { + this.showSelectDropDown(); + EventHelper.stop(e, true); + } + })); + } + get onDidSelect() { + return this._onDidSelect.event; + } + setOptions(options2, selected) { + if (!equals(this.options, options2)) { + this.options = options2; + this.selectElement.options.length = 0; + this._hasDetails = false; + this._cachedMaxDetailsHeight = void 0; + this.options.forEach((option2, index) => { + this.selectElement.add(this.createOption(option2.text, index, option2.isDisabled)); + if (typeof option2.description === "string") { + this._hasDetails = true; + } + }); + } + if (selected !== void 0) { + this.select(selected); + this._currentSelection = this.selected; + } + } + setOptionsList() { + this.selectList?.splice(0, this.selectList.length, this.options); + } + select(index) { + if (index >= 0 && index < this.options.length) { + this.selected = index; + } else if (index > this.options.length - 1) { + this.select(this.options.length - 1); + } else if (this.selected < 0) { + this.selected = 0; + } + this.selectElement.selectedIndex = this.selected; + if (!!this.options[this.selected] && !!this.options[this.selected].text) { + this.setTitle(this.options[this.selected].text); + } + } + focus() { + if (this.selectElement) { + this.selectElement.tabIndex = 0; + this.selectElement.focus(); + } + } + blur() { + if (this.selectElement) { + this.selectElement.tabIndex = -1; + this.selectElement.blur(); + } + } + setFocusable(focusable) { + this.selectElement.tabIndex = focusable ? 0 : -1; + } + render(container) { + this.container = container; + container.classList.add("select-container"); + container.appendChild(this.selectElement); + this.styleSelectElement(); + } + initStyleSheet() { + const content = []; + if (this.styles.listFocusBackground) { + content.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { background-color: ${this.styles.listFocusBackground} !important; }`); + } + if (this.styles.listFocusForeground) { + content.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { color: ${this.styles.listFocusForeground} !important; }`); + } + if (this.styles.decoratorRightForeground) { + content.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.focused) .option-decorator-right { color: ${this.styles.decoratorRightForeground}; }`); + } + if (this.styles.selectBackground && this.styles.selectBorder && this.styles.selectBorder !== this.styles.selectBackground) { + content.push(`.monaco-select-box-dropdown-container { border: 1px solid ${this.styles.selectBorder} } `); + content.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-top { border-top: 1px solid ${this.styles.selectBorder} } `); + content.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-bottom { border-bottom: 1px solid ${this.styles.selectBorder} } `); + } else if (this.styles.selectListBorder) { + content.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-top { border-top: 1px solid ${this.styles.selectListBorder} } `); + content.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-bottom { border-bottom: 1px solid ${this.styles.selectListBorder} } `); + } + if (this.styles.listHoverForeground) { + content.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { color: ${this.styles.listHoverForeground} !important; }`); + } + if (this.styles.listHoverBackground) { + content.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { background-color: ${this.styles.listHoverBackground} !important; }`); + } + if (this.styles.listFocusOutline) { + content.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { outline: 1.6px dotted ${this.styles.listFocusOutline} !important; outline-offset: -1.6px !important; }`); + } + if (this.styles.listHoverOutline) { + content.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { outline: 1.6px dashed ${this.styles.listHoverOutline} !important; outline-offset: -1.6px !important; }`); + } + content.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.option-disabled.focused { background-color: transparent !important; color: inherit !important; outline: none !important; }`); + content.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.option-disabled:hover { background-color: transparent !important; color: inherit !important; outline: none !important; }`); + this.styleElement.textContent = content.join("\n"); + } + styleSelectElement() { + const background = this.styles.selectBackground ?? ""; + const foreground2 = this.styles.selectForeground ?? ""; + const border = this.styles.selectBorder ?? ""; + this.selectElement.style.backgroundColor = background; + this.selectElement.style.color = foreground2; + this.selectElement.style.borderColor = border; + } + styleList() { + const background = this.styles.selectBackground ?? ""; + const listBackground = asCssValueWithDefault(this.styles.selectListBackground, background); + this.selectDropDownListContainer.style.backgroundColor = listBackground; + this.selectionDetailsPane.style.backgroundColor = listBackground; + const optionsBorder = this.styles.focusBorder ?? ""; + this.selectDropDownContainer.style.outlineColor = optionsBorder; + this.selectDropDownContainer.style.outlineOffset = "-1px"; + this.selectList.style(this.styles); + } + createOption(value, index, disabled) { + const option2 = document.createElement("option"); + option2.value = value; + option2.text = value; + option2.disabled = !!disabled; + return option2; + } + // ContextView dropdown methods + showSelectDropDown() { + this.selectionDetailsPane.textContent = ""; + if (!this.contextViewProvider || this._isVisible) { + return; + } + this.createSelectList(this.selectDropDownContainer); + this.setOptionsList(); + this.contextViewProvider.showContextView({ + getAnchor: () => this.selectElement, + render: (container) => this.renderSelectDropDown(container, true), + layout: () => { + this.layoutSelectDropDown(); + }, + onHide: () => { + this.selectDropDownContainer.classList.remove("visible"); + this.selectElement.classList.remove("synthetic-focus"); + }, + anchorPosition: this._dropDownPosition + }, this.selectBoxOptions.optionsAsChildren ? this.container : void 0); + this._isVisible = true; + this.hideSelectDropDown(false); + this.contextViewProvider.showContextView({ + getAnchor: () => this.selectElement, + render: (container) => this.renderSelectDropDown(container), + layout: () => this.layoutSelectDropDown(), + onHide: () => { + this.selectDropDownContainer.classList.remove("visible"); + this.selectElement.classList.remove("synthetic-focus"); + }, + anchorPosition: this._dropDownPosition + }, this.selectBoxOptions.optionsAsChildren ? this.container : void 0); + this._currentSelection = this.selected; + this._isVisible = true; + this.selectElement.setAttribute("aria-expanded", "true"); + } + hideSelectDropDown(focusSelect) { + if (!this.contextViewProvider || !this._isVisible) { + return; + } + this._isVisible = false; + this.selectElement.setAttribute("aria-expanded", "false"); + if (focusSelect) { + this.selectElement.focus(); + } + this.contextViewProvider.hideContextView(); + } + renderSelectDropDown(container, preLayoutPosition) { + container.appendChild(this.selectDropDownContainer); + this.layoutSelectDropDown(preLayoutPosition); + return { + dispose: () => { + this.selectDropDownContainer.remove(); + } + }; + } + // Iterate over detailed descriptions, find max height + measureMaxDetailsHeight() { + let maxDetailsPaneHeight = 0; + this.options.forEach((_option, index) => { + this.updateDetail(index); + if (this.selectionDetailsPane.offsetHeight > maxDetailsPaneHeight) { + maxDetailsPaneHeight = this.selectionDetailsPane.offsetHeight; + } + }); + return maxDetailsPaneHeight; + } + layoutSelectDropDown(preLayoutPosition) { + if (this._skipLayout) { + return false; + } + if (this.selectList) { + this.selectDropDownContainer.classList.add("visible"); + const window2 = getWindow(this.selectElement); + const selectPosition = getDomNodePagePosition(this.selectElement); + const styles = getWindow(this.selectElement).getComputedStyle(this.selectElement); + const verticalPadding = parseFloat(styles.getPropertyValue("--dropdown-padding-top")) + parseFloat(styles.getPropertyValue("--dropdown-padding-bottom")); + const maxSelectDropDownHeightBelow = window2.innerHeight - selectPosition.top - selectPosition.height - (this.selectBoxOptions.minBottomMargin || 0); + const maxSelectDropDownHeightAbove = selectPosition.top - _SelectBoxList.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN; + const selectWidth = this.selectElement.offsetWidth; + const selectMinWidth = this.setWidthControlElement(this.widthControlElement); + const selectOptimalWidth = Math.max(selectMinWidth, Math.round(selectWidth)).toString() + "px"; + this.selectDropDownContainer.style.width = selectOptimalWidth; + this.selectList.getHTMLElement().style.height = ""; + this.selectList.layout(); + let listHeight = this.selectList.contentHeight; + if (this._hasDetails && this._cachedMaxDetailsHeight === void 0) { + this._cachedMaxDetailsHeight = this.measureMaxDetailsHeight(); + } + const maxDetailsPaneHeight = this._hasDetails ? this._cachedMaxDetailsHeight : 0; + const minRequiredDropDownHeight = listHeight + verticalPadding + maxDetailsPaneHeight; + const maxVisibleOptionsBelow = Math.floor((maxSelectDropDownHeightBelow - verticalPadding - maxDetailsPaneHeight) / this.getHeight()); + const maxVisibleOptionsAbove = Math.floor((maxSelectDropDownHeightAbove - verticalPadding - maxDetailsPaneHeight) / this.getHeight()); + if (preLayoutPosition) { + if (selectPosition.top + selectPosition.height > window2.innerHeight - 22 || selectPosition.top < _SelectBoxList.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN || maxVisibleOptionsBelow < 1 && maxVisibleOptionsAbove < 1) { + return false; + } + if (maxVisibleOptionsBelow < _SelectBoxList.DEFAULT_MINIMUM_VISIBLE_OPTIONS && maxVisibleOptionsAbove > maxVisibleOptionsBelow && this.options.length > maxVisibleOptionsBelow) { + this._dropDownPosition = 1; + this.selectDropDownListContainer.remove(); + this.selectionDetailsPane.remove(); + this.selectDropDownContainer.appendChild(this.selectionDetailsPane); + this.selectDropDownContainer.appendChild(this.selectDropDownListContainer); + this.selectionDetailsPane.classList.remove("border-top"); + this.selectionDetailsPane.classList.add("border-bottom"); + } else { + this._dropDownPosition = 0; + this.selectDropDownListContainer.remove(); + this.selectionDetailsPane.remove(); + this.selectDropDownContainer.appendChild(this.selectDropDownListContainer); + this.selectDropDownContainer.appendChild(this.selectionDetailsPane); + this.selectionDetailsPane.classList.remove("border-bottom"); + this.selectionDetailsPane.classList.add("border-top"); + } + return true; + } + if (selectPosition.top + selectPosition.height > window2.innerHeight - 22 || selectPosition.top < _SelectBoxList.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN || this._dropDownPosition === 0 && maxVisibleOptionsBelow < 1 || this._dropDownPosition === 1 && maxVisibleOptionsAbove < 1) { + this.hideSelectDropDown(true); + return false; + } + if (this._dropDownPosition === 0) { + if (this._isVisible && maxVisibleOptionsBelow + maxVisibleOptionsAbove < 1) { + this.hideSelectDropDown(true); + return false; + } + if (minRequiredDropDownHeight > maxSelectDropDownHeightBelow) { + listHeight = maxVisibleOptionsBelow * this.getHeight(); + } + } else { + if (minRequiredDropDownHeight > maxSelectDropDownHeightAbove) { + listHeight = maxVisibleOptionsAbove * this.getHeight(); + } + } + this.selectList.layout(listHeight); + this.selectList.domFocus(); + if (this.selectList.length > 0) { + this.selectList.setFocus([this.selected || 0]); + this.selectList.reveal(this.selectList.getFocus()[0] || 0); + } + if (this._hasDetails) { + this.selectList.getHTMLElement().style.height = listHeight + verticalPadding + "px"; + this.selectDropDownContainer.style.height = ""; + } else { + this.selectDropDownContainer.style.height = listHeight + verticalPadding + "px"; + } + this.updateDetail(this.selected); + this.selectDropDownContainer.style.width = selectOptimalWidth; + this.selectDropDownListContainer.setAttribute("tabindex", "0"); + this.selectElement.classList.add("synthetic-focus"); + this.selectDropDownContainer.classList.add("synthetic-focus"); + return true; + } else { + return false; + } + } + setWidthControlElement(container) { + let elementWidth = 0; + if (container) { + let longest = 0; + let longestLength = 0; + this.options.forEach((option2, index) => { + const detailLength = !!option2.detail ? option2.detail.length : 0; + const rightDecoratorLength = !!option2.decoratorRight ? option2.decoratorRight.length : 0; + const len = option2.text.length + detailLength + rightDecoratorLength; + if (len > longestLength) { + longest = index; + longestLength = len; + } + }); + container.textContent = this.options[longest].text + (!!this.options[longest].decoratorRight ? this.options[longest].decoratorRight + " " : ""); + elementWidth = getTotalWidth(container); + } + return elementWidth; + } + createSelectList(parent) { + if (this.selectList) { + return; + } + this.selectDropDownListContainer = append(parent, $2(".select-box-dropdown-list-container")); + this.listRenderer = new SelectListRenderer(); + this.selectList = this._register(new List("SelectBoxCustom", this.selectDropDownListContainer, this, [this.listRenderer], { + useShadows: false, + verticalScrollMode: 3, + keyboardSupport: false, + mouseSupport: false, + accessibilityProvider: { + getAriaLabel: (element) => { + let label = element.text; + if (element.detail) { + label += `. ${element.detail}`; + } + if (element.decoratorRight) { + label += `. ${element.decoratorRight}`; + } + if (element.description) { + label += `. ${element.description}`; + } + return label; + }, + getWidgetAriaLabel: () => localize(16, "Select Box"), + getRole: () => isMacintosh ? "" : "option", + getWidgetRole: () => "listbox" + } + })); + if (this.selectBoxOptions.ariaLabel) { + this.selectList.ariaLabel = this.selectBoxOptions.ariaLabel; + } + const onKeyDown = this._register(new DomEmitter(this.selectDropDownListContainer, "keydown")); + const onSelectDropDownKeyDown = Event.chain(onKeyDown.event, ($23) => $23.filter(() => this.selectList.length > 0).map((e) => new StandardKeyboardEvent(e))); + this._register(Event.chain(onSelectDropDownKeyDown, ($23) => $23.filter( + (e) => e.keyCode === 3 + /* KeyCode.Enter */ + ))(this.onEnter, this)); + this._register(Event.chain(onSelectDropDownKeyDown, ($23) => $23.filter( + (e) => e.keyCode === 2 + /* KeyCode.Tab */ + ))(this.onEnter, this)); + this._register(Event.chain(onSelectDropDownKeyDown, ($23) => $23.filter( + (e) => e.keyCode === 9 + /* KeyCode.Escape */ + ))(this.onEscape, this)); + this._register(Event.chain(onSelectDropDownKeyDown, ($23) => $23.filter( + (e) => e.keyCode === 16 + /* KeyCode.UpArrow */ + ))(this.onUpArrow, this)); + this._register(Event.chain(onSelectDropDownKeyDown, ($23) => $23.filter( + (e) => e.keyCode === 18 + /* KeyCode.DownArrow */ + ))(this.onDownArrow, this)); + this._register(Event.chain(onSelectDropDownKeyDown, ($23) => $23.filter( + (e) => e.keyCode === 12 + /* KeyCode.PageDown */ + ))(this.onPageDown, this)); + this._register(Event.chain(onSelectDropDownKeyDown, ($23) => $23.filter( + (e) => e.keyCode === 11 + /* KeyCode.PageUp */ + ))(this.onPageUp, this)); + this._register(Event.chain(onSelectDropDownKeyDown, ($23) => $23.filter( + (e) => e.keyCode === 14 + /* KeyCode.Home */ + ))(this.onHome, this)); + this._register(Event.chain(onSelectDropDownKeyDown, ($23) => $23.filter( + (e) => e.keyCode === 13 + /* KeyCode.End */ + ))(this.onEnd, this)); + this._register(Event.chain(onSelectDropDownKeyDown, ($23) => $23.filter((e) => e.keyCode >= 21 && e.keyCode <= 56 || e.keyCode >= 85 && e.keyCode <= 113))(this.onCharacter, this)); + this._register(addDisposableListener(this.selectList.getHTMLElement(), EventType.POINTER_UP, (e) => this.onPointerUp(e))); + this._register(this.selectList.onMouseOver((e) => typeof e.index !== "undefined" && this.selectList.setFocus([e.index]))); + this._register(this.selectList.onDidChangeFocus((e) => this.onListFocus(e))); + this._register(addDisposableListener(this.selectDropDownContainer, EventType.FOCUS_OUT, (e) => { + if (!this._isVisible || isAncestor(e.relatedTarget, this.selectDropDownContainer)) { + return; + } + this.onListBlur(); + })); + this.selectList.getHTMLElement().setAttribute("aria-label", this.selectBoxOptions.ariaLabel || ""); + this.selectList.getHTMLElement().setAttribute("aria-expanded", "true"); + this.styleList(); + } + // List methods + // List mouse controller - active exit, select option, fire onDidSelect if change, return focus to parent select + // Also takes in touchend events + onPointerUp(e) { + if (!this.selectList.length) { + return; + } + EventHelper.stop(e); + const target = e.target; + if (!target) { + return; + } + if (target.classList.contains("slider")) { + return; + } + const listRowElement = target.closest(".monaco-list-row"); + if (!listRowElement) { + return; + } + const index = Number(listRowElement.getAttribute("data-index")); + const disabled = listRowElement.classList.contains("option-disabled"); + if (index >= 0 && index < this.options.length && !disabled) { + this.selected = index; + this.select(this.selected); + this.selectList.setFocus([this.selected]); + this.selectList.reveal(this.selectList.getFocus()[0]); + if (this.selected !== this._currentSelection) { + this._currentSelection = this.selected; + this._onDidSelect.fire({ + index: this.selectElement.selectedIndex, + selected: this.options[this.selected].text + }); + if (!!this.options[this.selected] && !!this.options[this.selected].text) { + this.setTitle(this.options[this.selected].text); + } + } + this.hideSelectDropDown(true); + } + } + // List Exit - passive - implicit no selection change, hide drop-down + onListBlur() { + if (this._sticky) { + return; + } + if (this.selected !== this._currentSelection) { + this.select(this._currentSelection); + } + this.hideSelectDropDown(false); + } + renderDescriptionMarkdown(text2, actionHandler) { + const cleanRenderedMarkdown = (element) => { + for (let i2 = 0; i2 < element.childNodes.length; i2++) { + const child = element.childNodes.item(i2); + const tagName = child.tagName && child.tagName.toLowerCase(); + if (tagName === "img") { + child.remove(); + } else { + cleanRenderedMarkdown(child); + } + } + }; + const rendered = renderMarkdown({ value: text2, supportThemeIcons: true }, { actionHandler }); + rendered.element.classList.add("select-box-description-markdown"); + cleanRenderedMarkdown(rendered.element); + return rendered; + } + // List Focus Change - passive - update details pane with newly focused element's data + onListFocus(e) { + if (!this._isVisible || !this._hasDetails) { + return; + } + this.updateDetail(e.indexes[0]); + } + updateDetail(selectedIndex) { + this._selectionDetailsDisposables.clear(); + this.selectionDetailsPane.textContent = ""; + const option2 = this.options[selectedIndex]; + const description = option2?.description ?? ""; + const descriptionIsMarkdown = option2?.descriptionIsMarkdown ?? false; + if (description) { + if (descriptionIsMarkdown) { + const actionHandler = option2.descriptionMarkdownActionHandler; + const result = this._selectionDetailsDisposables.add(this.renderDescriptionMarkdown(description, actionHandler)); + this.selectionDetailsPane.appendChild(result.element); + } else { + this.selectionDetailsPane.textContent = description; + } + this.selectionDetailsPane.style.display = "block"; + } else { + this.selectionDetailsPane.style.display = "none"; + } + this._skipLayout = true; + this.contextViewProvider.layout(); + this._skipLayout = false; + } + // List keyboard controller + // List exit - active - hide ContextView dropdown, reset selection, return focus to parent select + onEscape(e) { + EventHelper.stop(e); + this.select(this._currentSelection); + this.hideSelectDropDown(true); + } + // List exit - active - hide ContextView dropdown, return focus to parent select, fire onDidSelect if change + onEnter(e) { + EventHelper.stop(e); + if (this.selected !== this._currentSelection) { + this._currentSelection = this.selected; + this._onDidSelect.fire({ + index: this.selectElement.selectedIndex, + selected: this.options[this.selected].text + }); + if (!!this.options[this.selected] && !!this.options[this.selected].text) { + this.setTitle(this.options[this.selected].text); + } + } + this.hideSelectDropDown(true); + } + // List navigation - have to handle a disabled option (jump over) + onDownArrow(e) { + if (this.selected < this.options.length - 1) { + EventHelper.stop(e, true); + const nextOptionDisabled = this.options[this.selected + 1].isDisabled; + if (nextOptionDisabled && this.options.length > this.selected + 2) { + this.selected += 2; + } else if (nextOptionDisabled) { + return; + } else { + this.selected++; + } + this.select(this.selected); + this.selectList.setFocus([this.selected]); + this.selectList.reveal(this.selectList.getFocus()[0]); + } + } + onUpArrow(e) { + if (this.selected > 0) { + EventHelper.stop(e, true); + const previousOptionDisabled = this.options[this.selected - 1].isDisabled; + if (previousOptionDisabled && this.selected > 1) { + this.selected -= 2; + } else { + this.selected--; + } + this.select(this.selected); + this.selectList.setFocus([this.selected]); + this.selectList.reveal(this.selectList.getFocus()[0]); + } + } + onPageUp(e) { + EventHelper.stop(e); + this.selectList.focusPreviousPage(); + setTimeout(() => { + this.selected = this.selectList.getFocus()[0]; + if (this.options[this.selected].isDisabled && this.selected < this.options.length - 1) { + this.selected++; + this.selectList.setFocus([this.selected]); + } + this.selectList.reveal(this.selected); + this.select(this.selected); + }, 1); + } + onPageDown(e) { + EventHelper.stop(e); + this.selectList.focusNextPage(); + setTimeout(() => { + this.selected = this.selectList.getFocus()[0]; + if (this.options[this.selected].isDisabled && this.selected > 0) { + this.selected--; + this.selectList.setFocus([this.selected]); + } + this.selectList.reveal(this.selected); + this.select(this.selected); + }, 1); + } + onHome(e) { + EventHelper.stop(e); + if (this.options.length < 2) { + return; + } + this.selected = 0; + if (this.options[this.selected].isDisabled && this.selected > 1) { + this.selected++; + } + this.selectList.setFocus([this.selected]); + this.selectList.reveal(this.selected); + this.select(this.selected); + } + onEnd(e) { + EventHelper.stop(e); + if (this.options.length < 2) { + return; + } + this.selected = this.options.length - 1; + if (this.options[this.selected].isDisabled && this.selected > 1) { + this.selected--; + } + this.selectList.setFocus([this.selected]); + this.selectList.reveal(this.selected); + this.select(this.selected); + } + // Mimic option first character navigation of native select + onCharacter(e) { + const ch = KeyCodeUtils.toString(e.keyCode); + let optionIndex = -1; + for (let i2 = 0; i2 < this.options.length - 1; i2++) { + optionIndex = (i2 + this.selected + 1) % this.options.length; + if (this.options[optionIndex].text.charAt(0).toUpperCase() === ch && !this.options[optionIndex].isDisabled) { + this.select(optionIndex); + this.selectList.setFocus([optionIndex]); + this.selectList.reveal(this.selectList.getFocus()[0]); + EventHelper.stop(e); + break; + } + } + } + dispose() { + this.hideSelectDropDown(false); + super.dispose(); + } +}; + +// node_modules/monaco-editor-core/esm/vs/base/browser/ui/selectBox/selectBoxNative.js +init_dom(); +init_arrays(); +init_event(); +init_lifecycle(); +init_platform(); +var SelectBoxNative = class extends Disposable { + constructor(options2, selected, styles, selectBoxOptions) { + super(); + this.selected = 0; + this.selectBoxOptions = selectBoxOptions || /* @__PURE__ */ Object.create(null); + this.options = []; + this.selectElement = document.createElement("select"); + this.selectElement.className = "monaco-select-box"; + if (typeof this.selectBoxOptions.ariaLabel === "string") { + this.selectElement.setAttribute("aria-label", this.selectBoxOptions.ariaLabel); + } + if (typeof this.selectBoxOptions.ariaDescription === "string") { + this.selectElement.setAttribute("aria-description", this.selectBoxOptions.ariaDescription); + } + this._onDidSelect = this._register(new Emitter()); + this.styles = styles; + this.registerListeners(); + this.setOptions(options2, selected); + } + registerListeners() { + this._register(Gesture.addTarget(this.selectElement)); + [EventType2.Tap].forEach((eventType) => { + this._register(addDisposableListener(this.selectElement, eventType, (e) => { + this.selectElement.focus(); + })); + }); + this._register(addStandardDisposableListener(this.selectElement, "click", (e) => { + EventHelper.stop(e, true); + })); + this._register(addStandardDisposableListener(this.selectElement, "change", (e) => { + this.selectElement.title = e.target.value; + this._onDidSelect.fire({ + index: e.target.selectedIndex, + selected: e.target.value + }); + })); + this._register(addStandardDisposableListener(this.selectElement, "keydown", (e) => { + let showSelect = false; + if (isMacintosh) { + if (e.keyCode === 18 || e.keyCode === 16 || e.keyCode === 10) { + showSelect = true; + } + } else { + if (e.keyCode === 18 && e.altKey || e.keyCode === 10 || e.keyCode === 3) { + showSelect = true; + } + } + if (showSelect) { + e.stopPropagation(); + } + })); + } + get onDidSelect() { + return this._onDidSelect.event; + } + setOptions(options2, selected) { + if (!this.options || !equals(this.options, options2)) { + this.options = options2; + this.selectElement.options.length = 0; + this.options.forEach((option2, index) => { + this.selectElement.add(this.createOption(option2.text, index, option2.isDisabled)); + }); + } + if (selected !== void 0) { + this.select(selected); + } + } + select(index) { + if (this.options.length === 0) { + this.selected = 0; + } else if (index >= 0 && index < this.options.length) { + this.selected = index; + } else if (index > this.options.length - 1) { + this.select(this.options.length - 1); + } else if (this.selected < 0) { + this.selected = 0; + } + this.selectElement.selectedIndex = this.selected; + if (this.selected < this.options.length && typeof this.options[this.selected].text === "string") { + this.selectElement.title = this.options[this.selected].text; + } else { + this.selectElement.title = ""; + } + } + focus() { + if (this.selectElement) { + this.selectElement.tabIndex = 0; + this.selectElement.focus(); + } + } + blur() { + if (this.selectElement) { + this.selectElement.tabIndex = -1; + this.selectElement.blur(); + } + } + setFocusable(focusable) { + this.selectElement.tabIndex = focusable ? 0 : -1; + } + render(container) { + container.classList.add("select-container"); + container.appendChild(this.selectElement); + this.setOptions(this.options, this.selected); + this.applyStyles(); + } + applyStyles() { + if (this.selectElement) { + this.selectElement.style.backgroundColor = this.styles.selectBackground ?? ""; + this.selectElement.style.color = this.styles.selectForeground ?? ""; + this.selectElement.style.borderColor = this.styles.selectBorder ?? ""; + } + } + createOption(value, index, disabled) { + const option2 = document.createElement("option"); + option2.value = value; + option2.text = value; + option2.disabled = !!disabled; + return option2; + } +}; + +// node_modules/monaco-editor-core/esm/vs/base/browser/ui/selectBox/selectBox.js +var SelectBox = class extends Widget { + constructor(options2, selected, contextViewProvider, styles, selectBoxOptions) { + super(); + if (isMacintosh && !selectBoxOptions?.useCustomDrawn) { + this.selectBoxDelegate = new SelectBoxNative(options2, selected, styles, selectBoxOptions); + } else { + this.selectBoxDelegate = new SelectBoxList(options2, selected, contextViewProvider, styles, selectBoxOptions); + } + this._register(this.selectBoxDelegate); + } + // Public SelectBox Methods - routed through delegate interface + get onDidSelect() { + return this.selectBoxDelegate.onDidSelect; + } + setOptions(options2, selected) { + this.selectBoxDelegate.setOptions(options2, selected); + } + select(index) { + this.selectBoxDelegate.select(index); + } + focus() { + this.selectBoxDelegate.focus(); + } + blur() { + this.selectBoxDelegate.blur(); + } + setFocusable(focusable) { + this.selectBoxDelegate.setFocusable(focusable); + } + render(container) { + this.selectBoxDelegate.render(container); + } +}; + +// node_modules/monaco-editor-core/esm/vs/base/browser/ui/actionbar/actionViewItems.js +init_actions(); +init_lifecycle(); +init_platform(); +init_types(); +init_nls(); +var BaseActionViewItem = class extends Disposable { + get action() { + return this._action; + } + constructor(context, action, options2 = {}) { + super(); + this.options = options2; + this._context = context || this; + this._action = action; + if (action instanceof Action) { + this._register(action.onDidChange((event) => { + if (!this.element) { + return; + } + this.handleActionChangeEvent(event); + })); + } + } + handleActionChangeEvent(event) { + if (event.enabled !== void 0) { + this.updateEnabled(); + } + if (event.checked !== void 0) { + this.updateChecked(); + } + if (event.class !== void 0) { + this.updateClass(); + } + if (event.label !== void 0) { + this.updateLabel(); + this.updateTooltip(); + } + if (event.tooltip !== void 0) { + this.updateTooltip(); + } + } + get actionRunner() { + if (!this._actionRunner) { + this._actionRunner = this._register(new ActionRunner()); + } + return this._actionRunner; + } + set actionRunner(actionRunner) { + this._actionRunner = actionRunner; + } + isEnabled() { + return this._action.enabled; + } + setActionContext(newContext) { + this._context = newContext; + } + render(container) { + const element = this.element = container; + this._register(Gesture.addTarget(container)); + const enableDragging = this.options && this.options.draggable; + if (enableDragging) { + container.draggable = true; + if (isFirefox) { + this._register(addDisposableListener(container, EventType.DRAG_START, (e) => e.dataTransfer?.setData(DataTransfers.TEXT, this._action.label))); + } + } + this._register(addDisposableListener(element, EventType2.Tap, (e) => this.onClick(e, true))); + this._register(addDisposableListener(element, EventType.MOUSE_DOWN, (e) => { + if (!enableDragging) { + EventHelper.stop(e, true); + } + if (this._action.enabled && e.button === 0) { + element.classList.add("active"); + } + })); + if (isMacintosh) { + this._register(addDisposableListener(element, EventType.CONTEXT_MENU, (e) => { + if (e.button === 0 && e.ctrlKey === true) { + this.onClick(e); + } + })); + } + this._register(addDisposableListener(element, EventType.CLICK, (e) => { + EventHelper.stop(e, true); + if (!(this.options && this.options.isMenu)) { + this.onClick(e); + } + })); + this._register(addDisposableListener(element, EventType.DBLCLICK, (e) => { + EventHelper.stop(e, true); + })); + [EventType.MOUSE_UP, EventType.MOUSE_OUT].forEach((event) => { + this._register(addDisposableListener(element, event, (e) => { + EventHelper.stop(e); + element.classList.remove("active"); + })); + }); + } + onClick(event, preserveFocus = false) { + EventHelper.stop(event, true); + const context = isUndefinedOrNull(this._context) ? this.options?.useEventAsContext ? event : { preserveFocus } : this._context; + this.actionRunner.run(this._action, context); + } + // Only set the tabIndex on the element once it is about to get focused + // That way this element wont be a tab stop when it is not needed #106441 + focus() { + if (this.element) { + this.element.tabIndex = 0; + this.element.focus(); + this.element.classList.add("focused"); + } + } + blur() { + if (this.element) { + this.element.blur(); + this.element.tabIndex = -1; + this.element.classList.remove("focused"); + } + } + setFocusable(focusable) { + if (this.element) { + this.element.tabIndex = focusable ? 0 : -1; + } + } + get trapsArrowNavigation() { + return false; + } + updateEnabled() { + } + updateLabel() { + } + getClass() { + return this.action.class; + } + getTooltip() { + return this.action.tooltip; + } + getHoverContents() { + return this.getTooltip(); + } + updateTooltip() { + if (!this.element) { + return; + } + const title = this.getHoverContents() ?? ""; + this.updateAriaLabel(); + if (!this.customHover && title !== "") { + const hoverDelegate = this.options.hoverDelegate ?? getDefaultHoverDelegate("element"); + this.customHover = this._store.add(getBaseLayerHoverDelegate().setupManagedHover(hoverDelegate, this.element, title)); + } else if (this.customHover) { + this.customHover.update(title); + } + } + updateAriaLabel() { + if (this.element) { + const title = this.getTooltip() ?? ""; + this.element.setAttribute("aria-label", title); + } + } + updateClass() { + } + updateChecked() { + } + dispose() { + if (this.element) { + this.element.remove(); + this.element = void 0; + } + this._context = void 0; + super.dispose(); + } +}; +var ActionViewItem = class extends BaseActionViewItem { + constructor(context, action, options2) { + options2 = { + ...options2, + icon: options2.icon !== void 0 ? options2.icon : false, + label: options2.label !== void 0 ? options2.label : true + }; + super(context, action, options2); + this.options = options2; + this.cssClass = ""; + } + render(container) { + super.render(container); + assertType(this.element); + const label = document.createElement("a"); + label.classList.add("action-label"); + label.setAttribute("role", this.getDefaultAriaRole()); + this.label = label; + this.element.appendChild(label); + if (this.options.label && this.options.keybinding && !this.options.keybindingNotRenderedWithLabel) { + const kbLabel = document.createElement("span"); + kbLabel.classList.add("keybinding"); + kbLabel.textContent = this.options.keybinding; + this.element.appendChild(kbLabel); + } + this.updateClass(); + this.updateLabel(); + this.updateTooltip(); + this.updateEnabled(); + this.updateChecked(); + } + getDefaultAriaRole() { + if (this._action.id === Separator.ID) { + return "presentation"; + } else { + if (this.options.isMenu) { + return "menuitem"; + } else if (this.options.isTabList) { + return "tab"; + } else { + return "button"; + } + } + } + // Only set the tabIndex on the element once it is about to get focused + // That way this element wont be a tab stop when it is not needed #106441 + focus() { + if (this.label) { + this.label.tabIndex = 0; + this.label.focus(); + } + } + blur() { + if (this.label) { + this.label.tabIndex = -1; + } + } + setFocusable(focusable) { + if (this.label) { + this.label.tabIndex = focusable ? 0 : -1; + } + } + updateLabel() { + if (this.options.label && this.label) { + this.label.textContent = this.action.label; + } + } + getTooltip() { + let title = null; + if (this.action.tooltip) { + title = this.action.tooltip; + } else if (this.action.label) { + title = this.action.label; + if (this.options.keybinding) { + title = localize(0, "{0} ({1})", title, this.options.keybinding); + } + } + return title ?? void 0; + } + updateClass() { + if (this.cssClass && this.label) { + this.label.classList.remove(...this.cssClass.split(" ")); + } + if (this.options.icon) { + this.cssClass = this.getClass(); + if (this.label) { + this.label.classList.add("codicon"); + if (this.cssClass) { + this.label.classList.add(...this.cssClass.split(" ")); + } + } + this.updateEnabled(); + } else { + this.label?.classList.remove("codicon"); + } + } + updateEnabled() { + if (this.action.enabled) { + if (this.label) { + this.label.removeAttribute("aria-disabled"); + this.label.classList.remove("disabled"); + } + this.element?.classList.remove("disabled"); + } else { + if (this.label) { + this.label.setAttribute("aria-disabled", "true"); + this.label.classList.add("disabled"); + } + this.element?.classList.add("disabled"); + } + } + updateAriaLabel() { + if (this.label) { + const title = this.getTooltip() ?? ""; + this.label.setAttribute("aria-label", title); + } + } + updateChecked() { + if (this.label) { + if (this.action.checked !== void 0) { + this.label.classList.toggle("checked", this.action.checked); + if (this.options.isTabList) { + this.label.setAttribute("aria-selected", this.action.checked ? "true" : "false"); + } else { + this.label.setAttribute("aria-checked", this.action.checked ? "true" : "false"); + this.label.setAttribute("role", "checkbox"); + } + } else { + this.label.classList.remove("checked"); + this.label.removeAttribute(this.options.isTabList ? "aria-selected" : "aria-checked"); + this.label.setAttribute("role", this.getDefaultAriaRole()); + } + } + } +}; +var SelectActionViewItem = class extends BaseActionViewItem { + constructor(ctx, action, options2, selected, contextViewProvider, styles, selectBoxOptions) { + super(ctx, action); + this.selectBox = new SelectBox(options2, selected, contextViewProvider, styles, selectBoxOptions); + this.selectBox.setFocusable(false); + this._register(this.selectBox); + this.registerListeners(); + } + select(index) { + this.selectBox.select(index); + } + registerListeners() { + this._register(this.selectBox.onDidSelect((e) => this.runAction(e.selected, e.index))); + } + runAction(option2, index) { + this.actionRunner.run(this._action, this.getActionContext(option2, index)); + } + getActionContext(option2, index) { + return option2; + } + setFocusable(focusable) { + this.selectBox.setFocusable(focusable); + } + focus() { + this.selectBox?.focus(); + } + blur() { + this.selectBox?.blur(); + } + render(container) { + this.selectBox.render(container); + } +}; + +// node_modules/monaco-editor-core/esm/vs/base/browser/ui/actionbar/actionbar.js +init_actions(); +init_event(); +init_lifecycle(); +init_types(); +var ActionBar = class extends Disposable { + get onDidBlur() { + return this._onDidBlur.event; + } + get onDidCancel() { + return this._onDidCancel.event; + } + get onDidRun() { + return this._onDidRun.event; + } + get onWillRun() { + return this._onWillRun.event; + } + constructor(container, options2 = {}) { + super(); + this._actionRunnerDisposables = this._register(new DisposableStore()); + this.viewItemDisposables = this._register(new DisposableMap()); + this.triggerKeyDown = false; + this.focusable = true; + this._onDidBlur = this._register(new Emitter()); + this._onDidCancel = this._register(new Emitter({ onWillAddFirstListener: () => this.cancelHasListener = true })); + this.cancelHasListener = false; + this._onDidRun = this._register(new Emitter()); + this._onWillRun = this._register(new Emitter()); + this.options = options2; + this._context = options2.context ?? null; + this._orientation = this.options.orientation ?? 0; + this._triggerKeys = { + keyDown: this.options.triggerKeys?.keyDown ?? false, + keys: this.options.triggerKeys?.keys ?? [ + 3, + 10 + /* KeyCode.Space */ + ] + }; + this._hoverDelegate = options2.hoverDelegate ?? this._register(createInstantHoverDelegate()); + if (this.options.actionRunner) { + this._actionRunner = this.options.actionRunner; + } else { + this._actionRunner = new ActionRunner(); + this._actionRunnerDisposables.add(this._actionRunner); + } + this._actionRunnerDisposables.add(this._actionRunner.onDidRun((e) => this._onDidRun.fire(e))); + this._actionRunnerDisposables.add(this._actionRunner.onWillRun((e) => this._onWillRun.fire(e))); + this.viewItems = []; + this.focusedItem = void 0; + this.domNode = document.createElement("div"); + this.domNode.className = "monaco-action-bar"; + let previousKeys; + let nextKeys; + switch (this._orientation) { + case 0: + previousKeys = [ + 15 + /* KeyCode.LeftArrow */ + ]; + nextKeys = [ + 17 + /* KeyCode.RightArrow */ + ]; + break; + case 1: + previousKeys = [ + 16 + /* KeyCode.UpArrow */ + ]; + nextKeys = [ + 18 + /* KeyCode.DownArrow */ + ]; + this.domNode.className += " vertical"; + break; + } + this._register(addDisposableListener(this.domNode, EventType.KEY_DOWN, (e) => { + const event = new StandardKeyboardEvent(e); + let eventHandled = true; + const focusedItem = typeof this.focusedItem === "number" ? this.viewItems[this.focusedItem] : void 0; + if (previousKeys && (event.equals(previousKeys[0]) || event.equals(previousKeys[1]))) { + eventHandled = this.focusPrevious(); + } else if (nextKeys && (event.equals(nextKeys[0]) || event.equals(nextKeys[1]))) { + eventHandled = this.focusNext(); + } else if (event.equals( + 9 + /* KeyCode.Escape */ + ) && this.cancelHasListener) { + this._onDidCancel.fire(); + } else if (event.equals( + 14 + /* KeyCode.Home */ + )) { + eventHandled = this.focusFirst(); + } else if (event.equals( + 13 + /* KeyCode.End */ + )) { + eventHandled = this.focusLast(); + } else if (event.equals( + 2 + /* KeyCode.Tab */ + ) && focusedItem instanceof BaseActionViewItem && focusedItem.trapsArrowNavigation) { + eventHandled = this.focusNext(void 0, true); + } else if (this.isTriggerKeyEvent(event)) { + if (this._triggerKeys.keyDown) { + this.doTrigger(event); + } else { + this.triggerKeyDown = true; + } + } else { + eventHandled = false; + } + if (eventHandled) { + event.preventDefault(); + event.stopPropagation(); + } + })); + this._register(addDisposableListener(this.domNode, EventType.KEY_UP, (e) => { + const event = new StandardKeyboardEvent(e); + if (this.isTriggerKeyEvent(event)) { + if (!this._triggerKeys.keyDown && this.triggerKeyDown) { + this.triggerKeyDown = false; + this.doTrigger(event); + } + event.preventDefault(); + event.stopPropagation(); + } else if (event.equals( + 2 + /* KeyCode.Tab */ + ) || event.equals( + 1024 | 2 + /* KeyCode.Tab */ + ) || event.equals( + 16 + /* KeyCode.UpArrow */ + ) || event.equals( + 18 + /* KeyCode.DownArrow */ + ) || event.equals( + 15 + /* KeyCode.LeftArrow */ + ) || event.equals( + 17 + /* KeyCode.RightArrow */ + )) { + this.updateFocusedItem(); + } + })); + this.focusTracker = this._register(trackFocus(this.domNode)); + this._register(this.focusTracker.onDidBlur(() => { + if (getActiveElement() === this.domNode || !isAncestor(getActiveElement(), this.domNode)) { + this._onDidBlur.fire(); + this.previouslyFocusedItem = this.focusedItem; + this.focusedItem = void 0; + this.triggerKeyDown = false; + } + })); + this._register(this.focusTracker.onDidFocus(() => this.updateFocusedItem())); + this.actionsList = document.createElement("ul"); + this.actionsList.className = "actions-container"; + if (this.options.highlightToggledItems) { + this.actionsList.classList.add("highlight-toggled"); + } + this.actionsList.setAttribute("role", this.options.ariaRole || "toolbar"); + if (this.options.ariaLabel) { + this.actionsList.setAttribute("aria-label", this.options.ariaLabel); + } + this.domNode.appendChild(this.actionsList); + container.appendChild(this.domNode); + } + refreshRole() { + if (this.length() >= 1) { + this.actionsList.setAttribute("role", this.options.ariaRole || "toolbar"); + } else { + this.actionsList.setAttribute("role", "presentation"); + } + } + // Some action bars should not be focusable at times + // When an action bar is not focusable make sure to make all the elements inside it not focusable + // When an action bar is focusable again, make sure the first item can be focused + setFocusable(focusable) { + this.focusable = focusable; + if (this.focusable) { + const firstEnabled = this.viewItems.find((vi) => vi instanceof BaseActionViewItem && vi.isEnabled()); + if (firstEnabled instanceof BaseActionViewItem) { + firstEnabled.setFocusable(true); + } + } else { + this.viewItems.forEach((vi) => { + if (vi instanceof BaseActionViewItem) { + vi.setFocusable(false); + } + }); + } + } + isTriggerKeyEvent(event) { + let ret = false; + this._triggerKeys.keys.forEach((keyCode) => { + ret = ret || event.equals(keyCode); + }); + return ret; + } + updateFocusedItem() { + for (let i2 = 0; i2 < this.actionsList.children.length; i2++) { + const elem = this.actionsList.children[i2]; + if (isAncestor(getActiveElement(), elem)) { + this.focusedItem = i2; + this.viewItems[this.focusedItem]?.showHover?.(); + break; + } + } + } + get context() { + return this._context; + } + set context(context) { + this._context = context; + this.viewItems.forEach((i2) => i2.setActionContext(context)); + } + get actionRunner() { + return this._actionRunner; + } + set actionRunner(actionRunner) { + this._actionRunner = actionRunner; + this._actionRunnerDisposables.clear(); + this._actionRunnerDisposables.add(this._actionRunner.onDidRun((e) => this._onDidRun.fire(e))); + this._actionRunnerDisposables.add(this._actionRunner.onWillRun((e) => this._onWillRun.fire(e))); + this.viewItems.forEach((item) => item.actionRunner = actionRunner); + } + getContainer() { + return this.domNode; + } + getAction(indexOrElement) { + if (typeof indexOrElement === "number") { + return this.viewItems[indexOrElement]?.action; + } + if (isHTMLElement(indexOrElement)) { + while (indexOrElement.parentElement !== this.actionsList) { + if (!indexOrElement.parentElement) { + return void 0; + } + indexOrElement = indexOrElement.parentElement; + } + for (let i2 = 0; i2 < this.actionsList.childNodes.length; i2++) { + if (this.actionsList.childNodes[i2] === indexOrElement) { + return this.viewItems[i2].action; + } + } + } + return void 0; + } + push(arg, options2 = {}) { + const actions = Array.isArray(arg) ? arg : [arg]; + let index = isNumber(options2.index) ? options2.index : null; + actions.forEach((action) => { + const actionViewItemElement = document.createElement("li"); + actionViewItemElement.className = "action-item"; + actionViewItemElement.setAttribute("role", "presentation"); + let item; + const viewItemOptions = { hoverDelegate: this._hoverDelegate, ...options2, isTabList: this.options.ariaRole === "tablist" }; + if (this.options.actionViewItemProvider) { + item = this.options.actionViewItemProvider(action, viewItemOptions); + } + if (!item) { + item = new ActionViewItem(this.context, action, viewItemOptions); + } + if (!this.options.allowContextMenu) { + this.viewItemDisposables.set(item, addDisposableListener(actionViewItemElement, EventType.CONTEXT_MENU, (e) => { + EventHelper.stop(e, true); + })); + } + item.actionRunner = this._actionRunner; + item.setActionContext(this.context); + item.render(actionViewItemElement); + if (index === null || index < 0 || index >= this.actionsList.children.length) { + this.actionsList.appendChild(actionViewItemElement); + this.viewItems.push(item); + } else { + this.actionsList.insertBefore(actionViewItemElement, this.actionsList.children[index]); + this.viewItems.splice(index, 0, item); + index++; + } + }); + if (this.focusable) { + let didFocus = false; + for (const item of this.viewItems) { + if (!(item instanceof BaseActionViewItem)) { + continue; + } + let focus; + if (didFocus) { + focus = false; + } else if (item.action.id === Separator.ID) { + focus = false; + } else if (!item.isEnabled() && this.options.focusOnlyEnabledItems) { + focus = false; + } else { + focus = true; + } + if (focus) { + item.setFocusable(true); + didFocus = true; + } else { + item.setFocusable(false); + } + } + } + if (typeof this.focusedItem === "number") { + this.focus(this.focusedItem); + } + this.refreshRole(); + } + getWidth(index) { + if (index >= 0 && index < this.actionsList.children.length) { + const item = this.actionsList.children.item(index); + if (item) { + return item.clientWidth; + } + } + return 0; + } + pull(index) { + if (index >= 0 && index < this.viewItems.length) { + this.actionsList.childNodes[index].remove(); + this.viewItemDisposables.deleteAndDispose(this.viewItems[index]); + dispose(this.viewItems.splice(index, 1)); + this.refreshRole(); + } + } + clear() { + if (this.isEmpty()) { + return; + } + this.viewItems = dispose(this.viewItems); + this.viewItemDisposables.clearAndDisposeAll(); + clearNode(this.actionsList); + this.refreshRole(); + } + length() { + return this.viewItems.length; + } + isEmpty() { + return this.viewItems.length === 0; + } + focus(arg) { + let selectFirst = false; + let index = void 0; + if (arg === void 0) { + selectFirst = true; + } else if (typeof arg === "number") { + index = arg; + } else if (typeof arg === "boolean") { + selectFirst = arg; + } + if (selectFirst && typeof this.focusedItem === "undefined") { + const firstEnabled = this.viewItems.findIndex((item) => item.isEnabled()); + this.focusedItem = firstEnabled === -1 ? void 0 : firstEnabled; + this.updateFocus(void 0, void 0, true); + } else { + if (index !== void 0) { + this.focusedItem = index; + } + this.updateFocus(void 0, void 0, true); + } + } + focusFirst() { + this.focusedItem = this.length() - 1; + return this.focusNext(true); + } + focusLast() { + this.focusedItem = 0; + return this.focusPrevious(true); + } + focusNext(forceLoop, forceFocus) { + if (typeof this.focusedItem === "undefined") { + this.focusedItem = this.viewItems.length - 1; + } else if (this.viewItems.length <= 1) { + return false; + } + const startIndex = this.focusedItem; + let item; + do { + if (!forceLoop && this.options.preventLoopNavigation && this.focusedItem + 1 >= this.viewItems.length) { + this.focusedItem = startIndex; + return false; + } + this.focusedItem = (this.focusedItem + 1) % this.viewItems.length; + item = this.viewItems[this.focusedItem]; + } while (this.focusedItem !== startIndex && (this.options.focusOnlyEnabledItems && !item.isEnabled() || item.action.id === Separator.ID)); + this.updateFocus(void 0, void 0, forceFocus); + return true; + } + focusPrevious(forceLoop) { + if (typeof this.focusedItem === "undefined") { + this.focusedItem = 0; + } else if (this.viewItems.length <= 1) { + return false; + } + const startIndex = this.focusedItem; + let item; + do { + this.focusedItem = this.focusedItem - 1; + if (this.focusedItem < 0) { + if (!forceLoop && this.options.preventLoopNavigation) { + this.focusedItem = startIndex; + return false; + } + this.focusedItem = this.viewItems.length - 1; + } + item = this.viewItems[this.focusedItem]; + } while (this.focusedItem !== startIndex && (this.options.focusOnlyEnabledItems && !item.isEnabled() || item.action.id === Separator.ID)); + this.updateFocus(true); + return true; + } + updateFocus(fromRight, preventScroll, forceFocus = false) { + if (typeof this.focusedItem === "undefined") { + this.actionsList.focus({ preventScroll }); + } + if (this.previouslyFocusedItem !== void 0 && this.previouslyFocusedItem !== this.focusedItem) { + this.viewItems[this.previouslyFocusedItem]?.blur(); + } + const actionViewItem = this.focusedItem !== void 0 ? this.viewItems[this.focusedItem] : void 0; + if (actionViewItem) { + let focusItem = true; + if (!isFunction(actionViewItem.focus)) { + focusItem = false; + } + if (this.options.focusOnlyEnabledItems && isFunction(actionViewItem.isEnabled) && !actionViewItem.isEnabled()) { + focusItem = false; + } + if (actionViewItem.action.id === Separator.ID) { + focusItem = false; + } + if (!focusItem) { + this.actionsList.focus({ preventScroll }); + this.previouslyFocusedItem = void 0; + } else if (forceFocus || this.previouslyFocusedItem !== this.focusedItem) { + actionViewItem.focus(fromRight); + this.previouslyFocusedItem = this.focusedItem; + } + if (focusItem) { + actionViewItem.showHover?.(); + } + } + } + doTrigger(event) { + if (typeof this.focusedItem === "undefined") { + return; + } + const actionViewItem = this.viewItems[this.focusedItem]; + if (actionViewItem instanceof BaseActionViewItem) { + const context = actionViewItem._context === null || actionViewItem._context === void 0 ? event : actionViewItem._context; + this.run(actionViewItem._action, context); + } + } + async run(action, context) { + await this._actionRunner.run(action, context); + } + dispose() { + this._context = void 0; + this.viewItems = dispose(this.viewItems); + this.getContainer().remove(); + super.dispose(); + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/browser/widget/diffEditor/components/accessibleDiffViewer.js +init_arrays(); +init_codicons(); +init_lifecycle(); +init_observable(); +init_themables(); +init_utils5(); +init_lineRange(); +init_offsetRange(); +init_position(); +init_range(); + +// node_modules/monaco-editor-core/esm/vs/editor/common/diff/rangeMapping.js +init_arrays(); +init_assert(); +init_errors(); +init_lineRange(); +init_position(); +init_range(); +var LineRangeMapping = class _LineRangeMapping { + static inverse(mapping, originalLineCount, modifiedLineCount) { + const result = []; + let lastOriginalEndLineNumber = 1; + let lastModifiedEndLineNumber = 1; + for (const m of mapping) { + const r2 = new _LineRangeMapping(new LineRange(lastOriginalEndLineNumber, m.original.startLineNumber), new LineRange(lastModifiedEndLineNumber, m.modified.startLineNumber)); + if (!r2.modified.isEmpty) { + result.push(r2); + } + lastOriginalEndLineNumber = m.original.endLineNumberExclusive; + lastModifiedEndLineNumber = m.modified.endLineNumberExclusive; + } + const r = new _LineRangeMapping(new LineRange(lastOriginalEndLineNumber, originalLineCount + 1), new LineRange(lastModifiedEndLineNumber, modifiedLineCount + 1)); + if (!r.modified.isEmpty) { + result.push(r); + } + return result; + } + static clip(mapping, originalRange, modifiedRange) { + const result = []; + for (const m of mapping) { + const original = m.original.intersect(originalRange); + const modified = m.modified.intersect(modifiedRange); + if (original && !original.isEmpty && modified && !modified.isEmpty) { + result.push(new _LineRangeMapping(original, modified)); + } + } + return result; + } + constructor(originalRange, modifiedRange) { + this.original = originalRange; + this.modified = modifiedRange; + } + toString() { + return `{${this.original.toString()}->${this.modified.toString()}}`; + } + flip() { + return new _LineRangeMapping(this.modified, this.original); + } + join(other) { + return new _LineRangeMapping(this.original.join(other.original), this.modified.join(other.modified)); + } + /** + * This method assumes that the LineRangeMapping describes a valid diff! + * I.e. if one range is empty, the other range cannot be the entire document. + * It avoids various problems when the line range points to non-existing line-numbers. + */ + toRangeMapping() { + const origInclusiveRange = this.original.toInclusiveRange(); + const modInclusiveRange = this.modified.toInclusiveRange(); + if (origInclusiveRange && modInclusiveRange) { + return new RangeMapping(origInclusiveRange, modInclusiveRange); + } else if (this.original.startLineNumber === 1 || this.modified.startLineNumber === 1) { + if (!(this.modified.startLineNumber === 1 && this.original.startLineNumber === 1)) { + throw new BugIndicatingError("not a valid diff"); + } + return new RangeMapping(new Range(this.original.startLineNumber, 1, this.original.endLineNumberExclusive, 1), new Range(this.modified.startLineNumber, 1, this.modified.endLineNumberExclusive, 1)); + } else { + return new RangeMapping(new Range(this.original.startLineNumber - 1, Number.MAX_SAFE_INTEGER, this.original.endLineNumberExclusive - 1, Number.MAX_SAFE_INTEGER), new Range(this.modified.startLineNumber - 1, Number.MAX_SAFE_INTEGER, this.modified.endLineNumberExclusive - 1, Number.MAX_SAFE_INTEGER)); + } + } + /** + * This method assumes that the LineRangeMapping describes a valid diff! + * I.e. if one range is empty, the other range cannot be the entire document. + * It avoids various problems when the line range points to non-existing line-numbers. + */ + toRangeMapping2(original, modified) { + if (isValidLineNumber(this.original.endLineNumberExclusive, original) && isValidLineNumber(this.modified.endLineNumberExclusive, modified)) { + return new RangeMapping(new Range(this.original.startLineNumber, 1, this.original.endLineNumberExclusive, 1), new Range(this.modified.startLineNumber, 1, this.modified.endLineNumberExclusive, 1)); + } + if (!this.original.isEmpty && !this.modified.isEmpty) { + return new RangeMapping(Range.fromPositions(new Position(this.original.startLineNumber, 1), normalizePosition(new Position(this.original.endLineNumberExclusive - 1, Number.MAX_SAFE_INTEGER), original)), Range.fromPositions(new Position(this.modified.startLineNumber, 1), normalizePosition(new Position(this.modified.endLineNumberExclusive - 1, Number.MAX_SAFE_INTEGER), modified))); + } + if (this.original.startLineNumber > 1 && this.modified.startLineNumber > 1) { + return new RangeMapping(Range.fromPositions(normalizePosition(new Position(this.original.startLineNumber - 1, Number.MAX_SAFE_INTEGER), original), normalizePosition(new Position(this.original.endLineNumberExclusive - 1, Number.MAX_SAFE_INTEGER), original)), Range.fromPositions(normalizePosition(new Position(this.modified.startLineNumber - 1, Number.MAX_SAFE_INTEGER), modified), normalizePosition(new Position(this.modified.endLineNumberExclusive - 1, Number.MAX_SAFE_INTEGER), modified))); + } + throw new BugIndicatingError(); + } +}; +function normalizePosition(position, content) { + if (position.lineNumber < 1) { + return new Position(1, 1); + } + if (position.lineNumber > content.length) { + return new Position(content.length, content[content.length - 1].length + 1); + } + const line = content[position.lineNumber - 1]; + if (position.column > line.length + 1) { + return new Position(position.lineNumber, line.length + 1); + } + return position; +} +function isValidLineNumber(lineNumber, lines) { + return lineNumber >= 1 && lineNumber <= lines.length; +} +var DetailedLineRangeMapping = class _DetailedLineRangeMapping extends LineRangeMapping { + static fromRangeMappings(rangeMappings) { + const originalRange = LineRange.join(rangeMappings.map((r) => LineRange.fromRangeInclusive(r.originalRange))); + const modifiedRange = LineRange.join(rangeMappings.map((r) => LineRange.fromRangeInclusive(r.modifiedRange))); + return new _DetailedLineRangeMapping(originalRange, modifiedRange, rangeMappings); + } + constructor(originalRange, modifiedRange, innerChanges) { + super(originalRange, modifiedRange); + this.innerChanges = innerChanges; + } + flip() { + return new _DetailedLineRangeMapping(this.modified, this.original, this.innerChanges?.map((c) => c.flip())); + } + withInnerChangesFromLineRanges() { + return new _DetailedLineRangeMapping(this.original, this.modified, [this.toRangeMapping()]); + } +}; +var RangeMapping = class _RangeMapping { + static fromEdit(edit2) { + const newRanges = edit2.getNewRanges(); + const result = edit2.replacements.map((e, idx) => new _RangeMapping(e.range, newRanges[idx])); + return result; + } + static assertSorted(rangeMappings) { + for (let i2 = 1; i2 < rangeMappings.length; i2++) { + const previous = rangeMappings[i2 - 1]; + const current = rangeMappings[i2]; + if (!(previous.originalRange.getEndPosition().isBeforeOrEqual(current.originalRange.getStartPosition()) && previous.modifiedRange.getEndPosition().isBeforeOrEqual(current.modifiedRange.getStartPosition()))) { + throw new BugIndicatingError("Range mappings must be sorted"); + } + } + } + constructor(originalRange, modifiedRange) { + this.originalRange = originalRange; + this.modifiedRange = modifiedRange; + } + toString() { + return `{${this.originalRange.toString()}->${this.modifiedRange.toString()}}`; + } + flip() { + return new _RangeMapping(this.modifiedRange, this.originalRange); + } + /** + * Creates a single text edit that describes the change from the original to the modified text. + */ + toTextEdit(modified) { + const newText = modified.getValueOfRange(this.modifiedRange); + return new TextReplacement(this.originalRange, newText); + } +}; +function lineRangeMappingFromRangeMappings(alignments, originalLines, modifiedLines, dontAssertStartLine = false) { + const changes = []; + for (const g of groupAdjacentBy(alignments.map((a) => getLineRangeMapping(a, originalLines, modifiedLines)), (a1, a2) => a1.original.intersectsOrTouches(a2.original) || a1.modified.intersectsOrTouches(a2.modified))) { + const first2 = g[0]; + const last = g[g.length - 1]; + changes.push(new DetailedLineRangeMapping(first2.original.join(last.original), first2.modified.join(last.modified), g.map((a) => a.innerChanges[0]))); + } + assertFn(() => { + if (!dontAssertStartLine && changes.length > 0) { + if (changes[0].modified.startLineNumber !== changes[0].original.startLineNumber) { + return false; + } + if (modifiedLines.length.lineCount - changes[changes.length - 1].modified.endLineNumberExclusive !== originalLines.length.lineCount - changes[changes.length - 1].original.endLineNumberExclusive) { + return false; + } + } + return checkAdjacentItems(changes, (m1, m2) => m2.original.startLineNumber - m1.original.endLineNumberExclusive === m2.modified.startLineNumber - m1.modified.endLineNumberExclusive && // There has to be an unchanged line in between (otherwise both diffs should have been joined) + m1.original.endLineNumberExclusive < m2.original.startLineNumber && m1.modified.endLineNumberExclusive < m2.modified.startLineNumber); + }); + return changes; +} +function getLineRangeMapping(rangeMapping, originalLines, modifiedLines) { + let lineStartDelta = 0; + let lineEndDelta = 0; + if (rangeMapping.modifiedRange.endColumn === 1 && rangeMapping.originalRange.endColumn === 1 && rangeMapping.originalRange.startLineNumber + lineStartDelta <= rangeMapping.originalRange.endLineNumber && rangeMapping.modifiedRange.startLineNumber + lineStartDelta <= rangeMapping.modifiedRange.endLineNumber) { + lineEndDelta = -1; + } + if (rangeMapping.modifiedRange.startColumn - 1 >= modifiedLines.getLineLength(rangeMapping.modifiedRange.startLineNumber) && rangeMapping.originalRange.startColumn - 1 >= originalLines.getLineLength(rangeMapping.originalRange.startLineNumber) && rangeMapping.originalRange.startLineNumber <= rangeMapping.originalRange.endLineNumber + lineEndDelta && rangeMapping.modifiedRange.startLineNumber <= rangeMapping.modifiedRange.endLineNumber + lineEndDelta) { + lineStartDelta = 1; + } + const originalLineRange = new LineRange(rangeMapping.originalRange.startLineNumber + lineStartDelta, rangeMapping.originalRange.endLineNumber + 1 + lineEndDelta); + const modifiedLineRange = new LineRange(rangeMapping.modifiedRange.startLineNumber + lineStartDelta, rangeMapping.modifiedRange.endLineNumber + 1 + lineEndDelta); + return new DetailedLineRangeMapping(originalLineRange, modifiedLineRange, [rangeMapping]); +} + +// node_modules/monaco-editor-core/esm/vs/editor/browser/widget/diffEditor/components/accessibleDiffViewer.js +init_language(); +init_lineTokens(); +init_nls(); +init_instantiation(); + +// node_modules/monaco-editor-core/esm/vs/platform/theme/common/iconRegistry.js +init_async(); +init_codicons(); +init_codiconsUtil(); +init_themables(); +init_event(); +init_types(); +init_uri(); +init_nls(); +init_jsonContributionRegistry(); +init_platform2(); +init_lifecycle(); +var Extensions8 = { + IconContribution: "base.contributions.icons" +}; +var IconContribution; +(function(IconContribution2) { + function getDefinition(contribution, registry) { + let definition = contribution.defaults; + while (ThemeIcon.isThemeIcon(definition)) { + const c = iconRegistry.getIcon(definition.id); + if (!c) { + return void 0; + } + definition = c.defaults; + } + return definition; + } + IconContribution2.getDefinition = getDefinition; +})(IconContribution || (IconContribution = {})); +var IconFontDefinition; +(function(IconFontDefinition2) { + function toJSONObject(iconFont) { + return { + weight: iconFont.weight, + style: iconFont.style, + src: iconFont.src.map((s) => ({ format: s.format, location: s.location.toString() })) + }; + } + IconFontDefinition2.toJSONObject = toJSONObject; + function fromJSONObject(json) { + const stringOrUndef = (s) => isString(s) ? s : void 0; + if (json && Array.isArray(json.src) && json.src.every((s) => isString(s.format) && isString(s.location))) { + return { + weight: stringOrUndef(json.weight), + style: stringOrUndef(json.style), + src: json.src.map((s) => ({ format: s.format, location: URI.parse(s.location) })) + }; + } + return void 0; + } + IconFontDefinition2.fromJSONObject = fromJSONObject; +})(IconFontDefinition || (IconFontDefinition = {})); +var fontIdRegex = /^([\w_-]+)$/; +var fontIdErrorMessage = localize(2024, "The font ID must only contain letters, numbers, underscores and dashes."); +var IconRegistry = class extends Disposable { + constructor() { + super(); + this._onDidChange = this._register(new Emitter()); + this.onDidChange = this._onDidChange.event; + this.iconSchema = { + definitions: { + icons: { + type: "object", + properties: { + fontId: { type: "string", description: localize(2025, "The id of the font to use. If not set, the font that is defined first is used."), pattern: fontIdRegex.source, patternErrorMessage: fontIdErrorMessage }, + fontCharacter: { type: "string", description: localize(2026, "The font character associated with the icon definition.") } + }, + additionalProperties: false, + defaultSnippets: [{ body: { fontCharacter: "\\\\e030" } }] + } + }, + type: "object", + properties: {} + }; + this.iconReferenceSchema = { type: "string", pattern: `^${ThemeIcon.iconNameExpression}$`, enum: [], enumDescriptions: [] }; + this.iconsById = {}; + this.iconFontsById = {}; + } + registerIcon(id, defaults, description, deprecationMessage) { + const existing = this.iconsById[id]; + if (existing) { + if (description && !existing.description) { + existing.description = description; + this.iconSchema.properties[id].markdownDescription = `${description} $(${id})`; + const enumIndex = this.iconReferenceSchema.enum.indexOf(id); + if (enumIndex !== -1) { + this.iconReferenceSchema.enumDescriptions[enumIndex] = description; + } + this._onDidChange.fire(); + } + return existing; + } + const iconContribution = { id, description, defaults, deprecationMessage }; + this.iconsById[id] = iconContribution; + const propertySchema = { $ref: "#/definitions/icons" }; + if (deprecationMessage) { + propertySchema.deprecationMessage = deprecationMessage; + } + if (description) { + propertySchema.markdownDescription = `${description}: $(${id})`; + } + this.iconSchema.properties[id] = propertySchema; + this.iconReferenceSchema.enum.push(id); + this.iconReferenceSchema.enumDescriptions.push(description || ""); + this._onDidChange.fire(); + return { id }; + } + getIcons() { + return Object.keys(this.iconsById).map((id) => this.iconsById[id]); + } + getIcon(id) { + return this.iconsById[id]; + } + getIconSchema() { + return this.iconSchema; + } + toString() { + const sorter2 = (i1, i2) => { + return i1.id.localeCompare(i2.id); + }; + const classNames2 = (i2) => { + while (ThemeIcon.isThemeIcon(i2.defaults)) { + i2 = this.iconsById[i2.defaults.id]; + } + return `codicon codicon-${i2 ? i2.id : ""}`; + }; + const reference = []; + reference.push(`| preview | identifier | default codicon ID | description`); + reference.push(`| ----------- | --------------------------------- | --------------------------------- | --------------------------------- |`); + const contributions = Object.keys(this.iconsById).map((key) => this.iconsById[key]); + for (const i2 of contributions.filter((i3) => !!i3.description).sort(sorter2)) { + reference.push(`||${i2.id}|${ThemeIcon.isThemeIcon(i2.defaults) ? i2.defaults.id : i2.id}|${i2.description || ""}|`); + } + reference.push(`| preview | identifier `); + reference.push(`| ----------- | --------------------------------- |`); + for (const i2 of contributions.filter((i3) => !ThemeIcon.isThemeIcon(i3.defaults)).sort(sorter2)) { + reference.push(`||${i2.id}|`); + } + return reference.join("\n"); + } +}; +var iconRegistry = new IconRegistry(); +Registry.add(Extensions8.IconContribution, iconRegistry); +function registerIcon(id, defaults, description, deprecationMessage) { + return iconRegistry.registerIcon(id, defaults, description, deprecationMessage); +} +function getIconRegistry() { + return iconRegistry; +} +function initialize() { + const codiconFontCharacters = getCodiconFontCharacters(); + for (const icon in codiconFontCharacters) { + const fontCharacter = "\\" + codiconFontCharacters[icon].toString(16); + iconRegistry.registerIcon(icon, { fontCharacter }); + } +} +initialize(); +var iconsSchemaId = "vscode://schemas/icons"; +var schemaRegistry2 = Registry.as(Extensions3.JSONContribution); +schemaRegistry2.registerSchema(iconsSchemaId, iconRegistry.getIconSchema()); +var delayer2 = new RunOnceScheduler(() => schemaRegistry2.notifySchemaChanged(iconsSchemaId), 200); +iconRegistry.onDidChange(() => { + if (!delayer2.isScheduled()) { + delayer2.schedule(); + } +}); +var widgetClose = registerIcon("widget-close", Codicon.close, localize(2027, "Icon for the close action in widgets.")); +var gotoPreviousLocation = registerIcon("goto-previous-location", Codicon.arrowUp, localize(2028, "Icon for goto previous editor location.")); +var gotoNextLocation = registerIcon("goto-next-location", Codicon.arrowDown, localize(2029, "Icon for goto next editor location.")); +var syncing = ThemeIcon.modify(Codicon.sync, "spin"); +var spinningLoading = ThemeIcon.modify(Codicon.loading, "spin"); + +// node_modules/monaco-editor-core/esm/vs/editor/browser/widget/diffEditor/components/accessibleDiffViewer.js +init_actions(); +var __decorate29 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param25 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var accessibleDiffViewerInsertIcon = registerIcon("diff-review-insert", Codicon.add, localize(97, "Icon for 'Insert' in accessible diff viewer.")); +var accessibleDiffViewerRemoveIcon = registerIcon("diff-review-remove", Codicon.remove, localize(98, "Icon for 'Remove' in accessible diff viewer.")); +var accessibleDiffViewerCloseIcon = registerIcon("diff-review-close", Codicon.close, localize(99, "Icon for 'Close' in accessible diff viewer.")); +var AccessibleDiffViewer = class AccessibleDiffViewer2 extends Disposable { + static { + this._ttPolicy = createTrustedTypesPolicy("diffReview", { createHTML: (value) => value }); + } + constructor(_parentNode, _visible, _setVisible, _canClose, _width, _height, _diffs, _models, _instantiationService) { + super(); + this._parentNode = _parentNode; + this._visible = _visible; + this._setVisible = _setVisible; + this._canClose = _canClose; + this._width = _width; + this._height = _height; + this._diffs = _diffs; + this._models = _models; + this._instantiationService = _instantiationService; + this._state = derived(this, (reader) => { + const visible = this._visible.read(reader); + this._parentNode.style.visibility = visible ? "visible" : "hidden"; + if (!visible) { + return null; + } + const model = reader.store.add(this._instantiationService.createInstance(ViewModel2, this._diffs, this._models, this._setVisible, this._canClose)); + const view = reader.store.add(this._instantiationService.createInstance(View3, this._parentNode, model, this._width, this._height, this._models)); + return { model, view }; + }).recomputeInitiallyAndOnChange(this._store); + } + next() { + transaction((tx) => { + const isVisible = this._visible.get(); + this._setVisible(true, tx); + if (isVisible) { + this._state.get().model.nextGroup(tx); + } + }); + } + prev() { + transaction((tx) => { + this._setVisible(true, tx); + this._state.get().model.previousGroup(tx); + }); + } + close() { + transaction((tx) => { + this._setVisible(false, tx); + }); + } +}; +AccessibleDiffViewer = __decorate29([ + __param25(8, IInstantiationService) +], AccessibleDiffViewer); +var ViewModel2 = class ViewModel3 extends Disposable { + constructor(_diffs, _models, _setVisible, canClose, _accessibilitySignalService) { + super(); + this._diffs = _diffs; + this._models = _models; + this._setVisible = _setVisible; + this.canClose = canClose; + this._accessibilitySignalService = _accessibilitySignalService; + this._groups = observableValue(this, []); + this._currentGroupIdx = observableValue(this, 0); + this._currentElementIdx = observableValue(this, 0); + this.groups = this._groups; + this.currentGroup = this._currentGroupIdx.map((idx, r) => this._groups.read(r)[idx]); + this.currentGroupIndex = this._currentGroupIdx; + this.currentElement = this._currentElementIdx.map((idx, r) => this.currentGroup.read(r)?.lines[idx]); + this._register(autorun((reader) => { + const diffs = this._diffs.read(reader); + if (!diffs) { + this._groups.set([], void 0); + return; + } + const groups = computeViewElementGroups(diffs, this._models.getOriginalModel().getLineCount(), this._models.getModifiedModel().getLineCount()); + transaction((tx) => { + const p = this._models.getModifiedPosition(); + if (p) { + const nextGroup = groups.findIndex((g) => p?.lineNumber < g.range.modified.endLineNumberExclusive); + if (nextGroup !== -1) { + this._currentGroupIdx.set(nextGroup, tx); + } + } + this._groups.set(groups, tx); + }); + })); + this._register(autorun((reader) => { + const currentViewItem = this.currentElement.read(reader); + if (currentViewItem?.type === LineType.Deleted) { + this._accessibilitySignalService.playSignal(AccessibilitySignal.diffLineDeleted, { source: "accessibleDiffViewer.currentElementChanged" }); + } else if (currentViewItem?.type === LineType.Added) { + this._accessibilitySignalService.playSignal(AccessibilitySignal.diffLineInserted, { source: "accessibleDiffViewer.currentElementChanged" }); + } + })); + this._register(autorun((reader) => { + const currentViewItem = this.currentElement.read(reader); + if (currentViewItem && currentViewItem.type !== LineType.Header) { + const lineNumber = currentViewItem.modifiedLineNumber ?? currentViewItem.diff.modified.startLineNumber; + this._models.modifiedSetSelection(Range.fromPositions(new Position(lineNumber, 1))); + } + })); + } + _goToGroupDelta(delta, tx) { + const groups = this.groups.get(); + if (!groups || groups.length <= 1) { + return; + } + subtransaction(tx, (tx2) => { + this._currentGroupIdx.set(OffsetRange.ofLength(groups.length).clipCyclic(this._currentGroupIdx.get() + delta), tx2); + this._currentElementIdx.set(0, tx2); + }); + } + nextGroup(tx) { + this._goToGroupDelta(1, tx); + } + previousGroup(tx) { + this._goToGroupDelta(-1, tx); + } + _goToLineDelta(delta) { + const group = this.currentGroup.get(); + if (!group || group.lines.length <= 1) { + return; + } + transaction((tx) => { + this._currentElementIdx.set(OffsetRange.ofLength(group.lines.length).clip(this._currentElementIdx.get() + delta), tx); + }); + } + goToNextLine() { + this._goToLineDelta(1); + } + goToPreviousLine() { + this._goToLineDelta(-1); + } + goToLine(line) { + const group = this.currentGroup.get(); + if (!group) { + return; + } + const idx = group.lines.indexOf(line); + if (idx === -1) { + return; + } + transaction((tx) => { + this._currentElementIdx.set(idx, tx); + }); + } + revealCurrentElementInEditor() { + if (!this.canClose.get()) { + return; + } + this._setVisible(false, void 0); + const curElem = this.currentElement.get(); + if (curElem) { + if (curElem.type === LineType.Deleted) { + this._models.originalReveal(Range.fromPositions(new Position(curElem.originalLineNumber, 1))); + } else { + this._models.modifiedReveal(curElem.type !== LineType.Header ? Range.fromPositions(new Position(curElem.modifiedLineNumber, 1)) : void 0); + } + } + } + close() { + if (!this.canClose.get()) { + return; + } + this._setVisible(false, void 0); + this._models.modifiedFocus(); + } +}; +ViewModel2 = __decorate29([ + __param25(4, IAccessibilitySignalService) +], ViewModel2); +var viewElementGroupLineMargin = 3; +function computeViewElementGroups(diffs, originalLineCount, modifiedLineCount) { + const result = []; + for (const g of groupAdjacentBy(diffs, (a, b) => b.modified.startLineNumber - a.modified.endLineNumberExclusive < 2 * viewElementGroupLineMargin)) { + const viewElements = []; + viewElements.push(new HeaderViewElement()); + const origFullRange = new LineRange(Math.max(1, g[0].original.startLineNumber - viewElementGroupLineMargin), Math.min(g[g.length - 1].original.endLineNumberExclusive + viewElementGroupLineMargin, originalLineCount + 1)); + const modifiedFullRange = new LineRange(Math.max(1, g[0].modified.startLineNumber - viewElementGroupLineMargin), Math.min(g[g.length - 1].modified.endLineNumberExclusive + viewElementGroupLineMargin, modifiedLineCount + 1)); + forEachAdjacent(g, (a, b) => { + const origRange = new LineRange(a ? a.original.endLineNumberExclusive : origFullRange.startLineNumber, b ? b.original.startLineNumber : origFullRange.endLineNumberExclusive); + const modifiedRange2 = new LineRange(a ? a.modified.endLineNumberExclusive : modifiedFullRange.startLineNumber, b ? b.modified.startLineNumber : modifiedFullRange.endLineNumberExclusive); + origRange.forEach((origLineNumber) => { + viewElements.push(new UnchangedLineViewElement(origLineNumber, modifiedRange2.startLineNumber + (origLineNumber - origRange.startLineNumber))); + }); + if (b) { + b.original.forEach((origLineNumber) => { + viewElements.push(new DeletedLineViewElement(b, origLineNumber)); + }); + b.modified.forEach((modifiedLineNumber) => { + viewElements.push(new AddedLineViewElement(b, modifiedLineNumber)); + }); + } + }); + const modifiedRange = g[0].modified.join(g[g.length - 1].modified); + const originalRange = g[0].original.join(g[g.length - 1].original); + result.push(new ViewElementGroup(new LineRangeMapping(modifiedRange, originalRange), viewElements)); + } + return result; +} +var LineType; +(function(LineType2) { + LineType2[LineType2["Header"] = 0] = "Header"; + LineType2[LineType2["Unchanged"] = 1] = "Unchanged"; + LineType2[LineType2["Deleted"] = 2] = "Deleted"; + LineType2[LineType2["Added"] = 3] = "Added"; +})(LineType || (LineType = {})); +var ViewElementGroup = class { + constructor(range2, lines) { + this.range = range2; + this.lines = lines; + } +}; +var HeaderViewElement = class { + constructor() { + this.type = LineType.Header; + } +}; +var DeletedLineViewElement = class { + constructor(diff, originalLineNumber) { + this.diff = diff; + this.originalLineNumber = originalLineNumber; + this.type = LineType.Deleted; + this.modifiedLineNumber = void 0; + } +}; +var AddedLineViewElement = class { + constructor(diff, modifiedLineNumber) { + this.diff = diff; + this.modifiedLineNumber = modifiedLineNumber; + this.type = LineType.Added; + this.originalLineNumber = void 0; + } +}; +var UnchangedLineViewElement = class { + constructor(originalLineNumber, modifiedLineNumber) { + this.originalLineNumber = originalLineNumber; + this.modifiedLineNumber = modifiedLineNumber; + this.type = LineType.Unchanged; + } +}; +var View3 = class View4 extends Disposable { + constructor(_element, _model, _width, _height, _models, _languageService) { + super(); + this._element = _element; + this._model = _model; + this._width = _width; + this._height = _height; + this._models = _models; + this._languageService = _languageService; + this.domNode = this._element; + this.domNode.className = "monaco-component diff-review monaco-editor-background"; + const actionBarContainer = document.createElement("div"); + actionBarContainer.className = "diff-review-actions"; + this._actionBar = this._register(new ActionBar(actionBarContainer)); + this._register(autorun((reader) => { + this._actionBar.clear(); + if (this._model.canClose.read(reader)) { + this._actionBar.push(toAction({ + id: "diffreview.close", + label: localize(100, "Close"), + class: "close-diff-review " + ThemeIcon.asClassName(accessibleDiffViewerCloseIcon), + enabled: true, + run: async () => _model.close() + }), { label: false, icon: true }); + } + })); + this._content = document.createElement("div"); + this._content.className = "diff-review-content"; + this._content.setAttribute("role", "code"); + this._scrollbar = this._register(new DomScrollableElement(this._content, {})); + reset(this.domNode, this._scrollbar.getDomNode(), actionBarContainer); + this._register(autorun((r) => { + this._height.read(r); + this._width.read(r); + this._scrollbar.scanDomNode(); + })); + this._register(toDisposable(() => { + reset(this.domNode); + })); + this._register(applyStyle(this.domNode, { width: this._width, height: this._height })); + this._register(applyStyle(this._content, { width: this._width, height: this._height })); + this._register(autorunWithStore((reader, store) => { + this._model.currentGroup.read(reader); + this._render(store); + })); + this._register(addStandardDisposableListener(this.domNode, "keydown", (e) => { + if (e.equals( + 18 + /* KeyCode.DownArrow */ + ) || e.equals( + 2048 | 18 + /* KeyCode.DownArrow */ + ) || e.equals( + 512 | 18 + /* KeyCode.DownArrow */ + )) { + e.preventDefault(); + this._model.goToNextLine(); + } + if (e.equals( + 16 + /* KeyCode.UpArrow */ + ) || e.equals( + 2048 | 16 + /* KeyCode.UpArrow */ + ) || e.equals( + 512 | 16 + /* KeyCode.UpArrow */ + )) { + e.preventDefault(); + this._model.goToPreviousLine(); + } + if (e.equals( + 9 + /* KeyCode.Escape */ + ) || e.equals( + 2048 | 9 + /* KeyCode.Escape */ + ) || e.equals( + 512 | 9 + /* KeyCode.Escape */ + ) || e.equals( + 1024 | 9 + /* KeyCode.Escape */ + )) { + e.preventDefault(); + this._model.close(); + } + if (e.equals( + 10 + /* KeyCode.Space */ + ) || e.equals( + 3 + /* KeyCode.Enter */ + )) { + e.preventDefault(); + this._model.revealCurrentElementInEditor(); + } + })); + } + _render(store) { + const originalOptions = this._models.getOriginalOptions(); + const modifiedOptions = this._models.getModifiedOptions(); + const container = document.createElement("div"); + container.className = "diff-review-table"; + container.setAttribute("role", "list"); + container.setAttribute("aria-label", localize(101, "Accessible Diff Viewer. Use arrow up and down to navigate.")); + applyFontInfo(container, modifiedOptions.get( + 59 + /* EditorOption.fontInfo */ + )); + reset(this._content, container); + const originalModel = this._models.getOriginalModel(); + const modifiedModel = this._models.getModifiedModel(); + if (!originalModel || !modifiedModel) { + return; + } + const originalModelOpts = originalModel.getOptions(); + const modifiedModelOpts = modifiedModel.getOptions(); + const lineHeight = modifiedOptions.get( + 75 + /* EditorOption.lineHeight */ + ); + const group = this._model.currentGroup.get(); + for (const viewItem of group?.lines || []) { + if (!group) { + break; + } + let row; + if (viewItem.type === LineType.Header) { + const header2 = document.createElement("div"); + header2.className = "diff-review-row"; + header2.setAttribute("role", "listitem"); + const r = group.range; + const diffIndex = this._model.currentGroupIndex.get(); + const diffsLength = this._model.groups.get().length; + const getAriaLines = (lines) => lines === 0 ? localize(102, "no lines changed") : lines === 1 ? localize(103, "1 line changed") : localize(104, "{0} lines changed", lines); + const originalChangedLinesCntAria = getAriaLines(r.original.length); + const modifiedChangedLinesCntAria = getAriaLines(r.modified.length); + header2.setAttribute("aria-label", localize(105, "Difference {0} of {1}: original line {2}, {3}, modified line {4}, {5}", diffIndex + 1, diffsLength, r.original.startLineNumber, originalChangedLinesCntAria, r.modified.startLineNumber, modifiedChangedLinesCntAria)); + const cell = document.createElement("div"); + cell.className = "diff-review-cell diff-review-summary"; + cell.appendChild(document.createTextNode(`${diffIndex + 1}/${diffsLength}: @@ -${r.original.startLineNumber},${r.original.length} +${r.modified.startLineNumber},${r.modified.length} @@`)); + header2.appendChild(cell); + row = header2; + } else { + row = this._createRow(viewItem, lineHeight, this._width.get(), originalOptions, originalModel, originalModelOpts, modifiedOptions, modifiedModel, modifiedModelOpts); + } + container.appendChild(row); + const isSelectedObs = derived((reader) => ( + /** @description isSelected */ + this._model.currentElement.read(reader) === viewItem + )); + store.add(autorun((reader) => { + const isSelected = isSelectedObs.read(reader); + row.tabIndex = isSelected ? 0 : -1; + if (isSelected) { + row.focus(); + } + })); + store.add(addDisposableListener(row, "focus", () => { + this._model.goToLine(viewItem); + })); + } + this._scrollbar.scanDomNode(); + } + _createRow(item, lineHeight, width2, originalOptions, originalModel, originalModelOpts, modifiedOptions, modifiedModel, modifiedModelOpts) { + const originalLayoutInfo = originalOptions.get( + 165 + /* EditorOption.layoutInfo */ + ); + const originalLineNumbersWidth = originalLayoutInfo.glyphMarginWidth + originalLayoutInfo.lineNumbersWidth; + const modifiedLayoutInfo = modifiedOptions.get( + 165 + /* EditorOption.layoutInfo */ + ); + const modifiedLineNumbersWidth = 10 + modifiedLayoutInfo.glyphMarginWidth + modifiedLayoutInfo.lineNumbersWidth; + let rowClassName = "diff-review-row"; + let lineNumbersExtraClassName = ""; + const spacerClassName = "diff-review-spacer"; + let spacerIcon = null; + switch (item.type) { + case LineType.Added: + rowClassName = "diff-review-row line-insert"; + lineNumbersExtraClassName = " char-insert"; + spacerIcon = accessibleDiffViewerInsertIcon; + break; + case LineType.Deleted: + rowClassName = "diff-review-row line-delete"; + lineNumbersExtraClassName = " char-delete"; + spacerIcon = accessibleDiffViewerRemoveIcon; + break; + } + const row = document.createElement("div"); + row.style.minWidth = width2 + "px"; + row.className = rowClassName; + row.setAttribute("role", "listitem"); + row.ariaLevel = ""; + const cell = document.createElement("div"); + cell.className = "diff-review-cell"; + cell.style.height = `${lineHeight}px`; + row.appendChild(cell); + const originalLineNumber = document.createElement("span"); + originalLineNumber.style.width = originalLineNumbersWidth + "px"; + originalLineNumber.style.minWidth = originalLineNumbersWidth + "px"; + originalLineNumber.className = "diff-review-line-number" + lineNumbersExtraClassName; + if (item.originalLineNumber !== void 0) { + originalLineNumber.appendChild(document.createTextNode(String(item.originalLineNumber))); + } else { + originalLineNumber.innerText = "\xA0"; + } + cell.appendChild(originalLineNumber); + const modifiedLineNumber = document.createElement("span"); + modifiedLineNumber.style.width = modifiedLineNumbersWidth + "px"; + modifiedLineNumber.style.minWidth = modifiedLineNumbersWidth + "px"; + modifiedLineNumber.style.paddingRight = "10px"; + modifiedLineNumber.className = "diff-review-line-number" + lineNumbersExtraClassName; + if (item.modifiedLineNumber !== void 0) { + modifiedLineNumber.appendChild(document.createTextNode(String(item.modifiedLineNumber))); + } else { + modifiedLineNumber.innerText = "\xA0"; + } + cell.appendChild(modifiedLineNumber); + const spacer = document.createElement("span"); + spacer.className = spacerClassName; + if (spacerIcon) { + const spacerCodicon = document.createElement("span"); + spacerCodicon.className = ThemeIcon.asClassName(spacerIcon); + spacerCodicon.innerText = "\xA0\xA0"; + spacer.appendChild(spacerCodicon); + } else { + spacer.innerText = "\xA0\xA0"; + } + cell.appendChild(spacer); + let lineContent; + if (item.modifiedLineNumber !== void 0) { + let html3 = this._getLineHtml(modifiedModel, modifiedOptions, modifiedModelOpts.tabSize, item.modifiedLineNumber, this._languageService.languageIdCodec); + if (AccessibleDiffViewer._ttPolicy) { + html3 = AccessibleDiffViewer._ttPolicy.createHTML(html3); + } + cell.insertAdjacentHTML("beforeend", html3); + lineContent = modifiedModel.getLineContent(item.modifiedLineNumber); + } else { + let html3 = this._getLineHtml(originalModel, originalOptions, originalModelOpts.tabSize, item.originalLineNumber, this._languageService.languageIdCodec); + if (AccessibleDiffViewer._ttPolicy) { + html3 = AccessibleDiffViewer._ttPolicy.createHTML(html3); + } + cell.insertAdjacentHTML("beforeend", html3); + lineContent = originalModel.getLineContent(item.originalLineNumber); + } + if (lineContent.length === 0) { + lineContent = localize(106, "blank"); + } + let ariaLabel = ""; + switch (item.type) { + case LineType.Unchanged: + if (item.originalLineNumber === item.modifiedLineNumber) { + ariaLabel = localize(107, "{0} unchanged line {1}", lineContent, item.originalLineNumber); + } else { + ariaLabel = localize(108, "{0} original line {1} modified line {2}", lineContent, item.originalLineNumber, item.modifiedLineNumber); + } + break; + case LineType.Added: + ariaLabel = localize(109, "+ {0} modified line {1}", lineContent, item.modifiedLineNumber); + break; + case LineType.Deleted: + ariaLabel = localize(110, "- {0} original line {1}", lineContent, item.originalLineNumber); + break; + } + row.setAttribute("aria-label", ariaLabel); + return row; + } + _getLineHtml(model, options2, tabSize, lineNumber, languageIdCodec) { + const lineContent = model.getLineContent(lineNumber); + const fontInfo = options2.get( + 59 + /* EditorOption.fontInfo */ + ); + const verticalScrollbarSize = options2.get( + 117 + /* EditorOption.scrollbar */ + ).verticalScrollbarSize; + const lineTokens = LineTokens.createEmpty(lineContent, languageIdCodec); + const isBasicASCII2 = ViewLineRenderingData.isBasicASCII(lineContent, model.mightContainNonBasicASCII()); + const containsRTL2 = ViewLineRenderingData.containsRTL(lineContent, isBasicASCII2, model.mightContainRTL()); + const r = renderViewLine2(new RenderLineInput(fontInfo.isMonospace && !options2.get( + 40 + /* EditorOption.disableMonospaceOptimizations */ + ), fontInfo.canUseHalfwidthRightwardsArrow, lineContent, false, isBasicASCII2, containsRTL2, 0, lineTokens, [], tabSize, 0, fontInfo.spaceWidth, fontInfo.middotWidth, fontInfo.wsmiddotWidth, options2.get( + 133 + /* EditorOption.stopRenderingLineAfter */ + ), options2.get( + 113 + /* EditorOption.renderWhitespace */ + ), options2.get( + 108 + /* EditorOption.renderControlCharacters */ + ), options2.get( + 60 + /* EditorOption.fontLigatures */ + ) !== EditorFontLigatures.OFF, null, null, verticalScrollbarSize)); + return r.html; + } +}; +View3 = __decorate29([ + __param25(5, ILanguageService) +], View3); +var AccessibleDiffViewerModelFromEditors = class { + constructor(editors) { + this.editors = editors; + } + getOriginalModel() { + return this.editors.original.getModel(); + } + getOriginalOptions() { + return this.editors.original.getOptions(); + } + originalReveal(range2) { + this.editors.original.revealRange(range2); + this.editors.original.setSelection(range2); + this.editors.original.focus(); + } + getModifiedModel() { + return this.editors.modified.getModel(); + } + getModifiedOptions() { + return this.editors.modified.getOptions(); + } + modifiedReveal(range2) { + if (range2) { + this.editors.modified.revealRange(range2); + this.editors.modified.setSelection(range2); + } + this.editors.modified.focus(); + } + modifiedSetSelection(range2) { + this.editors.modified.setSelection(range2); + } + modifiedFocus() { + this.editors.modified.focus(); + } + getModifiedPosition() { + return this.editors.modified.getPosition() ?? void 0; + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/browser/widget/diffEditor/components/diffEditorDecorations.js +init_lifecycle(); +init_observable(); + +// node_modules/monaco-editor-core/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/diffEditorViewZones.js +init_dom(); +init_arrays(); +init_async(); +init_codicons(); +init_lifecycle(); +init_observable(); +init_themables(); +init_types(); + +// node_modules/monaco-editor-core/esm/vs/editor/browser/widget/diffEditor/registrations.contribution.js +init_codicons(); +init_themables(); +init_textModel(); +init_nls(); +init_colorRegistry(); +var diffMoveBorder = registerColor("diffEditor.move.border", "#8b8b8b9c", localize(137, "The border color for text that got moved in the diff editor.")); +var diffMoveBorderActive = registerColor("diffEditor.moveActive.border", "#FFA500", localize(138, "The active border color for text that got moved in the diff editor.")); +var diffEditorUnchangedRegionShadow = registerColor("diffEditor.unchangedRegionShadow", { dark: "#000000", light: "#737373BF", hcDark: "#000000", hcLight: "#737373BF" }, localize(139, "The color of the shadow around unchanged region widgets.")); +var diffInsertIcon = registerIcon("diff-insert", Codicon.add, localize(140, "Line decoration for inserts in the diff editor.")); +var diffRemoveIcon = registerIcon("diff-remove", Codicon.remove, localize(141, "Line decoration for removals in the diff editor.")); +var diffLineAddDecorationBackgroundWithIndicator = ModelDecorationOptions.register({ + className: "line-insert", + description: "line-insert", + isWholeLine: true, + linesDecorationsClassName: "insert-sign " + ThemeIcon.asClassName(diffInsertIcon), + marginClassName: "gutter-insert" +}); +var diffLineDeleteDecorationBackgroundWithIndicator = ModelDecorationOptions.register({ + className: "line-delete", + description: "line-delete", + isWholeLine: true, + linesDecorationsClassName: "delete-sign " + ThemeIcon.asClassName(diffRemoveIcon), + marginClassName: "gutter-delete" +}); +var diffLineAddDecorationBackground = ModelDecorationOptions.register({ + className: "line-insert", + description: "line-insert", + isWholeLine: true, + marginClassName: "gutter-insert" +}); +var diffLineDeleteDecorationBackground = ModelDecorationOptions.register({ + className: "line-delete", + description: "line-delete", + isWholeLine: true, + marginClassName: "gutter-delete" +}); +var diffAddDecoration = ModelDecorationOptions.register({ + className: "char-insert", + description: "char-insert", + shouldFillLineOnLineBreak: true +}); +var diffWholeLineAddDecoration = ModelDecorationOptions.register({ + className: "char-insert", + description: "char-insert", + isWholeLine: true +}); +var diffAddDecorationEmpty = ModelDecorationOptions.register({ + className: "char-insert diff-range-empty", + description: "char-insert diff-range-empty" +}); +var diffDeleteDecoration = ModelDecorationOptions.register({ + className: "char-delete", + description: "char-delete", + shouldFillLineOnLineBreak: true +}); +var diffWholeLineDeleteDecoration = ModelDecorationOptions.register({ + className: "char-delete", + description: "char-delete", + isWholeLine: true +}); +var diffDeleteDecorationEmpty = ModelDecorationOptions.register({ + className: "char-delete diff-range-empty", + description: "char-delete diff-range-empty" +}); + +// node_modules/monaco-editor-core/esm/vs/editor/browser/widget/diffEditor/diffEditorViewModel.js +init_async(); +init_cancellation(); +init_lifecycle(); +init_observable(); + +// node_modules/monaco-editor-core/esm/vs/editor/browser/widget/diffEditor/diffProviderFactoryService.js +init_extensions(); +init_instantiation(); +init_event(); +init_stopwatch(); +init_lineRange(); +init_editorWorker(); +init_telemetry(); +var __decorate30 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param26 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var WorkerBasedDocumentDiffProvider_1; +var IDiffProviderFactoryService = createDecorator("diffProviderFactoryService"); +var WorkerBasedDiffProviderFactoryService = class WorkerBasedDiffProviderFactoryService2 { + constructor(instantiationService) { + this.instantiationService = instantiationService; + } + createDiffProvider(options2) { + return this.instantiationService.createInstance(WorkerBasedDocumentDiffProvider, options2); + } +}; +WorkerBasedDiffProviderFactoryService = __decorate30([ + __param26(0, IInstantiationService) +], WorkerBasedDiffProviderFactoryService); +registerSingleton( + IDiffProviderFactoryService, + WorkerBasedDiffProviderFactoryService, + 1 + /* InstantiationType.Delayed */ +); +var WorkerBasedDocumentDiffProvider = class WorkerBasedDocumentDiffProvider2 { + static { + WorkerBasedDocumentDiffProvider_1 = this; + } + static { + this.diffCache = /* @__PURE__ */ new Map(); + } + constructor(options2, editorWorkerService, telemetryService) { + this.editorWorkerService = editorWorkerService; + this.telemetryService = telemetryService; + this.onDidChangeEventEmitter = new Emitter(); + this.onDidChange = this.onDidChangeEventEmitter.event; + this.diffAlgorithm = "advanced"; + this.diffAlgorithmOnDidChangeSubscription = void 0; + this.setOptions(options2); + } + dispose() { + this.diffAlgorithmOnDidChangeSubscription?.dispose(); + } + async computeDiff(original, modified, options2, cancellationToken) { + if (typeof this.diffAlgorithm !== "string") { + return this.diffAlgorithm.computeDiff(original, modified, options2, cancellationToken); + } + if (original.isDisposed() || modified.isDisposed()) { + return { + changes: [], + identical: true, + quitEarly: false, + moves: [] + }; + } + if (original.getLineCount() === 1 && original.getLineMaxColumn(1) === 1) { + if (modified.getLineCount() === 1 && modified.getLineMaxColumn(1) === 1) { + return { + changes: [], + identical: true, + quitEarly: false, + moves: [] + }; + } + return { + changes: [ + new DetailedLineRangeMapping(new LineRange(1, 2), new LineRange(1, modified.getLineCount() + 1), [ + new RangeMapping(original.getFullModelRange(), modified.getFullModelRange()) + ]) + ], + identical: false, + quitEarly: false, + moves: [] + }; + } + const uriKey = JSON.stringify([original.uri.toString(), modified.uri.toString()]); + const context = JSON.stringify([original.id, modified.id, original.getAlternativeVersionId(), modified.getAlternativeVersionId(), JSON.stringify(options2)]); + const c = WorkerBasedDocumentDiffProvider_1.diffCache.get(uriKey); + if (c && c.context === context) { + return c.result; + } + const sw = StopWatch.create(); + const result = await this.editorWorkerService.computeDiff(original.uri, modified.uri, options2, this.diffAlgorithm); + const timeMs = sw.elapsed(); + this.telemetryService.publicLog2("diffEditor.computeDiff", { + timeMs, + timedOut: result?.quitEarly ?? true, + detectedMoves: options2.computeMoves ? result?.moves.length ?? 0 : -1 + }); + if (cancellationToken.isCancellationRequested) { + return { + changes: [], + identical: false, + quitEarly: true, + moves: [] + }; + } + if (!result) { + throw new Error("no diff result available"); + } + if (WorkerBasedDocumentDiffProvider_1.diffCache.size > 10) { + WorkerBasedDocumentDiffProvider_1.diffCache.delete(WorkerBasedDocumentDiffProvider_1.diffCache.keys().next().value); + } + WorkerBasedDocumentDiffProvider_1.diffCache.set(uriKey, { result, context }); + return result; + } + setOptions(newOptions) { + let didChange = false; + if (newOptions.diffAlgorithm) { + if (this.diffAlgorithm !== newOptions.diffAlgorithm) { + this.diffAlgorithmOnDidChangeSubscription?.dispose(); + this.diffAlgorithmOnDidChangeSubscription = void 0; + this.diffAlgorithm = newOptions.diffAlgorithm; + if (typeof newOptions.diffAlgorithm !== "string") { + this.diffAlgorithmOnDidChangeSubscription = newOptions.diffAlgorithm.onDidChange(() => this.onDidChangeEventEmitter.fire()); + } + didChange = true; + } + } + if (didChange) { + this.onDidChangeEventEmitter.fire(); + } + } +}; +WorkerBasedDocumentDiffProvider = WorkerBasedDocumentDiffProvider_1 = __decorate30([ + __param26(1, IEditorWorkerService), + __param26(2, ITelemetryService) +], WorkerBasedDocumentDiffProvider); + +// node_modules/monaco-editor-core/esm/vs/editor/browser/widget/diffEditor/diffEditorViewModel.js +init_utils5(); +init_lineRange(); + +// node_modules/monaco-editor-core/esm/vs/editor/common/diff/defaultLinesDiffComputer/defaultLinesDiffComputer.js +init_arrays(); +init_assert(); +init_lineRange(); +init_offsetRange(); +init_range(); + +// node_modules/monaco-editor-core/esm/vs/editor/common/diff/linesDiffComputer.js +var LinesDiff = class { + constructor(changes, moves, hitTimeout) { + this.changes = changes; + this.moves = moves; + this.hitTimeout = hitTimeout; + } +}; +var MovedText = class { + constructor(lineRangeMapping, changes) { + this.lineRangeMapping = lineRangeMapping; + this.changes = changes; + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/common/diff/defaultLinesDiffComputer/algorithms/diffAlgorithm.js +init_arrays(); +init_errors(); +init_offsetRange(); +var DiffAlgorithmResult = class _DiffAlgorithmResult { + static trivial(seq1, seq2) { + return new _DiffAlgorithmResult([new SequenceDiff(OffsetRange.ofLength(seq1.length), OffsetRange.ofLength(seq2.length))], false); + } + static trivialTimedOut(seq1, seq2) { + return new _DiffAlgorithmResult([new SequenceDiff(OffsetRange.ofLength(seq1.length), OffsetRange.ofLength(seq2.length))], true); + } + constructor(diffs, hitTimeout) { + this.diffs = diffs; + this.hitTimeout = hitTimeout; + } +}; +var SequenceDiff = class _SequenceDiff { + static invert(sequenceDiffs, doc1Length) { + const result = []; + forEachAdjacent(sequenceDiffs, (a, b) => { + result.push(_SequenceDiff.fromOffsetPairs(a ? a.getEndExclusives() : OffsetPair.zero, b ? b.getStarts() : new OffsetPair(doc1Length, (a ? a.seq2Range.endExclusive - a.seq1Range.endExclusive : 0) + doc1Length))); + }); + return result; + } + static fromOffsetPairs(start, endExclusive) { + return new _SequenceDiff(new OffsetRange(start.offset1, endExclusive.offset1), new OffsetRange(start.offset2, endExclusive.offset2)); + } + static assertSorted(sequenceDiffs) { + let last = void 0; + for (const cur of sequenceDiffs) { + if (last) { + if (!(last.seq1Range.endExclusive <= cur.seq1Range.start && last.seq2Range.endExclusive <= cur.seq2Range.start)) { + throw new BugIndicatingError("Sequence diffs must be sorted"); + } + } + last = cur; + } + } + constructor(seq1Range, seq2Range) { + this.seq1Range = seq1Range; + this.seq2Range = seq2Range; + } + swap() { + return new _SequenceDiff(this.seq2Range, this.seq1Range); + } + toString() { + return `${this.seq1Range} <-> ${this.seq2Range}`; + } + join(other) { + return new _SequenceDiff(this.seq1Range.join(other.seq1Range), this.seq2Range.join(other.seq2Range)); + } + delta(offset) { + if (offset === 0) { + return this; + } + return new _SequenceDiff(this.seq1Range.delta(offset), this.seq2Range.delta(offset)); + } + deltaStart(offset) { + if (offset === 0) { + return this; + } + return new _SequenceDiff(this.seq1Range.deltaStart(offset), this.seq2Range.deltaStart(offset)); + } + deltaEnd(offset) { + if (offset === 0) { + return this; + } + return new _SequenceDiff(this.seq1Range.deltaEnd(offset), this.seq2Range.deltaEnd(offset)); + } + intersect(other) { + const i1 = this.seq1Range.intersect(other.seq1Range); + const i2 = this.seq2Range.intersect(other.seq2Range); + if (!i1 || !i2) { + return void 0; + } + return new _SequenceDiff(i1, i2); + } + getStarts() { + return new OffsetPair(this.seq1Range.start, this.seq2Range.start); + } + getEndExclusives() { + return new OffsetPair(this.seq1Range.endExclusive, this.seq2Range.endExclusive); + } +}; +var OffsetPair = class _OffsetPair { + static { + this.zero = new _OffsetPair(0, 0); + } + static { + this.max = new _OffsetPair(Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER); + } + constructor(offset1, offset2) { + this.offset1 = offset1; + this.offset2 = offset2; + } + toString() { + return `${this.offset1} <-> ${this.offset2}`; + } + delta(offset) { + if (offset === 0) { + return this; + } + return new _OffsetPair(this.offset1 + offset, this.offset2 + offset); + } + equals(other) { + return this.offset1 === other.offset1 && this.offset2 === other.offset2; + } +}; +var InfiniteTimeout = class _InfiniteTimeout { + static { + this.instance = new _InfiniteTimeout(); + } + isValid() { + return true; + } +}; +var DateTimeout = class { + constructor(timeout2) { + this.timeout = timeout2; + this.startTime = Date.now(); + this.valid = true; + if (timeout2 <= 0) { + throw new BugIndicatingError("timeout must be positive"); + } + } + // Recommendation: Set a log-point `{this.disable()}` in the body + isValid() { + const valid = Date.now() - this.startTime < this.timeout; + if (!valid && this.valid) { + this.valid = false; + } + return this.valid; + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/common/diff/defaultLinesDiffComputer/algorithms/dynamicProgrammingDiffing.js +init_offsetRange(); + +// node_modules/monaco-editor-core/esm/vs/editor/common/diff/defaultLinesDiffComputer/utils.js +var Array2D = class { + constructor(width2, height) { + this.width = width2; + this.height = height; + this.array = []; + this.array = new Array(width2 * height); + } + get(x, y) { + return this.array[x + y * this.width]; + } + set(x, y, value) { + this.array[x + y * this.width] = value; + } +}; +function isSpace(charCode) { + return charCode === 32 || charCode === 9; +} +var LineRangeFragment = class _LineRangeFragment { + static { + this.chrKeys = /* @__PURE__ */ new Map(); + } + static getKey(chr) { + let key = this.chrKeys.get(chr); + if (key === void 0) { + key = this.chrKeys.size; + this.chrKeys.set(chr, key); + } + return key; + } + constructor(range2, lines, source) { + this.range = range2; + this.lines = lines; + this.source = source; + this.histogram = []; + let counter = 0; + for (let i2 = range2.startLineNumber - 1; i2 < range2.endLineNumberExclusive - 1; i2++) { + const line = lines[i2]; + for (let j = 0; j < line.length; j++) { + counter++; + const chr = line[j]; + const key2 = _LineRangeFragment.getKey(chr); + this.histogram[key2] = (this.histogram[key2] || 0) + 1; + } + counter++; + const key = _LineRangeFragment.getKey("\n"); + this.histogram[key] = (this.histogram[key] || 0) + 1; + } + this.totalCount = counter; + } + computeSimilarity(other) { + let sumDifferences = 0; + const maxLength = Math.max(this.histogram.length, other.histogram.length); + for (let i2 = 0; i2 < maxLength; i2++) { + sumDifferences += Math.abs((this.histogram[i2] ?? 0) - (other.histogram[i2] ?? 0)); + } + return 1 - sumDifferences / (this.totalCount + other.totalCount); + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/common/diff/defaultLinesDiffComputer/algorithms/dynamicProgrammingDiffing.js +var DynamicProgrammingDiffing = class { + compute(sequence1, sequence2, timeout2 = InfiniteTimeout.instance, equalityScore) { + if (sequence1.length === 0 || sequence2.length === 0) { + return DiffAlgorithmResult.trivial(sequence1, sequence2); + } + const lcsLengths = new Array2D(sequence1.length, sequence2.length); + const directions = new Array2D(sequence1.length, sequence2.length); + const lengths = new Array2D(sequence1.length, sequence2.length); + for (let s12 = 0; s12 < sequence1.length; s12++) { + for (let s22 = 0; s22 < sequence2.length; s22++) { + if (!timeout2.isValid()) { + return DiffAlgorithmResult.trivialTimedOut(sequence1, sequence2); + } + const horizontalLen = s12 === 0 ? 0 : lcsLengths.get(s12 - 1, s22); + const verticalLen = s22 === 0 ? 0 : lcsLengths.get(s12, s22 - 1); + let extendedSeqScore; + if (sequence1.getElement(s12) === sequence2.getElement(s22)) { + if (s12 === 0 || s22 === 0) { + extendedSeqScore = 0; + } else { + extendedSeqScore = lcsLengths.get(s12 - 1, s22 - 1); + } + if (s12 > 0 && s22 > 0 && directions.get(s12 - 1, s22 - 1) === 3) { + extendedSeqScore += lengths.get(s12 - 1, s22 - 1); + } + extendedSeqScore += equalityScore ? equalityScore(s12, s22) : 1; + } else { + extendedSeqScore = -1; + } + const newValue = Math.max(horizontalLen, verticalLen, extendedSeqScore); + if (newValue === extendedSeqScore) { + const prevLen = s12 > 0 && s22 > 0 ? lengths.get(s12 - 1, s22 - 1) : 0; + lengths.set(s12, s22, prevLen + 1); + directions.set(s12, s22, 3); + } else if (newValue === horizontalLen) { + lengths.set(s12, s22, 0); + directions.set(s12, s22, 1); + } else if (newValue === verticalLen) { + lengths.set(s12, s22, 0); + directions.set(s12, s22, 2); + } + lcsLengths.set(s12, s22, newValue); + } + } + const result = []; + let lastAligningPosS1 = sequence1.length; + let lastAligningPosS2 = sequence2.length; + function reportDecreasingAligningPositions(s12, s22) { + if (s12 + 1 !== lastAligningPosS1 || s22 + 1 !== lastAligningPosS2) { + result.push(new SequenceDiff(new OffsetRange(s12 + 1, lastAligningPosS1), new OffsetRange(s22 + 1, lastAligningPosS2))); + } + lastAligningPosS1 = s12; + lastAligningPosS2 = s22; + } + let s1 = sequence1.length - 1; + let s2 = sequence2.length - 1; + while (s1 >= 0 && s2 >= 0) { + if (directions.get(s1, s2) === 3) { + reportDecreasingAligningPositions(s1, s2); + s1--; + s2--; + } else { + if (directions.get(s1, s2) === 1) { + s1--; + } else { + s2--; + } + } + } + reportDecreasingAligningPositions(-1, -1); + result.reverse(); + return new DiffAlgorithmResult(result, false); + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/common/diff/defaultLinesDiffComputer/algorithms/myersDiffAlgorithm.js +init_offsetRange(); +var MyersDiffAlgorithm = class { + compute(seq1, seq2, timeout2 = InfiniteTimeout.instance) { + if (seq1.length === 0 || seq2.length === 0) { + return DiffAlgorithmResult.trivial(seq1, seq2); + } + const seqX = seq1; + const seqY = seq2; + function getXAfterSnake(x, y) { + while (x < seqX.length && y < seqY.length && seqX.getElement(x) === seqY.getElement(y)) { + x++; + y++; + } + return x; + } + let d = 0; + const V = new FastInt32Array(); + V.set(0, getXAfterSnake(0, 0)); + const paths = new FastArrayNegativeIndices(); + paths.set(0, V.get(0) === 0 ? null : new SnakePath(null, 0, 0, V.get(0))); + let k = 0; + loop: while (true) { + d++; + if (!timeout2.isValid()) { + return DiffAlgorithmResult.trivialTimedOut(seqX, seqY); + } + const lowerBound = -Math.min(d, seqY.length + d % 2); + const upperBound = Math.min(d, seqX.length + d % 2); + for (k = lowerBound; k <= upperBound; k += 2) { + let step = 0; + const maxXofDLineTop = k === upperBound ? -1 : V.get(k + 1); + const maxXofDLineLeft = k === lowerBound ? -1 : V.get(k - 1) + 1; + step++; + const x = Math.min(Math.max(maxXofDLineTop, maxXofDLineLeft), seqX.length); + const y = x - k; + step++; + if (x > seqX.length || y > seqY.length) { + continue; + } + const newMaxX = getXAfterSnake(x, y); + V.set(k, newMaxX); + const lastPath = x === maxXofDLineTop ? paths.get(k + 1) : paths.get(k - 1); + paths.set(k, newMaxX !== x ? new SnakePath(lastPath, x, y, newMaxX - x) : lastPath); + if (V.get(k) === seqX.length && V.get(k) - k === seqY.length) { + break loop; + } + } + } + let path = paths.get(k); + const result = []; + let lastAligningPosS1 = seqX.length; + let lastAligningPosS2 = seqY.length; + while (true) { + const endX = path ? path.x + path.length : 0; + const endY = path ? path.y + path.length : 0; + if (endX !== lastAligningPosS1 || endY !== lastAligningPosS2) { + result.push(new SequenceDiff(new OffsetRange(endX, lastAligningPosS1), new OffsetRange(endY, lastAligningPosS2))); + } + if (!path) { + break; + } + lastAligningPosS1 = path.x; + lastAligningPosS2 = path.y; + path = path.prev; + } + result.reverse(); + return new DiffAlgorithmResult(result, false); + } +}; +var SnakePath = class { + constructor(prev, x, y, length) { + this.prev = prev; + this.x = x; + this.y = y; + this.length = length; + } +}; +var FastInt32Array = class { + constructor() { + this.positiveArr = new Int32Array(10); + this.negativeArr = new Int32Array(10); + } + get(idx) { + if (idx < 0) { + idx = -idx - 1; + return this.negativeArr[idx]; + } else { + return this.positiveArr[idx]; + } + } + set(idx, value) { + if (idx < 0) { + idx = -idx - 1; + if (idx >= this.negativeArr.length) { + const arr = this.negativeArr; + this.negativeArr = new Int32Array(arr.length * 2); + this.negativeArr.set(arr); + } + this.negativeArr[idx] = value; + } else { + if (idx >= this.positiveArr.length) { + const arr = this.positiveArr; + this.positiveArr = new Int32Array(arr.length * 2); + this.positiveArr.set(arr); + } + this.positiveArr[idx] = value; + } + } +}; +var FastArrayNegativeIndices = class { + constructor() { + this.positiveArr = []; + this.negativeArr = []; + } + get(idx) { + if (idx < 0) { + idx = -idx - 1; + return this.negativeArr[idx]; + } else { + return this.positiveArr[idx]; + } + } + set(idx, value) { + if (idx < 0) { + idx = -idx - 1; + this.negativeArr[idx] = value; + } else { + this.positiveArr[idx] = value; + } + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/common/diff/defaultLinesDiffComputer/computeMovedLines.js +init_arrays(); +init_arraysFind(); +init_map(); +init_lineRange(); + +// node_modules/monaco-editor-core/esm/vs/editor/common/diff/defaultLinesDiffComputer/linesSliceCharSequence.js +init_arraysFind(); +init_offsetRange(); +init_position(); +init_range(); +var LinesSliceCharSequence = class { + constructor(lines, range2, considerWhitespaceChanges) { + this.lines = lines; + this.range = range2; + this.considerWhitespaceChanges = considerWhitespaceChanges; + this.elements = []; + this.firstElementOffsetByLineIdx = []; + this.lineStartOffsets = []; + this.trimmedWsLengthsByLineIdx = []; + this.firstElementOffsetByLineIdx.push(0); + for (let lineNumber = this.range.startLineNumber; lineNumber <= this.range.endLineNumber; lineNumber++) { + let line = lines[lineNumber - 1]; + let lineStartOffset = 0; + if (lineNumber === this.range.startLineNumber && this.range.startColumn > 1) { + lineStartOffset = this.range.startColumn - 1; + line = line.substring(lineStartOffset); + } + this.lineStartOffsets.push(lineStartOffset); + let trimmedWsLength = 0; + if (!considerWhitespaceChanges) { + const trimmedStartLine = line.trimStart(); + trimmedWsLength = line.length - trimmedStartLine.length; + line = trimmedStartLine.trimEnd(); + } + this.trimmedWsLengthsByLineIdx.push(trimmedWsLength); + const lineLength = lineNumber === this.range.endLineNumber ? Math.min(this.range.endColumn - 1 - lineStartOffset - trimmedWsLength, line.length) : line.length; + for (let i2 = 0; i2 < lineLength; i2++) { + this.elements.push(line.charCodeAt(i2)); + } + if (lineNumber < this.range.endLineNumber) { + this.elements.push("\n".charCodeAt(0)); + this.firstElementOffsetByLineIdx.push(this.elements.length); + } + } + } + toString() { + return `Slice: "${this.text}"`; + } + get text() { + return this.getText(new OffsetRange(0, this.length)); + } + getText(range2) { + return this.elements.slice(range2.start, range2.endExclusive).map((e) => String.fromCharCode(e)).join(""); + } + getElement(offset) { + return this.elements[offset]; + } + get length() { + return this.elements.length; + } + getBoundaryScore(length) { + const prevCategory = getCategory(length > 0 ? this.elements[length - 1] : -1); + const nextCategory = getCategory(length < this.elements.length ? this.elements[length] : -1); + if (prevCategory === 7 && nextCategory === 8) { + return 0; + } + if (prevCategory === 8) { + return 150; + } + let score3 = 0; + if (prevCategory !== nextCategory) { + score3 += 10; + if (prevCategory === 0 && nextCategory === 1) { + score3 += 1; + } + } + score3 += getCategoryBoundaryScore(prevCategory); + score3 += getCategoryBoundaryScore(nextCategory); + return score3; + } + translateOffset(offset, preference = "right") { + const i2 = findLastIdxMonotonous(this.firstElementOffsetByLineIdx, (value) => value <= offset); + const lineOffset = offset - this.firstElementOffsetByLineIdx[i2]; + return new Position(this.range.startLineNumber + i2, 1 + this.lineStartOffsets[i2] + lineOffset + (lineOffset === 0 && preference === "left" ? 0 : this.trimmedWsLengthsByLineIdx[i2])); + } + translateRange(range2) { + const pos1 = this.translateOffset(range2.start, "right"); + const pos2 = this.translateOffset(range2.endExclusive, "left"); + if (pos2.isBefore(pos1)) { + return Range.fromPositions(pos2, pos2); + } + return Range.fromPositions(pos1, pos2); + } + /** + * Finds the word that contains the character at the given offset + */ + findWordContaining(offset) { + if (offset < 0 || offset >= this.elements.length) { + return void 0; + } + if (!isWordChar(this.elements[offset])) { + return void 0; + } + let start = offset; + while (start > 0 && isWordChar(this.elements[start - 1])) { + start--; + } + let end = offset; + while (end < this.elements.length && isWordChar(this.elements[end])) { + end++; + } + return new OffsetRange(start, end); + } + /** fooBar has the two sub-words foo and bar */ + findSubWordContaining(offset) { + if (offset < 0 || offset >= this.elements.length) { + return void 0; + } + if (!isWordChar(this.elements[offset])) { + return void 0; + } + let start = offset; + while (start > 0 && isWordChar(this.elements[start - 1]) && !isUpperCase(this.elements[start])) { + start--; + } + let end = offset; + while (end < this.elements.length && isWordChar(this.elements[end]) && !isUpperCase(this.elements[end])) { + end++; + } + return new OffsetRange(start, end); + } + countLinesIn(range2) { + return this.translateOffset(range2.endExclusive).lineNumber - this.translateOffset(range2.start).lineNumber; + } + isStronglyEqual(offset1, offset2) { + return this.elements[offset1] === this.elements[offset2]; + } + extendToFullLines(range2) { + const start = findLastMonotonous(this.firstElementOffsetByLineIdx, (x) => x <= range2.start) ?? 0; + const end = findFirstMonotonous(this.firstElementOffsetByLineIdx, (x) => range2.endExclusive <= x) ?? this.elements.length; + return new OffsetRange(start, end); + } +}; +function isWordChar(charCode) { + return charCode >= 97 && charCode <= 122 || charCode >= 65 && charCode <= 90 || charCode >= 48 && charCode <= 57; +} +function isUpperCase(charCode) { + return charCode >= 65 && charCode <= 90; +} +var score = { + [ + 0 + /* CharBoundaryCategory.WordLower */ + ]: 0, + [ + 1 + /* CharBoundaryCategory.WordUpper */ + ]: 0, + [ + 2 + /* CharBoundaryCategory.WordNumber */ + ]: 0, + [ + 3 + /* CharBoundaryCategory.End */ + ]: 10, + [ + 4 + /* CharBoundaryCategory.Other */ + ]: 2, + [ + 5 + /* CharBoundaryCategory.Separator */ + ]: 30, + [ + 6 + /* CharBoundaryCategory.Space */ + ]: 3, + [ + 7 + /* CharBoundaryCategory.LineBreakCR */ + ]: 10, + [ + 8 + /* CharBoundaryCategory.LineBreakLF */ + ]: 10 +}; +function getCategoryBoundaryScore(category) { + return score[category]; +} +function getCategory(charCode) { + if (charCode === 10) { + return 8; + } else if (charCode === 13) { + return 7; + } else if (isSpace(charCode)) { + return 6; + } else if (charCode >= 97 && charCode <= 122) { + return 0; + } else if (charCode >= 65 && charCode <= 90) { + return 1; + } else if (charCode >= 48 && charCode <= 57) { + return 2; + } else if (charCode === -1) { + return 3; + } else if (charCode === 44 || charCode === 59) { + return 5; + } else { + return 4; + } +} + +// node_modules/monaco-editor-core/esm/vs/editor/common/diff/defaultLinesDiffComputer/computeMovedLines.js +init_range(); +function computeMovedLines(changes, originalLines, modifiedLines, hashedOriginalLines, hashedModifiedLines, timeout2) { + let { moves, excludedChanges } = computeMovesFromSimpleDeletionsToSimpleInsertions(changes, originalLines, modifiedLines, timeout2); + if (!timeout2.isValid()) { + return []; + } + const filteredChanges = changes.filter((c) => !excludedChanges.has(c)); + const unchangedMoves = computeUnchangedMoves(filteredChanges, hashedOriginalLines, hashedModifiedLines, originalLines, modifiedLines, timeout2); + pushMany(moves, unchangedMoves); + moves = joinCloseConsecutiveMoves(moves); + moves = moves.filter((current) => { + const lines = current.original.toOffsetRange().slice(originalLines).map((l) => l.trim()); + const originalText = lines.join("\n"); + return originalText.length >= 15 && countWhere(lines, (l) => l.length >= 2) >= 2; + }); + moves = removeMovesInSameDiff(changes, moves); + return moves; +} +function countWhere(arr, predicate) { + let count = 0; + for (const t of arr) { + if (predicate(t)) { + count++; + } + } + return count; +} +function computeMovesFromSimpleDeletionsToSimpleInsertions(changes, originalLines, modifiedLines, timeout2) { + const moves = []; + const deletions = changes.filter((c) => c.modified.isEmpty && c.original.length >= 3).map((d) => new LineRangeFragment(d.original, originalLines, d)); + const insertions = new Set(changes.filter((c) => c.original.isEmpty && c.modified.length >= 3).map((d) => new LineRangeFragment(d.modified, modifiedLines, d))); + const excludedChanges = /* @__PURE__ */ new Set(); + for (const deletion of deletions) { + let highestSimilarity = -1; + let best; + for (const insertion of insertions) { + const similarity = deletion.computeSimilarity(insertion); + if (similarity > highestSimilarity) { + highestSimilarity = similarity; + best = insertion; + } + } + if (highestSimilarity > 0.9 && best) { + insertions.delete(best); + moves.push(new LineRangeMapping(deletion.range, best.range)); + excludedChanges.add(deletion.source); + excludedChanges.add(best.source); + } + if (!timeout2.isValid()) { + return { moves, excludedChanges }; + } + } + return { moves, excludedChanges }; +} +function computeUnchangedMoves(changes, hashedOriginalLines, hashedModifiedLines, originalLines, modifiedLines, timeout2) { + const moves = []; + const original3LineHashes = new SetMap(); + for (const change of changes) { + for (let i2 = change.original.startLineNumber; i2 < change.original.endLineNumberExclusive - 2; i2++) { + const key = `${hashedOriginalLines[i2 - 1]}:${hashedOriginalLines[i2 + 1 - 1]}:${hashedOriginalLines[i2 + 2 - 1]}`; + original3LineHashes.add(key, { range: new LineRange(i2, i2 + 3) }); + } + } + const possibleMappings = []; + changes.sort(compareBy((c) => c.modified.startLineNumber, numberComparator)); + for (const change of changes) { + let lastMappings = []; + for (let i2 = change.modified.startLineNumber; i2 < change.modified.endLineNumberExclusive - 2; i2++) { + const key = `${hashedModifiedLines[i2 - 1]}:${hashedModifiedLines[i2 + 1 - 1]}:${hashedModifiedLines[i2 + 2 - 1]}`; + const currentModifiedRange = new LineRange(i2, i2 + 3); + const nextMappings = []; + original3LineHashes.forEach(key, ({ range: range2 }) => { + for (const lastMapping of lastMappings) { + if (lastMapping.originalLineRange.endLineNumberExclusive + 1 === range2.endLineNumberExclusive && lastMapping.modifiedLineRange.endLineNumberExclusive + 1 === currentModifiedRange.endLineNumberExclusive) { + lastMapping.originalLineRange = new LineRange(lastMapping.originalLineRange.startLineNumber, range2.endLineNumberExclusive); + lastMapping.modifiedLineRange = new LineRange(lastMapping.modifiedLineRange.startLineNumber, currentModifiedRange.endLineNumberExclusive); + nextMappings.push(lastMapping); + return; + } + } + const mapping = { + modifiedLineRange: currentModifiedRange, + originalLineRange: range2 + }; + possibleMappings.push(mapping); + nextMappings.push(mapping); + }); + lastMappings = nextMappings; + } + if (!timeout2.isValid()) { + return []; + } + } + possibleMappings.sort(reverseOrder(compareBy((m) => m.modifiedLineRange.length, numberComparator))); + const modifiedSet = new LineRangeSet(); + const originalSet = new LineRangeSet(); + for (const mapping of possibleMappings) { + const diffOrigToMod = mapping.modifiedLineRange.startLineNumber - mapping.originalLineRange.startLineNumber; + const modifiedSections = modifiedSet.subtractFrom(mapping.modifiedLineRange); + const originalTranslatedSections = originalSet.subtractFrom(mapping.originalLineRange).getWithDelta(diffOrigToMod); + const modifiedIntersectedSections = modifiedSections.getIntersection(originalTranslatedSections); + for (const s of modifiedIntersectedSections.ranges) { + if (s.length < 3) { + continue; + } + const modifiedLineRange = s; + const originalLineRange = s.delta(-diffOrigToMod); + moves.push(new LineRangeMapping(originalLineRange, modifiedLineRange)); + modifiedSet.addRange(modifiedLineRange); + originalSet.addRange(originalLineRange); + } + } + moves.sort(compareBy((m) => m.original.startLineNumber, numberComparator)); + const monotonousChanges = new MonotonousArray(changes); + for (let i2 = 0; i2 < moves.length; i2++) { + const move = moves[i2]; + const firstTouchingChangeOrig = monotonousChanges.findLastMonotonous((c) => c.original.startLineNumber <= move.original.startLineNumber); + const firstTouchingChangeMod = findLastMonotonous(changes, (c) => c.modified.startLineNumber <= move.modified.startLineNumber); + const linesAbove = Math.max(move.original.startLineNumber - firstTouchingChangeOrig.original.startLineNumber, move.modified.startLineNumber - firstTouchingChangeMod.modified.startLineNumber); + const lastTouchingChangeOrig = monotonousChanges.findLastMonotonous((c) => c.original.startLineNumber < move.original.endLineNumberExclusive); + const lastTouchingChangeMod = findLastMonotonous(changes, (c) => c.modified.startLineNumber < move.modified.endLineNumberExclusive); + const linesBelow = Math.max(lastTouchingChangeOrig.original.endLineNumberExclusive - move.original.endLineNumberExclusive, lastTouchingChangeMod.modified.endLineNumberExclusive - move.modified.endLineNumberExclusive); + let extendToTop; + for (extendToTop = 0; extendToTop < linesAbove; extendToTop++) { + const origLine = move.original.startLineNumber - extendToTop - 1; + const modLine = move.modified.startLineNumber - extendToTop - 1; + if (origLine > originalLines.length || modLine > modifiedLines.length) { + break; + } + if (modifiedSet.contains(modLine) || originalSet.contains(origLine)) { + break; + } + if (!areLinesSimilar(originalLines[origLine - 1], modifiedLines[modLine - 1], timeout2)) { + break; + } + } + if (extendToTop > 0) { + originalSet.addRange(new LineRange(move.original.startLineNumber - extendToTop, move.original.startLineNumber)); + modifiedSet.addRange(new LineRange(move.modified.startLineNumber - extendToTop, move.modified.startLineNumber)); + } + let extendToBottom; + for (extendToBottom = 0; extendToBottom < linesBelow; extendToBottom++) { + const origLine = move.original.endLineNumberExclusive + extendToBottom; + const modLine = move.modified.endLineNumberExclusive + extendToBottom; + if (origLine > originalLines.length || modLine > modifiedLines.length) { + break; + } + if (modifiedSet.contains(modLine) || originalSet.contains(origLine)) { + break; + } + if (!areLinesSimilar(originalLines[origLine - 1], modifiedLines[modLine - 1], timeout2)) { + break; + } + } + if (extendToBottom > 0) { + originalSet.addRange(new LineRange(move.original.endLineNumberExclusive, move.original.endLineNumberExclusive + extendToBottom)); + modifiedSet.addRange(new LineRange(move.modified.endLineNumberExclusive, move.modified.endLineNumberExclusive + extendToBottom)); + } + if (extendToTop > 0 || extendToBottom > 0) { + moves[i2] = new LineRangeMapping(new LineRange(move.original.startLineNumber - extendToTop, move.original.endLineNumberExclusive + extendToBottom), new LineRange(move.modified.startLineNumber - extendToTop, move.modified.endLineNumberExclusive + extendToBottom)); + } + } + return moves; +} +function areLinesSimilar(line1, line2, timeout2) { + if (line1.trim() === line2.trim()) { + return true; + } + if (line1.length > 300 && line2.length > 300) { + return false; + } + const myersDiffingAlgorithm = new MyersDiffAlgorithm(); + const result = myersDiffingAlgorithm.compute(new LinesSliceCharSequence([line1], new Range(1, 1, 1, line1.length), false), new LinesSliceCharSequence([line2], new Range(1, 1, 1, line2.length), false), timeout2); + let commonNonSpaceCharCount = 0; + const inverted = SequenceDiff.invert(result.diffs, line1.length); + for (const seq of inverted) { + seq.seq1Range.forEach((idx) => { + if (!isSpace(line1.charCodeAt(idx))) { + commonNonSpaceCharCount++; + } + }); + } + function countNonWsChars(str) { + let count = 0; + for (let i2 = 0; i2 < line1.length; i2++) { + if (!isSpace(str.charCodeAt(i2))) { + count++; + } + } + return count; + } + const longerLineLength = countNonWsChars(line1.length > line2.length ? line1 : line2); + const r = commonNonSpaceCharCount / longerLineLength > 0.6 && longerLineLength > 10; + return r; +} +function joinCloseConsecutiveMoves(moves) { + if (moves.length === 0) { + return moves; + } + moves.sort(compareBy((m) => m.original.startLineNumber, numberComparator)); + const result = [moves[0]]; + for (let i2 = 1; i2 < moves.length; i2++) { + const last = result[result.length - 1]; + const current = moves[i2]; + const originalDist = current.original.startLineNumber - last.original.endLineNumberExclusive; + const modifiedDist = current.modified.startLineNumber - last.modified.endLineNumberExclusive; + const currentMoveAfterLast = originalDist >= 0 && modifiedDist >= 0; + if (currentMoveAfterLast && originalDist + modifiedDist <= 2) { + result[result.length - 1] = last.join(current); + continue; + } + result.push(current); + } + return result; +} +function removeMovesInSameDiff(changes, moves) { + const changesMonotonous = new MonotonousArray(changes); + moves = moves.filter((m) => { + const diffBeforeEndOfMoveOriginal = changesMonotonous.findLastMonotonous((c) => c.original.startLineNumber < m.original.endLineNumberExclusive) || new LineRangeMapping(new LineRange(1, 1), new LineRange(1, 1)); + const diffBeforeEndOfMoveModified = findLastMonotonous(changes, (c) => c.modified.startLineNumber < m.modified.endLineNumberExclusive); + const differentDiffs = diffBeforeEndOfMoveOriginal !== diffBeforeEndOfMoveModified; + return differentDiffs; + }); + return moves; +} + +// node_modules/monaco-editor-core/esm/vs/editor/common/diff/defaultLinesDiffComputer/heuristicSequenceOptimizations.js +init_arrays(); +init_offsetRange(); +function optimizeSequenceDiffs(sequence1, sequence2, sequenceDiffs) { + let result = sequenceDiffs; + result = joinSequenceDiffsByShifting(sequence1, sequence2, result); + result = joinSequenceDiffsByShifting(sequence1, sequence2, result); + result = shiftSequenceDiffs(sequence1, sequence2, result); + return result; +} +function joinSequenceDiffsByShifting(sequence1, sequence2, sequenceDiffs) { + if (sequenceDiffs.length === 0) { + return sequenceDiffs; + } + const result = []; + result.push(sequenceDiffs[0]); + for (let i2 = 1; i2 < sequenceDiffs.length; i2++) { + const prevResult = result[result.length - 1]; + let cur = sequenceDiffs[i2]; + if (cur.seq1Range.isEmpty || cur.seq2Range.isEmpty) { + const length = cur.seq1Range.start - prevResult.seq1Range.endExclusive; + let d; + for (d = 1; d <= length; d++) { + if (sequence1.getElement(cur.seq1Range.start - d) !== sequence1.getElement(cur.seq1Range.endExclusive - d) || sequence2.getElement(cur.seq2Range.start - d) !== sequence2.getElement(cur.seq2Range.endExclusive - d)) { + break; + } + } + d--; + if (d === length) { + result[result.length - 1] = new SequenceDiff(new OffsetRange(prevResult.seq1Range.start, cur.seq1Range.endExclusive - length), new OffsetRange(prevResult.seq2Range.start, cur.seq2Range.endExclusive - length)); + continue; + } + cur = cur.delta(-d); + } + result.push(cur); + } + const result2 = []; + for (let i2 = 0; i2 < result.length - 1; i2++) { + const nextResult = result[i2 + 1]; + let cur = result[i2]; + if (cur.seq1Range.isEmpty || cur.seq2Range.isEmpty) { + const length = nextResult.seq1Range.start - cur.seq1Range.endExclusive; + let d; + for (d = 0; d < length; d++) { + if (!sequence1.isStronglyEqual(cur.seq1Range.start + d, cur.seq1Range.endExclusive + d) || !sequence2.isStronglyEqual(cur.seq2Range.start + d, cur.seq2Range.endExclusive + d)) { + break; + } + } + if (d === length) { + result[i2 + 1] = new SequenceDiff(new OffsetRange(cur.seq1Range.start + length, nextResult.seq1Range.endExclusive), new OffsetRange(cur.seq2Range.start + length, nextResult.seq2Range.endExclusive)); + continue; + } + if (d > 0) { + cur = cur.delta(d); + } + } + result2.push(cur); + } + if (result.length > 0) { + result2.push(result[result.length - 1]); + } + return result2; +} +function shiftSequenceDiffs(sequence1, sequence2, sequenceDiffs) { + if (!sequence1.getBoundaryScore || !sequence2.getBoundaryScore) { + return sequenceDiffs; + } + for (let i2 = 0; i2 < sequenceDiffs.length; i2++) { + const prevDiff = i2 > 0 ? sequenceDiffs[i2 - 1] : void 0; + const diff = sequenceDiffs[i2]; + const nextDiff = i2 + 1 < sequenceDiffs.length ? sequenceDiffs[i2 + 1] : void 0; + const seq1ValidRange = new OffsetRange(prevDiff ? prevDiff.seq1Range.endExclusive + 1 : 0, nextDiff ? nextDiff.seq1Range.start - 1 : sequence1.length); + const seq2ValidRange = new OffsetRange(prevDiff ? prevDiff.seq2Range.endExclusive + 1 : 0, nextDiff ? nextDiff.seq2Range.start - 1 : sequence2.length); + if (diff.seq1Range.isEmpty) { + sequenceDiffs[i2] = shiftDiffToBetterPosition(diff, sequence1, sequence2, seq1ValidRange, seq2ValidRange); + } else if (diff.seq2Range.isEmpty) { + sequenceDiffs[i2] = shiftDiffToBetterPosition(diff.swap(), sequence2, sequence1, seq2ValidRange, seq1ValidRange).swap(); + } + } + return sequenceDiffs; +} +function shiftDiffToBetterPosition(diff, sequence1, sequence2, seq1ValidRange, seq2ValidRange) { + const maxShiftLimit = 100; + let deltaBefore = 1; + while (diff.seq1Range.start - deltaBefore >= seq1ValidRange.start && diff.seq2Range.start - deltaBefore >= seq2ValidRange.start && sequence2.isStronglyEqual(diff.seq2Range.start - deltaBefore, diff.seq2Range.endExclusive - deltaBefore) && deltaBefore < maxShiftLimit) { + deltaBefore++; + } + deltaBefore--; + let deltaAfter = 0; + while (diff.seq1Range.start + deltaAfter < seq1ValidRange.endExclusive && diff.seq2Range.endExclusive + deltaAfter < seq2ValidRange.endExclusive && sequence2.isStronglyEqual(diff.seq2Range.start + deltaAfter, diff.seq2Range.endExclusive + deltaAfter) && deltaAfter < maxShiftLimit) { + deltaAfter++; + } + if (deltaBefore === 0 && deltaAfter === 0) { + return diff; + } + let bestDelta = 0; + let bestScore = -1; + for (let delta = -deltaBefore; delta <= deltaAfter; delta++) { + const seq2OffsetStart = diff.seq2Range.start + delta; + const seq2OffsetEndExclusive = diff.seq2Range.endExclusive + delta; + const seq1Offset = diff.seq1Range.start + delta; + const score3 = sequence1.getBoundaryScore(seq1Offset) + sequence2.getBoundaryScore(seq2OffsetStart) + sequence2.getBoundaryScore(seq2OffsetEndExclusive); + if (score3 > bestScore) { + bestScore = score3; + bestDelta = delta; + } + } + return diff.delta(bestDelta); +} +function removeShortMatches(sequence1, sequence2, sequenceDiffs) { + const result = []; + for (const s of sequenceDiffs) { + const last = result[result.length - 1]; + if (!last) { + result.push(s); + continue; + } + if (s.seq1Range.start - last.seq1Range.endExclusive <= 2 || s.seq2Range.start - last.seq2Range.endExclusive <= 2) { + result[result.length - 1] = new SequenceDiff(last.seq1Range.join(s.seq1Range), last.seq2Range.join(s.seq2Range)); + } else { + result.push(s); + } + } + return result; +} +function extendDiffsToEntireWordIfAppropriate(sequence1, sequence2, sequenceDiffs, findParent, force = false) { + const equalMappings = SequenceDiff.invert(sequenceDiffs, sequence1.length); + const additional = []; + let lastPoint = new OffsetPair(0, 0); + function scanWord(pair, equalMapping) { + if (pair.offset1 < lastPoint.offset1 || pair.offset2 < lastPoint.offset2) { + return; + } + const w1 = findParent(sequence1, pair.offset1); + const w2 = findParent(sequence2, pair.offset2); + if (!w1 || !w2) { + return; + } + let w = new SequenceDiff(w1, w2); + const equalPart = w.intersect(equalMapping); + let equalChars1 = equalPart.seq1Range.length; + let equalChars2 = equalPart.seq2Range.length; + while (equalMappings.length > 0) { + const next = equalMappings[0]; + const intersects2 = next.seq1Range.intersects(w.seq1Range) || next.seq2Range.intersects(w.seq2Range); + if (!intersects2) { + break; + } + const v1 = findParent(sequence1, next.seq1Range.start); + const v2 = findParent(sequence2, next.seq2Range.start); + const v = new SequenceDiff(v1, v2); + const equalPart2 = v.intersect(next); + equalChars1 += equalPart2.seq1Range.length; + equalChars2 += equalPart2.seq2Range.length; + w = w.join(v); + if (w.seq1Range.endExclusive >= next.seq1Range.endExclusive) { + equalMappings.shift(); + } else { + break; + } + } + if (force && equalChars1 + equalChars2 < w.seq1Range.length + w.seq2Range.length || equalChars1 + equalChars2 < (w.seq1Range.length + w.seq2Range.length) * 2 / 3) { + additional.push(w); + } + lastPoint = w.getEndExclusives(); + } + while (equalMappings.length > 0) { + const next = equalMappings.shift(); + if (next.seq1Range.isEmpty) { + continue; + } + scanWord(next.getStarts(), next); + scanWord(next.getEndExclusives().delta(-1), next); + } + const merged = mergeSequenceDiffs(sequenceDiffs, additional); + return merged; +} +function mergeSequenceDiffs(sequenceDiffs1, sequenceDiffs2) { + const result = []; + while (sequenceDiffs1.length > 0 || sequenceDiffs2.length > 0) { + const sd1 = sequenceDiffs1[0]; + const sd2 = sequenceDiffs2[0]; + let next; + if (sd1 && (!sd2 || sd1.seq1Range.start < sd2.seq1Range.start)) { + next = sequenceDiffs1.shift(); + } else { + next = sequenceDiffs2.shift(); + } + if (result.length > 0 && result[result.length - 1].seq1Range.endExclusive >= next.seq1Range.start) { + result[result.length - 1] = result[result.length - 1].join(next); + } else { + result.push(next); + } + } + return result; +} +function removeVeryShortMatchingLinesBetweenDiffs(sequence1, _sequence2, sequenceDiffs) { + let diffs = sequenceDiffs; + if (diffs.length === 0) { + return diffs; + } + let counter = 0; + let shouldRepeat; + do { + shouldRepeat = false; + const result = [ + diffs[0] + ]; + for (let i2 = 1; i2 < diffs.length; i2++) { + let shouldJoinDiffs = function(before, after2) { + const unchangedRange = new OffsetRange(lastResult.seq1Range.endExclusive, cur.seq1Range.start); + const unchangedText = sequence1.getText(unchangedRange); + const unchangedTextWithoutWs = unchangedText.replace(/\s/g, ""); + if (unchangedTextWithoutWs.length <= 4 && (before.seq1Range.length + before.seq2Range.length > 5 || after2.seq1Range.length + after2.seq2Range.length > 5)) { + return true; + } + return false; + }; + const cur = diffs[i2]; + const lastResult = result[result.length - 1]; + const shouldJoin = shouldJoinDiffs(lastResult, cur); + if (shouldJoin) { + shouldRepeat = true; + result[result.length - 1] = result[result.length - 1].join(cur); + } else { + result.push(cur); + } + } + diffs = result; + } while (counter++ < 10 && shouldRepeat); + return diffs; +} +function removeVeryShortMatchingTextBetweenLongDiffs(sequence1, sequence2, sequenceDiffs) { + let diffs = sequenceDiffs; + if (diffs.length === 0) { + return diffs; + } + let counter = 0; + let shouldRepeat; + do { + shouldRepeat = false; + const result = [ + diffs[0] + ]; + for (let i2 = 1; i2 < diffs.length; i2++) { + let shouldJoinDiffs = function(before, after2) { + const unchangedRange = new OffsetRange(lastResult.seq1Range.endExclusive, cur.seq1Range.start); + const unchangedLineCount = sequence1.countLinesIn(unchangedRange); + if (unchangedLineCount > 5 || unchangedRange.length > 500) { + return false; + } + const unchangedText = sequence1.getText(unchangedRange).trim(); + if (unchangedText.length > 20 || unchangedText.split(/\r\n|\r|\n/).length > 1) { + return false; + } + const beforeLineCount1 = sequence1.countLinesIn(before.seq1Range); + const beforeSeq1Length = before.seq1Range.length; + const beforeLineCount2 = sequence2.countLinesIn(before.seq2Range); + const beforeSeq2Length = before.seq2Range.length; + const afterLineCount1 = sequence1.countLinesIn(after2.seq1Range); + const afterSeq1Length = after2.seq1Range.length; + const afterLineCount2 = sequence2.countLinesIn(after2.seq2Range); + const afterSeq2Length = after2.seq2Range.length; + const max = 2 * 40 + 50; + function cap(v) { + return Math.min(v, max); + } + if (Math.pow(Math.pow(cap(beforeLineCount1 * 40 + beforeSeq1Length), 1.5) + Math.pow(cap(beforeLineCount2 * 40 + beforeSeq2Length), 1.5), 1.5) + Math.pow(Math.pow(cap(afterLineCount1 * 40 + afterSeq1Length), 1.5) + Math.pow(cap(afterLineCount2 * 40 + afterSeq2Length), 1.5), 1.5) > (max ** 1.5) ** 1.5 * 1.3) { + return true; + } + return false; + }; + const cur = diffs[i2]; + const lastResult = result[result.length - 1]; + const shouldJoin = shouldJoinDiffs(lastResult, cur); + if (shouldJoin) { + shouldRepeat = true; + result[result.length - 1] = result[result.length - 1].join(cur); + } else { + result.push(cur); + } + } + diffs = result; + } while (counter++ < 10 && shouldRepeat); + const newDiffs = []; + forEachWithNeighbors(diffs, (prev, cur, next) => { + let newDiff = cur; + function shouldMarkAsChanged(text2) { + return text2.length > 0 && text2.trim().length <= 3 && cur.seq1Range.length + cur.seq2Range.length > 100; + } + const fullRange1 = sequence1.extendToFullLines(cur.seq1Range); + const prefix = sequence1.getText(new OffsetRange(fullRange1.start, cur.seq1Range.start)); + if (shouldMarkAsChanged(prefix)) { + newDiff = newDiff.deltaStart(-prefix.length); + } + const suffix = sequence1.getText(new OffsetRange(cur.seq1Range.endExclusive, fullRange1.endExclusive)); + if (shouldMarkAsChanged(suffix)) { + newDiff = newDiff.deltaEnd(suffix.length); + } + const availableSpace = SequenceDiff.fromOffsetPairs(prev ? prev.getEndExclusives() : OffsetPair.zero, next ? next.getStarts() : OffsetPair.max); + const result = newDiff.intersect(availableSpace); + if (newDiffs.length > 0 && result.getStarts().equals(newDiffs[newDiffs.length - 1].getEndExclusives())) { + newDiffs[newDiffs.length - 1] = newDiffs[newDiffs.length - 1].join(result); + } else { + newDiffs.push(result); + } + }); + return newDiffs; +} + +// node_modules/monaco-editor-core/esm/vs/editor/common/diff/defaultLinesDiffComputer/lineSequence.js +var LineSequence = class { + constructor(trimmedHash, lines) { + this.trimmedHash = trimmedHash; + this.lines = lines; + } + getElement(offset) { + return this.trimmedHash[offset]; + } + get length() { + return this.trimmedHash.length; + } + getBoundaryScore(length) { + const indentationBefore = length === 0 ? 0 : getIndentation(this.lines[length - 1]); + const indentationAfter = length === this.lines.length ? 0 : getIndentation(this.lines[length]); + return 1e3 - (indentationBefore + indentationAfter); + } + getText(range2) { + return this.lines.slice(range2.start, range2.endExclusive).join("\n"); + } + isStronglyEqual(offset1, offset2) { + return this.lines[offset1] === this.lines[offset2]; + } +}; +function getIndentation(str) { + let i2 = 0; + while (i2 < str.length && (str.charCodeAt(i2) === 32 || str.charCodeAt(i2) === 9)) { + i2++; + } + return i2; +} + +// node_modules/monaco-editor-core/esm/vs/editor/common/diff/defaultLinesDiffComputer/defaultLinesDiffComputer.js +var DefaultLinesDiffComputer = class { + constructor() { + this.dynamicProgrammingDiffing = new DynamicProgrammingDiffing(); + this.myersDiffingAlgorithm = new MyersDiffAlgorithm(); + } + computeDiff(originalLines, modifiedLines, options2) { + if (originalLines.length <= 1 && equals(originalLines, modifiedLines, (a, b) => a === b)) { + return new LinesDiff([], [], false); + } + if (originalLines.length === 1 && originalLines[0].length === 0 || modifiedLines.length === 1 && modifiedLines[0].length === 0) { + return new LinesDiff([ + new DetailedLineRangeMapping(new LineRange(1, originalLines.length + 1), new LineRange(1, modifiedLines.length + 1), [ + new RangeMapping(new Range(1, 1, originalLines.length, originalLines[originalLines.length - 1].length + 1), new Range(1, 1, modifiedLines.length, modifiedLines[modifiedLines.length - 1].length + 1)) + ]) + ], [], false); + } + const timeout2 = options2.maxComputationTimeMs === 0 ? InfiniteTimeout.instance : new DateTimeout(options2.maxComputationTimeMs); + const considerWhitespaceChanges = !options2.ignoreTrimWhitespace; + const perfectHashes = /* @__PURE__ */ new Map(); + function getOrCreateHash(text2) { + let hash2 = perfectHashes.get(text2); + if (hash2 === void 0) { + hash2 = perfectHashes.size; + perfectHashes.set(text2, hash2); + } + return hash2; + } + const originalLinesHashes = originalLines.map((l) => getOrCreateHash(l.trim())); + const modifiedLinesHashes = modifiedLines.map((l) => getOrCreateHash(l.trim())); + const sequence1 = new LineSequence(originalLinesHashes, originalLines); + const sequence2 = new LineSequence(modifiedLinesHashes, modifiedLines); + const lineAlignmentResult = (() => { + if (sequence1.length + sequence2.length < 1700) { + return this.dynamicProgrammingDiffing.compute(sequence1, sequence2, timeout2, (offset1, offset2) => originalLines[offset1] === modifiedLines[offset2] ? modifiedLines[offset2].length === 0 ? 0.1 : 1 + Math.log(1 + modifiedLines[offset2].length) : 0.99); + } + return this.myersDiffingAlgorithm.compute(sequence1, sequence2, timeout2); + })(); + let lineAlignments = lineAlignmentResult.diffs; + let hitTimeout = lineAlignmentResult.hitTimeout; + lineAlignments = optimizeSequenceDiffs(sequence1, sequence2, lineAlignments); + lineAlignments = removeVeryShortMatchingLinesBetweenDiffs(sequence1, sequence2, lineAlignments); + const alignments = []; + const scanForWhitespaceChanges = (equalLinesCount) => { + if (!considerWhitespaceChanges) { + return; + } + for (let i2 = 0; i2 < equalLinesCount; i2++) { + const seq1Offset = seq1LastStart + i2; + const seq2Offset = seq2LastStart + i2; + if (originalLines[seq1Offset] !== modifiedLines[seq2Offset]) { + const characterDiffs = this.refineDiff(originalLines, modifiedLines, new SequenceDiff(new OffsetRange(seq1Offset, seq1Offset + 1), new OffsetRange(seq2Offset, seq2Offset + 1)), timeout2, considerWhitespaceChanges, options2); + for (const a of characterDiffs.mappings) { + alignments.push(a); + } + if (characterDiffs.hitTimeout) { + hitTimeout = true; + } + } + } + }; + let seq1LastStart = 0; + let seq2LastStart = 0; + for (const diff of lineAlignments) { + assertFn(() => diff.seq1Range.start - seq1LastStart === diff.seq2Range.start - seq2LastStart); + const equalLinesCount = diff.seq1Range.start - seq1LastStart; + scanForWhitespaceChanges(equalLinesCount); + seq1LastStart = diff.seq1Range.endExclusive; + seq2LastStart = diff.seq2Range.endExclusive; + const characterDiffs = this.refineDiff(originalLines, modifiedLines, diff, timeout2, considerWhitespaceChanges, options2); + if (characterDiffs.hitTimeout) { + hitTimeout = true; + } + for (const a of characterDiffs.mappings) { + alignments.push(a); + } + } + scanForWhitespaceChanges(originalLines.length - seq1LastStart); + const original = new ArrayText(originalLines); + const modified = new ArrayText(modifiedLines); + const changes = lineRangeMappingFromRangeMappings(alignments, original, modified); + let moves = []; + if (options2.computeMoves) { + moves = this.computeMoves(changes, originalLines, modifiedLines, originalLinesHashes, modifiedLinesHashes, timeout2, considerWhitespaceChanges, options2); + } + assertFn(() => { + function validatePosition(pos, lines) { + if (pos.lineNumber < 1 || pos.lineNumber > lines.length) { + return false; + } + const line = lines[pos.lineNumber - 1]; + if (pos.column < 1 || pos.column > line.length + 1) { + return false; + } + return true; + } + function validateRange(range2, lines) { + if (range2.startLineNumber < 1 || range2.startLineNumber > lines.length + 1) { + return false; + } + if (range2.endLineNumberExclusive < 1 || range2.endLineNumberExclusive > lines.length + 1) { + return false; + } + return true; + } + for (const c of changes) { + if (!c.innerChanges) { + return false; + } + for (const ic of c.innerChanges) { + const valid = validatePosition(ic.modifiedRange.getStartPosition(), modifiedLines) && validatePosition(ic.modifiedRange.getEndPosition(), modifiedLines) && validatePosition(ic.originalRange.getStartPosition(), originalLines) && validatePosition(ic.originalRange.getEndPosition(), originalLines); + if (!valid) { + return false; + } + } + if (!validateRange(c.modified, modifiedLines) || !validateRange(c.original, originalLines)) { + return false; + } + } + return true; + }); + return new LinesDiff(changes, moves, hitTimeout); + } + computeMoves(changes, originalLines, modifiedLines, hashedOriginalLines, hashedModifiedLines, timeout2, considerWhitespaceChanges, options2) { + const moves = computeMovedLines(changes, originalLines, modifiedLines, hashedOriginalLines, hashedModifiedLines, timeout2); + const movesWithDiffs = moves.map((m) => { + const moveChanges = this.refineDiff(originalLines, modifiedLines, new SequenceDiff(m.original.toOffsetRange(), m.modified.toOffsetRange()), timeout2, considerWhitespaceChanges, options2); + const mappings = lineRangeMappingFromRangeMappings(moveChanges.mappings, new ArrayText(originalLines), new ArrayText(modifiedLines), true); + return new MovedText(m, mappings); + }); + return movesWithDiffs; + } + refineDiff(originalLines, modifiedLines, diff, timeout2, considerWhitespaceChanges, options2) { + const lineRangeMapping = toLineRangeMapping(diff); + const rangeMapping = lineRangeMapping.toRangeMapping2(originalLines, modifiedLines); + const slice1 = new LinesSliceCharSequence(originalLines, rangeMapping.originalRange, considerWhitespaceChanges); + const slice2 = new LinesSliceCharSequence(modifiedLines, rangeMapping.modifiedRange, considerWhitespaceChanges); + const diffResult = slice1.length + slice2.length < 500 ? this.dynamicProgrammingDiffing.compute(slice1, slice2, timeout2) : this.myersDiffingAlgorithm.compute(slice1, slice2, timeout2); + const check = false; + let diffs = diffResult.diffs; + if (check) { + SequenceDiff.assertSorted(diffs); + } + diffs = optimizeSequenceDiffs(slice1, slice2, diffs); + if (check) { + SequenceDiff.assertSorted(diffs); + } + diffs = extendDiffsToEntireWordIfAppropriate(slice1, slice2, diffs, (seq, idx) => seq.findWordContaining(idx)); + if (check) { + SequenceDiff.assertSorted(diffs); + } + if (options2.extendToSubwords) { + diffs = extendDiffsToEntireWordIfAppropriate(slice1, slice2, diffs, (seq, idx) => seq.findSubWordContaining(idx), true); + if (check) { + SequenceDiff.assertSorted(diffs); + } + } + diffs = removeShortMatches(slice1, slice2, diffs); + if (check) { + SequenceDiff.assertSorted(diffs); + } + diffs = removeVeryShortMatchingTextBetweenLongDiffs(slice1, slice2, diffs); + if (check) { + SequenceDiff.assertSorted(diffs); + } + const result = diffs.map((d) => new RangeMapping(slice1.translateRange(d.seq1Range), slice2.translateRange(d.seq2Range))); + if (check) { + RangeMapping.assertSorted(result); + } + return { + mappings: result, + hitTimeout: diffResult.hitTimeout + }; + } +}; +function toLineRangeMapping(sequenceDiff) { + return new LineRangeMapping(new LineRange(sequenceDiff.seq1Range.start + 1, sequenceDiff.seq1Range.endExclusive + 1), new LineRange(sequenceDiff.seq2Range.start + 1, sequenceDiff.seq2Range.endExclusive + 1)); +} + +// node_modules/monaco-editor-core/esm/vs/editor/browser/widget/diffEditor/diffEditorViewModel.js +init_beforeEditPositionMapper(); +init_combineTextEditInfos(); +init_types(); +init_arrays(); +init_assert(); +var __decorate31 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param27 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var DiffEditorViewModel = class DiffEditorViewModel2 extends Disposable { + setActiveMovedText(movedText) { + this._activeMovedText.set(movedText, void 0); + } + constructor(model, _options, _diffProviderFactoryService) { + super(); + this.model = model; + this._options = _options; + this._diffProviderFactoryService = _diffProviderFactoryService; + this._isDiffUpToDate = observableValue(this, false); + this.isDiffUpToDate = this._isDiffUpToDate; + this._diff = observableValue(this, void 0); + this.diff = this._diff; + this._unchangedRegions = observableValue(this, void 0); + this.unchangedRegions = derived(this, (r) => { + if (this._options.hideUnchangedRegions.read(r)) { + return this._unchangedRegions.read(r)?.regions ?? []; + } else { + transaction((tx) => { + for (const r2 of this._unchangedRegions.read(void 0)?.regions || []) { + r2.collapseAll(tx); + } + }); + return []; + } + }); + this.movedTextToCompare = observableValue(this, void 0); + this._activeMovedText = observableValue(this, void 0); + this._hoveredMovedText = observableValue(this, void 0); + this.activeMovedText = derived(this, (r) => this.movedTextToCompare.read(r) ?? this._hoveredMovedText.read(r) ?? this._activeMovedText.read(r)); + this._cancellationTokenSource = new CancellationTokenSource(); + this._diffProvider = derived(this, (reader) => { + const diffProvider = this._diffProviderFactoryService.createDiffProvider({ + diffAlgorithm: this._options.diffAlgorithm.read(reader) + }); + const onChangeSignal = observableSignalFromEvent("onDidChange", diffProvider.onDidChange); + return { + diffProvider, + onChangeSignal + }; + }); + this._register(toDisposable(() => this._cancellationTokenSource.cancel())); + const contentChangedSignal = observableSignal("contentChangedSignal"); + const debouncer = this._register(new RunOnceScheduler(() => contentChangedSignal.trigger(void 0), 200)); + this._register(autorun((reader) => { + const lastUnchangedRegions = this._unchangedRegions.read(reader); + if (!lastUnchangedRegions || lastUnchangedRegions.regions.some((r) => r.isDragged.read(reader))) { + return; + } + const lastUnchangedRegionsOrigRanges = lastUnchangedRegions.originalDecorationIds.map((id) => model.original.getDecorationRange(id)).map((r) => r ? LineRange.fromRangeInclusive(r) : void 0); + const lastUnchangedRegionsModRanges = lastUnchangedRegions.modifiedDecorationIds.map((id) => model.modified.getDecorationRange(id)).map((r) => r ? LineRange.fromRangeInclusive(r) : void 0); + const updatedLastUnchangedRegions = lastUnchangedRegions.regions.map((r, idx) => !lastUnchangedRegionsOrigRanges[idx] || !lastUnchangedRegionsModRanges[idx] ? void 0 : new UnchangedRegion(lastUnchangedRegionsOrigRanges[idx].startLineNumber, lastUnchangedRegionsModRanges[idx].startLineNumber, lastUnchangedRegionsOrigRanges[idx].length, r.visibleLineCountTop.read(reader), r.visibleLineCountBottom.read(reader))).filter(isDefined); + const newRanges = []; + let didChange = false; + for (const touching of groupAdjacentBy(updatedLastUnchangedRegions, (a, b) => a.getHiddenModifiedRange(reader).endLineNumberExclusive === b.getHiddenModifiedRange(reader).startLineNumber)) { + if (touching.length > 1) { + didChange = true; + const sumLineCount = touching.reduce((sum2, r2) => sum2 + r2.lineCount, 0); + const r = new UnchangedRegion(touching[0].originalLineNumber, touching[0].modifiedLineNumber, sumLineCount, touching[0].visibleLineCountTop.read(void 0), touching[touching.length - 1].visibleLineCountBottom.read(void 0)); + newRanges.push(r); + } else { + newRanges.push(touching[0]); + } + } + if (didChange) { + const originalDecorationIds = model.original.deltaDecorations(lastUnchangedRegions.originalDecorationIds, newRanges.map((r) => ({ range: r.originalUnchangedRange.toInclusiveRange(), options: { description: "unchanged" } }))); + const modifiedDecorationIds = model.modified.deltaDecorations(lastUnchangedRegions.modifiedDecorationIds, newRanges.map((r) => ({ range: r.modifiedUnchangedRange.toInclusiveRange(), options: { description: "unchanged" } }))); + transaction((tx) => { + this._unchangedRegions.set({ + regions: newRanges, + originalDecorationIds, + modifiedDecorationIds + }, tx); + }); + } + })); + const updateUnchangedRegions = (result, tx, reader) => { + const newUnchangedRegions = UnchangedRegion.fromDiffs(result.changes, model.original.getLineCount(), model.modified.getLineCount(), this._options.hideUnchangedRegionsMinimumLineCount.read(reader), this._options.hideUnchangedRegionsContextLineCount.read(reader)); + let visibleRegions = void 0; + const lastUnchangedRegions = this._unchangedRegions.get(); + if (lastUnchangedRegions) { + const lastUnchangedRegionsOrigRanges = lastUnchangedRegions.originalDecorationIds.map((id) => model.original.getDecorationRange(id)).map((r) => r ? LineRange.fromRangeInclusive(r) : void 0); + const lastUnchangedRegionsModRanges = lastUnchangedRegions.modifiedDecorationIds.map((id) => model.modified.getDecorationRange(id)).map((r) => r ? LineRange.fromRangeInclusive(r) : void 0); + const updatedLastUnchangedRegions = filterWithPrevious(lastUnchangedRegions.regions.map((r, idx) => { + if (!lastUnchangedRegionsOrigRanges[idx] || !lastUnchangedRegionsModRanges[idx]) { + return void 0; + } + const length = lastUnchangedRegionsOrigRanges[idx].length; + return new UnchangedRegion( + lastUnchangedRegionsOrigRanges[idx].startLineNumber, + lastUnchangedRegionsModRanges[idx].startLineNumber, + length, + // The visible area can shrink by edits -> we have to account for this + Math.min(r.visibleLineCountTop.get(), length), + Math.min(r.visibleLineCountBottom.get(), length - r.visibleLineCountTop.get()) + ); + }).filter(isDefined), (cur, prev) => !prev || cur.modifiedLineNumber >= prev.modifiedLineNumber + prev.lineCount && cur.originalLineNumber >= prev.originalLineNumber + prev.lineCount); + let hiddenRegions = updatedLastUnchangedRegions.map((r) => new LineRangeMapping(r.getHiddenOriginalRange(reader), r.getHiddenModifiedRange(reader))); + hiddenRegions = LineRangeMapping.clip(hiddenRegions, LineRange.ofLength(1, model.original.getLineCount()), LineRange.ofLength(1, model.modified.getLineCount())); + visibleRegions = LineRangeMapping.inverse(hiddenRegions, model.original.getLineCount(), model.modified.getLineCount()); + } + const newUnchangedRegions2 = []; + if (visibleRegions) { + for (const r of newUnchangedRegions) { + const intersecting = visibleRegions.filter((f) => f.original.intersectsStrict(r.originalUnchangedRange) && f.modified.intersectsStrict(r.modifiedUnchangedRange)); + newUnchangedRegions2.push(...r.setVisibleRanges(intersecting, tx)); + } + } else { + newUnchangedRegions2.push(...newUnchangedRegions); + } + const originalDecorationIds = model.original.deltaDecorations(lastUnchangedRegions?.originalDecorationIds || [], newUnchangedRegions2.map((r) => ({ range: r.originalUnchangedRange.toInclusiveRange(), options: { description: "unchanged" } }))); + const modifiedDecorationIds = model.modified.deltaDecorations(lastUnchangedRegions?.modifiedDecorationIds || [], newUnchangedRegions2.map((r) => ({ range: r.modifiedUnchangedRange.toInclusiveRange(), options: { description: "unchanged" } }))); + this._unchangedRegions.set({ + regions: newUnchangedRegions2, + originalDecorationIds, + modifiedDecorationIds + }, tx); + }; + this._register(model.modified.onDidChangeContent((e) => { + const diff = this._diff.get(); + if (diff) { + const textEdits = TextEditInfo.fromModelContentChanges(e.changes); + const result = applyModifiedEdits(this._lastDiff, textEdits, model.original, model.modified); + if (result) { + this._lastDiff = result; + transaction((tx) => { + this._diff.set(DiffState.fromDiffResult(this._lastDiff), tx); + updateUnchangedRegions(result, tx); + const currentSyncedMovedText = this.movedTextToCompare.get(); + this.movedTextToCompare.set(currentSyncedMovedText ? this._lastDiff.moves.find((m) => m.lineRangeMapping.modified.intersect(currentSyncedMovedText.lineRangeMapping.modified)) : void 0, tx); + }); + } + } + this._isDiffUpToDate.set(false, void 0); + debouncer.schedule(); + })); + this._register(model.original.onDidChangeContent((e) => { + const diff = this._diff.get(); + if (diff) { + const textEdits = TextEditInfo.fromModelContentChanges(e.changes); + const result = applyOriginalEdits(this._lastDiff, textEdits, model.original, model.modified); + if (result) { + this._lastDiff = result; + transaction((tx) => { + this._diff.set(DiffState.fromDiffResult(this._lastDiff), tx); + updateUnchangedRegions(result, tx); + const currentSyncedMovedText = this.movedTextToCompare.get(); + this.movedTextToCompare.set(currentSyncedMovedText ? this._lastDiff.moves.find((m) => m.lineRangeMapping.modified.intersect(currentSyncedMovedText.lineRangeMapping.modified)) : void 0, tx); + }); + } + } + this._isDiffUpToDate.set(false, void 0); + debouncer.schedule(); + })); + this._register(autorunWithStore(async (reader, store) => { + this._options.hideUnchangedRegionsMinimumLineCount.read(reader); + this._options.hideUnchangedRegionsContextLineCount.read(reader); + debouncer.cancel(); + contentChangedSignal.read(reader); + const documentDiffProvider = this._diffProvider.read(reader); + documentDiffProvider.onChangeSignal.read(reader); + readHotReloadableExport(DefaultLinesDiffComputer, reader); + readHotReloadableExport(optimizeSequenceDiffs, reader); + this._isDiffUpToDate.set(false, void 0); + let originalTextEditInfos = []; + store.add(model.original.onDidChangeContent((e) => { + const edits = TextEditInfo.fromModelContentChanges(e.changes); + originalTextEditInfos = combineTextEditInfos(originalTextEditInfos, edits); + })); + let modifiedTextEditInfos = []; + store.add(model.modified.onDidChangeContent((e) => { + const edits = TextEditInfo.fromModelContentChanges(e.changes); + modifiedTextEditInfos = combineTextEditInfos(modifiedTextEditInfos, edits); + })); + let result = await documentDiffProvider.diffProvider.computeDiff(model.original, model.modified, { + ignoreTrimWhitespace: this._options.ignoreTrimWhitespace.read(reader), + maxComputationTimeMs: this._options.maxComputationTimeMs.read(reader), + computeMoves: this._options.showMoves.read(reader) + }, this._cancellationTokenSource.token); + if (this._cancellationTokenSource.token.isCancellationRequested) { + return; + } + if (model.original.isDisposed() || model.modified.isDisposed()) { + return; + } + result = normalizeDocumentDiff(result, model.original, model.modified); + result = applyOriginalEdits(result, originalTextEditInfos, model.original, model.modified) ?? result; + result = applyModifiedEdits(result, modifiedTextEditInfos, model.original, model.modified) ?? result; + transaction((tx) => { + updateUnchangedRegions(result, tx); + this._lastDiff = result; + const state = DiffState.fromDiffResult(result); + this._diff.set(state, tx); + this._isDiffUpToDate.set(true, tx); + const currentSyncedMovedText = this.movedTextToCompare.read(void 0); + this.movedTextToCompare.set(currentSyncedMovedText ? this._lastDiff.moves.find((m) => m.lineRangeMapping.modified.intersect(currentSyncedMovedText.lineRangeMapping.modified)) : void 0, tx); + }); + })); + } + ensureModifiedLineIsVisible(lineNumber, preference, tx) { + if (this.diff.get()?.mappings.length === 0) { + return; + } + const unchangedRegions = this._unchangedRegions.get()?.regions || []; + for (const r of unchangedRegions) { + if (r.getHiddenModifiedRange(void 0).contains(lineNumber)) { + r.showModifiedLine(lineNumber, preference, tx); + return; + } + } + } + ensureOriginalLineIsVisible(lineNumber, preference, tx) { + if (this.diff.get()?.mappings.length === 0) { + return; + } + const unchangedRegions = this._unchangedRegions.get()?.regions || []; + for (const r of unchangedRegions) { + if (r.getHiddenOriginalRange(void 0).contains(lineNumber)) { + r.showOriginalLine(lineNumber, preference, tx); + return; + } + } + } + async waitForDiff() { + await waitForState(this.isDiffUpToDate, (s) => s); + } + serializeState() { + const regions = this._unchangedRegions.get(); + return { + collapsedRegions: regions?.regions.map((r) => ({ range: r.getHiddenModifiedRange(void 0).serialize() })) + }; + } + restoreSerializedState(state) { + const ranges = state.collapsedRegions?.map((r) => LineRange.deserialize(r.range)); + const regions = this._unchangedRegions.get(); + if (!regions || !ranges) { + return; + } + transaction((tx) => { + for (const r of regions.regions) { + for (const range2 of ranges) { + if (r.modifiedUnchangedRange.intersect(range2)) { + r.setHiddenModifiedRange(range2, tx); + break; + } + } + } + }); + } +}; +DiffEditorViewModel = __decorate31([ + __param27(2, IDiffProviderFactoryService) +], DiffEditorViewModel); +function normalizeDocumentDiff(diff, original, modified) { + return { + changes: diff.changes.map((c) => new DetailedLineRangeMapping(c.original, c.modified, c.innerChanges ? c.innerChanges.map((i2) => normalizeRangeMapping(i2, original, modified)) : void 0)), + moves: diff.moves, + identical: diff.identical, + quitEarly: diff.quitEarly + }; +} +function normalizeRangeMapping(rangeMapping, original, modified) { + let originalRange = rangeMapping.originalRange; + let modifiedRange = rangeMapping.modifiedRange; + if (originalRange.startColumn === 1 && modifiedRange.startColumn === 1 && (originalRange.endColumn !== 1 || modifiedRange.endColumn !== 1) && originalRange.endColumn === original.getLineMaxColumn(originalRange.endLineNumber) && modifiedRange.endColumn === modified.getLineMaxColumn(modifiedRange.endLineNumber) && originalRange.endLineNumber < original.getLineCount() && modifiedRange.endLineNumber < modified.getLineCount()) { + originalRange = originalRange.setEndPosition(originalRange.endLineNumber + 1, 1); + modifiedRange = modifiedRange.setEndPosition(modifiedRange.endLineNumber + 1, 1); + } + return new RangeMapping(originalRange, modifiedRange); +} +var DiffState = class _DiffState { + static fromDiffResult(result) { + return new _DiffState(result.changes.map((c) => new DiffMapping(c)), result.moves || [], result.identical, result.quitEarly); + } + constructor(mappings, movedTexts, identical, quitEarly) { + this.mappings = mappings; + this.movedTexts = movedTexts; + this.identical = identical; + this.quitEarly = quitEarly; + } +}; +var DiffMapping = class { + constructor(lineRangeMapping) { + this.lineRangeMapping = lineRangeMapping; + } +}; +var UnchangedRegion = class _UnchangedRegion { + static fromDiffs(changes, originalLineCount, modifiedLineCount, minHiddenLineCount, minContext) { + const inversedMappings = DetailedLineRangeMapping.inverse(changes, originalLineCount, modifiedLineCount); + const result = []; + for (const mapping of inversedMappings) { + let origStart = mapping.original.startLineNumber; + let modStart = mapping.modified.startLineNumber; + let length = mapping.original.length; + const atStart = origStart === 1 && modStart === 1; + const atEnd = origStart + length === originalLineCount + 1 && modStart + length === modifiedLineCount + 1; + if ((atStart || atEnd) && length >= minContext + minHiddenLineCount) { + if (atStart && !atEnd) { + length -= minContext; + } + if (atEnd && !atStart) { + origStart += minContext; + modStart += minContext; + length -= minContext; + } + result.push(new _UnchangedRegion(origStart, modStart, length, 0, 0)); + } else if (length >= minContext * 2 + minHiddenLineCount) { + origStart += minContext; + modStart += minContext; + length -= minContext * 2; + result.push(new _UnchangedRegion(origStart, modStart, length, 0, 0)); + } + } + return result; + } + get originalUnchangedRange() { + return LineRange.ofLength(this.originalLineNumber, this.lineCount); + } + get modifiedUnchangedRange() { + return LineRange.ofLength(this.modifiedLineNumber, this.lineCount); + } + constructor(originalLineNumber, modifiedLineNumber, lineCount, visibleLineCountTop, visibleLineCountBottom) { + this.originalLineNumber = originalLineNumber; + this.modifiedLineNumber = modifiedLineNumber; + this.lineCount = lineCount; + this._visibleLineCountTop = observableValue(this, 0); + this.visibleLineCountTop = this._visibleLineCountTop; + this._visibleLineCountBottom = observableValue(this, 0); + this.visibleLineCountBottom = this._visibleLineCountBottom; + this._shouldHideControls = derived(this, (reader) => ( + /** @description isVisible */ + this.visibleLineCountTop.read(reader) + this.visibleLineCountBottom.read(reader) === this.lineCount && !this.isDragged.read(reader) + )); + this.isDragged = observableValue(this, void 0); + const visibleLineCountTop2 = Math.max(Math.min(visibleLineCountTop, this.lineCount), 0); + const visibleLineCountBottom2 = Math.max(Math.min(visibleLineCountBottom, this.lineCount - visibleLineCountTop), 0); + softAssert(visibleLineCountTop === visibleLineCountTop2); + softAssert(visibleLineCountBottom === visibleLineCountBottom2); + this._visibleLineCountTop.set(visibleLineCountTop2, void 0); + this._visibleLineCountBottom.set(visibleLineCountBottom2, void 0); + } + setVisibleRanges(visibleRanges, tx) { + const result = []; + const hiddenModified = new LineRangeSet(visibleRanges.map((r) => r.modified)).subtractFrom(this.modifiedUnchangedRange); + let originalStartLineNumber = this.originalLineNumber; + let modifiedStartLineNumber = this.modifiedLineNumber; + const modifiedEndLineNumberEx = this.modifiedLineNumber + this.lineCount; + if (hiddenModified.ranges.length === 0) { + this.showAll(tx); + result.push(this); + } else { + let i2 = 0; + for (const r of hiddenModified.ranges) { + const isLast = i2 === hiddenModified.ranges.length - 1; + i2++; + const length = (isLast ? modifiedEndLineNumberEx : r.endLineNumberExclusive) - modifiedStartLineNumber; + const newR = new _UnchangedRegion(originalStartLineNumber, modifiedStartLineNumber, length, 0, 0); + newR.setHiddenModifiedRange(r, tx); + result.push(newR); + originalStartLineNumber = newR.originalUnchangedRange.endLineNumberExclusive; + modifiedStartLineNumber = newR.modifiedUnchangedRange.endLineNumberExclusive; + } + } + return result; + } + shouldHideControls(reader) { + return this._shouldHideControls.read(reader); + } + getHiddenOriginalRange(reader) { + return LineRange.ofLength(this.originalLineNumber + this._visibleLineCountTop.read(reader), this.lineCount - this._visibleLineCountTop.read(reader) - this._visibleLineCountBottom.read(reader)); + } + getHiddenModifiedRange(reader) { + return LineRange.ofLength(this.modifiedLineNumber + this._visibleLineCountTop.read(reader), this.lineCount - this._visibleLineCountTop.read(reader) - this._visibleLineCountBottom.read(reader)); + } + setHiddenModifiedRange(range2, tx) { + const visibleLineCountTop = range2.startLineNumber - this.modifiedLineNumber; + const visibleLineCountBottom = this.modifiedLineNumber + this.lineCount - range2.endLineNumberExclusive; + this.setState(visibleLineCountTop, visibleLineCountBottom, tx); + } + getMaxVisibleLineCountTop() { + return this.lineCount - this._visibleLineCountBottom.get(); + } + getMaxVisibleLineCountBottom() { + return this.lineCount - this._visibleLineCountTop.get(); + } + showMoreAbove(count = 10, tx) { + const maxVisibleLineCountTop = this.getMaxVisibleLineCountTop(); + this._visibleLineCountTop.set(Math.min(this._visibleLineCountTop.get() + count, maxVisibleLineCountTop), tx); + } + showMoreBelow(count = 10, tx) { + const maxVisibleLineCountBottom = this.lineCount - this._visibleLineCountTop.get(); + this._visibleLineCountBottom.set(Math.min(this._visibleLineCountBottom.get() + count, maxVisibleLineCountBottom), tx); + } + showAll(tx) { + this._visibleLineCountBottom.set(this.lineCount - this._visibleLineCountTop.get(), tx); + } + showModifiedLine(lineNumber, preference, tx) { + const top = lineNumber + 1 - (this.modifiedLineNumber + this._visibleLineCountTop.get()); + const bottom = this.modifiedLineNumber - this._visibleLineCountBottom.get() + this.lineCount - lineNumber; + if (preference === 0 && top < bottom || preference === 1) { + this._visibleLineCountTop.set(this._visibleLineCountTop.get() + top, tx); + } else { + this._visibleLineCountBottom.set(this._visibleLineCountBottom.get() + bottom, tx); + } + } + showOriginalLine(lineNumber, preference, tx) { + const top = lineNumber - this.originalLineNumber; + const bottom = this.originalLineNumber + this.lineCount - lineNumber; + if (preference === 0 && top < bottom || preference === 1) { + this._visibleLineCountTop.set(Math.min(this._visibleLineCountTop.get() + bottom - top, this.getMaxVisibleLineCountTop()), tx); + } else { + this._visibleLineCountBottom.set(Math.min(this._visibleLineCountBottom.get() + top - bottom, this.getMaxVisibleLineCountBottom()), tx); + } + } + collapseAll(tx) { + this._visibleLineCountTop.set(0, tx); + this._visibleLineCountBottom.set(0, tx); + } + setState(visibleLineCountTop, visibleLineCountBottom, tx) { + visibleLineCountTop = Math.max(Math.min(visibleLineCountTop, this.lineCount), 0); + visibleLineCountBottom = Math.max(Math.min(visibleLineCountBottom, this.lineCount - visibleLineCountTop), 0); + this._visibleLineCountTop.set(visibleLineCountTop, tx); + this._visibleLineCountBottom.set(visibleLineCountBottom, tx); + } +}; +function applyOriginalEdits(diff, textEdits, originalTextModel, modifiedTextModel) { + return void 0; +} +function applyModifiedEdits(diff, textEdits, originalTextModel, modifiedTextModel) { + return void 0; +} + +// node_modules/monaco-editor-core/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/inlineDiffDeletedCodeMargin.js +init_dom(); +init_actions(); +init_codicons(); +init_lifecycle(); +init_platform(); +init_themables(); +init_nls(); + +// node_modules/monaco-editor-core/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/copySelection.js +init_dom(); +init_lifecycle(); +init_range(); +function enableCopySelection(options2) { + const { domNode, renderLinesResult, diffEntry, originalModel, clipboardService } = options2; + const viewZoneDisposable = new DisposableStore(); + viewZoneDisposable.add(addDisposableListener(domNode, "copy", (e) => { + e.preventDefault(); + const selection = domNode.ownerDocument.getSelection(); + if (!selection || selection.rangeCount === 0) { + return; + } + const domRange = selection.getRangeAt(0); + if (!domRange || domRange.collapsed) { + return; + } + const startElement = domRange.startContainer.nodeType === Node.TEXT_NODE ? domRange.startContainer.parentElement : domRange.startContainer; + const endElement = domRange.endContainer.nodeType === Node.TEXT_NODE ? domRange.endContainer.parentElement : domRange.endContainer; + if (!startElement || !endElement) { + return; + } + const startPosition = renderLinesResult.getModelPositionAt(startElement, domRange.startOffset); + const endPosition = renderLinesResult.getModelPositionAt(endElement, domRange.endOffset); + if (!startPosition || !endPosition) { + return; + } + const adjustedStart = startPosition.delta(diffEntry.original.startLineNumber - 1); + const adjustedEnd = endPosition.delta(diffEntry.original.startLineNumber - 1); + const range2 = adjustedEnd.isBefore(adjustedStart) ? Range.fromPositions(adjustedEnd, adjustedStart) : Range.fromPositions(adjustedStart, adjustedEnd); + const selectedText = originalModel.getValueInRange(range2); + clipboardService.writeText(selectedText); + })); + return viewZoneDisposable; +} + +// node_modules/monaco-editor-core/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/inlineDiffDeletedCodeMargin.js +var InlineDiffDeletedCodeMargin = class extends Disposable { + get visibility() { + return this._visibility; + } + set visibility(_visibility) { + if (this._visibility !== _visibility) { + this._visibility = _visibility; + this._diffActions.style.visibility = _visibility ? "visible" : "hidden"; + } + } + constructor(_getViewZoneId, _marginDomNode, _deletedCodeDomNode, _modifiedEditor, _diff, _editor, _renderLinesResult, _originalTextModel, _contextMenuService, _clipboardService) { + super(); + this._getViewZoneId = _getViewZoneId; + this._marginDomNode = _marginDomNode; + this._deletedCodeDomNode = _deletedCodeDomNode; + this._modifiedEditor = _modifiedEditor; + this._diff = _diff; + this._editor = _editor; + this._renderLinesResult = _renderLinesResult; + this._originalTextModel = _originalTextModel; + this._contextMenuService = _contextMenuService; + this._clipboardService = _clipboardService; + this._visibility = false; + this._marginDomNode.style.zIndex = "10"; + this._diffActions = document.createElement("div"); + this._diffActions.className = ThemeIcon.asClassName(Codicon.lightBulb) + " lightbulb-glyph"; + this._diffActions.style.position = "absolute"; + const lineHeight = this._modifiedEditor.getOption( + 75 + /* EditorOption.lineHeight */ + ); + this._diffActions.style.right = "0px"; + this._diffActions.style.visibility = "hidden"; + this._diffActions.style.height = `${lineHeight}px`; + this._diffActions.style.lineHeight = `${lineHeight}px`; + this._marginDomNode.appendChild(this._diffActions); + let currentLineNumberOffset = 0; + const useShadowDOM = _modifiedEditor.getOption( + 144 + /* EditorOption.useShadowDOM */ + ) && !isIOS; + const showContextMenu = (anchor, baseActions, onHide) => { + this._contextMenuService.showContextMenu({ + domForShadowRoot: useShadowDOM ? _modifiedEditor.getDomNode() ?? void 0 : void 0, + getAnchor: () => anchor, + onHide, + getActions: () => { + const actions = baseActions ?? []; + const isDeletion3 = _diff.modified.isEmpty; + actions.push(new Action("diff.clipboard.copyDeletedContent", isDeletion3 ? _diff.original.length > 1 ? localize(112, "Copy deleted lines") : localize(113, "Copy deleted line") : _diff.original.length > 1 ? localize(114, "Copy changed lines") : localize(115, "Copy changed line"), void 0, true, async () => { + const originalText = this._originalTextModel.getValueInRange(_diff.original.toExclusiveRange()); + await this._clipboardService.writeText(originalText); + })); + if (_diff.original.length > 1) { + actions.push(new Action("diff.clipboard.copyDeletedLineContent", isDeletion3 ? localize(116, "Copy deleted line ({0})", _diff.original.startLineNumber + currentLineNumberOffset) : localize(117, "Copy changed line ({0})", _diff.original.startLineNumber + currentLineNumberOffset), void 0, true, async () => { + let lineContent = this._originalTextModel.getLineContent(_diff.original.startLineNumber + currentLineNumberOffset); + if (lineContent === "") { + const eof = this._originalTextModel.getEndOfLineSequence(); + lineContent = eof === 0 ? "\n" : "\r\n"; + } + await this._clipboardService.writeText(lineContent); + })); + } + const readOnly = _modifiedEditor.getOption( + 104 + /* EditorOption.readOnly */ + ); + if (!readOnly) { + actions.push(new Action("diff.inline.revertChange", localize(118, "Revert this change"), void 0, true, async () => { + this._editor.revert(this._diff); + })); + } + return actions; + }, + autoSelectFirstItem: true + }); + }; + this._register(addStandardDisposableListener(this._diffActions, "mousedown", (e) => { + if (!e.leftButton) { + return; + } + const { top, height } = getDomNodePagePosition(this._diffActions); + const pad = Math.floor(lineHeight / 3); + e.preventDefault(); + showContextMenu({ x: e.posx, y: top + height + pad }); + })); + this._register(_modifiedEditor.onMouseMove((e) => { + if ((e.target.type === 8 || e.target.type === 5) && e.target.detail.viewZoneId === this._getViewZoneId()) { + currentLineNumberOffset = this._updateLightBulbPosition(this._marginDomNode, e.event.browserEvent.y, lineHeight); + this.visibility = true; + } else { + this.visibility = false; + } + })); + this._register(enableCopySelection({ + domNode: this._deletedCodeDomNode, + diffEntry: _diff, + originalModel: this._originalTextModel, + renderLinesResult: this._renderLinesResult, + clipboardService: _clipboardService + })); + } + _updateLightBulbPosition(marginDomNode, y, lineHeight) { + const { top } = getDomNodePagePosition(marginDomNode); + const offset = y - top; + const lineNumberOffset = Math.floor(offset / lineHeight); + const newTop = lineNumberOffset * lineHeight; + this._diffActions.style.top = `${newTop}px`; + if (this._renderLinesResult.viewLineCounts) { + let acc = 0; + for (let i2 = 0; i2 < this._renderLinesResult.viewLineCounts.length; i2++) { + acc += this._renderLinesResult.viewLineCounts[i2]; + if (lineNumberOffset < acc) { + return i2; + } + } + } + return lineNumberOffset; + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/renderLines.js +init_position(); +init_stringBuilder(); +var ttPolicy3 = createTrustedTypesPolicy("diffEditorWidget", { createHTML: (value) => value }); +function renderLines(source, options2, decorations, domNode, noExtra = false) { + applyFontInfo(domNode, options2.fontInfo); + const hasCharChanges = decorations.length > 0; + const sb = new StringBuilder(1e4); + let maxCharsPerLine = 0; + let renderedLineCount = 0; + const viewLineCounts = []; + const renderOutputs = []; + for (let lineIndex = 0; lineIndex < source.lineTokens.length; lineIndex++) { + const lineNumber = lineIndex + 1; + const lineTokens = source.lineTokens[lineIndex]; + const lineBreakData = source.lineBreakData[lineIndex]; + const actualDecorations = LineDecoration.filter(decorations, lineNumber, 1, Number.MAX_SAFE_INTEGER); + if (lineBreakData) { + let lastBreakOffset = 0; + for (const breakOffset of lineBreakData.breakOffsets) { + const viewLineTokens = lineTokens.sliceAndInflate(lastBreakOffset, breakOffset, 0); + const result = renderOriginalLine(renderedLineCount, viewLineTokens, LineDecoration.extractWrapped(actualDecorations, lastBreakOffset, breakOffset), hasCharChanges, source.mightContainNonBasicASCII, source.mightContainRTL, options2, sb, noExtra); + maxCharsPerLine = Math.max(maxCharsPerLine, result.maxCharWidth); + renderOutputs.push(new RenderLineOutputWithOffset(result.output.characterMapping, result.output.containsForeignElements, lastBreakOffset)); + renderedLineCount++; + lastBreakOffset = breakOffset; + } + viewLineCounts.push(lineBreakData.breakOffsets.length); + } else { + viewLineCounts.push(1); + const result = renderOriginalLine(renderedLineCount, lineTokens, actualDecorations, hasCharChanges, source.mightContainNonBasicASCII, source.mightContainRTL, options2, sb, noExtra); + maxCharsPerLine = Math.max(maxCharsPerLine, result.maxCharWidth); + renderOutputs.push(new RenderLineOutputWithOffset(result.output.characterMapping, result.output.containsForeignElements, 0)); + renderedLineCount++; + } + } + maxCharsPerLine += options2.scrollBeyondLastColumn; + const html3 = sb.build(); + const trustedhtml = ttPolicy3 ? ttPolicy3.createHTML(html3) : html3; + domNode.innerHTML = trustedhtml; + const minWidthInPx = maxCharsPerLine * options2.typicalHalfwidthCharacterWidth; + return new RenderLinesResult(renderedLineCount, minWidthInPx, viewLineCounts, renderOutputs, source); +} +var LineSource = class { + constructor(lineTokens, lineBreakData = lineTokens.map((t) => null), mightContainNonBasicASCII = true, mightContainRTL = true) { + this.lineTokens = lineTokens; + this.lineBreakData = lineBreakData; + this.mightContainNonBasicASCII = mightContainNonBasicASCII; + this.mightContainRTL = mightContainRTL; + } +}; +var RenderOptions = class _RenderOptions { + static fromEditor(editor2) { + const modifiedEditorOptions = editor2.getOptions(); + const fontInfo = modifiedEditorOptions.get( + 59 + /* EditorOption.fontInfo */ + ); + const layoutInfo = modifiedEditorOptions.get( + 165 + /* EditorOption.layoutInfo */ + ); + return new _RenderOptions(editor2.getModel()?.getOptions().tabSize || 0, fontInfo, modifiedEditorOptions.get( + 40 + /* EditorOption.disableMonospaceOptimizations */ + ), fontInfo.typicalHalfwidthCharacterWidth, modifiedEditorOptions.get( + 118 + /* EditorOption.scrollBeyondLastColumn */ + ), modifiedEditorOptions.get( + 75 + /* EditorOption.lineHeight */ + ), layoutInfo.decorationsWidth, modifiedEditorOptions.get( + 133 + /* EditorOption.stopRenderingLineAfter */ + ), modifiedEditorOptions.get( + 113 + /* EditorOption.renderWhitespace */ + ), modifiedEditorOptions.get( + 108 + /* EditorOption.renderControlCharacters */ + ), modifiedEditorOptions.get( + 60 + /* EditorOption.fontLigatures */ + ), modifiedEditorOptions.get( + 117 + /* EditorOption.scrollbar */ + ).verticalScrollbarSize); + } + constructor(tabSize, fontInfo, disableMonospaceOptimizations, typicalHalfwidthCharacterWidth, scrollBeyondLastColumn, lineHeight, lineDecorationsWidth, stopRenderingLineAfter, renderWhitespace, renderControlCharacters, fontLigatures, verticalScrollbarSize, setWidth = true) { + this.tabSize = tabSize; + this.fontInfo = fontInfo; + this.disableMonospaceOptimizations = disableMonospaceOptimizations; + this.typicalHalfwidthCharacterWidth = typicalHalfwidthCharacterWidth; + this.scrollBeyondLastColumn = scrollBeyondLastColumn; + this.lineHeight = lineHeight; + this.lineDecorationsWidth = lineDecorationsWidth; + this.stopRenderingLineAfter = stopRenderingLineAfter; + this.renderWhitespace = renderWhitespace; + this.renderControlCharacters = renderControlCharacters; + this.fontLigatures = fontLigatures; + this.verticalScrollbarSize = verticalScrollbarSize; + this.setWidth = setWidth; + } + withSetWidth(setWidth) { + return new _RenderOptions(this.tabSize, this.fontInfo, this.disableMonospaceOptimizations, this.typicalHalfwidthCharacterWidth, this.scrollBeyondLastColumn, this.lineHeight, this.lineDecorationsWidth, this.stopRenderingLineAfter, this.renderWhitespace, this.renderControlCharacters, this.fontLigatures, this.verticalScrollbarSize, setWidth); + } + withScrollBeyondLastColumn(scrollBeyondLastColumn) { + return new _RenderOptions(this.tabSize, this.fontInfo, this.disableMonospaceOptimizations, this.typicalHalfwidthCharacterWidth, scrollBeyondLastColumn, this.lineHeight, this.lineDecorationsWidth, this.stopRenderingLineAfter, this.renderWhitespace, this.renderControlCharacters, this.fontLigatures, this.verticalScrollbarSize, this.setWidth); + } +}; +var RenderLinesResult = class { + constructor(heightInLines, minWidthInPx, viewLineCounts, _renderOutputs, _source) { + this.heightInLines = heightInLines; + this.minWidthInPx = minWidthInPx; + this.viewLineCounts = viewLineCounts; + this._renderOutputs = _renderOutputs; + this._source = _source; + } + /** + * Returns the model position for a given DOM node and offset within that node. + * @param domNode The span node within a view-line where the offset is located + * @param offset The offset within the span node + * @returns The Position in the model, or undefined if the position cannot be determined + */ + getModelPositionAt(domNode, offset) { + let viewLineElement = domNode; + while (viewLineElement && !viewLineElement.classList.contains("view-line")) { + viewLineElement = viewLineElement.parentElement; + } + if (!viewLineElement) { + return void 0; + } + const container = viewLineElement.parentElement; + if (!container) { + return void 0; + } + const viewLines = container.querySelectorAll(".view-line"); + let viewLineIndex = -1; + for (let i2 = 0; i2 < viewLines.length; i2++) { + if (viewLines[i2] === viewLineElement) { + viewLineIndex = i2; + break; + } + } + if (viewLineIndex === -1 || viewLineIndex >= this._renderOutputs.length) { + return void 0; + } + let modelLineNumber = 1; + let remainingViewLines = viewLineIndex; + for (let i2 = 0; i2 < this.viewLineCounts.length; i2++) { + if (remainingViewLines < this.viewLineCounts[i2]) { + modelLineNumber = i2 + 1; + break; + } + remainingViewLines -= this.viewLineCounts[i2]; + } + if (modelLineNumber > this._source.lineTokens.length) { + return void 0; + } + const renderOutput = this._renderOutputs[viewLineIndex]; + if (!renderOutput) { + return void 0; + } + const column = getColumnOfNodeOffset(renderOutput.characterMapping, domNode, offset) + renderOutput.offset; + return new Position(modelLineNumber, column); + } +}; +var RenderLineOutputWithOffset = class extends RenderLineOutput { + constructor(characterMapping, containsForeignElements, offset) { + super(characterMapping, containsForeignElements); + this.offset = offset; + } +}; +function renderOriginalLine(viewLineIdx, lineTokens, decorations, hasCharChanges, mightContainNonBasicASCII, mightContainRTL, options2, sb, noExtra) { + sb.appendString('
    '); + } else { + sb.appendString('px;">'); + } + const lineContent = lineTokens.getLineContent(); + const isBasicASCII2 = ViewLineRenderingData.isBasicASCII(lineContent, mightContainNonBasicASCII); + const containsRTL2 = ViewLineRenderingData.containsRTL(lineContent, isBasicASCII2, mightContainRTL); + const output = renderViewLine(new RenderLineInput( + options2.fontInfo.isMonospace && !options2.disableMonospaceOptimizations, + options2.fontInfo.canUseHalfwidthRightwardsArrow, + lineContent, + false, + isBasicASCII2, + containsRTL2, + 0, + lineTokens, + decorations, + options2.tabSize, + 0, + options2.fontInfo.spaceWidth, + options2.fontInfo.middotWidth, + options2.fontInfo.wsmiddotWidth, + options2.stopRenderingLineAfter, + options2.renderWhitespace, + options2.renderControlCharacters, + options2.fontLigatures !== EditorFontLigatures.OFF, + null, + // Send no selections, original line cannot be selected + null, + options2.verticalScrollbarSize + ), sb); + sb.appendString("
    "); + const maxCharWidth = output.characterMapping.getHorizontalOffset(output.characterMapping.length); + return { output, maxCharWidth }; +} + +// node_modules/monaco-editor-core/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/diffEditorViewZones.js +init_utils5(); +init_lineRange(); +init_position(); + +// node_modules/monaco-editor-core/esm/vs/platform/clipboard/common/clipboardService.js +init_instantiation(); +var IClipboardService = createDecorator("clipboardService"); + +// node_modules/monaco-editor-core/esm/vs/platform/contextview/browser/contextView.js +init_instantiation(); +var IContextViewService = createDecorator("contextViewService"); +var IContextMenuService = createDecorator("contextMenuService"); + +// node_modules/monaco-editor-core/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/diffEditorViewZones.js +init_range(); +var __decorate32 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param28 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var DiffEditorViewZones = class DiffEditorViewZones2 extends Disposable { + constructor(_targetWindow, _editors, _diffModel, _options, _diffEditorWidget, _canIgnoreViewZoneUpdateEvent, _origViewZonesToIgnore, _modViewZonesToIgnore, _clipboardService, _contextMenuService) { + super(); + this._targetWindow = _targetWindow; + this._editors = _editors; + this._diffModel = _diffModel; + this._options = _options; + this._diffEditorWidget = _diffEditorWidget; + this._canIgnoreViewZoneUpdateEvent = _canIgnoreViewZoneUpdateEvent; + this._origViewZonesToIgnore = _origViewZonesToIgnore; + this._modViewZonesToIgnore = _modViewZonesToIgnore; + this._clipboardService = _clipboardService; + this._contextMenuService = _contextMenuService; + this._originalTopPadding = observableValue(this, 0); + this._originalScrollOffset = observableValue(this, 0); + this._originalScrollOffsetAnimated = animatedObservable(this._targetWindow, this._originalScrollOffset, this._store); + this._modifiedTopPadding = observableValue(this, 0); + this._modifiedScrollOffset = observableValue(this, 0); + this._modifiedScrollOffsetAnimated = animatedObservable(this._targetWindow, this._modifiedScrollOffset, this._store); + const state = observableValue("invalidateAlignmentsState", 0); + const updateImmediately = this._register(new RunOnceScheduler(() => { + state.set(state.get() + 1, void 0); + }, 0)); + this._register(this._editors.original.onDidChangeViewZones((_args) => { + if (!this._canIgnoreViewZoneUpdateEvent()) { + updateImmediately.schedule(); + } + })); + this._register(this._editors.modified.onDidChangeViewZones((_args) => { + if (!this._canIgnoreViewZoneUpdateEvent()) { + updateImmediately.schedule(); + } + })); + this._register(this._editors.original.onDidChangeConfiguration((args) => { + if (args.hasChanged( + 166 + /* EditorOption.wrappingInfo */ + ) || args.hasChanged( + 75 + /* EditorOption.lineHeight */ + )) { + updateImmediately.schedule(); + } + })); + this._register(this._editors.modified.onDidChangeConfiguration((args) => { + if (args.hasChanged( + 166 + /* EditorOption.wrappingInfo */ + ) || args.hasChanged( + 75 + /* EditorOption.lineHeight */ + )) { + updateImmediately.schedule(); + } + })); + const originalModelTokenizationCompleted = this._diffModel.map((m) => m ? observableFromEvent( + this, + m.model.original.onDidChangeTokens, + () => m.model.original.tokenization.backgroundTokenizationState === 2 + /* BackgroundTokenizationState.Completed */ + ) : void 0).map((m, reader) => m?.read(reader)); + const alignments = derived((reader) => { + const diffModel = this._diffModel.read(reader); + const diff = diffModel?.diff.read(reader); + if (!diffModel || !diff) { + return null; + } + state.read(reader); + const renderSideBySide = this._options.renderSideBySide.read(reader); + const innerHunkAlignment = renderSideBySide; + return computeRangeAlignment(this._editors.original, this._editors.modified, diff.mappings, this._origViewZonesToIgnore, this._modViewZonesToIgnore, innerHunkAlignment); + }); + const alignmentsSyncedMovedText = derived((reader) => { + const syncedMovedText = this._diffModel.read(reader)?.movedTextToCompare.read(reader); + if (!syncedMovedText) { + return null; + } + state.read(reader); + const mappings = syncedMovedText.changes.map((c) => new DiffMapping(c)); + return computeRangeAlignment(this._editors.original, this._editors.modified, mappings, this._origViewZonesToIgnore, this._modViewZonesToIgnore, true); + }); + function createFakeLinesDiv() { + const r = document.createElement("div"); + r.className = "diagonal-fill"; + return r; + } + const alignmentViewZonesDisposables = this._register(new DisposableStore()); + this.viewZones = derived(this, (reader) => { + alignmentViewZonesDisposables.clear(); + const alignmentsVal = alignments.read(reader) || []; + const origViewZones = []; + const modViewZones = []; + const modifiedTopPaddingVal = this._modifiedTopPadding.read(reader); + if (modifiedTopPaddingVal > 0) { + modViewZones.push({ + afterLineNumber: 0, + domNode: document.createElement("div"), + heightInPx: modifiedTopPaddingVal, + showInHiddenAreas: true, + suppressMouseDown: true + }); + } + const originalTopPaddingVal = this._originalTopPadding.read(reader); + if (originalTopPaddingVal > 0) { + origViewZones.push({ + afterLineNumber: 0, + domNode: document.createElement("div"), + heightInPx: originalTopPaddingVal, + showInHiddenAreas: true, + suppressMouseDown: true + }); + } + const renderSideBySide = this._options.renderSideBySide.read(reader); + const deletedCodeLineBreaksComputer = !renderSideBySide ? this._editors.modified._getViewModel()?.createLineBreaksComputer() : void 0; + if (deletedCodeLineBreaksComputer) { + const originalModel = this._editors.original.getModel(); + for (const a of alignmentsVal) { + if (a.diff) { + for (let i2 = a.originalRange.startLineNumber; i2 < a.originalRange.endLineNumberExclusive; i2++) { + if (i2 > originalModel.getLineCount()) { + return { orig: origViewZones, mod: modViewZones }; + } + deletedCodeLineBreaksComputer?.addRequest(originalModel.getLineContent(i2), null, null); + } + } + } + } + const lineBreakData = deletedCodeLineBreaksComputer?.finalize() ?? []; + let lineBreakDataIdx = 0; + const modLineHeight = this._editors.modified.getOption( + 75 + /* EditorOption.lineHeight */ + ); + const syncedMovedText = this._diffModel.read(reader)?.movedTextToCompare.read(reader); + const mightContainNonBasicASCII = this._editors.original.getModel()?.mightContainNonBasicASCII() ?? false; + const mightContainRTL = this._editors.original.getModel()?.mightContainRTL() ?? false; + const renderOptions = RenderOptions.fromEditor(this._editors.modified); + for (const a of alignmentsVal) { + if (a.diff && !renderSideBySide && (!this._options.useTrueInlineDiffRendering.read(reader) || !allowsTrueInlineDiffRendering(a.diff))) { + if (!a.originalRange.isEmpty) { + originalModelTokenizationCompleted.read(reader); + const deletedCodeDomNode = document.createElement("div"); + deletedCodeDomNode.classList.add("view-lines", "line-delete", "line-delete-selectable", "monaco-mouse-cursor-text"); + const originalModel = this._editors.original.getModel(); + if (a.originalRange.endLineNumberExclusive - 1 > originalModel.getLineCount()) { + return { orig: origViewZones, mod: modViewZones }; + } + const source = new LineSource(a.originalRange.mapToLineArray((l) => originalModel.tokenization.getLineTokens(l)), a.originalRange.mapToLineArray((_) => lineBreakData[lineBreakDataIdx++]), mightContainNonBasicASCII, mightContainRTL); + const decorations = []; + for (const i2 of a.diff.innerChanges || []) { + decorations.push(new InlineDecoration( + i2.originalRange.delta(-(a.diff.original.startLineNumber - 1)), + diffDeleteDecoration.className, + 0 + /* InlineDecorationType.Regular */ + )); + } + const result = renderLines(source, renderOptions, decorations, deletedCodeDomNode); + const marginDomNode2 = document.createElement("div"); + marginDomNode2.className = "inline-deleted-margin-view-zone"; + applyFontInfo(marginDomNode2, renderOptions.fontInfo); + if (this._options.renderIndicators.read(reader)) { + for (let i2 = 0; i2 < result.heightInLines; i2++) { + const marginElement = document.createElement("div"); + marginElement.className = `delete-sign ${ThemeIcon.asClassName(diffRemoveIcon)}`; + marginElement.setAttribute("style", `position:absolute;top:${i2 * modLineHeight}px;width:${renderOptions.lineDecorationsWidth}px;height:${modLineHeight}px;right:0;`); + marginDomNode2.appendChild(marginElement); + } + } + let zoneId = void 0; + alignmentViewZonesDisposables.add(new InlineDiffDeletedCodeMargin(() => assertReturnsDefined(zoneId), marginDomNode2, deletedCodeDomNode, this._editors.modified, a.diff, this._diffEditorWidget, result, this._editors.original.getModel(), this._contextMenuService, this._clipboardService)); + for (let i2 = 0; i2 < result.viewLineCounts.length; i2++) { + const count = result.viewLineCounts[i2]; + if (count > 1) { + origViewZones.push({ + afterLineNumber: a.originalRange.startLineNumber + i2, + domNode: createFakeLinesDiv(), + heightInPx: (count - 1) * modLineHeight, + showInHiddenAreas: true, + suppressMouseDown: true + }); + } + } + modViewZones.push({ + afterLineNumber: a.modifiedRange.startLineNumber - 1, + domNode: deletedCodeDomNode, + heightInPx: result.heightInLines * modLineHeight, + minWidthInPx: result.minWidthInPx, + marginDomNode: marginDomNode2, + setZoneId(id) { + zoneId = id; + }, + showInHiddenAreas: true, + suppressMouseDown: false + }); + } + const marginDomNode = document.createElement("div"); + marginDomNode.className = "gutter-delete"; + origViewZones.push({ + afterLineNumber: a.originalRange.endLineNumberExclusive - 1, + domNode: createFakeLinesDiv(), + heightInPx: a.modifiedHeightInPx, + marginDomNode, + showInHiddenAreas: true, + suppressMouseDown: true + }); + } else { + const delta = a.modifiedHeightInPx - a.originalHeightInPx; + if (delta > 0) { + if (syncedMovedText?.lineRangeMapping.original.delta(-1).deltaLength(2).contains(a.originalRange.endLineNumberExclusive - 1)) { + continue; + } + origViewZones.push({ + afterLineNumber: a.originalRange.endLineNumberExclusive - 1, + domNode: createFakeLinesDiv(), + heightInPx: delta, + showInHiddenAreas: true, + suppressMouseDown: true + }); + } else { + let createViewZoneMarginArrow = function() { + const arrow = document.createElement("div"); + arrow.className = "arrow-revert-change " + ThemeIcon.asClassName(Codicon.arrowRight); + reader.store.add(addDisposableListener(arrow, "mousedown", (e) => e.stopPropagation())); + reader.store.add(addDisposableListener(arrow, "click", (e) => { + e.stopPropagation(); + _diffEditorWidget.revert(a.diff); + })); + return $("div", {}, arrow); + }; + if (syncedMovedText?.lineRangeMapping.modified.delta(-1).deltaLength(2).contains(a.modifiedRange.endLineNumberExclusive - 1)) { + continue; + } + let marginDomNode = void 0; + if (a.diff && a.diff.modified.isEmpty && this._options.shouldRenderOldRevertArrows.read(reader)) { + marginDomNode = createViewZoneMarginArrow(); + } + modViewZones.push({ + afterLineNumber: a.modifiedRange.endLineNumberExclusive - 1, + domNode: createFakeLinesDiv(), + heightInPx: -delta, + marginDomNode, + showInHiddenAreas: true, + suppressMouseDown: true + }); + } + } + } + for (const a of alignmentsSyncedMovedText.read(reader) ?? []) { + if (!syncedMovedText?.lineRangeMapping.original.intersect(a.originalRange) || !syncedMovedText?.lineRangeMapping.modified.intersect(a.modifiedRange)) { + continue; + } + const delta = a.modifiedHeightInPx - a.originalHeightInPx; + if (delta > 0) { + origViewZones.push({ + afterLineNumber: a.originalRange.endLineNumberExclusive - 1, + domNode: createFakeLinesDiv(), + heightInPx: delta, + showInHiddenAreas: true, + suppressMouseDown: true + }); + } else { + modViewZones.push({ + afterLineNumber: a.modifiedRange.endLineNumberExclusive - 1, + domNode: createFakeLinesDiv(), + heightInPx: -delta, + showInHiddenAreas: true, + suppressMouseDown: true + }); + } + } + return { orig: origViewZones, mod: modViewZones }; + }); + let ignoreChange = false; + this._register(this._editors.original.onDidScrollChange((e) => { + if (e.scrollLeftChanged && !ignoreChange) { + ignoreChange = true; + this._editors.modified.setScrollLeft(e.scrollLeft); + ignoreChange = false; + } + })); + this._register(this._editors.modified.onDidScrollChange((e) => { + if (e.scrollLeftChanged && !ignoreChange) { + ignoreChange = true; + this._editors.original.setScrollLeft(e.scrollLeft); + ignoreChange = false; + } + })); + this._originalScrollTop = observableFromEvent(this._editors.original.onDidScrollChange, () => ( + /** @description original.getScrollTop */ + this._editors.original.getScrollTop() + )); + this._modifiedScrollTop = observableFromEvent(this._editors.modified.onDidScrollChange, () => ( + /** @description modified.getScrollTop */ + this._editors.modified.getScrollTop() + )); + this._register(autorun((reader) => { + const newScrollTopModified = this._originalScrollTop.read(reader) - (this._originalScrollOffsetAnimated.read(void 0) - this._modifiedScrollOffsetAnimated.read(reader)) - (this._originalTopPadding.read(void 0) - this._modifiedTopPadding.read(reader)); + if (newScrollTopModified !== this._editors.modified.getScrollTop()) { + this._editors.modified.setScrollTop( + newScrollTopModified, + 1 + /* ScrollType.Immediate */ + ); + } + })); + this._register(autorun((reader) => { + const newScrollTopOriginal = this._modifiedScrollTop.read(reader) - (this._modifiedScrollOffsetAnimated.read(void 0) - this._originalScrollOffsetAnimated.read(reader)) - (this._modifiedTopPadding.read(void 0) - this._originalTopPadding.read(reader)); + if (newScrollTopOriginal !== this._editors.original.getScrollTop()) { + this._editors.original.setScrollTop( + newScrollTopOriginal, + 1 + /* ScrollType.Immediate */ + ); + } + })); + this._register(autorun((reader) => { + const m = this._diffModel.read(reader)?.movedTextToCompare.read(reader); + let deltaOrigToMod = 0; + if (m) { + const trueTopOriginal = this._editors.original.getTopForLineNumber(m.lineRangeMapping.original.startLineNumber, true) - this._originalTopPadding.read(void 0); + const trueTopModified = this._editors.modified.getTopForLineNumber(m.lineRangeMapping.modified.startLineNumber, true) - this._modifiedTopPadding.read(void 0); + deltaOrigToMod = trueTopModified - trueTopOriginal; + } + if (deltaOrigToMod > 0) { + this._modifiedTopPadding.set(0, void 0); + this._originalTopPadding.set(deltaOrigToMod, void 0); + } else if (deltaOrigToMod < 0) { + this._modifiedTopPadding.set(-deltaOrigToMod, void 0); + this._originalTopPadding.set(0, void 0); + } else { + setTimeout(() => { + this._modifiedTopPadding.set(0, void 0); + this._originalTopPadding.set(0, void 0); + }, 400); + } + if (this._editors.modified.hasTextFocus()) { + this._originalScrollOffset.set(this._modifiedScrollOffset.read(void 0) - deltaOrigToMod, void 0, true); + } else { + this._modifiedScrollOffset.set(this._originalScrollOffset.read(void 0) + deltaOrigToMod, void 0, true); + } + })); + } +}; +DiffEditorViewZones = __decorate32([ + __param28(8, IClipboardService), + __param28(9, IContextMenuService) +], DiffEditorViewZones); +function computeRangeAlignment(originalEditor, modifiedEditor, diffs, originalEditorAlignmentViewZones, modifiedEditorAlignmentViewZones, innerHunkAlignment) { + const originalLineHeightOverrides = new ArrayQueue(getAdditionalLineHeights(originalEditor, originalEditorAlignmentViewZones)); + const modifiedLineHeightOverrides = new ArrayQueue(getAdditionalLineHeights(modifiedEditor, modifiedEditorAlignmentViewZones)); + const origLineHeight = originalEditor.getOption( + 75 + /* EditorOption.lineHeight */ + ); + const modLineHeight = modifiedEditor.getOption( + 75 + /* EditorOption.lineHeight */ + ); + const result = []; + let lastOriginalLineNumber = 0; + let lastModifiedLineNumber = 0; + function handleAlignmentsOutsideOfDiffs(untilOriginalLineNumberExclusive, untilModifiedLineNumberExclusive) { + while (true) { + let origNext = originalLineHeightOverrides.peek(); + let modNext = modifiedLineHeightOverrides.peek(); + if (origNext && origNext.lineNumber >= untilOriginalLineNumberExclusive) { + origNext = void 0; + } + if (modNext && modNext.lineNumber >= untilModifiedLineNumberExclusive) { + modNext = void 0; + } + if (!origNext && !modNext) { + break; + } + const distOrig = origNext ? origNext.lineNumber - lastOriginalLineNumber : Number.MAX_VALUE; + const distNext = modNext ? modNext.lineNumber - lastModifiedLineNumber : Number.MAX_VALUE; + if (distOrig < distNext) { + originalLineHeightOverrides.dequeue(); + modNext = { + lineNumber: origNext.lineNumber - lastOriginalLineNumber + lastModifiedLineNumber, + heightInPx: 0 + }; + } else if (distOrig > distNext) { + modifiedLineHeightOverrides.dequeue(); + origNext = { + lineNumber: modNext.lineNumber - lastModifiedLineNumber + lastOriginalLineNumber, + heightInPx: 0 + }; + } else { + originalLineHeightOverrides.dequeue(); + modifiedLineHeightOverrides.dequeue(); + } + result.push({ + originalRange: LineRange.ofLength(origNext.lineNumber, 1), + modifiedRange: LineRange.ofLength(modNext.lineNumber, 1), + originalHeightInPx: origLineHeight + origNext.heightInPx, + modifiedHeightInPx: modLineHeight + modNext.heightInPx, + diff: void 0 + }); + } + } + for (const m of diffs) { + let emitAlignment = function(origLineNumberExclusive, modLineNumberExclusive, forceAlignment = false) { + if (origLineNumberExclusive < lastOrigLineNumber || modLineNumberExclusive < lastModLineNumber) { + return; + } + if (first2) { + first2 = false; + } else if (!forceAlignment && (origLineNumberExclusive === lastOrigLineNumber || modLineNumberExclusive === lastModLineNumber)) { + return; + } + const originalRange = new LineRange(lastOrigLineNumber, origLineNumberExclusive); + const modifiedRange = new LineRange(lastModLineNumber, modLineNumberExclusive); + if (originalRange.isEmpty && modifiedRange.isEmpty) { + return; + } + const originalAdditionalHeight = originalLineHeightOverrides.takeWhile((v) => v.lineNumber < origLineNumberExclusive)?.reduce((p, c2) => p + c2.heightInPx, 0) ?? 0; + const modifiedAdditionalHeight = modifiedLineHeightOverrides.takeWhile((v) => v.lineNumber < modLineNumberExclusive)?.reduce((p, c2) => p + c2.heightInPx, 0) ?? 0; + result.push({ + originalRange, + modifiedRange, + originalHeightInPx: originalRange.length * origLineHeight + originalAdditionalHeight, + modifiedHeightInPx: modifiedRange.length * modLineHeight + modifiedAdditionalHeight, + diff: m.lineRangeMapping + }); + lastOrigLineNumber = origLineNumberExclusive; + lastModLineNumber = modLineNumberExclusive; + }; + const c = m.lineRangeMapping; + handleAlignmentsOutsideOfDiffs(c.original.startLineNumber, c.modified.startLineNumber); + let first2 = true; + let lastModLineNumber = c.modified.startLineNumber; + let lastOrigLineNumber = c.original.startLineNumber; + if (innerHunkAlignment) { + for (const i2 of c.innerChanges || []) { + if (i2.originalRange.startColumn > 1 && i2.modifiedRange.startColumn > 1) { + emitAlignment(i2.originalRange.startLineNumber, i2.modifiedRange.startLineNumber); + } + const originalModel = originalEditor.getModel(); + const maxColumn = i2.originalRange.endLineNumber <= originalModel.getLineCount() ? originalModel.getLineMaxColumn(i2.originalRange.endLineNumber) : Number.MAX_SAFE_INTEGER; + if (i2.originalRange.endColumn < maxColumn) { + emitAlignment(i2.originalRange.endLineNumber, i2.modifiedRange.endLineNumber); + } + } + } + emitAlignment(c.original.endLineNumberExclusive, c.modified.endLineNumberExclusive, true); + lastOriginalLineNumber = c.original.endLineNumberExclusive; + lastModifiedLineNumber = c.modified.endLineNumberExclusive; + } + handleAlignmentsOutsideOfDiffs(Number.MAX_VALUE, Number.MAX_VALUE); + return result; +} +function getAdditionalLineHeights(editor2, viewZonesToIgnore) { + const viewZoneHeights = []; + const wrappingZoneHeights = []; + const hasWrapping = editor2.getOption( + 166 + /* EditorOption.wrappingInfo */ + ).wrappingColumn !== -1; + const coordinatesConverter = editor2._getViewModel().coordinatesConverter; + const editorLineHeight = editor2.getOption( + 75 + /* EditorOption.lineHeight */ + ); + if (hasWrapping) { + for (let i2 = 1; i2 <= editor2.getModel().getLineCount(); i2++) { + const lineCount = coordinatesConverter.getModelLineViewLineCount(i2); + if (lineCount > 1) { + wrappingZoneHeights.push({ lineNumber: i2, heightInPx: editorLineHeight * (lineCount - 1) }); + } + } + } + for (const w of editor2.getWhitespaces()) { + if (viewZonesToIgnore.has(w.id)) { + continue; + } + const modelLineNumber = w.afterLineNumber === 0 ? 0 : coordinatesConverter.convertViewPositionToModelPosition(new Position(w.afterLineNumber, 1)).lineNumber; + viewZoneHeights.push({ lineNumber: modelLineNumber, heightInPx: w.height }); + } + const result = joinCombine(viewZoneHeights, wrappingZoneHeights, (v) => v.lineNumber, (v1, v2) => ({ lineNumber: v1.lineNumber, heightInPx: v1.heightInPx + v2.heightInPx })); + return result; +} +function allowsTrueInlineDiffRendering(mapping) { + if (!mapping.innerChanges) { + return false; + } + return mapping.innerChanges.every((c) => rangeIsSingleLine(c.modifiedRange) && rangeIsSingleLine(c.originalRange) || c.originalRange.equalsRange(new Range(1, 1, 1, 1))); +} +function rangeIsSingleLine(range2) { + return range2.startLineNumber === range2.endLineNumber; +} + +// node_modules/monaco-editor-core/esm/vs/editor/browser/widget/diffEditor/features/movedBlocksLinesFeature.js +init_dom(); +init_actions(); +init_arrays(); +init_arraysFind(); +init_codicons(); +init_lifecycle(); +init_observable(); +init_themables(); +init_utils5(); +init_offsetRange(); +init_nls(); +var MovedBlocksLinesFeature = class _MovedBlocksLinesFeature extends Disposable { + static { + this.movedCodeBlockPadding = 4; + } + constructor(_rootElement, _diffModel, _originalEditorLayoutInfo, _modifiedEditorLayoutInfo, _editors) { + super(); + this._rootElement = _rootElement; + this._diffModel = _diffModel; + this._originalEditorLayoutInfo = _originalEditorLayoutInfo; + this._modifiedEditorLayoutInfo = _modifiedEditorLayoutInfo; + this._editors = _editors; + this._originalScrollTop = observableFromEvent(this, this._editors.original.onDidScrollChange, () => this._editors.original.getScrollTop()); + this._modifiedScrollTop = observableFromEvent(this, this._editors.modified.onDidScrollChange, () => this._editors.modified.getScrollTop()); + this._viewZonesChanged = observableSignalFromEvent("onDidChangeViewZones", this._editors.modified.onDidChangeViewZones); + this.width = observableValue(this, 0); + this._modifiedViewZonesChangedSignal = observableSignalFromEvent("modified.onDidChangeViewZones", this._editors.modified.onDidChangeViewZones); + this._originalViewZonesChangedSignal = observableSignalFromEvent("original.onDidChangeViewZones", this._editors.original.onDidChangeViewZones); + this._state = derived(this, (reader) => { + this._element.replaceChildren(); + const model = this._diffModel.read(reader); + const moves = model?.diff.read(reader)?.movedTexts; + if (!moves || moves.length === 0) { + this.width.set(0, void 0); + return; + } + this._viewZonesChanged.read(reader); + const infoOrig = this._originalEditorLayoutInfo.read(reader); + const infoMod = this._modifiedEditorLayoutInfo.read(reader); + if (!infoOrig || !infoMod) { + this.width.set(0, void 0); + return; + } + this._modifiedViewZonesChangedSignal.read(reader); + this._originalViewZonesChangedSignal.read(reader); + const lines = moves.map((move) => { + function computeLineStart(range2, editor2) { + const t1 = editor2.getTopForLineNumber(range2.startLineNumber, true); + const t2 = editor2.getTopForLineNumber(range2.endLineNumberExclusive, true); + return (t1 + t2) / 2; + } + const start = computeLineStart(move.lineRangeMapping.original, this._editors.original); + const startOffset = this._originalScrollTop.read(reader); + const end = computeLineStart(move.lineRangeMapping.modified, this._editors.modified); + const endOffset = this._modifiedScrollTop.read(reader); + const from = start - startOffset; + const to = end - endOffset; + const top = Math.min(start, end); + const bottom = Math.max(start, end); + return { range: new OffsetRange(top, bottom), from, to, fromWithoutScroll: start, toWithoutScroll: end, move }; + }); + lines.sort(tieBreakComparators(compareBy((l) => l.fromWithoutScroll > l.toWithoutScroll, booleanComparator), compareBy((l) => l.fromWithoutScroll > l.toWithoutScroll ? l.fromWithoutScroll : -l.toWithoutScroll, numberComparator))); + const layout2 = LinesLayout2.compute(lines.map((l) => l.range)); + const padding = 10; + const lineAreaLeft = infoOrig.verticalScrollbarWidth; + const lineAreaWidth = (layout2.getTrackCount() - 1) * 10 + padding * 2; + const width2 = lineAreaLeft + lineAreaWidth + (infoMod.contentLeft - _MovedBlocksLinesFeature.movedCodeBlockPadding); + let idx = 0; + for (const line of lines) { + const track = layout2.getTrack(idx); + const verticalY = lineAreaLeft + padding + track * 10; + const arrowHeight = 15; + const arrowWidth = 15; + const right = width2; + const rectWidth = infoMod.glyphMarginWidth + infoMod.lineNumbersWidth; + const rectHeight = 18; + const rect = document.createElementNS("http://www.w3.org/2000/svg", "rect"); + rect.classList.add("arrow-rectangle"); + rect.setAttribute("x", `${right - rectWidth}`); + rect.setAttribute("y", `${line.to - rectHeight / 2}`); + rect.setAttribute("width", `${rectWidth}`); + rect.setAttribute("height", `${rectHeight}`); + this._element.appendChild(rect); + const g = document.createElementNS("http://www.w3.org/2000/svg", "g"); + const path = document.createElementNS("http://www.w3.org/2000/svg", "path"); + path.setAttribute("d", `M ${0} ${line.from} L ${verticalY} ${line.from} L ${verticalY} ${line.to} L ${right - arrowWidth} ${line.to}`); + path.setAttribute("fill", "none"); + g.appendChild(path); + const arrowRight = document.createElementNS("http://www.w3.org/2000/svg", "polygon"); + arrowRight.classList.add("arrow"); + reader.store.add(autorun((reader2) => { + path.classList.toggle("currentMove", line.move === model.activeMovedText.read(reader2)); + arrowRight.classList.toggle("currentMove", line.move === model.activeMovedText.read(reader2)); + })); + arrowRight.setAttribute("points", `${right - arrowWidth},${line.to - arrowHeight / 2} ${right},${line.to} ${right - arrowWidth},${line.to + arrowHeight / 2}`); + g.appendChild(arrowRight); + this._element.appendChild(g); + idx++; + } + this.width.set(lineAreaWidth, void 0); + }); + this._element = document.createElementNS("http://www.w3.org/2000/svg", "svg"); + this._element.setAttribute("class", "moved-blocks-lines"); + this._rootElement.appendChild(this._element); + this._register(toDisposable(() => this._element.remove())); + this._register(autorun((reader) => { + const info = this._originalEditorLayoutInfo.read(reader); + const info2 = this._modifiedEditorLayoutInfo.read(reader); + if (!info || !info2) { + return; + } + this._element.style.left = `${info.width - info.verticalScrollbarWidth}px`; + this._element.style.height = `${info.height}px`; + this._element.style.width = `${info.verticalScrollbarWidth + info.contentLeft - _MovedBlocksLinesFeature.movedCodeBlockPadding + this.width.read(reader)}px`; + })); + this._register(recomputeInitiallyAndOnChange(this._state)); + const movedBlockViewZones = derived((reader) => { + const model = this._diffModel.read(reader); + const d = model?.diff.read(reader); + if (!d) { + return []; + } + return d.movedTexts.map((move) => ({ + move, + original: new PlaceholderViewZone(constObservable(move.lineRangeMapping.original.startLineNumber - 1), 18), + modified: new PlaceholderViewZone(constObservable(move.lineRangeMapping.modified.startLineNumber - 1), 18) + })); + }); + this._register(applyViewZones(this._editors.original, movedBlockViewZones.map((zones) => ( + /** @description movedBlockViewZones.original */ + zones.map((z) => z.original) + )))); + this._register(applyViewZones(this._editors.modified, movedBlockViewZones.map((zones) => ( + /** @description movedBlockViewZones.modified */ + zones.map((z) => z.modified) + )))); + this._register(autorunWithStore((reader, store) => { + const blocks = movedBlockViewZones.read(reader); + for (const b of blocks) { + store.add(new MovedBlockOverlayWidget(this._editors.original, b.original, b.move, "original", this._diffModel.get())); + store.add(new MovedBlockOverlayWidget(this._editors.modified, b.modified, b.move, "modified", this._diffModel.get())); + } + })); + const originalHasFocus = observableSignalFromEvent("original.onDidFocusEditorWidget", (e) => this._editors.original.onDidFocusEditorWidget(() => setTimeout(() => e(void 0), 0))); + const modifiedHasFocus = observableSignalFromEvent("modified.onDidFocusEditorWidget", (e) => this._editors.modified.onDidFocusEditorWidget(() => setTimeout(() => e(void 0), 0))); + let lastChangedEditor = "modified"; + this._register(autorunHandleChanges({ + changeTracker: { + createChangeSummary: () => void 0, + handleChange: (ctx, summary) => { + if (ctx.didChange(originalHasFocus)) { + lastChangedEditor = "original"; + } + if (ctx.didChange(modifiedHasFocus)) { + lastChangedEditor = "modified"; + } + return true; + } + } + }, (reader) => { + originalHasFocus.read(reader); + modifiedHasFocus.read(reader); + const m = this._diffModel.read(reader); + if (!m) { + return; + } + const diff = m.diff.read(reader); + let movedText = void 0; + if (diff && lastChangedEditor === "original") { + const originalPos = this._editors.originalCursor.read(reader); + if (originalPos) { + movedText = diff.movedTexts.find((m2) => m2.lineRangeMapping.original.contains(originalPos.lineNumber)); + } + } + if (diff && lastChangedEditor === "modified") { + const modifiedPos = this._editors.modifiedCursor.read(reader); + if (modifiedPos) { + movedText = diff.movedTexts.find((m2) => m2.lineRangeMapping.modified.contains(modifiedPos.lineNumber)); + } + } + if (movedText !== m.movedTextToCompare.read(void 0)) { + m.movedTextToCompare.set(void 0, void 0); + } + m.setActiveMovedText(movedText); + })); + } +}; +var LinesLayout2 = class _LinesLayout { + static compute(lines) { + const setsPerTrack = []; + const trackPerLineIdx = []; + for (const line of lines) { + let trackIdx = setsPerTrack.findIndex((set) => !set.intersectsStrict(line)); + if (trackIdx === -1) { + const maxTrackCount = 6; + if (setsPerTrack.length >= maxTrackCount) { + trackIdx = findMaxIdx(setsPerTrack, compareBy((set) => set.intersectWithRangeLength(line), numberComparator)); + } else { + trackIdx = setsPerTrack.length; + setsPerTrack.push(new OffsetRangeSet()); + } + } + setsPerTrack[trackIdx].addRange(line); + trackPerLineIdx.push(trackIdx); + } + return new _LinesLayout(setsPerTrack.length, trackPerLineIdx); + } + constructor(_trackCount, trackPerLineIdx) { + this._trackCount = _trackCount; + this.trackPerLineIdx = trackPerLineIdx; + } + getTrack(lineIdx) { + return this.trackPerLineIdx[lineIdx]; + } + getTrackCount() { + return this._trackCount; + } +}; +var MovedBlockOverlayWidget = class extends ViewZoneOverlayWidget { + constructor(_editor, _viewZone, _move, _kind, _diffModel) { + const root = h("div.diff-hidden-lines-widget"); + super(_editor, _viewZone, root.root); + this._editor = _editor; + this._move = _move; + this._kind = _kind; + this._diffModel = _diffModel; + this._nodes = h("div.diff-moved-code-block", { style: { marginRight: "4px" } }, [ + h("div.text-content@textContent"), + h("div.action-bar@actionBar") + ]); + root.root.appendChild(this._nodes.root); + const editorLayout = observableFromEvent(this._editor.onDidLayoutChange, () => this._editor.getLayoutInfo()); + this._register(applyStyle(this._nodes.root, { + paddingRight: editorLayout.map((l) => l.verticalScrollbarWidth) + })); + let text2; + if (_move.changes.length > 0) { + text2 = this._kind === "original" ? localize(131, "Code moved with changes to line {0}-{1}", this._move.lineRangeMapping.modified.startLineNumber, this._move.lineRangeMapping.modified.endLineNumberExclusive - 1) : localize(132, "Code moved with changes from line {0}-{1}", this._move.lineRangeMapping.original.startLineNumber, this._move.lineRangeMapping.original.endLineNumberExclusive - 1); + } else { + text2 = this._kind === "original" ? localize(133, "Code moved to line {0}-{1}", this._move.lineRangeMapping.modified.startLineNumber, this._move.lineRangeMapping.modified.endLineNumberExclusive - 1) : localize(134, "Code moved from line {0}-{1}", this._move.lineRangeMapping.original.startLineNumber, this._move.lineRangeMapping.original.endLineNumberExclusive - 1); + } + const actionBar2 = this._register(new ActionBar(this._nodes.actionBar, { + highlightToggledItems: true + })); + const caption = new Action("", text2, "", false); + actionBar2.push(caption, { icon: false, label: true }); + const actionCompare = new Action("", "Compare", ThemeIcon.asClassName(Codicon.compareChanges), true, () => { + this._editor.focus(); + this._diffModel.movedTextToCompare.set(this._diffModel.movedTextToCompare.get() === _move ? void 0 : this._move, void 0); + }); + this._register(autorun((reader) => { + const isActive = this._diffModel.movedTextToCompare.read(reader) === _move; + actionCompare.checked = isActive; + })); + actionBar2.push(actionCompare, { icon: false, label: true }); + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/browser/widget/diffEditor/components/diffEditorDecorations.js +init_utils5(); +var DiffEditorDecorations = class extends Disposable { + constructor(_editors, _diffModel, _options, widget) { + super(); + this._editors = _editors; + this._diffModel = _diffModel; + this._options = _options; + this._decorations = derived(this, (reader) => { + const diffModel = this._diffModel.read(reader); + const diff = diffModel?.diff.read(reader); + if (!diff) { + return null; + } + const movedTextToCompare = this._diffModel.read(reader).movedTextToCompare.read(reader); + const renderIndicators = this._options.renderIndicators.read(reader); + const showEmptyDecorations = this._options.showEmptyDecorations.read(reader); + const originalDecorations = []; + const modifiedDecorations = []; + if (!movedTextToCompare) { + for (const m of diff.mappings) { + if (!m.lineRangeMapping.original.isEmpty) { + originalDecorations.push({ range: m.lineRangeMapping.original.toInclusiveRange(), options: renderIndicators ? diffLineDeleteDecorationBackgroundWithIndicator : diffLineDeleteDecorationBackground }); + } + if (!m.lineRangeMapping.modified.isEmpty) { + modifiedDecorations.push({ range: m.lineRangeMapping.modified.toInclusiveRange(), options: renderIndicators ? diffLineAddDecorationBackgroundWithIndicator : diffLineAddDecorationBackground }); + } + if (m.lineRangeMapping.modified.isEmpty || m.lineRangeMapping.original.isEmpty) { + if (!m.lineRangeMapping.original.isEmpty) { + originalDecorations.push({ range: m.lineRangeMapping.original.toInclusiveRange(), options: diffWholeLineDeleteDecoration }); + } + if (!m.lineRangeMapping.modified.isEmpty) { + modifiedDecorations.push({ range: m.lineRangeMapping.modified.toInclusiveRange(), options: diffWholeLineAddDecoration }); + } + } else { + const useInlineDiff = this._options.useTrueInlineDiffRendering.read(reader) && allowsTrueInlineDiffRendering(m.lineRangeMapping); + for (const i2 of m.lineRangeMapping.innerChanges || []) { + if (m.lineRangeMapping.original.contains(i2.originalRange.startLineNumber)) { + originalDecorations.push({ range: i2.originalRange, options: i2.originalRange.isEmpty() && showEmptyDecorations ? diffDeleteDecorationEmpty : diffDeleteDecoration }); + } + if (m.lineRangeMapping.modified.contains(i2.modifiedRange.startLineNumber)) { + modifiedDecorations.push({ range: i2.modifiedRange, options: i2.modifiedRange.isEmpty() && showEmptyDecorations && !useInlineDiff ? diffAddDecorationEmpty : diffAddDecoration }); + } + if (useInlineDiff) { + const deletedText = diffModel.model.original.getValueInRange(i2.originalRange); + modifiedDecorations.push({ + range: i2.modifiedRange, + options: { + description: "deleted-text", + before: { + content: deletedText, + inlineClassName: "inline-deleted-text" + }, + zIndex: 1e5, + showIfCollapsed: true + } + }); + } + } + } + } + } + if (movedTextToCompare) { + for (const m of movedTextToCompare.changes) { + const fullRangeOriginal = m.original.toInclusiveRange(); + if (fullRangeOriginal) { + originalDecorations.push({ range: fullRangeOriginal, options: renderIndicators ? diffLineDeleteDecorationBackgroundWithIndicator : diffLineDeleteDecorationBackground }); + } + const fullRangeModified = m.modified.toInclusiveRange(); + if (fullRangeModified) { + modifiedDecorations.push({ range: fullRangeModified, options: renderIndicators ? diffLineAddDecorationBackgroundWithIndicator : diffLineAddDecorationBackground }); + } + for (const i2 of m.innerChanges || []) { + originalDecorations.push({ range: i2.originalRange, options: diffDeleteDecoration }); + modifiedDecorations.push({ range: i2.modifiedRange, options: diffAddDecoration }); + } + } + } + const activeMovedText = this._diffModel.read(reader).activeMovedText.read(reader); + for (const m of diff.movedTexts) { + originalDecorations.push({ + range: m.lineRangeMapping.original.toInclusiveRange(), + options: { + description: "moved", + blockClassName: "movedOriginal" + (m === activeMovedText ? " currentMove" : ""), + blockPadding: [MovedBlocksLinesFeature.movedCodeBlockPadding, 0, MovedBlocksLinesFeature.movedCodeBlockPadding, MovedBlocksLinesFeature.movedCodeBlockPadding] + } + }); + modifiedDecorations.push({ + range: m.lineRangeMapping.modified.toInclusiveRange(), + options: { + description: "moved", + blockClassName: "movedModified" + (m === activeMovedText ? " currentMove" : ""), + blockPadding: [4, 0, 4, 4] + } + }); + } + return { originalDecorations, modifiedDecorations }; + }); + this._register(applyObservableDecorations(this._editors.original, this._decorations.map((d) => d?.originalDecorations || []))); + this._register(applyObservableDecorations(this._editors.modified, this._decorations.map((d) => d?.modifiedDecorations || []))); + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/browser/widget/diffEditor/components/diffEditorEditors.js +init_event(); +init_lifecycle(); +init_observable(); +init_observableCodeEditor(); + +// node_modules/monaco-editor-core/esm/vs/editor/browser/widget/diffEditor/features/overviewRulerFeature.js +init_dom(); +init_lifecycle(); +init_observable(); +init_utils5(); +init_position(); +init_colorRegistry(); +init_themeService(); +var __decorate33 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param29 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var OverviewRulerFeature_1; +var OverviewRulerFeature = class OverviewRulerFeature2 extends Disposable { + static { + OverviewRulerFeature_1 = this; + } + static { + this.ONE_OVERVIEW_WIDTH = 15; + } + static { + this.ENTIRE_DIFF_OVERVIEW_WIDTH = this.ONE_OVERVIEW_WIDTH * 2; + } + constructor(_editors, _rootElement, _diffModel, _rootWidth, _rootHeight, _modifiedEditorLayoutInfo, _themeService) { + super(); + this._editors = _editors; + this._rootElement = _rootElement; + this._diffModel = _diffModel; + this._rootWidth = _rootWidth; + this._rootHeight = _rootHeight; + this._modifiedEditorLayoutInfo = _modifiedEditorLayoutInfo; + this._themeService = _themeService; + this.width = OverviewRulerFeature_1.ENTIRE_DIFF_OVERVIEW_WIDTH; + const currentColorTheme = observableFromEvent(this._themeService.onDidColorThemeChange, () => this._themeService.getColorTheme()); + const currentColors = derived((reader) => { + const theme = currentColorTheme.read(reader); + const insertColor = theme.getColor(diffOverviewRulerInserted) || (theme.getColor(diffInserted) || defaultInsertColor).transparent(2); + const removeColor = theme.getColor(diffOverviewRulerRemoved) || (theme.getColor(diffRemoved) || defaultRemoveColor).transparent(2); + return { insertColor, removeColor }; + }); + const viewportDomElement = createFastDomNode(document.createElement("div")); + viewportDomElement.setClassName("diffViewport"); + viewportDomElement.setPosition("absolute"); + const diffOverviewRoot = h("div.diffOverview", { + style: { position: "absolute", top: "0px", width: OverviewRulerFeature_1.ENTIRE_DIFF_OVERVIEW_WIDTH + "px" } + }).root; + this._register(appendRemoveOnDispose(diffOverviewRoot, viewportDomElement.domNode)); + this._register(addStandardDisposableListener(diffOverviewRoot, EventType.POINTER_DOWN, (e) => { + this._editors.modified.delegateVerticalScrollbarPointerDown(e); + })); + this._register(addDisposableListener(diffOverviewRoot, EventType.MOUSE_WHEEL, (e) => { + this._editors.modified.delegateScrollFromMouseWheelEvent(e); + }, { passive: false })); + this._register(appendRemoveOnDispose(this._rootElement, diffOverviewRoot)); + this._register(autorunWithStore((reader, store) => { + const m = this._diffModel.read(reader); + const originalOverviewRuler = this._editors.original.createOverviewRuler("original diffOverviewRuler"); + if (originalOverviewRuler) { + store.add(originalOverviewRuler); + store.add(appendRemoveOnDispose(diffOverviewRoot, originalOverviewRuler.getDomNode())); + } + const modifiedOverviewRuler = this._editors.modified.createOverviewRuler("modified diffOverviewRuler"); + if (modifiedOverviewRuler) { + store.add(modifiedOverviewRuler); + store.add(appendRemoveOnDispose(diffOverviewRoot, modifiedOverviewRuler.getDomNode())); + } + if (!originalOverviewRuler || !modifiedOverviewRuler) { + return; + } + const origViewZonesChanged = observableSignalFromEvent("viewZoneChanged", this._editors.original.onDidChangeViewZones); + const modViewZonesChanged = observableSignalFromEvent("viewZoneChanged", this._editors.modified.onDidChangeViewZones); + const origHiddenRangesChanged = observableSignalFromEvent("hiddenRangesChanged", this._editors.original.onDidChangeHiddenAreas); + const modHiddenRangesChanged = observableSignalFromEvent("hiddenRangesChanged", this._editors.modified.onDidChangeHiddenAreas); + store.add(autorun((reader2) => { + origViewZonesChanged.read(reader2); + modViewZonesChanged.read(reader2); + origHiddenRangesChanged.read(reader2); + modHiddenRangesChanged.read(reader2); + const colors = currentColors.read(reader2); + const diff = m?.diff.read(reader2)?.mappings; + function createZones(ranges, color, editor2) { + const vm = editor2._getViewModel(); + if (!vm) { + return []; + } + return ranges.filter((d) => d.length > 0).map((r) => { + const start = vm.coordinatesConverter.convertModelPositionToViewPosition(new Position(r.startLineNumber, 1)); + const end = vm.coordinatesConverter.convertModelPositionToViewPosition(new Position(r.endLineNumberExclusive, 1)); + const lineCount = end.lineNumber - start.lineNumber; + return new OverviewRulerZone(start.lineNumber, end.lineNumber, lineCount, color.toString()); + }); + } + const originalZones = createZones((diff || []).map((d) => d.lineRangeMapping.original), colors.removeColor, this._editors.original); + const modifiedZones = createZones((diff || []).map((d) => d.lineRangeMapping.modified), colors.insertColor, this._editors.modified); + originalOverviewRuler?.setZones(originalZones); + modifiedOverviewRuler?.setZones(modifiedZones); + })); + store.add(autorun((reader2) => { + const height = this._rootHeight.read(reader2); + const width2 = this._rootWidth.read(reader2); + const layoutInfo = this._modifiedEditorLayoutInfo.read(reader2); + if (layoutInfo) { + const freeSpace = OverviewRulerFeature_1.ENTIRE_DIFF_OVERVIEW_WIDTH - 2 * OverviewRulerFeature_1.ONE_OVERVIEW_WIDTH; + originalOverviewRuler.setLayout({ + top: 0, + height, + right: freeSpace + OverviewRulerFeature_1.ONE_OVERVIEW_WIDTH, + width: OverviewRulerFeature_1.ONE_OVERVIEW_WIDTH + }); + modifiedOverviewRuler.setLayout({ + top: 0, + height, + right: 0, + width: OverviewRulerFeature_1.ONE_OVERVIEW_WIDTH + }); + const scrollTop = this._editors.modifiedScrollTop.read(reader2); + const scrollHeight = this._editors.modifiedScrollHeight.read(reader2); + const scrollBarOptions = this._editors.modified.getOption( + 117 + /* EditorOption.scrollbar */ + ); + const state = new ScrollbarState(scrollBarOptions.verticalHasArrows ? scrollBarOptions.arrowSize : 0, scrollBarOptions.verticalScrollbarSize, 0, layoutInfo.height, scrollHeight, scrollTop); + viewportDomElement.setTop(state.getSliderPosition()); + viewportDomElement.setHeight(state.getSliderSize()); + } else { + viewportDomElement.setTop(0); + viewportDomElement.setHeight(0); + } + diffOverviewRoot.style.height = height + "px"; + diffOverviewRoot.style.left = width2 - OverviewRulerFeature_1.ENTIRE_DIFF_OVERVIEW_WIDTH + "px"; + viewportDomElement.setWidth(OverviewRulerFeature_1.ENTIRE_DIFF_OVERVIEW_WIDTH); + })); + })); + } +}; +OverviewRulerFeature = OverviewRulerFeature_1 = __decorate33([ + __param29(6, IThemeService) +], OverviewRulerFeature); + +// node_modules/monaco-editor-core/esm/vs/editor/browser/widget/diffEditor/components/diffEditorEditors.js +init_position(); +init_nls(); +init_instantiation(); +init_contextkey(); +var __decorate34 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param30 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var DiffEditorEditors = class DiffEditorEditors2 extends Disposable { + get onDidContentSizeChange() { + return this._onDidContentSizeChange.event; + } + constructor(originalEditorElement, modifiedEditorElement, _options, _argCodeEditorWidgetOptions, _createInnerEditor, _contextKeyService, _instantiationService, _keybindingService) { + super(); + this.originalEditorElement = originalEditorElement; + this.modifiedEditorElement = modifiedEditorElement; + this._options = _options; + this._argCodeEditorWidgetOptions = _argCodeEditorWidgetOptions; + this._createInnerEditor = _createInnerEditor; + this._contextKeyService = _contextKeyService; + this._instantiationService = _instantiationService; + this._keybindingService = _keybindingService; + this.original = this._register(this._createLeftHandSideEditor(this._options.editorOptions.get(), this._argCodeEditorWidgetOptions.originalEditor || {})); + this.modified = this._register(this._createRightHandSideEditor(this._options.editorOptions.get(), this._argCodeEditorWidgetOptions.modifiedEditor || {})); + this._onDidContentSizeChange = this._register(new Emitter()); + this.modifiedScrollTop = observableFromEvent(this, this.modified.onDidScrollChange, () => ( + /** @description modified.getScrollTop */ + this.modified.getScrollTop() + )); + this.modifiedScrollHeight = observableFromEvent(this, this.modified.onDidScrollChange, () => ( + /** @description modified.getScrollHeight */ + this.modified.getScrollHeight() + )); + this.modifiedObs = observableCodeEditor(this.modified); + this.originalObs = observableCodeEditor(this.original); + this.modifiedModel = this.modifiedObs.model; + this.modifiedSelections = observableFromEvent(this, this.modified.onDidChangeCursorSelection, () => this.modified.getSelections() ?? []); + this.modifiedCursor = derivedOpts({ owner: this, equalsFn: Position.equals }, (reader) => this.modifiedSelections.read(reader)[0]?.getPosition() ?? new Position(1, 1)); + this.originalCursor = observableFromEvent(this, this.original.onDidChangeCursorPosition, () => this.original.getPosition() ?? new Position(1, 1)); + this.isOriginalFocused = observableCodeEditor(this.original).isFocused; + this.isModifiedFocused = observableCodeEditor(this.modified).isFocused; + this.isFocused = derived(this, (reader) => this.isOriginalFocused.read(reader) || this.isModifiedFocused.read(reader)); + this._argCodeEditorWidgetOptions = null; + this._register(autorunHandleChanges({ + changeTracker: { + createChangeSummary: () => ({}), + handleChange: (ctx, changeSummary) => { + if (ctx.didChange(_options.editorOptions)) { + Object.assign(changeSummary, ctx.change.changedOptions); + } + return true; + } + } + }, (reader, changeSummary) => { + _options.editorOptions.read(reader); + this._options.renderSideBySide.read(reader); + this.modified.updateOptions(this._adjustOptionsForRightHandSide(reader, changeSummary)); + this.original.updateOptions(this._adjustOptionsForLeftHandSide(reader, changeSummary)); + })); + } + _createLeftHandSideEditor(options2, codeEditorWidgetOptions) { + const leftHandSideOptions = this._adjustOptionsForLeftHandSide(void 0, options2); + const editor2 = this._constructInnerEditor(this._instantiationService, this.originalEditorElement, leftHandSideOptions, codeEditorWidgetOptions); + const isInDiffLeftEditorKey = this._contextKeyService.createKey("isInDiffLeftEditor", editor2.hasWidgetFocus()); + this._register(editor2.onDidFocusEditorWidget(() => isInDiffLeftEditorKey.set(true))); + this._register(editor2.onDidBlurEditorWidget(() => isInDiffLeftEditorKey.set(false))); + return editor2; + } + _createRightHandSideEditor(options2, codeEditorWidgetOptions) { + const rightHandSideOptions = this._adjustOptionsForRightHandSide(void 0, options2); + const editor2 = this._constructInnerEditor(this._instantiationService, this.modifiedEditorElement, rightHandSideOptions, codeEditorWidgetOptions); + const isInDiffRightEditorKey = this._contextKeyService.createKey("isInDiffRightEditor", editor2.hasWidgetFocus()); + this._register(editor2.onDidFocusEditorWidget(() => isInDiffRightEditorKey.set(true))); + this._register(editor2.onDidBlurEditorWidget(() => isInDiffRightEditorKey.set(false))); + return editor2; + } + _constructInnerEditor(instantiationService, container, options2, editorWidgetOptions) { + const editor2 = this._createInnerEditor(instantiationService, container, options2, editorWidgetOptions); + this._register(editor2.onDidContentSizeChange((e) => { + const width2 = this.original.getContentWidth() + this.modified.getContentWidth() + OverviewRulerFeature.ENTIRE_DIFF_OVERVIEW_WIDTH; + const height = Math.max(this.modified.getContentHeight(), this.original.getContentHeight()); + this._onDidContentSizeChange.fire({ + contentHeight: height, + contentWidth: width2, + contentHeightChanged: e.contentHeightChanged, + contentWidthChanged: e.contentWidthChanged + }); + })); + return editor2; + } + _adjustOptionsForLeftHandSide(_reader, changedOptions) { + const result = this._adjustOptionsForSubEditor(changedOptions); + if (!this._options.renderSideBySide.get()) { + result.wordWrapOverride1 = "off"; + result.wordWrapOverride2 = "off"; + result.stickyScroll = { enabled: false }; + result.unicodeHighlight = { nonBasicASCII: false, ambiguousCharacters: false, invisibleCharacters: false }; + } else { + result.unicodeHighlight = this._options.editorOptions.get().unicodeHighlight || {}; + result.wordWrapOverride1 = this._options.diffWordWrap.get(); + } + result.glyphMargin = this._options.renderSideBySide.get(); + if (changedOptions.originalAriaLabel) { + result.ariaLabel = changedOptions.originalAriaLabel; + } + result.ariaLabel = this._updateAriaLabel(result.ariaLabel); + result.readOnly = !this._options.originalEditable.get(); + result.dropIntoEditor = { enabled: !result.readOnly }; + result.extraEditorClassName = "original-in-monaco-diff-editor"; + return result; + } + _adjustOptionsForRightHandSide(reader, changedOptions) { + const result = this._adjustOptionsForSubEditor(changedOptions); + if (changedOptions.modifiedAriaLabel) { + result.ariaLabel = changedOptions.modifiedAriaLabel; + } + result.ariaLabel = this._updateAriaLabel(result.ariaLabel); + result.wordWrapOverride1 = this._options.diffWordWrap.get(); + result.revealHorizontalRightPadding = EditorOptions.revealHorizontalRightPadding.defaultValue + OverviewRulerFeature.ENTIRE_DIFF_OVERVIEW_WIDTH; + result.scrollbar.verticalHasArrows = false; + result.extraEditorClassName = "modified-in-monaco-diff-editor"; + return result; + } + _adjustOptionsForSubEditor(options2) { + const clonedOptions = { + ...options2, + dimension: { + height: 0, + width: 0 + } + }; + clonedOptions.inDiffEditor = true; + clonedOptions.automaticLayout = false; + clonedOptions.allowVariableLineHeights = false; + clonedOptions.allowVariableFonts = false; + clonedOptions.allowVariableFontsInAccessibilityMode = false; + clonedOptions.scrollbar = { ...clonedOptions.scrollbar || {} }; + clonedOptions.folding = false; + clonedOptions.codeLens = this._options.diffCodeLens.get(); + clonedOptions.fixedOverflowWidgets = true; + clonedOptions.minimap = { ...clonedOptions.minimap || {} }; + clonedOptions.minimap.enabled = false; + if (this._options.hideUnchangedRegions.get()) { + clonedOptions.stickyScroll = { enabled: false }; + } else { + clonedOptions.stickyScroll = this._options.editorOptions.get().stickyScroll; + } + return clonedOptions; + } + _updateAriaLabel(ariaLabel) { + if (!ariaLabel) { + ariaLabel = ""; + } + const ariaNavigationTip = localize(111, " use {0} to open the accessibility help.", this._keybindingService.lookupKeybinding("editor.action.accessibilityHelp")?.getAriaLabel()); + if (this._options.accessibilityVerbose.get()) { + return ariaLabel + ariaNavigationTip; + } else if (ariaLabel) { + return ariaLabel.replaceAll(ariaNavigationTip, ""); + } + return ""; + } +}; +DiffEditorEditors = __decorate34([ + __param30(5, IContextKeyService), + __param30(6, IInstantiationService), + __param30(7, IKeybindingService) +], DiffEditorEditors); + +// node_modules/monaco-editor-core/esm/vs/base/browser/ui/sash/sash.js +init_dom(); +init_async(); +init_event(); +init_lifecycle(); +init_platform(); +var __decorate35 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var DEBUG = false; +var OrthogonalEdge; +(function(OrthogonalEdge2) { + OrthogonalEdge2["North"] = "north"; + OrthogonalEdge2["South"] = "south"; + OrthogonalEdge2["East"] = "east"; + OrthogonalEdge2["West"] = "west"; +})(OrthogonalEdge || (OrthogonalEdge = {})); +var globalSize = 4; +var onDidChangeGlobalSize = new Emitter(); +var globalHoverDelay = 300; +var onDidChangeHoverDelay = new Emitter(); +var MouseEventFactory = class { + constructor(el) { + this.el = el; + this.disposables = new DisposableStore(); + } + get onPointerMove() { + return this.disposables.add(new DomEmitter(getWindow(this.el), "mousemove")).event; + } + get onPointerUp() { + return this.disposables.add(new DomEmitter(getWindow(this.el), "mouseup")).event; + } + dispose() { + this.disposables.dispose(); + } +}; +__decorate35([ + memoize +], MouseEventFactory.prototype, "onPointerMove", null); +__decorate35([ + memoize +], MouseEventFactory.prototype, "onPointerUp", null); +var GestureEventFactory = class { + get onPointerMove() { + return this.disposables.add(new DomEmitter(this.el, EventType2.Change)).event; + } + get onPointerUp() { + return this.disposables.add(new DomEmitter(this.el, EventType2.End)).event; + } + constructor(el) { + this.el = el; + this.disposables = new DisposableStore(); + } + dispose() { + this.disposables.dispose(); + } +}; +__decorate35([ + memoize +], GestureEventFactory.prototype, "onPointerMove", null); +__decorate35([ + memoize +], GestureEventFactory.prototype, "onPointerUp", null); +var OrthogonalPointerEventFactory = class { + get onPointerMove() { + return this.factory.onPointerMove; + } + get onPointerUp() { + return this.factory.onPointerUp; + } + constructor(factory) { + this.factory = factory; + } + dispose() { + } +}; +__decorate35([ + memoize +], OrthogonalPointerEventFactory.prototype, "onPointerMove", null); +__decorate35([ + memoize +], OrthogonalPointerEventFactory.prototype, "onPointerUp", null); +var PointerEventsDisabledCssClass = "pointer-events-disabled"; +var Sash = class _Sash extends Disposable { + get state() { + return this._state; + } + get orthogonalStartSash() { + return this._orthogonalStartSash; + } + get orthogonalEndSash() { + return this._orthogonalEndSash; + } + /** + * The state of a sash defines whether it can be interacted with by the user + * as well as what mouse cursor to use, when hovered. + */ + set state(state) { + if (this._state === state) { + return; + } + this.el.classList.toggle( + "disabled", + state === 0 + /* SashState.Disabled */ + ); + this.el.classList.toggle( + "minimum", + state === 1 + /* SashState.AtMinimum */ + ); + this.el.classList.toggle( + "maximum", + state === 2 + /* SashState.AtMaximum */ + ); + this._state = state; + this.onDidEnablementChange.fire(state); + } + /** + * An event which fires whenever the user starts dragging this sash. + */ + get onDidStart() { + return this._onDidStart.event; + } + /** + * An event which fires whenever the user moves the mouse while + * dragging this sash. + */ + get onDidChange() { + return this._onDidChange.event; + } + /** + * An event which fires whenever the user double clicks this sash. + */ + get onDidReset() { + return this._onDidReset.event; + } + /** + * An event which fires whenever the user stops dragging this sash. + */ + get onDidEnd() { + return this._onDidEnd.event; + } + /** + * A reference to another sash, perpendicular to this one, which + * aligns at the start of this one. A corner sash will be created + * automatically at that location. + * + * The start of a horizontal sash is its left-most position. + * The start of a vertical sash is its top-most position. + */ + set orthogonalStartSash(sash) { + if (this._orthogonalStartSash === sash) { + return; + } + this.orthogonalStartDragHandleDisposables.clear(); + this.orthogonalStartSashDisposables.clear(); + if (sash) { + const onChange = (state) => { + this.orthogonalStartDragHandleDisposables.clear(); + if (state !== 0) { + this._orthogonalStartDragHandle = append(this.el, $(".orthogonal-drag-handle.start")); + this.orthogonalStartDragHandleDisposables.add(toDisposable(() => this._orthogonalStartDragHandle.remove())); + this.orthogonalStartDragHandleDisposables.add(addDisposableListener(this._orthogonalStartDragHandle, "mouseenter", () => _Sash.onMouseEnter(sash))); + this.orthogonalStartDragHandleDisposables.add(addDisposableListener(this._orthogonalStartDragHandle, "mouseleave", () => _Sash.onMouseLeave(sash))); + } + }; + this.orthogonalStartSashDisposables.add(sash.onDidEnablementChange.event(onChange, this)); + onChange(sash.state); + } + this._orthogonalStartSash = sash; + } + /** + * A reference to another sash, perpendicular to this one, which + * aligns at the end of this one. A corner sash will be created + * automatically at that location. + * + * The end of a horizontal sash is its right-most position. + * The end of a vertical sash is its bottom-most position. + */ + set orthogonalEndSash(sash) { + if (this._orthogonalEndSash === sash) { + return; + } + this.orthogonalEndDragHandleDisposables.clear(); + this.orthogonalEndSashDisposables.clear(); + if (sash) { + const onChange = (state) => { + this.orthogonalEndDragHandleDisposables.clear(); + if (state !== 0) { + this._orthogonalEndDragHandle = append(this.el, $(".orthogonal-drag-handle.end")); + this.orthogonalEndDragHandleDisposables.add(toDisposable(() => this._orthogonalEndDragHandle.remove())); + this.orthogonalEndDragHandleDisposables.add(addDisposableListener(this._orthogonalEndDragHandle, "mouseenter", () => _Sash.onMouseEnter(sash))); + this.orthogonalEndDragHandleDisposables.add(addDisposableListener(this._orthogonalEndDragHandle, "mouseleave", () => _Sash.onMouseLeave(sash))); + } + }; + this.orthogonalEndSashDisposables.add(sash.onDidEnablementChange.event(onChange, this)); + onChange(sash.state); + } + this._orthogonalEndSash = sash; + } + constructor(container, layoutProvider, options2) { + super(); + this.hoverDelay = globalHoverDelay; + this.hoverDelayer = this._register(new Delayer(this.hoverDelay)); + this._state = 3; + this.onDidEnablementChange = this._register(new Emitter()); + this._onDidStart = this._register(new Emitter()); + this._onDidChange = this._register(new Emitter()); + this._onDidReset = this._register(new Emitter()); + this._onDidEnd = this._register(new Emitter()); + this.orthogonalStartSashDisposables = this._register(new DisposableStore()); + this.orthogonalStartDragHandleDisposables = this._register(new DisposableStore()); + this.orthogonalEndSashDisposables = this._register(new DisposableStore()); + this.orthogonalEndDragHandleDisposables = this._register(new DisposableStore()); + this.linkedSash = void 0; + this.el = append(container, $(".monaco-sash")); + if (options2.orthogonalEdge) { + this.el.classList.add(`orthogonal-edge-${options2.orthogonalEdge}`); + } + if (isMacintosh) { + this.el.classList.add("mac"); + } + this._register(addDisposableListener(this.el, "mousedown", (e) => this.onPointerStart(e, new MouseEventFactory(container)))); + this._register(addDisposableListener(this.el, "dblclick", (e) => this.onPointerDoublePress(e))); + this._register(addDisposableListener(this.el, "mouseenter", () => _Sash.onMouseEnter(this))); + this._register(addDisposableListener(this.el, "mouseleave", () => _Sash.onMouseLeave(this))); + this._register(Gesture.addTarget(this.el)); + this._register(addDisposableListener(this.el, EventType2.Start, (e) => this.onPointerStart(e, new GestureEventFactory(this.el)))); + let doubleTapTimeout = void 0; + this._register(addDisposableListener(this.el, EventType2.Tap, (event) => { + if (doubleTapTimeout) { + clearTimeout(doubleTapTimeout); + doubleTapTimeout = void 0; + this.onPointerDoublePress(event); + return; + } + clearTimeout(doubleTapTimeout); + doubleTapTimeout = setTimeout(() => doubleTapTimeout = void 0, 250); + })); + if (typeof options2.size === "number") { + this.size = options2.size; + if (options2.orientation === 0) { + this.el.style.width = `${this.size}px`; + } else { + this.el.style.height = `${this.size}px`; + } + } else { + this.size = globalSize; + this._register(onDidChangeGlobalSize.event((size2) => { + this.size = size2; + this.layout(); + })); + } + this._register(onDidChangeHoverDelay.event((delay) => this.hoverDelay = delay)); + this.layoutProvider = layoutProvider; + this.orthogonalStartSash = options2.orthogonalStartSash; + this.orthogonalEndSash = options2.orthogonalEndSash; + this.orientation = options2.orientation || 0; + if (this.orientation === 1) { + this.el.classList.add("horizontal"); + this.el.classList.remove("vertical"); + } else { + this.el.classList.remove("horizontal"); + this.el.classList.add("vertical"); + } + this.el.classList.toggle("debug", DEBUG); + this.layout(); + } + onPointerStart(event, pointerEventFactory) { + EventHelper.stop(event); + let isMultisashResize = false; + if (!event.__orthogonalSashEvent) { + const orthogonalSash = this.getOrthogonalSash(event); + if (orthogonalSash) { + isMultisashResize = true; + event.__orthogonalSashEvent = true; + orthogonalSash.onPointerStart(event, new OrthogonalPointerEventFactory(pointerEventFactory)); + } + } + if (this.linkedSash && !event.__linkedSashEvent) { + event.__linkedSashEvent = true; + this.linkedSash.onPointerStart(event, new OrthogonalPointerEventFactory(pointerEventFactory)); + } + if (!this.state) { + return; + } + const iframes = this.el.ownerDocument.getElementsByTagName("iframe"); + for (const iframe of iframes) { + iframe.classList.add(PointerEventsDisabledCssClass); + } + const startX = event.pageX; + const startY = event.pageY; + const altKey = event.altKey; + const startEvent = { startX, currentX: startX, startY, currentY: startY, altKey }; + this.el.classList.add("active"); + this._onDidStart.fire(startEvent); + const style = createStyleSheet(this.el); + const updateStyle = () => { + let cursor = ""; + if (isMultisashResize) { + cursor = "all-scroll"; + } else if (this.orientation === 1) { + if (this.state === 1) { + cursor = "s-resize"; + } else if (this.state === 2) { + cursor = "n-resize"; + } else { + cursor = isMacintosh ? "row-resize" : "ns-resize"; + } + } else { + if (this.state === 1) { + cursor = "e-resize"; + } else if (this.state === 2) { + cursor = "w-resize"; + } else { + cursor = isMacintosh ? "col-resize" : "ew-resize"; + } + } + style.textContent = `* { cursor: ${cursor} !important; }`; + }; + const disposables = new DisposableStore(); + updateStyle(); + if (!isMultisashResize) { + this.onDidEnablementChange.event(updateStyle, null, disposables); + } + const onPointerMove = (e) => { + EventHelper.stop(e, false); + const event2 = { startX, currentX: e.pageX, startY, currentY: e.pageY, altKey }; + this._onDidChange.fire(event2); + }; + const onPointerUp = (e) => { + EventHelper.stop(e, false); + style.remove(); + this.el.classList.remove("active"); + this._onDidEnd.fire(); + disposables.dispose(); + for (const iframe of iframes) { + iframe.classList.remove(PointerEventsDisabledCssClass); + } + }; + pointerEventFactory.onPointerMove(onPointerMove, null, disposables); + pointerEventFactory.onPointerUp(onPointerUp, null, disposables); + disposables.add(pointerEventFactory); + } + onPointerDoublePress(e) { + const orthogonalSash = this.getOrthogonalSash(e); + if (orthogonalSash) { + orthogonalSash._onDidReset.fire(); + } + if (this.linkedSash) { + this.linkedSash._onDidReset.fire(); + } + this._onDidReset.fire(); + } + static onMouseEnter(sash, fromLinkedSash = false) { + if (sash.el.classList.contains("active")) { + sash.hoverDelayer.cancel(); + sash.el.classList.add("hover"); + } else { + sash.hoverDelayer.trigger(() => sash.el.classList.add("hover"), sash.hoverDelay).then(void 0, () => { + }); + } + if (!fromLinkedSash && sash.linkedSash) { + _Sash.onMouseEnter(sash.linkedSash, true); + } + } + static onMouseLeave(sash, fromLinkedSash = false) { + sash.hoverDelayer.cancel(); + sash.el.classList.remove("hover"); + if (!fromLinkedSash && sash.linkedSash) { + _Sash.onMouseLeave(sash.linkedSash, true); + } + } + /** + * Forcefully stop any user interactions with this sash. + * Useful when hiding a parent component, while the user is still + * interacting with the sash. + */ + clearSashHoverState() { + _Sash.onMouseLeave(this); + } + /** + * Layout the sash. The sash will size and position itself + * based on its provided {@link ISashLayoutProvider layout provider}. + */ + layout() { + if (this.orientation === 0) { + const verticalProvider = this.layoutProvider; + this.el.style.left = verticalProvider.getVerticalSashLeft(this) - this.size / 2 + "px"; + if (verticalProvider.getVerticalSashTop) { + this.el.style.top = verticalProvider.getVerticalSashTop(this) + "px"; + } + if (verticalProvider.getVerticalSashHeight) { + this.el.style.height = verticalProvider.getVerticalSashHeight(this) + "px"; + } + } else { + const horizontalProvider = this.layoutProvider; + this.el.style.top = horizontalProvider.getHorizontalSashTop(this) - this.size / 2 + "px"; + if (horizontalProvider.getHorizontalSashLeft) { + this.el.style.left = horizontalProvider.getHorizontalSashLeft(this) + "px"; + } + if (horizontalProvider.getHorizontalSashWidth) { + this.el.style.width = horizontalProvider.getHorizontalSashWidth(this) + "px"; + } + } + } + getOrthogonalSash(e) { + const target = e.initialTarget ?? e.target; + if (!target || !isHTMLElement(target)) { + return void 0; + } + if (target.classList.contains("orthogonal-drag-handle")) { + return target.classList.contains("start") ? this.orthogonalStartSash : this.orthogonalEndSash; + } + return void 0; + } + dispose() { + super.dispose(); + this.el.remove(); + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/browser/widget/diffEditor/components/diffEditorSash.js +init_lifecycle(); +init_observable(); +var SashLayout = class { + resetSash() { + this._sashRatio.set(void 0, void 0); + } + constructor(_options, dimensions) { + this._options = _options; + this.dimensions = dimensions; + this.sashLeft = derivedWithSetter(this, (reader) => { + const ratio = this._sashRatio.read(reader) ?? this._options.splitViewDefaultRatio.read(reader); + return this._computeSashLeft(ratio, reader); + }, (value, tx) => { + const contentWidth = this.dimensions.width.get(); + this._sashRatio.set(value / contentWidth, tx); + }); + this._sashRatio = observableValue(this, void 0); + } + /** @pure */ + _computeSashLeft(desiredRatio, reader) { + const contentWidth = this.dimensions.width.read(reader); + const midPoint = Math.floor(this._options.splitViewDefaultRatio.read(reader) * contentWidth); + const sashLeft = this._options.enableSplitViewResizing.read(reader) ? Math.floor(desiredRatio * contentWidth) : midPoint; + const MINIMUM_EDITOR_WIDTH = 100; + if (contentWidth <= MINIMUM_EDITOR_WIDTH * 2) { + return midPoint; + } + if (sashLeft < MINIMUM_EDITOR_WIDTH) { + return MINIMUM_EDITOR_WIDTH; + } + if (sashLeft > contentWidth - MINIMUM_EDITOR_WIDTH) { + return contentWidth - MINIMUM_EDITOR_WIDTH; + } + return sashLeft; + } +}; +var DiffEditorSash = class extends Disposable { + constructor(_domNode, _dimensions, _enabled, _boundarySashes, sashLeft, _resetSash) { + super(); + this._domNode = _domNode; + this._dimensions = _dimensions; + this._enabled = _enabled; + this._boundarySashes = _boundarySashes; + this.sashLeft = sashLeft; + this._resetSash = _resetSash; + this._sash = this._register(new Sash(this._domNode, { + getVerticalSashTop: (_sash) => 0, + getVerticalSashLeft: (_sash) => this.sashLeft.get(), + getVerticalSashHeight: (_sash) => this._dimensions.height.get() + }, { + orientation: 0 + /* Orientation.VERTICAL */ + })); + this._startSashPosition = void 0; + this._register(this._sash.onDidStart(() => { + this._startSashPosition = this.sashLeft.get(); + })); + this._register(this._sash.onDidChange((e) => { + this.sashLeft.set(this._startSashPosition + (e.currentX - e.startX), void 0); + })); + this._register(this._sash.onDidEnd(() => this._sash.layout())); + this._register(this._sash.onDidReset(() => this._resetSash())); + this._register(autorun((reader) => { + const sashes = this._boundarySashes.read(reader); + if (sashes) { + this._sash.orthogonalEndSash = sashes.bottom; + } + })); + this._register(autorun((reader) => { + const enabled = this._enabled.read(reader); + this._sash.state = enabled ? 3 : 0; + this.sashLeft.read(reader); + this._dimensions.height.read(reader); + this._sash.layout(); + })); + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/browser/widget/diffEditor/delegatingEditorImpl.js +init_event(); +init_lifecycle(); +var DelegatingEditor = class _DelegatingEditor extends Disposable { + constructor() { + super(...arguments); + this._id = ++_DelegatingEditor.idCounter; + this._onDidDispose = this._register(new Emitter()); + this.onDidDispose = this._onDidDispose.event; + } + static { + this.idCounter = 0; + } + getId() { + return this.getEditorType() + ":v2:" + this._id; + } + // #region editorBrowser.IDiffEditor: Delegating to modified Editor + getVisibleColumnFromPosition(position) { + return this._targetEditor.getVisibleColumnFromPosition(position); + } + getPosition() { + return this._targetEditor.getPosition(); + } + setPosition(position, source = "api") { + this._targetEditor.setPosition(position, source); + } + revealLine(lineNumber, scrollType = 0) { + this._targetEditor.revealLine(lineNumber, scrollType); + } + revealLineInCenter(lineNumber, scrollType = 0) { + this._targetEditor.revealLineInCenter(lineNumber, scrollType); + } + revealLineInCenterIfOutsideViewport(lineNumber, scrollType = 0) { + this._targetEditor.revealLineInCenterIfOutsideViewport(lineNumber, scrollType); + } + revealLineNearTop(lineNumber, scrollType = 0) { + this._targetEditor.revealLineNearTop(lineNumber, scrollType); + } + revealPosition(position, scrollType = 0) { + this._targetEditor.revealPosition(position, scrollType); + } + revealPositionInCenter(position, scrollType = 0) { + this._targetEditor.revealPositionInCenter(position, scrollType); + } + revealPositionInCenterIfOutsideViewport(position, scrollType = 0) { + this._targetEditor.revealPositionInCenterIfOutsideViewport(position, scrollType); + } + revealPositionNearTop(position, scrollType = 0) { + this._targetEditor.revealPositionNearTop(position, scrollType); + } + getSelection() { + return this._targetEditor.getSelection(); + } + getSelections() { + return this._targetEditor.getSelections(); + } + setSelection(something, source = "api") { + this._targetEditor.setSelection(something, source); + } + setSelections(ranges, source = "api") { + this._targetEditor.setSelections(ranges, source); + } + revealLines(startLineNumber, endLineNumber, scrollType = 0) { + this._targetEditor.revealLines(startLineNumber, endLineNumber, scrollType); + } + revealLinesInCenter(startLineNumber, endLineNumber, scrollType = 0) { + this._targetEditor.revealLinesInCenter(startLineNumber, endLineNumber, scrollType); + } + revealLinesInCenterIfOutsideViewport(startLineNumber, endLineNumber, scrollType = 0) { + this._targetEditor.revealLinesInCenterIfOutsideViewport(startLineNumber, endLineNumber, scrollType); + } + revealLinesNearTop(startLineNumber, endLineNumber, scrollType = 0) { + this._targetEditor.revealLinesNearTop(startLineNumber, endLineNumber, scrollType); + } + revealRange(range2, scrollType = 0, revealVerticalInCenter = false, revealHorizontal = true) { + this._targetEditor.revealRange(range2, scrollType, revealVerticalInCenter, revealHorizontal); + } + revealRangeInCenter(range2, scrollType = 0) { + this._targetEditor.revealRangeInCenter(range2, scrollType); + } + revealRangeInCenterIfOutsideViewport(range2, scrollType = 0) { + this._targetEditor.revealRangeInCenterIfOutsideViewport(range2, scrollType); + } + revealRangeNearTop(range2, scrollType = 0) { + this._targetEditor.revealRangeNearTop(range2, scrollType); + } + revealRangeNearTopIfOutsideViewport(range2, scrollType = 0) { + this._targetEditor.revealRangeNearTopIfOutsideViewport(range2, scrollType); + } + revealRangeAtTop(range2, scrollType = 0) { + this._targetEditor.revealRangeAtTop(range2, scrollType); + } + getSupportedActions() { + return this._targetEditor.getSupportedActions(); + } + focus() { + this._targetEditor.focus(); + } + trigger(source, handlerId, payload) { + this._targetEditor.trigger(source, handlerId, payload); + } + createDecorationsCollection(decorations) { + return this._targetEditor.createDecorationsCollection(decorations); + } + changeDecorations(callback) { + return this._targetEditor.changeDecorations(callback); + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/browser/widget/diffEditor/diffEditorOptions.js +init_observable(); + +// node_modules/monaco-editor-core/esm/vs/editor/common/config/diffEditor.js +var diffEditorDefaultOptions = { + enableSplitViewResizing: true, + splitViewDefaultRatio: 0.5, + renderSideBySide: true, + renderMarginRevertIcon: true, + renderGutterMenu: true, + maxComputationTime: 5e3, + maxFileSize: 50, + ignoreTrimWhitespace: true, + renderIndicators: true, + originalEditable: false, + diffCodeLens: false, + renderOverviewRuler: true, + diffWordWrap: "inherit", + diffAlgorithm: "advanced", + accessibilityVerbose: false, + experimental: { + showMoves: false, + showEmptyDecorations: true, + useTrueInlineView: false + }, + hideUnchangedRegions: { + enabled: false, + contextLineCount: 3, + minimumLineCount: 3, + revealLineCount: 20 + }, + isInEmbeddedEditor: false, + onlyShowAccessibleDiffViewer: false, + renderSideBySideInlineBreakpoint: 900, + useInlineViewWhenSpaceIsLimited: true, + compactMode: false +}; + +// node_modules/monaco-editor-core/esm/vs/editor/browser/widget/diffEditor/diffEditorOptions.js +var __decorate36 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param31 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var DiffEditorOptions = class DiffEditorOptions2 { + get editorOptions() { + return this._options; + } + constructor(options2, _accessibilityService) { + this._accessibilityService = _accessibilityService; + this._diffEditorWidth = observableValue(this, 0); + this._screenReaderMode = observableFromEvent(this, this._accessibilityService.onDidChangeScreenReaderOptimized, () => this._accessibilityService.isScreenReaderOptimized()); + this.couldShowInlineViewBecauseOfSize = derived(this, (reader) => this._options.read(reader).renderSideBySide && this._diffEditorWidth.read(reader) <= this._options.read(reader).renderSideBySideInlineBreakpoint); + this.renderOverviewRuler = derived(this, (reader) => this._options.read(reader).renderOverviewRuler); + this.renderSideBySide = derived(this, (reader) => { + if (this.compactMode.read(reader)) { + if (this.shouldRenderInlineViewInSmartMode.read(reader)) { + return false; + } + } + return this._options.read(reader).renderSideBySide && !(this._options.read(reader).useInlineViewWhenSpaceIsLimited && this.couldShowInlineViewBecauseOfSize.read(reader) && !this._screenReaderMode.read(reader)); + }); + this.readOnly = derived(this, (reader) => this._options.read(reader).readOnly); + this.shouldRenderOldRevertArrows = derived(this, (reader) => { + if (!this._options.read(reader).renderMarginRevertIcon) { + return false; + } + if (!this.renderSideBySide.read(reader)) { + return false; + } + if (this.readOnly.read(reader)) { + return false; + } + if (this.shouldRenderGutterMenu.read(reader)) { + return false; + } + return true; + }); + this.shouldRenderGutterMenu = derived(this, (reader) => this._options.read(reader).renderGutterMenu); + this.renderIndicators = derived(this, (reader) => this._options.read(reader).renderIndicators); + this.enableSplitViewResizing = derived(this, (reader) => this._options.read(reader).enableSplitViewResizing); + this.splitViewDefaultRatio = derived(this, (reader) => this._options.read(reader).splitViewDefaultRatio); + this.ignoreTrimWhitespace = derived(this, (reader) => this._options.read(reader).ignoreTrimWhitespace); + this.maxComputationTimeMs = derived(this, (reader) => this._options.read(reader).maxComputationTime); + this.showMoves = derived(this, (reader) => this._options.read(reader).experimental.showMoves && this.renderSideBySide.read(reader)); + this.isInEmbeddedEditor = derived(this, (reader) => this._options.read(reader).isInEmbeddedEditor); + this.diffWordWrap = derived(this, (reader) => this._options.read(reader).diffWordWrap); + this.originalEditable = derived(this, (reader) => this._options.read(reader).originalEditable); + this.diffCodeLens = derived(this, (reader) => this._options.read(reader).diffCodeLens); + this.accessibilityVerbose = derived(this, (reader) => this._options.read(reader).accessibilityVerbose); + this.diffAlgorithm = derived(this, (reader) => this._options.read(reader).diffAlgorithm); + this.showEmptyDecorations = derived(this, (reader) => this._options.read(reader).experimental.showEmptyDecorations); + this.onlyShowAccessibleDiffViewer = derived(this, (reader) => this._options.read(reader).onlyShowAccessibleDiffViewer); + this.compactMode = derived(this, (reader) => this._options.read(reader).compactMode); + this.trueInlineDiffRenderingEnabled = derived(this, (reader) => this._options.read(reader).experimental.useTrueInlineView); + this.useTrueInlineDiffRendering = derived(this, (reader) => !this.renderSideBySide.read(reader) && this.trueInlineDiffRenderingEnabled.read(reader)); + this.hideUnchangedRegions = derived(this, (reader) => this._options.read(reader).hideUnchangedRegions.enabled); + this.hideUnchangedRegionsRevealLineCount = derived(this, (reader) => this._options.read(reader).hideUnchangedRegions.revealLineCount); + this.hideUnchangedRegionsContextLineCount = derived(this, (reader) => this._options.read(reader).hideUnchangedRegions.contextLineCount); + this.hideUnchangedRegionsMinimumLineCount = derived(this, (reader) => this._options.read(reader).hideUnchangedRegions.minimumLineCount); + this._model = observableValue(this, void 0); + this.shouldRenderInlineViewInSmartMode = this._model.map(this, (model) => derivedConstOnceDefined(this, (reader) => { + const diffs = model?.diff.read(reader); + return diffs ? isSimpleDiff(diffs, this.trueInlineDiffRenderingEnabled.read(reader)) : void 0; + })).flatten().map(this, (v) => !!v); + this.inlineViewHideOriginalLineNumbers = this.compactMode; + const optionsCopy = { ...options2, ...validateDiffEditorOptions(options2, diffEditorDefaultOptions) }; + this._options = observableValue(this, optionsCopy); + } + updateOptions(changedOptions) { + const newDiffEditorOptions = validateDiffEditorOptions(changedOptions, this._options.get()); + const newOptions = { ...this._options.get(), ...changedOptions, ...newDiffEditorOptions }; + this._options.set(newOptions, void 0, { changedOptions }); + } + setWidth(width2) { + this._diffEditorWidth.set(width2, void 0); + } + setModel(model) { + this._model.set(model, void 0); + } +}; +DiffEditorOptions = __decorate36([ + __param31(1, IAccessibilityService) +], DiffEditorOptions); +function isSimpleDiff(diff, supportsTrueDiffRendering) { + return diff.mappings.every((m) => isInsertion(m.lineRangeMapping) || isDeletion(m.lineRangeMapping) || supportsTrueDiffRendering && allowsTrueInlineDiffRendering(m.lineRangeMapping)); +} +function isInsertion(mapping) { + return mapping.original.length === 0; +} +function isDeletion(mapping) { + return mapping.modified.length === 0; +} +function validateDiffEditorOptions(options2, defaults) { + return { + enableSplitViewResizing: boolean(options2.enableSplitViewResizing, defaults.enableSplitViewResizing), + splitViewDefaultRatio: clampedFloat(options2.splitViewDefaultRatio, 0.5, 0.1, 0.9), + renderSideBySide: boolean(options2.renderSideBySide, defaults.renderSideBySide), + renderMarginRevertIcon: boolean(options2.renderMarginRevertIcon, defaults.renderMarginRevertIcon), + maxComputationTime: clampedInt( + options2.maxComputationTime, + defaults.maxComputationTime, + 0, + 1073741824 + /* Constants.MAX_SAFE_SMALL_INTEGER */ + ), + maxFileSize: clampedInt( + options2.maxFileSize, + defaults.maxFileSize, + 0, + 1073741824 + /* Constants.MAX_SAFE_SMALL_INTEGER */ + ), + ignoreTrimWhitespace: boolean(options2.ignoreTrimWhitespace, defaults.ignoreTrimWhitespace), + renderIndicators: boolean(options2.renderIndicators, defaults.renderIndicators), + originalEditable: boolean(options2.originalEditable, defaults.originalEditable), + diffCodeLens: boolean(options2.diffCodeLens, defaults.diffCodeLens), + renderOverviewRuler: boolean(options2.renderOverviewRuler, defaults.renderOverviewRuler), + diffWordWrap: stringSet(options2.diffWordWrap, defaults.diffWordWrap, ["off", "on", "inherit"]), + diffAlgorithm: stringSet(options2.diffAlgorithm, defaults.diffAlgorithm, ["legacy", "advanced"], { "smart": "legacy", "experimental": "advanced" }), + accessibilityVerbose: boolean(options2.accessibilityVerbose, defaults.accessibilityVerbose), + experimental: { + showMoves: boolean(options2.experimental?.showMoves, defaults.experimental.showMoves), + showEmptyDecorations: boolean(options2.experimental?.showEmptyDecorations, defaults.experimental.showEmptyDecorations), + useTrueInlineView: boolean(options2.experimental?.useTrueInlineView, defaults.experimental.useTrueInlineView) + }, + hideUnchangedRegions: { + // eslint-disable-next-line local/code-no-any-casts, @typescript-eslint/no-explicit-any + enabled: boolean(options2.hideUnchangedRegions?.enabled ?? options2.experimental?.collapseUnchangedRegions, defaults.hideUnchangedRegions.enabled), + contextLineCount: clampedInt( + options2.hideUnchangedRegions?.contextLineCount, + defaults.hideUnchangedRegions.contextLineCount, + 0, + 1073741824 + /* Constants.MAX_SAFE_SMALL_INTEGER */ + ), + minimumLineCount: clampedInt( + options2.hideUnchangedRegions?.minimumLineCount, + defaults.hideUnchangedRegions.minimumLineCount, + 0, + 1073741824 + /* Constants.MAX_SAFE_SMALL_INTEGER */ + ), + revealLineCount: clampedInt( + options2.hideUnchangedRegions?.revealLineCount, + defaults.hideUnchangedRegions.revealLineCount, + 0, + 1073741824 + /* Constants.MAX_SAFE_SMALL_INTEGER */ + ) + }, + isInEmbeddedEditor: boolean(options2.isInEmbeddedEditor, defaults.isInEmbeddedEditor), + onlyShowAccessibleDiffViewer: boolean(options2.onlyShowAccessibleDiffViewer, defaults.onlyShowAccessibleDiffViewer), + renderSideBySideInlineBreakpoint: clampedInt( + options2.renderSideBySideInlineBreakpoint, + defaults.renderSideBySideInlineBreakpoint, + 0, + 1073741824 + /* Constants.MAX_SAFE_SMALL_INTEGER */ + ), + useInlineViewWhenSpaceIsLimited: boolean(options2.useInlineViewWhenSpaceIsLimited, defaults.useInlineViewWhenSpaceIsLimited), + renderGutterMenu: boolean(options2.renderGutterMenu, defaults.renderGutterMenu), + compactMode: boolean(options2.compactMode, defaults.compactMode) + }; +} + +// node_modules/monaco-editor-core/esm/vs/editor/browser/widget/diffEditor/features/gutterFeature.js +init_dom(); +init_lifecycle(); +init_observable(); + +// node_modules/monaco-editor-core/esm/vs/platform/actions/browser/toolbar.js +init_dom(); +init_mouseEvent(); + +// node_modules/monaco-editor-core/esm/vs/base/browser/ui/dropdown/dropdownActionViewItem.js +init_event(); +init_dom(); + +// node_modules/monaco-editor-core/esm/vs/base/browser/ui/dropdown/dropdown.js +init_dom(); +init_keyboardEvent(); +init_actions(); +init_event(); +var BaseDropdown = class extends ActionRunner { + constructor(container, options2) { + super(); + this._onDidChangeVisibility = this._register(new Emitter()); + this.onDidChangeVisibility = this._onDidChangeVisibility.event; + this._element = append(container, $(".monaco-dropdown")); + this._label = append(this._element, $(".dropdown-label")); + let labelRenderer = options2.labelRenderer; + if (!labelRenderer) { + labelRenderer = (container2) => { + container2.textContent = options2.label || ""; + return null; + }; + } + for (const event of [EventType.CLICK, EventType.MOUSE_DOWN, EventType2.Tap]) { + this._register(addDisposableListener(this.element, event, (e) => EventHelper.stop(e, true))); + } + for (const event of [EventType.MOUSE_DOWN, EventType2.Tap]) { + this._register(addDisposableListener(this._label, event, (e) => { + if (isMouseEvent(e) && e.button !== 0) { + return; + } + if (this.visible) { + this.hide(); + } else { + this.show(); + } + })); + } + this._register(addDisposableListener(this._label, EventType.KEY_DOWN, (e) => { + const event = new StandardKeyboardEvent(e); + if (event.equals( + 3 + /* KeyCode.Enter */ + ) || event.equals( + 10 + /* KeyCode.Space */ + )) { + EventHelper.stop(e, true); + if (this.visible) { + this.hide(); + } else { + this.show(); + } + } + })); + const cleanupFn = labelRenderer(this._label); + if (cleanupFn) { + this._register(cleanupFn); + } + this._register(Gesture.addTarget(this._label)); + } + get element() { + return this._element; + } + show() { + if (!this.visible) { + this.visible = true; + this._onDidChangeVisibility.fire(true); + } + } + hide() { + if (this.visible) { + this.visible = false; + this._onDidChangeVisibility.fire(false); + } + } + dispose() { + super.dispose(); + this.hide(); + if (this.boxContainer) { + this.boxContainer.remove(); + this.boxContainer = void 0; + } + if (this.contents) { + this.contents.remove(); + this.contents = void 0; + } + if (this._label) { + this._label.remove(); + this._label = void 0; + } + } +}; +var DropdownMenu = class extends BaseDropdown { + constructor(container, _options) { + super(container, _options); + this._options = _options; + this._actions = []; + this.actions = _options.actions || []; + } + set menuOptions(options2) { + this._menuOptions = options2; + } + get menuOptions() { + return this._menuOptions; + } + get actions() { + if (this._options.actionProvider) { + return this._options.actionProvider.getActions(); + } + return this._actions; + } + set actions(actions) { + this._actions = actions; + } + show() { + super.show(); + this.element.classList.add("active"); + this._options.contextMenuProvider.showContextMenu({ + getAnchor: () => this.element, + getActions: () => this.actions, + getActionsContext: () => this.menuOptions ? this.menuOptions.context : null, + getActionViewItem: (action, options2) => this.menuOptions && this.menuOptions.actionViewItemProvider ? this.menuOptions.actionViewItemProvider(action, options2) : void 0, + getKeyBinding: (action) => this.menuOptions && this.menuOptions.getKeyBinding ? this.menuOptions.getKeyBinding(action) : void 0, + getMenuClassName: () => this._options.menuClassName || "", + onHide: () => this.onHide(), + actionRunner: this.menuOptions ? this.menuOptions.actionRunner : void 0, + anchorAlignment: this.menuOptions ? this.menuOptions.anchorAlignment : 0, + domForShadowRoot: this._options.menuAsChild ? this.element : void 0, + skipTelemetry: this._options.skipTelemetry + }); + } + hide() { + super.hide(); + } + onHide() { + this.hide(); + this.element.classList.remove("active"); + } +}; + +// node_modules/monaco-editor-core/esm/vs/base/browser/ui/dropdown/dropdownActionViewItem.js +var DropdownMenuActionViewItem = class extends BaseActionViewItem { + get onDidChangeVisibility() { + return this._onDidChangeVisibility.event; + } + constructor(action, menuActionsOrProvider, contextMenuProvider, options2 = /* @__PURE__ */ Object.create(null)) { + super(null, action, options2); + this.actionItem = null; + this._onDidChangeVisibility = this._register(new Emitter()); + this.menuActionsOrProvider = menuActionsOrProvider; + this.contextMenuProvider = contextMenuProvider; + this.options = options2; + if (this.options.actionRunner) { + this.actionRunner = this.options.actionRunner; + } + } + render(container) { + this.actionItem = container; + const labelRenderer = (el) => { + this.element = append(el, $("a.action-label")); + return this.renderLabel(this.element); + }; + const isActionsArray = Array.isArray(this.menuActionsOrProvider); + const options2 = { + contextMenuProvider: this.contextMenuProvider, + labelRenderer, + menuAsChild: this.options.menuAsChild, + actions: isActionsArray ? this.menuActionsOrProvider : void 0, + actionProvider: isActionsArray ? void 0 : this.menuActionsOrProvider, + skipTelemetry: this.options.skipTelemetry + }; + this.dropdownMenu = this._register(new DropdownMenu(container, options2)); + this._register(this.dropdownMenu.onDidChangeVisibility((visible) => { + this.element?.setAttribute("aria-expanded", `${visible}`); + this._onDidChangeVisibility.fire(visible); + })); + this.dropdownMenu.menuOptions = { + actionViewItemProvider: this.options.actionViewItemProvider, + actionRunner: this.actionRunner, + getKeyBinding: this.options.keybindingProvider, + context: this._context + }; + if (this.options.anchorAlignmentProvider) { + const that = this; + this.dropdownMenu.menuOptions = { + ...this.dropdownMenu.menuOptions, + get anchorAlignment() { + return that.options.anchorAlignmentProvider(); + } + }; + } + this.updateTooltip(); + this.updateEnabled(); + } + renderLabel(element) { + let classNames2 = []; + if (typeof this.options.classNames === "string") { + classNames2 = this.options.classNames.split(/\s+/g).filter((s) => !!s); + } else if (this.options.classNames) { + classNames2 = this.options.classNames; + } + if (!classNames2.find((c) => c === "icon")) { + classNames2.push("codicon"); + } + element.classList.add(...classNames2); + if (this._action.label) { + this._register(getBaseLayerHoverDelegate().setupManagedHover(this.options.hoverDelegate ?? getDefaultHoverDelegate("mouse"), element, this._action.label)); + } + return null; + } + getTooltip() { + let title = null; + if (this.action.tooltip) { + title = this.action.tooltip; + } else if (this.action.label) { + title = this.action.label; + } + return title ?? void 0; + } + setActionContext(newContext) { + super.setActionContext(newContext); + if (this.dropdownMenu) { + if (this.dropdownMenu.menuOptions) { + this.dropdownMenu.menuOptions.context = newContext; + } else { + this.dropdownMenu.menuOptions = { context: newContext }; + } + } + } + show() { + this.dropdownMenu?.show(); + } + updateEnabled() { + const disabled = !this.action.enabled; + this.actionItem?.classList.toggle("disabled", disabled); + this.element?.classList.toggle("disabled", disabled); + } +}; + +// node_modules/monaco-editor-core/esm/vs/base/browser/ui/toolbar/toolbar.js +init_actions(); +init_codicons(); +init_themables(); +init_event(); +init_lifecycle(); +init_nls(); +var ACTION_MIN_WIDTH = 24; +var ToolBar = class extends Disposable { + get onDidChangeDropdownVisibility() { + return this._onDidChangeDropdownVisibility.event; + } + constructor(container, contextMenuProvider, options2 = { + orientation: 0 + /* ActionsOrientation.HORIZONTAL */ + }) { + super(); + this.submenuActionViewItems = []; + this.hasSecondaryActions = false; + this._onDidChangeDropdownVisibility = this._register(new EventMultiplexer()); + this.originalPrimaryActions = []; + this.originalSecondaryActions = []; + this.hiddenActions = []; + this.disposables = this._register(new DisposableStore()); + options2.hoverDelegate = options2.hoverDelegate ?? this._register(createInstantHoverDelegate()); + this.options = options2; + this.toggleMenuAction = this._register(new ToggleMenuAction(() => this.toggleMenuActionViewItem?.show(), options2.toggleMenuTitle)); + this.element = document.createElement("div"); + this.element.className = "monaco-toolbar"; + container.appendChild(this.element); + this.actionBar = this._register(new ActionBar(this.element, { + orientation: options2.orientation, + ariaLabel: options2.ariaLabel, + actionRunner: options2.actionRunner, + allowContextMenu: options2.allowContextMenu, + highlightToggledItems: options2.highlightToggledItems, + hoverDelegate: options2.hoverDelegate, + actionViewItemProvider: (action, viewItemOptions) => { + if (action.id === ToggleMenuAction.ID) { + this.toggleMenuActionViewItem = new DropdownMenuActionViewItem(action, { getActions: () => this.toggleMenuAction.menuActions }, contextMenuProvider, { + actionViewItemProvider: this.options.actionViewItemProvider, + actionRunner: this.actionRunner, + keybindingProvider: this.options.getKeyBinding, + classNames: ThemeIcon.asClassNameArray(options2.moreIcon ?? Codicon.toolBarMore), + anchorAlignmentProvider: this.options.anchorAlignmentProvider, + menuAsChild: !!this.options.renderDropdownAsChildElement, + skipTelemetry: this.options.skipTelemetry, + isMenu: true, + hoverDelegate: this.options.hoverDelegate + }); + this.toggleMenuActionViewItem.setActionContext(this.actionBar.context); + this.disposables.add(this._onDidChangeDropdownVisibility.add(this.toggleMenuActionViewItem.onDidChangeVisibility)); + return this.toggleMenuActionViewItem; + } + if (options2.actionViewItemProvider) { + const result = options2.actionViewItemProvider(action, viewItemOptions); + if (result) { + return result; + } + } + if (action instanceof SubmenuAction) { + const result = new DropdownMenuActionViewItem(action, action.actions, contextMenuProvider, { + actionViewItemProvider: this.options.actionViewItemProvider, + actionRunner: this.actionRunner, + keybindingProvider: this.options.getKeyBinding, + classNames: action.class, + anchorAlignmentProvider: this.options.anchorAlignmentProvider, + menuAsChild: !!this.options.renderDropdownAsChildElement, + skipTelemetry: this.options.skipTelemetry, + hoverDelegate: this.options.hoverDelegate + }); + result.setActionContext(this.actionBar.context); + this.submenuActionViewItems.push(result); + this.disposables.add(this._onDidChangeDropdownVisibility.add(result.onDidChangeVisibility)); + return result; + } + return void 0; + } + })); + if (this.options.responsive) { + this.element.classList.add("responsive"); + const observer = new ResizeObserver(() => { + this.setToolbarMaxWidth(this.element.getBoundingClientRect().width); + }); + observer.observe(this.element); + this._store.add(toDisposable(() => observer.disconnect())); + } + } + set actionRunner(actionRunner) { + this.actionBar.actionRunner = actionRunner; + } + get actionRunner() { + return this.actionBar.actionRunner; + } + set context(context) { + this.actionBar.context = context; + this.toggleMenuActionViewItem?.setActionContext(context); + for (const actionViewItem of this.submenuActionViewItems) { + actionViewItem.setActionContext(context); + } + } + getElement() { + return this.element; + } + getItemAction(indexOrElement) { + return this.actionBar.getAction(indexOrElement); + } + getItemWidth(index) { + return this.actionBar.getWidth(index); + } + setActions(primaryActions, secondaryActions) { + this.clear(); + this.originalPrimaryActions = primaryActions ? primaryActions.slice(0) : []; + this.originalSecondaryActions = secondaryActions ? secondaryActions.slice(0) : []; + const primaryActionsToSet = primaryActions ? primaryActions.slice(0) : []; + this.hasSecondaryActions = !!(secondaryActions && secondaryActions.length > 0); + if (this.hasSecondaryActions && secondaryActions) { + this.toggleMenuAction.menuActions = secondaryActions.slice(0); + primaryActionsToSet.push(this.toggleMenuAction); + } + if (primaryActionsToSet.length > 0 && this.options.trailingSeparator) { + primaryActionsToSet.push(new Separator()); + } + primaryActionsToSet.forEach((action) => { + this.actionBar.push(action, { icon: this.options.icon ?? true, label: this.options.label ?? false, keybinding: this.getKeybindingLabel(action) }); + }); + if (this.options.responsive) { + this.hiddenActions.length = 0; + this.setToolbarMaxWidth(this.element.getBoundingClientRect().width); + } + } + getKeybindingLabel(action) { + const key = this.options.getKeyBinding?.(action); + return key?.getLabel() ?? void 0; + } + getItemsWidthResponsive() { + return this.actionBar.length() * ACTION_MIN_WIDTH; + } + setToolbarMaxWidth(maxWidth) { + if (this.actionBar.isEmpty() || this.getItemsWidthResponsive() <= maxWidth && this.hiddenActions.length === 0) { + return; + } + if (this.getItemsWidthResponsive() > maxWidth) { + while (this.getItemsWidthResponsive() > maxWidth && this.actionBar.length() > 0) { + const index = this.originalPrimaryActions.length - this.hiddenActions.length - 1; + if (index < 0) { + break; + } + const size2 = Math.min(ACTION_MIN_WIDTH, this.getItemWidth(index)); + const action = this.originalPrimaryActions[index]; + this.hiddenActions.unshift({ action, size: size2 }); + this.actionBar.pull(index); + if (this.originalSecondaryActions.length === 0 && this.hiddenActions.length === 1) { + this.actionBar.push(this.toggleMenuAction, { + icon: this.options.icon ?? true, + label: this.options.label ?? false, + keybinding: this.getKeybindingLabel(this.toggleMenuAction) + }); + } + } + } else { + while (this.hiddenActions.length > 0) { + const entry = this.hiddenActions.shift(); + if (this.getItemsWidthResponsive() + entry.size > maxWidth) { + this.hiddenActions.unshift(entry); + break; + } + this.actionBar.push(entry.action, { + icon: this.options.icon ?? true, + label: this.options.label ?? false, + keybinding: this.getKeybindingLabel(entry.action), + index: this.originalPrimaryActions.length - this.hiddenActions.length - 1 + }); + if (this.originalSecondaryActions.length === 0 && this.hiddenActions.length === 1) { + this.toggleMenuAction.menuActions = []; + this.actionBar.pull(this.actionBar.length() - 1); + } + } + } + const hiddenActions = this.hiddenActions.map((entry) => entry.action); + if (this.originalSecondaryActions.length > 0 || hiddenActions.length > 0) { + const secondaryActions = this.originalSecondaryActions.slice(0); + this.toggleMenuAction.menuActions = Separator.join(hiddenActions, secondaryActions); + } + } + clear() { + this.submenuActionViewItems = []; + this.disposables.clear(); + this.actionBar.clear(); + } + dispose() { + this.clear(); + this.disposables.dispose(); + super.dispose(); + } +}; +var ToggleMenuAction = class _ToggleMenuAction extends Action { + static { + this.ID = "toolbar.toggle.more"; + } + constructor(toggleDropdownMenu, title) { + title = title || localize(17, "More Actions..."); + super(_ToggleMenuAction.ID, title, void 0, true); + this._menuActions = []; + this.toggleDropdownMenu = toggleDropdownMenu; + } + async run() { + this.toggleDropdownMenu(); + } + get menuActions() { + return this._menuActions; + } + set menuActions(actions) { + this._menuActions = actions; + } +}; + +// node_modules/monaco-editor-core/esm/vs/platform/actions/browser/toolbar.js +init_actions(); +init_arrays(); +init_collections(); +init_errors(); +init_event(); +init_iterator(); +init_lifecycle(); +init_nls(); + +// node_modules/monaco-editor-core/esm/vs/platform/actions/browser/menuEntryActionViewItem.js +init_dom(); +init_keyboardEvent(); +init_actions(); + +// node_modules/monaco-editor-core/esm/vs/base/common/keybindingLabels.js +init_nls(); +var ModifierLabelProvider = class { + constructor(mac, windows, linux = windows) { + this.modifierLabels = [null]; + this.modifierLabels[ + 2 + /* OperatingSystem.Macintosh */ + ] = mac; + this.modifierLabels[ + 1 + /* OperatingSystem.Windows */ + ] = windows; + this.modifierLabels[ + 3 + /* OperatingSystem.Linux */ + ] = linux; + } + toLabel(OS2, chords, keyLabelProvider) { + if (chords.length === 0) { + return null; + } + const result = []; + for (let i2 = 0, len = chords.length; i2 < len; i2++) { + const chord = chords[i2]; + const keyLabel = keyLabelProvider(chord); + if (keyLabel === null) { + return null; + } + result[i2] = _simpleAsString(chord, keyLabel, this.modifierLabels[OS2]); + } + return result.join(" "); + } +}; +var UILabelProvider = new ModifierLabelProvider({ + ctrlKey: "\u2303", + shiftKey: "\u21E7", + altKey: "\u2325", + metaKey: "\u2318", + separator: "" +}, { + ctrlKey: localize(35, "Ctrl"), + shiftKey: localize(36, "Shift"), + altKey: localize(37, "Alt"), + metaKey: localize(38, "Windows"), + separator: "+" +}, { + ctrlKey: localize(39, "Ctrl"), + shiftKey: localize(40, "Shift"), + altKey: localize(41, "Alt"), + metaKey: localize(42, "Super"), + separator: "+" +}); +var AriaLabelProvider = new ModifierLabelProvider({ + ctrlKey: localize(43, "Control"), + shiftKey: localize(44, "Shift"), + altKey: localize(45, "Option"), + metaKey: localize(46, "Command"), + separator: "+" +}, { + ctrlKey: localize(47, "Control"), + shiftKey: localize(48, "Shift"), + altKey: localize(49, "Alt"), + metaKey: localize(50, "Windows"), + separator: "+" +}, { + ctrlKey: localize(51, "Control"), + shiftKey: localize(52, "Shift"), + altKey: localize(53, "Alt"), + metaKey: localize(54, "Super"), + separator: "+" +}); +var ElectronAcceleratorLabelProvider = new ModifierLabelProvider({ + ctrlKey: "Ctrl", + shiftKey: "Shift", + altKey: "Alt", + metaKey: "Cmd", + separator: "+" +}, { + ctrlKey: "Ctrl", + shiftKey: "Shift", + altKey: "Alt", + metaKey: "Super", + separator: "+" +}); +var UserSettingsLabelProvider = new ModifierLabelProvider({ + ctrlKey: "ctrl", + shiftKey: "shift", + altKey: "alt", + metaKey: "cmd", + separator: "+" +}, { + ctrlKey: "ctrl", + shiftKey: "shift", + altKey: "alt", + metaKey: "win", + separator: "+" +}, { + ctrlKey: "ctrl", + shiftKey: "shift", + altKey: "alt", + metaKey: "meta", + separator: "+" +}); +function _simpleAsString(modifiers, key, labels) { + if (key === null) { + return ""; + } + const result = []; + if (modifiers.ctrlKey) { + result.push(labels.ctrlKey); + } + if (modifiers.shiftKey) { + result.push(labels.shiftKey); + } + if (modifiers.altKey) { + result.push(labels.altKey); + } + if (modifiers.metaKey) { + result.push(labels.metaKey); + } + if (key !== "") { + result.push(key); + } + return result.join(labels.separator); +} + +// node_modules/monaco-editor-core/esm/vs/platform/actions/browser/menuEntryActionViewItem.js +init_lifecycle(); +init_platform(); +init_themables(); +init_types(); +init_nls(); + +// node_modules/monaco-editor-core/esm/vs/platform/action/common/action.js +function isLocalizedString(thing) { + return !!thing && typeof thing === "object" && typeof thing.original === "string" && typeof thing.value === "string"; +} +function isICommandActionToggleInfo(thing) { + return thing ? thing.condition !== void 0 : false; +} + +// node_modules/monaco-editor-core/esm/vs/platform/actions/browser/menuEntryActionViewItem.js +init_configuration(); +init_contextkey(); +init_instantiation(); + +// node_modules/monaco-editor-core/esm/vs/platform/storage/common/storage.js +init_async(); +init_event(); +init_lifecycle(); +init_types(); + +// node_modules/monaco-editor-core/esm/vs/base/parts/storage/common/storage.js +init_async(); +init_event(); +init_lifecycle(); +init_types(); +var StorageHint; +(function(StorageHint2) { + StorageHint2[StorageHint2["STORAGE_DOES_NOT_EXIST"] = 0] = "STORAGE_DOES_NOT_EXIST"; + StorageHint2[StorageHint2["STORAGE_IN_MEMORY"] = 1] = "STORAGE_IN_MEMORY"; +})(StorageHint || (StorageHint = {})); +var StorageState; +(function(StorageState2) { + StorageState2[StorageState2["None"] = 0] = "None"; + StorageState2[StorageState2["Initialized"] = 1] = "Initialized"; + StorageState2[StorageState2["Closed"] = 2] = "Closed"; +})(StorageState || (StorageState = {})); +var Storage = class _Storage extends Disposable { + static { + this.DEFAULT_FLUSH_DELAY = 100; + } + constructor(database, options2 = /* @__PURE__ */ Object.create(null)) { + super(); + this.database = database; + this.options = options2; + this._onDidChangeStorage = this._register(new PauseableEmitter()); + this.onDidChangeStorage = this._onDidChangeStorage.event; + this.state = StorageState.None; + this.cache = /* @__PURE__ */ new Map(); + this.flushDelayer = this._register(new ThrottledDelayer(_Storage.DEFAULT_FLUSH_DELAY)); + this.pendingDeletes = /* @__PURE__ */ new Set(); + this.pendingInserts = /* @__PURE__ */ new Map(); + this.pendingClose = void 0; + this.whenFlushedCallbacks = []; + this.registerListeners(); + } + registerListeners() { + this._register(this.database.onDidChangeItemsExternal((e) => this.onDidChangeItemsExternal(e))); + } + onDidChangeItemsExternal(e) { + this._onDidChangeStorage.pause(); + try { + e.changed?.forEach((value, key) => this.acceptExternal(key, value)); + e.deleted?.forEach((key) => this.acceptExternal(key, void 0)); + } finally { + this._onDidChangeStorage.resume(); + } + } + acceptExternal(key, value) { + if (this.state === StorageState.Closed) { + return; + } + let changed = false; + if (isUndefinedOrNull(value)) { + changed = this.cache.delete(key); + } else { + const currentValue = this.cache.get(key); + if (currentValue !== value) { + this.cache.set(key, value); + changed = true; + } + } + if (changed) { + this._onDidChangeStorage.fire({ key, external: true }); + } + } + get(key, fallbackValue) { + const value = this.cache.get(key); + if (isUndefinedOrNull(value)) { + return fallbackValue; + } + return value; + } + getBoolean(key, fallbackValue) { + const value = this.get(key); + if (isUndefinedOrNull(value)) { + return fallbackValue; + } + return value === "true"; + } + getNumber(key, fallbackValue) { + const value = this.get(key); + if (isUndefinedOrNull(value)) { + return fallbackValue; + } + return parseInt(value, 10); + } + async set(key, value, external = false) { + if (this.state === StorageState.Closed) { + return; + } + if (isUndefinedOrNull(value)) { + return this.delete(key, external); + } + const valueStr = isObject(value) || Array.isArray(value) ? stringify(value) : String(value); + const currentValue = this.cache.get(key); + if (currentValue === valueStr) { + return; + } + this.cache.set(key, valueStr); + this.pendingInserts.set(key, valueStr); + this.pendingDeletes.delete(key); + this._onDidChangeStorage.fire({ key, external }); + return this.doFlush(); + } + async delete(key, external = false) { + if (this.state === StorageState.Closed) { + return; + } + const wasDeleted = this.cache.delete(key); + if (!wasDeleted) { + return; + } + if (!this.pendingDeletes.has(key)) { + this.pendingDeletes.add(key); + } + this.pendingInserts.delete(key); + this._onDidChangeStorage.fire({ key, external }); + return this.doFlush(); + } + get hasPending() { + return this.pendingInserts.size > 0 || this.pendingDeletes.size > 0; + } + async flushPending() { + if (!this.hasPending) { + return; + } + const updateRequest = { insert: this.pendingInserts, delete: this.pendingDeletes }; + this.pendingDeletes = /* @__PURE__ */ new Set(); + this.pendingInserts = /* @__PURE__ */ new Map(); + return this.database.updateItems(updateRequest).finally(() => { + if (!this.hasPending) { + while (this.whenFlushedCallbacks.length) { + this.whenFlushedCallbacks.pop()?.(); + } + } + }); + } + async flush(delay) { + if (this.state === StorageState.Closed || // Return early if we are already closed + this.pendingClose) { + return; + } + return this.doFlush(delay); + } + async doFlush(delay) { + if (this.options.hint === StorageHint.STORAGE_IN_MEMORY) { + return this.flushPending(); + } + return this.flushDelayer.trigger(() => this.flushPending(), delay); + } + async whenFlushed() { + if (!this.hasPending) { + return; + } + return new Promise((resolve3) => this.whenFlushedCallbacks.push(resolve3)); + } +}; +var InMemoryStorageDatabase = class { + constructor() { + this.onDidChangeItemsExternal = Event.None; + this.items = /* @__PURE__ */ new Map(); + } + async updateItems(request) { + request.insert?.forEach((value, key) => this.items.set(key, value)); + request.delete?.forEach((key) => this.items.delete(key)); + } +}; + +// node_modules/monaco-editor-core/esm/vs/platform/storage/common/storage.js +init_instantiation(); +var TARGET_KEY = "__$__targetStorageMarker"; +var IStorageService = createDecorator("storageService"); +var WillSaveStateReason; +(function(WillSaveStateReason2) { + WillSaveStateReason2[WillSaveStateReason2["NONE"] = 0] = "NONE"; + WillSaveStateReason2[WillSaveStateReason2["SHUTDOWN"] = 1] = "SHUTDOWN"; +})(WillSaveStateReason || (WillSaveStateReason = {})); +function loadKeyTargets(storage) { + const keysRaw = storage.get(TARGET_KEY); + if (keysRaw) { + try { + return JSON.parse(keysRaw); + } catch (error) { + } + } + return /* @__PURE__ */ Object.create(null); +} +var AbstractStorageService = class _AbstractStorageService extends Disposable { + static { + this.DEFAULT_FLUSH_INTERVAL = 60 * 1e3; + } + // every minute + constructor(options2 = { flushInterval: _AbstractStorageService.DEFAULT_FLUSH_INTERVAL }) { + super(); + this._onDidChangeValue = this._register(new PauseableEmitter()); + this._onDidChangeTarget = this._register(new PauseableEmitter()); + this._onWillSaveState = this._register(new Emitter()); + this.onWillSaveState = this._onWillSaveState.event; + this.runFlushWhenIdle = this._register(new MutableDisposable()); + this._workspaceKeyTargets = void 0; + this._profileKeyTargets = void 0; + this._applicationKeyTargets = void 0; + this.flushWhenIdleScheduler = this._register(new RunOnceScheduler(() => this.doFlushWhenIdle(), options2.flushInterval)); + } + onDidChangeValue(scope, key, disposable) { + return Event.filter(this._onDidChangeValue.event, (e) => e.scope === scope && (key === void 0 || e.key === key), disposable); + } + doFlushWhenIdle() { + this.runFlushWhenIdle.value = runWhenGlobalIdle(() => { + if (this.shouldFlushWhenIdle()) { + this.flush(); + } + this.flushWhenIdleScheduler.schedule(); + }); + } + shouldFlushWhenIdle() { + return true; + } + emitDidChangeValue(scope, event) { + const { key, external } = event; + if (key === TARGET_KEY) { + switch (scope) { + case -1: + this._applicationKeyTargets = void 0; + break; + case 0: + this._profileKeyTargets = void 0; + break; + case 1: + this._workspaceKeyTargets = void 0; + break; + } + this._onDidChangeTarget.fire({ scope }); + } else { + this._onDidChangeValue.fire({ scope, key, target: this.getKeyTargets(scope)[key], external }); + } + } + get(key, scope, fallbackValue) { + return this.getStorage(scope)?.get(key, fallbackValue); + } + getBoolean(key, scope, fallbackValue) { + return this.getStorage(scope)?.getBoolean(key, fallbackValue); + } + getNumber(key, scope, fallbackValue) { + return this.getStorage(scope)?.getNumber(key, fallbackValue); + } + store(key, value, scope, target, external = false) { + if (isUndefinedOrNull(value)) { + this.remove(key, scope, external); + return; + } + this.withPausedEmitters(() => { + this.updateKeyTarget(key, scope, target); + this.getStorage(scope)?.set(key, value, external); + }); + } + remove(key, scope, external = false) { + this.withPausedEmitters(() => { + this.updateKeyTarget(key, scope, void 0); + this.getStorage(scope)?.delete(key, external); + }); + } + withPausedEmitters(fn) { + this._onDidChangeValue.pause(); + this._onDidChangeTarget.pause(); + try { + fn(); + } finally { + this._onDidChangeValue.resume(); + this._onDidChangeTarget.resume(); + } + } + updateKeyTarget(key, scope, target, external = false) { + const keyTargets = this.getKeyTargets(scope); + if (typeof target === "number") { + if (keyTargets[key] !== target) { + keyTargets[key] = target; + this.getStorage(scope)?.set(TARGET_KEY, JSON.stringify(keyTargets), external); + } + } else { + if (typeof keyTargets[key] === "number") { + delete keyTargets[key]; + this.getStorage(scope)?.set(TARGET_KEY, JSON.stringify(keyTargets), external); + } + } + } + get workspaceKeyTargets() { + if (!this._workspaceKeyTargets) { + this._workspaceKeyTargets = this.loadKeyTargets( + 1 + /* StorageScope.WORKSPACE */ + ); + } + return this._workspaceKeyTargets; + } + get profileKeyTargets() { + if (!this._profileKeyTargets) { + this._profileKeyTargets = this.loadKeyTargets( + 0 + /* StorageScope.PROFILE */ + ); + } + return this._profileKeyTargets; + } + get applicationKeyTargets() { + if (!this._applicationKeyTargets) { + this._applicationKeyTargets = this.loadKeyTargets( + -1 + /* StorageScope.APPLICATION */ + ); + } + return this._applicationKeyTargets; + } + getKeyTargets(scope) { + switch (scope) { + case -1: + return this.applicationKeyTargets; + case 0: + return this.profileKeyTargets; + default: + return this.workspaceKeyTargets; + } + } + loadKeyTargets(scope) { + const storage = this.getStorage(scope); + return storage ? loadKeyTargets(storage) : /* @__PURE__ */ Object.create(null); + } + async flush(reason = WillSaveStateReason.NONE) { + this._onWillSaveState.fire({ reason }); + const applicationStorage = this.getStorage( + -1 + /* StorageScope.APPLICATION */ + ); + const profileStorage = this.getStorage( + 0 + /* StorageScope.PROFILE */ + ); + const workspaceStorage = this.getStorage( + 1 + /* StorageScope.WORKSPACE */ + ); + switch (reason) { + // Unspecific reason: just wait when data is flushed + case WillSaveStateReason.NONE: + await Promises.settled([ + applicationStorage?.whenFlushed() ?? Promise.resolve(), + profileStorage?.whenFlushed() ?? Promise.resolve(), + workspaceStorage?.whenFlushed() ?? Promise.resolve() + ]); + break; + // Shutdown: we want to flush as soon as possible + // and not hit any delays that might be there + case WillSaveStateReason.SHUTDOWN: + await Promises.settled([ + applicationStorage?.flush(0) ?? Promise.resolve(), + profileStorage?.flush(0) ?? Promise.resolve(), + workspaceStorage?.flush(0) ?? Promise.resolve() + ]); + break; + } + } +}; +var InMemoryStorageService = class extends AbstractStorageService { + constructor() { + super(); + this.applicationStorage = this._register(new Storage(new InMemoryStorageDatabase(), { hint: StorageHint.STORAGE_IN_MEMORY })); + this.profileStorage = this._register(new Storage(new InMemoryStorageDatabase(), { hint: StorageHint.STORAGE_IN_MEMORY })); + this.workspaceStorage = this._register(new Storage(new InMemoryStorageDatabase(), { hint: StorageHint.STORAGE_IN_MEMORY })); + this._register(this.workspaceStorage.onDidChangeStorage((e) => this.emitDidChangeValue(1, e))); + this._register(this.profileStorage.onDidChangeStorage((e) => this.emitDidChangeValue(0, e))); + this._register(this.applicationStorage.onDidChangeStorage((e) => this.emitDidChangeValue(-1, e))); + } + getStorage(scope) { + switch (scope) { + case -1: + return this.applicationStorage; + case 0: + return this.profileStorage; + default: + return this.workspaceStorage; + } + } + shouldFlushWhenIdle() { + return false; + } +}; + +// node_modules/monaco-editor-core/esm/vs/platform/theme/browser/defaultStyles.js +init_colorRegistry(); +init_color(); +function overrideStyles(override, styles) { + const result = { ...styles }; + for (const key in override) { + const val = override[key]; + result[key] = val !== void 0 ? asCssVariable(val) : void 0; + } + return result; +} +var defaultKeybindingLabelStyles = { + keybindingLabelBackground: asCssVariable(keybindingLabelBackground), + keybindingLabelForeground: asCssVariable(keybindingLabelForeground), + keybindingLabelBorder: asCssVariable(keybindingLabelBorder), + keybindingLabelBottomBorder: asCssVariable(keybindingLabelBottomBorder), + keybindingLabelShadow: asCssVariable(widgetShadow) +}; +var defaultButtonStyles = { + buttonForeground: asCssVariable(buttonForeground), + buttonSeparator: asCssVariable(buttonSeparator), + buttonBackground: asCssVariable(buttonBackground), + buttonHoverBackground: asCssVariable(buttonHoverBackground), + buttonSecondaryForeground: asCssVariable(buttonSecondaryForeground), + buttonSecondaryBackground: asCssVariable(buttonSecondaryBackground), + buttonSecondaryHoverBackground: asCssVariable(buttonSecondaryHoverBackground), + buttonBorder: asCssVariable(buttonBorder) +}; +var defaultProgressBarStyles = { + progressBarBackground: asCssVariable(progressBarBackground) +}; +var defaultToggleStyles = { + inputActiveOptionBorder: asCssVariable(inputActiveOptionBorder), + inputActiveOptionForeground: asCssVariable(inputActiveOptionForeground), + inputActiveOptionBackground: asCssVariable(inputActiveOptionBackground) +}; +var defaultRadioStyles = { + activeForeground: asCssVariable(radioActiveForeground), + activeBackground: asCssVariable(radioActiveBackground), + activeBorder: asCssVariable(radioActiveBorder), + inactiveForeground: asCssVariable(radioInactiveForeground), + inactiveBackground: asCssVariable(radioInactiveBackground), + inactiveBorder: asCssVariable(radioInactiveBorder), + inactiveHoverBackground: asCssVariable(radioInactiveHoverBackground) +}; +var defaultCheckboxStyles = { + checkboxBackground: asCssVariable(checkboxBackground), + checkboxBorder: asCssVariable(checkboxBorder), + checkboxForeground: asCssVariable(checkboxForeground), + checkboxDisabledBackground: asCssVariable(checkboxDisabledBackground), + checkboxDisabledForeground: asCssVariable(checkboxDisabledForeground) +}; +var defaultDialogStyles = { + dialogBackground: asCssVariable(editorWidgetBackground), + dialogForeground: asCssVariable(editorWidgetForeground), + dialogShadow: asCssVariable(widgetShadow), + dialogBorder: asCssVariable(widgetBorder), + errorIconForeground: asCssVariable(problemsErrorIconForeground), + warningIconForeground: asCssVariable(problemsWarningIconForeground), + infoIconForeground: asCssVariable(problemsInfoIconForeground), + textLinkForeground: asCssVariable(textLinkForeground) +}; +var defaultInputBoxStyles = { + inputBackground: asCssVariable(inputBackground), + inputForeground: asCssVariable(inputForeground), + inputBorder: asCssVariable(inputBorder), + inputValidationInfoBorder: asCssVariable(inputValidationInfoBorder), + inputValidationInfoBackground: asCssVariable(inputValidationInfoBackground), + inputValidationInfoForeground: asCssVariable(inputValidationInfoForeground), + inputValidationWarningBorder: asCssVariable(inputValidationWarningBorder), + inputValidationWarningBackground: asCssVariable(inputValidationWarningBackground), + inputValidationWarningForeground: asCssVariable(inputValidationWarningForeground), + inputValidationErrorBorder: asCssVariable(inputValidationErrorBorder), + inputValidationErrorBackground: asCssVariable(inputValidationErrorBackground), + inputValidationErrorForeground: asCssVariable(inputValidationErrorForeground) +}; +var defaultFindWidgetStyles = { + listFilterWidgetBackground: asCssVariable(listFilterWidgetBackground), + listFilterWidgetOutline: asCssVariable(listFilterWidgetOutline), + listFilterWidgetNoMatchesOutline: asCssVariable(listFilterWidgetNoMatchesOutline), + listFilterWidgetShadow: asCssVariable(listFilterWidgetShadow), + inputBoxStyles: defaultInputBoxStyles, + toggleStyles: defaultToggleStyles +}; +var defaultCountBadgeStyles = { + badgeBackground: asCssVariable(badgeBackground), + badgeForeground: asCssVariable(badgeForeground), + badgeBorder: asCssVariable(contrastBorder) +}; +var defaultBreadcrumbsWidgetStyles = { + breadcrumbsBackground: asCssVariable(breadcrumbsBackground), + breadcrumbsForeground: asCssVariable(breadcrumbsForeground), + breadcrumbsHoverForeground: asCssVariable(breadcrumbsFocusForeground), + breadcrumbsFocusForeground: asCssVariable(breadcrumbsFocusForeground), + breadcrumbsFocusAndSelectionForeground: asCssVariable(breadcrumbsActiveSelectionForeground) +}; +var defaultListStyles = { + listBackground: void 0, + listInactiveFocusForeground: void 0, + listFocusBackground: asCssVariable(listFocusBackground), + listFocusForeground: asCssVariable(listFocusForeground), + listFocusOutline: asCssVariable(listFocusOutline), + listActiveSelectionBackground: asCssVariable(listActiveSelectionBackground), + listActiveSelectionForeground: asCssVariable(listActiveSelectionForeground), + listActiveSelectionIconForeground: asCssVariable(listActiveSelectionIconForeground), + listFocusAndSelectionOutline: asCssVariable(listFocusAndSelectionOutline), + listFocusAndSelectionBackground: asCssVariable(listActiveSelectionBackground), + listFocusAndSelectionForeground: asCssVariable(listActiveSelectionForeground), + listInactiveSelectionBackground: asCssVariable(listInactiveSelectionBackground), + listInactiveSelectionIconForeground: asCssVariable(listInactiveSelectionIconForeground), + listInactiveSelectionForeground: asCssVariable(listInactiveSelectionForeground), + listInactiveFocusBackground: asCssVariable(listInactiveFocusBackground), + listInactiveFocusOutline: asCssVariable(listInactiveFocusOutline), + listHoverBackground: asCssVariable(listHoverBackground), + listHoverForeground: asCssVariable(listHoverForeground), + listDropOverBackground: asCssVariable(listDropOverBackground), + listDropBetweenBackground: asCssVariable(listDropBetweenBackground), + listSelectionOutline: asCssVariable(activeContrastBorder), + listHoverOutline: asCssVariable(activeContrastBorder), + treeIndentGuidesStroke: asCssVariable(treeIndentGuidesStroke), + treeInactiveIndentGuidesStroke: asCssVariable(treeInactiveIndentGuidesStroke), + treeStickyScrollBackground: void 0, + treeStickyScrollBorder: void 0, + treeStickyScrollShadow: asCssVariable(scrollbarShadow), + tableColumnsBorder: asCssVariable(tableColumnsBorder), + tableOddRowsBackgroundColor: asCssVariable(tableOddRowsBackgroundColor) +}; +function getListStyles(override) { + return overrideStyles(override, defaultListStyles); +} +var defaultSelectBoxStyles = { + selectBackground: asCssVariable(selectBackground), + selectListBackground: asCssVariable(selectListBackground), + selectForeground: asCssVariable(selectForeground), + decoratorRightForeground: asCssVariable(pickerGroupForeground), + selectBorder: asCssVariable(selectBorder), + focusBorder: asCssVariable(focusBorder), + listFocusBackground: asCssVariable(quickInputListFocusBackground), + listInactiveSelectionIconForeground: asCssVariable(quickInputListFocusIconForeground), + listFocusForeground: asCssVariable(quickInputListFocusForeground), + listFocusOutline: asCssVariableWithDefault(activeContrastBorder, Color.transparent.toString()), + listHoverBackground: asCssVariable(listHoverBackground), + listHoverForeground: asCssVariable(listHoverForeground), + listHoverOutline: asCssVariable(activeContrastBorder), + selectListBorder: asCssVariable(editorWidgetBorder), + listBackground: void 0, + listActiveSelectionBackground: void 0, + listActiveSelectionForeground: void 0, + listActiveSelectionIconForeground: void 0, + listFocusAndSelectionBackground: void 0, + listDropOverBackground: void 0, + listDropBetweenBackground: void 0, + listInactiveSelectionBackground: void 0, + listInactiveSelectionForeground: void 0, + listInactiveFocusBackground: void 0, + listInactiveFocusOutline: void 0, + listSelectionOutline: void 0, + listFocusAndSelectionForeground: void 0, + listFocusAndSelectionOutline: void 0, + listInactiveFocusForeground: void 0, + tableColumnsBorder: void 0, + tableOddRowsBackgroundColor: void 0, + treeIndentGuidesStroke: void 0, + treeInactiveIndentGuidesStroke: void 0, + treeStickyScrollBackground: void 0, + treeStickyScrollBorder: void 0, + treeStickyScrollShadow: void 0 +}; +var defaultMenuStyles = { + shadowColor: asCssVariable(widgetShadow), + borderColor: asCssVariable(menuBorder), + foregroundColor: asCssVariable(menuForeground), + backgroundColor: asCssVariable(menuBackground), + selectionForegroundColor: asCssVariable(menuSelectionForeground), + selectionBackgroundColor: asCssVariable(menuSelectionBackground), + selectionBorderColor: asCssVariable(menuSelectionBorder), + separatorColor: asCssVariable(menuSeparatorBackground), + scrollbarShadow: asCssVariable(scrollbarShadow), + scrollbarSliderBackground: asCssVariable(scrollbarSliderBackground), + scrollbarSliderHoverBackground: asCssVariable(scrollbarSliderHoverBackground), + scrollbarSliderActiveBackground: asCssVariable(scrollbarSliderActiveBackground) +}; + +// node_modules/monaco-editor-core/esm/vs/platform/actions/browser/menuEntryActionViewItem.js +init_colorRegistry(); +init_theme(); +init_themeService(); + +// node_modules/monaco-editor-core/esm/vs/platform/window/common/window.js +init_platform(); +function hasNativeContextMenu(configurationService, titleBarStyle) { + if (isWeb) { + return false; + } + const nativeTitle = hasNativeTitlebar(configurationService, titleBarStyle); + const windowConfigurations = configurationService.getValue("window"); + if (windowConfigurations?.menuStyle === "native") { + if (!isMacintosh && !nativeTitle) { + return false; + } + return true; + } + if (windowConfigurations?.menuStyle === "custom") { + return false; + } + return nativeTitle; +} +function hasNativeTitlebar(configurationService, titleBarStyle) { + if (!titleBarStyle) { + titleBarStyle = getTitleBarStyle(configurationService); + } + return titleBarStyle === "native"; +} +function getTitleBarStyle(configurationService) { + if (isWeb) { + return "custom"; + } + const configuration = configurationService.getValue("window"); + if (configuration) { + const useNativeTabs = isMacintosh && configuration.nativeTabs === true; + if (useNativeTabs) { + return "native"; + } + const useSimpleFullScreen = isMacintosh && configuration.nativeFullScreen === false; + if (useSimpleFullScreen) { + return "native"; + } + const style = configuration.titleBarStyle; + if (style === "native" || style === "custom") { + return style; + } + } + return "custom"; +} +function getWindowControlsStyle(configurationService) { + if (isWeb || isMacintosh || getTitleBarStyle(configurationService) === "native") { + return "native"; + } + const configuration = configurationService.getValue("window"); + const style = configuration?.controlsStyle; + if (style === "custom" || style === "hidden") { + return style; + } + return "native"; +} + +// node_modules/monaco-editor-core/esm/vs/platform/actions/browser/menuEntryActionViewItem.js +init_actions2(); +var __decorate37 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param32 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +function getFlatContextMenuActions(groups, primaryGroup) { + const target = []; + getContextMenuActionsImpl(groups, target, primaryGroup); + return target; +} +function getContextMenuActionsImpl(groups, target, primaryGroup) { + const modifierKeyEmitter = ModifierKeyEmitter.getInstance(); + const useAlternativeActions = modifierKeyEmitter.keyStatus.altKey || (isWindows || isLinux) && modifierKeyEmitter.keyStatus.shiftKey; + fillInActions(groups, target, useAlternativeActions, primaryGroup ? (actionGroup) => actionGroup === primaryGroup : (actionGroup) => actionGroup === "navigation"); +} +function getActionBarActions(groups, primaryGroup, shouldInlineSubmenu, useSeparatorsInPrimaryActions) { + const target = { primary: [], secondary: [] }; + fillInActionBarActions(groups, target, primaryGroup, shouldInlineSubmenu, useSeparatorsInPrimaryActions); + return target; +} +function getFlatActionBarActions(groups, primaryGroup, shouldInlineSubmenu, useSeparatorsInPrimaryActions) { + const target = []; + fillInActionBarActions(groups, target, primaryGroup, shouldInlineSubmenu, useSeparatorsInPrimaryActions); + return target; +} +function fillInActionBarActions(groups, target, primaryGroup, shouldInlineSubmenu, useSeparatorsInPrimaryActions) { + const isPrimaryAction = typeof primaryGroup === "string" ? (actionGroup) => actionGroup === primaryGroup : primaryGroup; + fillInActions(groups, target, false, isPrimaryAction, shouldInlineSubmenu, useSeparatorsInPrimaryActions); +} +function fillInActions(groups, target, useAlternativeActions, isPrimaryAction = (actionGroup) => actionGroup === "navigation", shouldInlineSubmenu = () => false, useSeparatorsInPrimaryActions = false) { + let primaryBucket; + let secondaryBucket; + if (Array.isArray(target)) { + primaryBucket = target; + secondaryBucket = target; + } else { + primaryBucket = target.primary; + secondaryBucket = target.secondary; + } + const submenuInfo = /* @__PURE__ */ new Set(); + for (const [group, actions] of groups) { + let target2; + if (isPrimaryAction(group)) { + target2 = primaryBucket; + if (target2.length > 0 && useSeparatorsInPrimaryActions) { + target2.push(new Separator()); + } + } else { + target2 = secondaryBucket; + if (target2.length > 0) { + target2.push(new Separator()); + } + } + for (let action of actions) { + if (useAlternativeActions) { + action = action instanceof MenuItemAction && action.alt ? action.alt : action; + } + const newLen = target2.push(action); + if (action instanceof SubmenuAction) { + submenuInfo.add({ group, action, index: newLen - 1 }); + } + } + } + for (const { group, action, index } of submenuInfo) { + const target2 = isPrimaryAction(group) ? primaryBucket : secondaryBucket; + const submenuActions = action.actions; + if (shouldInlineSubmenu(action, group, target2.length)) { + target2.splice(index, 1, ...submenuActions); + } + } +} +var MenuEntryActionViewItem = class MenuEntryActionViewItem2 extends ActionViewItem { + constructor(action, _options, _keybindingService, _notificationService, _contextKeyService, _themeService, _contextMenuService, _accessibilityService) { + super(void 0, action, { icon: !!(action.class || action.item.icon), label: !action.class && !action.item.icon, draggable: _options?.draggable, keybinding: _options?.keybinding, hoverDelegate: _options?.hoverDelegate, keybindingNotRenderedWithLabel: _options?.keybindingNotRenderedWithLabel }); + this._options = _options; + this._keybindingService = _keybindingService; + this._notificationService = _notificationService; + this._contextKeyService = _contextKeyService; + this._themeService = _themeService; + this._contextMenuService = _contextMenuService; + this._accessibilityService = _accessibilityService; + this._wantsAltCommand = false; + this._itemClassDispose = this._register(new MutableDisposable()); + this._altKey = ModifierKeyEmitter.getInstance(); + } + get _menuItemAction() { + return this._action; + } + get _commandAction() { + return this._wantsAltCommand && this._menuItemAction.alt || this._menuItemAction; + } + async onClick(event) { + event.preventDefault(); + event.stopPropagation(); + try { + await this.actionRunner.run(this._commandAction, this._context); + } catch (err) { + this._notificationService.error(err); + } + } + render(container) { + super.render(container); + container.classList.add("menu-entry"); + if (this.options.icon) { + this._updateItemClass(this._menuItemAction.item); + } + if (this._menuItemAction.alt) { + let isMouseOver = false; + const updateAltState = () => { + const wantsAltCommand = !!this._menuItemAction.alt?.enabled && (!this._accessibilityService.isMotionReduced() || isMouseOver) && (this._altKey.keyStatus.altKey || this._altKey.keyStatus.shiftKey && isMouseOver); + if (wantsAltCommand !== this._wantsAltCommand) { + this._wantsAltCommand = wantsAltCommand; + this.updateLabel(); + this.updateTooltip(); + this.updateClass(); + } + }; + this._register(this._altKey.event(updateAltState)); + this._register(addDisposableListener(container, "mouseleave", (_) => { + isMouseOver = false; + updateAltState(); + })); + this._register(addDisposableListener(container, "mouseenter", (_) => { + isMouseOver = true; + updateAltState(); + })); + updateAltState(); + } + } + updateLabel() { + if (this.options.label && this.label) { + this.label.textContent = this._commandAction.label; + } + } + getTooltip() { + const keybinding = this._keybindingService.lookupKeybinding(this._commandAction.id, this._contextKeyService); + const keybindingLabel = keybinding && keybinding.getLabel(); + const tooltip = this._commandAction.tooltip || this._commandAction.label; + let title = keybindingLabel ? localize(1644, "{0} ({1})", tooltip, keybindingLabel) : tooltip; + if (!this._wantsAltCommand && this._menuItemAction.alt?.enabled) { + const altTooltip = this._menuItemAction.alt.tooltip || this._menuItemAction.alt.label; + const altKeybinding = this._keybindingService.lookupKeybinding(this._menuItemAction.alt.id, this._contextKeyService); + const altKeybindingLabel = altKeybinding && altKeybinding.getLabel(); + const altTitleSection = altKeybindingLabel ? localize(1645, "{0} ({1})", altTooltip, altKeybindingLabel) : altTooltip; + title = localize(1646, "{0}\n[{1}] {2}", title, UILabelProvider.modifierLabels[OS].altKey, altTitleSection); + } + return title; + } + updateClass() { + if (this.options.icon) { + if (this._commandAction !== this._menuItemAction) { + if (this._menuItemAction.alt) { + this._updateItemClass(this._menuItemAction.alt.item); + } + } else { + this._updateItemClass(this._menuItemAction.item); + } + } + } + _updateItemClass(item) { + this._itemClassDispose.value = void 0; + const { element, label } = this; + if (!element || !label) { + return; + } + const icon = this._commandAction.checked && isICommandActionToggleInfo(item.toggled) && item.toggled.icon ? item.toggled.icon : item.icon; + if (!icon) { + return; + } + if (ThemeIcon.isThemeIcon(icon)) { + const iconClasses = ThemeIcon.asClassNameArray(icon); + label.classList.add(...iconClasses); + this._itemClassDispose.value = toDisposable(() => { + label.classList.remove(...iconClasses); + }); + } else { + label.style.backgroundImage = isDark(this._themeService.getColorTheme().type) ? asCSSUrl(icon.dark) : asCSSUrl(icon.light); + label.classList.add("icon"); + this._itemClassDispose.value = combinedDisposable(toDisposable(() => { + label.style.backgroundImage = ""; + label.classList.remove("icon"); + }), this._themeService.onDidColorThemeChange(() => { + this.updateClass(); + })); + } + } +}; +MenuEntryActionViewItem = __decorate37([ + __param32(2, IKeybindingService), + __param32(3, INotificationService), + __param32(4, IContextKeyService), + __param32(5, IThemeService), + __param32(6, IContextMenuService), + __param32(7, IAccessibilityService) +], MenuEntryActionViewItem); +var TextOnlyMenuEntryActionViewItem = class _TextOnlyMenuEntryActionViewItem extends MenuEntryActionViewItem { + render(container) { + this.options.label = true; + this.options.icon = false; + super.render(container); + container.classList.add("text-only"); + container.classList.toggle("use-comma", this._options?.useComma ?? false); + } + updateLabel() { + const kb = this._keybindingService.lookupKeybinding(this._action.id, this._contextKeyService); + if (!kb) { + return super.updateLabel(); + } + if (this.label) { + const kb2 = _TextOnlyMenuEntryActionViewItem._symbolPrintEnter(kb); + if (this._options?.conversational) { + this.label.textContent = localize(1647, "{1} to {0}", this._action.label, kb2); + } else { + this.label.textContent = localize(1648, "{0} ({1})", this._action.label, kb2); + } + } + } + static _symbolPrintEnter(kb) { + return kb.getLabel()?.replace(/\benter\b/gi, "\u23CE").replace(/\bEscape\b/gi, "Esc"); + } +}; +var SubmenuEntryActionViewItem = class SubmenuEntryActionViewItem2 extends DropdownMenuActionViewItem { + constructor(action, options2, _keybindingService, _contextMenuService, _themeService) { + const dropdownOptions = { + ...options2, + menuAsChild: options2?.menuAsChild ?? false, + classNames: options2?.classNames ?? (ThemeIcon.isThemeIcon(action.item.icon) ? ThemeIcon.asClassName(action.item.icon) : void 0), + keybindingProvider: options2?.keybindingProvider ?? ((action2) => _keybindingService.lookupKeybinding(action2.id)) + }; + super(action, { getActions: () => action.actions }, _contextMenuService, dropdownOptions); + this._keybindingService = _keybindingService; + this._contextMenuService = _contextMenuService; + this._themeService = _themeService; + } + render(container) { + super.render(container); + assertType(this.element); + container.classList.add("menu-entry"); + const action = this._action; + const { icon } = action.item; + if (icon && !ThemeIcon.isThemeIcon(icon)) { + this.element.classList.add("icon"); + const setBackgroundImage = () => { + if (this.element) { + this.element.style.backgroundImage = isDark(this._themeService.getColorTheme().type) ? asCSSUrl(icon.dark) : asCSSUrl(icon.light); + } + }; + setBackgroundImage(); + this._register(this._themeService.onDidColorThemeChange(() => { + setBackgroundImage(); + })); + } + } +}; +SubmenuEntryActionViewItem = __decorate37([ + __param32(2, IKeybindingService), + __param32(3, IContextMenuService), + __param32(4, IThemeService) +], SubmenuEntryActionViewItem); +var DropdownWithDefaultActionViewItem = class DropdownWithDefaultActionViewItem2 extends BaseActionViewItem { + constructor(submenuAction, options2, _keybindingService, _notificationService, _contextMenuService, _menuService, _instaService, _storageService) { + super(null, submenuAction); + this._keybindingService = _keybindingService; + this._notificationService = _notificationService; + this._contextMenuService = _contextMenuService; + this._menuService = _menuService; + this._instaService = _instaService; + this._storageService = _storageService; + this._defaultActionDisposables = this._register(new DisposableStore()); + this._container = null; + this._options = options2; + this._storageKey = `${submenuAction.item.submenu.id}_lastActionId`; + let defaultAction; + const defaultActionId = options2?.togglePrimaryAction ? _storageService.get( + this._storageKey, + 1 + /* StorageScope.WORKSPACE */ + ) : void 0; + if (defaultActionId) { + defaultAction = submenuAction.actions.find((a) => defaultActionId === a.id); + } + if (!defaultAction) { + defaultAction = submenuAction.actions[0]; + } + this._defaultAction = this._defaultActionDisposables.add(this._instaService.createInstance(MenuEntryActionViewItem, defaultAction, { keybinding: this._getDefaultActionKeybindingLabel(defaultAction) })); + const dropdownOptions = { + keybindingProvider: (action) => this._keybindingService.lookupKeybinding(action.id), + ...options2, + menuAsChild: options2?.menuAsChild ?? true, + classNames: options2?.classNames ?? ["codicon", "codicon-chevron-down"], + actionRunner: options2?.actionRunner ?? this._register(new ActionRunner()) + }; + this._dropdown = this._register(new DropdownMenuActionViewItem(submenuAction, submenuAction.actions, this._contextMenuService, dropdownOptions)); + if (options2?.togglePrimaryAction) { + this._register(this._dropdown.actionRunner.onDidRun((e) => { + if (e.action instanceof MenuItemAction) { + this.update(e.action); + } + })); + } + } + update(lastAction) { + if (this._options?.togglePrimaryAction) { + this._storageService.store( + this._storageKey, + lastAction.id, + 1, + 1 + /* StorageTarget.MACHINE */ + ); + } + this._defaultActionDisposables.clear(); + this._defaultAction = this._defaultActionDisposables.add(this._instaService.createInstance(MenuEntryActionViewItem, lastAction, { keybinding: this._getDefaultActionKeybindingLabel(lastAction) })); + this._defaultAction.actionRunner = this._defaultActionDisposables.add(new class extends ActionRunner { + async runAction(action, context) { + await action.run(void 0); + } + }()); + if (this._container) { + this._defaultAction.render(prepend(this._container, $(".action-container"))); + } + } + _getDefaultActionKeybindingLabel(defaultAction) { + let defaultActionKeybinding; + if (this._options?.renderKeybindingWithDefaultActionLabel) { + const kb = this._keybindingService.lookupKeybinding(defaultAction.id); + if (kb) { + defaultActionKeybinding = `(${kb.getLabel()})`; + } + } + return defaultActionKeybinding; + } + setActionContext(newContext) { + super.setActionContext(newContext); + this._defaultAction.setActionContext(newContext); + this._dropdown.setActionContext(newContext); + } + set actionRunner(actionRunner) { + super.actionRunner = actionRunner; + this._defaultAction.actionRunner = actionRunner; + this._dropdown.actionRunner = actionRunner; + } + get actionRunner() { + return super.actionRunner; + } + render(container) { + this._container = container; + super.render(this._container); + this._container.classList.add("monaco-dropdown-with-default"); + const primaryContainer = $(".action-container"); + this._defaultAction.render(append(this._container, primaryContainer)); + this._register(addDisposableListener(primaryContainer, EventType.KEY_DOWN, (e) => { + const event = new StandardKeyboardEvent(e); + if (event.equals( + 17 + /* KeyCode.RightArrow */ + )) { + this._defaultAction.element.tabIndex = -1; + this._dropdown.focus(); + event.stopPropagation(); + } + })); + const dropdownContainer = $(".dropdown-action-container"); + this._dropdown.render(append(this._container, dropdownContainer)); + this._register(addDisposableListener(dropdownContainer, EventType.KEY_DOWN, (e) => { + const event = new StandardKeyboardEvent(e); + if (event.equals( + 15 + /* KeyCode.LeftArrow */ + )) { + this._defaultAction.element.tabIndex = 0; + this._dropdown.setFocusable(false); + this._defaultAction.element?.focus(); + event.stopPropagation(); + } + })); + } + focus(fromRight) { + if (fromRight) { + this._dropdown.focus(); + } else { + this._defaultAction.element.tabIndex = 0; + this._defaultAction.element.focus(); + } + } + blur() { + this._defaultAction.element.tabIndex = -1; + this._dropdown.blur(); + this._container.blur(); + } + setFocusable(focusable) { + if (focusable) { + this._defaultAction.element.tabIndex = 0; + } else { + this._defaultAction.element.tabIndex = -1; + this._dropdown.setFocusable(false); + } + } +}; +DropdownWithDefaultActionViewItem = __decorate37([ + __param32(2, IKeybindingService), + __param32(3, INotificationService), + __param32(4, IContextMenuService), + __param32(5, IMenuService), + __param32(6, IInstantiationService), + __param32(7, IStorageService) +], DropdownWithDefaultActionViewItem); +var SubmenuEntrySelectActionViewItem = class SubmenuEntrySelectActionViewItem2 extends SelectActionViewItem { + constructor(action, contextViewService, configurationService) { + super(null, action, action.actions.map((a) => ({ + text: a.id === Separator.ID ? "\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500" : a.label, + isDisabled: !a.enabled + })), 0, contextViewService, defaultSelectBoxStyles, { ariaLabel: action.tooltip, optionsAsChildren: true, useCustomDrawn: !hasNativeContextMenu(configurationService) }); + this.select(Math.max(0, action.actions.findIndex((a) => a.checked))); + } + render(container) { + super.render(container); + container.style.borderColor = asCssVariable(selectBorder); + } + runAction(option2, index) { + const action = this.action.actions[index]; + if (action) { + this.actionRunner.run(action); + } + } +}; +SubmenuEntrySelectActionViewItem = __decorate37([ + __param32(1, IContextViewService), + __param32(2, IConfigurationService) +], SubmenuEntrySelectActionViewItem); +function createActionViewItem(instaService, action, options2) { + if (action instanceof MenuItemAction) { + return instaService.createInstance(MenuEntryActionViewItem, action, options2); + } else if (action instanceof SubmenuItemAction) { + if (action.item.isSelection) { + return instaService.createInstance(SubmenuEntrySelectActionViewItem, action); + } else if (action.item.isSplitButton) { + return instaService.createInstance(DropdownWithDefaultActionViewItem, action, { + ...options2, + togglePrimaryAction: typeof action.item.isSplitButton !== "boolean" ? action.item.isSplitButton.togglePrimaryAction : false + }); + } else { + return instaService.createInstance(SubmenuEntryActionViewItem, action, options2); + } + } else { + return void 0; + } +} + +// node_modules/monaco-editor-core/esm/vs/platform/actions/browser/toolbar.js +init_actions2(); + +// node_modules/monaco-editor-core/esm/vs/platform/actions/common/menuService.js +init_async(); +init_event(); +init_lifecycle(); +init_actions2(); +init_commands(); +init_contextkey(); +init_actions(); +init_arrays(); +init_nls(); +var __decorate38 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param33 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var PersistedMenuHideState_1; +var MenuInfo_1; +var MenuService = class MenuService2 { + constructor(_commandService, _keybindingService, storageService) { + this._commandService = _commandService; + this._keybindingService = _keybindingService; + this._hiddenStates = new PersistedMenuHideState(storageService); + } + createMenu(id, contextKeyService, options2) { + return new MenuImpl(id, this._hiddenStates, { emitEventsForSubmenuChanges: false, eventDebounceDelay: 50, ...options2 }, this._commandService, this._keybindingService, contextKeyService); + } + getMenuActions(id, contextKeyService, options2) { + const menu = new MenuImpl(id, this._hiddenStates, { emitEventsForSubmenuChanges: false, eventDebounceDelay: 50, ...options2 }, this._commandService, this._keybindingService, contextKeyService); + const actions = menu.getActions(options2); + menu.dispose(); + return actions; + } + resetHiddenStates(ids) { + this._hiddenStates.reset(ids); + } +}; +MenuService = __decorate38([ + __param33(0, ICommandService), + __param33(1, IKeybindingService), + __param33(2, IStorageService) +], MenuService); +var PersistedMenuHideState = class PersistedMenuHideState2 { + static { + PersistedMenuHideState_1 = this; + } + static { + this._key = "menu.hiddenCommands"; + } + constructor(_storageService) { + this._storageService = _storageService; + this._disposables = new DisposableStore(); + this._onDidChange = new Emitter(); + this.onDidChange = this._onDidChange.event; + this._ignoreChangeEvent = false; + this._hiddenByDefaultCache = /* @__PURE__ */ new Map(); + try { + const raw = _storageService.get(PersistedMenuHideState_1._key, 0, "{}"); + this._data = JSON.parse(raw); + } catch (err) { + this._data = /* @__PURE__ */ Object.create(null); + } + this._disposables.add(_storageService.onDidChangeValue(0, PersistedMenuHideState_1._key, this._disposables)(() => { + if (!this._ignoreChangeEvent) { + try { + const raw = _storageService.get(PersistedMenuHideState_1._key, 0, "{}"); + this._data = JSON.parse(raw); + } catch (err) { + console.log("FAILED to read storage after UPDATE", err); + } + } + this._onDidChange.fire(); + })); + } + dispose() { + this._onDidChange.dispose(); + this._disposables.dispose(); + } + _isHiddenByDefault(menu, commandId) { + return this._hiddenByDefaultCache.get(`${menu.id}/${commandId}`) ?? false; + } + setDefaultState(menu, commandId, hidden) { + this._hiddenByDefaultCache.set(`${menu.id}/${commandId}`, hidden); + } + isHidden(menu, commandId) { + const hiddenByDefault = this._isHiddenByDefault(menu, commandId); + const state = this._data[menu.id]?.includes(commandId) ?? false; + return hiddenByDefault ? !state : state; + } + updateHidden(menu, commandId, hidden) { + const hiddenByDefault = this._isHiddenByDefault(menu, commandId); + if (hiddenByDefault) { + hidden = !hidden; + } + const entries2 = this._data[menu.id]; + if (!hidden) { + if (entries2) { + const idx = entries2.indexOf(commandId); + if (idx >= 0) { + removeFastWithoutKeepingOrder(entries2, idx); + } + if (entries2.length === 0) { + delete this._data[menu.id]; + } + } + } else { + if (!entries2) { + this._data[menu.id] = [commandId]; + } else { + const idx = entries2.indexOf(commandId); + if (idx < 0) { + entries2.push(commandId); + } + } + } + this._persist(); + } + reset(menus) { + if (menus === void 0) { + this._data = /* @__PURE__ */ Object.create(null); + this._persist(); + } else { + for (const { id } of menus) { + if (this._data[id]) { + delete this._data[id]; + } + } + this._persist(); + } + } + _persist() { + try { + this._ignoreChangeEvent = true; + const raw = JSON.stringify(this._data); + this._storageService.store( + PersistedMenuHideState_1._key, + raw, + 0, + 0 + /* StorageTarget.USER */ + ); + } finally { + this._ignoreChangeEvent = false; + } + } +}; +PersistedMenuHideState = PersistedMenuHideState_1 = __decorate38([ + __param33(0, IStorageService) +], PersistedMenuHideState); +var MenuInfoSnapshot = class _MenuInfoSnapshot { + constructor(_id, _collectContextKeysForSubmenus) { + this._id = _id; + this._collectContextKeysForSubmenus = _collectContextKeysForSubmenus; + this._menuGroups = []; + this._allMenuIds = /* @__PURE__ */ new Set(); + this._structureContextKeys = /* @__PURE__ */ new Set(); + this._preconditionContextKeys = /* @__PURE__ */ new Set(); + this._toggledContextKeys = /* @__PURE__ */ new Set(); + this.refresh(); + } + get allMenuIds() { + return this._allMenuIds; + } + get structureContextKeys() { + return this._structureContextKeys; + } + get preconditionContextKeys() { + return this._preconditionContextKeys; + } + get toggledContextKeys() { + return this._toggledContextKeys; + } + refresh() { + this._menuGroups.length = 0; + this._allMenuIds.clear(); + this._structureContextKeys.clear(); + this._preconditionContextKeys.clear(); + this._toggledContextKeys.clear(); + const menuItems = this._sort(MenuRegistry.getMenuItems(this._id)); + let group; + for (const item of menuItems) { + const groupName = item.group || ""; + if (!group || group[0] !== groupName) { + group = [groupName, []]; + this._menuGroups.push(group); + } + group[1].push(item); + this._collectContextKeysAndSubmenuIds(item); + } + this._allMenuIds.add(this._id); + } + _sort(menuItems) { + return menuItems; + } + _collectContextKeysAndSubmenuIds(item) { + _MenuInfoSnapshot._fillInKbExprKeys(item.when, this._structureContextKeys); + if (isIMenuItem(item)) { + if (item.command.precondition) { + _MenuInfoSnapshot._fillInKbExprKeys(item.command.precondition, this._preconditionContextKeys); + } + if (item.command.toggled) { + const toggledExpression = item.command.toggled.condition || item.command.toggled; + _MenuInfoSnapshot._fillInKbExprKeys(toggledExpression, this._toggledContextKeys); + } + } else if (this._collectContextKeysForSubmenus) { + MenuRegistry.getMenuItems(item.submenu).forEach(this._collectContextKeysAndSubmenuIds, this); + this._allMenuIds.add(item.submenu); + } + } + static _fillInKbExprKeys(exp, set) { + if (exp) { + for (const key of exp.keys()) { + set.add(key); + } + } + } +}; +var MenuInfo = MenuInfo_1 = class MenuInfo2 extends MenuInfoSnapshot { + constructor(_id, _hiddenStates, _collectContextKeysForSubmenus, _commandService, _keybindingService, _contextKeyService) { + super(_id, _collectContextKeysForSubmenus); + this._hiddenStates = _hiddenStates; + this._commandService = _commandService; + this._keybindingService = _keybindingService; + this._contextKeyService = _contextKeyService; + this.refresh(); + } + createActionGroups(options2) { + const result = []; + for (const group of this._menuGroups) { + const [id, items] = group; + let activeActions; + for (const item of items) { + if (this._contextKeyService.contextMatchesRules(item.when)) { + const isMenuItem = isIMenuItem(item); + if (isMenuItem) { + this._hiddenStates.setDefaultState(this._id, item.command.id, !!item.isHiddenByDefault); + } + const menuHide = createMenuHide(this._id, isMenuItem ? item.command : item, this._hiddenStates); + if (isMenuItem) { + const menuKeybinding = createConfigureKeybindingAction(this._commandService, this._keybindingService, item.command.id, item.when); + (activeActions ??= []).push(new MenuItemAction(item.command, item.alt, options2, menuHide, menuKeybinding, this._contextKeyService, this._commandService)); + } else { + const groups = new MenuInfo_1(item.submenu, this._hiddenStates, this._collectContextKeysForSubmenus, this._commandService, this._keybindingService, this._contextKeyService).createActionGroups(options2); + const submenuActions = Separator.join(...groups.map((g) => g[1])); + if (submenuActions.length > 0) { + (activeActions ??= []).push(new SubmenuItemAction(item, menuHide, submenuActions)); + } + } + } + } + if (activeActions && activeActions.length > 0) { + result.push([id, activeActions]); + } + } + return result; + } + _sort(menuItems) { + return menuItems.sort(MenuInfo_1._compareMenuItems); + } + static _compareMenuItems(a, b) { + const aGroup = a.group; + const bGroup = b.group; + if (aGroup !== bGroup) { + if (!aGroup) { + return 1; + } else if (!bGroup) { + return -1; + } + if (aGroup === "navigation") { + return -1; + } else if (bGroup === "navigation") { + return 1; + } + const value = aGroup.localeCompare(bGroup); + if (value !== 0) { + return value; + } + } + const aPrio = a.order || 0; + const bPrio = b.order || 0; + if (aPrio < bPrio) { + return -1; + } else if (aPrio > bPrio) { + return 1; + } + return MenuInfo_1._compareTitles(isIMenuItem(a) ? a.command.title : a.title, isIMenuItem(b) ? b.command.title : b.title); + } + static _compareTitles(a, b) { + const aStr = typeof a === "string" ? a : a.original; + const bStr = typeof b === "string" ? b : b.original; + return aStr.localeCompare(bStr); + } +}; +MenuInfo = MenuInfo_1 = __decorate38([ + __param33(3, ICommandService), + __param33(4, IKeybindingService), + __param33(5, IContextKeyService) +], MenuInfo); +var MenuImpl = class MenuImpl2 { + constructor(id, hiddenStates, options2, commandService, keybindingService, contextKeyService) { + this._disposables = new DisposableStore(); + this._menuInfo = new MenuInfo(id, hiddenStates, options2.emitEventsForSubmenuChanges, commandService, keybindingService, contextKeyService); + const rebuildMenuSoon = new RunOnceScheduler(() => { + this._menuInfo.refresh(); + this._onDidChange.fire({ menu: this, isStructuralChange: true, isEnablementChange: true, isToggleChange: true }); + }, options2.eventDebounceDelay); + this._disposables.add(rebuildMenuSoon); + this._disposables.add(MenuRegistry.onDidChangeMenu((e) => { + for (const id2 of this._menuInfo.allMenuIds) { + if (e.has(id2)) { + rebuildMenuSoon.schedule(); + break; + } + } + })); + const lazyListener = this._disposables.add(new DisposableStore()); + const merge = (events) => { + let isStructuralChange = false; + let isEnablementChange = false; + let isToggleChange = false; + for (const item of events) { + isStructuralChange = isStructuralChange || item.isStructuralChange; + isEnablementChange = isEnablementChange || item.isEnablementChange; + isToggleChange = isToggleChange || item.isToggleChange; + if (isStructuralChange && isEnablementChange && isToggleChange) { + break; + } + } + return { menu: this, isStructuralChange, isEnablementChange, isToggleChange }; + }; + const startLazyListener = () => { + lazyListener.add(contextKeyService.onDidChangeContext((e) => { + const isStructuralChange = e.affectsSome(this._menuInfo.structureContextKeys); + const isEnablementChange = e.affectsSome(this._menuInfo.preconditionContextKeys); + const isToggleChange = e.affectsSome(this._menuInfo.toggledContextKeys); + if (isStructuralChange || isEnablementChange || isToggleChange) { + this._onDidChange.fire({ menu: this, isStructuralChange, isEnablementChange, isToggleChange }); + } + })); + lazyListener.add(hiddenStates.onDidChange((e) => { + this._onDidChange.fire({ menu: this, isStructuralChange: true, isEnablementChange: false, isToggleChange: false }); + })); + }; + this._onDidChange = new DebounceEmitter({ + // start/stop context key listener + onWillAddFirstListener: startLazyListener, + onDidRemoveLastListener: lazyListener.clear.bind(lazyListener), + delay: options2.eventDebounceDelay, + merge + }); + this.onDidChange = this._onDidChange.event; + } + getActions(options2) { + return this._menuInfo.createActionGroups(options2); + } + dispose() { + this._disposables.dispose(); + this._onDidChange.dispose(); + } +}; +MenuImpl = __decorate38([ + __param33(3, ICommandService), + __param33(4, IKeybindingService), + __param33(5, IContextKeyService) +], MenuImpl); +function createMenuHide(menu, command, states) { + const id = isISubmenuItem(command) ? command.submenu.id : command.id; + const title = typeof command.title === "string" ? command.title : command.title.value; + const hide2 = toAction({ + id: `hide/${menu.id}/${id}`, + label: localize(1651, "Hide '{0}'", title), + run() { + states.updateHidden(menu, id, true); + } + }); + const toggle = toAction({ + id: `toggle/${menu.id}/${id}`, + label: title, + get checked() { + return !states.isHidden(menu, id); + }, + run() { + states.updateHidden(menu, id, !!this.checked); + } + }); + return { + hide: hide2, + toggle, + get isHidden() { + return !toggle.checked; + } + }; +} +function createConfigureKeybindingAction(commandService, keybindingService, commandId, when = void 0, enabled = true) { + return toAction({ + id: `configureKeybinding/${commandId}`, + label: localize(1652, "Configure Keybinding"), + enabled, + run() { + const hasKeybinding = !!keybindingService.lookupKeybinding(commandId); + const whenValue = !hasKeybinding && when ? when.serialize() : void 0; + commandService.executeCommand("workbench.action.openGlobalKeybindings", `@command:${commandId}` + (whenValue ? ` +when:${whenValue}` : "")); + } + }); +} + +// node_modules/monaco-editor-core/esm/vs/platform/actions/browser/toolbar.js +init_commands(); +init_contextkey(); +init_telemetry(); + +// node_modules/monaco-editor-core/esm/vs/platform/actions/browser/actionViewItemService.js +init_event(); +init_extensions(); +init_instantiation(); +init_actions2(); +var IActionViewItemService = createDecorator("IActionViewItemService"); +var ActionViewItemService = class { + constructor() { + this._providers = /* @__PURE__ */ new Map(); + this._onDidChange = new Emitter(); + this.onDidChange = this._onDidChange.event; + } + dispose() { + this._onDidChange.dispose(); + } + lookUp(menu, commandOrMenuId) { + return this._providers.get(this._makeKey(menu, commandOrMenuId)); + } + _makeKey(menu, commandOrMenuId) { + return `${menu.id}/${commandOrMenuId instanceof MenuId ? commandOrMenuId.id : commandOrMenuId}`; + } +}; +registerSingleton( + IActionViewItemService, + ActionViewItemService, + 1 + /* InstantiationType.Delayed */ +); + +// node_modules/monaco-editor-core/esm/vs/platform/actions/browser/toolbar.js +init_instantiation(); +var __decorate39 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param34 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var WorkbenchToolBar = class WorkbenchToolBar2 extends ToolBar { + constructor(container, _options, _menuService, _contextKeyService, _contextMenuService, _keybindingService, _commandService, telemetryService) { + super(container, _contextMenuService, { + // defaults + getKeyBinding: (action) => _keybindingService.lookupKeybinding(action.id) ?? void 0, + // options (override defaults) + ..._options, + // mandatory (overide options) + allowContextMenu: true, + skipTelemetry: typeof _options?.telemetrySource === "string" + }); + this._options = _options; + this._menuService = _menuService; + this._contextKeyService = _contextKeyService; + this._contextMenuService = _contextMenuService; + this._keybindingService = _keybindingService; + this._commandService = _commandService; + this._sessionDisposables = this._store.add(new DisposableStore()); + const telemetrySource = _options?.telemetrySource; + if (telemetrySource) { + this._store.add(this.actionBar.onDidRun((e) => telemetryService.publicLog2("workbenchActionExecuted", { id: e.action.id, from: telemetrySource }))); + } + } + setActions(_primary, _secondary = [], menuIds) { + this._sessionDisposables.clear(); + const primary = _primary.slice(); + const secondary = _secondary.slice(); + const toggleActions = []; + let toggleActionsCheckedCount = 0; + const extraSecondary = []; + let someAreHidden = false; + if (this._options?.hiddenItemStrategy !== -1) { + for (let i2 = 0; i2 < primary.length; i2++) { + const action = primary[i2]; + if (!(action instanceof MenuItemAction) && !(action instanceof SubmenuItemAction)) { + continue; + } + if (!action.hideActions) { + continue; + } + toggleActions.push(action.hideActions.toggle); + if (action.hideActions.toggle.checked) { + toggleActionsCheckedCount++; + } + if (action.hideActions.isHidden) { + someAreHidden = true; + primary[i2] = void 0; + if (this._options?.hiddenItemStrategy !== 0) { + extraSecondary[i2] = action; + } + } + } + } + if (this._options?.overflowBehavior !== void 0) { + const exemptedIds = intersection(new Set(this._options.overflowBehavior.exempted), Iterable.map(primary, (a) => a?.id)); + const maxItems = this._options.overflowBehavior.maxItems - exemptedIds.size; + let count = 0; + for (let i2 = 0; i2 < primary.length; i2++) { + const action = primary[i2]; + if (!action) { + continue; + } + count++; + if (exemptedIds.has(action.id)) { + continue; + } + if (count >= maxItems) { + primary[i2] = void 0; + extraSecondary[i2] = action; + } + } + } + coalesceInPlace(primary); + coalesceInPlace(extraSecondary); + super.setActions(primary, Separator.join(extraSecondary, secondary)); + if (toggleActions.length > 0 || primary.length > 0) { + this._sessionDisposables.add(addDisposableListener(this.getElement(), "contextmenu", (e) => { + const event = new StandardMouseEvent(getWindow(this.getElement()), e); + const action = this.getItemAction(event.target); + if (!action) { + return; + } + event.preventDefault(); + event.stopPropagation(); + const primaryActions = []; + if (action instanceof MenuItemAction && action.menuKeybinding) { + primaryActions.push(action.menuKeybinding); + } else if (!(action instanceof SubmenuItemAction || action instanceof ToggleMenuAction)) { + const supportsKeybindings = !!this._keybindingService.lookupKeybinding(action.id); + primaryActions.push(createConfigureKeybindingAction(this._commandService, this._keybindingService, action.id, void 0, supportsKeybindings)); + } + if (toggleActions.length > 0) { + let noHide = false; + if (toggleActionsCheckedCount === 1 && this._options?.hiddenItemStrategy === 0) { + noHide = true; + for (let i2 = 0; i2 < toggleActions.length; i2++) { + if (toggleActions[i2].checked) { + toggleActions[i2] = toAction({ + id: action.id, + label: action.label, + checked: true, + enabled: false, + run() { + } + }); + break; + } + } + } + if (!noHide && (action instanceof MenuItemAction || action instanceof SubmenuItemAction)) { + if (!action.hideActions) { + return; + } + primaryActions.push(action.hideActions.hide); + } else { + primaryActions.push(toAction({ + id: "label", + label: localize(1649, "Hide"), + enabled: false, + run() { + } + })); + } + } + const actions = Separator.join(primaryActions, toggleActions); + if (this._options?.resetMenu && !menuIds) { + menuIds = [this._options.resetMenu]; + } + if (someAreHidden && menuIds) { + actions.push(new Separator()); + actions.push(toAction({ + id: "resetThisMenu", + label: localize(1650, "Reset Menu"), + run: () => this._menuService.resetHiddenStates(menuIds) + })); + } + if (actions.length === 0) { + return; + } + this._contextMenuService.showContextMenu({ + getAnchor: () => event, + getActions: () => actions, + // add context menu actions (iff appicable) + menuId: this._options?.contextMenu, + menuActionOptions: { renderShortTitle: true, ...this._options?.menuOptions }, + skipTelemetry: typeof this._options?.telemetrySource === "string", + contextKeyService: this._contextKeyService + }); + })); + } + } +}; +WorkbenchToolBar = __decorate39([ + __param34(2, IMenuService), + __param34(3, IContextKeyService), + __param34(4, IContextMenuService), + __param34(5, IKeybindingService), + __param34(6, ICommandService), + __param34(7, ITelemetryService) +], WorkbenchToolBar); +var MenuWorkbenchToolBar = class MenuWorkbenchToolBar2 extends WorkbenchToolBar { + get onDidChangeMenuItems() { + return this._onDidChangeMenuItems.event; + } + constructor(container, menuId, options2, menuService, contextKeyService, contextMenuService, keybindingService, commandService, telemetryService, actionViewService, instantiationService) { + super(container, { + resetMenu: menuId, + ...options2, + actionViewItemProvider: (action, opts) => { + let provider = actionViewService.lookUp(menuId, action instanceof SubmenuItemAction ? action.item.submenu.id : action.id); + if (!provider) { + provider = options2?.actionViewItemProvider; + } + const viewItem = provider?.(action, opts, instantiationService, getWindow(container).vscodeWindowId); + if (viewItem) { + return viewItem; + } + return createActionViewItem(instantiationService, action, opts); + } + }, menuService, contextKeyService, contextMenuService, keybindingService, commandService, telemetryService); + this._onDidChangeMenuItems = this._store.add(new Emitter()); + const menu = this._store.add(menuService.createMenu(menuId, contextKeyService, { emitEventsForSubmenuChanges: true, eventDebounceDelay: options2?.eventDebounceDelay })); + const updateToolbar = () => { + const { primary, secondary } = getActionBarActions(menu.getActions(options2?.menuOptions), options2?.toolbarOptions?.primaryGroup, options2?.toolbarOptions?.shouldInlineSubmenu, options2?.toolbarOptions?.useSeparatorsInPrimaryActions); + container.classList.toggle("has-no-actions", primary.length === 0 && secondary.length === 0); + super.setActions(primary, secondary); + }; + this._store.add(menu.onDidChange(() => { + updateToolbar(); + this._onDidChangeMenuItems.fire(this); + })); + this._store.add(actionViewService.onDidChange((e) => { + if (e === menuId) { + updateToolbar(); + } + })); + updateToolbar(); + } + /** + * @deprecated The WorkbenchToolBar does not support this method because it works with menus. + */ + setActions() { + throw new BugIndicatingError("This toolbar is populated from a menu."); + } +}; +MenuWorkbenchToolBar = __decorate39([ + __param34(3, IMenuService), + __param34(4, IContextKeyService), + __param34(5, IContextMenuService), + __param34(6, IKeybindingService), + __param34(7, ICommandService), + __param34(8, ITelemetryService), + __param34(9, IActionViewItemService), + __param34(10, IInstantiationService) +], MenuWorkbenchToolBar); + +// node_modules/monaco-editor-core/esm/vs/editor/browser/widget/diffEditor/features/gutterFeature.js +init_actions2(); +init_contextkey(); + +// node_modules/monaco-editor-core/esm/vs/platform/hover/browser/hover.js +init_instantiation(); +init_lifecycle(); +init_configuration(); +init_dom(); +var __decorate40 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param35 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var IHoverService = createDecorator("hoverService"); +var WorkbenchHoverDelegate = class WorkbenchHoverDelegate2 extends Disposable { + get delay() { + if (this.isInstantlyHovering()) { + return 0; + } + if (this.hoverOptions?.dynamicDelay) { + return (content) => this.hoverOptions?.dynamicDelay?.(content) ?? this._delay; + } + return this._delay; + } + constructor(placement, hoverOptions, overrideOptions = {}, configurationService, hoverService) { + super(); + this.placement = placement; + this.hoverOptions = hoverOptions; + this.overrideOptions = overrideOptions; + this.configurationService = configurationService; + this.hoverService = hoverService; + this.lastHoverHideTime = 0; + this.timeLimit = 200; + this.hoverDisposables = this._register(new DisposableStore()); + this._delay = this.configurationService.getValue("workbench.hover.delay"); + this._register(this.configurationService.onDidChangeConfiguration((e) => { + if (e.affectsConfiguration("workbench.hover.delay")) { + this._delay = this.configurationService.getValue("workbench.hover.delay"); + } + })); + } + showHover(options2, focus) { + const overrideOptions = typeof this.overrideOptions === "function" ? this.overrideOptions(options2, focus) : this.overrideOptions; + this.hoverDisposables.clear(); + const targets = isHTMLElement(options2.target) ? [options2.target] : options2.target.targetElements; + for (const target of targets) { + this.hoverDisposables.add(addStandardDisposableListener(target, "keydown", (e) => { + if (e.equals( + 9 + /* KeyCode.Escape */ + )) { + this.hoverService.hideHover(); + } + })); + } + const id = isHTMLElement(options2.content) ? void 0 : typeof options2.content === "string" ? options2.content.toString() : options2.content.value; + return this.hoverService.showInstantHover({ + ...options2, + ...overrideOptions, + persistence: { + hideOnKeyDown: true, + ...overrideOptions.persistence + }, + id, + appearance: { + ...options2.appearance, + compact: true, + skipFadeInAnimation: this.isInstantlyHovering(), + ...overrideOptions.appearance + } + }, focus); + } + isInstantlyHovering() { + return !!this.hoverOptions?.instantHover && Date.now() - this.lastHoverHideTime < this.timeLimit; + } + onDidHideHover() { + this.hoverDisposables.clear(); + if (this.hoverOptions?.instantHover) { + this.lastHoverHideTime = Date.now(); + } + } +}; +WorkbenchHoverDelegate = __decorate40([ + __param35(3, IConfigurationService), + __param35(4, IHoverService) +], WorkbenchHoverDelegate); +var nativeHoverDelegate = { + showHover: function() { + throw new Error("Native hover function not implemented."); + }, + delay: 0, + showNativeHover: true +}; + +// node_modules/monaco-editor-core/esm/vs/editor/browser/widget/diffEditor/features/gutterFeature.js +init_instantiation(); +init_lineRange(); +init_offsetRange(); +init_range(); + +// node_modules/monaco-editor-core/esm/vs/editor/common/model/textModelText.js +init_textLength(); +var TextModelText = class extends AbstractText { + constructor(_textModel) { + super(); + this._textModel = _textModel; + } + getValueOfRange(range2) { + return this._textModel.getValueInRange(range2); + } + getLineLength(lineNumber) { + return this._textModel.getLineLength(lineNumber); + } + get length() { + const lastLineNumber = this._textModel.getLineCount(); + const lastLineLen = this._textModel.getLineLength(lastLineNumber); + return new TextLength(lastLineNumber - 1, lastLineLen); + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/browser/widget/multiDiffEditor/utils.js +init_actions(); +var ActionRunnerWithContext = class extends ActionRunner { + constructor(_getContext) { + super(); + this._getContext = _getContext; + } + runAction(action, _context) { + const ctx = this._getContext(); + return super.runAction(action, ctx); + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/browser/widget/diffEditor/features/gutterFeature.js +init_utils5(); + +// node_modules/monaco-editor-core/esm/vs/editor/browser/widget/diffEditor/utils/editorGutter.js +init_dom(); +init_lifecycle(); +init_observable(); +init_lineRange(); +init_offsetRange(); +var EditorGutter = class extends Disposable { + constructor(_editor, _domNode, itemProvider) { + super(); + this._editor = _editor; + this._domNode = _domNode; + this.itemProvider = itemProvider; + this.scrollTop = observableFromEvent(this, this._editor.onDidScrollChange, (e) => ( + /** @description editor.onDidScrollChange */ + this._editor.getScrollTop() + )); + this.isScrollTopZero = this.scrollTop.map((scrollTop) => ( + /** @description isScrollTopZero */ + scrollTop === 0 + )); + this.modelAttached = observableFromEvent(this, this._editor.onDidChangeModel, (e) => ( + /** @description editor.onDidChangeModel */ + this._editor.hasModel() + )); + this.editorOnDidChangeViewZones = observableSignalFromEvent("onDidChangeViewZones", this._editor.onDidChangeViewZones); + this.editorOnDidContentSizeChange = observableSignalFromEvent("onDidContentSizeChange", this._editor.onDidContentSizeChange); + this.domNodeSizeChanged = observableSignal("domNodeSizeChanged"); + this.views = /* @__PURE__ */ new Map(); + this._domNode.className = "gutter monaco-editor"; + const scrollDecoration = this._domNode.appendChild(h("div.scroll-decoration", { role: "presentation", ariaHidden: "true", style: { width: "100%" } }).root); + const o = new ResizeObserver(() => { + transaction((tx) => { + this.domNodeSizeChanged.trigger(tx); + }); + }); + o.observe(this._domNode); + this._register(toDisposable(() => o.disconnect())); + this._register(autorun((reader) => { + scrollDecoration.className = this.isScrollTopZero.read(reader) ? "" : "scroll-decoration"; + })); + this._register(autorun((reader) => ( + /** @description EditorGutter.Render */ + this.render(reader) + ))); + } + dispose() { + super.dispose(); + reset(this._domNode); + } + render(reader) { + if (!this.modelAttached.read(reader)) { + return; + } + this.domNodeSizeChanged.read(reader); + this.editorOnDidChangeViewZones.read(reader); + this.editorOnDidContentSizeChange.read(reader); + const scrollTop = this.scrollTop.read(reader); + const visibleRanges = this._editor.getVisibleRanges(); + const unusedIds = new Set(this.views.keys()); + const viewRange = OffsetRange.ofStartAndLength(0, this._domNode.clientHeight); + if (!viewRange.isEmpty) { + for (const visibleRange of visibleRanges) { + const visibleRange2 = new LineRange(visibleRange.startLineNumber, visibleRange.endLineNumber + 1); + const gutterItems = this.itemProvider.getIntersectingGutterItems(visibleRange2, reader); + transaction((tx) => { + for (const gutterItem of gutterItems) { + if (!gutterItem.range.intersect(visibleRange2)) { + continue; + } + unusedIds.delete(gutterItem.id); + let view = this.views.get(gutterItem.id); + if (!view) { + const viewDomNode = document.createElement("div"); + this._domNode.appendChild(viewDomNode); + const gutterItemObs = observableValue("item", gutterItem); + const itemView = this.itemProvider.createView(gutterItemObs, viewDomNode); + view = new ManagedGutterItemView(gutterItemObs, itemView, viewDomNode); + this.views.set(gutterItem.id, view); + } else { + view.item.set(gutterItem, tx); + } + const top = gutterItem.range.startLineNumber <= this._editor.getModel().getLineCount() ? this._editor.getTopForLineNumber(gutterItem.range.startLineNumber, true) - scrollTop : gutterItem.range.startLineNumber > 1 ? this._editor.getBottomForLineNumber(gutterItem.range.startLineNumber - 1, false) - scrollTop : 0; + const bottom = gutterItem.range.endLineNumberExclusive === 1 ? Math.max(top, this._editor.getTopForLineNumber(gutterItem.range.startLineNumber, false) - scrollTop) : Math.max(top, this._editor.getBottomForLineNumber(gutterItem.range.endLineNumberExclusive - 1, true) - scrollTop); + const height = bottom - top; + view.domNode.style.top = `${top}px`; + view.domNode.style.height = `${height}px`; + view.gutterItemView.layout(OffsetRange.ofStartAndLength(top, height), viewRange); + } + }); + } + } + for (const id of unusedIds) { + const view = this.views.get(id); + view.gutterItemView.dispose(); + view.domNode.remove(); + this.views.delete(id); + } + } +}; +var ManagedGutterItemView = class { + constructor(item, gutterItemView, domNode) { + this.item = item; + this.gutterItemView = gutterItemView; + this.domNode = domNode; + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/browser/widget/diffEditor/features/gutterFeature.js +var __decorate41 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param36 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var emptyArr2 = []; +var width = 35; +var DiffEditorGutter = class DiffEditorGutter2 extends Disposable { + constructor(diffEditorRoot, _diffModel, _editors, _options, _sashLayout, _boundarySashes, _instantiationService, _contextKeyService, _menuService) { + super(); + this._diffModel = _diffModel; + this._editors = _editors; + this._options = _options; + this._sashLayout = _sashLayout; + this._boundarySashes = _boundarySashes; + this._instantiationService = _instantiationService; + this._contextKeyService = _contextKeyService; + this._menuService = _menuService; + this._menu = this._register(this._menuService.createMenu(MenuId.DiffEditorHunkToolbar, this._contextKeyService)); + this._actions = observableFromEvent(this, this._menu.onDidChange, () => this._menu.getActions()); + this._hasActions = this._actions.map((a) => a.length > 0); + this._showSash = derived(this, (reader) => this._options.renderSideBySide.read(reader) && this._hasActions.read(reader)); + this.width = derived(this, (reader) => this._hasActions.read(reader) ? width : 0); + this.elements = h("div.gutter@gutter", { style: { position: "absolute", height: "100%", width: width + "px" } }, []); + this._currentDiff = derived(this, (reader) => { + const model = this._diffModel.read(reader); + if (!model) { + return void 0; + } + const mappings = model.diff.read(reader)?.mappings; + const cursorPosition = this._editors.modifiedCursor.read(reader); + if (!cursorPosition) { + return void 0; + } + return mappings?.find((m) => m.lineRangeMapping.modified.contains(cursorPosition.lineNumber)); + }); + this._selectedDiffs = derived(this, (reader) => { + const model = this._diffModel.read(reader); + const diff = model?.diff.read(reader); + if (!diff) { + return emptyArr2; + } + const selections = this._editors.modifiedSelections.read(reader); + if (selections.every((s) => s.isEmpty())) { + return emptyArr2; + } + const selectedLineNumbers = new LineRangeSet(selections.map((s) => LineRange.fromRangeInclusive(s))); + const selectedMappings = diff.mappings.filter((m) => m.lineRangeMapping.innerChanges && selectedLineNumbers.intersects(m.lineRangeMapping.modified)); + const result = selectedMappings.map((mapping) => ({ + mapping, + rangeMappings: mapping.lineRangeMapping.innerChanges.filter((c) => selections.some((s) => Range.areIntersecting(c.modifiedRange, s))) + })); + if (result.length === 0 || result.every((r) => r.rangeMappings.length === 0)) { + return emptyArr2; + } + return result; + }); + this._register(prependRemoveOnDispose(diffEditorRoot, this.elements.root)); + this._register(addDisposableListener(this.elements.root, "click", () => { + this._editors.modified.focus(); + })); + this._register(applyStyle(this.elements.root, { display: this._hasActions.map((a) => a ? "block" : "none") })); + derivedDisposable(this, (reader) => { + const showSash = this._showSash.read(reader); + return !showSash ? void 0 : new DiffEditorSash(diffEditorRoot, this._sashLayout.dimensions, this._options.enableSplitViewResizing, this._boundarySashes, derivedWithSetter(this, (reader2) => this._sashLayout.sashLeft.read(reader2) - width, (v, tx) => this._sashLayout.sashLeft.set(v + width, tx)), () => this._sashLayout.resetSash()); + }).recomputeInitiallyAndOnChange(this._store); + const gutterItems = derived(this, (reader) => { + const model = this._diffModel.read(reader); + if (!model) { + return []; + } + const diffs = model.diff.read(reader); + if (!diffs) { + return []; + } + const selection = this._selectedDiffs.read(reader); + if (selection.length > 0) { + const m = DetailedLineRangeMapping.fromRangeMappings(selection.flatMap((s) => s.rangeMappings)); + return [ + new DiffGutterItem(m, true, MenuId.DiffEditorSelectionToolbar, void 0, model.model.original.uri, model.model.modified.uri) + ]; + } + const currentDiff = this._currentDiff.read(reader); + return diffs.mappings.map((m) => new DiffGutterItem(m.lineRangeMapping.withInnerChangesFromLineRanges(), m.lineRangeMapping === currentDiff?.lineRangeMapping, MenuId.DiffEditorHunkToolbar, void 0, model.model.original.uri, model.model.modified.uri)); + }); + this._register(new EditorGutter(this._editors.modified, this.elements.root, { + getIntersectingGutterItems: (range2, reader) => gutterItems.read(reader), + createView: (item, target) => { + return this._instantiationService.createInstance(DiffToolBar, item, target, this); + } + })); + this._register(addDisposableListener(this.elements.gutter, EventType.MOUSE_WHEEL, (e) => { + if (this._editors.modified.getOption( + 117 + /* EditorOption.scrollbar */ + ).handleMouseWheel) { + this._editors.modified.delegateScrollFromMouseWheelEvent(e); + } + }, { passive: false })); + } + computeStagedValue(mapping) { + const c = mapping.innerChanges ?? []; + const modified = new TextModelText(this._editors.modifiedModel.get()); + const original = new TextModelText(this._editors.original.getModel()); + const edit2 = new TextEdit(c.map((c2) => c2.toTextEdit(modified))); + const value = edit2.apply(original); + return value; + } + layout(left) { + this.elements.gutter.style.left = left + "px"; + } +}; +DiffEditorGutter = __decorate41([ + __param36(6, IInstantiationService), + __param36(7, IContextKeyService), + __param36(8, IMenuService) +], DiffEditorGutter); +var DiffGutterItem = class { + constructor(mapping, showAlways, menuId, rangeOverride, originalUri, modifiedUri) { + this.mapping = mapping; + this.showAlways = showAlways; + this.menuId = menuId; + this.rangeOverride = rangeOverride; + this.originalUri = originalUri; + this.modifiedUri = modifiedUri; + } + get id() { + return this.mapping.modified.toString(); + } + get range() { + return this.rangeOverride ?? this.mapping.modified; + } +}; +var DiffToolBar = class DiffToolBar2 extends Disposable { + constructor(_item, target, gutter, instantiationService) { + super(); + this._item = _item; + this._elements = h("div.gutterItem", { style: { height: "20px", width: "34px" } }, [ + h("div.background@background", {}, []), + h("div.buttons@buttons", {}, []) + ]); + this._showAlways = this._item.map(this, (item) => item.showAlways); + this._menuId = this._item.map(this, (item) => item.menuId); + this._isSmall = observableValue(this, false); + this._lastItemRange = void 0; + this._lastViewRange = void 0; + const hoverDelegate = this._register(instantiationService.createInstance(WorkbenchHoverDelegate, "element", { instantHover: true }, { position: { + hoverPosition: 1 + /* HoverPosition.RIGHT */ + } })); + this._register(appendRemoveOnDispose(target, this._elements.root)); + this._register(autorun((reader) => { + const showAlways = this._showAlways.read(reader); + this._elements.root.classList.toggle("noTransition", true); + this._elements.root.classList.toggle("showAlways", showAlways); + setTimeout(() => { + this._elements.root.classList.toggle("noTransition", false); + }, 0); + })); + this._register(autorunWithStore((reader, store) => { + this._elements.buttons.replaceChildren(); + const i2 = store.add(instantiationService.createInstance(MenuWorkbenchToolBar, this._elements.buttons, this._menuId.read(reader), { + orientation: 1, + hoverDelegate, + toolbarOptions: { + primaryGroup: (g) => g.startsWith("primary") + }, + overflowBehavior: { maxItems: this._isSmall.read(reader) ? 1 : 3 }, + hiddenItemStrategy: 0, + actionRunner: store.add(new ActionRunnerWithContext(() => { + const item = this._item.read(void 0); + const mapping = item.mapping; + return { + mapping, + originalWithModifiedChanges: gutter.computeStagedValue(mapping), + originalUri: item.originalUri, + modifiedUri: item.modifiedUri + }; + })), + menuOptions: { + shouldForwardArgs: true + } + })); + store.add(i2.onDidChangeMenuItems(() => { + if (this._lastItemRange) { + this.layout(this._lastItemRange, this._lastViewRange); + } + })); + })); + } + layout(itemRange, viewRange) { + this._lastItemRange = itemRange; + this._lastViewRange = viewRange; + let itemHeight = this._elements.buttons.clientHeight; + this._isSmall.set(this._item.get().mapping.original.startLineNumber === 1 && itemRange.length < 30, void 0); + itemHeight = this._elements.buttons.clientHeight; + const middleHeight = itemRange.length / 2 - itemHeight / 2; + const margin = itemHeight; + let effectiveCheckboxTop = itemRange.start + middleHeight; + const preferredViewPortRange = OffsetRange.tryCreate(margin, viewRange.endExclusive - margin - itemHeight); + const preferredParentRange = OffsetRange.tryCreate(itemRange.start + margin, itemRange.endExclusive - itemHeight - margin); + if (preferredParentRange && preferredViewPortRange && preferredParentRange.start < preferredParentRange.endExclusive) { + effectiveCheckboxTop = preferredViewPortRange.clip(effectiveCheckboxTop); + effectiveCheckboxTop = preferredParentRange.clip(effectiveCheckboxTop); + } + this._elements.buttons.style.top = `${effectiveCheckboxTop - itemRange.start}px`; + } +}; +DiffToolBar = __decorate41([ + __param36(3, IInstantiationService) +], DiffToolBar); + +// node_modules/monaco-editor-core/esm/vs/editor/browser/widget/diffEditor/diffEditorWidget.js +init_hideUnchangedRegionsFeature(); + +// node_modules/monaco-editor-core/esm/vs/editor/browser/widget/diffEditor/features/revertButtonsFeature.js +init_dom(); +init_iconLabels2(); +init_codicons(); +init_lifecycle(); +init_observable(); +init_lineRange(); +init_range(); +init_model2(); +init_nls(); +var emptyArr3 = []; +var RevertButtonsFeature = class extends Disposable { + constructor(_editors, _diffModel, _options, _widget) { + super(); + this._editors = _editors; + this._diffModel = _diffModel; + this._options = _options; + this._widget = _widget; + this._selectedDiffs = derived(this, (reader) => { + const model = this._diffModel.read(reader); + const diff = model?.diff.read(reader); + if (!diff) { + return emptyArr3; + } + const selections = this._editors.modifiedSelections.read(reader); + if (selections.every((s) => s.isEmpty())) { + return emptyArr3; + } + const selectedLineNumbers = new LineRangeSet(selections.map((s) => LineRange.fromRangeInclusive(s))); + const selectedMappings = diff.mappings.filter((m) => m.lineRangeMapping.innerChanges && selectedLineNumbers.intersects(m.lineRangeMapping.modified)); + const result = selectedMappings.map((mapping) => ({ + mapping, + rangeMappings: mapping.lineRangeMapping.innerChanges.filter((c) => selections.some((s) => Range.areIntersecting(c.modifiedRange, s))) + })); + if (result.length === 0 || result.every((r) => r.rangeMappings.length === 0)) { + return emptyArr3; + } + return result; + }); + this._register(autorunWithStore((reader, store) => { + if (!this._options.shouldRenderOldRevertArrows.read(reader)) { + return; + } + const model = this._diffModel.read(reader); + const diff = model?.diff.read(reader); + if (!model || !diff) { + return; + } + if (model.movedTextToCompare.read(reader)) { + return; + } + const glyphWidgetsModified = []; + const selectedDiffs = this._selectedDiffs.read(reader); + const selectedDiffsSet = new Set(selectedDiffs.map((d) => d.mapping)); + if (selectedDiffs.length > 0) { + const selections = this._editors.modifiedSelections.read(reader); + const btn = store.add(new RevertButton(selections[selections.length - 1].positionLineNumber, this._widget, selectedDiffs.flatMap((d) => d.rangeMappings), true)); + this._editors.modified.addGlyphMarginWidget(btn); + glyphWidgetsModified.push(btn); + } + for (const m of diff.mappings) { + if (selectedDiffsSet.has(m)) { + continue; + } + if (!m.lineRangeMapping.modified.isEmpty && m.lineRangeMapping.innerChanges) { + const btn = store.add(new RevertButton(m.lineRangeMapping.modified.startLineNumber, this._widget, m.lineRangeMapping, false)); + this._editors.modified.addGlyphMarginWidget(btn); + glyphWidgetsModified.push(btn); + } + } + store.add(toDisposable(() => { + for (const w of glyphWidgetsModified) { + this._editors.modified.removeGlyphMarginWidget(w); + } + })); + })); + } +}; +var RevertButton = class _RevertButton extends Disposable { + static { + this.counter = 0; + } + getId() { + return this._id; + } + constructor(_lineNumber, _widget, _diffs, _revertSelection) { + super(); + this._lineNumber = _lineNumber; + this._widget = _widget; + this._diffs = _diffs; + this._revertSelection = _revertSelection; + this._id = `revertButton${_RevertButton.counter++}`; + this._domNode = h("div.revertButton", { + title: this._revertSelection ? localize(135, "Revert Selected Changes") : localize(136, "Revert Change") + }, [renderIcon(Codicon.arrowRight)]).root; + this._register(addDisposableListener(this._domNode, EventType.MOUSE_DOWN, (e) => { + if (e.button !== 2) { + e.stopPropagation(); + e.preventDefault(); + } + })); + this._register(addDisposableListener(this._domNode, EventType.MOUSE_UP, (e) => { + e.stopPropagation(); + e.preventDefault(); + })); + this._register(addDisposableListener(this._domNode, EventType.CLICK, (e) => { + if (this._diffs instanceof LineRangeMapping) { + this._widget.revert(this._diffs); + } else { + this._widget.revertRangeMappings(this._diffs); + } + e.stopPropagation(); + e.preventDefault(); + })); + } + /** + * Get the dom node of the glyph widget. + */ + getDomNode() { + return this._domNode; + } + /** + * Get the placement of the glyph widget. + */ + getPosition() { + return { + lane: GlyphMarginLane.Right, + range: { + startColumn: 1, + startLineNumber: this._lineNumber, + endColumn: 1, + endLineNumber: this._lineNumber + }, + zIndex: 10001 + }; + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/browser/widget/diffEditor/diffEditorWidget.js +init_utils5(); +var __decorate43 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param38 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var DiffEditorWidget = class DiffEditorWidget2 extends DelegatingEditor { + get onDidContentSizeChange() { + return this._editors.onDidContentSizeChange; + } + constructor(_domElement, options2, codeEditorWidgetOptions, _parentContextKeyService, _parentInstantiationService, _codeEditorService, _accessibilitySignalService, _editorProgressService) { + super(); + this._domElement = _domElement; + this._parentContextKeyService = _parentContextKeyService; + this._parentInstantiationService = _parentInstantiationService; + this._codeEditorService = _codeEditorService; + this._accessibilitySignalService = _accessibilitySignalService; + this._editorProgressService = _editorProgressService; + this.elements = h("div.monaco-diff-editor.side-by-side", { style: { position: "relative", height: "100%" } }, [ + h("div.editor.original@original", { style: { position: "absolute", height: "100%" } }), + h("div.editor.modified@modified", { style: { position: "absolute", height: "100%" } }), + h("div.accessibleDiffViewer@accessibleDiffViewer", { style: { position: "absolute", height: "100%" } }) + ]); + this._diffModelSrc = this._register(disposableObservableValue(this, void 0)); + this._diffModel = derived(this, (reader) => this._diffModelSrc.read(reader)?.object); + this.onDidChangeModel = Event.fromObservableLight(this._diffModel); + this._contextKeyService = this._register(this._parentContextKeyService.createScoped(this._domElement)); + this._instantiationService = this._register(this._parentInstantiationService.createChild(new ServiceCollection([IContextKeyService, this._contextKeyService]))); + this._boundarySashes = observableValue(this, void 0); + this._accessibleDiffViewerShouldBeVisible = observableValue(this, false); + this._accessibleDiffViewerVisible = derived(this, (reader) => this._options.onlyShowAccessibleDiffViewer.read(reader) ? true : this._accessibleDiffViewerShouldBeVisible.read(reader)); + this._movedBlocksLinesPart = observableValue(this, void 0); + this._layoutInfo = derived(this, (reader) => { + const fullWidth = this._rootSizeObserver.width.read(reader); + const fullHeight = this._rootSizeObserver.height.read(reader); + if (this._rootSizeObserver.automaticLayout) { + this.elements.root.style.height = "100%"; + } else { + this.elements.root.style.height = fullHeight + "px"; + } + const sash = this._sash.read(reader); + const gutter = this._gutter.read(reader); + const gutterWidth = gutter?.width.read(reader) ?? 0; + const overviewRulerPartWidth = this._overviewRulerPart.read(reader)?.width ?? 0; + let originalLeft, originalWidth, modifiedLeft, modifiedWidth, gutterLeft; + const sideBySide = !!sash; + if (sideBySide) { + const sashLeft = sash.sashLeft.read(reader); + const movedBlocksLinesWidth = this._movedBlocksLinesPart.read(reader)?.width.read(reader) ?? 0; + originalLeft = 0; + originalWidth = sashLeft - gutterWidth - movedBlocksLinesWidth; + gutterLeft = sashLeft - gutterWidth; + modifiedLeft = sashLeft; + modifiedWidth = fullWidth - modifiedLeft - overviewRulerPartWidth; + } else { + gutterLeft = 0; + const shouldHideOriginalLineNumbers = this._options.inlineViewHideOriginalLineNumbers.read(reader); + originalLeft = gutterWidth; + if (shouldHideOriginalLineNumbers) { + originalWidth = 0; + } else { + originalWidth = Math.max(5, this._editors.originalObs.layoutInfoDecorationsLeft.read(reader)); + } + modifiedLeft = gutterWidth + originalWidth; + modifiedWidth = fullWidth - modifiedLeft - overviewRulerPartWidth; + } + this.elements.original.style.left = originalLeft + "px"; + this.elements.original.style.width = originalWidth + "px"; + this._editors.original.layout({ width: originalWidth, height: fullHeight }, true); + gutter?.layout(gutterLeft); + this.elements.modified.style.left = modifiedLeft + "px"; + this.elements.modified.style.width = modifiedWidth + "px"; + this._editors.modified.layout({ width: modifiedWidth, height: fullHeight }, true); + return { + modifiedEditor: this._editors.modified.getLayoutInfo(), + originalEditor: this._editors.original.getLayoutInfo() + }; + }); + this._diffValue = this._diffModel.map((m, r) => m?.diff.read(r)); + this.onDidUpdateDiff = Event.fromObservableLight(this._diffValue); + this._codeEditorService.willCreateDiffEditor(); + this._contextKeyService.createKey("isInDiffEditor", true); + this._domElement.appendChild(this.elements.root); + this._register(toDisposable(() => this.elements.root.remove())); + this._rootSizeObserver = this._register(new ObservableElementSizeObserver(this.elements.root, options2.dimension)); + this._rootSizeObserver.setAutomaticLayout(options2.automaticLayout ?? false); + this._options = this._instantiationService.createInstance(DiffEditorOptions, options2); + this._register(autorun((reader) => { + this._options.setWidth(this._rootSizeObserver.width.read(reader)); + })); + this._contextKeyService.createKey(EditorContextKeys.isEmbeddedDiffEditor.key, false); + this._register(bindContextKey(EditorContextKeys.isEmbeddedDiffEditor, this._contextKeyService, (reader) => this._options.isInEmbeddedEditor.read(reader))); + this._register(bindContextKey(EditorContextKeys.comparingMovedCode, this._contextKeyService, (reader) => !!this._diffModel.read(reader)?.movedTextToCompare.read(reader))); + this._register(bindContextKey(EditorContextKeys.diffEditorRenderSideBySideInlineBreakpointReached, this._contextKeyService, (reader) => this._options.couldShowInlineViewBecauseOfSize.read(reader))); + this._register(bindContextKey(EditorContextKeys.diffEditorInlineMode, this._contextKeyService, (reader) => !this._options.renderSideBySide.read(reader))); + this._register(bindContextKey(EditorContextKeys.hasChanges, this._contextKeyService, (reader) => (this._diffModel.read(reader)?.diff.read(reader)?.mappings.length ?? 0) > 0)); + this._editors = this._register(this._instantiationService.createInstance(DiffEditorEditors, this.elements.original, this.elements.modified, this._options, codeEditorWidgetOptions, (i2, c, o, o2) => this._createInnerEditor(i2, c, o, o2))); + this._register(bindContextKey(EditorContextKeys.diffEditorOriginalWritable, this._contextKeyService, (reader) => this._options.originalEditable.read(reader))); + this._register(bindContextKey(EditorContextKeys.diffEditorModifiedWritable, this._contextKeyService, (reader) => !this._options.readOnly.read(reader))); + this._register(bindContextKey(EditorContextKeys.diffEditorOriginalUri, this._contextKeyService, (reader) => this._diffModel.read(reader)?.model.original.uri.toString() ?? "")); + this._register(bindContextKey(EditorContextKeys.diffEditorModifiedUri, this._contextKeyService, (reader) => this._diffModel.read(reader)?.model.modified.uri.toString() ?? "")); + this._overviewRulerPart = derivedDisposable(this, (reader) => !this._options.renderOverviewRuler.read(reader) ? void 0 : this._instantiationService.createInstance(readHotReloadableExport(OverviewRulerFeature, reader), this._editors, this.elements.root, this._diffModel, this._rootSizeObserver.width, this._rootSizeObserver.height, this._layoutInfo.map((i2) => i2.modifiedEditor))).recomputeInitiallyAndOnChange(this._store); + const dimensions = { + height: this._rootSizeObserver.height, + width: this._rootSizeObserver.width.map((w, reader) => w - (this._overviewRulerPart.read(reader)?.width ?? 0)) + }; + this._sashLayout = new SashLayout(this._options, dimensions); + this._sash = derivedDisposable(this, (reader) => { + const showSash = this._options.renderSideBySide.read(reader); + this.elements.root.classList.toggle("side-by-side", showSash); + return !showSash ? void 0 : new DiffEditorSash(this.elements.root, dimensions, this._options.enableSplitViewResizing, this._boundarySashes, this._sashLayout.sashLeft, () => this._sashLayout.resetSash()); + }).recomputeInitiallyAndOnChange(this._store); + const unchangedRangesFeature = derivedDisposable(this, (reader) => ( + /** @description UnchangedRangesFeature */ + this._instantiationService.createInstance(readHotReloadableExport(HideUnchangedRegionsFeature, reader), this._editors, this._diffModel, this._options) + )).recomputeInitiallyAndOnChange(this._store); + derivedDisposable(this, (reader) => ( + /** @description DiffEditorDecorations */ + this._instantiationService.createInstance(readHotReloadableExport(DiffEditorDecorations, reader), this._editors, this._diffModel, this._options, this) + )).recomputeInitiallyAndOnChange(this._store); + const origViewZoneIdsToIgnore = /* @__PURE__ */ new Set(); + const modViewZoneIdsToIgnore = /* @__PURE__ */ new Set(); + let isUpdatingViewZones = false; + const viewZoneManager = derivedDisposable(this, (reader) => ( + /** @description ViewZoneManager */ + this._instantiationService.createInstance(readHotReloadableExport(DiffEditorViewZones, reader), getWindow(this._domElement), this._editors, this._diffModel, this._options, this, () => isUpdatingViewZones || unchangedRangesFeature.read(void 0).isUpdatingHiddenAreas, origViewZoneIdsToIgnore, modViewZoneIdsToIgnore) + )).recomputeInitiallyAndOnChange(this._store); + const originalViewZones = derived(this, (reader) => { + const orig = viewZoneManager.read(reader).viewZones.read(reader).orig; + const orig2 = unchangedRangesFeature.read(reader).viewZones.read(reader).origViewZones; + return orig.concat(orig2); + }); + const modifiedViewZones = derived(this, (reader) => { + const mod = viewZoneManager.read(reader).viewZones.read(reader).mod; + const mod2 = unchangedRangesFeature.read(reader).viewZones.read(reader).modViewZones; + return mod.concat(mod2); + }); + this._register(applyViewZones(this._editors.original, originalViewZones, (isUpdatingOrigViewZones) => { + isUpdatingViewZones = isUpdatingOrigViewZones; + }, origViewZoneIdsToIgnore)); + let scrollState; + this._register(applyViewZones(this._editors.modified, modifiedViewZones, (isUpdatingModViewZones) => { + isUpdatingViewZones = isUpdatingModViewZones; + if (isUpdatingViewZones) { + scrollState = StableEditorScrollState.capture(this._editors.modified); + } else { + scrollState?.restore(this._editors.modified); + scrollState = void 0; + } + }, modViewZoneIdsToIgnore)); + this._accessibleDiffViewer = derivedDisposable(this, (reader) => this._instantiationService.createInstance(readHotReloadableExport(AccessibleDiffViewer, reader), this.elements.accessibleDiffViewer, this._accessibleDiffViewerVisible, (visible, tx) => this._accessibleDiffViewerShouldBeVisible.set(visible, tx), this._options.onlyShowAccessibleDiffViewer.map((v) => !v), this._rootSizeObserver.width, this._rootSizeObserver.height, this._diffModel.map((m, r) => m?.diff.read(r)?.mappings.map((m2) => m2.lineRangeMapping)), new AccessibleDiffViewerModelFromEditors(this._editors))).recomputeInitiallyAndOnChange(this._store); + const visibility = this._accessibleDiffViewerVisible.map((v) => v ? "hidden" : "visible"); + this._register(applyStyle(this.elements.modified, { visibility })); + this._register(applyStyle(this.elements.original, { visibility })); + this._createDiffEditorContributions(); + this._codeEditorService.addDiffEditor(this); + this._register(toDisposable(() => { + this._codeEditorService.removeDiffEditor(this); + })); + this._gutter = derivedDisposable(this, (reader) => { + return this._options.shouldRenderGutterMenu.read(reader) ? this._instantiationService.createInstance(readHotReloadableExport(DiffEditorGutter, reader), this.elements.root, this._diffModel, this._editors, this._options, this._sashLayout, this._boundarySashes) : void 0; + }); + this._register(recomputeInitiallyAndOnChange(this._layoutInfo)); + derivedDisposable(this, (reader) => ( + /** @description MovedBlocksLinesPart */ + new (readHotReloadableExport(MovedBlocksLinesFeature, reader))(this.elements.root, this._diffModel, this._layoutInfo.map((i2) => i2.originalEditor), this._layoutInfo.map((i2) => i2.modifiedEditor), this._editors) + )).recomputeInitiallyAndOnChange(this._store, (value) => { + this._movedBlocksLinesPart.set(value, void 0); + }); + this._register(Event.runAndSubscribe(this._editors.modified.onDidChangeCursorPosition, (e) => this._handleCursorPositionChange(e, true))); + this._register(Event.runAndSubscribe(this._editors.original.onDidChangeCursorPosition, (e) => this._handleCursorPositionChange(e, false))); + const isInitializingDiff = this._diffModel.map(this, (m, reader) => { + if (!m) { + return void 0; + } + return m.diff.read(reader) === void 0 && !m.isDiffUpToDate.read(reader); + }); + this._register(autorunWithStore((reader, store) => { + if (isInitializingDiff.read(reader) === true) { + const r = this._editorProgressService.show(true, 1e3); + store.add(toDisposable(() => r.done())); + } + })); + this._register(autorunWithStore((reader, store) => { + store.add(new (readHotReloadableExport(RevertButtonsFeature, reader))(this._editors, this._diffModel, this._options, this)); + })); + this._register(autorunWithStore((reader, store) => { + const model = this._diffModel.read(reader); + if (!model) { + return; + } + for (const m of [model.model.original, model.model.modified]) { + store.add(m.onWillDispose((e) => { + onUnexpectedError(new BugIndicatingError("TextModel got disposed before DiffEditorWidget model got reset")); + this.setModel(null); + })); + } + })); + this._register(autorun((reader) => { + this._options.setModel(this._diffModel.read(reader)); + })); + } + _createInnerEditor(instantiationService, container, options2, editorWidgetOptions) { + const editor2 = instantiationService.createInstance(CodeEditorWidget, container, options2, editorWidgetOptions); + return editor2; + } + _createDiffEditorContributions() { + const contributions = EditorExtensionsRegistry.getDiffEditorContributions(); + for (const desc of contributions) { + try { + this._register(this._instantiationService.createInstance(desc.ctor, this)); + } catch (err) { + onUnexpectedError(err); + } + } + } + get _targetEditor() { + return this._editors.modified; + } + getEditorType() { + return EditorType.IDiffEditor; + } + layout(dimension) { + this._rootSizeObserver.observe(dimension); + } + hasTextFocus() { + return this._editors.original.hasTextFocus() || this._editors.modified.hasTextFocus(); + } + saveViewState() { + const originalViewState = this._editors.original.saveViewState(); + const modifiedViewState = this._editors.modified.saveViewState(); + return { + original: originalViewState, + modified: modifiedViewState, + modelState: this._diffModel.get()?.serializeState() + }; + } + restoreViewState(s) { + if (s && s.original && s.modified) { + const diffEditorState = s; + this._editors.original.restoreViewState(diffEditorState.original); + this._editors.modified.restoreViewState(diffEditorState.modified); + if (diffEditorState.modelState) { + this._diffModel.get()?.restoreSerializedState(diffEditorState.modelState); + } + } + } + handleInitialized() { + this._editors.original.handleInitialized(); + this._editors.modified.handleInitialized(); + } + createViewModel(model) { + return this._instantiationService.createInstance(DiffEditorViewModel, model, this._options); + } + getModel() { + return this._diffModel.get()?.model ?? null; + } + setModel(model) { + const vm = !model ? null : "model" in model ? RefCounted.create(model).createNewRef(this) : RefCounted.create(this.createViewModel(model), this); + this.setDiffModel(vm); + } + setDiffModel(viewModel, tx) { + const currentModel = this._diffModel.get(); + if (!viewModel && currentModel) { + this._accessibleDiffViewer.get().close(); + } + if (this._diffModel.get() !== viewModel?.object) { + subtransaction(tx, (tx2) => { + const vm = viewModel?.object; + observableFromEvent.batchEventsGlobally(tx2, () => { + this._editors.original.setModel(vm ? vm.model.original : null); + this._editors.modified.setModel(vm ? vm.model.modified : null); + }); + const prevValueRef = this._diffModelSrc.get()?.createNewRef(this); + this._diffModelSrc.set(viewModel?.createNewRef(this), tx2); + setTimeout(() => { + prevValueRef?.dispose(); + }, 0); + }); + } + } + /** + * @param changedOptions Only has values for top-level options that have actually changed. + */ + updateOptions(changedOptions) { + this._options.updateOptions(changedOptions); + } + getContainerDomNode() { + return this._domElement; + } + getOriginalEditor() { + return this._editors.original; + } + getModifiedEditor() { + return this._editors.modified; + } + /** + * @deprecated Use `this.getDiffComputationResult().changes2` instead. + */ + getLineChanges() { + const diffState = this._diffModel.get()?.diff.get(); + if (!diffState) { + return null; + } + return toLineChanges(diffState); + } + getDiffComputationResult() { + const diffState = this._diffModel.get()?.diff.get(); + if (!diffState) { + return null; + } + return { + changes: this.getLineChanges(), + changes2: diffState.mappings.map((m) => m.lineRangeMapping), + identical: diffState.identical, + quitEarly: diffState.quitEarly + }; + } + revert(diff) { + const model = this._diffModel.get(); + if (!model || !model.isDiffUpToDate.get()) { + return; + } + this._editors.modified.pushUndoStop(); + this._editors.modified.executeEdits("diffEditor", [ + { + range: diff.modified.toExclusiveRange(), + text: model.model.original.getValueInRange(diff.original.toExclusiveRange()) + } + ]); + this._editors.modified.pushUndoStop(); + } + revertRangeMappings(diffs) { + const model = this._diffModel.get(); + if (!model || !model.isDiffUpToDate.get()) { + return; + } + const changes = diffs.map((c) => ({ + range: c.modifiedRange, + text: model.model.original.getValueInRange(c.originalRange) + })); + this._editors.modified.pushUndoStop(); + this._editors.modified.executeEdits("diffEditor", changes); + this._editors.modified.pushUndoStop(); + } + revertFocusedRangeMappings() { + const model = this._diffModel.get(); + if (!model || !model.isDiffUpToDate.get()) { + return; + } + const diffs = this._diffModel.get()?.diff.get()?.mappings; + if (!diffs || diffs.length === 0) { + return; + } + const modifiedEditor = this._editors.modified; + if (!modifiedEditor.hasTextFocus()) { + return; + } + const curLineNumber = modifiedEditor.getPosition().lineNumber; + const selection = modifiedEditor.getSelection(); + const selectedRange = LineRange.fromRange(selection || new Range(curLineNumber, 0, curLineNumber, 0)); + const diffsToRevert = diffs.filter((d) => { + return d.lineRangeMapping.modified.intersect(selectedRange); + }); + modifiedEditor.pushUndoStop(); + modifiedEditor.executeEdits("diffEditor", diffsToRevert.map((d) => ({ + range: d.lineRangeMapping.modified.toExclusiveRange(), + text: model.model.original.getValueInRange(d.lineRangeMapping.original.toExclusiveRange()) + }))); + modifiedEditor.pushUndoStop(); + } + _goTo(diff) { + this._editors.modified.setPosition(new Position(diff.lineRangeMapping.modified.startLineNumber, 1)); + this._editors.modified.revealRangeInCenter(diff.lineRangeMapping.modified.toExclusiveRange()); + } + goToDiff(target) { + const diffs = this._diffModel.get()?.diff.get()?.mappings; + if (!diffs || diffs.length === 0) { + return; + } + const curLineNumber = this._editors.modified.getPosition().lineNumber; + let diff; + if (target === "next") { + const modifiedLineCount = this._editors.modified.getModel().getLineCount(); + if (modifiedLineCount === curLineNumber) { + diff = diffs[0]; + } else { + diff = diffs.find((d) => d.lineRangeMapping.modified.startLineNumber > curLineNumber) ?? diffs[0]; + } + } else { + diff = findLast(diffs, (d) => d.lineRangeMapping.modified.startLineNumber < curLineNumber) ?? diffs[diffs.length - 1]; + } + this._goTo(diff); + if (diff.lineRangeMapping.modified.isEmpty) { + this._accessibilitySignalService.playSignal(AccessibilitySignal.diffLineDeleted, { source: "diffEditor.goToDiff" }); + } else if (diff.lineRangeMapping.original.isEmpty) { + this._accessibilitySignalService.playSignal(AccessibilitySignal.diffLineInserted, { source: "diffEditor.goToDiff" }); + } else if (diff) { + this._accessibilitySignalService.playSignal(AccessibilitySignal.diffLineModified, { source: "diffEditor.goToDiff" }); + } + } + revealFirstDiff() { + const diffModel = this._diffModel.get(); + if (!diffModel) { + return; + } + this.waitForDiff().then(() => { + const diffs = diffModel.diff.get()?.mappings; + if (!diffs || diffs.length === 0) { + return; + } + this._goTo(diffs[0]); + }); + } + accessibleDiffViewerNext() { + this._accessibleDiffViewer.get().next(); + } + accessibleDiffViewerPrev() { + this._accessibleDiffViewer.get().prev(); + } + async waitForDiff() { + const diffModel = this._diffModel.get(); + if (!diffModel) { + return; + } + await diffModel.waitForDiff(); + } + mapToOtherSide() { + const isModifiedFocus = this._editors.modified.hasWidgetFocus(); + const source = isModifiedFocus ? this._editors.modified : this._editors.original; + const destination = isModifiedFocus ? this._editors.original : this._editors.modified; + let destinationSelection; + const sourceSelection = source.getSelection(); + if (sourceSelection) { + const mappings = this._diffModel.get()?.diff.get()?.mappings.map((m) => isModifiedFocus ? m.lineRangeMapping.flip() : m.lineRangeMapping); + if (mappings) { + const newRange1 = translatePosition(sourceSelection.getStartPosition(), mappings); + const newRange2 = translatePosition(sourceSelection.getEndPosition(), mappings); + destinationSelection = Range.plusRange(newRange1, newRange2); + } + } + return { destination, destinationSelection }; + } + switchSide() { + const { destination, destinationSelection } = this.mapToOtherSide(); + destination.focus(); + if (destinationSelection) { + destination.setSelection(destinationSelection); + } + } + exitCompareMove() { + const model = this._diffModel.get(); + if (!model) { + return; + } + model.movedTextToCompare.set(void 0, void 0); + } + collapseAllUnchangedRegions() { + const unchangedRegions = this._diffModel.get()?.unchangedRegions.get(); + if (!unchangedRegions) { + return; + } + transaction((tx) => { + for (const region of unchangedRegions) { + region.collapseAll(tx); + } + }); + } + showAllUnchangedRegions() { + const unchangedRegions = this._diffModel.get()?.unchangedRegions.get(); + if (!unchangedRegions) { + return; + } + transaction((tx) => { + for (const region of unchangedRegions) { + region.showAll(tx); + } + }); + } + _handleCursorPositionChange(e, isModifiedEditor) { + if (e?.reason === 3) { + const diff = this._diffModel.get()?.diff.get()?.mappings.find((m) => isModifiedEditor ? m.lineRangeMapping.modified.contains(e.position.lineNumber) : m.lineRangeMapping.original.contains(e.position.lineNumber)); + if (diff?.lineRangeMapping.modified.isEmpty) { + this._accessibilitySignalService.playSignal(AccessibilitySignal.diffLineDeleted, { source: "diffEditor.cursorPositionChanged" }); + } else if (diff?.lineRangeMapping.original.isEmpty) { + this._accessibilitySignalService.playSignal(AccessibilitySignal.diffLineInserted, { source: "diffEditor.cursorPositionChanged" }); + } else if (diff) { + this._accessibilitySignalService.playSignal(AccessibilitySignal.diffLineModified, { source: "diffEditor.cursorPositionChanged" }); + } + } + } +}; +DiffEditorWidget = __decorate43([ + __param38(3, IContextKeyService), + __param38(4, IInstantiationService), + __param38(5, ICodeEditorService), + __param38(6, IAccessibilitySignalService), + __param38(7, IEditorProgressService) +], DiffEditorWidget); +function toLineChanges(state) { + return state.mappings.map((x) => { + const m = x.lineRangeMapping; + let originalStartLineNumber; + let originalEndLineNumber; + let modifiedStartLineNumber; + let modifiedEndLineNumber; + let innerChanges = m.innerChanges; + if (m.original.isEmpty) { + originalStartLineNumber = m.original.startLineNumber - 1; + originalEndLineNumber = 0; + innerChanges = void 0; + } else { + originalStartLineNumber = m.original.startLineNumber; + originalEndLineNumber = m.original.endLineNumberExclusive - 1; + } + if (m.modified.isEmpty) { + modifiedStartLineNumber = m.modified.startLineNumber - 1; + modifiedEndLineNumber = 0; + innerChanges = void 0; + } else { + modifiedStartLineNumber = m.modified.startLineNumber; + modifiedEndLineNumber = m.modified.endLineNumberExclusive - 1; + } + return { + originalStartLineNumber, + originalEndLineNumber, + modifiedStartLineNumber, + modifiedEndLineNumber, + charChanges: innerChanges?.map((m2) => ({ + originalStartLineNumber: m2.originalRange.startLineNumber, + originalStartColumn: m2.originalRange.startColumn, + originalEndLineNumber: m2.originalRange.endLineNumber, + originalEndColumn: m2.originalRange.endColumn, + modifiedStartLineNumber: m2.modifiedRange.startLineNumber, + modifiedStartColumn: m2.modifiedRange.startColumn, + modifiedEndLineNumber: m2.modifiedRange.endLineNumber, + modifiedEndColumn: m2.modifiedRange.endColumn + })) + }; + }); +} + +// node_modules/monaco-editor-core/esm/vs/editor/browser/widget/diffEditor/commands.js +init_editorContextKeys(); +init_nls(); +init_actions2(); +init_configuration(); +init_contextkey(); +var ToggleCollapseUnchangedRegions = class extends Action2 { + constructor() { + super({ + id: "diffEditor.toggleCollapseUnchangedRegions", + title: localize2(85, "Toggle Collapse Unchanged Regions"), + icon: Codicon.map, + toggled: ContextKeyExpr.has("config.diffEditor.hideUnchangedRegions.enabled"), + precondition: ContextKeyExpr.has("isInDiffEditor"), + menu: { + when: ContextKeyExpr.has("isInDiffEditor"), + id: MenuId.EditorTitle, + order: 22, + group: "navigation" + } + }); + } + run(accessor, ...args) { + const configurationService = accessor.get(IConfigurationService); + const newValue = !configurationService.getValue("diffEditor.hideUnchangedRegions.enabled"); + configurationService.updateValue("diffEditor.hideUnchangedRegions.enabled", newValue); + } +}; +var ToggleShowMovedCodeBlocks = class extends Action2 { + constructor() { + super({ + id: "diffEditor.toggleShowMovedCodeBlocks", + title: localize2(86, "Toggle Show Moved Code Blocks"), + precondition: ContextKeyExpr.has("isInDiffEditor") + }); + } + run(accessor, ...args) { + const configurationService = accessor.get(IConfigurationService); + const newValue = !configurationService.getValue("diffEditor.experimental.showMoves"); + configurationService.updateValue("diffEditor.experimental.showMoves", newValue); + } +}; +var ToggleUseInlineViewWhenSpaceIsLimited = class extends Action2 { + constructor() { + super({ + id: "diffEditor.toggleUseInlineViewWhenSpaceIsLimited", + title: localize2(87, "Toggle Use Inline View When Space Is Limited"), + precondition: ContextKeyExpr.has("isInDiffEditor") + }); + } + run(accessor, ...args) { + const configurationService = accessor.get(IConfigurationService); + const newValue = !configurationService.getValue("diffEditor.useInlineViewWhenSpaceIsLimited"); + configurationService.updateValue("diffEditor.useInlineViewWhenSpaceIsLimited", newValue); + } +}; +var diffEditorCategory = localize2(88, "Diff Editor"); +var SwitchSide = class extends EditorAction2 { + constructor() { + super({ + id: "diffEditor.switchSide", + title: localize2(89, "Switch Side"), + icon: Codicon.arrowSwap, + precondition: ContextKeyExpr.has("isInDiffEditor"), + f1: true, + category: diffEditorCategory + }); + } + runEditorCommand(accessor, editor2, arg) { + const diffEditor = findFocusedDiffEditor(accessor); + if (diffEditor instanceof DiffEditorWidget) { + if (arg && arg.dryRun) { + return { destinationSelection: diffEditor.mapToOtherSide().destinationSelection }; + } else { + diffEditor.switchSide(); + } + } + return void 0; + } +}; +var ExitCompareMove = class extends EditorAction2 { + constructor() { + super({ + id: "diffEditor.exitCompareMove", + title: localize2(90, "Exit Compare Move"), + icon: Codicon.close, + precondition: EditorContextKeys.comparingMovedCode, + f1: false, + category: diffEditorCategory, + keybinding: { + weight: 1e4, + primary: 9 + } + }); + } + runEditorCommand(accessor, editor2, ...args) { + const diffEditor = findFocusedDiffEditor(accessor); + if (diffEditor instanceof DiffEditorWidget) { + diffEditor.exitCompareMove(); + } + } +}; +var CollapseAllUnchangedRegions = class extends EditorAction2 { + constructor() { + super({ + id: "diffEditor.collapseAllUnchangedRegions", + title: localize2(91, "Collapse All Unchanged Regions"), + icon: Codicon.fold, + precondition: ContextKeyExpr.has("isInDiffEditor"), + f1: true, + category: diffEditorCategory + }); + } + runEditorCommand(accessor, editor2, ...args) { + const diffEditor = findFocusedDiffEditor(accessor); + if (diffEditor instanceof DiffEditorWidget) { + diffEditor.collapseAllUnchangedRegions(); + } + } +}; +var ShowAllUnchangedRegions = class extends EditorAction2 { + constructor() { + super({ + id: "diffEditor.showAllUnchangedRegions", + title: localize2(92, "Show All Unchanged Regions"), + icon: Codicon.unfold, + precondition: ContextKeyExpr.has("isInDiffEditor"), + f1: true, + category: diffEditorCategory + }); + } + runEditorCommand(accessor, editor2, ...args) { + const diffEditor = findFocusedDiffEditor(accessor); + if (diffEditor instanceof DiffEditorWidget) { + diffEditor.showAllUnchangedRegions(); + } + } +}; +var RevertHunkOrSelection = class extends Action2 { + constructor() { + super({ + id: "diffEditor.revert", + title: localize2(93, "Revert"), + f1: true, + category: diffEditorCategory, + precondition: ContextKeyExpr.has("isInDiffEditor") + }); + } + run(accessor, arg) { + return arg ? this.runViaToolbarContext(accessor, arg) : this.runViaCursorOrSelection(accessor); + } + runViaCursorOrSelection(accessor) { + const diffEditor = findFocusedDiffEditor(accessor); + if (diffEditor instanceof DiffEditorWidget) { + diffEditor.revertFocusedRangeMappings(); + } + return void 0; + } + runViaToolbarContext(accessor, arg) { + const diffEditor = findDiffEditor(accessor, arg.originalUri, arg.modifiedUri); + if (diffEditor instanceof DiffEditorWidget) { + diffEditor.revertRangeMappings(arg.mapping.innerChanges ?? []); + } + return void 0; + } +}; +var accessibleDiffViewerCategory = localize2(94, "Accessible Diff Viewer"); +var AccessibleDiffViewerNext = class _AccessibleDiffViewerNext extends Action2 { + static { + this.id = "editor.action.accessibleDiffViewer.next"; + } + constructor() { + super({ + id: _AccessibleDiffViewerNext.id, + title: localize2(95, "Go to Next Difference"), + category: accessibleDiffViewerCategory, + precondition: ContextKeyExpr.has("isInDiffEditor"), + keybinding: { + primary: 65, + weight: 100 + /* KeybindingWeight.EditorContrib */ + }, + f1: true + }); + } + run(accessor) { + const diffEditor = findFocusedDiffEditor(accessor); + diffEditor?.accessibleDiffViewerNext(); + } +}; +var AccessibleDiffViewerPrev = class _AccessibleDiffViewerPrev extends Action2 { + static { + this.id = "editor.action.accessibleDiffViewer.prev"; + } + constructor() { + super({ + id: _AccessibleDiffViewerPrev.id, + title: localize2(96, "Go to Previous Difference"), + category: accessibleDiffViewerCategory, + precondition: ContextKeyExpr.has("isInDiffEditor"), + keybinding: { + primary: 1024 | 65, + weight: 100 + /* KeybindingWeight.EditorContrib */ + }, + f1: true + }); + } + run(accessor) { + const diffEditor = findFocusedDiffEditor(accessor); + diffEditor?.accessibleDiffViewerPrev(); + } +}; +function findDiffEditor(accessor, originalUri, modifiedUri) { + const codeEditorService = accessor.get(ICodeEditorService); + const diffEditors = codeEditorService.listDiffEditors(); + return diffEditors.find((diffEditor) => { + const modified = diffEditor.getModifiedEditor(); + const original = diffEditor.getOriginalEditor(); + return modified && modified.getModel()?.uri.toString() === modifiedUri.toString() && original && original.getModel()?.uri.toString() === originalUri.toString(); + }) || null; +} +function findFocusedDiffEditor(accessor) { + const codeEditorService = accessor.get(ICodeEditorService); + const diffEditors = codeEditorService.listDiffEditors(); + const activeElement = getActiveElement(); + if (activeElement) { + for (const d of diffEditors) { + const container = d.getContainerDomNode(); + if (container.contains(activeElement)) { + return d; + } + } + } + return null; +} + +// node_modules/monaco-editor-core/esm/vs/editor/browser/widget/diffEditor/diffEditor.contribution.js +init_editorContextKeys(); +init_nls(); +init_actions2(); +init_commands(); +init_contextkey(); +registerAction2(ToggleCollapseUnchangedRegions); +registerAction2(ToggleShowMovedCodeBlocks); +registerAction2(ToggleUseInlineViewWhenSpaceIsLimited); +MenuRegistry.appendMenuItem(MenuId.EditorTitle, { + command: { + id: new ToggleUseInlineViewWhenSpaceIsLimited().desc.id, + title: localize(119, "Use Inline View When Space Is Limited"), + toggled: ContextKeyExpr.has("config.diffEditor.useInlineViewWhenSpaceIsLimited"), + precondition: ContextKeyExpr.has("isInDiffEditor") + }, + order: 11, + group: "1_diff", + when: ContextKeyExpr.and(EditorContextKeys.diffEditorRenderSideBySideInlineBreakpointReached, ContextKeyExpr.has("isInDiffEditor")) +}); +MenuRegistry.appendMenuItem(MenuId.EditorTitle, { + command: { + id: new ToggleShowMovedCodeBlocks().desc.id, + title: localize(120, "Show Moved Code Blocks"), + icon: Codicon.move, + toggled: ContextKeyEqualsExpr.create("config.diffEditor.experimental.showMoves", true), + precondition: ContextKeyExpr.has("isInDiffEditor") + }, + order: 10, + group: "1_diff", + when: ContextKeyExpr.has("isInDiffEditor") +}); +registerAction2(RevertHunkOrSelection); +for (const ctx of [ + { icon: Codicon.arrowRight, key: EditorContextKeys.diffEditorInlineMode.toNegated() }, + { icon: Codicon.discard, key: EditorContextKeys.diffEditorInlineMode } +]) { + MenuRegistry.appendMenuItem(MenuId.DiffEditorHunkToolbar, { + command: { + id: new RevertHunkOrSelection().desc.id, + title: localize(121, "Revert Block"), + icon: ctx.icon + }, + when: ContextKeyExpr.and(EditorContextKeys.diffEditorModifiedWritable, ctx.key), + order: 5, + group: "primary" + }); + MenuRegistry.appendMenuItem(MenuId.DiffEditorSelectionToolbar, { + command: { + id: new RevertHunkOrSelection().desc.id, + title: localize(122, "Revert Selection"), + icon: ctx.icon + }, + when: ContextKeyExpr.and(EditorContextKeys.diffEditorModifiedWritable, ctx.key), + order: 5, + group: "primary" + }); +} +registerAction2(SwitchSide); +registerAction2(ExitCompareMove); +registerAction2(CollapseAllUnchangedRegions); +registerAction2(ShowAllUnchangedRegions); +MenuRegistry.appendMenuItem(MenuId.EditorTitle, { + command: { + id: AccessibleDiffViewerNext.id, + title: localize(123, "Open Accessible Diff Viewer"), + precondition: ContextKeyExpr.has("isInDiffEditor") + }, + order: 10, + group: "2_diff", + when: ContextKeyExpr.and(EditorContextKeys.accessibleDiffViewerVisible.negate(), ContextKeyExpr.has("isInDiffEditor")) +}); +CommandsRegistry.registerCommandAlias("editor.action.diffReview.next", AccessibleDiffViewerNext.id); +registerAction2(AccessibleDiffViewerNext); +CommandsRegistry.registerCommandAlias("editor.action.diffReview.prev", AccessibleDiffViewerPrev.id); +registerAction2(AccessibleDiffViewerPrev); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/anchorSelect/browser/anchorSelect.js +init_htmlContent(); +init_keyCodes(); +init_editorExtensions(); +init_selection(); +init_editorContextKeys(); +init_nls(); +init_contextkey(); +var __decorate44 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param39 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var SelectionAnchorController_1; +var SelectionAnchorSet = new RawContextKey("selectionAnchorSet", false); +var SelectionAnchorController = class SelectionAnchorController2 { + static { + SelectionAnchorController_1 = this; + } + static { + this.ID = "editor.contrib.selectionAnchorController"; + } + static get(editor2) { + return editor2.getContribution(SelectionAnchorController_1.ID); + } + constructor(editor2, contextKeyService) { + this.editor = editor2; + this.selectionAnchorSetContextKey = SelectionAnchorSet.bindTo(contextKeyService); + this.modelChangeListener = editor2.onDidChangeModel(() => this.selectionAnchorSetContextKey.reset()); + } + setSelectionAnchor() { + if (this.editor.hasModel()) { + const position = this.editor.getPosition(); + this.editor.changeDecorations((accessor) => { + if (this.decorationId) { + accessor.removeDecoration(this.decorationId); + } + this.decorationId = accessor.addDecoration(Selection.fromPositions(position, position), { + description: "selection-anchor", + stickiness: 1, + hoverMessage: new MarkdownString().appendText(localize(798, "Selection Anchor")), + className: "selection-anchor" + }); + }); + this.selectionAnchorSetContextKey.set(!!this.decorationId); + alert(localize(799, "Anchor set at {0}:{1}", position.lineNumber, position.column)); + } + } + goToSelectionAnchor() { + if (this.editor.hasModel() && this.decorationId) { + const anchorPosition = this.editor.getModel().getDecorationRange(this.decorationId); + if (anchorPosition) { + this.editor.setPosition(anchorPosition.getStartPosition()); + } + } + } + selectFromAnchorToCursor() { + if (this.editor.hasModel() && this.decorationId) { + const start = this.editor.getModel().getDecorationRange(this.decorationId); + if (start) { + const end = this.editor.getPosition(); + this.editor.setSelection(Selection.fromPositions(start.getStartPosition(), end)); + this.cancelSelectionAnchor(); + } + } + } + cancelSelectionAnchor() { + if (this.decorationId) { + const decorationId = this.decorationId; + this.editor.changeDecorations((accessor) => { + accessor.removeDecoration(decorationId); + this.decorationId = void 0; + }); + this.selectionAnchorSetContextKey.set(false); + } + } + dispose() { + this.cancelSelectionAnchor(); + this.modelChangeListener.dispose(); + } +}; +SelectionAnchorController = SelectionAnchorController_1 = __decorate44([ + __param39(1, IContextKeyService) +], SelectionAnchorController); +var SetSelectionAnchor = class extends EditorAction { + constructor() { + super({ + id: "editor.action.setSelectionAnchor", + label: localize2(800, "Set Selection Anchor"), + precondition: void 0, + kbOpts: { + kbExpr: EditorContextKeys.editorTextFocus, + primary: KeyChord( + 2048 | 41, + 2048 | 32 + /* KeyCode.KeyB */ + ), + weight: 100 + /* KeybindingWeight.EditorContrib */ + } + }); + } + async run(_accessor, editor2) { + SelectionAnchorController.get(editor2)?.setSelectionAnchor(); + } +}; +var GoToSelectionAnchor = class extends EditorAction { + constructor() { + super({ + id: "editor.action.goToSelectionAnchor", + label: localize2(801, "Go to Selection Anchor"), + precondition: SelectionAnchorSet + }); + } + async run(_accessor, editor2) { + SelectionAnchorController.get(editor2)?.goToSelectionAnchor(); + } +}; +var SelectFromAnchorToCursor = class extends EditorAction { + constructor() { + super({ + id: "editor.action.selectFromAnchorToCursor", + label: localize2(802, "Select from Anchor to Cursor"), + precondition: SelectionAnchorSet, + kbOpts: { + kbExpr: EditorContextKeys.editorTextFocus, + primary: KeyChord( + 2048 | 41, + 2048 | 41 + /* KeyCode.KeyK */ + ), + weight: 100 + /* KeybindingWeight.EditorContrib */ + } + }); + } + async run(_accessor, editor2) { + SelectionAnchorController.get(editor2)?.selectFromAnchorToCursor(); + } +}; +var CancelSelectionAnchor = class extends EditorAction { + constructor() { + super({ + id: "editor.action.cancelSelectionAnchor", + label: localize2(803, "Cancel Selection Anchor"), + precondition: SelectionAnchorSet, + kbOpts: { + kbExpr: EditorContextKeys.editorTextFocus, + primary: 9, + weight: 100 + /* KeybindingWeight.EditorContrib */ + } + }); + } + async run(_accessor, editor2) { + SelectionAnchorController.get(editor2)?.cancelSelectionAnchor(); + } +}; +registerEditorContribution( + SelectionAnchorController.ID, + SelectionAnchorController, + 4 + /* EditorContributionInstantiation.Lazy */ +); +registerEditorAction(SetSelectionAnchor); +registerEditorAction(GoToSelectionAnchor); +registerEditorAction(SelectFromAnchorToCursor); +registerEditorAction(CancelSelectionAnchor); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/bracketMatching/browser/bracketMatching.js +init_async(); +init_lifecycle(); +init_editorExtensions(); +init_position(); +init_range(); +init_selection(); +init_editorContextKeys(); +init_model2(); +init_textModel(); +init_nls(); +init_actions2(); +init_colorRegistry(); +init_themeService(); +var overviewRulerBracketMatchForeground = registerColor("editorOverviewRuler.bracketMatchForeground", "#A0A0A0", localize(804, "Overview ruler marker color for matching brackets.")); +var JumpToBracketAction = class extends EditorAction { + constructor() { + super({ + id: "editor.action.jumpToBracket", + label: localize2(806, "Go to Bracket"), + precondition: void 0, + kbOpts: { + kbExpr: EditorContextKeys.editorTextFocus, + primary: 2048 | 1024 | 93, + weight: 100 + /* KeybindingWeight.EditorContrib */ + } + }); + } + run(accessor, editor2) { + BracketMatchingController.get(editor2)?.jumpToBracket(); + } +}; +var SelectToBracketAction = class extends EditorAction { + constructor() { + super({ + id: "editor.action.selectToBracket", + label: localize2(807, "Select to Bracket"), + precondition: void 0, + metadata: { + description: localize2(808, "Select the text inside and including the brackets or curly braces"), + args: [{ + name: "args", + schema: { + type: "object", + properties: { + "selectBrackets": { + type: "boolean", + default: true + } + } + } + }] + } + }); + } + run(accessor, editor2, args) { + let selectBrackets = true; + if (args && args.selectBrackets === false) { + selectBrackets = false; + } + BracketMatchingController.get(editor2)?.selectToBracket(selectBrackets); + } +}; +var RemoveBracketsAction = class extends EditorAction { + constructor() { + super({ + id: "editor.action.removeBrackets", + label: localize2(809, "Remove Brackets"), + precondition: void 0, + kbOpts: { + kbExpr: EditorContextKeys.editorTextFocus, + primary: 2048 | 512 | 1, + weight: 100 + /* KeybindingWeight.EditorContrib */ + }, + canTriggerInlineEdits: true + }); + } + run(accessor, editor2) { + BracketMatchingController.get(editor2)?.removeBrackets(this.id); + } +}; +var BracketsData = class { + constructor(position, brackets, options2) { + this.position = position; + this.brackets = brackets; + this.options = options2; + } +}; +var BracketMatchingController = class _BracketMatchingController extends Disposable { + static { + this.ID = "editor.contrib.bracketMatchingController"; + } + static get(editor2) { + return editor2.getContribution(_BracketMatchingController.ID); + } + constructor(editor2) { + super(); + this._editor = editor2; + this._lastBracketsData = []; + this._lastVersionId = 0; + this._decorations = this._editor.createDecorationsCollection(); + this._updateBracketsSoon = this._register(new RunOnceScheduler(() => this._updateBrackets(), 50)); + this._matchBrackets = this._editor.getOption( + 80 + /* EditorOption.matchBrackets */ + ); + this._updateBracketsSoon.schedule(); + this._register(editor2.onDidChangeCursorPosition((e) => { + if (this._matchBrackets === "never") { + return; + } + this._updateBracketsSoon.schedule(); + })); + this._register(editor2.onDidChangeModelContent((e) => { + this._updateBracketsSoon.schedule(); + })); + this._register(editor2.onDidChangeModel((e) => { + this._lastBracketsData = []; + this._updateBracketsSoon.schedule(); + })); + this._register(editor2.onDidChangeModelLanguageConfiguration((e) => { + this._lastBracketsData = []; + this._updateBracketsSoon.schedule(); + })); + this._register(editor2.onDidChangeConfiguration((e) => { + if (e.hasChanged( + 80 + /* EditorOption.matchBrackets */ + )) { + this._matchBrackets = this._editor.getOption( + 80 + /* EditorOption.matchBrackets */ + ); + this._decorations.clear(); + this._lastBracketsData = []; + this._lastVersionId = 0; + this._updateBracketsSoon.schedule(); + } + })); + this._register(editor2.onDidBlurEditorWidget(() => { + this._updateBracketsSoon.schedule(); + })); + this._register(editor2.onDidFocusEditorWidget(() => { + this._updateBracketsSoon.schedule(); + })); + } + jumpToBracket() { + if (!this._editor.hasModel()) { + return; + } + const model = this._editor.getModel(); + const newSelections = this._editor.getSelections().map((selection) => { + const position = selection.getStartPosition(); + const brackets = model.bracketPairs.matchBracket(position); + let newCursorPosition = null; + if (brackets) { + if (brackets[0].containsPosition(position) && !brackets[1].containsPosition(position)) { + newCursorPosition = brackets[1].getStartPosition(); + } else if (brackets[1].containsPosition(position)) { + newCursorPosition = brackets[0].getStartPosition(); + } + } else { + const enclosingBrackets = model.bracketPairs.findEnclosingBrackets(position); + if (enclosingBrackets) { + newCursorPosition = enclosingBrackets[1].getStartPosition(); + } else { + const nextBracket = model.bracketPairs.findNextBracket(position); + if (nextBracket && nextBracket.range) { + newCursorPosition = nextBracket.range.getStartPosition(); + } + } + } + if (newCursorPosition) { + return new Selection(newCursorPosition.lineNumber, newCursorPosition.column, newCursorPosition.lineNumber, newCursorPosition.column); + } + return new Selection(position.lineNumber, position.column, position.lineNumber, position.column); + }); + this._editor.setSelections(newSelections); + this._editor.revealRange(newSelections[0]); + } + selectToBracket(selectBrackets) { + if (!this._editor.hasModel()) { + return; + } + const model = this._editor.getModel(); + const newSelections = []; + this._editor.getSelections().forEach((selection) => { + const position = selection.getStartPosition(); + let brackets = model.bracketPairs.matchBracket(position); + if (!brackets) { + brackets = model.bracketPairs.findEnclosingBrackets(position); + if (!brackets) { + const nextBracket = model.bracketPairs.findNextBracket(position); + if (nextBracket && nextBracket.range) { + brackets = model.bracketPairs.matchBracket(nextBracket.range.getStartPosition()); + } + } + } + let selectFrom = null; + let selectTo = null; + if (brackets) { + brackets.sort(Range.compareRangesUsingStarts); + const [open, close] = brackets; + selectFrom = selectBrackets ? open.getStartPosition() : open.getEndPosition(); + selectTo = selectBrackets ? close.getEndPosition() : close.getStartPosition(); + if (close.containsPosition(position)) { + const tmp = selectFrom; + selectFrom = selectTo; + selectTo = tmp; + } + } + if (selectFrom && selectTo) { + newSelections.push(new Selection(selectFrom.lineNumber, selectFrom.column, selectTo.lineNumber, selectTo.column)); + } + }); + if (newSelections.length > 0) { + this._editor.setSelections(newSelections); + this._editor.revealRange(newSelections[0]); + } + } + removeBrackets(editSource) { + if (!this._editor.hasModel()) { + return; + } + const model = this._editor.getModel(); + this._editor.getSelections().forEach((selection) => { + const position = selection.getPosition(); + let brackets = model.bracketPairs.matchBracket(position); + if (!brackets) { + brackets = model.bracketPairs.findEnclosingBrackets(position); + } + if (brackets) { + this._editor.pushUndoStop(); + this._editor.executeEdits(editSource, [ + { range: brackets[0], text: "" }, + { range: brackets[1], text: "" } + ]); + this._editor.pushUndoStop(); + } + }); + } + static { + this._DECORATION_OPTIONS_WITH_OVERVIEW_RULER = ModelDecorationOptions.register({ + description: "bracket-match-overview", + stickiness: 1, + className: "bracket-match", + overviewRuler: { + color: themeColorFromId(overviewRulerBracketMatchForeground), + position: OverviewRulerLane.Center + } + }); + } + static { + this._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER = ModelDecorationOptions.register({ + description: "bracket-match-no-overview", + stickiness: 1, + className: "bracket-match" + }); + } + _updateBrackets() { + if (this._matchBrackets === "never") { + return; + } + this._recomputeBrackets(); + const newDecorations = []; + let newDecorationsLen = 0; + for (const bracketData of this._lastBracketsData) { + const brackets = bracketData.brackets; + if (brackets) { + newDecorations[newDecorationsLen++] = { range: brackets[0], options: bracketData.options }; + newDecorations[newDecorationsLen++] = { range: brackets[1], options: bracketData.options }; + } + } + this._decorations.set(newDecorations); + } + _recomputeBrackets() { + if (!this._editor.hasModel() || !this._editor.hasWidgetFocus()) { + this._lastBracketsData = []; + this._lastVersionId = 0; + return; + } + const selections = this._editor.getSelections(); + if (selections.length > 100) { + this._lastBracketsData = []; + this._lastVersionId = 0; + return; + } + const model = this._editor.getModel(); + const versionId = model.getVersionId(); + let previousData = []; + if (this._lastVersionId === versionId) { + previousData = this._lastBracketsData; + } + const positions = []; + let positionsLen = 0; + for (let i2 = 0, len = selections.length; i2 < len; i2++) { + const selection = selections[i2]; + if (selection.isEmpty()) { + positions[positionsLen++] = selection.getStartPosition(); + } + } + if (positions.length > 1) { + positions.sort(Position.compare); + } + const newData = []; + let newDataLen = 0; + let previousIndex = 0; + const previousLen = previousData.length; + for (let i2 = 0, len = positions.length; i2 < len; i2++) { + const position = positions[i2]; + while (previousIndex < previousLen && previousData[previousIndex].position.isBefore(position)) { + previousIndex++; + } + if (previousIndex < previousLen && previousData[previousIndex].position.equals(position)) { + newData[newDataLen++] = previousData[previousIndex]; + } else { + let brackets = model.bracketPairs.matchBracket( + position, + 20 + /* give at most 20ms to compute */ + ); + let options2 = _BracketMatchingController._DECORATION_OPTIONS_WITH_OVERVIEW_RULER; + if (!brackets && this._matchBrackets === "always") { + brackets = model.bracketPairs.findEnclosingBrackets( + position, + 20 + /* give at most 20ms to compute */ + ); + options2 = _BracketMatchingController._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER; + } + newData[newDataLen++] = new BracketsData(position, brackets, options2); + } + } + this._lastBracketsData = newData; + this._lastVersionId = versionId; + } +}; +registerEditorContribution( + BracketMatchingController.ID, + BracketMatchingController, + 1 + /* EditorContributionInstantiation.AfterFirstRender */ +); +registerEditorAction(SelectToBracketAction); +registerEditorAction(JumpToBracketAction); +registerEditorAction(RemoveBracketsAction); +MenuRegistry.appendMenuItem(MenuId.MenubarGoMenu, { + group: "5_infile_nav", + command: { + id: "editor.action.jumpToBracket", + title: localize(805, "Go to &&Bracket") + }, + order: 2 +}); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/caretOperations/browser/caretOperations.js +init_editorExtensions(); +init_editorContextKeys(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/caretOperations/browser/moveCaretCommand.js +init_range(); +init_selection(); +var MoveCaretCommand = class { + constructor(selection, isMovingLeft) { + this._selection = selection; + this._isMovingLeft = isMovingLeft; + } + getEditOperations(model, builder) { + if (this._selection.startLineNumber !== this._selection.endLineNumber || this._selection.isEmpty()) { + return; + } + const lineNumber = this._selection.startLineNumber; + const startColumn = this._selection.startColumn; + const endColumn = this._selection.endColumn; + if (this._isMovingLeft && startColumn === 1) { + return; + } + if (!this._isMovingLeft && endColumn === model.getLineMaxColumn(lineNumber)) { + return; + } + if (this._isMovingLeft) { + const rangeBefore = new Range(lineNumber, startColumn - 1, lineNumber, startColumn); + const charBefore = model.getValueInRange(rangeBefore); + builder.addEditOperation(rangeBefore, null); + builder.addEditOperation(new Range(lineNumber, endColumn, lineNumber, endColumn), charBefore); + } else { + const rangeAfter = new Range(lineNumber, endColumn, lineNumber, endColumn + 1); + const charAfter = model.getValueInRange(rangeAfter); + builder.addEditOperation(rangeAfter, null); + builder.addEditOperation(new Range(lineNumber, startColumn, lineNumber, startColumn), charAfter); + } + } + computeCursorState(model, helper) { + if (this._isMovingLeft) { + return new Selection(this._selection.startLineNumber, this._selection.startColumn - 1, this._selection.endLineNumber, this._selection.endColumn - 1); + } else { + return new Selection(this._selection.startLineNumber, this._selection.startColumn + 1, this._selection.endLineNumber, this._selection.endColumn + 1); + } + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/caretOperations/browser/caretOperations.js +init_nls(); +var MoveCaretAction = class extends EditorAction { + constructor(left, opts) { + super(opts); + this.left = left; + } + run(accessor, editor2) { + if (!editor2.hasModel()) { + return; + } + const commands = []; + const selections = editor2.getSelections(); + for (const selection of selections) { + commands.push(new MoveCaretCommand(selection, this.left)); + } + editor2.pushUndoStop(); + editor2.executeCommands(this.id, commands); + editor2.pushUndoStop(); + } +}; +var MoveCaretLeftAction = class extends MoveCaretAction { + constructor() { + super(true, { + id: "editor.action.moveCarretLeftAction", + label: localize2(810, "Move Selected Text Left"), + precondition: EditorContextKeys.writable + }); + } +}; +var MoveCaretRightAction = class extends MoveCaretAction { + constructor() { + super(false, { + id: "editor.action.moveCarretRightAction", + label: localize2(811, "Move Selected Text Right"), + precondition: EditorContextKeys.writable + }); + } +}; +registerEditorAction(MoveCaretLeftAction); +registerEditorAction(MoveCaretRightAction); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/caretOperations/browser/transpose.js +init_editorExtensions(); +init_range(); +init_editorContextKeys(); +init_nls(); +var TransposeLettersAction = class extends EditorAction { + constructor() { + super({ + id: "editor.action.transposeLetters", + label: localize2(812, "Transpose Letters"), + precondition: EditorContextKeys.writable, + kbOpts: { + kbExpr: EditorContextKeys.textInputFocus, + primary: 0, + mac: { + primary: 256 | 50 + /* KeyCode.KeyT */ + }, + weight: 100 + /* KeybindingWeight.EditorContrib */ + } + }); + } + run(accessor, editor2) { + if (!editor2.hasModel()) { + return; + } + const model = editor2.getModel(); + const commands = []; + const selections = editor2.getSelections(); + for (const selection of selections) { + if (!selection.isEmpty()) { + continue; + } + const lineNumber = selection.startLineNumber; + const column = selection.startColumn; + const lastColumn = model.getLineMaxColumn(lineNumber); + if (lineNumber === 1 && (column === 1 || column === 2 && lastColumn === 2)) { + continue; + } + const endPosition = column === lastColumn ? selection.getPosition() : MoveOperations.rightPosition(model, selection.getPosition().lineNumber, selection.getPosition().column); + const middlePosition = MoveOperations.leftPosition(model, endPosition); + const beginPosition = MoveOperations.leftPosition(model, middlePosition); + const leftChar = model.getValueInRange(Range.fromPositions(beginPosition, middlePosition)); + const rightChar = model.getValueInRange(Range.fromPositions(middlePosition, endPosition)); + const replaceRange = Range.fromPositions(beginPosition, endPosition); + commands.push(new ReplaceCommand(replaceRange, rightChar + leftChar)); + } + if (commands.length > 0) { + editor2.pushUndoStop(); + editor2.executeCommands(this.id, commands); + editor2.pushUndoStop(); + } + } +}; +registerEditorAction(TransposeLettersAction); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/clipboard/browser/clipboard.js +init_browser(); +init_dom(); +init_platform(); +init_nls(); +init_actions2(); +init_contextkey(); +init_log(); +init_editorExtensions(); +init_codeEditorService(); +init_editorContextKeys(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.js +init_dom(); +init_arrays(); +init_async(); +init_cancellation(); + +// node_modules/monaco-editor-core/esm/vs/base/common/dataTransfer.js +init_arrays(); +init_iterator(); +init_uuid(); +function createStringDataTransferItem(stringOrPromise, id) { + return { + id, + asString: async () => stringOrPromise, + asFile: () => void 0, + value: typeof stringOrPromise === "string" ? stringOrPromise : void 0 + }; +} +function createFileDataTransferItem(fileName, uri, data, id) { + const file = { id: generateUuid(), name: fileName, uri, data }; + return { + id, + asString: async () => "", + asFile: () => file, + value: void 0 + }; +} +var VSDataTransfer = class { + constructor() { + this._entries = /* @__PURE__ */ new Map(); + } + get size() { + let size2 = 0; + for (const _ of this._entries) { + size2++; + } + return size2; + } + has(mimeType) { + return this._entries.has(this.toKey(mimeType)); + } + matches(pattern) { + const mimes = [...this._entries.keys()]; + if (Iterable.some(this, ([_, item]) => item.asFile())) { + mimes.push("files"); + } + return matchesMimeType_normalized(normalizeMimeType(pattern), mimes); + } + get(mimeType) { + return this._entries.get(this.toKey(mimeType))?.[0]; + } + /** + * Add a new entry to this data transfer. + * + * This does not replace existing entries for `mimeType`. + */ + append(mimeType, value) { + const existing = this._entries.get(mimeType); + if (existing) { + existing.push(value); + } else { + this._entries.set(this.toKey(mimeType), [value]); + } + } + /** + * Set the entry for a given mime type. + * + * This replaces all existing entries for `mimeType`. + */ + replace(mimeType, value) { + this._entries.set(this.toKey(mimeType), [value]); + } + /** + * Remove all entries for `mimeType`. + */ + delete(mimeType) { + this._entries.delete(this.toKey(mimeType)); + } + /** + * Iterate over all `[mime, item]` pairs in this data transfer. + * + * There may be multiple entries for each mime type. + */ + *[Symbol.iterator]() { + for (const [mine, items] of this._entries) { + for (const item of items) { + yield [mine, item]; + } + } + } + toKey(mimeType) { + return normalizeMimeType(mimeType); + } +}; +function normalizeMimeType(mimeType) { + return mimeType.toLowerCase(); +} +function matchesMimeType(pattern, mimeTypes) { + return matchesMimeType_normalized(normalizeMimeType(pattern), mimeTypes.map(normalizeMimeType)); +} +function matchesMimeType_normalized(normalizedPattern, normalizedMimeTypes) { + if (normalizedPattern === "*/*") { + return normalizedMimeTypes.length > 0; + } + if (normalizedMimeTypes.includes(normalizedPattern)) { + return true; + } + const wildcard = normalizedPattern.match(/^([a-z]+)\/([a-z]+|\*)$/i); + if (!wildcard) { + return false; + } + const [_, type, subtype] = wildcard; + if (subtype === "*") { + return normalizedMimeTypes.some((mime) => mime.startsWith(type + "/")); + } + return false; +} +var UriList = Object.freeze({ + // http://amundsen.com/hypermedia/urilist/ + create: (entries2) => { + return distinct(entries2.map((x) => x.toString())).join("\r\n"); + }, + split: (str) => { + return str.split("\r\n"); + }, + parse: (str) => { + return UriList.split(str).filter((value) => !value.startsWith("#")); + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.js +init_errors(); + +// node_modules/monaco-editor-core/esm/vs/base/common/hierarchicalKind.js +var HierarchicalKind = class _HierarchicalKind { + static { + this.sep = "."; + } + static { + this.None = new _HierarchicalKind("@@none@@"); + } + static { + this.Empty = new _HierarchicalKind(""); + } + constructor(value) { + this.value = value; + } + equals(other) { + return this.value === other.value; + } + contains(other) { + return this.equals(other) || this.value === "" || other.value.startsWith(this.value + _HierarchicalKind.sep); + } + intersects(other) { + return this.contains(other) || other.contains(this); + } + append(...parts) { + return new _HierarchicalKind((this.value ? [this.value, ...parts] : parts).join(_HierarchicalKind.sep)); + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.js +init_lifecycle(); +init_mime(); +init_platform(); +init_types(); +init_uuid(); +init_nls(); +init_commands(); +init_configuration(); +init_contextkey(); +init_instantiation(); +init_log(); + +// node_modules/monaco-editor-core/esm/vs/platform/quickinput/common/quickInput.js +init_instantiation(); +var NO_KEY_MODS = { ctrlCmd: false, alt: false }; +var QuickInputHideReason; +(function(QuickInputHideReason2) { + QuickInputHideReason2[QuickInputHideReason2["Blur"] = 1] = "Blur"; + QuickInputHideReason2[QuickInputHideReason2["Gesture"] = 2] = "Gesture"; + QuickInputHideReason2[QuickInputHideReason2["Other"] = 3] = "Other"; +})(QuickInputHideReason || (QuickInputHideReason = {})); +var ItemActivation; +(function(ItemActivation2) { + ItemActivation2[ItemActivation2["NONE"] = 0] = "NONE"; + ItemActivation2[ItemActivation2["FIRST"] = 1] = "FIRST"; + ItemActivation2[ItemActivation2["SECOND"] = 2] = "SECOND"; + ItemActivation2[ItemActivation2["LAST"] = 3] = "LAST"; +})(ItemActivation || (ItemActivation = {})); +var QuickPickFocus; +(function(QuickPickFocus2) { + QuickPickFocus2[QuickPickFocus2["First"] = 1] = "First"; + QuickPickFocus2[QuickPickFocus2["Second"] = 2] = "Second"; + QuickPickFocus2[QuickPickFocus2["Last"] = 3] = "Last"; + QuickPickFocus2[QuickPickFocus2["Next"] = 4] = "Next"; + QuickPickFocus2[QuickPickFocus2["Previous"] = 5] = "Previous"; + QuickPickFocus2[QuickPickFocus2["NextPage"] = 6] = "NextPage"; + QuickPickFocus2[QuickPickFocus2["PreviousPage"] = 7] = "PreviousPage"; + QuickPickFocus2[QuickPickFocus2["NextSeparator"] = 8] = "NextSeparator"; + QuickPickFocus2[QuickPickFocus2["PreviousSeparator"] = 9] = "PreviousSeparator"; +})(QuickPickFocus || (QuickPickFocus = {})); +var QuickInputButtonLocation; +(function(QuickInputButtonLocation2) { + QuickInputButtonLocation2[QuickInputButtonLocation2["Title"] = 1] = "Title"; + QuickInputButtonLocation2[QuickInputButtonLocation2["Inline"] = 2] = "Inline"; + QuickInputButtonLocation2[QuickInputButtonLocation2["Input"] = 3] = "Input"; +})(QuickInputButtonLocation || (QuickInputButtonLocation = {})); +var QuickPickItemScorerAccessor = class { + constructor(options2) { + this.options = options2; + } +}; +var quickPickItemScorerAccessor = new QuickPickItemScorerAccessor(); +var IQuickInputService = createDecorator("quickInputService"); + +// node_modules/monaco-editor-core/esm/vs/editor/browser/dataTransfer.js +init_mime(); +init_uri(); + +// node_modules/monaco-editor-core/esm/vs/platform/dnd/browser/dnd.js +init_platform(); +init_platform2(); +var CodeDataTransfers = { + EDITORS: "CodeEditors", + FILES: "CodeFiles", + SYMBOLS: "application/vnd.code.symbols", + MARKERS: "application/vnd.code.diagnostics", + NOTEBOOK_CELL_OUTPUT: "notebook-cell-output", + SCM_HISTORY_ITEM: "scm-history-item" +}; +var DragAndDropContributionRegistry = class { +}; +var Extensions9 = { + DragAndDropContribution: "workbench.contributions.dragAndDrop" +}; +Registry.add(Extensions9.DragAndDropContribution, new DragAndDropContributionRegistry()); +var LocalSelectionTransfer = class _LocalSelectionTransfer { + static { + this.INSTANCE = new _LocalSelectionTransfer(); + } + constructor() { + } + static getInstance() { + return _LocalSelectionTransfer.INSTANCE; + } + hasData(proto) { + return proto && proto === this.proto; + } + getData(proto) { + if (this.hasData(proto)) { + return this.data; + } + return void 0; + } +}; +function getPathForFile(file) { + if (isNative && typeof globalThis.vscode?.webUtils?.getPathForFile === "function") { + return globalThis.vscode?.webUtils?.getPathForFile(file); + } + return void 0; +} + +// node_modules/monaco-editor-core/esm/vs/editor/browser/dataTransfer.js +function toVSDataTransfer(dataTransfer) { + const vsDataTransfer = new VSDataTransfer(); + for (const item of dataTransfer.items) { + const type = item.type; + if (item.kind === "string") { + const asStringValue = new Promise((resolve3) => item.getAsString(resolve3)); + vsDataTransfer.append(type, createStringDataTransferItem(asStringValue)); + } else if (item.kind === "file") { + const file = item.getAsFile(); + if (file) { + vsDataTransfer.append(type, createFileDataTransferItemFromFile(file)); + } + } + } + return vsDataTransfer; +} +function createFileDataTransferItemFromFile(file) { + const path = getPathForFile(file); + const uri = path ? URI.parse(path) : void 0; + return createFileDataTransferItem(file.name, uri, async () => { + return new Uint8Array(await file.arrayBuffer()); + }); +} +var INTERNAL_DND_MIME_TYPES = Object.freeze([ + CodeDataTransfers.EDITORS, + CodeDataTransfers.FILES, + DataTransfers.RESOURCES, + DataTransfers.INTERNAL_URI_LIST +]); +function toExternalVSDataTransfer(sourceDataTransfer, overwriteUriList = false) { + const vsDataTransfer = toVSDataTransfer(sourceDataTransfer); + const uriList = vsDataTransfer.get(DataTransfers.INTERNAL_URI_LIST); + if (uriList) { + vsDataTransfer.replace(Mimes.uriList, uriList); + } else { + if (overwriteUriList || !vsDataTransfer.has(Mimes.uriList)) { + const editorData = []; + for (const item of sourceDataTransfer.items) { + const file = item.getAsFile(); + if (file) { + const path = getPathForFile(file); + try { + if (path) { + editorData.push(URI.file(path).toString()); + } else { + editorData.push(URI.parse(file.name, true).toString()); + } + } catch { + } + } + } + if (editorData.length) { + vsDataTransfer.replace(Mimes.uriList, createStringDataTransferItem(UriList.create(editorData))); + } + } + } + for (const internal of INTERNAL_DND_MIME_TYPES) { + vsDataTransfer.delete(internal); + } + return vsDataTransfer; +} + +// node_modules/monaco-editor-core/esm/vs/editor/browser/services/bulkEditService.js +init_instantiation(); +init_uri(); +init_types(); +var IBulkEditService = createDecorator("IWorkspaceEditService"); +var ResourceEdit = class { + constructor(metadata) { + this.metadata = metadata; + } + static convert(edit2) { + return edit2.edits.map((edit3) => { + if (ResourceTextEdit.is(edit3)) { + return ResourceTextEdit.lift(edit3); + } + if (ResourceFileEdit.is(edit3)) { + return ResourceFileEdit.lift(edit3); + } + throw new Error("Unsupported edit"); + }); + } +}; +var ResourceTextEdit = class _ResourceTextEdit extends ResourceEdit { + static is(candidate) { + if (candidate instanceof _ResourceTextEdit) { + return true; + } + return isObject(candidate) && URI.isUri(candidate.resource) && isObject(candidate.textEdit); + } + static lift(edit2) { + if (edit2 instanceof _ResourceTextEdit) { + return edit2; + } else { + return new _ResourceTextEdit(edit2.resource, edit2.textEdit, edit2.versionId, edit2.metadata); + } + } + constructor(resource, textEdit, versionId = void 0, metadata) { + super(metadata); + this.resource = resource; + this.textEdit = textEdit; + this.versionId = versionId; + } +}; +var ResourceFileEdit = class _ResourceFileEdit extends ResourceEdit { + static is(candidate) { + if (candidate instanceof _ResourceFileEdit) { + return true; + } else { + return isObject(candidate) && (Boolean(candidate.newResource) || Boolean(candidate.oldResource)); + } + } + static lift(edit2) { + if (edit2 instanceof _ResourceFileEdit) { + return edit2; + } else { + return new _ResourceFileEdit(edit2.oldResource, edit2.newResource, edit2.options, edit2.metadata); + } + } + constructor(oldResource, newResource, options2 = {}, metadata) { + super(metadata); + this.oldResource = oldResource; + this.newResource = newResource; + this.options = options2; + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.js +init_range(); +init_languages(); +init_languageFeatures(); +init_editorState(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/inlineProgress/browser/inlineProgress.js +init_dom(); +init_async(); +init_codicons(); +init_lifecycle(); +init_strings(); +init_themables(); +init_range(); +init_textModel(); +init_instantiation(); +var __decorate45 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param40 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var inlineProgressDecoration = ModelDecorationOptions.register({ + description: "inline-progress-widget", + stickiness: 1, + showIfCollapsed: true, + after: { + content: noBreakWhitespace, + inlineClassName: "inline-editor-progress-decoration", + inlineClassNameAffectsLetterSpacing: true + } +}); +var InlineProgressWidget = class _InlineProgressWidget extends Disposable { + static { + this.baseId = "editor.widget.inlineProgressWidget"; + } + constructor(typeId, editor2, range2, title, delegate) { + super(); + this.typeId = typeId; + this.editor = editor2; + this.range = range2; + this.delegate = delegate; + this.allowEditorOverflow = false; + this.suppressMouseDown = true; + this.create(title); + this.editor.addContentWidget(this); + this.editor.layoutContentWidget(this); + } + create(title) { + this.domNode = $(".inline-progress-widget"); + this.domNode.role = "button"; + this.domNode.title = title; + const iconElement = $("span.icon"); + this.domNode.append(iconElement); + iconElement.classList.add(...ThemeIcon.asClassNameArray(Codicon.loading), "codicon-modifier-spin"); + const updateSize = () => { + const lineHeight = this.editor.getOption( + 75 + /* EditorOption.lineHeight */ + ); + this.domNode.style.height = `${lineHeight}px`; + this.domNode.style.width = `${Math.ceil(0.8 * lineHeight)}px`; + }; + updateSize(); + this._register(this.editor.onDidChangeConfiguration((c) => { + if (c.hasChanged( + 61 + /* EditorOption.fontSize */ + ) || c.hasChanged( + 75 + /* EditorOption.lineHeight */ + )) { + updateSize(); + } + })); + this._register(addDisposableListener(this.domNode, EventType.CLICK, (e) => { + this.delegate.cancel(); + })); + } + getId() { + return _InlineProgressWidget.baseId + "." + this.typeId; + } + getDomNode() { + return this.domNode; + } + getPosition() { + return { + position: { lineNumber: this.range.startLineNumber, column: this.range.startColumn }, + preference: [ + 0 + /* ContentWidgetPositionPreference.EXACT */ + ] + }; + } + dispose() { + super.dispose(); + this.editor.removeContentWidget(this); + } +}; +var InlineProgressManager = class InlineProgressManager2 extends Disposable { + constructor(id, _editor, _instantiationService) { + super(); + this.id = id; + this._editor = _editor; + this._instantiationService = _instantiationService; + this._showDelay = 500; + this._showPromise = this._register(new MutableDisposable()); + this._currentWidget = this._register(new MutableDisposable()); + this._operationIdPool = 0; + this._currentDecorations = _editor.createDecorationsCollection(); + } + dispose() { + super.dispose(); + this._currentDecorations.clear(); + } + async showWhile(position, title, promise, delegate, delayOverride) { + const operationId = this._operationIdPool++; + this._currentOperation = operationId; + this.clear(); + this._showPromise.value = disposableTimeout(() => { + const range2 = Range.fromPositions(position); + const decorationIds = this._currentDecorations.set([{ + range: range2, + options: inlineProgressDecoration + }]); + if (decorationIds.length > 0) { + this._currentWidget.value = this._instantiationService.createInstance(InlineProgressWidget, this.id, this._editor, range2, title, delegate); + } + }, delayOverride ?? this._showDelay); + try { + return await promise; + } finally { + if (this._currentOperation === operationId) { + this.clear(); + this._currentOperation = void 0; + } + } + } + clear() { + this._showPromise.clear(); + this._currentDecorations.clear(); + this._currentWidget.clear(); + } +}; +InlineProgressManager = __decorate45([ + __param40(2, IInstantiationService) +], InlineProgressManager); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/message/browser/messageController.js +init_event(); +init_htmlContent(); +init_lifecycle(); +init_editorExtensions(); +init_range(); + +// node_modules/monaco-editor-core/esm/vs/platform/markdown/browser/markdownRenderer.js +init_errors(); +init_extensions(); +init_instantiation(); + +// node_modules/monaco-editor-core/esm/vs/platform/opener/common/opener.js +init_instantiation(); +var IOpenerService = createDecorator("openerService"); +function withSelection(uri, selection) { + return uri.with({ fragment: `${selection.startLineNumber},${selection.startColumn}${selection.endLineNumber ? `-${selection.endLineNumber}${selection.endColumn ? `,${selection.endColumn}` : ""}` : ""}` }); +} +function extractSelection(uri) { + let selection = void 0; + const match2 = /^L?(\d+)(?:,(\d+))?(-L?(\d+)(?:,(\d+))?)?/.exec(uri.fragment); + if (match2) { + selection = { + startLineNumber: parseInt(match2[1]), + startColumn: match2[2] ? parseInt(match2[2]) : 1, + endLineNumber: match2[4] ? parseInt(match2[4]) : void 0, + endColumn: match2[4] ? match2[5] ? parseInt(match2[5]) : 1 : void 0 + }; + uri = uri.with({ fragment: "" }); + } + return { selection, uri }; +} + +// node_modules/monaco-editor-core/esm/vs/platform/markdown/browser/markdownRenderer.js +var __decorate46 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param41 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var IMarkdownRendererService = createDecorator("markdownRendererService"); +var MarkdownRendererService = class MarkdownRendererService2 { + constructor(_openerService) { + this._openerService = _openerService; + } + render(markdown, options2, outElement) { + const resolvedOptions = { ...options2 }; + if (!resolvedOptions.actionHandler) { + resolvedOptions.actionHandler = (link2, mdStr) => { + return openLinkFromMarkdown(this._openerService, link2, mdStr.isTrusted); + }; + } + if (!resolvedOptions.codeBlockRenderer) { + resolvedOptions.codeBlockRenderer = (alias, value) => { + return this._defaultCodeBlockRenderer?.renderCodeBlock(alias, value, resolvedOptions ?? {}) ?? Promise.resolve(document.createElement("span")); + }; + } + const rendered = renderMarkdown(markdown, resolvedOptions, outElement); + rendered.element.classList.add("rendered-markdown"); + return rendered; + } + setDefaultCodeBlockRenderer(renderer) { + this._defaultCodeBlockRenderer = renderer; + } +}; +MarkdownRendererService = __decorate46([ + __param41(0, IOpenerService) +], MarkdownRendererService); +async function openLinkFromMarkdown(openerService, link2, isTrusted, skipValidation) { + try { + return await openerService.open(link2, { + fromUserGesture: true, + allowContributedOpeners: true, + allowCommands: toAllowCommandsOption(isTrusted), + skipValidation + }); + } catch (e) { + onUnexpectedError(e); + return false; + } +} +function toAllowCommandsOption(isTrusted) { + if (isTrusted === true) { + return true; + } + if (isTrusted && Array.isArray(isTrusted.enabledCommands)) { + return isTrusted.enabledCommands; + } + return false; +} +registerSingleton( + IMarkdownRendererService, + MarkdownRendererService, + 1 + /* InstantiationType.Delayed */ +); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/message/browser/messageController.js +init_nls(); +init_contextkey(); +init_dom(); +var __decorate47 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param42 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var MessageController_1; +var MessageController = class MessageController2 { + static { + MessageController_1 = this; + } + static { + this.ID = "editor.contrib.messageController"; + } + static { + this.MESSAGE_VISIBLE = new RawContextKey("messageVisible", false, localize(1287, "Whether the editor is currently showing an inline message")); + } + static get(editor2) { + return editor2.getContribution(MessageController_1.ID); + } + constructor(editor2, contextKeyService, _openerService) { + this._openerService = _openerService; + this._messageWidget = new MutableDisposable(); + this._messageListeners = new DisposableStore(); + this._mouseOverMessage = false; + this._editor = editor2; + this._visible = MessageController_1.MESSAGE_VISIBLE.bindTo(contextKeyService); + } + dispose() { + this._messageListeners.dispose(); + this._messageWidget.dispose(); + this._visible.reset(); + } + showMessage(message, position) { + alert(isMarkdownString(message) ? message.value : message); + this._visible.set(true); + this._messageWidget.clear(); + this._messageListeners.clear(); + if (isMarkdownString(message)) { + const renderedMessage = this._messageListeners.add(renderMarkdown(message, { + actionHandler: (url, mdStr) => { + this.closeMessage(); + openLinkFromMarkdown(this._openerService, url, mdStr.isTrusted); + } + })); + this._messageWidget.value = new MessageWidget(this._editor, position, renderedMessage.element); + } else { + this._messageWidget.value = new MessageWidget(this._editor, position, message); + } + this._messageListeners.add(Event.debounce(this._editor.onDidBlurEditorText, (last, event) => event, 0)(() => { + if (this._mouseOverMessage) { + return; + } + if (this._messageWidget.value && isAncestor(getActiveElement(), this._messageWidget.value.getDomNode())) { + return; + } + 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(addDisposableListener(this._messageWidget.value.getDomNode(), EventType.MOUSE_ENTER, () => this._mouseOverMessage = true, true)); + this._messageListeners.add(addDisposableListener(this._messageWidget.value.getDomNode(), EventType.MOUSE_LEAVE, () => this._mouseOverMessage = false, true)); + let bounds; + this._messageListeners.add(this._editor.onMouseMove((e) => { + if (!e.target.position) { + return; + } + if (!bounds) { + bounds = new Range(position.lineNumber - 3, 1, e.target.position.lineNumber + 3, 1); + } else if (!bounds.containsPosition(e.target.position)) { + this.closeMessage(); + } + })); + } + closeMessage() { + this._visible.reset(); + this._messageListeners.clear(); + if (this._messageWidget.value) { + this._messageListeners.add(MessageWidget.fadeOut(this._messageWidget.value)); + } + } +}; +MessageController = MessageController_1 = __decorate47([ + __param42(1, IContextKeyService), + __param42(2, IOpenerService) +], MessageController); +var MessageCommand = EditorCommand.bindToContribution(MessageController.get); +registerEditorCommand(new MessageCommand({ + id: "leaveEditorMessage", + precondition: MessageController.MESSAGE_VISIBLE, + handler: (c) => c.closeMessage(), + kbOpts: { + weight: 100 + 30, + primary: 9 + /* KeyCode.Escape */ + } +})); +var MessageWidget = class { + static fadeOut(messageWidget) { + const dispose2 = () => { + messageWidget.dispose(); + clearTimeout(handle); + messageWidget.getDomNode().removeEventListener("animationend", dispose2); + }; + const handle = setTimeout(dispose2, 110); + messageWidget.getDomNode().addEventListener("animationend", dispose2); + messageWidget.getDomNode().classList.add("fadeOut"); + return { dispose: dispose2 }; + } + constructor(editor2, { lineNumber, column }, text2) { + this.allowEditorOverflow = true; + this.suppressMouseDown = false; + this._editor = editor2; + this._editor.revealLinesInCenterIfOutsideViewport( + lineNumber, + lineNumber, + 0 + /* ScrollType.Smooth */ + ); + this._position = { lineNumber, column }; + this._domNode = document.createElement("div"); + this._domNode.classList.add("monaco-editor-overlaymessage"); + this._domNode.style.marginLeft = "-6px"; + const anchorTop = document.createElement("div"); + anchorTop.classList.add("anchor", "top"); + this._domNode.appendChild(anchorTop); + const message = document.createElement("div"); + if (typeof text2 === "string") { + message.classList.add("message"); + message.textContent = text2; + } else { + text2.classList.add("message"); + message.appendChild(text2); + } + this._domNode.appendChild(message); + const anchorBottom = document.createElement("div"); + anchorBottom.classList.add("anchor", "below"); + this._domNode.appendChild(anchorBottom); + 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(position) { + this._domNode.classList.toggle( + "below", + position === 2 + /* ContentWidgetPositionPreference.BELOW */ + ); + } +}; +registerEditorContribution( + MessageController.ID, + MessageController, + 4 + /* EditorContributionInstantiation.Lazy */ +); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/dropOrPasteInto/browser/defaultProviders.js +init_arrays(); +init_lifecycle(); +init_mime(); +init_network(); +init_resources(); +init_uri(); +init_nls(); + +// node_modules/monaco-editor-core/esm/vs/platform/workspace/common/workspace.js +init_nls(); +init_path(); + +// node_modules/monaco-editor-core/esm/vs/base/common/ternarySearchTree.js +init_assert(); +init_strings(); +var StringIterator = class { + constructor() { + this._value = ""; + this._pos = 0; + } + reset(key) { + this._value = key; + this._pos = 0; + return this; + } + next() { + this._pos += 1; + return this; + } + hasNext() { + return this._pos < this._value.length - 1; + } + cmp(a) { + const aCode = a.charCodeAt(0); + const thisCode = this._value.charCodeAt(this._pos); + return aCode - thisCode; + } + value() { + return this._value[this._pos]; + } +}; +var ConfigKeysIterator = class { + constructor(_caseSensitive = true) { + this._caseSensitive = _caseSensitive; + } + reset(key) { + this._value = key; + this._from = 0; + this._to = 0; + return this.next(); + } + hasNext() { + return this._to < this._value.length; + } + next() { + this._from = this._to; + let justSeps = true; + for (; this._to < this._value.length; this._to++) { + const ch = this._value.charCodeAt(this._to); + if (ch === 46) { + if (justSeps) { + this._from++; + } else { + break; + } + } else { + justSeps = false; + } + } + return this; + } + cmp(a) { + return this._caseSensitive ? compareSubstring(a, this._value, 0, a.length, this._from, this._to) : compareSubstringIgnoreCase(a, this._value, 0, a.length, this._from, this._to); + } + value() { + return this._value.substring(this._from, this._to); + } +}; +var PathIterator = class { + constructor(_splitOnBackslash = true, _caseSensitive = true) { + this._splitOnBackslash = _splitOnBackslash; + this._caseSensitive = _caseSensitive; + } + reset(key) { + this._from = 0; + this._to = 0; + this._value = key; + this._valueLen = key.length; + for (let pos = key.length - 1; pos >= 0; pos--, this._valueLen--) { + const ch = this._value.charCodeAt(pos); + if (!(ch === 47 || this._splitOnBackslash && ch === 92)) { + break; + } + } + return this.next(); + } + hasNext() { + return this._to < this._valueLen; + } + next() { + this._from = this._to; + let justSeps = true; + for (; this._to < this._valueLen; this._to++) { + const ch = this._value.charCodeAt(this._to); + if (ch === 47 || this._splitOnBackslash && ch === 92) { + if (justSeps) { + this._from++; + } else { + break; + } + } else { + justSeps = false; + } + } + return this; + } + cmp(a) { + return this._caseSensitive ? compareSubstring(a, this._value, 0, a.length, this._from, this._to) : compareSubstringIgnoreCase(a, this._value, 0, a.length, this._from, this._to); + } + value() { + return this._value.substring(this._from, this._to); + } +}; +var UriIterator = class { + constructor(_ignorePathCasing, _ignoreQueryAndFragment) { + this._ignorePathCasing = _ignorePathCasing; + this._ignoreQueryAndFragment = _ignoreQueryAndFragment; + this._states = []; + this._stateIdx = 0; + } + reset(key) { + this._value = key; + this._states = []; + if (this._value.scheme) { + this._states.push( + 1 + /* UriIteratorState.Scheme */ + ); + } + if (this._value.authority) { + this._states.push( + 2 + /* UriIteratorState.Authority */ + ); + } + if (this._value.path) { + this._pathIterator = new PathIterator(false, !this._ignorePathCasing(key)); + this._pathIterator.reset(key.path); + if (this._pathIterator.value()) { + this._states.push( + 3 + /* UriIteratorState.Path */ + ); + } + } + if (!this._ignoreQueryAndFragment(key)) { + if (this._value.query) { + this._states.push( + 4 + /* UriIteratorState.Query */ + ); + } + if (this._value.fragment) { + this._states.push( + 5 + /* UriIteratorState.Fragment */ + ); + } + } + this._stateIdx = 0; + return this; + } + next() { + if (this._states[this._stateIdx] === 3 && this._pathIterator.hasNext()) { + this._pathIterator.next(); + } else { + this._stateIdx += 1; + } + return this; + } + hasNext() { + return this._states[this._stateIdx] === 3 && this._pathIterator.hasNext() || this._stateIdx < this._states.length - 1; + } + cmp(a) { + if (this._states[this._stateIdx] === 1) { + return compareIgnoreCase(a, this._value.scheme); + } else if (this._states[this._stateIdx] === 2) { + return compareIgnoreCase(a, this._value.authority); + } else if (this._states[this._stateIdx] === 3) { + return this._pathIterator.cmp(a); + } else if (this._states[this._stateIdx] === 4) { + return compare(a, this._value.query); + } else if (this._states[this._stateIdx] === 5) { + return compare(a, this._value.fragment); + } + throw new Error(); + } + value() { + if (this._states[this._stateIdx] === 1) { + return this._value.scheme; + } else if (this._states[this._stateIdx] === 2) { + return this._value.authority; + } else if (this._states[this._stateIdx] === 3) { + return this._pathIterator.value(); + } else if (this._states[this._stateIdx] === 4) { + return this._value.query; + } else if (this._states[this._stateIdx] === 5) { + return this._value.fragment; + } + throw new Error(); + } +}; +var Undef = class _Undef { + static { + this.Val = /* @__PURE__ */ Symbol("undefined_placeholder"); + } + static wrap(value) { + return value === void 0 ? _Undef.Val : value; + } + static unwrap(value) { + return value === _Undef.Val ? void 0 : value; + } +}; +var TernarySearchTreeNode = class { + constructor() { + this.height = 1; + this.value = void 0; + this.key = void 0; + this.left = void 0; + this.mid = void 0; + this.right = void 0; + } + rotateLeft() { + const tmp = this.right; + this.right = tmp.left; + tmp.left = this; + this.updateHeight(); + tmp.updateHeight(); + return tmp; + } + rotateRight() { + const tmp = this.left; + this.left = tmp.right; + tmp.right = this; + this.updateHeight(); + tmp.updateHeight(); + return tmp; + } + updateHeight() { + this.height = 1 + Math.max(this.heightLeft, this.heightRight); + } + balanceFactor() { + return this.heightRight - this.heightLeft; + } + get heightLeft() { + return this.left?.height ?? 0; + } + get heightRight() { + return this.right?.height ?? 0; + } +}; +var TernarySearchTree = class _TernarySearchTree { + static forUris(ignorePathCasing = () => false, ignoreQueryAndFragment = () => false) { + return new _TernarySearchTree(new UriIterator(ignorePathCasing, ignoreQueryAndFragment)); + } + static forStrings() { + return new _TernarySearchTree(new StringIterator()); + } + static forConfigKeys() { + return new _TernarySearchTree(new ConfigKeysIterator()); + } + constructor(segments) { + this._iter = segments; + } + clear() { + this._root = void 0; + } + set(key, element) { + const iter = this._iter.reset(key); + let node; + if (!this._root) { + this._root = new TernarySearchTreeNode(); + this._root.segment = iter.value(); + } + const stack = []; + node = this._root; + while (true) { + const val = iter.cmp(node.segment); + if (val > 0) { + if (!node.left) { + node.left = new TernarySearchTreeNode(); + node.left.segment = iter.value(); + } + stack.push([-1, node]); + node = node.left; + } else if (val < 0) { + if (!node.right) { + node.right = new TernarySearchTreeNode(); + node.right.segment = iter.value(); + } + stack.push([1, node]); + node = node.right; + } else if (iter.hasNext()) { + iter.next(); + if (!node.mid) { + node.mid = new TernarySearchTreeNode(); + node.mid.segment = iter.value(); + } + stack.push([0, node]); + node = node.mid; + } else { + break; + } + } + const oldElement = Undef.unwrap(node.value); + node.value = Undef.wrap(element); + node.key = key; + for (let i2 = stack.length - 1; i2 >= 0; i2--) { + const node2 = stack[i2][1]; + node2.updateHeight(); + const bf = node2.balanceFactor(); + if (bf < -1 || bf > 1) { + const d1 = stack[i2][0]; + const d2 = stack[i2 + 1][0]; + if (d1 === 1 && d2 === 1) { + stack[i2][1] = node2.rotateLeft(); + } else if (d1 === -1 && d2 === -1) { + stack[i2][1] = node2.rotateRight(); + } else if (d1 === 1 && d2 === -1) { + node2.right = stack[i2 + 1][1] = stack[i2 + 1][1].rotateRight(); + stack[i2][1] = node2.rotateLeft(); + } else if (d1 === -1 && d2 === 1) { + node2.left = stack[i2 + 1][1] = stack[i2 + 1][1].rotateLeft(); + stack[i2][1] = node2.rotateRight(); + } else { + throw new Error(); + } + if (i2 > 0) { + switch (stack[i2 - 1][0]) { + case -1: + stack[i2 - 1][1].left = stack[i2][1]; + break; + case 1: + stack[i2 - 1][1].right = stack[i2][1]; + break; + case 0: + stack[i2 - 1][1].mid = stack[i2][1]; + break; + } + } else { + this._root = stack[0][1]; + } + } + } + return oldElement; + } + get(key) { + return Undef.unwrap(this._getNode(key)?.value); + } + _getNode(key) { + const iter = this._iter.reset(key); + let node = this._root; + while (node) { + const val = iter.cmp(node.segment); + if (val > 0) { + node = node.left; + } else if (val < 0) { + node = node.right; + } else if (iter.hasNext()) { + iter.next(); + node = node.mid; + } else { + break; + } + } + return node; + } + has(key) { + const node = this._getNode(key); + return !(node?.value === void 0 && node?.mid === void 0); + } + delete(key) { + return this._delete(key, false); + } + deleteSuperstr(key) { + return this._delete(key, true); + } + _delete(key, superStr) { + const iter = this._iter.reset(key); + const stack = []; + let node = this._root; + while (node) { + const val = iter.cmp(node.segment); + if (val > 0) { + stack.push([-1, node]); + node = node.left; + } else if (val < 0) { + stack.push([1, node]); + node = node.right; + } else if (iter.hasNext()) { + iter.next(); + stack.push([0, node]); + node = node.mid; + } else { + break; + } + } + if (!node) { + return; + } + if (superStr) { + node.left = void 0; + node.mid = void 0; + node.right = void 0; + node.height = 1; + } else { + node.key = void 0; + node.value = void 0; + } + if (!node.mid && !node.value) { + if (node.left && node.right) { + const stack2 = [[1, node]]; + const min = this._min(node.right, stack2); + if (min.key) { + node.key = min.key; + node.value = min.value; + node.segment = min.segment; + const newChild = min.right; + if (stack2.length > 1) { + const [dir, parent] = stack2[stack2.length - 1]; + switch (dir) { + case -1: + parent.left = newChild; + break; + case 0: + assert(false); + case 1: + assert(false); + } + } else { + node.right = newChild; + } + const newChild2 = this._balanceByStack(stack2); + if (stack.length > 0) { + const [dir, parent] = stack[stack.length - 1]; + switch (dir) { + case -1: + parent.left = newChild2; + break; + case 0: + parent.mid = newChild2; + break; + case 1: + parent.right = newChild2; + break; + } + } else { + this._root = newChild2; + } + } + } else { + const newChild = node.left ?? node.right; + if (stack.length > 0) { + const [dir, parent] = stack[stack.length - 1]; + switch (dir) { + case -1: + parent.left = newChild; + break; + case 0: + parent.mid = newChild; + break; + case 1: + parent.right = newChild; + break; + } + } else { + this._root = newChild; + } + } + } + this._root = this._balanceByStack(stack) ?? this._root; + } + _min(node, stack) { + while (node.left) { + stack.push([-1, node]); + node = node.left; + } + return node; + } + _balanceByStack(stack) { + for (let i2 = stack.length - 1; i2 >= 0; i2--) { + const node = stack[i2][1]; + node.updateHeight(); + const bf = node.balanceFactor(); + if (bf > 1) { + if (node.right.balanceFactor() >= 0) { + stack[i2][1] = node.rotateLeft(); + } else { + node.right = node.right.rotateRight(); + stack[i2][1] = node.rotateLeft(); + } + } else if (bf < -1) { + if (node.left.balanceFactor() <= 0) { + stack[i2][1] = node.rotateRight(); + } else { + node.left = node.left.rotateLeft(); + stack[i2][1] = node.rotateRight(); + } + } + if (i2 > 0) { + switch (stack[i2 - 1][0]) { + case -1: + stack[i2 - 1][1].left = stack[i2][1]; + break; + case 1: + stack[i2 - 1][1].right = stack[i2][1]; + break; + case 0: + stack[i2 - 1][1].mid = stack[i2][1]; + break; + } + } else { + return stack[0][1]; + } + } + return void 0; + } + findSubstr(key) { + const iter = this._iter.reset(key); + let node = this._root; + let candidate = void 0; + while (node) { + const val = iter.cmp(node.segment); + if (val > 0) { + node = node.left; + } else if (val < 0) { + node = node.right; + } else if (iter.hasNext()) { + iter.next(); + candidate = Undef.unwrap(node.value) || candidate; + node = node.mid; + } else { + break; + } + } + return node && Undef.unwrap(node.value) || candidate; + } + findSuperstr(key) { + return this._findSuperstrOrElement(key, false); + } + _findSuperstrOrElement(key, allowValue) { + const iter = this._iter.reset(key); + let node = this._root; + while (node) { + const val = iter.cmp(node.segment); + if (val > 0) { + node = node.left; + } else if (val < 0) { + node = node.right; + } else if (iter.hasNext()) { + iter.next(); + node = node.mid; + } else { + if (!node.mid) { + if (allowValue) { + return Undef.unwrap(node.value); + } else { + return void 0; + } + } else { + return this._entries(node.mid); + } + } + } + return void 0; + } + forEach(callback) { + for (const [key, value] of this) { + callback(value, key); + } + } + *[Symbol.iterator]() { + yield* this._entries(this._root); + } + _entries(node) { + const result = []; + this._dfsEntries(node, result); + return result[Symbol.iterator](); + } + _dfsEntries(node, bucket) { + if (!node) { + return; + } + if (node.left) { + this._dfsEntries(node.left, bucket); + } + if (node.value !== void 0) { + bucket.push([node.key, Undef.unwrap(node.value)]); + } + if (node.mid) { + this._dfsEntries(node.mid, bucket); + } + if (node.right) { + this._dfsEntries(node.right, bucket); + } + } +}; + +// node_modules/monaco-editor-core/esm/vs/platform/workspace/common/workspace.js +init_uri(); +init_instantiation(); +var IWorkspaceContextService = createDecorator("contextService"); +function isSingleFolderWorkspaceIdentifier(obj) { + const singleFolderIdentifier = obj; + return typeof singleFolderIdentifier?.id === "string" && URI.isUri(singleFolderIdentifier.uri); +} +function isEmptyWorkspaceIdentifier(obj) { + const emptyWorkspaceIdentifier = obj; + return typeof emptyWorkspaceIdentifier?.id === "string" && !isSingleFolderWorkspaceIdentifier(obj) && !isWorkspaceIdentifier(obj); +} +var EXTENSION_DEVELOPMENT_EMPTY_WINDOW_WORKSPACE = { id: "ext-dev" }; +var UNKNOWN_EMPTY_WINDOW_WORKSPACE = { id: "empty-window" }; +function toWorkspaceIdentifier(arg0, isExtensionDevelopment) { + if (typeof arg0 === "string" || typeof arg0 === "undefined") { + if (typeof arg0 === "string") { + return { + id: basename(arg0) + }; + } + if (isExtensionDevelopment) { + return EXTENSION_DEVELOPMENT_EMPTY_WINDOW_WORKSPACE; + } + return UNKNOWN_EMPTY_WINDOW_WORKSPACE; + } + const workspace = arg0; + if (workspace.configuration) { + return { + id: workspace.id, + configPath: workspace.configuration + }; + } + if (workspace.folders.length === 1) { + return { + id: workspace.id, + uri: workspace.folders[0].uri + }; + } + return { + id: workspace.id + }; +} +function isWorkspaceIdentifier(obj) { + const workspaceIdentifier = obj; + return typeof workspaceIdentifier?.id === "string" && URI.isUri(workspaceIdentifier.configPath); +} +var WorkspaceFolder = class { + constructor(data, raw) { + this.raw = raw; + this.uri = data.uri; + this.index = data.index; + this.name = data.name; + } + toJSON() { + return { uri: this.uri, name: this.name, index: this.index }; + } +}; +var WORKSPACE_EXTENSION = "code-workspace"; +var WORKSPACE_FILTER = [{ name: localize(2050, "Code Workspace"), extensions: [WORKSPACE_EXTENSION] }]; +var STANDALONE_EDITOR_WORKSPACE_ID = "4064f6ec-cb38-4ad0-af64-ee6467e63c82"; +function isStandaloneEditorWorkspace(workspace) { + return workspace.id === STANDALONE_EDITOR_WORKSPACE_ID; +} + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/dropOrPasteInto/browser/defaultProviders.js +init_languages(); +init_languageFeatures(); +var __decorate48 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param43 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var SimplePasteAndDropProvider = class { + constructor(kind) { + this.copyMimeTypes = []; + this.kind = kind; + this.providedDropEditKinds = [this.kind]; + this.providedPasteEditKinds = [this.kind]; + } + async provideDocumentPasteEdits(_model, _ranges, dataTransfer, context, token) { + const edit2 = await this.getEdit(dataTransfer, token); + if (!edit2) { + return void 0; + } + return { + edits: [{ insertText: edit2.insertText, title: edit2.title, kind: edit2.kind, handledMimeType: edit2.handledMimeType, yieldTo: edit2.yieldTo }], + dispose() { + } + }; + } + async provideDocumentDropEdits(_model, _position, dataTransfer, token) { + const edit2 = await this.getEdit(dataTransfer, token); + if (!edit2) { + return; + } + return { + edits: [{ insertText: edit2.insertText, title: edit2.title, kind: edit2.kind, handledMimeType: edit2.handledMimeType, yieldTo: edit2.yieldTo }], + dispose() { + } + }; + } +}; +var DefaultTextPasteOrDropEditProvider = class _DefaultTextPasteOrDropEditProvider extends SimplePasteAndDropProvider { + static { + this.id = "text"; + } + constructor() { + super(HierarchicalKind.Empty.append("text", "plain")); + this.id = _DefaultTextPasteOrDropEditProvider.id; + this.dropMimeTypes = [Mimes.text]; + this.pasteMimeTypes = [Mimes.text]; + } + async getEdit(dataTransfer, _token) { + const textEntry = dataTransfer.get(Mimes.text); + if (!textEntry) { + return; + } + if (dataTransfer.has(Mimes.uriList)) { + return; + } + const insertText = await textEntry.asString(); + return { + handledMimeType: Mimes.text, + title: localize(926, "Insert Plain Text"), + insertText, + kind: this.kind + }; + } +}; +var PathProvider = class extends SimplePasteAndDropProvider { + constructor() { + super(HierarchicalKind.Empty.append("uri", "path", "absolute")); + this.dropMimeTypes = [Mimes.uriList]; + this.pasteMimeTypes = [Mimes.uriList]; + } + async getEdit(dataTransfer, token) { + const entries2 = await extractUriList(dataTransfer); + if (!entries2.length || token.isCancellationRequested) { + return; + } + let uriCount = 0; + const insertText = entries2.map(({ uri, originalText }) => { + if (uri.scheme === Schemas.file) { + return uri.fsPath; + } else { + uriCount++; + return originalText; + } + }).join(" "); + let label; + if (uriCount > 0) { + label = entries2.length > 1 ? localize(927, "Insert Uris") : localize(928, "Insert Uri"); + } else { + label = entries2.length > 1 ? localize(929, "Insert Paths") : localize(930, "Insert Path"); + } + return { + handledMimeType: Mimes.uriList, + insertText, + title: label, + kind: this.kind + }; + } +}; +var RelativePathProvider = class RelativePathProvider2 extends SimplePasteAndDropProvider { + constructor(_workspaceContextService) { + super(HierarchicalKind.Empty.append("uri", "path", "relative")); + this._workspaceContextService = _workspaceContextService; + this.dropMimeTypes = [Mimes.uriList]; + this.pasteMimeTypes = [Mimes.uriList]; + } + async getEdit(dataTransfer, token) { + const entries2 = await extractUriList(dataTransfer); + if (!entries2.length || token.isCancellationRequested) { + return; + } + const relativeUris = coalesce(entries2.map(({ uri }) => { + const root = this._workspaceContextService.getWorkspaceFolder(uri); + return root ? relativePath(root.uri, uri) : void 0; + })); + if (!relativeUris.length) { + return; + } + return { + handledMimeType: Mimes.uriList, + insertText: relativeUris.join(" "), + title: entries2.length > 1 ? localize(931, "Insert Relative Paths") : localize(932, "Insert Relative Path"), + kind: this.kind + }; + } +}; +RelativePathProvider = __decorate48([ + __param43(0, IWorkspaceContextService) +], RelativePathProvider); +var PasteHtmlProvider = class { + constructor() { + this.kind = new HierarchicalKind("html"); + this.providedPasteEditKinds = [this.kind]; + this.copyMimeTypes = []; + this.pasteMimeTypes = ["text/html"]; + this._yieldTo = [{ mimeType: Mimes.text }]; + } + async provideDocumentPasteEdits(_model, _ranges, dataTransfer, context, token) { + if (context.triggerKind !== DocumentPasteTriggerKind.PasteAs && !context.only?.contains(this.kind)) { + return; + } + const entry = dataTransfer.get("text/html"); + const htmlText = await entry?.asString(); + if (!htmlText || token.isCancellationRequested) { + return; + } + return { + dispose() { + }, + edits: [{ + insertText: htmlText, + yieldTo: this._yieldTo, + title: localize(933, "Insert HTML"), + kind: this.kind + }] + }; + } +}; +async function extractUriList(dataTransfer) { + const urlListEntry = dataTransfer.get(Mimes.uriList); + if (!urlListEntry) { + return []; + } + const strUriList = await urlListEntry.asString(); + const entries2 = []; + for (const entry of UriList.parse(strUriList)) { + try { + entries2.push({ uri: URI.parse(entry), originalText: entry }); + } catch { + } + } + return entries2; +} +var genericLanguageSelector = { scheme: "*", hasAccessToAllModels: true }; +var DefaultDropProvidersFeature = class DefaultDropProvidersFeature2 extends Disposable { + constructor(languageFeaturesService, workspaceContextService) { + super(); + this._register(languageFeaturesService.documentDropEditProvider.register(genericLanguageSelector, new DefaultTextPasteOrDropEditProvider())); + this._register(languageFeaturesService.documentDropEditProvider.register(genericLanguageSelector, new PathProvider())); + this._register(languageFeaturesService.documentDropEditProvider.register(genericLanguageSelector, new RelativePathProvider(workspaceContextService))); + } +}; +DefaultDropProvidersFeature = __decorate48([ + __param43(0, ILanguageFeaturesService), + __param43(1, IWorkspaceContextService) +], DefaultDropProvidersFeature); +var DefaultPasteProvidersFeature = class DefaultPasteProvidersFeature2 extends Disposable { + constructor(languageFeaturesService, workspaceContextService) { + super(); + this._register(languageFeaturesService.documentPasteEditProvider.register(genericLanguageSelector, new DefaultTextPasteOrDropEditProvider())); + this._register(languageFeaturesService.documentPasteEditProvider.register(genericLanguageSelector, new PathProvider())); + this._register(languageFeaturesService.documentPasteEditProvider.register(genericLanguageSelector, new RelativePathProvider(workspaceContextService))); + this._register(languageFeaturesService.documentPasteEditProvider.register(genericLanguageSelector, new PasteHtmlProvider())); + } +}; +DefaultPasteProvidersFeature = __decorate48([ + __param43(0, ILanguageFeaturesService), + __param43(1, IWorkspaceContextService) +], DefaultPasteProvidersFeature); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/snippet/browser/snippetParser.js +var Scanner2 = class _Scanner { + constructor() { + this.value = ""; + this.pos = 0; + } + static { + this._table = { + [ + 36 + /* CharCode.DollarSign */ + ]: 0, + [ + 58 + /* CharCode.Colon */ + ]: 1, + [ + 44 + /* CharCode.Comma */ + ]: 2, + [ + 123 + /* CharCode.OpenCurlyBrace */ + ]: 3, + [ + 125 + /* CharCode.CloseCurlyBrace */ + ]: 4, + [ + 92 + /* CharCode.Backslash */ + ]: 5, + [ + 47 + /* CharCode.Slash */ + ]: 6, + [ + 124 + /* CharCode.Pipe */ + ]: 7, + [ + 43 + /* CharCode.Plus */ + ]: 11, + [ + 45 + /* CharCode.Dash */ + ]: 12, + [ + 63 + /* CharCode.QuestionMark */ + ]: 13 + }; + } + static isDigitCharacter(ch) { + return ch >= 48 && ch <= 57; + } + static isVariableCharacter(ch) { + return ch === 95 || ch >= 97 && ch <= 122 || ch >= 65 && ch <= 90; + } + text(value) { + this.value = value; + this.pos = 0; + } + tokenText(token) { + return this.value.substr(token.pos, token.len); + } + next() { + if (this.pos >= this.value.length) { + return { type: 14, pos: this.pos, len: 0 }; + } + const pos = this.pos; + let len = 0; + let ch = this.value.charCodeAt(pos); + let type; + type = _Scanner._table[ch]; + if (typeof type === "number") { + this.pos += 1; + return { type, pos, len: 1 }; + } + if (_Scanner.isDigitCharacter(ch)) { + type = 8; + do { + len += 1; + ch = this.value.charCodeAt(pos + len); + } while (_Scanner.isDigitCharacter(ch)); + this.pos += len; + return { type, pos, len }; + } + if (_Scanner.isVariableCharacter(ch)) { + type = 9; + do { + ch = this.value.charCodeAt(pos + ++len); + } while (_Scanner.isVariableCharacter(ch) || _Scanner.isDigitCharacter(ch)); + this.pos += len; + return { type, pos, len }; + } + type = 10; + do { + len += 1; + ch = this.value.charCodeAt(pos + len); + } while (!isNaN(ch) && typeof _Scanner._table[ch] === "undefined" && !_Scanner.isDigitCharacter(ch) && !_Scanner.isVariableCharacter(ch)); + this.pos += len; + return { type, pos, len }; + } +}; +var Marker = class { + constructor() { + this._children = []; + } + appendChild(child) { + if (child instanceof Text && this._children[this._children.length - 1] instanceof Text) { + this._children[this._children.length - 1].value += child.value; + } else { + child.parent = this; + this._children.push(child); + } + return this; + } + replace(child, others) { + const { parent } = child; + const idx = parent.children.indexOf(child); + const newChildren = parent.children.slice(0); + newChildren.splice(idx, 1, ...others); + parent._children = newChildren; + (function _fixParent(children, parent2) { + for (const child2 of children) { + child2.parent = parent2; + _fixParent(child2.children, child2); + } + })(others, parent); + } + get children() { + return this._children; + } + get rightMostDescendant() { + if (this._children.length > 0) { + return this._children[this._children.length - 1].rightMostDescendant; + } + return this; + } + get snippet() { + let candidate = this; + while (true) { + if (!candidate) { + return void 0; + } + if (candidate instanceof TextmateSnippet) { + return candidate; + } + candidate = candidate.parent; + } + } + toString() { + return this.children.reduce((prev, cur) => prev + cur.toString(), ""); + } + len() { + return 0; + } +}; +var Text = class _Text extends Marker { + constructor(value) { + super(); + this.value = value; + } + toString() { + return this.value; + } + len() { + return this.value.length; + } + clone() { + return new _Text(this.value); + } +}; +var TransformableMarker = class extends Marker { +}; +var Placeholder = class _Placeholder extends TransformableMarker { + static compareByIndex(a, b) { + if (a.index === b.index) { + return 0; + } else if (a.isFinalTabstop) { + return 1; + } else if (b.isFinalTabstop) { + return -1; + } else if (a.index < b.index) { + return -1; + } else if (a.index > b.index) { + return 1; + } else { + return 0; + } + } + constructor(index) { + super(); + this.index = index; + } + get isFinalTabstop() { + return this.index === 0; + } + get choice() { + return this._children.length === 1 && this._children[0] instanceof Choice ? this._children[0] : void 0; + } + clone() { + const ret = new _Placeholder(this.index); + if (this.transform) { + ret.transform = this.transform.clone(); + } + ret._children = this.children.map((child) => child.clone()); + return ret; + } +}; +var Choice = class _Choice extends Marker { + constructor() { + super(...arguments); + this.options = []; + } + appendChild(marker) { + if (marker instanceof Text) { + marker.parent = this; + this.options.push(marker); + } + return this; + } + toString() { + return this.options[0].value; + } + len() { + return this.options[0].len(); + } + clone() { + const ret = new _Choice(); + this.options.forEach(ret.appendChild, ret); + return ret; + } +}; +var Transform = class _Transform extends Marker { + constructor() { + super(...arguments); + this.regexp = new RegExp(""); + } + resolve(value) { + const _this = this; + let didMatch = false; + let ret = value.replace(this.regexp, function() { + didMatch = true; + return _this._replace(Array.prototype.slice.call(arguments, 0, -2)); + }); + if (!didMatch && this._children.some((child) => child instanceof FormatString && Boolean(child.elseValue))) { + ret = this._replace([]); + } + return ret; + } + _replace(groups) { + let ret = ""; + for (const marker of this._children) { + if (marker instanceof FormatString) { + let value = groups[marker.index] || ""; + value = marker.resolve(value); + ret += value; + } else { + ret += marker.toString(); + } + } + return ret; + } + toString() { + return ""; + } + clone() { + const ret = new _Transform(); + ret.regexp = new RegExp(this.regexp.source, (this.regexp.ignoreCase ? "i" : "") + (this.regexp.global ? "g" : "")); + ret._children = this.children.map((child) => child.clone()); + return ret; + } +}; +var FormatString = class _FormatString extends Marker { + constructor(index, shorthandName, ifValue, elseValue) { + super(); + this.index = index; + this.shorthandName = shorthandName; + this.ifValue = ifValue; + this.elseValue = elseValue; + } + resolve(value) { + if (this.shorthandName === "upcase") { + return !value ? "" : value.toLocaleUpperCase(); + } else if (this.shorthandName === "downcase") { + return !value ? "" : value.toLocaleLowerCase(); + } else if (this.shorthandName === "capitalize") { + return !value ? "" : value[0].toLocaleUpperCase() + value.substr(1); + } else if (this.shorthandName === "pascalcase") { + return !value ? "" : this._toPascalCase(value); + } else if (this.shorthandName === "camelcase") { + return !value ? "" : this._toCamelCase(value); + } else if (Boolean(value) && typeof this.ifValue === "string") { + return this.ifValue; + } else if (!Boolean(value) && typeof this.elseValue === "string") { + return this.elseValue; + } else { + return value || ""; + } + } + _toPascalCase(value) { + const match2 = value.match(/[a-z0-9]+/gi); + if (!match2) { + return value; + } + return match2.map((word) => { + return word.charAt(0).toUpperCase() + word.substr(1); + }).join(""); + } + _toCamelCase(value) { + const match2 = value.match(/[a-z0-9]+/gi); + if (!match2) { + return value; + } + return match2.map((word, index) => { + if (index === 0) { + return word.charAt(0).toLowerCase() + word.substr(1); + } + return word.charAt(0).toUpperCase() + word.substr(1); + }).join(""); + } + clone() { + const ret = new _FormatString(this.index, this.shorthandName, this.ifValue, this.elseValue); + return ret; + } +}; +var Variable = class _Variable extends TransformableMarker { + constructor(name) { + super(); + this.name = name; + } + resolve(resolver) { + let value = resolver.resolve(this); + if (this.transform) { + value = this.transform.resolve(value || ""); + } + if (value !== void 0) { + this._children = [new Text(value)]; + return true; + } + return false; + } + clone() { + const ret = new _Variable(this.name); + if (this.transform) { + ret.transform = this.transform.clone(); + } + ret._children = this.children.map((child) => child.clone()); + return ret; + } +}; +function walk(marker, visitor) { + const stack = [...marker]; + while (stack.length > 0) { + const marker2 = stack.shift(); + const recurse = visitor(marker2); + if (!recurse) { + break; + } + stack.unshift(...marker2.children); + } +} +var TextmateSnippet = class _TextmateSnippet extends Marker { + get placeholderInfo() { + if (!this._placeholders) { + const all = []; + let last; + this.walk(function(candidate) { + if (candidate instanceof Placeholder) { + all.push(candidate); + last = !last || last.index < candidate.index ? candidate : last; + } + return true; + }); + this._placeholders = { all, last }; + } + return this._placeholders; + } + get placeholders() { + const { all } = this.placeholderInfo; + return all; + } + offset(marker) { + let pos = 0; + let found = false; + this.walk((candidate) => { + if (candidate === marker) { + found = true; + return false; + } + pos += candidate.len(); + return true; + }); + if (!found) { + return -1; + } + return pos; + } + fullLen(marker) { + let ret = 0; + walk([marker], (marker2) => { + ret += marker2.len(); + return true; + }); + return ret; + } + enclosingPlaceholders(placeholder) { + const ret = []; + let { parent } = placeholder; + while (parent) { + if (parent instanceof Placeholder) { + ret.push(parent); + } + parent = parent.parent; + } + return ret; + } + resolveVariables(resolver) { + this.walk((candidate) => { + if (candidate instanceof Variable) { + if (candidate.resolve(resolver)) { + this._placeholders = void 0; + } + } + return true; + }); + return this; + } + appendChild(child) { + this._placeholders = void 0; + return super.appendChild(child); + } + replace(child, others) { + this._placeholders = void 0; + return super.replace(child, others); + } + clone() { + const ret = new _TextmateSnippet(); + this._children = this.children.map((child) => child.clone()); + return ret; + } + walk(visitor) { + walk(this.children, visitor); + } +}; +var SnippetParser = class { + constructor() { + this._scanner = new Scanner2(); + this._token = { type: 14, pos: 0, len: 0 }; + } + static escape(value) { + return value.replace(/\$|}|\\/g, "\\$&"); + } + static guessNeedsClipboard(template) { + return /\${?CLIPBOARD/.test(template); + } + parse(value, insertFinalTabstop, enforceFinalTabstop) { + const snippet = new TextmateSnippet(); + this.parseFragment(value, snippet); + this.ensureFinalTabstop(snippet, enforceFinalTabstop ?? false, insertFinalTabstop ?? false); + return snippet; + } + parseFragment(value, snippet) { + const offset = snippet.children.length; + this._scanner.text(value); + this._token = this._scanner.next(); + while (this._parse(snippet)) { + } + const placeholderDefaultValues = /* @__PURE__ */ new Map(); + const incompletePlaceholders = []; + snippet.walk((marker) => { + if (marker instanceof Placeholder) { + if (marker.isFinalTabstop) { + placeholderDefaultValues.set(0, void 0); + } else if (!placeholderDefaultValues.has(marker.index) && marker.children.length > 0) { + placeholderDefaultValues.set(marker.index, marker.children); + } else { + incompletePlaceholders.push(marker); + } + } + return true; + }); + const fillInIncompletePlaceholder = (placeholder, stack2) => { + const defaultValues = placeholderDefaultValues.get(placeholder.index); + if (!defaultValues) { + return; + } + const clone2 = new Placeholder(placeholder.index); + clone2.transform = placeholder.transform; + for (const child of defaultValues) { + const newChild = child.clone(); + clone2.appendChild(newChild); + if (newChild instanceof Placeholder && placeholderDefaultValues.has(newChild.index) && !stack2.has(newChild.index)) { + stack2.add(newChild.index); + fillInIncompletePlaceholder(newChild, stack2); + stack2.delete(newChild.index); + } + } + snippet.replace(placeholder, [clone2]); + }; + const stack = /* @__PURE__ */ new Set(); + for (const placeholder of incompletePlaceholders) { + fillInIncompletePlaceholder(placeholder, stack); + } + return snippet.children.slice(offset); + } + ensureFinalTabstop(snippet, enforceFinalTabstop, insertFinalTabstop) { + if (enforceFinalTabstop || insertFinalTabstop && snippet.placeholders.length > 0) { + const finalTabstop = snippet.placeholders.find((p) => p.index === 0); + if (!finalTabstop) { + snippet.appendChild(new Placeholder(0)); + } + } + } + _accept(type, value) { + if (type === void 0 || this._token.type === type) { + const ret = !value ? true : this._scanner.tokenText(this._token); + this._token = this._scanner.next(); + return ret; + } + return false; + } + _backTo(token) { + this._scanner.pos = token.pos + token.len; + this._token = token; + return false; + } + _until(type) { + const start = this._token; + while (this._token.type !== type) { + if (this._token.type === 14) { + return false; + } else if (this._token.type === 5) { + const nextToken = this._scanner.next(); + if (nextToken.type !== 0 && nextToken.type !== 4 && nextToken.type !== 5) { + return false; + } + } + this._token = this._scanner.next(); + } + const value = this._scanner.value.substring(start.pos, this._token.pos).replace(/\\(\$|}|\\)/g, "$1"); + this._token = this._scanner.next(); + return value; + } + _parse(marker) { + return this._parseEscaped(marker) || this._parseTabstopOrVariableName(marker) || this._parseComplexPlaceholder(marker) || this._parseComplexVariable(marker) || this._parseAnything(marker); + } + // \$, \\, \} -> just text + _parseEscaped(marker) { + let value; + if (value = this._accept(5, true)) { + value = this._accept(0, true) || this._accept(4, true) || this._accept(5, true) || value; + marker.appendChild(new Text(value)); + return true; + } + return false; + } + // $foo -> variable, $1 -> tabstop + _parseTabstopOrVariableName(parent) { + let value; + const token = this._token; + const match2 = this._accept( + 0 + /* TokenType.Dollar */ + ) && (value = this._accept(9, true) || this._accept(8, true)); + if (!match2) { + return this._backTo(token); + } + parent.appendChild(/^\d+$/.test(value) ? new Placeholder(Number(value)) : new Variable(value)); + return true; + } + // ${1:}, ${1} -> placeholder + _parseComplexPlaceholder(parent) { + let index; + const token = this._token; + const match2 = this._accept( + 0 + /* TokenType.Dollar */ + ) && this._accept( + 3 + /* TokenType.CurlyOpen */ + ) && (index = this._accept(8, true)); + if (!match2) { + return this._backTo(token); + } + const placeholder = new Placeholder(Number(index)); + if (this._accept( + 1 + /* TokenType.Colon */ + )) { + while (true) { + if (this._accept( + 4 + /* TokenType.CurlyClose */ + )) { + parent.appendChild(placeholder); + return true; + } + if (this._parse(placeholder)) { + continue; + } + parent.appendChild(new Text("${" + index + ":")); + placeholder.children.forEach(parent.appendChild, parent); + return true; + } + } else if (placeholder.index > 0 && this._accept( + 7 + /* TokenType.Pipe */ + )) { + const choice = new Choice(); + while (true) { + if (this._parseChoiceElement(choice)) { + if (this._accept( + 2 + /* TokenType.Comma */ + )) { + continue; + } + if (this._accept( + 7 + /* TokenType.Pipe */ + )) { + placeholder.appendChild(choice); + if (this._accept( + 4 + /* TokenType.CurlyClose */ + )) { + parent.appendChild(placeholder); + return true; + } + } + } + this._backTo(token); + return false; + } + } else if (this._accept( + 6 + /* TokenType.Forwardslash */ + )) { + if (this._parseTransform(placeholder)) { + parent.appendChild(placeholder); + return true; + } + this._backTo(token); + return false; + } else if (this._accept( + 4 + /* TokenType.CurlyClose */ + )) { + parent.appendChild(placeholder); + return true; + } else { + return this._backTo(token); + } + } + _parseChoiceElement(parent) { + const token = this._token; + const values = []; + while (true) { + if (this._token.type === 2 || this._token.type === 7) { + break; + } + let value; + if (value = this._accept(5, true)) { + value = this._accept(2, true) || this._accept(7, true) || this._accept(5, true) || value; + } else { + value = this._accept(void 0, true); + } + if (!value) { + this._backTo(token); + return false; + } + values.push(value); + } + if (values.length === 0) { + this._backTo(token); + return false; + } + parent.appendChild(new Text(values.join(""))); + return true; + } + // ${foo:}, ${foo} -> variable + _parseComplexVariable(parent) { + let name; + const token = this._token; + const match2 = this._accept( + 0 + /* TokenType.Dollar */ + ) && this._accept( + 3 + /* TokenType.CurlyOpen */ + ) && (name = this._accept(9, true)); + if (!match2) { + return this._backTo(token); + } + const variable = new Variable(name); + if (this._accept( + 1 + /* TokenType.Colon */ + )) { + while (true) { + if (this._accept( + 4 + /* TokenType.CurlyClose */ + )) { + parent.appendChild(variable); + return true; + } + if (this._parse(variable)) { + continue; + } + parent.appendChild(new Text("${" + name + ":")); + variable.children.forEach(parent.appendChild, parent); + return true; + } + } else if (this._accept( + 6 + /* TokenType.Forwardslash */ + )) { + if (this._parseTransform(variable)) { + parent.appendChild(variable); + return true; + } + this._backTo(token); + return false; + } else if (this._accept( + 4 + /* TokenType.CurlyClose */ + )) { + parent.appendChild(variable); + return true; + } else { + return this._backTo(token); + } + } + _parseTransform(parent) { + const transform = new Transform(); + let regexValue = ""; + let regexOptions = ""; + while (true) { + if (this._accept( + 6 + /* TokenType.Forwardslash */ + )) { + break; + } + let escaped; + if (escaped = this._accept(5, true)) { + escaped = this._accept(6, true) || escaped; + regexValue += escaped; + continue; + } + if (this._token.type !== 14) { + regexValue += this._accept(void 0, true); + continue; + } + return false; + } + while (true) { + if (this._accept( + 6 + /* TokenType.Forwardslash */ + )) { + break; + } + let escaped; + if (escaped = this._accept(5, true)) { + escaped = this._accept(5, true) || this._accept(6, true) || escaped; + transform.appendChild(new Text(escaped)); + continue; + } + if (this._parseFormatString(transform) || this._parseAnything(transform)) { + continue; + } + return false; + } + while (true) { + if (this._accept( + 4 + /* TokenType.CurlyClose */ + )) { + break; + } + if (this._token.type !== 14) { + regexOptions += this._accept(void 0, true); + continue; + } + return false; + } + try { + transform.regexp = new RegExp(regexValue, regexOptions); + } catch (e) { + return false; + } + parent.transform = transform; + return true; + } + _parseFormatString(parent) { + const token = this._token; + if (!this._accept( + 0 + /* TokenType.Dollar */ + )) { + return false; + } + let complex = false; + if (this._accept( + 3 + /* TokenType.CurlyOpen */ + )) { + complex = true; + } + const index = this._accept(8, true); + if (!index) { + this._backTo(token); + return false; + } else if (!complex) { + parent.appendChild(new FormatString(Number(index))); + return true; + } else if (this._accept( + 4 + /* TokenType.CurlyClose */ + )) { + parent.appendChild(new FormatString(Number(index))); + return true; + } else if (!this._accept( + 1 + /* TokenType.Colon */ + )) { + this._backTo(token); + return false; + } + if (this._accept( + 6 + /* TokenType.Forwardslash */ + )) { + const shorthand = this._accept(9, true); + if (!shorthand || !this._accept( + 4 + /* TokenType.CurlyClose */ + )) { + this._backTo(token); + return false; + } else { + parent.appendChild(new FormatString(Number(index), shorthand)); + return true; + } + } else if (this._accept( + 11 + /* TokenType.Plus */ + )) { + const ifValue = this._until( + 4 + /* TokenType.CurlyClose */ + ); + if (ifValue) { + parent.appendChild(new FormatString(Number(index), void 0, ifValue, void 0)); + return true; + } + } else if (this._accept( + 12 + /* TokenType.Dash */ + )) { + const elseValue = this._until( + 4 + /* TokenType.CurlyClose */ + ); + if (elseValue) { + parent.appendChild(new FormatString(Number(index), void 0, void 0, elseValue)); + return true; + } + } else if (this._accept( + 13 + /* TokenType.QuestionMark */ + )) { + const ifValue = this._until( + 1 + /* TokenType.Colon */ + ); + if (ifValue) { + const elseValue = this._until( + 4 + /* TokenType.CurlyClose */ + ); + if (elseValue) { + parent.appendChild(new FormatString(Number(index), void 0, ifValue, elseValue)); + return true; + } + } + } else { + const elseValue = this._until( + 4 + /* TokenType.CurlyClose */ + ); + if (elseValue) { + parent.appendChild(new FormatString(Number(index), void 0, void 0, elseValue)); + return true; + } + } + this._backTo(token); + return false; + } + _parseAnything(marker) { + if (this._token.type !== 14) { + marker.appendChild(new Text(this._scanner.tokenText(this._token))); + this._accept(void 0); + return true; + } + return false; + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/dropOrPasteInto/browser/edit.js +function createCombinedWorkspaceEdit(uri, ranges, edit2) { + if (typeof edit2.insertText === "string" ? edit2.insertText === "" : edit2.insertText.snippet === "") { + return { + edits: edit2.additionalEdit?.edits ?? [] + }; + } + return { + edits: [ + ...ranges.map((range2) => new ResourceTextEdit(uri, { range: range2, text: typeof edit2.insertText === "string" ? SnippetParser.escape(edit2.insertText) + "$0" : edit2.insertText.snippet, insertAsSnippet: true })), + ...edit2.additionalEdit?.edits ?? [] + ] + }; +} +function sortEditsByYieldTo(edits) { + function yieldsTo(yTo, other) { + if ("mimeType" in yTo) { + return yTo.mimeType === other.handledMimeType; + } + return !!other.kind && yTo.kind.contains(other.kind); + } + const yieldsToMap = /* @__PURE__ */ new Map(); + for (const edit2 of edits) { + for (const yTo of edit2.yieldTo ?? []) { + for (const other of edits) { + if (other === edit2) { + continue; + } + if (yieldsTo(yTo, other)) { + let arr = yieldsToMap.get(edit2); + if (!arr) { + arr = []; + yieldsToMap.set(edit2, arr); + } + arr.push(other); + } + } + } + } + if (!yieldsToMap.size) { + return Array.from(edits); + } + const visited = /* @__PURE__ */ new Set(); + const tempStack = []; + function visit(nodes) { + if (!nodes.length) { + return []; + } + const node = nodes[0]; + if (tempStack.includes(node)) { + console.warn("Yield to cycle detected", node); + return nodes; + } + if (visited.has(node)) { + return visit(nodes.slice(1)); + } + let pre = []; + const yTo = yieldsToMap.get(node); + if (yTo) { + tempStack.push(node); + pre = visit(yTo); + tempStack.pop(); + } + visited.add(node); + return [...pre, node, ...visit(nodes.slice(1))]; + } + return visit(Array.from(edits)); +} + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/dropOrPasteInto/browser/postEditWidget.js +init_dom(); + +// node_modules/monaco-editor-core/esm/vs/base/browser/ui/button/button.js +init_dom(); +init_keyboardEvent(); +init_iconLabels2(); +init_color(); +init_event(); +init_htmlContent(); +init_lifecycle(); +init_themables(); +var unthemedButtonStyles = { + buttonBackground: "#0E639C", + buttonHoverBackground: "#006BB3", + buttonSeparator: Color.white.toString(), + buttonForeground: Color.white.toString(), + buttonBorder: void 0, + buttonSecondaryBackground: void 0, + buttonSecondaryForeground: void 0, + buttonSecondaryHoverBackground: void 0 +}; +var buttonSanitizerConfig = Object.freeze({ + allowedTags: { + override: ["b", "i", "u", "code", "span"] + }, + allowedAttributes: { + override: ["class"] + } +}); +var Button = class extends Disposable { + get onDidClick() { + return this._onDidClick.event; + } + constructor(container, options2) { + super(); + this._label = ""; + this._onDidClick = this._register(new Emitter()); + this._onDidEscape = this._register(new Emitter()); + this.options = options2; + this._element = document.createElement("a"); + this._element.classList.add("monaco-button"); + this._element.tabIndex = 0; + this._element.setAttribute("role", "button"); + this._element.classList.toggle("secondary", !!options2.secondary); + const background = options2.secondary ? options2.buttonSecondaryBackground : options2.buttonBackground; + const foreground2 = options2.secondary ? options2.buttonSecondaryForeground : options2.buttonForeground; + this._element.style.color = foreground2 || ""; + this._element.style.backgroundColor = background || ""; + if (options2.supportShortLabel) { + this._labelShortElement = document.createElement("div"); + this._labelShortElement.classList.add("monaco-button-label-short"); + this._element.appendChild(this._labelShortElement); + this._labelElement = document.createElement("div"); + this._labelElement.classList.add("monaco-button-label"); + this._element.appendChild(this._labelElement); + this._element.classList.add("monaco-text-button-with-short-label"); + } + if (typeof options2.title === "string") { + this.setTitle(options2.title); + } + if (typeof options2.ariaLabel === "string") { + this._element.setAttribute("aria-label", options2.ariaLabel); + } + container.appendChild(this._element); + this.enabled = !options2.disabled; + this._register(Gesture.addTarget(this._element)); + [EventType.CLICK, EventType2.Tap].forEach((eventType) => { + this._register(addDisposableListener(this._element, eventType, (e) => { + if (!this.enabled) { + EventHelper.stop(e); + return; + } + this._onDidClick.fire(e); + })); + }); + this._register(addDisposableListener(this._element, EventType.KEY_DOWN, (e) => { + const event = new StandardKeyboardEvent(e); + let eventHandled = false; + if (this.enabled && (event.equals( + 3 + /* KeyCode.Enter */ + ) || event.equals( + 10 + /* KeyCode.Space */ + ))) { + this._onDidClick.fire(e); + eventHandled = true; + } else if (event.equals( + 9 + /* KeyCode.Escape */ + )) { + this._onDidEscape.fire(e); + this._element.blur(); + eventHandled = true; + } + if (eventHandled) { + EventHelper.stop(event, true); + } + })); + this._register(addDisposableListener(this._element, EventType.MOUSE_OVER, (e) => { + if (!this._element.classList.contains("disabled")) { + this.updateBackground(true); + } + })); + this._register(addDisposableListener(this._element, EventType.MOUSE_OUT, (e) => { + this.updateBackground(false); + })); + this.focusTracker = this._register(trackFocus(this._element)); + this._register(this.focusTracker.onDidFocus(() => { + if (this.enabled) { + this.updateBackground(true); + } + })); + this._register(this.focusTracker.onDidBlur(() => { + if (this.enabled) { + this.updateBackground(false); + } + })); + } + dispose() { + super.dispose(); + this._element.remove(); + } + getContentElements(content) { + const elements = []; + for (let segment of renderLabelWithIcons(content)) { + if (typeof segment === "string") { + segment = segment.trim(); + if (segment === "") { + continue; + } + const node = document.createElement("span"); + node.textContent = segment; + elements.push(node); + } else { + elements.push(segment); + } + } + return elements; + } + updateBackground(hover) { + let background; + if (this.options.secondary) { + background = hover ? this.options.buttonSecondaryHoverBackground : this.options.buttonSecondaryBackground; + } else { + background = hover ? this.options.buttonHoverBackground : this.options.buttonBackground; + } + if (background) { + this._element.style.backgroundColor = background; + } + } + get element() { + return this._element; + } + set label(value) { + if (this._label === value) { + return; + } + if (isMarkdownString(this._label) && isMarkdownString(value) && markdownStringEqual(this._label, value)) { + return; + } + this._element.classList.add("monaco-text-button"); + const labelElement = this.options.supportShortLabel ? this._labelElement : this._element; + if (isMarkdownString(value)) { + const rendered = renderMarkdown(value, void 0, document.createElement("span")); + rendered.dispose(); + const root = rendered.element.querySelector("p")?.innerHTML; + if (root) { + safeSetInnerHtml(labelElement, root, buttonSanitizerConfig); + } else { + reset(labelElement); + } + } else { + if (this.options.supportIcons) { + reset(labelElement, ...this.getContentElements(value)); + } else { + labelElement.textContent = value; + } + } + let title = ""; + if (typeof this.options.title === "string") { + title = this.options.title; + } else if (this.options.title) { + title = renderAsPlaintext(value); + } + this.setTitle(title); + this._setAriaLabel(); + this._label = value; + } + get label() { + return this._label; + } + _setAriaLabel() { + if (typeof this.options.ariaLabel === "string") { + this._element.setAttribute("aria-label", this.options.ariaLabel); + } else if (typeof this.options.title === "string") { + this._element.setAttribute("aria-label", this.options.title); + } + } + set icon(icon) { + this._setAriaLabel(); + const oldIcons = Array.from(this._element.classList).filter((item) => item.startsWith("codicon-")); + this._element.classList.remove(...oldIcons); + this._element.classList.add(...ThemeIcon.asClassNameArray(icon)); + } + set enabled(value) { + if (value) { + this._element.classList.remove("disabled"); + this._element.setAttribute("aria-disabled", String(false)); + this._element.tabIndex = 0; + } else { + this._element.classList.add("disabled"); + this._element.setAttribute("aria-disabled", String(true)); + } + } + get enabled() { + return !this._element.classList.contains("disabled"); + } + setTitle(title) { + if (!this._hover && title !== "") { + this._hover = this._register(getBaseLayerHoverDelegate().setupManagedHover(this.options.hoverDelegate ?? getDefaultHoverDelegate("element"), this._element, title)); + } else if (this._hover) { + this._hover.update(title); + } + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/dropOrPasteInto/browser/postEditWidget.js +init_async(); +init_codicons(); + +// node_modules/monaco-editor-core/esm/vs/base/common/errorMessage.js +init_arrays(); +init_types(); +init_nls(); +function exceptionToErrorMessage(exception, verbose) { + if (verbose && (exception.stack || exception.stacktrace)) { + return localize(29, "{0}: {1}", detectSystemErrorMessage(exception), stackToString(exception.stack) || stackToString(exception.stacktrace)); + } + return detectSystemErrorMessage(exception); +} +function stackToString(stack) { + if (Array.isArray(stack)) { + return stack.join("\n"); + } + return stack; +} +function detectSystemErrorMessage(exception) { + if (exception.code === "ERR_UNC_HOST_NOT_ALLOWED") { + return `${exception.message}. Please update the 'security.allowedUNCHosts' setting if you want to allow this host.`; + } + if (typeof exception.code === "string" && typeof exception.errno === "number" && typeof exception.syscall === "string") { + return localize(30, "A system error occurred ({0})", exception.message); + } + return exception.message || localize(31, "An unknown error occurred. Please consult the log for more details."); +} +function toErrorMessage(error = null, verbose = false) { + if (!error) { + return localize(32, "An unknown error occurred. Please consult the log for more details."); + } + if (Array.isArray(error)) { + const errors = coalesce(error); + const msg = toErrorMessage(errors[0], verbose); + if (errors.length > 1) { + return localize(33, "{0} ({1} errors in total)", msg, errors.length); + } + return msg; + } + if (isString(error)) { + return error; + } + if (error.detail) { + const detail = error.detail; + if (detail.error) { + return exceptionToErrorMessage(detail.error, verbose); + } + if (detail.exception) { + return exceptionToErrorMessage(detail.exception, verbose); + } + } + if (error.stack) { + return exceptionToErrorMessage(error, verbose); + } + if (error.message) { + return error.message; + } + return localize(34, "An unknown error occurred. Please consult the log for more details."); +} + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/dropOrPasteInto/browser/postEditWidget.js +init_errors(); +init_event(); +init_lifecycle(); +init_themables(); +init_nls(); + +// node_modules/monaco-editor-core/esm/vs/platform/actionWidget/browser/actionWidget.js +init_dom(); +init_lifecycle(); +init_nls(); + +// node_modules/monaco-editor-core/esm/vs/platform/actionWidget/browser/actionList.js +init_dom(); + +// node_modules/monaco-editor-core/esm/vs/base/browser/ui/keybindingLabel/keybindingLabel.js +init_dom(); +init_lifecycle(); +init_objects(); +init_nls(); +var $3 = $; +var unthemedKeybindingLabelOptions = { + keybindingLabelBackground: void 0, + keybindingLabelForeground: void 0, + keybindingLabelBorder: void 0, + keybindingLabelBottomBorder: void 0, + keybindingLabelShadow: void 0 +}; +var KeybindingLabel = class _KeybindingLabel extends Disposable { + constructor(container, os, options2) { + super(); + this.os = os; + this.keyElements = /* @__PURE__ */ new Set(); + this.options = options2 || /* @__PURE__ */ Object.create(null); + const labelForeground = this.options.keybindingLabelForeground; + this.domNode = append(container, $3(".monaco-keybinding")); + if (labelForeground) { + this.domNode.style.color = labelForeground; + } + this.hover = this._register(getBaseLayerHoverDelegate().setupManagedHover(getDefaultHoverDelegate("mouse"), this.domNode, "")); + this.didEverRender = false; + container.appendChild(this.domNode); + } + set(keybinding, matches) { + if (this.didEverRender && this.keybinding === keybinding && _KeybindingLabel.areSame(this.matches, matches)) { + return; + } + this.keybinding = keybinding; + this.matches = matches; + this.render(); + } + render() { + this.clear(); + if (this.keybinding) { + const chords = this.keybinding.getChords(); + if (chords[0]) { + this.renderChord(this.domNode, chords[0], this.matches ? this.matches.firstPart : null); + } + for (let i2 = 1; i2 < chords.length; i2++) { + append(this.domNode, $3("span.monaco-keybinding-key-chord-separator", void 0, " ")); + this.renderChord(this.domNode, chords[i2], this.matches ? this.matches.chordPart : null); + } + const title = this.options.disableTitle ?? false ? void 0 : this.keybinding.getAriaLabel() || void 0; + this.hover.update(title); + this.domNode.setAttribute("aria-label", title || ""); + } else if (this.options && this.options.renderUnboundKeybindings) { + this.renderUnbound(this.domNode); + } + this.didEverRender = true; + } + clear() { + clearNode(this.domNode); + this.keyElements.clear(); + } + renderChord(parent, chord, match2) { + const modifierLabels = UILabelProvider.modifierLabels[this.os]; + if (chord.ctrlKey) { + this.renderKey(parent, modifierLabels.ctrlKey, Boolean(match2?.ctrlKey), modifierLabels.separator); + } + if (chord.shiftKey) { + this.renderKey(parent, modifierLabels.shiftKey, Boolean(match2?.shiftKey), modifierLabels.separator); + } + if (chord.altKey) { + this.renderKey(parent, modifierLabels.altKey, Boolean(match2?.altKey), modifierLabels.separator); + } + if (chord.metaKey) { + this.renderKey(parent, modifierLabels.metaKey, Boolean(match2?.metaKey), modifierLabels.separator); + } + const keyLabel = chord.keyLabel; + if (keyLabel) { + this.renderKey(parent, keyLabel, Boolean(match2?.keyCode), ""); + } + } + renderKey(parent, label, highlight, separator2) { + append(parent, this.createKeyElement(label, highlight ? ".highlight" : "")); + if (separator2) { + append(parent, $3("span.monaco-keybinding-key-separator", void 0, separator2)); + } + } + renderUnbound(parent) { + append(parent, this.createKeyElement(localize(15, "Unbound"))); + } + createKeyElement(label, extraClass = "") { + const keyElement = $3("span.monaco-keybinding-key" + extraClass, void 0, label); + this.keyElements.add(keyElement); + if (this.options.keybindingLabelBackground) { + keyElement.style.backgroundColor = this.options.keybindingLabelBackground; + } + if (this.options.keybindingLabelBorder) { + keyElement.style.borderColor = this.options.keybindingLabelBorder; + } + if (this.options.keybindingLabelBottomBorder) { + keyElement.style.borderBottomColor = this.options.keybindingLabelBottomBorder; + } + if (this.options.keybindingLabelShadow) { + keyElement.style.boxShadow = `inset 0 -1px 0 ${this.options.keybindingLabelShadow}`; + } + return keyElement; + } + static areSame(a, b) { + if (a === b || !a && !b) { + return true; + } + return !!a && !!b && equals2(a.firstPart, b.firstPart) && equals2(a.chordPart, b.chordPart); + } +}; + +// node_modules/monaco-editor-core/esm/vs/platform/actionWidget/browser/actionList.js +init_cancellation(); +init_codicons(); +init_lifecycle(); +init_platform(); +init_themables(); +init_nls(); +init_colorRegistry(); + +// node_modules/monaco-editor-core/esm/vs/platform/layout/browser/layoutService.js +init_instantiation(); +var ILayoutService = createDecorator("layoutService"); + +// node_modules/monaco-editor-core/esm/vs/platform/actionWidget/browser/actionList.js +var __decorate49 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param44 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var acceptSelectedActionCommand = "acceptSelectedCodeAction"; +var previewSelectedActionCommand = "previewSelectedCodeAction"; +var HeaderRenderer = class { + get templateId() { + return "header"; + } + renderTemplate(container) { + container.classList.add("group-header"); + const text2 = document.createElement("span"); + container.append(text2); + return { container, text: text2 }; + } + renderElement(element, _index, templateData) { + templateData.text.textContent = element.group?.title ?? element.label ?? ""; + } + disposeTemplate(_templateData) { + } +}; +var SeparatorRenderer = class { + get templateId() { + return "separator"; + } + renderTemplate(container) { + container.classList.add("separator"); + const text2 = document.createElement("span"); + container.append(text2); + return { container, text: text2 }; + } + renderElement(element, _index, templateData) { + templateData.text.textContent = element.label ?? ""; + } + disposeTemplate(_templateData) { + } +}; +var ActionItemRenderer = class ActionItemRenderer2 { + get templateId() { + return "action"; + } + constructor(_supportsPreview, _keybindingService) { + this._supportsPreview = _supportsPreview; + this._keybindingService = _keybindingService; + } + renderTemplate(container) { + container.classList.add(this.templateId); + const icon = document.createElement("div"); + icon.className = "icon"; + container.append(icon); + const text2 = document.createElement("span"); + text2.className = "title"; + container.append(text2); + const description = document.createElement("span"); + description.className = "description"; + container.append(description); + const keybinding = new KeybindingLabel(container, OS); + return { container, icon, text: text2, description, keybinding }; + } + renderElement(element, _index, data) { + if (element.group?.icon) { + data.icon.className = ThemeIcon.asClassName(element.group.icon); + if (element.group.icon.color) { + data.icon.style.color = asCssVariable(element.group.icon.color.id); + } + } else { + data.icon.className = ThemeIcon.asClassName(Codicon.lightBulb); + data.icon.style.color = "var(--vscode-editorLightBulb-foreground)"; + } + if (!element.item || !element.label) { + return; + } + setVisibility(!element.hideIcon, data.icon); + data.text.textContent = stripNewlines(element.label); + if (element.keybinding) { + data.description.textContent = element.keybinding.getLabel(); + data.description.style.display = "inline"; + data.description.style.letterSpacing = "0.5px"; + } else if (element.description) { + data.description.textContent = stripNewlines(element.description); + data.description.style.display = "inline"; + } else { + data.description.textContent = ""; + data.description.style.display = "none"; + } + const actionTitle = this._keybindingService.lookupKeybinding(acceptSelectedActionCommand)?.getLabel(); + const previewTitle = this._keybindingService.lookupKeybinding(previewSelectedActionCommand)?.getLabel(); + data.container.classList.toggle("option-disabled", element.disabled); + if (element.tooltip) { + data.container.title = element.tooltip; + } else if (element.disabled) { + data.container.title = element.label; + } else if (actionTitle && previewTitle) { + if (this._supportsPreview && element.canPreview) { + data.container.title = localize(1653, "{0} to Apply, {1} to Preview", actionTitle, previewTitle); + } else { + data.container.title = localize(1654, "{0} to Apply", actionTitle); + } + } else { + data.container.title = ""; + } + } + disposeTemplate(templateData) { + templateData.keybinding.dispose(); + } +}; +ActionItemRenderer = __decorate49([ + __param44(1, IKeybindingService) +], ActionItemRenderer); +var AcceptSelectedEvent = class extends UIEvent { + constructor() { + super("acceptSelectedAction"); + } +}; +var PreviewSelectedEvent = class extends UIEvent { + constructor() { + super("previewSelectedAction"); + } +}; +function getKeyboardNavigationLabel(item) { + if (item.kind === "action") { + return item.label; + } + return void 0; +} +var ActionList = class ActionList2 extends Disposable { + constructor(user, preview, items, _delegate, accessibilityProvider, _contextViewService, _keybindingService, _layoutService) { + super(); + this._delegate = _delegate; + this._contextViewService = _contextViewService; + this._keybindingService = _keybindingService; + this._layoutService = _layoutService; + this._actionLineHeight = 28; + this._headerLineHeight = 28; + this._separatorLineHeight = 8; + this.cts = this._register(new CancellationTokenSource()); + this.domNode = document.createElement("div"); + this.domNode.classList.add("actionList"); + const virtualDelegate = { + getHeight: (element) => { + switch (element.kind) { + case "header": + return this._headerLineHeight; + case "separator": + return this._separatorLineHeight; + default: + return this._actionLineHeight; + } + }, + getTemplateId: (element) => element.kind + }; + this._list = this._register(new List(user, this.domNode, virtualDelegate, [ + new ActionItemRenderer(preview, this._keybindingService), + new HeaderRenderer(), + new SeparatorRenderer() + ], { + keyboardSupport: false, + typeNavigationEnabled: true, + keyboardNavigationLabelProvider: { getKeyboardNavigationLabel }, + accessibilityProvider: { + getAriaLabel: (element) => { + if (element.kind === "action") { + let label = element.label ? stripNewlines(element?.label) : ""; + if (element.description) { + label = label + ", " + stripNewlines(element.description); + } + if (element.disabled) { + label = localize(1655, "{0}, Disabled Reason: {1}", label, element.disabled); + } + return label; + } + return null; + }, + getWidgetAriaLabel: () => localize(1656, "Action Widget"), + getRole: (e) => { + switch (e.kind) { + case "action": + return "option"; + case "separator": + return "separator"; + default: + return "separator"; + } + }, + getWidgetRole: () => "listbox", + ...accessibilityProvider + } + })); + this._list.style(defaultListStyles); + this._register(this._list.onMouseClick((e) => this.onListClick(e))); + this._register(this._list.onMouseOver((e) => this.onListHover(e))); + this._register(this._list.onDidChangeFocus(() => this.onFocus())); + this._register(this._list.onDidChangeSelection((e) => this.onListSelection(e))); + this._allMenuItems = items; + this._list.splice(0, this._list.length, this._allMenuItems); + if (this._list.length) { + this.focusNext(); + } + } + focusCondition(element) { + return !element.disabled && element.kind === "action"; + } + hide(didCancel) { + this._delegate.onHide(didCancel); + this.cts.cancel(); + this._contextViewService.hideContextView(); + } + layout(minWidth) { + const numHeaders = this._allMenuItems.filter((item) => item.kind === "header").length; + const numSeparators = this._allMenuItems.filter((item) => item.kind === "separator").length; + const itemsHeight = this._allMenuItems.length * this._actionLineHeight; + const heightWithHeaders = itemsHeight + numHeaders * this._headerLineHeight - numHeaders * this._actionLineHeight; + const heightWithSeparators = heightWithHeaders + numSeparators * this._separatorLineHeight - numSeparators * this._actionLineHeight; + this._list.layout(heightWithSeparators); + let maxWidth = minWidth; + if (this._allMenuItems.length >= 50) { + maxWidth = 380; + } else { + const itemWidths = this._allMenuItems.map((_, index) => { + const element = this.domNode.ownerDocument.getElementById(this._list.getElementID(index)); + if (element) { + element.style.width = "auto"; + const width2 = element.getBoundingClientRect().width; + element.style.width = ""; + return width2; + } + return 0; + }); + maxWidth = Math.max(...itemWidths, minWidth); + } + const maxVhPrecentage = 0.7; + const height = Math.min(heightWithSeparators, this._layoutService.getContainer(getWindow(this.domNode)).clientHeight * maxVhPrecentage); + this._list.layout(height, maxWidth); + this.domNode.style.height = `${height}px`; + this._list.domFocus(); + return maxWidth; + } + focusPrevious() { + this._list.focusPrevious(1, true, void 0, this.focusCondition); + } + focusNext() { + this._list.focusNext(1, true, void 0, this.focusCondition); + } + acceptSelected(preview) { + const focused = this._list.getFocus(); + if (focused.length === 0) { + return; + } + const focusIndex = focused[0]; + const element = this._list.element(focusIndex); + if (!this.focusCondition(element)) { + return; + } + const event = preview ? new PreviewSelectedEvent() : new AcceptSelectedEvent(); + this._list.setSelection([focusIndex], event); + } + onListSelection(e) { + if (!e.elements.length) { + return; + } + const element = e.elements[0]; + if (element.item && this.focusCondition(element)) { + this._delegate.onSelect(element.item, e.browserEvent instanceof PreviewSelectedEvent); + } else { + this._list.setSelection([]); + } + } + onFocus() { + const focused = this._list.getFocus(); + if (focused.length === 0) { + return; + } + const focusIndex = focused[0]; + const element = this._list.element(focusIndex); + this._delegate.onFocus?.(element.item); + } + async onListHover(e) { + const element = e.element; + if (element && element.item && this.focusCondition(element)) { + if (this._delegate.onHover && !element.disabled && element.kind === "action") { + const result = await this._delegate.onHover(element.item, this.cts.token); + element.canPreview = result ? result.canPreview : void 0; + } + if (e.index) { + this._list.splice(e.index, 1, [element]); + } + } + this._list.setFocus(typeof e.index === "number" ? [e.index] : []); + } + onListClick(e) { + if (e.element && this.focusCondition(e.element)) { + this._list.setFocus([]); + } + } +}; +ActionList = __decorate49([ + __param44(5, IContextViewService), + __param44(6, IKeybindingService), + __param44(7, ILayoutService) +], ActionList); +function stripNewlines(str) { + return str.replace(/\r\n|\r|\n/g, " "); +} + +// node_modules/monaco-editor-core/esm/vs/platform/actionWidget/browser/actionWidget.js +init_actions2(); +init_contextkey(); +init_extensions(); +init_instantiation(); +init_colorRegistry(); +var __decorate50 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param45 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +registerColor("actionBar.toggledBackground", inputActiveOptionBackground, localize(1657, "Background color for toggled action items in action bar.")); +var ActionWidgetContextKeys = { + Visible: new RawContextKey("codeActionMenuVisible", false, localize(1658, "Whether the action widget list is visible")) +}; +var IActionWidgetService = createDecorator("actionWidgetService"); +var ActionWidgetService = class ActionWidgetService2 extends Disposable { + get isVisible() { + return ActionWidgetContextKeys.Visible.getValue(this._contextKeyService) || false; + } + constructor(_contextViewService, _contextKeyService, _instantiationService) { + super(); + this._contextViewService = _contextViewService; + this._contextKeyService = _contextKeyService; + this._instantiationService = _instantiationService; + this._list = this._register(new MutableDisposable()); + } + show(user, supportsPreview, items, delegate, anchor, container, actionBarActions, accessibilityProvider) { + const visibleContext = ActionWidgetContextKeys.Visible.bindTo(this._contextKeyService); + const list2 = this._instantiationService.createInstance(ActionList, user, supportsPreview, items, delegate, accessibilityProvider); + this._contextViewService.showContextView({ + getAnchor: () => anchor, + render: (container2) => { + visibleContext.set(true); + return this._renderWidget(container2, list2, actionBarActions ?? []); + }, + onHide: (didCancel) => { + visibleContext.reset(); + this._onWidgetClosed(didCancel); + } + }, container, false); + } + acceptSelected(preview) { + this._list.value?.acceptSelected(preview); + } + focusPrevious() { + this._list?.value?.focusPrevious(); + } + focusNext() { + this._list?.value?.focusNext(); + } + hide(didCancel) { + this._list.value?.hide(didCancel); + this._list.clear(); + } + _renderWidget(element, list2, actionBarActions) { + const widget = document.createElement("div"); + widget.classList.add("action-widget"); + element.appendChild(widget); + this._list.value = list2; + if (this._list.value) { + widget.appendChild(this._list.value.domNode); + } else { + throw new Error("List has no value"); + } + const renderDisposables = new DisposableStore(); + const menuBlock = document.createElement("div"); + const block2 = element.appendChild(menuBlock); + block2.classList.add("context-view-block"); + renderDisposables.add(addDisposableListener(block2, EventType.MOUSE_DOWN, (e) => e.stopPropagation())); + const pointerBlockDiv = document.createElement("div"); + const pointerBlock = element.appendChild(pointerBlockDiv); + pointerBlock.classList.add("context-view-pointerBlock"); + renderDisposables.add(addDisposableListener(pointerBlock, EventType.POINTER_MOVE, () => pointerBlock.remove())); + renderDisposables.add(addDisposableListener(pointerBlock, EventType.MOUSE_DOWN, () => pointerBlock.remove())); + let actionBarWidth = 0; + if (actionBarActions.length) { + const actionBar2 = this._createActionBar(".action-widget-action-bar", actionBarActions); + if (actionBar2) { + widget.appendChild(actionBar2.getContainer().parentElement); + renderDisposables.add(actionBar2); + actionBarWidth = actionBar2.getContainer().offsetWidth; + } + } + const width2 = this._list.value?.layout(actionBarWidth); + widget.style.width = `${width2}px`; + const focusTracker = renderDisposables.add(trackFocus(element)); + renderDisposables.add(focusTracker.onDidBlur(() => this.hide(true))); + return renderDisposables; + } + _createActionBar(className2, actions) { + if (!actions.length) { + return void 0; + } + const container = $(className2); + const actionBar2 = new ActionBar(container); + actionBar2.push(actions, { icon: false, label: true }); + return actionBar2; + } + _onWidgetClosed(didCancel) { + this._list.value?.hide(didCancel); + } +}; +ActionWidgetService = __decorate50([ + __param45(0, IContextViewService), + __param45(1, IContextKeyService), + __param45(2, IInstantiationService) +], ActionWidgetService); +registerSingleton( + IActionWidgetService, + ActionWidgetService, + 1 + /* InstantiationType.Delayed */ +); +var weight = 100 + 1e3; +registerAction2(class extends Action2 { + constructor() { + super({ + id: "hideCodeActionWidget", + title: localize2(1659, "Hide action widget"), + precondition: ActionWidgetContextKeys.Visible, + keybinding: { + weight, + primary: 9, + secondary: [ + 1024 | 9 + /* KeyCode.Escape */ + ] + } + }); + } + run(accessor) { + accessor.get(IActionWidgetService).hide(true); + } +}); +registerAction2(class extends Action2 { + constructor() { + super({ + id: "selectPrevCodeAction", + title: localize2(1660, "Select previous action"), + precondition: ActionWidgetContextKeys.Visible, + keybinding: { + weight, + primary: 16, + secondary: [ + 2048 | 16 + /* KeyCode.UpArrow */ + ], + mac: { primary: 16, secondary: [ + 2048 | 16, + 256 | 46 + /* KeyCode.KeyP */ + ] } + } + }); + } + run(accessor) { + const widgetService = accessor.get(IActionWidgetService); + if (widgetService instanceof ActionWidgetService) { + widgetService.focusPrevious(); + } + } +}); +registerAction2(class extends Action2 { + constructor() { + super({ + id: "selectNextCodeAction", + title: localize2(1661, "Select next action"), + precondition: ActionWidgetContextKeys.Visible, + keybinding: { + weight, + primary: 18, + secondary: [ + 2048 | 18 + /* KeyCode.DownArrow */ + ], + mac: { primary: 18, secondary: [ + 2048 | 18, + 256 | 44 + /* KeyCode.KeyN */ + ] } + } + }); + } + run(accessor) { + const widgetService = accessor.get(IActionWidgetService); + if (widgetService instanceof ActionWidgetService) { + widgetService.focusNext(); + } + } +}); +registerAction2(class extends Action2 { + constructor() { + super({ + id: acceptSelectedActionCommand, + title: localize2(1662, "Accept selected action"), + precondition: ActionWidgetContextKeys.Visible, + keybinding: { + weight, + primary: 3, + secondary: [ + 2048 | 89 + /* KeyCode.Period */ + ] + } + }); + } + run(accessor) { + const widgetService = accessor.get(IActionWidgetService); + if (widgetService instanceof ActionWidgetService) { + widgetService.acceptSelected(); + } + } +}); +registerAction2(class extends Action2 { + constructor() { + super({ + id: previewSelectedActionCommand, + title: localize2(1663, "Preview selected action"), + precondition: ActionWidgetContextKeys.Visible, + keybinding: { + weight, + primary: 2048 | 3 + } + }); + } + run(accessor) { + const widgetService = accessor.get(IActionWidgetService); + if (widgetService instanceof ActionWidgetService) { + widgetService.acceptSelected(true); + } + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/dropOrPasteInto/browser/postEditWidget.js +init_contextkey(); +init_instantiation(); +init_editorState(); +var __decorate51 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param46 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var PostEditWidget_1; +var PostEditWidget = class PostEditWidget2 extends Disposable { + static { + PostEditWidget_1 = this; + } + static { + this.baseId = "editor.widget.postEditWidget"; + } + constructor(typeId, editor2, visibleContext, showCommand, range2, edits, onSelectNewEdit, additionalActions, contextKeyService, _keybindingService, _actionWidgetService) { + super(); + this.typeId = typeId; + this.editor = editor2; + this.showCommand = showCommand; + this.range = range2; + this.edits = edits; + this.onSelectNewEdit = onSelectNewEdit; + this.additionalActions = additionalActions; + this._keybindingService = _keybindingService; + this._actionWidgetService = _actionWidgetService; + this.allowEditorOverflow = true; + this.suppressMouseDown = true; + this.create(); + this.visibleContext = visibleContext.bindTo(contextKeyService); + this.visibleContext.set(true); + this._register(toDisposable(() => this.visibleContext.reset())); + this.editor.addContentWidget(this); + this.editor.layoutContentWidget(this); + this._register(toDisposable((() => this.editor.removeContentWidget(this)))); + this._register(this.editor.onDidChangeCursorPosition((e) => { + this.dispose(); + })); + this._register(Event.runAndSubscribe(_keybindingService.onDidUpdateKeybindings, () => { + this._updateButtonTitle(); + })); + } + _updateButtonTitle() { + const binding = this._keybindingService.lookupKeybinding(this.showCommand.id)?.getLabel(); + this.button.element.title = this.showCommand.label + (binding ? ` (${binding})` : ""); + } + create() { + this.domNode = $(".post-edit-widget"); + this.button = this._register(new Button(this.domNode, { + supportIcons: true + })); + this.button.label = "$(insert)"; + this._register(addDisposableListener(this.domNode, EventType.CLICK, () => this.showSelector())); + } + getId() { + return PostEditWidget_1.baseId + "." + this.typeId; + } + getDomNode() { + return this.domNode; + } + getPosition() { + return { + position: this.range.getEndPosition(), + preference: [ + 2 + /* ContentWidgetPositionPreference.BELOW */ + ] + }; + } + showSelector() { + const pos = getDomNodePagePosition(this.button.element); + const anchor = { x: pos.left + pos.width, y: pos.top + pos.height }; + this._actionWidgetService.show("postEditWidget", false, this.edits.allEdits.map((edit2, i2) => { + return { + kind: "action", + item: edit2, + label: edit2.title, + disabled: false, + canPreview: false, + group: { title: "", icon: ThemeIcon.fromId(i2 === this.edits.activeEditIndex ? Codicon.check.id : Codicon.blank.id) } + }; + }), { + onHide: () => { + this.editor.focus(); + }, + onSelect: (item) => { + this._actionWidgetService.hide(false); + const i2 = this.edits.allEdits.findIndex((edit2) => edit2 === item); + if (i2 !== this.edits.activeEditIndex) { + return this.onSelectNewEdit(i2); + } + } + }, anchor, this.editor.getDomNode() ?? void 0, this.additionalActions); + } +}; +PostEditWidget = PostEditWidget_1 = __decorate51([ + __param46(8, IContextKeyService), + __param46(9, IKeybindingService), + __param46(10, IActionWidgetService) +], PostEditWidget); +var PostEditWidgetManager = class PostEditWidgetManager2 extends Disposable { + constructor(_id, _editor, _visibleContext, _showCommand, _getAdditionalActions, _instantiationService, _bulkEditService, _notificationService) { + super(); + this._id = _id; + this._editor = _editor; + this._visibleContext = _visibleContext; + this._showCommand = _showCommand; + this._getAdditionalActions = _getAdditionalActions; + this._instantiationService = _instantiationService; + this._bulkEditService = _bulkEditService; + this._notificationService = _notificationService; + this._currentWidget = this._register(new MutableDisposable()); + this._register(Event.any(_editor.onDidChangeModel, _editor.onDidChangeModelContent)(() => this.clear())); + } + async applyEditAndShowIfNeeded(ranges, edits, canShowWidget, resolve3, token) { + if (!ranges.length || !this._editor.hasModel()) { + return; + } + const model = this._editor.getModel(); + const edit2 = edits.allEdits.at(edits.activeEditIndex); + if (!edit2) { + return; + } + const onDidSelectEdit = async (newEditIndex) => { + const model2 = this._editor.getModel(); + if (!model2) { + return; + } + await model2.undo(); + this.applyEditAndShowIfNeeded(ranges, { activeEditIndex: newEditIndex, allEdits: edits.allEdits }, canShowWidget, resolve3, token); + }; + const handleError = (e, message) => { + if (isCancellationError(e)) { + return; + } + this._notificationService.error(message); + if (canShowWidget) { + this.show(ranges[0], edits, onDidSelectEdit); + } + }; + const editorStateCts = new EditorStateCancellationTokenSource(this._editor, 1 | 2, void 0, token); + let resolvedEdit; + try { + resolvedEdit = await raceCancellationError(resolve3(edit2, editorStateCts.token), editorStateCts.token); + } catch (e) { + return handleError(e, localize(937, "Error resolving edit '{0}':\n{1}", edit2.title, toErrorMessage(e))); + } finally { + editorStateCts.dispose(); + } + if (token.isCancellationRequested) { + return; + } + const combinedWorkspaceEdit = createCombinedWorkspaceEdit(model.uri, ranges, resolvedEdit); + const primaryRange = ranges[0]; + const editTrackingDecoration = model.deltaDecorations([], [{ + range: primaryRange, + options: { + description: "paste-line-suffix", + stickiness: 0 + /* TrackedRangeStickiness.AlwaysGrowsWhenTypingAtEdges */ + } + }]); + this._editor.focus(); + let editResult; + let editRange; + try { + editResult = await this._bulkEditService.apply(combinedWorkspaceEdit, { editor: this._editor, token }); + editRange = model.getDecorationRange(editTrackingDecoration[0]); + } catch (e) { + return handleError(e, localize(938, "Error applying edit '{0}':\n{1}", edit2.title, toErrorMessage(e))); + } finally { + model.deltaDecorations(editTrackingDecoration, []); + } + if (token.isCancellationRequested) { + return; + } + if (canShowWidget && editResult.isApplied && edits.allEdits.length > 1) { + this.show(editRange ?? primaryRange, edits, onDidSelectEdit); + } + } + show(range2, edits, onDidSelectEdit) { + this.clear(); + if (this._editor.hasModel()) { + this._currentWidget.value = this._instantiationService.createInstance(PostEditWidget, this._id, this._editor, this._visibleContext, this._showCommand, range2, edits, onDidSelectEdit, this._getAdditionalActions()); + } + } + clear() { + this._currentWidget.clear(); + } + tryShowSelector() { + this._currentWidget.value?.showSelector(); + } +}; +PostEditWidgetManager = __decorate51([ + __param46(5, IInstantiationService), + __param46(6, IBulkEditService), + __param46(7, INotificationService) +], PostEditWidgetManager); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.js +var __decorate52 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param47 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var CopyPasteController_1; +var changePasteTypeCommandId = "editor.changePasteType"; +var pasteAsPreferenceConfig = "editor.pasteAs.preferences"; +var pasteWidgetVisibleCtx = new RawContextKey("pasteWidgetVisible", false, localize(917, "Whether the paste widget is showing")); +var vscodeClipboardMime = "application/vnd.code.copymetadata"; +var CopyPasteController = class CopyPasteController2 extends Disposable { + static { + CopyPasteController_1 = this; + } + static { + this.ID = "editor.contrib.copyPasteActionController"; + } + static get(editor2) { + return editor2.getContribution(CopyPasteController_1.ID); + } + constructor(editor2, instantiationService, _logService, _bulkEditService, _clipboardService, _commandService, _configService, _languageFeaturesService, _quickInputService, _progressService) { + super(); + this._logService = _logService; + this._bulkEditService = _bulkEditService; + this._clipboardService = _clipboardService; + this._commandService = _commandService; + this._configService = _configService; + this._languageFeaturesService = _languageFeaturesService; + this._quickInputService = _quickInputService; + this._progressService = _progressService; + this._editor = editor2; + const container = editor2.getContainerDomNode(); + this._register(addDisposableListener(container, "copy", (e) => this.handleCopy(e))); + this._register(addDisposableListener(container, "cut", (e) => this.handleCopy(e))); + this._register(addDisposableListener(container, "paste", (e) => this.handlePaste(e), true)); + this._pasteProgressManager = this._register(new InlineProgressManager("pasteIntoEditor", editor2, instantiationService)); + this._postPasteWidgetManager = this._register(instantiationService.createInstance(PostEditWidgetManager, "pasteIntoEditor", editor2, pasteWidgetVisibleCtx, { id: changePasteTypeCommandId, label: localize(918, "Show paste options...") }, () => CopyPasteController_1._configureDefaultAction ? [CopyPasteController_1._configureDefaultAction] : [])); + } + changePasteType() { + this._postPasteWidgetManager.tryShowSelector(); + } + async pasteAs(preferred) { + this._logService.trace("CopyPasteController.pasteAs"); + this._editor.focus(); + try { + this._logService.trace("Before calling editor.action.clipboardPasteAction"); + this._pasteAsActionContext = { preferred }; + await this._commandService.executeCommand("editor.action.clipboardPasteAction"); + } finally { + this._pasteAsActionContext = void 0; + } + } + clearWidgets() { + this._postPasteWidgetManager.clear(); + } + isPasteAsEnabled() { + return this._editor.getOption( + 97 + /* EditorOption.pasteAs */ + ).enabled; + } + async finishedPaste() { + await this._currentPasteOperation; + } + handleCopy(e) { + let id = null; + if (e.clipboardData) { + const [text2, metadata] = ClipboardEventUtils.getTextData(e.clipboardData); + const storedMetadata = metadata || InMemoryClipboardMetadataManager.INSTANCE.get(text2); + id = storedMetadata?.id || null; + this._logService.trace("CopyPasteController#handleCopy for id : ", id, " with text.length : ", text2.length); + } else { + this._logService.trace("CopyPasteController#handleCopy"); + } + if (!this._editor.hasTextFocus()) { + return; + } + this._clipboardService.clearInternalState?.(); + if (!e.clipboardData || !this.isPasteAsEnabled()) { + return; + } + const model = this._editor.getModel(); + const selections = this._editor.getSelections(); + if (!model || !selections?.length) { + return; + } + const enableEmptySelectionClipboard = this._editor.getOption( + 45 + /* EditorOption.emptySelectionClipboard */ + ); + let ranges = selections; + const wasFromEmptySelection = selections.length === 1 && selections[0].isEmpty(); + if (wasFromEmptySelection) { + if (!enableEmptySelectionClipboard) { + return; + } + ranges = [new Range(ranges[0].startLineNumber, 1, ranges[0].startLineNumber, 1 + model.getLineLength(ranges[0].startLineNumber))]; + } + const toCopy = this._editor._getViewModel()?.getPlainTextToCopy(selections, enableEmptySelectionClipboard, isWindows); + const multicursorText = Array.isArray(toCopy) ? toCopy : null; + const defaultPastePayload = { + multicursorText, + pasteOnNewLine: wasFromEmptySelection, + mode: null + }; + const providers = this._languageFeaturesService.documentPasteEditProvider.ordered(model).filter((x) => !!x.prepareDocumentPaste); + if (!providers.length) { + this.setCopyMetadata(e.clipboardData, { defaultPastePayload }); + return; + } + const dataTransfer = toVSDataTransfer(e.clipboardData); + const providerCopyMimeTypes = providers.flatMap((x) => x.copyMimeTypes ?? []); + const handle = id ?? generateUuid(); + this.setCopyMetadata(e.clipboardData, { + id: handle, + providerCopyMimeTypes, + defaultPastePayload + }); + const operations = providers.map((provider) => { + return { + providerMimeTypes: provider.copyMimeTypes, + operation: createCancelablePromise((token) => provider.prepareDocumentPaste(model, ranges, dataTransfer, token).catch((err) => { + console.error(err); + return void 0; + })) + }; + }); + CopyPasteController_1._currentCopyOperation?.operations.forEach((entry) => entry.operation.cancel()); + CopyPasteController_1._currentCopyOperation = { handle, operations }; + } + async handlePaste(e) { + if (e.clipboardData) { + const [text2, metadata2] = ClipboardEventUtils.getTextData(e.clipboardData); + const metadataComputed = metadata2 || InMemoryClipboardMetadataManager.INSTANCE.get(text2); + this._logService.trace("CopyPasteController#handlePaste for id : ", metadataComputed?.id); + } else { + this._logService.trace("CopyPasteController#handlePaste"); + } + if (!e.clipboardData || !this._editor.hasTextFocus()) { + return; + } + MessageController.get(this._editor)?.closeMessage(); + this._currentPasteOperation?.cancel(); + this._currentPasteOperation = void 0; + const model = this._editor.getModel(); + const selections = this._editor.getSelections(); + if (!selections?.length || !model) { + return; + } + if (this._editor.getOption( + 104 + /* EditorOption.readOnly */ + ) || !this.isPasteAsEnabled() && !this._pasteAsActionContext) { + return; + } + const metadata = this.fetchCopyMetadata(e); + this._logService.trace("CopyPasteController#handlePaste with metadata : ", metadata?.id, " and text.length : ", e.clipboardData.getData("text/plain").length); + const dataTransfer = toExternalVSDataTransfer(e.clipboardData); + dataTransfer.delete(vscodeClipboardMime); + const fileTypes = Array.from(e.clipboardData.files).map((file) => file.type); + const allPotentialMimeTypes = [ + ...e.clipboardData.types, + ...fileTypes, + ...metadata?.providerCopyMimeTypes ?? [], + // TODO: always adds `uri-list` because this get set if there are resources in the system clipboard. + // However we can only check the system clipboard async. For this early check, just add it in. + // We filter providers again once we have the final dataTransfer we will use. + Mimes.uriList + ]; + const allProviders = this._languageFeaturesService.documentPasteEditProvider.ordered(model).filter((provider) => { + const preference = this._pasteAsActionContext?.preferred; + if (preference) { + if (!this.providerMatchesPreference(provider, preference)) { + return false; + } + } + return provider.pasteMimeTypes?.some((type) => matchesMimeType(type, allPotentialMimeTypes)); + }); + if (!allProviders.length) { + if (this._pasteAsActionContext?.preferred) { + this.showPasteAsNoEditMessage(selections, this._pasteAsActionContext.preferred); + e.preventDefault(); + e.stopImmediatePropagation(); + } + return; + } + e.preventDefault(); + e.stopImmediatePropagation(); + if (this._pasteAsActionContext) { + this.showPasteAsPick(this._pasteAsActionContext.preferred, allProviders, selections, dataTransfer, metadata); + } else { + this.doPasteInline(allProviders, selections, dataTransfer, metadata, e); + } + } + showPasteAsNoEditMessage(selections, preference) { + const kindLabel = "only" in preference ? preference.only.value : "preferences" in preference ? preference.preferences.length ? preference.preferences.map((preference2) => preference2.value).join(", ") : localize(919, "empty") : preference.providerId; + MessageController.get(this._editor)?.showMessage(localize(920, "No paste edits for '{0}' found", kindLabel), selections[0].getStartPosition()); + } + doPasteInline(allProviders, selections, dataTransfer, metadata, clipboardEvent) { + this._logService.trace("CopyPasteController#doPasteInline"); + const editor2 = this._editor; + if (!editor2.hasModel()) { + return; + } + const editorStateCts = new EditorStateCancellationTokenSource(editor2, 1 | 2, void 0); + const p = createCancelablePromise(async (pToken) => { + const editor3 = this._editor; + if (!editor3.hasModel()) { + return; + } + const model = editor3.getModel(); + const disposables = new DisposableStore(); + const cts = disposables.add(new CancellationTokenSource(pToken)); + disposables.add(editorStateCts.token.onCancellationRequested(() => cts.cancel())); + const token = cts.token; + try { + await this.mergeInDataFromCopy(allProviders, dataTransfer, metadata, token); + if (token.isCancellationRequested) { + return; + } + const supportedProviders = allProviders.filter((provider) => this.isSupportedPasteProvider(provider, dataTransfer)); + if (!supportedProviders.length || supportedProviders.length === 1 && supportedProviders[0] instanceof DefaultTextPasteOrDropEditProvider) { + return this.applyDefaultPasteHandler(dataTransfer, metadata, token, clipboardEvent); + } + const context = { + triggerKind: DocumentPasteTriggerKind.Automatic + }; + const editSession = await this.getPasteEdits(supportedProviders, dataTransfer, model, selections, context, token); + disposables.add(editSession); + if (token.isCancellationRequested) { + return; + } + if (editSession.edits.length === 1 && editSession.edits[0].provider instanceof DefaultTextPasteOrDropEditProvider) { + return this.applyDefaultPasteHandler(dataTransfer, metadata, token, clipboardEvent); + } + if (editSession.edits.length) { + const canShowWidget = editor3.getOption( + 97 + /* EditorOption.pasteAs */ + ).showPasteSelector === "afterPaste"; + return this._postPasteWidgetManager.applyEditAndShowIfNeeded(selections, { activeEditIndex: this.getInitialActiveEditIndex(model, editSession.edits), allEdits: editSession.edits }, canShowWidget, async (edit2, resolveToken) => { + if (!edit2.provider.resolveDocumentPasteEdit) { + return edit2; + } + const resolveP = edit2.provider.resolveDocumentPasteEdit(edit2, resolveToken); + const showP = new DeferredPromise(); + const resolved = await this._pasteProgressManager.showWhile(selections[0].getEndPosition(), localize(921, "Resolving paste edit for '{0}'. Click to cancel", edit2.title), raceCancellation(Promise.race([showP.p, resolveP]), resolveToken), { + cancel: () => showP.cancel() + }, 0); + if (resolved) { + edit2.insertText = resolved.insertText; + edit2.additionalEdit = resolved.additionalEdit; + } + return edit2; + }, token); + } + await this.applyDefaultPasteHandler(dataTransfer, metadata, token, clipboardEvent); + } finally { + disposables.dispose(); + if (this._currentPasteOperation === p) { + this._currentPasteOperation = void 0; + } + } + }); + this._pasteProgressManager.showWhile(selections[0].getEndPosition(), localize(922, "Running paste handlers. Click to cancel and do basic paste"), p, { + cancel: async () => { + p.cancel(); + if (editorStateCts.token.isCancellationRequested) { + return; + } + await this.applyDefaultPasteHandler(dataTransfer, metadata, editorStateCts.token, clipboardEvent); + } + }).finally(() => { + editorStateCts.dispose(); + }); + this._currentPasteOperation = p; + } + showPasteAsPick(preference, allProviders, selections, dataTransfer, metadata) { + this._logService.trace("CopyPasteController#showPasteAsPick"); + const p = createCancelablePromise(async (token) => { + const editor2 = this._editor; + if (!editor2.hasModel()) { + return; + } + const model = editor2.getModel(); + const disposables = new DisposableStore(); + const tokenSource = disposables.add(new EditorStateCancellationTokenSource(editor2, 1 | 2, void 0, token)); + try { + await this.mergeInDataFromCopy(allProviders, dataTransfer, metadata, tokenSource.token); + if (tokenSource.token.isCancellationRequested) { + return; + } + let supportedProviders = allProviders.filter((provider) => this.isSupportedPasteProvider(provider, dataTransfer, preference)); + if (preference) { + supportedProviders = supportedProviders.filter((provider) => this.providerMatchesPreference(provider, preference)); + } + const context = { + triggerKind: DocumentPasteTriggerKind.PasteAs, + only: preference && "only" in preference ? preference.only : void 0 + }; + let editSession = disposables.add(await this.getPasteEdits(supportedProviders, dataTransfer, model, selections, context, tokenSource.token)); + if (tokenSource.token.isCancellationRequested) { + return; + } + if (preference) { + editSession = { + edits: editSession.edits.filter((edit2) => { + if ("only" in preference) { + return preference.only.contains(edit2.kind); + } else if ("preferences" in preference) { + return preference.preferences.some((preference2) => preference2.contains(edit2.kind)); + } else { + return preference.providerId === edit2.provider.id; + } + }), + dispose: editSession.dispose + }; + } + if (!editSession.edits.length) { + if (preference) { + this.showPasteAsNoEditMessage(selections, preference); + } + return; + } + let pickedEdit; + if (preference) { + pickedEdit = editSession.edits.at(0); + } else { + const configureDefaultItem = { + id: "editor.pasteAs.default", + label: localize(923, "Configure default paste action"), + edit: void 0 + }; + const selected = await this._quickInputService.pick([ + ...editSession.edits.map((edit2) => ({ + label: edit2.title, + description: edit2.kind?.value, + edit: edit2 + })), + ...CopyPasteController_1._configureDefaultAction ? [ + upcast({ type: "separator" }), + { + label: CopyPasteController_1._configureDefaultAction.label, + edit: void 0 + } + ] : [] + ], { + placeHolder: localize(924, "Select Paste Action") + }); + if (selected === configureDefaultItem) { + CopyPasteController_1._configureDefaultAction?.run(); + return; + } + pickedEdit = selected?.edit; + } + if (!pickedEdit) { + return; + } + const combinedWorkspaceEdit = createCombinedWorkspaceEdit(model.uri, selections, pickedEdit); + await this._bulkEditService.apply(combinedWorkspaceEdit, { editor: this._editor }); + } finally { + disposables.dispose(); + if (this._currentPasteOperation === p) { + this._currentPasteOperation = void 0; + } + } + }); + this._progressService.withProgress({ + location: 10, + title: localize(925, "Running paste handlers") + }, () => p); + } + setCopyMetadata(dataTransfer, metadata) { + this._logService.trace("CopyPasteController#setCopyMetadata new id : ", metadata.id); + dataTransfer.setData(vscodeClipboardMime, JSON.stringify(metadata)); + } + fetchCopyMetadata(e) { + this._logService.trace("CopyPasteController#fetchCopyMetadata"); + if (!e.clipboardData) { + return; + } + const rawMetadata = e.clipboardData.getData(vscodeClipboardMime); + if (rawMetadata) { + try { + return JSON.parse(rawMetadata); + } catch { + return void 0; + } + } + const [_, metadata] = ClipboardEventUtils.getTextData(e.clipboardData); + if (metadata) { + return { + defaultPastePayload: { + mode: metadata.mode, + multicursorText: metadata.multicursorText ?? null, + pasteOnNewLine: !!metadata.isFromEmptySelection + } + }; + } + return void 0; + } + async mergeInDataFromCopy(allProviders, dataTransfer, metadata, token) { + this._logService.trace("CopyPasteController#mergeInDataFromCopy with metadata : ", metadata?.id); + if (metadata?.id && CopyPasteController_1._currentCopyOperation?.handle === metadata.id) { + const toResolve = CopyPasteController_1._currentCopyOperation.operations.filter((op) => allProviders.some((provider) => provider.pasteMimeTypes.some((type) => matchesMimeType(type, op.providerMimeTypes)))).map((op) => op.operation); + const toMergeResults = await Promise.all(toResolve); + if (token.isCancellationRequested) { + return; + } + for (const toMergeData of toMergeResults.reverse()) { + if (toMergeData) { + for (const [key, value] of toMergeData) { + dataTransfer.replace(key, value); + } + } + } + } + if (!dataTransfer.has(Mimes.uriList)) { + const resources = await this._clipboardService.readResources(); + if (token.isCancellationRequested) { + return; + } + if (resources.length) { + dataTransfer.append(Mimes.uriList, createStringDataTransferItem(UriList.create(resources))); + } + } + } + async getPasteEdits(providers, dataTransfer, model, selections, context, token) { + const disposables = new DisposableStore(); + const results = await raceCancellation(Promise.all(providers.map(async (provider) => { + try { + const edits2 = await provider.provideDocumentPasteEdits?.(model, selections, dataTransfer, context, token); + if (edits2) { + disposables.add(edits2); + } + return edits2?.edits?.map((edit2) => ({ ...edit2, provider })); + } catch (err) { + if (!isCancellationError(err)) { + console.error(err); + } + return void 0; + } + })), token); + const edits = coalesce(results ?? []).flat().filter((edit2) => { + return !context.only || context.only.contains(edit2.kind); + }); + return { + edits: sortEditsByYieldTo(edits), + dispose: () => disposables.dispose() + }; + } + async applyDefaultPasteHandler(dataTransfer, metadata, token, clipboardEvent) { + const textDataTransfer = dataTransfer.get(Mimes.text) ?? dataTransfer.get("text"); + const text2 = await textDataTransfer?.asString() ?? ""; + if (token.isCancellationRequested) { + return; + } + const payload = { + clipboardEvent, + text: text2, + pasteOnNewLine: metadata?.defaultPastePayload.pasteOnNewLine ?? false, + multicursorText: metadata?.defaultPastePayload.multicursorText ?? null, + mode: null + }; + this._logService.trace("CopyPasteController#applyDefaultPasteHandler for id : ", metadata?.id); + this._editor.trigger("keyboard", "paste", payload); + } + /** + * Filter out providers if they: + * - Don't handle any of the data transfer types we have + * - Don't match the preferred paste kind + */ + isSupportedPasteProvider(provider, dataTransfer, preference) { + if (!provider.pasteMimeTypes?.some((type) => dataTransfer.matches(type))) { + return false; + } + return !preference || this.providerMatchesPreference(provider, preference); + } + providerMatchesPreference(provider, preference) { + if ("only" in preference) { + return provider.providedPasteEditKinds.some((providedKind) => preference.only.contains(providedKind)); + } else if ("preferences" in preference) { + return preference.preferences.some((providedKind) => preference.preferences.some((preferredKind) => preferredKind.contains(providedKind))); + } else { + return provider.id === preference.providerId; + } + } + getInitialActiveEditIndex(model, edits) { + const preferredProviders = this._configService.getValue(pasteAsPreferenceConfig, { resource: model.uri }); + for (const config of Array.isArray(preferredProviders) ? preferredProviders : []) { + const desiredKind = new HierarchicalKind(config); + const editIndex = edits.findIndex((edit2) => desiredKind.contains(edit2.kind)); + if (editIndex >= 0) { + return editIndex; + } + } + return 0; + } +}; +CopyPasteController = CopyPasteController_1 = __decorate52([ + __param47(1, IInstantiationService), + __param47(2, ILogService), + __param47(3, IBulkEditService), + __param47(4, IClipboardService), + __param47(5, ICommandService), + __param47(6, IConfigurationService), + __param47(7, ILanguageFeaturesService), + __param47(8, IQuickInputService), + __param47(9, IProgressService) +], CopyPasteController); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/clipboard/browser/clipboard.js +var CLIPBOARD_CONTEXT_MENU_GROUP = "9_cutcopypaste"; +var supportsCut = isNative || document.queryCommandSupported("cut"); +var supportsCopy = isNative || document.queryCommandSupported("copy"); +var supportsPaste = typeof navigator.clipboard === "undefined" || isFirefox ? document.queryCommandSupported("paste") : true; +function registerCommand3(command) { + command.register(); + return command; +} +var CutAction = supportsCut ? registerCommand3(new MultiCommand({ + id: "editor.action.clipboardCutAction", + precondition: void 0, + kbOpts: ( + // Do not bind cut keybindings in the browser, + // since browsers do that for us and it avoids security prompts + isNative ? { + primary: 2048 | 54, + win: { primary: 2048 | 54, secondary: [ + 1024 | 20 + /* KeyCode.Delete */ + ] }, + weight: 100 + /* KeybindingWeight.EditorContrib */ + } : void 0 + ), + menuOpts: [{ + menuId: MenuId.MenubarEditMenu, + group: "2_ccp", + title: localize(813, "Cu&&t"), + order: 1 + }, { + menuId: MenuId.EditorContext, + group: CLIPBOARD_CONTEXT_MENU_GROUP, + title: localize(814, "Cut"), + when: EditorContextKeys.writable, + order: 1 + }, { + menuId: MenuId.CommandPalette, + group: "", + title: localize(815, "Cut"), + order: 1 + }, { + menuId: MenuId.SimpleEditorContext, + group: CLIPBOARD_CONTEXT_MENU_GROUP, + title: localize(816, "Cut"), + when: EditorContextKeys.writable, + order: 1 + }] +})) : void 0; +var CopyAction = supportsCopy ? registerCommand3(new MultiCommand({ + id: "editor.action.clipboardCopyAction", + precondition: void 0, + kbOpts: ( + // Do not bind copy keybindings in the browser, + // since browsers do that for us and it avoids security prompts + isNative ? { + primary: 2048 | 33, + win: { primary: 2048 | 33, secondary: [ + 2048 | 19 + /* KeyCode.Insert */ + ] }, + weight: 100 + /* KeybindingWeight.EditorContrib */ + } : void 0 + ), + menuOpts: [{ + menuId: MenuId.MenubarEditMenu, + group: "2_ccp", + title: localize(817, "&&Copy"), + order: 2 + }, { + menuId: MenuId.EditorContext, + group: CLIPBOARD_CONTEXT_MENU_GROUP, + title: localize(818, "Copy"), + order: 2 + }, { + menuId: MenuId.CommandPalette, + group: "", + title: localize(819, "Copy"), + order: 1 + }, { + menuId: MenuId.SimpleEditorContext, + group: CLIPBOARD_CONTEXT_MENU_GROUP, + title: localize(820, "Copy"), + order: 2 + }] +})) : void 0; +MenuRegistry.appendMenuItem(MenuId.MenubarEditMenu, { submenu: MenuId.MenubarCopy, title: localize2(825, "Copy As"), group: "2_ccp", order: 3 }); +MenuRegistry.appendMenuItem(MenuId.EditorContext, { submenu: MenuId.EditorContextCopy, title: localize2(826, "Copy As"), group: CLIPBOARD_CONTEXT_MENU_GROUP, order: 3 }); +MenuRegistry.appendMenuItem(MenuId.EditorContext, { submenu: MenuId.EditorContextShare, title: localize2(827, "Share"), group: "11_share", order: -1, when: ContextKeyExpr.and(ContextKeyExpr.notEquals("resourceScheme", "output"), EditorContextKeys.editorTextFocus) }); +MenuRegistry.appendMenuItem(MenuId.ExplorerContext, { submenu: MenuId.ExplorerContextShare, title: localize2(828, "Share"), group: "11_share", order: -1 }); +var PasteAction = supportsPaste ? registerCommand3(new MultiCommand({ + id: "editor.action.clipboardPasteAction", + precondition: void 0, + kbOpts: ( + // Do not bind paste keybindings in the browser, + // since browsers do that for us and it avoids security prompts + isNative ? { + primary: 2048 | 52, + win: { primary: 2048 | 52, secondary: [ + 1024 | 19 + /* KeyCode.Insert */ + ] }, + linux: { primary: 2048 | 52, secondary: [ + 1024 | 19 + /* KeyCode.Insert */ + ] }, + weight: 100 + /* KeybindingWeight.EditorContrib */ + } : void 0 + ), + menuOpts: [{ + menuId: MenuId.MenubarEditMenu, + group: "2_ccp", + title: localize(821, "&&Paste"), + order: 4 + }, { + menuId: MenuId.EditorContext, + group: CLIPBOARD_CONTEXT_MENU_GROUP, + title: localize(822, "Paste"), + when: EditorContextKeys.writable, + order: 4 + }, { + menuId: MenuId.CommandPalette, + group: "", + title: localize(823, "Paste"), + order: 1 + }, { + menuId: MenuId.SimpleEditorContext, + group: CLIPBOARD_CONTEXT_MENU_GROUP, + title: localize(824, "Paste"), + when: EditorContextKeys.writable, + order: 4 + }] +})) : void 0; +var ExecCommandCopyWithSyntaxHighlightingAction = class extends EditorAction { + constructor() { + super({ + id: "editor.action.clipboardCopyWithSyntaxHighlightingAction", + label: localize2(829, "Copy with Syntax Highlighting"), + precondition: void 0, + kbOpts: { + kbExpr: EditorContextKeys.textInputFocus, + primary: 0, + weight: 100 + /* KeybindingWeight.EditorContrib */ + } + }); + } + run(accessor, editor2) { + const logService = accessor.get(ILogService); + logService.trace("ExecCommandCopyWithSyntaxHighlightingAction#run"); + if (!editor2.hasModel()) { + return; + } + const emptySelectionClipboard = editor2.getOption( + 45 + /* EditorOption.emptySelectionClipboard */ + ); + if (!emptySelectionClipboard && editor2.getSelection().isEmpty()) { + return; + } + CopyOptions.forceCopyWithSyntaxHighlighting = true; + editor2.focus(); + logService.trace("ExecCommandCopyWithSyntaxHighlightingAction (before execCommand copy)"); + editor2.getContainerDomNode().ownerDocument.execCommand("copy"); + logService.trace("ExecCommandCopyWithSyntaxHighlightingAction (after execCommand copy)"); + CopyOptions.forceCopyWithSyntaxHighlighting = false; + } +}; +function registerExecCommandImpl(target, browserCommand) { + if (!target) { + return; + } + target.addImplementation(1e4, "code-editor", (accessor, args) => { + const logService = accessor.get(ILogService); + logService.trace("registerExecCommandImpl (addImplementation code-editor for : ", browserCommand, ")"); + const focusedEditor = accessor.get(ICodeEditorService).getFocusedCodeEditor(); + if (focusedEditor && focusedEditor.hasTextFocus()) { + const emptySelectionClipboard = focusedEditor.getOption( + 45 + /* EditorOption.emptySelectionClipboard */ + ); + const selection = focusedEditor.getSelection(); + if (selection && selection.isEmpty() && !emptySelectionClipboard) { + return true; + } + if (focusedEditor.getOption( + 170 + /* EditorOption.effectiveEditContext */ + ) && browserCommand === "cut") { + logCopyCommand(focusedEditor); + logService.trace("registerExecCommandImpl (before execCommand copy)"); + focusedEditor.getContainerDomNode().ownerDocument.execCommand("copy"); + focusedEditor.trigger(void 0, "cut", void 0); + logService.trace("registerExecCommandImpl (after execCommand copy)"); + } else { + logCopyCommand(focusedEditor); + logService.trace("registerExecCommandImpl (before execCommand " + browserCommand + ")"); + focusedEditor.getContainerDomNode().ownerDocument.execCommand(browserCommand); + logService.trace("registerExecCommandImpl (after execCommand " + browserCommand + ")"); + } + return true; + } + return false; + }); + target.addImplementation(0, "generic-dom", (accessor, args) => { + const logService = accessor.get(ILogService); + logService.trace("registerExecCommandImpl (addImplementation generic-dom for : ", browserCommand, ")"); + logService.trace("registerExecCommandImpl (before execCommand " + browserCommand + ")"); + getActiveDocument().execCommand(browserCommand); + logService.trace("registerExecCommandImpl (after execCommand " + browserCommand + ")"); + return true; + }); +} +function logCopyCommand(editor2) { + const editContextEnabled = editor2.getOption( + 170 + /* EditorOption.effectiveEditContext */ + ); + if (editContextEnabled) { + const nativeEditContext = NativeEditContextRegistry.get(editor2.getId()); + if (nativeEditContext) { + nativeEditContext.onWillCopy(); + } + } +} +registerExecCommandImpl(CutAction, "cut"); +registerExecCommandImpl(CopyAction, "copy"); +if (PasteAction) { + PasteAction.addImplementation(1e4, "code-editor", (accessor, args) => { + const logService = accessor.get(ILogService); + logService.trace("registerExecCommandImpl (addImplementation code-editor for : paste)"); + const codeEditorService = accessor.get(ICodeEditorService); + const clipboardService = accessor.get(IClipboardService); + const focusedEditor = codeEditorService.getFocusedCodeEditor(); + if (focusedEditor && focusedEditor.hasModel() && focusedEditor.hasTextFocus()) { + const editContextEnabled = focusedEditor.getOption( + 170 + /* EditorOption.effectiveEditContext */ + ); + if (editContextEnabled) { + const nativeEditContext = NativeEditContextRegistry.get(focusedEditor.getId()); + if (nativeEditContext) { + nativeEditContext.onWillPaste(); + } + } + logService.trace("registerExecCommandImpl (before triggerPaste)"); + const triggerPaste = clipboardService.triggerPaste(getActiveWindow().vscodeWindowId); + if (triggerPaste) { + logService.trace("registerExecCommandImpl (triggerPaste defined)"); + return triggerPaste.then(async () => { + logService.trace("registerExecCommandImpl (after triggerPaste)"); + return CopyPasteController.get(focusedEditor)?.finishedPaste() ?? Promise.resolve(); + }); + } else { + logService.trace("registerExecCommandImpl (triggerPaste undefined)"); + } + if (isWeb) { + logService.trace("registerExecCommandImpl (Paste handling on web)"); + return (async () => { + const clipboardText = await clipboardService.readText(); + if (clipboardText !== "") { + const metadata = InMemoryClipboardMetadataManager.INSTANCE.get(clipboardText); + let pasteOnNewLine = false; + let multicursorText = null; + let mode = null; + if (metadata) { + pasteOnNewLine = focusedEditor.getOption( + 45 + /* EditorOption.emptySelectionClipboard */ + ) && !!metadata.isFromEmptySelection; + multicursorText = typeof metadata.multicursorText !== "undefined" ? metadata.multicursorText : null; + mode = metadata.mode; + } + logService.trace("registerExecCommandImpl (clipboardText.length : ", clipboardText.length, " id : ", metadata?.id, ")"); + focusedEditor.trigger("keyboard", "paste", { + text: clipboardText, + pasteOnNewLine, + multicursorText, + mode + }); + } + })(); + } + return true; + } + return false; + }); + PasteAction.addImplementation(0, "generic-dom", (accessor, args) => { + const logService = accessor.get(ILogService); + logService.trace("registerExecCommandImpl (addImplementation generic-dom for : paste)"); + const triggerPaste = accessor.get(IClipboardService).triggerPaste(getActiveWindow().vscodeWindowId); + return triggerPaste ?? false; + }); +} +if (supportsCopy) { + registerEditorAction(ExecCommandCopyWithSyntaxHighlightingAction); +} + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/codeAction/browser/codeActionContributions.js +init_editorExtensions(); + +// node_modules/monaco-editor-core/esm/vs/editor/common/config/editorConfigurationSchema.js +init_textModelDefaults(); +init_nls(); +init_configurationRegistry(); +init_platform2(); +var editorConfigurationBaseNode = Object.freeze({ + id: "editor", + order: 5, + type: "object", + title: localize(147, "Editor"), + scope: 6 +}); +var editorConfiguration = { + ...editorConfigurationBaseNode, + properties: { + "editor.tabSize": { + type: "number", + default: EDITOR_MODEL_DEFAULTS.tabSize, + minimum: 1, + maximum: 100, + markdownDescription: localize(148, "The number of spaces a tab is equal to. This setting is overridden based on the file contents when {0} is on.", "`#editor.detectIndentation#`") + }, + "editor.indentSize": { + "anyOf": [ + { + type: "string", + enum: ["tabSize"] + }, + { + type: "number", + minimum: 1 + } + ], + default: "tabSize", + markdownDescription: localize(149, 'The number of spaces used for indentation or `"tabSize"` to use the value from `#editor.tabSize#`. This setting is overridden based on the file contents when `#editor.detectIndentation#` is on.') + }, + "editor.insertSpaces": { + type: "boolean", + default: EDITOR_MODEL_DEFAULTS.insertSpaces, + markdownDescription: localize(150, "Insert spaces when pressing `Tab`. This setting is overridden based on the file contents when {0} is on.", "`#editor.detectIndentation#`") + }, + "editor.detectIndentation": { + type: "boolean", + default: EDITOR_MODEL_DEFAULTS.detectIndentation, + markdownDescription: localize(151, "Controls whether {0} and {1} will be automatically detected when a file is opened based on the file contents.", "`#editor.tabSize#`", "`#editor.insertSpaces#`") + }, + "editor.trimAutoWhitespace": { + type: "boolean", + default: EDITOR_MODEL_DEFAULTS.trimAutoWhitespace, + description: localize(152, "Remove trailing auto inserted whitespace.") + }, + "editor.largeFileOptimizations": { + type: "boolean", + default: EDITOR_MODEL_DEFAULTS.largeFileOptimizations, + description: localize(153, "Special handling for large files to disable certain memory intensive features.") + }, + "editor.wordBasedSuggestions": { + enum: ["off", "currentDocument", "matchingDocuments", "allDocuments"], + default: "matchingDocuments", + enumDescriptions: [ + localize(154, "Turn off Word Based Suggestions."), + localize(155, "Only suggest words from the active document."), + localize(156, "Suggest words from all open documents of the same language."), + localize(157, "Suggest words from all open documents.") + ], + description: localize(158, "Controls whether completions should be computed based on words in the document and from which documents they are computed.") + }, + "editor.semanticHighlighting.enabled": { + enum: [true, false, "configuredByTheme"], + enumDescriptions: [ + localize(159, "Semantic highlighting enabled for all color themes."), + localize(160, "Semantic highlighting disabled for all color themes."), + localize(161, "Semantic highlighting is configured by the current color theme's `semanticHighlighting` setting.") + ], + default: "configuredByTheme", + description: localize(162, "Controls whether the semanticHighlighting is shown for the languages that support it.") + }, + "editor.stablePeek": { + type: "boolean", + default: false, + markdownDescription: localize(163, "Keep peek editors open even when double-clicking their content or when hitting `Escape`.") + }, + "editor.maxTokenizationLineLength": { + type: "integer", + default: 2e4, + description: localize(164, "Lines above this length will not be tokenized for performance reasons") + }, + "editor.experimental.asyncTokenization": { + type: "boolean", + default: true, + description: localize(165, "Controls whether the tokenization should happen asynchronously on a web worker."), + tags: ["experimental"] + }, + "editor.experimental.asyncTokenizationLogging": { + type: "boolean", + default: false, + description: localize(166, "Controls whether async tokenization should be logged. For debugging only.") + }, + "editor.experimental.asyncTokenizationVerification": { + type: "boolean", + default: false, + description: localize(167, "Controls whether async tokenization should be verified against legacy background tokenization. Might slow down tokenization. For debugging only."), + tags: ["experimental"] + }, + "editor.experimental.treeSitterTelemetry": { + type: "boolean", + default: false, + markdownDescription: localize(168, "Controls whether tree sitter parsing should be turned on and telemetry collected. Setting `#editor.experimental.preferTreeSitter#` for specific languages will take precedence."), + tags: ["experimental"], + experiment: { + mode: "auto" + } + }, + "editor.experimental.preferTreeSitter.css": { + type: "boolean", + default: false, + markdownDescription: localize(169, "Controls whether tree sitter parsing should be turned on for css. This will take precedence over `#editor.experimental.treeSitterTelemetry#` for css."), + tags: ["experimental"], + experiment: { + mode: "auto" + } + }, + "editor.experimental.preferTreeSitter.typescript": { + type: "boolean", + default: false, + markdownDescription: localize(170, "Controls whether tree sitter parsing should be turned on for typescript. This will take precedence over `#editor.experimental.treeSitterTelemetry#` for typescript."), + tags: ["experimental"], + experiment: { + mode: "auto" + } + }, + "editor.experimental.preferTreeSitter.ini": { + type: "boolean", + default: false, + markdownDescription: localize(171, "Controls whether tree sitter parsing should be turned on for ini. This will take precedence over `#editor.experimental.treeSitterTelemetry#` for ini."), + tags: ["experimental"], + experiment: { + mode: "auto" + } + }, + "editor.experimental.preferTreeSitter.regex": { + type: "boolean", + default: false, + markdownDescription: localize(172, "Controls whether tree sitter parsing should be turned on for regex. This will take precedence over `#editor.experimental.treeSitterTelemetry#` for regex."), + tags: ["experimental"], + experiment: { + mode: "auto" + } + }, + "editor.language.brackets": { + type: ["array", "null"], + default: null, + // We want to distinguish the empty array from not configured. + description: localize(173, "Defines the bracket symbols that increase or decrease the indentation."), + items: { + type: "array", + items: [ + { + type: "string", + description: localize(174, "The opening bracket character or string sequence.") + }, + { + type: "string", + description: localize(175, "The closing bracket character or string sequence.") + } + ] + } + }, + "editor.language.colorizedBracketPairs": { + type: ["array", "null"], + default: null, + // We want to distinguish the empty array from not configured. + description: localize(176, "Defines the bracket pairs that are colorized by their nesting level if bracket pair colorization is enabled."), + items: { + type: "array", + items: [ + { + type: "string", + description: localize(177, "The opening bracket character or string sequence.") + }, + { + type: "string", + description: localize(178, "The closing bracket character or string sequence.") + } + ] + } + }, + "diffEditor.maxComputationTime": { + type: "number", + default: diffEditorDefaultOptions.maxComputationTime, + description: localize(179, "Timeout in milliseconds after which diff computation is cancelled. Use 0 for no timeout.") + }, + "diffEditor.maxFileSize": { + type: "number", + default: diffEditorDefaultOptions.maxFileSize, + description: localize(180, "Maximum file size in MB for which to compute diffs. Use 0 for no limit.") + }, + "diffEditor.renderSideBySide": { + type: "boolean", + default: diffEditorDefaultOptions.renderSideBySide, + description: localize(181, "Controls whether the diff editor shows the diff side by side or inline.") + }, + "diffEditor.renderSideBySideInlineBreakpoint": { + type: "number", + default: diffEditorDefaultOptions.renderSideBySideInlineBreakpoint, + description: localize(182, "If the diff editor width is smaller than this value, the inline view is used.") + }, + "diffEditor.useInlineViewWhenSpaceIsLimited": { + type: "boolean", + default: diffEditorDefaultOptions.useInlineViewWhenSpaceIsLimited, + description: localize(183, "If enabled and the editor width is too small, the inline view is used.") + }, + "diffEditor.renderMarginRevertIcon": { + type: "boolean", + default: diffEditorDefaultOptions.renderMarginRevertIcon, + description: localize(184, "When enabled, the diff editor shows arrows in its glyph margin to revert changes.") + }, + "diffEditor.renderGutterMenu": { + type: "boolean", + default: diffEditorDefaultOptions.renderGutterMenu, + description: localize(185, "When enabled, the diff editor shows a special gutter for revert and stage actions.") + }, + "diffEditor.ignoreTrimWhitespace": { + type: "boolean", + default: diffEditorDefaultOptions.ignoreTrimWhitespace, + description: localize(186, "When enabled, the diff editor ignores changes in leading or trailing whitespace.") + }, + "diffEditor.renderIndicators": { + type: "boolean", + default: diffEditorDefaultOptions.renderIndicators, + description: localize(187, "Controls whether the diff editor shows +/- indicators for added/removed changes.") + }, + "diffEditor.codeLens": { + type: "boolean", + default: diffEditorDefaultOptions.diffCodeLens, + description: localize(188, "Controls whether the editor shows CodeLens.") + }, + "diffEditor.wordWrap": { + type: "string", + enum: ["off", "on", "inherit"], + default: diffEditorDefaultOptions.diffWordWrap, + markdownEnumDescriptions: [ + localize(189, "Lines will never wrap."), + localize(190, "Lines will wrap at the viewport width."), + localize(191, "Lines will wrap according to the {0} setting.", "`#editor.wordWrap#`") + ] + }, + "diffEditor.diffAlgorithm": { + type: "string", + enum: ["legacy", "advanced"], + default: diffEditorDefaultOptions.diffAlgorithm, + markdownEnumDescriptions: [ + localize(192, "Uses the legacy diffing algorithm."), + localize(193, "Uses the advanced diffing algorithm.") + ] + }, + "diffEditor.hideUnchangedRegions.enabled": { + type: "boolean", + default: diffEditorDefaultOptions.hideUnchangedRegions.enabled, + markdownDescription: localize(194, "Controls whether the diff editor shows unchanged regions.") + }, + "diffEditor.hideUnchangedRegions.revealLineCount": { + type: "integer", + default: diffEditorDefaultOptions.hideUnchangedRegions.revealLineCount, + markdownDescription: localize(195, "Controls how many lines are used for unchanged regions."), + minimum: 1 + }, + "diffEditor.hideUnchangedRegions.minimumLineCount": { + type: "integer", + default: diffEditorDefaultOptions.hideUnchangedRegions.minimumLineCount, + markdownDescription: localize(196, "Controls how many lines are used as a minimum for unchanged regions."), + minimum: 1 + }, + "diffEditor.hideUnchangedRegions.contextLineCount": { + type: "integer", + default: diffEditorDefaultOptions.hideUnchangedRegions.contextLineCount, + markdownDescription: localize(197, "Controls how many lines are used as context when comparing unchanged regions."), + minimum: 1 + }, + "diffEditor.experimental.showMoves": { + type: "boolean", + default: diffEditorDefaultOptions.experimental.showMoves, + markdownDescription: localize(198, "Controls whether the diff editor should show detected code moves.") + }, + "diffEditor.experimental.showEmptyDecorations": { + type: "boolean", + default: diffEditorDefaultOptions.experimental.showEmptyDecorations, + description: localize(199, "Controls whether the diff editor shows empty decorations to see where characters got inserted or deleted.") + }, + "diffEditor.experimental.useTrueInlineView": { + type: "boolean", + default: diffEditorDefaultOptions.experimental.useTrueInlineView, + description: localize(200, "If enabled and the editor uses the inline view, word changes are rendered inline.") + } + } +}; +function isConfigurationPropertySchema(x) { + return typeof x.type !== "undefined" || typeof x.anyOf !== "undefined"; +} +for (const editorOption of editorOptionsRegistry) { + const schema = editorOption.schema; + if (typeof schema !== "undefined") { + if (isConfigurationPropertySchema(schema)) { + editorConfiguration.properties[`editor.${editorOption.name}`] = schema; + } else { + for (const key in schema) { + if (Object.hasOwnProperty.call(schema, key)) { + editorConfiguration.properties[key] = schema[key]; + } + } + } + } +} +var cachedEditorConfigurationKeys = null; +function getEditorConfigurationKeys() { + if (cachedEditorConfigurationKeys === null) { + cachedEditorConfigurationKeys = /* @__PURE__ */ Object.create(null); + Object.keys(editorConfiguration.properties).forEach((prop) => { + cachedEditorConfigurationKeys[prop] = true; + }); + } + return cachedEditorConfigurationKeys; +} +function isEditorConfigurationKey(key) { + const editorConfigurationKeys = getEditorConfigurationKeys(); + return editorConfigurationKeys[`editor.${key}`] || false; +} +function isDiffEditorConfigurationKey(key) { + const editorConfigurationKeys = getEditorConfigurationKeys(); + return editorConfigurationKeys[`diffEditor.${key}`] || false; +} +var configurationRegistry2 = Registry.as(Extensions4.Configuration); +configurationRegistry2.registerConfiguration(editorConfiguration); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/codeAction/browser/codeActionCommands.js +init_strings(); +init_editorExtensions(); +init_editorContextKeys(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/codeAction/browser/codeAction.js +init_arrays(); +init_cancellation(); +init_errors(); +init_lifecycle(); +init_uri(); +init_nls(); +init_commands(); +init_telemetry(); +init_range(); +init_selection(); +init_languages(); +init_languageFeatures(); +init_model(); +init_textModelEditSource(); +init_editorState(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/codeAction/common/types.js +init_errors(); +var CodeActionKind = new class { + constructor() { + this.QuickFix = new HierarchicalKind("quickfix"); + this.Refactor = new HierarchicalKind("refactor"); + this.RefactorExtract = this.Refactor.append("extract"); + this.RefactorInline = this.Refactor.append("inline"); + this.RefactorMove = this.Refactor.append("move"); + this.RefactorRewrite = this.Refactor.append("rewrite"); + this.Notebook = new HierarchicalKind("notebook"); + this.Source = new HierarchicalKind("source"); + this.SourceOrganizeImports = this.Source.append("organizeImports"); + this.SourceFixAll = this.Source.append("fixAll"); + this.SurroundWith = this.Refactor.append("surround"); + } +}(); +var CodeActionTriggerSource; +(function(CodeActionTriggerSource2) { + CodeActionTriggerSource2["Refactor"] = "refactor"; + CodeActionTriggerSource2["RefactorPreview"] = "refactor preview"; + CodeActionTriggerSource2["Lightbulb"] = "lightbulb"; + CodeActionTriggerSource2["Default"] = "other (default)"; + CodeActionTriggerSource2["SourceAction"] = "source action"; + CodeActionTriggerSource2["QuickFix"] = "quick fix action"; + CodeActionTriggerSource2["FixAll"] = "fix all"; + CodeActionTriggerSource2["OrganizeImports"] = "organize imports"; + CodeActionTriggerSource2["AutoFix"] = "auto fix"; + CodeActionTriggerSource2["QuickFixHover"] = "quick fix hover window"; + CodeActionTriggerSource2["OnSave"] = "save participants"; + CodeActionTriggerSource2["ProblemsView"] = "problems view"; +})(CodeActionTriggerSource || (CodeActionTriggerSource = {})); +function mayIncludeActionsOfKind(filter, providedKind) { + if (filter.include && !filter.include.intersects(providedKind)) { + return false; + } + if (filter.excludes) { + if (filter.excludes.some((exclude) => excludesAction(providedKind, exclude, filter.include))) { + return false; + } + } + if (!filter.includeSourceActions && CodeActionKind.Source.contains(providedKind)) { + return false; + } + return true; +} +function filtersAction(filter, action) { + const actionKind = action.kind ? new HierarchicalKind(action.kind) : void 0; + if (filter.include) { + if (!actionKind || !filter.include.contains(actionKind)) { + return false; + } + } + if (filter.excludes) { + if (actionKind && filter.excludes.some((exclude) => excludesAction(actionKind, exclude, filter.include))) { + return false; + } + } + if (!filter.includeSourceActions) { + if (actionKind && CodeActionKind.Source.contains(actionKind)) { + return false; + } + } + if (filter.onlyIncludePreferredActions) { + if (!action.isPreferred) { + return false; + } + } + return true; +} +function excludesAction(providedKind, exclude, include) { + if (!exclude.contains(providedKind)) { + return false; + } + if (include && exclude.contains(include)) { + return false; + } + return true; +} +var CodeActionCommandArgs = class _CodeActionCommandArgs { + static fromUser(arg, defaults) { + if (!arg || typeof arg !== "object") { + return new _CodeActionCommandArgs(defaults.kind, defaults.apply, false); + } + return new _CodeActionCommandArgs(_CodeActionCommandArgs.getKindFromUser(arg, defaults.kind), _CodeActionCommandArgs.getApplyFromUser(arg, defaults.apply), _CodeActionCommandArgs.getPreferredUser(arg)); + } + static getApplyFromUser(arg, defaultAutoApply) { + switch (typeof arg.apply === "string" ? arg.apply.toLowerCase() : "") { + case "first": + return "first"; + case "never": + return "never"; + case "ifsingle": + return "ifSingle"; + default: + return defaultAutoApply; + } + } + static getKindFromUser(arg, defaultKind) { + return typeof arg.kind === "string" ? new HierarchicalKind(arg.kind) : defaultKind; + } + static getPreferredUser(arg) { + return typeof arg.preferred === "boolean" ? arg.preferred : false; + } + constructor(kind, apply2, preferred) { + this.kind = kind; + this.apply = apply2; + this.preferred = preferred; + } +}; +var CodeActionItem = class { + constructor(action, provider, highlightRange2) { + this.action = action; + this.provider = provider; + this.highlightRange = highlightRange2; + } + async resolve(token) { + if (this.provider?.resolveCodeAction && !this.action.edit) { + let action; + try { + action = await this.provider.resolveCodeAction(this.action, token); + } catch (err) { + onUnexpectedExternalError(err); + } + if (action) { + this.action.edit = action.edit; + } + } + return this; + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/codeAction/browser/codeAction.js +var codeActionCommandId = "editor.action.codeAction"; +var quickFixCommandId = "editor.action.quickFix"; +var autoFixCommandId = "editor.action.autoFix"; +var refactorCommandId = "editor.action.refactor"; +var sourceActionCommandId = "editor.action.sourceAction"; +var organizeImportsCommandId = "editor.action.organizeImports"; +var fixAllCommandId = "editor.action.fixAll"; +var CODE_ACTION_SOUND_APPLIED_DURATION = 1e3; +var ManagedCodeActionSet = class _ManagedCodeActionSet extends Disposable { + static codeActionsPreferredComparator(a, b) { + if (a.isPreferred && !b.isPreferred) { + return -1; + } else if (!a.isPreferred && b.isPreferred) { + return 1; + } else { + return 0; + } + } + static codeActionsComparator({ action: a }, { action: b }) { + if (a.isAI && !b.isAI) { + return 1; + } else if (!a.isAI && b.isAI) { + return -1; + } + if (isNonEmptyArray(a.diagnostics)) { + return isNonEmptyArray(b.diagnostics) ? _ManagedCodeActionSet.codeActionsPreferredComparator(a, b) : -1; + } else if (isNonEmptyArray(b.diagnostics)) { + return 1; + } else { + return _ManagedCodeActionSet.codeActionsPreferredComparator(a, b); + } + } + constructor(actions, documentation, disposables) { + super(); + this.documentation = documentation; + this._register(disposables); + this.allActions = [...actions].sort(_ManagedCodeActionSet.codeActionsComparator); + this.validActions = this.allActions.filter(({ action }) => !action.disabled); + } + get hasAutoFix() { + return this.validActions.some(({ action: fix }) => !!fix.kind && CodeActionKind.QuickFix.contains(new HierarchicalKind(fix.kind)) && !!fix.isPreferred); + } + get hasAIFix() { + return this.validActions.some(({ action: fix }) => !!fix.isAI); + } + get allAIFixes() { + return this.validActions.every(({ action: fix }) => !!fix.isAI); + } +}; +var emptyCodeActionsResponse = { actions: [], documentation: void 0 }; +async function getCodeActions(registry, model, rangeOrSelection, trigger, progress, token) { + const filter = trigger.filter || {}; + const notebookFilter = { + ...filter, + excludes: [...filter.excludes || [], CodeActionKind.Notebook] + }; + const codeActionContext = { + only: filter.include?.value, + trigger: trigger.type + }; + const cts = new TextModelCancellationTokenSource(model, token); + const excludeNotebookCodeActions = trigger.type === 2; + const providers = getCodeActionProviders(registry, model, excludeNotebookCodeActions ? notebookFilter : filter); + const disposables = new DisposableStore(); + const promises = providers.map(async (provider) => { + const handle = setTimeout(() => progress.report(provider), 1250); + try { + const providedCodeActions = await provider.provideCodeActions(model, rangeOrSelection, codeActionContext, cts.token); + if (cts.token.isCancellationRequested) { + providedCodeActions?.dispose(); + return emptyCodeActionsResponse; + } + if (providedCodeActions) { + disposables.add(providedCodeActions); + } + const filteredActions = (providedCodeActions?.actions || []).filter((action) => action && filtersAction(filter, action)); + const documentation = getDocumentationFromProvider(provider, filteredActions, filter.include); + return { + actions: filteredActions.map((action) => new CodeActionItem(action, provider)), + documentation + }; + } catch (err) { + if (isCancellationError(err)) { + throw err; + } + onUnexpectedExternalError(err); + return emptyCodeActionsResponse; + } finally { + clearTimeout(handle); + } + }); + const listener = registry.onDidChange(() => { + const newProviders = registry.all(model); + if (!equals(newProviders, providers)) { + cts.cancel(); + } + }); + try { + const actions = await Promise.all(promises); + const allActions = actions.map((x) => x.actions).flat(); + const allDocumentation = [ + ...coalesce(actions.map((x) => x.documentation)), + ...getAdditionalDocumentationForShowingActions(registry, model, trigger, allActions) + ]; + const managedCodeActionSet = new ManagedCodeActionSet(allActions, allDocumentation, disposables); + disposables.add(managedCodeActionSet); + return managedCodeActionSet; + } catch (err) { + disposables.dispose(); + throw err; + } finally { + listener.dispose(); + cts.dispose(); + } +} +function getCodeActionProviders(registry, model, filter) { + return registry.all(model).filter((provider) => { + if (!provider.providedCodeActionKinds) { + return true; + } + return provider.providedCodeActionKinds.some((kind) => mayIncludeActionsOfKind(filter, new HierarchicalKind(kind))); + }); +} +function* getAdditionalDocumentationForShowingActions(registry, model, trigger, actionsToShow) { + if (model && actionsToShow.length) { + for (const provider of registry.all(model)) { + if (provider._getAdditionalMenuItems) { + yield* provider._getAdditionalMenuItems?.({ trigger: trigger.type, only: trigger.filter?.include?.value }, actionsToShow.map((item) => item.action)); + } + } + } +} +function getDocumentationFromProvider(provider, providedCodeActions, only) { + if (!provider.documentation) { + return void 0; + } + const documentation = provider.documentation.map((entry) => ({ kind: new HierarchicalKind(entry.kind), command: entry.command })); + if (only) { + let currentBest; + for (const entry of documentation) { + if (entry.kind.contains(only)) { + if (!currentBest) { + currentBest = entry; + } else { + if (currentBest.kind.contains(entry.kind)) { + currentBest = entry; + } + } + } + } + if (currentBest) { + return currentBest?.command; + } + } + for (const action of providedCodeActions) { + if (!action.kind) { + continue; + } + for (const entry of documentation) { + if (entry.kind.contains(new HierarchicalKind(action.kind))) { + return entry.command; + } + } + } + return void 0; +} +var ApplyCodeActionReason; +(function(ApplyCodeActionReason2) { + ApplyCodeActionReason2["OnSave"] = "onSave"; + ApplyCodeActionReason2["FromProblemsView"] = "fromProblemsView"; + ApplyCodeActionReason2["FromCodeActions"] = "fromCodeActions"; + ApplyCodeActionReason2["FromAILightbulb"] = "fromAILightbulb"; + ApplyCodeActionReason2["FromProblemsHover"] = "fromProblemsHover"; +})(ApplyCodeActionReason || (ApplyCodeActionReason = {})); +async function applyCodeAction(accessor, item, codeActionReason, options2, token = CancellationToken.None) { + const bulkEditService = accessor.get(IBulkEditService); + const commandService = accessor.get(ICommandService); + const telemetryService = accessor.get(ITelemetryService); + const notificationService = accessor.get(INotificationService); + const accessibilitySignalService = accessor.get(IAccessibilitySignalService); + telemetryService.publicLog2("codeAction.applyCodeAction", { + codeActionTitle: item.action.title, + codeActionKind: item.action.kind, + codeActionIsPreferred: !!item.action.isPreferred, + reason: codeActionReason + }); + accessibilitySignalService.playSignal(AccessibilitySignal.codeActionTriggered); + await item.resolve(token); + if (token.isCancellationRequested) { + return; + } + if (item.action.edit?.edits.length) { + const result = await bulkEditService.apply(item.action.edit, { + editor: options2?.editor, + label: item.action.title, + quotableLabel: item.action.title, + code: "undoredo.codeAction", + respectAutoSaveConfig: codeActionReason !== ApplyCodeActionReason.OnSave, + showPreview: options2?.preview, + reason: EditSources.codeAction({ kind: item.action.kind, providerId: ProviderId.fromExtensionId(item.provider?.extensionId) }) + }); + if (!result.isApplied) { + return; + } + } + if (item.action.command) { + try { + await commandService.executeCommand(item.action.command.id, ...item.action.command.arguments || []); + } catch (err) { + const message = asMessage(err); + notificationService.error(typeof message === "string" ? message : localize(830, "An unknown error occurred while applying the code action")); + } + } + setTimeout(() => accessibilitySignalService.playSignal(AccessibilitySignal.codeActionApplied), CODE_ACTION_SOUND_APPLIED_DURATION); +} +function asMessage(err) { + if (typeof err === "string") { + return err; + } else if (err instanceof Error && typeof err.message === "string") { + return err.message; + } else { + return void 0; + } +} +CommandsRegistry.registerCommand("_executeCodeActionProvider", async function(accessor, resource, rangeOrSelection, kind, itemResolveCount) { + if (!(resource instanceof URI)) { + throw illegalArgument(); + } + const { codeActionProvider } = accessor.get(ILanguageFeaturesService); + const model = accessor.get(IModelService).getModel(resource); + if (!model) { + throw illegalArgument(); + } + const validatedRangeOrSelection = Selection.isISelection(rangeOrSelection) ? Selection.liftSelection(rangeOrSelection) : Range.isIRange(rangeOrSelection) ? model.validateRange(rangeOrSelection) : void 0; + if (!validatedRangeOrSelection) { + throw illegalArgument(); + } + const include = typeof kind === "string" ? new HierarchicalKind(kind) : void 0; + const codeActionSet = await getCodeActions(codeActionProvider, model, validatedRangeOrSelection, { type: 1, triggerAction: CodeActionTriggerSource.Default, filter: { includeSourceActions: true, include } }, Progress.None, CancellationToken.None); + const resolving = []; + const resolveCount = Math.min(codeActionSet.validActions.length, typeof itemResolveCount === "number" ? itemResolveCount : 0); + for (let i2 = 0; i2 < resolveCount; i2++) { + resolving.push(codeActionSet.validActions[i2].resolve(CancellationToken.None)); + } + try { + await Promise.all(resolving); + return codeActionSet.validActions.map((item) => item.action); + } finally { + setTimeout(() => codeActionSet.dispose(), 100); + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/codeAction/browser/codeActionCommands.js +init_nls(); +init_contextkey(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/codeAction/browser/codeActionController.js +init_dom(); +init_errors(); +init_lazy(); +init_lifecycle(); +init_nls(); +init_commands(); +init_configuration(); +init_contextkey(); +init_instantiation(); + +// node_modules/monaco-editor-core/esm/vs/platform/markers/common/markers.js +init_nls(); +init_instantiation(); +var MarkerSeverity; +(function(MarkerSeverity4) { + MarkerSeverity4[MarkerSeverity4["Hint"] = 1] = "Hint"; + MarkerSeverity4[MarkerSeverity4["Info"] = 2] = "Info"; + MarkerSeverity4[MarkerSeverity4["Warning"] = 4] = "Warning"; + MarkerSeverity4[MarkerSeverity4["Error"] = 8] = "Error"; +})(MarkerSeverity || (MarkerSeverity = {})); +(function(MarkerSeverity4) { + function compare2(a, b) { + return b - a; + } + MarkerSeverity4.compare = compare2; + const _displayStrings = /* @__PURE__ */ Object.create(null); + _displayStrings[MarkerSeverity4.Error] = localize(1732, "Error"); + _displayStrings[MarkerSeverity4.Warning] = localize(1733, "Warning"); + _displayStrings[MarkerSeverity4.Info] = localize(1734, "Info"); + function toString(a) { + return _displayStrings[a] || ""; + } + MarkerSeverity4.toString = toString; + const _displayStringsPlural = /* @__PURE__ */ Object.create(null); + _displayStringsPlural[MarkerSeverity4.Error] = localize(1735, "Errors"); + _displayStringsPlural[MarkerSeverity4.Warning] = localize(1736, "Warnings"); + _displayStringsPlural[MarkerSeverity4.Info] = localize(1737, "Infos"); + function toStringPlural(a) { + return _displayStringsPlural[a] || ""; + } + MarkerSeverity4.toStringPlural = toStringPlural; + function fromSeverity(severity) { + switch (severity) { + case severity_default.Error: + return MarkerSeverity4.Error; + case severity_default.Warning: + return MarkerSeverity4.Warning; + case severity_default.Info: + return MarkerSeverity4.Info; + case severity_default.Ignore: + return MarkerSeverity4.Hint; + } + } + MarkerSeverity4.fromSeverity = fromSeverity; + function toSeverity(severity) { + switch (severity) { + case MarkerSeverity4.Error: + return severity_default.Error; + case MarkerSeverity4.Warning: + return severity_default.Warning; + case MarkerSeverity4.Info: + return severity_default.Info; + case MarkerSeverity4.Hint: + return severity_default.Ignore; + } + } + MarkerSeverity4.toSeverity = toSeverity; +})(MarkerSeverity || (MarkerSeverity = {})); +var IMarkerData; +(function(IMarkerData2) { + const emptyString = ""; + function makeKey(markerData) { + return makeKeyOptionalMessage(markerData, true); + } + IMarkerData2.makeKey = makeKey; + function makeKeyOptionalMessage(markerData, useMessage) { + const result = [emptyString]; + if (markerData.source) { + result.push(markerData.source.replace("\xA6", "\\\xA6")); + } else { + result.push(emptyString); + } + if (markerData.code) { + if (typeof markerData.code === "string") { + result.push(markerData.code.replace("\xA6", "\\\xA6")); + } else { + result.push(markerData.code.value.replace("\xA6", "\\\xA6")); + } + } else { + result.push(emptyString); + } + if (markerData.severity !== void 0 && markerData.severity !== null) { + result.push(MarkerSeverity.toString(markerData.severity)); + } else { + result.push(emptyString); + } + if (markerData.message && useMessage) { + result.push(markerData.message.replace("\xA6", "\\\xA6")); + } else { + result.push(emptyString); + } + if (markerData.startLineNumber !== void 0 && markerData.startLineNumber !== null) { + result.push(markerData.startLineNumber.toString()); + } else { + result.push(emptyString); + } + if (markerData.startColumn !== void 0 && markerData.startColumn !== null) { + result.push(markerData.startColumn.toString()); + } else { + result.push(emptyString); + } + if (markerData.endLineNumber !== void 0 && markerData.endLineNumber !== null) { + result.push(markerData.endLineNumber.toString()); + } else { + result.push(emptyString); + } + if (markerData.endColumn !== void 0 && markerData.endColumn !== null) { + result.push(markerData.endColumn.toString()); + } else { + result.push(emptyString); + } + result.push(emptyString); + return result.join("\xA6"); + } + IMarkerData2.makeKeyOptionalMessage = makeKeyOptionalMessage; +})(IMarkerData || (IMarkerData = {})); +var IMarkerService = createDecorator("markerService"); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/codeAction/browser/codeActionController.js +init_colorRegistry(); +init_theme(); +init_themeService(); +init_position(); +init_textModel(); +init_languageFeatures(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/codeAction/browser/codeActionKeybindingResolver.js +init_lazy(); +var __decorate53 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param48 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var CodeActionKeybindingResolver_1; +var CodeActionKeybindingResolver = class CodeActionKeybindingResolver2 { + static { + CodeActionKeybindingResolver_1 = this; + } + static { + this.codeActionCommands = [ + refactorCommandId, + codeActionCommandId, + sourceActionCommandId, + organizeImportsCommandId, + fixAllCommandId + ]; + } + constructor(keybindingService) { + this.keybindingService = keybindingService; + } + getResolver() { + const allCodeActionBindings = new Lazy(() => this.keybindingService.getKeybindings().filter((item) => CodeActionKeybindingResolver_1.codeActionCommands.indexOf(item.command) >= 0).filter((item) => item.resolvedKeybinding).map((item) => { + let commandArgs = item.commandArgs; + if (item.command === organizeImportsCommandId) { + commandArgs = { kind: CodeActionKind.SourceOrganizeImports.value }; + } else if (item.command === fixAllCommandId) { + commandArgs = { kind: CodeActionKind.SourceFixAll.value }; + } + return { + resolvedKeybinding: item.resolvedKeybinding, + ...CodeActionCommandArgs.fromUser(commandArgs, { + kind: HierarchicalKind.None, + apply: "never" + /* CodeActionAutoApply.Never */ + }) + }; + })); + return (action) => { + if (action.kind) { + const binding = this.bestKeybindingForCodeAction(action, allCodeActionBindings.value); + return binding?.resolvedKeybinding; + } + return void 0; + }; + } + bestKeybindingForCodeAction(action, candidates) { + if (!action.kind) { + return void 0; + } + const kind = new HierarchicalKind(action.kind); + return candidates.filter((candidate) => candidate.kind.contains(kind)).filter((candidate) => { + if (candidate.preferred) { + return action.isPreferred; + } + return true; + }).reduceRight((currentBest, candidate) => { + if (!currentBest) { + return candidate; + } + return currentBest.kind.contains(candidate.kind) ? candidate : currentBest; + }, void 0); + } +}; +CodeActionKeybindingResolver = CodeActionKeybindingResolver_1 = __decorate53([ + __param48(0, IKeybindingService) +], CodeActionKeybindingResolver); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/codeAction/browser/codeActionMenu.js +init_codicons(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/symbolIcons/browser/symbolIcons.js +init_nls(); +init_colorRegistry(); +var SYMBOL_ICON_ARRAY_FOREGROUND = registerColor("symbolIcon.arrayForeground", foreground, localize(1495, "The foreground color for array symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")); +var SYMBOL_ICON_BOOLEAN_FOREGROUND = registerColor("symbolIcon.booleanForeground", foreground, localize(1496, "The foreground color for boolean symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")); +var SYMBOL_ICON_CLASS_FOREGROUND = registerColor("symbolIcon.classForeground", { + dark: "#EE9D28", + light: "#D67E00", + hcDark: "#EE9D28", + hcLight: "#D67E00" +}, localize(1497, "The foreground color for class symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")); +var SYMBOL_ICON_COLOR_FOREGROUND = registerColor("symbolIcon.colorForeground", foreground, localize(1498, "The foreground color for color symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")); +var SYMBOL_ICON_CONSTANT_FOREGROUND = registerColor("symbolIcon.constantForeground", foreground, localize(1499, "The foreground color for constant symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")); +var SYMBOL_ICON_CONSTRUCTOR_FOREGROUND = registerColor("symbolIcon.constructorForeground", { + dark: "#B180D7", + light: "#652D90", + hcDark: "#B180D7", + hcLight: "#652D90" +}, localize(1500, "The foreground color for constructor symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")); +var SYMBOL_ICON_ENUMERATOR_FOREGROUND = registerColor("symbolIcon.enumeratorForeground", { + dark: "#EE9D28", + light: "#D67E00", + hcDark: "#EE9D28", + hcLight: "#D67E00" +}, localize(1501, "The foreground color for enumerator symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")); +var SYMBOL_ICON_ENUMERATOR_MEMBER_FOREGROUND = registerColor("symbolIcon.enumeratorMemberForeground", { + dark: "#75BEFF", + light: "#007ACC", + hcDark: "#75BEFF", + hcLight: "#007ACC" +}, localize(1502, "The foreground color for enumerator member symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")); +var SYMBOL_ICON_EVENT_FOREGROUND = registerColor("symbolIcon.eventForeground", { + dark: "#EE9D28", + light: "#D67E00", + hcDark: "#EE9D28", + hcLight: "#D67E00" +}, localize(1503, "The foreground color for event symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")); +var SYMBOL_ICON_FIELD_FOREGROUND = registerColor("symbolIcon.fieldForeground", { + dark: "#75BEFF", + light: "#007ACC", + hcDark: "#75BEFF", + hcLight: "#007ACC" +}, localize(1504, "The foreground color for field symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")); +var SYMBOL_ICON_FILE_FOREGROUND = registerColor("symbolIcon.fileForeground", foreground, localize(1505, "The foreground color for file symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")); +var SYMBOL_ICON_FOLDER_FOREGROUND = registerColor("symbolIcon.folderForeground", foreground, localize(1506, "The foreground color for folder symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")); +var SYMBOL_ICON_FUNCTION_FOREGROUND = registerColor("symbolIcon.functionForeground", { + dark: "#B180D7", + light: "#652D90", + hcDark: "#B180D7", + hcLight: "#652D90" +}, localize(1507, "The foreground color for function symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")); +var SYMBOL_ICON_INTERFACE_FOREGROUND = registerColor("symbolIcon.interfaceForeground", { + dark: "#75BEFF", + light: "#007ACC", + hcDark: "#75BEFF", + hcLight: "#007ACC" +}, localize(1508, "The foreground color for interface symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")); +var SYMBOL_ICON_KEY_FOREGROUND = registerColor("symbolIcon.keyForeground", foreground, localize(1509, "The foreground color for key symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")); +var SYMBOL_ICON_KEYWORD_FOREGROUND = registerColor("symbolIcon.keywordForeground", foreground, localize(1510, "The foreground color for keyword symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")); +var SYMBOL_ICON_METHOD_FOREGROUND = registerColor("symbolIcon.methodForeground", { + dark: "#B180D7", + light: "#652D90", + hcDark: "#B180D7", + hcLight: "#652D90" +}, localize(1511, "The foreground color for method symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")); +var SYMBOL_ICON_MODULE_FOREGROUND = registerColor("symbolIcon.moduleForeground", foreground, localize(1512, "The foreground color for module symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")); +var SYMBOL_ICON_NAMESPACE_FOREGROUND = registerColor("symbolIcon.namespaceForeground", foreground, localize(1513, "The foreground color for namespace symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")); +var SYMBOL_ICON_NULL_FOREGROUND = registerColor("symbolIcon.nullForeground", foreground, localize(1514, "The foreground color for null symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")); +var SYMBOL_ICON_NUMBER_FOREGROUND = registerColor("symbolIcon.numberForeground", foreground, localize(1515, "The foreground color for number symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")); +var SYMBOL_ICON_OBJECT_FOREGROUND = registerColor("symbolIcon.objectForeground", foreground, localize(1516, "The foreground color for object symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")); +var SYMBOL_ICON_OPERATOR_FOREGROUND = registerColor("symbolIcon.operatorForeground", foreground, localize(1517, "The foreground color for operator symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")); +var SYMBOL_ICON_PACKAGE_FOREGROUND = registerColor("symbolIcon.packageForeground", foreground, localize(1518, "The foreground color for package symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")); +var SYMBOL_ICON_PROPERTY_FOREGROUND = registerColor("symbolIcon.propertyForeground", foreground, localize(1519, "The foreground color for property symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")); +var SYMBOL_ICON_REFERENCE_FOREGROUND = registerColor("symbolIcon.referenceForeground", foreground, localize(1520, "The foreground color for reference symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")); +var SYMBOL_ICON_SNIPPET_FOREGROUND = registerColor("symbolIcon.snippetForeground", foreground, localize(1521, "The foreground color for snippet symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")); +var SYMBOL_ICON_STRING_FOREGROUND = registerColor("symbolIcon.stringForeground", foreground, localize(1522, "The foreground color for string symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")); +var SYMBOL_ICON_STRUCT_FOREGROUND = registerColor("symbolIcon.structForeground", foreground, localize(1523, "The foreground color for struct symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")); +var SYMBOL_ICON_TEXT_FOREGROUND = registerColor("symbolIcon.textForeground", foreground, localize(1524, "The foreground color for text symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")); +var SYMBOL_ICON_TYPEPARAMETER_FOREGROUND = registerColor("symbolIcon.typeParameterForeground", foreground, localize(1525, "The foreground color for type parameter symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")); +var SYMBOL_ICON_UNIT_FOREGROUND = registerColor("symbolIcon.unitForeground", foreground, localize(1526, "The foreground color for unit symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")); +var SYMBOL_ICON_VARIABLE_FOREGROUND = registerColor("symbolIcon.variableForeground", { + dark: "#75BEFF", + light: "#007ACC", + hcDark: "#75BEFF", + hcLight: "#007ACC" +}, localize(1527, "The foreground color for variable symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/codeAction/browser/codeActionMenu.js +init_nls(); +var uncategorizedCodeActionGroup = Object.freeze({ kind: HierarchicalKind.Empty, title: localize(866, "More Actions...") }); +var codeActionGroups = Object.freeze([ + { kind: CodeActionKind.QuickFix, title: localize(867, "Quick Fix") }, + { kind: CodeActionKind.RefactorExtract, title: localize(868, "Extract"), icon: Codicon.wrench }, + { kind: CodeActionKind.RefactorInline, title: localize(869, "Inline"), icon: Codicon.wrench }, + { kind: CodeActionKind.RefactorRewrite, title: localize(870, "Rewrite"), icon: Codicon.wrench }, + { kind: CodeActionKind.RefactorMove, title: localize(871, "Move"), icon: Codicon.wrench }, + { kind: CodeActionKind.SurroundWith, title: localize(872, "Surround With"), icon: Codicon.surroundWith }, + { kind: CodeActionKind.Source, title: localize(873, "Source Action"), icon: Codicon.symbolFile }, + uncategorizedCodeActionGroup +]); +function toMenuItems(inputCodeActions, showHeaders, keybindingResolver) { + if (!showHeaders) { + return inputCodeActions.map((action) => { + return { + kind: "action", + item: action, + group: uncategorizedCodeActionGroup, + disabled: !!action.action.disabled, + label: action.action.disabled || action.action.title, + canPreview: !!action.action.edit?.edits.length + }; + }); + } + const menuEntries = codeActionGroups.map((group) => ({ group, actions: [] })); + for (const action of inputCodeActions) { + const kind = action.action.kind ? new HierarchicalKind(action.action.kind) : HierarchicalKind.None; + for (const menuEntry of menuEntries) { + if (menuEntry.group.kind.contains(kind)) { + menuEntry.actions.push(action); + break; + } + } + } + const allMenuItems = []; + for (const menuEntry of menuEntries) { + if (menuEntry.actions.length) { + allMenuItems.push({ kind: "header", group: menuEntry.group }); + for (const action of menuEntry.actions) { + const group = menuEntry.group; + allMenuItems.push({ + kind: "action", + item: action, + group: action.action.isAI ? { title: group.title, kind: group.kind, icon: Codicon.sparkle } : group, + label: action.action.title, + disabled: !!action.action.disabled, + keybinding: keybindingResolver(action.action) + }); + } + } + } + return allMenuItems; +} + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/codeAction/browser/codeActionModel.js +init_async(); +init_errors(); +init_event(); +init_lifecycle(); +init_resources(); +init_contextkey(); +init_position(); +init_selection(); +var SUPPORTED_CODE_ACTIONS = new RawContextKey("supportedCodeAction", ""); +var APPLY_FIX_ALL_COMMAND_ID = "_typescript.applyFixAllCodeAction"; +var CodeActionOracle = class extends Disposable { + constructor(_editor, _markerService, _signalChange, _delay = 250) { + super(); + this._editor = _editor; + this._markerService = _markerService; + this._signalChange = _signalChange; + this._delay = _delay; + this._autoTriggerTimer = this._register(new TimeoutTimer()); + this._register(this._markerService.onMarkerChanged((e) => this._onMarkerChanges(e))); + this._register(this._editor.onDidChangeCursorPosition(() => this._tryAutoTrigger())); + } + trigger(trigger) { + const selection = this._getRangeOfSelectionUnlessWhitespaceEnclosed(trigger); + this._signalChange(selection ? { trigger, selection } : void 0); + } + _onMarkerChanges(resources) { + const model = this._editor.getModel(); + if (model && resources.some((resource) => isEqual(resource, model.uri))) { + this._tryAutoTrigger(); + } + } + _tryAutoTrigger() { + this._autoTriggerTimer.cancelAndSet(() => { + this.trigger({ type: 2, triggerAction: CodeActionTriggerSource.Default }); + }, this._delay); + } + _getRangeOfSelectionUnlessWhitespaceEnclosed(trigger) { + if (!this._editor.hasModel()) { + return void 0; + } + const selection = this._editor.getSelection(); + if (trigger.type === 1) { + return selection; + } + const enabled = this._editor.getOption( + 73 + /* EditorOption.lightbulb */ + ).enabled; + if (enabled === ShowLightbulbIconMode.Off) { + return void 0; + } else if (enabled === ShowLightbulbIconMode.On) { + return selection; + } else if (enabled === ShowLightbulbIconMode.OnCode) { + const isSelectionEmpty = selection.isEmpty(); + if (!isSelectionEmpty) { + return selection; + } + const model = this._editor.getModel(); + const { lineNumber, column } = selection.getPosition(); + const line = model.getLineContent(lineNumber); + if (line.length === 0) { + return void 0; + } else if (column === 1) { + if (/\s/.test(line[0])) { + return void 0; + } + } else if (column === model.getLineMaxColumn(lineNumber)) { + if (/\s/.test(line[line.length - 1])) { + return void 0; + } + } else { + if (/\s/.test(line[column - 2]) && /\s/.test(line[column - 1])) { + return void 0; + } + } + } + return selection; + } +}; +var CodeActionsState; +(function(CodeActionsState2) { + CodeActionsState2.Empty = { + type: 0 + /* Type.Empty */ + }; + class Triggered { + constructor(trigger, position, _cancellablePromise) { + this.trigger = trigger; + this.position = position; + this._cancellablePromise = _cancellablePromise; + this.type = 1; + this.actions = _cancellablePromise.catch((e) => { + if (isCancellationError(e)) { + return emptyCodeActionSet; + } + throw e; + }); + } + cancel() { + this._cancellablePromise.cancel(); + } + } + CodeActionsState2.Triggered = Triggered; +})(CodeActionsState || (CodeActionsState = {})); +var emptyCodeActionSet = Object.freeze({ + allActions: [], + validActions: [], + dispose: () => { + }, + documentation: [], + hasAutoFix: false, + hasAIFix: false, + allAIFixes: false +}); +var CodeActionModel = class extends Disposable { + constructor(_editor, _registry2, _markerService, contextKeyService, _progressService, _configurationService) { + super(); + this._editor = _editor; + this._registry = _registry2; + this._markerService = _markerService; + this._progressService = _progressService; + this._configurationService = _configurationService; + this._codeActionOracle = this._register(new MutableDisposable()); + this._state = CodeActionsState.Empty; + this._onDidChangeState = this._register(new Emitter()); + this.onDidChangeState = this._onDidChangeState.event; + this.codeActionsDisposable = this._register(new MutableDisposable()); + this._disposed = false; + this._supportedCodeActions = SUPPORTED_CODE_ACTIONS.bindTo(contextKeyService); + this._register(this._editor.onDidChangeModel(() => this._update())); + this._register(this._editor.onDidChangeModelLanguage(() => this._update())); + this._register(this._registry.onDidChange(() => this._update())); + this._register(this._editor.onDidChangeConfiguration((e) => { + if (e.hasChanged( + 73 + /* EditorOption.lightbulb */ + )) { + this._update(); + } + })); + this._update(); + } + dispose() { + if (this._disposed) { + return; + } + this._disposed = true; + super.dispose(); + this.setState(CodeActionsState.Empty, true); + } + _settingEnabledNearbyQuickfixes() { + const model = this._editor?.getModel(); + return this._configurationService ? this._configurationService.getValue("editor.codeActionWidget.includeNearbyQuickFixes", { resource: model?.uri }) : false; + } + _update() { + if (this._disposed) { + return; + } + this._codeActionOracle.value = void 0; + this.setState(CodeActionsState.Empty); + const model = this._editor.getModel(); + if (model && this._registry.has(model) && !this._editor.getOption( + 104 + /* EditorOption.readOnly */ + )) { + const supportedActions = this._registry.all(model).flatMap((provider) => provider.providedCodeActionKinds ?? []); + this._supportedCodeActions.set(supportedActions.join(" ")); + this._codeActionOracle.value = new CodeActionOracle(this._editor, this._markerService, (trigger) => { + if (!trigger) { + this.setState(CodeActionsState.Empty); + return; + } + const startPosition = trigger.selection.getStartPosition(); + const actions = createCancelablePromise(async (token) => { + if (this._settingEnabledNearbyQuickfixes() && trigger.trigger.type === 1 && (trigger.trigger.triggerAction === CodeActionTriggerSource.QuickFix || trigger.trigger.filter?.include?.contains(CodeActionKind.QuickFix))) { + const codeActionSet2 = await getCodeActions(this._registry, model, trigger.selection, trigger.trigger, Progress.None, token); + this.codeActionsDisposable.value = codeActionSet2; + const allCodeActions = [...codeActionSet2.allActions]; + if (token.isCancellationRequested) { + codeActionSet2.dispose(); + return emptyCodeActionSet; + } + const foundQuickfix = codeActionSet2.validActions?.some((action) => { + return action.action.kind && CodeActionKind.QuickFix.contains(new HierarchicalKind(action.action.kind)) && !action.action.isAI; + }); + const allMarkers = this._markerService.read({ resource: model.uri }); + if (foundQuickfix) { + for (const action of codeActionSet2.validActions) { + if (action.action.command?.arguments?.some((arg) => typeof arg === "string" && arg.includes(APPLY_FIX_ALL_COMMAND_ID))) { + action.action.diagnostics = [...allMarkers.filter((marker) => marker.relatedInformation)]; + } + } + return { validActions: codeActionSet2.validActions, allActions: allCodeActions, documentation: codeActionSet2.documentation, hasAutoFix: codeActionSet2.hasAutoFix, hasAIFix: codeActionSet2.hasAIFix, allAIFixes: codeActionSet2.allAIFixes, dispose: () => { + this.codeActionsDisposable.value = codeActionSet2; + } }; + } else if (!foundQuickfix) { + if (allMarkers.length > 0) { + const currPosition = trigger.selection.getPosition(); + let trackedPosition = currPosition; + let distance = Number.MAX_VALUE; + const currentActions = [...codeActionSet2.validActions]; + for (const marker of allMarkers) { + const col = marker.endColumn; + const row = marker.endLineNumber; + const startRow = marker.startLineNumber; + if (row === currPosition.lineNumber || startRow === currPosition.lineNumber) { + trackedPosition = new Position(row, col); + const newCodeActionTrigger = { + type: trigger.trigger.type, + triggerAction: trigger.trigger.triggerAction, + filter: { include: trigger.trigger.filter?.include ? trigger.trigger.filter?.include : CodeActionKind.QuickFix }, + autoApply: trigger.trigger.autoApply, + context: { notAvailableMessage: trigger.trigger.context?.notAvailableMessage || "", position: trackedPosition } + }; + const selectionAsPosition = new Selection(trackedPosition.lineNumber, trackedPosition.column, trackedPosition.lineNumber, trackedPosition.column); + const actionsAtMarker = await getCodeActions(this._registry, model, selectionAsPosition, newCodeActionTrigger, Progress.None, token); + if (token.isCancellationRequested) { + actionsAtMarker.dispose(); + return emptyCodeActionSet; + } + if (actionsAtMarker.validActions.length !== 0) { + for (const action of actionsAtMarker.validActions) { + if (action.action.command?.arguments?.some((arg) => typeof arg === "string" && arg.includes(APPLY_FIX_ALL_COMMAND_ID))) { + action.action.diagnostics = [...allMarkers.filter((marker2) => marker2.relatedInformation)]; + } + } + if (codeActionSet2.allActions.length === 0) { + allCodeActions.push(...actionsAtMarker.allActions); + } + if (Math.abs(currPosition.column - col) < distance) { + currentActions.unshift(...actionsAtMarker.validActions); + } else { + currentActions.push(...actionsAtMarker.validActions); + } + } + distance = Math.abs(currPosition.column - col); + } + } + const filteredActions = currentActions.filter((action, index, self2) => self2.findIndex((a) => a.action.title === action.action.title) === index); + filteredActions.sort((a, b) => { + if (a.action.isPreferred && !b.action.isPreferred) { + return -1; + } else if (!a.action.isPreferred && b.action.isPreferred) { + return 1; + } else if (a.action.isAI && !b.action.isAI) { + return 1; + } else if (!a.action.isAI && b.action.isAI) { + return -1; + } else { + return 0; + } + }); + return { validActions: filteredActions, allActions: allCodeActions, documentation: codeActionSet2.documentation, hasAutoFix: codeActionSet2.hasAutoFix, hasAIFix: codeActionSet2.hasAIFix, allAIFixes: codeActionSet2.allAIFixes, dispose: () => { + this.codeActionsDisposable.value = codeActionSet2; + } }; + } + } + } + if (trigger.trigger.type === 1) { + const codeActions = await getCodeActions(this._registry, model, trigger.selection, trigger.trigger, Progress.None, token); + this.codeActionsDisposable.value = codeActions; + return codeActions; + } + const codeActionSet = await getCodeActions(this._registry, model, trigger.selection, trigger.trigger, Progress.None, token); + this.codeActionsDisposable.value = codeActionSet; + return codeActionSet; + }); + if (trigger.trigger.type === 1) { + this._progressService?.showWhile(actions, 250); + } + const newState = new CodeActionsState.Triggered(trigger.trigger, startPosition, actions); + let isManualToAutoTransition = false; + if (this._state.type === 1) { + isManualToAutoTransition = this._state.trigger.type === 1 && newState.type === 1 && newState.trigger.type === 2 && this._state.position !== newState.position; + } + if (!isManualToAutoTransition) { + this.setState(newState); + } else { + setTimeout(() => { + this.setState(newState); + }, 500); + } + }, void 0); + this._codeActionOracle.value.trigger({ type: 2, triggerAction: CodeActionTriggerSource.Default }); + } else { + this._supportedCodeActions.reset(); + } + } + trigger(trigger) { + this._codeActionOracle.value?.trigger(trigger); + this.codeActionsDisposable.dispose(); + } + setState(newState, skipNotify) { + if (newState === this._state) { + return; + } + if (this._state.type === 1) { + this._state.cancel(); + } + this._state = newState; + if (!skipNotify && !this._disposed) { + this._onDidChangeState.fire(newState); + } + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/codeAction/browser/lightBulbWidget.js +init_dom(); +init_codicons(); +init_event(); +init_lifecycle(); +init_themables(); +init_model2(); +init_textModel(); +init_utils4(); +init_nls(); +init_range(); +var __decorate54 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param49 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var LightBulbWidget_1; +var GUTTER_LIGHTBULB_ICON = registerIcon("gutter-lightbulb", Codicon.lightBulb, localize(874, "Icon which spawns code actions menu from the gutter when there is no space in the editor.")); +var GUTTER_LIGHTBULB_AUTO_FIX_ICON = registerIcon("gutter-lightbulb-auto-fix", Codicon.lightbulbAutofix, localize(875, "Icon which spawns code actions menu from the gutter when there is no space in the editor and a quick fix is available.")); +var GUTTER_LIGHTBULB_AIFIX_ICON = registerIcon("gutter-lightbulb-sparkle", Codicon.lightbulbSparkle, localize(876, "Icon which spawns code actions menu from the gutter when there is no space in the editor and an AI fix is available.")); +var GUTTER_LIGHTBULB_AIFIX_AUTO_FIX_ICON = registerIcon("gutter-lightbulb-aifix-auto-fix", Codicon.lightbulbSparkleAutofix, localize(877, "Icon which spawns code actions menu from the gutter when there is no space in the editor and an AI fix and a quick fix is available.")); +var GUTTER_SPARKLE_FILLED_ICON = registerIcon("gutter-lightbulb-sparkle-filled", Codicon.sparkleFilled, localize(878, "Icon which spawns code actions menu from the gutter when there is no space in the editor and an AI fix and a quick fix is available.")); +var LightBulbState; +(function(LightBulbState2) { + LightBulbState2.Hidden = { + type: 0 + /* Type.Hidden */ + }; + class Showing { + constructor(actions, trigger, editorPosition, widgetPosition) { + this.actions = actions; + this.trigger = trigger; + this.editorPosition = editorPosition; + this.widgetPosition = widgetPosition; + this.type = 1; + } + } + LightBulbState2.Showing = Showing; +})(LightBulbState || (LightBulbState = {})); +var LightBulbWidget = class LightBulbWidget2 extends Disposable { + static { + LightBulbWidget_1 = this; + } + static { + this.GUTTER_DECORATION = ModelDecorationOptions.register({ + description: "codicon-gutter-lightbulb-decoration", + glyphMarginClassName: ThemeIcon.asClassName(Codicon.lightBulb), + glyphMargin: { position: GlyphMarginLane.Left }, + stickiness: 1 + }); + } + static { + this.ID = "editor.contrib.lightbulbWidget"; + } + static { + this._posPref = [ + 0 + /* ContentWidgetPositionPreference.EXACT */ + ]; + } + constructor(_editor, _keybindingService) { + super(); + this._editor = _editor; + this._keybindingService = _keybindingService; + this._onClick = this._register(new Emitter()); + this.onClick = this._onClick.event; + this._state = LightBulbState.Hidden; + this._gutterState = LightBulbState.Hidden; + this._iconClasses = []; + this.lightbulbClasses = [ + "codicon-" + GUTTER_LIGHTBULB_ICON.id, + "codicon-" + GUTTER_LIGHTBULB_AIFIX_AUTO_FIX_ICON.id, + "codicon-" + GUTTER_LIGHTBULB_AUTO_FIX_ICON.id, + "codicon-" + GUTTER_LIGHTBULB_AIFIX_ICON.id, + "codicon-" + GUTTER_SPARKLE_FILLED_ICON.id + ]; + this.gutterDecoration = LightBulbWidget_1.GUTTER_DECORATION; + this._domNode = $("div.lightBulbWidget"); + this._domNode.role = "listbox"; + this._register(Gesture.ignoreTarget(this._domNode)); + this._editor.addContentWidget(this); + this._register(this._editor.onDidChangeModelContent((_) => { + const editorModel = this._editor.getModel(); + if (this.state.type !== 1 || !editorModel || this.state.editorPosition.lineNumber >= editorModel.getLineCount()) { + this.hide(); + } + if (this.gutterState.type !== 1 || !editorModel || this.gutterState.editorPosition.lineNumber >= editorModel.getLineCount()) { + this.gutterHide(); + } + })); + this._register(addStandardDisposableGenericMouseDownListener(this._domNode, (e) => { + if (this.state.type !== 1) { + return; + } + this._editor.focus(); + e.preventDefault(); + const { top, height } = getDomNodePagePosition(this._domNode); + const lineHeight = this._editor.getOption( + 75 + /* EditorOption.lineHeight */ + ); + let pad = Math.floor(lineHeight / 3); + if (this.state.widgetPosition.position !== null && this.state.widgetPosition.position.lineNumber < this.state.editorPosition.lineNumber) { + pad += lineHeight; + } + this._onClick.fire({ + x: e.posx, + y: top + height + pad, + actions: this.state.actions, + trigger: this.state.trigger + }); + })); + this._register(addDisposableListener(this._domNode, "mouseenter", (e) => { + if ((e.buttons & 1) !== 1) { + return; + } + this.hide(); + })); + this._register(Event.runAndSubscribe(this._keybindingService.onDidUpdateKeybindings, () => { + this._preferredKbLabel = this._keybindingService.lookupKeybinding(autoFixCommandId)?.getLabel() ?? void 0; + this._quickFixKbLabel = this._keybindingService.lookupKeybinding(quickFixCommandId)?.getLabel() ?? void 0; + this._updateLightBulbTitleAndIcon(); + })); + this._register(this._editor.onMouseDown(async (e) => { + if (!e.target.element || !this.lightbulbClasses.some((cls) => e.target.element && e.target.element.classList.contains(cls))) { + return; + } + if (this.gutterState.type !== 1) { + return; + } + this._editor.focus(); + const { top, height } = getDomNodePagePosition(e.target.element); + const lineHeight = this._editor.getOption( + 75 + /* EditorOption.lineHeight */ + ); + let pad = Math.floor(lineHeight / 3); + if (this.gutterState.widgetPosition.position !== null && this.gutterState.widgetPosition.position.lineNumber < this.gutterState.editorPosition.lineNumber) { + pad += lineHeight; + } + this._onClick.fire({ + x: e.event.posx, + y: top + height + pad, + actions: this.gutterState.actions, + trigger: this.gutterState.trigger + }); + })); + } + dispose() { + super.dispose(); + this._editor.removeContentWidget(this); + if (this._gutterDecorationID) { + this._removeGutterDecoration(this._gutterDecorationID); + } + } + getId() { + return "LightBulbWidget"; + } + getDomNode() { + return this._domNode; + } + getPosition() { + return this._state.type === 1 ? this._state.widgetPosition : null; + } + update(actions, trigger, atPosition) { + if (actions.validActions.length <= 0) { + this.gutterHide(); + return this.hide(); + } + const hasTextFocus = this._editor.hasTextFocus(); + if (!hasTextFocus) { + this.gutterHide(); + return this.hide(); + } + const options2 = this._editor.getOptions(); + if (!options2.get( + 73 + /* EditorOption.lightbulb */ + ).enabled) { + this.gutterHide(); + return this.hide(); + } + const model = this._editor.getModel(); + if (!model) { + this.gutterHide(); + return this.hide(); + } + const { lineNumber, column } = model.validatePosition(atPosition); + const tabSize = model.getOptions().tabSize; + const fontInfo = this._editor.getOptions().get( + 59 + /* EditorOption.fontInfo */ + ); + const lineContent = model.getLineContent(lineNumber); + const indent = computeIndentLevel(lineContent, tabSize); + const lineHasSpace = fontInfo.spaceWidth * indent > 22; + const isFolded = (lineNumber2) => { + return lineNumber2 > 2 && this._editor.getTopForLineNumber(lineNumber2) === this._editor.getTopForLineNumber(lineNumber2 - 1); + }; + const currLineDecorations = this._editor.getLineDecorations(lineNumber); + let hasDecoration = false; + if (currLineDecorations) { + for (const decoration3 of currLineDecorations) { + const glyphClass = decoration3.options.glyphMarginClassName; + if (glyphClass && !this.lightbulbClasses.some((className2) => glyphClass.includes(className2))) { + hasDecoration = true; + break; + } + } + } + let effectiveLineNumber = lineNumber; + let effectiveColumnNumber = 1; + if (!lineHasSpace) { + const isLineEmptyOrIndented = (lineNumber2) => { + const lineContent2 = model.getLineContent(lineNumber2); + return /^\s*$|^\s+/.test(lineContent2) || lineContent2.length <= effectiveColumnNumber; + }; + if (lineNumber > 1 && !isFolded(lineNumber - 1)) { + const lineCount = model.getLineCount(); + const endLine = lineNumber === lineCount; + const prevLineEmptyOrIndented = lineNumber > 1 && isLineEmptyOrIndented(lineNumber - 1); + const nextLineEmptyOrIndented = !endLine && isLineEmptyOrIndented(lineNumber + 1); + const currLineEmptyOrIndented = isLineEmptyOrIndented(lineNumber); + const notEmpty = !nextLineEmptyOrIndented && !prevLineEmptyOrIndented; + if (!nextLineEmptyOrIndented && !prevLineEmptyOrIndented && !hasDecoration) { + this.gutterState = new LightBulbState.Showing(actions, trigger, atPosition, { + position: { lineNumber: effectiveLineNumber, column: effectiveColumnNumber }, + preference: LightBulbWidget_1._posPref + }); + this.renderGutterLightbub(); + return this.hide(); + } else if (prevLineEmptyOrIndented || endLine || prevLineEmptyOrIndented && !currLineEmptyOrIndented) { + effectiveLineNumber -= 1; + } else if (nextLineEmptyOrIndented || notEmpty && currLineEmptyOrIndented) { + effectiveLineNumber += 1; + } + } else if (lineNumber === 1 && (lineNumber === model.getLineCount() || !isLineEmptyOrIndented(lineNumber + 1) && !isLineEmptyOrIndented(lineNumber))) { + this.gutterState = new LightBulbState.Showing(actions, trigger, atPosition, { + position: { lineNumber: effectiveLineNumber, column: effectiveColumnNumber }, + preference: LightBulbWidget_1._posPref + }); + if (hasDecoration) { + this.gutterHide(); + } else { + this.renderGutterLightbub(); + return this.hide(); + } + } else if (lineNumber < model.getLineCount() && !isFolded(lineNumber + 1)) { + effectiveLineNumber += 1; + } else if (column * fontInfo.spaceWidth < 22) { + return this.hide(); + } + effectiveColumnNumber = /^\S\s*$/.test(model.getLineContent(effectiveLineNumber)) ? 2 : 1; + } + this.state = new LightBulbState.Showing(actions, trigger, atPosition, { + position: { lineNumber: effectiveLineNumber, column: effectiveColumnNumber }, + preference: LightBulbWidget_1._posPref + }); + if (this._gutterDecorationID) { + this._removeGutterDecoration(this._gutterDecorationID); + this.gutterHide(); + } + const validActions = actions.validActions; + const actionKind = actions.validActions[0].action.kind; + if (validActions.length !== 1 || !actionKind) { + this._editor.layoutContentWidget(this); + return; + } + this._editor.layoutContentWidget(this); + } + hide() { + if (this.state === LightBulbState.Hidden) { + return; + } + this.state = LightBulbState.Hidden; + this._editor.layoutContentWidget(this); + } + gutterHide() { + if (this.gutterState === LightBulbState.Hidden) { + return; + } + if (this._gutterDecorationID) { + this._removeGutterDecoration(this._gutterDecorationID); + } + this.gutterState = LightBulbState.Hidden; + } + get state() { + return this._state; + } + set state(value) { + this._state = value; + this._updateLightBulbTitleAndIcon(); + } + get gutterState() { + return this._gutterState; + } + set gutterState(value) { + this._gutterState = value; + this._updateGutterLightBulbTitleAndIcon(); + } + _updateLightBulbTitleAndIcon() { + this._domNode.classList.remove(...this._iconClasses); + this._iconClasses = []; + if (this.state.type !== 1) { + return; + } + let icon; + let autoRun = false; + if (this.state.actions.allAIFixes) { + icon = Codicon.sparkleFilled; + if (this.state.actions.validActions.length === 1) { + autoRun = true; + } + } else if (this.state.actions.hasAutoFix) { + if (this.state.actions.hasAIFix) { + icon = Codicon.lightbulbSparkleAutofix; + } else { + icon = Codicon.lightbulbAutofix; + } + } else if (this.state.actions.hasAIFix) { + icon = Codicon.lightbulbSparkle; + } else { + icon = Codicon.lightBulb; + } + this._updateLightbulbTitle(this.state.actions.hasAutoFix, autoRun); + this._iconClasses = ThemeIcon.asClassNameArray(icon); + this._domNode.classList.add(...this._iconClasses); + } + _updateGutterLightBulbTitleAndIcon() { + if (this.gutterState.type !== 1) { + return; + } + let icon; + let autoRun = false; + if (this.gutterState.actions.allAIFixes) { + icon = GUTTER_SPARKLE_FILLED_ICON; + if (this.gutterState.actions.validActions.length === 1) { + autoRun = true; + } + } else if (this.gutterState.actions.hasAutoFix) { + if (this.gutterState.actions.hasAIFix) { + icon = GUTTER_LIGHTBULB_AIFIX_AUTO_FIX_ICON; + } else { + icon = GUTTER_LIGHTBULB_AUTO_FIX_ICON; + } + } else if (this.gutterState.actions.hasAIFix) { + icon = GUTTER_LIGHTBULB_AIFIX_ICON; + } else { + icon = GUTTER_LIGHTBULB_ICON; + } + this._updateLightbulbTitle(this.gutterState.actions.hasAutoFix, autoRun); + const GUTTER_DECORATION = ModelDecorationOptions.register({ + description: "codicon-gutter-lightbulb-decoration", + glyphMarginClassName: ThemeIcon.asClassName(icon), + glyphMargin: { position: GlyphMarginLane.Left }, + stickiness: 1 + }); + this.gutterDecoration = GUTTER_DECORATION; + } + /* Gutter Helper Functions */ + renderGutterLightbub() { + const selection = this._editor.getSelection(); + if (!selection) { + return; + } + if (this._gutterDecorationID === void 0) { + this._addGutterDecoration(selection.startLineNumber); + } else { + this._updateGutterDecoration(this._gutterDecorationID, selection.startLineNumber); + } + } + _addGutterDecoration(lineNumber) { + this._editor.changeDecorations((accessor) => { + this._gutterDecorationID = accessor.addDecoration(new Range(lineNumber, 0, lineNumber, 0), this.gutterDecoration); + }); + } + _removeGutterDecoration(decorationId) { + this._editor.changeDecorations((accessor) => { + accessor.removeDecoration(decorationId); + this._gutterDecorationID = void 0; + }); + } + _updateGutterDecoration(decorationId, lineNumber) { + this._editor.changeDecorations((accessor) => { + accessor.changeDecoration(decorationId, new Range(lineNumber, 0, lineNumber, 0)); + accessor.changeDecorationOptions(decorationId, this.gutterDecoration); + }); + } + _updateLightbulbTitle(autoFix, autoRun) { + if (this.state.type !== 1) { + return; + } + if (autoRun) { + this.title = localize(879, "Run: {0}", this.state.actions.validActions[0].action.title); + } else if (autoFix && this._preferredKbLabel) { + this.title = localize(880, "Show Code Actions. Preferred Quick Fix Available ({0})", this._preferredKbLabel); + } else if (!autoFix && this._quickFixKbLabel) { + this.title = localize(881, "Show Code Actions ({0})", this._quickFixKbLabel); + } else if (!autoFix) { + this.title = localize(882, "Show Code Actions"); + } + } + set title(value) { + this._domNode.title = value; + } +}; +LightBulbWidget = LightBulbWidget_1 = __decorate54([ + __param49(1, IKeybindingService) +], LightBulbWidget); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/codeAction/browser/codeActionController.js +var __decorate55 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param50 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var CodeActionController_1; +var DECORATION_CLASS_NAME = "quickfix-edit-highlight"; +var CodeActionController = class CodeActionController2 extends Disposable { + static { + CodeActionController_1 = this; + } + static { + this.ID = "editor.contrib.codeActionController"; + } + static get(editor2) { + return editor2.getContribution(CodeActionController_1.ID); + } + constructor(editor2, markerService, contextKeyService, instantiationService, languageFeaturesService, progressService, _commandService, _configurationService, _actionWidgetService, _instantiationService, _progressService) { + super(); + this._commandService = _commandService; + this._configurationService = _configurationService; + this._actionWidgetService = _actionWidgetService; + this._instantiationService = _instantiationService; + this._progressService = _progressService; + this._activeCodeActions = this._register(new MutableDisposable()); + this._showDisabled = false; + this._disposed = false; + this._editor = editor2; + this._model = this._register(new CodeActionModel(this._editor, languageFeaturesService.codeActionProvider, markerService, contextKeyService, progressService, _configurationService)); + this._register(this._model.onDidChangeState((newState) => this.update(newState))); + this._lightBulbWidget = new Lazy(() => { + const widget = this._editor.getContribution(LightBulbWidget.ID); + if (widget) { + this._register(widget.onClick((e) => this.showCodeActionsFromLightbulb(e.actions, e))); + } + return widget; + }); + this._resolver = instantiationService.createInstance(CodeActionKeybindingResolver); + this._register(this._editor.onDidLayoutChange(() => this._actionWidgetService.hide())); + } + dispose() { + this._disposed = true; + super.dispose(); + } + async showCodeActionsFromLightbulb(actions, at) { + if (actions.allAIFixes && actions.validActions.length === 1) { + const actionItem = actions.validActions[0]; + const command = actionItem.action.command; + if (command && command.id === "inlineChat.start") { + if (command.arguments && command.arguments.length >= 1 && command.arguments[0]) { + command.arguments[0] = { ...command.arguments[0], autoSend: false }; + } + } + await this.applyCodeAction(actionItem, false, false, ApplyCodeActionReason.FromAILightbulb); + return; + } + await this.showCodeActionList(actions, at, { includeDisabledActions: false, fromLightbulb: true }); + } + showCodeActions(_trigger, actions, at) { + return this.showCodeActionList(actions, at, { includeDisabledActions: false, fromLightbulb: false }); + } + manualTriggerAtCurrentPosition(notAvailableMessage, triggerAction, filter, autoApply) { + if (!this._editor.hasModel()) { + return; + } + MessageController.get(this._editor)?.closeMessage(); + const triggerPosition = this._editor.getPosition(); + this._trigger({ type: 1, triggerAction, filter, autoApply, context: { notAvailableMessage, position: triggerPosition } }); + } + _trigger(trigger) { + return this._model.trigger(trigger); + } + async applyCodeAction(action, retrigger, preview, actionReason) { + const progress = this._progressService.show(true, 500); + try { + await this._instantiationService.invokeFunction(applyCodeAction, action, actionReason, { preview, editor: this._editor }); + } finally { + if (retrigger) { + this._trigger({ type: 2, triggerAction: CodeActionTriggerSource.QuickFix, filter: {} }); + } + progress.done(); + } + } + hideLightBulbWidget() { + this._lightBulbWidget.rawValue?.hide(); + this._lightBulbWidget.rawValue?.gutterHide(); + } + async update(newState) { + if (newState.type !== 1) { + this.hideLightBulbWidget(); + return; + } + let actions; + try { + actions = await newState.actions; + } catch (e) { + onUnexpectedError(e); + return; + } + if (this._disposed) { + return; + } + const selection = this._editor.getSelection(); + if (selection?.startLineNumber !== newState.position.lineNumber) { + return; + } + this._lightBulbWidget.value?.update(actions, newState.trigger, newState.position); + if (newState.trigger.type === 1) { + if (newState.trigger.filter?.include) { + const validActionToApply = this.tryGetValidActionToApply(newState.trigger, actions); + if (validActionToApply) { + try { + this.hideLightBulbWidget(); + await this.applyCodeAction(validActionToApply, false, false, ApplyCodeActionReason.FromCodeActions); + } finally { + actions.dispose(); + } + return; + } + if (newState.trigger.context) { + const invalidAction = this.getInvalidActionThatWouldHaveBeenApplied(newState.trigger, actions); + if (invalidAction && invalidAction.action.disabled) { + MessageController.get(this._editor)?.showMessage(invalidAction.action.disabled, newState.trigger.context.position); + actions.dispose(); + return; + } + } + } + const includeDisabledActions = !!newState.trigger.filter?.include; + if (newState.trigger.context) { + if (!actions.allActions.length || !includeDisabledActions && !actions.validActions.length) { + MessageController.get(this._editor)?.showMessage(newState.trigger.context.notAvailableMessage, newState.trigger.context.position); + this._activeCodeActions.value = actions; + actions.dispose(); + return; + } + } + this._activeCodeActions.value = actions; + this.showCodeActionList(actions, this.toCoords(newState.position), { includeDisabledActions, fromLightbulb: false }); + } else { + if (this._actionWidgetService.isVisible) { + actions.dispose(); + } else { + this._activeCodeActions.value = actions; + } + } + } + getInvalidActionThatWouldHaveBeenApplied(trigger, actions) { + if (!actions.allActions.length) { + return void 0; + } + if (trigger.autoApply === "first" && actions.validActions.length === 0 || trigger.autoApply === "ifSingle" && actions.allActions.length === 1) { + return actions.allActions.find(({ action }) => action.disabled); + } + return void 0; + } + tryGetValidActionToApply(trigger, actions) { + if (!actions.validActions.length) { + return void 0; + } + if (trigger.autoApply === "first" && actions.validActions.length > 0 || trigger.autoApply === "ifSingle" && actions.validActions.length === 1) { + return actions.validActions[0]; + } + return void 0; + } + static { + this.DECORATION = ModelDecorationOptions.register({ + description: "quickfix-highlight", + className: DECORATION_CLASS_NAME + }); + } + async showCodeActionList(actions, at, options2) { + const currentDecorations = this._editor.createDecorationsCollection(); + const editorDom = this._editor.getDomNode(); + if (!editorDom) { + return; + } + const actionsToShow = options2.includeDisabledActions && (this._showDisabled || actions.validActions.length === 0) ? actions.allActions : actions.validActions; + if (!actionsToShow.length) { + return; + } + const anchor = Position.isIPosition(at) ? this.toCoords(at) : at; + const delegate = { + onSelect: async (action, preview) => { + this.applyCodeAction( + action, + /* retrigger */ + true, + !!preview, + options2.fromLightbulb ? ApplyCodeActionReason.FromAILightbulb : ApplyCodeActionReason.FromCodeActions + ); + this._actionWidgetService.hide(false); + currentDecorations.clear(); + }, + onHide: (didCancel) => { + this._editor?.focus(); + currentDecorations.clear(); + }, + onHover: async (action, token) => { + if (token.isCancellationRequested) { + return; + } + let canPreview = false; + const actionKind = action.action.kind; + if (actionKind) { + const hierarchicalKind = new HierarchicalKind(actionKind); + const refactorKinds = [ + CodeActionKind.RefactorExtract, + CodeActionKind.RefactorInline, + CodeActionKind.RefactorRewrite, + CodeActionKind.RefactorMove, + CodeActionKind.Source + ]; + canPreview = refactorKinds.some((refactorKind) => refactorKind.contains(hierarchicalKind)); + } + return { canPreview: canPreview || !!action.action.edit?.edits.length }; + }, + onFocus: (action) => { + if (action && action.action) { + const ranges = action.action.ranges; + const diagnostics = action.action.diagnostics; + currentDecorations.clear(); + if (ranges && ranges.length > 0) { + const decorations = diagnostics && diagnostics?.length > 1 ? diagnostics.map((diagnostic) => ({ range: diagnostic, options: CodeActionController_1.DECORATION })) : ranges.map((range2) => ({ range: range2, options: CodeActionController_1.DECORATION })); + currentDecorations.set(decorations); + } else if (diagnostics && diagnostics.length > 0) { + const decorations = diagnostics.map((diagnostic2) => ({ range: diagnostic2, options: CodeActionController_1.DECORATION })); + currentDecorations.set(decorations); + const diagnostic = diagnostics[0]; + if (diagnostic.startLineNumber && diagnostic.startColumn) { + const selectionText = this._editor.getModel()?.getWordAtPosition({ lineNumber: diagnostic.startLineNumber, column: diagnostic.startColumn })?.word; + status(localize(863, "Context: {0} at line {1} and column {2}.", selectionText, diagnostic.startLineNumber, diagnostic.startColumn)); + } + } + } else { + currentDecorations.clear(); + } + } + }; + this._actionWidgetService.show("codeActionWidget", true, toMenuItems(actionsToShow, this._shouldShowHeaders(), this._resolver.getResolver()), delegate, anchor, editorDom, this._getActionBarActions(actions, at, options2)); + } + toCoords(position) { + if (!this._editor.hasModel()) { + return { x: 0, y: 0 }; + } + this._editor.revealPosition( + position, + 1 + /* ScrollType.Immediate */ + ); + this._editor.render(); + const cursorCoords = this._editor.getScrolledVisiblePosition(position); + const editorCoords = getDomNodePagePosition(this._editor.getDomNode()); + const x = editorCoords.left + cursorCoords.left; + const y = editorCoords.top + cursorCoords.top + cursorCoords.height; + return { x, y }; + } + _shouldShowHeaders() { + const model = this._editor?.getModel(); + return this._configurationService.getValue("editor.codeActionWidget.showHeaders", { resource: model?.uri }); + } + _getActionBarActions(actions, at, options2) { + if (options2.fromLightbulb) { + return []; + } + const resultActions = actions.documentation.map((command) => ({ + id: command.id, + label: command.title, + tooltip: command.tooltip ?? "", + class: void 0, + enabled: true, + run: () => this._commandService.executeCommand(command.id, ...command.arguments ?? []) + })); + if (options2.includeDisabledActions && actions.validActions.length > 0 && actions.allActions.length !== actions.validActions.length) { + resultActions.push(this._showDisabled ? { + id: "hideMoreActions", + label: localize(864, "Hide Disabled"), + enabled: true, + tooltip: "", + class: void 0, + run: () => { + this._showDisabled = false; + return this.showCodeActionList(actions, at, options2); + } + } : { + id: "showMoreActions", + label: localize(865, "Show Disabled"), + enabled: true, + tooltip: "", + class: void 0, + run: () => { + this._showDisabled = true; + return this.showCodeActionList(actions, at, options2); + } + }); + } + return resultActions; + } +}; +CodeActionController = CodeActionController_1 = __decorate55([ + __param50(1, IMarkerService), + __param50(2, IContextKeyService), + __param50(3, IInstantiationService), + __param50(4, ILanguageFeaturesService), + __param50(5, IEditorProgressService), + __param50(6, ICommandService), + __param50(7, IConfigurationService), + __param50(8, IActionWidgetService), + __param50(9, IInstantiationService), + __param50(10, IEditorProgressService) +], CodeActionController); +registerThemingParticipant((theme, collector) => { + const addBackgroundColorRule = (selector, color) => { + if (color) { + collector.addRule(`.monaco-editor ${selector} { background-color: ${color}; }`); + } + }; + addBackgroundColorRule(".quickfix-edit-highlight", theme.getColor(editorFindMatchHighlight)); + const findMatchHighlightBorder = theme.getColor(editorFindMatchHighlightBorder); + if (findMatchHighlightBorder) { + collector.addRule(`.monaco-editor .quickfix-edit-highlight { border: 1px ${isHighContrast(theme.type) ? "dotted" : "solid"} ${findMatchHighlightBorder}; box-sizing: border-box; }`); + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/codeAction/browser/codeActionCommands.js +function contextKeyForSupportedActions(kind) { + return ContextKeyExpr.regex(SUPPORTED_CODE_ACTIONS.keys()[0], new RegExp("(\\s|^)" + escapeRegExpCharacters(kind.value) + "\\b")); +} +var argsSchema = { + type: "object", + defaultSnippets: [{ body: { kind: "" } }], + properties: { + "kind": { + type: "string", + description: localize(831, "Kind of the code action to run.") + }, + "apply": { + type: "string", + description: localize(832, "Controls when the returned actions are applied."), + default: "ifSingle", + enum: [ + "first", + "ifSingle", + "never" + /* CodeActionAutoApply.Never */ + ], + enumDescriptions: [ + localize(833, "Always apply the first returned code action."), + localize(834, "Apply the first returned code action if it is the only one."), + localize(835, "Do not apply the returned code actions.") + ] + }, + "preferred": { + type: "boolean", + default: false, + description: localize(836, "Controls if only preferred code actions should be returned.") + } + } +}; +function triggerCodeActionsForEditorSelection(editor2, notAvailableMessage, filter, autoApply, triggerAction = CodeActionTriggerSource.Default) { + if (editor2.hasModel()) { + const controller = CodeActionController.get(editor2); + controller?.manualTriggerAtCurrentPosition(notAvailableMessage, triggerAction, filter, autoApply); + } +} +var QuickFixAction = class extends EditorAction { + constructor() { + super({ + id: quickFixCommandId, + label: localize2(853, "Quick Fix..."), + precondition: ContextKeyExpr.and(EditorContextKeys.writable, EditorContextKeys.hasCodeActionsProvider), + kbOpts: { + kbExpr: EditorContextKeys.textInputFocus, + primary: 2048 | 89, + weight: 100 + /* KeybindingWeight.EditorContrib */ + } + }); + } + run(_accessor, editor2) { + return triggerCodeActionsForEditorSelection(editor2, localize(837, "No code actions available"), void 0, void 0, CodeActionTriggerSource.QuickFix); + } +}; +var CodeActionCommand = class extends EditorCommand { + constructor() { + super({ + id: codeActionCommandId, + precondition: ContextKeyExpr.and(EditorContextKeys.writable, EditorContextKeys.hasCodeActionsProvider), + metadata: { + description: "Trigger a code action", + args: [{ name: "args", schema: argsSchema }] + } + }); + } + runEditorCommand(_accessor, editor2, userArgs) { + const args = CodeActionCommandArgs.fromUser(userArgs, { + kind: HierarchicalKind.Empty, + apply: "ifSingle" + }); + return triggerCodeActionsForEditorSelection(editor2, typeof userArgs?.kind === "string" ? args.preferred ? localize(838, "No preferred code actions for '{0}' available", userArgs.kind) : localize(839, "No code actions for '{0}' available", userArgs.kind) : args.preferred ? localize(840, "No preferred code actions available") : localize(841, "No code actions available"), { + include: args.kind, + includeSourceActions: true, + onlyIncludePreferredActions: args.preferred + }, args.apply); + } +}; +var RefactorAction = class extends EditorAction { + constructor() { + super({ + id: refactorCommandId, + label: localize2(854, "Refactor..."), + precondition: ContextKeyExpr.and(EditorContextKeys.writable, EditorContextKeys.hasCodeActionsProvider), + kbOpts: { + kbExpr: EditorContextKeys.textInputFocus, + primary: 2048 | 1024 | 48, + mac: { + primary: 256 | 1024 | 48 + /* KeyCode.KeyR */ + }, + weight: 100 + /* KeybindingWeight.EditorContrib */ + }, + contextMenuOpts: { + group: "1_modification", + order: 2, + when: ContextKeyExpr.and(EditorContextKeys.writable, contextKeyForSupportedActions(CodeActionKind.Refactor)) + }, + metadata: { + description: "Refactor...", + args: [{ name: "args", schema: argsSchema }] + } + }); + } + run(_accessor, editor2, userArgs) { + const args = CodeActionCommandArgs.fromUser(userArgs, { + kind: CodeActionKind.Refactor, + apply: "never" + /* CodeActionAutoApply.Never */ + }); + return triggerCodeActionsForEditorSelection(editor2, typeof userArgs?.kind === "string" ? args.preferred ? localize(842, "No preferred refactorings for '{0}' available", userArgs.kind) : localize(843, "No refactorings for '{0}' available", userArgs.kind) : args.preferred ? localize(844, "No preferred refactorings available") : localize(845, "No refactorings available"), { + include: CodeActionKind.Refactor.contains(args.kind) ? args.kind : HierarchicalKind.None, + onlyIncludePreferredActions: args.preferred + }, args.apply, CodeActionTriggerSource.Refactor); + } +}; +var SourceAction = class extends EditorAction { + constructor() { + super({ + id: sourceActionCommandId, + label: localize2(855, "Source Action..."), + precondition: ContextKeyExpr.and(EditorContextKeys.writable, EditorContextKeys.hasCodeActionsProvider), + contextMenuOpts: { + group: "1_modification", + order: 2.1, + when: ContextKeyExpr.and(EditorContextKeys.writable, contextKeyForSupportedActions(CodeActionKind.Source)) + }, + metadata: { + description: "Source Action...", + args: [{ name: "args", schema: argsSchema }] + } + }); + } + run(_accessor, editor2, userArgs) { + const args = CodeActionCommandArgs.fromUser(userArgs, { + kind: CodeActionKind.Source, + apply: "never" + /* CodeActionAutoApply.Never */ + }); + return triggerCodeActionsForEditorSelection(editor2, typeof userArgs?.kind === "string" ? args.preferred ? localize(846, "No preferred source actions for '{0}' available", userArgs.kind) : localize(847, "No source actions for '{0}' available", userArgs.kind) : args.preferred ? localize(848, "No preferred source actions available") : localize(849, "No source actions available"), { + include: CodeActionKind.Source.contains(args.kind) ? args.kind : HierarchicalKind.None, + includeSourceActions: true, + onlyIncludePreferredActions: args.preferred + }, args.apply, CodeActionTriggerSource.SourceAction); + } +}; +var OrganizeImportsAction = class extends EditorAction { + constructor() { + super({ + id: organizeImportsCommandId, + label: localize2(856, "Organize Imports"), + precondition: ContextKeyExpr.and(EditorContextKeys.writable, contextKeyForSupportedActions(CodeActionKind.SourceOrganizeImports)), + kbOpts: { + kbExpr: EditorContextKeys.textInputFocus, + primary: 1024 | 512 | 45, + weight: 100 + /* KeybindingWeight.EditorContrib */ + }, + metadata: { + description: localize2(857, "Organize imports in the current file. Also called 'Optimize Imports' by some tools") + } + }); + } + run(_accessor, editor2) { + return triggerCodeActionsForEditorSelection(editor2, localize(850, "No organize imports action available"), { include: CodeActionKind.SourceOrganizeImports, includeSourceActions: true }, "ifSingle", CodeActionTriggerSource.OrganizeImports); + } +}; +var FixAllAction = class extends EditorAction { + constructor() { + super({ + id: fixAllCommandId, + label: localize2(858, "Fix All"), + precondition: ContextKeyExpr.and(EditorContextKeys.writable, contextKeyForSupportedActions(CodeActionKind.SourceFixAll)) + }); + } + run(_accessor, editor2) { + return triggerCodeActionsForEditorSelection(editor2, localize(851, "No fix all action available"), { include: CodeActionKind.SourceFixAll, includeSourceActions: true }, "ifSingle", CodeActionTriggerSource.FixAll); + } +}; +var AutoFixAction = class extends EditorAction { + constructor() { + super({ + id: autoFixCommandId, + label: localize2(859, "Auto Fix..."), + precondition: ContextKeyExpr.and(EditorContextKeys.writable, contextKeyForSupportedActions(CodeActionKind.QuickFix)), + kbOpts: { + kbExpr: EditorContextKeys.textInputFocus, + primary: 512 | 1024 | 89, + mac: { + primary: 2048 | 512 | 89 + /* KeyCode.Period */ + }, + weight: 100 + /* KeybindingWeight.EditorContrib */ + } + }); + } + run(_accessor, editor2) { + return triggerCodeActionsForEditorSelection(editor2, localize(852, "No auto fixes available"), { + include: CodeActionKind.QuickFix, + onlyIncludePreferredActions: true + }, "ifSingle", CodeActionTriggerSource.AutoFix); + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/codeAction/browser/codeActionContributions.js +init_nls(); +init_configurationRegistry(); +init_platform2(); +registerEditorContribution( + CodeActionController.ID, + CodeActionController, + 3 + /* EditorContributionInstantiation.Eventually */ +); +registerEditorContribution( + LightBulbWidget.ID, + LightBulbWidget, + 4 + /* EditorContributionInstantiation.Lazy */ +); +registerEditorAction(QuickFixAction); +registerEditorAction(RefactorAction); +registerEditorAction(SourceAction); +registerEditorAction(OrganizeImportsAction); +registerEditorAction(AutoFixAction); +registerEditorAction(FixAllAction); +registerEditorCommand(new CodeActionCommand()); +Registry.as(Extensions4.Configuration).registerConfiguration({ + ...editorConfigurationBaseNode, + properties: { + "editor.codeActionWidget.showHeaders": { + type: "boolean", + scope: 6, + description: localize(860, "Enable/disable showing group headers in the Code Action menu."), + default: true + } + } +}); +Registry.as(Extensions4.Configuration).registerConfiguration({ + ...editorConfigurationBaseNode, + properties: { + "editor.codeActionWidget.includeNearbyQuickFixes": { + type: "boolean", + scope: 6, + description: localize(861, "Enable/disable showing nearest Quick Fix within a line when not currently on a diagnostic."), + default: true + } + } +}); +Registry.as(Extensions4.Configuration).registerConfiguration({ + ...editorConfigurationBaseNode, + properties: { + "editor.codeActions.triggerOnFocusChange": { + type: "boolean", + scope: 6, + markdownDescription: localize(862, "Enable triggering {0} when {1} is set to {2}. Code Actions must be set to {3} to be triggered for window and focus changes.", "`#editor.codeActionsOnSave#`", "`#files.autoSave#`", "`afterDelay`", "`always`"), + default: false + } + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/codelens/browser/codelensController.js +init_async(); +init_errors(); +init_lifecycle(); +init_editorExtensions(); +init_editorContextKeys(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/codelens/browser/codelens.js +init_cancellation(); +init_errors(); +init_lifecycle(); +init_types(); +init_uri(); +init_model(); +init_commands(); +init_languageFeatures(); +var CodeLensModel = class _CodeLensModel { + constructor() { + this.lenses = []; + } + static { + this.Empty = new _CodeLensModel(); + } + dispose() { + this._store?.dispose(); + } + get isDisposed() { + return this._store?.isDisposed ?? false; + } + add(list2, provider) { + if (isDisposable(list2)) { + this._store ??= new DisposableStore(); + this._store.add(list2); + } + for (const symbol of list2.lenses) { + this.lenses.push({ symbol, provider }); + } + } +}; +async function getCodeLensModel(registry, model, token) { + const provider = registry.ordered(model); + const providerRanks = /* @__PURE__ */ new Map(); + const result = new CodeLensModel(); + const promises = provider.map(async (provider2, i2) => { + providerRanks.set(provider2, i2); + try { + const list2 = await Promise.resolve(provider2.provideCodeLenses(model, token)); + if (list2) { + result.add(list2, provider2); + } + } catch (err) { + onUnexpectedExternalError(err); + } + }); + await Promise.all(promises); + if (token.isCancellationRequested) { + result.dispose(); + return CodeLensModel.Empty; + } + result.lenses = result.lenses.sort((a, b) => { + if (a.symbol.range.startLineNumber < b.symbol.range.startLineNumber) { + return -1; + } else if (a.symbol.range.startLineNumber > b.symbol.range.startLineNumber) { + return 1; + } else if (providerRanks.get(a.provider) < providerRanks.get(b.provider)) { + return -1; + } else if (providerRanks.get(a.provider) > providerRanks.get(b.provider)) { + return 1; + } else if (a.symbol.range.startColumn < b.symbol.range.startColumn) { + return -1; + } else if (a.symbol.range.startColumn > b.symbol.range.startColumn) { + return 1; + } else { + return 0; + } + }); + return result; +} +CommandsRegistry.registerCommand("_executeCodeLensProvider", function(accessor, ...args) { + let [uri, itemResolveCount] = args; + assertType(URI.isUri(uri)); + assertType(typeof itemResolveCount === "number" || !itemResolveCount); + const { codeLensProvider } = accessor.get(ILanguageFeaturesService); + const model = accessor.get(IModelService).getModel(uri); + if (!model) { + throw illegalArgument(); + } + const result = []; + const disposables = new DisposableStore(); + return getCodeLensModel(codeLensProvider, model, CancellationToken.None).then((value) => { + disposables.add(value); + const resolve3 = []; + for (const item of value.lenses) { + if (itemResolveCount === void 0 || itemResolveCount === null || Boolean(item.symbol.command)) { + result.push(item.symbol); + } else if (itemResolveCount-- > 0 && item.provider.resolveCodeLens) { + resolve3.push(Promise.resolve(item.provider.resolveCodeLens(model, item.symbol, CancellationToken.None)).then((symbol) => result.push(symbol || item.symbol))); + } + } + return Promise.all(resolve3); + }).then(() => { + return result; + }).finally(() => { + setTimeout(() => disposables.dispose(), 100); + }); +}); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/codelens/browser/codeLensCache.js +init_event(); +init_map(); +init_range(); +init_extensions(); +init_instantiation(); +init_window(); +init_dom(); +var __decorate56 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param51 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var ICodeLensCache = createDecorator("ICodeLensCache"); +var CacheItem = class { + constructor(lineCount, data) { + this.lineCount = lineCount; + this.data = data; + } +}; +var CodeLensCache = class CodeLensCache2 { + constructor(storageService) { + this._fakeProvider = new class { + provideCodeLenses() { + throw new Error("not supported"); + } + }(); + this._cache = new LRUCache(20, 0.75); + const oldkey = "codelens/cache"; + runWhenWindowIdle(mainWindow, () => storageService.remove( + oldkey, + 1 + /* StorageScope.WORKSPACE */ + )); + const key = "codelens/cache2"; + const raw = storageService.get(key, 1, "{}"); + this._deserialize(raw); + const onWillSaveStateBecauseOfShutdown = Event.filter(storageService.onWillSaveState, (e) => e.reason === WillSaveStateReason.SHUTDOWN); + Event.once(onWillSaveStateBecauseOfShutdown)((e) => { + storageService.store( + key, + this._serialize(), + 1, + 1 + /* StorageTarget.MACHINE */ + ); + }); + } + put(model, data) { + const copyItems = data.lenses.map((item2) => { + return { + range: item2.symbol.range, + command: item2.symbol.command && { id: "", title: item2.symbol.command?.title } + }; + }); + const copyModel = new CodeLensModel(); + copyModel.add({ lenses: copyItems }, this._fakeProvider); + const item = new CacheItem(model.getLineCount(), copyModel); + this._cache.set(model.uri.toString(), item); + } + get(model) { + const item = this._cache.get(model.uri.toString()); + return item && item.lineCount === model.getLineCount() ? item.data : void 0; + } + delete(model) { + this._cache.delete(model.uri.toString()); + } + // --- persistence + _serialize() { + const data = /* @__PURE__ */ Object.create(null); + for (const [key, value] of this._cache) { + const lines = /* @__PURE__ */ new Set(); + for (const d of value.data.lenses) { + lines.add(d.symbol.range.startLineNumber); + } + data[key] = { + lineCount: value.lineCount, + lines: [...lines.values()] + }; + } + return JSON.stringify(data); + } + _deserialize(raw) { + try { + const data = JSON.parse(raw); + for (const key in data) { + const element = data[key]; + const lenses = []; + for (const line of element.lines) { + lenses.push({ range: new Range(line, 1, line, 11) }); + } + const model = new CodeLensModel(); + model.add({ lenses }, this._fakeProvider); + this._cache.set(key, new CacheItem(element.lineCount, model)); + } + } catch { + } + } +}; +CodeLensCache = __decorate56([ + __param51(0, IStorageService) +], CodeLensCache); +registerSingleton( + ICodeLensCache, + CodeLensCache, + 1 + /* InstantiationType.Delayed */ +); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/codelens/browser/codelensWidget.js +init_dom(); +init_iconLabels2(); +init_range(); +init_textModel(); +var CodeLensViewZone = class { + constructor(afterLineNumber, heightInPx, onHeight) { + this.afterColumn = 1073741824; + this.afterLineNumber = afterLineNumber; + this.heightInPx = heightInPx; + this._onHeight = onHeight; + this.suppressMouseDown = true; + this.domNode = document.createElement("div"); + } + onComputedHeight(height) { + if (this._lastHeight === void 0) { + this._lastHeight = height; + } else if (this._lastHeight !== height) { + this._lastHeight = height; + this._onHeight(); + } + } + isVisible() { + return this._lastHeight !== 0 && this.domNode.hasAttribute("monaco-visible-view-zone"); + } +}; +var CodeLensContentWidget = class _CodeLensContentWidget { + static { + this._idPool = 0; + } + constructor(editor2, line) { + this.allowEditorOverflow = false; + this.suppressMouseDown = true; + this._commands = /* @__PURE__ */ new Map(); + this._isEmpty = true; + this._editor = editor2; + this._id = `codelens.widget-${_CodeLensContentWidget._idPool++}`; + this.updatePosition(line); + this._domNode = document.createElement("span"); + this._domNode.className = `codelens-decoration`; + } + withCommands(lenses, animate2) { + this._commands.clear(); + const children = []; + let hasSymbol = false; + for (let i2 = 0; i2 < lenses.length; i2++) { + const lens = lenses[i2]; + if (!lens) { + continue; + } + hasSymbol = true; + if (lens.command) { + const title = renderLabelWithIcons(lens.command.title.trim()); + if (lens.command.id) { + const id = `c${_CodeLensContentWidget._idPool++}`; + children.push($("a", { id, title: lens.command.tooltip, role: "button" }, ...title)); + this._commands.set(id, lens.command); + } else { + children.push($("span", { title: lens.command.tooltip }, ...title)); + } + if (i2 + 1 < lenses.length) { + children.push($("span", void 0, "\xA0|\xA0")); + } + } + } + if (!hasSymbol) { + reset(this._domNode, $("span", void 0, "no commands")); + } else { + reset(this._domNode, ...children); + if (this._isEmpty && animate2) { + this._domNode.classList.add("fadein"); + } + this._isEmpty = false; + } + } + getCommand(link2) { + return link2.parentElement === this._domNode ? this._commands.get(link2.id) : void 0; + } + getId() { + return this._id; + } + getDomNode() { + return this._domNode; + } + updatePosition(line) { + const column = this._editor.getModel().getLineFirstNonWhitespaceColumn(line); + this._widgetPosition = { + position: { lineNumber: line, column }, + preference: [ + 1 + /* ContentWidgetPositionPreference.ABOVE */ + ] + }; + } + getPosition() { + return this._widgetPosition || null; + } +}; +var CodeLensHelper = class { + constructor() { + this._removeDecorations = []; + this._addDecorations = []; + this._addDecorationsCallbacks = []; + } + addDecoration(decoration3, callback) { + this._addDecorations.push(decoration3); + this._addDecorationsCallbacks.push(callback); + } + removeDecoration(decorationId) { + this._removeDecorations.push(decorationId); + } + commit(changeAccessor) { + const resultingDecorations = changeAccessor.deltaDecorations(this._removeDecorations, this._addDecorations); + for (let i2 = 0, len = resultingDecorations.length; i2 < len; i2++) { + this._addDecorationsCallbacks[i2](resultingDecorations[i2]); + } + } +}; +var codeLensDecorationOptions = ModelDecorationOptions.register({ + collapseOnReplaceEdit: true, + description: "codelens" +}); +var CodeLensWidget = class { + constructor(data, editor2, helper, viewZoneChangeAccessor, heightInPx, updateCallback) { + this._isDisposed = false; + this._editor = editor2; + this._data = data; + this._decorationIds = []; + let range2; + const lenses = []; + this._data.forEach((codeLensData, i2) => { + if (codeLensData.symbol.command) { + lenses.push(codeLensData.symbol); + } + helper.addDecoration({ + range: codeLensData.symbol.range, + options: codeLensDecorationOptions + }, (id) => this._decorationIds[i2] = id); + if (!range2) { + range2 = Range.lift(codeLensData.symbol.range); + } else { + range2 = Range.plusRange(range2, codeLensData.symbol.range); + } + }); + this._viewZone = new CodeLensViewZone(range2.startLineNumber - 1, heightInPx, updateCallback); + this._viewZoneId = viewZoneChangeAccessor.addZone(this._viewZone); + if (lenses.length > 0) { + this._createContentWidgetIfNecessary(); + this._contentWidget.withCommands(lenses, false); + } + } + _createContentWidgetIfNecessary() { + if (!this._contentWidget) { + this._contentWidget = new CodeLensContentWidget(this._editor, this._viewZone.afterLineNumber + 1); + this._editor.addContentWidget(this._contentWidget); + } else { + this._editor.layoutContentWidget(this._contentWidget); + } + } + dispose(helper, viewZoneChangeAccessor) { + this._decorationIds.forEach(helper.removeDecoration, helper); + this._decorationIds = []; + viewZoneChangeAccessor?.removeZone(this._viewZoneId); + if (this._contentWidget) { + this._editor.removeContentWidget(this._contentWidget); + this._contentWidget = void 0; + } + this._isDisposed = true; + } + isDisposed() { + return this._isDisposed; + } + isValid() { + return this._decorationIds.some((id, i2) => { + const range2 = this._editor.getModel().getDecorationRange(id); + const symbol = this._data[i2].symbol; + return !!(range2 && Range.isEmpty(symbol.range) === range2.isEmpty()); + }); + } + updateCodeLensSymbols(data, helper) { + this._decorationIds.forEach(helper.removeDecoration, helper); + this._decorationIds = []; + this._data = data; + this._data.forEach((codeLensData, i2) => { + helper.addDecoration({ + range: codeLensData.symbol.range, + options: codeLensDecorationOptions + }, (id) => this._decorationIds[i2] = id); + }); + } + updateHeight(height, viewZoneChangeAccessor) { + this._viewZone.heightInPx = height; + viewZoneChangeAccessor.layoutZone(this._viewZoneId); + if (this._contentWidget) { + this._editor.layoutContentWidget(this._contentWidget); + } + } + computeIfNecessary(model) { + if (!this._viewZone.isVisible()) { + return null; + } + for (let i2 = 0; i2 < this._decorationIds.length; i2++) { + const range2 = model.getDecorationRange(this._decorationIds[i2]); + if (range2) { + this._data[i2].symbol.range = range2; + } + } + return this._data; + } + updateCommands(symbols) { + this._createContentWidgetIfNecessary(); + this._contentWidget.withCommands(symbols, true); + for (let i2 = 0; i2 < this._data.length; i2++) { + const resolved = symbols[i2]; + if (resolved) { + const { symbol } = this._data[i2]; + symbol.command = resolved.command || symbol.command; + } + } + } + getCommand(link2) { + return this._contentWidget?.getCommand(link2); + } + getLineNumber() { + const range2 = this._editor.getModel().getDecorationRange(this._decorationIds[0]); + if (range2) { + return range2.startLineNumber; + } + return -1; + } + update(viewZoneChangeAccessor) { + if (this.isValid()) { + const range2 = this._editor.getModel().getDecorationRange(this._decorationIds[0]); + if (range2) { + this._viewZone.afterLineNumber = range2.startLineNumber - 1; + viewZoneChangeAccessor.layoutZone(this._viewZoneId); + if (this._contentWidget) { + this._contentWidget.updatePosition(range2.startLineNumber); + this._editor.layoutContentWidget(this._contentWidget); + } + } + } + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/codelens/browser/codelensController.js +init_nls(); +init_commands(); +init_languageFeatureDebounce(); +init_languageFeatures(); +var __decorate58 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param53 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var CodeLensContribution = class CodeLensContribution2 { + static { + this.ID = "css.editor.codeLens"; + } + constructor(_editor, _languageFeaturesService, debounceService, _commandService, _notificationService, _codeLensCache) { + this._editor = _editor; + this._languageFeaturesService = _languageFeaturesService; + this._commandService = _commandService; + this._notificationService = _notificationService; + this._codeLensCache = _codeLensCache; + this._disposables = new DisposableStore(); + this._localToDispose = new DisposableStore(); + this._lenses = []; + this._oldCodeLensModels = new DisposableStore(); + this._provideCodeLensDebounce = debounceService.for(_languageFeaturesService.codeLensProvider, "CodeLensProvide", { min: 250 }); + this._resolveCodeLensesDebounce = debounceService.for(_languageFeaturesService.codeLensProvider, "CodeLensResolve", { min: 250, salt: "resolve" }); + this._resolveCodeLensesScheduler = new RunOnceScheduler(() => this._resolveCodeLensesInViewport(), this._resolveCodeLensesDebounce.default()); + this._disposables.add(this._editor.onDidChangeModel(() => this._onModelChange())); + this._disposables.add(this._editor.onDidChangeModelLanguage(() => this._onModelChange())); + this._disposables.add(this._editor.onDidChangeConfiguration((e) => { + if (e.hasChanged( + 59 + /* EditorOption.fontInfo */ + ) || e.hasChanged( + 25 + /* EditorOption.codeLensFontSize */ + ) || e.hasChanged( + 24 + /* EditorOption.codeLensFontFamily */ + )) { + this._updateLensStyle(); + } + if (e.hasChanged( + 23 + /* EditorOption.codeLens */ + )) { + this._onModelChange(); + } + })); + this._disposables.add(_languageFeaturesService.codeLensProvider.onDidChange(this._onModelChange, this)); + this._onModelChange(); + this._updateLensStyle(); + } + dispose() { + this._localDispose(); + this._localToDispose.dispose(); + this._disposables.dispose(); + this._oldCodeLensModels.dispose(); + this._currentCodeLensModel?.dispose(); + } + _getLayoutInfo() { + const lineHeightFactor = Math.max(1.3, this._editor.getOption( + 75 + /* EditorOption.lineHeight */ + ) / this._editor.getOption( + 61 + /* EditorOption.fontSize */ + )); + let fontSize = this._editor.getOption( + 25 + /* EditorOption.codeLensFontSize */ + ); + if (!fontSize || fontSize < 5) { + fontSize = this._editor.getOption( + 61 + /* EditorOption.fontSize */ + ) * 0.9 | 0; + } + return { + fontSize, + codeLensHeight: fontSize * lineHeightFactor | 0 + }; + } + _updateLensStyle() { + const { codeLensHeight, fontSize } = this._getLayoutInfo(); + const fontFamily = this._editor.getOption( + 24 + /* EditorOption.codeLensFontFamily */ + ); + const editorFontInfo = this._editor.getOption( + 59 + /* EditorOption.fontInfo */ + ); + const { style } = this._editor.getContainerDomNode(); + style.setProperty("--vscode-editorCodeLens-lineHeight", `${codeLensHeight}px`); + style.setProperty("--vscode-editorCodeLens-fontSize", `${fontSize}px`); + style.setProperty("--vscode-editorCodeLens-fontFeatureSettings", editorFontInfo.fontFeatureSettings); + if (fontFamily) { + style.setProperty("--vscode-editorCodeLens-fontFamily", fontFamily); + style.setProperty("--vscode-editorCodeLens-fontFamilyDefault", EDITOR_FONT_DEFAULTS.fontFamily); + } + this._editor.changeViewZones((accessor) => { + for (const lens of this._lenses) { + lens.updateHeight(codeLensHeight, accessor); + } + }); + } + _localDispose() { + this._getCodeLensModelPromise?.cancel(); + this._getCodeLensModelPromise = void 0; + this._resolveCodeLensesPromise?.cancel(); + this._resolveCodeLensesPromise = void 0; + this._localToDispose.clear(); + this._oldCodeLensModels.clear(); + this._currentCodeLensModel?.dispose(); + } + _onModelChange() { + this._localDispose(); + const model = this._editor.getModel(); + if (!model) { + return; + } + if (!this._editor.getOption( + 23 + /* EditorOption.codeLens */ + ) || model.isTooLargeForTokenization()) { + return; + } + const cachedLenses = this._codeLensCache.get(model); + if (cachedLenses) { + this._renderCodeLensSymbols(cachedLenses); + } + if (!this._languageFeaturesService.codeLensProvider.has(model)) { + if (cachedLenses) { + disposableTimeout(() => { + const cachedLensesNow = this._codeLensCache.get(model); + if (cachedLenses === cachedLensesNow) { + this._codeLensCache.delete(model); + this._onModelChange(); + } + }, 30 * 1e3, this._localToDispose); + } + return; + } + for (const provider of this._languageFeaturesService.codeLensProvider.all(model)) { + if (typeof provider.onDidChange === "function") { + const registration = provider.onDidChange(() => scheduler.schedule()); + this._localToDispose.add(registration); + } + } + const scheduler = new RunOnceScheduler(() => { + const t1 = Date.now(); + this._getCodeLensModelPromise?.cancel(); + this._getCodeLensModelPromise = createCancelablePromise((token) => getCodeLensModel(this._languageFeaturesService.codeLensProvider, model, token)); + this._getCodeLensModelPromise.then((result) => { + if (this._currentCodeLensModel) { + this._oldCodeLensModels.add(this._currentCodeLensModel); + } + this._currentCodeLensModel = result; + this._codeLensCache.put(model, result); + const newDelay = this._provideCodeLensDebounce.update(model, Date.now() - t1); + scheduler.delay = newDelay; + this._renderCodeLensSymbols(result); + this._resolveCodeLensesInViewportSoon(); + }, onUnexpectedError); + }, this._provideCodeLensDebounce.get(model)); + this._localToDispose.add(scheduler); + this._localToDispose.add(toDisposable(() => this._resolveCodeLensesScheduler.cancel())); + this._localToDispose.add(this._editor.onDidChangeModelContent(() => { + this._editor.changeDecorations((decorationsAccessor) => { + this._editor.changeViewZones((viewZonesAccessor) => { + const toDispose = []; + let lastLensLineNumber = -1; + this._lenses.forEach((lens) => { + if (!lens.isValid() || lastLensLineNumber === lens.getLineNumber()) { + toDispose.push(lens); + } else { + lens.update(viewZonesAccessor); + lastLensLineNumber = lens.getLineNumber(); + } + }); + const helper = new CodeLensHelper(); + toDispose.forEach((l) => { + l.dispose(helper, viewZonesAccessor); + this._lenses.splice(this._lenses.indexOf(l), 1); + }); + helper.commit(decorationsAccessor); + }); + }); + scheduler.schedule(); + this._resolveCodeLensesScheduler.cancel(); + this._resolveCodeLensesPromise?.cancel(); + this._resolveCodeLensesPromise = void 0; + })); + this._localToDispose.add(this._editor.onDidFocusEditorText(() => { + scheduler.schedule(); + })); + this._localToDispose.add(this._editor.onDidBlurEditorText(() => { + scheduler.cancel(); + })); + this._localToDispose.add(this._editor.onDidScrollChange((e) => { + if (e.scrollTopChanged && this._lenses.length > 0) { + this._resolveCodeLensesInViewportSoon(); + } + })); + this._localToDispose.add(this._editor.onDidLayoutChange(() => { + this._resolveCodeLensesInViewportSoon(); + })); + this._localToDispose.add(toDisposable(() => { + if (this._editor.getModel()) { + const scrollState = StableEditorScrollState.capture(this._editor); + this._editor.changeDecorations((decorationsAccessor) => { + this._editor.changeViewZones((viewZonesAccessor) => { + this._disposeAllLenses(decorationsAccessor, viewZonesAccessor); + }); + }); + scrollState.restore(this._editor); + } else { + this._disposeAllLenses(void 0, void 0); + } + })); + this._localToDispose.add(this._editor.onMouseDown((e) => { + if (e.target.type !== 9) { + return; + } + let target = e.target.element; + if (target?.tagName === "SPAN") { + target = target.parentElement; + } + if (target?.tagName === "A") { + for (const lens of this._lenses) { + const command = lens.getCommand(target); + if (command) { + this._commandService.executeCommand(command.id, ...command.arguments || []).catch((err) => this._notificationService.error(err)); + break; + } + } + } + })); + scheduler.schedule(); + } + _disposeAllLenses(decChangeAccessor, viewZoneChangeAccessor) { + const helper = new CodeLensHelper(); + for (const lens of this._lenses) { + lens.dispose(helper, viewZoneChangeAccessor); + } + if (decChangeAccessor) { + helper.commit(decChangeAccessor); + } + this._lenses.length = 0; + } + _renderCodeLensSymbols(symbols) { + if (!this._editor.hasModel()) { + return; + } + const maxLineNumber = this._editor.getModel().getLineCount(); + const groups = []; + let lastGroup; + for (const symbol of symbols.lenses) { + const line = symbol.symbol.range.startLineNumber; + if (line < 1 || line > maxLineNumber) { + continue; + } else if (lastGroup && lastGroup[lastGroup.length - 1].symbol.range.startLineNumber === line) { + lastGroup.push(symbol); + } else { + lastGroup = [symbol]; + groups.push(lastGroup); + } + } + if (!groups.length && !this._lenses.length) { + return; + } + const scrollState = StableEditorScrollState.capture(this._editor); + const layoutInfo = this._getLayoutInfo(); + this._editor.changeDecorations((decorationsAccessor) => { + this._editor.changeViewZones((viewZoneAccessor) => { + const helper = new CodeLensHelper(); + let codeLensIndex = 0; + let groupsIndex = 0; + while (groupsIndex < groups.length && codeLensIndex < this._lenses.length) { + const symbolsLineNumber = groups[groupsIndex][0].symbol.range.startLineNumber; + const codeLensLineNumber = this._lenses[codeLensIndex].getLineNumber(); + if (codeLensLineNumber < symbolsLineNumber) { + this._lenses[codeLensIndex].dispose(helper, viewZoneAccessor); + this._lenses.splice(codeLensIndex, 1); + } else if (codeLensLineNumber === symbolsLineNumber) { + this._lenses[codeLensIndex].updateCodeLensSymbols(groups[groupsIndex], helper); + groupsIndex++; + codeLensIndex++; + } else { + this._lenses.splice(codeLensIndex, 0, new CodeLensWidget(groups[groupsIndex], this._editor, helper, viewZoneAccessor, layoutInfo.codeLensHeight, () => this._resolveCodeLensesInViewportSoon())); + codeLensIndex++; + groupsIndex++; + } + } + while (codeLensIndex < this._lenses.length) { + this._lenses[codeLensIndex].dispose(helper, viewZoneAccessor); + this._lenses.splice(codeLensIndex, 1); + } + while (groupsIndex < groups.length) { + this._lenses.push(new CodeLensWidget(groups[groupsIndex], this._editor, helper, viewZoneAccessor, layoutInfo.codeLensHeight, () => this._resolveCodeLensesInViewportSoon())); + groupsIndex++; + } + helper.commit(decorationsAccessor); + }); + }); + scrollState.restore(this._editor); + } + _resolveCodeLensesInViewportSoon() { + const model = this._editor.getModel(); + if (model) { + this._resolveCodeLensesScheduler.schedule(); + } + } + _resolveCodeLensesInViewport() { + this._resolveCodeLensesPromise?.cancel(); + this._resolveCodeLensesPromise = void 0; + const model = this._editor.getModel(); + if (!model) { + return; + } + const toResolve = []; + const lenses = []; + this._lenses.forEach((lens) => { + const request = lens.computeIfNecessary(model); + if (request) { + toResolve.push(request); + lenses.push(lens); + } + }); + if (toResolve.length === 0) { + this._oldCodeLensModels.clear(); + return; + } + const t1 = Date.now(); + const resolvePromise = createCancelablePromise((token) => { + const promises = toResolve.map((request, i2) => { + const resolvedSymbols = new Array(request.length); + const promises2 = request.map((request2, i3) => { + if (!request2.symbol.command && typeof request2.provider.resolveCodeLens === "function") { + return Promise.resolve(request2.provider.resolveCodeLens(model, request2.symbol, token)).then((symbol) => { + resolvedSymbols[i3] = symbol; + }, onUnexpectedExternalError); + } else { + resolvedSymbols[i3] = request2.symbol; + return Promise.resolve(void 0); + } + }); + return Promise.all(promises2).then(() => { + if (!token.isCancellationRequested && !lenses[i2].isDisposed()) { + lenses[i2].updateCommands(resolvedSymbols); + } + }); + }); + return Promise.all(promises); + }); + this._resolveCodeLensesPromise = resolvePromise; + this._resolveCodeLensesPromise.then(() => { + const newDelay = this._resolveCodeLensesDebounce.update(model, Date.now() - t1); + this._resolveCodeLensesScheduler.delay = newDelay; + if (this._currentCodeLensModel) { + this._codeLensCache.put(model, this._currentCodeLensModel); + } + this._oldCodeLensModels.clear(); + if (resolvePromise === this._resolveCodeLensesPromise) { + this._resolveCodeLensesPromise = void 0; + } + }, (err) => { + onUnexpectedError(err); + if (resolvePromise === this._resolveCodeLensesPromise) { + this._resolveCodeLensesPromise = void 0; + } + }); + } + async getModel() { + await this._getCodeLensModelPromise; + await this._resolveCodeLensesPromise; + return !this._currentCodeLensModel?.isDisposed ? this._currentCodeLensModel : void 0; + } +}; +CodeLensContribution = __decorate58([ + __param53(1, ILanguageFeaturesService), + __param53(2, ILanguageFeatureDebounceService), + __param53(3, ICommandService), + __param53(4, INotificationService), + __param53(5, ICodeLensCache) +], CodeLensContribution); +registerEditorContribution( + CodeLensContribution.ID, + CodeLensContribution, + 1 + /* EditorContributionInstantiation.AfterFirstRender */ +); +registerEditorAction(class ShowLensesInCurrentLine extends EditorAction { + constructor() { + super({ + id: "codelens.showLensesInCurrentLine", + precondition: EditorContextKeys.hasCodeLensProvider, + label: localize2(884, "Show CodeLens Commands for Current Line") + }); + } + async run(accessor, editor2) { + if (!editor2.hasModel()) { + return; + } + const quickInputService = accessor.get(IQuickInputService); + const commandService = accessor.get(ICommandService); + const notificationService = accessor.get(INotificationService); + const lineNumber = editor2.getSelection().positionLineNumber; + const codelensController = editor2.getContribution(CodeLensContribution.ID); + if (!codelensController) { + return; + } + const model = await codelensController.getModel(); + if (!model) { + return; + } + const items = []; + for (const lens of model.lenses) { + if (lens.symbol.command && lens.symbol.range.startLineNumber === lineNumber) { + items.push({ + label: lens.symbol.command.title, + command: lens.symbol.command + }); + } + } + if (items.length === 0) { + return; + } + const item = await quickInputService.pick(items, { + canPickMany: false, + placeHolder: localize(883, "Select a command") + }); + if (!item) { + return; + } + let command = item.command; + if (model.isDisposed) { + const newModel = await codelensController.getModel(); + const newLens = newModel?.lenses.find((lens) => lens.symbol.range.startLineNumber === lineNumber && lens.symbol.command?.title === command.title); + if (!newLens || !newLens.symbol.command) { + return; + } + command = newLens.symbol.command; + } + try { + await commandService.executeCommand(command.id, ...command.arguments || []); + } catch (err) { + notificationService.error(err); + } + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/colorPicker/browser/colorPickerContribution.js +init_cancellation(); +init_errors(); +init_uri(); +init_actions2(); +init_commands(); +init_editorExtensions(); + +// node_modules/monaco-editor-core/esm/vs/editor/common/editorFeatures.js +var editorFeatures = []; +function registerEditorFeature(ctor) { + editorFeatures.push(ctor); +} +function getEditorFeatures() { + return editorFeatures.slice(0); +} + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/hover/browser/hoverTypes.js +var HoverRangeAnchor = class { + constructor(priority, range2, initialMousePosX, initialMousePosY) { + this.priority = priority; + this.range = range2; + this.initialMousePosX = initialMousePosX; + this.initialMousePosY = initialMousePosY; + this.type = 1; + } + equals(other) { + return other.type === 1 && this.range.equalsRange(other.range); + } + canAdoptVisibleHover(lastAnchor, showAtPosition) { + return lastAnchor.type === 1 && showAtPosition.lineNumber === this.range.startLineNumber; + } +}; +var HoverForeignElementAnchor = class { + constructor(priority, owner, range2, initialMousePosX, initialMousePosY, supportsMarkerHover) { + this.priority = priority; + this.owner = owner; + this.range = range2; + this.initialMousePosX = initialMousePosX; + this.initialMousePosY = initialMousePosY; + this.supportsMarkerHover = supportsMarkerHover; + this.type = 2; + } + equals(other) { + return other.type === 2 && this.owner === other.owner; + } + canAdoptVisibleHover(lastAnchor, showAtPosition) { + return lastAnchor.type === 2 && this.owner === lastAnchor.owner; + } +}; +var RenderedHoverParts = class { + constructor(renderedHoverParts, disposables) { + this.renderedHoverParts = renderedHoverParts; + this.disposables = disposables; + } + dispose() { + for (const part of this.renderedHoverParts) { + part.dispose(); + } + this.disposables?.dispose(); + } +}; +var HoverParticipantRegistry = new class HoverParticipantRegistry2 { + constructor() { + this._participants = []; + } + register(ctor) { + this._participants.push(ctor); + } + getAll() { + return this._participants; + } +}(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/colorPicker/browser/color.js +init_cancellation(); +init_errors(); +init_model(); +init_languageFeatures(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/colorPicker/browser/defaultDocumentColorProvider.js +init_color(); +init_lifecycle(); +init_languageFeatures(); +init_editorWorker(); +var __decorate59 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param54 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var DefaultDocumentColorProvider = class DefaultDocumentColorProvider2 { + constructor(_editorWorkerService) { + this._editorWorkerService = _editorWorkerService; + } + async provideDocumentColors(model, _token) { + return this._editorWorkerService.computeDefaultDocumentColors(model.uri); + } + provideColorPresentations(_model, colorInfo, _token) { + const range2 = colorInfo.range; + const colorFromInfo = colorInfo.color; + const alpha = colorFromInfo.alpha; + const color = new Color(new RGBA(Math.round(255 * colorFromInfo.red), Math.round(255 * colorFromInfo.green), Math.round(255 * colorFromInfo.blue), alpha)); + const rgb = alpha ? Color.Format.CSS.formatRGBA(color) : Color.Format.CSS.formatRGB(color); + const hsl = alpha ? Color.Format.CSS.formatHSLA(color) : Color.Format.CSS.formatHSL(color); + const hex = alpha ? Color.Format.CSS.formatHexA(color) : Color.Format.CSS.formatHex(color); + const colorPresentations = []; + colorPresentations.push({ label: rgb, textEdit: { range: range2, text: rgb } }); + colorPresentations.push({ label: hsl, textEdit: { range: range2, text: hsl } }); + colorPresentations.push({ label: hex, textEdit: { range: range2, text: hex } }); + return colorPresentations; + } +}; +DefaultDocumentColorProvider = __decorate59([ + __param54(0, IEditorWorkerService) +], DefaultDocumentColorProvider); +var DefaultDocumentColorProviderFeature = class DefaultDocumentColorProviderFeature2 extends Disposable { + constructor(_languageFeaturesService, editorWorkerService) { + super(); + this._register(_languageFeaturesService.colorProvider.register("*", new DefaultDocumentColorProvider(editorWorkerService))); + } +}; +DefaultDocumentColorProviderFeature = __decorate59([ + __param54(0, ILanguageFeaturesService), + __param54(1, IEditorWorkerService) +], DefaultDocumentColorProviderFeature); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/colorPicker/browser/color.js +init_configuration(); +async function getColors(colorProviderRegistry, model, token, defaultColorDecoratorsEnablement = "auto") { + return _findColorData(new ColorDataCollector(), colorProviderRegistry, model, token, defaultColorDecoratorsEnablement); +} +function getColorPresentations(model, colorInfo, provider, token) { + return Promise.resolve(provider.provideColorPresentations(model, colorInfo, token)); +} +var ColorDataCollector = class { + constructor() { + } + async compute(provider, model, token, colors) { + const documentColors = await provider.provideDocumentColors(model, token); + if (Array.isArray(documentColors)) { + for (const colorInfo of documentColors) { + colors.push({ colorInfo, provider }); + } + } + return Array.isArray(documentColors); + } +}; +var ExtColorDataCollector = class { + constructor() { + } + async compute(provider, model, token, colors) { + const documentColors = await provider.provideDocumentColors(model, token); + if (Array.isArray(documentColors)) { + for (const colorInfo of documentColors) { + colors.push({ range: colorInfo.range, color: [colorInfo.color.red, colorInfo.color.green, colorInfo.color.blue, colorInfo.color.alpha] }); + } + } + return Array.isArray(documentColors); + } +}; +var ColorPresentationsCollector = class { + constructor(colorInfo) { + this.colorInfo = colorInfo; + } + async compute(provider, model, _token, colors) { + const documentColors = await provider.provideColorPresentations(model, this.colorInfo, CancellationToken.None); + if (Array.isArray(documentColors)) { + colors.push(...documentColors); + } + return Array.isArray(documentColors); + } +}; +async function _findColorData(collector, colorProviderRegistry, model, token, defaultColorDecoratorsEnablement) { + let validDocumentColorProviderFound = false; + let defaultProvider; + const colorData = []; + const documentColorProviders = colorProviderRegistry.ordered(model); + for (let i2 = documentColorProviders.length - 1; i2 >= 0; i2--) { + const provider = documentColorProviders[i2]; + if (defaultColorDecoratorsEnablement !== "always" && provider instanceof DefaultDocumentColorProvider) { + defaultProvider = provider; + } else { + try { + if (await collector.compute(provider, model, token, colorData)) { + validDocumentColorProviderFound = true; + } + } catch (e) { + onUnexpectedExternalError(e); + } + } + } + if (validDocumentColorProviderFound) { + return colorData; + } + if (defaultProvider && defaultColorDecoratorsEnablement !== "never") { + await collector.compute(defaultProvider, model, token, colorData); + return colorData; + } + return []; +} +function _setupColorCommand(accessor, resource) { + const { colorProvider: colorProviderRegistry } = accessor.get(ILanguageFeaturesService); + const model = accessor.get(IModelService).getModel(resource); + if (!model) { + throw illegalArgument(); + } + const defaultColorDecoratorsEnablement = accessor.get(IConfigurationService).getValue("editor.defaultColorDecorators", { resource }); + return { model, colorProviderRegistry, defaultColorDecoratorsEnablement }; +} + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/colorPicker/browser/colorDetector.js +init_async(); +init_color(); +init_errors(); +init_event(); +init_lifecycle(); +init_stopwatch(); +init_strings(); +init_range(); +init_textModel(); +init_languageFeatureDebounce(); +init_languageFeatures(); +init_configuration(); +var __decorate60 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param55 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var ColorDetector_1; +var ColorDecorationInjectedTextMarker = /* @__PURE__ */ Object.create({}); +var ColorDetector = class ColorDetector2 extends Disposable { + static { + ColorDetector_1 = this; + } + static { + this.ID = "editor.contrib.colorDetector"; + } + static { + this.RECOMPUTE_TIME = 1e3; + } + // ms + constructor(_editor, _configurationService, _languageFeaturesService, languageFeatureDebounceService) { + super(); + this._editor = _editor; + this._configurationService = _configurationService; + this._languageFeaturesService = _languageFeaturesService; + this._localToDispose = this._register(new DisposableStore()); + this._decorationsIds = []; + this._colorDatas = /* @__PURE__ */ new Map(); + this._decoratorLimitReporter = this._register(new DecoratorLimitReporter()); + this._colorDecorationClassRefs = this._register(new DisposableStore()); + this._colorDecoratorIds = this._editor.createDecorationsCollection(); + this._ruleFactory = this._register(new DynamicCssRules(this._editor)); + this._debounceInformation = languageFeatureDebounceService.for(_languageFeaturesService.colorProvider, "Document Colors", { min: ColorDetector_1.RECOMPUTE_TIME }); + this._register(_editor.onDidChangeModel(() => { + this._isColorDecoratorsEnabled = this.isEnabled(); + this.updateColors(); + })); + this._register(_editor.onDidChangeModelLanguage(() => this.updateColors())); + this._register(_languageFeaturesService.colorProvider.onDidChange(() => this.updateColors())); + this._register(_editor.onDidChangeConfiguration((e) => { + const prevIsEnabled = this._isColorDecoratorsEnabled; + this._isColorDecoratorsEnabled = this.isEnabled(); + this._defaultColorDecoratorsEnablement = this._editor.getOption( + 167 + /* EditorOption.defaultColorDecorators */ + ); + const updatedColorDecoratorsSetting = prevIsEnabled !== this._isColorDecoratorsEnabled || e.hasChanged( + 27 + /* EditorOption.colorDecoratorsLimit */ + ); + const updatedDefaultColorDecoratorsSetting = e.hasChanged( + 167 + /* EditorOption.defaultColorDecorators */ + ); + if (updatedColorDecoratorsSetting || updatedDefaultColorDecoratorsSetting) { + if (this._isColorDecoratorsEnabled) { + this.updateColors(); + } else { + this.removeAllDecorations(); + } + } + })); + this._timeoutTimer = null; + this._computePromise = null; + this._isColorDecoratorsEnabled = this.isEnabled(); + this._defaultColorDecoratorsEnablement = this._editor.getOption( + 167 + /* EditorOption.defaultColorDecorators */ + ); + this.updateColors(); + } + isEnabled() { + const model = this._editor.getModel(); + if (!model) { + return false; + } + const languageId = model.getLanguageId(); + const deprecatedConfig = this._configurationService.getValue(languageId); + if (deprecatedConfig && typeof deprecatedConfig === "object") { + const colorDecorators = deprecatedConfig["colorDecorators"]; + if (colorDecorators && colorDecorators["enable"] !== void 0 && !colorDecorators["enable"]) { + return colorDecorators["enable"]; + } + } + return this._editor.getOption( + 26 + /* EditorOption.colorDecorators */ + ); + } + static get(editor2) { + return editor2.getContribution(this.ID); + } + dispose() { + this.stop(); + this.removeAllDecorations(); + super.dispose(); + } + updateColors() { + this.stop(); + if (!this._isColorDecoratorsEnabled) { + return; + } + const model = this._editor.getModel(); + if (!model || !this._languageFeaturesService.colorProvider.has(model)) { + return; + } + this._localToDispose.add(this._editor.onDidChangeModelContent(() => { + if (!this._timeoutTimer) { + this._timeoutTimer = new TimeoutTimer(); + this._timeoutTimer.cancelAndSet(() => { + this._timeoutTimer = null; + this.beginCompute(); + }, this._debounceInformation.get(model)); + } + })); + this.beginCompute(); + } + async beginCompute() { + this._computePromise = createCancelablePromise(async (token) => { + const model = this._editor.getModel(); + if (!model) { + return []; + } + const sw = new StopWatch(false); + const colors = await getColors(this._languageFeaturesService.colorProvider, model, token, this._defaultColorDecoratorsEnablement); + this._debounceInformation.update(model, sw.elapsed()); + return colors; + }); + try { + const colors = await this._computePromise; + this.updateDecorations(colors); + this.updateColorDecorators(colors); + this._computePromise = null; + } catch (e) { + onUnexpectedError(e); + } + } + stop() { + if (this._timeoutTimer) { + this._timeoutTimer.cancel(); + this._timeoutTimer = null; + } + if (this._computePromise) { + this._computePromise.cancel(); + this._computePromise = null; + } + this._localToDispose.clear(); + } + updateDecorations(colorDatas) { + const decorations = colorDatas.map((c) => ({ + range: { + startLineNumber: c.colorInfo.range.startLineNumber, + startColumn: c.colorInfo.range.startColumn, + endLineNumber: c.colorInfo.range.endLineNumber, + endColumn: c.colorInfo.range.endColumn + }, + options: ModelDecorationOptions.EMPTY + })); + this._editor.changeDecorations((changeAccessor) => { + this._decorationsIds = changeAccessor.deltaDecorations(this._decorationsIds, decorations); + this._colorDatas = /* @__PURE__ */ new Map(); + this._decorationsIds.forEach((id, i2) => this._colorDatas.set(id, colorDatas[i2])); + }); + } + updateColorDecorators(colorData) { + this._colorDecorationClassRefs.clear(); + const decorations = []; + const limit = this._editor.getOption( + 27 + /* EditorOption.colorDecoratorsLimit */ + ); + for (let i2 = 0; i2 < colorData.length && decorations.length < limit; i2++) { + const { red, green, blue, alpha } = colorData[i2].colorInfo.color; + const rgba = new RGBA(Math.round(red * 255), Math.round(green * 255), Math.round(blue * 255), alpha); + const color = `rgba(${rgba.r}, ${rgba.g}, ${rgba.b}, ${rgba.a})`; + const ref = this._colorDecorationClassRefs.add(this._ruleFactory.createClassNameRef({ + backgroundColor: color + })); + decorations.push({ + range: { + startLineNumber: colorData[i2].colorInfo.range.startLineNumber, + startColumn: colorData[i2].colorInfo.range.startColumn, + endLineNumber: colorData[i2].colorInfo.range.endLineNumber, + endColumn: colorData[i2].colorInfo.range.endColumn + }, + options: { + description: "colorDetector", + before: { + content: noBreakWhitespace, + inlineClassName: `${ref.className} colorpicker-color-decoration`, + inlineClassNameAffectsLetterSpacing: true, + attachedData: ColorDecorationInjectedTextMarker + } + } + }); + } + const limited = limit < colorData.length ? limit : false; + this._decoratorLimitReporter.update(colorData.length, limited); + this._colorDecoratorIds.set(decorations); + } + removeAllDecorations() { + this._editor.removeDecorations(this._decorationsIds); + this._decorationsIds = []; + this._colorDecoratorIds.clear(); + this._colorDecorationClassRefs.clear(); + } + getColorData(position) { + const model = this._editor.getModel(); + if (!model) { + return null; + } + const decorations = model.getDecorationsInRange(Range.fromPositions(position, position)).filter((d) => this._colorDatas.has(d.id)); + if (decorations.length === 0) { + return null; + } + return this._colorDatas.get(decorations[0].id); + } + isColorDecoration(decoration3) { + return this._colorDecoratorIds.has(decoration3); + } +}; +ColorDetector = ColorDetector_1 = __decorate60([ + __param55(1, IConfigurationService), + __param55(2, ILanguageFeaturesService), + __param55(3, ILanguageFeatureDebounceService) +], ColorDetector); +var DecoratorLimitReporter = class extends Disposable { + constructor() { + super(...arguments); + this._onDidChange = this._register(new Emitter()); + this._computed = 0; + this._limited = false; + } + update(computed, limited) { + if (computed !== this._computed || limited !== this._limited) { + this._computed = computed; + this._limited = limited; + this._onDidChange.fire(); + } + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/colorPicker/browser/hoverColorPicker/hoverColorPickerContribution.js +init_lifecycle(); +init_range(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/hover/browser/hoverActionIds.js +init_nls(); +var SHOW_OR_FOCUS_HOVER_ACTION_ID = "editor.action.showHover"; +var SHOW_DEFINITION_PREVIEW_HOVER_ACTION_ID = "editor.action.showDefinitionPreviewHover"; +var HIDE_HOVER_ACTION_ID = "editor.action.hideHover"; +var SCROLL_UP_HOVER_ACTION_ID = "editor.action.scrollUpHover"; +var SCROLL_DOWN_HOVER_ACTION_ID = "editor.action.scrollDownHover"; +var SCROLL_LEFT_HOVER_ACTION_ID = "editor.action.scrollLeftHover"; +var SCROLL_RIGHT_HOVER_ACTION_ID = "editor.action.scrollRightHover"; +var PAGE_UP_HOVER_ACTION_ID = "editor.action.pageUpHover"; +var PAGE_DOWN_HOVER_ACTION_ID = "editor.action.pageDownHover"; +var GO_TO_TOP_HOVER_ACTION_ID = "editor.action.goToTopHover"; +var GO_TO_BOTTOM_HOVER_ACTION_ID = "editor.action.goToBottomHover"; +var INCREASE_HOVER_VERBOSITY_ACTION_ID = "editor.action.increaseHoverVerbosityLevel"; +var INCREASE_HOVER_VERBOSITY_ACTION_LABEL = localize(1102, "Increase Hover Verbosity Level"); +var DECREASE_HOVER_VERBOSITY_ACTION_ID = "editor.action.decreaseHoverVerbosityLevel"; +var DECREASE_HOVER_VERBOSITY_ACTION_LABEL = localize(1103, "Decrease Hover Verbosity Level"); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/hover/browser/contentHoverController.js +init_lifecycle(); +init_instantiation(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/inlineCompletionsHintsWidget.js +init_dom(); +init_actions(); +init_arrays(); +init_async(); +init_codicons(); +init_lifecycle(); +init_observable(); +init_platform(); +init_themables(); +init_nls(); +init_actions2(); +init_commands(); +init_contextkey(); +init_instantiation(); +init_telemetry(); +init_position(); +init_languages(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/inlineCompletions/browser/controller/commandIds.js +var inlineSuggestCommitId = "editor.action.inlineSuggest.commit"; +var showPreviousInlineSuggestionActionId = "editor.action.inlineSuggest.showPrevious"; +var showNextInlineSuggestionActionId = "editor.action.inlineSuggest.showNext"; +var jumpToNextInlineEditId = "editor.action.inlineSuggest.jump"; +var hideInlineCompletionId = "editor.action.inlineSuggest.hide"; +var toggleShowCollapsedId = "editor.action.inlineSuggest.toggleShowCollapsed"; + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/inlineCompletionsHintsWidget.js +var __decorate61 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param56 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var InlineSuggestionHintsContentWidget_1; +var InlineCompletionsHintsWidget = class InlineCompletionsHintsWidget2 extends Disposable { + constructor(editor2, model, instantiationService) { + super(); + this.editor = editor2; + this.model = model; + this.instantiationService = instantiationService; + this.alwaysShowToolbar = observableFromEvent(this, this.editor.onDidChangeConfiguration, () => this.editor.getOption( + 71 + /* EditorOption.inlineSuggest */ + ).showToolbar === "always"); + this.sessionPosition = void 0; + this.position = derived(this, (reader) => { + const ghostText = this.model.read(reader)?.primaryGhostText.read(reader); + if (!this.alwaysShowToolbar.read(reader) || !ghostText || ghostText.parts.length === 0) { + this.sessionPosition = void 0; + return null; + } + const firstColumn = ghostText.parts[0].column; + if (this.sessionPosition && this.sessionPosition.lineNumber !== ghostText.lineNumber) { + this.sessionPosition = void 0; + } + const position = new Position(ghostText.lineNumber, Math.min(firstColumn, this.sessionPosition?.column ?? Number.MAX_SAFE_INTEGER)); + this.sessionPosition = position; + return position; + }); + this._register(autorunWithStore((reader, store) => { + const model2 = this.model.read(reader); + if (!model2 || !this.alwaysShowToolbar.read(reader)) { + return; + } + const contentWidgetValue = derived((reader2) => { + const contentWidget = reader2.store.add(this.instantiationService.createInstance(InlineSuggestionHintsContentWidget.hot.read(reader2), this.editor, true, this.position, model2.selectedInlineCompletionIndex, model2.inlineCompletionsCount, model2.activeCommands, model2.warning, () => { + })); + editor2.addContentWidget(contentWidget); + reader2.store.add(toDisposable(() => editor2.removeContentWidget(contentWidget))); + reader2.store.add(autorun((reader3) => { + const position = this.position.read(reader3); + if (!position) { + return; + } + if (model2.lastTriggerKind.read(reader3) !== InlineCompletionTriggerKind.Explicit) { + model2.triggerExplicitly(); + } + })); + return contentWidget; + }); + const hadPosition = derivedObservableWithCache(this, (reader2, lastValue) => !!this.position.read(reader2) || !!lastValue); + store.add(autorun((reader2) => { + if (hadPosition.read(reader2)) { + contentWidgetValue.read(reader2); + } + })); + })); + } +}; +InlineCompletionsHintsWidget = __decorate61([ + __param56(2, IInstantiationService) +], InlineCompletionsHintsWidget); +var inlineSuggestionHintsNextIcon = registerIcon("inline-suggestion-hints-next", Codicon.chevronRight, localize(1207, "Icon for show next parameter hint.")); +var inlineSuggestionHintsPreviousIcon = registerIcon("inline-suggestion-hints-previous", Codicon.chevronLeft, localize(1208, "Icon for show previous parameter hint.")); +var InlineSuggestionHintsContentWidget = class InlineSuggestionHintsContentWidget2 extends Disposable { + static { + InlineSuggestionHintsContentWidget_1 = this; + } + static { + this.hot = createHotClass(this); + } + static { + this._dropDownVisible = false; + } + static get dropDownVisible() { + return this._dropDownVisible; + } + static { + this.id = 0; + } + createCommandAction(commandId, label, iconClassName) { + const action = new Action(commandId, label, iconClassName, true, () => this._commandService.executeCommand(commandId)); + const kb = this.keybindingService.lookupKeybinding(commandId, this._contextKeyService); + let tooltip = label; + if (kb) { + tooltip = localize(1209, "{0} ({1})", label, kb.getLabel()); + } + action.tooltip = tooltip; + return action; + } + constructor(editor2, withBorder, _position, _currentSuggestionIdx, _suggestionCount, _extraCommands, _warning, _relayout, _commandService, instantiationService, keybindingService, _contextKeyService, _menuService) { + super(); + this.editor = editor2; + this.withBorder = withBorder; + this._position = _position; + this._currentSuggestionIdx = _currentSuggestionIdx; + this._suggestionCount = _suggestionCount; + this._extraCommands = _extraCommands; + this._warning = _warning; + this._relayout = _relayout; + this._commandService = _commandService; + this.keybindingService = keybindingService; + this._contextKeyService = _contextKeyService; + this._menuService = _menuService; + this.id = `InlineSuggestionHintsContentWidget${InlineSuggestionHintsContentWidget_1.id++}`; + this.allowEditorOverflow = true; + this.suppressMouseDown = false; + this._warningMessageContentNode = derived((reader) => { + const warning = this._warning.read(reader); + if (!warning) { + return void 0; + } + if (typeof warning.message === "string") { + return warning.message; + } + const markdownElement = reader.store.add(renderMarkdown(warning.message)); + return markdownElement.element; + }); + this._warningMessageNode = n.div({ + class: "warningMessage", + style: { + maxWidth: 400, + margin: 4, + marginBottom: 4, + display: derived((reader) => this._warning.read(reader) ? "block" : "none") + } + }, [ + this._warningMessageContentNode + ]).keepUpdated(this._store); + this.nodes = h("div.inlineSuggestionsHints", { className: this.withBorder ? "monaco-hover monaco-hover-content" : "" }, [ + this._warningMessageNode.element, + h("div@toolBar") + ]); + this.previousAction = this._register(this.createCommandAction(showPreviousInlineSuggestionActionId, localize(1210, "Previous"), ThemeIcon.asClassName(inlineSuggestionHintsPreviousIcon))); + this.availableSuggestionCountAction = this._register(new Action("inlineSuggestionHints.availableSuggestionCount", "", void 0, false)); + this.nextAction = this._register(this.createCommandAction(showNextInlineSuggestionActionId, localize(1211, "Next"), ThemeIcon.asClassName(inlineSuggestionHintsNextIcon))); + this.inlineCompletionsActionsMenus = this._register(this._menuService.createMenu(MenuId.InlineCompletionsActions, this._contextKeyService)); + this.clearAvailableSuggestionCountLabelDebounced = this._register(new RunOnceScheduler(() => { + this.availableSuggestionCountAction.label = ""; + }, 100)); + this.disableButtonsDebounced = this._register(new RunOnceScheduler(() => { + this.previousAction.enabled = this.nextAction.enabled = false; + }, 100)); + this._register(autorun((reader) => { + this._warningMessageContentNode.read(reader); + this._warningMessageNode.readEffect(reader); + this._relayout(); + })); + this.toolBar = this._register(instantiationService.createInstance(CustomizedMenuWorkbenchToolBar, this.nodes.toolBar, MenuId.InlineSuggestionToolbar, { + menuOptions: { renderShortTitle: true }, + toolbarOptions: { primaryGroup: (g) => g.startsWith("primary") }, + actionViewItemProvider: (action, options2) => { + if (action instanceof MenuItemAction) { + return instantiationService.createInstance(StatusBarViewItem, action, void 0); + } + if (action === this.availableSuggestionCountAction) { + const a = new ActionViewItemWithClassName(void 0, action, { label: true, icon: false }); + a.setClass("availableSuggestionCount"); + return a; + } + return void 0; + }, + telemetrySource: "InlineSuggestionToolbar" + })); + this.toolBar.setPrependedPrimaryActions([ + this.previousAction, + this.availableSuggestionCountAction, + this.nextAction + ]); + this._register(this.toolBar.onDidChangeDropdownVisibility((e) => { + InlineSuggestionHintsContentWidget_1._dropDownVisible = e; + })); + this._register(autorun((reader) => { + this._position.read(reader); + this.editor.layoutContentWidget(this); + })); + this._register(autorun((reader) => { + const suggestionCount = this._suggestionCount.read(reader); + const currentSuggestionIdx = this._currentSuggestionIdx.read(reader); + if (suggestionCount !== void 0) { + this.clearAvailableSuggestionCountLabelDebounced.cancel(); + this.availableSuggestionCountAction.label = `${currentSuggestionIdx + 1}/${suggestionCount}`; + } else { + this.clearAvailableSuggestionCountLabelDebounced.schedule(); + } + if (suggestionCount !== void 0 && suggestionCount > 1) { + this.disableButtonsDebounced.cancel(); + this.previousAction.enabled = this.nextAction.enabled = true; + } else { + this.disableButtonsDebounced.schedule(); + } + })); + this._register(autorun((reader) => { + const extraCommands = this._extraCommands.read(reader); + const extraActions = extraCommands.map((c) => ({ + class: void 0, + id: c.command.id, + enabled: true, + tooltip: c.command.tooltip || "", + label: c.command.title, + run: (event) => { + return this._commandService.executeCommand(c.command.id); + } + })); + for (const [_, group] of this.inlineCompletionsActionsMenus.getActions()) { + for (const action of group) { + if (action instanceof MenuItemAction) { + extraActions.push(action); + } + } + } + if (extraActions.length > 0) { + extraActions.unshift(new Separator()); + } + this.toolBar.setAdditionalSecondaryActions(extraActions); + })); + } + getId() { + return this.id; + } + getDomNode() { + return this.nodes.root; + } + getPosition() { + return { + position: this._position.get(), + preference: [ + 1, + 2 + /* ContentWidgetPositionPreference.BELOW */ + ], + positionAffinity: 3 + }; + } +}; +InlineSuggestionHintsContentWidget = InlineSuggestionHintsContentWidget_1 = __decorate61([ + __param56(8, ICommandService), + __param56(9, IInstantiationService), + __param56(10, IKeybindingService), + __param56(11, IContextKeyService), + __param56(12, IMenuService) +], InlineSuggestionHintsContentWidget); +var ActionViewItemWithClassName = class extends ActionViewItem { + constructor() { + super(...arguments); + this._className = void 0; + } + setClass(className2) { + this._className = className2; + } + render(container) { + super.render(container); + if (this._className) { + container.classList.add(this._className); + } + } + updateTooltip() { + } +}; +var StatusBarViewItem = class extends MenuEntryActionViewItem { + updateLabel() { + const kb = this._keybindingService.lookupKeybinding(this._action.id, this._contextKeyService, true); + if (!kb) { + return super.updateLabel(); + } + if (this.label) { + const div = h("div.keybinding").root; + const k = this._register(new KeybindingLabel(div, OS, { disableTitle: true, ...unthemedKeybindingLabelOptions })); + k.set(kb); + this.label.textContent = this._action.label; + this.label.appendChild(div); + this.label.classList.add("inlineSuggestionStatusBarItemLabel"); + } + } + updateTooltip() { + } +}; +var CustomizedMenuWorkbenchToolBar = class CustomizedMenuWorkbenchToolBar2 extends WorkbenchToolBar { + constructor(container, menuId, options2, menuService, contextKeyService, contextMenuService, keybindingService, commandService, telemetryService) { + super(container, { resetMenu: menuId, ...options2 }, menuService, contextKeyService, contextMenuService, keybindingService, commandService, telemetryService); + this.menuId = menuId; + this.options2 = options2; + this.menuService = menuService; + this.contextKeyService = contextKeyService; + this.menu = this._store.add(this.menuService.createMenu(this.menuId, this.contextKeyService, { emitEventsForSubmenuChanges: true })); + this.additionalActions = []; + this.prependedPrimaryActions = []; + this.additionalPrimaryActions = []; + this._store.add(this.menu.onDidChange(() => this.updateToolbar())); + this.updateToolbar(); + } + updateToolbar() { + const { primary, secondary } = getActionBarActions(this.menu.getActions(this.options2?.menuOptions), this.options2?.toolbarOptions?.primaryGroup, this.options2?.toolbarOptions?.shouldInlineSubmenu, this.options2?.toolbarOptions?.useSeparatorsInPrimaryActions); + secondary.push(...this.additionalActions); + primary.unshift(...this.prependedPrimaryActions); + primary.push(...this.additionalPrimaryActions); + this.setActions(primary, secondary); + } + setPrependedPrimaryActions(actions) { + if (equals(this.prependedPrimaryActions, actions, (a, b) => a === b)) { + return; + } + this.prependedPrimaryActions = actions; + this.updateToolbar(); + } + setAdditionalSecondaryActions(actions) { + if (equals(this.additionalActions, actions, (a, b) => a === b)) { + return; + } + this.additionalActions = actions; + this.updateToolbar(); + } +}; +CustomizedMenuWorkbenchToolBar = __decorate61([ + __param56(3, IMenuService), + __param56(4, IContextKeyService), + __param56(5, IContextMenuService), + __param56(6, IKeybindingService), + __param56(7, ICommandService), + __param56(8, ITelemetryService) +], CustomizedMenuWorkbenchToolBar); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/hover/browser/contentHoverController.js +init_async(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/hover/browser/hoverUtils.js +init_dom(); +function isMousePositionWithinElement(element, posx, posy) { + const elementRect = getDomNodePagePosition(element); + if (posx < elementRect.left || posx > elementRect.left + elementRect.width || posy < elementRect.top || posy > elementRect.top + elementRect.height) { + return false; + } + return true; +} + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/hover/browser/contentHoverWidgetWrapper.js +init_dom(); +init_lifecycle(); +init_languages(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/hover/browser/hoverOperation.js +init_async(); +init_errors(); +init_event(); +init_lifecycle(); +var HoverResult = class { + constructor(value, isComplete, hasLoadingMessage, options2) { + this.value = value; + this.isComplete = isComplete; + this.hasLoadingMessage = hasLoadingMessage; + this.options = options2; + } +}; +var HoverOperation = class extends Disposable { + constructor(_editor, _computer) { + super(); + this._editor = _editor; + this._computer = _computer; + this._onResult = this._register(new Emitter()); + this.onResult = this._onResult.event; + this._asyncComputationScheduler = this._register(new Debouncer((options2) => this._triggerAsyncComputation(options2), 0)); + this._syncComputationScheduler = this._register(new Debouncer((options2) => this._triggerSyncComputation(options2), 0)); + this._loadingMessageScheduler = this._register(new Debouncer((options2) => this._triggerLoadingMessage(options2), 0)); + this._state = 0; + this._asyncIterable = null; + this._asyncIterableDone = false; + this._result = []; + } + dispose() { + if (this._asyncIterable) { + this._asyncIterable.cancel(); + this._asyncIterable = null; + } + this._options = void 0; + super.dispose(); + } + get _hoverTime() { + return this._editor.getOption( + 69 + /* EditorOption.hover */ + ).delay; + } + get _firstWaitTime() { + return this._hoverTime / 2; + } + get _secondWaitTime() { + return this._hoverTime - this._firstWaitTime; + } + get _loadingMessageTime() { + return 3 * this._hoverTime; + } + _setState(state, options2) { + this._options = options2; + this._state = state; + this._fireResult(options2); + } + _triggerAsyncComputation(options2) { + this._setState(2, options2); + this._syncComputationScheduler.schedule(options2, this._secondWaitTime); + if (this._computer.computeAsync) { + this._asyncIterableDone = false; + this._asyncIterable = createCancelableAsyncIterableProducer((token) => this._computer.computeAsync(options2, token)); + (async () => { + try { + for await (const item of this._asyncIterable) { + if (item) { + this._result.push(item); + this._fireResult(options2); + } + } + this._asyncIterableDone = true; + if (this._state === 3 || this._state === 4) { + this._setState(0, options2); + } + } catch (e) { + onUnexpectedError(e); + } + })(); + } else { + this._asyncIterableDone = true; + } + } + _triggerSyncComputation(options2) { + if (this._computer.computeSync) { + this._result = this._result.concat(this._computer.computeSync(options2)); + } + this._setState(this._asyncIterableDone ? 0 : 3, options2); + } + _triggerLoadingMessage(options2) { + if (this._state === 3) { + this._setState(4, options2); + } + } + _fireResult(options2) { + if (this._state === 1 || this._state === 2) { + return; + } + const isComplete = this._state === 0; + const hasLoadingMessage = this._state === 4; + this._onResult.fire(new HoverResult(this._result.slice(0), isComplete, hasLoadingMessage, options2)); + } + start(mode, options2) { + if (mode === 0) { + if (this._state === 0) { + this._setState(1, options2); + this._asyncComputationScheduler.schedule(options2, this._firstWaitTime); + this._loadingMessageScheduler.schedule(options2, this._loadingMessageTime); + } + } else { + switch (this._state) { + case 0: + this._triggerAsyncComputation(options2); + this._syncComputationScheduler.cancel(); + this._triggerSyncComputation(options2); + break; + case 2: + this._syncComputationScheduler.cancel(); + this._triggerSyncComputation(options2); + break; + } + } + } + cancel() { + this._asyncComputationScheduler.cancel(); + this._syncComputationScheduler.cancel(); + this._loadingMessageScheduler.cancel(); + if (this._asyncIterable) { + this._asyncIterable.cancel(); + this._asyncIterable = null; + } + this._result = []; + this._options = void 0; + this._state = 0; + } + get options() { + return this._options; + } +}; +var Debouncer = class extends Disposable { + constructor(runner, debounceTimeMs) { + super(); + this._scheduler = this._register(new RunOnceScheduler(() => runner(this._options), debounceTimeMs)); + } + schedule(options2, debounceTimeMs) { + this._options = options2; + this._scheduler.schedule(debounceTimeMs); + } + cancel() { + this._scheduler.cancel(); + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/hover/browser/contentHoverWidgetWrapper.js +init_instantiation(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/hover/browser/contentHoverWidget.js +init_dom(); + +// node_modules/monaco-editor-core/esm/vs/base/browser/ui/resizable/resizable.js +init_dom(); +init_event(); +init_lifecycle(); +var ResizableHTMLElement = class { + get onDidWillResize() { + return this._onDidWillResize.event; + } + get onDidResize() { + return this._onDidResize.event; + } + constructor() { + this._onDidWillResize = new Emitter(); + this._onDidResize = new Emitter(); + this._sashListener = new DisposableStore(); + this._size = new Dimension(0, 0); + this._minSize = new Dimension(0, 0); + this._maxSize = new Dimension(Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER); + this.domNode = document.createElement("div"); + this._eastSash = new Sash(this.domNode, { getVerticalSashLeft: () => this._size.width }, { + orientation: 0 + /* Orientation.VERTICAL */ + }); + this._westSash = new Sash(this.domNode, { getVerticalSashLeft: () => 0 }, { + orientation: 0 + /* Orientation.VERTICAL */ + }); + this._northSash = new Sash(this.domNode, { getHorizontalSashTop: () => 0 }, { orientation: 1, orthogonalEdge: OrthogonalEdge.North }); + this._southSash = new Sash(this.domNode, { getHorizontalSashTop: () => this._size.height }, { orientation: 1, orthogonalEdge: OrthogonalEdge.South }); + this._northSash.orthogonalStartSash = this._westSash; + this._northSash.orthogonalEndSash = this._eastSash; + this._southSash.orthogonalStartSash = this._westSash; + this._southSash.orthogonalEndSash = this._eastSash; + let currentSize; + let deltaY = 0; + let deltaX = 0; + this._sashListener.add(Event.any(this._northSash.onDidStart, this._eastSash.onDidStart, this._southSash.onDidStart, this._westSash.onDidStart)(() => { + if (currentSize === void 0) { + this._onDidWillResize.fire(); + currentSize = this._size; + deltaY = 0; + deltaX = 0; + } + })); + this._sashListener.add(Event.any(this._northSash.onDidEnd, this._eastSash.onDidEnd, this._southSash.onDidEnd, this._westSash.onDidEnd)(() => { + if (currentSize !== void 0) { + currentSize = void 0; + deltaY = 0; + deltaX = 0; + this._onDidResize.fire({ dimension: this._size, done: true }); + } + })); + this._sashListener.add(this._eastSash.onDidChange((e) => { + if (currentSize) { + deltaX = e.currentX - e.startX; + this.layout(currentSize.height + deltaY, currentSize.width + deltaX); + this._onDidResize.fire({ dimension: this._size, done: false, east: true }); + } + })); + this._sashListener.add(this._westSash.onDidChange((e) => { + if (currentSize) { + deltaX = -(e.currentX - e.startX); + this.layout(currentSize.height + deltaY, currentSize.width + deltaX); + this._onDidResize.fire({ dimension: this._size, done: false, west: true }); + } + })); + this._sashListener.add(this._northSash.onDidChange((e) => { + if (currentSize) { + deltaY = -(e.currentY - e.startY); + this.layout(currentSize.height + deltaY, currentSize.width + deltaX); + this._onDidResize.fire({ dimension: this._size, done: false, north: true }); + } + })); + this._sashListener.add(this._southSash.onDidChange((e) => { + if (currentSize) { + deltaY = e.currentY - e.startY; + this.layout(currentSize.height + deltaY, currentSize.width + deltaX); + this._onDidResize.fire({ dimension: this._size, done: false, south: true }); + } + })); + this._sashListener.add(Event.any(this._eastSash.onDidReset, this._westSash.onDidReset)((e) => { + if (this._preferredSize) { + this.layout(this._size.height, this._preferredSize.width); + this._onDidResize.fire({ dimension: this._size, done: true }); + } + })); + this._sashListener.add(Event.any(this._northSash.onDidReset, this._southSash.onDidReset)((e) => { + if (this._preferredSize) { + this.layout(this._preferredSize.height, this._size.width); + this._onDidResize.fire({ dimension: this._size, done: true }); + } + })); + } + dispose() { + this._northSash.dispose(); + this._southSash.dispose(); + this._eastSash.dispose(); + this._westSash.dispose(); + this._sashListener.dispose(); + this._onDidResize.dispose(); + this._onDidWillResize.dispose(); + this.domNode.remove(); + } + enableSashes(north, east, south, west) { + this._northSash.state = north ? 3 : 0; + this._eastSash.state = east ? 3 : 0; + this._southSash.state = south ? 3 : 0; + this._westSash.state = west ? 3 : 0; + } + layout(height = this.size.height, width2 = this.size.width) { + const { height: minHeight, width: minWidth } = this._minSize; + const { height: maxHeight, width: maxWidth } = this._maxSize; + height = Math.max(minHeight, Math.min(maxHeight, height)); + width2 = Math.max(minWidth, Math.min(maxWidth, width2)); + const newSize = new Dimension(width2, height); + if (!Dimension.equals(newSize, this._size)) { + this.domNode.style.height = height + "px"; + this.domNode.style.width = width2 + "px"; + this._size = newSize; + this._northSash.layout(); + this._eastSash.layout(); + this._southSash.layout(); + this._westSash.layout(); + } + } + clearSashHoverState() { + this._eastSash.clearSashHoverState(); + this._westSash.clearSashHoverState(); + this._northSash.clearSashHoverState(); + this._southSash.clearSashHoverState(); + } + get size() { + return this._size; + } + set maxSize(value) { + this._maxSize = value; + } + get maxSize() { + return this._maxSize; + } + set minSize(value) { + this._minSize = value; + } + get minSize() { + return this._minSize; + } + set preferredSize(value) { + this._preferredSize = value; + } + get preferredSize() { + return this._preferredSize; + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/hover/browser/resizableContentWidget.js +init_lifecycle(); +init_position(); +init_dom(); +var TOP_HEIGHT = 30; +var BOTTOM_HEIGHT = 24; +var ResizableContentWidget = class extends Disposable { + constructor(_editor, minimumSize = new Dimension(10, 10)) { + super(); + this._editor = _editor; + this.allowEditorOverflow = true; + this.suppressMouseDown = false; + this._resizableNode = this._register(new ResizableHTMLElement()); + this._contentPosition = null; + this._isResizing = false; + this._resizableNode.domNode.style.position = "absolute"; + this._resizableNode.minSize = Dimension.lift(minimumSize); + this._resizableNode.layout(minimumSize.height, minimumSize.width); + this._resizableNode.enableSashes(true, true, true, true); + this._register(this._resizableNode.onDidResize((e) => { + this._resize(new Dimension(e.dimension.width, e.dimension.height)); + if (e.done) { + this._isResizing = false; + } + })); + this._register(this._resizableNode.onDidWillResize(() => { + this._isResizing = true; + })); + } + get isResizing() { + return this._isResizing; + } + getDomNode() { + return this._resizableNode.domNode; + } + getPosition() { + return this._contentPosition; + } + get position() { + return this._contentPosition?.position ? Position.lift(this._contentPosition.position) : void 0; + } + _availableVerticalSpaceAbove(position) { + const editorDomNode = this._editor.getDomNode(); + const mouseBox = this._editor.getScrolledVisiblePosition(position); + if (!editorDomNode || !mouseBox) { + return; + } + const editorBox = getDomNodePagePosition(editorDomNode); + return editorBox.top + mouseBox.top - TOP_HEIGHT; + } + _availableVerticalSpaceBelow(position) { + const editorDomNode = this._editor.getDomNode(); + const mouseBox = this._editor.getScrolledVisiblePosition(position); + if (!editorDomNode || !mouseBox) { + return; + } + const editorBox = getDomNodePagePosition(editorDomNode); + const bodyBox = getClientArea(editorDomNode.ownerDocument.body); + const mouseBottom = editorBox.top + mouseBox.top + mouseBox.height; + return bodyBox.height - mouseBottom - BOTTOM_HEIGHT; + } + _findPositionPreference(widgetHeight, showAtPosition) { + const maxHeightBelow = Math.min(this._availableVerticalSpaceBelow(showAtPosition) ?? Infinity, widgetHeight); + const maxHeightAbove = Math.min(this._availableVerticalSpaceAbove(showAtPosition) ?? Infinity, widgetHeight); + const maxHeight = Math.min(Math.max(maxHeightAbove, maxHeightBelow), widgetHeight); + const height = Math.min(widgetHeight, maxHeight); + let renderingAbove; + if (this._editor.getOption( + 69 + /* EditorOption.hover */ + ).above) { + renderingAbove = height <= maxHeightAbove ? 1 : 2; + } else { + renderingAbove = height <= maxHeightBelow ? 2 : 1; + } + if (renderingAbove === 1) { + this._resizableNode.enableSashes(true, true, false, false); + } else { + this._resizableNode.enableSashes(false, true, true, false); + } + return renderingAbove; + } + _resize(dimension) { + this._resizableNode.layout(dimension.height, dimension.width); + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/hover/browser/contentHoverWidget.js +init_contextkey(); +init_configuration(); +init_editorContextKeys(); + +// node_modules/monaco-editor-core/esm/vs/base/browser/ui/hover/hoverWidget.js +init_dom(); +init_keyboardEvent(); +init_lifecycle(); +init_nls(); +var $4 = $; +var HoverWidget = class extends Disposable { + constructor(fadeIn) { + super(); + this.containerDomNode = document.createElement("div"); + this.containerDomNode.className = "monaco-hover"; + this.containerDomNode.classList.toggle("fade-in", !!fadeIn); + this.containerDomNode.tabIndex = 0; + this.containerDomNode.setAttribute("role", "tooltip"); + this.contentsDomNode = document.createElement("div"); + this.contentsDomNode.className = "monaco-hover-content"; + this.scrollbar = this._register(new DomScrollableElement(this.contentsDomNode, { + consumeMouseWheelIfScrollbarIsNeeded: true + })); + this.containerDomNode.appendChild(this.scrollbar.getDomNode()); + } + onContentsChanged() { + this.scrollbar.scanDomNode(); + } +}; +var HoverAction = class _HoverAction extends Disposable { + static render(parent, actionOptions, keybindingLabel) { + return new _HoverAction(parent, actionOptions, keybindingLabel); + } + constructor(parent, actionOptions, keybindingLabel) { + super(); + this.actionLabel = actionOptions.label; + this.actionKeybindingLabel = keybindingLabel; + this.actionContainer = append(parent, $4("div.action-container")); + this.actionContainer.setAttribute("tabindex", "0"); + this.action = append(this.actionContainer, $4("a.action")); + this.action.setAttribute("role", "button"); + if (actionOptions.iconClass) { + const iconElement = append(this.action, $4(`span.icon`)); + iconElement.classList.add(...actionOptions.iconClass.split(" ")); + } + this.actionRenderedLabel = keybindingLabel ? `${actionOptions.label} (${keybindingLabel})` : actionOptions.label; + const label = append(this.action, $4("span")); + label.textContent = this.actionRenderedLabel; + this._store.add(new ClickAction(this.actionContainer, actionOptions.run)); + this._store.add(new KeyDownAction(this.actionContainer, actionOptions.run, [ + 3, + 10 + /* KeyCode.Space */ + ])); + this.setEnabled(true); + } + setEnabled(enabled) { + if (enabled) { + this.actionContainer.classList.remove("disabled"); + this.actionContainer.removeAttribute("aria-disabled"); + } else { + this.actionContainer.classList.add("disabled"); + this.actionContainer.setAttribute("aria-disabled", "true"); + } + } +}; +function getHoverAccessibleViewHint(shouldHaveHint, keybinding) { + return shouldHaveHint && keybinding ? localize(7, "Inspect this in the accessible view with {0}.", keybinding) : shouldHaveHint ? localize(8, "Inspect this in the accessible view via the command Open Accessible View which is currently not triggerable via keybinding.") : ""; +} +var ClickAction = class extends Disposable { + constructor(container, run) { + super(); + this._register(addDisposableListener(container, EventType.CLICK, (e) => { + e.stopPropagation(); + e.preventDefault(); + run(container); + })); + } +}; +var KeyDownAction = class extends Disposable { + constructor(container, run, keyCodes) { + super(); + this._register(addDisposableListener(container, EventType.KEY_DOWN, (e) => { + const event = new StandardKeyboardEvent(e); + if (keyCodes.some((keyCode) => event.equals(keyCode))) { + e.stopPropagation(); + e.preventDefault(); + run(container); + } + })); + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/hover/browser/contentHoverWidget.js +init_event(); +var __decorate62 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param57 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var ContentHoverWidget_1; +var HORIZONTAL_SCROLLING_BY = 30; +var ContentHoverWidget = class ContentHoverWidget2 extends ResizableContentWidget { + static { + ContentHoverWidget_1 = this; + } + static { + this.ID = "editor.contrib.resizableContentHoverWidget"; + } + static { + this._lastDimensions = new Dimension(0, 0); + } + get isVisibleFromKeyboard() { + return this._renderedHover?.source === 2; + } + get isVisible() { + return this._hoverVisibleKey.get() ?? false; + } + get isFocused() { + return this._hoverFocusedKey.get() ?? false; + } + constructor(editor2, contextKeyService, _configurationService, _accessibilityService, _keybindingService) { + const minimumHeight = editor2.getOption( + 75 + /* EditorOption.lineHeight */ + ) + 8; + const minimumWidth = 150; + const minimumSize = new Dimension(minimumWidth, minimumHeight); + super(editor2, minimumSize); + this._configurationService = _configurationService; + this._accessibilityService = _accessibilityService; + this._keybindingService = _keybindingService; + this._hover = this._register(new HoverWidget(true)); + this._onDidResize = this._register(new Emitter()); + this.onDidResize = this._onDidResize.event; + this._onDidScroll = this._register(new Emitter()); + this.onDidScroll = this._onDidScroll.event; + this._onContentsChanged = this._register(new Emitter()); + this.onContentsChanged = this._onContentsChanged.event; + this._minimumSize = minimumSize; + this._hoverVisibleKey = EditorContextKeys.hoverVisible.bindTo(contextKeyService); + this._hoverFocusedKey = EditorContextKeys.hoverFocused.bindTo(contextKeyService); + append(this._resizableNode.domNode, this._hover.containerDomNode); + this._resizableNode.domNode.style.zIndex = "50"; + this._resizableNode.domNode.className = "monaco-resizable-hover"; + this._register(this._editor.onDidLayoutChange(() => { + if (this.isVisible) { + this._updateMaxDimensions(); + } + })); + this._register(this._editor.onDidChangeConfiguration((e) => { + if (e.hasChanged( + 59 + /* EditorOption.fontInfo */ + )) { + this._updateFont(); + } + })); + const focusTracker = this._register(trackFocus(this._resizableNode.domNode)); + this._register(focusTracker.onDidFocus(() => { + this._hoverFocusedKey.set(true); + })); + this._register(focusTracker.onDidBlur(() => { + this._hoverFocusedKey.set(false); + })); + this._register(this._hover.scrollbar.onScroll((e) => { + this._onDidScroll.fire(e); + })); + this._setRenderedHover(void 0); + this._editor.addContentWidget(this); + } + dispose() { + super.dispose(); + this._renderedHover?.dispose(); + this._editor.removeContentWidget(this); + } + getId() { + return ContentHoverWidget_1.ID; + } + static _applyDimensions(container, width2, height) { + const transformedWidth = typeof width2 === "number" ? `${width2}px` : width2; + const transformedHeight = typeof height === "number" ? `${height}px` : height; + container.style.width = transformedWidth; + container.style.height = transformedHeight; + } + _setContentsDomNodeDimensions(width2, height) { + const contentsDomNode = this._hover.contentsDomNode; + return ContentHoverWidget_1._applyDimensions(contentsDomNode, width2, height); + } + _setContainerDomNodeDimensions(width2, height) { + const containerDomNode = this._hover.containerDomNode; + return ContentHoverWidget_1._applyDimensions(containerDomNode, width2, height); + } + _setScrollableElementDimensions(width2, height) { + const scrollbarDomElement = this._hover.scrollbar.getDomNode(); + return ContentHoverWidget_1._applyDimensions(scrollbarDomElement, width2, height); + } + _setHoverWidgetDimensions(width2, height) { + this._setContainerDomNodeDimensions(width2, height); + this._setScrollableElementDimensions(width2, height); + this._setContentsDomNodeDimensions(width2, height); + this._layoutContentWidget(); + } + static _applyMaxDimensions(container, width2, height) { + const transformedWidth = typeof width2 === "number" ? `${width2}px` : width2; + const transformedHeight = typeof height === "number" ? `${height}px` : height; + container.style.maxWidth = transformedWidth; + container.style.maxHeight = transformedHeight; + } + _setHoverWidgetMaxDimensions(width2, height) { + ContentHoverWidget_1._applyMaxDimensions(this._hover.contentsDomNode, width2, height); + ContentHoverWidget_1._applyMaxDimensions(this._hover.scrollbar.getDomNode(), width2, height); + ContentHoverWidget_1._applyMaxDimensions(this._hover.containerDomNode, width2, height); + this._hover.containerDomNode.style.setProperty("--vscode-hover-maxWidth", typeof width2 === "number" ? `${width2}px` : width2); + this._layoutContentWidget(); + } + _setAdjustedHoverWidgetDimensions(size2) { + this._setHoverWidgetMaxDimensions("none", "none"); + this._setHoverWidgetDimensions(size2.width, size2.height); + } + _updateResizableNodeMaxDimensions() { + const maxRenderingWidth = this._findMaximumRenderingWidth() ?? Infinity; + const maxRenderingHeight = this._findMaximumRenderingHeight() ?? Infinity; + this._resizableNode.maxSize = new Dimension(maxRenderingWidth, maxRenderingHeight); + this._setHoverWidgetMaxDimensions(maxRenderingWidth, maxRenderingHeight); + } + _resize(size2) { + ContentHoverWidget_1._lastDimensions = new Dimension(size2.width, size2.height); + this._setAdjustedHoverWidgetDimensions(size2); + this._resizableNode.layout(size2.height, size2.width); + this._updateResizableNodeMaxDimensions(); + this._hover.scrollbar.scanDomNode(); + this._editor.layoutContentWidget(this); + this._onDidResize.fire(); + } + _findAvailableSpaceVertically() { + const position = this._renderedHover?.showAtPosition; + if (!position) { + return; + } + return this._positionPreference === 1 ? this._availableVerticalSpaceAbove(position) : this._availableVerticalSpaceBelow(position); + } + _findMaximumRenderingHeight() { + const availableSpace = this._findAvailableSpaceVertically(); + if (!availableSpace) { + return; + } + const children = this._hover.contentsDomNode.children; + let maximumHeight = children.length - 1; + Array.from(this._hover.contentsDomNode.children).forEach((hoverPart) => { + maximumHeight += hoverPart.clientHeight; + }); + return Math.min(availableSpace, maximumHeight); + } + _isHoverTextOverflowing() { + this._hover.containerDomNode.style.setProperty("--vscode-hover-whiteSpace", "nowrap"); + this._hover.containerDomNode.style.setProperty("--vscode-hover-sourceWhiteSpace", "nowrap"); + const overflowing = Array.from(this._hover.contentsDomNode.children).some((hoverElement) => { + return hoverElement.scrollWidth > hoverElement.clientWidth; + }); + this._hover.containerDomNode.style.removeProperty("--vscode-hover-whiteSpace"); + this._hover.containerDomNode.style.removeProperty("--vscode-hover-sourceWhiteSpace"); + return overflowing; + } + _findMaximumRenderingWidth() { + if (!this._editor || !this._editor.hasModel()) { + return; + } + const overflowing = this._isHoverTextOverflowing(); + const initialWidth = typeof this._contentWidth === "undefined" ? 0 : this._contentWidth; + if (overflowing || this._hover.containerDomNode.clientWidth < initialWidth) { + const bodyBoxWidth = getClientArea(this._hover.containerDomNode.ownerDocument.body).width; + const horizontalPadding = 14; + return bodyBoxWidth - horizontalPadding; + } else { + return this._hover.containerDomNode.clientWidth; + } + } + isMouseGettingCloser(posx, posy) { + if (!this._renderedHover) { + return false; + } + if (this._renderedHover.initialMousePosX === void 0 || this._renderedHover.initialMousePosY === void 0) { + this._renderedHover.initialMousePosX = posx; + this._renderedHover.initialMousePosY = posy; + return false; + } + const widgetRect = getDomNodePagePosition(this.getDomNode()); + if (this._renderedHover.closestMouseDistance === void 0) { + this._renderedHover.closestMouseDistance = computeDistanceFromPointToRectangle(this._renderedHover.initialMousePosX, this._renderedHover.initialMousePosY, widgetRect.left, widgetRect.top, widgetRect.width, widgetRect.height); + } + const distance = computeDistanceFromPointToRectangle(posx, posy, widgetRect.left, widgetRect.top, widgetRect.width, widgetRect.height); + if (distance > this._renderedHover.closestMouseDistance + 4) { + return false; + } + this._renderedHover.closestMouseDistance = Math.min(this._renderedHover.closestMouseDistance, distance); + return true; + } + _setRenderedHover(renderedHover) { + this._renderedHover?.dispose(); + this._renderedHover = renderedHover; + this._hoverVisibleKey.set(!!renderedHover); + this._hover.containerDomNode.classList.toggle("hidden", !renderedHover); + } + _updateFont() { + const { fontSize, lineHeight } = this._editor.getOption( + 59 + /* EditorOption.fontInfo */ + ); + const contentsDomNode = this._hover.contentsDomNode; + contentsDomNode.style.fontSize = `${fontSize}px`; + contentsDomNode.style.lineHeight = `${lineHeight / fontSize}`; + const codeClasses = Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")); + codeClasses.forEach((node) => this._editor.applyFontInfo(node)); + } + _updateContent(node) { + const contentsDomNode = this._hover.contentsDomNode; + contentsDomNode.style.paddingBottom = ""; + contentsDomNode.textContent = ""; + contentsDomNode.appendChild(node); + } + _layoutContentWidget() { + this._editor.layoutContentWidget(this); + this._hover.onContentsChanged(); + } + _updateMaxDimensions() { + const height = Math.max(this._editor.getLayoutInfo().height / 4, 250, ContentHoverWidget_1._lastDimensions.height); + const width2 = Math.max(this._editor.getLayoutInfo().width * 0.66, 750, ContentHoverWidget_1._lastDimensions.width); + this._resizableNode.maxSize = new Dimension(width2, height); + this._setHoverWidgetMaxDimensions(width2, height); + } + _render(renderedHover) { + this._setRenderedHover(renderedHover); + this._updateFont(); + this._updateContent(renderedHover.domNode); + this.handleContentsChanged(); + this._editor.render(); + } + getPosition() { + if (!this._renderedHover) { + return null; + } + return { + position: this._renderedHover.showAtPosition, + secondaryPosition: this._renderedHover.showAtSecondaryPosition, + positionAffinity: this._renderedHover.shouldAppearBeforeContent ? 3 : void 0, + preference: [ + this._positionPreference ?? 1 + /* ContentWidgetPositionPreference.ABOVE */ + ] + }; + } + show(renderedHover) { + if (!this._editor || !this._editor.hasModel()) { + return; + } + this._render(renderedHover); + const widgetHeight = getTotalHeight(this._hover.containerDomNode); + const widgetPosition = renderedHover.showAtPosition; + this._positionPreference = this._findPositionPreference(widgetHeight, widgetPosition) ?? 1; + this.handleContentsChanged(); + if (renderedHover.shouldFocus) { + this._hover.containerDomNode.focus(); + } + this._onDidResize.fire(); + const hoverFocused = this._hover.containerDomNode.ownerDocument.activeElement === this._hover.containerDomNode; + const accessibleViewHint = hoverFocused && getHoverAccessibleViewHint(this._configurationService.getValue("accessibility.verbosity.hover") === true && this._accessibilityService.isScreenReaderOptimized(), this._keybindingService.lookupKeybinding("editor.action.accessibleView")?.getAriaLabel() ?? ""); + if (accessibleViewHint) { + this._hover.contentsDomNode.ariaLabel = this._hover.contentsDomNode.textContent + ", " + accessibleViewHint; + } + } + hide() { + if (!this._renderedHover) { + return; + } + const hoverStoleFocus = this._renderedHover.shouldFocus || this._hoverFocusedKey.get(); + this._setRenderedHover(void 0); + this._resizableNode.maxSize = new Dimension(Infinity, Infinity); + this._resizableNode.clearSashHoverState(); + this._hoverFocusedKey.set(false); + this._editor.layoutContentWidget(this); + if (hoverStoleFocus) { + this._editor.focus(); + } + } + _removeConstraintsRenderNormally() { + const layoutInfo = this._editor.getLayoutInfo(); + this._resizableNode.layout(layoutInfo.height, layoutInfo.width); + this._setHoverWidgetDimensions("auto", "auto"); + this._updateMaxDimensions(); + } + setMinimumDimensions(dimensions) { + this._minimumSize = new Dimension(Math.max(this._minimumSize.width, dimensions.width), Math.max(this._minimumSize.height, dimensions.height)); + this._updateMinimumWidth(); + } + _updateMinimumWidth() { + const width2 = typeof this._contentWidth === "undefined" ? this._minimumSize.width : Math.min(this._contentWidth, this._minimumSize.width); + this._resizableNode.minSize = new Dimension(width2, this._minimumSize.height); + } + handleContentsChanged() { + this._removeConstraintsRenderNormally(); + const contentsDomNode = this._hover.contentsDomNode; + let height = getTotalHeight(contentsDomNode); + let width2 = getTotalWidth(contentsDomNode) + 2; + this._resizableNode.layout(height, width2); + this._setHoverWidgetDimensions(width2, height); + height = getTotalHeight(contentsDomNode); + width2 = getTotalWidth(contentsDomNode); + this._contentWidth = width2; + this._updateMinimumWidth(); + this._resizableNode.layout(height, width2); + if (this._renderedHover?.showAtPosition) { + const widgetHeight = getTotalHeight(this._hover.containerDomNode); + this._positionPreference = this._findPositionPreference(widgetHeight, this._renderedHover.showAtPosition); + } + this._layoutContentWidget(); + this._onContentsChanged.fire(); + } + focus() { + this._hover.containerDomNode.focus(); + } + scrollUp() { + const scrollTop = this._hover.scrollbar.getScrollPosition().scrollTop; + const fontInfo = this._editor.getOption( + 59 + /* EditorOption.fontInfo */ + ); + this._hover.scrollbar.setScrollPosition({ scrollTop: scrollTop - fontInfo.lineHeight }); + } + scrollDown() { + const scrollTop = this._hover.scrollbar.getScrollPosition().scrollTop; + const fontInfo = this._editor.getOption( + 59 + /* EditorOption.fontInfo */ + ); + this._hover.scrollbar.setScrollPosition({ scrollTop: scrollTop + fontInfo.lineHeight }); + } + scrollLeft() { + const scrollLeft = this._hover.scrollbar.getScrollPosition().scrollLeft; + this._hover.scrollbar.setScrollPosition({ scrollLeft: scrollLeft - HORIZONTAL_SCROLLING_BY }); + } + scrollRight() { + const scrollLeft = this._hover.scrollbar.getScrollPosition().scrollLeft; + this._hover.scrollbar.setScrollPosition({ scrollLeft: scrollLeft + HORIZONTAL_SCROLLING_BY }); + } + pageUp() { + const scrollTop = this._hover.scrollbar.getScrollPosition().scrollTop; + const scrollHeight = this._hover.scrollbar.getScrollDimensions().height; + this._hover.scrollbar.setScrollPosition({ scrollTop: scrollTop - scrollHeight }); + } + pageDown() { + const scrollTop = this._hover.scrollbar.getScrollPosition().scrollTop; + const scrollHeight = this._hover.scrollbar.getScrollDimensions().height; + this._hover.scrollbar.setScrollPosition({ scrollTop: scrollTop + scrollHeight }); + } + goToTop() { + this._hover.scrollbar.setScrollPosition({ scrollTop: 0 }); + } + goToBottom() { + this._hover.scrollbar.setScrollPosition({ scrollTop: this._hover.scrollbar.getScrollDimensions().scrollHeight }); + } +}; +ContentHoverWidget = ContentHoverWidget_1 = __decorate62([ + __param57(1, IContextKeyService), + __param57(2, IConfigurationService), + __param57(3, IAccessibilityService), + __param57(4, IKeybindingService) +], ContentHoverWidget); +function computeDistanceFromPointToRectangle(pointX, pointY, left, top, width2, height) { + const x = left + width2 / 2; + const y = top + height / 2; + const dx = Math.max(Math.abs(pointX - x) - width2 / 2, 0); + const dy = Math.max(Math.abs(pointY - y) - height / 2, 0); + return Math.sqrt(dx * dx + dy * dy); +} + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/hover/browser/contentHoverComputer.js +init_arrays(); +init_async(); +var ContentHoverComputer = class _ContentHoverComputer { + constructor(_editor, _participants) { + this._editor = _editor; + this._participants = _participants; + } + static _getLineDecorations(editor2, anchor) { + if (anchor.type !== 1 && !anchor.supportsMarkerHover) { + return []; + } + const model = editor2.getModel(); + const lineNumber = anchor.range.startLineNumber; + if (lineNumber > model.getLineCount()) { + return []; + } + const maxColumn = model.getLineMaxColumn(lineNumber); + return editor2.getLineDecorations(lineNumber).filter((d) => { + if (d.options.isWholeLine) { + return true; + } + const startColumn = d.range.startLineNumber === lineNumber ? d.range.startColumn : 1; + const endColumn = d.range.endLineNumber === lineNumber ? d.range.endColumn : maxColumn; + if (d.options.showIfCollapsed) { + if (startColumn > anchor.range.startColumn + 1 || anchor.range.endColumn - 1 > endColumn) { + return false; + } + } else { + if (startColumn > anchor.range.startColumn || anchor.range.endColumn > endColumn) { + return false; + } + } + return true; + }); + } + computeAsync(options2, token) { + const anchor = options2.anchor; + if (!this._editor.hasModel() || !anchor) { + return AsyncIterableProducer.EMPTY; + } + const lineDecorations = _ContentHoverComputer._getLineDecorations(this._editor, anchor); + return AsyncIterableProducer.merge(this._participants.map((participant) => { + if (!participant.computeAsync) { + return AsyncIterableProducer.EMPTY; + } + return participant.computeAsync(anchor, lineDecorations, options2.source, token); + })); + } + computeSync(options2) { + if (!this._editor.hasModel()) { + return []; + } + const anchor = options2.anchor; + const lineDecorations = _ContentHoverComputer._getLineDecorations(this._editor, anchor); + let result = []; + for (const participant of this._participants) { + result = result.concat(participant.computeSync(anchor, lineDecorations, options2.source)); + } + return coalesce(result); + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/hover/browser/contentHoverTypes.js +var ContentHoverResult = class { + constructor(hoverParts, isComplete, options2) { + this.hoverParts = hoverParts; + this.isComplete = isComplete; + this.options = options2; + } + filter(anchor) { + const filteredHoverParts = this.hoverParts.filter((m) => m.isValidForHoverAnchor(anchor)); + if (filteredHoverParts.length === this.hoverParts.length) { + return this; + } + return new FilteredContentHoverResult(this, filteredHoverParts, this.isComplete, this.options); + } +}; +var FilteredContentHoverResult = class extends ContentHoverResult { + constructor(original, messages, isComplete, options2) { + super(messages, isComplete, options2); + this.original = original; + } + filter(anchor) { + return this.original.filter(anchor); + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/hover/browser/contentHoverWidgetWrapper.js +init_event(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/hover/browser/contentHoverRendered.js +init_lifecycle(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/hover/browser/contentHoverStatusBar.js +init_dom(); +init_lifecycle(); +var __decorate63 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param58 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var $5 = $; +var EditorHoverStatusBar = class EditorHoverStatusBar2 extends Disposable { + get hasContent() { + return this._hasContent; + } + constructor(_keybindingService, _hoverService) { + super(); + this._keybindingService = _keybindingService; + this._hoverService = _hoverService; + this.actions = []; + this._hasContent = false; + this.hoverElement = $5("div.hover-row.status-bar"); + this.hoverElement.tabIndex = 0; + this.actionsElement = append(this.hoverElement, $5("div.actions")); + } + addAction(actionOptions) { + const keybinding = this._keybindingService.lookupKeybinding(actionOptions.commandId); + const keybindingLabel = keybinding ? keybinding.getLabel() : null; + this._hasContent = true; + const action = this._register(HoverAction.render(this.actionsElement, actionOptions, keybindingLabel)); + this._register(this._hoverService.setupManagedHover(getDefaultHoverDelegate("element"), action.actionContainer, action.actionRenderedLabel)); + this.actions.push(action); + return action; + } + append(element) { + const result = append(this.actionsElement, element); + this._hasContent = true; + return result; + } +}; +EditorHoverStatusBar = __decorate63([ + __param58(0, IKeybindingService), + __param58(1, IHoverService) +], EditorHoverStatusBar); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/hover/browser/hoverCopyButton.js +init_lifecycle(); +init_nls(); +init_codicons(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/find/browser/findWidget.js +init_dom(); + +// node_modules/monaco-editor-core/esm/vs/base/browser/ui/toggle/toggle.js +init_codicons(); +init_event(); +init_themables(); +var unthemedToggleStyles = { + inputActiveOptionBorder: "#007ACC00", + inputActiveOptionForeground: "#FFFFFF", + inputActiveOptionBackground: "#0E639C50" +}; +var Toggle = class extends Widget { + get onChange() { + return this._onChange.event; + } + get onKeyDown() { + return this._onKeyDown.event; + } + constructor(opts) { + super(); + this._onChange = this._register(new Emitter()); + this._onKeyDown = this._register(new Emitter()); + this._opts = opts; + this._title = this._opts.title; + this._checked = this._opts.isChecked; + const classes2 = ["monaco-custom-toggle"]; + if (this._opts.icon) { + this._icon = this._opts.icon; + classes2.push(...ThemeIcon.asClassNameArray(this._icon)); + } + if (this._opts.actionClassName) { + classes2.push(...this._opts.actionClassName.split(" ")); + } + if (this._checked) { + classes2.push("checked"); + } + this.domNode = document.createElement("div"); + this._register(getBaseLayerHoverDelegate().setupDelayedHover(this.domNode, () => ({ + content: this._title, + style: 1 + }), this._opts.hoverLifecycleOptions)); + this.domNode.classList.add(...classes2); + if (!this._opts.notFocusable) { + this.domNode.tabIndex = 0; + } + this.domNode.setAttribute("role", "checkbox"); + this.domNode.setAttribute("aria-checked", String(this._checked)); + this.setTitle(this._opts.title); + this.applyStyles(); + this.onclick(this.domNode, (ev) => { + if (this.enabled) { + this.checked = !this._checked; + this._onChange.fire(false); + ev.preventDefault(); + } + }); + this._register(this.ignoreGesture(this.domNode)); + this.onkeydown(this.domNode, (keyboardEvent) => { + if (!this.enabled) { + return; + } + if (keyboardEvent.keyCode === 10 || keyboardEvent.keyCode === 3) { + this.checked = !this._checked; + this._onChange.fire(true); + keyboardEvent.preventDefault(); + keyboardEvent.stopPropagation(); + return; + } + this._onKeyDown.fire(keyboardEvent); + }); + } + get enabled() { + return this.domNode.getAttribute("aria-disabled") !== "true"; + } + focus() { + this.domNode.focus(); + } + get checked() { + return this._checked; + } + set checked(newIsChecked) { + this._checked = newIsChecked; + this.domNode.setAttribute("aria-checked", String(this._checked)); + this.domNode.classList.toggle("checked", this._checked); + this.applyStyles(); + } + setIcon(icon) { + if (this._icon) { + this.domNode.classList.remove(...ThemeIcon.asClassNameArray(this._icon)); + } + this._icon = icon; + if (this._icon) { + this.domNode.classList.add(...ThemeIcon.asClassNameArray(this._icon)); + } + } + width() { + return 2 + 2 + 2 + 16; + } + applyStyles() { + if (this.domNode) { + this.domNode.style.borderColor = this._checked && this._opts.inputActiveOptionBorder || ""; + this.domNode.style.color = this._checked && this._opts.inputActiveOptionForeground || "inherit"; + this.domNode.style.backgroundColor = this._checked && this._opts.inputActiveOptionBackground || ""; + } + } + enable() { + this.domNode.setAttribute("aria-disabled", String(false)); + this.domNode.classList.remove("disabled"); + } + disable() { + this.domNode.setAttribute("aria-disabled", String(true)); + this.domNode.classList.add("disabled"); + } + setTitle(newTitle) { + this._title = newTitle; + this.domNode.setAttribute("aria-label", newTitle); + } + set visible(visible) { + this.domNode.style.display = visible ? "" : "none"; + } + get visible() { + return this.domNode.style.display !== "none"; + } +}; +var BaseCheckbox = class extends Widget { + static { + this.CLASS_NAME = "monaco-checkbox"; + } + constructor(checkbox, domNode, styles) { + super(); + this.checkbox = checkbox; + this.domNode = domNode; + this.styles = styles; + this._onChange = this._register(new Emitter()); + this.onChange = this._onChange.event; + this.applyStyles(); + } + get enabled() { + return this.checkbox.enabled; + } + enable() { + this.checkbox.enable(); + this.applyStyles(true); + } + disable() { + this.checkbox.disable(); + this.applyStyles(false); + } + setTitle(newTitle) { + this.checkbox.setTitle(newTitle); + } + applyStyles(enabled = this.enabled) { + this.domNode.style.color = (enabled ? this.styles.checkboxForeground : this.styles.checkboxDisabledForeground) || ""; + this.domNode.style.backgroundColor = (enabled ? this.styles.checkboxBackground : this.styles.checkboxDisabledBackground) || ""; + this.domNode.style.borderColor = (enabled ? this.styles.checkboxBorder : this.styles.checkboxDisabledBackground) || ""; + const size2 = this.styles.size || 18; + this.domNode.style.width = this.domNode.style.height = this.domNode.style.fontSize = `${size2}px`; + this.domNode.style.fontSize = `${size2 - 2}px`; + } +}; +var Checkbox = class extends BaseCheckbox { + constructor(title, isChecked, styles) { + const toggle = new Toggle({ title, isChecked, icon: Codicon.check, actionClassName: BaseCheckbox.CLASS_NAME, hoverLifecycleOptions: styles.hoverLifecycleOptions, ...unthemedToggleStyles }); + super(toggle, toggle.domNode, styles); + this._register(toggle); + this._register(this.checkbox.onChange((keyboard) => { + this.applyStyles(); + this._onChange.fire(keyboard); + })); + } + get checked() { + return this.checkbox.checked; + } + set checked(newIsChecked) { + this.checkbox.checked = newIsChecked; + this.applyStyles(); + } + applyStyles(enabled) { + if (this.checkbox.checked) { + this.checkbox.setIcon(Codicon.check); + } else { + this.checkbox.setIcon(void 0); + } + super.applyStyles(enabled); + } +}; +var TriStateCheckbox = class extends BaseCheckbox { + constructor(title, _state, styles) { + let icon; + switch (_state) { + case true: + icon = Codicon.check; + break; + case "mixed": + icon = Codicon.dash; + break; + case false: + icon = void 0; + break; + } + const checkbox = new Toggle({ + title, + isChecked: _state === true, + icon, + actionClassName: Checkbox.CLASS_NAME, + hoverLifecycleOptions: styles.hoverLifecycleOptions, + ...unthemedToggleStyles + }); + super(checkbox, checkbox.domNode, styles); + this._state = _state; + this._register(checkbox); + this._register(this.checkbox.onChange((keyboard) => { + this._state = this.checkbox.checked; + this.applyStyles(); + this._onChange.fire(keyboard); + })); + } + get checked() { + return this._state; + } + set checked(newState) { + if (this._state !== newState) { + this._state = newState; + this.checkbox.checked = newState === true; + this.applyStyles(); + } + } + applyStyles(enabled) { + switch (this._state) { + case true: + this.checkbox.setIcon(Codicon.check); + break; + case "mixed": + this.checkbox.setIcon(Codicon.dash); + break; + case false: + this.checkbox.setIcon(void 0); + break; + } + super.applyStyles(enabled); + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/find/browser/findWidget.js +init_async(); +init_codicons(); +init_errors(); +init_lifecycle(); +init_platform(); +init_strings(); +init_range(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/find/browser/findModel.js +init_arraysFind(); +init_async(); +init_lifecycle(); +init_position(); +init_range(); +init_selection(); +init_textModelSearch(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/find/browser/findDecorations.js +init_range(); +init_model2(); +init_textModel(); +init_colorRegistry(); +init_themeService(); +var FindDecorations = class _FindDecorations { + constructor(editor2) { + this._editor = editor2; + this._decorations = []; + this._overviewRulerApproximateDecorations = []; + this._findScopeDecorationIds = []; + this._rangeHighlightDecorationId = null; + this._highlightedDecorationId = null; + this._startPosition = this._editor.getPosition(); + } + dispose() { + this._editor.removeDecorations(this._allDecorations()); + this._decorations = []; + this._overviewRulerApproximateDecorations = []; + this._findScopeDecorationIds = []; + this._rangeHighlightDecorationId = null; + this._highlightedDecorationId = null; + } + reset() { + this._decorations = []; + this._overviewRulerApproximateDecorations = []; + this._findScopeDecorationIds = []; + this._rangeHighlightDecorationId = null; + this._highlightedDecorationId = null; + } + getCount() { + return this._decorations.length; + } + /** @deprecated use getFindScopes to support multiple selections */ + getFindScope() { + if (this._findScopeDecorationIds[0]) { + return this._editor.getModel().getDecorationRange(this._findScopeDecorationIds[0]); + } + return null; + } + getFindScopes() { + if (this._findScopeDecorationIds.length) { + const scopes = this._findScopeDecorationIds.map((findScopeDecorationId) => this._editor.getModel().getDecorationRange(findScopeDecorationId)).filter((element) => !!element); + if (scopes.length) { + return scopes; + } + } + return null; + } + getStartPosition() { + return this._startPosition; + } + setStartPosition(newStartPosition) { + this._startPosition = newStartPosition; + this.setCurrentFindMatch(null); + } + _getDecorationIndex(decorationId) { + const index = this._decorations.indexOf(decorationId); + if (index >= 0) { + return index + 1; + } + return 1; + } + getDecorationRangeAt(index) { + const decorationId = index < this._decorations.length ? this._decorations[index] : null; + if (decorationId) { + return this._editor.getModel().getDecorationRange(decorationId); + } + return null; + } + getCurrentMatchesPosition(desiredRange) { + const candidates = this._editor.getModel().getDecorationsInRange(desiredRange); + for (const candidate of candidates) { + const candidateOpts = candidate.options; + if (candidateOpts === _FindDecorations._FIND_MATCH_DECORATION || candidateOpts === _FindDecorations._CURRENT_FIND_MATCH_DECORATION) { + return this._getDecorationIndex(candidate.id); + } + } + return 0; + } + setCurrentFindMatch(nextMatch) { + let newCurrentDecorationId = null; + let matchPosition = 0; + if (nextMatch) { + for (let i2 = 0, len = this._decorations.length; i2 < len; i2++) { + const range2 = this._editor.getModel().getDecorationRange(this._decorations[i2]); + if (nextMatch.equalsRange(range2)) { + newCurrentDecorationId = this._decorations[i2]; + matchPosition = i2 + 1; + break; + } + } + } + if (this._highlightedDecorationId !== null || newCurrentDecorationId !== null) { + this._editor.changeDecorations((changeAccessor) => { + if (this._highlightedDecorationId !== null) { + changeAccessor.changeDecorationOptions(this._highlightedDecorationId, _FindDecorations._FIND_MATCH_DECORATION); + this._highlightedDecorationId = null; + } + if (newCurrentDecorationId !== null) { + this._highlightedDecorationId = newCurrentDecorationId; + changeAccessor.changeDecorationOptions(this._highlightedDecorationId, _FindDecorations._CURRENT_FIND_MATCH_DECORATION); + } + if (this._rangeHighlightDecorationId !== null) { + changeAccessor.removeDecoration(this._rangeHighlightDecorationId); + this._rangeHighlightDecorationId = null; + } + if (newCurrentDecorationId !== null) { + let rng = this._editor.getModel().getDecorationRange(newCurrentDecorationId); + if (rng.startLineNumber !== rng.endLineNumber && rng.endColumn === 1) { + const lineBeforeEnd = rng.endLineNumber - 1; + const lineBeforeEndMaxColumn = this._editor.getModel().getLineMaxColumn(lineBeforeEnd); + rng = new Range(rng.startLineNumber, rng.startColumn, lineBeforeEnd, lineBeforeEndMaxColumn); + } + this._rangeHighlightDecorationId = changeAccessor.addDecoration(rng, _FindDecorations._RANGE_HIGHLIGHT_DECORATION); + } + }); + } + return matchPosition; + } + set(findMatches, findScopes) { + this._editor.changeDecorations((accessor) => { + let findMatchesOptions = _FindDecorations._FIND_MATCH_DECORATION; + const newOverviewRulerApproximateDecorations = []; + if (findMatches.length > 1e3) { + findMatchesOptions = _FindDecorations._FIND_MATCH_NO_OVERVIEW_DECORATION; + const lineCount = this._editor.getModel().getLineCount(); + const height = this._editor.getLayoutInfo().height; + const approxPixelsPerLine = height / lineCount; + const mergeLinesDelta = Math.max(2, Math.ceil(3 / approxPixelsPerLine)); + let prevStartLineNumber = findMatches[0].range.startLineNumber; + let prevEndLineNumber = findMatches[0].range.endLineNumber; + for (let i2 = 1, len = findMatches.length; i2 < len; i2++) { + const range2 = findMatches[i2].range; + if (prevEndLineNumber + mergeLinesDelta >= range2.startLineNumber) { + if (range2.endLineNumber > prevEndLineNumber) { + prevEndLineNumber = range2.endLineNumber; + } + } else { + newOverviewRulerApproximateDecorations.push({ + range: new Range(prevStartLineNumber, 1, prevEndLineNumber, 1), + options: _FindDecorations._FIND_MATCH_ONLY_OVERVIEW_DECORATION + }); + prevStartLineNumber = range2.startLineNumber; + prevEndLineNumber = range2.endLineNumber; + } + } + newOverviewRulerApproximateDecorations.push({ + range: new Range(prevStartLineNumber, 1, prevEndLineNumber, 1), + options: _FindDecorations._FIND_MATCH_ONLY_OVERVIEW_DECORATION + }); + } + const newFindMatchesDecorations = new Array(findMatches.length); + for (let i2 = 0, len = findMatches.length; i2 < len; i2++) { + newFindMatchesDecorations[i2] = { + range: findMatches[i2].range, + options: findMatchesOptions + }; + } + this._decorations = accessor.deltaDecorations(this._decorations, newFindMatchesDecorations); + this._overviewRulerApproximateDecorations = accessor.deltaDecorations(this._overviewRulerApproximateDecorations, newOverviewRulerApproximateDecorations); + if (this._rangeHighlightDecorationId) { + accessor.removeDecoration(this._rangeHighlightDecorationId); + this._rangeHighlightDecorationId = null; + } + if (this._findScopeDecorationIds.length) { + this._findScopeDecorationIds.forEach((findScopeDecorationId) => accessor.removeDecoration(findScopeDecorationId)); + this._findScopeDecorationIds = []; + } + if (findScopes?.length) { + this._findScopeDecorationIds = findScopes.map((findScope) => accessor.addDecoration(findScope, _FindDecorations._FIND_SCOPE_DECORATION)); + } + }); + } + matchBeforePosition(position) { + if (this._decorations.length === 0) { + return null; + } + for (let i2 = this._decorations.length - 1; i2 >= 0; i2--) { + const decorationId = this._decorations[i2]; + const r = this._editor.getModel().getDecorationRange(decorationId); + if (!r || r.endLineNumber > position.lineNumber) { + continue; + } + if (r.endLineNumber < position.lineNumber) { + return r; + } + if (r.endColumn > position.column) { + continue; + } + return r; + } + return this._editor.getModel().getDecorationRange(this._decorations[this._decorations.length - 1]); + } + matchAfterPosition(position) { + if (this._decorations.length === 0) { + return null; + } + for (let i2 = 0, len = this._decorations.length; i2 < len; i2++) { + const decorationId = this._decorations[i2]; + const r = this._editor.getModel().getDecorationRange(decorationId); + if (!r || r.startLineNumber < position.lineNumber) { + continue; + } + if (r.startLineNumber > position.lineNumber) { + return r; + } + if (r.startColumn < position.column) { + continue; + } + return r; + } + return this._editor.getModel().getDecorationRange(this._decorations[0]); + } + _allDecorations() { + let result = []; + result = result.concat(this._decorations); + result = result.concat(this._overviewRulerApproximateDecorations); + if (this._findScopeDecorationIds.length) { + result.push(...this._findScopeDecorationIds); + } + if (this._rangeHighlightDecorationId) { + result.push(this._rangeHighlightDecorationId); + } + return result; + } + static { + this._CURRENT_FIND_MATCH_DECORATION = ModelDecorationOptions.register({ + description: "current-find-match", + stickiness: 1, + zIndex: 13, + className: "currentFindMatch", + inlineClassName: "currentFindMatchInline", + showIfCollapsed: true, + overviewRuler: { + color: themeColorFromId(overviewRulerFindMatchForeground), + position: OverviewRulerLane.Center + }, + minimap: { + color: themeColorFromId(minimapFindMatch), + position: 1 + /* MinimapPosition.Inline */ + } + }); + } + static { + this._FIND_MATCH_DECORATION = ModelDecorationOptions.register({ + description: "find-match", + stickiness: 1, + zIndex: 10, + className: "findMatch", + inlineClassName: "findMatchInline", + showIfCollapsed: true, + overviewRuler: { + color: themeColorFromId(overviewRulerFindMatchForeground), + position: OverviewRulerLane.Center + }, + minimap: { + color: themeColorFromId(minimapFindMatch), + position: 1 + /* MinimapPosition.Inline */ + } + }); + } + static { + this._FIND_MATCH_NO_OVERVIEW_DECORATION = ModelDecorationOptions.register({ + description: "find-match-no-overview", + stickiness: 1, + className: "findMatch", + showIfCollapsed: true + }); + } + static { + this._FIND_MATCH_ONLY_OVERVIEW_DECORATION = ModelDecorationOptions.register({ + description: "find-match-only-overview", + stickiness: 1, + overviewRuler: { + color: themeColorFromId(overviewRulerFindMatchForeground), + position: OverviewRulerLane.Center + } + }); + } + static { + this._RANGE_HIGHLIGHT_DECORATION = ModelDecorationOptions.register({ + description: "find-range-highlight", + stickiness: 1, + className: "rangeHighlight", + isWholeLine: true + }); + } + static { + this._FIND_SCOPE_DECORATION = ModelDecorationOptions.register({ + description: "find-scope", + className: "findScope", + isWholeLine: true + }); + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/find/browser/replaceAllCommand.js +init_range(); +var ReplaceAllCommand = class { + constructor(editorSelection, ranges, replaceStrings) { + this._editorSelection = editorSelection; + this._ranges = ranges; + this._replaceStrings = replaceStrings; + this._trackedEditorSelectionId = null; + } + getEditOperations(model, builder) { + if (this._ranges.length > 0) { + const ops = []; + for (let i2 = 0; i2 < this._ranges.length; i2++) { + ops.push({ + range: this._ranges[i2], + text: this._replaceStrings[i2] + }); + } + ops.sort((o1, o2) => { + return Range.compareRangesUsingStarts(o1.range, o2.range); + }); + const resultOps = []; + let previousOp = ops[0]; + for (let i2 = 1; i2 < ops.length; i2++) { + if (previousOp.range.endLineNumber === ops[i2].range.startLineNumber && previousOp.range.endColumn === ops[i2].range.startColumn) { + previousOp.range = previousOp.range.plusRange(ops[i2].range); + previousOp.text = previousOp.text + ops[i2].text; + } else { + resultOps.push(previousOp); + previousOp = ops[i2]; + } + } + resultOps.push(previousOp); + for (const op of resultOps) { + builder.addEditOperation(op.range, op.text); + } + } + this._trackedEditorSelectionId = builder.trackSelection(this._editorSelection); + } + computeCursorState(model, helper) { + return helper.getTrackedSelection(this._trackedEditorSelectionId); + } +}; + +// node_modules/monaco-editor-core/esm/vs/base/common/search.js +init_strings(); +function buildReplaceStringWithCasePreserved(matches, pattern) { + if (matches && matches[0] !== "") { + const containsHyphens = validateSpecificSpecialCharacter(matches, pattern, "-"); + const containsUnderscores = validateSpecificSpecialCharacter(matches, pattern, "_"); + if (containsHyphens && !containsUnderscores) { + return buildReplaceStringForSpecificSpecialCharacter(matches, pattern, "-"); + } else if (!containsHyphens && containsUnderscores) { + return buildReplaceStringForSpecificSpecialCharacter(matches, pattern, "_"); + } + if (matches[0].toUpperCase() === matches[0]) { + return pattern.toUpperCase(); + } else if (matches[0].toLowerCase() === matches[0]) { + return pattern.toLowerCase(); + } else if (containsUppercaseCharacter(matches[0][0]) && pattern.length > 0) { + return pattern[0].toUpperCase() + pattern.substr(1); + } else if (matches[0][0].toUpperCase() !== matches[0][0] && pattern.length > 0) { + return pattern[0].toLowerCase() + pattern.substr(1); + } else { + return pattern; + } + } else { + return pattern; + } +} +function validateSpecificSpecialCharacter(matches, pattern, specialCharacter) { + const doesContainSpecialCharacter = matches[0].indexOf(specialCharacter) !== -1 && pattern.indexOf(specialCharacter) !== -1; + return doesContainSpecialCharacter && matches[0].split(specialCharacter).length === pattern.split(specialCharacter).length; +} +function buildReplaceStringForSpecificSpecialCharacter(matches, pattern, specialCharacter) { + const splitPatternAtSpecialCharacter = pattern.split(specialCharacter); + const splitMatchAtSpecialCharacter = matches[0].split(specialCharacter); + let replaceString = ""; + splitPatternAtSpecialCharacter.forEach((splitValue, index) => { + replaceString += buildReplaceStringWithCasePreserved([splitMatchAtSpecialCharacter[index]], splitValue) + specialCharacter; + }); + return replaceString.slice(0, -1); +} + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/find/browser/replacePattern.js +var StaticValueReplacePattern = class { + constructor(staticValue) { + this.staticValue = staticValue; + this.kind = 0; + } +}; +var DynamicPiecesReplacePattern = class { + constructor(pieces) { + this.pieces = pieces; + this.kind = 1; + } +}; +var ReplacePattern = class _ReplacePattern { + static fromStaticValue(value) { + return new _ReplacePattern([ReplacePiece.staticValue(value)]); + } + get hasReplacementPatterns() { + return this._state.kind === 1; + } + constructor(pieces) { + if (!pieces || pieces.length === 0) { + this._state = new StaticValueReplacePattern(""); + } else if (pieces.length === 1 && pieces[0].staticValue !== null) { + this._state = new StaticValueReplacePattern(pieces[0].staticValue); + } else { + this._state = new DynamicPiecesReplacePattern(pieces); + } + } + buildReplaceString(matches, preserveCase) { + if (this._state.kind === 0) { + if (preserveCase) { + return buildReplaceStringWithCasePreserved(matches, this._state.staticValue); + } else { + return this._state.staticValue; + } + } + let result = ""; + for (let i2 = 0, len = this._state.pieces.length; i2 < len; i2++) { + const piece = this._state.pieces[i2]; + if (piece.staticValue !== null) { + result += piece.staticValue; + continue; + } + let match2 = _ReplacePattern._substitute(piece.matchIndex, matches); + if (piece.caseOps !== null && piece.caseOps.length > 0) { + const repl = []; + const lenOps = piece.caseOps.length; + let opIdx = 0; + for (let idx = 0, len2 = match2.length; idx < len2; idx++) { + if (opIdx >= lenOps) { + repl.push(match2.slice(idx)); + break; + } + switch (piece.caseOps[opIdx]) { + case "U": + repl.push(match2[idx].toUpperCase()); + break; + case "u": + repl.push(match2[idx].toUpperCase()); + opIdx++; + break; + case "L": + repl.push(match2[idx].toLowerCase()); + break; + case "l": + repl.push(match2[idx].toLowerCase()); + opIdx++; + break; + default: + repl.push(match2[idx]); + } + } + match2 = repl.join(""); + } + result += match2; + } + return result; + } + static _substitute(matchIndex, matches) { + if (matches === null) { + return ""; + } + if (matchIndex === 0) { + return matches[0]; + } + let remainder = ""; + while (matchIndex > 0) { + if (matchIndex < matches.length) { + const match2 = matches[matchIndex] || ""; + return match2 + remainder; + } + remainder = String(matchIndex % 10) + remainder; + matchIndex = Math.floor(matchIndex / 10); + } + return "$" + remainder; + } +}; +var ReplacePiece = class _ReplacePiece { + static staticValue(value) { + return new _ReplacePiece(value, -1, null); + } + static caseOps(index, caseOps) { + return new _ReplacePiece(null, index, caseOps); + } + constructor(staticValue, matchIndex, caseOps) { + this.staticValue = staticValue; + this.matchIndex = matchIndex; + if (!caseOps || caseOps.length === 0) { + this.caseOps = null; + } else { + this.caseOps = caseOps.slice(0); + } + } +}; +var ReplacePieceBuilder = class { + constructor(source) { + this._source = source; + this._lastCharIndex = 0; + this._result = []; + this._resultLen = 0; + this._currentStaticPiece = ""; + } + emitUnchanged(toCharIndex) { + this._emitStatic(this._source.substring(this._lastCharIndex, toCharIndex)); + this._lastCharIndex = toCharIndex; + } + emitStatic(value, toCharIndex) { + this._emitStatic(value); + this._lastCharIndex = toCharIndex; + } + _emitStatic(value) { + if (value.length === 0) { + return; + } + this._currentStaticPiece += value; + } + emitMatchIndex(index, toCharIndex, caseOps) { + if (this._currentStaticPiece.length !== 0) { + this._result[this._resultLen++] = ReplacePiece.staticValue(this._currentStaticPiece); + this._currentStaticPiece = ""; + } + this._result[this._resultLen++] = ReplacePiece.caseOps(index, caseOps); + this._lastCharIndex = toCharIndex; + } + finalize() { + this.emitUnchanged(this._source.length); + if (this._currentStaticPiece.length !== 0) { + this._result[this._resultLen++] = ReplacePiece.staticValue(this._currentStaticPiece); + this._currentStaticPiece = ""; + } + return new ReplacePattern(this._result); + } +}; +function parseReplaceString(replaceString) { + if (!replaceString || replaceString.length === 0) { + return new ReplacePattern(null); + } + const caseOps = []; + const result = new ReplacePieceBuilder(replaceString); + for (let i2 = 0, len = replaceString.length; i2 < len; i2++) { + const chCode = replaceString.charCodeAt(i2); + if (chCode === 92) { + i2++; + if (i2 >= len) { + break; + } + const nextChCode = replaceString.charCodeAt(i2); + switch (nextChCode) { + case 92: + result.emitUnchanged(i2 - 1); + result.emitStatic("\\", i2 + 1); + break; + case 110: + result.emitUnchanged(i2 - 1); + result.emitStatic("\n", i2 + 1); + break; + case 116: + result.emitUnchanged(i2 - 1); + result.emitStatic(" ", i2 + 1); + break; + // Case modification of string replacements, patterned after Boost, but only applied + // to the replacement text, not subsequent content. + case 117: + // \u => upper-cases one character. + case 85: + // \U => upper-cases ALL following characters. + case 108: + // \l => lower-cases one character. + case 76: + result.emitUnchanged(i2 - 1); + result.emitStatic("", i2 + 1); + caseOps.push(String.fromCharCode(nextChCode)); + break; + } + continue; + } + if (chCode === 36) { + i2++; + if (i2 >= len) { + break; + } + const nextChCode = replaceString.charCodeAt(i2); + if (nextChCode === 36) { + result.emitUnchanged(i2 - 1); + result.emitStatic("$", i2 + 1); + continue; + } + if (nextChCode === 48 || nextChCode === 38) { + result.emitUnchanged(i2 - 1); + result.emitMatchIndex(0, i2 + 1, caseOps); + caseOps.length = 0; + continue; + } + if (49 <= nextChCode && nextChCode <= 57) { + let matchIndex = nextChCode - 48; + if (i2 + 1 < len) { + const nextNextChCode = replaceString.charCodeAt(i2 + 1); + if (48 <= nextNextChCode && nextNextChCode <= 57) { + i2++; + matchIndex = matchIndex * 10 + (nextNextChCode - 48); + result.emitUnchanged(i2 - 2); + result.emitMatchIndex(matchIndex, i2 + 1, caseOps); + caseOps.length = 0; + continue; + } + } + result.emitUnchanged(i2 - 1); + result.emitMatchIndex(matchIndex, i2 + 1, caseOps); + caseOps.length = 0; + continue; + } + } + } + return result.finalize(); +} + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/find/browser/findModel.js +init_contextkey(); +var CONTEXT_FIND_WIDGET_VISIBLE = new RawContextKey("findWidgetVisible", false); +var CONTEXT_FIND_WIDGET_NOT_VISIBLE = CONTEXT_FIND_WIDGET_VISIBLE.toNegated(); +var CONTEXT_FIND_INPUT_FOCUSED = new RawContextKey("findInputFocussed", false); +var CONTEXT_REPLACE_INPUT_FOCUSED = new RawContextKey("replaceInputFocussed", false); +var ToggleCaseSensitiveKeybinding = { + primary: 512 | 33, + mac: { + primary: 2048 | 512 | 33 + /* KeyCode.KeyC */ + } +}; +var ToggleWholeWordKeybinding = { + primary: 512 | 53, + mac: { + primary: 2048 | 512 | 53 + /* KeyCode.KeyW */ + } +}; +var ToggleRegexKeybinding = { + primary: 512 | 48, + mac: { + primary: 2048 | 512 | 48 + /* KeyCode.KeyR */ + } +}; +var ToggleSearchScopeKeybinding = { + primary: 512 | 42, + mac: { + primary: 2048 | 512 | 42 + /* KeyCode.KeyL */ + } +}; +var TogglePreserveCaseKeybinding = { + primary: 512 | 46, + mac: { + primary: 2048 | 512 | 46 + /* KeyCode.KeyP */ + } +}; +var FIND_IDS = { + StartFindAction: "actions.find", + StartFindWithSelection: "actions.findWithSelection", + StartFindWithArgs: "editor.actions.findWithArgs", + NextMatchFindAction: "editor.action.nextMatchFindAction", + PreviousMatchFindAction: "editor.action.previousMatchFindAction", + GoToMatchFindAction: "editor.action.goToMatchFindAction", + NextSelectionMatchFindAction: "editor.action.nextSelectionMatchFindAction", + PreviousSelectionMatchFindAction: "editor.action.previousSelectionMatchFindAction", + StartFindReplaceAction: "editor.action.startFindReplaceAction", + CloseFindWidgetCommand: "closeFindWidget", + ToggleCaseSensitiveCommand: "toggleFindCaseSensitive", + ToggleWholeWordCommand: "toggleFindWholeWord", + ToggleRegexCommand: "toggleFindRegex", + ToggleSearchScopeCommand: "toggleFindInSelection", + TogglePreserveCaseCommand: "togglePreserveCase", + ReplaceOneAction: "editor.action.replaceOne", + ReplaceAllAction: "editor.action.replaceAll", + SelectAllMatchesAction: "editor.action.selectAllMatches" +}; +var MATCHES_LIMIT = 19999; +var RESEARCH_DELAY = 240; +var FindModelBoundToEditorModel = class _FindModelBoundToEditorModel { + constructor(editor2, state) { + this._toDispose = new DisposableStore(); + this._editor = editor2; + this._state = state; + this._isDisposed = false; + this._startSearchingTimer = new TimeoutTimer(); + this._decorations = new FindDecorations(editor2); + this._toDispose.add(this._decorations); + this._updateDecorationsScheduler = new RunOnceScheduler(() => { + if (!this._editor.hasModel()) { + return; + } + return this.research(false); + }, 100); + this._toDispose.add(this._updateDecorationsScheduler); + this._toDispose.add(this._editor.onDidChangeCursorPosition((e) => { + if (e.reason === 3 || e.reason === 5 || e.reason === 6) { + this._decorations.setStartPosition(this._editor.getPosition()); + } + })); + this._ignoreModelContentChanged = false; + this._toDispose.add(this._editor.onDidChangeModelContent((e) => { + if (this._ignoreModelContentChanged) { + return; + } + if (e.isFlush) { + this._decorations.reset(); + } + this._decorations.setStartPosition(this._editor.getPosition()); + this._updateDecorationsScheduler.schedule(); + })); + this._toDispose.add(this._state.onFindReplaceStateChange((e) => this._onStateChanged(e))); + this.research(false, this._state.searchScope); + } + dispose() { + this._isDisposed = true; + dispose(this._startSearchingTimer); + this._toDispose.dispose(); + } + _onStateChanged(e) { + if (this._isDisposed) { + return; + } + if (!this._editor.hasModel()) { + return; + } + if (e.searchString || e.isReplaceRevealed || e.isRegex || e.wholeWord || e.matchCase || e.searchScope) { + const model = this._editor.getModel(); + if (model.isTooLargeForSyncing()) { + this._startSearchingTimer.cancel(); + this._startSearchingTimer.setIfNotSet(() => { + if (e.searchScope) { + this.research(e.moveCursor, this._state.searchScope); + } else { + this.research(e.moveCursor); + } + }, RESEARCH_DELAY); + } else { + if (e.searchScope) { + this.research(e.moveCursor, this._state.searchScope); + } else { + this.research(e.moveCursor); + } + } + } + } + static _getSearchRange(model, findScope) { + if (findScope) { + return findScope; + } + return model.getFullModelRange(); + } + research(moveCursor, newFindScope) { + let findScopes = null; + if (typeof newFindScope !== "undefined") { + if (newFindScope !== null) { + if (!Array.isArray(newFindScope)) { + findScopes = [newFindScope]; + } else { + findScopes = newFindScope; + } + } + } else { + findScopes = this._decorations.getFindScopes(); + } + if (findScopes !== null) { + findScopes = findScopes.map((findScope) => { + if (findScope.startLineNumber !== findScope.endLineNumber) { + let endLineNumber = findScope.endLineNumber; + if (findScope.endColumn === 1) { + endLineNumber = endLineNumber - 1; + } + return new Range(findScope.startLineNumber, 1, endLineNumber, this._editor.getModel().getLineMaxColumn(endLineNumber)); + } + return findScope; + }); + } + const findMatches = this._findMatches(findScopes, false, MATCHES_LIMIT); + this._decorations.set(findMatches, findScopes); + const editorSelection = this._editor.getSelection(); + let currentMatchesPosition = this._decorations.getCurrentMatchesPosition(editorSelection); + if (currentMatchesPosition === 0 && findMatches.length > 0) { + const matchAfterSelection = findFirstIdxMonotonousOrArrLen(findMatches.map((match2) => match2.range), (range2) => Range.compareRangesUsingStarts(range2, editorSelection) >= 0); + currentMatchesPosition = matchAfterSelection > 0 ? matchAfterSelection - 1 + 1 : currentMatchesPosition; + } + this._state.changeMatchInfo(currentMatchesPosition, this._decorations.getCount(), void 0); + if (moveCursor && this._editor.getOption( + 50 + /* EditorOption.find */ + ).cursorMoveOnType) { + this._moveToNextMatch(this._decorations.getStartPosition()); + } + } + _hasMatches() { + return this._state.matchesCount > 0; + } + _cannotFind() { + if (!this._hasMatches()) { + const findScope = this._decorations.getFindScope(); + if (findScope) { + this._editor.revealRangeInCenterIfOutsideViewport( + findScope, + 0 + /* ScrollType.Smooth */ + ); + } + return true; + } + return false; + } + _setCurrentFindMatch(match2) { + const matchesPosition = this._decorations.setCurrentFindMatch(match2); + this._state.changeMatchInfo(matchesPosition, this._decorations.getCount(), match2); + this._editor.setSelection(match2); + this._editor.revealRangeInCenterIfOutsideViewport( + match2, + 0 + /* ScrollType.Smooth */ + ); + } + _prevSearchPosition(before) { + const isUsingLineStops = this._state.isRegex && (this._state.searchString.indexOf("^") >= 0 || this._state.searchString.indexOf("$") >= 0); + let { lineNumber, column } = before; + const model = this._editor.getModel(); + if (isUsingLineStops || column === 1) { + if (lineNumber === 1) { + lineNumber = model.getLineCount(); + } else { + lineNumber--; + } + column = model.getLineMaxColumn(lineNumber); + } else { + column--; + } + return new Position(lineNumber, column); + } + _moveToPrevMatch(before, isRecursed = false) { + if (!this._state.canNavigateBack()) { + const nextMatchRange = this._decorations.matchAfterPosition(before); + if (nextMatchRange) { + this._setCurrentFindMatch(nextMatchRange); + } + return; + } + if (this._decorations.getCount() < MATCHES_LIMIT) { + let prevMatchRange = this._decorations.matchBeforePosition(before); + if (prevMatchRange && prevMatchRange.isEmpty() && prevMatchRange.getStartPosition().equals(before)) { + before = this._prevSearchPosition(before); + prevMatchRange = this._decorations.matchBeforePosition(before); + } + if (prevMatchRange) { + this._setCurrentFindMatch(prevMatchRange); + } + return; + } + if (this._cannotFind()) { + return; + } + const findScope = this._decorations.getFindScope(); + const searchRange = _FindModelBoundToEditorModel._getSearchRange(this._editor.getModel(), findScope); + if (searchRange.getEndPosition().isBefore(before)) { + before = searchRange.getEndPosition(); + } + if (before.isBefore(searchRange.getStartPosition())) { + before = searchRange.getEndPosition(); + } + const { lineNumber, column } = before; + const model = this._editor.getModel(); + let position = new Position(lineNumber, column); + let prevMatch = model.findPreviousMatch(this._state.searchString, position, this._state.isRegex, this._state.matchCase, this._state.wholeWord ? this._editor.getOption( + 148 + /* EditorOption.wordSeparators */ + ) : null, false); + if (prevMatch && prevMatch.range.isEmpty() && prevMatch.range.getStartPosition().equals(position)) { + position = this._prevSearchPosition(position); + prevMatch = model.findPreviousMatch(this._state.searchString, position, this._state.isRegex, this._state.matchCase, this._state.wholeWord ? this._editor.getOption( + 148 + /* EditorOption.wordSeparators */ + ) : null, false); + } + if (!prevMatch) { + return; + } + if (!isRecursed && !searchRange.containsRange(prevMatch.range)) { + return this._moveToPrevMatch(prevMatch.range.getStartPosition(), true); + } + this._setCurrentFindMatch(prevMatch.range); + } + moveToPrevMatch() { + this._moveToPrevMatch(this._editor.getSelection().getStartPosition()); + } + _nextSearchPosition(after2) { + const isUsingLineStops = this._state.isRegex && (this._state.searchString.indexOf("^") >= 0 || this._state.searchString.indexOf("$") >= 0); + let { lineNumber, column } = after2; + const model = this._editor.getModel(); + if (isUsingLineStops || column === model.getLineMaxColumn(lineNumber)) { + if (lineNumber === model.getLineCount()) { + lineNumber = 1; + } else { + lineNumber++; + } + column = 1; + } else { + column++; + } + return new Position(lineNumber, column); + } + _moveToNextMatch(after2) { + if (!this._state.canNavigateForward()) { + const prevMatchRange = this._decorations.matchBeforePosition(after2); + if (prevMatchRange) { + this._setCurrentFindMatch(prevMatchRange); + } + return; + } + if (this._decorations.getCount() < MATCHES_LIMIT) { + let nextMatchRange = this._decorations.matchAfterPosition(after2); + if (nextMatchRange && nextMatchRange.isEmpty() && nextMatchRange.getStartPosition().equals(after2)) { + after2 = this._nextSearchPosition(after2); + nextMatchRange = this._decorations.matchAfterPosition(after2); + } + if (nextMatchRange) { + this._setCurrentFindMatch(nextMatchRange); + } + return; + } + const nextMatch = this._getNextMatch(after2, false, true); + if (nextMatch) { + this._setCurrentFindMatch(nextMatch.range); + } + } + _getNextMatch(after2, captureMatches, forceMove, isRecursed = false) { + if (this._cannotFind()) { + return null; + } + const findScope = this._decorations.getFindScope(); + const searchRange = _FindModelBoundToEditorModel._getSearchRange(this._editor.getModel(), findScope); + if (searchRange.getEndPosition().isBefore(after2)) { + after2 = searchRange.getStartPosition(); + } + if (after2.isBefore(searchRange.getStartPosition())) { + after2 = searchRange.getStartPosition(); + } + const { lineNumber, column } = after2; + const model = this._editor.getModel(); + let position = new Position(lineNumber, column); + let nextMatch = model.findNextMatch(this._state.searchString, position, this._state.isRegex, this._state.matchCase, this._state.wholeWord ? this._editor.getOption( + 148 + /* EditorOption.wordSeparators */ + ) : null, captureMatches); + if (forceMove && nextMatch && nextMatch.range.isEmpty() && nextMatch.range.getStartPosition().equals(position)) { + position = this._nextSearchPosition(position); + nextMatch = model.findNextMatch(this._state.searchString, position, this._state.isRegex, this._state.matchCase, this._state.wholeWord ? this._editor.getOption( + 148 + /* EditorOption.wordSeparators */ + ) : null, captureMatches); + } + if (!nextMatch) { + return null; + } + if (!isRecursed && !searchRange.containsRange(nextMatch.range)) { + return this._getNextMatch(nextMatch.range.getEndPosition(), captureMatches, forceMove, true); + } + return nextMatch; + } + moveToNextMatch() { + this._moveToNextMatch(this._editor.getSelection().getEndPosition()); + } + _moveToMatch(index) { + const decorationRange = this._decorations.getDecorationRangeAt(index); + if (decorationRange) { + this._setCurrentFindMatch(decorationRange); + } + } + moveToMatch(index) { + this._moveToMatch(index); + } + _getReplacePattern() { + if (this._state.isRegex) { + return parseReplaceString(this._state.replaceString); + } + return ReplacePattern.fromStaticValue(this._state.replaceString); + } + replace() { + if (!this._hasMatches()) { + return; + } + const replacePattern = this._getReplacePattern(); + const selection = this._editor.getSelection(); + const nextMatch = this._getNextMatch(selection.getStartPosition(), true, false); + if (nextMatch) { + if (selection.equalsRange(nextMatch.range)) { + const replaceString = replacePattern.buildReplaceString(nextMatch.matches, this._state.preserveCase); + const command = new ReplaceCommand(selection, replaceString); + this._executeEditorCommand("replace", command); + this._decorations.setStartPosition(new Position(selection.startLineNumber, selection.startColumn + replaceString.length)); + this.research(true); + } else { + this._decorations.setStartPosition(this._editor.getPosition()); + this._setCurrentFindMatch(nextMatch.range); + } + } + } + _findMatches(findScopes, captureMatches, limitResultCount) { + const searchRanges = (findScopes || [null]).map((scope) => _FindModelBoundToEditorModel._getSearchRange(this._editor.getModel(), scope)); + return this._editor.getModel().findMatches(this._state.searchString, searchRanges, this._state.isRegex, this._state.matchCase, this._state.wholeWord ? this._editor.getOption( + 148 + /* EditorOption.wordSeparators */ + ) : null, captureMatches, limitResultCount); + } + replaceAll() { + if (!this._hasMatches()) { + return; + } + const findScopes = this._decorations.getFindScopes(); + if (findScopes === null && this._state.matchesCount >= MATCHES_LIMIT) { + this._largeReplaceAll(); + } else { + this._regularReplaceAll(findScopes); + } + this.research(false); + } + _largeReplaceAll() { + const searchParams = new SearchParams(this._state.searchString, this._state.isRegex, this._state.matchCase, this._state.wholeWord ? this._editor.getOption( + 148 + /* EditorOption.wordSeparators */ + ) : null); + const searchData = searchParams.parseSearchRequest(); + if (!searchData) { + return; + } + let searchRegex = searchData.regex; + if (!searchRegex.multiline) { + let mod = "mu"; + if (searchRegex.ignoreCase) { + mod += "i"; + } + if (searchRegex.global) { + mod += "g"; + } + searchRegex = new RegExp(searchRegex.source, mod); + } + const model = this._editor.getModel(); + const modelText = model.getValue( + 1 + /* EndOfLinePreference.LF */ + ); + const fullModelRange = model.getFullModelRange(); + const replacePattern = this._getReplacePattern(); + let resultText; + const preserveCase = this._state.preserveCase; + if (replacePattern.hasReplacementPatterns || preserveCase) { + resultText = modelText.replace(searchRegex, function() { + return replacePattern.buildReplaceString(arguments, preserveCase); + }); + } else { + resultText = modelText.replace(searchRegex, replacePattern.buildReplaceString(null, preserveCase)); + } + const command = new ReplaceCommandThatPreservesSelection(fullModelRange, resultText, this._editor.getSelection()); + this._executeEditorCommand("replaceAll", command); + } + _regularReplaceAll(findScopes) { + const replacePattern = this._getReplacePattern(); + const matches = this._findMatches( + findScopes, + replacePattern.hasReplacementPatterns || this._state.preserveCase, + 1073741824 + /* Constants.MAX_SAFE_SMALL_INTEGER */ + ); + const replaceStrings = []; + for (let i2 = 0, len = matches.length; i2 < len; i2++) { + replaceStrings[i2] = replacePattern.buildReplaceString(matches[i2].matches, this._state.preserveCase); + } + const command = new ReplaceAllCommand(this._editor.getSelection(), matches.map((m) => m.range), replaceStrings); + this._executeEditorCommand("replaceAll", command); + } + selectAllMatches() { + if (!this._hasMatches()) { + return; + } + const findScopes = this._decorations.getFindScopes(); + const matches = this._findMatches( + findScopes, + false, + 1073741824 + /* Constants.MAX_SAFE_SMALL_INTEGER */ + ); + let selections = matches.map((m) => new Selection(m.range.startLineNumber, m.range.startColumn, m.range.endLineNumber, m.range.endColumn)); + const editorSelection = this._editor.getSelection(); + for (let i2 = 0, len = selections.length; i2 < len; i2++) { + const sel = selections[i2]; + if (sel.equalsRange(editorSelection)) { + selections = [editorSelection].concat(selections.slice(0, i2)).concat(selections.slice(i2 + 1)); + break; + } + } + this._editor.setSelections(selections); + } + _executeEditorCommand(source, command) { + try { + this._ignoreModelContentChanged = true; + this._editor.pushUndoStop(); + this._editor.executeCommand(source, command); + this._editor.pushUndoStop(); + } finally { + this._ignoreModelContentChanged = false; + } + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/find/browser/findWidget.js +init_nls(); + +// node_modules/monaco-editor-core/esm/vs/base/browser/ui/findinput/findInput.js +init_dom(); + +// node_modules/monaco-editor-core/esm/vs/base/browser/ui/findinput/findInputToggles.js +init_codicons(); +init_nls(); +var NLS_CASE_SENSITIVE_TOGGLE_LABEL = localize(2, "Match Case"); +var NLS_WHOLE_WORD_TOGGLE_LABEL = localize(3, "Match Whole Word"); +var NLS_REGEX_TOGGLE_LABEL = localize(4, "Use Regular Expression"); +var CaseSensitiveToggle = class extends Toggle { + constructor(opts) { + super({ + icon: Codicon.caseSensitive, + title: NLS_CASE_SENSITIVE_TOGGLE_LABEL + opts.appendTitle, + isChecked: opts.isChecked, + hoverLifecycleOptions: opts.hoverLifecycleOptions, + inputActiveOptionBorder: opts.inputActiveOptionBorder, + inputActiveOptionForeground: opts.inputActiveOptionForeground, + inputActiveOptionBackground: opts.inputActiveOptionBackground + }); + } +}; +var WholeWordsToggle = class extends Toggle { + constructor(opts) { + super({ + icon: Codicon.wholeWord, + title: NLS_WHOLE_WORD_TOGGLE_LABEL + opts.appendTitle, + isChecked: opts.isChecked, + hoverLifecycleOptions: opts.hoverLifecycleOptions, + inputActiveOptionBorder: opts.inputActiveOptionBorder, + inputActiveOptionForeground: opts.inputActiveOptionForeground, + inputActiveOptionBackground: opts.inputActiveOptionBackground + }); + } +}; +var RegexToggle = class extends Toggle { + constructor(opts) { + super({ + icon: Codicon.regex, + title: NLS_REGEX_TOGGLE_LABEL + opts.appendTitle, + isChecked: opts.isChecked, + hoverLifecycleOptions: opts.hoverLifecycleOptions, + inputActiveOptionBorder: opts.inputActiveOptionBorder, + inputActiveOptionForeground: opts.inputActiveOptionForeground, + inputActiveOptionBackground: opts.inputActiveOptionBackground + }); + } +}; + +// node_modules/monaco-editor-core/esm/vs/base/browser/ui/inputbox/inputBox.js +init_dom(); + +// node_modules/monaco-editor-core/esm/vs/base/browser/formattedTextRenderer.js +init_dom(); +function renderText(text2, _options, target) { + const element = target ?? document.createElement("div"); + element.textContent = text2; + return element; +} +function renderFormattedText(formattedText, options2, target) { + const element = target ?? document.createElement("div"); + element.textContent = ""; + _renderFormattedText(element, parseFormattedText(formattedText, !!options2?.renderCodeSegments), options2?.actionHandler, options2?.renderCodeSegments); + return element; +} +var StringStream = class { + constructor(source) { + this.source = source; + this.index = 0; + } + eos() { + return this.index >= this.source.length; + } + next() { + const next = this.peek(); + this.advance(); + return next; + } + peek() { + return this.source[this.index]; + } + advance() { + this.index++; + } +}; +function _renderFormattedText(element, treeNode, actionHandler, renderCodeSegments) { + let child; + if (treeNode.type === 2) { + child = document.createTextNode(treeNode.content || ""); + } else if (treeNode.type === 3) { + child = document.createElement("b"); + } else if (treeNode.type === 4) { + child = document.createElement("i"); + } else if (treeNode.type === 7 && renderCodeSegments) { + child = document.createElement("code"); + } else if (treeNode.type === 5 && actionHandler) { + const a = document.createElement("a"); + actionHandler.disposables.add(addStandardDisposableListener(a, "click", (event) => { + actionHandler.callback(String(treeNode.index), event); + })); + child = a; + } else if (treeNode.type === 8) { + child = document.createElement("br"); + } else if (treeNode.type === 1) { + child = element; + } + if (child && element !== child) { + element.appendChild(child); + } + if (child && Array.isArray(treeNode.children)) { + treeNode.children.forEach((nodeChild) => { + _renderFormattedText(child, nodeChild, actionHandler, renderCodeSegments); + }); + } +} +function parseFormattedText(content, parseCodeSegments) { + const root = { + type: 1, + children: [] + }; + let actionViewItemIndex = 0; + let current = root; + const stack = []; + const stream = new StringStream(content); + while (!stream.eos()) { + let next = stream.next(); + const isEscapedFormatType = next === "\\" && formatTagType(stream.peek(), parseCodeSegments) !== 0; + if (isEscapedFormatType) { + next = stream.next(); + } + if (!isEscapedFormatType && isFormatTag(next, parseCodeSegments) && next === stream.peek()) { + stream.advance(); + if (current.type === 2) { + current = stack.pop(); + } + const type = formatTagType(next, parseCodeSegments); + if (current.type === type || current.type === 5 && type === 6) { + current = stack.pop(); + } else { + const newCurrent = { + type, + children: [] + }; + if (type === 5) { + newCurrent.index = actionViewItemIndex; + actionViewItemIndex++; + } + current.children.push(newCurrent); + stack.push(current); + current = newCurrent; + } + } else if (next === "\n") { + if (current.type === 2) { + current = stack.pop(); + } + current.children.push({ + type: 8 + /* FormatType.NewLine */ + }); + } else { + if (current.type !== 2) { + const textCurrent = { + type: 2, + content: next + }; + current.children.push(textCurrent); + stack.push(current); + current = textCurrent; + } else { + current.content += next; + } + } + } + if (current.type === 2) { + current = stack.pop(); + } + if (stack.length) { + } + return root; +} +function isFormatTag(char, supportCodeSegments) { + return formatTagType(char, supportCodeSegments) !== 0; +} +function formatTagType(char, supportCodeSegments) { + switch (char) { + case "*": + return 3; + case "_": + return 4; + case "[": + return 5; + case "]": + return 6; + case "`": + return supportCodeSegments ? 7 : 0; + default: + return 0; + } +} + +// node_modules/monaco-editor-core/esm/vs/base/browser/ui/inputbox/inputBox.js +init_event(); + +// node_modules/monaco-editor-core/esm/vs/base/common/navigator.js +var ArrayNavigator = class { + constructor(items, start = 0, end = items.length, index = start - 1) { + this.items = items; + this.start = start; + this.end = end; + this.index = index; + } + current() { + if (this.index === this.start - 1 || this.index === this.end) { + return null; + } + return this.items[this.index]; + } + next() { + this.index = Math.min(this.index + 1, this.end); + return this.current(); + } + previous() { + this.index = Math.max(this.index - 1, this.start - 1); + return this.current(); + } + first() { + this.index = this.start; + return this.current(); + } + last() { + this.index = this.end - 1; + return this.current(); + } +}; + +// node_modules/monaco-editor-core/esm/vs/base/common/history.js +var HistoryNavigator = class { + constructor(_history = /* @__PURE__ */ new Set(), limit = 10) { + this._history = _history; + this._limit = limit; + this._onChange(); + if (this._history.onDidChange) { + this._disposable = this._history.onDidChange(() => this._onChange()); + } + } + getHistory() { + return this._elements; + } + add(t) { + this._history.delete(t); + this._history.add(t); + this._onChange(); + } + next() { + return this._navigator.next(); + } + previous() { + if (this._currentPosition() !== 0) { + return this._navigator.previous(); + } + return null; + } + current() { + return this._navigator.current(); + } + first() { + return this._navigator.first(); + } + last() { + return this._navigator.last(); + } + isLast() { + return this._currentPosition() >= this._elements.length - 1; + } + isNowhere() { + return this._navigator.current() === null; + } + has(t) { + return this._history.has(t); + } + _onChange() { + this._reduceToLimit(); + const elements = this._elements; + this._navigator = new ArrayNavigator(elements, 0, elements.length, elements.length); + } + _reduceToLimit() { + const data = this._elements; + if (data.length > this._limit) { + const replaceValue = data.slice(data.length - this._limit); + if (this._history.replace) { + this._history.replace(replaceValue); + } else { + this._history = new Set(replaceValue); + } + } + } + _currentPosition() { + const currentElement = this._navigator.current(); + if (!currentElement) { + return -1; + } + return this._elements.indexOf(currentElement); + } + get _elements() { + const elements = []; + this._history.forEach((e) => elements.push(e)); + return elements; + } + dispose() { + if (this._disposable) { + this._disposable.dispose(); + this._disposable = void 0; + } + } +}; + +// node_modules/monaco-editor-core/esm/vs/base/browser/ui/inputbox/inputBox.js +init_objects(); +init_nls(); +init_lifecycle(); +var $6 = $; +var InputBox = class extends Widget { + get onDidChange() { + return this._onDidChange.event; + } + get onDidHeightChange() { + return this._onDidHeightChange.event; + } + constructor(container, contextViewProvider, options2) { + super(); + this.state = "idle"; + this.maxHeight = Number.POSITIVE_INFINITY; + this.hover = this._register(new MutableDisposable()); + this._onDidChange = this._register(new Emitter()); + this._onDidHeightChange = this._register(new Emitter()); + this.contextViewProvider = contextViewProvider; + this.options = options2; + this.message = null; + this.placeholder = this.options.placeholder || ""; + this.tooltip = this.options.tooltip ?? (this.placeholder || ""); + this.ariaLabel = this.options.ariaLabel || ""; + if (this.options.validationOptions) { + this.validation = this.options.validationOptions.validation; + } + this.element = append(container, $6(".monaco-inputbox.idle")); + const tagName = this.options.flexibleHeight ? "textarea" : "input"; + const wrapper = append(this.element, $6(".ibwrapper")); + this.input = append(wrapper, $6(tagName + ".input.empty")); + this.input.setAttribute("autocorrect", "off"); + this.input.setAttribute("autocapitalize", "off"); + this.input.setAttribute("spellcheck", "false"); + this.onfocus(this.input, () => this.element.classList.add("synthetic-focus")); + this.onblur(this.input, () => this.element.classList.remove("synthetic-focus")); + if (this.options.flexibleHeight) { + this.maxHeight = typeof this.options.flexibleMaxHeight === "number" ? this.options.flexibleMaxHeight : Number.POSITIVE_INFINITY; + this.mirror = append(wrapper, $6("div.mirror")); + this.mirror.innerText = "\xA0"; + this.scrollableElement = new ScrollableElement(this.element, { + vertical: 1 + /* ScrollbarVisibility.Auto */ + }); + if (this.options.flexibleWidth) { + this.input.setAttribute("wrap", "off"); + this.mirror.style.whiteSpace = "pre"; + this.mirror.style.wordWrap = "initial"; + } + append(container, this.scrollableElement.getDomNode()); + this._register(this.scrollableElement); + this._register(this.scrollableElement.onScroll((e) => this.input.scrollTop = e.scrollTop)); + const onSelectionChange = this._register(new DomEmitter(container.ownerDocument, "selectionchange")); + const onAnchoredSelectionChange = Event.filter(onSelectionChange.event, () => { + const selection = container.ownerDocument.getSelection(); + return selection?.anchorNode === wrapper; + }); + this._register(onAnchoredSelectionChange(this.updateScrollDimensions, this)); + this._register(this.onDidHeightChange(this.updateScrollDimensions, this)); + } else { + this.input.type = this.options.type || "text"; + this.input.setAttribute("wrap", "off"); + } + if (this.ariaLabel) { + this.input.setAttribute("aria-label", this.ariaLabel); + } + if (this.placeholder && !this.options.showPlaceholderOnFocus) { + this.setPlaceHolder(this.placeholder); + } + if (this.tooltip) { + this.setTooltip(this.tooltip); + } + this.oninput(this.input, () => this.onValueChange()); + this.onblur(this.input, () => this.onBlur()); + this.onfocus(this.input, () => this.onFocus()); + this._register(this.ignoreGesture(this.input)); + setTimeout(() => this.updateMirror(), 0); + if (this.options.actions) { + this.actionbar = this._register(new ActionBar(this.element)); + this.actionbar.push(this.options.actions, { icon: true, label: false }); + } + this.applyStyles(); + } + onBlur() { + this._hideMessage(); + if (this.options.showPlaceholderOnFocus) { + this.input.setAttribute("placeholder", ""); + } + } + onFocus() { + this._showMessage(); + if (this.options.showPlaceholderOnFocus) { + this.input.setAttribute("placeholder", this.placeholder || ""); + } + } + setPlaceHolder(placeHolder) { + this.placeholder = placeHolder; + this.input.setAttribute("placeholder", placeHolder); + } + setTooltip(tooltip) { + this.tooltip = tooltip; + if (!this.hover.value) { + this.hover.value = this._register(getBaseLayerHoverDelegate().setupDelayedHoverAtMouse(this.input, () => ({ + content: this.tooltip, + appearance: { + compact: true + } + }))); + } + } + get inputElement() { + return this.input; + } + get value() { + return this.input.value; + } + set value(newValue) { + if (this.input.value !== newValue) { + this.input.value = newValue; + this.onValueChange(); + } + } + get height() { + return typeof this.cachedHeight === "number" ? this.cachedHeight : getTotalHeight(this.element); + } + focus() { + this.input.focus(); + } + blur() { + this.input.blur(); + } + hasFocus() { + return isActiveElement(this.input); + } + select(range2 = null) { + this.input.select(); + if (range2) { + this.input.setSelectionRange(range2.start, range2.end); + if (range2.end === this.input.value.length) { + this.input.scrollLeft = this.input.scrollWidth; + } + } + } + isSelectionAtEnd() { + return this.input.selectionEnd === this.input.value.length && this.input.selectionStart === this.input.selectionEnd; + } + getSelection() { + const selectionStart = this.input.selectionStart; + if (selectionStart === null) { + return null; + } + const selectionEnd = this.input.selectionEnd ?? selectionStart; + return { + start: selectionStart, + end: selectionEnd + }; + } + enable() { + this.input.removeAttribute("disabled"); + } + disable() { + this.blur(); + this.input.disabled = true; + this._hideMessage(); + } + set paddingRight(paddingRight) { + this.input.style.width = `calc(100% - ${paddingRight}px)`; + if (this.mirror) { + this.mirror.style.paddingRight = paddingRight + "px"; + } + } + updateScrollDimensions() { + if (typeof this.cachedContentHeight !== "number" || typeof this.cachedHeight !== "number" || !this.scrollableElement) { + return; + } + const scrollHeight = this.cachedContentHeight; + const height = this.cachedHeight; + const scrollTop = this.input.scrollTop; + this.scrollableElement.setScrollDimensions({ scrollHeight, height }); + this.scrollableElement.setScrollPosition({ scrollTop }); + } + showMessage(message, force) { + if (this.state === "open" && equals2(this.message, message)) { + return; + } + this.message = message; + this.element.classList.remove("idle"); + this.element.classList.remove("info"); + this.element.classList.remove("warning"); + this.element.classList.remove("error"); + this.element.classList.add(this.classForType(message.type)); + const styles = this.stylesForType(this.message.type); + this.element.style.border = `1px solid ${asCssValueWithDefault(styles.border, "transparent")}`; + if (this.message.content && (this.hasFocus() || force)) { + this._showMessage(); + } + } + hideMessage() { + this.message = null; + this.element.classList.remove("info"); + this.element.classList.remove("warning"); + this.element.classList.remove("error"); + this.element.classList.add("idle"); + this._hideMessage(); + this.applyStyles(); + } + validate() { + let errorMsg = null; + if (this.validation) { + errorMsg = this.validation(this.value); + if (errorMsg) { + this.inputElement.setAttribute("aria-invalid", "true"); + this.showMessage(errorMsg); + } else if (this.inputElement.hasAttribute("aria-invalid")) { + this.inputElement.removeAttribute("aria-invalid"); + this.hideMessage(); + } + } + return errorMsg?.type; + } + stylesForType(type) { + const styles = this.options.inputBoxStyles; + switch (type) { + case 1: + return { border: styles.inputValidationInfoBorder, background: styles.inputValidationInfoBackground, foreground: styles.inputValidationInfoForeground }; + case 2: + return { border: styles.inputValidationWarningBorder, background: styles.inputValidationWarningBackground, foreground: styles.inputValidationWarningForeground }; + default: + return { border: styles.inputValidationErrorBorder, background: styles.inputValidationErrorBackground, foreground: styles.inputValidationErrorForeground }; + } + } + classForType(type) { + switch (type) { + case 1: + return "info"; + case 2: + return "warning"; + default: + return "error"; + } + } + _showMessage() { + if (!this.contextViewProvider || !this.message) { + return; + } + let div; + const layout2 = () => div.style.width = getTotalWidth(this.element) + "px"; + this.contextViewProvider.showContextView({ + getAnchor: () => this.element, + anchorAlignment: 1, + render: (container) => { + if (!this.message) { + return null; + } + div = append(container, $6(".monaco-inputbox-container")); + layout2(); + const spanElement = $6("span.monaco-inputbox-message"); + if (this.message.formatContent) { + renderFormattedText(this.message.content, void 0, spanElement); + } else { + renderText(this.message.content, void 0, spanElement); + } + spanElement.classList.add(this.classForType(this.message.type)); + const styles = this.stylesForType(this.message.type); + spanElement.style.backgroundColor = styles.background ?? ""; + spanElement.style.color = styles.foreground ?? ""; + spanElement.style.border = styles.border ? `1px solid ${styles.border}` : ""; + append(div, spanElement); + return null; + }, + onHide: () => { + this.state = "closed"; + }, + layout: layout2 + }); + let alertText; + if (this.message.type === 3) { + alertText = localize(9, "Error: {0}", this.message.content); + } else if (this.message.type === 2) { + alertText = localize(10, "Warning: {0}", this.message.content); + } else { + alertText = localize(11, "Info: {0}", this.message.content); + } + alert(alertText); + this.state = "open"; + } + _hideMessage() { + if (!this.contextViewProvider) { + return; + } + if (this.state === "open") { + this.contextViewProvider.hideContextView(); + } + this.state = "idle"; + } + onValueChange() { + this._onDidChange.fire(this.value); + this.validate(); + this.updateMirror(); + this.input.classList.toggle("empty", !this.value); + if (this.state === "open" && this.contextViewProvider) { + this.contextViewProvider.layout(); + } + } + updateMirror() { + if (!this.mirror) { + return; + } + const value = this.value; + const lastCharCode = value.charCodeAt(value.length - 1); + const suffix = lastCharCode === 10 ? " " : ""; + const mirrorTextContent = (value + suffix).replace(/\u000c/g, ""); + if (mirrorTextContent) { + this.mirror.textContent = value + suffix; + } else { + this.mirror.innerText = "\xA0"; + } + this.layout(); + } + applyStyles() { + const styles = this.options.inputBoxStyles; + const background = styles.inputBackground ?? ""; + const foreground2 = styles.inputForeground ?? ""; + const border = styles.inputBorder ?? ""; + this.element.style.backgroundColor = background; + this.element.style.color = foreground2; + this.input.style.backgroundColor = "inherit"; + this.input.style.color = foreground2; + this.element.style.border = `1px solid ${asCssValueWithDefault(border, "transparent")}`; + } + layout() { + if (!this.mirror) { + return; + } + const previousHeight = this.cachedContentHeight; + this.cachedContentHeight = getTotalHeight(this.mirror); + if (previousHeight !== this.cachedContentHeight) { + this.cachedHeight = Math.min(this.cachedContentHeight, this.maxHeight); + this.input.style.height = this.cachedHeight + "px"; + this._onDidHeightChange.fire(this.cachedContentHeight); + } + } + insertAtCursor(text2) { + const inputElement = this.inputElement; + const start = inputElement.selectionStart; + const end = inputElement.selectionEnd; + const content = inputElement.value; + if (start !== null && end !== null) { + this.value = content.substr(0, start) + text2 + content.substr(end); + inputElement.setSelectionRange(start + 1, start + 1); + this.layout(); + } + } + dispose() { + this._hideMessage(); + this.message = null; + this.actionbar?.dispose(); + super.dispose(); + } +}; +var HistoryInputBox = class extends InputBox { + constructor(container, contextViewProvider, options2) { + const NLS_PLACEHOLDER_HISTORY_HINT_SUFFIX_NO_PARENS = localize(12, " or {0} for history", `\u21C5`); + const NLS_PLACEHOLDER_HISTORY_HINT_SUFFIX_IN_PARENS = localize(13, " ({0} for history)", `\u21C5`); + super(container, contextViewProvider, options2); + this._onDidFocus = this._register(new Emitter()); + this.onDidFocus = this._onDidFocus.event; + this._onDidBlur = this._register(new Emitter()); + this.onDidBlur = this._onDidBlur.event; + this.history = this._register(new HistoryNavigator(options2.history, 100)); + const addSuffix = () => { + if (options2.showHistoryHint && options2.showHistoryHint() && !this.placeholder.endsWith(NLS_PLACEHOLDER_HISTORY_HINT_SUFFIX_NO_PARENS) && !this.placeholder.endsWith(NLS_PLACEHOLDER_HISTORY_HINT_SUFFIX_IN_PARENS) && this.history.getHistory().length) { + const suffix = this.placeholder.endsWith(")") ? NLS_PLACEHOLDER_HISTORY_HINT_SUFFIX_NO_PARENS : NLS_PLACEHOLDER_HISTORY_HINT_SUFFIX_IN_PARENS; + const suffixedPlaceholder = this.placeholder + suffix; + if (options2.showPlaceholderOnFocus && !isActiveElement(this.input)) { + this.placeholder = suffixedPlaceholder; + } else { + this.setPlaceHolder(suffixedPlaceholder); + } + } + }; + this.observer = new MutationObserver((mutationList, observer) => { + mutationList.forEach((mutation) => { + if (!mutation.target.textContent) { + addSuffix(); + } + }); + }); + this.observer.observe(this.input, { attributeFilter: ["class"] }); + this.onfocus(this.input, () => addSuffix()); + this.onblur(this.input, () => { + const resetPlaceholder = (historyHint) => { + if (!this.placeholder.endsWith(historyHint)) { + return false; + } else { + const revertedPlaceholder = this.placeholder.slice(0, this.placeholder.length - historyHint.length); + if (options2.showPlaceholderOnFocus) { + this.placeholder = revertedPlaceholder; + } else { + this.setPlaceHolder(revertedPlaceholder); + } + return true; + } + }; + if (!resetPlaceholder(NLS_PLACEHOLDER_HISTORY_HINT_SUFFIX_IN_PARENS)) { + resetPlaceholder(NLS_PLACEHOLDER_HISTORY_HINT_SUFFIX_NO_PARENS); + } + }); + } + dispose() { + super.dispose(); + if (this.observer) { + this.observer.disconnect(); + this.observer = void 0; + } + } + addToHistory(always) { + if (this.value && (always || this.value !== this.getCurrentValue())) { + this.history.add(this.value); + } + } + isAtLastInHistory() { + return this.history.isLast(); + } + isNowhereInHistory() { + return this.history.isNowhere(); + } + showNextValue() { + if (!this.history.has(this.value)) { + this.addToHistory(); + } + let next = this.getNextValue(); + if (next) { + next = next === this.value ? this.getNextValue() : next; + } + this.value = next ?? ""; + status(this.value ? this.value : localize(14, "Cleared Input")); + } + showPreviousValue() { + if (!this.history.has(this.value)) { + this.addToHistory(); + } + let previous = this.getPreviousValue(); + if (previous) { + previous = previous === this.value ? this.getPreviousValue() : previous; + } + if (previous) { + this.value = previous; + status(this.value); + } + } + setPlaceHolder(placeHolder) { + super.setPlaceHolder(placeHolder); + this.setTooltip(placeHolder); + } + onBlur() { + super.onBlur(); + this._onDidBlur.fire(); + } + onFocus() { + super.onFocus(); + this._onDidFocus.fire(); + } + getCurrentValue() { + let currentValue = this.history.current(); + if (!currentValue) { + currentValue = this.history.last(); + this.history.next(); + } + return currentValue; + } + getPreviousValue() { + return this.history.previous() || this.history.first(); + } + getNextValue() { + return this.history.next(); + } +}; + +// node_modules/monaco-editor-core/esm/vs/base/browser/ui/findinput/findInput.js +init_event(); +init_nls(); +init_lifecycle(); +var NLS_DEFAULT_LABEL = localize(1, "input"); +var FindInput = class extends Widget { + get onDidOptionChange() { + return this._onDidOptionChange.event; + } + get onKeyDown() { + return this._onKeyDown.event; + } + get onMouseDown() { + return this._onMouseDown.event; + } + get onCaseSensitiveKeyDown() { + return this._onCaseSensitiveKeyDown.event; + } + get onRegexKeyDown() { + return this._onRegexKeyDown.event; + } + constructor(parent, contextViewProvider, options2) { + super(); + this.fixFocusOnOptionClickEnabled = true; + this.imeSessionInProgress = false; + this.additionalTogglesDisposables = this._register(new MutableDisposable()); + this.additionalToggles = []; + this._onDidOptionChange = this._register(new Emitter()); + this._onKeyDown = this._register(new Emitter()); + this._onMouseDown = this._register(new Emitter()); + this._onInput = this._register(new Emitter()); + this._onKeyUp = this._register(new Emitter()); + this._onCaseSensitiveKeyDown = this._register(new Emitter()); + this._onRegexKeyDown = this._register(new Emitter()); + this._lastHighlightFindOptions = 0; + this.placeholder = options2.placeholder || ""; + this.validation = options2.validation; + this.label = options2.label || NLS_DEFAULT_LABEL; + this.showCommonFindToggles = !!options2.showCommonFindToggles; + const appendCaseSensitiveLabel = options2.appendCaseSensitiveLabel || ""; + const appendWholeWordsLabel = options2.appendWholeWordsLabel || ""; + const appendRegexLabel = options2.appendRegexLabel || ""; + const flexibleHeight = !!options2.flexibleHeight; + const flexibleWidth = !!options2.flexibleWidth; + const flexibleMaxHeight = options2.flexibleMaxHeight; + this.domNode = document.createElement("div"); + this.domNode.classList.add("monaco-findInput"); + this.inputBox = this._register(new HistoryInputBox(this.domNode, contextViewProvider, { + placeholder: this.placeholder || "", + ariaLabel: this.label || "", + validationOptions: { + validation: this.validation + }, + showHistoryHint: options2.showHistoryHint, + flexibleHeight, + flexibleWidth, + flexibleMaxHeight, + inputBoxStyles: options2.inputBoxStyles, + history: options2.history + })); + if (this.showCommonFindToggles) { + const hoverLifecycleOptions = options2?.hoverLifecycleOptions || { groupId: "find-input" }; + this.regex = this._register(new RegexToggle({ + appendTitle: appendRegexLabel, + isChecked: false, + hoverLifecycleOptions, + ...options2.toggleStyles + })); + this._register(this.regex.onChange((viaKeyboard) => { + this._onDidOptionChange.fire(viaKeyboard); + if (!viaKeyboard && this.fixFocusOnOptionClickEnabled) { + this.inputBox.focus(); + } + this.validate(); + })); + this._register(this.regex.onKeyDown((e) => { + this._onRegexKeyDown.fire(e); + })); + this.wholeWords = this._register(new WholeWordsToggle({ + appendTitle: appendWholeWordsLabel, + isChecked: false, + hoverLifecycleOptions, + ...options2.toggleStyles + })); + this._register(this.wholeWords.onChange((viaKeyboard) => { + this._onDidOptionChange.fire(viaKeyboard); + if (!viaKeyboard && this.fixFocusOnOptionClickEnabled) { + this.inputBox.focus(); + } + this.validate(); + })); + this.caseSensitive = this._register(new CaseSensitiveToggle({ + appendTitle: appendCaseSensitiveLabel, + isChecked: false, + hoverLifecycleOptions, + ...options2.toggleStyles + })); + this._register(this.caseSensitive.onChange((viaKeyboard) => { + this._onDidOptionChange.fire(viaKeyboard); + if (!viaKeyboard && this.fixFocusOnOptionClickEnabled) { + this.inputBox.focus(); + } + this.validate(); + })); + this._register(this.caseSensitive.onKeyDown((e) => { + this._onCaseSensitiveKeyDown.fire(e); + })); + const indexes = [this.caseSensitive.domNode, this.wholeWords.domNode, this.regex.domNode]; + this.onkeydown(this.domNode, (event) => { + if (event.equals( + 15 + /* KeyCode.LeftArrow */ + ) || event.equals( + 17 + /* KeyCode.RightArrow */ + ) || event.equals( + 9 + /* KeyCode.Escape */ + )) { + const index = indexes.indexOf(this.domNode.ownerDocument.activeElement); + if (index >= 0) { + let newIndex = -1; + if (event.equals( + 17 + /* KeyCode.RightArrow */ + )) { + newIndex = (index + 1) % indexes.length; + } else if (event.equals( + 15 + /* KeyCode.LeftArrow */ + )) { + if (index === 0) { + newIndex = indexes.length - 1; + } else { + newIndex = index - 1; + } + } + if (event.equals( + 9 + /* KeyCode.Escape */ + )) { + indexes[index].blur(); + this.inputBox.focus(); + } else if (newIndex >= 0) { + indexes[newIndex].focus(); + } + EventHelper.stop(event, true); + } + } + }); + } + this.controls = document.createElement("div"); + this.controls.className = "controls"; + this.controls.style.display = this.showCommonFindToggles ? "" : "none"; + if (this.caseSensitive) { + this.controls.append(this.caseSensitive.domNode); + } + if (this.wholeWords) { + this.controls.appendChild(this.wholeWords.domNode); + } + if (this.regex) { + this.controls.appendChild(this.regex.domNode); + } + this.setAdditionalToggles(options2?.additionalToggles); + if (this.controls) { + this.domNode.appendChild(this.controls); + } + parent?.appendChild(this.domNode); + this._register(addDisposableListener(this.inputBox.inputElement, "compositionstart", (e) => { + this.imeSessionInProgress = true; + })); + this._register(addDisposableListener(this.inputBox.inputElement, "compositionend", (e) => { + this.imeSessionInProgress = false; + this._onInput.fire(); + })); + this.onkeydown(this.inputBox.inputElement, (e) => this._onKeyDown.fire(e)); + this.onkeyup(this.inputBox.inputElement, (e) => this._onKeyUp.fire(e)); + this.oninput(this.inputBox.inputElement, (e) => this._onInput.fire()); + this.onmousedown(this.inputBox.inputElement, (e) => this._onMouseDown.fire(e)); + } + get onDidChange() { + return this.inputBox.onDidChange; + } + layout(style) { + this.inputBox.layout(); + this.updateInputBoxPadding(style.collapsedFindWidget); + } + enable() { + this.domNode.classList.remove("disabled"); + this.inputBox.enable(); + this.regex?.enable(); + this.wholeWords?.enable(); + this.caseSensitive?.enable(); + for (const toggle of this.additionalToggles) { + toggle.enable(); + } + } + disable() { + this.domNode.classList.add("disabled"); + this.inputBox.disable(); + this.regex?.disable(); + this.wholeWords?.disable(); + this.caseSensitive?.disable(); + for (const toggle of this.additionalToggles) { + toggle.disable(); + } + } + setFocusInputOnOptionClick(value) { + this.fixFocusOnOptionClickEnabled = value; + } + setEnabled(enabled) { + if (enabled) { + this.enable(); + } else { + this.disable(); + } + } + setAdditionalToggles(toggles) { + for (const currentToggle of this.additionalToggles) { + currentToggle.domNode.remove(); + } + this.additionalToggles = []; + this.additionalTogglesDisposables.value = new DisposableStore(); + for (const toggle of toggles ?? []) { + this.additionalTogglesDisposables.value.add(toggle); + this.controls.appendChild(toggle.domNode); + this.additionalTogglesDisposables.value.add(toggle.onChange((viaKeyboard) => { + this._onDidOptionChange.fire(viaKeyboard); + if (!viaKeyboard && this.fixFocusOnOptionClickEnabled) { + this.inputBox.focus(); + } + })); + this.additionalToggles.push(toggle); + } + if (this.additionalToggles.length > 0) { + this.controls.style.display = ""; + } + this.updateInputBoxPadding(); + } + updateInputBoxPadding(controlsHidden = false) { + if (controlsHidden) { + this.inputBox.paddingRight = 0; + } else { + this.inputBox.paddingRight = (this.caseSensitive?.width() ?? 0) + (this.wholeWords?.width() ?? 0) + (this.regex?.width() ?? 0) + this.additionalToggles.reduce((r, t) => r + t.width(), 0); + } + } + getValue() { + return this.inputBox.value; + } + setValue(value) { + if (this.inputBox.value !== value) { + this.inputBox.value = value; + } + } + select() { + this.inputBox.select(); + } + focus() { + this.inputBox.focus(); + } + getCaseSensitive() { + return this.caseSensitive?.checked ?? false; + } + setCaseSensitive(value) { + if (this.caseSensitive) { + this.caseSensitive.checked = value; + } + } + getWholeWords() { + return this.wholeWords?.checked ?? false; + } + setWholeWords(value) { + if (this.wholeWords) { + this.wholeWords.checked = value; + } + } + getRegex() { + return this.regex?.checked ?? false; + } + setRegex(value) { + if (this.regex) { + this.regex.checked = value; + this.validate(); + } + } + focusOnCaseSensitive() { + this.caseSensitive?.focus(); + } + highlightFindOptions() { + this.domNode.classList.remove("highlight-" + this._lastHighlightFindOptions); + this._lastHighlightFindOptions = 1 - this._lastHighlightFindOptions; + this.domNode.classList.add("highlight-" + this._lastHighlightFindOptions); + } + validate() { + this.inputBox.validate(); + } + showMessage(message) { + this.inputBox.showMessage(message); + } + clearMessage() { + this.inputBox.hideMessage(); + } +}; + +// node_modules/monaco-editor-core/esm/vs/base/browser/ui/findinput/replaceInput.js +init_dom(); +init_codicons(); +init_event(); +init_nls(); +var NLS_DEFAULT_LABEL2 = localize(5, "input"); +var NLS_PRESERVE_CASE_LABEL = localize(6, "Preserve Case"); +var PreserveCaseToggle = class extends Toggle { + constructor(opts) { + super({ + // TODO: does this need its own icon? + icon: Codicon.preserveCase, + title: NLS_PRESERVE_CASE_LABEL + opts.appendTitle, + isChecked: opts.isChecked, + hoverLifecycleOptions: opts.hoverLifecycleOptions, + inputActiveOptionBorder: opts.inputActiveOptionBorder, + inputActiveOptionForeground: opts.inputActiveOptionForeground, + inputActiveOptionBackground: opts.inputActiveOptionBackground + }); + } +}; +var ReplaceInput = class extends Widget { + get onDidOptionChange() { + return this._onDidOptionChange.event; + } + get onKeyDown() { + return this._onKeyDown.event; + } + get onPreserveCaseKeyDown() { + return this._onPreserveCaseKeyDown.event; + } + constructor(parent, contextViewProvider, _showOptionButtons, options2) { + super(); + this._showOptionButtons = _showOptionButtons; + this.fixFocusOnOptionClickEnabled = true; + this.cachedOptionsWidth = 0; + this._onDidOptionChange = this._register(new Emitter()); + this._onKeyDown = this._register(new Emitter()); + this._onMouseDown = this._register(new Emitter()); + this._onInput = this._register(new Emitter()); + this._onKeyUp = this._register(new Emitter()); + this._onPreserveCaseKeyDown = this._register(new Emitter()); + this.contextViewProvider = contextViewProvider; + this.placeholder = options2.placeholder || ""; + this.validation = options2.validation; + this.label = options2.label || NLS_DEFAULT_LABEL2; + const appendPreserveCaseLabel = options2.appendPreserveCaseLabel || ""; + const history = options2.history || /* @__PURE__ */ new Set([]); + const flexibleHeight = !!options2.flexibleHeight; + const flexibleWidth = !!options2.flexibleWidth; + const flexibleMaxHeight = options2.flexibleMaxHeight; + this.domNode = document.createElement("div"); + this.domNode.classList.add("monaco-findInput"); + this.inputBox = this._register(new HistoryInputBox(this.domNode, this.contextViewProvider, { + ariaLabel: this.label || "", + placeholder: this.placeholder || "", + validationOptions: { + validation: this.validation + }, + history, + showHistoryHint: options2.showHistoryHint, + flexibleHeight, + flexibleWidth, + flexibleMaxHeight, + inputBoxStyles: options2.inputBoxStyles + })); + this.preserveCase = this._register(new PreserveCaseToggle({ + appendTitle: appendPreserveCaseLabel, + isChecked: false, + hoverLifecycleOptions: options2.hoverLifecycleOptions, + ...options2.toggleStyles + })); + this._register(this.preserveCase.onChange((viaKeyboard) => { + this._onDidOptionChange.fire(viaKeyboard); + if (!viaKeyboard && this.fixFocusOnOptionClickEnabled) { + this.inputBox.focus(); + } + this.validate(); + })); + this._register(this.preserveCase.onKeyDown((e) => { + this._onPreserveCaseKeyDown.fire(e); + })); + if (this._showOptionButtons) { + this.cachedOptionsWidth = this.preserveCase.width(); + } else { + this.cachedOptionsWidth = 0; + } + const indexes = [this.preserveCase.domNode]; + this.onkeydown(this.domNode, (event) => { + if (event.equals( + 15 + /* KeyCode.LeftArrow */ + ) || event.equals( + 17 + /* KeyCode.RightArrow */ + ) || event.equals( + 9 + /* KeyCode.Escape */ + )) { + const index = indexes.indexOf(this.domNode.ownerDocument.activeElement); + if (index >= 0) { + let newIndex = -1; + if (event.equals( + 17 + /* KeyCode.RightArrow */ + )) { + newIndex = (index + 1) % indexes.length; + } else if (event.equals( + 15 + /* KeyCode.LeftArrow */ + )) { + if (index === 0) { + newIndex = indexes.length - 1; + } else { + newIndex = index - 1; + } + } + if (event.equals( + 9 + /* KeyCode.Escape */ + )) { + indexes[index].blur(); + this.inputBox.focus(); + } else if (newIndex >= 0) { + indexes[newIndex].focus(); + } + EventHelper.stop(event, true); + } + } + }); + const controls = document.createElement("div"); + controls.className = "controls"; + controls.style.display = this._showOptionButtons ? "block" : "none"; + controls.appendChild(this.preserveCase.domNode); + this.domNode.appendChild(controls); + parent?.appendChild(this.domNode); + this.onkeydown(this.inputBox.inputElement, (e) => this._onKeyDown.fire(e)); + this.onkeyup(this.inputBox.inputElement, (e) => this._onKeyUp.fire(e)); + this.oninput(this.inputBox.inputElement, (e) => this._onInput.fire()); + this.onmousedown(this.inputBox.inputElement, (e) => this._onMouseDown.fire(e)); + } + enable() { + this.domNode.classList.remove("disabled"); + this.inputBox.enable(); + this.preserveCase.enable(); + } + disable() { + this.domNode.classList.add("disabled"); + this.inputBox.disable(); + this.preserveCase.disable(); + } + setEnabled(enabled) { + if (enabled) { + this.enable(); + } else { + this.disable(); + } + } + select() { + this.inputBox.select(); + } + focus() { + this.inputBox.focus(); + } + getPreserveCase() { + return this.preserveCase.checked; + } + setPreserveCase(value) { + this.preserveCase.checked = value; + } + focusOnPreserve() { + this.preserveCase.focus(); + } + validate() { + this.inputBox?.validate(); + } + set width(newWidth) { + this.inputBox.paddingRight = this.cachedOptionsWidth; + this.domNode.style.width = newWidth + "px"; + } + dispose() { + super.dispose(); + } +}; + +// node_modules/monaco-editor-core/esm/vs/platform/history/browser/contextScopedHistoryWidget.js +init_contextkey(); +init_keybindingsRegistry(); +init_nls(); +init_lifecycle(); +init_dom(); +var __decorate64 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param59 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var historyNavigationVisible = new RawContextKey("suggestWidgetVisible", false, localize(1698, "Whether suggestion are visible")); +var HistoryNavigationWidgetFocusContext = "historyNavigationWidgetFocus"; +var HistoryNavigationForwardsEnablementContext = "historyNavigationForwardsEnabled"; +var HistoryNavigationBackwardsEnablementContext = "historyNavigationBackwardsEnabled"; +var lastFocusedWidget = void 0; +var widgets = []; +function registerAndCreateHistoryNavigationContext(scopedContextKeyService, widget) { + if (widgets.includes(widget)) { + throw new Error("Cannot register the same widget multiple times"); + } + widgets.push(widget); + const disposableStore = new DisposableStore(); + const historyNavigationWidgetFocus = new RawContextKey(HistoryNavigationWidgetFocusContext, false).bindTo(scopedContextKeyService); + const historyNavigationForwardsEnablement = new RawContextKey(HistoryNavigationForwardsEnablementContext, true).bindTo(scopedContextKeyService); + const historyNavigationBackwardsEnablement = new RawContextKey(HistoryNavigationBackwardsEnablementContext, true).bindTo(scopedContextKeyService); + const onDidFocus = () => { + historyNavigationWidgetFocus.set(true); + lastFocusedWidget = widget; + }; + const onDidBlur = () => { + historyNavigationWidgetFocus.set(false); + if (lastFocusedWidget === widget) { + lastFocusedWidget = void 0; + } + }; + if (isActiveElement(widget.element)) { + onDidFocus(); + } + disposableStore.add(widget.onDidFocus(() => onDidFocus())); + disposableStore.add(widget.onDidBlur(() => onDidBlur())); + disposableStore.add(toDisposable(() => { + widgets.splice(widgets.indexOf(widget), 1); + onDidBlur(); + })); + return { + historyNavigationForwardsEnablement, + historyNavigationBackwardsEnablement, + dispose() { + disposableStore.dispose(); + } + }; +} +var ContextScopedFindInput = class ContextScopedFindInput2 extends FindInput { + constructor(container, contextViewProvider, options2, contextKeyService) { + super(container, contextViewProvider, options2); + const scopedContextKeyService = this._register(contextKeyService.createScoped(this.inputBox.element)); + this._register(registerAndCreateHistoryNavigationContext(scopedContextKeyService, this.inputBox)); + } +}; +ContextScopedFindInput = __decorate64([ + __param59(3, IContextKeyService) +], ContextScopedFindInput); +var ContextScopedReplaceInput = class ContextScopedReplaceInput2 extends ReplaceInput { + constructor(container, contextViewProvider, options2, contextKeyService, showReplaceOptions = false) { + super(container, contextViewProvider, showReplaceOptions, options2); + const scopedContextKeyService = this._register(contextKeyService.createScoped(this.inputBox.element)); + this._register(registerAndCreateHistoryNavigationContext(scopedContextKeyService, this.inputBox)); + } +}; +ContextScopedReplaceInput = __decorate64([ + __param59(3, IContextKeyService) +], ContextScopedReplaceInput); +KeybindingsRegistry.registerCommandAndKeybindingRule({ + id: "history.showPrevious", + weight: 200, + when: ContextKeyExpr.and(ContextKeyExpr.has(HistoryNavigationWidgetFocusContext), ContextKeyExpr.equals(HistoryNavigationBackwardsEnablementContext, true), ContextKeyExpr.not("isComposing"), historyNavigationVisible.isEqualTo(false)), + primary: 16, + secondary: [ + 512 | 16 + /* KeyCode.UpArrow */ + ], + handler: (accessor) => { + lastFocusedWidget?.showPreviousValue(); + } +}); +KeybindingsRegistry.registerCommandAndKeybindingRule({ + id: "history.showNext", + weight: 200, + when: ContextKeyExpr.and(ContextKeyExpr.has(HistoryNavigationWidgetFocusContext), ContextKeyExpr.equals(HistoryNavigationForwardsEnablementContext, true), ContextKeyExpr.not("isComposing"), historyNavigationVisible.isEqualTo(false)), + primary: 18, + secondary: [ + 512 | 18 + /* KeyCode.DownArrow */ + ], + handler: (accessor) => { + lastFocusedWidget?.showNextValue(); + } +}); + +// node_modules/monaco-editor-core/esm/vs/platform/history/browser/historyWidgetKeybindingHint.js +function showHistoryKeybindingHint(keybindingService) { + return keybindingService.lookupKeybinding("history.showPrevious")?.getElectronAccelerator() === "Up" && keybindingService.lookupKeybinding("history.showNext")?.getElectronAccelerator() === "Down"; +} + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/find/browser/findWidget.js +init_colorRegistry(); +init_themeService(); +init_themables(); +init_theme(); +init_types(); +var findCollapsedIcon = registerIcon("find-collapsed", Codicon.chevronRight, localize(956, "Icon to indicate that the editor find widget is collapsed.")); +var findExpandedIcon = registerIcon("find-expanded", Codicon.chevronDown, localize(957, "Icon to indicate that the editor find widget is expanded.")); +var findSelectionIcon = registerIcon("find-selection", Codicon.selection, localize(958, "Icon for 'Find in Selection' in the editor find widget.")); +var findReplaceIcon = registerIcon("find-replace", Codicon.replace, localize(959, "Icon for 'Replace' in the editor find widget.")); +var findReplaceAllIcon = registerIcon("find-replace-all", Codicon.replaceAll, localize(960, "Icon for 'Replace All' in the editor find widget.")); +var findPreviousMatchIcon = registerIcon("find-previous-match", Codicon.arrowUp, localize(961, "Icon for 'Find Previous' in the editor find widget.")); +var findNextMatchIcon = registerIcon("find-next-match", Codicon.arrowDown, localize(962, "Icon for 'Find Next' in the editor find widget.")); +var NLS_FIND_DIALOG_LABEL = localize(963, "Find / Replace"); +var NLS_FIND_INPUT_LABEL = localize(964, "Find"); +var NLS_FIND_INPUT_PLACEHOLDER = localize(965, "Find"); +var NLS_PREVIOUS_MATCH_BTN_LABEL = localize(966, "Previous Match"); +var NLS_NEXT_MATCH_BTN_LABEL = localize(967, "Next Match"); +var NLS_TOGGLE_SELECTION_FIND_TITLE = localize(968, "Find in Selection"); +var NLS_CLOSE_BTN_LABEL = localize(969, "Close"); +var NLS_REPLACE_INPUT_LABEL = localize(970, "Replace"); +var NLS_REPLACE_INPUT_PLACEHOLDER = localize(971, "Replace"); +var NLS_REPLACE_BTN_LABEL = localize(972, "Replace"); +var NLS_REPLACE_ALL_BTN_LABEL = localize(973, "Replace All"); +var NLS_TOGGLE_REPLACE_MODE_BTN_LABEL = localize(974, "Toggle Replace"); +var NLS_MATCHES_COUNT_LIMIT_TITLE = localize(975, "Only the first {0} results are highlighted, but all find operations work on the entire text.", MATCHES_LIMIT); +var NLS_MATCHES_LOCATION = localize(976, "{0} of {1}"); +var NLS_NO_RESULTS = localize(977, "No results"); +var FIND_WIDGET_INITIAL_WIDTH = 419; +var PART_WIDTH = 275; +var FIND_INPUT_AREA_WIDTH = PART_WIDTH - 54; +var MAX_MATCHES_COUNT_WIDTH = 69; +var FIND_INPUT_AREA_HEIGHT = 33; +var ctrlKeyMod2 = isMacintosh ? 256 : 2048; +var FindWidgetViewZone = class { + constructor(afterLineNumber) { + this.afterLineNumber = afterLineNumber; + this.heightInPx = FIND_INPUT_AREA_HEIGHT; + this.suppressMouseDown = false; + this.domNode = document.createElement("div"); + this.domNode.className = "dock-find-viewzone"; + } +}; +function stopPropagationForMultiLineUpwards(event, value, textarea) { + const isMultiline = !!value.match(/\n/); + if (textarea && isMultiline && textarea.selectionStart > 0) { + event.stopPropagation(); + return; + } +} +function stopPropagationForMultiLineDownwards(event, value, textarea) { + const isMultiline = !!value.match(/\n/); + if (textarea && isMultiline && textarea.selectionEnd < textarea.value.length) { + event.stopPropagation(); + return; + } +} +var FindWidget = class _FindWidget extends Widget { + static { + this.ID = "editor.contrib.findWidget"; + } + constructor(codeEditor, controller, state, contextViewProvider, keybindingService, contextKeyService, _hoverService, _findWidgetSearchHistory, _replaceWidgetHistory) { + super(); + this._hoverService = _hoverService; + this._findWidgetSearchHistory = _findWidgetSearchHistory; + this._replaceWidgetHistory = _replaceWidgetHistory; + this._cachedHeight = null; + this._revealTimeouts = []; + this._codeEditor = codeEditor; + this._controller = controller; + this._state = state; + this._contextViewProvider = contextViewProvider; + this._keybindingService = keybindingService; + this._contextKeyService = contextKeyService; + this._isVisible = false; + this._isReplaceVisible = false; + this._ignoreChangeEvent = false; + this._updateHistoryDelayer = new Delayer(500); + this._register(toDisposable(() => this._updateHistoryDelayer.cancel())); + this._register(this._state.onFindReplaceStateChange((e) => this._onStateChanged(e))); + this._buildDomNode(); + this._updateButtons(); + this._tryUpdateWidgetWidth(); + this._findInput.inputBox.layout(); + this._register(this._codeEditor.onDidChangeConfiguration((e) => { + if (e.hasChanged( + 104 + /* EditorOption.readOnly */ + )) { + if (this._codeEditor.getOption( + 104 + /* EditorOption.readOnly */ + )) { + this._state.change({ isReplaceRevealed: false }, false); + } + this._updateButtons(); + } + if (e.hasChanged( + 165 + /* EditorOption.layoutInfo */ + )) { + this._tryUpdateWidgetWidth(); + } + if (e.hasChanged( + 2 + /* EditorOption.accessibilitySupport */ + )) { + this.updateAccessibilitySupport(); + } + if (e.hasChanged( + 50 + /* EditorOption.find */ + )) { + const supportLoop = this._codeEditor.getOption( + 50 + /* EditorOption.find */ + ).loop; + this._state.change({ loop: supportLoop }, false); + const addExtraSpaceOnTop = this._codeEditor.getOption( + 50 + /* EditorOption.find */ + ).addExtraSpaceOnTop; + if (addExtraSpaceOnTop && !this._viewZone) { + this._viewZone = new FindWidgetViewZone(0); + this._showViewZone(); + } + if (!addExtraSpaceOnTop && this._viewZone) { + this._removeViewZone(); + } + } + })); + this.updateAccessibilitySupport(); + this._register(this._codeEditor.onDidChangeCursorSelection(() => { + if (this._isVisible) { + this._updateToggleSelectionFindButton(); + } + })); + this._register(this._codeEditor.onDidFocusEditorWidget(async () => { + if (this._isVisible) { + const globalBufferTerm = await this._controller.getGlobalBufferTerm(); + if (globalBufferTerm && globalBufferTerm !== this._state.searchString) { + this._state.change({ searchString: globalBufferTerm }, false); + this._findInput.select(); + } + } + })); + this._findInputFocused = CONTEXT_FIND_INPUT_FOCUSED.bindTo(contextKeyService); + this._findFocusTracker = this._register(trackFocus(this._findInput.inputBox.inputElement)); + this._register(this._findFocusTracker.onDidFocus(() => { + this._findInputFocused.set(true); + this._updateSearchScope(); + })); + this._register(this._findFocusTracker.onDidBlur(() => { + this._findInputFocused.set(false); + })); + this._replaceInputFocused = CONTEXT_REPLACE_INPUT_FOCUSED.bindTo(contextKeyService); + this._replaceFocusTracker = this._register(trackFocus(this._replaceInput.inputBox.inputElement)); + this._register(this._replaceFocusTracker.onDidFocus(() => { + this._replaceInputFocused.set(true); + this._updateSearchScope(); + })); + this._register(this._replaceFocusTracker.onDidBlur(() => { + this._replaceInputFocused.set(false); + })); + this._codeEditor.addOverlayWidget(this); + if (this._codeEditor.getOption( + 50 + /* EditorOption.find */ + ).addExtraSpaceOnTop) { + this._viewZone = new FindWidgetViewZone(0); + } + this._register(this._codeEditor.onDidChangeModel(() => { + if (!this._isVisible) { + return; + } + this._viewZoneId = void 0; + })); + this._register(this._codeEditor.onDidScrollChange((e) => { + if (e.scrollTopChanged) { + this._layoutViewZone(); + return; + } + setTimeout(() => { + this._layoutViewZone(); + }, 0); + })); + } + // ----- IOverlayWidget API + getId() { + return _FindWidget.ID; + } + getDomNode() { + return this._domNode; + } + getPosition() { + if (this._isVisible) { + return { + preference: 0 + /* OverlayWidgetPositionPreference.TOP_RIGHT_CORNER */ + }; + } + return null; + } + // ----- React to state changes + _onStateChanged(e) { + if (e.searchString) { + try { + this._ignoreChangeEvent = true; + this._findInput.setValue(this._state.searchString); + } finally { + this._ignoreChangeEvent = false; + } + this._updateButtons(); + } + if (e.replaceString) { + this._replaceInput.inputBox.value = this._state.replaceString; + } + if (e.isRevealed) { + if (this._state.isRevealed) { + this._reveal(); + } else { + this._hide(true); + } + } + if (e.isReplaceRevealed) { + if (this._state.isReplaceRevealed) { + if (!this._codeEditor.getOption( + 104 + /* EditorOption.readOnly */ + ) && !this._isReplaceVisible) { + this._isReplaceVisible = true; + this._replaceInput.width = getTotalWidth(this._findInput.domNode); + this._updateButtons(); + this._replaceInput.inputBox.layout(); + } + } else { + if (this._isReplaceVisible) { + this._isReplaceVisible = false; + this._updateButtons(); + } + } + } + if ((e.isRevealed || e.isReplaceRevealed) && (this._state.isRevealed || this._state.isReplaceRevealed)) { + if (this._tryUpdateHeight()) { + this._showViewZone(); + } + } + if (e.isRegex) { + this._findInput.setRegex(this._state.isRegex); + } + if (e.wholeWord) { + this._findInput.setWholeWords(this._state.wholeWord); + } + if (e.matchCase) { + this._findInput.setCaseSensitive(this._state.matchCase); + } + if (e.preserveCase) { + this._replaceInput.setPreserveCase(this._state.preserveCase); + } + if (e.searchScope) { + if (this._state.searchScope) { + this._toggleSelectionFind.checked = true; + } else { + this._toggleSelectionFind.checked = false; + } + this._updateToggleSelectionFindButton(); + } + if (e.searchString || e.matchesCount || e.matchesPosition) { + const showRedOutline = this._state.searchString.length > 0 && this._state.matchesCount === 0; + this._domNode.classList.toggle("no-results", showRedOutline); + this._updateMatchesCount(); + this._updateButtons(); + } + if (e.searchString || e.currentMatch) { + this._layoutViewZone(); + } + if (e.updateHistory) { + this._delayedUpdateHistory(); + } + if (e.loop) { + this._updateButtons(); + } + } + _delayedUpdateHistory() { + this._updateHistoryDelayer.trigger(this._updateHistory.bind(this)).then(void 0, onUnexpectedError); + } + _updateHistory() { + if (this._state.searchString) { + this._findInput.inputBox.addToHistory(); + } + if (this._state.replaceString) { + this._replaceInput.inputBox.addToHistory(); + } + } + _updateMatchesCount() { + this._matchesCount.style.minWidth = MAX_MATCHES_COUNT_WIDTH + "px"; + if (this._state.matchesCount >= MATCHES_LIMIT) { + this._matchesCount.title = NLS_MATCHES_COUNT_LIMIT_TITLE; + } else { + this._matchesCount.title = ""; + } + this._matchesCount.firstChild?.remove(); + let label; + if (this._state.matchesCount > 0) { + let matchesCount = String(this._state.matchesCount); + if (this._state.matchesCount >= MATCHES_LIMIT) { + matchesCount += "+"; + } + let matchesPosition = String(this._state.matchesPosition); + if (matchesPosition === "0") { + matchesPosition = "?"; + } + label = format(NLS_MATCHES_LOCATION, matchesPosition, matchesCount); + } else { + label = NLS_NO_RESULTS; + } + this._matchesCount.appendChild(document.createTextNode(label)); + alert(this._getAriaLabel(label, this._state.currentMatch, this._state.searchString)); + MAX_MATCHES_COUNT_WIDTH = Math.max(MAX_MATCHES_COUNT_WIDTH, this._matchesCount.clientWidth); + } + // ----- actions + _getAriaLabel(label, currentMatch, searchString) { + if (label === NLS_NO_RESULTS) { + return searchString === "" ? localize(978, "{0} found", label) : localize(979, "{0} found for '{1}'", label, searchString); + } + if (currentMatch) { + const ariaLabel = localize(980, "{0} found for '{1}', at {2}", label, searchString, currentMatch.startLineNumber + ":" + currentMatch.startColumn); + const model = this._codeEditor.getModel(); + if (model && currentMatch.startLineNumber <= model.getLineCount() && currentMatch.startLineNumber >= 1) { + const lineContent = model.getLineContent(currentMatch.startLineNumber); + return `${lineContent}, ${ariaLabel}`; + } + return ariaLabel; + } + return localize(981, "{0} found for '{1}'", label, searchString); + } + /** + * If 'selection find' is ON we should not disable the button (its function is to cancel 'selection find'). + * If 'selection find' is OFF we enable the button only if there is a selection. + */ + _updateToggleSelectionFindButton() { + const selection = this._codeEditor.getSelection(); + const isSelection = selection ? selection.startLineNumber !== selection.endLineNumber || selection.startColumn !== selection.endColumn : false; + const isChecked = this._toggleSelectionFind.checked; + if (this._isVisible && (isChecked || isSelection)) { + this._toggleSelectionFind.enable(); + } else { + this._toggleSelectionFind.disable(); + } + } + _updateButtons() { + this._findInput.setEnabled(this._isVisible); + this._replaceInput.setEnabled(this._isVisible && this._isReplaceVisible); + this._updateToggleSelectionFindButton(); + this._closeBtn.setEnabled(this._isVisible); + const findInputIsNonEmpty = this._state.searchString.length > 0; + const matchesCount = this._state.matchesCount ? true : false; + this._prevBtn.setEnabled(this._isVisible && findInputIsNonEmpty && matchesCount && this._state.canNavigateBack()); + this._nextBtn.setEnabled(this._isVisible && findInputIsNonEmpty && matchesCount && this._state.canNavigateForward()); + this._replaceBtn.setEnabled(this._isVisible && this._isReplaceVisible && findInputIsNonEmpty); + this._replaceAllBtn.setEnabled(this._isVisible && this._isReplaceVisible && findInputIsNonEmpty); + this._domNode.classList.toggle("replaceToggled", this._isReplaceVisible); + this._toggleReplaceBtn.setExpanded(this._isReplaceVisible); + const canReplace = !this._codeEditor.getOption( + 104 + /* EditorOption.readOnly */ + ); + this._toggleReplaceBtn.setEnabled(this._isVisible && canReplace); + } + _reveal() { + this._revealTimeouts.forEach((e) => { + clearTimeout(e); + }); + this._revealTimeouts = []; + if (!this._isVisible) { + this._isVisible = true; + const selection = this._codeEditor.getSelection(); + switch (this._codeEditor.getOption( + 50 + /* EditorOption.find */ + ).autoFindInSelection) { + case "always": + this._toggleSelectionFind.checked = true; + break; + case "never": + this._toggleSelectionFind.checked = false; + break; + case "multiline": { + const isSelectionMultipleLine = !!selection && selection.startLineNumber !== selection.endLineNumber; + this._toggleSelectionFind.checked = isSelectionMultipleLine; + break; + } + default: + break; + } + this._tryUpdateWidgetWidth(); + this._updateButtons(); + this._revealTimeouts.push(setTimeout(() => { + this._domNode.classList.add("visible"); + this._domNode.setAttribute("aria-hidden", "false"); + }, 0)); + this._revealTimeouts.push(setTimeout(() => { + this._findInput.validate(); + }, 200)); + this._codeEditor.layoutOverlayWidget(this); + let adjustEditorScrollTop = true; + if (this._codeEditor.getOption( + 50 + /* EditorOption.find */ + ).seedSearchStringFromSelection && selection) { + const domNode = this._codeEditor.getDomNode(); + if (domNode) { + const editorCoords = getDomNodePagePosition(domNode); + const startCoords = this._codeEditor.getScrolledVisiblePosition(selection.getStartPosition()); + const startLeft = editorCoords.left + (startCoords ? startCoords.left : 0); + const startTop = startCoords ? startCoords.top : 0; + if (this._viewZone && startTop < this._viewZone.heightInPx) { + if (selection.endLineNumber > selection.startLineNumber) { + adjustEditorScrollTop = false; + } + const leftOfFindWidget = getTopLeftOffset(this._domNode).left; + if (startLeft > leftOfFindWidget) { + adjustEditorScrollTop = false; + } + const endCoords = this._codeEditor.getScrolledVisiblePosition(selection.getEndPosition()); + const endLeft = editorCoords.left + (endCoords ? endCoords.left : 0); + if (endLeft > leftOfFindWidget) { + adjustEditorScrollTop = false; + } + } + } + } + this._showViewZone(adjustEditorScrollTop); + } + } + _hide(focusTheEditor) { + this._revealTimeouts.forEach((e) => { + clearTimeout(e); + }); + this._revealTimeouts = []; + if (this._isVisible) { + this._isVisible = false; + this._updateButtons(); + this._domNode.classList.remove("visible"); + this._domNode.setAttribute("aria-hidden", "true"); + this._findInput.clearMessage(); + if (focusTheEditor) { + this._codeEditor.focus(); + } + this._codeEditor.layoutOverlayWidget(this); + this._removeViewZone(); + } + } + _layoutViewZone(targetScrollTop) { + const addExtraSpaceOnTop = this._codeEditor.getOption( + 50 + /* EditorOption.find */ + ).addExtraSpaceOnTop; + if (!addExtraSpaceOnTop) { + this._removeViewZone(); + return; + } + if (!this._isVisible) { + return; + } + const viewZone = this._viewZone; + if (this._viewZoneId !== void 0 || !viewZone) { + return; + } + this._codeEditor.changeViewZones((accessor) => { + viewZone.heightInPx = this._getHeight(); + this._viewZoneId = accessor.addZone(viewZone); + this._codeEditor.setScrollTop(targetScrollTop || this._codeEditor.getScrollTop() + viewZone.heightInPx); + }); + } + _showViewZone(adjustScroll = true) { + if (!this._isVisible) { + return; + } + const addExtraSpaceOnTop = this._codeEditor.getOption( + 50 + /* EditorOption.find */ + ).addExtraSpaceOnTop; + if (!addExtraSpaceOnTop) { + return; + } + if (this._viewZone === void 0) { + this._viewZone = new FindWidgetViewZone(0); + } + const viewZone = this._viewZone; + this._codeEditor.changeViewZones((accessor) => { + if (this._viewZoneId !== void 0) { + const newHeight = this._getHeight(); + if (newHeight === viewZone.heightInPx) { + return; + } + const scrollAdjustment = newHeight - viewZone.heightInPx; + viewZone.heightInPx = newHeight; + accessor.layoutZone(this._viewZoneId); + if (adjustScroll) { + this._codeEditor.setScrollTop(this._codeEditor.getScrollTop() + scrollAdjustment); + } + return; + } else { + let scrollAdjustment = this._getHeight(); + scrollAdjustment -= this._codeEditor.getOption( + 96 + /* EditorOption.padding */ + ).top; + if (scrollAdjustment <= 0) { + return; + } + viewZone.heightInPx = scrollAdjustment; + this._viewZoneId = accessor.addZone(viewZone); + if (adjustScroll) { + this._codeEditor.setScrollTop(this._codeEditor.getScrollTop() + scrollAdjustment); + } + } + }); + } + _removeViewZone() { + this._codeEditor.changeViewZones((accessor) => { + if (this._viewZoneId !== void 0) { + accessor.removeZone(this._viewZoneId); + this._viewZoneId = void 0; + if (this._viewZone) { + this._codeEditor.setScrollTop(this._codeEditor.getScrollTop() - this._viewZone.heightInPx); + this._viewZone = void 0; + } + } + }); + } + _tryUpdateWidgetWidth() { + if (!this._isVisible) { + return; + } + if (!this._domNode.isConnected) { + return; + } + const layoutInfo = this._codeEditor.getLayoutInfo(); + const editorContentWidth = layoutInfo.contentWidth; + if (editorContentWidth <= 0) { + this._domNode.classList.add("hiddenEditor"); + return; + } else if (this._domNode.classList.contains("hiddenEditor")) { + this._domNode.classList.remove("hiddenEditor"); + } + const editorWidth = layoutInfo.width; + const minimapWidth = layoutInfo.minimap.minimapWidth; + let collapsedFindWidget = false; + let reducedFindWidget = false; + let narrowFindWidget = false; + if (this._resized) { + const widgetWidth = getTotalWidth(this._domNode); + if (widgetWidth > FIND_WIDGET_INITIAL_WIDTH) { + this._domNode.style.maxWidth = `${editorWidth - 28 - minimapWidth - 15}px`; + this._replaceInput.width = getTotalWidth(this._findInput.domNode); + return; + } + } + if (FIND_WIDGET_INITIAL_WIDTH + 28 + minimapWidth >= editorWidth) { + reducedFindWidget = true; + } + if (FIND_WIDGET_INITIAL_WIDTH + 28 + minimapWidth - MAX_MATCHES_COUNT_WIDTH >= editorWidth) { + narrowFindWidget = true; + } + if (FIND_WIDGET_INITIAL_WIDTH + 28 + minimapWidth - MAX_MATCHES_COUNT_WIDTH >= editorWidth + 50) { + collapsedFindWidget = true; + } + this._domNode.classList.toggle("collapsed-find-widget", collapsedFindWidget); + this._domNode.classList.toggle("narrow-find-widget", narrowFindWidget); + this._domNode.classList.toggle("reduced-find-widget", reducedFindWidget); + if (!narrowFindWidget && !collapsedFindWidget) { + this._domNode.style.maxWidth = `${editorWidth - 28 - minimapWidth - 15}px`; + } + this._findInput.layout({ collapsedFindWidget, narrowFindWidget, reducedFindWidget }); + if (this._resized) { + const findInputWidth = this._findInput.inputBox.element.clientWidth; + if (findInputWidth > 0) { + this._replaceInput.width = findInputWidth; + } + } else if (this._isReplaceVisible) { + this._replaceInput.width = getTotalWidth(this._findInput.domNode); + } + } + _getHeight() { + let totalheight = 0; + totalheight += 4; + totalheight += this._findInput.inputBox.height + 2; + if (this._isReplaceVisible) { + totalheight += 4; + totalheight += this._replaceInput.inputBox.height + 2; + } + totalheight += 4; + return totalheight; + } + _tryUpdateHeight() { + const totalHeight = this._getHeight(); + if (this._cachedHeight !== null && this._cachedHeight === totalHeight) { + return false; + } + this._cachedHeight = totalHeight; + this._domNode.style.height = `${totalHeight}px`; + return true; + } + // ----- Public + focusFindInput() { + this._findInput.select(); + this._findInput.focus(); + } + focusReplaceInput() { + this._replaceInput.select(); + this._replaceInput.focus(); + } + highlightFindOptions() { + this._findInput.highlightFindOptions(); + } + _updateSearchScope() { + if (!this._codeEditor.hasModel()) { + return; + } + if (this._toggleSelectionFind.checked) { + const selections = this._codeEditor.getSelections(); + selections.map((selection) => { + if (selection.endColumn === 1 && selection.endLineNumber > selection.startLineNumber) { + selection = selection.setEndPosition(selection.endLineNumber - 1, this._codeEditor.getModel().getLineMaxColumn(selection.endLineNumber - 1)); + } + const currentMatch = this._state.currentMatch; + if (selection.startLineNumber !== selection.endLineNumber) { + if (!Range.equalsRange(selection, currentMatch)) { + return selection; + } + } + return null; + }).filter((element) => !!element); + if (selections.length) { + this._state.change({ searchScope: selections }, true); + } + } + } + _onFindInputMouseDown(e) { + if (e.middleButton) { + e.stopPropagation(); + } + } + _onFindInputKeyDown(e) { + if (e.equals( + ctrlKeyMod2 | 3 + /* KeyCode.Enter */ + )) { + if (this._keybindingService.dispatchEvent(e, e.target)) { + e.preventDefault(); + return; + } else { + this._findInput.inputBox.insertAtCursor("\n"); + e.preventDefault(); + return; + } + } + if (e.equals( + 2 + /* KeyCode.Tab */ + )) { + if (this._isReplaceVisible) { + this._replaceInput.focus(); + } else { + this._findInput.focusOnCaseSensitive(); + } + e.preventDefault(); + return; + } + if (e.equals( + 2048 | 18 + /* KeyCode.DownArrow */ + )) { + this._codeEditor.focus(); + e.preventDefault(); + return; + } + if (e.equals( + 16 + /* KeyCode.UpArrow */ + )) { + return stopPropagationForMultiLineUpwards(e, this._findInput.getValue(), this._findInput.domNode.querySelector("textarea")); + } + if (e.equals( + 18 + /* KeyCode.DownArrow */ + )) { + return stopPropagationForMultiLineDownwards(e, this._findInput.getValue(), this._findInput.domNode.querySelector("textarea")); + } + } + _onReplaceInputKeyDown(e) { + if (e.equals( + ctrlKeyMod2 | 3 + /* KeyCode.Enter */ + )) { + if (this._keybindingService.dispatchEvent(e, e.target)) { + e.preventDefault(); + return; + } else { + this._replaceInput.inputBox.insertAtCursor("\n"); + e.preventDefault(); + return; + } + } + if (e.equals( + 2 + /* KeyCode.Tab */ + )) { + this._findInput.focusOnCaseSensitive(); + e.preventDefault(); + return; + } + if (e.equals( + 1024 | 2 + /* KeyCode.Tab */ + )) { + this._findInput.focus(); + e.preventDefault(); + return; + } + if (e.equals( + 2048 | 18 + /* KeyCode.DownArrow */ + )) { + this._codeEditor.focus(); + e.preventDefault(); + return; + } + if (e.equals( + 16 + /* KeyCode.UpArrow */ + )) { + return stopPropagationForMultiLineUpwards(e, this._replaceInput.inputBox.value, this._replaceInput.inputBox.element.querySelector("textarea")); + } + if (e.equals( + 18 + /* KeyCode.DownArrow */ + )) { + return stopPropagationForMultiLineDownwards(e, this._replaceInput.inputBox.value, this._replaceInput.inputBox.element.querySelector("textarea")); + } + } + // ----- sash + getVerticalSashLeft(_sash) { + return 0; + } + // ----- initialization + _keybindingLabelFor(actionId) { + const kb = this._keybindingService.lookupKeybinding(actionId); + if (!kb) { + return ""; + } + return ` (${kb.getLabel()})`; + } + _buildDomNode() { + const flexibleHeight = true; + const flexibleWidth = true; + const findSearchHistoryConfig = this._codeEditor.getOption( + 50 + /* EditorOption.find */ + ).history; + const replaceHistoryConfig = this._codeEditor.getOption( + 50 + /* EditorOption.find */ + ).replaceHistory; + this._findInput = this._register(new ContextScopedFindInput(null, this._contextViewProvider, { + width: FIND_INPUT_AREA_WIDTH, + label: NLS_FIND_INPUT_LABEL, + placeholder: NLS_FIND_INPUT_PLACEHOLDER, + appendCaseSensitiveLabel: this._keybindingLabelFor(FIND_IDS.ToggleCaseSensitiveCommand), + appendWholeWordsLabel: this._keybindingLabelFor(FIND_IDS.ToggleWholeWordCommand), + appendRegexLabel: this._keybindingLabelFor(FIND_IDS.ToggleRegexCommand), + validation: (value) => { + if (value.length === 0 || !this._findInput.getRegex()) { + return null; + } + try { + new RegExp(value, "gu"); + return null; + } catch (e) { + return { content: e.message }; + } + }, + flexibleHeight, + flexibleWidth, + flexibleMaxHeight: 118, + showCommonFindToggles: true, + showHistoryHint: () => showHistoryKeybindingHint(this._keybindingService), + inputBoxStyles: defaultInputBoxStyles, + toggleStyles: defaultToggleStyles, + history: findSearchHistoryConfig === "workspace" ? this._findWidgetSearchHistory : /* @__PURE__ */ new Set([]) + }, this._contextKeyService)); + this._findInput.setRegex(!!this._state.isRegex); + this._findInput.setCaseSensitive(!!this._state.matchCase); + this._findInput.setWholeWords(!!this._state.wholeWord); + this._register(this._findInput.onKeyDown((e) => { + if (e.equals( + 3 + /* KeyCode.Enter */ + ) && !this._codeEditor.getOption( + 50 + /* EditorOption.find */ + ).findOnType) { + this._state.change({ searchString: this._findInput.getValue() }, true); + } + this._onFindInputKeyDown(e); + })); + this._register(this._findInput.inputBox.onDidChange(() => { + if (this._ignoreChangeEvent || !this._codeEditor.getOption( + 50 + /* EditorOption.find */ + ).findOnType) { + return; + } + this._state.change({ searchString: this._findInput.getValue() }, true); + })); + this._register(this._findInput.onDidOptionChange(() => { + this._state.change({ + isRegex: this._findInput.getRegex(), + wholeWord: this._findInput.getWholeWords(), + matchCase: this._findInput.getCaseSensitive() + }, true); + })); + this._register(this._findInput.onCaseSensitiveKeyDown((e) => { + if (e.equals( + 1024 | 2 + /* KeyCode.Tab */ + )) { + if (this._isReplaceVisible) { + this._replaceInput.focus(); + e.preventDefault(); + } + } + })); + this._register(this._findInput.onRegexKeyDown((e) => { + if (e.equals( + 2 + /* KeyCode.Tab */ + )) { + if (this._isReplaceVisible) { + this._replaceInput.focusOnPreserve(); + e.preventDefault(); + } + } + })); + this._register(this._findInput.inputBox.onDidHeightChange((e) => { + if (this._tryUpdateHeight()) { + this._showViewZone(); + } + })); + if (isLinux) { + this._register(this._findInput.onMouseDown((e) => this._onFindInputMouseDown(e))); + } + this._matchesCount = document.createElement("div"); + this._matchesCount.className = "matchesCount"; + this._updateMatchesCount(); + const hoverLifecycleOptions = { groupId: "find-widget" }; + this._prevBtn = this._register(new SimpleButton({ + label: NLS_PREVIOUS_MATCH_BTN_LABEL + this._keybindingLabelFor(FIND_IDS.PreviousMatchFindAction), + icon: findPreviousMatchIcon, + hoverLifecycleOptions, + onTrigger: () => { + assertReturnsDefined(this._codeEditor.getAction(FIND_IDS.PreviousMatchFindAction)).run().then(void 0, onUnexpectedError); + } + }, this._hoverService)); + this._nextBtn = this._register(new SimpleButton({ + label: NLS_NEXT_MATCH_BTN_LABEL + this._keybindingLabelFor(FIND_IDS.NextMatchFindAction), + icon: findNextMatchIcon, + hoverLifecycleOptions, + onTrigger: () => { + assertReturnsDefined(this._codeEditor.getAction(FIND_IDS.NextMatchFindAction)).run().then(void 0, onUnexpectedError); + } + }, this._hoverService)); + const findPart = document.createElement("div"); + findPart.className = "find-part"; + findPart.appendChild(this._findInput.domNode); + const actionsContainer = document.createElement("div"); + actionsContainer.className = "find-actions"; + findPart.appendChild(actionsContainer); + actionsContainer.appendChild(this._matchesCount); + actionsContainer.appendChild(this._prevBtn.domNode); + actionsContainer.appendChild(this._nextBtn.domNode); + this._toggleSelectionFind = this._register(new Toggle({ + icon: findSelectionIcon, + title: NLS_TOGGLE_SELECTION_FIND_TITLE + this._keybindingLabelFor(FIND_IDS.ToggleSearchScopeCommand), + isChecked: false, + hoverLifecycleOptions, + inputActiveOptionBackground: asCssVariable(inputActiveOptionBackground), + inputActiveOptionBorder: asCssVariable(inputActiveOptionBorder), + inputActiveOptionForeground: asCssVariable(inputActiveOptionForeground) + })); + this._register(this._toggleSelectionFind.onChange(() => { + if (this._toggleSelectionFind.checked) { + if (this._codeEditor.hasModel()) { + let selections = this._codeEditor.getSelections(); + selections = selections.map((selection) => { + if (selection.endColumn === 1 && selection.endLineNumber > selection.startLineNumber) { + selection = selection.setEndPosition(selection.endLineNumber - 1, this._codeEditor.getModel().getLineMaxColumn(selection.endLineNumber - 1)); + } + if (!selection.isEmpty()) { + return selection; + } + return null; + }).filter((element) => !!element); + if (selections.length) { + this._state.change({ searchScope: selections }, true); + } + } + } else { + this._state.change({ searchScope: null }, true); + } + })); + actionsContainer.appendChild(this._toggleSelectionFind.domNode); + this._closeBtn = this._register(new SimpleButton({ + label: NLS_CLOSE_BTN_LABEL + this._keybindingLabelFor(FIND_IDS.CloseFindWidgetCommand), + icon: widgetClose, + hoverLifecycleOptions, + onTrigger: () => { + this._state.change({ isRevealed: false, searchScope: null }, false); + }, + onKeyDown: (e) => { + if (e.equals( + 2 + /* KeyCode.Tab */ + )) { + if (this._isReplaceVisible) { + if (this._replaceBtn.isEnabled()) { + this._replaceBtn.focus(); + } else { + this._codeEditor.focus(); + } + e.preventDefault(); + } + } + } + }, this._hoverService)); + this._replaceInput = this._register(new ContextScopedReplaceInput(null, void 0, { + label: NLS_REPLACE_INPUT_LABEL, + placeholder: NLS_REPLACE_INPUT_PLACEHOLDER, + appendPreserveCaseLabel: this._keybindingLabelFor(FIND_IDS.TogglePreserveCaseCommand), + history: replaceHistoryConfig === "workspace" ? this._replaceWidgetHistory : /* @__PURE__ */ new Set([]), + flexibleHeight, + flexibleWidth, + flexibleMaxHeight: 118, + showHistoryHint: () => showHistoryKeybindingHint(this._keybindingService), + inputBoxStyles: defaultInputBoxStyles, + toggleStyles: defaultToggleStyles, + hoverLifecycleOptions + }, this._contextKeyService, true)); + this._replaceInput.setPreserveCase(!!this._state.preserveCase); + this._register(this._replaceInput.onKeyDown((e) => this._onReplaceInputKeyDown(e))); + this._register(this._replaceInput.inputBox.onDidChange(() => { + this._state.change({ replaceString: this._replaceInput.inputBox.value }, false); + })); + this._register(this._replaceInput.inputBox.onDidHeightChange((e) => { + if (this._isReplaceVisible && this._tryUpdateHeight()) { + this._showViewZone(); + } + })); + this._register(this._replaceInput.onDidOptionChange(() => { + this._state.change({ + preserveCase: this._replaceInput.getPreserveCase() + }, true); + })); + this._register(this._replaceInput.onPreserveCaseKeyDown((e) => { + if (e.equals( + 2 + /* KeyCode.Tab */ + )) { + if (this._prevBtn.isEnabled()) { + this._prevBtn.focus(); + } else if (this._nextBtn.isEnabled()) { + this._nextBtn.focus(); + } else if (this._toggleSelectionFind.enabled) { + this._toggleSelectionFind.focus(); + } else if (this._closeBtn.isEnabled()) { + this._closeBtn.focus(); + } + e.preventDefault(); + } + })); + this._replaceBtn = this._register(new SimpleButton({ + label: NLS_REPLACE_BTN_LABEL + this._keybindingLabelFor(FIND_IDS.ReplaceOneAction), + icon: findReplaceIcon, + hoverLifecycleOptions, + onTrigger: () => { + this._controller.replace(); + }, + onKeyDown: (e) => { + if (e.equals( + 1024 | 2 + /* KeyCode.Tab */ + )) { + this._closeBtn.focus(); + e.preventDefault(); + } + } + }, this._hoverService)); + this._replaceAllBtn = this._register(new SimpleButton({ + label: NLS_REPLACE_ALL_BTN_LABEL + this._keybindingLabelFor(FIND_IDS.ReplaceAllAction), + icon: findReplaceAllIcon, + hoverLifecycleOptions, + onTrigger: () => { + this._controller.replaceAll(); + } + }, this._hoverService)); + const replacePart = document.createElement("div"); + replacePart.className = "replace-part"; + replacePart.appendChild(this._replaceInput.domNode); + const replaceActionsContainer = document.createElement("div"); + replaceActionsContainer.className = "replace-actions"; + replacePart.appendChild(replaceActionsContainer); + replaceActionsContainer.appendChild(this._replaceBtn.domNode); + replaceActionsContainer.appendChild(this._replaceAllBtn.domNode); + this._toggleReplaceBtn = this._register(new SimpleButton({ + label: NLS_TOGGLE_REPLACE_MODE_BTN_LABEL, + className: "codicon toggle left", + onTrigger: () => { + this._state.change({ isReplaceRevealed: !this._isReplaceVisible }, false); + if (this._isReplaceVisible) { + this._replaceInput.width = getTotalWidth(this._findInput.domNode); + this._replaceInput.inputBox.layout(); + } + this._showViewZone(); + } + }, this._hoverService)); + this._toggleReplaceBtn.setExpanded(this._isReplaceVisible); + this._domNode = document.createElement("div"); + this._domNode.className = "editor-widget find-widget"; + this._domNode.setAttribute("aria-hidden", "true"); + this._domNode.ariaLabel = NLS_FIND_DIALOG_LABEL; + this._domNode.role = "dialog"; + this._domNode.style.width = `${FIND_WIDGET_INITIAL_WIDTH}px`; + this._domNode.appendChild(this._toggleReplaceBtn.domNode); + this._domNode.appendChild(findPart); + this._domNode.appendChild(this._closeBtn.domNode); + this._domNode.appendChild(replacePart); + this._resizeSash = this._register(new Sash(this._domNode, this, { orientation: 0, size: 2 })); + this._resized = false; + let originalWidth = FIND_WIDGET_INITIAL_WIDTH; + this._register(this._resizeSash.onDidStart(() => { + originalWidth = getTotalWidth(this._domNode); + })); + this._register(this._resizeSash.onDidChange((evt) => { + this._resized = true; + const width2 = originalWidth + evt.startX - evt.currentX; + if (width2 < FIND_WIDGET_INITIAL_WIDTH) { + return; + } + const maxWidth = parseFloat(getComputedStyle(this._domNode).maxWidth) || 0; + if (width2 > maxWidth) { + return; + } + this._domNode.style.width = `${width2}px`; + if (this._isReplaceVisible) { + this._replaceInput.width = getTotalWidth(this._findInput.domNode); + } + this._findInput.inputBox.layout(); + this._tryUpdateHeight(); + })); + this._register(this._resizeSash.onDidReset(() => { + const currentWidth = getTotalWidth(this._domNode); + if (currentWidth < FIND_WIDGET_INITIAL_WIDTH) { + return; + } + let width2 = FIND_WIDGET_INITIAL_WIDTH; + if (!this._resized || currentWidth === FIND_WIDGET_INITIAL_WIDTH) { + const layoutInfo = this._codeEditor.getLayoutInfo(); + width2 = layoutInfo.width - 28 - layoutInfo.minimap.minimapWidth - 15; + this._resized = true; + } else { + } + this._domNode.style.width = `${width2}px`; + if (this._isReplaceVisible) { + this._replaceInput.width = getTotalWidth(this._findInput.domNode); + } + this._findInput.inputBox.layout(); + })); + } + updateAccessibilitySupport() { + const value = this._codeEditor.getOption( + 2 + /* EditorOption.accessibilitySupport */ + ); + this._findInput.setFocusInputOnOptionClick( + value !== 2 + /* AccessibilitySupport.Enabled */ + ); + } + getViewState() { + let widgetViewZoneVisible = false; + if (this._viewZone && this._viewZoneId) { + widgetViewZoneVisible = this._viewZone.heightInPx > this._codeEditor.getScrollTop(); + } + return { + widgetViewZoneVisible, + scrollTop: this._codeEditor.getScrollTop() + }; + } + setViewState(state) { + if (!state) { + return; + } + if (state.widgetViewZoneVisible) { + this._layoutViewZone(state.scrollTop); + } + } +}; +var SimpleButton = class extends Widget { + constructor(opts, hoverService) { + super(); + this._opts = opts; + let className2 = "button"; + if (this._opts.className) { + className2 = className2 + " " + this._opts.className; + } + if (this._opts.icon) { + className2 = className2 + " " + ThemeIcon.asClassName(this._opts.icon); + } + this._domNode = document.createElement("div"); + this._domNode.tabIndex = 0; + this._domNode.className = className2; + this._domNode.setAttribute("role", "button"); + this._domNode.setAttribute("aria-label", this._opts.label); + this._register(hoverService.setupDelayedHover(this._domNode, { + content: this._opts.label, + style: 1 + }, opts.hoverLifecycleOptions)); + this.onclick(this._domNode, (e) => { + this._opts.onTrigger(); + e.preventDefault(); + }); + this.onkeydown(this._domNode, (e) => { + if (e.equals( + 10 + /* KeyCode.Space */ + ) || e.equals( + 3 + /* KeyCode.Enter */ + )) { + this._opts.onTrigger(); + e.preventDefault(); + return; + } + this._opts.onKeyDown?.(e); + }); + } + get domNode() { + return this._domNode; + } + isEnabled() { + return this._domNode.tabIndex >= 0; + } + focus() { + this._domNode.focus(); + } + setEnabled(enabled) { + this._domNode.classList.toggle("disabled", !enabled); + this._domNode.setAttribute("aria-disabled", String(!enabled)); + this._domNode.tabIndex = enabled ? 0 : -1; + } + setExpanded(expanded2) { + this._domNode.setAttribute("aria-expanded", String(!!expanded2)); + if (expanded2) { + this._domNode.classList.remove(...ThemeIcon.asClassNameArray(findCollapsedIcon)); + this._domNode.classList.add(...ThemeIcon.asClassNameArray(findExpandedIcon)); + } else { + this._domNode.classList.remove(...ThemeIcon.asClassNameArray(findExpandedIcon)); + this._domNode.classList.add(...ThemeIcon.asClassNameArray(findCollapsedIcon)); + } + } +}; +registerThemingParticipant((theme, collector) => { + const findMatchHighlightBorder = theme.getColor(editorFindMatchHighlightBorder); + if (findMatchHighlightBorder) { + collector.addRule(`.monaco-editor .findMatch { border: 1px ${isHighContrast(theme.type) ? "dotted" : "solid"} ${findMatchHighlightBorder}; box-sizing: border-box; }`); + } + const findRangeHighlightBorder = theme.getColor(editorFindRangeHighlightBorder); + if (findRangeHighlightBorder) { + collector.addRule(`.monaco-editor .findScope { border: 1px ${isHighContrast(theme.type) ? "dashed" : "solid"} ${findRangeHighlightBorder}; }`); + } + const hcBorder = theme.getColor(contrastBorder); + if (hcBorder) { + collector.addRule(`.monaco-editor .find-widget { border: 1px solid ${hcBorder}; }`); + } + const findMatchForeground = theme.getColor(editorFindMatchForeground); + if (findMatchForeground) { + collector.addRule(`.monaco-editor .findMatchInline { color: ${findMatchForeground}; }`); + } + const findMatchHighlightForeground = theme.getColor(editorFindMatchHighlightForeground); + if (findMatchHighlightForeground) { + collector.addRule(`.monaco-editor .currentFindMatchInline { color: ${findMatchHighlightForeground}; }`); + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/hover/browser/hoverCopyButton.js +var __decorate65 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param60 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var HoverCopyButton = class HoverCopyButton2 extends Disposable { + constructor(_container, _getContent, _clipboardService, _hoverService) { + super(); + this._container = _container; + this._getContent = _getContent; + this._clipboardService = _clipboardService; + this._hoverService = _hoverService; + this._container.classList.add("hover-row-with-copy"); + this._button = this._register(new SimpleButton({ + label: localize(1128, "Copy"), + icon: Codicon.copy, + onTrigger: () => this._copyContent(), + className: "hover-copy-button" + }, this._hoverService)); + this._container.appendChild(this._button.domNode); + } + async _copyContent() { + const content = this._getContent(); + if (content) { + await this._clipboardService.writeText(content); + status(localize(1129, "Copied to clipboard")); + } + } +}; +HoverCopyButton = __decorate65([ + __param60(2, IClipboardService), + __param60(3, IHoverService) +], HoverCopyButton); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/hover/browser/contentHoverRendered.js +init_textModel(); +init_position(); +init_range(); +init_dom(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/hover/browser/markdownHoverParticipant.js +init_dom(); +init_arrays(); +init_cancellation(); +init_htmlContent(); +init_lifecycle(); +init_range(); +init_nls(); +init_configuration(); +init_languageFeatures(); +init_languages(); +init_codicons(); +init_themables(); +init_errors(); +init_async(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/hover/browser/getHover.js +init_async(); +init_cancellation(); +init_errors(); +init_editorExtensions(); +init_languageFeatures(); +var HoverProviderResult = class { + constructor(provider, hover, ordinal) { + this.provider = provider; + this.hover = hover; + this.ordinal = ordinal; + } +}; +async function executeProvider(provider, ordinal, model, position, token) { + const result = await Promise.resolve(provider.provideHover(model, position, token)).catch(onUnexpectedExternalError); + if (!result || !isValid(result)) { + return void 0; + } + return new HoverProviderResult(provider, result, ordinal); +} +function getHoverProviderResultsAsAsyncIterable(registry, model, position, token, recursive = false) { + const providers = registry.ordered(model, recursive); + const promises = providers.map((provider, index) => executeProvider(provider, index, model, position, token)); + return AsyncIterableProducer.fromPromisesResolveOrder(promises).coalesce(); +} +async function getHoversPromise(registry, model, position, token, recursive = false) { + const out = []; + for await (const item of getHoverProviderResultsAsAsyncIterable(registry, model, position, token, recursive)) { + out.push(item.hover); + } + return out; +} +registerModelAndPositionCommand("_executeHoverProvider", (accessor, model, position) => { + const languageFeaturesService = accessor.get(ILanguageFeaturesService); + return getHoversPromise(languageFeaturesService.hoverProvider, model, position, CancellationToken.None); +}); +registerModelAndPositionCommand("_executeHoverProvider_recursive", (accessor, model, position) => { + const languageFeaturesService = accessor.get(ILanguageFeaturesService); + return getHoversPromise(languageFeaturesService.hoverProvider, model, position, CancellationToken.None, true); +}); +function isValid(result) { + const hasRange = typeof result.range !== "undefined"; + const hasHtmlContent = typeof result.contents !== "undefined" && result.contents && result.contents.length > 0; + return hasRange && hasHtmlContent; +} + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/hover/browser/markdownHoverParticipant.js +init_commands(); +var __decorate66 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param61 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var $7 = $; +var increaseHoverVerbosityIcon = registerIcon("hover-increase-verbosity", Codicon.add, localize(1130, "Icon for increaseing hover verbosity.")); +var decreaseHoverVerbosityIcon = registerIcon("hover-decrease-verbosity", Codicon.remove, localize(1131, "Icon for decreasing hover verbosity.")); +var MarkdownHover = class { + constructor(owner, range2, contents, isBeforeContent, ordinal, source = void 0) { + this.owner = owner; + this.range = range2; + this.contents = contents; + this.isBeforeContent = isBeforeContent; + this.ordinal = ordinal; + this.source = source; + } + isValidForHoverAnchor(anchor) { + return anchor.type === 1 && this.range.startColumn <= anchor.range.startColumn && this.range.endColumn >= anchor.range.endColumn; + } +}; +var HoverSource = class { + constructor(hover, hoverProvider, hoverPosition) { + this.hover = hover; + this.hoverProvider = hoverProvider; + this.hoverPosition = hoverPosition; + } + supportsVerbosityAction(hoverVerbosityAction) { + switch (hoverVerbosityAction) { + case HoverVerbosityAction.Increase: + return this.hover.canIncreaseVerbosity ?? false; + case HoverVerbosityAction.Decrease: + return this.hover.canDecreaseVerbosity ?? false; + } + } +}; +var MarkdownHoverParticipant = class MarkdownHoverParticipant2 { + constructor(_editor, _markdownRendererService, _configurationService, _languageFeaturesService, _keybindingService, _hoverService, _commandService) { + this._editor = _editor; + this._markdownRendererService = _markdownRendererService; + this._configurationService = _configurationService; + this._languageFeaturesService = _languageFeaturesService; + this._keybindingService = _keybindingService; + this._hoverService = _hoverService; + this._commandService = _commandService; + this.hoverOrdinal = 3; + } + createLoadingMessage(anchor) { + return new MarkdownHover(this, anchor.range, [new MarkdownString().appendText(localize(1132, "Loading..."))], false, 2e3); + } + computeSync(anchor, lineDecorations) { + if (!this._editor.hasModel() || anchor.type !== 1) { + return []; + } + const model = this._editor.getModel(); + const lineNumber = anchor.range.startLineNumber; + const maxColumn = model.getLineMaxColumn(lineNumber); + const result = []; + let index = 1e3; + const lineLength = model.getLineLength(lineNumber); + const languageId = model.getLanguageIdAtPosition(anchor.range.startLineNumber, anchor.range.startColumn); + const stopRenderingLineAfter = this._editor.getOption( + 133 + /* EditorOption.stopRenderingLineAfter */ + ); + const maxTokenizationLineLength = this._configurationService.getValue("editor.maxTokenizationLineLength", { + overrideIdentifier: languageId + }); + let stopRenderingMessage = false; + if (stopRenderingLineAfter >= 0 && lineLength > stopRenderingLineAfter && anchor.range.startColumn >= stopRenderingLineAfter) { + stopRenderingMessage = true; + result.push(new MarkdownHover(this, anchor.range, [{ + value: localize(1133, "Rendering paused for long line for performance reasons. This can be configured via `editor.stopRenderingLineAfter`.") + }], false, index++)); + } + if (!stopRenderingMessage && typeof maxTokenizationLineLength === "number" && lineLength >= maxTokenizationLineLength) { + result.push(new MarkdownHover(this, anchor.range, [{ + value: localize(1134, "Tokenization is skipped for long lines for performance reasons. This can be configured via `editor.maxTokenizationLineLength`.") + }], false, index++)); + } + let isBeforeContent = false; + for (const d of lineDecorations) { + const startColumn = d.range.startLineNumber === lineNumber ? d.range.startColumn : 1; + const endColumn = d.range.endLineNumber === lineNumber ? d.range.endColumn : maxColumn; + const hoverMessage = d.options.hoverMessage; + if (!hoverMessage || isEmptyMarkdownString(hoverMessage)) { + continue; + } + if (d.options.beforeContentClassName) { + isBeforeContent = true; + } + const range2 = new Range(anchor.range.startLineNumber, startColumn, anchor.range.startLineNumber, endColumn); + result.push(new MarkdownHover(this, range2, asArray(hoverMessage), isBeforeContent, index++)); + } + return result; + } + computeAsync(anchor, lineDecorations, source, token) { + if (!this._editor.hasModel() || anchor.type !== 1) { + return AsyncIterableProducer.EMPTY; + } + const model = this._editor.getModel(); + const hoverProviderRegistry = this._languageFeaturesService.hoverProvider; + if (!hoverProviderRegistry.has(model)) { + return AsyncIterableProducer.EMPTY; + } + return this._getMarkdownHovers(hoverProviderRegistry, model, anchor, token); + } + async *_getMarkdownHovers(hoverProviderRegistry, model, anchor, token) { + const position = anchor.range.getStartPosition(); + const hoverProviderResults = getHoverProviderResultsAsAsyncIterable(hoverProviderRegistry, model, position, token); + for await (const item of hoverProviderResults) { + if (!isEmptyMarkdownString(item.hover.contents)) { + const range2 = item.hover.range ? Range.lift(item.hover.range) : anchor.range; + const hoverSource = new HoverSource(item.hover, item.provider, position); + yield new MarkdownHover(this, range2, item.hover.contents, false, item.ordinal, hoverSource); + } + } + } + renderHoverParts(context, hoverParts) { + this._renderedHoverParts = new MarkdownRenderedHoverParts(hoverParts, context.fragment, this, this._editor, this._commandService, this._keybindingService, this._hoverService, this._configurationService, this._markdownRendererService, context.onContentsChanged); + return this._renderedHoverParts; + } + handleScroll(e) { + this._renderedHoverParts?.handleScroll(e); + } + getAccessibleContent(hoverPart) { + return this._renderedHoverParts?.getAccessibleContent(hoverPart) ?? ""; + } + updateMarkdownHoverVerbosityLevel(action, index) { + return Promise.resolve(this._renderedHoverParts?.updateMarkdownHoverPartVerbosityLevel(action, index)); + } +}; +MarkdownHoverParticipant = __decorate66([ + __param61(1, IMarkdownRendererService), + __param61(2, IConfigurationService), + __param61(3, ILanguageFeaturesService), + __param61(4, IKeybindingService), + __param61(5, IHoverService), + __param61(6, ICommandService) +], MarkdownHoverParticipant); +var RenderedMarkdownHoverPart = class { + constructor(hoverPart, hoverElement, disposables, actionsContainer) { + this.hoverPart = hoverPart; + this.hoverElement = hoverElement; + this.disposables = disposables; + this.actionsContainer = actionsContainer; + } + dispose() { + this.disposables.dispose(); + } +}; +var MarkdownRenderedHoverParts = class { + constructor(hoverParts, hoverPartsContainer, _hoverParticipant, _editor, _commandService, _keybindingService, _hoverService, _configurationService, _markdownRendererService, _onFinishedRendering) { + this._hoverParticipant = _hoverParticipant; + this._editor = _editor; + this._commandService = _commandService; + this._keybindingService = _keybindingService; + this._hoverService = _hoverService; + this._configurationService = _configurationService; + this._markdownRendererService = _markdownRendererService; + this._onFinishedRendering = _onFinishedRendering; + this._ongoingHoverOperations = /* @__PURE__ */ new Map(); + this._disposables = new DisposableStore(); + this.renderedHoverParts = this._renderHoverParts(hoverParts, hoverPartsContainer, this._onFinishedRendering); + this._disposables.add(toDisposable(() => { + this.renderedHoverParts.forEach((renderedHoverPart) => { + renderedHoverPart.dispose(); + }); + this._ongoingHoverOperations.forEach((operation) => { + operation.tokenSource.dispose(true); + }); + })); + } + _renderHoverParts(hoverParts, hoverPartsContainer, onFinishedRendering) { + hoverParts.sort(compareBy((hover) => hover.ordinal, numberComparator)); + return hoverParts.map((hoverPart) => { + const renderedHoverPart = this._renderHoverPart(hoverPart, onFinishedRendering); + hoverPartsContainer.appendChild(renderedHoverPart.hoverElement); + return renderedHoverPart; + }); + } + _renderHoverPart(hoverPart, onFinishedRendering) { + const renderedMarkdownPart = this._renderMarkdownHover(hoverPart, onFinishedRendering); + const renderedMarkdownElement = renderedMarkdownPart.hoverElement; + const hoverSource = hoverPart.source; + const disposables = new DisposableStore(); + disposables.add(renderedMarkdownPart); + if (!hoverSource) { + return new RenderedMarkdownHoverPart(hoverPart, renderedMarkdownElement, disposables); + } + const canIncreaseVerbosity = hoverSource.supportsVerbosityAction(HoverVerbosityAction.Increase); + const canDecreaseVerbosity = hoverSource.supportsVerbosityAction(HoverVerbosityAction.Decrease); + if (!canIncreaseVerbosity && !canDecreaseVerbosity) { + return new RenderedMarkdownHoverPart(hoverPart, renderedMarkdownElement, disposables); + } + const actionsContainer = $7("div.verbosity-actions"); + renderedMarkdownElement.prepend(actionsContainer); + const actionsContainerInner = $7("div.verbosity-actions-inner"); + actionsContainer.append(actionsContainerInner); + disposables.add(this._renderHoverExpansionAction(actionsContainerInner, HoverVerbosityAction.Increase, canIncreaseVerbosity)); + disposables.add(this._renderHoverExpansionAction(actionsContainerInner, HoverVerbosityAction.Decrease, canDecreaseVerbosity)); + return new RenderedMarkdownHoverPart(hoverPart, renderedMarkdownElement, disposables, actionsContainerInner); + } + _renderMarkdownHover(markdownHover, onFinishedRendering) { + const renderedMarkdownHover = renderMarkdown2(this._editor, markdownHover, this._markdownRendererService, onFinishedRendering); + return renderedMarkdownHover; + } + _renderHoverExpansionAction(container, action, actionEnabled) { + const store = new DisposableStore(); + const isActionIncrease = action === HoverVerbosityAction.Increase; + const actionElement = append(container, $7(ThemeIcon.asCSSSelector(isActionIncrease ? increaseHoverVerbosityIcon : decreaseHoverVerbosityIcon))); + actionElement.tabIndex = 0; + const hoverDelegate = new WorkbenchHoverDelegate("mouse", void 0, { target: container, position: { + hoverPosition: 0 + /* HoverPosition.LEFT */ + } }, this._configurationService, this._hoverService); + store.add(this._hoverService.setupManagedHover(hoverDelegate, actionElement, labelForHoverVerbosityAction(this._keybindingService, action))); + if (!actionEnabled) { + actionElement.classList.add("disabled"); + return store; + } + actionElement.classList.add("enabled"); + const actionFunction = () => this._commandService.executeCommand(action === HoverVerbosityAction.Increase ? INCREASE_HOVER_VERBOSITY_ACTION_ID : DECREASE_HOVER_VERBOSITY_ACTION_ID, { focus: true }); + store.add(new ClickAction(actionElement, actionFunction)); + store.add(new KeyDownAction(actionElement, actionFunction, [ + 3, + 10 + /* KeyCode.Space */ + ])); + return store; + } + handleScroll(e) { + this.renderedHoverParts.forEach((renderedHoverPart) => { + const actionsContainerInner = renderedHoverPart.actionsContainer; + if (!actionsContainerInner) { + return; + } + const hoverElement = renderedHoverPart.hoverElement; + const topOfHoverScrollPosition = e.scrollTop; + const bottomOfHoverScrollPosition = topOfHoverScrollPosition + e.height; + const topOfRenderedPart = hoverElement.offsetTop; + const hoverElementHeight = hoverElement.clientHeight; + const bottomOfRenderedPart = topOfRenderedPart + hoverElementHeight; + const iconsHeight = 22; + let top; + if (bottomOfRenderedPart <= bottomOfHoverScrollPosition || topOfRenderedPart >= bottomOfHoverScrollPosition) { + top = hoverElementHeight - iconsHeight; + } else { + top = bottomOfHoverScrollPosition - topOfRenderedPart - iconsHeight; + } + actionsContainerInner.style.top = `${top}px`; + }); + } + async updateMarkdownHoverPartVerbosityLevel(action, index) { + const model = this._editor.getModel(); + if (!model) { + return void 0; + } + const hoverRenderedPart = this._getRenderedHoverPartAtIndex(index); + const hoverSource = hoverRenderedPart?.hoverPart.source; + if (!hoverRenderedPart || !hoverSource?.supportsVerbosityAction(action)) { + return void 0; + } + const newHover = await this._fetchHover(hoverSource, model, action); + if (!newHover) { + return void 0; + } + const newHoverSource = new HoverSource(newHover, hoverSource.hoverProvider, hoverSource.hoverPosition); + const initialHoverPart = hoverRenderedPart.hoverPart; + const newHoverPart = new MarkdownHover(this._hoverParticipant, initialHoverPart.range, newHover.contents, initialHoverPart.isBeforeContent, initialHoverPart.ordinal, newHoverSource); + const newHoverRenderedPart = this._updateRenderedHoverPart(index, newHoverPart); + if (!newHoverRenderedPart) { + return void 0; + } + return { + hoverPart: newHoverPart, + hoverElement: newHoverRenderedPart.hoverElement + }; + } + getAccessibleContent(hoverPart) { + const renderedHoverPartIndex = this.renderedHoverParts.findIndex((renderedHoverPart2) => renderedHoverPart2.hoverPart === hoverPart); + if (renderedHoverPartIndex === -1) { + return void 0; + } + const renderedHoverPart = this._getRenderedHoverPartAtIndex(renderedHoverPartIndex); + if (!renderedHoverPart) { + return void 0; + } + const hoverElementInnerText = renderedHoverPart.hoverElement.innerText; + const accessibleContent = hoverElementInnerText.replace(/[^\S\n\r]+/gu, " "); + return accessibleContent; + } + async _fetchHover(hoverSource, model, action) { + let verbosityDelta = action === HoverVerbosityAction.Increase ? 1 : -1; + const provider = hoverSource.hoverProvider; + const ongoingHoverOperation = this._ongoingHoverOperations.get(provider); + if (ongoingHoverOperation) { + ongoingHoverOperation.tokenSource.cancel(); + verbosityDelta += ongoingHoverOperation.verbosityDelta; + } + const tokenSource = new CancellationTokenSource(); + this._ongoingHoverOperations.set(provider, { verbosityDelta, tokenSource }); + const context = { verbosityRequest: { verbosityDelta, previousHover: hoverSource.hover } }; + let hover; + try { + hover = await Promise.resolve(provider.provideHover(model, hoverSource.hoverPosition, tokenSource.token, context)); + } catch (e) { + onUnexpectedExternalError(e); + } + tokenSource.dispose(); + this._ongoingHoverOperations.delete(provider); + return hover; + } + _updateRenderedHoverPart(index, hoverPart) { + if (index >= this.renderedHoverParts.length || index < 0) { + return void 0; + } + const renderedHoverPart = this._renderHoverPart(hoverPart, this._onFinishedRendering); + const currentRenderedHoverPart = this.renderedHoverParts[index]; + const currentRenderedMarkdown = currentRenderedHoverPart.hoverElement; + const renderedMarkdown = renderedHoverPart.hoverElement; + const renderedChildrenElements = Array.from(renderedMarkdown.children); + currentRenderedMarkdown.replaceChildren(...renderedChildrenElements); + const newRenderedHoverPart = new RenderedMarkdownHoverPart(hoverPart, currentRenderedMarkdown, renderedHoverPart.disposables, renderedHoverPart.actionsContainer); + currentRenderedHoverPart.dispose(); + this.renderedHoverParts[index] = newRenderedHoverPart; + return newRenderedHoverPart; + } + _getRenderedHoverPartAtIndex(index) { + return this.renderedHoverParts[index]; + } + dispose() { + this._disposables.dispose(); + } +}; +function renderMarkdownHovers(context, markdownHovers, editor2, markdownRendererService) { + markdownHovers.sort(compareBy((hover) => hover.ordinal, numberComparator)); + const renderedHoverParts = []; + for (const markdownHover of markdownHovers) { + const renderedHoverPart = renderMarkdown2(editor2, markdownHover, markdownRendererService, context.onContentsChanged); + context.fragment.appendChild(renderedHoverPart.hoverElement); + renderedHoverParts.push(renderedHoverPart); + } + return new RenderedHoverParts(renderedHoverParts); +} +function renderMarkdown2(editor2, markdownHover, markdownRendererService, onFinishedRendering) { + const disposables = new DisposableStore(); + const renderedMarkdown = $7("div.hover-row"); + const renderedMarkdownContents = $7("div.hover-row-contents"); + renderedMarkdown.appendChild(renderedMarkdownContents); + const markdownStrings = markdownHover.contents; + for (const markdownString of markdownStrings) { + if (isEmptyMarkdownString(markdownString)) { + continue; + } + const markdownHoverElement = $7("div.markdown-hover"); + const hoverContentsElement = append(markdownHoverElement, $7("div.hover-contents")); + const renderedContents = disposables.add(markdownRendererService.render(markdownString, { + context: editor2, + asyncRenderCallback: () => { + hoverContentsElement.className = "hover-contents code-hover-contents"; + onFinishedRendering(); + } + })); + hoverContentsElement.appendChild(renderedContents.element); + renderedMarkdownContents.appendChild(markdownHoverElement); + } + const renderedHoverPart = { + hoverPart: markdownHover, + hoverElement: renderedMarkdown, + dispose() { + disposables.dispose(); + } + }; + return renderedHoverPart; +} +function labelForHoverVerbosityAction(keybindingService, action) { + switch (action) { + case HoverVerbosityAction.Increase: { + const kb = keybindingService.lookupKeybinding(INCREASE_HOVER_VERBOSITY_ACTION_ID); + return kb ? localize(1135, "Increase Hover Verbosity ({0})", kb.getLabel()) : localize(1136, "Increase Hover Verbosity"); + } + case HoverVerbosityAction.Decrease: { + const kb = keybindingService.lookupKeybinding(DECREASE_HOVER_VERBOSITY_ACTION_ID); + return kb ? localize(1137, "Decrease Hover Verbosity ({0})", kb.getLabel()) : localize(1138, "Decrease Hover Verbosity"); + } + } +} + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/colorPicker/browser/hoverColorPicker/hoverColorPickerParticipant.js +init_async(); +init_range(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/colorPicker/browser/colorPickerWidget.js +init_dom(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerBody.js +init_dom(); +init_color(); +init_lifecycle(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerSaturationBox.js +init_dom(); +init_color(); +init_event(); +init_lifecycle(); +var $8 = $; +var SaturationBox = class extends Disposable { + constructor(container, model, pixelRatio) { + super(); + this.model = model; + this.pixelRatio = pixelRatio; + this._onDidChange = new Emitter(); + this.onDidChange = this._onDidChange.event; + this._onColorFlushed = new Emitter(); + this.onColorFlushed = this._onColorFlushed.event; + this._domNode = $8(".saturation-wrap"); + append(container, this._domNode); + this._canvas = document.createElement("canvas"); + this._canvas.className = "saturation-box"; + append(this._domNode, this._canvas); + this.selection = $8(".saturation-selection"); + append(this._domNode, this.selection); + this.layout(); + this._register(addDisposableListener(this._domNode, EventType.POINTER_DOWN, (e) => this.onPointerDown(e))); + this._register(this.model.onDidChangeColor(this.onDidChangeColor, this)); + this.monitor = null; + } + get domNode() { + return this._domNode; + } + onPointerDown(e) { + if (!e.target || !(e.target instanceof Element)) { + return; + } + this.monitor = this._register(new GlobalPointerMoveMonitor()); + const origin = getDomNodePagePosition(this._domNode); + if (e.target !== this.selection) { + this.onDidChangePosition(e.offsetX, e.offsetY); + } + this.monitor.startMonitoring(e.target, e.pointerId, e.buttons, (event) => this.onDidChangePosition(event.pageX - origin.left, event.pageY - origin.top), () => null); + const pointerUpListener = addDisposableListener(e.target.ownerDocument, EventType.POINTER_UP, () => { + this._onColorFlushed.fire(); + pointerUpListener.dispose(); + if (this.monitor) { + this.monitor.stopMonitoring(true); + this.monitor = null; + } + }, true); + } + onDidChangePosition(left, top) { + const s = Math.max(0, Math.min(1, left / this.width)); + const v = Math.max(0, Math.min(1, 1 - top / this.height)); + this.paintSelection(s, v); + this._onDidChange.fire({ s, v }); + } + layout() { + this.width = this._domNode.offsetWidth; + this.height = this._domNode.offsetHeight; + this._canvas.width = this.width * this.pixelRatio; + this._canvas.height = this.height * this.pixelRatio; + this.paint(); + const hsva = this.model.color.hsva; + this.paintSelection(hsva.s, hsva.v); + } + paint() { + const hsva = this.model.color.hsva; + const saturatedColor = new Color(new HSVA(hsva.h, 1, 1, 1)); + const ctx = this._canvas.getContext("2d"); + const whiteGradient = ctx.createLinearGradient(0, 0, this._canvas.width, 0); + whiteGradient.addColorStop(0, "rgba(255, 255, 255, 1)"); + whiteGradient.addColorStop(0.5, "rgba(255, 255, 255, 0.5)"); + whiteGradient.addColorStop(1, "rgba(255, 255, 255, 0)"); + const blackGradient = ctx.createLinearGradient(0, 0, 0, this._canvas.height); + blackGradient.addColorStop(0, "rgba(0, 0, 0, 0)"); + blackGradient.addColorStop(1, "rgba(0, 0, 0, 1)"); + ctx.rect(0, 0, this._canvas.width, this._canvas.height); + ctx.fillStyle = Color.Format.CSS.format(saturatedColor); + ctx.fill(); + ctx.fillStyle = whiteGradient; + ctx.fill(); + ctx.fillStyle = blackGradient; + ctx.fill(); + } + paintSelection(s, v) { + this.selection.style.left = `${s * this.width}px`; + this.selection.style.top = `${this.height - v * this.height}px`; + } + onDidChangeColor(color) { + if (this.monitor && this.monitor.isMonitoring()) { + return; + } + this.paint(); + const hsva = color.hsva; + this.paintSelection(hsva.s, hsva.v); + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerInsertButton.js +init_dom(); +init_event(); +init_lifecycle(); +var InsertButton = class extends Disposable { + constructor(container) { + super(); + this._onClicked = this._register(new Emitter()); + this.onClicked = this._onClicked.event; + this._button = append(container, document.createElement("button")); + this._button.classList.add("insert-button"); + this._button.textContent = "Insert"; + this._register(addDisposableListener(this._button, EventType.CLICK, () => { + this._onClicked.fire(); + })); + } + get button() { + return this._button; + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerStrip.js +init_dom(); +init_color(); +init_event(); +init_lifecycle(); +var $9 = $; +var Strip = class extends Disposable { + constructor(container, model, type) { + super(); + this.model = model; + this._onDidChange = new Emitter(); + this.onDidChange = this._onDidChange.event; + this._onColorFlushed = new Emitter(); + this.onColorFlushed = this._onColorFlushed.event; + if (type === "standalone") { + this.domNode = append(container, $9(".standalone-strip")); + this.overlay = append(this.domNode, $9(".standalone-overlay")); + } else { + this.domNode = append(container, $9(".strip")); + this.overlay = append(this.domNode, $9(".overlay")); + } + this.slider = append(this.domNode, $9(".slider")); + this.slider.style.top = `0px`; + this._register(addDisposableListener(this.domNode, EventType.POINTER_DOWN, (e) => this.onPointerDown(e))); + this._register(model.onDidChangeColor(this.onDidChangeColor, this)); + this.layout(); + } + layout() { + this.height = this.domNode.offsetHeight - this.slider.offsetHeight; + const value = this.getValue(this.model.color); + this.updateSliderPosition(value); + } + onDidChangeColor(color) { + const value = this.getValue(color); + this.updateSliderPosition(value); + } + onPointerDown(e) { + if (!e.target || !(e.target instanceof Element)) { + return; + } + const monitor = this._register(new GlobalPointerMoveMonitor()); + const origin = getDomNodePagePosition(this.domNode); + this.domNode.classList.add("grabbing"); + if (e.target !== this.slider) { + this.onDidChangeTop(e.offsetY); + } + monitor.startMonitoring(e.target, e.pointerId, e.buttons, (event) => this.onDidChangeTop(event.pageY - origin.top), () => null); + const pointerUpListener = addDisposableListener(e.target.ownerDocument, EventType.POINTER_UP, () => { + this._onColorFlushed.fire(); + pointerUpListener.dispose(); + monitor.stopMonitoring(true); + this.domNode.classList.remove("grabbing"); + }, true); + } + onDidChangeTop(top) { + const value = Math.max(0, Math.min(1, 1 - top / this.height)); + this.updateSliderPosition(value); + this._onDidChange.fire(value); + } + updateSliderPosition(value) { + this.slider.style.top = `${(1 - value) * this.height}px`; + } +}; +var OpacityStrip = class extends Strip { + constructor(container, model, type) { + super(container, model, type); + this.domNode.classList.add("opacity-strip"); + this.onDidChangeColor(this.model.color); + } + onDidChangeColor(color) { + super.onDidChangeColor(color); + const { r, g, b } = color.rgba; + const opaque = new Color(new RGBA(r, g, b, 1)); + const transparent2 = new Color(new RGBA(r, g, b, 0)); + this.overlay.style.background = `linear-gradient(to bottom, ${opaque} 0%, ${transparent2} 100%)`; + } + getValue(color) { + return color.hsva.a; + } +}; +var HueStrip = class extends Strip { + constructor(container, model, type) { + super(container, model, type); + this.domNode.classList.add("hue-strip"); + } + getValue(color) { + return 1 - color.hsva.h / 360; + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerBody.js +var $10 = $; +var ColorPickerBody = class extends Disposable { + constructor(container, model, pixelRatio, type) { + super(); + this.model = model; + this.pixelRatio = pixelRatio; + this._insertButton = null; + this._domNode = $10(".colorpicker-body"); + append(container, this._domNode); + this._saturationBox = new SaturationBox(this._domNode, this.model, this.pixelRatio); + this._register(this._saturationBox); + this._register(this._saturationBox.onDidChange(this.onDidSaturationValueChange, this)); + this._register(this._saturationBox.onColorFlushed(this.flushColor, this)); + this._opacityStrip = new OpacityStrip(this._domNode, this.model, type); + this._register(this._opacityStrip); + this._register(this._opacityStrip.onDidChange(this.onDidOpacityChange, this)); + this._register(this._opacityStrip.onColorFlushed(this.flushColor, this)); + this._hueStrip = new HueStrip(this._domNode, this.model, type); + this._register(this._hueStrip); + this._register(this._hueStrip.onDidChange(this.onDidHueChange, this)); + this._register(this._hueStrip.onColorFlushed(this.flushColor, this)); + if (type === "standalone") { + this._insertButton = this._register(new InsertButton(this._domNode)); + this._domNode.classList.add("standalone-colorpicker"); + } + } + flushColor() { + this.model.flushColor(); + } + onDidSaturationValueChange({ s, v }) { + const hsva = this.model.color.hsva; + this.model.color = new Color(new HSVA(hsva.h, s, v, hsva.a)); + } + onDidOpacityChange(a) { + const hsva = this.model.color.hsva; + this.model.color = new Color(new HSVA(hsva.h, hsva.s, hsva.v, a)); + } + onDidHueChange(value) { + const hsva = this.model.color.hsva; + const h2 = (1 - value) * 360; + this.model.color = new Color(new HSVA(h2 === 360 ? 0 : h2, hsva.s, hsva.v, hsva.a)); + } + get domNode() { + return this._domNode; + } + get saturationBox() { + return this._saturationBox; + } + get enterButton() { + return this._insertButton; + } + layout() { + this._saturationBox.layout(); + this._opacityStrip.layout(); + this._hueStrip.layout(); + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerHeader.js +init_dom(); +init_color(); +init_lifecycle(); +init_nls(); +init_colorRegistry(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerCloseButton.js +init_dom(); +init_lifecycle(); +init_nls(); +init_event(); +init_themables(); +init_codicons(); +var $11 = $; +var CloseButton = class extends Disposable { + constructor(container) { + super(); + this._onClicked = this._register(new Emitter()); + this.onClicked = this._onClicked.event; + this._button = document.createElement("div"); + this._button.classList.add("close-button"); + append(container, this._button); + const innerDiv = document.createElement("div"); + innerDiv.classList.add("close-button-inner-div"); + append(this._button, innerDiv); + const closeButton = append(innerDiv, $11(".button" + ThemeIcon.asCSSSelector(registerIcon("color-picker-close", Codicon.close, localize(885, "Icon to close the color picker"))))); + closeButton.classList.add("close-icon"); + this._register(addDisposableListener(this._button, EventType.CLICK, () => { + this._onClicked.fire(); + })); + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerHeader.js +var $12 = $; +var ColorPickerHeader = class extends Disposable { + constructor(container, model, themeService, type) { + super(); + this.model = model; + this.type = type; + this._closeButton = null; + this._domNode = $12(".colorpicker-header"); + append(container, this._domNode); + this._pickedColorNode = append(this._domNode, $12(".picked-color")); + append(this._pickedColorNode, $12("span.codicon.codicon-color-mode")); + this._pickedColorPresentation = append(this._pickedColorNode, document.createElement("span")); + this._pickedColorPresentation.classList.add("picked-color-presentation"); + const tooltip = localize(886, "Click to toggle color options (rgb/hsl/hex)"); + this._pickedColorNode.setAttribute("title", tooltip); + this._originalColorNode = append(this._domNode, $12(".original-color")); + this._originalColorNode.style.backgroundColor = Color.Format.CSS.format(this.model.originalColor) || ""; + this.backgroundColor = themeService.getColorTheme().getColor(editorHoverBackground) || Color.white; + this._register(themeService.onDidColorThemeChange((theme) => { + this.backgroundColor = theme.getColor(editorHoverBackground) || Color.white; + })); + this._register(addDisposableListener(this._pickedColorNode, EventType.CLICK, () => this.model.selectNextColorPresentation())); + this._register(addDisposableListener(this._originalColorNode, EventType.CLICK, () => { + this.model.color = this.model.originalColor; + this.model.flushColor(); + })); + this._register(model.onDidChangeColor(this.onDidChangeColor, this)); + this._register(model.onDidChangePresentation(this.onDidChangePresentation, this)); + this._pickedColorNode.style.backgroundColor = Color.Format.CSS.format(model.color) || ""; + this._pickedColorNode.classList.toggle("light", model.color.rgba.a < 0.5 ? this.backgroundColor.isLighter() : model.color.isLighter()); + this.onDidChangeColor(this.model.color); + if (this.type === "standalone") { + this._domNode.classList.add("standalone-colorpicker"); + this._closeButton = this._register(new CloseButton(this._domNode)); + } + } + get closeButton() { + return this._closeButton; + } + get pickedColorNode() { + return this._pickedColorNode; + } + get originalColorNode() { + return this._originalColorNode; + } + onDidChangeColor(color) { + this._pickedColorNode.style.backgroundColor = Color.Format.CSS.format(color) || ""; + this._pickedColorNode.classList.toggle("light", color.rgba.a < 0.5 ? this.backgroundColor.isLighter() : color.isLighter()); + this.onDidChangePresentation(); + } + onDidChangePresentation() { + this._pickedColorPresentation.textContent = this.model.presentation ? this.model.presentation.label : ""; + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/colorPicker/browser/colorPickerWidget.js +var $13 = $; +var ColorPickerWidget = class extends Widget { + constructor(container, model, pixelRatio, themeService, type) { + super(); + this.model = model; + this.pixelRatio = pixelRatio; + this._register(PixelRatio.getInstance(getWindow(container)).onDidChange(() => this.layout())); + this._domNode = $13(".colorpicker-widget"); + container.appendChild(this._domNode); + this.header = this._register(new ColorPickerHeader(this._domNode, this.model, themeService, type)); + this.body = this._register(new ColorPickerBody(this._domNode, this.model, this.pixelRatio, type)); + } + layout() { + this.body.layout(); + } + get domNode() { + return this._domNode; + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/colorPicker/browser/hoverColorPicker/hoverColorPickerParticipant.js +init_themeService(); +init_nls(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/colorPicker/browser/colorPickerParticipantUtils.js +init_cancellation(); +init_color(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/colorPicker/browser/colorPickerModel.js +init_event(); +var ColorPickerModel = class { + get color() { + return this._color; + } + set color(color) { + if (this._color.equals(color)) { + return; + } + this._color = color; + this._onDidChangeColor.fire(color); + } + get presentation() { + return this.colorPresentations[this.presentationIndex]; + } + get colorPresentations() { + return this._colorPresentations; + } + set colorPresentations(colorPresentations) { + this._colorPresentations = colorPresentations; + if (this.presentationIndex > colorPresentations.length - 1) { + this.presentationIndex = 0; + } + this._onDidChangePresentation.fire(this.presentation); + } + constructor(color, availableColorPresentations, presentationIndex) { + this.presentationIndex = presentationIndex; + this._onColorFlushed = new Emitter(); + this.onColorFlushed = this._onColorFlushed.event; + this._onDidChangeColor = new Emitter(); + this.onDidChangeColor = this._onDidChangeColor.event; + this._onDidChangePresentation = new Emitter(); + this.onDidChangePresentation = this._onDidChangePresentation.event; + this.originalColor = color; + this._color = color; + this._colorPresentations = availableColorPresentations; + } + selectNextColorPresentation() { + this.presentationIndex = (this.presentationIndex + 1) % this.colorPresentations.length; + this.flushColor(); + this._onDidChangePresentation.fire(this.presentation); + } + guessColorPresentation(color, originalText) { + let presentationIndex = -1; + for (let i2 = 0; i2 < this.colorPresentations.length; i2++) { + if (originalText.toLowerCase() === this.colorPresentations[i2].label) { + presentationIndex = i2; + break; + } + } + if (presentationIndex === -1) { + const originalTextPrefix = originalText.split("(")[0].toLowerCase(); + for (let i2 = 0; i2 < this.colorPresentations.length; i2++) { + if (this.colorPresentations[i2].label.toLowerCase().startsWith(originalTextPrefix)) { + presentationIndex = i2; + break; + } + } + } + if (presentationIndex !== -1 && presentationIndex !== this.presentationIndex) { + this.presentationIndex = presentationIndex; + this._onDidChangePresentation.fire(this.presentation); + } + } + flushColor() { + this._onColorFlushed.fire(this._color); + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/colorPicker/browser/colorPickerParticipantUtils.js +init_range(); +async function createColorHover(editorModel, colorInfo, provider) { + const originalText = editorModel.getValueInRange(colorInfo.range); + const { red, green, blue, alpha } = colorInfo.color; + const rgba = new RGBA(Math.round(red * 255), Math.round(green * 255), Math.round(blue * 255), alpha); + const color = new Color(rgba); + const colorPresentations = await getColorPresentations(editorModel, colorInfo, provider, CancellationToken.None); + const model = new ColorPickerModel(color, [], 0); + model.colorPresentations = colorPresentations || []; + model.guessColorPresentation(color, originalText); + return { + range: Range.lift(colorInfo.range), + model, + provider + }; +} +function updateEditorModel(editor2, range2, model) { + const textEdits = []; + const edit2 = model.presentation.textEdit ?? { range: range2, text: model.presentation.label, forceMoveMarkers: false }; + textEdits.push(edit2); + if (model.presentation.additionalTextEdits) { + textEdits.push(...model.presentation.additionalTextEdits); + } + const replaceRange = Range.lift(edit2.range); + const trackedRange = editor2.getModel()._setTrackedRange( + null, + replaceRange, + 3 + /* TrackedRangeStickiness.GrowsOnlyWhenTypingAfter */ + ); + editor2.executeEdits("colorpicker", textEdits); + editor2.pushUndoStop(); + return editor2.getModel()._getTrackedRange(trackedRange) ?? replaceRange; +} +async function updateColorPresentations(editorModel, colorPickerModel, color, range2, colorHover) { + const colorPresentations = await getColorPresentations(editorModel, { + range: range2, + color: { + red: color.rgba.r / 255, + green: color.rgba.g / 255, + blue: color.rgba.b / 255, + alpha: color.rgba.a + } + }, colorHover.provider, CancellationToken.None); + colorPickerModel.colorPresentations = colorPresentations || []; +} + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/colorPicker/browser/hoverColorPicker/hoverColorPickerParticipant.js +init_dom(); +init_lifecycle(); +var __decorate67 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param62 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var ColorHover = class _ColorHover { + constructor(owner, range2, model, provider) { + this.owner = owner; + this.range = range2; + this.model = model; + this.provider = provider; + this.forceShowAtRange = true; + } + isValidForHoverAnchor(anchor) { + return anchor.type === 1 && this.range.startColumn <= anchor.range.startColumn && this.range.endColumn >= anchor.range.endColumn; + } + static fromBaseColor(owner, color) { + return new _ColorHover(owner, color.range, color.model, color.provider); + } +}; +var HoverColorPickerParticipant = class HoverColorPickerParticipant2 { + constructor(_editor, _themeService) { + this._editor = _editor; + this._themeService = _themeService; + this.hoverOrdinal = 2; + } + computeSync(_anchor, _lineDecorations, source) { + return []; + } + computeAsync(anchor, lineDecorations, source, token) { + return AsyncIterableProducer.fromPromise(this._computeAsync(anchor, lineDecorations, source)); + } + async _computeAsync(_anchor, lineDecorations, source) { + if (!this._editor.hasModel()) { + return []; + } + if (!this._isValidRequest(source)) { + return []; + } + const colorDetector = ColorDetector.get(this._editor); + if (!colorDetector) { + return []; + } + for (const d of lineDecorations) { + if (!colorDetector.isColorDecoration(d)) { + continue; + } + const colorData = colorDetector.getColorData(d.range.getStartPosition()); + if (colorData) { + const colorHover = ColorHover.fromBaseColor(this, await createColorHover(this._editor.getModel(), colorData.colorInfo, colorData.provider)); + return [colorHover]; + } + } + return []; + } + _isValidRequest(source) { + const decoratorActivatedOn = this._editor.getOption( + 168 + /* EditorOption.colorDecoratorsActivatedOn */ + ); + switch (source) { + case 0: + return decoratorActivatedOn === "hover" || decoratorActivatedOn === "clickAndHover"; + case 1: + return decoratorActivatedOn === "click" || decoratorActivatedOn === "clickAndHover"; + case 2: + return true; + } + } + renderHoverParts(context, hoverParts) { + const editor2 = this._editor; + if (hoverParts.length === 0 || !editor2.hasModel()) { + return new RenderedHoverParts([]); + } + const minimumHeight = editor2.getOption( + 75 + /* EditorOption.lineHeight */ + ) + 8; + context.setMinimumDimensions(new Dimension(302, minimumHeight)); + const disposables = new DisposableStore(); + const colorHover = hoverParts[0]; + const editorModel = editor2.getModel(); + const model = colorHover.model; + this._colorPicker = disposables.add(new ColorPickerWidget( + context.fragment, + model, + editor2.getOption( + 163 + /* EditorOption.pixelRatio */ + ), + this._themeService, + "hover" + /* ColorPickerWidgetType.Hover */ + )); + let editorUpdatedByColorPicker = false; + let range2 = new Range(colorHover.range.startLineNumber, colorHover.range.startColumn, colorHover.range.endLineNumber, colorHover.range.endColumn); + disposables.add(model.onColorFlushed(async (color) => { + await updateColorPresentations(editorModel, model, color, range2, colorHover); + editorUpdatedByColorPicker = true; + range2 = updateEditorModel(editor2, range2, model); + })); + disposables.add(model.onDidChangeColor((color) => { + updateColorPresentations(editorModel, model, color, range2, colorHover); + })); + disposables.add(editor2.onDidChangeModelContent((e) => { + if (editorUpdatedByColorPicker) { + editorUpdatedByColorPicker = false; + } else { + context.hide(); + editor2.focus(); + } + })); + const renderedHoverPart = { + hoverPart: ColorHover.fromBaseColor(this, colorHover), + hoverElement: this._colorPicker.domNode, + dispose() { + disposables.dispose(); + } + }; + return new RenderedHoverParts([renderedHoverPart]); + } + getAccessibleContent(hoverPart) { + return localize(887, "There is a color picker here."); + } + handleResize() { + this._colorPicker?.layout(); + } + handleContentsChanged() { + this._colorPicker?.layout(); + } + handleHide() { + this._colorPicker?.dispose(); + this._colorPicker = void 0; + } + isColorPickerVisible() { + return !!this._colorPicker; + } +}; +HoverColorPickerParticipant = __decorate67([ + __param62(1, IThemeService) +], HoverColorPickerParticipant); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/inlayHints/browser/inlayHintsHover.js +init_async(); +init_htmlContent(); +init_position(); +init_textModel(); +init_resolverService(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/inlayHints/browser/inlayHintsController.js +init_dom(); +init_arrays(); +init_async(); +init_cancellation(); +init_errors(); +init_lifecycle(); +init_map(); +init_types(); +init_uri(); + +// node_modules/monaco-editor-core/esm/vs/editor/common/core/editOperation.js +init_range(); +var EditOperation = class { + static insert(position, text2) { + return { + range: new Range(position.lineNumber, position.column, position.lineNumber, position.column), + text: text2, + forceMoveMarkers: true + }; + } + static delete(range2) { + return { + range: range2, + text: null + }; + } + static replace(range2, text2) { + return { + range: range2, + text: text2 + }; + } + static replaceMove(range2, text2) { + return { + range: range2, + text: text2, + forceMoveMarkers: true + }; + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/inlayHints/browser/inlayHintsController.js +init_range(); +init_languages(); +init_model2(); +init_textModel(); +init_languageFeatureDebounce(); +init_languageFeatures(); +init_resolverService(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/gotoSymbol/browser/link/clickLinkGesture.js +init_event(); +init_lifecycle(); +init_platform(); +function hasModifier(e, modifier) { + return !!e[modifier]; +} +var ClickLinkMouseEvent = class { + constructor(source, opts) { + this.target = source.target; + this.isLeftClick = source.event.leftButton; + this.isMiddleClick = source.event.middleButton; + this.isRightClick = source.event.rightButton; + this.mouseMiddleClickAction = opts.mouseMiddleClickAction; + this.hasTriggerModifier = hasModifier(source.event, opts.triggerModifier); + if (this.isMiddleClick && opts.mouseMiddleClickAction === "ctrlLeftClick") { + this.isMiddleClick = false; + this.isLeftClick = true; + this.hasTriggerModifier = true; + } + this.hasSideBySideModifier = hasModifier(source.event, opts.triggerSideBySideModifier); + this.isNoneOrSingleMouseDown = source.event.detail <= 1; + } +}; +var ClickLinkKeyboardEvent = class { + constructor(source, opts) { + this.keyCodeIsTriggerKey = source.keyCode === opts.triggerKey; + this.keyCodeIsSideBySideKey = source.keyCode === opts.triggerSideBySideKey; + this.hasTriggerModifier = hasModifier(source, opts.triggerModifier); + } +}; +var ClickLinkOptions = class { + constructor(triggerKey, triggerModifier, triggerSideBySideKey, triggerSideBySideModifier, mouseMiddleClickAction) { + this.mouseMiddleClickAction = mouseMiddleClickAction; + this.triggerKey = triggerKey; + this.triggerModifier = triggerModifier; + this.triggerSideBySideKey = triggerSideBySideKey; + this.triggerSideBySideModifier = triggerSideBySideModifier; + } + equals(other) { + return this.triggerKey === other.triggerKey && this.triggerModifier === other.triggerModifier && this.triggerSideBySideKey === other.triggerSideBySideKey && this.triggerSideBySideModifier === other.triggerSideBySideModifier && this.mouseMiddleClickAction === other.mouseMiddleClickAction; + } +}; +function createOptions(multiCursorModifier, mouseMiddleClickAction) { + if (multiCursorModifier === "altKey") { + if (isMacintosh) { + return new ClickLinkOptions(57, "metaKey", 6, "altKey", mouseMiddleClickAction); + } + return new ClickLinkOptions(5, "ctrlKey", 6, "altKey", mouseMiddleClickAction); + } + if (isMacintosh) { + return new ClickLinkOptions(6, "altKey", 57, "metaKey", mouseMiddleClickAction); + } + return new ClickLinkOptions(6, "altKey", 5, "ctrlKey", mouseMiddleClickAction); +} +var ClickLinkGesture = class extends Disposable { + constructor(editor2, opts) { + super(); + this._onMouseMoveOrRelevantKeyDown = this._register(new Emitter()); + this.onMouseMoveOrRelevantKeyDown = this._onMouseMoveOrRelevantKeyDown.event; + this._onExecute = this._register(new Emitter()); + this.onExecute = this._onExecute.event; + this._onCancel = this._register(new Emitter()); + this.onCancel = this._onCancel.event; + this._editor = editor2; + this._extractLineNumberFromMouseEvent = opts?.extractLineNumberFromMouseEvent ?? ((e) => e.target.position ? e.target.position.lineNumber : 0); + this._opts = createOptions(this._editor.getOption( + 86 + /* EditorOption.multiCursorModifier */ + ), this._editor.getOption( + 87 + /* EditorOption.mouseMiddleClickAction */ + )); + this._lastMouseMoveEvent = null; + this._hasTriggerKeyOnMouseDown = false; + this._lineNumberOnMouseDown = 0; + this._register(this._editor.onDidChangeConfiguration((e) => { + if (e.hasChanged( + 86 + /* EditorOption.multiCursorModifier */ + ) || e.hasChanged( + 87 + /* EditorOption.mouseMiddleClickAction */ + )) { + const newOpts = createOptions(this._editor.getOption( + 86 + /* EditorOption.multiCursorModifier */ + ), this._editor.getOption( + 87 + /* EditorOption.mouseMiddleClickAction */ + )); + if (this._opts.equals(newOpts)) { + return; + } + this._opts = newOpts; + this._lastMouseMoveEvent = null; + this._hasTriggerKeyOnMouseDown = false; + this._lineNumberOnMouseDown = 0; + this._onCancel.fire(); + } + })); + this._register(this._editor.onMouseMove((e) => this._onEditorMouseMove(new ClickLinkMouseEvent(e, this._opts)))); + this._register(this._editor.onMouseDown((e) => this._onEditorMouseDown(new ClickLinkMouseEvent(e, this._opts)))); + this._register(this._editor.onMouseUp((e) => this._onEditorMouseUp(new ClickLinkMouseEvent(e, this._opts)))); + this._register(this._editor.onKeyDown((e) => this._onEditorKeyDown(new ClickLinkKeyboardEvent(e, this._opts)))); + this._register(this._editor.onKeyUp((e) => this._onEditorKeyUp(new ClickLinkKeyboardEvent(e, this._opts)))); + this._register(this._editor.onMouseDrag(() => this._resetHandler())); + this._register(this._editor.onDidChangeCursorSelection((e) => this._onDidChangeCursorSelection(e))); + this._register(this._editor.onDidChangeModel((e) => this._resetHandler())); + this._register(this._editor.onDidChangeModelContent(() => this._resetHandler())); + this._register(this._editor.onDidScrollChange((e) => { + if (e.scrollTopChanged || e.scrollLeftChanged) { + this._resetHandler(); + } + })); + } + _onDidChangeCursorSelection(e) { + if (e.selection && e.selection.startColumn !== e.selection.endColumn) { + this._resetHandler(); + } + } + _onEditorMouseMove(mouseEvent) { + this._lastMouseMoveEvent = mouseEvent; + this._onMouseMoveOrRelevantKeyDown.fire([mouseEvent, null]); + } + _onEditorMouseDown(mouseEvent) { + this._hasTriggerKeyOnMouseDown = mouseEvent.hasTriggerModifier; + this._lineNumberOnMouseDown = this._extractLineNumberFromMouseEvent(mouseEvent); + } + _onEditorMouseUp(mouseEvent) { + const currentLineNumber = this._extractLineNumberFromMouseEvent(mouseEvent); + const lineNumbersCorrect = !!this._lineNumberOnMouseDown && this._lineNumberOnMouseDown === currentLineNumber; + if (lineNumbersCorrect && (this._hasTriggerKeyOnMouseDown || mouseEvent.isMiddleClick && mouseEvent.mouseMiddleClickAction === "openLink")) { + this._onExecute.fire(mouseEvent); + } + } + _onEditorKeyDown(e) { + if (this._lastMouseMoveEvent && (e.keyCodeIsTriggerKey || e.keyCodeIsSideBySideKey && e.hasTriggerModifier)) { + this._onMouseMoveOrRelevantKeyDown.fire([this._lastMouseMoveEvent, e]); + } else if (e.hasTriggerModifier) { + this._onCancel.fire(); + } + } + _onEditorKeyUp(e) { + if (e.keyCodeIsTriggerKey) { + this._onCancel.fire(); + } + } + _resetHandler() { + this._lastMouseMoveEvent = null; + this._hasTriggerKeyOnMouseDown = false; + this._onCancel.fire(); + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/inlayHints/browser/inlayHints.js +init_errors(); +init_lifecycle(); +init_position(); +init_range(); +init_htmlContent(); +var InlayHintAnchor = class { + constructor(range2, direction) { + this.range = range2; + this.direction = direction; + } +}; +var InlayHintItem = class _InlayHintItem { + constructor(hint, anchor, provider) { + this.hint = hint; + this.anchor = anchor; + this.provider = provider; + this._isResolved = false; + } + with(delta) { + const result = new _InlayHintItem(this.hint, delta.anchor, this.provider); + result._isResolved = this._isResolved; + result._currentResolve = this._currentResolve; + return result; + } + async resolve(token) { + if (typeof this.provider.resolveInlayHint !== "function") { + return; + } + if (this._currentResolve) { + await this._currentResolve; + if (token.isCancellationRequested) { + return; + } + return this.resolve(token); + } + if (!this._isResolved) { + this._currentResolve = this._doResolve(token).finally(() => this._currentResolve = void 0); + } + await this._currentResolve; + } + async _doResolve(token) { + try { + const newHint = await Promise.resolve(this.provider.resolveInlayHint(this.hint, token)); + this.hint.tooltip = newHint?.tooltip ?? this.hint.tooltip; + this.hint.label = newHint?.label ?? this.hint.label; + this.hint.textEdits = newHint?.textEdits ?? this.hint.textEdits; + this._isResolved = true; + } catch (err) { + onUnexpectedExternalError(err); + this._isResolved = false; + } + } +}; +var InlayHintsFragments = class _InlayHintsFragments { + static { + this._emptyInlayHintList = Object.freeze({ dispose() { + }, hints: [] }); + } + static async create(registry, model, ranges, token) { + const data = []; + const promises = registry.ordered(model).reverse().map((provider) => ranges.map(async (range2) => { + try { + const result = await provider.provideInlayHints(model, range2, token); + if (result?.hints.length || provider.onDidChangeInlayHints) { + data.push([result ?? _InlayHintsFragments._emptyInlayHintList, provider]); + } + } catch (err) { + onUnexpectedExternalError(err); + } + })); + await Promise.all(promises.flat()); + if (token.isCancellationRequested || model.isDisposed()) { + throw new CancellationError(); + } + return new _InlayHintsFragments(ranges, data, model); + } + constructor(ranges, data, model) { + this._disposables = new DisposableStore(); + this.ranges = ranges; + this.provider = /* @__PURE__ */ new Set(); + const items = []; + for (const [list2, provider] of data) { + this._disposables.add(list2); + this.provider.add(provider); + for (const hint of list2.hints) { + const position = model.validatePosition(hint.position); + let direction = "before"; + const wordRange = _InlayHintsFragments._getRangeAtPosition(model, position); + let range2; + if (wordRange.getStartPosition().isBefore(position)) { + range2 = Range.fromPositions(wordRange.getStartPosition(), position); + direction = "after"; + } else { + range2 = Range.fromPositions(position, wordRange.getEndPosition()); + direction = "before"; + } + items.push(new InlayHintItem(hint, new InlayHintAnchor(range2, direction), provider)); + } + } + this.items = items.sort((a, b) => Position.compare(a.hint.position, b.hint.position)); + } + dispose() { + this._disposables.dispose(); + } + static _getRangeAtPosition(model, position) { + const line = position.lineNumber; + const word = model.getWordAtPosition(position); + if (word) { + return new Range(line, word.startColumn, line, word.endColumn); + } + model.tokenization.tokenizeIfCheap(line); + const tokens = model.tokenization.getLineTokens(line); + const offset = position.column - 1; + const idx = tokens.findTokenIndexAtOffset(offset); + let start = tokens.getStartOffset(idx); + let end = tokens.getEndOffset(idx); + if (end - start === 1) { + if (start === offset && idx > 1) { + start = tokens.getStartOffset(idx - 1); + end = tokens.getEndOffset(idx - 1); + } else if (end === offset && idx < tokens.getCount() - 1) { + start = tokens.getStartOffset(idx + 1); + end = tokens.getEndOffset(idx + 1); + } + } + return new Range(line, start + 1, line, end + 1); + } +}; +function asCommandLink(command) { + return createCommandUri(command.id, ...command.arguments ?? []).toString(); +} + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/inlayHints/browser/inlayHintsLocations.js +init_dom(); +init_actions(); +init_cancellation(); +init_uuid(); +init_range(); +init_resolverService(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/gotoSymbol/browser/goToCommands.js +init_async(); +init_keyCodes(); +init_types(); +init_uri(); +init_editorState(); + +// node_modules/monaco-editor-core/esm/vs/editor/browser/editorBrowser.js +function isCodeEditor(thing) { + if (thing && typeof thing.getEditorType === "function") { + return thing.getEditorType() === EditorType.ICodeEditor; + } else { + return false; + } +} +function isDiffEditor(thing) { + if (thing && typeof thing.getEditorType === "function") { + return thing.getEditorType() === EditorType.IDiffEditor; + } else { + return false; + } +} +function isCompositeEditor(thing) { + return !!thing && typeof thing === "object" && typeof thing.onDidChangeActiveEditor === "function"; +} +function getCodeEditor(thing) { + if (isCodeEditor(thing)) { + return thing; + } + if (isDiffEditor(thing)) { + return thing.getModifiedEditor(); + } + if (isCompositeEditor(thing) && isCodeEditor(thing.activeCodeEditor)) { + return thing.activeCodeEditor; + } + return null; +} + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/gotoSymbol/browser/goToCommands.js +init_editorExtensions(); +init_codeEditorService(); + +// node_modules/monaco-editor-core/esm/vs/editor/browser/widget/codeEditor/embeddedCodeEditorWidget.js +init_objects(); +init_codeEditorService(); +init_languageConfigurationRegistry(); +init_languageFeatures(); +init_commands(); +init_contextkey(); +init_instantiation(); +init_themeService(); +var __decorate68 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param63 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var EmbeddedCodeEditorWidget = class EmbeddedCodeEditorWidget2 extends CodeEditorWidget { + constructor(domElement, options2, codeEditorWidgetOptions, parentEditor, instantiationService, codeEditorService, commandService, contextKeyService, themeService, notificationService, accessibilityService, languageConfigurationService, languageFeaturesService) { + super(domElement, { ...parentEditor.getRawOptions(), overflowWidgetsDomNode: parentEditor.getOverflowWidgetsDomNode() }, codeEditorWidgetOptions, instantiationService, codeEditorService, commandService, contextKeyService, themeService, notificationService, accessibilityService, languageConfigurationService, languageFeaturesService); + this._parentEditor = parentEditor; + this._overwriteOptions = options2; + super.updateOptions(this._overwriteOptions); + this._register(parentEditor.onDidChangeConfiguration((e) => this._onParentConfigurationChanged(e))); + } + getParentEditor() { + return this._parentEditor; + } + _onParentConfigurationChanged(e) { + super.updateOptions(this._parentEditor.getRawOptions()); + super.updateOptions(this._overwriteOptions); + } + updateOptions(newOptions) { + mixin(this._overwriteOptions, newOptions, true); + super.updateOptions(this._overwriteOptions); + } +}; +EmbeddedCodeEditorWidget = __decorate68([ + __param63(4, IInstantiationService), + __param63(5, ICodeEditorService), + __param63(6, ICommandService), + __param63(7, IContextKeyService), + __param63(8, IThemeService), + __param63(9, INotificationService), + __param63(10, IAccessibilityService), + __param63(11, ILanguageConfigurationService), + __param63(12, ILanguageFeaturesService) +], EmbeddedCodeEditorWidget); +function getOuterEditor(accessor) { + const editor2 = accessor.get(ICodeEditorService).getFocusedCodeEditor(); + if (editor2 instanceof EmbeddedCodeEditorWidget) { + return editor2.getParentEditor(); + } + return editor2; +} + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/gotoSymbol/browser/goToCommands.js +init_position(); +init_range(); +init_editorContextKeys(); +init_languages(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesController.js +init_async(); +init_errors(); +init_keyCodes(); +init_lifecycle(); +init_codeEditorService(); +init_position(); +init_range(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/peekView/browser/peekView.js +init_dom(); +init_actions(); +init_codicons(); +init_themables(); +init_color(); +init_event(); +init_objects(); +init_editorExtensions(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/zoneWidget/browser/zoneWidget.js +init_color(); +init_lifecycle(); +init_objects(); +init_range(); +init_textModel(); +var defaultColor = new Color(new RGBA(0, 122, 204)); +var defaultOptions = { + showArrow: true, + showFrame: true, + className: "", + frameColor: defaultColor, + arrowColor: defaultColor, + keepEditorSelection: false +}; +var WIDGET_ID = "vs.editor.contrib.zoneWidget"; +var ViewZoneDelegate = class { + constructor(domNode, afterLineNumber, afterColumn, heightInLines, onDomNodeTop, onComputedHeight, showInHiddenAreas, ordinal) { + this.id = ""; + this.domNode = domNode; + this.afterLineNumber = afterLineNumber; + this.afterColumn = afterColumn; + this.heightInLines = heightInLines; + this.showInHiddenAreas = showInHiddenAreas; + this.ordinal = ordinal; + this._onDomNodeTop = onDomNodeTop; + this._onComputedHeight = onComputedHeight; + } + onDomNodeTop(top) { + this._onDomNodeTop(top); + } + onComputedHeight(height) { + this._onComputedHeight(height); + } +}; +var OverlayWidgetDelegate = class { + constructor(id, domNode) { + this._id = id; + this._domNode = domNode; + } + getId() { + return this._id; + } + getDomNode() { + return this._domNode; + } + getPosition() { + return null; + } +}; +var Arrow = class _Arrow { + static { + this._IdGenerator = new IdGenerator(".arrow-decoration-"); + } + constructor(_editor) { + this._editor = _editor; + this._ruleName = _Arrow._IdGenerator.nextId(); + this._color = null; + this._height = -1; + this._decorations = this._editor.createDecorationsCollection(); + } + dispose() { + this.hide(); + removeCSSRulesContainingSelector(this._ruleName); + } + set color(value) { + if (this._color !== value) { + this._color = value; + this._updateStyle(); + } + } + set height(value) { + if (this._height !== value) { + this._height = value; + this._updateStyle(); + } + } + _updateStyle() { + removeCSSRulesContainingSelector(this._ruleName); + createCSSRule(`.monaco-editor ${this._ruleName}`, `border-style: solid; border-color: transparent; border-bottom-color: ${this._color}; border-width: ${this._height}px; bottom: -${this._height}px !important; margin-left: -${this._height}px; `); + } + show(where) { + if (where.column === 1) { + where = { lineNumber: where.lineNumber, column: 2 }; + } + this._decorations.set([{ + range: Range.fromPositions(where), + options: { + description: "zone-widget-arrow", + className: this._ruleName, + stickiness: 1 + /* TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges */ + } + }]); + } + hide() { + this._decorations.clear(); + } +}; +var ZoneWidget = class { + constructor(editor2, options2 = {}) { + this._arrow = null; + this._overlayWidget = null; + this._resizeSash = null; + this._isSashResizeHeight = false; + this._viewZone = null; + this._disposables = new DisposableStore(); + this.container = null; + this._isShowing = false; + this.editor = editor2; + this._positionMarkerId = this.editor.createDecorationsCollection(); + this.options = deepClone(options2); + mixin(this.options, defaultOptions, false); + this.domNode = document.createElement("div"); + if (!this.options.isAccessible) { + this.domNode.setAttribute("aria-hidden", "true"); + this.domNode.setAttribute("role", "presentation"); + } + this._disposables.add(this.editor.onDidLayoutChange((info) => { + const width2 = this._getWidth(info); + this.domNode.style.width = width2 + "px"; + this.domNode.style.left = this._getLeft(info) + "px"; + this._onWidth(width2); + })); + } + dispose() { + if (this._overlayWidget) { + this.editor.removeOverlayWidget(this._overlayWidget); + this._overlayWidget = null; + } + if (this._viewZone) { + this.editor.changeViewZones((accessor) => { + if (this._viewZone) { + accessor.removeZone(this._viewZone.id); + } + this._viewZone = null; + }); + } + this._positionMarkerId.clear(); + this._disposables.dispose(); + } + create() { + this.domNode.classList.add("zone-widget"); + if (this.options.className) { + this.domNode.classList.add(this.options.className); + } + this.container = document.createElement("div"); + this.container.classList.add("zone-widget-container"); + this.domNode.appendChild(this.container); + if (this.options.showArrow) { + this._arrow = new Arrow(this.editor); + this._disposables.add(this._arrow); + } + this._fillContainer(this.container); + this._initSash(); + this._applyStyles(); + } + style(styles) { + if (styles.frameColor) { + this.options.frameColor = styles.frameColor; + } + if (styles.arrowColor) { + this.options.arrowColor = styles.arrowColor; + } + this._applyStyles(); + } + _applyStyles() { + if (this.container && this.options.frameColor) { + const frameColor = this.options.frameColor.toString(); + this.container.style.borderTopColor = frameColor; + this.container.style.borderBottomColor = frameColor; + } + if (this._arrow && this.options.arrowColor) { + const arrowColor = this.options.arrowColor.toString(); + this._arrow.color = arrowColor; + } + } + _getWidth(info) { + return info.width - info.minimap.minimapWidth - info.verticalScrollbarWidth; + } + _getLeft(info) { + if (info.minimap.minimapWidth > 0 && info.minimap.minimapLeft === 0) { + return info.minimap.minimapWidth; + } + return 0; + } + _onViewZoneTop(top) { + this.domNode.style.top = top + "px"; + } + _onViewZoneHeight(height) { + this.domNode.style.height = `${height}px`; + if (this.container) { + const containerHeight = height - this._decoratingElementsHeight(); + this.container.style.height = `${containerHeight}px`; + const layoutInfo = this.editor.getLayoutInfo(); + this._doLayout(containerHeight, this._getWidth(layoutInfo)); + } + this._resizeSash?.layout(); + } + get position() { + const range2 = this._positionMarkerId.getRange(0); + if (!range2) { + return void 0; + } + return range2.getStartPosition(); + } + show(rangeOrPos, heightInLines) { + const range2 = Range.isIRange(rangeOrPos) ? Range.lift(rangeOrPos) : Range.fromPositions(rangeOrPos); + this._isShowing = true; + this._showImpl(range2, heightInLines); + this._isShowing = false; + this._positionMarkerId.set([{ range: range2, options: ModelDecorationOptions.EMPTY }]); + } + hide() { + if (this._viewZone) { + this.editor.changeViewZones((accessor) => { + if (this._viewZone) { + accessor.removeZone(this._viewZone.id); + } + }); + this._viewZone = null; + } + if (this._overlayWidget) { + this.editor.removeOverlayWidget(this._overlayWidget); + this._overlayWidget = null; + } + this._arrow?.hide(); + this._positionMarkerId.clear(); + this._isSashResizeHeight = false; + } + _decoratingElementsHeight() { + const lineHeight = this.editor.getOption( + 75 + /* EditorOption.lineHeight */ + ); + let result = 0; + if (this.options.showArrow) { + const arrowHeight = Math.round(lineHeight / 3); + result += 2 * arrowHeight; + } + if (this.options.showFrame) { + const frameThickness = this.options.frameWidth ?? Math.round(lineHeight / 9); + result += 2 * frameThickness; + } + return result; + } + /** Gets the maximum widget height in lines. */ + _getMaximumHeightInLines() { + return Math.max(12, this.editor.getLayoutInfo().height / this.editor.getOption( + 75 + /* EditorOption.lineHeight */ + ) * 0.8); + } + _showImpl(where, heightInLines) { + const position = where.getStartPosition(); + const layoutInfo = this.editor.getLayoutInfo(); + const width2 = this._getWidth(layoutInfo); + this.domNode.style.width = `${width2}px`; + this.domNode.style.left = this._getLeft(layoutInfo) + "px"; + const viewZoneDomNode = document.createElement("div"); + viewZoneDomNode.style.overflow = "hidden"; + const lineHeight = this.editor.getOption( + 75 + /* EditorOption.lineHeight */ + ); + const maxHeightInLines = this._getMaximumHeightInLines(); + if (maxHeightInLines !== void 0) { + heightInLines = Math.min(heightInLines, maxHeightInLines); + } + let arrowHeight = 0; + let frameThickness = 0; + if (this._arrow && this.options.showArrow) { + arrowHeight = Math.round(lineHeight / 3); + this._arrow.height = arrowHeight; + this._arrow.show(position); + } + if (this.options.showFrame) { + frameThickness = Math.round(lineHeight / 9); + } + this.editor.changeViewZones((accessor) => { + if (this._viewZone) { + accessor.removeZone(this._viewZone.id); + } + if (this._overlayWidget) { + this.editor.removeOverlayWidget(this._overlayWidget); + this._overlayWidget = null; + } + this.domNode.style.top = "-1000px"; + this._viewZone = new ViewZoneDelegate(viewZoneDomNode, position.lineNumber, position.column, heightInLines, (top) => this._onViewZoneTop(top), (height) => this._onViewZoneHeight(height), this.options.showInHiddenAreas, this.options.ordinal); + this._viewZone.id = accessor.addZone(this._viewZone); + this._overlayWidget = new OverlayWidgetDelegate(WIDGET_ID + this._viewZone.id, this.domNode); + this.editor.addOverlayWidget(this._overlayWidget); + }); + this._updateSashEnablement(); + if (this.container && this.options.showFrame) { + const width3 = this.options.frameWidth ? this.options.frameWidth : frameThickness; + this.container.style.borderTopWidth = width3 + "px"; + this.container.style.borderBottomWidth = width3 + "px"; + } + const containerHeight = heightInLines * lineHeight - this._decoratingElementsHeight(); + if (this.container) { + this.container.style.top = arrowHeight + "px"; + this.container.style.height = containerHeight + "px"; + this.container.style.overflow = "hidden"; + } + this._doLayout(containerHeight, width2); + if (!this.options.keepEditorSelection) { + this.editor.setSelection(where); + } + const model = this.editor.getModel(); + if (model) { + const range2 = model.validateRange(new Range(where.startLineNumber, 1, where.endLineNumber + 1, 1)); + this.revealRange(range2, range2.startLineNumber === model.getLineCount()); + } + } + revealRange(range2, isLastLine) { + if (isLastLine) { + this.editor.revealLineNearTop( + range2.endLineNumber, + 0 + /* ScrollType.Smooth */ + ); + } else { + this.editor.revealRange( + range2, + 0 + /* ScrollType.Smooth */ + ); + } + } + setCssClass(className2, classToReplace) { + if (!this.container) { + return; + } + if (classToReplace) { + this.container.classList.remove(classToReplace); + } + this.container.classList.add(className2); + } + _onWidth(widthInPixel) { + } + _doLayout(heightInPixel, widthInPixel) { + } + _relayout(_newHeightInLines, useMax) { + const maxHeightInLines = this._getMaximumHeightInLines(); + const newHeightInLines = useMax && maxHeightInLines !== void 0 ? Math.min(maxHeightInLines, _newHeightInLines) : _newHeightInLines; + if (this._viewZone && this._viewZone.heightInLines !== newHeightInLines) { + this.editor.changeViewZones((accessor) => { + if (this._viewZone) { + this._viewZone.heightInLines = newHeightInLines; + accessor.layoutZone(this._viewZone.id); + } + }); + this._updateSashEnablement(); + } + } + // --- sash + _initSash() { + if (this._resizeSash) { + return; + } + this._resizeSash = this._disposables.add(new Sash(this.domNode, this, { + orientation: 1 + /* Orientation.HORIZONTAL */ + })); + if (!this.options.isResizeable) { + this._resizeSash.state = 0; + } + let data; + this._disposables.add(this._resizeSash.onDidStart((e) => { + if (this._viewZone) { + data = { + startY: e.startY, + heightInLines: this._viewZone.heightInLines, + ...this._getResizeBounds() + }; + } + })); + this._disposables.add(this._resizeSash.onDidEnd(() => { + data = void 0; + })); + this._disposables.add(this._resizeSash.onDidChange((evt) => { + if (data) { + const lineDelta = (evt.currentY - data.startY) / this.editor.getOption( + 75 + /* EditorOption.lineHeight */ + ); + const roundedLineDelta = lineDelta < 0 ? Math.ceil(lineDelta) : Math.floor(lineDelta); + const newHeightInLines = data.heightInLines + roundedLineDelta; + if (newHeightInLines > data.minLines && newHeightInLines < data.maxLines) { + this._isSashResizeHeight = true; + this._relayout(newHeightInLines); + } + } + })); + } + _updateSashEnablement() { + if (this._resizeSash) { + const { minLines, maxLines } = this._getResizeBounds(); + this._resizeSash.state = minLines === maxLines ? 0 : 3; + } + } + _getResizeBounds() { + return { minLines: 5, maxLines: 35 }; + } + getHorizontalSashLeft() { + return 0; + } + getHorizontalSashTop() { + return (this.domNode.style.height === null ? 0 : parseInt(this.domNode.style.height)) - this._decoratingElementsHeight() / 2; + } + getHorizontalSashWidth() { + const layoutInfo = this.editor.getLayoutInfo(); + return layoutInfo.width - layoutInfo.minimap.minimapWidth; + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/peekView/browser/peekView.js +init_nls(); +init_contextkey(); +init_extensions(); +init_instantiation(); +init_colorRegistry(); +init_observableCodeEditor(); +var __decorate69 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param64 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var IPeekViewService = createDecorator("IPeekViewService"); +registerSingleton( + IPeekViewService, + class { + constructor() { + this._widgets = /* @__PURE__ */ new Map(); + } + addExclusiveWidget(editor2, widget) { + const existing = this._widgets.get(editor2); + if (existing) { + existing.listener.dispose(); + existing.widget.dispose(); + } + const remove = () => { + const data = this._widgets.get(editor2); + if (data && data.widget === widget) { + data.listener.dispose(); + this._widgets.delete(editor2); + } + }; + this._widgets.set(editor2, { widget, listener: widget.onDidClose(remove) }); + } + }, + 1 + /* InstantiationType.Delayed */ +); +var PeekContext; +(function(PeekContext2) { + PeekContext2.inPeekEditor = new RawContextKey("inReferenceSearchEditor", true, localize(1316, "Whether the current code editor is embedded inside peek")); + PeekContext2.notInPeekEditor = PeekContext2.inPeekEditor.toNegated(); +})(PeekContext || (PeekContext = {})); +var PeekContextController = class PeekContextController2 { + static { + this.ID = "editor.contrib.referenceController"; + } + constructor(editor2, contextKeyService) { + if (editor2 instanceof EmbeddedCodeEditorWidget) { + PeekContext.inPeekEditor.bindTo(contextKeyService); + } + } + dispose() { + } +}; +PeekContextController = __decorate69([ + __param64(1, IContextKeyService) +], PeekContextController); +registerEditorContribution( + PeekContextController.ID, + PeekContextController, + 0 + /* EditorContributionInstantiation.Eager */ +); +var defaultOptions2 = { + headerBackgroundColor: Color.white, + primaryHeadingColor: Color.fromHex("#333333"), + secondaryHeadingColor: Color.fromHex("#6c6c6cb3") +}; +var PeekViewWidget = class PeekViewWidget2 extends ZoneWidget { + constructor(editor2, options2, instantiationService) { + super(editor2, options2); + this.instantiationService = instantiationService; + this._onDidClose = new Emitter(); + this.onDidClose = this._onDidClose.event; + mixin(this.options, defaultOptions2, false); + const e = observableCodeEditor(this.editor); + e.openedPeekWidgets.set(e.openedPeekWidgets.get() + 1, void 0); + } + dispose() { + if (!this.disposed) { + this.disposed = true; + super.dispose(); + this._onDidClose.fire(this); + const e = observableCodeEditor(this.editor); + e.openedPeekWidgets.set(e.openedPeekWidgets.get() - 1, void 0); + } + } + style(styles) { + const options2 = this.options; + if (styles.headerBackgroundColor) { + options2.headerBackgroundColor = styles.headerBackgroundColor; + } + if (styles.primaryHeadingColor) { + options2.primaryHeadingColor = styles.primaryHeadingColor; + } + if (styles.secondaryHeadingColor) { + options2.secondaryHeadingColor = styles.secondaryHeadingColor; + } + super.style(styles); + } + _applyStyles() { + super._applyStyles(); + const options2 = this.options; + if (this._headElement && options2.headerBackgroundColor) { + this._headElement.style.backgroundColor = options2.headerBackgroundColor.toString(); + } + if (this._primaryHeading && options2.primaryHeadingColor) { + this._primaryHeading.style.color = options2.primaryHeadingColor.toString(); + } + if (this._secondaryHeading && options2.secondaryHeadingColor) { + this._secondaryHeading.style.color = options2.secondaryHeadingColor.toString(); + } + if (this._bodyElement && options2.frameColor) { + this._bodyElement.style.borderColor = options2.frameColor.toString(); + } + } + _fillContainer(container) { + this.setCssClass("peekview-widget"); + this._headElement = $(".head"); + this._bodyElement = $(".body"); + this._fillHead(this._headElement); + this._fillBody(this._bodyElement); + container.appendChild(this._headElement); + container.appendChild(this._bodyElement); + } + _fillHead(container, noCloseAction) { + this._titleElement = $(".peekview-title"); + if (this.options.supportOnTitleClick) { + this._titleElement.classList.add("clickable"); + addStandardDisposableListener(this._titleElement, "click", (event) => this._onTitleClick(event)); + } + append(this._headElement, this._titleElement); + this._fillTitleIcon(this._titleElement); + this._primaryHeading = $("span.filename"); + this._secondaryHeading = $("span.dirname"); + this._metaHeading = $("span.meta"); + append(this._titleElement, this._primaryHeading, this._secondaryHeading, this._metaHeading); + const actionsContainer = $(".peekview-actions"); + append(this._headElement, actionsContainer); + const actionBarOptions = this._getActionBarOptions(); + this._actionbarWidget = new ActionBar(actionsContainer, actionBarOptions); + this._disposables.add(this._actionbarWidget); + if (!noCloseAction) { + this._actionbarWidget.push(this._disposables.add(new Action("peekview.close", localize(1317, "Close"), ThemeIcon.asClassName(Codicon.close), true, () => { + this.dispose(); + return Promise.resolve(); + })), { label: false, icon: true }); + } + } + _fillTitleIcon(container) { + } + _getActionBarOptions() { + return { + actionViewItemProvider: createActionViewItem.bind(void 0, this.instantiationService), + orientation: 0 + /* ActionsOrientation.HORIZONTAL */ + }; + } + _onTitleClick(event) { + } + setTitle(primaryHeading, secondaryHeading) { + if (this._primaryHeading && this._secondaryHeading) { + this._primaryHeading.innerText = primaryHeading; + this._primaryHeading.setAttribute("title", primaryHeading); + if (secondaryHeading) { + this._secondaryHeading.innerText = secondaryHeading; + } else { + clearNode(this._secondaryHeading); + } + } + } + setMetaTitle(value) { + if (this._metaHeading) { + if (value) { + this._metaHeading.innerText = value; + show(this._metaHeading); + } else { + hide(this._metaHeading); + } + } + } + _doLayout(heightInPixel, widthInPixel) { + if (!this._isShowing && heightInPixel < 0) { + this.dispose(); + return; + } + const headHeight = Math.ceil(this.editor.getOption( + 75 + /* EditorOption.lineHeight */ + ) * 1.2); + const bodyHeight = Math.round(heightInPixel - (headHeight + 1)); + this._doLayoutHead(headHeight, widthInPixel); + this._doLayoutBody(bodyHeight, widthInPixel); + } + _doLayoutHead(heightInPixel, widthInPixel) { + if (this._headElement) { + this._headElement.style.height = `${heightInPixel}px`; + this._headElement.style.lineHeight = this._headElement.style.height; + } + } + _doLayoutBody(heightInPixel, widthInPixel) { + if (this._bodyElement) { + this._bodyElement.style.height = `${heightInPixel}px`; + } + } +}; +PeekViewWidget = __decorate69([ + __param64(2, IInstantiationService) +], PeekViewWidget); +var peekViewTitleBackground = registerColor("peekViewTitle.background", { dark: "#252526", light: "#F3F3F3", hcDark: Color.black, hcLight: Color.white }, localize(1318, "Background color of the peek view title area.")); +var peekViewTitleForeground = registerColor("peekViewTitleLabel.foreground", { dark: Color.white, light: Color.black, hcDark: Color.white, hcLight: editorForeground }, localize(1319, "Color of the peek view title.")); +var peekViewTitleInfoForeground = registerColor("peekViewTitleDescription.foreground", { dark: "#ccccccb3", light: "#616161", hcDark: "#FFFFFF99", hcLight: "#292929" }, localize(1320, "Color of the peek view title info.")); +var peekViewBorder = registerColor("peekView.border", { dark: editorInfoForeground, light: editorInfoForeground, hcDark: contrastBorder, hcLight: contrastBorder }, localize(1321, "Color of the peek view borders and arrow.")); +var peekViewResultsBackground = registerColor("peekViewResult.background", { dark: "#252526", light: "#F3F3F3", hcDark: Color.black, hcLight: Color.white }, localize(1322, "Background color of the peek view result list.")); +var peekViewResultsMatchForeground = registerColor("peekViewResult.lineForeground", { dark: "#bbbbbb", light: "#646465", hcDark: Color.white, hcLight: editorForeground }, localize(1323, "Foreground color for line nodes in the peek view result list.")); +var peekViewResultsFileForeground = registerColor("peekViewResult.fileForeground", { dark: Color.white, light: "#1E1E1E", hcDark: Color.white, hcLight: editorForeground }, localize(1324, "Foreground color for file nodes in the peek view result list.")); +var peekViewResultsSelectionBackground = registerColor("peekViewResult.selectionBackground", { dark: "#3399ff33", light: "#3399ff33", hcDark: null, hcLight: null }, localize(1325, "Background color of the selected entry in the peek view result list.")); +var peekViewResultsSelectionForeground = registerColor("peekViewResult.selectionForeground", { dark: Color.white, light: "#6C6C6C", hcDark: Color.white, hcLight: editorForeground }, localize(1326, "Foreground color of the selected entry in the peek view result list.")); +var peekViewEditorBackground = registerColor("peekViewEditor.background", { dark: "#001F33", light: "#F2F8FC", hcDark: Color.black, hcLight: Color.white }, localize(1327, "Background color of the peek view editor.")); +var peekViewEditorGutterBackground = registerColor("peekViewEditorGutter.background", peekViewEditorBackground, localize(1328, "Background color of the gutter in the peek view editor.")); +var peekViewEditorStickyScrollBackground = registerColor("peekViewEditorStickyScroll.background", peekViewEditorBackground, localize(1329, "Background color of sticky scroll in the peek view editor.")); +var peekViewEditorStickyScrollGutterBackground = registerColor("peekViewEditorStickyScrollGutter.background", peekViewEditorBackground, localize(1330, "Background color of the gutter part of sticky scroll in the peek view editor.")); +var peekViewResultsMatchHighlight = registerColor("peekViewResult.matchHighlightBackground", { dark: "#ea5c004d", light: "#ea5c004d", hcDark: null, hcLight: null }, localize(1331, "Match highlight color in the peek view result list.")); +var peekViewEditorMatchHighlight = registerColor("peekViewEditor.matchHighlightBackground", { dark: "#ff8f0099", light: "#f5d802de", hcDark: null, hcLight: null }, localize(1332, "Match highlight color in the peek view editor.")); +var peekViewEditorMatchHighlightBorder = registerColor("peekViewEditor.matchHighlightBorder", { dark: null, light: null, hcDark: activeContrastBorder, hcLight: activeContrastBorder }, localize(1333, "Match highlight border in the peek view editor.")); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesController.js +init_nls(); +init_commands(); +init_configuration(); +init_contextkey(); +init_instantiation(); +init_keybindingsRegistry(); + +// node_modules/monaco-editor-core/esm/vs/platform/list/browser/listService.js +init_dom(); + +// node_modules/monaco-editor-core/esm/vs/base/browser/ui/list/listPaging.js +init_arrays(); +init_cancellation(); +init_event(); +init_lifecycle(); +var PagedRenderer = class { + get templateId() { + return this.renderer.templateId; + } + constructor(renderer, modelProvider) { + this.renderer = renderer; + this.modelProvider = modelProvider; + } + renderTemplate(container) { + const data = this.renderer.renderTemplate(container); + return { data, disposable: Disposable.None }; + } + renderElement(index, _, data, details) { + data.disposable?.dispose(); + if (!data.data) { + return; + } + const model = this.modelProvider(); + if (model.isResolved(index)) { + return this.renderer.renderElement(model.get(index), index, data.data, details); + } + const cts = new CancellationTokenSource(); + const promise = model.resolve(index, cts.token); + data.disposable = { dispose: () => cts.cancel() }; + this.renderer.renderPlaceholder(index, data.data); + promise.then((entry) => this.renderer.renderElement(entry, index, data.data, details)); + } + disposeTemplate(data) { + if (data.disposable) { + data.disposable.dispose(); + data.disposable = void 0; + } + if (data.data) { + this.renderer.disposeTemplate(data.data); + data.data = void 0; + } + } +}; +var PagedAccessibilityProvider = class { + constructor(modelProvider, accessibilityProvider) { + this.modelProvider = modelProvider; + this.accessibilityProvider = accessibilityProvider; + } + getWidgetAriaLabel() { + return this.accessibilityProvider.getWidgetAriaLabel(); + } + getAriaLabel(index) { + const model = this.modelProvider(); + if (!model.isResolved(index)) { + return null; + } + return this.accessibilityProvider.getAriaLabel(model.get(index)); + } +}; +function fromPagedListOptions(modelProvider, options2) { + return { + ...options2, + accessibilityProvider: options2.accessibilityProvider && new PagedAccessibilityProvider(modelProvider, options2.accessibilityProvider) + }; +} +var PagedList = class { + constructor(user, container, virtualDelegate, renderers, options2 = {}) { + this.modelDisposables = new DisposableStore(); + const modelProvider = () => this.model; + const pagedRenderers = renderers.map((r) => new PagedRenderer(r, modelProvider)); + this.list = new List(user, container, virtualDelegate, pagedRenderers, fromPagedListOptions(modelProvider, options2)); + } + updateOptions(options2) { + this.list.updateOptions(options2); + } + getHTMLElement() { + return this.list.getHTMLElement(); + } + get onDidFocus() { + return this.list.onDidFocus; + } + get widget() { + return this.list; + } + get onDidDispose() { + return this.list.onDidDispose; + } + get onMouseDblClick() { + return Event.map(this.list.onMouseDblClick, ({ element, index, browserEvent }) => ({ element: element === void 0 ? void 0 : this._model.get(element), index, browserEvent })); + } + get onPointer() { + return Event.map(this.list.onPointer, ({ element, index, browserEvent }) => ({ element: element === void 0 ? void 0 : this._model.get(element), index, browserEvent })); + } + get onDidChangeSelection() { + return Event.map(this.list.onDidChangeSelection, ({ elements, indexes, browserEvent }) => ({ elements: elements.map((e) => this._model.get(e)), indexes, browserEvent })); + } + get model() { + return this._model; + } + set model(model) { + this.modelDisposables.clear(); + this._model = model; + this.list.splice(0, this.list.length, range(model.length)); + this.modelDisposables.add(model.onDidIncrementLength((newLength) => this.list.splice(this.list.length, 0, range(this.list.length, newLength)))); + } + getFocus() { + return this.list.getFocus(); + } + getSelection() { + return this.list.getSelection(); + } + getSelectedElements() { + return this.getSelection().map((i2) => this.model.get(i2)); + } + style(styles) { + this.list.style(styles); + } + dispose() { + this.list.dispose(); + this.modelDisposables.dispose(); + } +}; + +// node_modules/monaco-editor-core/esm/vs/base/browser/ui/table/tableWidget.js +init_dom(); + +// node_modules/monaco-editor-core/esm/vs/base/browser/ui/splitview/splitview.js +init_dom(); +init_arrays(); +init_color(); +init_event(); +init_lifecycle(); +init_numbers(); +init_types(); +var defaultStyles = { + separatorBorder: Color.transparent +}; +var ViewItem = class { + set size(size2) { + this._size = size2; + } + get size() { + return this._size; + } + get visible() { + return typeof this._cachedVisibleSize === "undefined"; + } + setVisible(visible, size2) { + if (visible === this.visible) { + return; + } + if (visible) { + this.size = clamp(this._cachedVisibleSize, this.viewMinimumSize, this.viewMaximumSize); + this._cachedVisibleSize = void 0; + } else { + this._cachedVisibleSize = typeof size2 === "number" ? size2 : this.size; + this.size = 0; + } + this.container.classList.toggle("visible", visible); + try { + this.view.setVisible?.(visible); + } catch (e) { + console.error("Splitview: Failed to set visible view"); + console.error(e); + } + } + get minimumSize() { + return this.visible ? this.view.minimumSize : 0; + } + get viewMinimumSize() { + return this.view.minimumSize; + } + get maximumSize() { + return this.visible ? this.view.maximumSize : 0; + } + get viewMaximumSize() { + return this.view.maximumSize; + } + get priority() { + return this.view.priority; + } + get proportionalLayout() { + return this.view.proportionalLayout ?? true; + } + get snap() { + return !!this.view.snap; + } + set enabled(enabled) { + this.container.style.pointerEvents = enabled ? "" : "none"; + } + constructor(container, view, size2, disposable) { + this.container = container; + this.view = view; + this.disposable = disposable; + this._cachedVisibleSize = void 0; + if (typeof size2 === "number") { + this._size = size2; + this._cachedVisibleSize = void 0; + container.classList.add("visible"); + } else { + this._size = 0; + this._cachedVisibleSize = size2.cachedVisibleSize; + } + } + layout(offset, layoutContext) { + this.layoutContainer(offset); + try { + this.view.layout(this.size, offset, layoutContext); + } catch (e) { + console.error("Splitview: Failed to layout view"); + console.error(e); + } + } + dispose() { + this.disposable.dispose(); + } +}; +var VerticalViewItem = class extends ViewItem { + layoutContainer(offset) { + this.container.style.top = `${offset}px`; + this.container.style.height = `${this.size}px`; + } +}; +var HorizontalViewItem = class extends ViewItem { + layoutContainer(offset) { + this.container.style.left = `${offset}px`; + this.container.style.width = `${this.size}px`; + } +}; +var State; +(function(State2) { + State2[State2["Idle"] = 0] = "Idle"; + State2[State2["Busy"] = 1] = "Busy"; +})(State || (State = {})); +var Sizing; +(function(Sizing2) { + Sizing2.Distribute = { type: "distribute" }; + function Split(index) { + return { type: "split", index }; + } + Sizing2.Split = Split; + function Auto(index) { + return { type: "auto", index }; + } + Sizing2.Auto = Auto; + function Invisible(cachedVisibleSize) { + return { type: "invisible", cachedVisibleSize }; + } + Sizing2.Invisible = Invisible; +})(Sizing || (Sizing = {})); +var SplitView = class extends Disposable { + get orthogonalStartSash() { + return this._orthogonalStartSash; + } + get orthogonalEndSash() { + return this._orthogonalEndSash; + } + get startSnappingEnabled() { + return this._startSnappingEnabled; + } + get endSnappingEnabled() { + return this._endSnappingEnabled; + } + /** + * A reference to a sash, perpendicular to all sashes in this {@link SplitView}, + * located at the left- or top-most side of the SplitView. + * Corner sashes will be created automatically at the intersections. + */ + set orthogonalStartSash(sash) { + for (const sashItem of this.sashItems) { + sashItem.sash.orthogonalStartSash = sash; + } + this._orthogonalStartSash = sash; + } + /** + * A reference to a sash, perpendicular to all sashes in this {@link SplitView}, + * located at the right- or bottom-most side of the SplitView. + * Corner sashes will be created automatically at the intersections. + */ + set orthogonalEndSash(sash) { + for (const sashItem of this.sashItems) { + sashItem.sash.orthogonalEndSash = sash; + } + this._orthogonalEndSash = sash; + } + /** + * Enable/disable snapping at the beginning of this {@link SplitView}. + */ + set startSnappingEnabled(startSnappingEnabled) { + if (this._startSnappingEnabled === startSnappingEnabled) { + return; + } + this._startSnappingEnabled = startSnappingEnabled; + this.updateSashEnablement(); + } + /** + * Enable/disable snapping at the end of this {@link SplitView}. + */ + set endSnappingEnabled(endSnappingEnabled) { + if (this._endSnappingEnabled === endSnappingEnabled) { + return; + } + this._endSnappingEnabled = endSnappingEnabled; + this.updateSashEnablement(); + } + /** + * Create a new {@link SplitView} instance. + */ + constructor(container, options2 = {}) { + super(); + this.size = 0; + this._contentSize = 0; + this.proportions = void 0; + this.viewItems = []; + this.sashItems = []; + this.state = State.Idle; + this._onDidSashChange = this._register(new Emitter()); + this._onDidSashReset = this._register(new Emitter()); + this._startSnappingEnabled = true; + this._endSnappingEnabled = true; + this.onDidSashChange = this._onDidSashChange.event; + this.onDidSashReset = this._onDidSashReset.event; + this.orientation = options2.orientation ?? 0; + this.inverseAltBehavior = options2.inverseAltBehavior ?? false; + this.proportionalLayout = options2.proportionalLayout ?? true; + this.getSashOrthogonalSize = options2.getSashOrthogonalSize; + this.el = document.createElement("div"); + this.el.classList.add("monaco-split-view2"); + this.el.classList.add(this.orientation === 0 ? "vertical" : "horizontal"); + container.appendChild(this.el); + this.sashContainer = append(this.el, $(".sash-container")); + this.viewContainer = $(".split-view-container"); + this.scrollable = this._register(new Scrollable({ + forceIntegerValues: true, + smoothScrollDuration: 125, + scheduleAtNextAnimationFrame: (callback) => scheduleAtNextAnimationFrame(getWindow(this.el), callback) + })); + this.scrollableElement = this._register(new SmoothScrollableElement(this.viewContainer, { + vertical: this.orientation === 0 ? options2.scrollbarVisibility ?? 1 : 2, + horizontal: this.orientation === 1 ? options2.scrollbarVisibility ?? 1 : 2 + /* ScrollbarVisibility.Hidden */ + }, this.scrollable)); + const onDidScrollViewContainer = this._register(new DomEmitter(this.viewContainer, "scroll")).event; + this._register(onDidScrollViewContainer((_) => { + const position = this.scrollableElement.getScrollPosition(); + const scrollLeft = Math.abs(this.viewContainer.scrollLeft - position.scrollLeft) <= 1 ? void 0 : this.viewContainer.scrollLeft; + const scrollTop = Math.abs(this.viewContainer.scrollTop - position.scrollTop) <= 1 ? void 0 : this.viewContainer.scrollTop; + if (scrollLeft !== void 0 || scrollTop !== void 0) { + this.scrollableElement.setScrollPosition({ scrollLeft, scrollTop }); + } + })); + this.onDidScroll = this.scrollableElement.onScroll; + this._register(this.onDidScroll((e) => { + if (e.scrollTopChanged) { + this.viewContainer.scrollTop = e.scrollTop; + } + if (e.scrollLeftChanged) { + this.viewContainer.scrollLeft = e.scrollLeft; + } + })); + append(this.el, this.scrollableElement.getDomNode()); + this.style(options2.styles || defaultStyles); + if (options2.descriptor) { + this.size = options2.descriptor.size; + options2.descriptor.views.forEach((viewDescriptor, index) => { + const sizing = isUndefined(viewDescriptor.visible) || viewDescriptor.visible ? viewDescriptor.size : { type: "invisible", cachedVisibleSize: viewDescriptor.size }; + const view = viewDescriptor.view; + this.doAddView(view, sizing, index, true); + }); + this._contentSize = this.viewItems.reduce((r, i2) => r + i2.size, 0); + this.saveProportions(); + } + } + style(styles) { + if (styles.separatorBorder.isTransparent()) { + this.el.classList.remove("separator-border"); + this.el.style.removeProperty("--separator-border"); + } else { + this.el.classList.add("separator-border"); + this.el.style.setProperty("--separator-border", styles.separatorBorder.toString()); + } + } + /** + * Add a {@link IView view} to this {@link SplitView}. + * + * @param view The view to add. + * @param size Either a fixed size, or a dynamic {@link Sizing} strategy. + * @param index The index to insert the view on. + * @param skipLayout Whether layout should be skipped. + */ + addView(view, size2, index = this.viewItems.length, skipLayout) { + this.doAddView(view, size2, index, skipLayout); + } + /** + * Layout the {@link SplitView}. + * + * @param size The entire size of the {@link SplitView}. + * @param layoutContext An optional layout context to pass along to {@link IView views}. + */ + layout(size2, layoutContext) { + const previousSize = Math.max(this.size, this._contentSize); + this.size = size2; + this.layoutContext = layoutContext; + if (!this.proportions) { + const indexes = range(this.viewItems.length); + const lowPriorityIndexes = indexes.filter( + (i2) => this.viewItems[i2].priority === 1 + /* LayoutPriority.Low */ + ); + const highPriorityIndexes = indexes.filter( + (i2) => this.viewItems[i2].priority === 2 + /* LayoutPriority.High */ + ); + this.resize(this.viewItems.length - 1, size2 - previousSize, void 0, lowPriorityIndexes, highPriorityIndexes); + } else { + let total = 0; + for (let i2 = 0; i2 < this.viewItems.length; i2++) { + const item = this.viewItems[i2]; + const proportion = this.proportions[i2]; + if (typeof proportion === "number") { + total += proportion; + } else { + size2 -= item.size; + } + } + for (let i2 = 0; i2 < this.viewItems.length; i2++) { + const item = this.viewItems[i2]; + const proportion = this.proportions[i2]; + if (typeof proportion === "number" && total > 0) { + item.size = clamp(Math.round(proportion * size2 / total), item.minimumSize, item.maximumSize); + } + } + } + this.distributeEmptySpace(); + this.layoutViews(); + } + saveProportions() { + if (this.proportionalLayout && this._contentSize > 0) { + this.proportions = this.viewItems.map((v) => v.proportionalLayout && v.visible ? v.size / this._contentSize : void 0); + } + } + onSashStart({ sash, start, alt }) { + for (const item of this.viewItems) { + item.enabled = false; + } + const index = this.sashItems.findIndex((item) => item.sash === sash); + const disposable = combinedDisposable(addDisposableListener(this.el.ownerDocument.body, "keydown", (e) => resetSashDragState(this.sashDragState.current, e.altKey)), addDisposableListener(this.el.ownerDocument.body, "keyup", () => resetSashDragState(this.sashDragState.current, false))); + const resetSashDragState = (start2, alt2) => { + const sizes = this.viewItems.map((i2) => i2.size); + let minDelta = Number.NEGATIVE_INFINITY; + let maxDelta = Number.POSITIVE_INFINITY; + if (this.inverseAltBehavior) { + alt2 = !alt2; + } + if (alt2) { + const isLastSash = index === this.sashItems.length - 1; + if (isLastSash) { + const viewItem = this.viewItems[index]; + minDelta = (viewItem.minimumSize - viewItem.size) / 2; + maxDelta = (viewItem.maximumSize - viewItem.size) / 2; + } else { + const viewItem = this.viewItems[index + 1]; + minDelta = (viewItem.size - viewItem.maximumSize) / 2; + maxDelta = (viewItem.size - viewItem.minimumSize) / 2; + } + } + let snapBefore; + let snapAfter; + if (!alt2) { + const upIndexes = range(index, -1); + const downIndexes = range(index + 1, this.viewItems.length); + const minDeltaUp = upIndexes.reduce((r, i2) => r + (this.viewItems[i2].minimumSize - sizes[i2]), 0); + const maxDeltaUp = upIndexes.reduce((r, i2) => r + (this.viewItems[i2].viewMaximumSize - sizes[i2]), 0); + const maxDeltaDown = downIndexes.length === 0 ? Number.POSITIVE_INFINITY : downIndexes.reduce((r, i2) => r + (sizes[i2] - this.viewItems[i2].minimumSize), 0); + const minDeltaDown = downIndexes.length === 0 ? Number.NEGATIVE_INFINITY : downIndexes.reduce((r, i2) => r + (sizes[i2] - this.viewItems[i2].viewMaximumSize), 0); + const minDelta2 = Math.max(minDeltaUp, minDeltaDown); + const maxDelta2 = Math.min(maxDeltaDown, maxDeltaUp); + const snapBeforeIndex = this.findFirstSnapIndex(upIndexes); + const snapAfterIndex = this.findFirstSnapIndex(downIndexes); + if (typeof snapBeforeIndex === "number") { + const viewItem = this.viewItems[snapBeforeIndex]; + const halfSize = Math.floor(viewItem.viewMinimumSize / 2); + snapBefore = { + index: snapBeforeIndex, + limitDelta: viewItem.visible ? minDelta2 - halfSize : minDelta2 + halfSize, + size: viewItem.size + }; + } + if (typeof snapAfterIndex === "number") { + const viewItem = this.viewItems[snapAfterIndex]; + const halfSize = Math.floor(viewItem.viewMinimumSize / 2); + snapAfter = { + index: snapAfterIndex, + limitDelta: viewItem.visible ? maxDelta2 + halfSize : maxDelta2 - halfSize, + size: viewItem.size + }; + } + } + this.sashDragState = { start: start2, current: start2, index, sizes, minDelta, maxDelta, alt: alt2, snapBefore, snapAfter, disposable }; + }; + resetSashDragState(start, alt); + } + onSashChange({ current }) { + const { index, start, sizes, alt, minDelta, maxDelta, snapBefore, snapAfter } = this.sashDragState; + this.sashDragState.current = current; + const delta = current - start; + const newDelta = this.resize(index, delta, sizes, void 0, void 0, minDelta, maxDelta, snapBefore, snapAfter); + if (alt) { + const isLastSash = index === this.sashItems.length - 1; + const newSizes = this.viewItems.map((i2) => i2.size); + const viewItemIndex = isLastSash ? index : index + 1; + const viewItem = this.viewItems[viewItemIndex]; + const newMinDelta = viewItem.size - viewItem.maximumSize; + const newMaxDelta = viewItem.size - viewItem.minimumSize; + const resizeIndex = isLastSash ? index - 1 : index + 1; + this.resize(resizeIndex, -newDelta, newSizes, void 0, void 0, newMinDelta, newMaxDelta); + } + this.distributeEmptySpace(); + this.layoutViews(); + } + onSashEnd(index) { + this._onDidSashChange.fire(index); + this.sashDragState.disposable.dispose(); + this.saveProportions(); + for (const item of this.viewItems) { + item.enabled = true; + } + } + onViewChange(item, size2) { + const index = this.viewItems.indexOf(item); + if (index < 0 || index >= this.viewItems.length) { + return; + } + size2 = typeof size2 === "number" ? size2 : item.size; + size2 = clamp(size2, item.minimumSize, item.maximumSize); + if (this.inverseAltBehavior && index > 0) { + this.resize(index - 1, Math.floor((item.size - size2) / 2)); + this.distributeEmptySpace(); + this.layoutViews(); + } else { + item.size = size2; + this.relayout([index], void 0); + } + } + /** + * Resize a {@link IView view} within the {@link SplitView}. + * + * @param index The {@link IView view} index. + * @param size The {@link IView view} size. + */ + resizeView(index, size2) { + if (index < 0 || index >= this.viewItems.length) { + return; + } + if (this.state !== State.Idle) { + throw new Error("Cant modify splitview"); + } + this.state = State.Busy; + try { + const indexes = range(this.viewItems.length).filter((i2) => i2 !== index); + const lowPriorityIndexes = [...indexes.filter( + (i2) => this.viewItems[i2].priority === 1 + /* LayoutPriority.Low */ + ), index]; + const highPriorityIndexes = indexes.filter( + (i2) => this.viewItems[i2].priority === 2 + /* LayoutPriority.High */ + ); + const item = this.viewItems[index]; + size2 = Math.round(size2); + size2 = clamp(size2, item.minimumSize, Math.min(item.maximumSize, this.size)); + item.size = size2; + this.relayout(lowPriorityIndexes, highPriorityIndexes); + } finally { + this.state = State.Idle; + } + } + /** + * Distribute the entire {@link SplitView} size among all {@link IView views}. + */ + distributeViewSizes() { + const flexibleViewItems = []; + let flexibleSize = 0; + for (const item of this.viewItems) { + if (item.maximumSize - item.minimumSize > 0) { + flexibleViewItems.push(item); + flexibleSize += item.size; + } + } + const size2 = Math.floor(flexibleSize / flexibleViewItems.length); + for (const item of flexibleViewItems) { + item.size = clamp(size2, item.minimumSize, item.maximumSize); + } + const indexes = range(this.viewItems.length); + const lowPriorityIndexes = indexes.filter( + (i2) => this.viewItems[i2].priority === 1 + /* LayoutPriority.Low */ + ); + const highPriorityIndexes = indexes.filter( + (i2) => this.viewItems[i2].priority === 2 + /* LayoutPriority.High */ + ); + this.relayout(lowPriorityIndexes, highPriorityIndexes); + } + /** + * Returns the size of a {@link IView view}. + */ + getViewSize(index) { + if (index < 0 || index >= this.viewItems.length) { + return -1; + } + return this.viewItems[index].size; + } + doAddView(view, size2, index = this.viewItems.length, skipLayout) { + if (this.state !== State.Idle) { + throw new Error("Cant modify splitview"); + } + this.state = State.Busy; + try { + const container = $(".split-view-view"); + if (index === this.viewItems.length) { + this.viewContainer.appendChild(container); + } else { + this.viewContainer.insertBefore(container, this.viewContainer.children.item(index)); + } + const onChangeDisposable = view.onDidChange((size3) => this.onViewChange(item, size3)); + const containerDisposable = toDisposable(() => container.remove()); + const disposable = combinedDisposable(onChangeDisposable, containerDisposable); + let viewSize; + if (typeof size2 === "number") { + viewSize = size2; + } else { + if (size2.type === "auto") { + if (this.areViewsDistributed()) { + size2 = { type: "distribute" }; + } else { + size2 = { type: "split", index: size2.index }; + } + } + if (size2.type === "split") { + viewSize = this.getViewSize(size2.index) / 2; + } else if (size2.type === "invisible") { + viewSize = { cachedVisibleSize: size2.cachedVisibleSize }; + } else { + viewSize = view.minimumSize; + } + } + const item = this.orientation === 0 ? new VerticalViewItem(container, view, viewSize, disposable) : new HorizontalViewItem(container, view, viewSize, disposable); + this.viewItems.splice(index, 0, item); + if (this.viewItems.length > 1) { + const opts = { orthogonalStartSash: this.orthogonalStartSash, orthogonalEndSash: this.orthogonalEndSash }; + const sash = this.orientation === 0 ? new Sash(this.sashContainer, { getHorizontalSashTop: (s) => this.getSashPosition(s), getHorizontalSashWidth: this.getSashOrthogonalSize }, { + ...opts, + orientation: 1 + /* Orientation.HORIZONTAL */ + }) : new Sash(this.sashContainer, { getVerticalSashLeft: (s) => this.getSashPosition(s), getVerticalSashHeight: this.getSashOrthogonalSize }, { + ...opts, + orientation: 0 + /* Orientation.VERTICAL */ + }); + const sashEventMapper = this.orientation === 0 ? (e) => ({ sash, start: e.startY, current: e.currentY, alt: e.altKey }) : (e) => ({ sash, start: e.startX, current: e.currentX, alt: e.altKey }); + const onStart = Event.map(sash.onDidStart, sashEventMapper); + const onStartDisposable = onStart(this.onSashStart, this); + const onChange = Event.map(sash.onDidChange, sashEventMapper); + const onChangeDisposable2 = onChange(this.onSashChange, this); + const onEnd = Event.map(sash.onDidEnd, () => this.sashItems.findIndex((item2) => item2.sash === sash)); + const onEndDisposable = onEnd(this.onSashEnd, this); + const onDidResetDisposable = sash.onDidReset(() => { + const index2 = this.sashItems.findIndex((item2) => item2.sash === sash); + const upIndexes = range(index2, -1); + const downIndexes = range(index2 + 1, this.viewItems.length); + const snapBeforeIndex = this.findFirstSnapIndex(upIndexes); + const snapAfterIndex = this.findFirstSnapIndex(downIndexes); + if (typeof snapBeforeIndex === "number" && !this.viewItems[snapBeforeIndex].visible) { + return; + } + if (typeof snapAfterIndex === "number" && !this.viewItems[snapAfterIndex].visible) { + return; + } + this._onDidSashReset.fire(index2); + }); + const disposable2 = combinedDisposable(onStartDisposable, onChangeDisposable2, onEndDisposable, onDidResetDisposable, sash); + const sashItem = { sash, disposable: disposable2 }; + this.sashItems.splice(index - 1, 0, sashItem); + } + container.appendChild(view.element); + let highPriorityIndexes; + if (typeof size2 !== "number" && size2.type === "split") { + highPriorityIndexes = [size2.index]; + } + if (!skipLayout) { + this.relayout([index], highPriorityIndexes); + } + if (!skipLayout && typeof size2 !== "number" && size2.type === "distribute") { + this.distributeViewSizes(); + } + } finally { + this.state = State.Idle; + } + } + relayout(lowPriorityIndexes, highPriorityIndexes) { + const contentSize = this.viewItems.reduce((r, i2) => r + i2.size, 0); + this.resize(this.viewItems.length - 1, this.size - contentSize, void 0, lowPriorityIndexes, highPriorityIndexes); + this.distributeEmptySpace(); + this.layoutViews(); + this.saveProportions(); + } + resize(index, delta, sizes = this.viewItems.map((i2) => i2.size), lowPriorityIndexes, highPriorityIndexes, overloadMinDelta = Number.NEGATIVE_INFINITY, overloadMaxDelta = Number.POSITIVE_INFINITY, snapBefore, snapAfter) { + if (index < 0 || index >= this.viewItems.length) { + return 0; + } + const upIndexes = range(index, -1); + const downIndexes = range(index + 1, this.viewItems.length); + if (highPriorityIndexes) { + for (const index2 of highPriorityIndexes) { + pushToStart(upIndexes, index2); + pushToStart(downIndexes, index2); + } + } + if (lowPriorityIndexes) { + for (const index2 of lowPriorityIndexes) { + pushToEnd(upIndexes, index2); + pushToEnd(downIndexes, index2); + } + } + const upItems = upIndexes.map((i2) => this.viewItems[i2]); + const upSizes = upIndexes.map((i2) => sizes[i2]); + const downItems = downIndexes.map((i2) => this.viewItems[i2]); + const downSizes = downIndexes.map((i2) => sizes[i2]); + const minDeltaUp = upIndexes.reduce((r, i2) => r + (this.viewItems[i2].minimumSize - sizes[i2]), 0); + const maxDeltaUp = upIndexes.reduce((r, i2) => r + (this.viewItems[i2].maximumSize - sizes[i2]), 0); + const maxDeltaDown = downIndexes.length === 0 ? Number.POSITIVE_INFINITY : downIndexes.reduce((r, i2) => r + (sizes[i2] - this.viewItems[i2].minimumSize), 0); + const minDeltaDown = downIndexes.length === 0 ? Number.NEGATIVE_INFINITY : downIndexes.reduce((r, i2) => r + (sizes[i2] - this.viewItems[i2].maximumSize), 0); + const minDelta = Math.max(minDeltaUp, minDeltaDown, overloadMinDelta); + const maxDelta = Math.min(maxDeltaDown, maxDeltaUp, overloadMaxDelta); + let snapped = false; + if (snapBefore) { + const snapView = this.viewItems[snapBefore.index]; + const visible = delta >= snapBefore.limitDelta; + snapped = visible !== snapView.visible; + snapView.setVisible(visible, snapBefore.size); + } + if (!snapped && snapAfter) { + const snapView = this.viewItems[snapAfter.index]; + const visible = delta < snapAfter.limitDelta; + snapped = visible !== snapView.visible; + snapView.setVisible(visible, snapAfter.size); + } + if (snapped) { + return this.resize(index, delta, sizes, lowPriorityIndexes, highPriorityIndexes, overloadMinDelta, overloadMaxDelta); + } + delta = clamp(delta, minDelta, maxDelta); + for (let i2 = 0, deltaUp = delta; i2 < upItems.length; i2++) { + const item = upItems[i2]; + const size2 = clamp(upSizes[i2] + deltaUp, item.minimumSize, item.maximumSize); + const viewDelta = size2 - upSizes[i2]; + deltaUp -= viewDelta; + item.size = size2; + } + for (let i2 = 0, deltaDown = delta; i2 < downItems.length; i2++) { + const item = downItems[i2]; + const size2 = clamp(downSizes[i2] - deltaDown, item.minimumSize, item.maximumSize); + const viewDelta = size2 - downSizes[i2]; + deltaDown += viewDelta; + item.size = size2; + } + return delta; + } + distributeEmptySpace(lowPriorityIndex) { + const contentSize = this.viewItems.reduce((r, i2) => r + i2.size, 0); + let emptyDelta = this.size - contentSize; + const indexes = range(this.viewItems.length - 1, -1); + const lowPriorityIndexes = indexes.filter( + (i2) => this.viewItems[i2].priority === 1 + /* LayoutPriority.Low */ + ); + const highPriorityIndexes = indexes.filter( + (i2) => this.viewItems[i2].priority === 2 + /* LayoutPriority.High */ + ); + for (const index of highPriorityIndexes) { + pushToStart(indexes, index); + } + for (const index of lowPriorityIndexes) { + pushToEnd(indexes, index); + } + if (typeof lowPriorityIndex === "number") { + pushToEnd(indexes, lowPriorityIndex); + } + for (let i2 = 0; emptyDelta !== 0 && i2 < indexes.length; i2++) { + const item = this.viewItems[indexes[i2]]; + const size2 = clamp(item.size + emptyDelta, item.minimumSize, item.maximumSize); + const viewDelta = size2 - item.size; + emptyDelta -= viewDelta; + item.size = size2; + } + } + layoutViews() { + this._contentSize = this.viewItems.reduce((r, i2) => r + i2.size, 0); + let offset = 0; + for (const viewItem of this.viewItems) { + viewItem.layout(offset, this.layoutContext); + offset += viewItem.size; + } + this.sashItems.forEach((item) => item.sash.layout()); + this.updateSashEnablement(); + this.updateScrollableElement(); + } + updateScrollableElement() { + if (this.orientation === 0) { + this.scrollableElement.setScrollDimensions({ + height: this.size, + scrollHeight: this._contentSize + }); + } else { + this.scrollableElement.setScrollDimensions({ + width: this.size, + scrollWidth: this._contentSize + }); + } + } + updateSashEnablement() { + let previous = false; + const collapsesDown = this.viewItems.map((i2) => previous = i2.size - i2.minimumSize > 0 || previous); + previous = false; + const expandsDown = this.viewItems.map((i2) => previous = i2.maximumSize - i2.size > 0 || previous); + const reverseViews = [...this.viewItems].reverse(); + previous = false; + const collapsesUp = reverseViews.map((i2) => previous = i2.size - i2.minimumSize > 0 || previous).reverse(); + previous = false; + const expandsUp = reverseViews.map((i2) => previous = i2.maximumSize - i2.size > 0 || previous).reverse(); + let position = 0; + for (let index = 0; index < this.sashItems.length; index++) { + const { sash } = this.sashItems[index]; + const viewItem = this.viewItems[index]; + position += viewItem.size; + const min = !(collapsesDown[index] && expandsUp[index + 1]); + const max = !(expandsDown[index] && collapsesUp[index + 1]); + if (min && max) { + const upIndexes = range(index, -1); + const downIndexes = range(index + 1, this.viewItems.length); + const snapBeforeIndex = this.findFirstSnapIndex(upIndexes); + const snapAfterIndex = this.findFirstSnapIndex(downIndexes); + const snappedBefore = typeof snapBeforeIndex === "number" && !this.viewItems[snapBeforeIndex].visible; + const snappedAfter = typeof snapAfterIndex === "number" && !this.viewItems[snapAfterIndex].visible; + if (snappedBefore && collapsesUp[index] && (position > 0 || this.startSnappingEnabled)) { + sash.state = 1; + } else if (snappedAfter && collapsesDown[index] && (position < this._contentSize || this.endSnappingEnabled)) { + sash.state = 2; + } else { + sash.state = 0; + } + } else if (min && !max) { + sash.state = 1; + } else if (!min && max) { + sash.state = 2; + } else { + sash.state = 3; + } + } + } + getSashPosition(sash) { + let position = 0; + for (let i2 = 0; i2 < this.sashItems.length; i2++) { + position += this.viewItems[i2].size; + if (this.sashItems[i2].sash === sash) { + return position; + } + } + return 0; + } + findFirstSnapIndex(indexes) { + for (const index of indexes) { + const viewItem = this.viewItems[index]; + if (!viewItem.visible) { + continue; + } + if (viewItem.snap) { + return index; + } + } + for (const index of indexes) { + const viewItem = this.viewItems[index]; + if (viewItem.visible && viewItem.maximumSize - viewItem.minimumSize > 0) { + return void 0; + } + if (!viewItem.visible && viewItem.snap) { + return index; + } + } + return void 0; + } + areViewsDistributed() { + let min = void 0, max = void 0; + for (const view of this.viewItems) { + min = min === void 0 ? view.size : Math.min(min, view.size); + max = max === void 0 ? view.size : Math.max(max, view.size); + if (max - min > 2) { + return false; + } + } + return true; + } + dispose() { + this.sashDragState?.disposable.dispose(); + dispose(this.viewItems); + this.viewItems = []; + this.sashItems.forEach((i2) => i2.disposable.dispose()); + this.sashItems = []; + super.dispose(); + } +}; + +// node_modules/monaco-editor-core/esm/vs/base/browser/ui/table/tableWidget.js +init_event(); +init_lifecycle(); +var TableListRenderer = class _TableListRenderer { + static { + this.TemplateId = "row"; + } + constructor(columns, renderers, getColumnSize) { + this.columns = columns; + this.getColumnSize = getColumnSize; + this.templateId = _TableListRenderer.TemplateId; + this.renderedTemplates = /* @__PURE__ */ new Set(); + const rendererMap = new Map(renderers.map((r) => [r.templateId, r])); + this.renderers = []; + for (const column of columns) { + const renderer = rendererMap.get(column.templateId); + if (!renderer) { + throw new Error(`Table cell renderer for template id ${column.templateId} not found.`); + } + this.renderers.push(renderer); + } + } + renderTemplate(container) { + const rowContainer = append(container, $(".monaco-table-tr")); + const cellContainers = []; + const cellTemplateData = []; + for (let i2 = 0; i2 < this.columns.length; i2++) { + const renderer = this.renderers[i2]; + const cellContainer = append(rowContainer, $(".monaco-table-td", { "data-col-index": i2 })); + cellContainer.style.width = `${this.getColumnSize(i2)}px`; + cellContainers.push(cellContainer); + cellTemplateData.push(renderer.renderTemplate(cellContainer)); + } + const result = { container, cellContainers, cellTemplateData }; + this.renderedTemplates.add(result); + return result; + } + renderElement(element, index, templateData, renderDetails) { + for (let i2 = 0; i2 < this.columns.length; i2++) { + const column = this.columns[i2]; + const cell = column.project(element); + const renderer = this.renderers[i2]; + renderer.renderElement(cell, index, templateData.cellTemplateData[i2], renderDetails); + } + } + disposeElement(element, index, templateData, renderDetails) { + for (let i2 = 0; i2 < this.columns.length; i2++) { + const renderer = this.renderers[i2]; + if (renderer.disposeElement) { + const column = this.columns[i2]; + const cell = column.project(element); + renderer.disposeElement(cell, index, templateData.cellTemplateData[i2], renderDetails); + } + } + } + disposeTemplate(templateData) { + for (let i2 = 0; i2 < this.columns.length; i2++) { + const renderer = this.renderers[i2]; + renderer.disposeTemplate(templateData.cellTemplateData[i2]); + } + clearNode(templateData.container); + this.renderedTemplates.delete(templateData); + } + layoutColumn(index, size2) { + for (const { cellContainers } of this.renderedTemplates) { + cellContainers[index].style.width = `${size2}px`; + } + } +}; +function asListVirtualDelegate(delegate) { + return { + getHeight(row) { + return delegate.getHeight(row); + }, + getTemplateId() { + return TableListRenderer.TemplateId; + } + }; +} +var ColumnHeader = class extends Disposable { + get minimumSize() { + return this.column.minimumWidth ?? 120; + } + get maximumSize() { + return this.column.maximumWidth ?? Number.POSITIVE_INFINITY; + } + get onDidChange() { + return this.column.onDidChangeWidthConstraints ?? Event.None; + } + constructor(column, index) { + super(); + this.column = column; + this.index = index; + this._onDidLayout = new Emitter(); + this.onDidLayout = this._onDidLayout.event; + this.element = $(".monaco-table-th", { "data-col-index": index }, column.label); + if (column.tooltip) { + this._register(getBaseLayerHoverDelegate().setupManagedHover(getDefaultHoverDelegate("mouse"), this.element, column.tooltip)); + } + } + layout(size2) { + this._onDidLayout.fire([this.index, size2]); + } +}; +var Table = class _Table { + static { + this.InstanceCount = 0; + } + get onDidChangeFocus() { + return this.list.onDidChangeFocus; + } + get onDidChangeSelection() { + return this.list.onDidChangeSelection; + } + get onDidScroll() { + return this.list.onDidScroll; + } + get onMouseDblClick() { + return this.list.onMouseDblClick; + } + get onPointer() { + return this.list.onPointer; + } + get onDidFocus() { + return this.list.onDidFocus; + } + get scrollTop() { + return this.list.scrollTop; + } + set scrollTop(scrollTop) { + this.list.scrollTop = scrollTop; + } + get scrollHeight() { + return this.list.scrollHeight; + } + get renderHeight() { + return this.list.renderHeight; + } + get onDidDispose() { + return this.list.onDidDispose; + } + constructor(user, container, virtualDelegate, columns, renderers, _options) { + this.virtualDelegate = virtualDelegate; + this.columns = columns; + this.domId = `table_id_${++_Table.InstanceCount}`; + this.disposables = new DisposableStore(); + this.cachedWidth = 0; + this.cachedHeight = 0; + this.domNode = append(container, $(`.monaco-table.${this.domId}`)); + const headers = columns.map((c, i2) => this.disposables.add(new ColumnHeader(c, i2))); + const descriptor = { + size: headers.reduce((a, b) => a + b.column.weight, 0), + views: headers.map((view) => ({ size: view.column.weight, view })) + }; + this.splitview = this.disposables.add(new SplitView(this.domNode, { + orientation: 1, + scrollbarVisibility: 2, + getSashOrthogonalSize: () => this.cachedHeight, + descriptor + })); + this.splitview.el.style.height = `${virtualDelegate.headerRowHeight}px`; + this.splitview.el.style.lineHeight = `${virtualDelegate.headerRowHeight}px`; + const renderer = new TableListRenderer(columns, renderers, (i2) => this.splitview.getViewSize(i2)); + this.list = this.disposables.add(new List(user, this.domNode, asListVirtualDelegate(virtualDelegate), [renderer], _options)); + Event.any(...headers.map((h2) => h2.onDidLayout))(([index, size2]) => renderer.layoutColumn(index, size2), null, this.disposables); + this.splitview.onDidSashReset((index) => { + const totalWeight = columns.reduce((r, c) => r + c.weight, 0); + const size2 = columns[index].weight / totalWeight * this.cachedWidth; + this.splitview.resizeView(index, size2); + }, null, this.disposables); + this.styleElement = createStyleSheet(this.domNode); + this.style(unthemedListStyles); + } + updateOptions(options2) { + this.list.updateOptions(options2); + } + splice(start, deleteCount, elements = []) { + this.list.splice(start, deleteCount, elements); + } + getHTMLElement() { + return this.domNode; + } + style(styles) { + const content = []; + content.push(`.monaco-table.${this.domId} > .monaco-split-view2 .monaco-sash.vertical::before { + top: ${this.virtualDelegate.headerRowHeight + 1}px; + height: calc(100% - ${this.virtualDelegate.headerRowHeight}px); + }`); + this.styleElement.textContent = content.join("\n"); + this.list.style(styles); + } + getSelectedElements() { + return this.list.getSelectedElements(); + } + getSelection() { + return this.list.getSelection(); + } + getFocus() { + return this.list.getFocus(); + } + dispose() { + this.disposables.dispose(); + } +}; + +// node_modules/monaco-editor-core/esm/vs/base/browser/ui/tree/abstractTree.js +init_dom(); +init_keyboardEvent(); + +// node_modules/monaco-editor-core/esm/vs/base/browser/ui/tree/tree.js +var ObjectTreeElementCollapseState; +(function(ObjectTreeElementCollapseState2) { + ObjectTreeElementCollapseState2[ObjectTreeElementCollapseState2["Expanded"] = 0] = "Expanded"; + ObjectTreeElementCollapseState2[ObjectTreeElementCollapseState2["Collapsed"] = 1] = "Collapsed"; + ObjectTreeElementCollapseState2[ObjectTreeElementCollapseState2["PreserveOrExpanded"] = 2] = "PreserveOrExpanded"; + ObjectTreeElementCollapseState2[ObjectTreeElementCollapseState2["PreserveOrCollapsed"] = 3] = "PreserveOrCollapsed"; +})(ObjectTreeElementCollapseState || (ObjectTreeElementCollapseState = {})); +var TreeMouseEventTarget; +(function(TreeMouseEventTarget2) { + TreeMouseEventTarget2[TreeMouseEventTarget2["Unknown"] = 0] = "Unknown"; + TreeMouseEventTarget2[TreeMouseEventTarget2["Twistie"] = 1] = "Twistie"; + TreeMouseEventTarget2[TreeMouseEventTarget2["Element"] = 2] = "Element"; + TreeMouseEventTarget2[TreeMouseEventTarget2["Filter"] = 3] = "Filter"; +})(TreeMouseEventTarget || (TreeMouseEventTarget = {})); +var TreeError = class extends Error { + constructor(user, message) { + super(`TreeError [${user}] ${message}`); + } +}; +var WeakMapper = class { + constructor(fn) { + this.fn = fn; + this._map = /* @__PURE__ */ new WeakMap(); + } + map(key) { + let result = this._map.get(key); + if (!result) { + result = this.fn(key); + this._map.set(key, result); + } + return result; + } +}; + +// node_modules/monaco-editor-core/esm/vs/base/browser/ui/tree/indexTreeModel.js +init_arrays(); +init_async(); +init_symbols(); + +// node_modules/monaco-editor-core/esm/vs/base/common/diff/diffChange.js +var DiffChange = class { + /** + * Constructs a new DiffChange with the given sequence information + * and content. + */ + constructor(originalStart, originalLength, modifiedStart, modifiedLength) { + this.originalStart = originalStart; + this.originalLength = originalLength; + this.modifiedStart = modifiedStart; + this.modifiedLength = modifiedLength; + } + /** + * The end point (exclusive) of the change in the original sequence. + */ + getOriginalEnd() { + return this.originalStart + this.originalLength; + } + /** + * The end point (exclusive) of the change in the modified sequence. + */ + getModifiedEnd() { + return this.modifiedStart + this.modifiedLength; + } +}; + +// node_modules/monaco-editor-core/esm/vs/base/common/diff/diff.js +init_hash(); +var StringDiffSequence = class { + constructor(source) { + this.source = source; + } + getElements() { + const source = this.source; + const characters = new Int32Array(source.length); + for (let i2 = 0, len = source.length; i2 < len; i2++) { + characters[i2] = source.charCodeAt(i2); + } + return characters; + } +}; +function stringDiff(original, modified, pretty) { + return new LcsDiff(new StringDiffSequence(original), new StringDiffSequence(modified)).ComputeDiff(pretty).changes; +} +var Debug = class { + static Assert(condition, message) { + if (!condition) { + throw new Error(message); + } + } +}; +var MyArray = class { + /** + * Copies a range of elements from an Array starting at the specified source index and pastes + * them to another Array starting at the specified destination index. The length and the indexes + * are specified as 64-bit integers. + * sourceArray: + * The Array that contains the data to copy. + * sourceIndex: + * A 64-bit integer that represents the index in the sourceArray at which copying begins. + * destinationArray: + * The Array that receives the data. + * destinationIndex: + * A 64-bit integer that represents the index in the destinationArray at which storing begins. + * length: + * A 64-bit integer that represents the number of elements to copy. + */ + static Copy(sourceArray, sourceIndex, destinationArray, destinationIndex, length) { + for (let i2 = 0; i2 < length; i2++) { + destinationArray[destinationIndex + i2] = sourceArray[sourceIndex + i2]; + } + } + static Copy2(sourceArray, sourceIndex, destinationArray, destinationIndex, length) { + for (let i2 = 0; i2 < length; i2++) { + destinationArray[destinationIndex + i2] = sourceArray[sourceIndex + i2]; + } + } +}; +var DiffChangeHelper = class { + /** + * Constructs a new DiffChangeHelper for the given DiffSequences. + */ + constructor() { + this.m_changes = []; + this.m_originalStart = 1073741824; + this.m_modifiedStart = 1073741824; + this.m_originalCount = 0; + this.m_modifiedCount = 0; + } + /** + * Marks the beginning of the next change in the set of differences. + */ + MarkNextChange() { + if (this.m_originalCount > 0 || this.m_modifiedCount > 0) { + this.m_changes.push(new DiffChange(this.m_originalStart, this.m_originalCount, this.m_modifiedStart, this.m_modifiedCount)); + } + this.m_originalCount = 0; + this.m_modifiedCount = 0; + this.m_originalStart = 1073741824; + this.m_modifiedStart = 1073741824; + } + /** + * Adds the original element at the given position to the elements + * affected by the current change. The modified index gives context + * to the change position with respect to the original sequence. + * @param originalIndex The index of the original element to add. + * @param modifiedIndex The index of the modified element that provides corresponding position in the modified sequence. + */ + AddOriginalElement(originalIndex, modifiedIndex) { + this.m_originalStart = Math.min(this.m_originalStart, originalIndex); + this.m_modifiedStart = Math.min(this.m_modifiedStart, modifiedIndex); + this.m_originalCount++; + } + /** + * Adds the modified element at the given position to the elements + * affected by the current change. The original index gives context + * to the change position with respect to the modified sequence. + * @param originalIndex The index of the original element that provides corresponding position in the original sequence. + * @param modifiedIndex The index of the modified element to add. + */ + AddModifiedElement(originalIndex, modifiedIndex) { + this.m_originalStart = Math.min(this.m_originalStart, originalIndex); + this.m_modifiedStart = Math.min(this.m_modifiedStart, modifiedIndex); + this.m_modifiedCount++; + } + /** + * Retrieves all of the changes marked by the class. + */ + getChanges() { + if (this.m_originalCount > 0 || this.m_modifiedCount > 0) { + this.MarkNextChange(); + } + return this.m_changes; + } + /** + * Retrieves all of the changes marked by the class in the reverse order + */ + getReverseChanges() { + if (this.m_originalCount > 0 || this.m_modifiedCount > 0) { + this.MarkNextChange(); + } + this.m_changes.reverse(); + return this.m_changes; + } +}; +var LcsDiff = class _LcsDiff { + /** + * Constructs the DiffFinder + */ + constructor(originalSequence, modifiedSequence, continueProcessingPredicate = null) { + this.ContinueProcessingPredicate = continueProcessingPredicate; + this._originalSequence = originalSequence; + this._modifiedSequence = modifiedSequence; + const [originalStringElements, originalElementsOrHash, originalHasStrings] = _LcsDiff._getElements(originalSequence); + const [modifiedStringElements, modifiedElementsOrHash, modifiedHasStrings] = _LcsDiff._getElements(modifiedSequence); + this._hasStrings = originalHasStrings && modifiedHasStrings; + this._originalStringElements = originalStringElements; + this._originalElementsOrHash = originalElementsOrHash; + this._modifiedStringElements = modifiedStringElements; + this._modifiedElementsOrHash = modifiedElementsOrHash; + this.m_forwardHistory = []; + this.m_reverseHistory = []; + } + static _isStringArray(arr) { + return arr.length > 0 && typeof arr[0] === "string"; + } + static _getElements(sequence) { + const elements = sequence.getElements(); + if (_LcsDiff._isStringArray(elements)) { + const hashes = new Int32Array(elements.length); + for (let i2 = 0, len = elements.length; i2 < len; i2++) { + hashes[i2] = stringHash(elements[i2], 0); + } + return [elements, hashes, true]; + } + if (elements instanceof Int32Array) { + return [[], elements, false]; + } + return [[], new Int32Array(elements), false]; + } + ElementsAreEqual(originalIndex, newIndex) { + if (this._originalElementsOrHash[originalIndex] !== this._modifiedElementsOrHash[newIndex]) { + return false; + } + return this._hasStrings ? this._originalStringElements[originalIndex] === this._modifiedStringElements[newIndex] : true; + } + ElementsAreStrictEqual(originalIndex, newIndex) { + if (!this.ElementsAreEqual(originalIndex, newIndex)) { + return false; + } + const originalElement = _LcsDiff._getStrictElement(this._originalSequence, originalIndex); + const modifiedElement = _LcsDiff._getStrictElement(this._modifiedSequence, newIndex); + return originalElement === modifiedElement; + } + static _getStrictElement(sequence, index) { + if (typeof sequence.getStrictElement === "function") { + return sequence.getStrictElement(index); + } + return null; + } + OriginalElementsAreEqual(index1, index2) { + if (this._originalElementsOrHash[index1] !== this._originalElementsOrHash[index2]) { + return false; + } + return this._hasStrings ? this._originalStringElements[index1] === this._originalStringElements[index2] : true; + } + ModifiedElementsAreEqual(index1, index2) { + if (this._modifiedElementsOrHash[index1] !== this._modifiedElementsOrHash[index2]) { + return false; + } + return this._hasStrings ? this._modifiedStringElements[index1] === this._modifiedStringElements[index2] : true; + } + ComputeDiff(pretty) { + return this._ComputeDiff(0, this._originalElementsOrHash.length - 1, 0, this._modifiedElementsOrHash.length - 1, pretty); + } + /** + * Computes the differences between the original and modified input + * sequences on the bounded range. + * @returns An array of the differences between the two input sequences. + */ + _ComputeDiff(originalStart, originalEnd, modifiedStart, modifiedEnd, pretty) { + const quitEarlyArr = [false]; + let changes = this.ComputeDiffRecursive(originalStart, originalEnd, modifiedStart, modifiedEnd, quitEarlyArr); + if (pretty) { + changes = this.PrettifyChanges(changes); + } + return { + quitEarly: quitEarlyArr[0], + changes + }; + } + /** + * Private helper method which computes the differences on the bounded range + * recursively. + * @returns An array of the differences between the two input sequences. + */ + ComputeDiffRecursive(originalStart, originalEnd, modifiedStart, modifiedEnd, quitEarlyArr) { + quitEarlyArr[0] = false; + while (originalStart <= originalEnd && modifiedStart <= modifiedEnd && this.ElementsAreEqual(originalStart, modifiedStart)) { + originalStart++; + modifiedStart++; + } + while (originalEnd >= originalStart && modifiedEnd >= modifiedStart && this.ElementsAreEqual(originalEnd, modifiedEnd)) { + originalEnd--; + modifiedEnd--; + } + if (originalStart > originalEnd || modifiedStart > modifiedEnd) { + let changes; + if (modifiedStart <= modifiedEnd) { + Debug.Assert(originalStart === originalEnd + 1, "originalStart should only be one more than originalEnd"); + changes = [ + new DiffChange(originalStart, 0, modifiedStart, modifiedEnd - modifiedStart + 1) + ]; + } else if (originalStart <= originalEnd) { + Debug.Assert(modifiedStart === modifiedEnd + 1, "modifiedStart should only be one more than modifiedEnd"); + changes = [ + new DiffChange(originalStart, originalEnd - originalStart + 1, modifiedStart, 0) + ]; + } else { + Debug.Assert(originalStart === originalEnd + 1, "originalStart should only be one more than originalEnd"); + Debug.Assert(modifiedStart === modifiedEnd + 1, "modifiedStart should only be one more than modifiedEnd"); + changes = []; + } + return changes; + } + const midOriginalArr = [0]; + const midModifiedArr = [0]; + const result = this.ComputeRecursionPoint(originalStart, originalEnd, modifiedStart, modifiedEnd, midOriginalArr, midModifiedArr, quitEarlyArr); + const midOriginal = midOriginalArr[0]; + const midModified = midModifiedArr[0]; + if (result !== null) { + return result; + } else if (!quitEarlyArr[0]) { + const leftChanges = this.ComputeDiffRecursive(originalStart, midOriginal, modifiedStart, midModified, quitEarlyArr); + let rightChanges = []; + if (!quitEarlyArr[0]) { + rightChanges = this.ComputeDiffRecursive(midOriginal + 1, originalEnd, midModified + 1, modifiedEnd, quitEarlyArr); + } else { + rightChanges = [ + new DiffChange(midOriginal + 1, originalEnd - (midOriginal + 1) + 1, midModified + 1, modifiedEnd - (midModified + 1) + 1) + ]; + } + return this.ConcatenateChanges(leftChanges, rightChanges); + } + return [ + new DiffChange(originalStart, originalEnd - originalStart + 1, modifiedStart, modifiedEnd - modifiedStart + 1) + ]; + } + WALKTRACE(diagonalForwardBase, diagonalForwardStart, diagonalForwardEnd, diagonalForwardOffset, diagonalReverseBase, diagonalReverseStart, diagonalReverseEnd, diagonalReverseOffset, forwardPoints, reversePoints, originalIndex, originalEnd, midOriginalArr, modifiedIndex, modifiedEnd, midModifiedArr, deltaIsEven, quitEarlyArr) { + let forwardChanges = null; + let reverseChanges = null; + let changeHelper = new DiffChangeHelper(); + let diagonalMin = diagonalForwardStart; + let diagonalMax = diagonalForwardEnd; + let diagonalRelative = midOriginalArr[0] - midModifiedArr[0] - diagonalForwardOffset; + let lastOriginalIndex = -1073741824; + let historyIndex = this.m_forwardHistory.length - 1; + do { + const diagonal = diagonalRelative + diagonalForwardBase; + if (diagonal === diagonalMin || diagonal < diagonalMax && forwardPoints[diagonal - 1] < forwardPoints[diagonal + 1]) { + originalIndex = forwardPoints[diagonal + 1]; + modifiedIndex = originalIndex - diagonalRelative - diagonalForwardOffset; + if (originalIndex < lastOriginalIndex) { + changeHelper.MarkNextChange(); + } + lastOriginalIndex = originalIndex; + changeHelper.AddModifiedElement(originalIndex + 1, modifiedIndex); + diagonalRelative = diagonal + 1 - diagonalForwardBase; + } else { + originalIndex = forwardPoints[diagonal - 1] + 1; + modifiedIndex = originalIndex - diagonalRelative - diagonalForwardOffset; + if (originalIndex < lastOriginalIndex) { + changeHelper.MarkNextChange(); + } + lastOriginalIndex = originalIndex - 1; + changeHelper.AddOriginalElement(originalIndex, modifiedIndex + 1); + diagonalRelative = diagonal - 1 - diagonalForwardBase; + } + if (historyIndex >= 0) { + forwardPoints = this.m_forwardHistory[historyIndex]; + diagonalForwardBase = forwardPoints[0]; + diagonalMin = 1; + diagonalMax = forwardPoints.length - 1; + } + } while (--historyIndex >= -1); + forwardChanges = changeHelper.getReverseChanges(); + if (quitEarlyArr[0]) { + let originalStartPoint = midOriginalArr[0] + 1; + let modifiedStartPoint = midModifiedArr[0] + 1; + if (forwardChanges !== null && forwardChanges.length > 0) { + const lastForwardChange = forwardChanges[forwardChanges.length - 1]; + originalStartPoint = Math.max(originalStartPoint, lastForwardChange.getOriginalEnd()); + modifiedStartPoint = Math.max(modifiedStartPoint, lastForwardChange.getModifiedEnd()); + } + reverseChanges = [ + new DiffChange(originalStartPoint, originalEnd - originalStartPoint + 1, modifiedStartPoint, modifiedEnd - modifiedStartPoint + 1) + ]; + } else { + changeHelper = new DiffChangeHelper(); + diagonalMin = diagonalReverseStart; + diagonalMax = diagonalReverseEnd; + diagonalRelative = midOriginalArr[0] - midModifiedArr[0] - diagonalReverseOffset; + lastOriginalIndex = 1073741824; + historyIndex = deltaIsEven ? this.m_reverseHistory.length - 1 : this.m_reverseHistory.length - 2; + do { + const diagonal = diagonalRelative + diagonalReverseBase; + if (diagonal === diagonalMin || diagonal < diagonalMax && reversePoints[diagonal - 1] >= reversePoints[diagonal + 1]) { + originalIndex = reversePoints[diagonal + 1] - 1; + modifiedIndex = originalIndex - diagonalRelative - diagonalReverseOffset; + if (originalIndex > lastOriginalIndex) { + changeHelper.MarkNextChange(); + } + lastOriginalIndex = originalIndex + 1; + changeHelper.AddOriginalElement(originalIndex + 1, modifiedIndex + 1); + diagonalRelative = diagonal + 1 - diagonalReverseBase; + } else { + originalIndex = reversePoints[diagonal - 1]; + modifiedIndex = originalIndex - diagonalRelative - diagonalReverseOffset; + if (originalIndex > lastOriginalIndex) { + changeHelper.MarkNextChange(); + } + lastOriginalIndex = originalIndex; + changeHelper.AddModifiedElement(originalIndex + 1, modifiedIndex + 1); + diagonalRelative = diagonal - 1 - diagonalReverseBase; + } + if (historyIndex >= 0) { + reversePoints = this.m_reverseHistory[historyIndex]; + diagonalReverseBase = reversePoints[0]; + diagonalMin = 1; + diagonalMax = reversePoints.length - 1; + } + } while (--historyIndex >= -1); + reverseChanges = changeHelper.getChanges(); + } + return this.ConcatenateChanges(forwardChanges, reverseChanges); + } + /** + * Given the range to compute the diff on, this method finds the point: + * (midOriginal, midModified) + * that exists in the middle of the LCS of the two sequences and + * is the point at which the LCS problem may be broken down recursively. + * This method will try to keep the LCS trace in memory. If the LCS recursion + * point is calculated and the full trace is available in memory, then this method + * will return the change list. + * @param originalStart The start bound of the original sequence range + * @param originalEnd The end bound of the original sequence range + * @param modifiedStart The start bound of the modified sequence range + * @param modifiedEnd The end bound of the modified sequence range + * @param midOriginal The middle point of the original sequence range + * @param midModified The middle point of the modified sequence range + * @returns The diff changes, if available, otherwise null + */ + ComputeRecursionPoint(originalStart, originalEnd, modifiedStart, modifiedEnd, midOriginalArr, midModifiedArr, quitEarlyArr) { + let originalIndex = 0, modifiedIndex = 0; + let diagonalForwardStart = 0, diagonalForwardEnd = 0; + let diagonalReverseStart = 0, diagonalReverseEnd = 0; + originalStart--; + modifiedStart--; + midOriginalArr[0] = 0; + midModifiedArr[0] = 0; + this.m_forwardHistory = []; + this.m_reverseHistory = []; + const maxDifferences = originalEnd - originalStart + (modifiedEnd - modifiedStart); + const numDiagonals = maxDifferences + 1; + const forwardPoints = new Int32Array(numDiagonals); + const reversePoints = new Int32Array(numDiagonals); + const diagonalForwardBase = modifiedEnd - modifiedStart; + const diagonalReverseBase = originalEnd - originalStart; + const diagonalForwardOffset = originalStart - modifiedStart; + const diagonalReverseOffset = originalEnd - modifiedEnd; + const delta = diagonalReverseBase - diagonalForwardBase; + const deltaIsEven = delta % 2 === 0; + forwardPoints[diagonalForwardBase] = originalStart; + reversePoints[diagonalReverseBase] = originalEnd; + quitEarlyArr[0] = false; + for (let numDifferences = 1; numDifferences <= maxDifferences / 2 + 1; numDifferences++) { + let furthestOriginalIndex = 0; + let furthestModifiedIndex = 0; + diagonalForwardStart = this.ClipDiagonalBound(diagonalForwardBase - numDifferences, numDifferences, diagonalForwardBase, numDiagonals); + diagonalForwardEnd = this.ClipDiagonalBound(diagonalForwardBase + numDifferences, numDifferences, diagonalForwardBase, numDiagonals); + for (let diagonal = diagonalForwardStart; diagonal <= diagonalForwardEnd; diagonal += 2) { + if (diagonal === diagonalForwardStart || diagonal < diagonalForwardEnd && forwardPoints[diagonal - 1] < forwardPoints[diagonal + 1]) { + originalIndex = forwardPoints[diagonal + 1]; + } else { + originalIndex = forwardPoints[diagonal - 1] + 1; + } + modifiedIndex = originalIndex - (diagonal - diagonalForwardBase) - diagonalForwardOffset; + const tempOriginalIndex = originalIndex; + while (originalIndex < originalEnd && modifiedIndex < modifiedEnd && this.ElementsAreEqual(originalIndex + 1, modifiedIndex + 1)) { + originalIndex++; + modifiedIndex++; + } + forwardPoints[diagonal] = originalIndex; + if (originalIndex + modifiedIndex > furthestOriginalIndex + furthestModifiedIndex) { + furthestOriginalIndex = originalIndex; + furthestModifiedIndex = modifiedIndex; + } + if (!deltaIsEven && Math.abs(diagonal - diagonalReverseBase) <= numDifferences - 1) { + if (originalIndex >= reversePoints[diagonal]) { + midOriginalArr[0] = originalIndex; + midModifiedArr[0] = modifiedIndex; + if (tempOriginalIndex <= reversePoints[diagonal] && 1447 > 0 && numDifferences <= 1447 + 1) { + return this.WALKTRACE(diagonalForwardBase, diagonalForwardStart, diagonalForwardEnd, diagonalForwardOffset, diagonalReverseBase, diagonalReverseStart, diagonalReverseEnd, diagonalReverseOffset, forwardPoints, reversePoints, originalIndex, originalEnd, midOriginalArr, modifiedIndex, modifiedEnd, midModifiedArr, deltaIsEven, quitEarlyArr); + } else { + return null; + } + } + } + } + const matchLengthOfLongest = (furthestOriginalIndex - originalStart + (furthestModifiedIndex - modifiedStart) - numDifferences) / 2; + if (this.ContinueProcessingPredicate !== null && !this.ContinueProcessingPredicate(furthestOriginalIndex, matchLengthOfLongest)) { + quitEarlyArr[0] = true; + midOriginalArr[0] = furthestOriginalIndex; + midModifiedArr[0] = furthestModifiedIndex; + if (matchLengthOfLongest > 0 && 1447 > 0 && numDifferences <= 1447 + 1) { + return this.WALKTRACE(diagonalForwardBase, diagonalForwardStart, diagonalForwardEnd, diagonalForwardOffset, diagonalReverseBase, diagonalReverseStart, diagonalReverseEnd, diagonalReverseOffset, forwardPoints, reversePoints, originalIndex, originalEnd, midOriginalArr, modifiedIndex, modifiedEnd, midModifiedArr, deltaIsEven, quitEarlyArr); + } else { + originalStart++; + modifiedStart++; + return [ + new DiffChange(originalStart, originalEnd - originalStart + 1, modifiedStart, modifiedEnd - modifiedStart + 1) + ]; + } + } + diagonalReverseStart = this.ClipDiagonalBound(diagonalReverseBase - numDifferences, numDifferences, diagonalReverseBase, numDiagonals); + diagonalReverseEnd = this.ClipDiagonalBound(diagonalReverseBase + numDifferences, numDifferences, diagonalReverseBase, numDiagonals); + for (let diagonal = diagonalReverseStart; diagonal <= diagonalReverseEnd; diagonal += 2) { + if (diagonal === diagonalReverseStart || diagonal < diagonalReverseEnd && reversePoints[diagonal - 1] >= reversePoints[diagonal + 1]) { + originalIndex = reversePoints[diagonal + 1] - 1; + } else { + originalIndex = reversePoints[diagonal - 1]; + } + modifiedIndex = originalIndex - (diagonal - diagonalReverseBase) - diagonalReverseOffset; + const tempOriginalIndex = originalIndex; + while (originalIndex > originalStart && modifiedIndex > modifiedStart && this.ElementsAreEqual(originalIndex, modifiedIndex)) { + originalIndex--; + modifiedIndex--; + } + reversePoints[diagonal] = originalIndex; + if (deltaIsEven && Math.abs(diagonal - diagonalForwardBase) <= numDifferences) { + if (originalIndex <= forwardPoints[diagonal]) { + midOriginalArr[0] = originalIndex; + midModifiedArr[0] = modifiedIndex; + if (tempOriginalIndex >= forwardPoints[diagonal] && 1447 > 0 && numDifferences <= 1447 + 1) { + return this.WALKTRACE(diagonalForwardBase, diagonalForwardStart, diagonalForwardEnd, diagonalForwardOffset, diagonalReverseBase, diagonalReverseStart, diagonalReverseEnd, diagonalReverseOffset, forwardPoints, reversePoints, originalIndex, originalEnd, midOriginalArr, modifiedIndex, modifiedEnd, midModifiedArr, deltaIsEven, quitEarlyArr); + } else { + return null; + } + } + } + } + if (numDifferences <= 1447) { + let temp = new Int32Array(diagonalForwardEnd - diagonalForwardStart + 2); + temp[0] = diagonalForwardBase - diagonalForwardStart + 1; + MyArray.Copy2(forwardPoints, diagonalForwardStart, temp, 1, diagonalForwardEnd - diagonalForwardStart + 1); + this.m_forwardHistory.push(temp); + temp = new Int32Array(diagonalReverseEnd - diagonalReverseStart + 2); + temp[0] = diagonalReverseBase - diagonalReverseStart + 1; + MyArray.Copy2(reversePoints, diagonalReverseStart, temp, 1, diagonalReverseEnd - diagonalReverseStart + 1); + this.m_reverseHistory.push(temp); + } + } + return this.WALKTRACE(diagonalForwardBase, diagonalForwardStart, diagonalForwardEnd, diagonalForwardOffset, diagonalReverseBase, diagonalReverseStart, diagonalReverseEnd, diagonalReverseOffset, forwardPoints, reversePoints, originalIndex, originalEnd, midOriginalArr, modifiedIndex, modifiedEnd, midModifiedArr, deltaIsEven, quitEarlyArr); + } + /** + * Shifts the given changes to provide a more intuitive diff. + * While the first element in a diff matches the first element after the diff, + * we shift the diff down. + * + * @param changes The list of changes to shift + * @returns The shifted changes + */ + PrettifyChanges(changes) { + for (let i2 = 0; i2 < changes.length; i2++) { + const change = changes[i2]; + const originalStop = i2 < changes.length - 1 ? changes[i2 + 1].originalStart : this._originalElementsOrHash.length; + const modifiedStop = i2 < changes.length - 1 ? changes[i2 + 1].modifiedStart : this._modifiedElementsOrHash.length; + const checkOriginal = change.originalLength > 0; + const checkModified = change.modifiedLength > 0; + while (change.originalStart + change.originalLength < originalStop && change.modifiedStart + change.modifiedLength < modifiedStop && (!checkOriginal || this.OriginalElementsAreEqual(change.originalStart, change.originalStart + change.originalLength)) && (!checkModified || this.ModifiedElementsAreEqual(change.modifiedStart, change.modifiedStart + change.modifiedLength))) { + const startStrictEqual = this.ElementsAreStrictEqual(change.originalStart, change.modifiedStart); + const endStrictEqual = this.ElementsAreStrictEqual(change.originalStart + change.originalLength, change.modifiedStart + change.modifiedLength); + if (endStrictEqual && !startStrictEqual) { + break; + } + change.originalStart++; + change.modifiedStart++; + } + const mergedChangeArr = [null]; + if (i2 < changes.length - 1 && this.ChangesOverlap(changes[i2], changes[i2 + 1], mergedChangeArr)) { + changes[i2] = mergedChangeArr[0]; + changes.splice(i2 + 1, 1); + i2--; + continue; + } + } + for (let i2 = changes.length - 1; i2 >= 0; i2--) { + const change = changes[i2]; + let originalStop = 0; + let modifiedStop = 0; + if (i2 > 0) { + const prevChange = changes[i2 - 1]; + originalStop = prevChange.originalStart + prevChange.originalLength; + modifiedStop = prevChange.modifiedStart + prevChange.modifiedLength; + } + const checkOriginal = change.originalLength > 0; + const checkModified = change.modifiedLength > 0; + let bestDelta = 0; + let bestScore = this._boundaryScore(change.originalStart, change.originalLength, change.modifiedStart, change.modifiedLength); + for (let delta = 1; ; delta++) { + const originalStart = change.originalStart - delta; + const modifiedStart = change.modifiedStart - delta; + if (originalStart < originalStop || modifiedStart < modifiedStop) { + break; + } + if (checkOriginal && !this.OriginalElementsAreEqual(originalStart, originalStart + change.originalLength)) { + break; + } + if (checkModified && !this.ModifiedElementsAreEqual(modifiedStart, modifiedStart + change.modifiedLength)) { + break; + } + const touchingPreviousChange = originalStart === originalStop && modifiedStart === modifiedStop; + const score3 = (touchingPreviousChange ? 5 : 0) + this._boundaryScore(originalStart, change.originalLength, modifiedStart, change.modifiedLength); + if (score3 > bestScore) { + bestScore = score3; + bestDelta = delta; + } + } + change.originalStart -= bestDelta; + change.modifiedStart -= bestDelta; + const mergedChangeArr = [null]; + if (i2 > 0 && this.ChangesOverlap(changes[i2 - 1], changes[i2], mergedChangeArr)) { + changes[i2 - 1] = mergedChangeArr[0]; + changes.splice(i2, 1); + i2++; + continue; + } + } + if (this._hasStrings) { + for (let i2 = 1, len = changes.length; i2 < len; i2++) { + const aChange = changes[i2 - 1]; + const bChange = changes[i2]; + const matchedLength = bChange.originalStart - aChange.originalStart - aChange.originalLength; + const aOriginalStart = aChange.originalStart; + const bOriginalEnd = bChange.originalStart + bChange.originalLength; + const abOriginalLength = bOriginalEnd - aOriginalStart; + const aModifiedStart = aChange.modifiedStart; + const bModifiedEnd = bChange.modifiedStart + bChange.modifiedLength; + const abModifiedLength = bModifiedEnd - aModifiedStart; + if (matchedLength < 5 && abOriginalLength < 20 && abModifiedLength < 20) { + const t = this._findBetterContiguousSequence(aOriginalStart, abOriginalLength, aModifiedStart, abModifiedLength, matchedLength); + if (t) { + const [originalMatchStart, modifiedMatchStart] = t; + if (originalMatchStart !== aChange.originalStart + aChange.originalLength || modifiedMatchStart !== aChange.modifiedStart + aChange.modifiedLength) { + aChange.originalLength = originalMatchStart - aChange.originalStart; + aChange.modifiedLength = modifiedMatchStart - aChange.modifiedStart; + bChange.originalStart = originalMatchStart + matchedLength; + bChange.modifiedStart = modifiedMatchStart + matchedLength; + bChange.originalLength = bOriginalEnd - bChange.originalStart; + bChange.modifiedLength = bModifiedEnd - bChange.modifiedStart; + } + } + } + } + } + return changes; + } + _findBetterContiguousSequence(originalStart, originalLength, modifiedStart, modifiedLength, desiredLength) { + if (originalLength < desiredLength || modifiedLength < desiredLength) { + return null; + } + const originalMax = originalStart + originalLength - desiredLength + 1; + const modifiedMax = modifiedStart + modifiedLength - desiredLength + 1; + let bestScore = 0; + let bestOriginalStart = 0; + let bestModifiedStart = 0; + for (let i2 = originalStart; i2 < originalMax; i2++) { + for (let j = modifiedStart; j < modifiedMax; j++) { + const score3 = this._contiguousSequenceScore(i2, j, desiredLength); + if (score3 > 0 && score3 > bestScore) { + bestScore = score3; + bestOriginalStart = i2; + bestModifiedStart = j; + } + } + } + if (bestScore > 0) { + return [bestOriginalStart, bestModifiedStart]; + } + return null; + } + _contiguousSequenceScore(originalStart, modifiedStart, length) { + let score3 = 0; + for (let l = 0; l < length; l++) { + if (!this.ElementsAreEqual(originalStart + l, modifiedStart + l)) { + return 0; + } + score3 += this._originalStringElements[originalStart + l].length; + } + return score3; + } + _OriginalIsBoundary(index) { + if (index <= 0 || index >= this._originalElementsOrHash.length - 1) { + return true; + } + return this._hasStrings && /^\s*$/.test(this._originalStringElements[index]); + } + _OriginalRegionIsBoundary(originalStart, originalLength) { + if (this._OriginalIsBoundary(originalStart) || this._OriginalIsBoundary(originalStart - 1)) { + return true; + } + if (originalLength > 0) { + const originalEnd = originalStart + originalLength; + if (this._OriginalIsBoundary(originalEnd - 1) || this._OriginalIsBoundary(originalEnd)) { + return true; + } + } + return false; + } + _ModifiedIsBoundary(index) { + if (index <= 0 || index >= this._modifiedElementsOrHash.length - 1) { + return true; + } + return this._hasStrings && /^\s*$/.test(this._modifiedStringElements[index]); + } + _ModifiedRegionIsBoundary(modifiedStart, modifiedLength) { + if (this._ModifiedIsBoundary(modifiedStart) || this._ModifiedIsBoundary(modifiedStart - 1)) { + return true; + } + if (modifiedLength > 0) { + const modifiedEnd = modifiedStart + modifiedLength; + if (this._ModifiedIsBoundary(modifiedEnd - 1) || this._ModifiedIsBoundary(modifiedEnd)) { + return true; + } + } + return false; + } + _boundaryScore(originalStart, originalLength, modifiedStart, modifiedLength) { + const originalScore = this._OriginalRegionIsBoundary(originalStart, originalLength) ? 1 : 0; + const modifiedScore = this._ModifiedRegionIsBoundary(modifiedStart, modifiedLength) ? 1 : 0; + return originalScore + modifiedScore; + } + /** + * Concatenates the two input DiffChange lists and returns the resulting + * list. + * @param The left changes + * @param The right changes + * @returns The concatenated list + */ + ConcatenateChanges(left, right) { + const mergedChangeArr = []; + if (left.length === 0 || right.length === 0) { + return right.length > 0 ? right : left; + } else if (this.ChangesOverlap(left[left.length - 1], right[0], mergedChangeArr)) { + const result = new Array(left.length + right.length - 1); + MyArray.Copy(left, 0, result, 0, left.length - 1); + result[left.length - 1] = mergedChangeArr[0]; + MyArray.Copy(right, 1, result, left.length, right.length - 1); + return result; + } else { + const result = new Array(left.length + right.length); + MyArray.Copy(left, 0, result, 0, left.length); + MyArray.Copy(right, 0, result, left.length, right.length); + return result; + } + } + /** + * Returns true if the two changes overlap and can be merged into a single + * change + * @param left The left change + * @param right The right change + * @param mergedChange The merged change if the two overlap, null otherwise + * @returns True if the two changes overlap + */ + ChangesOverlap(left, right, mergedChangeArr) { + Debug.Assert(left.originalStart <= right.originalStart, "Left change is not less than or equal to right change"); + Debug.Assert(left.modifiedStart <= right.modifiedStart, "Left change is not less than or equal to right change"); + if (left.originalStart + left.originalLength >= right.originalStart || left.modifiedStart + left.modifiedLength >= right.modifiedStart) { + const originalStart = left.originalStart; + let originalLength = left.originalLength; + const modifiedStart = left.modifiedStart; + let modifiedLength = left.modifiedLength; + if (left.originalStart + left.originalLength >= right.originalStart) { + originalLength = right.originalStart + right.originalLength - left.originalStart; + } + if (left.modifiedStart + left.modifiedLength >= right.modifiedStart) { + modifiedLength = right.modifiedStart + right.modifiedLength - left.modifiedStart; + } + mergedChangeArr[0] = new DiffChange(originalStart, originalLength, modifiedStart, modifiedLength); + return true; + } else { + mergedChangeArr[0] = null; + return false; + } + } + /** + * Helper method used to clip a diagonal index to the range of valid + * diagonals. This also decides whether or not the diagonal index, + * if it exceeds the boundary, should be clipped to the boundary or clipped + * one inside the boundary depending on the Even/Odd status of the boundary + * and numDifferences. + * @param diagonal The index of the diagonal to clip. + * @param numDifferences The current number of differences being iterated upon. + * @param diagonalBaseIndex The base reference diagonal. + * @param numDiagonals The total number of diagonals. + * @returns The clipped diagonal index. + */ + ClipDiagonalBound(diagonal, numDifferences, diagonalBaseIndex, numDiagonals) { + if (diagonal >= 0 && diagonal < numDiagonals) { + return diagonal; + } + const diagonalsBelow = diagonalBaseIndex; + const diagonalsAbove = numDiagonals - diagonalBaseIndex - 1; + const diffEven = numDifferences % 2 === 0; + if (diagonal < 0) { + const lowerBoundEven = diagonalsBelow % 2 === 0; + return diffEven === lowerBoundEven ? 0 : 1; + } else { + const upperBoundEven = diagonalsAbove % 2 === 0; + return diffEven === upperBoundEven ? numDiagonals - 1 : numDiagonals - 2; + } + } +}; +var precomputedEqualityArray = new Uint32Array(65536); + +// node_modules/monaco-editor-core/esm/vs/base/browser/ui/tree/indexTreeModel.js +init_event(); +init_iterator(); +function isFilterResult(obj) { + return !!obj && obj.visibility !== void 0; +} +function getVisibleState(visibility) { + switch (visibility) { + case true: + return 1; + case false: + return 0; + default: + return visibility; + } +} +function isCollapsibleStateUpdate(update) { + return "collapsible" in update; +} +var IndexTreeModel = class { + constructor(user, rootElement, options2 = {}) { + this.user = user; + this.rootRef = []; + this.eventBufferer = new EventBufferer(); + this._onDidSpliceModel = new Emitter(); + this.onDidSpliceModel = this._onDidSpliceModel.event; + this._onDidSpliceRenderedNodes = new Emitter(); + this.onDidSpliceRenderedNodes = this._onDidSpliceRenderedNodes.event; + this._onDidChangeCollapseState = new Emitter(); + this.onDidChangeCollapseState = this.eventBufferer.wrapEvent(this._onDidChangeCollapseState.event); + this._onDidChangeRenderNodeCount = new Emitter(); + this.onDidChangeRenderNodeCount = this.eventBufferer.wrapEvent(this._onDidChangeRenderNodeCount.event); + this.refilterDelayer = new Delayer(MicrotaskDelay); + this.collapseByDefault = typeof options2.collapseByDefault === "undefined" ? false : options2.collapseByDefault; + this.allowNonCollapsibleParents = options2.allowNonCollapsibleParents ?? false; + this.filter = options2.filter; + this.autoExpandSingleChildren = typeof options2.autoExpandSingleChildren === "undefined" ? false : options2.autoExpandSingleChildren; + this.root = { + parent: void 0, + element: rootElement, + children: [], + depth: 0, + visibleChildrenCount: 0, + visibleChildIndex: -1, + collapsible: false, + collapsed: false, + renderNodeCount: 0, + visibility: 1, + visible: true, + filterData: void 0 + }; + } + splice(location2, deleteCount, toInsert = Iterable.empty(), options2 = {}) { + if (location2.length === 0) { + throw new TreeError(this.user, "Invalid tree location"); + } + if (options2.diffIdentityProvider) { + this.spliceSmart(options2.diffIdentityProvider, location2, deleteCount, toInsert, options2); + } else { + this.spliceSimple(location2, deleteCount, toInsert, options2); + } + } + spliceSmart(identity2, location2, deleteCount, toInsertIterable = Iterable.empty(), options2, recurseLevels = options2.diffDepth ?? 0) { + const { parentNode } = this.getParentNodeWithListIndex(location2); + if (!parentNode.lastDiffIds) { + return this.spliceSimple(location2, deleteCount, toInsertIterable, options2); + } + const toInsert = [...toInsertIterable]; + const index = location2[location2.length - 1]; + const diff = new LcsDiff({ getElements: () => parentNode.lastDiffIds }, { + getElements: () => [ + ...parentNode.children.slice(0, index), + ...toInsert, + ...parentNode.children.slice(index + deleteCount) + ].map((e) => identity2.getId(e.element).toString()) + }).ComputeDiff(false); + if (diff.quitEarly) { + parentNode.lastDiffIds = void 0; + return this.spliceSimple(location2, deleteCount, toInsert, options2); + } + const locationPrefix = location2.slice(0, -1); + const recurseSplice = (fromOriginal, fromModified, count) => { + if (recurseLevels > 0) { + for (let i2 = 0; i2 < count; i2++) { + fromOriginal--; + fromModified--; + this.spliceSmart(identity2, [...locationPrefix, fromOriginal, 0], Number.MAX_SAFE_INTEGER, toInsert[fromModified].children, options2, recurseLevels - 1); + } + } + }; + let lastStartO = Math.min(parentNode.children.length, index + deleteCount); + let lastStartM = toInsert.length; + for (const change of diff.changes.sort((a, b) => b.originalStart - a.originalStart)) { + recurseSplice(lastStartO, lastStartM, lastStartO - (change.originalStart + change.originalLength)); + lastStartO = change.originalStart; + lastStartM = change.modifiedStart - index; + this.spliceSimple([...locationPrefix, lastStartO], change.originalLength, Iterable.slice(toInsert, lastStartM, lastStartM + change.modifiedLength), options2); + } + recurseSplice(lastStartO, lastStartM, lastStartO); + } + spliceSimple(location2, deleteCount, toInsert = Iterable.empty(), { onDidCreateNode, onDidDeleteNode, diffIdentityProvider }) { + const { parentNode, listIndex, revealed, visible } = this.getParentNodeWithListIndex(location2); + const treeListElementsToInsert = []; + const nodesToInsertIterator = Iterable.map(toInsert, (el) => this.createTreeNode(el, parentNode, parentNode.visible ? 1 : 0, revealed, treeListElementsToInsert, onDidCreateNode)); + const lastIndex = location2[location2.length - 1]; + let visibleChildStartIndex = 0; + for (let i2 = lastIndex; i2 >= 0 && i2 < parentNode.children.length; i2--) { + const child = parentNode.children[i2]; + if (child.visible) { + visibleChildStartIndex = child.visibleChildIndex; + break; + } + } + const nodesToInsert = []; + let insertedVisibleChildrenCount = 0; + let renderNodeCount = 0; + for (const child of nodesToInsertIterator) { + nodesToInsert.push(child); + renderNodeCount += child.renderNodeCount; + if (child.visible) { + child.visibleChildIndex = visibleChildStartIndex + insertedVisibleChildrenCount++; + } + } + const deletedNodes = splice(parentNode.children, lastIndex, deleteCount, nodesToInsert); + if (!diffIdentityProvider) { + parentNode.lastDiffIds = void 0; + } else if (parentNode.lastDiffIds) { + splice(parentNode.lastDiffIds, lastIndex, deleteCount, nodesToInsert.map((n2) => diffIdentityProvider.getId(n2.element).toString())); + } else { + parentNode.lastDiffIds = parentNode.children.map((n2) => diffIdentityProvider.getId(n2.element).toString()); + } + let deletedVisibleChildrenCount = 0; + for (const child of deletedNodes) { + if (child.visible) { + deletedVisibleChildrenCount++; + } + } + if (deletedVisibleChildrenCount !== 0) { + for (let i2 = lastIndex + nodesToInsert.length; i2 < parentNode.children.length; i2++) { + const child = parentNode.children[i2]; + if (child.visible) { + child.visibleChildIndex -= deletedVisibleChildrenCount; + } + } + } + parentNode.visibleChildrenCount += insertedVisibleChildrenCount - deletedVisibleChildrenCount; + if (deletedNodes.length > 0 && onDidDeleteNode) { + const visit = (node2) => { + onDidDeleteNode(node2); + node2.children.forEach(visit); + }; + deletedNodes.forEach(visit); + } + if (revealed && visible) { + const visibleDeleteCount = deletedNodes.reduce((r, node2) => r + (node2.visible ? node2.renderNodeCount : 0), 0); + this._updateAncestorsRenderNodeCount(parentNode, renderNodeCount - visibleDeleteCount); + this._onDidSpliceRenderedNodes.fire({ start: listIndex, deleteCount: visibleDeleteCount, elements: treeListElementsToInsert }); + } + this._onDidSpliceModel.fire({ insertedNodes: nodesToInsert, deletedNodes }); + let node = parentNode; + while (node) { + if (node.visibility === 2) { + this.refilterDelayer.trigger(() => this.refilter()); + break; + } + node = node.parent; + } + } + rerender(location2) { + if (location2.length === 0) { + throw new TreeError(this.user, "Invalid tree location"); + } + const { node, listIndex, revealed } = this.getTreeNodeWithListIndex(location2); + if (node.visible && revealed) { + this._onDidSpliceRenderedNodes.fire({ start: listIndex, deleteCount: 1, elements: [node] }); + } + } + has(location2) { + return this.hasTreeNode(location2); + } + getListIndex(location2) { + const { listIndex, visible, revealed } = this.getTreeNodeWithListIndex(location2); + return visible && revealed ? listIndex : -1; + } + getListRenderCount(location2) { + return this.getTreeNode(location2).renderNodeCount; + } + isCollapsible(location2) { + return this.getTreeNode(location2).collapsible; + } + setCollapsible(location2, collapsible) { + const node = this.getTreeNode(location2); + if (typeof collapsible === "undefined") { + collapsible = !node.collapsible; + } + const update = { collapsible }; + return this.eventBufferer.bufferEvents(() => this._setCollapseState(location2, update)); + } + isCollapsed(location2) { + return this.getTreeNode(location2).collapsed; + } + setCollapsed(location2, collapsed2, recursive) { + const node = this.getTreeNode(location2); + if (typeof collapsed2 === "undefined") { + collapsed2 = !node.collapsed; + } + const update = { collapsed: collapsed2, recursive: recursive || false }; + return this.eventBufferer.bufferEvents(() => this._setCollapseState(location2, update)); + } + _setCollapseState(location2, update) { + const { node, listIndex, revealed } = this.getTreeNodeWithListIndex(location2); + const result = this._setListNodeCollapseState(node, listIndex, revealed, update); + if (node !== this.root && this.autoExpandSingleChildren && result && !isCollapsibleStateUpdate(update) && node.collapsible && !node.collapsed && !update.recursive) { + let onlyVisibleChildIndex = -1; + for (let i2 = 0; i2 < node.children.length; i2++) { + const child = node.children[i2]; + if (child.visible) { + if (onlyVisibleChildIndex > -1) { + onlyVisibleChildIndex = -1; + break; + } else { + onlyVisibleChildIndex = i2; + } + } + } + if (onlyVisibleChildIndex > -1) { + this._setCollapseState([...location2, onlyVisibleChildIndex], update); + } + } + return result; + } + _setListNodeCollapseState(node, listIndex, revealed, update) { + const result = this._setNodeCollapseState(node, update, false); + if (!revealed || !node.visible || !result) { + return result; + } + const previousRenderNodeCount = node.renderNodeCount; + const toInsert = this.updateNodeAfterCollapseChange(node); + const deleteCount = previousRenderNodeCount - (listIndex === -1 ? 0 : 1); + this._onDidSpliceRenderedNodes.fire({ start: listIndex + 1, deleteCount, elements: toInsert.slice(1) }); + return result; + } + _setNodeCollapseState(node, update, deep) { + let result; + if (node === this.root) { + result = false; + } else { + if (isCollapsibleStateUpdate(update)) { + result = node.collapsible !== update.collapsible; + node.collapsible = update.collapsible; + } else if (!node.collapsible) { + result = false; + } else { + result = node.collapsed !== update.collapsed; + node.collapsed = update.collapsed; + } + if (result) { + this._onDidChangeCollapseState.fire({ node, deep }); + } + } + if (!isCollapsibleStateUpdate(update) && update.recursive) { + for (const child of node.children) { + result = this._setNodeCollapseState(child, update, true) || result; + } + } + return result; + } + expandTo(location2) { + this.eventBufferer.bufferEvents(() => { + let node = this.getTreeNode(location2); + while (node.parent) { + node = node.parent; + location2 = location2.slice(0, location2.length - 1); + if (node.collapsed) { + this._setCollapseState(location2, { collapsed: false, recursive: false }); + } + } + }); + } + refilter() { + const previousRenderNodeCount = this.root.renderNodeCount; + const toInsert = this.updateNodeAfterFilterChange(this.root); + this._onDidSpliceRenderedNodes.fire({ start: 0, deleteCount: previousRenderNodeCount, elements: toInsert }); + this.refilterDelayer.cancel(); + } + createTreeNode(treeElement, parent, parentVisibility, revealed, treeListElements, onDidCreateNode) { + const node = { + parent, + element: treeElement.element, + children: [], + depth: parent.depth + 1, + visibleChildrenCount: 0, + visibleChildIndex: -1, + collapsible: typeof treeElement.collapsible === "boolean" ? treeElement.collapsible : typeof treeElement.collapsed !== "undefined", + collapsed: typeof treeElement.collapsed === "undefined" ? this.collapseByDefault : treeElement.collapsed, + renderNodeCount: 1, + visibility: 1, + visible: true, + filterData: void 0 + }; + const visibility = this._filterNode(node, parentVisibility); + node.visibility = visibility; + if (revealed) { + treeListElements.push(node); + } + const childElements = treeElement.children || Iterable.empty(); + const childRevealed = revealed && visibility !== 0 && !node.collapsed; + let visibleChildrenCount = 0; + let renderNodeCount = 1; + for (const el of childElements) { + const child = this.createTreeNode(el, node, visibility, childRevealed, treeListElements, onDidCreateNode); + node.children.push(child); + renderNodeCount += child.renderNodeCount; + if (child.visible) { + child.visibleChildIndex = visibleChildrenCount++; + } + } + if (!this.allowNonCollapsibleParents) { + node.collapsible = node.collapsible || node.children.length > 0; + } + node.visibleChildrenCount = visibleChildrenCount; + node.visible = visibility === 2 ? visibleChildrenCount > 0 : visibility === 1; + if (!node.visible) { + node.renderNodeCount = 0; + if (revealed) { + treeListElements.pop(); + } + } else if (!node.collapsed) { + node.renderNodeCount = renderNodeCount; + } + onDidCreateNode?.(node); + return node; + } + updateNodeAfterCollapseChange(node) { + const previousRenderNodeCount = node.renderNodeCount; + const result = []; + this._updateNodeAfterCollapseChange(node, result); + this._updateAncestorsRenderNodeCount(node.parent, result.length - previousRenderNodeCount); + return result; + } + _updateNodeAfterCollapseChange(node, result) { + if (node.visible === false) { + return 0; + } + result.push(node); + node.renderNodeCount = 1; + if (!node.collapsed) { + for (const child of node.children) { + node.renderNodeCount += this._updateNodeAfterCollapseChange(child, result); + } + } + this._onDidChangeRenderNodeCount.fire(node); + return node.renderNodeCount; + } + updateNodeAfterFilterChange(node) { + const previousRenderNodeCount = node.renderNodeCount; + const result = []; + this._updateNodeAfterFilterChange(node, node.visible ? 1 : 0, result); + this._updateAncestorsRenderNodeCount(node.parent, result.length - previousRenderNodeCount); + return result; + } + _updateNodeAfterFilterChange(node, parentVisibility, result, revealed = true) { + let visibility; + if (node !== this.root) { + visibility = this._filterNode(node, parentVisibility); + if (visibility === 0) { + node.visible = false; + node.renderNodeCount = 0; + return false; + } + if (revealed) { + result.push(node); + } + } + const resultStartLength = result.length; + node.renderNodeCount = node === this.root ? 0 : 1; + let hasVisibleDescendants = false; + if (!node.collapsed || visibility !== 0) { + let visibleChildIndex = 0; + for (const child of node.children) { + hasVisibleDescendants = this._updateNodeAfterFilterChange(child, visibility, result, revealed && !node.collapsed) || hasVisibleDescendants; + if (child.visible) { + child.visibleChildIndex = visibleChildIndex++; + } + } + node.visibleChildrenCount = visibleChildIndex; + } else { + node.visibleChildrenCount = 0; + } + if (node !== this.root) { + node.visible = visibility === 2 ? hasVisibleDescendants : visibility === 1; + node.visibility = visibility; + } + if (!node.visible) { + node.renderNodeCount = 0; + if (revealed) { + result.pop(); + } + } else if (!node.collapsed) { + node.renderNodeCount += result.length - resultStartLength; + } + this._onDidChangeRenderNodeCount.fire(node); + return node.visible; + } + _updateAncestorsRenderNodeCount(node, diff) { + if (diff === 0) { + return; + } + while (node) { + node.renderNodeCount += diff; + this._onDidChangeRenderNodeCount.fire(node); + node = node.parent; + } + } + _filterNode(node, parentVisibility) { + const result = this.filter ? this.filter.filter(node.element, parentVisibility) : 1; + if (typeof result === "boolean") { + node.filterData = void 0; + return result ? 1 : 0; + } else if (isFilterResult(result)) { + node.filterData = result.data; + return getVisibleState(result.visibility); + } else { + node.filterData = void 0; + return getVisibleState(result); + } + } + // cheap + hasTreeNode(location2, node = this.root) { + if (!location2 || location2.length === 0) { + return true; + } + const [index, ...rest] = location2; + if (index < 0 || index > node.children.length) { + return false; + } + return this.hasTreeNode(rest, node.children[index]); + } + // cheap + getTreeNode(location2, node = this.root) { + if (!location2 || location2.length === 0) { + return node; + } + const [index, ...rest] = location2; + if (index < 0 || index > node.children.length) { + throw new TreeError(this.user, "Invalid tree location"); + } + return this.getTreeNode(rest, node.children[index]); + } + // expensive + getTreeNodeWithListIndex(location2) { + if (location2.length === 0) { + return { node: this.root, listIndex: -1, revealed: true, visible: false }; + } + const { parentNode, listIndex, revealed, visible } = this.getParentNodeWithListIndex(location2); + const index = location2[location2.length - 1]; + if (index < 0 || index > parentNode.children.length) { + throw new TreeError(this.user, "Invalid tree location"); + } + const node = parentNode.children[index]; + return { node, listIndex, revealed, visible: visible && node.visible }; + } + getParentNodeWithListIndex(location2, node = this.root, listIndex = 0, revealed = true, visible = true) { + const [index, ...rest] = location2; + if (index < 0 || index > node.children.length) { + throw new TreeError(this.user, "Invalid tree location"); + } + for (let i2 = 0; i2 < index; i2++) { + listIndex += node.children[i2].renderNodeCount; + } + revealed = revealed && !node.collapsed; + visible = visible && node.visible; + if (rest.length === 0) { + return { parentNode: node, listIndex, revealed, visible }; + } + return this.getParentNodeWithListIndex(rest, node.children[index], listIndex + 1, revealed, visible); + } + getNode(location2 = []) { + return this.getTreeNode(location2); + } + // TODO@joao perf! + getNodeLocation(node) { + const location2 = []; + let indexTreeNode = node; + while (indexTreeNode.parent) { + location2.push(indexTreeNode.parent.children.indexOf(indexTreeNode)); + indexTreeNode = indexTreeNode.parent; + } + return location2.reverse(); + } + getParentNodeLocation(location2) { + if (location2.length === 0) { + return void 0; + } else if (location2.length === 1) { + return []; + } else { + return tail(location2)[0]; + } + } + getFirstElementChild(location2) { + const node = this.getTreeNode(location2); + if (node.children.length === 0) { + return void 0; + } + return node.children[0].element; + } +}; + +// node_modules/monaco-editor-core/esm/vs/base/browser/ui/tree/abstractTree.js +init_actions(); +init_arrays(); +init_async(); +init_codicons(); +init_themables(); +init_map(); +init_event(); +init_filters(); +init_lifecycle(); +init_numbers(); +init_nls(); +init_observable(); +var TreeElementsDragAndDropData = class extends ElementsDragAndDropData { + constructor(data) { + super(data.elements.map((node) => node.element)); + this.data = data; + } +}; +function asTreeDragAndDropData(data) { + if (data instanceof ElementsDragAndDropData) { + return new TreeElementsDragAndDropData(data); + } + return data; +} +var TreeNodeListDragAndDrop = class { + constructor(modelProvider, dnd) { + this.modelProvider = modelProvider; + this.dnd = dnd; + this.autoExpandDisposable = Disposable.None; + this.disposables = new DisposableStore(); + } + getDragURI(node) { + return this.dnd.getDragURI(node.element); + } + getDragLabel(nodes, originalEvent) { + if (this.dnd.getDragLabel) { + return this.dnd.getDragLabel(nodes.map((node) => node.element), originalEvent); + } + return void 0; + } + onDragStart(data, originalEvent) { + this.dnd.onDragStart?.(asTreeDragAndDropData(data), originalEvent); + } + onDragOver(data, targetNode, targetIndex, targetSector, originalEvent, raw = true) { + const result = this.dnd.onDragOver(asTreeDragAndDropData(data), targetNode && targetNode.element, targetIndex, targetSector, originalEvent); + const didChangeAutoExpandNode = this.autoExpandNode !== targetNode; + if (didChangeAutoExpandNode) { + this.autoExpandDisposable.dispose(); + this.autoExpandNode = targetNode; + } + if (typeof targetNode === "undefined") { + return result; + } + if (didChangeAutoExpandNode && typeof result !== "boolean" && result.autoExpand) { + this.autoExpandDisposable = disposableTimeout(() => { + const model2 = this.modelProvider(); + const ref2 = model2.getNodeLocation(targetNode); + if (model2.isCollapsed(ref2)) { + model2.setCollapsed(ref2, false); + } + this.autoExpandNode = void 0; + }, 500, this.disposables); + } + if (typeof result === "boolean" || !result.accept || typeof result.bubble === "undefined" || result.feedback) { + if (!raw) { + const accept = typeof result === "boolean" ? result : result.accept; + const effect = typeof result === "boolean" ? void 0 : result.effect; + return { accept, effect, feedback: [targetIndex] }; + } + return result; + } + if (result.bubble === 1) { + const model2 = this.modelProvider(); + const ref2 = model2.getNodeLocation(targetNode); + const parentRef = model2.getParentNodeLocation(ref2); + const parentNode = model2.getNode(parentRef); + const parentIndex = parentRef && model2.getListIndex(parentRef); + return this.onDragOver(data, parentNode, parentIndex, targetSector, originalEvent, false); + } + const model = this.modelProvider(); + const ref = model.getNodeLocation(targetNode); + const start = model.getListIndex(ref); + const length = model.getListRenderCount(ref); + return { ...result, feedback: range(start, start + length) }; + } + drop(data, targetNode, targetIndex, targetSector, originalEvent) { + this.autoExpandDisposable.dispose(); + this.autoExpandNode = void 0; + this.dnd.drop(asTreeDragAndDropData(data), targetNode && targetNode.element, targetIndex, targetSector, originalEvent); + } + onDragEnd(originalEvent) { + this.dnd.onDragEnd?.(originalEvent); + } + dispose() { + this.disposables.dispose(); + this.dnd.dispose(); + } +}; +function asListOptions(modelProvider, disposableStore, options2) { + return options2 && { + ...options2, + identityProvider: options2.identityProvider && { + getId(el) { + return options2.identityProvider.getId(el.element); + } + }, + dnd: options2.dnd && disposableStore.add(new TreeNodeListDragAndDrop(modelProvider, options2.dnd)), + multipleSelectionController: options2.multipleSelectionController && { + isSelectionSingleChangeEvent(e) { + return options2.multipleSelectionController.isSelectionSingleChangeEvent({ ...e, element: e.element }); + }, + isSelectionRangeChangeEvent(e) { + return options2.multipleSelectionController.isSelectionRangeChangeEvent({ ...e, element: e.element }); + } + }, + accessibilityProvider: options2.accessibilityProvider && { + ...options2.accessibilityProvider, + getSetSize(node) { + const model = modelProvider(); + const ref = model.getNodeLocation(node); + const parentRef = model.getParentNodeLocation(ref); + const parentNode = model.getNode(parentRef); + return parentNode.visibleChildrenCount; + }, + getPosInSet(node) { + return node.visibleChildIndex + 1; + }, + isChecked: options2.accessibilityProvider && options2.accessibilityProvider.isChecked ? (node) => { + return options2.accessibilityProvider.isChecked(node.element); + } : void 0, + getRole: options2.accessibilityProvider && options2.accessibilityProvider.getRole ? (node) => { + return options2.accessibilityProvider.getRole(node.element); + } : () => "treeitem", + getAriaLabel(e) { + return options2.accessibilityProvider.getAriaLabel(e.element); + }, + getWidgetAriaLabel() { + return options2.accessibilityProvider.getWidgetAriaLabel(); + }, + getWidgetRole: options2.accessibilityProvider && options2.accessibilityProvider.getWidgetRole ? () => options2.accessibilityProvider.getWidgetRole() : () => "tree", + getAriaLevel: options2.accessibilityProvider && options2.accessibilityProvider.getAriaLevel ? (node) => options2.accessibilityProvider.getAriaLevel(node.element) : (node) => { + return node.depth; + }, + getActiveDescendantId: options2.accessibilityProvider.getActiveDescendantId && ((node) => { + return options2.accessibilityProvider.getActiveDescendantId(node.element); + }) + }, + keyboardNavigationLabelProvider: options2.keyboardNavigationLabelProvider && { + ...options2.keyboardNavigationLabelProvider, + getKeyboardNavigationLabel(node) { + return options2.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(node.element); + } + } + }; +} +var ComposedTreeDelegate = class { + constructor(delegate) { + this.delegate = delegate; + } + getHeight(element) { + return this.delegate.getHeight(element.element); + } + getTemplateId(element) { + return this.delegate.getTemplateId(element.element); + } + hasDynamicHeight(element) { + return !!this.delegate.hasDynamicHeight && this.delegate.hasDynamicHeight(element.element); + } + setDynamicHeight(element, height) { + this.delegate.setDynamicHeight?.(element.element, height); + } +}; +var RenderIndentGuides; +(function(RenderIndentGuides2) { + RenderIndentGuides2["None"] = "none"; + RenderIndentGuides2["OnHover"] = "onHover"; + RenderIndentGuides2["Always"] = "always"; +})(RenderIndentGuides || (RenderIndentGuides = {})); +var EventCollection = class { + get elements() { + return this._elements; + } + constructor(onDidChange, _elements = []) { + this._elements = _elements; + this.disposables = new DisposableStore(); + this.onDidChange = Event.forEach(onDidChange, (elements) => this._elements = elements, this.disposables); + } + dispose() { + this.disposables.dispose(); + } +}; +var TreeRenderer = class _TreeRenderer { + static { + this.DefaultIndent = 8; + } + constructor(renderer, model, onDidChangeCollapseState, activeNodes, renderedIndentGuides, options2 = {}) { + this.renderer = renderer; + this.model = model; + this.activeNodes = activeNodes; + this.renderedIndentGuides = renderedIndentGuides; + this.renderedElements = /* @__PURE__ */ new Map(); + this.renderedNodes = /* @__PURE__ */ new Map(); + this.indent = _TreeRenderer.DefaultIndent; + this.hideTwistiesOfChildlessElements = false; + this.shouldRenderIndentGuides = false; + this.activeIndentNodes = /* @__PURE__ */ new Set(); + this.indentGuidesDisposable = Disposable.None; + this.disposables = new DisposableStore(); + this.templateId = renderer.templateId; + this.updateOptions(options2); + Event.map(onDidChangeCollapseState, (e) => e.node)(this.onDidChangeNodeTwistieState, this, this.disposables); + renderer.onDidChangeTwistieState?.(this.onDidChangeTwistieState, this, this.disposables); + } + updateOptions(options2 = {}) { + if (typeof options2.indent !== "undefined") { + const indent = clamp(options2.indent, 0, 40); + if (indent !== this.indent) { + this.indent = indent; + for (const [node, templateData] of this.renderedNodes) { + templateData.indentSize = _TreeRenderer.DefaultIndent + (node.depth - 1) * this.indent; + this.renderTreeElement(node, templateData); + } + } + } + if (typeof options2.renderIndentGuides !== "undefined") { + const shouldRenderIndentGuides = options2.renderIndentGuides !== RenderIndentGuides.None; + if (shouldRenderIndentGuides !== this.shouldRenderIndentGuides) { + this.shouldRenderIndentGuides = shouldRenderIndentGuides; + for (const [node, templateData] of this.renderedNodes) { + this._renderIndentGuides(node, templateData); + } + this.indentGuidesDisposable.dispose(); + if (shouldRenderIndentGuides) { + const disposables = new DisposableStore(); + this.activeNodes.onDidChange(this._onDidChangeActiveNodes, this, disposables); + this.indentGuidesDisposable = disposables; + this._onDidChangeActiveNodes(this.activeNodes.elements); + } + } + } + if (typeof options2.hideTwistiesOfChildlessElements !== "undefined") { + this.hideTwistiesOfChildlessElements = options2.hideTwistiesOfChildlessElements; + } + } + renderTemplate(container) { + const el = append(container, $(".monaco-tl-row")); + const indent = append(el, $(".monaco-tl-indent")); + const twistie = append(el, $(".monaco-tl-twistie")); + const contents = append(el, $(".monaco-tl-contents")); + const templateData = this.renderer.renderTemplate(contents); + return { container, indent, twistie, indentGuidesDisposable: Disposable.None, indentSize: 0, templateData }; + } + renderElement(node, index, templateData, details) { + templateData.indentSize = _TreeRenderer.DefaultIndent + (node.depth - 1) * this.indent; + this.renderedNodes.set(node, templateData); + this.renderedElements.set(node.element, node); + this.renderTreeElement(node, templateData); + this.renderer.renderElement(node, index, templateData.templateData, { ...details, indent: templateData.indentSize }); + } + disposeElement(node, index, templateData, details) { + templateData.indentGuidesDisposable.dispose(); + this.renderer.disposeElement?.(node, index, templateData.templateData, { ...details, indent: templateData.indentSize }); + if (typeof details?.height === "number") { + this.renderedNodes.delete(node); + this.renderedElements.delete(node.element); + } + } + disposeTemplate(templateData) { + this.renderer.disposeTemplate(templateData.templateData); + } + onDidChangeTwistieState(element) { + const node = this.renderedElements.get(element); + if (!node) { + return; + } + this.onDidChangeNodeTwistieState(node); + } + onDidChangeNodeTwistieState(node) { + const templateData = this.renderedNodes.get(node); + if (!templateData) { + return; + } + this._onDidChangeActiveNodes(this.activeNodes.elements); + this.renderTreeElement(node, templateData); + } + renderTreeElement(node, templateData) { + templateData.twistie.style.paddingLeft = `${templateData.indentSize}px`; + templateData.indent.style.width = `${templateData.indentSize + this.indent - 16}px`; + if (node.collapsible) { + templateData.container.setAttribute("aria-expanded", String(!node.collapsed)); + } else { + templateData.container.removeAttribute("aria-expanded"); + } + templateData.twistie.classList.remove(...ThemeIcon.asClassNameArray(Codicon.treeItemExpanded)); + let twistieRendered = false; + if (this.renderer.renderTwistie) { + twistieRendered = this.renderer.renderTwistie(node.element, templateData.twistie); + } + if (node.collapsible && (!this.hideTwistiesOfChildlessElements || node.visibleChildrenCount > 0)) { + if (!twistieRendered) { + templateData.twistie.classList.add(...ThemeIcon.asClassNameArray(Codicon.treeItemExpanded)); + } + templateData.twistie.classList.add("collapsible"); + templateData.twistie.classList.toggle("collapsed", node.collapsed); + } else { + templateData.twistie.classList.remove("collapsible", "collapsed"); + } + this._renderIndentGuides(node, templateData); + } + _renderIndentGuides(node, templateData) { + clearNode(templateData.indent); + templateData.indentGuidesDisposable.dispose(); + if (!this.shouldRenderIndentGuides) { + return; + } + const disposableStore = new DisposableStore(); + while (true) { + const ref = this.model.getNodeLocation(node); + const parentRef = this.model.getParentNodeLocation(ref); + if (!parentRef) { + break; + } + const parent = this.model.getNode(parentRef); + const guide = $(".indent-guide", { style: `width: ${this.indent}px` }); + if (this.activeIndentNodes.has(parent)) { + guide.classList.add("active"); + } + if (templateData.indent.childElementCount === 0) { + templateData.indent.appendChild(guide); + } else { + templateData.indent.insertBefore(guide, templateData.indent.firstElementChild); + } + this.renderedIndentGuides.add(parent, guide); + disposableStore.add(toDisposable(() => this.renderedIndentGuides.delete(parent, guide))); + node = parent; + } + templateData.indentGuidesDisposable = disposableStore; + } + _onDidChangeActiveNodes(nodes) { + if (!this.shouldRenderIndentGuides) { + return; + } + const set = /* @__PURE__ */ new Set(); + nodes.forEach((node) => { + const ref = this.model.getNodeLocation(node); + try { + const parentRef = this.model.getParentNodeLocation(ref); + if (node.collapsible && node.children.length > 0 && !node.collapsed) { + set.add(node); + } else if (parentRef) { + set.add(this.model.getNode(parentRef)); + } + } catch { + } + }); + this.activeIndentNodes.forEach((node) => { + if (!set.has(node)) { + this.renderedIndentGuides.forEach(node, (line) => line.classList.remove("active")); + } + }); + set.forEach((node) => { + if (!this.activeIndentNodes.has(node)) { + this.renderedIndentGuides.forEach(node, (line) => line.classList.add("active")); + } + }); + this.activeIndentNodes = set; + } + dispose() { + this.renderedNodes.clear(); + this.renderedElements.clear(); + this.indentGuidesDisposable.dispose(); + dispose(this.disposables); + } +}; +function contiguousFuzzyScore(patternLower, wordLower) { + const index = wordLower.toLowerCase().indexOf(patternLower); + let score3; + if (index > -1) { + score3 = [Number.MAX_SAFE_INTEGER, 0]; + for (let i2 = patternLower.length; i2 > 0; i2--) { + score3.push(index + i2 - 1); + } + } + return score3; +} +var FindFilter = class { + get totalCount() { + return this._totalCount; + } + get matchCount() { + return this._matchCount; + } + set findMatchType(type) { + this._findMatchType = type; + } + get findMatchType() { + return this._findMatchType; + } + set findMode(mode) { + this._findMode = mode; + } + get findMode() { + return this._findMode; + } + constructor(_keyboardNavigationLabelProvider, _filter, _defaultFindVisibility) { + this._keyboardNavigationLabelProvider = _keyboardNavigationLabelProvider; + this._filter = _filter; + this._defaultFindVisibility = _defaultFindVisibility; + this._totalCount = 0; + this._matchCount = 0; + this._findMatchType = TreeFindMatchType.Fuzzy; + this._findMode = TreeFindMode.Highlight; + this._pattern = ""; + this._lowercasePattern = ""; + this.disposables = new DisposableStore(); + } + filter(element, parentVisibility) { + let visibility = 1; + if (this._filter) { + const result = this._filter.filter(element, parentVisibility); + if (typeof result === "boolean") { + visibility = result ? 1 : 0; + } else if (isFilterResult(result)) { + visibility = getVisibleState(result.visibility); + } else { + visibility = result; + } + if (visibility === 0) { + return false; + } + } + this._totalCount++; + if (!this._pattern) { + this._matchCount++; + return { data: FuzzyScore.Default, visibility }; + } + const label = this._keyboardNavigationLabelProvider.getKeyboardNavigationLabel(element); + const labels = Array.isArray(label) ? label : [label]; + for (const l of labels) { + const labelStr = l && l.toString(); + if (typeof labelStr === "undefined") { + return { data: FuzzyScore.Default, visibility }; + } + let score3; + if (this._findMatchType === TreeFindMatchType.Contiguous) { + score3 = contiguousFuzzyScore(this._lowercasePattern, labelStr.toLowerCase()); + } else { + score3 = fuzzyScore(this._pattern, this._lowercasePattern, 0, labelStr, labelStr.toLowerCase(), 0, { firstMatchCanBeWeak: true, boostFullMatch: true }); + } + if (score3) { + this._matchCount++; + return labels.length === 1 ? { data: score3, visibility } : { data: { label: labelStr, score: score3 }, visibility }; + } + } + if (this._findMode === TreeFindMode.Filter) { + if (typeof this._defaultFindVisibility === "number") { + return this._defaultFindVisibility; + } else if (this._defaultFindVisibility) { + return this._defaultFindVisibility(element); + } else { + return 2; + } + } else { + return { data: FuzzyScore.Default, visibility }; + } + } + reset() { + this._totalCount = 0; + this._matchCount = 0; + } + dispose() { + dispose(this.disposables); + } +}; +var FindToggles = class { + constructor(startStates) { + this.stateMap = new Map(startStates.map((state) => [state.id, { ...state }])); + } + get(id) { + const state = this.stateMap.get(id); + if (state === void 0) { + throw new Error(`No state found for toggle id ${id}`); + } + return state.isChecked; + } + set(id, value) { + const state = this.stateMap.get(id); + if (state === void 0) { + throw new Error(`No state found for toggle id ${id}`); + } + if (state.isChecked === value) { + return false; + } + state.isChecked = value; + return true; + } +}; +var TreeFindMode; +(function(TreeFindMode2) { + TreeFindMode2[TreeFindMode2["Highlight"] = 0] = "Highlight"; + TreeFindMode2[TreeFindMode2["Filter"] = 1] = "Filter"; +})(TreeFindMode || (TreeFindMode = {})); +var TreeFindMatchType; +(function(TreeFindMatchType2) { + TreeFindMatchType2[TreeFindMatchType2["Fuzzy"] = 0] = "Fuzzy"; + TreeFindMatchType2[TreeFindMatchType2["Contiguous"] = 1] = "Contiguous"; +})(TreeFindMatchType || (TreeFindMatchType = {})); +var DefaultTreeToggles; +(function(DefaultTreeToggles2) { + DefaultTreeToggles2["Mode"] = "mode"; + DefaultTreeToggles2["MatchType"] = "matchType"; +})(DefaultTreeToggles || (DefaultTreeToggles = {})); +var AbstractFindController = class { + get pattern() { + return this._pattern; + } + get placeholder() { + return this._placeholder; + } + set placeholder(value) { + this._placeholder = value; + this.widget?.setPlaceHolder(value); + } + constructor(tree, filter, contextViewProvider, options2 = {}) { + this.tree = tree; + this.filter = filter; + this.contextViewProvider = contextViewProvider; + this.options = options2; + this._pattern = ""; + this._onDidChangePattern = new Emitter(); + this._onDidChangeOpenState = new Emitter(); + this.onDidChangeOpenState = this._onDidChangeOpenState.event; + this.enabledDisposables = new DisposableStore(); + this.disposables = new DisposableStore(); + this.toggles = new FindToggles(options2.toggles ?? []); + this._placeholder = options2.placeholder ?? localize(20, "Type to search"); + } + isOpened() { + return !!this.widget; + } + updateToggleState(id, checked) { + this.toggles.set(id, checked); + this.widget?.setToggleState(id, checked); + } + renderMessage(showNotFound, warningMessage) { + if (showNotFound) { + if (this.tree.options.showNotFoundMessage ?? true) { + this.widget?.showMessage({ type: 2, content: warningMessage ?? localize(21, "No results found.") }); + } else { + this.widget?.showMessage({ + type: 2 + /* MessageType.WARNING */ + }); + } + } else { + this.widget?.clearMessage(); + } + } + alertResults(results) { + if (!results) { + alert(localize(22, "No results")); + } else { + alert(localize(23, "{0} results", results)); + } + } + dispose() { + this._history = void 0; + this._onDidChangePattern.dispose(); + this.enabledDisposables.dispose(); + this.disposables.dispose(); + } +}; +var FindController = class extends AbstractFindController { + get mode() { + return this.toggles.get(DefaultTreeToggles.Mode) ? TreeFindMode.Filter : TreeFindMode.Highlight; + } + set mode(mode) { + if (mode === this.mode) { + return; + } + const isFilterMode = mode === TreeFindMode.Filter; + this.updateToggleState(DefaultTreeToggles.Mode, isFilterMode); + this.placeholder = isFilterMode ? localize(24, "Type to filter") : localize(25, "Type to search"); + this.filter.findMode = mode; + this.tree.refilter(); + this.render(); + this._onDidChangeMode.fire(mode); + } + get matchType() { + return this.toggles.get(DefaultTreeToggles.MatchType) ? TreeFindMatchType.Fuzzy : TreeFindMatchType.Contiguous; + } + set matchType(matchType) { + if (matchType === this.matchType) { + return; + } + this.updateToggleState(DefaultTreeToggles.MatchType, matchType === TreeFindMatchType.Fuzzy); + this.filter.findMatchType = matchType; + this.tree.refilter(); + this.render(); + this._onDidChangeMatchType.fire(matchType); + } + constructor(tree, filter, contextViewProvider, options2 = {}) { + const defaultFindMode = options2.defaultFindMode ?? TreeFindMode.Highlight; + const defaultFindMatchType = options2.defaultFindMatchType ?? TreeFindMatchType.Fuzzy; + const toggleContributions = [{ + id: DefaultTreeToggles.Mode, + icon: Codicon.listFilter, + title: localize(26, "Filter"), + isChecked: defaultFindMode === TreeFindMode.Filter + }, { + id: DefaultTreeToggles.MatchType, + icon: Codicon.searchFuzzy, + title: localize(27, "Fuzzy Match"), + isChecked: defaultFindMatchType === TreeFindMatchType.Fuzzy + }]; + filter.findMatchType = defaultFindMatchType; + filter.findMode = defaultFindMode; + super(tree, filter, contextViewProvider, { ...options2, toggles: toggleContributions }); + this.filter = filter; + this._onDidChangeMode = new Emitter(); + this.onDidChangeMode = this._onDidChangeMode.event; + this._onDidChangeMatchType = new Emitter(); + this.onDidChangeMatchType = this._onDidChangeMatchType.event; + this.disposables.add(this.tree.onDidChangeModel(() => { + if (!this.isOpened()) { + return; + } + if (this.pattern.length !== 0) { + this.tree.refilter(); + } + this.render(); + })); + this.disposables.add(this.tree.onWillRefilter(() => this.filter.reset())); + } + updateOptions(optionsUpdate = {}) { + if (optionsUpdate.defaultFindMode !== void 0) { + this.mode = optionsUpdate.defaultFindMode; + } + if (optionsUpdate.defaultFindMatchType !== void 0) { + this.matchType = optionsUpdate.defaultFindMatchType; + } + } + shouldAllowFocus(node) { + if (!this.isOpened() || !this.pattern) { + return true; + } + if (this.filter.totalCount > 0 && this.filter.matchCount <= 1) { + return true; + } + return !FuzzyScore.isDefault(node.filterData); + } + render() { + const noMatches = this.filter.matchCount === 0 && this.filter.totalCount > 0; + const showNotFound = noMatches && this.pattern.length > 0; + this.renderMessage(showNotFound); + if (this.pattern.length) { + this.alertResults(this.filter.matchCount); + } + } +}; +function stickyScrollNodeStateEquals(node1, node2) { + return node1.position === node2.position && stickyScrollNodeEquals(node1, node2); +} +function stickyScrollNodeEquals(node1, node2) { + return node1.node.element === node2.node.element && node1.startIndex === node2.startIndex && node1.height === node2.height && node1.endIndex === node2.endIndex; +} +var StickyScrollState = class { + constructor(stickyNodes = []) { + this.stickyNodes = stickyNodes; + } + get count() { + return this.stickyNodes.length; + } + equal(state) { + return equals(this.stickyNodes, state.stickyNodes, stickyScrollNodeStateEquals); + } + contains(element) { + return this.stickyNodes.some((node) => node.node.element === element.element); + } + lastNodePartiallyVisible() { + if (this.count === 0) { + return false; + } + const lastStickyNode = this.stickyNodes[this.count - 1]; + if (this.count === 1) { + return lastStickyNode.position !== 0; + } + const secondLastStickyNode = this.stickyNodes[this.count - 2]; + return secondLastStickyNode.position + secondLastStickyNode.height !== lastStickyNode.position; + } + animationStateChanged(previousState) { + if (!equals(this.stickyNodes, previousState.stickyNodes, stickyScrollNodeEquals)) { + return false; + } + if (this.count === 0) { + return false; + } + const lastStickyNode = this.stickyNodes[this.count - 1]; + const previousLastStickyNode = previousState.stickyNodes[previousState.count - 1]; + return lastStickyNode.position !== previousLastStickyNode.position; + } +}; +var DefaultStickyScrollDelegate = class { + constrainStickyScrollNodes(stickyNodes, stickyScrollMaxItemCount, maxWidgetHeight) { + for (let i2 = 0; i2 < stickyNodes.length; i2++) { + const stickyNode = stickyNodes[i2]; + const stickyNodeBottom = stickyNode.position + stickyNode.height; + if (stickyNodeBottom > maxWidgetHeight || i2 >= stickyScrollMaxItemCount) { + return stickyNodes.slice(0, i2); + } + } + return stickyNodes; + } +}; +var StickyScrollController = class extends Disposable { + constructor(tree, model, view, renderers, treeDelegate, options2 = {}) { + super(); + this.tree = tree; + this.model = model; + this.view = view; + this.treeDelegate = treeDelegate; + this.maxWidgetViewRatio = 0.4; + const stickyScrollOptions = this.validateStickySettings(options2); + this.stickyScrollMaxItemCount = stickyScrollOptions.stickyScrollMaxItemCount; + this.stickyScrollDelegate = options2.stickyScrollDelegate ?? new DefaultStickyScrollDelegate(); + this.paddingTop = options2.paddingTop ?? 0; + this._widget = this._register(new StickyScrollWidget(view.getScrollableElement(), view, tree, renderers, treeDelegate, options2.accessibilityProvider)); + this.onDidChangeHasFocus = this._widget.onDidChangeHasFocus; + this.onContextMenu = this._widget.onContextMenu; + this._register(view.onDidScroll(() => this.update())); + this._register(view.onDidChangeContentHeight(() => this.update())); + this._register(tree.onDidChangeCollapseState(() => this.update())); + this._register(model.onDidSpliceRenderedNodes((e) => { + const state = this._widget.state; + if (!state) { + return; + } + const hasRemovedStickyNode = e.deleteCount > 0 && state.stickyNodes.some((stickyNode) => !this.model.has(this.model.getNodeLocation(stickyNode.node))); + if (hasRemovedStickyNode) { + this.update(); + return; + } + const shouldRerenderStickyNodes = state.stickyNodes.some((stickyNode) => { + const listIndex = this.model.getListIndex(this.model.getNodeLocation(stickyNode.node)); + return listIndex >= e.start && listIndex < e.start + e.deleteCount && state.contains(stickyNode.node); + }); + if (shouldRerenderStickyNodes) { + this._widget.rerender(); + } + })); + this.update(); + } + get height() { + return this._widget.height; + } + getNodeAtHeight(height) { + let index; + if (height === 0) { + index = this.view.firstVisibleIndex; + } else { + index = this.view.indexAt(height + this.view.scrollTop); + } + if (index < 0 || index >= this.view.length) { + return void 0; + } + return this.view.element(index); + } + update() { + const firstVisibleNode = this.getNodeAtHeight(this.paddingTop); + if (!firstVisibleNode || this.tree.scrollTop <= this.paddingTop) { + this._widget.setState(void 0); + return; + } + const stickyState = this.findStickyState(firstVisibleNode); + this._widget.setState(stickyState); + } + findStickyState(firstVisibleNode) { + const stickyNodes = []; + let firstVisibleNodeUnderWidget = firstVisibleNode; + let stickyNodesHeight = 0; + let nextStickyNode = this.getNextStickyNode(firstVisibleNodeUnderWidget, void 0, stickyNodesHeight); + while (nextStickyNode) { + stickyNodes.push(nextStickyNode); + stickyNodesHeight += nextStickyNode.height; + if (stickyNodes.length <= this.stickyScrollMaxItemCount) { + firstVisibleNodeUnderWidget = this.getNextVisibleNode(nextStickyNode); + if (!firstVisibleNodeUnderWidget) { + break; + } + } + nextStickyNode = this.getNextStickyNode(firstVisibleNodeUnderWidget, nextStickyNode.node, stickyNodesHeight); + } + const contrainedStickyNodes = this.constrainStickyNodes(stickyNodes); + return contrainedStickyNodes.length ? new StickyScrollState(contrainedStickyNodes) : void 0; + } + getNextVisibleNode(previousStickyNode) { + return this.getNodeAtHeight(previousStickyNode.position + previousStickyNode.height); + } + getNextStickyNode(firstVisibleNodeUnderWidget, previousStickyNode, stickyNodesHeight) { + const nextStickyNode = this.getAncestorUnderPrevious(firstVisibleNodeUnderWidget, previousStickyNode); + if (!nextStickyNode) { + return void 0; + } + if (nextStickyNode === firstVisibleNodeUnderWidget) { + if (!this.nodeIsUncollapsedParent(firstVisibleNodeUnderWidget)) { + return void 0; + } + if (this.nodeTopAlignsWithStickyNodesBottom(firstVisibleNodeUnderWidget, stickyNodesHeight)) { + return void 0; + } + } + return this.createStickyScrollNode(nextStickyNode, stickyNodesHeight); + } + nodeTopAlignsWithStickyNodesBottom(node, stickyNodesHeight) { + const nodeIndex = this.getNodeIndex(node); + const elementTop = this.view.getElementTop(nodeIndex); + const stickyPosition = stickyNodesHeight; + return this.view.scrollTop === elementTop - stickyPosition; + } + createStickyScrollNode(node, currentStickyNodesHeight) { + const height = this.treeDelegate.getHeight(node); + const { startIndex, endIndex } = this.getNodeRange(node); + const position = this.calculateStickyNodePosition(endIndex, currentStickyNodesHeight, height); + return { node, position, height, startIndex, endIndex }; + } + getAncestorUnderPrevious(node, previousAncestor = void 0) { + let currentAncestor = node; + let parentOfcurrentAncestor = this.getParentNode(currentAncestor); + while (parentOfcurrentAncestor) { + if (parentOfcurrentAncestor === previousAncestor) { + return currentAncestor; + } + currentAncestor = parentOfcurrentAncestor; + parentOfcurrentAncestor = this.getParentNode(currentAncestor); + } + if (previousAncestor === void 0) { + return currentAncestor; + } + return void 0; + } + calculateStickyNodePosition(lastDescendantIndex, stickyRowPositionTop, stickyNodeHeight) { + let lastChildRelativeTop = this.view.getRelativeTop(lastDescendantIndex); + if (lastChildRelativeTop === null && this.view.firstVisibleIndex === lastDescendantIndex && lastDescendantIndex + 1 < this.view.length) { + const nodeHeight = this.treeDelegate.getHeight(this.view.element(lastDescendantIndex)); + const nextNodeRelativeTop = this.view.getRelativeTop(lastDescendantIndex + 1); + lastChildRelativeTop = nextNodeRelativeTop ? nextNodeRelativeTop - nodeHeight / this.view.renderHeight : null; + } + if (lastChildRelativeTop === null) { + return stickyRowPositionTop; + } + const lastChildNode = this.view.element(lastDescendantIndex); + const lastChildHeight = this.treeDelegate.getHeight(lastChildNode); + const topOfLastChild = lastChildRelativeTop * this.view.renderHeight; + const bottomOfLastChild = topOfLastChild + lastChildHeight; + if (stickyRowPositionTop + stickyNodeHeight > bottomOfLastChild && stickyRowPositionTop <= bottomOfLastChild) { + return bottomOfLastChild - stickyNodeHeight; + } + return stickyRowPositionTop; + } + constrainStickyNodes(stickyNodes) { + if (stickyNodes.length === 0) { + return []; + } + const maximumStickyWidgetHeight = this.view.renderHeight * this.maxWidgetViewRatio; + const lastStickyNode = stickyNodes[stickyNodes.length - 1]; + if (stickyNodes.length <= this.stickyScrollMaxItemCount && lastStickyNode.position + lastStickyNode.height <= maximumStickyWidgetHeight) { + return stickyNodes; + } + const constrainedStickyNodes = this.stickyScrollDelegate.constrainStickyScrollNodes(stickyNodes, this.stickyScrollMaxItemCount, maximumStickyWidgetHeight); + if (!constrainedStickyNodes.length) { + return []; + } + const lastConstrainedStickyNode = constrainedStickyNodes[constrainedStickyNodes.length - 1]; + if (constrainedStickyNodes.length > this.stickyScrollMaxItemCount || lastConstrainedStickyNode.position + lastConstrainedStickyNode.height > maximumStickyWidgetHeight) { + throw new Error("stickyScrollDelegate violates constraints"); + } + return constrainedStickyNodes; + } + getParentNode(node) { + const nodeLocation = this.model.getNodeLocation(node); + const parentLocation = this.model.getParentNodeLocation(nodeLocation); + return parentLocation ? this.model.getNode(parentLocation) : void 0; + } + nodeIsUncollapsedParent(node) { + const nodeLocation = this.model.getNodeLocation(node); + return this.model.getListRenderCount(nodeLocation) > 1; + } + getNodeIndex(node) { + const nodeLocation = this.model.getNodeLocation(node); + const nodeIndex = this.model.getListIndex(nodeLocation); + return nodeIndex; + } + getNodeRange(node) { + const nodeLocation = this.model.getNodeLocation(node); + const startIndex = this.model.getListIndex(nodeLocation); + if (startIndex < 0) { + throw new Error("Node not found in tree"); + } + const renderCount = this.model.getListRenderCount(nodeLocation); + const endIndex = startIndex + renderCount - 1; + return { startIndex, endIndex }; + } + nodePositionTopBelowWidget(node) { + const ancestors = []; + let currentAncestor = this.getParentNode(node); + while (currentAncestor) { + ancestors.push(currentAncestor); + currentAncestor = this.getParentNode(currentAncestor); + } + let widgetHeight = 0; + for (let i2 = 0; i2 < ancestors.length && i2 < this.stickyScrollMaxItemCount; i2++) { + widgetHeight += this.treeDelegate.getHeight(ancestors[i2]); + } + return widgetHeight; + } + domFocus() { + this._widget.domFocus(); + } + // Whether sticky scroll was the last focused part in the tree or not + focusedLast() { + return this._widget.focusedLast(); + } + updateOptions(optionsUpdate = {}) { + if (optionsUpdate.paddingTop !== void 0) { + this.paddingTop = optionsUpdate.paddingTop; + } + if (optionsUpdate.stickyScrollMaxItemCount !== void 0) { + const validatedOptions = this.validateStickySettings(optionsUpdate); + if (this.stickyScrollMaxItemCount !== validatedOptions.stickyScrollMaxItemCount) { + this.stickyScrollMaxItemCount = validatedOptions.stickyScrollMaxItemCount; + this.update(); + } + } + } + validateStickySettings(options2) { + let stickyScrollMaxItemCount = 7; + if (typeof options2.stickyScrollMaxItemCount === "number") { + stickyScrollMaxItemCount = Math.max(options2.stickyScrollMaxItemCount, 1); + } + return { stickyScrollMaxItemCount }; + } +}; +var StickyScrollWidget = class { + get state() { + return this._previousState; + } + constructor(container, view, tree, treeRenderers, treeDelegate, accessibilityProvider) { + this.view = view; + this.tree = tree; + this.treeRenderers = treeRenderers; + this.treeDelegate = treeDelegate; + this.accessibilityProvider = accessibilityProvider; + this._previousElements = []; + this._previousStateDisposables = new DisposableStore(); + this._rootDomNode = $(".monaco-tree-sticky-container.empty"); + container.appendChild(this._rootDomNode); + const shadow = $(".monaco-tree-sticky-container-shadow"); + this._rootDomNode.appendChild(shadow); + this.stickyScrollFocus = new StickyScrollFocus(this._rootDomNode, view); + this.onDidChangeHasFocus = this.stickyScrollFocus.onDidChangeHasFocus; + this.onContextMenu = this.stickyScrollFocus.onContextMenu; + } + get height() { + if (!this._previousState) { + return 0; + } + const lastElement = this._previousState.stickyNodes[this._previousState.count - 1]; + return lastElement.position + lastElement.height; + } + setState(state) { + const wasVisible = !!this._previousState && this._previousState.count > 0; + const isVisible = !!state && state.count > 0; + if (!wasVisible && !isVisible || wasVisible && isVisible && this._previousState.equal(state)) { + return; + } + if (wasVisible !== isVisible) { + this.setVisible(isVisible); + } + if (!isVisible) { + this._previousState = void 0; + this._previousElements = []; + this._previousStateDisposables.clear(); + return; + } + const lastStickyNode = state.stickyNodes[state.count - 1]; + if (this._previousState && state.animationStateChanged(this._previousState)) { + this._previousElements[this._previousState.count - 1].style.top = `${lastStickyNode.position}px`; + } else { + this.renderState(state); + } + this._previousState = state; + this._rootDomNode.style.height = `${lastStickyNode.position + lastStickyNode.height}px`; + } + renderState(state) { + this._previousStateDisposables.clear(); + const elements = Array(state.count); + for (let stickyIndex = state.count - 1; stickyIndex >= 0; stickyIndex--) { + const stickyNode = state.stickyNodes[stickyIndex]; + const { element, disposable } = this.createElement(stickyNode, stickyIndex, state.count); + elements[stickyIndex] = element; + this._rootDomNode.appendChild(element); + this._previousStateDisposables.add(disposable); + } + this.stickyScrollFocus.updateElements(elements, state); + this._previousElements = elements; + } + rerender() { + if (this._previousState) { + this.renderState(this._previousState); + } + } + createElement(stickyNode, stickyIndex, stickyNodesTotal) { + const nodeIndex = stickyNode.startIndex; + const stickyElement = document.createElement("div"); + stickyElement.style.top = `${stickyNode.position}px`; + if (this.tree.options.setRowHeight !== false) { + stickyElement.style.height = `${stickyNode.height}px`; + } + if (this.tree.options.setRowLineHeight !== false) { + stickyElement.style.lineHeight = `${stickyNode.height}px`; + } + stickyElement.classList.add("monaco-tree-sticky-row"); + stickyElement.classList.add("monaco-list-row"); + stickyElement.setAttribute("data-index", `${nodeIndex}`); + stickyElement.setAttribute("data-parity", nodeIndex % 2 === 0 ? "even" : "odd"); + stickyElement.setAttribute("id", this.view.getElementID(nodeIndex)); + const accessibilityDisposable = this.setAccessibilityAttributes(stickyElement, stickyNode.node.element, stickyIndex, stickyNodesTotal); + const nodeTemplateId = this.treeDelegate.getTemplateId(stickyNode.node); + const renderer = this.treeRenderers.find((renderer2) => renderer2.templateId === nodeTemplateId); + if (!renderer) { + throw new Error(`No renderer found for template id ${nodeTemplateId}`); + } + let nodeCopy = stickyNode.node; + if (nodeCopy === this.tree.getNode(this.tree.getNodeLocation(stickyNode.node))) { + nodeCopy = new Proxy(stickyNode.node, {}); + } + const templateData = renderer.renderTemplate(stickyElement); + renderer.renderElement(nodeCopy, stickyNode.startIndex, templateData, { height: stickyNode.height }); + const disposable = toDisposable(() => { + accessibilityDisposable.dispose(); + renderer.disposeElement(nodeCopy, stickyNode.startIndex, templateData, { height: stickyNode.height }); + renderer.disposeTemplate(templateData); + stickyElement.remove(); + }); + return { element: stickyElement, disposable }; + } + setAccessibilityAttributes(container, element, stickyIndex, stickyNodesTotal) { + if (!this.accessibilityProvider) { + return Disposable.None; + } + if (this.accessibilityProvider.getSetSize) { + container.setAttribute("aria-setsize", String(this.accessibilityProvider.getSetSize(element, stickyIndex, stickyNodesTotal))); + } + if (this.accessibilityProvider.getPosInSet) { + container.setAttribute("aria-posinset", String(this.accessibilityProvider.getPosInSet(element, stickyIndex))); + } + if (this.accessibilityProvider.getRole) { + container.setAttribute("role", this.accessibilityProvider.getRole(element) ?? "treeitem"); + } + const ariaLabel = this.accessibilityProvider.getAriaLabel(element); + const observable = ariaLabel && typeof ariaLabel !== "string" ? ariaLabel : constObservable(ariaLabel); + const result = autorun((reader) => { + const value = reader.readObservable(observable); + if (value) { + container.setAttribute("aria-label", value); + } else { + container.removeAttribute("aria-label"); + } + }); + if (typeof ariaLabel === "string") { + } else if (ariaLabel) { + container.setAttribute("aria-label", ariaLabel.get()); + } + const ariaLevel = this.accessibilityProvider.getAriaLevel && this.accessibilityProvider.getAriaLevel(element); + if (typeof ariaLevel === "number") { + container.setAttribute("aria-level", `${ariaLevel}`); + } + container.setAttribute("aria-selected", String(false)); + return result; + } + setVisible(visible) { + this._rootDomNode.classList.toggle("empty", !visible); + if (!visible) { + this.stickyScrollFocus.updateElements([], void 0); + } + } + domFocus() { + this.stickyScrollFocus.domFocus(); + } + focusedLast() { + return this.stickyScrollFocus.focusedLast(); + } + dispose() { + this.stickyScrollFocus.dispose(); + this._previousStateDisposables.dispose(); + this._rootDomNode.remove(); + } +}; +var StickyScrollFocus = class extends Disposable { + get domHasFocus() { + return this._domHasFocus; + } + set domHasFocus(hasFocus) { + if (hasFocus !== this._domHasFocus) { + this._onDidChangeHasFocus.fire(hasFocus); + this._domHasFocus = hasFocus; + } + } + constructor(container, view) { + super(); + this.container = container; + this.view = view; + this.focusedIndex = -1; + this.elements = []; + this._onDidChangeHasFocus = new Emitter(); + this.onDidChangeHasFocus = this._onDidChangeHasFocus.event; + this._onContextMenu = new Emitter(); + this.onContextMenu = this._onContextMenu.event; + this._domHasFocus = false; + this._register(addDisposableListener(this.container, "focus", () => this.onFocus())); + this._register(addDisposableListener(this.container, "blur", () => this.onBlur())); + this._register(this.view.onDidFocus(() => this.toggleStickyScrollFocused(false))); + this._register(this.view.onKeyDown((e) => this.onKeyDown(e))); + this._register(this.view.onMouseDown((e) => this.onMouseDown(e))); + this._register(this.view.onContextMenu((e) => this.handleContextMenu(e))); + } + handleContextMenu(e) { + const target = e.browserEvent.target; + if (!isStickyScrollContainer(target) && !isStickyScrollElement(target)) { + if (this.focusedLast()) { + this.view.domFocus(); + } + return; + } + if (!isKeyboardEvent(e.browserEvent)) { + if (!this.state) { + throw new Error("Context menu should not be triggered when state is undefined"); + } + const stickyIndex = this.state.stickyNodes.findIndex((stickyNode2) => stickyNode2.node.element === e.element?.element); + if (stickyIndex === -1) { + throw new Error("Context menu should not be triggered when element is not in sticky scroll widget"); + } + this.container.focus(); + this.setFocus(stickyIndex); + return; + } + if (!this.state || this.focusedIndex < 0) { + throw new Error("Context menu key should not be triggered when focus is not in sticky scroll widget"); + } + const stickyNode = this.state.stickyNodes[this.focusedIndex]; + const element = stickyNode.node.element; + const anchor = this.elements[this.focusedIndex]; + this._onContextMenu.fire({ element, anchor, browserEvent: e.browserEvent, isStickyScroll: true }); + } + onKeyDown(e) { + if (this.domHasFocus && this.state) { + if (e.key === "ArrowUp") { + this.setFocusedElement(Math.max(0, this.focusedIndex - 1)); + e.preventDefault(); + e.stopPropagation(); + } else if (e.key === "ArrowDown" || e.key === "ArrowRight") { + if (this.focusedIndex >= this.state.count - 1) { + const nodeIndexToFocus = this.state.stickyNodes[this.state.count - 1].startIndex + 1; + this.view.domFocus(); + this.view.setFocus([nodeIndexToFocus]); + this.scrollNodeUnderWidget(nodeIndexToFocus, this.state); + } else { + this.setFocusedElement(this.focusedIndex + 1); + } + e.preventDefault(); + e.stopPropagation(); + } + } + } + onMouseDown(e) { + const target = e.browserEvent.target; + if (!isStickyScrollContainer(target) && !isStickyScrollElement(target)) { + return; + } + e.browserEvent.preventDefault(); + e.browserEvent.stopPropagation(); + } + updateElements(elements, state) { + if (state && state.count === 0) { + throw new Error("Sticky scroll state must be undefined when there are no sticky nodes"); + } + if (state && state.count !== elements.length) { + throw new Error("Sticky scroll focus received illigel state"); + } + const previousIndex = this.focusedIndex; + this.removeFocus(); + this.elements = elements; + this.state = state; + if (state) { + const newFocusedIndex = clamp(previousIndex, 0, state.count - 1); + this.setFocus(newFocusedIndex); + } else { + if (this.domHasFocus) { + this.view.domFocus(); + } + } + this.container.tabIndex = state ? 0 : -1; + } + setFocusedElement(stickyIndex) { + const state = this.state; + if (!state) { + throw new Error("Cannot set focus when state is undefined"); + } + this.setFocus(stickyIndex); + if (stickyIndex < state.count - 1) { + return; + } + if (state.lastNodePartiallyVisible()) { + const lastStickyNode = state.stickyNodes[stickyIndex]; + this.scrollNodeUnderWidget(lastStickyNode.endIndex + 1, state); + } + } + scrollNodeUnderWidget(nodeIndex, state) { + const lastStickyNode = state.stickyNodes[state.count - 1]; + const secondLastStickyNode = state.count > 1 ? state.stickyNodes[state.count - 2] : void 0; + const elementScrollTop = this.view.getElementTop(nodeIndex); + const elementTargetViewTop = secondLastStickyNode ? secondLastStickyNode.position + secondLastStickyNode.height + lastStickyNode.height : lastStickyNode.height; + this.view.scrollTop = elementScrollTop - elementTargetViewTop; + } + domFocus() { + if (!this.state) { + throw new Error("Cannot focus when state is undefined"); + } + this.container.focus(); + } + focusedLast() { + if (!this.state) { + return false; + } + return this.view.getHTMLElement().classList.contains("sticky-scroll-focused"); + } + removeFocus() { + if (this.focusedIndex === -1) { + return; + } + this.toggleElementFocus(this.elements[this.focusedIndex], false); + this.focusedIndex = -1; + } + setFocus(newFocusIndex) { + if (0 > newFocusIndex) { + throw new Error("addFocus() can not remove focus"); + } + if (!this.state && newFocusIndex >= 0) { + throw new Error("Cannot set focus index when state is undefined"); + } + if (this.state && newFocusIndex >= this.state.count) { + throw new Error("Cannot set focus index to an index that does not exist"); + } + const oldIndex = this.focusedIndex; + if (oldIndex >= 0) { + this.toggleElementFocus(this.elements[oldIndex], false); + } + if (newFocusIndex >= 0) { + this.toggleElementFocus(this.elements[newFocusIndex], true); + } + this.focusedIndex = newFocusIndex; + } + toggleElementFocus(element, focused) { + this.toggleElementActiveFocus(element, focused && this.domHasFocus); + this.toggleElementPassiveFocus(element, focused); + } + toggleCurrentElementActiveFocus(focused) { + if (this.focusedIndex === -1) { + return; + } + this.toggleElementActiveFocus(this.elements[this.focusedIndex], focused); + } + toggleElementActiveFocus(element, focused) { + element.classList.toggle("focused", focused); + } + toggleElementPassiveFocus(element, focused) { + element.classList.toggle("passive-focused", focused); + } + toggleStickyScrollFocused(focused) { + this.view.getHTMLElement().classList.toggle("sticky-scroll-focused", focused); + } + onFocus() { + if (!this.state || this.elements.length === 0) { + throw new Error("Cannot focus when state is undefined or elements are empty"); + } + this.domHasFocus = true; + this.toggleStickyScrollFocused(true); + this.toggleCurrentElementActiveFocus(true); + if (this.focusedIndex === -1) { + this.setFocus(0); + } + } + onBlur() { + this.domHasFocus = false; + this.toggleCurrentElementActiveFocus(false); + } + dispose() { + this.toggleStickyScrollFocused(false); + this._onDidChangeHasFocus.fire(false); + super.dispose(); + } +}; +function asTreeMouseEvent(event) { + let target = TreeMouseEventTarget.Unknown; + if (hasParentWithClass(event.browserEvent.target, "monaco-tl-twistie", "monaco-tl-row")) { + target = TreeMouseEventTarget.Twistie; + } else if (hasParentWithClass(event.browserEvent.target, "monaco-tl-contents", "monaco-tl-row")) { + target = TreeMouseEventTarget.Element; + } else if (hasParentWithClass(event.browserEvent.target, "monaco-tree-type-filter", "monaco-list")) { + target = TreeMouseEventTarget.Filter; + } + return { + browserEvent: event.browserEvent, + element: event.element ? event.element.element : null, + target + }; +} +function asTreeContextMenuEvent(event) { + const isStickyScroll = isStickyScrollContainer(event.browserEvent.target); + return { + element: event.element ? event.element.element : null, + browserEvent: event.browserEvent, + anchor: event.anchor, + isStickyScroll + }; +} +function dfs(node, fn) { + fn(node); + node.children.forEach((child) => dfs(child, fn)); +} +var Trait2 = class { + get nodeSet() { + if (!this._nodeSet) { + this._nodeSet = this.createNodeSet(); + } + return this._nodeSet; + } + constructor(getFirstViewElementWithTrait, identityProvider) { + this.getFirstViewElementWithTrait = getFirstViewElementWithTrait; + this.identityProvider = identityProvider; + this.nodes = []; + this._onDidChange = new Emitter(); + this.onDidChange = this._onDidChange.event; + } + set(nodes, browserEvent) { + const event = browserEvent; + if (!event?.__forceEvent && equals(this.nodes, nodes)) { + return; + } + this._set(nodes, false, browserEvent); + } + _set(nodes, silent, browserEvent) { + this.nodes = [...nodes]; + this.elements = void 0; + this._nodeSet = void 0; + if (!silent) { + const that = this; + this._onDidChange.fire({ get elements() { + return that.get(); + }, browserEvent }); + } + } + get() { + if (!this.elements) { + this.elements = this.nodes.map((node) => node.element); + } + return [...this.elements]; + } + getNodes() { + return this.nodes; + } + has(node) { + return this.nodeSet.has(node); + } + onDidModelSplice({ insertedNodes, deletedNodes }) { + if (!this.identityProvider) { + const set = this.createNodeSet(); + const visit = (node) => set.delete(node); + deletedNodes.forEach((node) => dfs(node, visit)); + this.set([...set.values()]); + return; + } + const deletedNodesIdSet = /* @__PURE__ */ new Set(); + const deletedNodesVisitor = (node) => deletedNodesIdSet.add(this.identityProvider.getId(node.element).toString()); + deletedNodes.forEach((node) => dfs(node, deletedNodesVisitor)); + const insertedNodesMap = /* @__PURE__ */ new Map(); + const insertedNodesVisitor = (node) => insertedNodesMap.set(this.identityProvider.getId(node.element).toString(), node); + insertedNodes.forEach((node) => dfs(node, insertedNodesVisitor)); + const nodes = []; + for (const node of this.nodes) { + const id = this.identityProvider.getId(node.element).toString(); + const wasDeleted = deletedNodesIdSet.has(id); + if (!wasDeleted) { + nodes.push(node); + } else { + const insertedNode = insertedNodesMap.get(id); + if (insertedNode && insertedNode.visible) { + nodes.push(insertedNode); + } + } + } + if (this.nodes.length > 0 && nodes.length === 0) { + const node = this.getFirstViewElementWithTrait(); + if (node) { + nodes.push(node); + } + } + this._set(nodes, true); + } + createNodeSet() { + const set = /* @__PURE__ */ new Set(); + for (const node of this.nodes) { + set.add(node); + } + return set; + } +}; +var TreeNodeListMouseController = class extends MouseController { + constructor(list2, tree, stickyScrollProvider) { + super(list2); + this.tree = tree; + this.stickyScrollProvider = stickyScrollProvider; + } + onViewPointer(e) { + if (isButton(e.browserEvent.target) || isEditableElement(e.browserEvent.target) || isMonacoEditor(e.browserEvent.target)) { + return; + } + if (e.browserEvent.isHandledByList) { + return; + } + const node = e.element; + if (!node) { + return super.onViewPointer(e); + } + if (this.isSelectionRangeChangeEvent(e) || this.isSelectionSingleChangeEvent(e)) { + return super.onViewPointer(e); + } + const target = e.browserEvent.target; + const onTwistie = target.classList.contains("monaco-tl-twistie") || target.classList.contains("monaco-icon-label") && target.classList.contains("folder-icon") && e.browserEvent.offsetX < 16; + const isStickyElement = isStickyScrollElement(e.browserEvent.target); + let expandOnlyOnTwistieClick = false; + if (isStickyElement) { + expandOnlyOnTwistieClick = true; + } else if (typeof this.tree.expandOnlyOnTwistieClick === "function") { + expandOnlyOnTwistieClick = this.tree.expandOnlyOnTwistieClick(node.element); + } else { + expandOnlyOnTwistieClick = !!this.tree.expandOnlyOnTwistieClick; + } + if (!isStickyElement) { + if (expandOnlyOnTwistieClick && !onTwistie && e.browserEvent.detail !== 2) { + return super.onViewPointer(e); + } + if (!this.tree.expandOnDoubleClick && e.browserEvent.detail === 2) { + return super.onViewPointer(e); + } + } else { + this.handleStickyScrollMouseEvent(e, node); + } + if (node.collapsible && (!isStickyElement || onTwistie)) { + const location2 = this.tree.getNodeLocation(node); + const recursive = e.browserEvent.altKey; + this.tree.setFocus([location2]); + this.tree.toggleCollapsed(location2, recursive); + if (onTwistie) { + e.browserEvent.isHandledByList = true; + return; + } + } + if (!isStickyElement) { + super.onViewPointer(e); + } + } + handleStickyScrollMouseEvent(e, node) { + if (isMonacoCustomToggle(e.browserEvent.target) || isActionItem(e.browserEvent.target)) { + return; + } + const stickyScrollController = this.stickyScrollProvider(); + if (!stickyScrollController) { + throw new Error("Sticky scroll controller not found"); + } + const nodeIndex = this.list.indexOf(node); + const elementScrollTop = this.list.getElementTop(nodeIndex); + const elementTargetViewTop = stickyScrollController.nodePositionTopBelowWidget(node); + this.tree.scrollTop = elementScrollTop - elementTargetViewTop; + this.list.domFocus(); + this.list.setFocus([nodeIndex]); + this.list.setSelection([nodeIndex]); + } + onDoubleClick(e) { + const onTwistie = e.browserEvent.target.classList.contains("monaco-tl-twistie"); + if (onTwistie || !this.tree.expandOnDoubleClick) { + return; + } + if (e.browserEvent.isHandledByList) { + return; + } + super.onDoubleClick(e); + } + // to make sure dom focus is not stolen (for example with context menu) + onMouseDown(e) { + const target = e.browserEvent.target; + if (!isStickyScrollContainer(target) && !isStickyScrollElement(target)) { + super.onMouseDown(e); + return; + } + } + onContextMenu(e) { + const target = e.browserEvent.target; + if (!isStickyScrollContainer(target) && !isStickyScrollElement(target)) { + super.onContextMenu(e); + return; + } + } +}; +var TreeNodeList = class extends List { + constructor(user, container, virtualDelegate, renderers, focusTrait, selectionTrait, anchorTrait, options2) { + super(user, container, virtualDelegate, renderers, options2); + this.focusTrait = focusTrait; + this.selectionTrait = selectionTrait; + this.anchorTrait = anchorTrait; + } + createMouseController(options2) { + return new TreeNodeListMouseController(this, options2.tree, options2.stickyScrollProvider); + } + splice(start, deleteCount, elements = []) { + super.splice(start, deleteCount, elements); + if (elements.length === 0) { + return; + } + const additionalFocus = []; + const additionalSelection = []; + let anchor; + elements.forEach((node, index) => { + if (this.focusTrait.has(node)) { + additionalFocus.push(start + index); + } + if (this.selectionTrait.has(node)) { + additionalSelection.push(start + index); + } + if (this.anchorTrait.has(node)) { + anchor = start + index; + } + }); + if (additionalFocus.length > 0) { + super.setFocus(distinct([...super.getFocus(), ...additionalFocus])); + } + if (additionalSelection.length > 0) { + super.setSelection(distinct([...super.getSelection(), ...additionalSelection])); + } + if (typeof anchor === "number") { + super.setAnchor(anchor); + } + } + setFocus(indexes, browserEvent, fromAPI = false) { + super.setFocus(indexes, browserEvent); + if (!fromAPI) { + this.focusTrait.set(indexes.map((i2) => this.element(i2)), browserEvent); + } + } + setSelection(indexes, browserEvent, fromAPI = false) { + super.setSelection(indexes, browserEvent); + if (!fromAPI) { + this.selectionTrait.set(indexes.map((i2) => this.element(i2)), browserEvent); + } + } + setAnchor(index, fromAPI = false) { + super.setAnchor(index); + if (!fromAPI) { + if (typeof index === "undefined") { + this.anchorTrait.set([]); + } else { + this.anchorTrait.set([this.element(index)]); + } + } + } +}; +var AbstractTree = class { + get onDidScroll() { + return this.view.onDidScroll; + } + get onDidChangeFocus() { + return this.eventBufferer.wrapEvent(this.focus.onDidChange); + } + get onDidChangeSelection() { + return this.eventBufferer.wrapEvent(this.selection.onDidChange); + } + get onMouseDblClick() { + return Event.filter(Event.map(this.view.onMouseDblClick, asTreeMouseEvent), (e) => e.target !== TreeMouseEventTarget.Filter); + } + get onMouseOver() { + return Event.map(this.view.onMouseOver, asTreeMouseEvent); + } + get onMouseOut() { + return Event.map(this.view.onMouseOut, asTreeMouseEvent); + } + get onContextMenu() { + return Event.any(Event.filter(Event.map(this.view.onContextMenu, asTreeContextMenuEvent), (e) => !e.isStickyScroll), this.stickyScrollController?.onContextMenu ?? Event.None); + } + get onPointer() { + return Event.map(this.view.onPointer, asTreeMouseEvent); + } + get onKeyDown() { + return this.view.onKeyDown; + } + get onDidFocus() { + return this.view.onDidFocus; + } + get onDidChangeModel() { + return Event.any(this.onDidChangeModelRelay.event, this.onDidSwapModel.event); + } + get onDidChangeCollapseState() { + return this.onDidChangeCollapseStateRelay.event; + } + get expandOnDoubleClick() { + return typeof this._options.expandOnDoubleClick === "undefined" ? true : this._options.expandOnDoubleClick; + } + get expandOnlyOnTwistieClick() { + return typeof this._options.expandOnlyOnTwistieClick === "undefined" ? true : this._options.expandOnlyOnTwistieClick; + } + get onDidDispose() { + return this.view.onDidDispose; + } + constructor(_user, container, delegate, renderers, _options = {}) { + this._user = _user; + this._options = _options; + this.eventBufferer = new EventBufferer(); + this.onDidChangeFindOpenState = Event.None; + this.onDidChangeStickyScrollFocused = Event.None; + this.disposables = new DisposableStore(); + this.onDidSwapModel = this.disposables.add(new Emitter()); + this.onDidChangeModelRelay = this.disposables.add(new Relay()); + this.onDidSpliceModelRelay = this.disposables.add(new Relay()); + this.onDidChangeCollapseStateRelay = this.disposables.add(new Relay()); + this.onDidChangeRenderNodeCountRelay = this.disposables.add(new Relay()); + this.onDidChangeActiveNodesRelay = this.disposables.add(new Relay()); + this._onWillRefilter = new Emitter(); + this.onWillRefilter = this._onWillRefilter.event; + this._onDidUpdateOptions = new Emitter(); + this.modelDisposables = new DisposableStore(); + if (_options.keyboardNavigationLabelProvider && (_options.findWidgetEnabled ?? true)) { + this.findFilter = new FindFilter(_options.keyboardNavigationLabelProvider, _options.filter, _options.defaultFindVisibility); + _options = { ..._options, filter: this.findFilter }; + this.disposables.add(this.findFilter); + } + this.model = this.createModel(_user, _options); + this.treeDelegate = new ComposedTreeDelegate(delegate); + const activeNodes = this.disposables.add(new EventCollection(this.onDidChangeActiveNodesRelay.event)); + const renderedIndentGuides = new SetMap(); + this.renderers = renderers.map((r) => new TreeRenderer(r, this.model, this.onDidChangeCollapseStateRelay.event, activeNodes, renderedIndentGuides, _options)); + for (const r of this.renderers) { + this.disposables.add(r); + } + this.focus = new Trait2(() => this.view.getFocusedElements()[0], _options.identityProvider); + this.selection = new Trait2(() => this.view.getSelectedElements()[0], _options.identityProvider); + this.anchor = new Trait2(() => this.view.getAnchorElement(), _options.identityProvider); + this.view = new TreeNodeList(_user, container, this.treeDelegate, this.renderers, this.focus, this.selection, this.anchor, { ...asListOptions(() => this.model, this.disposables, _options), tree: this, stickyScrollProvider: () => this.stickyScrollController }); + this.setupModel(this.model); + if (_options.keyboardSupport !== false) { + const onKeyDown = Event.chain(this.view.onKeyDown, ($23) => $23.filter((e) => !isEditableElement(e.target)).map((e) => new StandardKeyboardEvent(e))); + Event.chain(onKeyDown, ($23) => $23.filter( + (e) => e.keyCode === 15 + /* KeyCode.LeftArrow */ + ))(this.onLeftArrow, this, this.disposables); + Event.chain(onKeyDown, ($23) => $23.filter( + (e) => e.keyCode === 17 + /* KeyCode.RightArrow */ + ))(this.onRightArrow, this, this.disposables); + Event.chain(onKeyDown, ($23) => $23.filter( + (e) => e.keyCode === 10 + /* KeyCode.Space */ + ))(this.onSpace, this, this.disposables); + } + if ((_options.findWidgetEnabled ?? true) && _options.keyboardNavigationLabelProvider && _options.contextViewProvider) { + const findOptions = { + styles: _options.findWidgetStyles, + defaultFindMode: _options.defaultFindMode, + defaultFindMatchType: _options.defaultFindMatchType, + showNotFoundMessage: _options.showNotFoundMessage + }; + this.findController = this.disposables.add(new FindController(this, this.findFilter, _options.contextViewProvider, findOptions)); + this.focusNavigationFilter = (node) => this.findController.shouldAllowFocus(node); + this.onDidChangeFindOpenState = this.findController.onDidChangeOpenState; + this.onDidChangeFindMode = this.findController.onDidChangeMode; + this.onDidChangeFindMatchType = this.findController.onDidChangeMatchType; + } else { + this.onDidChangeFindMode = Event.None; + this.onDidChangeFindMatchType = Event.None; + } + if (_options.enableStickyScroll) { + this.stickyScrollController = new StickyScrollController(this, this.model, this.view, this.renderers, this.treeDelegate, _options); + this.onDidChangeStickyScrollFocused = this.stickyScrollController.onDidChangeHasFocus; + } + this.styleElement = createStyleSheet(this.view.getHTMLElement()); + this.getHTMLElement().classList.toggle("always", this._options.renderIndentGuides === RenderIndentGuides.Always); + } + updateOptions(optionsUpdate = {}) { + this._options = { ...this._options, ...optionsUpdate }; + for (const renderer of this.renderers) { + renderer.updateOptions(optionsUpdate); + } + this.view.updateOptions(this._options); + this.findController?.updateOptions(optionsUpdate); + this.updateStickyScroll(optionsUpdate); + this._onDidUpdateOptions.fire(this._options); + this.getHTMLElement().classList.toggle("always", this._options.renderIndentGuides === RenderIndentGuides.Always); + } + get options() { + return this._options; + } + updateStickyScroll(optionsUpdate) { + if (!this.stickyScrollController && this._options.enableStickyScroll) { + this.stickyScrollController = new StickyScrollController(this, this.model, this.view, this.renderers, this.treeDelegate, this._options); + this.onDidChangeStickyScrollFocused = this.stickyScrollController.onDidChangeHasFocus; + } else if (this.stickyScrollController && !this._options.enableStickyScroll) { + this.onDidChangeStickyScrollFocused = Event.None; + this.stickyScrollController.dispose(); + this.stickyScrollController = void 0; + } + this.stickyScrollController?.updateOptions(optionsUpdate); + } + // Widget + getHTMLElement() { + return this.view.getHTMLElement(); + } + get onDidChangeContentHeight() { + return this.view.onDidChangeContentHeight; + } + get scrollTop() { + return this.view.scrollTop; + } + set scrollTop(scrollTop) { + this.view.scrollTop = scrollTop; + } + get scrollHeight() { + return this.view.scrollHeight; + } + get renderHeight() { + return this.view.renderHeight; + } + get ariaLabel() { + return this.view.ariaLabel; + } + set ariaLabel(value) { + this.view.ariaLabel = value; + } + domFocus() { + if (this.stickyScrollController?.focusedLast()) { + this.stickyScrollController.domFocus(); + } else { + this.view.domFocus(); + } + } + layout(height, width2) { + this.view.layout(height, width2); + } + style(styles) { + const suffix = `.${this.view.domId}`; + const content = []; + if (styles.treeIndentGuidesStroke) { + content.push(`.monaco-list${suffix}:hover .monaco-tl-indent > .indent-guide, .monaco-list${suffix}.always .monaco-tl-indent > .indent-guide { opacity: 1; border-color: ${styles.treeInactiveIndentGuidesStroke}; }`); + content.push(`.monaco-list${suffix} .monaco-tl-indent > .indent-guide.active { opacity: 1; border-color: ${styles.treeIndentGuidesStroke}; }`); + } + const stickyScrollBackground = styles.treeStickyScrollBackground ?? styles.listBackground; + if (stickyScrollBackground) { + content.push(`.monaco-list${suffix} .monaco-scrollable-element .monaco-tree-sticky-container { background-color: ${stickyScrollBackground}; }`); + content.push(`.monaco-list${suffix} .monaco-scrollable-element .monaco-tree-sticky-container .monaco-tree-sticky-row { background-color: ${stickyScrollBackground}; }`); + } + if (styles.treeStickyScrollBorder) { + content.push(`.monaco-list${suffix} .monaco-scrollable-element .monaco-tree-sticky-container { border-bottom: 1px solid ${styles.treeStickyScrollBorder}; }`); + } + if (styles.treeStickyScrollShadow) { + content.push(`.monaco-list${suffix} .monaco-scrollable-element .monaco-tree-sticky-container .monaco-tree-sticky-container-shadow { box-shadow: ${styles.treeStickyScrollShadow} 0 6px 6px -6px inset; height: 3px; }`); + } + if (styles.listFocusForeground) { + content.push(`.monaco-list${suffix}.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container:focus .monaco-list-row.focused { color: ${styles.listFocusForeground}; }`); + content.push(`.monaco-list${suffix}:not(.sticky-scroll-focused) .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.focused { color: inherit; }`); + } + const focusAndSelectionOutline = asCssValueWithDefault(styles.listFocusAndSelectionOutline, asCssValueWithDefault(styles.listSelectionOutline, styles.listFocusOutline ?? "")); + if (focusAndSelectionOutline) { + content.push(`.monaco-list${suffix}.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container:focus .monaco-list-row.focused.selected { outline: 1px solid ${focusAndSelectionOutline}; outline-offset: -1px;}`); + content.push(`.monaco-list${suffix}:not(.sticky-scroll-focused) .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.focused.selected { outline: inherit;}`); + } + if (styles.listFocusOutline) { + content.push(`.monaco-list${suffix}.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container:focus .monaco-list-row.focused { outline: 1px solid ${styles.listFocusOutline}; outline-offset: -1px; }`); + content.push(`.monaco-list${suffix}:not(.sticky-scroll-focused) .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.focused { outline: inherit; }`); + content.push(`.context-menu-visible .monaco-list${suffix}.last-focused.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.passive-focused { outline: 1px solid ${styles.listFocusOutline}; outline-offset: -1px; }`); + content.push(`.context-menu-visible .monaco-list${suffix}.last-focused.sticky-scroll-focused .monaco-list-rows .monaco-list-row.focused { outline: inherit; }`); + content.push(`.context-menu-visible .monaco-list${suffix}.last-focused:not(.sticky-scroll-focused) .monaco-tree-sticky-container .monaco-list-rows .monaco-list-row.focused { outline: inherit; }`); + } + this.styleElement.textContent = content.join("\n"); + this.view.style(styles); + } + // Tree navigation + getParentElement(location2) { + const parentRef = this.model.getParentNodeLocation(location2); + const parentNode = this.model.getNode(parentRef); + return parentNode.element; + } + getFirstElementChild(location2) { + return this.model.getFirstElementChild(location2); + } + // Tree + getNode(location2) { + return this.model.getNode(location2); + } + getNodeLocation(node) { + return this.model.getNodeLocation(node); + } + collapse(location2, recursive = false) { + return this.model.setCollapsed(location2, true, recursive); + } + expand(location2, recursive = false) { + return this.model.setCollapsed(location2, false, recursive); + } + toggleCollapsed(location2, recursive = false) { + return this.model.setCollapsed(location2, void 0, recursive); + } + isCollapsible(location2) { + return this.model.isCollapsible(location2); + } + setCollapsible(location2, collapsible) { + return this.model.setCollapsible(location2, collapsible); + } + isCollapsed(location2) { + return this.model.isCollapsed(location2); + } + refilter() { + this._onWillRefilter.fire(void 0); + this.model.refilter(); + } + setSelection(elements, browserEvent) { + this.eventBufferer.bufferEvents(() => { + const nodes = elements.map((e) => this.model.getNode(e)); + this.selection.set(nodes, browserEvent); + const indexes = elements.map((e) => this.model.getListIndex(e)).filter((i2) => i2 > -1); + this.view.setSelection(indexes, browserEvent, true); + }); + } + getSelection() { + return this.selection.get(); + } + setFocus(elements, browserEvent) { + this.eventBufferer.bufferEvents(() => { + const nodes = elements.map((e) => this.model.getNode(e)); + this.focus.set(nodes, browserEvent); + const indexes = elements.map((e) => this.model.getListIndex(e)).filter((i2) => i2 > -1); + this.view.setFocus(indexes, browserEvent, true); + }); + } + focusNext(n2 = 1, loop = false, browserEvent, filter = isKeyboardEvent(browserEvent) && browserEvent.altKey ? void 0 : this.focusNavigationFilter) { + this.view.focusNext(n2, loop, browserEvent, filter); + } + focusPrevious(n2 = 1, loop = false, browserEvent, filter = isKeyboardEvent(browserEvent) && browserEvent.altKey ? void 0 : this.focusNavigationFilter) { + this.view.focusPrevious(n2, loop, browserEvent, filter); + } + focusNextPage(browserEvent, filter = isKeyboardEvent(browserEvent) && browserEvent.altKey ? void 0 : this.focusNavigationFilter) { + return this.view.focusNextPage(browserEvent, filter); + } + focusPreviousPage(browserEvent, filter = isKeyboardEvent(browserEvent) && browserEvent.altKey ? void 0 : this.focusNavigationFilter) { + return this.view.focusPreviousPage(browserEvent, filter, () => this.stickyScrollController?.height ?? 0); + } + focusLast(browserEvent, filter = isKeyboardEvent(browserEvent) && browserEvent.altKey ? void 0 : this.focusNavigationFilter) { + this.view.focusLast(browserEvent, filter); + } + focusFirst(browserEvent, filter = isKeyboardEvent(browserEvent) && browserEvent.altKey ? void 0 : this.focusNavigationFilter) { + this.view.focusFirst(browserEvent, filter); + } + getFocus() { + return this.focus.get(); + } + reveal(location2, relativeTop) { + this.model.expandTo(location2); + const index = this.model.getListIndex(location2); + if (index === -1) { + return; + } + if (!this.stickyScrollController) { + this.view.reveal(index, relativeTop); + } else { + const paddingTop = this.stickyScrollController.nodePositionTopBelowWidget(this.getNode(location2)); + this.view.reveal(index, relativeTop, paddingTop); + } + } + // List + onLeftArrow(e) { + e.preventDefault(); + e.stopPropagation(); + const nodes = this.view.getFocusedElements(); + if (nodes.length === 0) { + return; + } + const node = nodes[0]; + const location2 = this.model.getNodeLocation(node); + const didChange = this.model.setCollapsed(location2, true); + if (!didChange) { + const parentLocation = this.model.getParentNodeLocation(location2); + if (!parentLocation) { + return; + } + const parentListIndex = this.model.getListIndex(parentLocation); + this.view.reveal(parentListIndex); + this.view.setFocus([parentListIndex]); + } + } + onRightArrow(e) { + e.preventDefault(); + e.stopPropagation(); + const nodes = this.view.getFocusedElements(); + if (nodes.length === 0) { + return; + } + const node = nodes[0]; + const location2 = this.model.getNodeLocation(node); + const didChange = this.model.setCollapsed(location2, false); + if (!didChange) { + if (!node.children.some((child) => child.visible)) { + return; + } + const [focusedIndex] = this.view.getFocus(); + const firstChildIndex = focusedIndex + 1; + this.view.reveal(firstChildIndex); + this.view.setFocus([firstChildIndex]); + } + } + onSpace(e) { + e.preventDefault(); + e.stopPropagation(); + const nodes = this.view.getFocusedElements(); + if (nodes.length === 0) { + return; + } + const node = nodes[0]; + const location2 = this.model.getNodeLocation(node); + const recursive = e.browserEvent.altKey; + this.model.setCollapsed(location2, void 0, recursive); + } + setupModel(model) { + this.modelDisposables.clear(); + this.modelDisposables.add(model.onDidSpliceRenderedNodes(({ start, deleteCount, elements }) => this.view.splice(start, deleteCount, elements))); + const onDidModelSplice = Event.forEach(model.onDidSpliceModel, (e) => { + this.eventBufferer.bufferEvents(() => { + this.focus.onDidModelSplice(e); + this.selection.onDidModelSplice(e); + }); + }, this.modelDisposables); + onDidModelSplice(() => null, null, this.modelDisposables); + const activeNodesEmitter = this.modelDisposables.add(new Emitter()); + const activeNodesDebounce = this.modelDisposables.add(new Delayer(0)); + this.modelDisposables.add(Event.any(onDidModelSplice, this.focus.onDidChange, this.selection.onDidChange)(() => { + activeNodesDebounce.trigger(() => { + const set = /* @__PURE__ */ new Set(); + for (const node of this.focus.getNodes()) { + set.add(node); + } + for (const node of this.selection.getNodes()) { + set.add(node); + } + activeNodesEmitter.fire([...set.values()]); + }); + })); + this.onDidChangeActiveNodesRelay.input = activeNodesEmitter.event; + this.onDidChangeModelRelay.input = Event.signal(model.onDidSpliceModel); + this.onDidChangeCollapseStateRelay.input = model.onDidChangeCollapseState; + this.onDidChangeRenderNodeCountRelay.input = model.onDidChangeRenderNodeCount; + this.onDidSpliceModelRelay.input = model.onDidSpliceModel; + } + dispose() { + dispose(this.disposables); + this.stickyScrollController?.dispose(); + this.view.dispose(); + this.modelDisposables.dispose(); + } +}; + +// node_modules/monaco-editor-core/esm/vs/base/browser/ui/tree/objectTreeModel.js +init_iterator(); +var ObjectTreeModel = class { + constructor(user, options2 = {}) { + this.user = user; + this.rootRef = null; + this.nodes = /* @__PURE__ */ new Map(); + this.nodesByIdentity = /* @__PURE__ */ new Map(); + this.model = new IndexTreeModel(user, null, options2); + this.onDidSpliceModel = this.model.onDidSpliceModel; + this.onDidSpliceRenderedNodes = this.model.onDidSpliceRenderedNodes; + this.onDidChangeCollapseState = this.model.onDidChangeCollapseState; + this.onDidChangeRenderNodeCount = this.model.onDidChangeRenderNodeCount; + if (options2.sorter) { + this.sorter = { + compare(a, b) { + return options2.sorter.compare(a.element, b.element); + } + }; + } + this.identityProvider = options2.identityProvider; + } + setChildren(element, children = Iterable.empty(), options2 = {}) { + const location2 = this.getElementLocation(element); + this._setChildren(location2, this.preserveCollapseState(children), options2); + } + _setChildren(location2, children = Iterable.empty(), options2) { + const insertedElements = /* @__PURE__ */ new Set(); + const insertedElementIds = /* @__PURE__ */ new Set(); + const onDidCreateNode = (node) => { + if (node.element === null) { + return; + } + const tnode = node; + insertedElements.add(tnode.element); + this.nodes.set(tnode.element, tnode); + if (this.identityProvider) { + const id = this.identityProvider.getId(tnode.element).toString(); + insertedElementIds.add(id); + this.nodesByIdentity.set(id, tnode); + } + options2.onDidCreateNode?.(tnode); + }; + const onDidDeleteNode = (node) => { + if (node.element === null) { + return; + } + const tnode = node; + if (!insertedElements.has(tnode.element)) { + this.nodes.delete(tnode.element); + } + if (this.identityProvider) { + const id = this.identityProvider.getId(tnode.element).toString(); + if (!insertedElementIds.has(id)) { + this.nodesByIdentity.delete(id); + } + } + options2.onDidDeleteNode?.(tnode); + }; + this.model.splice([...location2, 0], Number.MAX_VALUE, children, { ...options2, onDidCreateNode, onDidDeleteNode }); + } + preserveCollapseState(elements = Iterable.empty()) { + if (this.sorter) { + elements = [...elements].sort(this.sorter.compare.bind(this.sorter)); + } + return Iterable.map(elements, (treeElement) => { + let node = this.nodes.get(treeElement.element); + if (!node && this.identityProvider) { + const id = this.identityProvider.getId(treeElement.element).toString(); + node = this.nodesByIdentity.get(id); + } + if (!node) { + let collapsed3; + if (typeof treeElement.collapsed === "undefined") { + collapsed3 = void 0; + } else if (treeElement.collapsed === ObjectTreeElementCollapseState.Collapsed || treeElement.collapsed === ObjectTreeElementCollapseState.PreserveOrCollapsed) { + collapsed3 = true; + } else if (treeElement.collapsed === ObjectTreeElementCollapseState.Expanded || treeElement.collapsed === ObjectTreeElementCollapseState.PreserveOrExpanded) { + collapsed3 = false; + } else { + collapsed3 = Boolean(treeElement.collapsed); + } + return { + ...treeElement, + children: this.preserveCollapseState(treeElement.children), + collapsed: collapsed3 + }; + } + const collapsible = typeof treeElement.collapsible === "boolean" ? treeElement.collapsible : node.collapsible; + let collapsed2; + if (typeof treeElement.collapsed === "undefined" || treeElement.collapsed === ObjectTreeElementCollapseState.PreserveOrCollapsed || treeElement.collapsed === ObjectTreeElementCollapseState.PreserveOrExpanded) { + collapsed2 = node.collapsed; + } else if (treeElement.collapsed === ObjectTreeElementCollapseState.Collapsed) { + collapsed2 = true; + } else if (treeElement.collapsed === ObjectTreeElementCollapseState.Expanded) { + collapsed2 = false; + } else { + collapsed2 = Boolean(treeElement.collapsed); + } + return { + ...treeElement, + collapsible, + collapsed: collapsed2, + children: this.preserveCollapseState(treeElement.children) + }; + }); + } + rerender(element) { + const location2 = this.getElementLocation(element); + this.model.rerender(location2); + } + resort(element = null, recursive = true) { + if (!this.sorter) { + return; + } + const location2 = this.getElementLocation(element); + const node = this.model.getNode(location2); + this._setChildren(location2, this.resortChildren(node, recursive), {}); + } + resortChildren(node, recursive, first2 = true) { + let childrenNodes = [...node.children]; + if (recursive || first2) { + childrenNodes = childrenNodes.sort(this.sorter.compare.bind(this.sorter)); + } + return Iterable.map(childrenNodes, (node2) => ({ + element: node2.element, + collapsible: node2.collapsible, + collapsed: node2.collapsed, + children: this.resortChildren(node2, recursive, false) + })); + } + getFirstElementChild(ref = null) { + const location2 = this.getElementLocation(ref); + return this.model.getFirstElementChild(location2); + } + has(element) { + return this.nodes.has(element); + } + getListIndex(element) { + const location2 = this.getElementLocation(element); + return this.model.getListIndex(location2); + } + getListRenderCount(element) { + const location2 = this.getElementLocation(element); + return this.model.getListRenderCount(location2); + } + isCollapsible(element) { + const location2 = this.getElementLocation(element); + return this.model.isCollapsible(location2); + } + setCollapsible(element, collapsible) { + const location2 = this.getElementLocation(element); + return this.model.setCollapsible(location2, collapsible); + } + isCollapsed(element) { + const location2 = this.getElementLocation(element); + return this.model.isCollapsed(location2); + } + setCollapsed(element, collapsed2, recursive) { + const location2 = this.getElementLocation(element); + return this.model.setCollapsed(location2, collapsed2, recursive); + } + expandTo(element) { + const location2 = this.getElementLocation(element); + this.model.expandTo(location2); + } + refilter() { + this.model.refilter(); + } + getNode(element = null) { + if (element === null) { + return this.model.getNode(this.model.rootRef); + } + const node = this.nodes.get(element); + if (!node) { + throw new TreeError(this.user, `Tree element not found: ${element}`); + } + return node; + } + getNodeLocation(node) { + return node.element; + } + getParentNodeLocation(element) { + if (element === null) { + throw new TreeError(this.user, `Invalid getParentNodeLocation call`); + } + const node = this.nodes.get(element); + if (!node) { + throw new TreeError(this.user, `Tree element not found: ${element}`); + } + const location2 = this.model.getNodeLocation(node); + const parentLocation = this.model.getParentNodeLocation(location2); + const parent = this.model.getNode(parentLocation); + return parent.element; + } + getElementLocation(element) { + if (element === null) { + return []; + } + const node = this.nodes.get(element); + if (!node) { + throw new TreeError(this.user, `Tree element not found: ${element}`); + } + return this.model.getNodeLocation(node); + } +}; + +// node_modules/monaco-editor-core/esm/vs/base/browser/ui/tree/compressedObjectTreeModel.js +init_arrays(); +init_event(); +init_iterator(); +function noCompress(element) { + const elements = [element.element]; + const incompressible = element.incompressible || false; + return { + element: { elements, incompressible }, + children: Iterable.map(Iterable.from(element.children), noCompress), + collapsible: element.collapsible, + collapsed: element.collapsed + }; +} +function compress(element) { + const elements = [element.element]; + const incompressible = element.incompressible || false; + let childrenIterator; + let children; + while (true) { + [children, childrenIterator] = Iterable.consume(Iterable.from(element.children), 2); + if (children.length !== 1) { + break; + } + if (children[0].incompressible) { + break; + } + element = children[0]; + elements.push(element.element); + } + return { + element: { elements, incompressible }, + children: Iterable.map(Iterable.concat(children, childrenIterator), compress), + collapsible: element.collapsible, + collapsed: element.collapsed + }; +} +function _decompress(element, index = 0) { + let children; + if (index < element.element.elements.length - 1) { + children = [_decompress(element, index + 1)]; + } else { + children = Iterable.map(Iterable.from(element.children), (el) => _decompress(el, 0)); + } + if (index === 0 && element.element.incompressible) { + return { + element: element.element.elements[index], + children, + incompressible: true, + collapsible: element.collapsible, + collapsed: element.collapsed + }; + } + return { + element: element.element.elements[index], + children, + collapsible: element.collapsible, + collapsed: element.collapsed + }; +} +function decompress(element) { + return _decompress(element, 0); +} +function splice2(treeElement, element, children) { + if (treeElement.element === element) { + return { ...treeElement, children }; + } + return { ...treeElement, children: Iterable.map(Iterable.from(treeElement.children), (e) => splice2(e, element, children)) }; +} +var wrapIdentityProvider = (base) => ({ + getId(node) { + return node.elements.map((e) => base.getId(e).toString()).join("\0"); + } +}); +var CompressedObjectTreeModel = class { + get onDidSpliceRenderedNodes() { + return this.model.onDidSpliceRenderedNodes; + } + get onDidSpliceModel() { + return this.model.onDidSpliceModel; + } + get onDidChangeCollapseState() { + return this.model.onDidChangeCollapseState; + } + get onDidChangeRenderNodeCount() { + return this.model.onDidChangeRenderNodeCount; + } + constructor(user, options2 = {}) { + this.user = user; + this.rootRef = null; + this.nodes = /* @__PURE__ */ new Map(); + this.model = new ObjectTreeModel(user, options2); + this.enabled = typeof options2.compressionEnabled === "undefined" ? true : options2.compressionEnabled; + this.identityProvider = options2.identityProvider; + } + setChildren(element, children = Iterable.empty(), options2) { + const diffIdentityProvider = options2.diffIdentityProvider && wrapIdentityProvider(options2.diffIdentityProvider); + if (element === null) { + const compressedChildren = Iterable.map(children, this.enabled ? compress : noCompress); + this._setChildren(null, compressedChildren, { diffIdentityProvider, diffDepth: Infinity }); + return; + } + const compressedNode = this.nodes.get(element); + if (!compressedNode) { + throw new TreeError(this.user, "Unknown compressed tree node"); + } + const node = this.model.getNode(compressedNode); + const compressedParentNode = this.model.getParentNodeLocation(compressedNode); + const parent = this.model.getNode(compressedParentNode); + const decompressedElement = decompress(node); + const splicedElement = splice2(decompressedElement, element, children); + const recompressedElement = (this.enabled ? compress : noCompress)(splicedElement); + const elementComparator = options2.diffIdentityProvider ? ((a, b) => options2.diffIdentityProvider.getId(a) === options2.diffIdentityProvider.getId(b)) : void 0; + if (equals(recompressedElement.element.elements, node.element.elements, elementComparator)) { + this._setChildren(compressedNode, recompressedElement.children || Iterable.empty(), { diffIdentityProvider, diffDepth: 1 }); + return; + } + const parentChildren = parent.children.map((child) => child === node ? recompressedElement : child); + this._setChildren(parent.element, parentChildren, { + diffIdentityProvider, + diffDepth: node.depth - parent.depth + }); + } + isCompressionEnabled() { + return this.enabled; + } + setCompressionEnabled(enabled) { + if (enabled === this.enabled) { + return; + } + this.enabled = enabled; + const root = this.model.getNode(); + const rootChildren = root.children; + const decompressedRootChildren = Iterable.map(rootChildren, decompress); + const recompressedRootChildren = Iterable.map(decompressedRootChildren, enabled ? compress : noCompress); + this._setChildren(null, recompressedRootChildren, { + diffIdentityProvider: this.identityProvider, + diffDepth: Infinity + }); + } + _setChildren(node, children, options2) { + const insertedElements = /* @__PURE__ */ new Set(); + const onDidCreateNode = (node2) => { + for (const element of node2.element.elements) { + insertedElements.add(element); + this.nodes.set(element, node2.element); + } + }; + const onDidDeleteNode = (node2) => { + for (const element of node2.element.elements) { + if (!insertedElements.has(element)) { + this.nodes.delete(element); + } + } + }; + this.model.setChildren(node, children, { ...options2, onDidCreateNode, onDidDeleteNode }); + } + has(element) { + return this.nodes.has(element); + } + getListIndex(location2) { + const node = this.getCompressedNode(location2); + return this.model.getListIndex(node); + } + getListRenderCount(location2) { + const node = this.getCompressedNode(location2); + return this.model.getListRenderCount(node); + } + getNode(location2) { + if (typeof location2 === "undefined") { + return this.model.getNode(); + } + const node = this.getCompressedNode(location2); + return this.model.getNode(node); + } + // TODO: review this + getNodeLocation(node) { + const compressedNode = this.model.getNodeLocation(node); + if (compressedNode === null) { + return null; + } + return compressedNode.elements[compressedNode.elements.length - 1]; + } + // TODO: review this + getParentNodeLocation(location2) { + const compressedNode = this.getCompressedNode(location2); + const parentNode = this.model.getParentNodeLocation(compressedNode); + if (parentNode === null) { + return null; + } + return parentNode.elements[parentNode.elements.length - 1]; + } + getFirstElementChild(location2) { + const compressedNode = this.getCompressedNode(location2); + return this.model.getFirstElementChild(compressedNode); + } + isCollapsible(location2) { + const compressedNode = this.getCompressedNode(location2); + return this.model.isCollapsible(compressedNode); + } + setCollapsible(location2, collapsible) { + const compressedNode = this.getCompressedNode(location2); + return this.model.setCollapsible(compressedNode, collapsible); + } + isCollapsed(location2) { + const compressedNode = this.getCompressedNode(location2); + return this.model.isCollapsed(compressedNode); + } + setCollapsed(location2, collapsed2, recursive) { + const compressedNode = this.getCompressedNode(location2); + return this.model.setCollapsed(compressedNode, collapsed2, recursive); + } + expandTo(location2) { + const compressedNode = this.getCompressedNode(location2); + this.model.expandTo(compressedNode); + } + rerender(location2) { + const compressedNode = this.getCompressedNode(location2); + this.model.rerender(compressedNode); + } + refilter() { + this.model.refilter(); + } + resort(location2 = null, recursive = true) { + const compressedNode = this.getCompressedNode(location2); + this.model.resort(compressedNode, recursive); + } + getCompressedNode(element) { + if (element === null) { + return null; + } + const node = this.nodes.get(element); + if (!node) { + throw new TreeError(this.user, `Tree element not found: ${element}`); + } + return node; + } +}; +var DefaultElementMapper = (elements) => elements[elements.length - 1]; +var CompressedTreeNodeWrapper = class _CompressedTreeNodeWrapper { + get element() { + return this.node.element === null ? null : this.unwrapper(this.node.element); + } + get children() { + return this.node.children.map((node) => new _CompressedTreeNodeWrapper(this.unwrapper, node)); + } + get depth() { + return this.node.depth; + } + get visibleChildrenCount() { + return this.node.visibleChildrenCount; + } + get visibleChildIndex() { + return this.node.visibleChildIndex; + } + get collapsible() { + return this.node.collapsible; + } + get collapsed() { + return this.node.collapsed; + } + get visible() { + return this.node.visible; + } + get filterData() { + return this.node.filterData; + } + constructor(unwrapper, node) { + this.unwrapper = unwrapper; + this.node = node; + } +}; +function mapOptions(compressedNodeUnwrapper, options2) { + return { + ...options2, + identityProvider: options2.identityProvider && { + getId(node) { + return options2.identityProvider.getId(compressedNodeUnwrapper(node)); + } + }, + sorter: options2.sorter && { + compare(node, otherNode) { + return options2.sorter.compare(node.elements[0], otherNode.elements[0]); + } + }, + filter: options2.filter && { + filter(node, parentVisibility) { + const elements = node.elements; + for (let i2 = 0; i2 < elements.length - 1; i2++) { + const result = options2.filter.filter(elements[i2], parentVisibility); + parentVisibility = getVisibleState(isFilterResult(result) ? result.visibility : result); + } + return options2.filter.filter(elements[elements.length - 1], parentVisibility); + } + } + }; +} +var CompressibleObjectTreeModel = class { + get onDidSpliceModel() { + return Event.map(this.model.onDidSpliceModel, ({ insertedNodes, deletedNodes }) => ({ + insertedNodes: insertedNodes.map((node) => this.nodeMapper.map(node)), + deletedNodes: deletedNodes.map((node) => this.nodeMapper.map(node)) + })); + } + get onDidSpliceRenderedNodes() { + return Event.map(this.model.onDidSpliceRenderedNodes, ({ start, deleteCount, elements }) => ({ + start, + deleteCount, + elements: elements.map((node) => this.nodeMapper.map(node)) + })); + } + get onDidChangeCollapseState() { + return Event.map(this.model.onDidChangeCollapseState, ({ node, deep }) => ({ + node: this.nodeMapper.map(node), + deep + })); + } + get onDidChangeRenderNodeCount() { + return Event.map(this.model.onDidChangeRenderNodeCount, (node) => this.nodeMapper.map(node)); + } + constructor(user, options2 = {}) { + this.rootRef = null; + this.elementMapper = options2.elementMapper || DefaultElementMapper; + const compressedNodeUnwrapper = (node) => this.elementMapper(node.elements); + this.nodeMapper = new WeakMapper((node) => new CompressedTreeNodeWrapper(compressedNodeUnwrapper, node)); + this.model = new CompressedObjectTreeModel(user, mapOptions(compressedNodeUnwrapper, options2)); + } + setChildren(element, children = Iterable.empty(), options2 = {}) { + this.model.setChildren(element, children, options2); + } + isCompressionEnabled() { + return this.model.isCompressionEnabled(); + } + setCompressionEnabled(enabled) { + this.model.setCompressionEnabled(enabled); + } + has(location2) { + return this.model.has(location2); + } + getListIndex(location2) { + return this.model.getListIndex(location2); + } + getListRenderCount(location2) { + return this.model.getListRenderCount(location2); + } + getNode(location2) { + return this.nodeMapper.map(this.model.getNode(location2)); + } + getNodeLocation(node) { + return node.element; + } + getParentNodeLocation(location2) { + return this.model.getParentNodeLocation(location2); + } + getFirstElementChild(location2) { + const result = this.model.getFirstElementChild(location2); + if (result === null || typeof result === "undefined") { + return result; + } + return this.elementMapper(result.elements); + } + isCollapsible(location2) { + return this.model.isCollapsible(location2); + } + setCollapsible(location2, collapsed2) { + return this.model.setCollapsible(location2, collapsed2); + } + isCollapsed(location2) { + return this.model.isCollapsed(location2); + } + setCollapsed(location2, collapsed2, recursive) { + return this.model.setCollapsed(location2, collapsed2, recursive); + } + expandTo(location2) { + return this.model.expandTo(location2); + } + rerender(location2) { + return this.model.rerender(location2); + } + refilter() { + return this.model.refilter(); + } + resort(element = null, recursive = true) { + return this.model.resort(element, recursive); + } + getCompressedTreeNode(location2 = null) { + return this.model.getNode(location2); + } +}; + +// node_modules/monaco-editor-core/esm/vs/base/browser/ui/tree/objectTree.js +init_iterator(); +var __decorate70 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var ObjectTree = class extends AbstractTree { + get onDidChangeCollapseState() { + return this.model.onDidChangeCollapseState; + } + constructor(user, container, delegate, renderers, options2 = {}) { + super(user, container, delegate, renderers, options2); + this.user = user; + } + setChildren(element, children = Iterable.empty(), options2) { + this.model.setChildren(element, children, options2); + } + rerender(element) { + if (element === void 0) { + this.view.rerender(); + return; + } + this.model.rerender(element); + } + resort(element, recursive = true) { + this.model.resort(element, recursive); + } + hasElement(element) { + return this.model.has(element); + } + createModel(user, options2) { + return new ObjectTreeModel(user, options2); + } +}; +var CompressibleRenderer = class { + get compressedTreeNodeProvider() { + return this._compressedTreeNodeProvider(); + } + constructor(_compressedTreeNodeProvider, stickyScrollDelegate, renderer) { + this._compressedTreeNodeProvider = _compressedTreeNodeProvider; + this.stickyScrollDelegate = stickyScrollDelegate; + this.renderer = renderer; + this.templateId = renderer.templateId; + if (renderer.onDidChangeTwistieState) { + this.onDidChangeTwistieState = renderer.onDidChangeTwistieState; + } + } + renderTemplate(container) { + const data = this.renderer.renderTemplate(container); + return { compressedTreeNode: void 0, data }; + } + renderElement(node, index, templateData, details) { + let compressedTreeNode = this.stickyScrollDelegate.getCompressedNode(node); + if (!compressedTreeNode) { + compressedTreeNode = this.compressedTreeNodeProvider.getCompressedTreeNode(node.element); + } + if (compressedTreeNode.element.elements.length === 1) { + templateData.compressedTreeNode = void 0; + this.renderer.renderElement(node, index, templateData.data, details); + } else { + templateData.compressedTreeNode = compressedTreeNode; + this.renderer.renderCompressedElements(compressedTreeNode, index, templateData.data, details); + } + } + disposeElement(node, index, templateData, details) { + if (templateData.compressedTreeNode) { + this.renderer.disposeCompressedElements?.(templateData.compressedTreeNode, index, templateData.data, details); + } else { + this.renderer.disposeElement?.(node, index, templateData.data, details); + } + } + disposeTemplate(templateData) { + this.renderer.disposeTemplate(templateData.data); + } + renderTwistie(element, twistieElement) { + return this.renderer.renderTwistie?.(element, twistieElement) ?? false; + } +}; +__decorate70([ + memoize +], CompressibleRenderer.prototype, "compressedTreeNodeProvider", null); +var CompressibleStickyScrollDelegate = class { + constructor(modelProvider) { + this.modelProvider = modelProvider; + this.compressedStickyNodes = /* @__PURE__ */ new Map(); + } + getCompressedNode(node) { + return this.compressedStickyNodes.get(node); + } + constrainStickyScrollNodes(stickyNodes, stickyScrollMaxItemCount, maxWidgetHeight) { + this.compressedStickyNodes.clear(); + if (stickyNodes.length === 0) { + return []; + } + for (let i2 = 0; i2 < stickyNodes.length; i2++) { + const stickyNode = stickyNodes[i2]; + const stickyNodeBottom = stickyNode.position + stickyNode.height; + const followingReachesMaxHeight = i2 + 1 < stickyNodes.length && stickyNodeBottom + stickyNodes[i2 + 1].height > maxWidgetHeight; + if (followingReachesMaxHeight || i2 >= stickyScrollMaxItemCount - 1 && stickyScrollMaxItemCount < stickyNodes.length) { + const uncompressedStickyNodes = stickyNodes.slice(0, i2); + const overflowingStickyNodes = stickyNodes.slice(i2); + const compressedStickyNode = this.compressStickyNodes(overflowingStickyNodes); + return [...uncompressedStickyNodes, compressedStickyNode]; + } + } + return stickyNodes; + } + compressStickyNodes(stickyNodes) { + if (stickyNodes.length === 0) { + throw new Error("Can't compress empty sticky nodes"); + } + const compressionModel = this.modelProvider(); + if (!compressionModel.isCompressionEnabled()) { + return stickyNodes[0]; + } + const elements = []; + for (let i2 = 0; i2 < stickyNodes.length; i2++) { + const stickyNode = stickyNodes[i2]; + const compressedNode2 = compressionModel.getCompressedTreeNode(stickyNode.node.element); + if (compressedNode2.element) { + if (i2 !== 0 && compressedNode2.element.incompressible) { + break; + } + elements.push(...compressedNode2.element.elements); + } + } + if (elements.length < 2) { + return stickyNodes[0]; + } + const lastStickyNode = stickyNodes[stickyNodes.length - 1]; + const compressedElement = { elements, incompressible: false }; + const compressedNode = { ...lastStickyNode.node, children: [], element: compressedElement }; + const stickyTreeNode = new Proxy(stickyNodes[0].node, {}); + const compressedStickyNode = { + node: stickyTreeNode, + startIndex: stickyNodes[0].startIndex, + endIndex: lastStickyNode.endIndex, + position: stickyNodes[0].position, + height: stickyNodes[0].height + }; + this.compressedStickyNodes.set(stickyTreeNode, compressedNode); + return compressedStickyNode; + } +}; +function asObjectTreeOptions(compressedTreeNodeProvider, options2) { + return options2 && { + ...options2, + keyboardNavigationLabelProvider: options2.keyboardNavigationLabelProvider && { + getKeyboardNavigationLabel(e) { + let compressedTreeNode; + try { + compressedTreeNode = compressedTreeNodeProvider().getCompressedTreeNode(e); + } catch { + return options2.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e); + } + if (compressedTreeNode.element.elements.length === 1) { + return options2.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e); + } else { + return options2.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(compressedTreeNode.element.elements); + } + } + } + }; +} +var CompressibleObjectTree = class extends ObjectTree { + constructor(user, container, delegate, renderers, options2 = {}) { + const compressedTreeNodeProvider = () => this; + const stickyScrollDelegate = new CompressibleStickyScrollDelegate(() => this.model); + const compressibleRenderers = renderers.map((r) => new CompressibleRenderer(compressedTreeNodeProvider, stickyScrollDelegate, r)); + super(user, container, delegate, compressibleRenderers, { ...asObjectTreeOptions(compressedTreeNodeProvider, options2), stickyScrollDelegate }); + } + setChildren(element, children = Iterable.empty(), options2) { + this.model.setChildren(element, children, options2); + } + createModel(user, options2) { + return new CompressibleObjectTreeModel(user, options2); + } + updateOptions(optionsUpdate = {}) { + super.updateOptions(optionsUpdate); + if (typeof optionsUpdate.compressionEnabled !== "undefined") { + this.model.setCompressionEnabled(optionsUpdate.compressionEnabled); + } + } + getCompressedTreeNode(element = null) { + return this.model.getCompressedTreeNode(element); + } +}; + +// node_modules/monaco-editor-core/esm/vs/base/browser/ui/tree/asyncDataTree.js +init_async(); +init_codicons(); +init_themables(); +init_errors(); +init_event(); +init_iterator(); +init_lifecycle(); +init_types(); +init_filters(); +init_arrays(); +function createAsyncDataTreeNode(props) { + return { + ...props, + children: [], + refreshPromise: void 0, + stale: true, + slow: false, + forceExpanded: false + }; +} +function isAncestor2(ancestor, descendant) { + if (!descendant.parent) { + return false; + } else if (descendant.parent === ancestor) { + return true; + } else { + return isAncestor2(ancestor, descendant.parent); + } +} +function intersects(node, other) { + return node === other || isAncestor2(node, other) || isAncestor2(other, node); +} +var AsyncDataTreeNodeWrapper = class _AsyncDataTreeNodeWrapper { + get element() { + return this.node.element.element; + } + get children() { + return this.node.children.map((node) => new _AsyncDataTreeNodeWrapper(node)); + } + get depth() { + return this.node.depth; + } + get visibleChildrenCount() { + return this.node.visibleChildrenCount; + } + get visibleChildIndex() { + return this.node.visibleChildIndex; + } + get collapsible() { + return this.node.collapsible; + } + get collapsed() { + return this.node.collapsed; + } + get visible() { + return this.node.visible; + } + get filterData() { + return this.node.filterData; + } + constructor(node) { + this.node = node; + } +}; +var AsyncDataTreeRenderer = class { + constructor(renderer, nodeMapper, onDidChangeTwistieState) { + this.renderer = renderer; + this.nodeMapper = nodeMapper; + this.onDidChangeTwistieState = onDidChangeTwistieState; + this.renderedNodes = /* @__PURE__ */ new Map(); + this.templateId = renderer.templateId; + } + renderTemplate(container) { + const templateData = this.renderer.renderTemplate(container); + return { templateData }; + } + renderElement(node, index, templateData, details) { + this.renderer.renderElement(this.nodeMapper.map(node), index, templateData.templateData, details); + } + renderTwistie(element, twistieElement) { + if (element.slow) { + twistieElement.classList.add(...ThemeIcon.asClassNameArray(Codicon.treeItemLoading)); + return true; + } else { + twistieElement.classList.remove(...ThemeIcon.asClassNameArray(Codicon.treeItemLoading)); + return false; + } + } + disposeElement(node, index, templateData, details) { + this.renderer.disposeElement?.(this.nodeMapper.map(node), index, templateData.templateData, details); + } + disposeTemplate(templateData) { + this.renderer.disposeTemplate(templateData.templateData); + } + dispose() { + this.renderedNodes.clear(); + } +}; +function asTreeEvent(e) { + return { + browserEvent: e.browserEvent, + elements: e.elements.map((e2) => e2.element) + }; +} +function asTreeMouseEvent2(e) { + return { + browserEvent: e.browserEvent, + element: e.element && e.element.element, + target: e.target + }; +} +var AsyncDataTreeElementsDragAndDropData = class extends ElementsDragAndDropData { + constructor(data) { + super(data.elements.map((node) => node.element)); + this.data = data; + } +}; +function asAsyncDataTreeDragAndDropData(data) { + if (data instanceof ElementsDragAndDropData) { + return new AsyncDataTreeElementsDragAndDropData(data); + } + return data; +} +var AsyncDataTreeNodeListDragAndDrop = class { + constructor(dnd) { + this.dnd = dnd; + } + getDragURI(node) { + return this.dnd.getDragURI(node.element); + } + getDragLabel(nodes, originalEvent) { + if (this.dnd.getDragLabel) { + return this.dnd.getDragLabel(nodes.map((node) => node.element), originalEvent); + } + return void 0; + } + onDragStart(data, originalEvent) { + this.dnd.onDragStart?.(asAsyncDataTreeDragAndDropData(data), originalEvent); + } + onDragOver(data, targetNode, targetIndex, targetSector, originalEvent, raw = true) { + return this.dnd.onDragOver(asAsyncDataTreeDragAndDropData(data), targetNode && targetNode.element, targetIndex, targetSector, originalEvent); + } + drop(data, targetNode, targetIndex, targetSector, originalEvent) { + this.dnd.drop(asAsyncDataTreeDragAndDropData(data), targetNode && targetNode.element, targetIndex, targetSector, originalEvent); + } + onDragEnd(originalEvent) { + this.dnd.onDragEnd?.(originalEvent); + } + dispose() { + this.dnd.dispose(); + } +}; +var AsyncFindFilter = class extends FindFilter { + constructor(findProvider, keyboardNavigationLabelProvider, filter) { + super(keyboardNavigationLabelProvider, filter); + this.findProvider = findProvider; + this.isFindSessionActive = false; + } + filter(element, parentVisibility) { + const filterResult = super.filter(element, parentVisibility); + if (!this.isFindSessionActive || this.findMode === TreeFindMode.Highlight || !this.findProvider.isVisible) { + return filterResult; + } + const visibility = isFilterResult(filterResult) ? filterResult.visibility : filterResult; + if (getVisibleState(visibility) === 0) { + return 0; + } + return this.findProvider.isVisible(element) ? filterResult : 0; + } +}; +var AsyncFindController = class extends FindController { + constructor(tree, findProvider, filter, contextViewProvider, options2) { + super(tree, filter, contextViewProvider, options2); + this.findProvider = findProvider; + this.filter = filter; + this.activeSession = false; + this.asyncWorkInProgress = false; + this.disposables.add(toDisposable(async () => { + if (this.activeSession) { + await this.findProvider.endSession?.(); + } + })); + } + render() { + if (this.asyncWorkInProgress || !this.activeFindMetadata) { + return; + } + const showNotFound = this.activeFindMetadata.matchCount === 0 && this.pattern.length > 0; + this.renderMessage(showNotFound); + if (this.pattern.length) { + this.alertResults(this.activeFindMetadata.matchCount); + } + } + shouldAllowFocus(node) { + return this.shouldFocusWhenNavigating(node); + } + shouldFocusWhenNavigating(node) { + if (!this.activeSession || !this.activeFindMetadata) { + return true; + } + const element = node.element?.element; + if (element && this.activeFindMetadata.isMatch(element)) { + return true; + } + return !FuzzyScore.isDefault(node.filterData); + } +}; +function asObjectTreeOptions2(options2) { + return options2 && { + ...options2, + collapseByDefault: true, + identityProvider: options2.identityProvider && { + getId(el) { + return options2.identityProvider.getId(el.element); + } + }, + dnd: options2.dnd && new AsyncDataTreeNodeListDragAndDrop(options2.dnd), + multipleSelectionController: options2.multipleSelectionController && { + isSelectionSingleChangeEvent(e) { + return options2.multipleSelectionController.isSelectionSingleChangeEvent({ ...e, element: e.element }); + }, + isSelectionRangeChangeEvent(e) { + return options2.multipleSelectionController.isSelectionRangeChangeEvent({ ...e, element: e.element }); + } + }, + accessibilityProvider: options2.accessibilityProvider && { + ...options2.accessibilityProvider, + getPosInSet: void 0, + getSetSize: void 0, + getRole: options2.accessibilityProvider.getRole ? (el) => { + return options2.accessibilityProvider.getRole(el.element); + } : () => "treeitem", + isChecked: options2.accessibilityProvider.isChecked ? (e) => { + return !!options2.accessibilityProvider?.isChecked(e.element); + } : void 0, + getAriaLabel(e) { + return options2.accessibilityProvider.getAriaLabel(e.element); + }, + getWidgetAriaLabel() { + return options2.accessibilityProvider.getWidgetAriaLabel(); + }, + getWidgetRole: options2.accessibilityProvider.getWidgetRole ? () => options2.accessibilityProvider.getWidgetRole() : () => "tree", + getAriaLevel: options2.accessibilityProvider.getAriaLevel && ((node) => { + return options2.accessibilityProvider.getAriaLevel(node.element); + }), + getActiveDescendantId: options2.accessibilityProvider.getActiveDescendantId && ((node) => { + return options2.accessibilityProvider.getActiveDescendantId(node.element); + }) + }, + filter: options2.filter && { + filter(e, parentVisibility) { + return options2.filter.filter(e.element, parentVisibility); + } + }, + keyboardNavigationLabelProvider: options2.keyboardNavigationLabelProvider && { + ...options2.keyboardNavigationLabelProvider, + getKeyboardNavigationLabel(e) { + return options2.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e.element); + } + }, + sorter: void 0, + expandOnlyOnTwistieClick: typeof options2.expandOnlyOnTwistieClick === "undefined" ? void 0 : typeof options2.expandOnlyOnTwistieClick !== "function" ? options2.expandOnlyOnTwistieClick : ((e) => options2.expandOnlyOnTwistieClick(e.element)), + defaultFindVisibility: (e) => { + if (e.hasChildren && e.stale) { + return 1; + } else if (typeof options2.defaultFindVisibility === "number") { + return options2.defaultFindVisibility; + } else if (typeof options2.defaultFindVisibility === "undefined") { + return 2; + } else { + return options2.defaultFindVisibility(e.element); + } + }, + stickyScrollDelegate: options2.stickyScrollDelegate + }; +} +function dfs2(node, fn) { + fn(node); + node.children.forEach((child) => dfs2(child, fn)); +} +var AsyncDataTree = class { + get onDidScroll() { + return this.tree.onDidScroll; + } + get onDidChangeFocus() { + return Event.map(this.tree.onDidChangeFocus, asTreeEvent); + } + get onDidChangeSelection() { + return Event.map(this.tree.onDidChangeSelection, asTreeEvent); + } + get onMouseDblClick() { + return Event.map(this.tree.onMouseDblClick, asTreeMouseEvent2); + } + get onPointer() { + return Event.map(this.tree.onPointer, asTreeMouseEvent2); + } + get onDidFocus() { + return this.tree.onDidFocus; + } + /** + * To be used internally only! + * @deprecated + */ + get onDidChangeModel() { + return this.tree.onDidChangeModel; + } + get onDidChangeCollapseState() { + return this.tree.onDidChangeCollapseState; + } + get onDidChangeStickyScrollFocused() { + return this.tree.onDidChangeStickyScrollFocused; + } + get onDidDispose() { + return this.tree.onDidDispose; + } + constructor(user, container, delegate, renderers, dataSource, options2 = {}) { + this.user = user; + this.dataSource = dataSource; + this.nodes = /* @__PURE__ */ new Map(); + this.subTreeRefreshPromises = /* @__PURE__ */ new Map(); + this.refreshPromises = /* @__PURE__ */ new Map(); + this._onDidRender = new Emitter(); + this._onDidChangeNodeSlowState = new Emitter(); + this.nodeMapper = new WeakMapper((node) => new AsyncDataTreeNodeWrapper(node)); + this.disposables = new DisposableStore(); + this.identityProvider = options2.identityProvider; + this.autoExpandSingleChildren = typeof options2.autoExpandSingleChildren === "undefined" ? false : options2.autoExpandSingleChildren; + this.sorter = options2.sorter; + this.getDefaultCollapseState = (e) => options2.collapseByDefault ? options2.collapseByDefault(e) ? ObjectTreeElementCollapseState.PreserveOrCollapsed : ObjectTreeElementCollapseState.PreserveOrExpanded : void 0; + let asyncFindEnabled = false; + let findFilter; + if (options2.findProvider && (options2.findWidgetEnabled ?? true) && options2.keyboardNavigationLabelProvider && options2.contextViewProvider) { + asyncFindEnabled = true; + findFilter = new AsyncFindFilter(options2.findProvider, options2.keyboardNavigationLabelProvider, options2.filter); + } + this.tree = this.createTree(user, container, delegate, renderers, { ...options2, findWidgetEnabled: !asyncFindEnabled, filter: findFilter ?? options2.filter }); + this.root = createAsyncDataTreeNode({ + element: void 0, + parent: null, + hasChildren: true, + defaultCollapseState: void 0 + }); + if (this.identityProvider) { + this.root = { + ...this.root, + id: null + }; + } + this.nodes.set(null, this.root); + this.tree.onDidChangeCollapseState(this._onDidChangeCollapseState, this, this.disposables); + if (asyncFindEnabled) { + const findOptions = { + styles: options2.findWidgetStyles, + showNotFoundMessage: options2.showNotFoundMessage, + defaultFindMatchType: options2.defaultFindMatchType, + defaultFindMode: options2.defaultFindMode + }; + this.findController = this.disposables.add(new AsyncFindController(this.tree, options2.findProvider, findFilter, this.tree.options.contextViewProvider, findOptions)); + this.focusNavigationFilter = (node) => this.findController.shouldFocusWhenNavigating(node); + this.onDidChangeFindOpenState = this.findController.onDidChangeOpenState; + this.onDidChangeFindMode = this.findController.onDidChangeMode; + this.onDidChangeFindMatchType = this.findController.onDidChangeMatchType; + } else { + this.onDidChangeFindOpenState = this.tree.onDidChangeFindOpenState; + this.onDidChangeFindMode = this.tree.onDidChangeFindMode; + this.onDidChangeFindMatchType = this.tree.onDidChangeFindMatchType; + } + } + createTree(user, container, delegate, renderers, options2) { + const objectTreeDelegate = new ComposedTreeDelegate(delegate); + const objectTreeRenderers = renderers.map((r) => new AsyncDataTreeRenderer(r, this.nodeMapper, this._onDidChangeNodeSlowState.event)); + const objectTreeOptions = asObjectTreeOptions2(options2) || {}; + return new ObjectTree(user, container, objectTreeDelegate, objectTreeRenderers, objectTreeOptions); + } + updateOptions(optionsUpdate = {}) { + if (this.findController) { + if (optionsUpdate.defaultFindMode !== void 0) { + this.findController.mode = optionsUpdate.defaultFindMode; + } + if (optionsUpdate.defaultFindMatchType !== void 0) { + this.findController.matchType = optionsUpdate.defaultFindMatchType; + } + } + this.tree.updateOptions(optionsUpdate); + } + // Widget + getHTMLElement() { + return this.tree.getHTMLElement(); + } + get scrollTop() { + return this.tree.scrollTop; + } + set scrollTop(scrollTop) { + this.tree.scrollTop = scrollTop; + } + get scrollHeight() { + return this.tree.scrollHeight; + } + get renderHeight() { + return this.tree.renderHeight; + } + domFocus() { + this.tree.domFocus(); + } + layout(height, width2) { + this.tree.layout(height, width2); + } + style(styles) { + this.tree.style(styles); + } + // Model + getInput() { + return this.root.element; + } + async setInput(input, viewState) { + this.cancelAllRefreshPromises(); + this.root.element = input; + const viewStateContext = viewState && { viewState, focus: [], selection: [] }; + await this._updateChildren(input, true, false, viewStateContext); + if (viewStateContext) { + this.tree.setFocus(viewStateContext.focus); + this.tree.setSelection(viewStateContext.selection); + } + if (viewState && typeof viewState.scrollTop === "number") { + this.scrollTop = viewState.scrollTop; + } + } + cancelAllRefreshPromises(includeSubTrees = false) { + this.refreshPromises.forEach((promise) => promise.cancel()); + this.refreshPromises.clear(); + if (includeSubTrees) { + this.subTreeRefreshPromises.forEach((promise) => promise.cancel()); + this.subTreeRefreshPromises.clear(); + } + } + async _updateChildren(element = this.root.element, recursive = true, rerender = false, viewStateContext, options2) { + if (typeof this.root.element === "undefined") { + throw new TreeError(this.user, "Tree input not set"); + } + if (this.root.refreshPromise) { + await this.root.refreshPromise; + await Event.toPromise(this._onDidRender.event); + } + const node = this.getDataNode(element); + await this.refreshAndRenderNode(node, recursive, viewStateContext, options2); + if (rerender) { + try { + this.tree.rerender(node); + } catch { + } + } + } + // View + rerender(element) { + if (element === void 0 || element === this.root.element) { + this.tree.rerender(); + return; + } + const node = this.getDataNode(element); + this.tree.rerender(node); + } + // Tree + getNode(element = this.root.element) { + const dataNode = this.getDataNode(element); + const node = this.tree.getNode(dataNode === this.root ? null : dataNode); + return this.nodeMapper.map(node); + } + collapse(element, recursive = false) { + const node = this.getDataNode(element); + return this.tree.collapse(node === this.root ? null : node, recursive); + } + async expand(element, recursive = false) { + if (typeof this.root.element === "undefined") { + throw new TreeError(this.user, "Tree input not set"); + } + if (this.root.refreshPromise) { + await this.root.refreshPromise; + await Event.toPromise(this._onDidRender.event); + } + const node = this.getDataNode(element); + if (this.tree.hasElement(node) && !this.tree.isCollapsible(node)) { + return false; + } + if (node.refreshPromise) { + await node.refreshPromise; + await Event.toPromise(this._onDidRender.event); + } + if (node !== this.root && !node.refreshPromise && !this.tree.isCollapsed(node)) { + return false; + } + const result = this.tree.expand(node === this.root ? null : node, recursive); + if (node.refreshPromise) { + await node.refreshPromise; + await Event.toPromise(this._onDidRender.event); + } + return result; + } + setSelection(elements, browserEvent) { + const nodes = elements.map((e) => this.getDataNode(e)); + this.tree.setSelection(nodes, browserEvent); + } + getSelection() { + const nodes = this.tree.getSelection(); + return nodes.map((n2) => n2.element); + } + setFocus(elements, browserEvent) { + const nodes = elements.map((e) => this.getDataNode(e)); + this.tree.setFocus(nodes, browserEvent); + } + getFocus() { + const nodes = this.tree.getFocus(); + return nodes.map((n2) => n2.element); + } + reveal(element, relativeTop) { + this.tree.reveal(this.getDataNode(element), relativeTop); + } + // Tree navigation + getParentElement(element) { + const node = this.tree.getParentElement(this.getDataNode(element)); + return node && node.element; + } + getFirstElementChild(element = this.root.element) { + const dataNode = this.getDataNode(element); + const node = this.tree.getFirstElementChild(dataNode === this.root ? null : dataNode); + return node && node.element; + } + // Implementation + getDataNode(element) { + const node = this.nodes.get(element === this.root.element ? null : element); + if (!node) { + const nodeIdentity = this.identityProvider?.getId(element).toString(); + throw new TreeError(this.user, `Data tree node not found${nodeIdentity ? `: ${nodeIdentity}` : ""}`); + } + return node; + } + async refreshAndRenderNode(node, recursive, viewStateContext, options2) { + if (this.disposables.isDisposed) { + return; + } + await this.refreshNode(node, recursive, viewStateContext); + if (this.disposables.isDisposed) { + return; + } + this.render(node, viewStateContext, options2); + } + async refreshNode(node, recursive, viewStateContext) { + let result; + this.subTreeRefreshPromises.forEach((refreshPromise, refreshNode) => { + if (!result && intersects(refreshNode, node)) { + result = refreshPromise.then(() => this.refreshNode(node, recursive, viewStateContext)); + } + }); + if (result) { + return result; + } + if (node !== this.root) { + const treeNode = this.tree.getNode(node); + if (treeNode.collapsed) { + node.hasChildren = !!this.dataSource.hasChildren(node.element); + node.stale = true; + this.setChildren(node, [], recursive, viewStateContext); + return; + } + } + return this.doRefreshSubTree(node, recursive, viewStateContext); + } + async doRefreshSubTree(node, recursive, viewStateContext) { + const cancelablePromise = createCancelablePromise(async () => { + const childrenToRefresh = await this.doRefreshNode(node, recursive, viewStateContext); + node.stale = false; + await Promises.settled(childrenToRefresh.map((child) => this.doRefreshSubTree(child, recursive, viewStateContext))); + }); + node.refreshPromise = cancelablePromise; + this.subTreeRefreshPromises.set(node, cancelablePromise); + cancelablePromise.finally(() => { + node.refreshPromise = void 0; + this.subTreeRefreshPromises.delete(node); + }); + return cancelablePromise; + } + async doRefreshNode(node, recursive, viewStateContext) { + node.hasChildren = !!this.dataSource.hasChildren(node.element); + let childrenPromise; + if (!node.hasChildren) { + childrenPromise = Promise.resolve(Iterable.empty()); + } else { + const children = this.doGetChildren(node); + if (isIterable(children)) { + childrenPromise = Promise.resolve(children); + } else { + const slowTimeout = timeout(800); + slowTimeout.then(() => { + node.slow = true; + this._onDidChangeNodeSlowState.fire(node); + }, (_) => null); + childrenPromise = children.finally(() => slowTimeout.cancel()); + } + } + try { + const children = await childrenPromise; + return this.setChildren(node, children, recursive, viewStateContext); + } catch (err) { + if (node !== this.root && this.tree.hasElement(node)) { + this.tree.collapse(node); + } + if (isCancellationError(err)) { + return []; + } + throw err; + } finally { + if (node.slow) { + node.slow = false; + this._onDidChangeNodeSlowState.fire(node); + } + } + } + doGetChildren(node) { + let result = this.refreshPromises.get(node); + if (result) { + return result; + } + const children = this.dataSource.getChildren(node.element); + if (isIterable(children)) { + return this.processChildren(children); + } else { + result = createCancelablePromise(async () => this.processChildren(await children)); + this.refreshPromises.set(node, result); + return result.finally(() => { + this.refreshPromises.delete(node); + }); + } + } + _onDidChangeCollapseState({ node, deep }) { + if (node.element === null) { + return; + } + if (!node.collapsed && node.element.stale) { + if (deep) { + this.collapse(node.element.element); + } else { + this.refreshAndRenderNode(node.element, false).catch(onUnexpectedError); + } + } + } + setChildren(node, childrenElementsIterable, recursive, viewStateContext) { + const childrenElements = [...childrenElementsIterable]; + if (node.children.length === 0 && childrenElements.length === 0) { + return []; + } + const nodesToForget = /* @__PURE__ */ new Map(); + const childrenTreeNodesById = /* @__PURE__ */ new Map(); + for (const child of node.children) { + nodesToForget.set(child.element, child); + if (this.identityProvider) { + childrenTreeNodesById.set(child.id, { node: child, collapsed: this.tree.hasElement(child) && this.tree.isCollapsed(child) }); + } + } + const childrenToRefresh = []; + const children = childrenElements.map((element) => { + const hasChildren = !!this.dataSource.hasChildren(element); + if (!this.identityProvider) { + const asyncDataTreeNode = createAsyncDataTreeNode({ element, parent: node, hasChildren, defaultCollapseState: this.getDefaultCollapseState(element) }); + if (hasChildren && asyncDataTreeNode.defaultCollapseState === ObjectTreeElementCollapseState.PreserveOrExpanded) { + childrenToRefresh.push(asyncDataTreeNode); + } + return asyncDataTreeNode; + } + const id = this.identityProvider.getId(element).toString(); + const result = childrenTreeNodesById.get(id); + if (result) { + const asyncDataTreeNode = result.node; + nodesToForget.delete(asyncDataTreeNode.element); + this.nodes.delete(asyncDataTreeNode.element); + this.nodes.set(element, asyncDataTreeNode); + asyncDataTreeNode.element = element; + asyncDataTreeNode.hasChildren = hasChildren; + if (recursive) { + if (result.collapsed) { + asyncDataTreeNode.children.forEach((node2) => dfs2(node2, (node3) => this.nodes.delete(node3.element))); + asyncDataTreeNode.children.splice(0, asyncDataTreeNode.children.length); + asyncDataTreeNode.stale = true; + } else { + childrenToRefresh.push(asyncDataTreeNode); + } + } else if (hasChildren && !result.collapsed) { + childrenToRefresh.push(asyncDataTreeNode); + } + return asyncDataTreeNode; + } + const childAsyncDataTreeNode = createAsyncDataTreeNode({ element, parent: node, id, hasChildren, defaultCollapseState: this.getDefaultCollapseState(element) }); + if (viewStateContext && viewStateContext.viewState.focus && viewStateContext.viewState.focus.indexOf(id) > -1) { + viewStateContext.focus.push(childAsyncDataTreeNode); + } + if (viewStateContext && viewStateContext.viewState.selection && viewStateContext.viewState.selection.indexOf(id) > -1) { + viewStateContext.selection.push(childAsyncDataTreeNode); + } + if (viewStateContext && viewStateContext.viewState.expanded && viewStateContext.viewState.expanded.indexOf(id) > -1) { + childrenToRefresh.push(childAsyncDataTreeNode); + } else if (hasChildren && childAsyncDataTreeNode.defaultCollapseState === ObjectTreeElementCollapseState.PreserveOrExpanded) { + childrenToRefresh.push(childAsyncDataTreeNode); + } + return childAsyncDataTreeNode; + }); + for (const node2 of nodesToForget.values()) { + dfs2(node2, (node3) => this.nodes.delete(node3.element)); + } + for (const child of children) { + this.nodes.set(child.element, child); + } + splice(node.children, 0, node.children.length, children); + if (node !== this.root && this.autoExpandSingleChildren && children.length === 1 && childrenToRefresh.length === 0) { + children[0].forceExpanded = true; + childrenToRefresh.push(children[0]); + } + return childrenToRefresh; + } + render(node, viewStateContext, options2) { + const children = node.children.map((node2) => this.asTreeElement(node2, viewStateContext)); + const objectTreeOptions = options2 && { + ...options2, + diffIdentityProvider: options2.diffIdentityProvider && { + getId(node2) { + return options2.diffIdentityProvider.getId(node2.element); + } + } + }; + this.tree.setChildren(node === this.root ? null : node, children, objectTreeOptions); + if (node !== this.root) { + this.tree.setCollapsible(node, node.hasChildren); + } + this._onDidRender.fire(); + } + asTreeElement(node, viewStateContext) { + if (node.stale) { + return { + element: node, + collapsible: node.hasChildren, + collapsed: true + }; + } + let collapsed2; + if (viewStateContext && viewStateContext.viewState.expanded && node.id && viewStateContext.viewState.expanded.indexOf(node.id) > -1) { + collapsed2 = false; + } else if (node.forceExpanded) { + collapsed2 = false; + node.forceExpanded = false; + } else { + collapsed2 = node.defaultCollapseState; + } + return { + element: node, + children: node.hasChildren ? Iterable.map(node.children, (child) => this.asTreeElement(child, viewStateContext)) : [], + collapsible: node.hasChildren, + collapsed: collapsed2 + }; + } + processChildren(children) { + if (this.sorter) { + children = [...children].sort(this.sorter.compare.bind(this.sorter)); + } + return children; + } + dispose() { + this.disposables.dispose(); + this.tree.dispose(); + } +}; +var CompressibleAsyncDataTreeNodeWrapper = class _CompressibleAsyncDataTreeNodeWrapper { + get element() { + return { + elements: this.node.element.elements.map((e) => e.element), + incompressible: this.node.element.incompressible + }; + } + get children() { + return this.node.children.map((node) => new _CompressibleAsyncDataTreeNodeWrapper(node)); + } + get depth() { + return this.node.depth; + } + get visibleChildrenCount() { + return this.node.visibleChildrenCount; + } + get visibleChildIndex() { + return this.node.visibleChildIndex; + } + get collapsible() { + return this.node.collapsible; + } + get collapsed() { + return this.node.collapsed; + } + get visible() { + return this.node.visible; + } + get filterData() { + return this.node.filterData; + } + constructor(node) { + this.node = node; + } +}; +var CompressibleAsyncDataTreeRenderer = class { + constructor(renderer, nodeMapper, compressibleNodeMapperProvider, onDidChangeTwistieState) { + this.renderer = renderer; + this.nodeMapper = nodeMapper; + this.compressibleNodeMapperProvider = compressibleNodeMapperProvider; + this.onDidChangeTwistieState = onDidChangeTwistieState; + this.renderedNodes = /* @__PURE__ */ new Map(); + this.disposables = []; + this.templateId = renderer.templateId; + } + renderTemplate(container) { + const templateData = this.renderer.renderTemplate(container); + return { templateData }; + } + renderElement(node, index, templateData, details) { + this.renderer.renderElement(this.nodeMapper.map(node), index, templateData.templateData, details); + } + renderCompressedElements(node, index, templateData, details) { + this.renderer.renderCompressedElements(this.compressibleNodeMapperProvider().map(node), index, templateData.templateData, details); + } + renderTwistie(element, twistieElement) { + if (element.slow) { + twistieElement.classList.add(...ThemeIcon.asClassNameArray(Codicon.treeItemLoading)); + return true; + } else { + twistieElement.classList.remove(...ThemeIcon.asClassNameArray(Codicon.treeItemLoading)); + return false; + } + } + disposeElement(node, index, templateData, details) { + this.renderer.disposeElement?.(this.nodeMapper.map(node), index, templateData.templateData, details); + } + disposeCompressedElements(node, index, templateData, details) { + this.renderer.disposeCompressedElements?.(this.compressibleNodeMapperProvider().map(node), index, templateData.templateData, details); + } + disposeTemplate(templateData) { + this.renderer.disposeTemplate(templateData.templateData); + } + dispose() { + this.renderedNodes.clear(); + this.disposables = dispose(this.disposables); + } +}; +function asCompressibleObjectTreeOptions(options2) { + const objectTreeOptions = options2 && asObjectTreeOptions2(options2); + return objectTreeOptions && { + ...objectTreeOptions, + keyboardNavigationLabelProvider: objectTreeOptions.keyboardNavigationLabelProvider && { + ...objectTreeOptions.keyboardNavigationLabelProvider, + getCompressedNodeKeyboardNavigationLabel(els) { + return options2.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(els.map((e) => e.element)); + } + }, + stickyScrollDelegate: objectTreeOptions.stickyScrollDelegate + }; +} +var CompressibleAsyncDataTree = class extends AsyncDataTree { + constructor(user, container, virtualDelegate, compressionDelegate, renderers, dataSource, options2 = {}) { + super(user, container, virtualDelegate, renderers, dataSource, options2); + this.compressionDelegate = compressionDelegate; + this.compressibleNodeMapper = new WeakMapper((node) => new CompressibleAsyncDataTreeNodeWrapper(node)); + this.filter = options2.filter; + } + createTree(user, container, delegate, renderers, options2) { + const objectTreeDelegate = new ComposedTreeDelegate(delegate); + const objectTreeRenderers = renderers.map((r) => new CompressibleAsyncDataTreeRenderer(r, this.nodeMapper, () => this.compressibleNodeMapper, this._onDidChangeNodeSlowState.event)); + const objectTreeOptions = asCompressibleObjectTreeOptions(options2) || {}; + return new CompressibleObjectTree(user, container, objectTreeDelegate, objectTreeRenderers, objectTreeOptions); + } + asTreeElement(node, viewStateContext) { + return { + incompressible: this.compressionDelegate.isIncompressible(node.element), + ...super.asTreeElement(node, viewStateContext) + }; + } + render(node, viewStateContext, options2) { + if (!this.identityProvider) { + return super.render(node, viewStateContext); + } + const getId = (element) => this.identityProvider.getId(element).toString(); + const getUncompressedIds = (nodes) => { + const result = /* @__PURE__ */ new Set(); + for (const node2 of nodes) { + const compressedNode = this.tree.getCompressedTreeNode(node2 === this.root ? null : node2); + if (!compressedNode.element) { + continue; + } + for (const node3 of compressedNode.element.elements) { + result.add(getId(node3.element)); + } + } + return result; + }; + const oldSelection = getUncompressedIds(this.tree.getSelection()); + const oldFocus = getUncompressedIds(this.tree.getFocus()); + super.render(node, viewStateContext, options2); + const selection = this.getSelection(); + let didChangeSelection = false; + const focus = this.getFocus(); + let didChangeFocus = false; + const visit = (node2) => { + const compressedNode = node2.element; + if (compressedNode) { + for (let i2 = 0; i2 < compressedNode.elements.length; i2++) { + const id = getId(compressedNode.elements[i2].element); + const element = compressedNode.elements[compressedNode.elements.length - 1].element; + if (oldSelection.has(id) && selection.indexOf(element) === -1) { + selection.push(element); + didChangeSelection = true; + } + if (oldFocus.has(id) && focus.indexOf(element) === -1) { + focus.push(element); + didChangeFocus = true; + } + } + } + node2.children.forEach(visit); + }; + visit(this.tree.getCompressedTreeNode(node === this.root ? null : node)); + if (didChangeSelection) { + this.setSelection(selection); + } + if (didChangeFocus) { + this.setFocus(focus); + } + } + // For compressed async data trees, `TreeVisibility.Recurse` doesn't currently work + // and we have to filter everything beforehand + // Related to #85193 and #85835 + processChildren(children) { + if (this.filter) { + children = Iterable.filter(children, (e) => { + const result = this.filter.filter( + e, + 1 + /* TreeVisibility.Visible */ + ); + const visibility = getVisibility(result); + if (visibility === 2) { + throw new Error("Recursive tree visibility not supported in async data compressed trees"); + } + return visibility === 1; + }); + } + return super.processChildren(children); + } +}; +function getVisibility(filterResult) { + if (typeof filterResult === "boolean") { + return filterResult ? 1 : 0; + } else if (isFilterResult(filterResult)) { + return getVisibleState(filterResult.visibility); + } else { + return getVisibleState(filterResult); + } +} + +// node_modules/monaco-editor-core/esm/vs/base/browser/ui/tree/dataTree.js +var DataTree = class extends AbstractTree { + constructor(user, container, delegate, renderers, dataSource, options2 = {}) { + super(user, container, delegate, renderers, options2); + this.user = user; + this.dataSource = dataSource; + this.identityProvider = options2.identityProvider; + } + createModel(user, options2) { + return new ObjectTreeModel(user, options2); + } +}; + +// node_modules/monaco-editor-core/esm/vs/platform/list/browser/listService.js +init_event(); +init_lifecycle(); +init_nls(); +init_configuration(); +init_configurationRegistry(); +init_contextkey(); + +// node_modules/monaco-editor-core/esm/vs/platform/contextkey/common/contextkeys.js +init_platform(); +init_nls(); +init_contextkey(); +var IsMacContext = new RawContextKey("isMac", isMacintosh, localize(1684, "Whether the operating system is macOS")); +var IsLinuxContext = new RawContextKey("isLinux", isLinux, localize(1685, "Whether the operating system is Linux")); +var IsWindowsContext = new RawContextKey("isWindows", isWindows, localize(1686, "Whether the operating system is Windows")); +var IsWebContext = new RawContextKey("isWeb", isWeb, localize(1687, "Whether the platform is a web browser")); +var IsMacNativeContext = new RawContextKey("isMacNative", isMacintosh && !isWeb, localize(1688, "Whether the operating system is macOS on a non-browser platform")); +var IsIOSContext = new RawContextKey("isIOS", isIOS, localize(1689, "Whether the operating system is iOS")); +var IsMobileContext = new RawContextKey("isMobile", isMobile, localize(1690, "Whether the platform is a mobile web browser")); +var IsDevelopmentContext = new RawContextKey("isDevelopment", false, true); +var ProductQualityContext = new RawContextKey("productQualityType", "", localize(1691, "Quality type of VS Code")); +var InputFocusedContextKey = "inputFocus"; +var InputFocusedContext = new RawContextKey(InputFocusedContextKey, false, localize(1692, "Whether keyboard focus is inside an input box")); + +// node_modules/monaco-editor-core/esm/vs/platform/list/browser/listService.js +init_instantiation(); +init_platform2(); +var __decorate71 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param65 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var IListService = createDecorator("listService"); +var ListService = class { + get lastFocusedList() { + return this._lastFocusedWidget; + } + constructor() { + this.disposables = new DisposableStore(); + this.lists = []; + this._lastFocusedWidget = void 0; + } + setLastFocusedList(widget) { + if (widget === this._lastFocusedWidget) { + return; + } + this._lastFocusedWidget?.getHTMLElement().classList.remove("last-focused"); + this._lastFocusedWidget = widget; + this._lastFocusedWidget?.getHTMLElement().classList.add("last-focused"); + } + register(widget, extraContextKeys) { + if (this.lists.some((l) => l.widget === widget)) { + throw new Error("Cannot register the same widget multiple times"); + } + const registeredList = { widget, extraContextKeys }; + this.lists.push(registeredList); + if (isActiveElement(widget.getHTMLElement())) { + this.setLastFocusedList(widget); + } + return combinedDisposable(widget.onDidFocus(() => this.setLastFocusedList(widget)), toDisposable(() => this.lists.splice(this.lists.indexOf(registeredList), 1)), widget.onDidDispose(() => { + this.lists = this.lists.filter((l) => l !== registeredList); + if (this._lastFocusedWidget === widget) { + this.setLastFocusedList(void 0); + } + })); + } + dispose() { + this.disposables.dispose(); + } +}; +var RawWorkbenchListScrollAtBoundaryContextKey = new RawContextKey("listScrollAtBoundary", "none"); +var WorkbenchListScrollAtTopContextKey = ContextKeyExpr.or(RawWorkbenchListScrollAtBoundaryContextKey.isEqualTo("top"), RawWorkbenchListScrollAtBoundaryContextKey.isEqualTo("both")); +var WorkbenchListScrollAtBottomContextKey = ContextKeyExpr.or(RawWorkbenchListScrollAtBoundaryContextKey.isEqualTo("bottom"), RawWorkbenchListScrollAtBoundaryContextKey.isEqualTo("both")); +var RawWorkbenchListFocusContextKey = new RawContextKey("listFocus", true); +var WorkbenchTreeStickyScrollFocused = new RawContextKey("treestickyScrollFocused", false); +var WorkbenchListSupportsMultiSelectContextKey = new RawContextKey("listSupportsMultiselect", true); +var WorkbenchListFocusContextKey = ContextKeyExpr.and(RawWorkbenchListFocusContextKey, ContextKeyExpr.not(InputFocusedContextKey), WorkbenchTreeStickyScrollFocused.negate()); +var WorkbenchListHasSelectionOrFocus = new RawContextKey("listHasSelectionOrFocus", false); +var WorkbenchListDoubleSelection = new RawContextKey("listDoubleSelection", false); +var WorkbenchListMultiSelection = new RawContextKey("listMultiSelection", false); +var WorkbenchListSelectionNavigation = new RawContextKey("listSelectionNavigation", false); +var WorkbenchListSupportsFind = new RawContextKey("listSupportsFind", true); +var WorkbenchTreeElementCanCollapse = new RawContextKey("treeElementCanCollapse", false); +var WorkbenchTreeElementHasParent = new RawContextKey("treeElementHasParent", false); +var WorkbenchTreeElementCanExpand = new RawContextKey("treeElementCanExpand", false); +var WorkbenchTreeElementHasChild = new RawContextKey("treeElementHasChild", false); +var WorkbenchTreeFindOpen = new RawContextKey("treeFindOpen", false); +var WorkbenchListTypeNavigationModeKey = "listTypeNavigationMode"; +var WorkbenchListAutomaticKeyboardNavigationLegacyKey = "listAutomaticKeyboardNavigation"; +function createScopedContextKeyService(contextKeyService, widget) { + const result = contextKeyService.createScoped(widget.getHTMLElement()); + RawWorkbenchListFocusContextKey.bindTo(result); + return result; +} +function createScrollObserver(contextKeyService, widget) { + const listScrollAt = RawWorkbenchListScrollAtBoundaryContextKey.bindTo(contextKeyService); + const update = () => { + const atTop = widget.scrollTop === 0; + const atBottom = widget.scrollHeight - widget.renderHeight - widget.scrollTop < 1; + if (atTop && atBottom) { + listScrollAt.set("both"); + } else if (atTop) { + listScrollAt.set("top"); + } else if (atBottom) { + listScrollAt.set("bottom"); + } else { + listScrollAt.set("none"); + } + }; + update(); + return widget.onDidScroll(update); +} +var multiSelectModifierSettingKey = "workbench.list.multiSelectModifier"; +var openModeSettingKey = "workbench.list.openMode"; +var horizontalScrollingKey = "workbench.list.horizontalScrolling"; +var defaultFindModeSettingKey = "workbench.list.defaultFindMode"; +var typeNavigationModeSettingKey = "workbench.list.typeNavigationMode"; +var keyboardNavigationSettingKey = "workbench.list.keyboardNavigation"; +var scrollByPageKey = "workbench.list.scrollByPage"; +var defaultFindMatchTypeSettingKey = "workbench.list.defaultFindMatchType"; +var treeIndentKey = "workbench.tree.indent"; +var treeRenderIndentGuidesKey = "workbench.tree.renderIndentGuides"; +var listSmoothScrolling = "workbench.list.smoothScrolling"; +var mouseWheelScrollSensitivityKey = "workbench.list.mouseWheelScrollSensitivity"; +var fastScrollSensitivityKey = "workbench.list.fastScrollSensitivity"; +var treeExpandMode = "workbench.tree.expandMode"; +var treeStickyScroll = "workbench.tree.enableStickyScroll"; +var treeStickyScrollMaxElements = "workbench.tree.stickyScrollMaxItemCount"; +function useAltAsMultipleSelectionModifier(configurationService) { + return configurationService.getValue(multiSelectModifierSettingKey) === "alt"; +} +var MultipleSelectionController = class extends Disposable { + constructor(configurationService) { + super(); + this.configurationService = configurationService; + this.useAltAsMultipleSelectionModifier = useAltAsMultipleSelectionModifier(configurationService); + this.registerListeners(); + } + registerListeners() { + this._register(this.configurationService.onDidChangeConfiguration((e) => { + if (e.affectsConfiguration(multiSelectModifierSettingKey)) { + this.useAltAsMultipleSelectionModifier = useAltAsMultipleSelectionModifier(this.configurationService); + } + })); + } + isSelectionSingleChangeEvent(event) { + if (this.useAltAsMultipleSelectionModifier) { + return event.browserEvent.altKey; + } + return isSelectionSingleChangeEvent(event); + } + isSelectionRangeChangeEvent(event) { + return isSelectionRangeChangeEvent(event); + } +}; +function toWorkbenchListOptions(accessor, options2) { + const configurationService = accessor.get(IConfigurationService); + const keybindingService = accessor.get(IKeybindingService); + const disposables = new DisposableStore(); + const result = { + ...options2, + keyboardNavigationDelegate: { mightProducePrintableCharacter(e) { + return keybindingService.mightProducePrintableCharacter(e); + } }, + smoothScrolling: Boolean(configurationService.getValue(listSmoothScrolling)), + mouseWheelScrollSensitivity: configurationService.getValue(mouseWheelScrollSensitivityKey), + fastScrollSensitivity: configurationService.getValue(fastScrollSensitivityKey), + multipleSelectionController: options2.multipleSelectionController ?? disposables.add(new MultipleSelectionController(configurationService)), + keyboardNavigationEventFilter: createKeyboardNavigationEventFilter(keybindingService), + scrollByPage: Boolean(configurationService.getValue(scrollByPageKey)) + }; + return [result, disposables]; +} +var WorkbenchList = class WorkbenchList2 extends List { + constructor(user, container, delegate, renderers, options2, contextKeyService, listService, configurationService, instantiationService) { + const horizontalScrolling = typeof options2.horizontalScrolling !== "undefined" ? options2.horizontalScrolling : Boolean(configurationService.getValue(horizontalScrollingKey)); + const [workbenchListOptions, workbenchListOptionsDisposable] = instantiationService.invokeFunction(toWorkbenchListOptions, options2); + super(user, container, delegate, renderers, { + keyboardSupport: false, + ...workbenchListOptions, + horizontalScrolling + }); + this.disposables.add(workbenchListOptionsDisposable); + this.contextKeyService = createScopedContextKeyService(contextKeyService, this); + this.disposables.add(createScrollObserver(this.contextKeyService, this)); + this.listSupportsMultiSelect = WorkbenchListSupportsMultiSelectContextKey.bindTo(this.contextKeyService); + this.listSupportsMultiSelect.set(options2.multipleSelectionSupport !== false); + const listSelectionNavigation = WorkbenchListSelectionNavigation.bindTo(this.contextKeyService); + listSelectionNavigation.set(Boolean(options2.selectionNavigation)); + this.listHasSelectionOrFocus = WorkbenchListHasSelectionOrFocus.bindTo(this.contextKeyService); + this.listDoubleSelection = WorkbenchListDoubleSelection.bindTo(this.contextKeyService); + this.listMultiSelection = WorkbenchListMultiSelection.bindTo(this.contextKeyService); + this.horizontalScrolling = options2.horizontalScrolling; + this._useAltAsMultipleSelectionModifier = useAltAsMultipleSelectionModifier(configurationService); + this.disposables.add(this.contextKeyService); + this.disposables.add(listService.register(this)); + this.updateStyles(options2.overrideStyles); + this.disposables.add(this.onDidChangeSelection(() => { + const selection = this.getSelection(); + const focus = this.getFocus(); + this.contextKeyService.bufferChangeEvents(() => { + this.listHasSelectionOrFocus.set(selection.length > 0 || focus.length > 0); + this.listMultiSelection.set(selection.length > 1); + this.listDoubleSelection.set(selection.length === 2); + }); + })); + this.disposables.add(this.onDidChangeFocus(() => { + const selection = this.getSelection(); + const focus = this.getFocus(); + this.listHasSelectionOrFocus.set(selection.length > 0 || focus.length > 0); + })); + this.disposables.add(configurationService.onDidChangeConfiguration((e) => { + if (e.affectsConfiguration(multiSelectModifierSettingKey)) { + this._useAltAsMultipleSelectionModifier = useAltAsMultipleSelectionModifier(configurationService); + } + let options3 = {}; + if (e.affectsConfiguration(horizontalScrollingKey) && this.horizontalScrolling === void 0) { + const horizontalScrolling2 = Boolean(configurationService.getValue(horizontalScrollingKey)); + options3 = { ...options3, horizontalScrolling: horizontalScrolling2 }; + } + if (e.affectsConfiguration(scrollByPageKey)) { + const scrollByPage = Boolean(configurationService.getValue(scrollByPageKey)); + options3 = { ...options3, scrollByPage }; + } + if (e.affectsConfiguration(listSmoothScrolling)) { + const smoothScrolling = Boolean(configurationService.getValue(listSmoothScrolling)); + options3 = { ...options3, smoothScrolling }; + } + if (e.affectsConfiguration(mouseWheelScrollSensitivityKey)) { + const mouseWheelScrollSensitivity = configurationService.getValue(mouseWheelScrollSensitivityKey); + options3 = { ...options3, mouseWheelScrollSensitivity }; + } + if (e.affectsConfiguration(fastScrollSensitivityKey)) { + const fastScrollSensitivity = configurationService.getValue(fastScrollSensitivityKey); + options3 = { ...options3, fastScrollSensitivity }; + } + if (Object.keys(options3).length > 0) { + this.updateOptions(options3); + } + })); + this.navigator = new ListResourceNavigator(this, { configurationService, ...options2 }); + this.disposables.add(this.navigator); + } + updateOptions(options2) { + super.updateOptions(options2); + if (options2.overrideStyles !== void 0) { + this.updateStyles(options2.overrideStyles); + } + if (options2.multipleSelectionSupport !== void 0) { + this.listSupportsMultiSelect.set(!!options2.multipleSelectionSupport); + } + } + updateStyles(styles) { + this.style(styles ? getListStyles(styles) : defaultListStyles); + } +}; +WorkbenchList = __decorate71([ + __param65(5, IContextKeyService), + __param65(6, IListService), + __param65(7, IConfigurationService), + __param65(8, IInstantiationService) +], WorkbenchList); +var WorkbenchPagedList = class WorkbenchPagedList2 extends PagedList { + constructor(user, container, delegate, renderers, options2, contextKeyService, listService, configurationService, instantiationService) { + const horizontalScrolling = typeof options2.horizontalScrolling !== "undefined" ? options2.horizontalScrolling : Boolean(configurationService.getValue(horizontalScrollingKey)); + const [workbenchListOptions, workbenchListOptionsDisposable] = instantiationService.invokeFunction(toWorkbenchListOptions, options2); + super(user, container, delegate, renderers, { + keyboardSupport: false, + ...workbenchListOptions, + horizontalScrolling + }); + this.disposables = new DisposableStore(); + this.disposables.add(workbenchListOptionsDisposable); + this.contextKeyService = createScopedContextKeyService(contextKeyService, this); + this.disposables.add(createScrollObserver(this.contextKeyService, this.widget)); + this.horizontalScrolling = options2.horizontalScrolling; + this.listSupportsMultiSelect = WorkbenchListSupportsMultiSelectContextKey.bindTo(this.contextKeyService); + this.listSupportsMultiSelect.set(options2.multipleSelectionSupport !== false); + const listSelectionNavigation = WorkbenchListSelectionNavigation.bindTo(this.contextKeyService); + listSelectionNavigation.set(Boolean(options2.selectionNavigation)); + this._useAltAsMultipleSelectionModifier = useAltAsMultipleSelectionModifier(configurationService); + this.disposables.add(this.contextKeyService); + this.disposables.add(listService.register(this)); + this.updateStyles(options2.overrideStyles); + this.disposables.add(configurationService.onDidChangeConfiguration((e) => { + if (e.affectsConfiguration(multiSelectModifierSettingKey)) { + this._useAltAsMultipleSelectionModifier = useAltAsMultipleSelectionModifier(configurationService); + } + let options3 = {}; + if (e.affectsConfiguration(horizontalScrollingKey) && this.horizontalScrolling === void 0) { + const horizontalScrolling2 = Boolean(configurationService.getValue(horizontalScrollingKey)); + options3 = { ...options3, horizontalScrolling: horizontalScrolling2 }; + } + if (e.affectsConfiguration(scrollByPageKey)) { + const scrollByPage = Boolean(configurationService.getValue(scrollByPageKey)); + options3 = { ...options3, scrollByPage }; + } + if (e.affectsConfiguration(listSmoothScrolling)) { + const smoothScrolling = Boolean(configurationService.getValue(listSmoothScrolling)); + options3 = { ...options3, smoothScrolling }; + } + if (e.affectsConfiguration(mouseWheelScrollSensitivityKey)) { + const mouseWheelScrollSensitivity = configurationService.getValue(mouseWheelScrollSensitivityKey); + options3 = { ...options3, mouseWheelScrollSensitivity }; + } + if (e.affectsConfiguration(fastScrollSensitivityKey)) { + const fastScrollSensitivity = configurationService.getValue(fastScrollSensitivityKey); + options3 = { ...options3, fastScrollSensitivity }; + } + if (Object.keys(options3).length > 0) { + this.updateOptions(options3); + } + })); + this.navigator = new ListResourceNavigator(this, { configurationService, ...options2 }); + this.disposables.add(this.navigator); + } + updateOptions(options2) { + super.updateOptions(options2); + if (options2.overrideStyles !== void 0) { + this.updateStyles(options2.overrideStyles); + } + if (options2.multipleSelectionSupport !== void 0) { + this.listSupportsMultiSelect.set(!!options2.multipleSelectionSupport); + } + } + updateStyles(styles) { + this.style(styles ? getListStyles(styles) : defaultListStyles); + } + dispose() { + this.disposables.dispose(); + super.dispose(); + } +}; +WorkbenchPagedList = __decorate71([ + __param65(5, IContextKeyService), + __param65(6, IListService), + __param65(7, IConfigurationService), + __param65(8, IInstantiationService) +], WorkbenchPagedList); +var WorkbenchTable = class WorkbenchTable2 extends Table { + constructor(user, container, delegate, columns, renderers, options2, contextKeyService, listService, configurationService, instantiationService) { + const horizontalScrolling = typeof options2.horizontalScrolling !== "undefined" ? options2.horizontalScrolling : Boolean(configurationService.getValue(horizontalScrollingKey)); + const [workbenchListOptions, workbenchListOptionsDisposable] = instantiationService.invokeFunction(toWorkbenchListOptions, options2); + super(user, container, delegate, columns, renderers, { + keyboardSupport: false, + ...workbenchListOptions, + horizontalScrolling + }); + this.disposables.add(workbenchListOptionsDisposable); + this.contextKeyService = createScopedContextKeyService(contextKeyService, this); + this.disposables.add(createScrollObserver(this.contextKeyService, this)); + this.listSupportsMultiSelect = WorkbenchListSupportsMultiSelectContextKey.bindTo(this.contextKeyService); + this.listSupportsMultiSelect.set(options2.multipleSelectionSupport !== false); + const listSelectionNavigation = WorkbenchListSelectionNavigation.bindTo(this.contextKeyService); + listSelectionNavigation.set(Boolean(options2.selectionNavigation)); + this.listHasSelectionOrFocus = WorkbenchListHasSelectionOrFocus.bindTo(this.contextKeyService); + this.listDoubleSelection = WorkbenchListDoubleSelection.bindTo(this.contextKeyService); + this.listMultiSelection = WorkbenchListMultiSelection.bindTo(this.contextKeyService); + this.horizontalScrolling = options2.horizontalScrolling; + this._useAltAsMultipleSelectionModifier = useAltAsMultipleSelectionModifier(configurationService); + this.disposables.add(this.contextKeyService); + this.disposables.add(listService.register(this)); + this.updateStyles(options2.overrideStyles); + this.disposables.add(this.onDidChangeSelection(() => { + const selection = this.getSelection(); + const focus = this.getFocus(); + this.contextKeyService.bufferChangeEvents(() => { + this.listHasSelectionOrFocus.set(selection.length > 0 || focus.length > 0); + this.listMultiSelection.set(selection.length > 1); + this.listDoubleSelection.set(selection.length === 2); + }); + })); + this.disposables.add(this.onDidChangeFocus(() => { + const selection = this.getSelection(); + const focus = this.getFocus(); + this.listHasSelectionOrFocus.set(selection.length > 0 || focus.length > 0); + })); + this.disposables.add(configurationService.onDidChangeConfiguration((e) => { + if (e.affectsConfiguration(multiSelectModifierSettingKey)) { + this._useAltAsMultipleSelectionModifier = useAltAsMultipleSelectionModifier(configurationService); + } + let options3 = {}; + if (e.affectsConfiguration(horizontalScrollingKey) && this.horizontalScrolling === void 0) { + const horizontalScrolling2 = Boolean(configurationService.getValue(horizontalScrollingKey)); + options3 = { ...options3, horizontalScrolling: horizontalScrolling2 }; + } + if (e.affectsConfiguration(scrollByPageKey)) { + const scrollByPage = Boolean(configurationService.getValue(scrollByPageKey)); + options3 = { ...options3, scrollByPage }; + } + if (e.affectsConfiguration(listSmoothScrolling)) { + const smoothScrolling = Boolean(configurationService.getValue(listSmoothScrolling)); + options3 = { ...options3, smoothScrolling }; + } + if (e.affectsConfiguration(mouseWheelScrollSensitivityKey)) { + const mouseWheelScrollSensitivity = configurationService.getValue(mouseWheelScrollSensitivityKey); + options3 = { ...options3, mouseWheelScrollSensitivity }; + } + if (e.affectsConfiguration(fastScrollSensitivityKey)) { + const fastScrollSensitivity = configurationService.getValue(fastScrollSensitivityKey); + options3 = { ...options3, fastScrollSensitivity }; + } + if (Object.keys(options3).length > 0) { + this.updateOptions(options3); + } + })); + this.navigator = new TableResourceNavigator(this, { configurationService, ...options2 }); + this.disposables.add(this.navigator); + } + updateOptions(options2) { + super.updateOptions(options2); + if (options2.overrideStyles !== void 0) { + this.updateStyles(options2.overrideStyles); + } + if (options2.multipleSelectionSupport !== void 0) { + this.listSupportsMultiSelect.set(!!options2.multipleSelectionSupport); + } + } + updateStyles(styles) { + this.style(styles ? getListStyles(styles) : defaultListStyles); + } + dispose() { + this.disposables.dispose(); + super.dispose(); + } +}; +WorkbenchTable = __decorate71([ + __param65(6, IContextKeyService), + __param65(7, IListService), + __param65(8, IConfigurationService), + __param65(9, IInstantiationService) +], WorkbenchTable); +var ResourceNavigator = class extends Disposable { + constructor(widget, options2) { + super(); + this.widget = widget; + this._onDidOpen = this._register(new Emitter()); + this.onDidOpen = this._onDidOpen.event; + this._register(Event.filter(this.widget.onDidChangeSelection, (e) => isKeyboardEvent(e.browserEvent))((e) => this.onSelectionFromKeyboard(e))); + this._register(this.widget.onPointer((e) => this.onPointer(e.element, e.browserEvent))); + this._register(this.widget.onMouseDblClick((e) => this.onMouseDblClick(e.element, e.browserEvent))); + if (typeof options2?.openOnSingleClick !== "boolean" && options2?.configurationService) { + this.openOnSingleClick = options2?.configurationService.getValue(openModeSettingKey) !== "doubleClick"; + this._register(options2?.configurationService.onDidChangeConfiguration((e) => { + if (e.affectsConfiguration(openModeSettingKey)) { + this.openOnSingleClick = options2?.configurationService.getValue(openModeSettingKey) !== "doubleClick"; + } + })); + } else { + this.openOnSingleClick = options2?.openOnSingleClick ?? true; + } + } + onSelectionFromKeyboard(event) { + if (event.elements.length !== 1) { + return; + } + const selectionKeyboardEvent = event.browserEvent; + const preserveFocus = typeof selectionKeyboardEvent.preserveFocus === "boolean" ? selectionKeyboardEvent.preserveFocus : true; + const pinned = typeof selectionKeyboardEvent.pinned === "boolean" ? selectionKeyboardEvent.pinned : !preserveFocus; + const sideBySide = false; + this._open(this.getSelectedElement(), preserveFocus, pinned, sideBySide, event.browserEvent); + } + onPointer(element, browserEvent) { + if (!this.openOnSingleClick) { + return; + } + const isDoubleClick = browserEvent.detail === 2; + if (isDoubleClick) { + return; + } + const isMiddleClick = browserEvent.button === 1; + const preserveFocus = true; + const pinned = isMiddleClick; + const sideBySide = browserEvent.ctrlKey || browserEvent.metaKey || browserEvent.altKey; + this._open(element, preserveFocus, pinned, sideBySide, browserEvent); + } + onMouseDblClick(element, browserEvent) { + if (!browserEvent) { + return; + } + const target = browserEvent.target; + const onTwistie = target.classList.contains("monaco-tl-twistie") || target.classList.contains("monaco-icon-label") && target.classList.contains("folder-icon") && browserEvent.offsetX < 16; + if (onTwistie) { + return; + } + const preserveFocus = false; + const pinned = true; + const sideBySide = browserEvent.ctrlKey || browserEvent.metaKey || browserEvent.altKey; + this._open(element, preserveFocus, pinned, sideBySide, browserEvent); + } + _open(element, preserveFocus, pinned, sideBySide, browserEvent) { + if (!element) { + return; + } + this._onDidOpen.fire({ + editorOptions: { + preserveFocus, + pinned, + revealIfVisible: true + }, + sideBySide, + element, + browserEvent + }); + } +}; +var ListResourceNavigator = class extends ResourceNavigator { + constructor(widget, options2) { + super(widget, options2); + this.widget = widget; + } + getSelectedElement() { + return this.widget.getSelectedElements()[0]; + } +}; +var TableResourceNavigator = class extends ResourceNavigator { + constructor(widget, options2) { + super(widget, options2); + } + getSelectedElement() { + return this.widget.getSelectedElements()[0]; + } +}; +var TreeResourceNavigator = class extends ResourceNavigator { + constructor(widget, options2) { + super(widget, options2); + } + getSelectedElement() { + return this.widget.getSelection()[0] ?? void 0; + } +}; +function createKeyboardNavigationEventFilter(keybindingService) { + let inMultiChord = false; + return (event) => { + if (event.toKeyCodeChord().isModifierKey()) { + return false; + } + if (inMultiChord) { + inMultiChord = false; + return false; + } + const result = keybindingService.softDispatch(event, event.target); + if (result.kind === 1) { + inMultiChord = true; + return false; + } + inMultiChord = false; + return result.kind === 0; + }; +} +var WorkbenchObjectTree = class WorkbenchObjectTree2 extends ObjectTree { + get onDidOpen() { + return this.internals.onDidOpen; + } + constructor(user, container, delegate, renderers, options2, instantiationService, contextKeyService, listService, configurationService) { + const { options: treeOptions, getTypeNavigationMode, disposable } = instantiationService.invokeFunction(workbenchTreeDataPreamble, options2); + super(user, container, delegate, renderers, treeOptions); + this.disposables.add(disposable); + this.internals = new WorkbenchTreeInternals(this, options2, getTypeNavigationMode, options2.overrideStyles, contextKeyService, listService, configurationService); + this.disposables.add(this.internals); + } + updateOptions(options2) { + super.updateOptions(options2); + this.internals.updateOptions(options2); + } +}; +WorkbenchObjectTree = __decorate71([ + __param65(5, IInstantiationService), + __param65(6, IContextKeyService), + __param65(7, IListService), + __param65(8, IConfigurationService) +], WorkbenchObjectTree); +var WorkbenchCompressibleObjectTree = class WorkbenchCompressibleObjectTree2 extends CompressibleObjectTree { + constructor(user, container, delegate, renderers, options2, instantiationService, contextKeyService, listService, configurationService) { + const { options: treeOptions, getTypeNavigationMode, disposable } = instantiationService.invokeFunction(workbenchTreeDataPreamble, options2); + super(user, container, delegate, renderers, treeOptions); + this.disposables.add(disposable); + this.internals = new WorkbenchTreeInternals(this, options2, getTypeNavigationMode, options2.overrideStyles, contextKeyService, listService, configurationService); + this.disposables.add(this.internals); + } + updateOptions(options2 = {}) { + super.updateOptions(options2); + if (options2.overrideStyles) { + this.internals.updateStyleOverrides(options2.overrideStyles); + } + this.internals.updateOptions(options2); + } +}; +WorkbenchCompressibleObjectTree = __decorate71([ + __param65(5, IInstantiationService), + __param65(6, IContextKeyService), + __param65(7, IListService), + __param65(8, IConfigurationService) +], WorkbenchCompressibleObjectTree); +var WorkbenchDataTree = class WorkbenchDataTree2 extends DataTree { + constructor(user, container, delegate, renderers, dataSource, options2, instantiationService, contextKeyService, listService, configurationService) { + const { options: treeOptions, getTypeNavigationMode, disposable } = instantiationService.invokeFunction(workbenchTreeDataPreamble, options2); + super(user, container, delegate, renderers, dataSource, treeOptions); + this.disposables.add(disposable); + this.internals = new WorkbenchTreeInternals(this, options2, getTypeNavigationMode, options2.overrideStyles, contextKeyService, listService, configurationService); + this.disposables.add(this.internals); + } + updateOptions(options2 = {}) { + super.updateOptions(options2); + if (options2.overrideStyles !== void 0) { + this.internals.updateStyleOverrides(options2.overrideStyles); + } + this.internals.updateOptions(options2); + } +}; +WorkbenchDataTree = __decorate71([ + __param65(6, IInstantiationService), + __param65(7, IContextKeyService), + __param65(8, IListService), + __param65(9, IConfigurationService) +], WorkbenchDataTree); +var WorkbenchAsyncDataTree = class WorkbenchAsyncDataTree2 extends AsyncDataTree { + get onDidOpen() { + return this.internals.onDidOpen; + } + constructor(user, container, delegate, renderers, dataSource, options2, instantiationService, contextKeyService, listService, configurationService) { + const { options: treeOptions, getTypeNavigationMode, disposable } = instantiationService.invokeFunction(workbenchTreeDataPreamble, options2); + super(user, container, delegate, renderers, dataSource, treeOptions); + this.disposables.add(disposable); + this.internals = new WorkbenchTreeInternals(this, options2, getTypeNavigationMode, options2.overrideStyles, contextKeyService, listService, configurationService); + this.disposables.add(this.internals); + } + updateOptions(options2 = {}) { + super.updateOptions(options2); + if (options2.overrideStyles) { + this.internals.updateStyleOverrides(options2.overrideStyles); + } + this.internals.updateOptions(options2); + } +}; +WorkbenchAsyncDataTree = __decorate71([ + __param65(6, IInstantiationService), + __param65(7, IContextKeyService), + __param65(8, IListService), + __param65(9, IConfigurationService) +], WorkbenchAsyncDataTree); +var WorkbenchCompressibleAsyncDataTree = class WorkbenchCompressibleAsyncDataTree2 extends CompressibleAsyncDataTree { + constructor(user, container, virtualDelegate, compressionDelegate, renderers, dataSource, options2, instantiationService, contextKeyService, listService, configurationService) { + const { options: treeOptions, getTypeNavigationMode, disposable } = instantiationService.invokeFunction(workbenchTreeDataPreamble, options2); + super(user, container, virtualDelegate, compressionDelegate, renderers, dataSource, treeOptions); + this.disposables.add(disposable); + this.internals = new WorkbenchTreeInternals(this, options2, getTypeNavigationMode, options2.overrideStyles, contextKeyService, listService, configurationService); + this.disposables.add(this.internals); + } + updateOptions(options2) { + super.updateOptions(options2); + this.internals.updateOptions(options2); + } +}; +WorkbenchCompressibleAsyncDataTree = __decorate71([ + __param65(7, IInstantiationService), + __param65(8, IContextKeyService), + __param65(9, IListService), + __param65(10, IConfigurationService) +], WorkbenchCompressibleAsyncDataTree); +function getDefaultTreeFindMode(configurationService) { + const value = configurationService.getValue(defaultFindModeSettingKey); + if (value === "highlight") { + return TreeFindMode.Highlight; + } else if (value === "filter") { + return TreeFindMode.Filter; + } + const deprecatedValue = configurationService.getValue(keyboardNavigationSettingKey); + if (deprecatedValue === "simple" || deprecatedValue === "highlight") { + return TreeFindMode.Highlight; + } else if (deprecatedValue === "filter") { + return TreeFindMode.Filter; + } + return void 0; +} +function getDefaultTreeFindMatchType(configurationService) { + const value = configurationService.getValue(defaultFindMatchTypeSettingKey); + if (value === "fuzzy") { + return TreeFindMatchType.Fuzzy; + } else if (value === "contiguous") { + return TreeFindMatchType.Contiguous; + } + return void 0; +} +function workbenchTreeDataPreamble(accessor, options2) { + const configurationService = accessor.get(IConfigurationService); + const contextViewService = accessor.get(IContextViewService); + const contextKeyService = accessor.get(IContextKeyService); + const instantiationService = accessor.get(IInstantiationService); + const getTypeNavigationMode = () => { + const modeString = contextKeyService.getContextKeyValue(WorkbenchListTypeNavigationModeKey); + if (modeString === "automatic") { + return TypeNavigationMode.Automatic; + } else if (modeString === "trigger") { + return TypeNavigationMode.Trigger; + } + const modeBoolean = contextKeyService.getContextKeyValue(WorkbenchListAutomaticKeyboardNavigationLegacyKey); + if (modeBoolean === false) { + return TypeNavigationMode.Trigger; + } + const configString = configurationService.getValue(typeNavigationModeSettingKey); + if (configString === "automatic") { + return TypeNavigationMode.Automatic; + } else if (configString === "trigger") { + return TypeNavigationMode.Trigger; + } + return void 0; + }; + const horizontalScrolling = options2.horizontalScrolling !== void 0 ? options2.horizontalScrolling : Boolean(configurationService.getValue(horizontalScrollingKey)); + const [workbenchListOptions, disposable] = instantiationService.invokeFunction(toWorkbenchListOptions, options2); + const paddingBottom = options2.paddingBottom; + const renderIndentGuides = options2.renderIndentGuides !== void 0 ? options2.renderIndentGuides : configurationService.getValue(treeRenderIndentGuidesKey); + return { + getTypeNavigationMode, + disposable, + // eslint-disable-next-line local/code-no-dangerous-type-assertions + options: { + // ...options, // TODO@Joao why is this not splatted here? + keyboardSupport: false, + ...workbenchListOptions, + indent: typeof configurationService.getValue(treeIndentKey) === "number" ? configurationService.getValue(treeIndentKey) : void 0, + renderIndentGuides, + smoothScrolling: Boolean(configurationService.getValue(listSmoothScrolling)), + defaultFindMode: options2.defaultFindMode ?? getDefaultTreeFindMode(configurationService), + defaultFindMatchType: options2.defaultFindMatchType ?? getDefaultTreeFindMatchType(configurationService), + horizontalScrolling, + scrollByPage: Boolean(configurationService.getValue(scrollByPageKey)), + paddingBottom, + hideTwistiesOfChildlessElements: options2.hideTwistiesOfChildlessElements, + expandOnlyOnTwistieClick: options2.expandOnlyOnTwistieClick ?? configurationService.getValue(treeExpandMode) === "doubleClick", + contextViewProvider: contextViewService, + findWidgetStyles: defaultFindWidgetStyles, + enableStickyScroll: Boolean(configurationService.getValue(treeStickyScroll)), + stickyScrollMaxItemCount: Number(configurationService.getValue(treeStickyScrollMaxElements)) + } + }; +} +var WorkbenchTreeInternals = class WorkbenchTreeInternals2 { + get onDidOpen() { + return this.navigator.onDidOpen; + } + constructor(tree, options2, getTypeNavigationMode, overrideStyles2, contextKeyService, listService, configurationService) { + this.tree = tree; + this.disposables = []; + this.contextKeyService = createScopedContextKeyService(contextKeyService, tree); + this.disposables.push(createScrollObserver(this.contextKeyService, tree)); + this.listSupportsMultiSelect = WorkbenchListSupportsMultiSelectContextKey.bindTo(this.contextKeyService); + this.listSupportsMultiSelect.set(options2.multipleSelectionSupport !== false); + const listSelectionNavigation = WorkbenchListSelectionNavigation.bindTo(this.contextKeyService); + listSelectionNavigation.set(Boolean(options2.selectionNavigation)); + this.listSupportFindWidget = WorkbenchListSupportsFind.bindTo(this.contextKeyService); + this.listSupportFindWidget.set(options2.findWidgetEnabled ?? true); + this.hasSelectionOrFocus = WorkbenchListHasSelectionOrFocus.bindTo(this.contextKeyService); + this.hasDoubleSelection = WorkbenchListDoubleSelection.bindTo(this.contextKeyService); + this.hasMultiSelection = WorkbenchListMultiSelection.bindTo(this.contextKeyService); + this.treeElementCanCollapse = WorkbenchTreeElementCanCollapse.bindTo(this.contextKeyService); + this.treeElementHasParent = WorkbenchTreeElementHasParent.bindTo(this.contextKeyService); + this.treeElementCanExpand = WorkbenchTreeElementCanExpand.bindTo(this.contextKeyService); + this.treeElementHasChild = WorkbenchTreeElementHasChild.bindTo(this.contextKeyService); + this.treeFindOpen = WorkbenchTreeFindOpen.bindTo(this.contextKeyService); + this.treeStickyScrollFocused = WorkbenchTreeStickyScrollFocused.bindTo(this.contextKeyService); + this._useAltAsMultipleSelectionModifier = useAltAsMultipleSelectionModifier(configurationService); + this.updateStyleOverrides(overrideStyles2); + const updateCollapseContextKeys = () => { + const focus = tree.getFocus()[0]; + if (!focus) { + return; + } + const node = tree.getNode(focus); + this.treeElementCanCollapse.set(node.collapsible && !node.collapsed); + this.treeElementHasParent.set(!!tree.getParentElement(focus)); + this.treeElementCanExpand.set(node.collapsible && node.collapsed); + this.treeElementHasChild.set(!!tree.getFirstElementChild(focus)); + }; + const interestingContextKeys = /* @__PURE__ */ new Set(); + interestingContextKeys.add(WorkbenchListTypeNavigationModeKey); + interestingContextKeys.add(WorkbenchListAutomaticKeyboardNavigationLegacyKey); + this.disposables.push(this.contextKeyService, listService.register(tree), tree.onDidChangeSelection(() => { + const selection = tree.getSelection(); + const focus = tree.getFocus(); + this.contextKeyService.bufferChangeEvents(() => { + this.hasSelectionOrFocus.set(selection.length > 0 || focus.length > 0); + this.hasMultiSelection.set(selection.length > 1); + this.hasDoubleSelection.set(selection.length === 2); + }); + }), tree.onDidChangeFocus(() => { + const selection = tree.getSelection(); + const focus = tree.getFocus(); + this.hasSelectionOrFocus.set(selection.length > 0 || focus.length > 0); + updateCollapseContextKeys(); + }), tree.onDidChangeCollapseState(updateCollapseContextKeys), tree.onDidChangeModel(updateCollapseContextKeys), tree.onDidChangeFindOpenState((enabled) => this.treeFindOpen.set(enabled)), tree.onDidChangeStickyScrollFocused((focused) => this.treeStickyScrollFocused.set(focused)), configurationService.onDidChangeConfiguration((e) => { + let newOptions = {}; + if (e.affectsConfiguration(multiSelectModifierSettingKey)) { + this._useAltAsMultipleSelectionModifier = useAltAsMultipleSelectionModifier(configurationService); + } + if (e.affectsConfiguration(treeIndentKey)) { + const indent = configurationService.getValue(treeIndentKey); + newOptions = { ...newOptions, indent }; + } + if (e.affectsConfiguration(treeRenderIndentGuidesKey) && options2.renderIndentGuides === void 0) { + const renderIndentGuides = configurationService.getValue(treeRenderIndentGuidesKey); + newOptions = { ...newOptions, renderIndentGuides }; + } + if (e.affectsConfiguration(listSmoothScrolling)) { + const smoothScrolling = Boolean(configurationService.getValue(listSmoothScrolling)); + newOptions = { ...newOptions, smoothScrolling }; + } + if (e.affectsConfiguration(defaultFindModeSettingKey) || e.affectsConfiguration(keyboardNavigationSettingKey)) { + const defaultFindMode = getDefaultTreeFindMode(configurationService); + newOptions = { ...newOptions, defaultFindMode }; + } + if (e.affectsConfiguration(typeNavigationModeSettingKey) || e.affectsConfiguration(keyboardNavigationSettingKey)) { + const typeNavigationMode = getTypeNavigationMode(); + newOptions = { ...newOptions, typeNavigationMode }; + } + if (e.affectsConfiguration(defaultFindMatchTypeSettingKey)) { + const defaultFindMatchType = getDefaultTreeFindMatchType(configurationService); + newOptions = { ...newOptions, defaultFindMatchType }; + } + if (e.affectsConfiguration(horizontalScrollingKey) && options2.horizontalScrolling === void 0) { + const horizontalScrolling = Boolean(configurationService.getValue(horizontalScrollingKey)); + newOptions = { ...newOptions, horizontalScrolling }; + } + if (e.affectsConfiguration(scrollByPageKey)) { + const scrollByPage = Boolean(configurationService.getValue(scrollByPageKey)); + newOptions = { ...newOptions, scrollByPage }; + } + if (e.affectsConfiguration(treeExpandMode) && options2.expandOnlyOnTwistieClick === void 0) { + newOptions = { ...newOptions, expandOnlyOnTwistieClick: configurationService.getValue(treeExpandMode) === "doubleClick" }; + } + if (e.affectsConfiguration(treeStickyScroll)) { + const enableStickyScroll = configurationService.getValue(treeStickyScroll); + newOptions = { ...newOptions, enableStickyScroll }; + } + if (e.affectsConfiguration(treeStickyScrollMaxElements)) { + const stickyScrollMaxItemCount = Math.max(1, configurationService.getValue(treeStickyScrollMaxElements)); + newOptions = { ...newOptions, stickyScrollMaxItemCount }; + } + if (e.affectsConfiguration(mouseWheelScrollSensitivityKey)) { + const mouseWheelScrollSensitivity = configurationService.getValue(mouseWheelScrollSensitivityKey); + newOptions = { ...newOptions, mouseWheelScrollSensitivity }; + } + if (e.affectsConfiguration(fastScrollSensitivityKey)) { + const fastScrollSensitivity = configurationService.getValue(fastScrollSensitivityKey); + newOptions = { ...newOptions, fastScrollSensitivity }; + } + if (Object.keys(newOptions).length > 0) { + tree.updateOptions(newOptions); + } + }), this.contextKeyService.onDidChangeContext((e) => { + if (e.affectsSome(interestingContextKeys)) { + tree.updateOptions({ typeNavigationMode: getTypeNavigationMode() }); + } + })); + this.navigator = new TreeResourceNavigator(tree, { configurationService, ...options2 }); + this.disposables.push(this.navigator); + } + updateOptions(options2) { + if (options2.multipleSelectionSupport !== void 0) { + this.listSupportsMultiSelect.set(!!options2.multipleSelectionSupport); + } + } + updateStyleOverrides(overrideStyles2) { + this.tree.style(overrideStyles2 ? getListStyles(overrideStyles2) : defaultListStyles); + } + dispose() { + this.disposables = dispose(this.disposables); + } +}; +WorkbenchTreeInternals = __decorate71([ + __param65(4, IContextKeyService), + __param65(5, IListService), + __param65(6, IConfigurationService) +], WorkbenchTreeInternals); +var configurationRegistry3 = Registry.as(Extensions4.Configuration); +configurationRegistry3.registerConfiguration({ + id: "workbench", + order: 7, + title: localize(1705, "Workbench"), + type: "object", + properties: { + [multiSelectModifierSettingKey]: { + type: "string", + enum: ["ctrlCmd", "alt"], + markdownEnumDescriptions: [ + localize(1706, "Maps to `Control` on Windows and Linux and to `Command` on macOS."), + localize(1707, "Maps to `Alt` on Windows and Linux and to `Option` on macOS.") + ], + default: "ctrlCmd", + description: localize(1708, "The modifier to be used to add an item in trees and lists to a multi-selection with the mouse (for example in the explorer, open editors and scm view). The 'Open to Side' mouse gestures - if supported - will adapt such that they do not conflict with the multiselect modifier.") + }, + [openModeSettingKey]: { + type: "string", + enum: ["singleClick", "doubleClick"], + default: "singleClick", + description: localize(1709, "Controls how to open items in trees and lists using the mouse (if supported). Note that some trees and lists might choose to ignore this setting if it is not applicable.") + }, + [horizontalScrollingKey]: { + type: "boolean", + default: false, + description: localize(1710, "Controls whether lists and trees support horizontal scrolling in the workbench. Warning: turning on this setting has a performance implication.") + }, + [scrollByPageKey]: { + type: "boolean", + default: false, + description: localize(1711, "Controls whether clicks in the scrollbar scroll page by page.") + }, + [treeIndentKey]: { + type: "number", + default: 8, + minimum: 4, + maximum: 40, + description: localize(1712, "Controls tree indentation in pixels.") + }, + [treeRenderIndentGuidesKey]: { + type: "string", + enum: ["none", "onHover", "always"], + default: "onHover", + description: localize(1713, "Controls whether the tree should render indent guides.") + }, + [listSmoothScrolling]: { + type: "boolean", + default: false, + description: localize(1714, "Controls whether lists and trees have smooth scrolling.") + }, + [mouseWheelScrollSensitivityKey]: { + type: "number", + default: 1, + markdownDescription: localize(1715, "A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.") + }, + [fastScrollSensitivityKey]: { + type: "number", + default: 5, + markdownDescription: localize(1716, "Scrolling speed multiplier when pressing `Alt`.") + }, + [defaultFindModeSettingKey]: { + type: "string", + enum: ["highlight", "filter"], + enumDescriptions: [ + localize(1717, "Highlight elements when searching. Further up and down navigation will traverse only the highlighted elements."), + localize(1718, "Filter elements when searching.") + ], + default: "highlight", + description: localize(1719, "Controls the default find mode for lists and trees in the workbench.") + }, + [keyboardNavigationSettingKey]: { + type: "string", + enum: ["simple", "highlight", "filter"], + enumDescriptions: [ + localize(1720, "Simple keyboard navigation focuses elements which match the keyboard input. Matching is done only on prefixes."), + localize(1721, "Highlight keyboard navigation highlights elements which match the keyboard input. Further up and down navigation will traverse only the highlighted elements."), + localize(1722, "Filter keyboard navigation will filter out and hide all the elements which do not match the keyboard input.") + ], + default: "highlight", + description: localize(1723, "Controls the keyboard navigation style for lists and trees in the workbench. Can be simple, highlight and filter."), + deprecated: true, + deprecationMessage: localize(1724, "Please use 'workbench.list.defaultFindMode' and 'workbench.list.typeNavigationMode' instead.") + }, + [defaultFindMatchTypeSettingKey]: { + type: "string", + enum: ["fuzzy", "contiguous"], + enumDescriptions: [ + localize(1725, "Use fuzzy matching when searching."), + localize(1726, "Use contiguous matching when searching.") + ], + default: "fuzzy", + description: localize(1727, "Controls the type of matching used when searching lists and trees in the workbench.") + }, + [treeExpandMode]: { + type: "string", + enum: ["singleClick", "doubleClick"], + default: "singleClick", + description: localize(1728, "Controls how tree folders are expanded when clicking the folder names. Note that some trees and lists might choose to ignore this setting if it is not applicable.") + }, + [treeStickyScroll]: { + type: "boolean", + default: true, + description: localize(1729, "Controls whether sticky scrolling is enabled in trees.") + }, + [treeStickyScrollMaxElements]: { + type: "number", + minimum: 1, + default: 7, + markdownDescription: localize(1730, "Controls the number of sticky elements displayed in the tree when {0} is enabled.", "`#workbench.tree.enableStickyScroll#`") + }, + [typeNavigationModeSettingKey]: { + type: "string", + enum: ["automatic", "trigger"], + default: "automatic", + markdownDescription: localize(1731, "Controls how type navigation works in lists and trees in the workbench. When set to `trigger`, type navigation begins once the `list.triggerTypeNavigation` command is run.") + } + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/gotoSymbol/browser/referencesModel.js +init_errors(); +init_event(); +init_lifecycle(); +init_map(); +init_resources(); +init_strings(); +init_range(); +init_nls(); +var OneReference = class { + constructor(isProviderFirst, parent, link2, _rangeCallback) { + this.isProviderFirst = isProviderFirst; + this.parent = parent; + this.link = link2; + this._rangeCallback = _rangeCallback; + this.id = defaultGenerator.nextId(); + } + get uri() { + return this.link.uri; + } + get range() { + return this._range ?? this.link.targetSelectionRange ?? this.link.range; + } + set range(value) { + this._range = value; + this._rangeCallback(this); + } + get ariaMessage() { + const preview = this.parent.getPreview(this)?.preview(this.range); + if (!preview) { + return localize(1087, "in {0} on line {1} at column {2}", basename2(this.uri), this.range.startLineNumber, this.range.startColumn); + } else { + return localize(1088, "{0} in {1} on line {2} at column {3}", preview.value, basename2(this.uri), this.range.startLineNumber, this.range.startColumn); + } + } +}; +var FilePreview = class { + constructor(_modelReference) { + this._modelReference = _modelReference; + } + dispose() { + this._modelReference.dispose(); + } + preview(range2, n2 = 8) { + const model = this._modelReference.object.textEditorModel; + if (!model) { + return void 0; + } + const { startLineNumber, startColumn, endLineNumber, endColumn } = range2; + const word = model.getWordUntilPosition({ lineNumber: startLineNumber, column: startColumn - n2 }); + const beforeRange = new Range(startLineNumber, word.startColumn, startLineNumber, startColumn); + const afterRange = new Range( + endLineNumber, + endColumn, + endLineNumber, + 1073741824 + /* Constants.MAX_SAFE_SMALL_INTEGER */ + ); + const before = model.getValueInRange(beforeRange).replace(/^\s+/, ""); + const inside = model.getValueInRange(range2); + const after2 = model.getValueInRange(afterRange).replace(/\s+$/, ""); + return { + value: before + inside + after2, + highlight: { start: before.length, end: before.length + inside.length } + }; + } +}; +var FileReferences = class { + constructor(parent, uri) { + this.parent = parent; + this.uri = uri; + this.children = []; + this._previews = new ResourceMap(); + } + dispose() { + dispose(this._previews.values()); + this._previews.clear(); + } + getPreview(child) { + return this._previews.get(child.uri); + } + get ariaMessage() { + const len = this.children.length; + if (len === 1) { + return localize(1089, "1 symbol in {0}, full path {1}", basename2(this.uri), this.uri.fsPath); + } else { + return localize(1090, "{0} symbols in {1}, full path {2}", len, basename2(this.uri), this.uri.fsPath); + } + } + async resolve(textModelResolverService) { + if (this._previews.size !== 0) { + return this; + } + for (const child of this.children) { + if (this._previews.has(child.uri)) { + continue; + } + try { + const ref = await textModelResolverService.createModelReference(child.uri); + this._previews.set(child.uri, new FilePreview(ref)); + } catch (err) { + onUnexpectedError(err); + } + } + return this; + } +}; +var ReferencesModel = class _ReferencesModel { + constructor(links, title) { + this.groups = []; + this.references = []; + this._onDidChangeReferenceRange = new Emitter(); + this.onDidChangeReferenceRange = this._onDidChangeReferenceRange.event; + this._links = links; + this._title = title; + const [providersFirst] = links; + links.sort(_ReferencesModel._compareReferences); + let current; + for (const link2 of links) { + if (!current || !extUri.isEqual(current.uri, link2.uri, true)) { + current = new FileReferences(this, link2.uri); + this.groups.push(current); + } + if (current.children.length === 0 || _ReferencesModel._compareReferences(link2, current.children[current.children.length - 1]) !== 0) { + const oneRef = new OneReference(providersFirst === link2, current, link2, (ref) => this._onDidChangeReferenceRange.fire(ref)); + this.references.push(oneRef); + current.children.push(oneRef); + } + } + } + dispose() { + dispose(this.groups); + this._onDidChangeReferenceRange.dispose(); + this.groups.length = 0; + } + clone() { + return new _ReferencesModel(this._links, this._title); + } + get title() { + return this._title; + } + get isEmpty() { + return this.groups.length === 0; + } + get ariaMessage() { + if (this.isEmpty) { + return localize(1091, "No results found"); + } else if (this.references.length === 1) { + return localize(1092, "Found 1 symbol in {0}", this.references[0].uri.fsPath); + } else if (this.groups.length === 1) { + return localize(1093, "Found {0} symbols in {1}", this.references.length, this.groups[0].uri.fsPath); + } else { + return localize(1094, "Found {0} symbols in {1} files", this.references.length, this.groups.length); + } + } + nextOrPreviousReference(reference, next) { + const { parent } = reference; + let idx = parent.children.indexOf(reference); + const childCount = parent.children.length; + const groupCount = parent.parent.groups.length; + if (groupCount === 1 || next && idx + 1 < childCount || !next && idx > 0) { + if (next) { + idx = (idx + 1) % childCount; + } else { + idx = (idx + childCount - 1) % childCount; + } + return parent.children[idx]; + } + idx = parent.parent.groups.indexOf(parent); + if (next) { + idx = (idx + 1) % groupCount; + return parent.parent.groups[idx].children[0]; + } else { + idx = (idx + groupCount - 1) % groupCount; + return parent.parent.groups[idx].children[parent.parent.groups[idx].children.length - 1]; + } + } + nearestReference(resource, position) { + const nearest = this.references.map((ref, idx) => { + return { + idx, + prefixLen: commonPrefixLength(ref.uri.toString(), resource.toString()), + offsetDist: Math.abs(ref.range.startLineNumber - position.lineNumber) * 100 + Math.abs(ref.range.startColumn - position.column) + }; + }).sort((a, b) => { + if (a.prefixLen > b.prefixLen) { + return -1; + } else if (a.prefixLen < b.prefixLen) { + return 1; + } else if (a.offsetDist < b.offsetDist) { + return -1; + } else if (a.offsetDist > b.offsetDist) { + return 1; + } else { + return 0; + } + })[0]; + if (nearest) { + return this.references[nearest.idx]; + } + return void 0; + } + referenceAt(resource, position) { + for (const ref of this.references) { + if (ref.uri.toString() === resource.toString()) { + if (Range.containsPosition(ref.range, position)) { + return ref; + } + } + } + return void 0; + } + firstReference() { + for (const ref of this.references) { + if (ref.isProviderFirst) { + return ref; + } + } + return this.references[0]; + } + static _compareReferences(a, b) { + return extUri.compare(a.uri, b.uri) || Range.compareRangesUsingStarts(a.range, b.range); + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesWidget.js +init_dom(); +init_color(); +init_event(); +init_lifecycle(); +init_network(); +init_resources(); +init_range(); +init_textModel(); +init_modesRegistry(); +init_resolverService(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesTree.js +init_dom(); + +// node_modules/monaco-editor-core/esm/vs/base/browser/ui/countBadge/countBadge.js +init_dom(); +init_strings(); +init_lifecycle(); +var CountBadge = class extends Disposable { + constructor(container, options2, styles) { + super(); + this.options = options2; + this.styles = styles; + this.count = 0; + this.hover = this._register(new MutableDisposable()); + this.element = append(container, $(".monaco-count-badge")); + this._register(toDisposable(() => container.removeChild(this.element))); + this.countFormat = this.options.countFormat || "{0}"; + this.titleFormat = this.options.titleFormat || ""; + this.setCount(this.options.count || 0); + this.updateHover(); + } + setCount(count) { + this.count = count; + this.render(); + } + setTitleFormat(titleFormat) { + this.titleFormat = titleFormat; + this.updateHover(); + this.render(); + } + updateHover() { + if (this.titleFormat !== "" && !this.hover.value) { + this.hover.value = getBaseLayerHoverDelegate().setupDelayedHoverAtMouse(this.element, () => ({ content: format(this.titleFormat, this.count), appearance: { compact: true } })); + } else if (this.titleFormat === "" && this.hover.value) { + this.hover.value = void 0; + } + } + render() { + this.element.textContent = format(this.countFormat, this.count); + this.element.style.backgroundColor = this.styles.badgeBackground ?? ""; + this.element.style.color = this.styles.badgeForeground ?? ""; + if (this.styles.badgeBorder) { + this.element.style.border = `1px solid ${this.styles.badgeBorder}`; + } + } +}; + +// node_modules/monaco-editor-core/esm/vs/base/browser/ui/highlightedlabel/highlightedLabel.js +init_dom(); +init_iconLabels2(); +init_lifecycle(); +init_objects(); +var HighlightedLabel = class _HighlightedLabel extends Disposable { + /** + * Create a new {@link HighlightedLabel}. + * + * @param container The parent container to append to. + */ + constructor(container, options2) { + super(); + this.options = options2; + this.text = ""; + this.title = ""; + this.highlights = []; + this.didEverRender = false; + this.domNode = append(container, $("span.monaco-highlighted-label")); + } + /** + * The label's DOM node. + */ + get element() { + return this.domNode; + } + /** + * Set the label and highlights. + * + * @param text The label to display. + * @param highlights The ranges to highlight. + * @param title An optional title for the hover tooltip. + * @param escapeNewLines Whether to escape new lines. + * @returns + */ + set(text2, highlights = [], title = "", escapeNewLines, supportIcons) { + if (!text2) { + text2 = ""; + } + if (escapeNewLines) { + text2 = _HighlightedLabel.escapeNewLines(text2, highlights); + } + if (this.didEverRender && this.text === text2 && this.title === title && equals2(this.highlights, highlights)) { + return; + } + this.text = text2; + this.title = title; + this.highlights = highlights; + this.render(supportIcons); + } + render(supportIcons) { + const children = []; + let pos = 0; + for (const highlight of this.highlights) { + if (highlight.end === highlight.start) { + continue; + } + if (pos < highlight.start) { + const substring2 = this.text.substring(pos, highlight.start); + if (supportIcons) { + children.push(...renderLabelWithIcons(substring2)); + } else { + children.push(substring2); + } + pos = highlight.start; + } + const substring = this.text.substring(pos, highlight.end); + const element = $("span.highlight", void 0, ...supportIcons ? renderLabelWithIcons(substring) : [substring]); + if (highlight.extraClasses) { + element.classList.add(...highlight.extraClasses); + } + children.push(element); + pos = highlight.end; + } + if (pos < this.text.length) { + const substring = this.text.substring(pos); + if (supportIcons) { + children.push(...renderLabelWithIcons(substring)); + } else { + children.push(substring); + } + } + reset(this.domNode, ...children); + if (!this.customHover && this.title !== "") { + const hoverDelegate = this.options?.hoverDelegate ?? getDefaultHoverDelegate("mouse"); + this.customHover = this._register(getBaseLayerHoverDelegate().setupManagedHover(hoverDelegate, this.domNode, this.title)); + } else if (this.customHover) { + this.customHover.update(this.title); + } + this.didEverRender = true; + } + static escapeNewLines(text2, highlights) { + let total = 0; + let extra = 0; + return text2.replace(/\r\n|\r|\n/g, (match2, offset) => { + extra = match2 === "\r\n" ? -1 : 0; + offset += total; + for (const highlight of highlights) { + if (highlight.end <= offset) { + continue; + } + if (highlight.start >= offset) { + highlight.start += extra; + } + if (highlight.end >= offset) { + highlight.end += extra; + } + } + total += extra; + return "\u23CE"; + }); + } +}; + +// node_modules/monaco-editor-core/esm/vs/base/browser/ui/iconLabel/iconLabel.js +init_dom(); +init_lifecycle(); +init_objects(); +init_themables(); +var FastLabelNode = class { + constructor(_element) { + this._element = _element; + } + get element() { + return this._element; + } + set textContent(content) { + if (this.disposed || content === this._textContent) { + return; + } + this._textContent = content; + this._element.textContent = content; + } + set classNames(classNames2) { + if (this.disposed || equals2(classNames2, this._classNames)) { + return; + } + this._classNames = classNames2; + this._element.classList.value = ""; + this._element.classList.add(...classNames2); + } + set empty(empty2) { + if (this.disposed || empty2 === this._empty) { + return; + } + this._empty = empty2; + this._element.style.marginLeft = empty2 ? "0" : ""; + } + dispose() { + this.disposed = true; + } +}; +var IconLabel = class extends Disposable { + constructor(container, options2) { + super(); + this.customHovers = /* @__PURE__ */ new Map(); + this.creationOptions = options2; + this.domNode = this._register(new FastLabelNode(append(container, $(".monaco-icon-label")))); + this.labelContainer = append(this.domNode.element, $(".monaco-icon-label-container")); + this.nameContainer = append(this.labelContainer, $("span.monaco-icon-name-container")); + if (options2?.supportHighlights || options2?.supportIcons) { + this.nameNode = this._register(new LabelWithHighlights(this.nameContainer, !!options2.supportIcons)); + } else { + this.nameNode = new Label(this.nameContainer); + } + this.hoverDelegate = options2?.hoverDelegate ?? getDefaultHoverDelegate("mouse"); + } + get element() { + return this.domNode.element; + } + setLabel(label, description, options2) { + const labelClasses = ["monaco-icon-label"]; + const containerClasses = ["monaco-icon-label-container"]; + let ariaLabel = ""; + if (options2) { + if (options2.extraClasses) { + labelClasses.push(...options2.extraClasses); + } + if (options2.bold) { + labelClasses.push("bold"); + } + if (options2.italic) { + labelClasses.push("italic"); + } + if (options2.strikethrough) { + labelClasses.push("strikethrough"); + } + if (options2.disabledCommand) { + containerClasses.push("disabled"); + } + if (options2.title) { + if (typeof options2.title === "string") { + ariaLabel += options2.title; + } else { + ariaLabel += label; + } + } + } + const existingIconNode = this.domNode.element.querySelector(".monaco-icon-label-iconpath"); + if (options2?.iconPath) { + let iconNode; + if (!existingIconNode || !isHTMLElement(existingIconNode)) { + iconNode = $(".monaco-icon-label-iconpath"); + this.domNode.element.prepend(iconNode); + } else { + iconNode = existingIconNode; + } + if (ThemeIcon.isThemeIcon(options2.iconPath)) { + const iconClass = ThemeIcon.asClassName(options2.iconPath); + iconNode.className = `monaco-icon-label-iconpath ${iconClass}`; + iconNode.style.backgroundImage = ""; + } else { + iconNode.style.backgroundImage = asCSSUrl(options2?.iconPath); + } + iconNode.style.backgroundRepeat = "no-repeat"; + iconNode.style.backgroundPosition = "center"; + iconNode.style.backgroundSize = "contain"; + } else if (existingIconNode) { + existingIconNode.remove(); + } + this.domNode.classNames = labelClasses; + this.domNode.element.setAttribute("aria-label", ariaLabel); + this.labelContainer.classList.value = ""; + this.labelContainer.classList.add(...containerClasses); + this.setupHover(options2?.descriptionTitle ? this.labelContainer : this.element, options2?.title); + this.nameNode.setLabel(label, options2); + if (description || this.descriptionNode) { + const descriptionNode = this.getOrCreateDescriptionNode(); + if (descriptionNode instanceof HighlightedLabel) { + const supportIcons = options2?.supportIcons ?? this.creationOptions?.supportIcons; + descriptionNode.set(description || "", options2 ? options2.descriptionMatches : void 0, void 0, options2?.labelEscapeNewLines, supportIcons); + this.setupHover(descriptionNode.element, options2?.descriptionTitle); + } else { + descriptionNode.textContent = description && options2?.labelEscapeNewLines ? HighlightedLabel.escapeNewLines(description, []) : description || ""; + this.setupHover(descriptionNode.element, options2?.descriptionTitle || ""); + descriptionNode.empty = !description; + } + } + if (options2?.suffix || this.suffixNode) { + const suffixNode = this.getOrCreateSuffixNode(); + suffixNode.textContent = options2?.suffix ?? ""; + } + } + setupHover(htmlElement, tooltip) { + const previousCustomHover = this.customHovers.get(htmlElement); + if (previousCustomHover) { + previousCustomHover.dispose(); + this.customHovers.delete(htmlElement); + } + if (!tooltip) { + htmlElement.removeAttribute("title"); + return; + } + let hoverTarget = htmlElement; + if (this.creationOptions?.hoverTargetOverride) { + if (!isAncestor(htmlElement, this.creationOptions.hoverTargetOverride)) { + throw new Error("hoverTargetOverrride must be an ancestor of the htmlElement"); + } + hoverTarget = this.creationOptions.hoverTargetOverride; + } + const hoverDisposable = getBaseLayerHoverDelegate().setupManagedHover(this.hoverDelegate, hoverTarget, tooltip); + if (hoverDisposable) { + this.customHovers.set(htmlElement, hoverDisposable); + } + } + dispose() { + super.dispose(); + for (const disposable of this.customHovers.values()) { + disposable.dispose(); + } + this.customHovers.clear(); + } + getOrCreateSuffixNode() { + if (!this.suffixNode) { + const suffixContainer = this._register(new FastLabelNode(after(this.nameContainer, $("span.monaco-icon-suffix-container")))); + this.suffixNode = this._register(new FastLabelNode(append(suffixContainer.element, $("span.label-suffix")))); + } + return this.suffixNode; + } + getOrCreateDescriptionNode() { + if (!this.descriptionNode) { + const descriptionContainer = this._register(new FastLabelNode(append(this.labelContainer, $("span.monaco-icon-description-container")))); + if (this.creationOptions?.supportDescriptionHighlights) { + this.descriptionNode = this._register(new HighlightedLabel(append(descriptionContainer.element, $("span.label-description")))); + } else { + this.descriptionNode = this._register(new FastLabelNode(append(descriptionContainer.element, $("span.label-description")))); + } + } + return this.descriptionNode; + } +}; +var Label = class { + constructor(container) { + this.container = container; + this.label = void 0; + this.singleLabel = void 0; + } + setLabel(label, options2) { + if (this.label === label && equals2(this.options, options2)) { + return; + } + this.label = label; + this.options = options2; + if (typeof label === "string") { + if (!this.singleLabel) { + this.container.textContent = ""; + this.container.classList.remove("multiple"); + this.singleLabel = append(this.container, $("a.label-name", { id: options2?.domId })); + } + this.singleLabel.textContent = label; + } else { + this.container.textContent = ""; + this.container.classList.add("multiple"); + this.singleLabel = void 0; + for (let i2 = 0; i2 < label.length; i2++) { + const l = label[i2]; + const id = options2?.domId && `${options2?.domId}_${i2}`; + append(this.container, $("a.label-name", { id, "data-icon-label-count": label.length, "data-icon-label-index": i2, "role": "treeitem" }, l)); + if (i2 < label.length - 1) { + append(this.container, $("span.label-separator", void 0, options2?.separator || "/")); + } + } + } + } +}; +function splitMatches(labels, separator2, matches) { + if (!matches) { + return void 0; + } + let labelStart = 0; + return labels.map((label) => { + const labelRange = { start: labelStart, end: labelStart + label.length }; + const result = matches.map((match2) => Range2.intersect(labelRange, match2)).filter((range2) => !Range2.isEmpty(range2)).map(({ start, end }) => ({ start: start - labelStart, end: end - labelStart })); + labelStart = labelRange.end + separator2.length; + return result; + }); +} +var LabelWithHighlights = class extends Disposable { + constructor(container, supportIcons) { + super(); + this.container = container; + this.supportIcons = supportIcons; + this.label = void 0; + this.singleLabel = void 0; + } + setLabel(label, options2) { + if (this.label === label && equals2(this.options, options2)) { + return; + } + this.label = label; + this.options = options2; + const supportIcons = options2?.supportIcons ?? this.supportIcons; + if (typeof label === "string") { + if (!this.singleLabel) { + this.container.textContent = ""; + this.container.classList.remove("multiple"); + this.singleLabel = this._register(new HighlightedLabel(append(this.container, $("a.label-name", { id: options2?.domId })))); + } + this.singleLabel.set(label, options2?.matches, void 0, options2?.labelEscapeNewLines, supportIcons); + } else { + this.container.textContent = ""; + this.container.classList.add("multiple"); + this.singleLabel = void 0; + const separator2 = options2?.separator || "/"; + const matches = splitMatches(label, separator2, options2?.matches); + for (let i2 = 0; i2 < label.length; i2++) { + const l = label[i2]; + const m = matches ? matches[i2] : void 0; + const id = options2?.domId && `${options2?.domId}_${i2}`; + const name = $("a.label-name", { id, "data-icon-label-count": label.length, "data-icon-label-index": i2, "role": "treeitem" }); + const highlightedLabel = this._register(new HighlightedLabel(append(this.container, name))); + highlightedLabel.set(l, m, void 0, options2?.labelEscapeNewLines, supportIcons); + if (i2 < label.length - 1) { + append(name, $("span.label-separator", void 0, separator2)); + } + } + } + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesTree.js +init_filters(); +init_lifecycle(); +init_resources(); +init_resolverService(); +init_nls(); +init_instantiation(); + +// node_modules/monaco-editor-core/esm/vs/platform/label/common/label.js +init_instantiation(); +var ILabelService = createDecorator("labelService"); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesTree.js +var __decorate72 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param66 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var FileReferencesRenderer_1; +var DataSource = class DataSource2 { + constructor(_resolverService) { + this._resolverService = _resolverService; + } + hasChildren(element) { + if (element instanceof ReferencesModel) { + return true; + } + if (element instanceof FileReferences) { + return true; + } + return false; + } + getChildren(element) { + if (element instanceof ReferencesModel) { + return element.groups; + } + if (element instanceof FileReferences) { + return element.resolve(this._resolverService).then((val) => { + return val.children; + }); + } + throw new Error("bad tree"); + } +}; +DataSource = __decorate72([ + __param66(0, ITextModelService) +], DataSource); +var Delegate = class { + getHeight() { + return 23; + } + getTemplateId(element) { + if (element instanceof FileReferences) { + return FileReferencesRenderer.id; + } else { + return OneReferenceRenderer.id; + } + } +}; +var StringRepresentationProvider = class StringRepresentationProvider2 { + constructor(_keybindingService) { + this._keybindingService = _keybindingService; + } + getKeyboardNavigationLabel(element) { + if (element instanceof OneReference) { + const parts = element.parent.getPreview(element)?.preview(element.range); + if (parts) { + return parts.value; + } + } + return basename2(element.uri); + } +}; +StringRepresentationProvider = __decorate72([ + __param66(0, IKeybindingService) +], StringRepresentationProvider); +var IdentityProvider = class { + getId(element) { + return element instanceof OneReference ? element.id : element.uri; + } +}; +var FileReferencesTemplate = class FileReferencesTemplate2 extends Disposable { + constructor(container, _labelService) { + super(); + this._labelService = _labelService; + const parent = document.createElement("div"); + parent.classList.add("reference-file"); + this.file = this._register(new IconLabel(parent, { supportHighlights: true })); + this.badge = this._register(new CountBadge(append(parent, $(".count")), {}, defaultCountBadgeStyles)); + container.appendChild(parent); + } + set(element, matches) { + const parent = dirname2(element.uri); + this.file.setLabel(this._labelService.getUriBasenameLabel(element.uri), this._labelService.getUriLabel(parent, { relative: true }), { title: this._labelService.getUriLabel(element.uri), matches }); + const len = element.children.length; + this.badge.setCount(len); + if (len > 1) { + this.badge.setTitleFormat(localize(1081, "{0} references", len)); + } else { + this.badge.setTitleFormat(localize(1082, "{0} reference", len)); + } + } +}; +FileReferencesTemplate = __decorate72([ + __param66(1, ILabelService) +], FileReferencesTemplate); +var FileReferencesRenderer = class FileReferencesRenderer2 { + static { + FileReferencesRenderer_1 = this; + } + static { + this.id = "FileReferencesRenderer"; + } + constructor(_instantiationService) { + this._instantiationService = _instantiationService; + this.templateId = FileReferencesRenderer_1.id; + } + renderTemplate(container) { + return this._instantiationService.createInstance(FileReferencesTemplate, container); + } + renderElement(node, index, template) { + template.set(node.element, createMatches(node.filterData)); + } + disposeTemplate(templateData) { + templateData.dispose(); + } +}; +FileReferencesRenderer = FileReferencesRenderer_1 = __decorate72([ + __param66(0, IInstantiationService) +], FileReferencesRenderer); +var OneReferenceTemplate = class extends Disposable { + constructor(container) { + super(); + this.label = this._register(new HighlightedLabel(container)); + } + set(element, score3) { + const preview = element.parent.getPreview(element)?.preview(element.range); + if (!preview || !preview.value) { + this.label.set(`${basename2(element.uri)}:${element.range.startLineNumber + 1}:${element.range.startColumn + 1}`); + } else { + const { value, highlight } = preview; + if (score3 && !FuzzyScore.isDefault(score3)) { + this.label.element.classList.toggle("referenceMatch", false); + this.label.set(value, createMatches(score3)); + } else { + this.label.element.classList.toggle("referenceMatch", true); + this.label.set(value, [highlight]); + } + } + } +}; +var OneReferenceRenderer = class _OneReferenceRenderer { + constructor() { + this.templateId = _OneReferenceRenderer.id; + } + static { + this.id = "OneReferenceRenderer"; + } + renderTemplate(container) { + return new OneReferenceTemplate(container); + } + renderElement(node, index, templateData) { + templateData.set(node.element, node.filterData); + } + disposeTemplate(templateData) { + templateData.dispose(); + } +}; +var AccessibilityProvider = class { + getWidgetAriaLabel() { + return localize(1083, "References"); + } + getAriaLabel(element) { + return element.ariaMessage; + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesWidget.js +init_nls(); +init_instantiation(); +init_themeService(); +var __decorate73 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param67 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var DecorationsManager = class _DecorationsManager { + static { + this.DecorationOptions = ModelDecorationOptions.register({ + description: "reference-decoration", + stickiness: 1, + className: "reference-decoration" + }); + } + constructor(_editor, _model) { + this._editor = _editor; + this._model = _model; + this._decorations = /* @__PURE__ */ new Map(); + this._decorationIgnoreSet = /* @__PURE__ */ new Set(); + this._callOnDispose = new DisposableStore(); + this._callOnModelChange = new DisposableStore(); + this._callOnDispose.add(this._editor.onDidChangeModel(() => this._onModelChanged())); + this._onModelChanged(); + } + dispose() { + this._callOnModelChange.dispose(); + this._callOnDispose.dispose(); + this.removeDecorations(); + } + _onModelChanged() { + this._callOnModelChange.clear(); + const model = this._editor.getModel(); + if (!model) { + return; + } + for (const ref of this._model.references) { + if (ref.uri.toString() === model.uri.toString()) { + this._addDecorations(ref.parent); + return; + } + } + } + _addDecorations(reference) { + if (!this._editor.hasModel()) { + return; + } + this._callOnModelChange.add(this._editor.getModel().onDidChangeDecorations(() => this._onDecorationChanged())); + const newDecorations = []; + const newDecorationsActualIndex = []; + for (let i2 = 0, len = reference.children.length; i2 < len; i2++) { + const oneReference = reference.children[i2]; + if (this._decorationIgnoreSet.has(oneReference.id)) { + continue; + } + if (oneReference.uri.toString() !== this._editor.getModel().uri.toString()) { + continue; + } + newDecorations.push({ + range: oneReference.range, + options: _DecorationsManager.DecorationOptions + }); + newDecorationsActualIndex.push(i2); + } + this._editor.changeDecorations((changeAccessor) => { + const decorations = changeAccessor.deltaDecorations([], newDecorations); + for (let i2 = 0; i2 < decorations.length; i2++) { + this._decorations.set(decorations[i2], reference.children[newDecorationsActualIndex[i2]]); + } + }); + } + _onDecorationChanged() { + const toRemove = []; + const model = this._editor.getModel(); + if (!model) { + return; + } + for (const [decorationId, reference] of this._decorations) { + const newRange = model.getDecorationRange(decorationId); + if (!newRange) { + continue; + } + let ignore = false; + if (Range.equalsRange(newRange, reference.range)) { + continue; + } + if (Range.spansMultipleLines(newRange)) { + ignore = true; + } else { + const lineLength = reference.range.endColumn - reference.range.startColumn; + const newLineLength = newRange.endColumn - newRange.startColumn; + if (lineLength !== newLineLength) { + ignore = true; + } + } + if (ignore) { + this._decorationIgnoreSet.add(reference.id); + toRemove.push(decorationId); + } else { + reference.range = newRange; + } + } + for (let i2 = 0, len = toRemove.length; i2 < len; i2++) { + this._decorations.delete(toRemove[i2]); + } + this._editor.removeDecorations(toRemove); + } + removeDecorations() { + this._editor.removeDecorations([...this._decorations.keys()]); + this._decorations.clear(); + } +}; +var LayoutData = class { + constructor() { + this.ratio = 0.7; + this.heightInLines = 18; + } + static fromJSON(raw) { + let ratio; + let heightInLines; + try { + const data = JSON.parse(raw); + ratio = data.ratio; + heightInLines = data.heightInLines; + } catch { + } + return { + ratio: ratio || 0.7, + heightInLines: heightInLines || 18 + }; + } +}; +var ReferencesTree = class extends WorkbenchAsyncDataTree { +}; +var ReferencesDragAndDrop = class ReferencesDragAndDrop2 { + constructor(labelService) { + this.labelService = labelService; + this.disposables = new DisposableStore(); + } + getDragURI(element) { + if (element instanceof FileReferences) { + return element.uri.toString(); + } else if (element instanceof OneReference) { + return withSelection(element.uri, element.range).toString(); + } + return null; + } + getDragLabel(elements) { + if (elements.length === 0) { + return void 0; + } + const labels = elements.map((e) => this.labelService.getUriBasenameLabel(e.uri)); + return labels.join(", "); + } + onDragStart(data, originalEvent) { + if (!originalEvent.dataTransfer) { + return; + } + const elements = data.elements; + const resources = elements.map((e) => this.getDragURI(e)).filter(Boolean); + if (resources.length) { + originalEvent.dataTransfer.setData(DataTransfers.RESOURCES, JSON.stringify(resources)); + originalEvent.dataTransfer.setData(DataTransfers.TEXT, resources.join("\n")); + } + } + onDragOver() { + return false; + } + drop() { + } + dispose() { + this.disposables.dispose(); + } +}; +ReferencesDragAndDrop = __decorate73([ + __param67(0, ILabelService) +], ReferencesDragAndDrop); +var ReferenceWidget = class ReferenceWidget2 extends PeekViewWidget { + constructor(editor2, _defaultTreeKeyboardSupport, layoutData, themeService, _textModelResolverService, _instantiationService, _peekViewService, _uriLabel, _keybindingService) { + super(editor2, { showFrame: false, showArrow: true, isResizeable: true, isAccessible: true, supportOnTitleClick: true }, _instantiationService); + this._defaultTreeKeyboardSupport = _defaultTreeKeyboardSupport; + this.layoutData = layoutData; + this._textModelResolverService = _textModelResolverService; + this._instantiationService = _instantiationService; + this._peekViewService = _peekViewService; + this._uriLabel = _uriLabel; + this._keybindingService = _keybindingService; + this._disposeOnNewModel = new DisposableStore(); + this._callOnDispose = new DisposableStore(); + this._onDidSelectReference = new Emitter(); + this.onDidSelectReference = this._onDidSelectReference.event; + this._dim = new Dimension(0, 0); + this._isClosing = false; + this._applyTheme(themeService.getColorTheme()); + this._callOnDispose.add(themeService.onDidColorThemeChange(this._applyTheme.bind(this))); + this._peekViewService.addExclusiveWidget(editor2, this); + this.create(); + } + get isClosing() { + return this._isClosing; + } + dispose() { + this._isClosing = true; + this.setModel(void 0); + this._callOnDispose.dispose(); + this._disposeOnNewModel.dispose(); + dispose(this._preview); + dispose(this._previewNotAvailableMessage); + dispose(this._tree); + dispose(this._previewModelReference); + this._splitView.dispose(); + super.dispose(); + } + _applyTheme(theme) { + const borderColor = theme.getColor(peekViewBorder) || Color.transparent; + this.style({ + arrowColor: borderColor, + frameColor: borderColor, + headerBackgroundColor: theme.getColor(peekViewTitleBackground) || Color.transparent, + primaryHeadingColor: theme.getColor(peekViewTitleForeground), + secondaryHeadingColor: theme.getColor(peekViewTitleInfoForeground) + }); + } + show(where) { + super.show(where, this.layoutData.heightInLines || 18); + } + focusOnReferenceTree() { + this._tree.domFocus(); + } + focusOnPreviewEditor() { + this._preview.focus(); + } + isPreviewEditorFocused() { + return this._preview.hasTextFocus(); + } + _onTitleClick(e) { + if (this._preview && this._preview.getModel()) { + this._onDidSelectReference.fire({ + element: this._getFocusedReference(), + kind: e.ctrlKey || e.metaKey || e.altKey ? "side" : "open", + source: "title" + }); + } + } + _fillBody(containerElement) { + this.setCssClass("reference-zone-widget"); + this._messageContainer = append(containerElement, $("div.messages")); + hide(this._messageContainer); + this._splitView = new SplitView(containerElement, { + orientation: 1 + /* Orientation.HORIZONTAL */ + }); + this._previewContainer = append(containerElement, $("div.preview.inline")); + const options2 = { + scrollBeyondLastLine: false, + scrollbar: { + verticalScrollbarSize: 14, + horizontal: "auto", + useShadows: true, + verticalHasArrows: false, + horizontalHasArrows: false, + alwaysConsumeMouseWheel: true + }, + overviewRulerLanes: 2, + fixedOverflowWidgets: true, + minimap: { + enabled: false + } + }; + this._preview = this._instantiationService.createInstance(EmbeddedCodeEditorWidget, this._previewContainer, options2, {}, this.editor); + hide(this._previewContainer); + this._previewNotAvailableMessage = this._instantiationService.createInstance(TextModel, localize(1084, "no preview available"), PLAINTEXT_LANGUAGE_ID, TextModel.DEFAULT_CREATION_OPTIONS, null); + this._treeContainer = append(containerElement, $("div.ref-tree.inline")); + const treeOptions = { + keyboardSupport: this._defaultTreeKeyboardSupport, + accessibilityProvider: new AccessibilityProvider(), + keyboardNavigationLabelProvider: this._instantiationService.createInstance(StringRepresentationProvider), + identityProvider: new IdentityProvider(), + openOnSingleClick: true, + selectionNavigation: true, + overrideStyles: { + listBackground: peekViewResultsBackground + }, + dnd: this._instantiationService.createInstance(ReferencesDragAndDrop) + }; + if (this._defaultTreeKeyboardSupport) { + this._callOnDispose.add(addStandardDisposableListener(this._treeContainer, "keydown", (e) => { + if (e.equals( + 9 + /* KeyCode.Escape */ + )) { + this._keybindingService.dispatchEvent(e, e.target); + e.stopPropagation(); + } + }, true)); + } + this._tree = this._instantiationService.createInstance(ReferencesTree, "ReferencesWidget", this._treeContainer, new Delegate(), [ + this._instantiationService.createInstance(FileReferencesRenderer), + this._instantiationService.createInstance(OneReferenceRenderer) + ], this._instantiationService.createInstance(DataSource), treeOptions); + this._splitView.addView({ + onDidChange: Event.None, + element: this._previewContainer, + minimumSize: 200, + maximumSize: Number.MAX_VALUE, + layout: (width2) => { + this._preview.layout({ height: this._dim.height, width: width2 }); + } + }, Sizing.Distribute); + this._splitView.addView({ + onDidChange: Event.None, + element: this._treeContainer, + minimumSize: 100, + maximumSize: Number.MAX_VALUE, + layout: (width2) => { + this._treeContainer.style.height = `${this._dim.height}px`; + this._treeContainer.style.width = `${width2}px`; + this._tree.layout(this._dim.height, width2); + } + }, Sizing.Distribute); + this._disposables.add(this._splitView.onDidSashChange(() => { + if (this._dim.width) { + this.layoutData.ratio = this._splitView.getViewSize(0) / this._dim.width; + } + }, void 0)); + const onEvent = (element, kind) => { + if (element instanceof OneReference) { + if (kind === "show") { + this._revealReference(element, false); + } + this._onDidSelectReference.fire({ element, kind, source: "tree" }); + } + }; + this._disposables.add(this._tree.onDidOpen((e) => { + if (e.sideBySide) { + onEvent(e.element, "side"); + } else if (e.editorOptions.pinned) { + onEvent(e.element, "goto"); + } else { + onEvent(e.element, "show"); + } + })); + hide(this._treeContainer); + } + _onWidth(width2) { + if (this._dim) { + this._doLayoutBody(this._dim.height, width2); + } + } + _doLayoutBody(heightInPixel, widthInPixel) { + super._doLayoutBody(heightInPixel, widthInPixel); + this._dim = new Dimension(widthInPixel, heightInPixel); + this.layoutData.heightInLines = this._viewZone ? this._viewZone.heightInLines : this.layoutData.heightInLines; + this._splitView.layout(widthInPixel); + this._splitView.resizeView(0, widthInPixel * this.layoutData.ratio); + } + setSelection(selection) { + return this._revealReference(selection, true).then(() => { + if (!this._model) { + return; + } + this._tree.setSelection([selection]); + this._tree.setFocus([selection]); + }); + } + setModel(newModel) { + this._disposeOnNewModel.clear(); + this._model = newModel; + if (this._model) { + return this._onNewModel(); + } + return Promise.resolve(); + } + _onNewModel() { + if (!this._model) { + return Promise.resolve(void 0); + } + if (this._model.isEmpty) { + this.setTitle(""); + this._messageContainer.innerText = localize(1085, "No results"); + show(this._messageContainer); + return Promise.resolve(void 0); + } + hide(this._messageContainer); + this._decorationsManager = new DecorationsManager(this._preview, this._model); + this._disposeOnNewModel.add(this._decorationsManager); + this._disposeOnNewModel.add(this._model.onDidChangeReferenceRange((reference) => this._tree.rerender(reference))); + this._disposeOnNewModel.add(this._preview.onMouseDown((e) => { + const { event, target } = e; + if (event.detail !== 2) { + return; + } + const element = this._getFocusedReference(); + if (!element) { + return; + } + this._onDidSelectReference.fire({ + element: { uri: element.uri, range: target.range }, + kind: event.ctrlKey || event.metaKey || event.altKey ? "side" : "open", + source: "editor" + }); + })); + this.container.classList.add("results-loaded"); + show(this._treeContainer); + show(this._previewContainer); + this._splitView.layout(this._dim.width); + this.focusOnReferenceTree(); + return this._tree.setInput(this._model.groups.length === 1 ? this._model.groups[0] : this._model); + } + _getFocusedReference() { + const [element] = this._tree.getFocus(); + if (element instanceof OneReference) { + return element; + } else if (element instanceof FileReferences) { + if (element.children.length > 0) { + return element.children[0]; + } + } + return void 0; + } + async revealReference(reference) { + await this._revealReference(reference, false); + this._onDidSelectReference.fire({ element: reference, kind: "goto", source: "tree" }); + } + async _revealReference(reference, revealParent) { + if (this._revealedReference === reference) { + return; + } + this._revealedReference = reference; + if (reference.uri.scheme !== Schemas.inMemory) { + this.setTitle(basenameOrAuthority(reference.uri), this._uriLabel.getUriLabel(dirname2(reference.uri))); + } else { + this.setTitle(localize(1086, "References")); + } + const promise = this._textModelResolverService.createModelReference(reference.uri); + if (this._tree.getInput() === reference.parent) { + this._tree.reveal(reference); + } else { + if (revealParent) { + this._tree.reveal(reference.parent); + } + await this._tree.expand(reference.parent); + this._tree.reveal(reference); + } + const ref = await promise; + if (!this._model) { + ref.dispose(); + return; + } + dispose(this._previewModelReference); + const model = ref.object; + if (model) { + const scrollType = this._preview.getModel() === model.textEditorModel ? 0 : 1; + const sel = Range.lift(reference.range).collapseToStart(); + this._previewModelReference = ref; + this._preview.setModel(model.textEditorModel); + this._preview.setSelection(sel); + this._preview.revealRangeInCenter(sel, scrollType); + } else { + this._preview.setModel(this._previewNotAvailableMessage); + ref.dispose(); + } + } +}; +ReferenceWidget = __decorate73([ + __param67(3, IThemeService), + __param67(4, ITextModelService), + __param67(5, IInstantiationService), + __param67(6, IPeekViewService), + __param67(7, ILabelService), + __param67(8, IKeybindingService) +], ReferenceWidget); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesController.js +init_editorContextKeys(); +var __decorate74 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param68 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var ReferencesController_1; +var ctxReferenceSearchVisible = new RawContextKey("referenceSearchVisible", false, localize(1078, "Whether reference peek is visible, like 'Peek References' or 'Peek Definition'")); +var ReferencesController = class ReferencesController2 { + static { + ReferencesController_1 = this; + } + static { + this.ID = "editor.contrib.referencesController"; + } + static get(editor2) { + return editor2.getContribution(ReferencesController_1.ID); + } + constructor(_defaultTreeKeyboardSupport, _editor, contextKeyService, _editorService, _notificationService, _instantiationService, _storageService, _configurationService) { + this._defaultTreeKeyboardSupport = _defaultTreeKeyboardSupport; + this._editor = _editor; + this._editorService = _editorService; + this._notificationService = _notificationService; + this._instantiationService = _instantiationService; + this._storageService = _storageService; + this._configurationService = _configurationService; + this._disposables = new DisposableStore(); + this._requestIdPool = 0; + this._ignoreModelChangeEvent = false; + this._referenceSearchVisible = ctxReferenceSearchVisible.bindTo(contextKeyService); + } + dispose() { + this._referenceSearchVisible.reset(); + this._disposables.dispose(); + this._widget?.dispose(); + this._model?.dispose(); + this._widget = void 0; + this._model = void 0; + } + toggleWidget(range2, modelPromise, peekMode) { + let widgetPosition; + if (this._widget) { + widgetPosition = this._widget.position; + } + this.closeWidget(); + if (!!widgetPosition && range2.containsPosition(widgetPosition)) { + return; + } + this._peekMode = peekMode; + this._referenceSearchVisible.set(true); + this._disposables.add(this._editor.onDidChangeModelLanguage(() => { + this.closeWidget(); + })); + this._disposables.add(this._editor.onDidChangeModel(() => { + if (!this._ignoreModelChangeEvent) { + this.closeWidget(); + } + })); + const storageKey = "peekViewLayout"; + const data = LayoutData.fromJSON(this._storageService.get(storageKey, 0, "{}")); + this._widget = this._instantiationService.createInstance(ReferenceWidget, this._editor, this._defaultTreeKeyboardSupport, data); + this._widget.setTitle(localize(1079, "Loading...")); + this._widget.show(range2); + this._disposables.add(this._widget.onDidClose(() => { + modelPromise.cancel(); + if (this._widget) { + this._storageService.store( + storageKey, + JSON.stringify(this._widget.layoutData), + 0, + 1 + /* StorageTarget.MACHINE */ + ); + if (!this._widget.isClosing) { + this.closeWidget(); + } + this._widget = void 0; + } else { + this.closeWidget(); + } + })); + this._disposables.add(this._widget.onDidSelectReference((event) => { + const { element, kind } = event; + if (!element) { + return; + } + switch (kind) { + case "open": + if (event.source !== "editor" || !this._configurationService.getValue("editor.stablePeek")) { + this.openReference(element, false, false); + } + break; + case "side": + this.openReference(element, true, false); + break; + case "goto": + if (peekMode) { + this._gotoReference(element, true); + } else { + this.openReference(element, false, true); + } + break; + } + })); + const requestId = ++this._requestIdPool; + modelPromise.then((model) => { + if (requestId !== this._requestIdPool || !this._widget) { + model.dispose(); + return void 0; + } + this._model?.dispose(); + this._model = model; + return this._widget.setModel(this._model).then(() => { + if (this._widget && this._model && this._editor.hasModel()) { + if (!this._model.isEmpty) { + this._widget.setMetaTitle(localize(1080, "{0} ({1})", this._model.title, this._model.references.length)); + } else { + this._widget.setMetaTitle(""); + } + const uri = this._editor.getModel().uri; + const pos = new Position(range2.startLineNumber, range2.startColumn); + const selection = this._model.nearestReference(uri, pos); + if (selection) { + return this._widget.setSelection(selection).then(() => { + if (this._widget && this._editor.getOption( + 99 + /* EditorOption.peekWidgetDefaultFocus */ + ) === "editor") { + this._widget.focusOnPreviewEditor(); + } + }); + } + } + return void 0; + }); + }, (error) => { + this._notificationService.error(error); + }); + } + changeFocusBetweenPreviewAndReferences() { + if (!this._widget) { + return; + } + if (this._widget.isPreviewEditorFocused()) { + this._widget.focusOnReferenceTree(); + } else { + this._widget.focusOnPreviewEditor(); + } + } + async goToNextOrPreviousReference(fwd) { + if (!this._editor.hasModel() || !this._model || !this._widget) { + return; + } + const currentPosition = this._widget.position; + if (!currentPosition) { + return; + } + const source = this._model.nearestReference(this._editor.getModel().uri, currentPosition); + if (!source) { + return; + } + const target = this._model.nextOrPreviousReference(source, fwd); + const editorFocus = this._editor.hasTextFocus(); + const previewEditorFocus = this._widget.isPreviewEditorFocused(); + await this._widget.setSelection(target); + await this._gotoReference(target, false); + if (editorFocus) { + this._editor.focus(); + } else if (this._widget && previewEditorFocus) { + this._widget.focusOnPreviewEditor(); + } + } + async revealReference(reference) { + if (!this._editor.hasModel() || !this._model || !this._widget) { + return; + } + await this._widget.revealReference(reference); + } + closeWidget(focusEditor = true) { + this._widget?.dispose(); + this._model?.dispose(); + this._referenceSearchVisible.reset(); + this._disposables.clear(); + this._widget = void 0; + this._model = void 0; + if (focusEditor) { + this._editor.focus(); + } + this._requestIdPool += 1; + } + _gotoReference(ref, pinned) { + this._widget?.hide(); + this._ignoreModelChangeEvent = true; + const range2 = Range.lift(ref.range).collapseToStart(); + return this._editorService.openCodeEditor({ + resource: ref.uri, + options: { selection: range2, selectionSource: "code.jump", pinned } + }, this._editor).then((openedEditor) => { + this._ignoreModelChangeEvent = false; + if (!openedEditor || !this._widget) { + this.closeWidget(); + return; + } + if (this._editor === openedEditor) { + this._widget.show(range2); + this._widget.focusOnReferenceTree(); + } else { + const other = ReferencesController_1.get(openedEditor); + const model = this._model.clone(); + this.closeWidget(); + openedEditor.focus(); + other?.toggleWidget(range2, createCancelablePromise((_) => Promise.resolve(model)), this._peekMode ?? false); + } + }, (err) => { + this._ignoreModelChangeEvent = false; + onUnexpectedError(err); + }); + } + openReference(ref, sideBySide, pinned) { + if (!sideBySide) { + this.closeWidget(); + } + const { uri, range: range2 } = ref; + this._editorService.openCodeEditor({ + resource: uri, + options: { selection: range2, selectionSource: "code.jump", pinned } + }, this._editor, sideBySide); + } +}; +ReferencesController = ReferencesController_1 = __decorate74([ + __param68(2, IContextKeyService), + __param68(3, ICodeEditorService), + __param68(4, INotificationService), + __param68(5, IInstantiationService), + __param68(6, IStorageService), + __param68(7, IConfigurationService) +], ReferencesController); +function withController(accessor, fn) { + const outerEditor = getOuterEditor(accessor); + if (!outerEditor) { + return; + } + const controller = ReferencesController.get(outerEditor); + if (controller) { + fn(controller); + } +} +KeybindingsRegistry.registerCommandAndKeybindingRule({ + id: "togglePeekWidgetFocus", + weight: 100, + primary: KeyChord( + 2048 | 41, + 60 + /* KeyCode.F2 */ + ), + when: ContextKeyExpr.or(ctxReferenceSearchVisible, PeekContext.inPeekEditor), + handler(accessor) { + withController(accessor, (controller) => { + controller.changeFocusBetweenPreviewAndReferences(); + }); + } +}); +KeybindingsRegistry.registerCommandAndKeybindingRule({ + id: "goToNextReference", + weight: 100 - 10, + primary: 62, + secondary: [ + 70 + /* KeyCode.F12 */ + ], + when: ContextKeyExpr.or(ctxReferenceSearchVisible, PeekContext.inPeekEditor), + handler(accessor) { + withController(accessor, (controller) => { + controller.goToNextOrPreviousReference(true); + }); + } +}); +KeybindingsRegistry.registerCommandAndKeybindingRule({ + id: "goToPreviousReference", + weight: 100 - 10, + primary: 1024 | 62, + secondary: [ + 1024 | 70 + /* KeyCode.F12 */ + ], + when: ContextKeyExpr.or(ctxReferenceSearchVisible, PeekContext.inPeekEditor), + handler(accessor) { + withController(accessor, (controller) => { + controller.goToNextOrPreviousReference(false); + }); + } +}); +CommandsRegistry.registerCommandAlias("goToNextReferenceFromEmbeddedEditor", "goToNextReference"); +CommandsRegistry.registerCommandAlias("goToPreviousReferenceFromEmbeddedEditor", "goToPreviousReference"); +CommandsRegistry.registerCommandAlias("closeReferenceSearchEditor", "closeReferenceSearch"); +CommandsRegistry.registerCommand("closeReferenceSearch", (accessor) => withController(accessor, (controller) => controller.closeWidget())); +KeybindingsRegistry.registerKeybindingRule({ + id: "closeReferenceSearch", + weight: 100 - 101, + primary: 9, + secondary: [ + 1024 | 9 + /* KeyCode.Escape */ + ], + when: ContextKeyExpr.and(PeekContext.inPeekEditor, ContextKeyExpr.not("config.editor.stablePeek")) +}); +KeybindingsRegistry.registerKeybindingRule({ + id: "closeReferenceSearch", + weight: 200 + 50, + primary: 9, + secondary: [ + 1024 | 9 + /* KeyCode.Escape */ + ], + when: ContextKeyExpr.and(ctxReferenceSearchVisible, ContextKeyExpr.not("config.editor.stablePeek"), ContextKeyExpr.or(EditorContextKeys.editorTextFocus, InputFocusedContext.negate())) +}); +KeybindingsRegistry.registerCommandAndKeybindingRule({ + id: "revealReference", + weight: 200, + primary: 3, + mac: { + primary: 3, + secondary: [ + 2048 | 18 + /* KeyCode.DownArrow */ + ] + }, + when: ContextKeyExpr.and(ctxReferenceSearchVisible, WorkbenchListFocusContextKey, WorkbenchTreeElementCanCollapse.negate(), WorkbenchTreeElementCanExpand.negate()), + handler(accessor) { + const listService = accessor.get(IListService); + const focus = listService.lastFocusedList?.getFocus(); + if (Array.isArray(focus) && focus[0] instanceof OneReference) { + withController(accessor, (controller) => controller.revealReference(focus[0])); + } + } +}); +KeybindingsRegistry.registerCommandAndKeybindingRule({ + id: "openReferenceToSide", + weight: 100, + primary: 2048 | 3, + mac: { + primary: 256 | 3 + /* KeyCode.Enter */ + }, + when: ContextKeyExpr.and(ctxReferenceSearchVisible, WorkbenchListFocusContextKey, WorkbenchTreeElementCanCollapse.negate(), WorkbenchTreeElementCanExpand.negate()), + handler(accessor) { + const listService = accessor.get(IListService); + const focus = listService.lastFocusedList?.getFocus(); + if (Array.isArray(focus) && focus[0] instanceof OneReference) { + withController(accessor, (controller) => controller.openReference(focus[0], true, true)); + } + } +}); +CommandsRegistry.registerCommand("openReference", (accessor) => { + const listService = accessor.get(IListService); + const focus = listService.lastFocusedList?.getFocus(); + if (Array.isArray(focus) && focus[0] instanceof OneReference) { + withController(accessor, (controller) => controller.openReference(focus[0], false, true)); + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/gotoSymbol/browser/symbolNavigation.js +init_event(); +init_lifecycle(); +init_resources(); +init_editorExtensions(); +init_codeEditorService(); +init_range(); +init_nls(); +init_contextkey(); +init_extensions(); +init_instantiation(); +init_keybindingsRegistry(); +var __decorate75 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param69 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var ctxHasSymbols = new RawContextKey("hasSymbols", false, localize(1095, "Whether there are symbol locations that can be navigated via keyboard-only.")); +var ISymbolNavigationService = createDecorator("ISymbolNavigationService"); +var SymbolNavigationService = class SymbolNavigationService2 { + constructor(contextKeyService, _editorService, _notificationService, _keybindingService) { + this._editorService = _editorService; + this._notificationService = _notificationService; + this._keybindingService = _keybindingService; + this._currentModel = void 0; + this._currentIdx = -1; + this._ignoreEditorChange = false; + this._ctxHasSymbols = ctxHasSymbols.bindTo(contextKeyService); + } + reset() { + this._ctxHasSymbols.reset(); + this._currentState?.dispose(); + this._currentMessage?.close(); + this._currentModel = void 0; + this._currentIdx = -1; + } + put(anchor) { + const refModel = anchor.parent.parent; + if (refModel.references.length <= 1) { + this.reset(); + return; + } + this._currentModel = refModel; + this._currentIdx = refModel.references.indexOf(anchor); + this._ctxHasSymbols.set(true); + this._showMessage(); + const editorState = new EditorState2(this._editorService); + const listener = editorState.onDidChange((_) => { + if (this._ignoreEditorChange) { + return; + } + const editor2 = this._editorService.getActiveCodeEditor(); + if (!editor2) { + return; + } + const model = editor2.getModel(); + const position = editor2.getPosition(); + if (!model || !position) { + return; + } + let seenUri = false; + let seenPosition = false; + for (const reference of refModel.references) { + if (isEqual(reference.uri, model.uri)) { + seenUri = true; + seenPosition = seenPosition || Range.containsPosition(reference.range, position); + } else if (seenUri) { + break; + } + } + if (!seenUri || !seenPosition) { + this.reset(); + } + }); + this._currentState = combinedDisposable(editorState, listener); + } + revealNext(source) { + if (!this._currentModel) { + return Promise.resolve(); + } + this._currentIdx += 1; + this._currentIdx %= this._currentModel.references.length; + const reference = this._currentModel.references[this._currentIdx]; + this._showMessage(); + this._ignoreEditorChange = true; + return this._editorService.openCodeEditor({ + resource: reference.uri, + options: { + selection: Range.collapseToStart(reference.range), + selectionRevealType: 3 + /* TextEditorSelectionRevealType.NearTopIfOutsideViewport */ + } + }, source).finally(() => { + this._ignoreEditorChange = false; + }); + } + _showMessage() { + this._currentMessage?.close(); + const kb = this._keybindingService.lookupKeybinding("editor.gotoNextSymbolFromResult"); + const message = kb ? localize(1096, "Symbol {0} of {1}, {2} for next", this._currentIdx + 1, this._currentModel.references.length, kb.getLabel()) : localize(1097, "Symbol {0} of {1}", this._currentIdx + 1, this._currentModel.references.length); + this._currentMessage = this._notificationService.status(message); + } +}; +SymbolNavigationService = __decorate75([ + __param69(0, IContextKeyService), + __param69(1, ICodeEditorService), + __param69(2, INotificationService), + __param69(3, IKeybindingService) +], SymbolNavigationService); +registerSingleton( + ISymbolNavigationService, + SymbolNavigationService, + 1 + /* InstantiationType.Delayed */ +); +registerEditorCommand(new class extends EditorCommand { + constructor() { + super({ + id: "editor.gotoNextSymbolFromResult", + precondition: ctxHasSymbols, + kbOpts: { + weight: 100, + primary: 70 + /* KeyCode.F12 */ + } + }); + } + runEditorCommand(accessor, editor2) { + return accessor.get(ISymbolNavigationService).revealNext(editor2); + } +}()); +KeybindingsRegistry.registerCommandAndKeybindingRule({ + id: "editor.gotoNextSymbolFromResult.cancel", + weight: 100, + when: ctxHasSymbols, + primary: 9, + handler(accessor) { + accessor.get(ISymbolNavigationService).reset(); + } +}); +var EditorState2 = class EditorState3 { + constructor(editorService) { + this._listener = /* @__PURE__ */ new Map(); + this._disposables = new DisposableStore(); + this._onDidChange = new Emitter(); + this.onDidChange = this._onDidChange.event; + this._disposables.add(editorService.onCodeEditorRemove(this._onDidRemoveEditor, this)); + this._disposables.add(editorService.onCodeEditorAdd(this._onDidAddEditor, this)); + editorService.listCodeEditors().forEach(this._onDidAddEditor, this); + } + dispose() { + this._disposables.dispose(); + this._onDidChange.dispose(); + dispose(this._listener.values()); + } + _onDidAddEditor(editor2) { + this._listener.set(editor2, combinedDisposable(editor2.onDidChangeCursorPosition((_) => this._onDidChange.fire({ editor: editor2 })), editor2.onDidChangeModelContent((_) => this._onDidChange.fire({ editor: editor2 })))); + } + _onDidRemoveEditor(editor2) { + this._listener.get(editor2)?.dispose(); + this._listener.delete(editor2); + } +}; +EditorState2 = __decorate75([ + __param69(0, ICodeEditorService) +], EditorState2); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/gotoSymbol/browser/goToCommands.js +init_nls(); +init_actions2(); +init_commands(); +init_contextkey(); +init_instantiation(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/gotoSymbol/browser/goToSymbol.js +init_arrays(); +init_cancellation(); +init_errors(); +init_network(); +init_editorExtensions(); +init_languageFeatures(); +function shouldIncludeLocationLink(sourceModel, loc) { + if (loc.uri.scheme === sourceModel.uri.scheme) { + return true; + } + if (matchesSomeScheme(loc.uri, Schemas.walkThroughSnippet, Schemas.vscodeChatCodeBlock, Schemas.vscodeChatCodeCompareBlock)) { + return false; + } + return true; +} +async function getLocationLinks(model, position, registry, recursive, provide) { + const provider = registry.ordered(model, recursive); + const promises = provider.map((provider2) => { + return Promise.resolve(provide(provider2, model, position)).then(void 0, (err) => { + onUnexpectedExternalError(err); + return void 0; + }); + }); + const values = await Promise.all(promises); + return coalesce(values.flat()).filter((loc) => shouldIncludeLocationLink(model, loc)); +} +function getDefinitionsAtPosition(registry, model, position, recursive, token) { + return getLocationLinks(model, position, registry, recursive, (provider, model2, position2) => { + return provider.provideDefinition(model2, position2, token); + }); +} +function getDeclarationsAtPosition(registry, model, position, recursive, token) { + return getLocationLinks(model, position, registry, recursive, (provider, model2, position2) => { + return provider.provideDeclaration(model2, position2, token); + }); +} +function getImplementationsAtPosition(registry, model, position, recursive, token) { + return getLocationLinks(model, position, registry, recursive, (provider, model2, position2) => { + return provider.provideImplementation(model2, position2, token); + }); +} +function getTypeDefinitionsAtPosition(registry, model, position, recursive, token) { + return getLocationLinks(model, position, registry, recursive, (provider, model2, position2) => { + return provider.provideTypeDefinition(model2, position2, token); + }); +} +function getReferencesAtPosition(registry, model, position, compact, recursive, token) { + return getLocationLinks(model, position, registry, recursive, async (provider, model2, position2) => { + const result = (await provider.provideReferences(model2, position2, { includeDeclaration: true }, token))?.filter((ref) => shouldIncludeLocationLink(model2, ref)); + if (!compact || !result || result.length !== 2) { + return result; + } + const resultWithoutDeclaration = (await provider.provideReferences(model2, position2, { includeDeclaration: false }, token))?.filter((ref) => shouldIncludeLocationLink(model2, ref)); + if (resultWithoutDeclaration && resultWithoutDeclaration.length === 1) { + return resultWithoutDeclaration; + } + return result; + }); +} +async function _sortedAndDeduped(callback) { + const rawLinks = await callback(); + const model = new ReferencesModel(rawLinks, ""); + const modelLinks = model.references.map((ref) => ref.link); + model.dispose(); + return modelLinks; +} +registerModelAndPositionCommand("_executeDefinitionProvider", (accessor, model, position) => { + const languageFeaturesService = accessor.get(ILanguageFeaturesService); + const promise = getDefinitionsAtPosition(languageFeaturesService.definitionProvider, model, position, false, CancellationToken.None); + return _sortedAndDeduped(() => promise); +}); +registerModelAndPositionCommand("_executeDefinitionProvider_recursive", (accessor, model, position) => { + const languageFeaturesService = accessor.get(ILanguageFeaturesService); + const promise = getDefinitionsAtPosition(languageFeaturesService.definitionProvider, model, position, true, CancellationToken.None); + return _sortedAndDeduped(() => promise); +}); +registerModelAndPositionCommand("_executeTypeDefinitionProvider", (accessor, model, position) => { + const languageFeaturesService = accessor.get(ILanguageFeaturesService); + const promise = getTypeDefinitionsAtPosition(languageFeaturesService.typeDefinitionProvider, model, position, false, CancellationToken.None); + return _sortedAndDeduped(() => promise); +}); +registerModelAndPositionCommand("_executeTypeDefinitionProvider_recursive", (accessor, model, position) => { + const languageFeaturesService = accessor.get(ILanguageFeaturesService); + const promise = getTypeDefinitionsAtPosition(languageFeaturesService.typeDefinitionProvider, model, position, true, CancellationToken.None); + return _sortedAndDeduped(() => promise); +}); +registerModelAndPositionCommand("_executeDeclarationProvider", (accessor, model, position) => { + const languageFeaturesService = accessor.get(ILanguageFeaturesService); + const promise = getDeclarationsAtPosition(languageFeaturesService.declarationProvider, model, position, false, CancellationToken.None); + return _sortedAndDeduped(() => promise); +}); +registerModelAndPositionCommand("_executeDeclarationProvider_recursive", (accessor, model, position) => { + const languageFeaturesService = accessor.get(ILanguageFeaturesService); + const promise = getDeclarationsAtPosition(languageFeaturesService.declarationProvider, model, position, true, CancellationToken.None); + return _sortedAndDeduped(() => promise); +}); +registerModelAndPositionCommand("_executeReferenceProvider", (accessor, model, position) => { + const languageFeaturesService = accessor.get(ILanguageFeaturesService); + const promise = getReferencesAtPosition(languageFeaturesService.referenceProvider, model, position, false, false, CancellationToken.None); + return _sortedAndDeduped(() => promise); +}); +registerModelAndPositionCommand("_executeReferenceProvider_recursive", (accessor, model, position) => { + const languageFeaturesService = accessor.get(ILanguageFeaturesService); + const promise = getReferencesAtPosition(languageFeaturesService.referenceProvider, model, position, false, true, CancellationToken.None); + return _sortedAndDeduped(() => promise); +}); +registerModelAndPositionCommand("_executeImplementationProvider", (accessor, model, position) => { + const languageFeaturesService = accessor.get(ILanguageFeaturesService); + const promise = getImplementationsAtPosition(languageFeaturesService.implementationProvider, model, position, false, CancellationToken.None); + return _sortedAndDeduped(() => promise); +}); +registerModelAndPositionCommand("_executeImplementationProvider_recursive", (accessor, model, position) => { + const languageFeaturesService = accessor.get(ILanguageFeaturesService); + const promise = getImplementationsAtPosition(languageFeaturesService.implementationProvider, model, position, true, CancellationToken.None); + return _sortedAndDeduped(() => promise); +}); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/gotoSymbol/browser/goToCommands.js +init_languageFeatures(); +init_iterator(); +MenuRegistry.appendMenuItem(MenuId.EditorContext, { + submenu: MenuId.EditorContextPeek, + title: localize(1038, "Peek"), + group: "navigation", + order: 100 +}); +var SymbolNavigationAnchor = class _SymbolNavigationAnchor { + static is(thing) { + if (!thing || typeof thing !== "object") { + return false; + } + if (thing instanceof _SymbolNavigationAnchor) { + return true; + } + if (Position.isIPosition(thing.position) && thing.model) { + return true; + } + return false; + } + constructor(model, position) { + this.model = model; + this.position = position; + } +}; +var SymbolNavigationAction = class _SymbolNavigationAction extends EditorAction2 { + static { + this._allSymbolNavigationCommands = /* @__PURE__ */ new Map(); + } + static { + this._activeAlternativeCommands = /* @__PURE__ */ new Set(); + } + static all() { + return _SymbolNavigationAction._allSymbolNavigationCommands.values(); + } + static _patchConfig(opts) { + const result = { ...opts, f1: true }; + if (result.menu) { + for (const item of Iterable.wrap(result.menu)) { + if (item.id === MenuId.EditorContext || item.id === MenuId.EditorContextPeek) { + item.when = ContextKeyExpr.and(opts.precondition, item.when); + } + } + } + return result; + } + constructor(configuration, opts) { + super(_SymbolNavigationAction._patchConfig(opts)); + this.configuration = configuration; + _SymbolNavigationAction._allSymbolNavigationCommands.set(opts.id, this); + } + runEditorCommand(accessor, editor2, arg, range2) { + if (!editor2.hasModel()) { + return Promise.resolve(void 0); + } + const notificationService = accessor.get(INotificationService); + const editorService = accessor.get(ICodeEditorService); + const progressService = accessor.get(IEditorProgressService); + const symbolNavService = accessor.get(ISymbolNavigationService); + const languageFeaturesService = accessor.get(ILanguageFeaturesService); + const instaService = accessor.get(IInstantiationService); + const model = editor2.getModel(); + const position = editor2.getPosition(); + const anchor = SymbolNavigationAnchor.is(arg) ? arg : new SymbolNavigationAnchor(model, position); + const cts = new EditorStateCancellationTokenSource( + editor2, + 1 | 4 + /* CodeEditorStateFlag.Position */ + ); + const promise = raceCancellation(this._getLocationModel(languageFeaturesService, anchor.model, anchor.position, cts.token), cts.token).then(async (references) => { + if (!references || cts.token.isCancellationRequested) { + return; + } + alert(references.ariaMessage); + let altAction; + if (references.referenceAt(model.uri, position)) { + const altActionId = this._getAlternativeCommand(editor2); + if (altActionId !== void 0 && !_SymbolNavigationAction._activeAlternativeCommands.has(altActionId) && _SymbolNavigationAction._allSymbolNavigationCommands.has(altActionId)) { + altAction = _SymbolNavigationAction._allSymbolNavigationCommands.get(altActionId); + } + } + const referenceCount = references.references.length; + if (referenceCount === 0) { + if (!this.configuration.muteMessage) { + const info = model.getWordAtPosition(position); + MessageController.get(editor2)?.showMessage(this._getNoResultFoundMessage(info), position); + } + } else if (referenceCount === 1 && altAction) { + _SymbolNavigationAction._activeAlternativeCommands.add(this.desc.id); + instaService.invokeFunction((accessor2) => altAction.runEditorCommand(accessor2, editor2, arg, range2).finally(() => { + _SymbolNavigationAction._activeAlternativeCommands.delete(this.desc.id); + })); + } else { + return this._onResult(editorService, symbolNavService, editor2, references, range2); + } + }, (err) => { + notificationService.error(err); + }).finally(() => { + cts.dispose(); + }); + progressService.showWhile(promise, 250); + return promise; + } + async _onResult(editorService, symbolNavService, editor2, model, range2) { + const gotoLocation = this._getGoToPreference(editor2); + if (!(editor2 instanceof EmbeddedCodeEditorWidget) && (this.configuration.openInPeek || gotoLocation === "peek" && model.references.length > 1)) { + this._openInPeek(editor2, model, range2); + } else { + const next = model.firstReference(); + const peek = model.references.length > 1 && gotoLocation === "gotoAndPeek"; + const targetEditor = await this._openReference(editor2, editorService, next, this.configuration.openToSide, !peek); + if (peek && targetEditor) { + this._openInPeek(targetEditor, model, range2); + } else { + model.dispose(); + } + if (gotoLocation === "goto") { + symbolNavService.put(next); + } + } + } + async _openReference(editor2, editorService, reference, sideBySide, highlight) { + let range2 = void 0; + if (isLocationLink(reference)) { + range2 = reference.targetSelectionRange; + } + if (!range2) { + range2 = reference.range; + } + if (!range2) { + return void 0; + } + const targetEditor = await editorService.openCodeEditor({ + resource: reference.uri, + options: { + selection: Range.collapseToStart(range2), + selectionRevealType: 3, + selectionSource: "code.jump" + /* TextEditorSelectionSource.JUMP */ + } + }, editor2, sideBySide); + if (!targetEditor) { + return void 0; + } + if (highlight) { + const modelNow = targetEditor.getModel(); + const decorations = targetEditor.createDecorationsCollection([{ range: range2, options: { description: "symbol-navigate-action-highlight", className: "symbolHighlight" } }]); + setTimeout(() => { + if (targetEditor.getModel() === modelNow) { + decorations.clear(); + } + }, 350); + } + return targetEditor; + } + _openInPeek(target, model, range2) { + const controller = ReferencesController.get(target); + if (controller && target.hasModel()) { + controller.toggleWidget(range2 ?? target.getSelection(), createCancelablePromise((_) => Promise.resolve(model)), this.configuration.openInPeek); + } else { + model.dispose(); + } + } +}; +var DefinitionAction = class extends SymbolNavigationAction { + async _getLocationModel(languageFeaturesService, model, position, token) { + return new ReferencesModel(await getDefinitionsAtPosition(languageFeaturesService.definitionProvider, model, position, false, token), localize(1039, "Definitions")); + } + _getNoResultFoundMessage(info) { + return info && info.word ? localize(1040, "No definition found for '{0}'", info.word) : localize(1041, "No definition found"); + } + _getAlternativeCommand(editor2) { + return editor2.getOption( + 67 + /* EditorOption.gotoLocation */ + ).alternativeDefinitionCommand; + } + _getGoToPreference(editor2) { + return editor2.getOption( + 67 + /* EditorOption.gotoLocation */ + ).multipleDefinitions; + } +}; +registerAction2(class GoToDefinitionAction extends DefinitionAction { + static { + this.id = "editor.action.revealDefinition"; + } + constructor() { + super({ + openToSide: false, + openInPeek: false, + muteMessage: false + }, { + id: GoToDefinitionAction.id, + title: { + ...localize2(1065, "Go to Definition"), + mnemonicTitle: localize(1042, "Go to &&Definition") + }, + precondition: EditorContextKeys.hasDefinitionProvider, + keybinding: [{ + when: EditorContextKeys.editorTextFocus, + primary: 70, + weight: 100 + /* KeybindingWeight.EditorContrib */ + }, { + when: ContextKeyExpr.and(EditorContextKeys.editorTextFocus, IsWebContext), + primary: 2048 | 70, + weight: 100 + /* KeybindingWeight.EditorContrib */ + }], + menu: [{ + id: MenuId.EditorContext, + group: "navigation", + order: 1.1 + }, { + id: MenuId.MenubarGoMenu, + precondition: null, + group: "4_symbol_nav", + order: 2 + }] + }); + CommandsRegistry.registerCommandAlias("editor.action.goToDeclaration", GoToDefinitionAction.id); + } +}); +registerAction2(class OpenDefinitionToSideAction extends DefinitionAction { + static { + this.id = "editor.action.revealDefinitionAside"; + } + constructor() { + super({ + openToSide: true, + openInPeek: false, + muteMessage: false + }, { + id: OpenDefinitionToSideAction.id, + title: localize2(1066, "Open Definition to the Side"), + precondition: ContextKeyExpr.and(EditorContextKeys.hasDefinitionProvider, EditorContextKeys.isInEmbeddedEditor.toNegated()), + keybinding: [{ + when: EditorContextKeys.editorTextFocus, + primary: KeyChord( + 2048 | 41, + 70 + /* KeyCode.F12 */ + ), + weight: 100 + /* KeybindingWeight.EditorContrib */ + }, { + when: ContextKeyExpr.and(EditorContextKeys.editorTextFocus, IsWebContext), + primary: KeyChord( + 2048 | 41, + 2048 | 70 + /* KeyCode.F12 */ + ), + weight: 100 + /* KeybindingWeight.EditorContrib */ + }] + }); + CommandsRegistry.registerCommandAlias("editor.action.openDeclarationToTheSide", OpenDefinitionToSideAction.id); + } +}); +registerAction2(class PeekDefinitionAction extends DefinitionAction { + static { + this.id = "editor.action.peekDefinition"; + } + constructor() { + super({ + openToSide: false, + openInPeek: true, + muteMessage: false + }, { + id: PeekDefinitionAction.id, + title: localize2(1067, "Peek Definition"), + precondition: ContextKeyExpr.and(EditorContextKeys.hasDefinitionProvider, PeekContext.notInPeekEditor, EditorContextKeys.isInEmbeddedEditor.toNegated()), + keybinding: { + when: EditorContextKeys.editorTextFocus, + primary: 512 | 70, + linux: { + primary: 2048 | 1024 | 68 + /* KeyCode.F10 */ + }, + weight: 100 + /* KeybindingWeight.EditorContrib */ + }, + menu: { + id: MenuId.EditorContextPeek, + group: "peek", + order: 2 + } + }); + CommandsRegistry.registerCommandAlias("editor.action.previewDeclaration", PeekDefinitionAction.id); + } +}); +var DeclarationAction = class extends SymbolNavigationAction { + async _getLocationModel(languageFeaturesService, model, position, token) { + return new ReferencesModel(await getDeclarationsAtPosition(languageFeaturesService.declarationProvider, model, position, false, token), localize(1043, "Declarations")); + } + _getNoResultFoundMessage(info) { + return info && info.word ? localize(1044, "No declaration found for '{0}'", info.word) : localize(1045, "No declaration found"); + } + _getAlternativeCommand(editor2) { + return editor2.getOption( + 67 + /* EditorOption.gotoLocation */ + ).alternativeDeclarationCommand; + } + _getGoToPreference(editor2) { + return editor2.getOption( + 67 + /* EditorOption.gotoLocation */ + ).multipleDeclarations; + } +}; +registerAction2(class GoToDeclarationAction extends DeclarationAction { + static { + this.id = "editor.action.revealDeclaration"; + } + constructor() { + super({ + openToSide: false, + openInPeek: false, + muteMessage: false + }, { + id: GoToDeclarationAction.id, + title: { + ...localize2(1068, "Go to Declaration"), + mnemonicTitle: localize(1046, "Go to &&Declaration") + }, + precondition: ContextKeyExpr.and(EditorContextKeys.hasDeclarationProvider, EditorContextKeys.isInEmbeddedEditor.toNegated()), + menu: [{ + id: MenuId.EditorContext, + group: "navigation", + order: 1.3 + }, { + id: MenuId.MenubarGoMenu, + precondition: null, + group: "4_symbol_nav", + order: 3 + }] + }); + } + _getNoResultFoundMessage(info) { + return info && info.word ? localize(1047, "No declaration found for '{0}'", info.word) : localize(1048, "No declaration found"); + } +}); +registerAction2(class PeekDeclarationAction extends DeclarationAction { + constructor() { + super({ + openToSide: false, + openInPeek: true, + muteMessage: false + }, { + id: "editor.action.peekDeclaration", + title: localize2(1069, "Peek Declaration"), + precondition: ContextKeyExpr.and(EditorContextKeys.hasDeclarationProvider, PeekContext.notInPeekEditor, EditorContextKeys.isInEmbeddedEditor.toNegated()), + menu: { + id: MenuId.EditorContextPeek, + group: "peek", + order: 3 + } + }); + } +}); +var TypeDefinitionAction = class extends SymbolNavigationAction { + async _getLocationModel(languageFeaturesService, model, position, token) { + return new ReferencesModel(await getTypeDefinitionsAtPosition(languageFeaturesService.typeDefinitionProvider, model, position, false, token), localize(1049, "Type Definitions")); + } + _getNoResultFoundMessage(info) { + return info && info.word ? localize(1050, "No type definition found for '{0}'", info.word) : localize(1051, "No type definition found"); + } + _getAlternativeCommand(editor2) { + return editor2.getOption( + 67 + /* EditorOption.gotoLocation */ + ).alternativeTypeDefinitionCommand; + } + _getGoToPreference(editor2) { + return editor2.getOption( + 67 + /* EditorOption.gotoLocation */ + ).multipleTypeDefinitions; + } +}; +registerAction2(class GoToTypeDefinitionAction extends TypeDefinitionAction { + static { + this.ID = "editor.action.goToTypeDefinition"; + } + constructor() { + super({ + openToSide: false, + openInPeek: false, + muteMessage: false + }, { + id: GoToTypeDefinitionAction.ID, + title: { + ...localize2(1070, "Go to Type Definition"), + mnemonicTitle: localize(1052, "Go to &&Type Definition") + }, + precondition: EditorContextKeys.hasTypeDefinitionProvider, + keybinding: { + when: EditorContextKeys.editorTextFocus, + primary: 0, + weight: 100 + /* KeybindingWeight.EditorContrib */ + }, + menu: [{ + id: MenuId.EditorContext, + group: "navigation", + order: 1.4 + }, { + id: MenuId.MenubarGoMenu, + precondition: null, + group: "4_symbol_nav", + order: 3 + }] + }); + } +}); +registerAction2(class PeekTypeDefinitionAction extends TypeDefinitionAction { + static { + this.ID = "editor.action.peekTypeDefinition"; + } + constructor() { + super({ + openToSide: false, + openInPeek: true, + muteMessage: false + }, { + id: PeekTypeDefinitionAction.ID, + title: localize2(1071, "Peek Type Definition"), + precondition: ContextKeyExpr.and(EditorContextKeys.hasTypeDefinitionProvider, PeekContext.notInPeekEditor, EditorContextKeys.isInEmbeddedEditor.toNegated()), + menu: { + id: MenuId.EditorContextPeek, + group: "peek", + order: 4 + } + }); + } +}); +var ImplementationAction = class extends SymbolNavigationAction { + async _getLocationModel(languageFeaturesService, model, position, token) { + return new ReferencesModel(await getImplementationsAtPosition(languageFeaturesService.implementationProvider, model, position, false, token), localize(1053, "Implementations")); + } + _getNoResultFoundMessage(info) { + return info && info.word ? localize(1054, "No implementation found for '{0}'", info.word) : localize(1055, "No implementation found"); + } + _getAlternativeCommand(editor2) { + return editor2.getOption( + 67 + /* EditorOption.gotoLocation */ + ).alternativeImplementationCommand; + } + _getGoToPreference(editor2) { + return editor2.getOption( + 67 + /* EditorOption.gotoLocation */ + ).multipleImplementations; + } +}; +registerAction2(class GoToImplementationAction extends ImplementationAction { + static { + this.ID = "editor.action.goToImplementation"; + } + constructor() { + super({ + openToSide: false, + openInPeek: false, + muteMessage: false + }, { + id: GoToImplementationAction.ID, + title: { + ...localize2(1072, "Go to Implementations"), + mnemonicTitle: localize(1056, "Go to &&Implementations") + }, + precondition: EditorContextKeys.hasImplementationProvider, + keybinding: { + when: EditorContextKeys.editorTextFocus, + primary: 2048 | 70, + weight: 100 + /* KeybindingWeight.EditorContrib */ + }, + menu: [{ + id: MenuId.EditorContext, + group: "navigation", + order: 1.45 + }, { + id: MenuId.MenubarGoMenu, + precondition: null, + group: "4_symbol_nav", + order: 4 + }] + }); + } +}); +registerAction2(class PeekImplementationAction extends ImplementationAction { + static { + this.ID = "editor.action.peekImplementation"; + } + constructor() { + super({ + openToSide: false, + openInPeek: true, + muteMessage: false + }, { + id: PeekImplementationAction.ID, + title: localize2(1073, "Peek Implementations"), + precondition: ContextKeyExpr.and(EditorContextKeys.hasImplementationProvider, PeekContext.notInPeekEditor, EditorContextKeys.isInEmbeddedEditor.toNegated()), + keybinding: { + when: EditorContextKeys.editorTextFocus, + primary: 2048 | 1024 | 70, + weight: 100 + /* KeybindingWeight.EditorContrib */ + }, + menu: { + id: MenuId.EditorContextPeek, + group: "peek", + order: 5 + } + }); + } +}); +var ReferencesAction = class extends SymbolNavigationAction { + _getNoResultFoundMessage(info) { + return info ? localize(1057, "No references found for '{0}'", info.word) : localize(1058, "No references found"); + } + _getAlternativeCommand(editor2) { + return editor2.getOption( + 67 + /* EditorOption.gotoLocation */ + ).alternativeReferenceCommand; + } + _getGoToPreference(editor2) { + return editor2.getOption( + 67 + /* EditorOption.gotoLocation */ + ).multipleReferences; + } +}; +registerAction2(class GoToReferencesAction extends ReferencesAction { + constructor() { + super({ + openToSide: false, + openInPeek: false, + muteMessage: false + }, { + id: "editor.action.goToReferences", + title: { + ...localize2(1074, "Go to References"), + mnemonicTitle: localize(1059, "Go to &&References") + }, + precondition: ContextKeyExpr.and(EditorContextKeys.hasReferenceProvider, PeekContext.notInPeekEditor, EditorContextKeys.isInEmbeddedEditor.toNegated()), + keybinding: { + when: EditorContextKeys.editorTextFocus, + primary: 1024 | 70, + weight: 100 + /* KeybindingWeight.EditorContrib */ + }, + menu: [{ + id: MenuId.EditorContext, + group: "navigation", + order: 1.45 + }, { + id: MenuId.MenubarGoMenu, + precondition: null, + group: "4_symbol_nav", + order: 5 + }] + }); + } + async _getLocationModel(languageFeaturesService, model, position, token) { + return new ReferencesModel(await getReferencesAtPosition(languageFeaturesService.referenceProvider, model, position, true, false, token), localize(1060, "References")); + } +}); +registerAction2(class PeekReferencesAction extends ReferencesAction { + constructor() { + super({ + openToSide: false, + openInPeek: true, + muteMessage: false + }, { + id: "editor.action.referenceSearch.trigger", + title: localize2(1075, "Peek References"), + precondition: ContextKeyExpr.and(EditorContextKeys.hasReferenceProvider, PeekContext.notInPeekEditor, EditorContextKeys.isInEmbeddedEditor.toNegated()), + menu: { + id: MenuId.EditorContextPeek, + group: "peek", + order: 6 + } + }); + } + async _getLocationModel(languageFeaturesService, model, position, token) { + return new ReferencesModel(await getReferencesAtPosition(languageFeaturesService.referenceProvider, model, position, false, false, token), localize(1061, "References")); + } +}); +var GenericGoToLocationAction = class extends SymbolNavigationAction { + constructor(config, _references, _gotoMultipleBehaviour) { + super(config, { + id: "editor.action.goToLocation", + title: localize2(1076, "Go to Any Symbol"), + precondition: ContextKeyExpr.and(PeekContext.notInPeekEditor, EditorContextKeys.isInEmbeddedEditor.toNegated()) + }); + this._references = _references; + this._gotoMultipleBehaviour = _gotoMultipleBehaviour; + } + async _getLocationModel(languageFeaturesService, _model, _position, _token) { + return new ReferencesModel(this._references, localize(1062, "Locations")); + } + _getNoResultFoundMessage(info) { + return info && localize(1063, "No results for '{0}'", info.word) || ""; + } + _getGoToPreference(editor2) { + return this._gotoMultipleBehaviour ?? editor2.getOption( + 67 + /* EditorOption.gotoLocation */ + ).multipleReferences; + } + _getAlternativeCommand() { + return void 0; + } +}; +CommandsRegistry.registerCommand({ + id: "editor.action.goToLocations", + metadata: { + description: "Go to locations from a position in a file", + args: [ + { name: "uri", description: "The text document in which to start", constraint: URI }, + { name: "position", description: "The position at which to start", constraint: Position.isIPosition }, + { name: "locations", description: "An array of locations.", constraint: Array }, + { name: "multiple", description: "Define what to do when having multiple results, either `peek`, `gotoAndPeek`, or `goto`" }, + { name: "noResultsMessage", description: "Human readable message that shows when locations is empty." } + ] + }, + handler: async (accessor, resource, position, references, multiple, noResultsMessage, openInPeek) => { + assertType(URI.isUri(resource)); + assertType(Position.isIPosition(position)); + assertType(Array.isArray(references)); + assertType(typeof multiple === "undefined" || typeof multiple === "string"); + assertType(typeof openInPeek === "undefined" || typeof openInPeek === "boolean"); + const editorService = accessor.get(ICodeEditorService); + const editor2 = await editorService.openCodeEditor({ resource }, editorService.getFocusedCodeEditor()); + if (isCodeEditor(editor2)) { + editor2.setPosition(position); + editor2.revealPositionInCenterIfOutsideViewport( + position, + 0 + /* ScrollType.Smooth */ + ); + return editor2.invokeWithinContext((accessor2) => { + const command = new class extends GenericGoToLocationAction { + _getNoResultFoundMessage(info) { + return noResultsMessage || super._getNoResultFoundMessage(info); + } + }({ + muteMessage: !Boolean(noResultsMessage), + openInPeek: Boolean(openInPeek), + openToSide: false + }, references, multiple); + accessor2.get(IInstantiationService).invokeFunction(command.run.bind(command), editor2); + }); + } + } +}); +CommandsRegistry.registerCommand({ + id: "editor.action.peekLocations", + metadata: { + description: "Peek locations from a position in a file", + args: [ + { name: "uri", description: "The text document in which to start", constraint: URI }, + { name: "position", description: "The position at which to start", constraint: Position.isIPosition }, + { name: "locations", description: "An array of locations.", constraint: Array }, + { name: "multiple", description: "Define what to do when having multiple results, either `peek`, `gotoAndPeek`, or `goto`" } + ] + }, + handler: async (accessor, resource, position, references, multiple) => { + accessor.get(ICommandService).executeCommand("editor.action.goToLocations", resource, position, references, multiple, void 0, true); + } +}); +CommandsRegistry.registerCommand({ + id: "editor.action.findReferences", + handler: (accessor, resource, position) => { + assertType(URI.isUri(resource)); + assertType(Position.isIPosition(position)); + const languageFeaturesService = accessor.get(ILanguageFeaturesService); + const codeEditorService = accessor.get(ICodeEditorService); + return codeEditorService.openCodeEditor({ resource }, codeEditorService.getFocusedCodeEditor()).then((control) => { + if (!isCodeEditor(control) || !control.hasModel()) { + return void 0; + } + const controller = ReferencesController.get(control); + if (!controller) { + return void 0; + } + const references = createCancelablePromise((token) => getReferencesAtPosition(languageFeaturesService.referenceProvider, control.getModel(), Position.lift(position), false, false, token).then((references2) => new ReferencesModel(references2, localize(1064, "References")))); + const range2 = new Range(position.lineNumber, position.column, position.lineNumber, position.column); + return Promise.resolve(controller.toggleWidget(range2, references, false)); + }); + } +}); +CommandsRegistry.registerCommandAlias("editor.action.showReferences", "editor.action.peekLocations"); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/inlayHints/browser/inlayHintsLocations.js +init_actions2(); +init_commands(); +init_contextkey(); +init_instantiation(); +async function showGoToContextMenu(accessor, editor2, anchor, part) { + const resolverService = accessor.get(ITextModelService); + const contextMenuService = accessor.get(IContextMenuService); + const commandService = accessor.get(ICommandService); + const instaService = accessor.get(IInstantiationService); + const notificationService = accessor.get(INotificationService); + await part.item.resolve(CancellationToken.None); + if (!part.part.location) { + return; + } + const location2 = part.part.location; + const menuActions = []; + const filter = new Set(MenuRegistry.getMenuItems(MenuId.EditorContext).map((item) => isIMenuItem(item) ? item.command.id : generateUuid())); + for (const delegate of SymbolNavigationAction.all()) { + if (filter.has(delegate.desc.id)) { + menuActions.push(new Action(delegate.desc.id, MenuItemAction.label(delegate.desc, { renderShortTitle: true }), void 0, true, async () => { + const ref = await resolverService.createModelReference(location2.uri); + try { + const symbolAnchor = new SymbolNavigationAnchor(ref.object.textEditorModel, Range.getStartPosition(location2.range)); + const range2 = part.item.anchor.range; + await instaService.invokeFunction(delegate.runEditorCommand.bind(delegate), editor2, symbolAnchor, range2); + } finally { + ref.dispose(); + } + })); + } + } + if (part.part.command) { + const { command } = part.part; + menuActions.push(new Separator()); + menuActions.push(new Action(command.id, command.title, void 0, true, async () => { + try { + await commandService.executeCommand(command.id, ...command.arguments ?? []); + } catch (err) { + notificationService.notify({ + severity: Severity2.Error, + source: part.item.provider.displayName, + message: err + }); + } + })); + } + const useShadowDOM = editor2.getOption( + 144 + /* EditorOption.useShadowDOM */ + ); + contextMenuService.showContextMenu({ + domForShadowRoot: useShadowDOM ? editor2.getDomNode() ?? void 0 : void 0, + getAnchor: () => { + const box = getDomNodePagePosition(anchor); + return { x: box.left, y: box.top + box.height + 8 }; + }, + getActions: () => menuActions, + onHide: () => { + editor2.focus(); + }, + autoSelectFirstItem: true + }); +} +async function goToDefinitionWithLocation(accessor, event, editor2, location2) { + const resolverService = accessor.get(ITextModelService); + const ref = await resolverService.createModelReference(location2.uri); + await editor2.invokeWithinContext(async (accessor2) => { + const openToSide = event.hasSideBySideModifier; + const contextKeyService = accessor2.get(IContextKeyService); + const isInPeek = PeekContext.inPeekEditor.getValue(contextKeyService); + const canPeek = !openToSide && editor2.getOption( + 101 + /* EditorOption.definitionLinkOpensInPeek */ + ) && !isInPeek; + const action = new DefinitionAction({ openToSide, openInPeek: canPeek, muteMessage: true }, { title: { value: "", original: "" }, id: "", precondition: void 0 }); + return action.run(accessor2, new SymbolNavigationAnchor(ref.object.textEditorModel, Range.getStartPosition(location2.range)), Range.lift(location2.range)); + }); + ref.dispose(); +} + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/inlayHints/browser/inlayHintsController.js +init_commands(); +init_extensions(); +init_instantiation(); +init_colorRegistry(); +init_themeService(); +var __decorate76 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param70 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var InlayHintsController_1; +var InlayHintsCache = class _InlayHintsCache { + constructor() { + this._entries = new LRUCache(50); + } + get(model) { + const key = _InlayHintsCache._key(model); + return this._entries.get(key); + } + set(model, value) { + const key = _InlayHintsCache._key(model); + this._entries.set(key, value); + } + static _key(model) { + return `${model.uri.toString()}/${model.getVersionId()}`; + } +}; +var IInlayHintsCache = createDecorator("IInlayHintsCache"); +registerSingleton( + IInlayHintsCache, + InlayHintsCache, + 1 + /* InstantiationType.Delayed */ +); +var RenderedInlayHintLabelPart = class { + constructor(item, index) { + this.item = item; + this.index = index; + } + get part() { + const label = this.item.hint.label; + if (typeof label === "string") { + return { label }; + } else { + return label[this.index]; + } + } +}; +var ActiveInlayHintInfo = class { + constructor(part, hasTriggerModifier2) { + this.part = part; + this.hasTriggerModifier = hasTriggerModifier2; + } +}; +var CancellationStore = class { + constructor() { + this._store = new MutableDisposable(); + this._tokenSource = new CancellationTokenSource(); + } + dispose() { + this._store.dispose(); + this._tokenSource.dispose(true); + } + reset() { + this._tokenSource.dispose(true); + this._tokenSource = new CancellationTokenSource(); + this._store.value = new DisposableStore(); + return { + store: this._store.value, + token: this._tokenSource.token + }; + } +}; +var InlayHintsController = class InlayHintsController2 { + static { + InlayHintsController_1 = this; + } + static { + this.ID = "editor.contrib.InlayHints"; + } + static { + this._MAX_DECORATORS = 1500; + } + static { + this._whitespaceData = {}; + } + static get(editor2) { + return editor2.getContribution(InlayHintsController_1.ID) ?? void 0; + } + constructor(_editor, _languageFeaturesService, _featureDebounce, _inlayHintsCache, _commandService, _notificationService, _instaService) { + this._editor = _editor; + this._languageFeaturesService = _languageFeaturesService; + this._inlayHintsCache = _inlayHintsCache; + this._commandService = _commandService; + this._notificationService = _notificationService; + this._instaService = _instaService; + this._disposables = new DisposableStore(); + this._sessionDisposables = new DisposableStore(); + this._decorationsMetadata = /* @__PURE__ */ new Map(); + this._activeRenderMode = 0; + this._ruleFactory = this._disposables.add(new DynamicCssRules(this._editor)); + this._debounceInfo = _featureDebounce.for(_languageFeaturesService.inlayHintsProvider, "InlayHint", { min: 25 }); + this._disposables.add(_languageFeaturesService.inlayHintsProvider.onDidChange(() => this._update())); + this._disposables.add(_editor.onDidChangeModel(() => this._update())); + this._disposables.add(_editor.onDidChangeModelLanguage(() => this._update())); + this._disposables.add(_editor.onDidChangeConfiguration((e) => { + if (e.hasChanged( + 159 + /* EditorOption.inlayHints */ + )) { + this._update(); + } + })); + this._update(); + } + dispose() { + this._sessionDisposables.dispose(); + this._removeAllDecorations(); + this._disposables.dispose(); + } + _update() { + this._sessionDisposables.clear(); + this._removeAllDecorations(); + const options2 = this._editor.getOption( + 159 + /* EditorOption.inlayHints */ + ); + if (options2.enabled === "off") { + return; + } + const model = this._editor.getModel(); + if (!model || !this._languageFeaturesService.inlayHintsProvider.has(model)) { + return; + } + if (options2.enabled === "on") { + this._activeRenderMode = 0; + } else { + let defaultMode; + let altMode; + if (options2.enabled === "onUnlessPressed") { + defaultMode = 0; + altMode = 1; + } else { + defaultMode = 1; + altMode = 0; + } + this._activeRenderMode = defaultMode; + this._sessionDisposables.add(ModifierKeyEmitter.getInstance().event((e) => { + if (!this._editor.hasModel()) { + return; + } + const newRenderMode = e.altKey && e.ctrlKey && !(e.shiftKey || e.metaKey) ? altMode : defaultMode; + if (newRenderMode !== this._activeRenderMode) { + this._activeRenderMode = newRenderMode; + const model2 = this._editor.getModel(); + const copies = this._copyInlayHintsWithCurrentAnchor(model2); + this._updateHintsDecorators([model2.getFullModelRange()], copies); + scheduler.schedule(0); + } + })); + } + const cached = this._inlayHintsCache.get(model); + if (cached) { + this._updateHintsDecorators([model.getFullModelRange()], cached); + } + this._sessionDisposables.add(toDisposable(() => { + if (!model.isDisposed()) { + this._cacheHintsForFastRestore(model); + } + })); + let cts; + const watchedProviders = /* @__PURE__ */ new Set(); + this._sessionDisposables.add(model.onWillDispose(() => cts?.cancel())); + const cancellationStore = this._sessionDisposables.add(new CancellationStore()); + const scheduler = new RunOnceScheduler(async () => { + const t1 = Date.now(); + const { store, token } = cancellationStore.reset(); + try { + const inlayHints = await InlayHintsFragments.create(this._languageFeaturesService.inlayHintsProvider, model, this._getHintsRanges(), token); + scheduler.delay = this._debounceInfo.update(model, Date.now() - t1); + if (token.isCancellationRequested) { + inlayHints.dispose(); + return; + } + for (const provider of inlayHints.provider) { + if (typeof provider.onDidChangeInlayHints === "function" && !watchedProviders.has(provider)) { + watchedProviders.add(provider); + store.add(provider.onDidChangeInlayHints(() => { + if (!scheduler.isScheduled()) { + scheduler.schedule(); + } + })); + } + } + store.add(inlayHints); + this._updateHintsDecorators(inlayHints.ranges, inlayHints.items); + this._cacheHintsForFastRestore(model); + } catch (err) { + onUnexpectedError(err); + } + }, this._debounceInfo.get(model)); + this._sessionDisposables.add(scheduler); + scheduler.schedule(0); + this._sessionDisposables.add(this._editor.onDidScrollChange((e) => { + if (e.scrollTopChanged || !scheduler.isScheduled()) { + scheduler.schedule(); + } + })); + const cursor = this._sessionDisposables.add(new MutableDisposable()); + this._sessionDisposables.add(this._editor.onDidChangeModelContent((e) => { + cts?.cancel(); + const delay = Math.max(scheduler.delay, 800); + this._cursorInfo = { position: this._editor.getPosition(), notEarlierThan: Date.now() + delay }; + cursor.value = disposableTimeout(() => scheduler.schedule(0), delay); + scheduler.schedule(); + })); + this._sessionDisposables.add(this._editor.onDidChangeConfiguration((e) => { + if (e.hasChanged( + 159 + /* EditorOption.inlayHints */ + )) { + scheduler.schedule(); + } + })); + this._sessionDisposables.add(this._installDblClickGesture(() => scheduler.schedule(0))); + this._sessionDisposables.add(this._installLinkGesture()); + this._sessionDisposables.add(this._installContextMenu()); + } + _installLinkGesture() { + const store = new DisposableStore(); + const gesture = store.add(new ClickLinkGesture(this._editor)); + const sessionStore = new DisposableStore(); + store.add(sessionStore); + store.add(gesture.onMouseMoveOrRelevantKeyDown((e) => { + const [mouseEvent] = e; + const labelPart = this._getInlayHintLabelPart(mouseEvent); + const model = this._editor.getModel(); + if (!labelPart || !model) { + sessionStore.clear(); + return; + } + const cts = new CancellationTokenSource(); + sessionStore.add(toDisposable(() => cts.dispose(true))); + labelPart.item.resolve(cts.token); + this._activeInlayHintPart = labelPart.part.command || labelPart.part.location ? new ActiveInlayHintInfo(labelPart, mouseEvent.hasTriggerModifier) : void 0; + const lineNumber = model.validatePosition(labelPart.item.hint.position).lineNumber; + const range2 = new Range(lineNumber, 1, lineNumber, model.getLineMaxColumn(lineNumber)); + const lineHints = this._getInlineHintsForRange(range2); + this._updateHintsDecorators([range2], lineHints); + sessionStore.add(toDisposable(() => { + this._activeInlayHintPart = void 0; + this._updateHintsDecorators([range2], lineHints); + })); + })); + store.add(gesture.onCancel(() => sessionStore.clear())); + store.add(gesture.onExecute(async (e) => { + const label = this._getInlayHintLabelPart(e); + if (label) { + const part = label.part; + if (part.location) { + this._instaService.invokeFunction(goToDefinitionWithLocation, e, this._editor, part.location); + } else if (Command2.is(part.command)) { + await this._invokeCommand(part.command, label.item); + } + } + })); + return store; + } + _getInlineHintsForRange(range2) { + const lineHints = /* @__PURE__ */ new Set(); + for (const data of this._decorationsMetadata.values()) { + if (range2.containsRange(data.item.anchor.range)) { + lineHints.add(data.item); + } + } + return Array.from(lineHints); + } + _installDblClickGesture(updateInlayHints) { + return this._editor.onMouseUp(async (e) => { + if (e.event.detail !== 2) { + return; + } + const part = this._getInlayHintLabelPart(e); + if (!part) { + return; + } + e.event.preventDefault(); + await part.item.resolve(CancellationToken.None); + if (isNonEmptyArray(part.item.hint.textEdits)) { + const edits = part.item.hint.textEdits.map((edit2) => EditOperation.replace(Range.lift(edit2.range), edit2.text)); + this._editor.executeEdits("inlayHint.default", edits); + updateInlayHints(); + } + }); + } + _installContextMenu() { + return this._editor.onContextMenu(async (e) => { + if (!isHTMLElement(e.event.target)) { + return; + } + const part = this._getInlayHintLabelPart(e); + if (part) { + await this._instaService.invokeFunction(showGoToContextMenu, this._editor, e.event.target, part); + } + }); + } + _getInlayHintLabelPart(e) { + if (e.target.type !== 6) { + return void 0; + } + const options2 = e.target.detail.injectedText?.options; + if (options2 instanceof ModelDecorationInjectedTextOptions && options2?.attachedData instanceof RenderedInlayHintLabelPart) { + return options2.attachedData; + } + return void 0; + } + async _invokeCommand(command, item) { + try { + await this._commandService.executeCommand(command.id, ...command.arguments ?? []); + } catch (err) { + this._notificationService.notify({ + severity: Severity2.Error, + source: item.provider.displayName, + message: err + }); + } + } + _cacheHintsForFastRestore(model) { + const hints = this._copyInlayHintsWithCurrentAnchor(model); + this._inlayHintsCache.set(model, hints); + } + // return inlay hints but with an anchor that reflects "updates" + // that happened after receiving them, e.g adding new lines before a hint + _copyInlayHintsWithCurrentAnchor(model) { + const items = /* @__PURE__ */ new Map(); + for (const [id, obj] of this._decorationsMetadata) { + if (items.has(obj.item)) { + continue; + } + const range2 = model.getDecorationRange(id); + if (range2) { + const anchor = new InlayHintAnchor(range2, obj.item.anchor.direction); + const copy = obj.item.with({ anchor }); + items.set(obj.item, copy); + } + } + return Array.from(items.values()); + } + _getHintsRanges() { + const extra = 30; + const model = this._editor.getModel(); + const visibleRanges = this._editor.getVisibleRangesPlusViewportAboveBelow(); + const result = []; + for (const range2 of visibleRanges.sort(Range.compareRangesUsingStarts)) { + const extendedRange = model.validateRange(new Range(range2.startLineNumber - extra, range2.startColumn, range2.endLineNumber + extra, range2.endColumn)); + if (result.length === 0 || !Range.areIntersectingOrTouching(result[result.length - 1], extendedRange)) { + result.push(extendedRange); + } else { + result[result.length - 1] = Range.plusRange(result[result.length - 1], extendedRange); + } + } + return result; + } + _updateHintsDecorators(ranges, items) { + const itemFixedLengths = /* @__PURE__ */ new Map(); + if (this._cursorInfo && this._cursorInfo.notEarlierThan > Date.now() && ranges.some((range2) => range2.containsPosition(this._cursorInfo.position))) { + const { position } = this._cursorInfo; + this._cursorInfo = void 0; + const lengths = /* @__PURE__ */ new Map(); + for (const deco of this._editor.getLineDecorations(position.lineNumber) ?? []) { + const data = this._decorationsMetadata.get(deco.id); + if (deco.range.startColumn > position.column) { + continue; + } + const opts = data?.decoration.options[data.item.anchor.direction]; + if (opts && opts.attachedData !== InlayHintsController_1._whitespaceData) { + const len = lengths.get(data.item) ?? 0; + lengths.set(data.item, len + opts.content.length); + } + } + const newItemsWithFixedLength = items.filter((item) => item.anchor.range.startLineNumber === position.lineNumber && item.anchor.range.endColumn <= position.column); + const fixedLengths = Array.from(lengths.values()); + let lastItem; + while (true) { + const targetItem = newItemsWithFixedLength.shift(); + const fixedLength = fixedLengths.shift(); + if (!fixedLength && !targetItem) { + break; + } + if (targetItem) { + itemFixedLengths.set(targetItem, fixedLength ?? 0); + lastItem = targetItem; + } else if (lastItem && fixedLength) { + let len = itemFixedLengths.get(lastItem); + len += fixedLength; + len += fixedLengths.reduce((p, c) => p + c, 0); + fixedLengths.length = 0; + break; + } + } + } + const newDecorationsData = []; + const addInjectedText = (item, ref, content, cursorStops, attachedData) => { + const opts = { + content, + inlineClassNameAffectsLetterSpacing: true, + inlineClassName: ref.className, + cursorStops, + attachedData + }; + newDecorationsData.push({ + item, + classNameRef: ref, + decoration: { + range: item.anchor.range, + options: { + // className: "rangeHighlight", // DEBUG highlight to see to what range a hint is attached + description: "InlayHint", + showIfCollapsed: item.anchor.range.isEmpty(), + // "original" range is empty + collapseOnReplaceEdit: !item.anchor.range.isEmpty(), + stickiness: 0, + [item.anchor.direction]: this._activeRenderMode === 0 ? opts : void 0 + } + } + }); + }; + const addInjectedWhitespace = (item, isLast) => { + const marginRule = this._ruleFactory.createClassNameRef({ + width: `${fontSize / 3 | 0}px`, + display: "inline-block" + }); + addInjectedText(item, marginRule, "\u200A", isLast ? InjectedTextCursorStops.Right : InjectedTextCursorStops.None, InlayHintsController_1._whitespaceData); + }; + const { fontSize, fontFamily, padding, isUniform } = this._getLayoutInfo(); + const maxLength = this._editor.getOption( + 159 + /* EditorOption.inlayHints */ + ).maximumLength; + const fontFamilyVar = "--code-editorInlayHintsFontFamily"; + this._editor.getContainerDomNode().style.setProperty(fontFamilyVar, fontFamily); + let currentLineInfo = { line: 0, totalLen: 0 }; + for (let i2 = 0; i2 < items.length; i2++) { + const item = items[i2]; + if (currentLineInfo.line !== item.anchor.range.startLineNumber) { + currentLineInfo = { line: item.anchor.range.startLineNumber, totalLen: 0 }; + } + if (maxLength && currentLineInfo.totalLen > maxLength) { + continue; + } + if (item.hint.paddingLeft) { + addInjectedWhitespace(item, false); + } + const parts = typeof item.hint.label === "string" ? [{ label: item.hint.label }] : item.hint.label; + const itemFixedLength = itemFixedLengths.get(item); + let itemActualLength = 0; + for (let i3 = 0; i3 < parts.length; i3++) { + const part = parts[i3]; + const isFirst = i3 === 0; + const isLast = i3 === parts.length - 1; + const cssProperties = { + fontSize: `${fontSize}px`, + fontFamily: `var(${fontFamilyVar}), ${EDITOR_FONT_DEFAULTS.fontFamily}`, + verticalAlign: isUniform ? "baseline" : "middle", + unicodeBidi: "isolate" + }; + if (isNonEmptyArray(item.hint.textEdits)) { + cssProperties.cursor = "default"; + } + this._fillInColors(cssProperties, item.hint); + if ((part.command || part.location) && this._activeInlayHintPart?.part.item === item && this._activeInlayHintPart.part.index === i3) { + cssProperties.textDecoration = "underline"; + if (this._activeInlayHintPart.hasTriggerModifier) { + cssProperties.color = themeColorFromId(editorActiveLinkForeground); + cssProperties.cursor = "pointer"; + } + } + let textlabel = part.label; + currentLineInfo.totalLen += textlabel.length; + let tooLong = false; + const over = maxLength !== 0 ? currentLineInfo.totalLen - maxLength : 0; + if (over > 0) { + textlabel = textlabel.slice(0, -over) + "\u2026"; + tooLong = true; + } + itemActualLength += textlabel.length; + if (itemFixedLength !== void 0) { + const overFixedLength = itemActualLength - itemFixedLength; + if (overFixedLength >= 0) { + itemActualLength -= overFixedLength; + textlabel = textlabel.slice(0, -(1 + overFixedLength)) + "\u2026"; + tooLong = true; + } + } + if (padding) { + if (isFirst && (isLast || tooLong)) { + cssProperties.padding = `1px ${Math.max(1, fontSize / 4) | 0}px`; + cssProperties.borderRadius = `${fontSize / 4 | 0}px`; + } else if (isFirst) { + cssProperties.padding = `1px 0 1px ${Math.max(1, fontSize / 4) | 0}px`; + cssProperties.borderRadius = `${fontSize / 4 | 0}px 0 0 ${fontSize / 4 | 0}px`; + } else if (isLast || tooLong) { + cssProperties.padding = `1px ${Math.max(1, fontSize / 4) | 0}px 1px 0`; + cssProperties.borderRadius = `0 ${fontSize / 4 | 0}px ${fontSize / 4 | 0}px 0`; + } else { + cssProperties.padding = `1px 0 1px 0`; + } + } + addInjectedText(item, this._ruleFactory.createClassNameRef(cssProperties), fixSpace(textlabel), isLast && !item.hint.paddingRight ? InjectedTextCursorStops.Right : InjectedTextCursorStops.None, new RenderedInlayHintLabelPart(item, i3)); + if (tooLong) { + break; + } + } + if (itemFixedLength !== void 0 && itemActualLength < itemFixedLength) { + const pad = itemFixedLength - itemActualLength; + addInjectedText(item, this._ruleFactory.createClassNameRef({}), "\u200A".repeat(pad), InjectedTextCursorStops.None); + } + if (item.hint.paddingRight) { + addInjectedWhitespace(item, true); + } + if (newDecorationsData.length > InlayHintsController_1._MAX_DECORATORS) { + break; + } + } + const decorationIdsToReplace = []; + for (const [id, metadata] of this._decorationsMetadata) { + const range2 = this._editor.getModel()?.getDecorationRange(id); + if (range2 && ranges.some((r) => r.containsRange(range2))) { + decorationIdsToReplace.push(id); + metadata.classNameRef.dispose(); + this._decorationsMetadata.delete(id); + } + } + const scrollState = StableEditorScrollState.capture(this._editor); + this._editor.changeDecorations((accessor) => { + const newDecorationIds = accessor.deltaDecorations(decorationIdsToReplace, newDecorationsData.map((d) => d.decoration)); + for (let i2 = 0; i2 < newDecorationIds.length; i2++) { + const data = newDecorationsData[i2]; + this._decorationsMetadata.set(newDecorationIds[i2], data); + } + }); + scrollState.restore(this._editor); + } + _fillInColors(props, hint) { + if (hint.kind === InlayHintKind.Parameter) { + props.backgroundColor = themeColorFromId(editorInlayHintParameterBackground); + props.color = themeColorFromId(editorInlayHintParameterForeground); + } else if (hint.kind === InlayHintKind.Type) { + props.backgroundColor = themeColorFromId(editorInlayHintTypeBackground); + props.color = themeColorFromId(editorInlayHintTypeForeground); + } else { + props.backgroundColor = themeColorFromId(editorInlayHintBackground); + props.color = themeColorFromId(editorInlayHintForeground); + } + } + _getLayoutInfo() { + const options2 = this._editor.getOption( + 159 + /* EditorOption.inlayHints */ + ); + const padding = options2.padding; + const editorFontSize = this._editor.getOption( + 61 + /* EditorOption.fontSize */ + ); + const editorFontFamily = this._editor.getOption( + 58 + /* EditorOption.fontFamily */ + ); + let fontSize = options2.fontSize; + if (!fontSize || fontSize < 5 || fontSize > editorFontSize) { + fontSize = editorFontSize; + } + const fontFamily = options2.fontFamily || editorFontFamily; + const isUniform = !padding && fontFamily === editorFontFamily && fontSize === editorFontSize; + return { fontSize, fontFamily, padding, isUniform }; + } + _removeAllDecorations() { + this._editor.removeDecorations(Array.from(this._decorationsMetadata.keys())); + for (const obj of this._decorationsMetadata.values()) { + obj.classNameRef.dispose(); + } + this._decorationsMetadata.clear(); + } +}; +InlayHintsController = InlayHintsController_1 = __decorate76([ + __param70(1, ILanguageFeaturesService), + __param70(2, ILanguageFeatureDebounceService), + __param70(3, IInlayHintsCache), + __param70(4, ICommandService), + __param70(5, INotificationService), + __param70(6, IInstantiationService) +], InlayHintsController); +function fixSpace(str) { + const noBreakWhitespace2 = "\xA0"; + return str.replace(/[ \t]/g, noBreakWhitespace2); +} +CommandsRegistry.registerCommand("_executeInlayHintProvider", async (accessor, ...args) => { + const [uri, range2] = args; + assertType(URI.isUri(uri)); + assertType(Range.isIRange(range2)); + const { inlayHintsProvider } = accessor.get(ILanguageFeaturesService); + const ref = await accessor.get(ITextModelService).createModelReference(uri); + try { + const model = await InlayHintsFragments.create(inlayHintsProvider, ref.object.textEditorModel, [Range.lift(range2)], CancellationToken.None); + const result = model.items.map((i2) => i2.hint); + setTimeout(() => model.dispose(), 0); + return result; + } finally { + ref.dispose(); + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/inlayHints/browser/inlayHintsHover.js +init_configuration(); +init_languageFeatures(); +init_nls(); +init_platform(); +init_arrays(); +init_commands(); +var __decorate77 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param71 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var InlayHintsHoverAnchor = class extends HoverForeignElementAnchor { + constructor(part, owner, initialMousePosX, initialMousePosY) { + super(10, owner, part.item.anchor.range, initialMousePosX, initialMousePosY, true); + this.part = part; + } +}; +var InlayHintsHover = class InlayHintsHover2 extends MarkdownHoverParticipant { + constructor(editor2, markdownRendererService, keybindingService, hoverService, configurationService, _resolverService, languageFeaturesService, commandService) { + super(editor2, markdownRendererService, configurationService, languageFeaturesService, keybindingService, hoverService, commandService); + this._resolverService = _resolverService; + this.hoverOrdinal = 6; + } + suggestHoverAnchor(mouseEvent) { + const controller = InlayHintsController.get(this._editor); + if (!controller) { + return null; + } + if (mouseEvent.target.type !== 6) { + return null; + } + const options2 = mouseEvent.target.detail.injectedText?.options; + if (!(options2 instanceof ModelDecorationInjectedTextOptions && options2.attachedData instanceof RenderedInlayHintLabelPart)) { + return null; + } + return new InlayHintsHoverAnchor(options2.attachedData, this, mouseEvent.event.posx, mouseEvent.event.posy); + } + computeSync() { + return []; + } + computeAsync(anchor, _lineDecorations, source, token) { + if (!(anchor instanceof InlayHintsHoverAnchor)) { + return AsyncIterableProducer.EMPTY; + } + return new AsyncIterableProducer(async (executor) => { + const { part } = anchor; + await part.item.resolve(token); + if (token.isCancellationRequested) { + return; + } + let itemTooltip; + if (typeof part.item.hint.tooltip === "string") { + itemTooltip = new MarkdownString().appendText(part.item.hint.tooltip); + } else if (part.item.hint.tooltip) { + itemTooltip = part.item.hint.tooltip; + } + if (itemTooltip) { + executor.emitOne(new MarkdownHover(this, anchor.range, [itemTooltip], false, 0)); + } + if (isNonEmptyArray(part.item.hint.textEdits)) { + executor.emitOne(new MarkdownHover(this, anchor.range, [new MarkdownString().appendText(localize(1164, "Double-click to insert"))], false, 10001)); + } + let partTooltip; + if (typeof part.part.tooltip === "string") { + partTooltip = new MarkdownString().appendText(part.part.tooltip); + } else if (part.part.tooltip) { + partTooltip = part.part.tooltip; + } + if (partTooltip) { + executor.emitOne(new MarkdownHover(this, anchor.range, [partTooltip], false, 1)); + } + if (part.part.location || part.part.command) { + let linkHint; + const useMetaKey = this._editor.getOption( + 86 + /* EditorOption.multiCursorModifier */ + ) === "altKey"; + const kb = useMetaKey ? isMacintosh ? localize(1165, "cmd + click") : localize(1166, "ctrl + click") : isMacintosh ? localize(1167, "option + click") : localize(1168, "alt + click"); + if (part.part.location && part.part.command) { + linkHint = new MarkdownString().appendText(localize(1169, "Go to Definition ({0}), right click for more", kb)); + } else if (part.part.location) { + linkHint = new MarkdownString().appendText(localize(1170, "Go to Definition ({0})", kb)); + } else if (part.part.command) { + linkHint = new MarkdownString(`[${localize(1171, "Execute Command")}](${asCommandLink(part.part.command)} "${part.part.command.title}") (${kb})`, { isTrusted: true }); + } + if (linkHint) { + executor.emitOne(new MarkdownHover(this, anchor.range, [linkHint], false, 1e4)); + } + } + const iterable = this._resolveInlayHintLabelPartHover(part, token); + for await (const item of iterable) { + executor.emitOne(item); + } + }); + } + async *_resolveInlayHintLabelPartHover(part, token) { + if (!part.part.location) { + return; + } + const { uri, range: range2 } = part.part.location; + const ref = await this._resolverService.createModelReference(uri); + try { + const model = ref.object.textEditorModel; + if (!this._languageFeaturesService.hoverProvider.has(model)) { + return; + } + for await (const item of getHoverProviderResultsAsAsyncIterable(this._languageFeaturesService.hoverProvider, model, new Position(range2.startLineNumber, range2.startColumn), token)) { + if (!isEmptyMarkdownString(item.hover.contents)) { + yield new MarkdownHover(this, part.item.anchor.range, item.hover.contents, false, 2 + item.ordinal); + } + } + } finally { + ref.dispose(); + } + } +}; +InlayHintsHover = __decorate77([ + __param71(1, IMarkdownRendererService), + __param71(2, IKeybindingService), + __param71(3, IHoverService), + __param71(4, IConfigurationService), + __param71(5, ITextModelService), + __param71(6, ILanguageFeaturesService), + __param71(7, ICommandService) +], InlayHintsHover); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/hover/browser/contentHoverRendered.js +init_errors(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/hover/browser/markerHoverParticipant.js +init_dom(); +init_arrays(); +init_async(); +init_errors(); +init_lifecycle(); +init_resources(); +init_range(); +init_languageFeatures(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/gotoError/browser/gotoError.js +init_codicons(); +init_lifecycle(); +init_editorExtensions(); +init_codeEditorService(); +init_position(); +init_range(); +init_editorContextKeys(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/gotoError/browser/markerNavigationService.js +init_arrays(); +init_event(); +init_lifecycle(); +init_linkedList(); +init_strings(); +init_uri(); +init_range(); +init_extensions(); +init_instantiation(); +init_configuration(); +init_resources(); +var __decorate78 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param72 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var MarkerCoordinate = class { + constructor(marker, index, total) { + this.marker = marker; + this.index = index; + this.total = total; + } +}; +var MarkerList = class MarkerList2 { + constructor(resourceFilter, _markerService, _configService) { + this._markerService = _markerService; + this._configService = _configService; + this._onDidChange = new Emitter(); + this.onDidChange = this._onDidChange.event; + this._dispoables = new DisposableStore(); + this._markers = []; + this._nextIdx = -1; + if (URI.isUri(resourceFilter)) { + this._resourceFilter = (uri) => uri.toString() === resourceFilter.toString(); + } else if (resourceFilter) { + this._resourceFilter = resourceFilter; + } + const compareOrder = this._configService.getValue("problems.sortOrder"); + const compareMarker = (a, b) => { + let res = compare(a.resource.toString(), b.resource.toString()); + if (res === 0) { + if (compareOrder === "position") { + res = Range.compareRangesUsingStarts(a, b) || MarkerSeverity.compare(a.severity, b.severity); + } else { + res = MarkerSeverity.compare(a.severity, b.severity) || Range.compareRangesUsingStarts(a, b); + } + } + return res; + }; + const updateMarker = () => { + let newMarkers = this._markerService.read({ + resource: URI.isUri(resourceFilter) ? resourceFilter : void 0, + severities: MarkerSeverity.Error | MarkerSeverity.Warning | MarkerSeverity.Info + }); + if (typeof resourceFilter === "function") { + newMarkers = newMarkers.filter((m) => this._resourceFilter(m.resource)); + } + newMarkers.sort(compareMarker); + if (equals(newMarkers, this._markers, (a, b) => a.resource.toString() === b.resource.toString() && a.startLineNumber === b.startLineNumber && a.startColumn === b.startColumn && a.endLineNumber === b.endLineNumber && a.endColumn === b.endColumn && a.severity === b.severity && a.message === b.message)) { + return false; + } + this._markers = newMarkers; + return true; + }; + updateMarker(); + this._dispoables.add(_markerService.onMarkerChanged((uris) => { + if (!this._resourceFilter || uris.some((uri) => this._resourceFilter(uri))) { + if (updateMarker()) { + this._nextIdx = -1; + this._onDidChange.fire(); + } + } + })); + } + dispose() { + this._dispoables.dispose(); + this._onDidChange.dispose(); + } + matches(uri) { + if (!this._resourceFilter && !uri) { + return true; + } + if (!this._resourceFilter || !uri) { + return false; + } + return this._resourceFilter(uri); + } + get selected() { + const marker = this._markers[this._nextIdx]; + return marker && new MarkerCoordinate(marker, this._nextIdx + 1, this._markers.length); + } + _initIdx(model, position, fwd) { + let idx = this._markers.findIndex((marker) => isEqual(marker.resource, model.uri)); + if (idx < 0) { + idx = binarySearch2(this._markers.length, (idx2) => compare(this._markers[idx2].resource.toString(), model.uri.toString())); + if (idx < 0) { + idx = ~idx; + } + if (fwd) { + this._nextIdx = idx; + } else { + this._nextIdx = (this._markers.length + idx - 1) % this._markers.length; + } + } else { + let found = false; + let wentPast = false; + for (let i2 = idx; i2 < this._markers.length; i2++) { + let range2 = Range.lift(this._markers[i2]); + if (range2.isEmpty()) { + const word = model.getWordAtPosition(range2.getStartPosition()); + if (word) { + range2 = new Range(range2.startLineNumber, word.startColumn, range2.startLineNumber, word.endColumn); + } + } + if (position && (range2.containsPosition(position) || position.isBeforeOrEqual(range2.getStartPosition()))) { + this._nextIdx = i2; + found = true; + wentPast = !range2.containsPosition(position); + break; + } + if (this._markers[i2].resource.toString() !== model.uri.toString()) { + break; + } + } + if (!found) { + this._nextIdx = fwd ? 0 : this._markers.length - 1; + } else if (wentPast && !fwd) { + this._nextIdx -= 1; + } + } + if (this._nextIdx < 0) { + this._nextIdx = this._markers.length - 1; + } + } + resetIndex() { + this._nextIdx = -1; + } + move(fwd, model, position) { + if (this._markers.length === 0) { + return false; + } + const oldIdx = this._nextIdx; + if (this._nextIdx === -1) { + this._initIdx(model, position, fwd); + } else if (fwd) { + this._nextIdx = (this._nextIdx + 1) % this._markers.length; + } else if (!fwd) { + this._nextIdx = (this._nextIdx - 1 + this._markers.length) % this._markers.length; + } + if (oldIdx !== this._nextIdx) { + return true; + } + return false; + } + find(uri, position) { + let idx = this._markers.findIndex((marker) => marker.resource.toString() === uri.toString()); + if (idx < 0) { + return void 0; + } + for (; idx < this._markers.length; idx++) { + if (Range.containsPosition(this._markers[idx], position)) { + return new MarkerCoordinate(this._markers[idx], idx + 1, this._markers.length); + } + } + return void 0; + } +}; +MarkerList = __decorate78([ + __param72(1, IMarkerService), + __param72(2, IConfigurationService) +], MarkerList); +var IMarkerNavigationService = createDecorator("IMarkerNavigationService"); +var MarkerNavigationService = class MarkerNavigationService2 { + constructor(_markerService, _configService) { + this._markerService = _markerService; + this._configService = _configService; + this._provider = new LinkedList(); + } + getMarkerList(resource) { + for (const provider of this._provider) { + const result = provider.getMarkerList(resource); + if (result) { + return result; + } + } + return new MarkerList(resource, this._markerService, this._configService); + } +}; +MarkerNavigationService = __decorate78([ + __param72(0, IMarkerService), + __param72(1, IConfigurationService) +], MarkerNavigationService); +registerSingleton( + IMarkerNavigationService, + MarkerNavigationService, + 1 + /* InstantiationType.Delayed */ +); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/gotoError/browser/gotoError.js +init_nls(); +init_actions2(); +init_contextkey(); +init_instantiation(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/gotoError/browser/gotoErrorWidget.js +init_dom(); +init_arrays(); +init_color(); +init_event(); +init_lifecycle(); +init_resources(); +init_strings(); +init_range(); +init_nls(); +init_actions2(); +init_contextkey(); +init_instantiation(); + +// node_modules/monaco-editor-core/esm/vs/base/browser/ui/severityIcon/severityIcon.js +init_codicons(); +init_themables(); +var SeverityIcon; +(function(SeverityIcon2) { + function className2(severity) { + switch (severity) { + case severity_default.Ignore: + return "severity-ignore " + ThemeIcon.asClassName(Codicon.info); + case severity_default.Info: + return ThemeIcon.asClassName(Codicon.info); + case severity_default.Warning: + return ThemeIcon.asClassName(Codicon.warning); + case severity_default.Error: + return ThemeIcon.asClassName(Codicon.error); + default: + return ""; + } + } + SeverityIcon2.className = className2; +})(SeverityIcon || (SeverityIcon = {})); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/gotoError/browser/gotoErrorWidget.js +init_colorRegistry(); +init_themeService(); +var __decorate79 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param73 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var MarkerNavigationWidget_1; +var MessageWidget2 = class { + constructor(parent, editor2, onRelatedInformation, _openerService, _labelService) { + this._openerService = _openerService; + this._labelService = _labelService; + this._lines = 0; + this._longestLineLength = 0; + this._relatedDiagnostics = /* @__PURE__ */ new WeakMap(); + this._disposables = new DisposableStore(); + this._editor = editor2; + const domNode = document.createElement("div"); + domNode.className = "descriptioncontainer"; + this._messageBlock = document.createElement("div"); + this._messageBlock.classList.add("message"); + this._messageBlock.setAttribute("aria-live", "assertive"); + this._messageBlock.setAttribute("role", "alert"); + domNode.appendChild(this._messageBlock); + this._relatedBlock = document.createElement("div"); + domNode.appendChild(this._relatedBlock); + this._disposables.add(addStandardDisposableListener(this._relatedBlock, "click", (event) => { + event.preventDefault(); + const related = this._relatedDiagnostics.get(event.target); + if (related) { + onRelatedInformation(related); + } + })); + this._scrollable = new ScrollableElement(domNode, { + horizontal: 1, + vertical: 1, + useShadows: false, + horizontalScrollbarSize: 6, + verticalScrollbarSize: 6 + }); + parent.appendChild(this._scrollable.getDomNode()); + this._disposables.add(this._scrollable.onScroll((e) => { + domNode.style.left = `-${e.scrollLeft}px`; + domNode.style.top = `-${e.scrollTop}px`; + })); + this._disposables.add(this._scrollable); + } + dispose() { + dispose(this._disposables); + } + update(marker) { + const { source, message, relatedInformation, code } = marker; + let sourceAndCodeLength = (source?.length || 0) + "()".length; + if (code) { + if (typeof code === "string") { + sourceAndCodeLength += code.length; + } else { + sourceAndCodeLength += code.value.length; + } + } + const lines = splitLines(message); + this._lines = lines.length; + this._longestLineLength = 0; + for (const line of lines) { + this._longestLineLength = Math.max(line.length + sourceAndCodeLength, this._longestLineLength); + } + clearNode(this._messageBlock); + this._messageBlock.setAttribute("aria-label", this.getAriaLabel(marker)); + this._editor.applyFontInfo(this._messageBlock); + let lastLineElement = this._messageBlock; + for (const line of lines) { + lastLineElement = document.createElement("div"); + lastLineElement.innerText = line; + if (line === "") { + lastLineElement.style.height = this._messageBlock.style.lineHeight; + } + this._messageBlock.appendChild(lastLineElement); + } + if (source || code) { + const detailsElement = document.createElement("span"); + detailsElement.classList.add("details"); + lastLineElement.appendChild(detailsElement); + if (source) { + const sourceElement = document.createElement("span"); + sourceElement.innerText = source; + sourceElement.classList.add("source"); + detailsElement.appendChild(sourceElement); + } + if (code) { + if (typeof code === "string") { + const codeElement = document.createElement("span"); + codeElement.innerText = `(${code})`; + codeElement.classList.add("code"); + detailsElement.appendChild(codeElement); + } else { + this._codeLink = $("a.code-link"); + this._codeLink.setAttribute("href", `${code.target.toString()}`); + this._codeLink.onclick = (e) => { + this._openerService.open(code.target, { allowCommands: true }); + e.preventDefault(); + e.stopPropagation(); + }; + const codeElement = append(this._codeLink, $("span")); + codeElement.innerText = code.value; + detailsElement.appendChild(this._codeLink); + } + } + } + clearNode(this._relatedBlock); + this._editor.applyFontInfo(this._relatedBlock); + if (isNonEmptyArray(relatedInformation)) { + const relatedInformationNode = this._relatedBlock.appendChild(document.createElement("div")); + relatedInformationNode.style.paddingTop = `${Math.floor(this._editor.getOption( + 75 + /* EditorOption.lineHeight */ + ) * 0.66)}px`; + this._lines += 1; + for (const related of relatedInformation) { + const container = document.createElement("div"); + const relatedResource = document.createElement("a"); + relatedResource.classList.add("filename"); + relatedResource.innerText = `${this._labelService.getUriBasenameLabel(related.resource)}(${related.startLineNumber}, ${related.startColumn}): `; + relatedResource.title = this._labelService.getUriLabel(related.resource); + this._relatedDiagnostics.set(relatedResource, related); + const relatedMessage = document.createElement("span"); + relatedMessage.innerText = related.message; + container.appendChild(relatedResource); + container.appendChild(relatedMessage); + this._lines += 1; + relatedInformationNode.appendChild(container); + } + } + const fontInfo = this._editor.getOption( + 59 + /* EditorOption.fontInfo */ + ); + const scrollWidth = Math.ceil(fontInfo.typicalFullwidthCharacterWidth * this._longestLineLength * 0.75); + const scrollHeight = fontInfo.lineHeight * this._lines; + this._scrollable.setScrollDimensions({ scrollWidth, scrollHeight }); + } + layout(height, width2) { + this._scrollable.getDomNode().style.height = `${height}px`; + this._scrollable.getDomNode().style.width = `${width2}px`; + this._scrollable.setScrollDimensions({ width: width2, height }); + } + getHeightInLines() { + return Math.min(17, this._lines); + } + getAriaLabel(marker) { + let severityLabel = ""; + switch (marker.severity) { + case MarkerSeverity.Error: + severityLabel = localize(1024, "Error"); + break; + case MarkerSeverity.Warning: + severityLabel = localize(1025, "Warning"); + break; + case MarkerSeverity.Info: + severityLabel = localize(1026, "Info"); + break; + case MarkerSeverity.Hint: + severityLabel = localize(1027, "Hint"); + break; + } + let ariaLabel = localize(1028, "{0} at {1}. ", severityLabel, marker.startLineNumber + ":" + marker.startColumn); + const model = this._editor.getModel(); + if (model && marker.startLineNumber <= model.getLineCount() && marker.startLineNumber >= 1) { + const lineContent = model.getLineContent(marker.startLineNumber); + ariaLabel = `${lineContent}, ${ariaLabel}`; + } + return ariaLabel; + } +}; +var MarkerNavigationWidget = class MarkerNavigationWidget2 extends PeekViewWidget { + static { + MarkerNavigationWidget_1 = this; + } + static { + this.TitleMenu = new MenuId("gotoErrorTitleMenu"); + } + constructor(editor2, _themeService, _openerService, _menuService, instantiationService, _contextKeyService, _labelService) { + super(editor2, { showArrow: true, showFrame: true, isAccessible: true, frameWidth: 1 }, instantiationService); + this._themeService = _themeService; + this._openerService = _openerService; + this._menuService = _menuService; + this._contextKeyService = _contextKeyService; + this._labelService = _labelService; + this._callOnDispose = new DisposableStore(); + this._onDidSelectRelatedInformation = new Emitter(); + this.onDidSelectRelatedInformation = this._onDidSelectRelatedInformation.event; + this._severity = MarkerSeverity.Warning; + this._backgroundColor = Color.white; + this._applyTheme(_themeService.getColorTheme()); + this._callOnDispose.add(_themeService.onDidColorThemeChange(this._applyTheme.bind(this))); + this.create(); + } + _applyTheme(theme) { + this._backgroundColor = theme.getColor(editorMarkerNavigationBackground); + let colorId = editorMarkerNavigationError; + let headerBackground = editorMarkerNavigationErrorHeader; + if (this._severity === MarkerSeverity.Warning) { + colorId = editorMarkerNavigationWarning; + headerBackground = editorMarkerNavigationWarningHeader; + } else if (this._severity === MarkerSeverity.Info) { + colorId = editorMarkerNavigationInfo; + headerBackground = editorMarkerNavigationInfoHeader; + } + const frameColor = theme.getColor(colorId); + const headerBg = theme.getColor(headerBackground); + this.style({ + arrowColor: frameColor, + frameColor, + headerBackgroundColor: headerBg, + primaryHeadingColor: theme.getColor(peekViewTitleForeground), + secondaryHeadingColor: theme.getColor(peekViewTitleInfoForeground) + }); + } + _applyStyles() { + if (this._parentContainer) { + this._parentContainer.style.backgroundColor = this._backgroundColor ? this._backgroundColor.toString() : ""; + } + super._applyStyles(); + } + dispose() { + this._callOnDispose.dispose(); + super.dispose(); + } + _fillHead(container) { + super._fillHead(container); + this._disposables.add(this._actionbarWidget.actionRunner.onWillRun((e) => this.editor.focus())); + const menu = this._menuService.getMenuActions(MarkerNavigationWidget_1.TitleMenu, this._contextKeyService); + const actions = getFlatActionBarActions(menu); + this._actionbarWidget.push(actions, { label: false, icon: true, index: 0 }); + } + _fillTitleIcon(container) { + this._icon = append(container, $("")); + } + _fillBody(container) { + this._parentContainer = container; + container.classList.add("marker-widget"); + this._parentContainer.tabIndex = 0; + this._parentContainer.setAttribute("role", "tooltip"); + this._container = document.createElement("div"); + container.appendChild(this._container); + this._message = new MessageWidget2(this._container, this.editor, (related) => this._onDidSelectRelatedInformation.fire(related), this._openerService, this._labelService); + this._disposables.add(this._message); + } + show() { + throw new Error("call showAtMarker"); + } + showAtMarker(marker, markerIdx, markerCount) { + this._container.classList.remove("stale"); + this._message.update(marker); + this._severity = marker.severity; + this._applyTheme(this._themeService.getColorTheme()); + const range2 = Range.lift(marker); + const editorPosition = this.editor.getPosition(); + const position = editorPosition && range2.containsPosition(editorPosition) ? editorPosition : range2.getStartPosition(); + super.show(position, this.computeRequiredHeight()); + const model = this.editor.getModel(); + if (model) { + const detail = markerCount > 1 ? localize(1029, "{0} of {1} problems", markerIdx, markerCount) : localize(1030, "{0} of {1} problem", markerIdx, markerCount); + this.setTitle(basename2(model.uri), detail); + } + this._icon.className = `codicon ${SeverityIcon.className(MarkerSeverity.toSeverity(this._severity))}`; + this.editor.revealPositionNearTop( + position, + 0 + /* ScrollType.Smooth */ + ); + this.editor.focus(); + } + updateMarker(marker) { + this._container.classList.remove("stale"); + this._message.update(marker); + } + showStale() { + this._container.classList.add("stale"); + this._relayout(); + } + _doLayoutBody(heightInPixel, widthInPixel) { + super._doLayoutBody(heightInPixel, widthInPixel); + this._heightInPixel = heightInPixel; + this._message.layout(heightInPixel, widthInPixel); + this._container.style.height = `${heightInPixel}px`; + } + _onWidth(widthInPixel) { + this._message.layout(this._heightInPixel, widthInPixel); + } + _relayout() { + super._relayout(this.computeRequiredHeight()); + } + computeRequiredHeight() { + return 3 + this._message.getHeightInLines(); + } +}; +MarkerNavigationWidget = MarkerNavigationWidget_1 = __decorate79([ + __param73(1, IThemeService), + __param73(2, IOpenerService), + __param73(3, IMenuService), + __param73(4, IInstantiationService), + __param73(5, IContextKeyService), + __param73(6, ILabelService) +], MarkerNavigationWidget); +var errorDefault = oneOf(editorErrorForeground, editorErrorBorder); +var warningDefault = oneOf(editorWarningForeground, editorWarningBorder); +var infoDefault = oneOf(editorInfoForeground, editorInfoBorder); +var editorMarkerNavigationError = registerColor("editorMarkerNavigationError.background", { dark: errorDefault, light: errorDefault, hcDark: contrastBorder, hcLight: contrastBorder }, localize(1031, "Editor marker navigation widget error color.")); +var editorMarkerNavigationErrorHeader = registerColor("editorMarkerNavigationError.headerBackground", { dark: transparent(editorMarkerNavigationError, 0.1), light: transparent(editorMarkerNavigationError, 0.1), hcDark: null, hcLight: null }, localize(1032, "Editor marker navigation widget error heading background.")); +var editorMarkerNavigationWarning = registerColor("editorMarkerNavigationWarning.background", { dark: warningDefault, light: warningDefault, hcDark: contrastBorder, hcLight: contrastBorder }, localize(1033, "Editor marker navigation widget warning color.")); +var editorMarkerNavigationWarningHeader = registerColor("editorMarkerNavigationWarning.headerBackground", { dark: transparent(editorMarkerNavigationWarning, 0.1), light: transparent(editorMarkerNavigationWarning, 0.1), hcDark: "#0C141F", hcLight: transparent(editorMarkerNavigationWarning, 0.2) }, localize(1034, "Editor marker navigation widget warning heading background.")); +var editorMarkerNavigationInfo = registerColor("editorMarkerNavigationInfo.background", { dark: infoDefault, light: infoDefault, hcDark: contrastBorder, hcLight: contrastBorder }, localize(1035, "Editor marker navigation widget info color.")); +var editorMarkerNavigationInfoHeader = registerColor("editorMarkerNavigationInfo.headerBackground", { dark: transparent(editorMarkerNavigationInfo, 0.1), light: transparent(editorMarkerNavigationInfo, 0.1), hcDark: null, hcLight: null }, localize(1036, "Editor marker navigation widget info heading background.")); +var editorMarkerNavigationBackground = registerColor("editorMarkerNavigation.background", editorBackground, localize(1037, "Editor marker navigation widget background.")); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/gotoError/browser/gotoError.js +var __decorate80 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param74 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var MarkerController_1; +var MarkerController = class MarkerController2 { + static { + MarkerController_1 = this; + } + static { + this.ID = "editor.contrib.markerController"; + } + static get(editor2) { + return editor2.getContribution(MarkerController_1.ID); + } + constructor(editor2, _markerNavigationService, _contextKeyService, _editorService, _instantiationService) { + this._markerNavigationService = _markerNavigationService; + this._contextKeyService = _contextKeyService; + this._editorService = _editorService; + this._instantiationService = _instantiationService; + this._sessionDispoables = new DisposableStore(); + this._editor = editor2; + this._widgetVisible = CONTEXT_MARKERS_NAVIGATION_VISIBLE.bindTo(this._contextKeyService); + } + dispose() { + this._cleanUp(); + this._sessionDispoables.dispose(); + } + _cleanUp() { + this._widgetVisible.reset(); + this._sessionDispoables.clear(); + this._widget = void 0; + this._model = void 0; + } + _getOrCreateModel(uri) { + if (this._model && this._model.matches(uri)) { + return this._model; + } + let reusePosition = false; + if (this._model) { + reusePosition = true; + this._cleanUp(); + } + this._model = this._markerNavigationService.getMarkerList(uri); + if (reusePosition) { + this._model.move(true, this._editor.getModel(), this._editor.getPosition()); + } + this._widget = this._instantiationService.createInstance(MarkerNavigationWidget, this._editor); + this._widget.onDidClose(() => this.close(), this, this._sessionDispoables); + this._widgetVisible.set(true); + this._sessionDispoables.add(this._model); + this._sessionDispoables.add(this._widget); + this._sessionDispoables.add(this._editor.onDidChangeCursorPosition((e) => { + if (!this._model?.selected || !Range.containsPosition(this._model?.selected.marker, e.position)) { + this._model?.resetIndex(); + } + })); + this._sessionDispoables.add(this._model.onDidChange(() => { + if (!this._widget || !this._widget.position || !this._model) { + return; + } + const info = this._model.find(this._editor.getModel().uri, this._widget.position); + if (info) { + this._widget.updateMarker(info.marker); + } else { + this._widget.showStale(); + } + })); + this._sessionDispoables.add(this._widget.onDidSelectRelatedInformation((related) => { + this._editorService.openCodeEditor({ + resource: related.resource, + options: { pinned: true, revealIfOpened: true, selection: Range.lift(related).collapseToStart() } + }, this._editor); + this.close(false); + })); + this._sessionDispoables.add(this._editor.onDidChangeModel(() => this._cleanUp())); + return this._model; + } + close(focusEditor = true) { + this._cleanUp(); + if (focusEditor) { + this._editor.focus(); + } + } + showAtMarker(marker) { + if (!this._editor.hasModel()) { + return; + } + const textModel = this._editor.getModel(); + const model = this._getOrCreateModel(textModel.uri); + model.resetIndex(); + model.move(true, textModel, new Position(marker.startLineNumber, marker.startColumn)); + if (model.selected) { + this._widget.showAtMarker(model.selected.marker, model.selected.index, model.selected.total); + } + } + async navigate(next, multiFile) { + if (!this._editor.hasModel()) { + return; + } + const textModel = this._editor.getModel(); + const model = this._getOrCreateModel(multiFile ? void 0 : textModel.uri); + model.move(next, textModel, this._editor.getPosition()); + if (!model.selected) { + return; + } + if (model.selected.marker.resource.toString() !== textModel.uri.toString()) { + this._cleanUp(); + const otherEditor = await this._editorService.openCodeEditor({ + resource: model.selected.marker.resource, + options: { pinned: false, revealIfOpened: true, selectionRevealType: 2, selection: model.selected.marker } + }, this._editor); + if (otherEditor) { + MarkerController_1.get(otherEditor)?.close(); + MarkerController_1.get(otherEditor)?.navigate(next, multiFile); + } + } else { + this._widget.showAtMarker(model.selected.marker, model.selected.index, model.selected.total); + } + } +}; +MarkerController = MarkerController_1 = __decorate80([ + __param74(1, IMarkerNavigationService), + __param74(2, IContextKeyService), + __param74(3, ICodeEditorService), + __param74(4, IInstantiationService) +], MarkerController); +var MarkerNavigationAction = class extends EditorAction { + constructor(_next, _multiFile, opts) { + super(opts); + this._next = _next; + this._multiFile = _multiFile; + } + async run(_accessor, editor2) { + if (editor2.hasModel()) { + await MarkerController.get(editor2)?.navigate(this._next, this._multiFile); + } + } +}; +var NextMarkerAction = class _NextMarkerAction extends MarkerNavigationAction { + static { + this.ID = "editor.action.marker.next"; + } + static { + this.LABEL = localize2(1020, "Go to Next Problem (Error, Warning, Info)"); + } + constructor() { + super(true, false, { + id: _NextMarkerAction.ID, + label: _NextMarkerAction.LABEL, + precondition: void 0, + kbOpts: { + kbExpr: EditorContextKeys.focus, + primary: 512 | 66, + weight: 100 + /* KeybindingWeight.EditorContrib */ + }, + menuOpts: { + menuId: MarkerNavigationWidget.TitleMenu, + title: _NextMarkerAction.LABEL.value, + icon: registerIcon("marker-navigation-next", Codicon.arrowDown, localize(1016, "Icon for goto next marker.")), + group: "navigation", + order: 1 + } + }); + } +}; +var PrevMarkerAction = class _PrevMarkerAction extends MarkerNavigationAction { + static { + this.ID = "editor.action.marker.prev"; + } + static { + this.LABEL = localize2(1021, "Go to Previous Problem (Error, Warning, Info)"); + } + constructor() { + super(false, false, { + id: _PrevMarkerAction.ID, + label: _PrevMarkerAction.LABEL, + precondition: void 0, + kbOpts: { + kbExpr: EditorContextKeys.focus, + primary: 1024 | 512 | 66, + weight: 100 + /* KeybindingWeight.EditorContrib */ + }, + menuOpts: { + menuId: MarkerNavigationWidget.TitleMenu, + title: _PrevMarkerAction.LABEL.value, + icon: registerIcon("marker-navigation-previous", Codicon.arrowUp, localize(1017, "Icon for goto previous marker.")), + group: "navigation", + order: 2 + } + }); + } +}; +var NextMarkerInFilesAction = class extends MarkerNavigationAction { + constructor() { + super(true, true, { + id: "editor.action.marker.nextInFiles", + label: localize2(1022, "Go to Next Problem in Files (Error, Warning, Info)"), + precondition: void 0, + kbOpts: { + kbExpr: EditorContextKeys.focus, + primary: 66, + weight: 100 + /* KeybindingWeight.EditorContrib */ + }, + menuOpts: { + menuId: MenuId.MenubarGoMenu, + title: localize(1018, "Next &&Problem"), + group: "6_problem_nav", + order: 1 + } + }); + } +}; +var PrevMarkerInFilesAction = class extends MarkerNavigationAction { + constructor() { + super(false, true, { + id: "editor.action.marker.prevInFiles", + label: localize2(1023, "Go to Previous Problem in Files (Error, Warning, Info)"), + precondition: void 0, + kbOpts: { + kbExpr: EditorContextKeys.focus, + primary: 1024 | 66, + weight: 100 + /* KeybindingWeight.EditorContrib */ + }, + menuOpts: { + menuId: MenuId.MenubarGoMenu, + title: localize(1019, "Previous &&Problem"), + group: "6_problem_nav", + order: 2 + } + }); + } +}; +registerEditorContribution( + MarkerController.ID, + MarkerController, + 4 + /* EditorContributionInstantiation.Lazy */ +); +registerEditorAction(NextMarkerAction); +registerEditorAction(PrevMarkerAction); +registerEditorAction(NextMarkerInFilesAction); +registerEditorAction(PrevMarkerInFilesAction); +var CONTEXT_MARKERS_NAVIGATION_VISIBLE = new RawContextKey("markersNavigationVisible", false); +var MarkerCommand = EditorCommand.bindToContribution(MarkerController.get); +registerEditorCommand(new MarkerCommand({ + id: "closeMarkersNavigation", + precondition: CONTEXT_MARKERS_NAVIGATION_VISIBLE, + handler: (x) => x.close(), + kbOpts: { + weight: 100 + 50, + kbExpr: EditorContextKeys.focus, + primary: 9, + secondary: [ + 1024 | 9 + /* KeyCode.Escape */ + ] + } +})); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/hover/browser/markerHoverParticipant.js +init_nls(); +init_themables(); +init_codicons(); +var __decorate81 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param75 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var $14 = $; +var MarkerHover = class { + constructor(owner, range2, marker) { + this.owner = owner; + this.range = range2; + this.marker = marker; + } + isValidForHoverAnchor(anchor) { + return anchor.type === 1 && this.range.startColumn <= anchor.range.startColumn && this.range.endColumn >= anchor.range.endColumn; + } +}; +var markerCodeActionTrigger = { + type: 1, + filter: { include: CodeActionKind.QuickFix }, + triggerAction: CodeActionTriggerSource.QuickFixHover +}; +var MarkerHoverParticipant = class MarkerHoverParticipant2 { + constructor(_editor, _markerDecorationsService, _openerService, _languageFeaturesService) { + this._editor = _editor; + this._markerDecorationsService = _markerDecorationsService; + this._openerService = _openerService; + this._languageFeaturesService = _languageFeaturesService; + this.hoverOrdinal = 1; + this.recentMarkerCodeActionsInfo = void 0; + } + computeSync(anchor, lineDecorations) { + if (!this._editor.hasModel() || anchor.type !== 1 && !anchor.supportsMarkerHover) { + return []; + } + const model = this._editor.getModel(); + const anchorRange = anchor.range; + if (!model.isValidRange(anchor.range)) { + return []; + } + const lineNumber = anchorRange.startLineNumber; + const maxColumn = model.getLineMaxColumn(lineNumber); + const result = []; + for (const d of lineDecorations) { + const startColumn = d.range.startLineNumber === lineNumber ? d.range.startColumn : 1; + const endColumn = d.range.endLineNumber === lineNumber ? d.range.endColumn : maxColumn; + const marker = this._markerDecorationsService.getMarker(model.uri, d); + if (!marker) { + continue; + } + const range2 = new Range(anchor.range.startLineNumber, startColumn, anchor.range.startLineNumber, endColumn); + result.push(new MarkerHover(this, range2, marker)); + } + return result; + } + renderHoverParts(context, hoverParts) { + if (!hoverParts.length) { + return new RenderedHoverParts([]); + } + const renderedHoverParts = []; + hoverParts.forEach((hoverPart) => { + const renderedMarkerHover = this._renderMarkerHover(hoverPart); + context.fragment.appendChild(renderedMarkerHover.hoverElement); + renderedHoverParts.push(renderedMarkerHover); + }); + const markerHoverForStatusbar = hoverParts.length === 1 ? hoverParts[0] : hoverParts.sort((a, b) => MarkerSeverity.compare(a.marker.severity, b.marker.severity))[0]; + const disposables = this._renderMarkerStatusbar(context, markerHoverForStatusbar); + return new RenderedHoverParts(renderedHoverParts, disposables); + } + getAccessibleContent(hoverPart) { + return hoverPart.marker.message; + } + _renderMarkerHover(markerHover) { + const disposables = new DisposableStore(); + const hoverElement = $14("div.hover-row"); + const markerElement = append(hoverElement, $14("div.marker.hover-contents")); + const { source, message, code, relatedInformation } = markerHover.marker; + this._editor.applyFontInfo(markerElement); + const messageElement = append(markerElement, $14("span")); + messageElement.style.whiteSpace = "pre-wrap"; + messageElement.innerText = message; + if (source || code) { + if (code && typeof code !== "string") { + const sourceAndCodeElement = $14("span"); + if (source) { + const sourceElement = append(sourceAndCodeElement, $14("span")); + sourceElement.innerText = source; + } + const codeLink = append(sourceAndCodeElement, $14("a.code-link")); + codeLink.setAttribute("href", code.target.toString(true)); + disposables.add(addDisposableListener(codeLink, "click", (e) => { + this._openerService.open(code.target, { allowCommands: true }); + e.preventDefault(); + e.stopPropagation(); + })); + const codeElement = append(codeLink, $14("span")); + codeElement.innerText = code.value; + const detailsElement = append(markerElement, sourceAndCodeElement); + detailsElement.style.opacity = "0.6"; + detailsElement.style.paddingLeft = "6px"; + } else { + const detailsElement = append(markerElement, $14("span")); + detailsElement.style.opacity = "0.6"; + detailsElement.style.paddingLeft = "6px"; + detailsElement.innerText = source && code ? `${source}(${code})` : source ? source : `(${code})`; + } + } + if (isNonEmptyArray(relatedInformation)) { + for (const { message: message2, resource, startLineNumber, startColumn } of relatedInformation) { + const relatedInfoContainer = append(markerElement, $14("div")); + relatedInfoContainer.style.marginTop = "8px"; + const a = append(relatedInfoContainer, $14("a")); + a.innerText = `${basename2(resource)}(${startLineNumber}, ${startColumn}): `; + a.style.cursor = "pointer"; + disposables.add(addDisposableListener(a, "click", (e) => { + e.stopPropagation(); + e.preventDefault(); + if (this._openerService) { + const editorOptions = { selection: { startLineNumber, startColumn } }; + this._openerService.open(resource, { + fromUserGesture: true, + editorOptions + }).catch(onUnexpectedError); + } + })); + const messageElement2 = append(relatedInfoContainer, $14("span")); + messageElement2.innerText = message2; + this._editor.applyFontInfo(messageElement2); + } + } + const renderedHoverPart = { + hoverPart: markerHover, + hoverElement, + dispose: () => disposables.dispose() + }; + return renderedHoverPart; + } + _renderMarkerStatusbar(context, markerHover) { + const disposables = new DisposableStore(); + if (markerHover.marker.severity === MarkerSeverity.Error || markerHover.marker.severity === MarkerSeverity.Warning || markerHover.marker.severity === MarkerSeverity.Info) { + const markerController = MarkerController.get(this._editor); + if (markerController) { + context.statusBar.addAction({ + label: localize(1139, "View Problem"), + commandId: NextMarkerAction.ID, + run: () => { + context.hide(); + markerController.showAtMarker(markerHover.marker); + this._editor.focus(); + } + }); + } + } + if (!this._editor.getOption( + 104 + /* EditorOption.readOnly */ + )) { + const quickfixPlaceholderElement = context.statusBar.append($14("div")); + if (this.recentMarkerCodeActionsInfo) { + if (IMarkerData.makeKey(this.recentMarkerCodeActionsInfo.marker) === IMarkerData.makeKey(markerHover.marker)) { + if (!this.recentMarkerCodeActionsInfo.hasCodeActions) { + quickfixPlaceholderElement.textContent = localize(1140, "No quick fixes available"); + } + } else { + this.recentMarkerCodeActionsInfo = void 0; + } + } + const updatePlaceholderDisposable = this.recentMarkerCodeActionsInfo && !this.recentMarkerCodeActionsInfo.hasCodeActions ? Disposable.None : disposableTimeout(() => quickfixPlaceholderElement.textContent = localize(1141, "Checking for quick fixes..."), 200, disposables); + if (!quickfixPlaceholderElement.textContent) { + quickfixPlaceholderElement.textContent = String.fromCharCode(160); + } + const codeActionsPromise = this.getCodeActions(markerHover.marker); + disposables.add(toDisposable(() => codeActionsPromise.cancel())); + codeActionsPromise.then((actions) => { + updatePlaceholderDisposable.dispose(); + this.recentMarkerCodeActionsInfo = { marker: markerHover.marker, hasCodeActions: actions.validActions.length > 0 }; + if (!this.recentMarkerCodeActionsInfo.hasCodeActions) { + actions.dispose(); + quickfixPlaceholderElement.textContent = localize(1142, "No quick fixes available"); + return; + } + quickfixPlaceholderElement.style.display = "none"; + let showing = false; + disposables.add(toDisposable(() => { + if (!showing) { + actions.dispose(); + } + })); + context.statusBar.addAction({ + label: localize(1143, "Quick Fix..."), + commandId: quickFixCommandId, + run: (target) => { + showing = true; + const controller = CodeActionController.get(this._editor); + const elementPosition = getDomNodePagePosition(target); + context.hide(); + controller?.showCodeActions(markerCodeActionTrigger, actions, { + x: elementPosition.left, + y: elementPosition.top, + width: elementPosition.width, + height: elementPosition.height + }); + } + }); + const aiCodeAction = actions.validActions.find((action) => action.action.isAI); + if (aiCodeAction) { + context.statusBar.addAction({ + label: aiCodeAction.action.title, + commandId: aiCodeAction.action.command?.id ?? "", + iconClass: ThemeIcon.asClassName(Codicon.sparkle), + run: () => { + const controller = CodeActionController.get(this._editor); + controller?.applyCodeAction(aiCodeAction, false, false, ApplyCodeActionReason.FromProblemsHover); + } + }); + } + context.onContentsChanged(); + }, onUnexpectedError); + } + return disposables; + } + getCodeActions(marker) { + return createCancelablePromise((cancellationToken) => { + return getCodeActions(this._languageFeaturesService.codeActionProvider, this._editor.getModel(), new Range(marker.startLineNumber, marker.startColumn, marker.endLineNumber, marker.endColumn), markerCodeActionTrigger, Progress.None, cancellationToken); + }); + } +}; +MarkerHoverParticipant = __decorate81([ + __param75(1, IMarkerDecorationsService), + __param75(2, IOpenerService), + __param75(3, ILanguageFeaturesService) +], MarkerHoverParticipant); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/hover/browser/contentHoverRendered.js +var __decorate82 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param76 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var RenderedContentHover_1; +var RenderedContentHoverParts_1; +var RenderedContentHover = RenderedContentHover_1 = class RenderedContentHover2 extends Disposable { + constructor(editor2, hoverResult, participants, context, keybindingService, hoverService, clipboardService) { + super(); + const parts = hoverResult.hoverParts; + this._renderedHoverParts = this._register(new RenderedContentHoverParts(editor2, participants, parts, context, keybindingService, hoverService, clipboardService)); + const contentHoverComputerOptions = hoverResult.options; + const anchor = contentHoverComputerOptions.anchor; + const { showAtPosition, showAtSecondaryPosition } = RenderedContentHover_1.computeHoverPositions(editor2, anchor.range, parts); + this.shouldAppearBeforeContent = parts.some((m) => m.isBeforeContent); + this.showAtPosition = showAtPosition; + this.showAtSecondaryPosition = showAtSecondaryPosition; + this.initialMousePosX = anchor.initialMousePosX; + this.initialMousePosY = anchor.initialMousePosY; + this.shouldFocus = contentHoverComputerOptions.shouldFocus; + this.source = contentHoverComputerOptions.source; + } + get domNode() { + return this._renderedHoverParts.domNode; + } + get domNodeHasChildren() { + return this._renderedHoverParts.domNodeHasChildren; + } + get focusedHoverPartIndex() { + return this._renderedHoverParts.focusedHoverPartIndex; + } + get hoverPartsCount() { + return this._renderedHoverParts.hoverPartsCount; + } + focusHoverPartWithIndex(index) { + this._renderedHoverParts.focusHoverPartWithIndex(index); + } + async updateHoverVerbosityLevel(action, index, focus) { + this._renderedHoverParts.updateHoverVerbosityLevel(action, index, focus); + } + isColorPickerVisible() { + return this._renderedHoverParts.isColorPickerVisible(); + } + static computeHoverPositions(editor2, anchorRange, hoverParts) { + let startColumnBoundary = 1; + if (editor2.hasModel()) { + const viewModel = editor2._getViewModel(); + const coordinatesConverter = viewModel.coordinatesConverter; + const anchorViewRange = coordinatesConverter.convertModelRangeToViewRange(anchorRange); + const anchorViewMinColumn = viewModel.getLineMinColumn(anchorViewRange.startLineNumber); + const anchorViewRangeStart = new Position(anchorViewRange.startLineNumber, anchorViewMinColumn); + startColumnBoundary = coordinatesConverter.convertViewPositionToModelPosition(anchorViewRangeStart).column; + } + const anchorStartLineNumber = anchorRange.startLineNumber; + let secondaryPositionColumn = anchorRange.startColumn; + let forceShowAtRange; + for (const hoverPart of hoverParts) { + const hoverPartRange = hoverPart.range; + const hoverPartRangeOnAnchorStartLine = hoverPartRange.startLineNumber === anchorStartLineNumber; + const hoverPartRangeOnAnchorEndLine = hoverPartRange.endLineNumber === anchorStartLineNumber; + const hoverPartRangeIsOnAnchorLine = hoverPartRangeOnAnchorStartLine && hoverPartRangeOnAnchorEndLine; + if (hoverPartRangeIsOnAnchorLine) { + const hoverPartStartColumn = hoverPartRange.startColumn; + const minSecondaryPositionColumn = Math.min(secondaryPositionColumn, hoverPartStartColumn); + secondaryPositionColumn = Math.max(minSecondaryPositionColumn, startColumnBoundary); + } + if (hoverPart.forceShowAtRange) { + forceShowAtRange = hoverPartRange; + } + } + let showAtPosition; + let showAtSecondaryPosition; + if (forceShowAtRange) { + const forceShowAtPosition = forceShowAtRange.getStartPosition(); + showAtPosition = forceShowAtPosition; + showAtSecondaryPosition = forceShowAtPosition; + } else { + showAtPosition = anchorRange.getStartPosition(); + showAtSecondaryPosition = new Position(anchorStartLineNumber, secondaryPositionColumn); + } + return { + showAtPosition, + showAtSecondaryPosition + }; + } +}; +RenderedContentHover = RenderedContentHover_1 = __decorate82([ + __param76(4, IKeybindingService), + __param76(5, IHoverService), + __param76(6, IClipboardService) +], RenderedContentHover); +var RenderedStatusBar = class { + constructor(fragment, _statusBar) { + this._statusBar = _statusBar; + fragment.appendChild(this._statusBar.hoverElement); + } + get hoverElement() { + return this._statusBar.hoverElement; + } + get actions() { + return this._statusBar.actions; + } + dispose() { + this._statusBar.dispose(); + } +}; +var RenderedContentHoverParts = class RenderedContentHoverParts2 extends Disposable { + static { + RenderedContentHoverParts_1 = this; + } + static { + this._DECORATION_OPTIONS = ModelDecorationOptions.register({ + description: "content-hover-highlight", + className: "hoverHighlight" + }); + } + constructor(editor2, participants, hoverParts, context, keybindingService, _hoverService, _clipboardService) { + super(); + this._hoverService = _hoverService; + this._clipboardService = _clipboardService; + this._renderedParts = []; + this._focusedHoverPartIndex = -1; + this._context = context; + this._fragment = document.createDocumentFragment(); + this._register(this._renderParts(participants, hoverParts, context, keybindingService, this._hoverService)); + this._register(this._registerListenersOnRenderedParts()); + this._register(this._createEditorDecorations(editor2, hoverParts)); + this._updateMarkdownAndColorParticipantInfo(participants); + } + _createEditorDecorations(editor2, hoverParts) { + if (hoverParts.length === 0) { + return Disposable.None; + } + let highlightRange2 = hoverParts[0].range; + for (const hoverPart of hoverParts) { + const hoverPartRange = hoverPart.range; + highlightRange2 = Range.plusRange(highlightRange2, hoverPartRange); + } + const highlightDecoration = editor2.createDecorationsCollection(); + highlightDecoration.set([{ + range: highlightRange2, + options: RenderedContentHoverParts_1._DECORATION_OPTIONS + }]); + return toDisposable(() => { + highlightDecoration.clear(); + }); + } + _renderParts(participants, hoverParts, hoverContext, keybindingService, hoverService) { + const statusBar = new EditorHoverStatusBar(keybindingService, hoverService); + const hoverRenderingContext = { + fragment: this._fragment, + statusBar, + ...hoverContext + }; + const disposables = new DisposableStore(); + disposables.add(statusBar); + for (const participant of participants) { + const renderedHoverParts = this._renderHoverPartsForParticipant(hoverParts, participant, hoverRenderingContext); + disposables.add(renderedHoverParts); + for (const renderedHoverPart of renderedHoverParts.renderedHoverParts) { + this._renderedParts.push({ + type: "hoverPart", + participant, + hoverPart: renderedHoverPart.hoverPart, + hoverElement: renderedHoverPart.hoverElement + }); + } + } + const renderedStatusBar = this._renderStatusBar(this._fragment, statusBar); + if (renderedStatusBar) { + disposables.add(renderedStatusBar); + this._renderedParts.push({ + type: "statusBar", + hoverElement: renderedStatusBar.hoverElement, + actions: renderedStatusBar.actions + }); + } + return disposables; + } + _renderHoverPartsForParticipant(hoverParts, participant, hoverRenderingContext) { + const hoverPartsForParticipant = hoverParts.filter((hoverPart) => hoverPart.owner === participant); + const hasHoverPartsForParticipant = hoverPartsForParticipant.length > 0; + if (!hasHoverPartsForParticipant) { + return new RenderedHoverParts([]); + } + return participant.renderHoverParts(hoverRenderingContext, hoverPartsForParticipant); + } + _renderStatusBar(fragment, statusBar) { + if (!statusBar.hasContent) { + return void 0; + } + return new RenderedStatusBar(fragment, statusBar); + } + _registerListenersOnRenderedParts() { + const disposables = new DisposableStore(); + this._renderedParts.forEach((renderedPart, index) => { + const element = renderedPart.hoverElement; + element.tabIndex = 0; + disposables.add(addDisposableListener(element, EventType.FOCUS_IN, (event) => { + event.stopPropagation(); + this._focusedHoverPartIndex = index; + })); + disposables.add(addDisposableListener(element, EventType.FOCUS_OUT, (event) => { + event.stopPropagation(); + this._focusedHoverPartIndex = -1; + })); + if (renderedPart.type === "hoverPart" && renderedPart.hoverPart instanceof MarkerHover) { + disposables.add(new HoverCopyButton(element, () => renderedPart.participant.getAccessibleContent(renderedPart.hoverPart), this._clipboardService, this._hoverService)); + } + }); + return disposables; + } + _updateMarkdownAndColorParticipantInfo(participants) { + const markdownHoverParticipant = participants.find((p) => { + return p instanceof MarkdownHoverParticipant && !(p instanceof InlayHintsHover); + }); + if (markdownHoverParticipant) { + this._markdownHoverParticipant = markdownHoverParticipant; + } + this._colorHoverParticipant = participants.find((p) => p instanceof HoverColorPickerParticipant); + } + focusHoverPartWithIndex(index) { + if (index < 0 || index >= this._renderedParts.length) { + return; + } + this._renderedParts[index].hoverElement.focus(); + } + async updateHoverVerbosityLevel(action, index, focus) { + if (!this._markdownHoverParticipant) { + return; + } + let rangeOfIndicesToUpdate; + if (index >= 0) { + rangeOfIndicesToUpdate = { start: index, endExclusive: index + 1 }; + } else { + rangeOfIndicesToUpdate = this._findRangeOfMarkdownHoverParts(this._markdownHoverParticipant); + } + for (let i2 = rangeOfIndicesToUpdate.start; i2 < rangeOfIndicesToUpdate.endExclusive; i2++) { + const normalizedMarkdownHoverIndex = this._normalizedIndexToMarkdownHoverIndexRange(this._markdownHoverParticipant, i2); + if (normalizedMarkdownHoverIndex === void 0) { + continue; + } + const renderedPart = await this._markdownHoverParticipant.updateMarkdownHoverVerbosityLevel(action, normalizedMarkdownHoverIndex); + if (!renderedPart) { + continue; + } + this._renderedParts[i2] = { + type: "hoverPart", + participant: this._markdownHoverParticipant, + hoverPart: renderedPart.hoverPart, + hoverElement: renderedPart.hoverElement + }; + } + if (focus) { + if (index >= 0) { + this.focusHoverPartWithIndex(index); + } else { + this._context.focus(); + } + } + this._context.onContentsChanged(); + } + isColorPickerVisible() { + return this._colorHoverParticipant?.isColorPickerVisible() ?? false; + } + _normalizedIndexToMarkdownHoverIndexRange(markdownHoverParticipant, index) { + const renderedPart = this._renderedParts[index]; + if (!renderedPart || renderedPart.type !== "hoverPart") { + return void 0; + } + const isHoverPartMarkdownHover = renderedPart.participant === markdownHoverParticipant; + if (!isHoverPartMarkdownHover) { + return void 0; + } + const firstIndexOfMarkdownHovers = this._renderedParts.findIndex((renderedPart2) => renderedPart2.type === "hoverPart" && renderedPart2.participant === markdownHoverParticipant); + if (firstIndexOfMarkdownHovers === -1) { + throw new BugIndicatingError(); + } + return index - firstIndexOfMarkdownHovers; + } + _findRangeOfMarkdownHoverParts(markdownHoverParticipant) { + const copiedRenderedParts = this._renderedParts.slice(); + const firstIndexOfMarkdownHovers = copiedRenderedParts.findIndex((renderedPart) => renderedPart.type === "hoverPart" && renderedPart.participant === markdownHoverParticipant); + const inversedLastIndexOfMarkdownHovers = copiedRenderedParts.reverse().findIndex((renderedPart) => renderedPart.type === "hoverPart" && renderedPart.participant === markdownHoverParticipant); + const lastIndexOfMarkdownHovers = inversedLastIndexOfMarkdownHovers >= 0 ? copiedRenderedParts.length - inversedLastIndexOfMarkdownHovers : inversedLastIndexOfMarkdownHovers; + return { start: firstIndexOfMarkdownHovers, endExclusive: lastIndexOfMarkdownHovers + 1 }; + } + get domNode() { + return this._fragment; + } + get domNodeHasChildren() { + return this._fragment.hasChildNodes(); + } + get focusedHoverPartIndex() { + return this._focusedHoverPartIndex; + } + get hoverPartsCount() { + return this._renderedParts.length; + } +}; +RenderedContentHoverParts = RenderedContentHoverParts_1 = __decorate82([ + __param76(4, IKeybindingService), + __param76(5, IHoverService), + __param76(6, IClipboardService) +], RenderedContentHoverParts); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/hover/browser/contentHoverWidgetWrapper.js +var __decorate83 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param77 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var ContentHoverWidgetWrapper = class ContentHoverWidgetWrapper2 extends Disposable { + constructor(_editor, _instantiationService, _keybindingService, _hoverService, _clipboardService) { + super(); + this._editor = _editor; + this._instantiationService = _instantiationService; + this._keybindingService = _keybindingService; + this._hoverService = _hoverService; + this._clipboardService = _clipboardService; + this._currentResult = null; + this._renderedContentHover = this._register(new MutableDisposable()); + this._onContentsChanged = this._register(new Emitter()); + this.onContentsChanged = this._onContentsChanged.event; + this._contentHoverWidget = this._register(this._instantiationService.createInstance(ContentHoverWidget, this._editor)); + this._participants = this._initializeHoverParticipants(); + this._hoverOperation = this._register(new HoverOperation(this._editor, new ContentHoverComputer(this._editor, this._participants))); + this._registerListeners(); + } + _initializeHoverParticipants() { + const participants = []; + for (const participant of HoverParticipantRegistry.getAll()) { + const participantInstance = this._instantiationService.createInstance(participant, this._editor); + participants.push(participantInstance); + } + participants.sort((p1, p2) => p1.hoverOrdinal - p2.hoverOrdinal); + this._register(this._contentHoverWidget.onDidResize(() => { + this._participants.forEach((participant) => participant.handleResize?.()); + })); + this._register(this._contentHoverWidget.onDidScroll((e) => { + this._participants.forEach((participant) => participant.handleScroll?.(e)); + })); + this._register(this._contentHoverWidget.onContentsChanged(() => { + this._participants.forEach((participant) => participant.handleContentsChanged?.()); + })); + return participants; + } + _registerListeners() { + this._register(this._hoverOperation.onResult((result) => { + const messages = result.hasLoadingMessage ? this._addLoadingMessage(result) : result.value; + this._withResult(new ContentHoverResult(messages, result.isComplete, result.options)); + })); + const contentHoverWidgetNode = this._contentHoverWidget.getDomNode(); + this._register(addStandardDisposableListener(contentHoverWidgetNode, "keydown", (e) => { + if (e.equals( + 9 + /* KeyCode.Escape */ + )) { + this.hide(); + } + })); + this._register(addStandardDisposableListener(contentHoverWidgetNode, "mouseleave", (e) => { + this._onMouseLeave(e); + })); + this._register(TokenizationRegistry2.onDidChange(() => { + if (this._contentHoverWidget.position && this._currentResult) { + this._setCurrentResult(this._currentResult); + } + })); + this._register(this._contentHoverWidget.onContentsChanged(() => { + this._onContentsChanged.fire(); + })); + } + /** + * Returns true if the hover shows now or will show. + */ + _startShowingOrUpdateHover(anchor, mode, source, focus, mouseEvent) { + const contentHoverIsVisible = this._contentHoverWidget.position && this._currentResult; + if (!contentHoverIsVisible) { + if (anchor) { + this._startHoverOperationIfNecessary(anchor, mode, source, focus, false); + return true; + } + return false; + } + const isHoverSticky = this._editor.getOption( + 69 + /* EditorOption.hover */ + ).sticky; + const isMouseGettingCloser = mouseEvent && this._contentHoverWidget.isMouseGettingCloser(mouseEvent.event.posx, mouseEvent.event.posy); + const isHoverStickyAndIsMouseGettingCloser = isHoverSticky && isMouseGettingCloser; + if (isHoverStickyAndIsMouseGettingCloser) { + if (anchor) { + this._startHoverOperationIfNecessary(anchor, mode, source, focus, true); + } + return true; + } + if (!anchor) { + this._setCurrentResult(null); + return false; + } + const currentAnchorEqualsPreviousAnchor = this._currentResult && this._currentResult.options.anchor.equals(anchor); + if (currentAnchorEqualsPreviousAnchor) { + return true; + } + const currentAnchorCompatibleWithPreviousAnchor = this._currentResult && anchor.canAdoptVisibleHover(this._currentResult.options.anchor, this._contentHoverWidget.position); + if (!currentAnchorCompatibleWithPreviousAnchor) { + this._setCurrentResult(null); + this._startHoverOperationIfNecessary(anchor, mode, source, focus, false); + return true; + } + if (this._currentResult) { + this._setCurrentResult(this._currentResult.filter(anchor)); + } + this._startHoverOperationIfNecessary(anchor, mode, source, focus, false); + return true; + } + _startHoverOperationIfNecessary(anchor, mode, source, shouldFocus, insistOnKeepingHoverVisible) { + const currentAnchorEqualToPreviousHover = this._hoverOperation.options && this._hoverOperation.options.anchor.equals(anchor); + if (currentAnchorEqualToPreviousHover) { + return; + } + this._hoverOperation.cancel(); + const contentHoverComputerOptions = { + anchor, + source, + shouldFocus, + insistOnKeepingHoverVisible + }; + this._hoverOperation.start(mode, contentHoverComputerOptions); + } + _setCurrentResult(hoverResult) { + let currentHoverResult = hoverResult; + const currentResultEqualToPreviousResult = this._currentResult === currentHoverResult; + if (currentResultEqualToPreviousResult) { + return; + } + const currentHoverResultIsEmpty = currentHoverResult && currentHoverResult.hoverParts.length === 0; + if (currentHoverResultIsEmpty) { + currentHoverResult = null; + } + this._currentResult = currentHoverResult; + if (this._currentResult) { + this._showHover(this._currentResult); + } else { + this._hideHover(); + } + } + _addLoadingMessage(hoverResult) { + for (const participant of this._participants) { + if (!participant.createLoadingMessage) { + continue; + } + const loadingMessage = participant.createLoadingMessage(hoverResult.options.anchor); + if (!loadingMessage) { + continue; + } + return hoverResult.value.slice(0).concat([loadingMessage]); + } + return hoverResult.value; + } + _withResult(hoverResult) { + const previousHoverIsVisibleWithCompleteResult = this._contentHoverWidget.position && this._currentResult && this._currentResult.isComplete; + if (!previousHoverIsVisibleWithCompleteResult) { + this._setCurrentResult(hoverResult); + } + const isCurrentHoverResultComplete = hoverResult.isComplete; + if (!isCurrentHoverResultComplete) { + return; + } + const currentHoverResultIsEmpty = hoverResult.hoverParts.length === 0; + const insistOnKeepingPreviousHoverVisible = hoverResult.options.insistOnKeepingHoverVisible; + const shouldKeepPreviousHoverVisible = currentHoverResultIsEmpty && insistOnKeepingPreviousHoverVisible; + if (shouldKeepPreviousHoverVisible) { + return; + } + this._setCurrentResult(hoverResult); + } + _showHover(hoverResult) { + const context = this._getHoverContext(); + this._renderedContentHover.value = new RenderedContentHover(this._editor, hoverResult, this._participants, context, this._keybindingService, this._hoverService, this._clipboardService); + if (this._renderedContentHover.value.domNodeHasChildren) { + this._contentHoverWidget.show(this._renderedContentHover.value); + } else { + this._renderedContentHover.clear(); + } + } + _hideHover() { + this._contentHoverWidget.hide(); + this._participants.forEach((participant) => participant.handleHide?.()); + } + _getHoverContext() { + const hide2 = () => { + this.hide(); + }; + const onContentsChanged = () => { + this._contentHoverWidget.handleContentsChanged(); + }; + const setMinimumDimensions = (dimensions) => { + this._contentHoverWidget.setMinimumDimensions(dimensions); + }; + const focus = () => this.focus(); + return { hide: hide2, onContentsChanged, setMinimumDimensions, focus }; + } + showsOrWillShow(mouseEvent) { + const isContentWidgetResizing = this._contentHoverWidget.isResizing; + if (isContentWidgetResizing) { + return true; + } + const anchorCandidates = this._findHoverAnchorCandidates(mouseEvent); + const anchorCandidatesExist = anchorCandidates.length > 0; + if (!anchorCandidatesExist) { + return this._startShowingOrUpdateHover(null, 0, 0, false, mouseEvent); + } + const anchor = anchorCandidates[0]; + return this._startShowingOrUpdateHover(anchor, 0, 0, false, mouseEvent); + } + _findHoverAnchorCandidates(mouseEvent) { + const anchorCandidates = []; + for (const participant of this._participants) { + if (!participant.suggestHoverAnchor) { + continue; + } + const anchor = participant.suggestHoverAnchor(mouseEvent); + if (!anchor) { + continue; + } + anchorCandidates.push(anchor); + } + const target = mouseEvent.target; + switch (target.type) { + case 6: { + anchorCandidates.push(new HoverRangeAnchor(0, target.range, mouseEvent.event.posx, mouseEvent.event.posy)); + break; + } + case 7: { + const epsilon = this._editor.getOption( + 59 + /* EditorOption.fontInfo */ + ).typicalHalfwidthCharacterWidth / 2; + const mouseIsWithinLinesAndCloseToHover = !target.detail.isAfterLines && typeof target.detail.horizontalDistanceToText === "number" && target.detail.horizontalDistanceToText < epsilon; + if (!mouseIsWithinLinesAndCloseToHover) { + break; + } + anchorCandidates.push(new HoverRangeAnchor(0, target.range, mouseEvent.event.posx, mouseEvent.event.posy)); + break; + } + } + anchorCandidates.sort((a, b) => b.priority - a.priority); + return anchorCandidates; + } + _onMouseLeave(e) { + const editorDomNode = this._editor.getDomNode(); + const isMousePositionOutsideOfEditor = !editorDomNode || !isMousePositionWithinElement(editorDomNode, e.x, e.y); + if (isMousePositionOutsideOfEditor) { + this.hide(); + } + } + startShowingAtRange(range2, mode, source, focus) { + this._startShowingOrUpdateHover(new HoverRangeAnchor(0, range2, void 0, void 0), mode, source, focus, null); + } + async updateHoverVerbosityLevel(action, index, focus) { + this._renderedContentHover.value?.updateHoverVerbosityLevel(action, index, focus); + } + focusedHoverPartIndex() { + return this._renderedContentHover.value?.focusedHoverPartIndex ?? -1; + } + containsNode(node) { + return node ? this._contentHoverWidget.getDomNode().contains(node) : false; + } + focus() { + const hoverPartsCount = this._renderedContentHover.value?.hoverPartsCount; + if (hoverPartsCount === 1) { + this.focusHoverPartWithIndex(0); + return; + } + this._contentHoverWidget.focus(); + } + focusHoverPartWithIndex(index) { + this._renderedContentHover.value?.focusHoverPartWithIndex(index); + } + scrollUp() { + this._contentHoverWidget.scrollUp(); + } + scrollDown() { + this._contentHoverWidget.scrollDown(); + } + scrollLeft() { + this._contentHoverWidget.scrollLeft(); + } + scrollRight() { + this._contentHoverWidget.scrollRight(); + } + pageUp() { + this._contentHoverWidget.pageUp(); + } + pageDown() { + this._contentHoverWidget.pageDown(); + } + goToTop() { + this._contentHoverWidget.goToTop(); + } + goToBottom() { + this._contentHoverWidget.goToBottom(); + } + hide() { + this._hoverOperation.cancel(); + this._setCurrentResult(null); + } + getDomNode() { + return this._contentHoverWidget.getDomNode(); + } + get isColorPickerVisible() { + return this._renderedContentHover.value?.isColorPickerVisible() ?? false; + } + get isVisibleFromKeyboard() { + return this._contentHoverWidget.isVisibleFromKeyboard; + } + get isVisible() { + return this._contentHoverWidget.isVisible; + } + get isFocused() { + return this._contentHoverWidget.isFocused; + } + get isResizing() { + return this._contentHoverWidget.isResizing; + } + get widget() { + return this._contentHoverWidget; + } +}; +ContentHoverWidgetWrapper = __decorate83([ + __param77(1, IInstantiationService), + __param77(2, IKeybindingService), + __param77(3, IHoverService), + __param77(4, IClipboardService) +], ContentHoverWidgetWrapper); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/hover/browser/contentHoverController.js +init_event(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/colorPicker/browser/hoverColorPicker/hoverColorPicker.js +function isOnColorDecorator(mouseEvent) { + const target = mouseEvent.target; + return !!target && target.type === 6 && target.detail.injectedText?.options.attachedData === ColorDecorationInjectedTextMarker; +} + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/hover/browser/contentHoverController.js +var __decorate84 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param78 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var ContentHoverController_1; +var _sticky = false; +var ContentHoverController = class ContentHoverController2 extends Disposable { + static { + ContentHoverController_1 = this; + } + static { + this.ID = "editor.contrib.contentHover"; + } + constructor(_editor, _contextMenuService, _instantiationService, _keybindingService) { + super(); + this._editor = _editor; + this._instantiationService = _instantiationService; + this._keybindingService = _keybindingService; + this._onHoverContentsChanged = this._register(new Emitter()); + this.shouldKeepOpenOnEditorMouseMoveOrLeave = false; + this._listenersStore = new DisposableStore(); + this._isMouseDown = false; + this._ignoreMouseEvents = false; + this._reactToEditorMouseMoveRunner = this._register(new RunOnceScheduler(() => { + if (this._mouseMoveEvent) { + this._reactToEditorMouseMove(this._mouseMoveEvent); + } + }, 0)); + this._register(_contextMenuService.onDidShowContextMenu(() => { + this.hideContentHover(); + this._ignoreMouseEvents = true; + })); + this._register(_contextMenuService.onDidHideContextMenu(() => { + this._ignoreMouseEvents = false; + })); + this._hookListeners(); + this._register(this._editor.onDidChangeConfiguration((e) => { + if (e.hasChanged( + 69 + /* EditorOption.hover */ + )) { + this._unhookListeners(); + this._hookListeners(); + } + })); + } + static get(editor2) { + return editor2.getContribution(ContentHoverController_1.ID); + } + _hookListeners() { + const hoverOpts = this._editor.getOption( + 69 + /* EditorOption.hover */ + ); + this._hoverSettings = { + enabled: hoverOpts.enabled, + sticky: hoverOpts.sticky, + hidingDelay: hoverOpts.hidingDelay + }; + if (!hoverOpts.enabled) { + this._cancelSchedulerAndHide(); + } + this._listenersStore.add(this._editor.onMouseDown((e) => this._onEditorMouseDown(e))); + this._listenersStore.add(this._editor.onMouseUp(() => this._onEditorMouseUp())); + this._listenersStore.add(this._editor.onMouseMove((e) => this._onEditorMouseMove(e))); + this._listenersStore.add(this._editor.onKeyDown((e) => this._onKeyDown(e))); + this._listenersStore.add(this._editor.onMouseLeave((e) => this._onEditorMouseLeave(e))); + this._listenersStore.add(this._editor.onDidChangeModel(() => this._cancelSchedulerAndHide())); + this._listenersStore.add(this._editor.onDidChangeModelContent(() => this._cancelScheduler())); + this._listenersStore.add(this._editor.onDidScrollChange((e) => this._onEditorScrollChanged(e))); + } + _unhookListeners() { + this._listenersStore.clear(); + } + _cancelSchedulerAndHide() { + this._cancelScheduler(); + this.hideContentHover(); + } + _cancelScheduler() { + this._mouseMoveEvent = void 0; + this._reactToEditorMouseMoveRunner.cancel(); + } + _onEditorScrollChanged(e) { + if (this._ignoreMouseEvents) { + return; + } + if (e.scrollTopChanged || e.scrollLeftChanged) { + this.hideContentHover(); + } + } + _onEditorMouseDown(mouseEvent) { + if (this._ignoreMouseEvents) { + return; + } + this._isMouseDown = true; + const shouldKeepHoverWidgetVisible = this._shouldKeepHoverWidgetVisible(mouseEvent); + if (shouldKeepHoverWidgetVisible) { + return; + } + this.hideContentHover(); + } + _shouldKeepHoverWidgetVisible(mouseEvent) { + return this._isMouseOnContentHoverWidget(mouseEvent) || this._isContentWidgetResizing() || isOnColorDecorator(mouseEvent); + } + _isMouseOnContentHoverWidget(mouseEvent) { + if (!this._contentWidget) { + return false; + } + return isMousePositionWithinElement(this._contentWidget.getDomNode(), mouseEvent.event.posx, mouseEvent.event.posy); + } + _onEditorMouseUp() { + if (this._ignoreMouseEvents) { + return; + } + this._isMouseDown = false; + } + _onEditorMouseLeave(mouseEvent) { + if (this._ignoreMouseEvents) { + return; + } + if (this.shouldKeepOpenOnEditorMouseMoveOrLeave) { + return; + } + this._cancelScheduler(); + const shouldKeepHoverWidgetVisible = this._shouldKeepHoverWidgetVisible(mouseEvent); + if (shouldKeepHoverWidgetVisible) { + return; + } + if (_sticky) { + return; + } + this.hideContentHover(); + } + _shouldKeepCurrentHover(mouseEvent) { + const contentWidget = this._contentWidget; + if (!contentWidget) { + return false; + } + const isHoverSticky = this._hoverSettings.sticky; + const isMouseOnStickyContentHoverWidget = (mouseEvent2, isHoverSticky2) => { + const isMouseOnContentHoverWidget = this._isMouseOnContentHoverWidget(mouseEvent2); + return isHoverSticky2 && isMouseOnContentHoverWidget; + }; + const isMouseOnColorPickerOrChoosingColor = (mouseEvent2) => { + const isColorPickerVisible = contentWidget.isColorPickerVisible; + const isMouseOnContentHoverWidget = this._isMouseOnContentHoverWidget(mouseEvent2); + const isMouseOnHoverWithColorPicker = isColorPickerVisible && isMouseOnContentHoverWidget; + const isMaybeChoosingColor = isColorPickerVisible && this._isMouseDown; + return isMouseOnHoverWithColorPicker || isMaybeChoosingColor; + }; + const isTextSelectedWithinContentHoverWidget = (mouseEvent2, sticky) => { + const view = mouseEvent2.event.browserEvent.view; + if (!view) { + return false; + } + return sticky && contentWidget.containsNode(view.document.activeElement) && !view.getSelection()?.isCollapsed; + }; + const isFocused = contentWidget.isFocused; + const isResizing = contentWidget.isResizing; + const isStickyAndVisibleFromKeyboard = this._hoverSettings.sticky && contentWidget.isVisibleFromKeyboard; + return this.shouldKeepOpenOnEditorMouseMoveOrLeave || isFocused || isResizing || isStickyAndVisibleFromKeyboard || isMouseOnStickyContentHoverWidget(mouseEvent, isHoverSticky) || isMouseOnColorPickerOrChoosingColor(mouseEvent) || isTextSelectedWithinContentHoverWidget(mouseEvent, isHoverSticky); + } + _onEditorMouseMove(mouseEvent) { + if (this._ignoreMouseEvents) { + return; + } + this._mouseMoveEvent = mouseEvent; + const shouldKeepCurrentHover = this._shouldKeepCurrentHover(mouseEvent); + if (shouldKeepCurrentHover) { + this._reactToEditorMouseMoveRunner.cancel(); + return; + } + const shouldRescheduleHoverComputation = this._shouldRescheduleHoverComputation(); + if (shouldRescheduleHoverComputation) { + if (!this._reactToEditorMouseMoveRunner.isScheduled()) { + this._reactToEditorMouseMoveRunner.schedule(this._hoverSettings.hidingDelay); + } + return; + } + this._reactToEditorMouseMove(mouseEvent); + } + _shouldRescheduleHoverComputation() { + const hidingDelay = this._hoverSettings.hidingDelay; + const isContentHoverWidgetVisible = this._contentWidget?.isVisible ?? false; + return isContentHoverWidgetVisible && this._hoverSettings.sticky && hidingDelay > 0; + } + _reactToEditorMouseMove(mouseEvent) { + if (this._hoverSettings.enabled) { + const contentWidget = this._getOrCreateContentWidget(); + if (contentWidget.showsOrWillShow(mouseEvent)) { + return; + } + } + if (_sticky) { + return; + } + this.hideContentHover(); + } + _onKeyDown(e) { + if (this._ignoreMouseEvents) { + return; + } + if (!this._contentWidget) { + return; + } + const isPotentialKeyboardShortcut = this._isPotentialKeyboardShortcut(e); + const isModifierKeyPressed = this._isModifierKeyPressed(e); + if (isPotentialKeyboardShortcut || isModifierKeyPressed) { + return; + } + if (this._contentWidget.isFocused && e.keyCode === 2) { + return; + } + this.hideContentHover(); + } + _isPotentialKeyboardShortcut(e) { + if (!this._editor.hasModel() || !this._contentWidget) { + return false; + } + const resolvedKeyboardEvent = this._keybindingService.softDispatch(e, this._editor.getDomNode()); + const moreChordsAreNeeded = resolvedKeyboardEvent.kind === 1; + const isHoverAction = resolvedKeyboardEvent.kind === 2 && (resolvedKeyboardEvent.commandId === SHOW_OR_FOCUS_HOVER_ACTION_ID || resolvedKeyboardEvent.commandId === INCREASE_HOVER_VERBOSITY_ACTION_ID || resolvedKeyboardEvent.commandId === DECREASE_HOVER_VERBOSITY_ACTION_ID) && this._contentWidget.isVisible; + return moreChordsAreNeeded || isHoverAction; + } + _isModifierKeyPressed(e) { + return e.keyCode === 5 || e.keyCode === 6 || e.keyCode === 57 || e.keyCode === 4; + } + hideContentHover() { + if (_sticky) { + return; + } + if (InlineSuggestionHintsContentWidget.dropDownVisible) { + return; + } + this._contentWidget?.hide(); + } + _getOrCreateContentWidget() { + if (!this._contentWidget) { + this._contentWidget = this._instantiationService.createInstance(ContentHoverWidgetWrapper, this._editor); + this._listenersStore.add(this._contentWidget.onContentsChanged(() => this._onHoverContentsChanged.fire())); + } + return this._contentWidget; + } + showContentHover(range2, mode, source, focus) { + this._getOrCreateContentWidget().startShowingAtRange(range2, mode, source, focus); + } + _isContentWidgetResizing() { + return this._contentWidget?.widget.isResizing || false; + } + focusedHoverPartIndex() { + return this._getOrCreateContentWidget().focusedHoverPartIndex(); + } + updateHoverVerbosityLevel(action, index, focus) { + this._getOrCreateContentWidget().updateHoverVerbosityLevel(action, index, focus); + } + focus() { + this._contentWidget?.focus(); + } + scrollUp() { + this._contentWidget?.scrollUp(); + } + scrollDown() { + this._contentWidget?.scrollDown(); + } + scrollLeft() { + this._contentWidget?.scrollLeft(); + } + scrollRight() { + this._contentWidget?.scrollRight(); + } + pageUp() { + this._contentWidget?.pageUp(); + } + pageDown() { + this._contentWidget?.pageDown(); + } + goToTop() { + this._contentWidget?.goToTop(); + } + goToBottom() { + this._contentWidget?.goToBottom(); + } + get isColorPickerVisible() { + return this._contentWidget?.isColorPickerVisible; + } + get isHoverVisible() { + return this._contentWidget?.isVisible; + } + dispose() { + super.dispose(); + this._unhookListeners(); + this._listenersStore.dispose(); + this._contentWidget?.dispose(); + } +}; +ContentHoverController = ContentHoverController_1 = __decorate84([ + __param78(1, IContextMenuService), + __param78(2, IInstantiationService), + __param78(3, IKeybindingService) +], ContentHoverController); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/colorPicker/browser/hoverColorPicker/hoverColorPickerContribution.js +var HoverColorPickerContribution = class extends Disposable { + static { + this.ID = "editor.contrib.colorContribution"; + } + // ms + constructor(_editor) { + super(); + this._editor = _editor; + this._register(_editor.onMouseDown((e) => this.onMouseDown(e))); + } + dispose() { + super.dispose(); + } + onMouseDown(mouseEvent) { + const colorDecoratorsActivatedOn = this._editor.getOption( + 168 + /* EditorOption.colorDecoratorsActivatedOn */ + ); + if (colorDecoratorsActivatedOn !== "click" && colorDecoratorsActivatedOn !== "clickAndHover") { + return; + } + if (!isOnColorDecorator(mouseEvent)) { + return; + } + const hoverController = this._editor.getContribution(ContentHoverController.ID); + if (!hoverController) { + return; + } + if (hoverController.isColorPickerVisible) { + return; + } + const targetRange = mouseEvent.target.range; + if (!targetRange) { + return; + } + const range2 = new Range(targetRange.startLineNumber, targetRange.startColumn + 1, targetRange.endLineNumber, targetRange.endColumn + 1); + hoverController.showContentHover(range2, 1, 1, false); + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/colorPicker/browser/standaloneColorPicker/standaloneColorPickerActions.js +init_editorExtensions(); +init_nls(); +init_editorContextKeys(); +init_actions2(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/colorPicker/browser/standaloneColorPicker/standaloneColorPickerController.js +init_contextkey(); +init_instantiation(); +init_editorContextKeys(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/colorPicker/browser/standaloneColorPicker/standaloneColorPickerWidget.js +init_lifecycle(); +init_instantiation(); +init_event(); +init_languageFeatures(); +init_editorWorker(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/colorPicker/browser/standaloneColorPicker/standaloneColorPickerParticipant.js +init_cancellation(); +init_lifecycle(); +init_themeService(); +init_range(); +init_dom(); +var __decorate85 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param79 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var StandaloneColorPickerHover = class _StandaloneColorPickerHover { + constructor(owner, range2, model, provider) { + this.owner = owner; + this.range = range2; + this.model = model; + this.provider = provider; + } + static fromBaseColor(owner, color) { + return new _StandaloneColorPickerHover(owner, color.range, color.model, color.provider); + } +}; +var StandaloneColorPickerRenderedParts = class extends Disposable { + constructor(editor2, context, colorHover, themeService) { + super(); + const editorModel = editor2.getModel(); + const colorPickerModel = colorHover.model; + this.color = colorHover.model.color; + this.colorPicker = this._register(new ColorPickerWidget( + context.fragment, + colorPickerModel, + editor2.getOption( + 163 + /* EditorOption.pixelRatio */ + ), + themeService, + "standalone" + /* ColorPickerWidgetType.Standalone */ + )); + this._register(colorPickerModel.onColorFlushed((color) => { + this.color = color; + })); + this._register(colorPickerModel.onDidChangeColor((color) => { + updateColorPresentations(editorModel, colorPickerModel, color, colorHover.range, colorHover); + })); + let editorUpdatedByColorPicker = false; + this._register(editor2.onDidChangeModelContent((e) => { + if (editorUpdatedByColorPicker) { + editorUpdatedByColorPicker = false; + } else { + context.hide(); + editor2.focus(); + } + })); + updateColorPresentations(editorModel, colorPickerModel, this.color, colorHover.range, colorHover); + } +}; +var StandaloneColorPickerParticipant = class StandaloneColorPickerParticipant2 { + constructor(_editor, _themeService) { + this._editor = _editor; + this._themeService = _themeService; + } + async createColorHover(defaultColorInfo, defaultColorProvider, colorProviderRegistry) { + if (!this._editor.hasModel()) { + return null; + } + const colorDetector = ColorDetector.get(this._editor); + if (!colorDetector) { + return null; + } + const colors = await getColors(colorProviderRegistry, this._editor.getModel(), CancellationToken.None); + let foundColorInfo = null; + let foundColorProvider = null; + for (const colorData of colors) { + const colorInfo2 = colorData.colorInfo; + if (Range.containsRange(colorInfo2.range, defaultColorInfo.range)) { + foundColorInfo = colorInfo2; + foundColorProvider = colorData.provider; + } + } + const colorInfo = foundColorInfo ?? defaultColorInfo; + const colorProvider = foundColorProvider ?? defaultColorProvider; + const foundInEditor = !!foundColorInfo; + const colorHover = StandaloneColorPickerHover.fromBaseColor(this, await createColorHover(this._editor.getModel(), colorInfo, colorProvider)); + return { colorHover, foundInEditor }; + } + async updateEditorModel(colorHoverData) { + if (!this._editor.hasModel()) { + return; + } + const colorPickerModel = colorHoverData.model; + let range2 = new Range(colorHoverData.range.startLineNumber, colorHoverData.range.startColumn, colorHoverData.range.endLineNumber, colorHoverData.range.endColumn); + if (this._color) { + await updateColorPresentations(this._editor.getModel(), colorPickerModel, this._color, range2, colorHoverData); + range2 = updateEditorModel(this._editor, range2, colorPickerModel); + } + } + renderHoverParts(context, hoverParts) { + if (hoverParts.length === 0 || !this._editor.hasModel()) { + return void 0; + } + this._setMinimumDimensions(context); + this._renderedParts = new StandaloneColorPickerRenderedParts(this._editor, context, hoverParts[0], this._themeService); + return this._renderedParts; + } + _setMinimumDimensions(context) { + const minimumHeight = this._editor.getOption( + 75 + /* EditorOption.lineHeight */ + ) + 8; + context.setMinimumDimensions(new Dimension(302, minimumHeight)); + } + get _color() { + return this._renderedParts?.color; + } +}; +StandaloneColorPickerParticipant = __decorate85([ + __param79(1, IThemeService) +], StandaloneColorPickerParticipant); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/colorPicker/browser/standaloneColorPicker/standaloneColorPickerWidget.js +init_dom(); +var __decorate86 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param80 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var StandaloneColorPickerWidget_1; +var StandaloneColorPickerResult = class { + // The color picker result consists of: an array of color results and a boolean indicating if the color was found in the editor + constructor(value, foundInEditor) { + this.value = value; + this.foundInEditor = foundInEditor; + } +}; +var PADDING = 8; +var CLOSE_BUTTON_WIDTH = 22; +var StandaloneColorPickerWidget = class StandaloneColorPickerWidget2 extends Disposable { + static { + StandaloneColorPickerWidget_1 = this; + } + static { + this.ID = "editor.contrib.standaloneColorPickerWidget"; + } + constructor(_editor, _standaloneColorPickerVisible, _standaloneColorPickerFocused, _instantiationService, _keybindingService, _languageFeaturesService, _editorWorkerService, _hoverService) { + super(); + this._editor = _editor; + this._standaloneColorPickerVisible = _standaloneColorPickerVisible; + this._standaloneColorPickerFocused = _standaloneColorPickerFocused; + this._keybindingService = _keybindingService; + this._languageFeaturesService = _languageFeaturesService; + this._editorWorkerService = _editorWorkerService; + this._hoverService = _hoverService; + this.allowEditorOverflow = true; + this._position = void 0; + this._body = document.createElement("div"); + this._colorHover = null; + this._selectionSetInEditor = false; + this._onResult = this._register(new Emitter()); + this.onResult = this._onResult.event; + this._renderedHoverParts = this._register(new MutableDisposable()); + this._renderedStatusBar = this._register(new MutableDisposable()); + this._standaloneColorPickerVisible.set(true); + this._standaloneColorPickerParticipant = _instantiationService.createInstance(StandaloneColorPickerParticipant, this._editor); + this._position = this._editor._getViewModel()?.getPrimaryCursorState().modelState.position; + const editorSelection = this._editor.getSelection(); + const selection = editorSelection ? { + startLineNumber: editorSelection.startLineNumber, + startColumn: editorSelection.startColumn, + endLineNumber: editorSelection.endLineNumber, + endColumn: editorSelection.endColumn + } : { startLineNumber: 0, endLineNumber: 0, endColumn: 0, startColumn: 0 }; + const focusTracker = this._register(trackFocus(this._body)); + this._register(focusTracker.onDidBlur((_) => { + this.hide(); + })); + this._register(focusTracker.onDidFocus((_) => { + this.focus(); + })); + this._register(this._editor.onDidChangeCursorPosition(() => { + if (!this._selectionSetInEditor) { + this.hide(); + } else { + this._selectionSetInEditor = false; + } + })); + this._register(this._editor.onMouseMove((e) => { + const classList = e.target.element?.classList; + if (classList && classList.contains("colorpicker-color-decoration")) { + this.hide(); + } + })); + this._register(this.onResult((result) => { + this._render(result.value, result.foundInEditor); + })); + this._start(selection); + this._body.style.zIndex = "50"; + this._editor.addContentWidget(this); + } + updateEditor() { + if (this._colorHover) { + this._standaloneColorPickerParticipant.updateEditorModel(this._colorHover); + } + } + getId() { + return StandaloneColorPickerWidget_1.ID; + } + getDomNode() { + return this._body; + } + getPosition() { + if (!this._position) { + return null; + } + const positionPreference = this._editor.getOption( + 69 + /* EditorOption.hover */ + ).above; + return { + position: this._position, + secondaryPosition: this._position, + preference: positionPreference ? [ + 1, + 2 + /* ContentWidgetPositionPreference.BELOW */ + ] : [ + 2, + 1 + /* ContentWidgetPositionPreference.ABOVE */ + ], + positionAffinity: 2 + /* PositionAffinity.None */ + }; + } + hide() { + this.dispose(); + this._standaloneColorPickerVisible.set(false); + this._standaloneColorPickerFocused.set(false); + this._editor.removeContentWidget(this); + this._editor.focus(); + } + focus() { + this._standaloneColorPickerFocused.set(true); + this._body.focus(); + } + async _start(selection) { + const computeAsyncResult = await this._computeAsync(selection); + if (!computeAsyncResult) { + return; + } + this._onResult.fire(new StandaloneColorPickerResult(computeAsyncResult.result, computeAsyncResult.foundInEditor)); + } + async _computeAsync(range2) { + if (!this._editor.hasModel()) { + return null; + } + const colorInfo = { + range: range2, + color: { red: 0, green: 0, blue: 0, alpha: 1 } + }; + const colorHoverResult = await this._standaloneColorPickerParticipant.createColorHover(colorInfo, new DefaultDocumentColorProvider(this._editorWorkerService), this._languageFeaturesService.colorProvider); + if (!colorHoverResult) { + return null; + } + return { result: colorHoverResult.colorHover, foundInEditor: colorHoverResult.foundInEditor }; + } + _render(colorHover, foundInEditor) { + const fragment = document.createDocumentFragment(); + this._renderedStatusBar.value = this._register(new EditorHoverStatusBar(this._keybindingService, this._hoverService)); + const context = { + fragment, + statusBar: this._renderedStatusBar.value, + onContentsChanged: () => { + }, + setMinimumDimensions: () => { + }, + hide: () => this.hide(), + focus: () => this.focus() + }; + this._colorHover = colorHover; + this._renderedHoverParts.value = this._standaloneColorPickerParticipant.renderHoverParts(context, [colorHover]); + if (!this._renderedHoverParts.value) { + this._renderedStatusBar.clear(); + this._renderedHoverParts.clear(); + return; + } + const colorPicker = this._renderedHoverParts.value.colorPicker; + this._body.classList.add("standalone-colorpicker-body"); + this._body.style.maxHeight = Math.max(this._editor.getLayoutInfo().height / 4, 250) + "px"; + this._body.style.maxWidth = Math.max(this._editor.getLayoutInfo().width * 0.66, 500) + "px"; + this._body.tabIndex = 0; + this._body.appendChild(fragment); + colorPicker.layout(); + const colorPickerBody = colorPicker.body; + const saturationBoxWidth = colorPickerBody.saturationBox.domNode.clientWidth; + const widthOfOriginalColorBox = colorPickerBody.domNode.clientWidth - saturationBoxWidth - CLOSE_BUTTON_WIDTH - PADDING; + const enterButton = colorPicker.body.enterButton; + enterButton?.onClicked(() => { + this.updateEditor(); + this.hide(); + }); + const colorPickerHeader = colorPicker.header; + const pickedColorNode = colorPickerHeader.pickedColorNode; + pickedColorNode.style.width = saturationBoxWidth + PADDING + "px"; + const originalColorNode = colorPickerHeader.originalColorNode; + originalColorNode.style.width = widthOfOriginalColorBox + "px"; + const closeButton = colorPicker.header.closeButton; + closeButton?.onClicked(() => { + this.hide(); + }); + if (foundInEditor) { + if (enterButton) { + enterButton.button.textContent = "Replace"; + } + this._selectionSetInEditor = true; + this._editor.setSelection(colorHover.range); + } + this._editor.layoutContentWidget(this); + } +}; +StandaloneColorPickerWidget = StandaloneColorPickerWidget_1 = __decorate86([ + __param80(3, IInstantiationService), + __param80(4, IKeybindingService), + __param80(5, ILanguageFeaturesService), + __param80(6, IEditorWorkerService), + __param80(7, IHoverService) +], StandaloneColorPickerWidget); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/colorPicker/browser/standaloneColorPicker/standaloneColorPickerController.js +init_lifecycle(); +var __decorate87 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param81 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var StandaloneColorPickerController_1; +var StandaloneColorPickerController = class StandaloneColorPickerController2 extends Disposable { + static { + StandaloneColorPickerController_1 = this; + } + static { + this.ID = "editor.contrib.standaloneColorPickerController"; + } + constructor(_editor, _contextKeyService, _instantiationService) { + super(); + this._editor = _editor; + this._instantiationService = _instantiationService; + this._standaloneColorPickerWidget = null; + this._standaloneColorPickerVisible = EditorContextKeys.standaloneColorPickerVisible.bindTo(_contextKeyService); + this._standaloneColorPickerFocused = EditorContextKeys.standaloneColorPickerFocused.bindTo(_contextKeyService); + } + showOrFocus() { + if (!this._editor.hasModel()) { + return; + } + if (!this._standaloneColorPickerVisible.get()) { + this._standaloneColorPickerWidget = this._instantiationService.createInstance(StandaloneColorPickerWidget, this._editor, this._standaloneColorPickerVisible, this._standaloneColorPickerFocused); + } else if (!this._standaloneColorPickerFocused.get()) { + this._standaloneColorPickerWidget?.focus(); + } + } + hide() { + this._standaloneColorPickerFocused.set(false); + this._standaloneColorPickerVisible.set(false); + this._standaloneColorPickerWidget?.hide(); + this._editor.focus(); + } + insertColor() { + this._standaloneColorPickerWidget?.updateEditor(); + this.hide(); + } + static get(editor2) { + return editor2.getContribution(StandaloneColorPickerController_1.ID); + } +}; +StandaloneColorPickerController = StandaloneColorPickerController_1 = __decorate87([ + __param81(1, IContextKeyService), + __param81(2, IInstantiationService) +], StandaloneColorPickerController); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/colorPicker/browser/standaloneColorPicker/standaloneColorPickerActions.js +var ShowOrFocusStandaloneColorPicker = class extends EditorAction2 { + constructor() { + super({ + id: "editor.action.showOrFocusStandaloneColorPicker", + title: { + ...localize2(889, "Show or Focus Standalone Color Picker"), + mnemonicTitle: localize(888, "&&Show or Focus Standalone Color Picker") + }, + precondition: void 0, + menu: [ + { id: MenuId.CommandPalette } + ], + metadata: { + description: localize2(890, "Show or focus a standalone color picker which uses the default color provider. It displays hex/rgb/hsl colors.") + } + }); + } + runEditorCommand(_accessor, editor2) { + StandaloneColorPickerController.get(editor2)?.showOrFocus(); + } +}; +var HideStandaloneColorPicker = class extends EditorAction { + constructor() { + super({ + id: "editor.action.hideColorPicker", + label: localize2(891, "Hide the Color Picker"), + precondition: EditorContextKeys.standaloneColorPickerVisible.isEqualTo(true), + kbOpts: { + primary: 9, + weight: 100 + /* KeybindingWeight.EditorContrib */ + }, + metadata: { + description: localize2(892, "Hide the standalone color picker.") + } + }); + } + run(_accessor, editor2) { + StandaloneColorPickerController.get(editor2)?.hide(); + } +}; +var InsertColorWithStandaloneColorPicker = class extends EditorAction { + constructor() { + super({ + id: "editor.action.insertColorWithStandaloneColorPicker", + label: localize2(893, "Insert Color with Standalone Color Picker"), + precondition: EditorContextKeys.standaloneColorPickerFocused.isEqualTo(true), + kbOpts: { + primary: 3, + weight: 100 + /* KeybindingWeight.EditorContrib */ + }, + metadata: { + description: localize2(894, "Insert hex/rgb/hsl colors with the focused standalone color picker.") + } + }); + } + run(_accessor, editor2) { + StandaloneColorPickerController.get(editor2)?.insertColor(); + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/colorPicker/browser/colorPickerContribution.js +init_range(); +registerEditorAction(HideStandaloneColorPicker); +registerEditorAction(InsertColorWithStandaloneColorPicker); +registerAction2(ShowOrFocusStandaloneColorPicker); +registerEditorContribution( + HoverColorPickerContribution.ID, + HoverColorPickerContribution, + 2 + /* EditorContributionInstantiation.BeforeFirstInteraction */ +); +registerEditorContribution( + StandaloneColorPickerController.ID, + StandaloneColorPickerController, + 1 + /* EditorContributionInstantiation.AfterFirstRender */ +); +registerEditorContribution( + ColorDetector.ID, + ColorDetector, + 1 + /* EditorContributionInstantiation.AfterFirstRender */ +); +registerEditorFeature(DefaultDocumentColorProviderFeature); +HoverParticipantRegistry.register(HoverColorPickerParticipant); +CommandsRegistry.registerCommand("_executeDocumentColorProvider", function(accessor, ...args) { + const [resource] = args; + if (!(resource instanceof URI)) { + throw illegalArgument(); + } + const { model, colorProviderRegistry, defaultColorDecoratorsEnablement } = _setupColorCommand(accessor, resource); + return _findColorData(new ExtColorDataCollector(), colorProviderRegistry, model, CancellationToken.None, defaultColorDecoratorsEnablement); +}); +CommandsRegistry.registerCommand("_executeColorPresentationProvider", function(accessor, ...args) { + const [color, context] = args; + if (!context) { + return; + } + const { uri, range: range2 } = context; + if (!(uri instanceof URI) || !Array.isArray(color) || color.length !== 4 || !Range.isIRange(range2)) { + throw illegalArgument(); + } + const { model, colorProviderRegistry, defaultColorDecoratorsEnablement } = _setupColorCommand(accessor, uri); + const [red, green, blue, alpha] = color; + return _findColorData(new ColorPresentationsCollector({ range: range2, color: { red, green, blue, alpha } }), colorProviderRegistry, model, CancellationToken.None, defaultColorDecoratorsEnablement); +}); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/comment/browser/comment.js +init_keyCodes(); +init_nls(); +init_actions2(); +init_editorExtensions(); +init_range(); +init_editorContextKeys(); +init_languageConfigurationRegistry(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/comment/browser/blockCommentCommand.js +init_position(); +init_range(); +init_selection(); +var BlockCommentCommand = class _BlockCommentCommand { + constructor(selection, insertSpace, languageConfigurationService) { + this.languageConfigurationService = languageConfigurationService; + this._selection = selection; + this._insertSpace = insertSpace; + this._usedEndToken = null; + } + static _haystackHasNeedleAtOffset(haystack, needle, offset) { + if (offset < 0) { + return false; + } + const needleLength = needle.length; + const haystackLength = haystack.length; + if (offset + needleLength > haystackLength) { + return false; + } + for (let i2 = 0; i2 < needleLength; i2++) { + const codeA = haystack.charCodeAt(offset + i2); + const codeB = needle.charCodeAt(i2); + if (codeA === codeB) { + continue; + } + if (codeA >= 65 && codeA <= 90 && codeA + 32 === codeB) { + continue; + } + if (codeB >= 65 && codeB <= 90 && codeB + 32 === codeA) { + continue; + } + return false; + } + return true; + } + _createOperationsForBlockComment(selection, startToken, endToken, insertSpace, model, builder) { + const startLineNumber = selection.startLineNumber; + const startColumn = selection.startColumn; + const endLineNumber = selection.endLineNumber; + const endColumn = selection.endColumn; + const startLineText = model.getLineContent(startLineNumber); + const endLineText = model.getLineContent(endLineNumber); + let startTokenIndex = startLineText.lastIndexOf(startToken, startColumn - 1 + startToken.length); + let endTokenIndex = endLineText.indexOf(endToken, endColumn - 1 - endToken.length); + if (startTokenIndex !== -1 && endTokenIndex !== -1) { + if (startLineNumber === endLineNumber) { + const lineBetweenTokens = startLineText.substring(startTokenIndex + startToken.length, endTokenIndex); + if (lineBetweenTokens.indexOf(endToken) >= 0) { + startTokenIndex = -1; + endTokenIndex = -1; + } + } else { + const startLineAfterStartToken = startLineText.substring(startTokenIndex + startToken.length); + const endLineBeforeEndToken = endLineText.substring(0, endTokenIndex); + if (startLineAfterStartToken.indexOf(endToken) >= 0 || endLineBeforeEndToken.indexOf(endToken) >= 0) { + startTokenIndex = -1; + endTokenIndex = -1; + } + } + } + let ops; + if (startTokenIndex !== -1 && endTokenIndex !== -1) { + if (insertSpace && startTokenIndex + startToken.length < startLineText.length && startLineText.charCodeAt(startTokenIndex + startToken.length) === 32) { + startToken = startToken + " "; + } + if (insertSpace && endTokenIndex > 0 && endLineText.charCodeAt(endTokenIndex - 1) === 32) { + endToken = " " + endToken; + endTokenIndex -= 1; + } + ops = _BlockCommentCommand._createRemoveBlockCommentOperations(new Range(startLineNumber, startTokenIndex + startToken.length + 1, endLineNumber, endTokenIndex + 1), startToken, endToken); + } else { + ops = _BlockCommentCommand._createAddBlockCommentOperations(selection, startToken, endToken, this._insertSpace); + this._usedEndToken = ops.length === 1 ? endToken : null; + } + for (const op of ops) { + builder.addTrackedEditOperation(op.range, op.text); + } + } + static _createRemoveBlockCommentOperations(r, startToken, endToken) { + const res = []; + if (!Range.isEmpty(r)) { + res.push(EditOperation.delete(new Range(r.startLineNumber, r.startColumn - startToken.length, r.startLineNumber, r.startColumn))); + res.push(EditOperation.delete(new Range(r.endLineNumber, r.endColumn, r.endLineNumber, r.endColumn + endToken.length))); + } else { + res.push(EditOperation.delete(new Range(r.startLineNumber, r.startColumn - startToken.length, r.endLineNumber, r.endColumn + endToken.length))); + } + return res; + } + static _createAddBlockCommentOperations(r, startToken, endToken, insertSpace) { + const res = []; + if (!Range.isEmpty(r)) { + res.push(EditOperation.insert(new Position(r.startLineNumber, r.startColumn), startToken + (insertSpace ? " " : ""))); + res.push(EditOperation.insert(new Position(r.endLineNumber, r.endColumn), (insertSpace ? " " : "") + endToken)); + } else { + res.push(EditOperation.replace(new Range(r.startLineNumber, r.startColumn, r.endLineNumber, r.endColumn), startToken + " " + endToken)); + } + return res; + } + getEditOperations(model, builder) { + const startLineNumber = this._selection.startLineNumber; + const startColumn = this._selection.startColumn; + model.tokenization.tokenizeIfCheap(startLineNumber); + const languageId = model.getLanguageIdAtPosition(startLineNumber, startColumn); + const config = this.languageConfigurationService.getLanguageConfiguration(languageId).comments; + if (!config || !config.blockCommentStartToken || !config.blockCommentEndToken) { + return; + } + this._createOperationsForBlockComment(this._selection, config.blockCommentStartToken, config.blockCommentEndToken, this._insertSpace, model, builder); + } + computeCursorState(model, helper) { + const inverseEditOperations = helper.getInverseEditOperations(); + if (inverseEditOperations.length === 2) { + const startTokenEditOperation = inverseEditOperations[0]; + const endTokenEditOperation = inverseEditOperations[1]; + return new Selection(startTokenEditOperation.range.endLineNumber, startTokenEditOperation.range.endColumn, endTokenEditOperation.range.startLineNumber, endTokenEditOperation.range.startColumn); + } else { + const srcRange = inverseEditOperations[0].range; + const deltaColumn = this._usedEndToken ? -this._usedEndToken.length - 1 : 0; + return new Selection(srcRange.endLineNumber, srcRange.endColumn + deltaColumn, srcRange.endLineNumber, srcRange.endColumn + deltaColumn); + } + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/comment/browser/lineCommentCommand.js +init_strings(); +init_position(); +init_range(); +init_selection(); +var LineCommentCommand = class _LineCommentCommand { + constructor(languageConfigurationService, selection, indentSize, type, insertSpace, ignoreEmptyLines, ignoreFirstLine) { + this.languageConfigurationService = languageConfigurationService; + this._selection = selection; + this._indentSize = indentSize; + this._type = type; + this._insertSpace = insertSpace; + this._selectionId = null; + this._deltaColumn = 0; + this._moveEndPositionDown = false; + this._ignoreEmptyLines = ignoreEmptyLines; + this._ignoreFirstLine = ignoreFirstLine || false; + } + /** + * Do an initial pass over the lines and gather info about the line comment string. + * Returns null if any of the lines doesn't support a line comment string. + */ + static _gatherPreflightCommentStrings(model, startLineNumber, endLineNumber, languageConfigurationService) { + model.tokenization.tokenizeIfCheap(startLineNumber); + const languageId = model.getLanguageIdAtPosition(startLineNumber, 1); + const config = languageConfigurationService.getLanguageConfiguration(languageId).comments; + const commentStr = config ? config.lineCommentToken : null; + if (!commentStr) { + return null; + } + const lines = []; + for (let i2 = 0, lineCount = endLineNumber - startLineNumber + 1; i2 < lineCount; i2++) { + lines[i2] = { + ignore: false, + commentStr, + commentStrOffset: 0, + commentStrLength: commentStr.length + }; + } + return lines; + } + /** + * Analyze lines and decide which lines are relevant and what the toggle should do. + * Also, build up several offsets and lengths useful in the generation of editor operations. + */ + static _analyzeLines(type, insertSpace, model, lines, startLineNumber, ignoreEmptyLines, ignoreFirstLine, languageConfigurationService, languageId) { + let onlyWhitespaceLines = true; + const config = languageConfigurationService.getLanguageConfiguration(languageId).comments; + const lineCommentNoIndent = config?.lineCommentNoIndent ?? false; + let shouldRemoveComments; + if (type === 0) { + shouldRemoveComments = true; + } else if (type === 1) { + shouldRemoveComments = false; + } else { + shouldRemoveComments = true; + } + for (let i2 = 0, lineCount = lines.length; i2 < lineCount; i2++) { + const lineData = lines[i2]; + const lineNumber = startLineNumber + i2; + if (lineNumber === startLineNumber && ignoreFirstLine) { + lineData.ignore = true; + continue; + } + const lineContent = model.getLineContent(lineNumber); + const lineContentStartOffset = firstNonWhitespaceIndex(lineContent); + if (lineContentStartOffset === -1) { + lineData.ignore = ignoreEmptyLines; + lineData.commentStrOffset = lineCommentNoIndent ? 0 : lineContent.length; + continue; + } + onlyWhitespaceLines = false; + const offset = lineCommentNoIndent ? 0 : lineContentStartOffset; + lineData.ignore = false; + lineData.commentStrOffset = offset; + if (shouldRemoveComments && !BlockCommentCommand._haystackHasNeedleAtOffset(lineContent, lineData.commentStr, offset)) { + if (type === 0) { + shouldRemoveComments = false; + } else if (type === 1) { + } else { + lineData.ignore = true; + } + } + if (shouldRemoveComments && insertSpace) { + const commentStrEndOffset = lineContentStartOffset + lineData.commentStrLength; + if (commentStrEndOffset < lineContent.length && lineContent.charCodeAt(commentStrEndOffset) === 32) { + lineData.commentStrLength += 1; + } + } + } + if (type === 0 && onlyWhitespaceLines) { + shouldRemoveComments = false; + for (let i2 = 0, lineCount = lines.length; i2 < lineCount; i2++) { + lines[i2].ignore = false; + } + } + return { + supported: true, + shouldRemoveComments, + lines + }; + } + /** + * Analyze all lines and decide exactly what to do => not supported | insert line comments | remove line comments + */ + static _gatherPreflightData(type, insertSpace, model, startLineNumber, endLineNumber, ignoreEmptyLines, ignoreFirstLine, languageConfigurationService) { + const lines = _LineCommentCommand._gatherPreflightCommentStrings(model, startLineNumber, endLineNumber, languageConfigurationService); + const languageId = model.getLanguageIdAtPosition(startLineNumber, 1); + if (lines === null) { + return { + supported: false + }; + } + return _LineCommentCommand._analyzeLines(type, insertSpace, model, lines, startLineNumber, ignoreEmptyLines, ignoreFirstLine, languageConfigurationService, languageId); + } + /** + * Given a successful analysis, execute either insert line comments, either remove line comments + */ + _executeLineComments(model, builder, data, s) { + let ops; + if (data.shouldRemoveComments) { + ops = _LineCommentCommand._createRemoveLineCommentsOperations(data.lines, s.startLineNumber); + } else { + _LineCommentCommand._normalizeInsertionPoint(model, data.lines, s.startLineNumber, this._indentSize); + ops = this._createAddLineCommentsOperations(data.lines, s.startLineNumber); + } + const cursorPosition = new Position(s.positionLineNumber, s.positionColumn); + for (let i2 = 0, len = ops.length; i2 < len; i2++) { + builder.addEditOperation(ops[i2].range, ops[i2].text); + if (Range.isEmpty(ops[i2].range) && Range.getStartPosition(ops[i2].range).equals(cursorPosition)) { + const lineContent = model.getLineContent(cursorPosition.lineNumber); + if (lineContent.length + 1 === cursorPosition.column) { + this._deltaColumn = (ops[i2].text || "").length; + } + } + } + this._selectionId = builder.trackSelection(s); + } + _attemptRemoveBlockComment(model, s, startToken, endToken) { + let startLineNumber = s.startLineNumber; + let endLineNumber = s.endLineNumber; + const startTokenAllowedBeforeColumn = endToken.length + Math.max(model.getLineFirstNonWhitespaceColumn(s.startLineNumber), s.startColumn); + let startTokenIndex = model.getLineContent(startLineNumber).lastIndexOf(startToken, startTokenAllowedBeforeColumn - 1); + let endTokenIndex = model.getLineContent(endLineNumber).indexOf(endToken, s.endColumn - 1 - startToken.length); + if (startTokenIndex !== -1 && endTokenIndex === -1) { + endTokenIndex = model.getLineContent(startLineNumber).indexOf(endToken, startTokenIndex + startToken.length); + endLineNumber = startLineNumber; + } + if (startTokenIndex === -1 && endTokenIndex !== -1) { + startTokenIndex = model.getLineContent(endLineNumber).lastIndexOf(startToken, endTokenIndex); + startLineNumber = endLineNumber; + } + if (s.isEmpty() && (startTokenIndex === -1 || endTokenIndex === -1)) { + startTokenIndex = model.getLineContent(startLineNumber).indexOf(startToken); + if (startTokenIndex !== -1) { + endTokenIndex = model.getLineContent(startLineNumber).indexOf(endToken, startTokenIndex + startToken.length); + } + } + if (startTokenIndex !== -1 && model.getLineContent(startLineNumber).charCodeAt(startTokenIndex + startToken.length) === 32) { + startToken += " "; + } + if (endTokenIndex !== -1 && model.getLineContent(endLineNumber).charCodeAt(endTokenIndex - 1) === 32) { + endToken = " " + endToken; + endTokenIndex -= 1; + } + if (startTokenIndex !== -1 && endTokenIndex !== -1) { + return BlockCommentCommand._createRemoveBlockCommentOperations(new Range(startLineNumber, startTokenIndex + startToken.length + 1, endLineNumber, endTokenIndex + 1), startToken, endToken); + } + return null; + } + /** + * Given an unsuccessful analysis, delegate to the block comment command + */ + _executeBlockComment(model, builder, s) { + model.tokenization.tokenizeIfCheap(s.startLineNumber); + const languageId = model.getLanguageIdAtPosition(s.startLineNumber, 1); + const config = this.languageConfigurationService.getLanguageConfiguration(languageId).comments; + if (!config || !config.blockCommentStartToken || !config.blockCommentEndToken) { + return; + } + const startToken = config.blockCommentStartToken; + const endToken = config.blockCommentEndToken; + let ops = this._attemptRemoveBlockComment(model, s, startToken, endToken); + if (!ops) { + if (s.isEmpty()) { + const lineContent = model.getLineContent(s.startLineNumber); + let firstNonWhitespaceIndex2 = firstNonWhitespaceIndex(lineContent); + if (firstNonWhitespaceIndex2 === -1) { + firstNonWhitespaceIndex2 = lineContent.length; + } + ops = BlockCommentCommand._createAddBlockCommentOperations(new Range(s.startLineNumber, firstNonWhitespaceIndex2 + 1, s.startLineNumber, lineContent.length + 1), startToken, endToken, this._insertSpace); + } else { + ops = BlockCommentCommand._createAddBlockCommentOperations(new Range(s.startLineNumber, model.getLineFirstNonWhitespaceColumn(s.startLineNumber), s.endLineNumber, model.getLineMaxColumn(s.endLineNumber)), startToken, endToken, this._insertSpace); + } + if (ops.length === 1) { + this._deltaColumn = startToken.length + 1; + } + } + this._selectionId = builder.trackSelection(s); + for (const op of ops) { + builder.addEditOperation(op.range, op.text); + } + } + getEditOperations(model, builder) { + let s = this._selection; + this._moveEndPositionDown = false; + if (s.startLineNumber === s.endLineNumber && this._ignoreFirstLine) { + builder.addEditOperation(new Range(s.startLineNumber, model.getLineMaxColumn(s.startLineNumber), s.startLineNumber + 1, 1), s.startLineNumber === model.getLineCount() ? "" : "\n"); + this._selectionId = builder.trackSelection(s); + return; + } + if (s.startLineNumber < s.endLineNumber && s.endColumn === 1) { + this._moveEndPositionDown = true; + s = s.setEndPosition(s.endLineNumber - 1, model.getLineMaxColumn(s.endLineNumber - 1)); + } + const data = _LineCommentCommand._gatherPreflightData(this._type, this._insertSpace, model, s.startLineNumber, s.endLineNumber, this._ignoreEmptyLines, this._ignoreFirstLine, this.languageConfigurationService); + if (data.supported) { + return this._executeLineComments(model, builder, data, s); + } + return this._executeBlockComment(model, builder, s); + } + computeCursorState(model, helper) { + let result = helper.getTrackedSelection(this._selectionId); + if (this._moveEndPositionDown) { + result = result.setEndPosition(result.endLineNumber + 1, 1); + } + return new Selection(result.selectionStartLineNumber, result.selectionStartColumn + this._deltaColumn, result.positionLineNumber, result.positionColumn + this._deltaColumn); + } + /** + * Generate edit operations in the remove line comment case + */ + static _createRemoveLineCommentsOperations(lines, startLineNumber) { + const res = []; + for (let i2 = 0, len = lines.length; i2 < len; i2++) { + const lineData = lines[i2]; + if (lineData.ignore) { + continue; + } + res.push(EditOperation.delete(new Range(startLineNumber + i2, lineData.commentStrOffset + 1, startLineNumber + i2, lineData.commentStrOffset + lineData.commentStrLength + 1))); + } + return res; + } + /** + * Generate edit operations in the add line comment case + */ + _createAddLineCommentsOperations(lines, startLineNumber) { + const res = []; + const afterCommentStr = this._insertSpace ? " " : ""; + for (let i2 = 0, len = lines.length; i2 < len; i2++) { + const lineData = lines[i2]; + if (lineData.ignore) { + continue; + } + res.push(EditOperation.insert(new Position(startLineNumber + i2, lineData.commentStrOffset + 1), lineData.commentStr + afterCommentStr)); + } + return res; + } + static nextVisibleColumn(currentVisibleColumn, indentSize, isTab, columnSize) { + if (isTab) { + return currentVisibleColumn + (indentSize - currentVisibleColumn % indentSize); + } + return currentVisibleColumn + columnSize; + } + /** + * Adjust insertion points to have them vertically aligned in the add line comment case + */ + static _normalizeInsertionPoint(model, lines, startLineNumber, indentSize) { + let minVisibleColumn = 1073741824; + let j; + let lenJ; + for (let i2 = 0, len = lines.length; i2 < len; i2++) { + if (lines[i2].ignore) { + continue; + } + const lineContent = model.getLineContent(startLineNumber + i2); + let currentVisibleColumn = 0; + for (let j2 = 0, lenJ2 = lines[i2].commentStrOffset; currentVisibleColumn < minVisibleColumn && j2 < lenJ2; j2++) { + currentVisibleColumn = _LineCommentCommand.nextVisibleColumn(currentVisibleColumn, indentSize, lineContent.charCodeAt(j2) === 9, 1); + } + if (currentVisibleColumn < minVisibleColumn) { + minVisibleColumn = currentVisibleColumn; + } + } + minVisibleColumn = Math.floor(minVisibleColumn / indentSize) * indentSize; + for (let i2 = 0, len = lines.length; i2 < len; i2++) { + if (lines[i2].ignore) { + continue; + } + const lineContent = model.getLineContent(startLineNumber + i2); + let currentVisibleColumn = 0; + for (j = 0, lenJ = lines[i2].commentStrOffset; currentVisibleColumn < minVisibleColumn && j < lenJ; j++) { + currentVisibleColumn = _LineCommentCommand.nextVisibleColumn(currentVisibleColumn, indentSize, lineContent.charCodeAt(j) === 9, 1); + } + if (currentVisibleColumn > minVisibleColumn) { + lines[i2].commentStrOffset = j - 1; + } else { + lines[i2].commentStrOffset = j; + } + } + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/comment/browser/comment.js +var CommentLineAction = class extends EditorAction { + constructor(type, opts) { + super(opts); + this._type = type; + } + run(accessor, editor2) { + const languageConfigurationService = accessor.get(ILanguageConfigurationService); + if (!editor2.hasModel()) { + return; + } + const model = editor2.getModel(); + const commands = []; + const modelOptions = model.getOptions(); + const commentsOptions = editor2.getOption( + 29 + /* EditorOption.comments */ + ); + const selections = editor2.getSelections().map((selection, index) => ({ selection, index, ignoreFirstLine: false })); + selections.sort((a, b) => Range.compareRangesUsingStarts(a.selection, b.selection)); + let prev = selections[0]; + for (let i2 = 1; i2 < selections.length; i2++) { + const curr = selections[i2]; + if (prev.selection.endLineNumber === curr.selection.startLineNumber) { + if (prev.index < curr.index) { + curr.ignoreFirstLine = true; + } else { + prev.ignoreFirstLine = true; + prev = curr; + } + } + } + for (const selection of selections) { + commands.push(new LineCommentCommand(languageConfigurationService, selection.selection, modelOptions.indentSize, this._type, commentsOptions.insertSpace, commentsOptions.ignoreEmptyLines, selection.ignoreFirstLine)); + } + editor2.pushUndoStop(); + editor2.executeCommands(this.id, commands); + editor2.pushUndoStop(); + } +}; +var ToggleCommentLineAction = class extends CommentLineAction { + constructor() { + super(0, { + id: "editor.action.commentLine", + label: localize2(897, "Toggle Line Comment"), + precondition: EditorContextKeys.writable, + kbOpts: { + kbExpr: EditorContextKeys.editorTextFocus, + primary: 2048 | 90, + weight: 100 + /* KeybindingWeight.EditorContrib */ + }, + menuOpts: { + menuId: MenuId.MenubarEditMenu, + group: "5_insert", + title: localize(895, "&&Toggle Line Comment"), + order: 1 + }, + canTriggerInlineEdits: true + }); + } +}; +var AddLineCommentAction = class extends CommentLineAction { + constructor() { + super(1, { + id: "editor.action.addCommentLine", + label: localize2(898, "Add Line Comment"), + precondition: EditorContextKeys.writable, + kbOpts: { + kbExpr: EditorContextKeys.editorTextFocus, + primary: KeyChord( + 2048 | 41, + 2048 | 33 + /* KeyCode.KeyC */ + ), + weight: 100 + /* KeybindingWeight.EditorContrib */ + }, + canTriggerInlineEdits: true + }); + } +}; +var RemoveLineCommentAction = class extends CommentLineAction { + constructor() { + super(2, { + id: "editor.action.removeCommentLine", + label: localize2(899, "Remove Line Comment"), + precondition: EditorContextKeys.writable, + kbOpts: { + kbExpr: EditorContextKeys.editorTextFocus, + primary: KeyChord( + 2048 | 41, + 2048 | 51 + /* KeyCode.KeyU */ + ), + weight: 100 + /* KeybindingWeight.EditorContrib */ + }, + canTriggerInlineEdits: true + }); + } +}; +var BlockCommentAction = class extends EditorAction { + constructor() { + super({ + id: "editor.action.blockComment", + label: localize2(900, "Toggle Block Comment"), + precondition: EditorContextKeys.writable, + kbOpts: { + kbExpr: EditorContextKeys.editorTextFocus, + primary: 1024 | 512 | 31, + linux: { + primary: 2048 | 1024 | 31 + /* KeyCode.KeyA */ + }, + weight: 100 + /* KeybindingWeight.EditorContrib */ + }, + menuOpts: { + menuId: MenuId.MenubarEditMenu, + group: "5_insert", + title: localize(896, "Toggle &&Block Comment"), + order: 2 + }, + canTriggerInlineEdits: true + }); + } + run(accessor, editor2) { + const languageConfigurationService = accessor.get(ILanguageConfigurationService); + if (!editor2.hasModel()) { + return; + } + const commentsOptions = editor2.getOption( + 29 + /* EditorOption.comments */ + ); + const commands = []; + const selections = editor2.getSelections(); + for (const selection of selections) { + commands.push(new BlockCommentCommand(selection, commentsOptions.insertSpace, languageConfigurationService)); + } + editor2.pushUndoStop(); + editor2.executeCommands(this.id, commands); + editor2.pushUndoStop(); + } +}; +registerEditorAction(ToggleCommentLineAction); +registerEditorAction(AddLineCommentAction); +registerEditorAction(RemoveLineCommentAction); +registerEditorAction(BlockCommentAction); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/contextmenu/browser/contextmenu.js +init_dom(); +init_actions(); +init_lifecycle(); +init_platform(); +init_editorExtensions(); +init_editorContextKeys(); +init_nls(); +init_actions2(); +init_contextkey(); +init_configuration(); +var __decorate88 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param82 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var ContextMenuController_1; +var ContextMenuController = class ContextMenuController2 { + static { + ContextMenuController_1 = this; + } + static { + this.ID = "editor.contrib.contextmenu"; + } + static get(editor2) { + return editor2.getContribution(ContextMenuController_1.ID); + } + constructor(editor2, _contextMenuService, _contextViewService, _contextKeyService, _keybindingService, _menuService, _configurationService, _workspaceContextService) { + this._contextMenuService = _contextMenuService; + this._contextViewService = _contextViewService; + this._contextKeyService = _contextKeyService; + this._keybindingService = _keybindingService; + this._menuService = _menuService; + this._configurationService = _configurationService; + this._workspaceContextService = _workspaceContextService; + this._toDispose = new DisposableStore(); + this._contextMenuIsBeingShownCount = 0; + this._editor = editor2; + this._toDispose.add(this._editor.onContextMenu((e) => this._onContextMenu(e))); + this._toDispose.add(this._editor.onMouseWheel((e) => { + if (this._contextMenuIsBeingShownCount > 0) { + const view = this._contextViewService.getContextViewElement(); + const target = e.srcElement; + if (!(target.shadowRoot && getShadowRoot(view) === target.shadowRoot)) { + this._contextViewService.hideContextView(); + } + } + })); + this._toDispose.add(this._editor.onKeyDown((e) => { + if (!this._editor.getOption( + 30 + /* EditorOption.contextmenu */ + )) { + return; + } + if (e.keyCode === 58) { + e.preventDefault(); + e.stopPropagation(); + this.showContextMenu(); + } + })); + } + _onContextMenu(e) { + if (!this._editor.hasModel()) { + return; + } + if (!this._editor.getOption( + 30 + /* EditorOption.contextmenu */ + )) { + this._editor.focus(); + if (e.target.position && !this._editor.getSelection().containsPosition(e.target.position)) { + this._editor.setPosition(e.target.position); + } + return; + } + if (e.target.type === 12) { + return; + } + if (e.target.type === 6 && e.target.detail.injectedText) { + return; + } + e.event.preventDefault(); + e.event.stopPropagation(); + if (e.target.type === 11) { + return this._showScrollbarContextMenu(e.event); + } + if (e.target.type !== 6 && e.target.type !== 7 && e.target.type !== 1) { + return; + } + this._editor.focus(); + if (e.target.position) { + let hasSelectionAtPosition = false; + for (const selection of this._editor.getSelections()) { + if (selection.containsPosition(e.target.position)) { + hasSelectionAtPosition = true; + break; + } + } + if (!hasSelectionAtPosition) { + this._editor.setPosition(e.target.position); + } + } + let anchor = null; + if (e.target.type !== 1) { + anchor = e.event; + } + this.showContextMenu(anchor); + } + showContextMenu(anchor) { + if (!this._editor.getOption( + 30 + /* EditorOption.contextmenu */ + )) { + return; + } + if (!this._editor.hasModel()) { + return; + } + const menuActions = this._getMenuActions(this._editor.getModel(), this._editor.contextMenuId); + if (menuActions.length > 0) { + this._doShowContextMenu(menuActions, anchor); + } + } + _getMenuActions(model, menuId) { + const result = []; + const groups = this._menuService.getMenuActions(menuId, this._contextKeyService, { arg: model.uri }); + for (const group of groups) { + const [, actions] = group; + let addedItems = 0; + for (const action of actions) { + if (action instanceof SubmenuItemAction) { + const subActions = this._getMenuActions(model, action.item.submenu); + if (subActions.length > 0) { + result.push(new SubmenuAction(action.id, action.label, subActions)); + addedItems++; + } + } else { + result.push(action); + addedItems++; + } + } + if (addedItems) { + result.push(new Separator()); + } + } + if (result.length) { + result.pop(); + } + return result; + } + _doShowContextMenu(actions, event = null) { + if (!this._editor.hasModel()) { + return; + } + let anchor = event; + if (!anchor) { + this._editor.revealPosition( + this._editor.getPosition(), + 1 + /* ScrollType.Immediate */ + ); + this._editor.render(); + const cursorCoords = this._editor.getScrolledVisiblePosition(this._editor.getPosition()); + const editorCoords = getDomNodePagePosition(this._editor.getDomNode()); + const posx = editorCoords.left + cursorCoords.left; + const posy = editorCoords.top + cursorCoords.top + cursorCoords.height; + anchor = { x: posx, y: posy }; + } + const useShadowDOM = this._editor.getOption( + 144 + /* EditorOption.useShadowDOM */ + ) && !isIOS; + this._contextMenuIsBeingShownCount++; + this._contextMenuService.showContextMenu({ + domForShadowRoot: useShadowDOM ? this._editor.getOverflowWidgetsDomNode() ?? this._editor.getDomNode() : void 0, + getAnchor: () => anchor, + getActions: () => actions, + getActionViewItem: (action) => { + const keybinding = this._keybindingFor(action); + if (keybinding) { + return new ActionViewItem(action, action, { label: true, keybinding: keybinding.getLabel(), isMenu: true }); + } + const customAction = action; + if (typeof customAction.getActionViewItem === "function") { + return customAction.getActionViewItem(); + } + return new ActionViewItem(action, action, { icon: true, label: true, isMenu: true }); + }, + getKeyBinding: (action) => { + return this._keybindingFor(action); + }, + onHide: (wasCancelled) => { + this._contextMenuIsBeingShownCount--; + } + }); + } + _showScrollbarContextMenu(anchor) { + if (!this._editor.hasModel()) { + return; + } + if (isStandaloneEditorWorkspace(this._workspaceContextService.getWorkspace())) { + return; + } + const minimapOptions = this._editor.getOption( + 81 + /* EditorOption.minimap */ + ); + let lastId = 0; + const createAction = (opts) => { + return { + id: `menu-action-${++lastId}`, + label: opts.label, + tooltip: "", + class: void 0, + enabled: typeof opts.enabled === "undefined" ? true : opts.enabled, + checked: opts.checked, + run: opts.run + }; + }; + const createSubmenuAction = (label, actions2) => { + return new SubmenuAction(`menu-action-${++lastId}`, label, actions2, void 0); + }; + const createEnumAction = (label, enabled, configName, configuredValue, options2) => { + if (!enabled) { + return createAction({ label, enabled, run: () => { + } }); + } + const createRunner = (value) => { + return () => { + this._configurationService.updateValue(configName, value); + }; + }; + const actions2 = []; + for (const option2 of options2) { + actions2.push(createAction({ + label: option2.label, + checked: configuredValue === option2.value, + run: createRunner(option2.value) + })); + } + return createSubmenuAction(label, actions2); + }; + const actions = []; + actions.push(createAction({ + label: localize(901, "Minimap"), + checked: minimapOptions.enabled, + run: () => { + this._configurationService.updateValue(`editor.minimap.enabled`, !minimapOptions.enabled); + } + })); + actions.push(new Separator()); + actions.push(createAction({ + label: localize(902, "Render Characters"), + enabled: minimapOptions.enabled, + checked: minimapOptions.renderCharacters, + run: () => { + this._configurationService.updateValue(`editor.minimap.renderCharacters`, !minimapOptions.renderCharacters); + } + })); + actions.push(createEnumAction(localize(903, "Vertical size"), minimapOptions.enabled, "editor.minimap.size", minimapOptions.size, [{ + label: localize(904, "Proportional"), + value: "proportional" + }, { + label: localize(905, "Fill"), + value: "fill" + }, { + label: localize(906, "Fit"), + value: "fit" + }])); + actions.push(createEnumAction(localize(907, "Slider"), minimapOptions.enabled, "editor.minimap.showSlider", minimapOptions.showSlider, [{ + label: localize(908, "Mouse Over"), + value: "mouseover" + }, { + label: localize(909, "Always"), + value: "always" + }])); + const useShadowDOM = this._editor.getOption( + 144 + /* EditorOption.useShadowDOM */ + ) && !isIOS; + this._contextMenuIsBeingShownCount++; + this._contextMenuService.showContextMenu({ + domForShadowRoot: useShadowDOM ? this._editor.getDomNode() : void 0, + getAnchor: () => anchor, + getActions: () => actions, + onHide: (wasCancelled) => { + this._contextMenuIsBeingShownCount--; + this._editor.focus(); + } + }); + } + _keybindingFor(action) { + return this._keybindingService.lookupKeybinding(action.id); + } + dispose() { + if (this._contextMenuIsBeingShownCount > 0) { + this._contextViewService.hideContextView(); + } + this._toDispose.dispose(); + } +}; +ContextMenuController = ContextMenuController_1 = __decorate88([ + __param82(1, IContextMenuService), + __param82(2, IContextViewService), + __param82(3, IContextKeyService), + __param82(4, IKeybindingService), + __param82(5, IMenuService), + __param82(6, IConfigurationService), + __param82(7, IWorkspaceContextService) +], ContextMenuController); +var ShowContextMenu = class extends EditorAction { + constructor() { + super({ + id: "editor.action.showContextMenu", + label: localize2(910, "Show Editor Context Menu"), + precondition: void 0, + kbOpts: { + kbExpr: EditorContextKeys.textInputFocus, + primary: 1024 | 68, + weight: 100 + /* KeybindingWeight.EditorContrib */ + } + }); + } + run(accessor, editor2) { + ContextMenuController.get(editor2)?.showContextMenu(); + } +}; +registerEditorContribution( + ContextMenuController.ID, + ContextMenuController, + 2 + /* EditorContributionInstantiation.BeforeFirstInteraction */ +); +registerEditorAction(ShowContextMenu); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/cursorUndo/browser/cursorUndo.js +init_lifecycle(); +init_editorExtensions(); +init_editorContextKeys(); +init_nls(); +var CursorState2 = class { + constructor(selections) { + this.selections = selections; + } + equals(other) { + const thisLen = this.selections.length; + const otherLen = other.selections.length; + if (thisLen !== otherLen) { + return false; + } + for (let i2 = 0; i2 < thisLen; i2++) { + if (!this.selections[i2].equalsSelection(other.selections[i2])) { + return false; + } + } + return true; + } +}; +var StackElement = class { + constructor(cursorState, scrollTop, scrollLeft) { + this.cursorState = cursorState; + this.scrollTop = scrollTop; + this.scrollLeft = scrollLeft; + } +}; +var CursorUndoRedoController = class _CursorUndoRedoController extends Disposable { + static { + this.ID = "editor.contrib.cursorUndoRedoController"; + } + static get(editor2) { + return editor2.getContribution(_CursorUndoRedoController.ID); + } + constructor(editor2) { + super(); + this._editor = editor2; + this._isCursorUndoRedo = false; + this._undoStack = []; + this._redoStack = []; + this._register(editor2.onDidChangeModel((e) => { + this._undoStack = []; + this._redoStack = []; + })); + this._register(editor2.onDidChangeModelContent((e) => { + this._undoStack = []; + this._redoStack = []; + })); + this._register(editor2.onDidChangeCursorSelection((e) => { + if (this._isCursorUndoRedo) { + return; + } + if (!e.oldSelections) { + return; + } + if (e.oldModelVersionId !== e.modelVersionId) { + return; + } + const prevState = new CursorState2(e.oldSelections); + const isEqualToLastUndoStack = this._undoStack.length > 0 && this._undoStack[this._undoStack.length - 1].cursorState.equals(prevState); + if (!isEqualToLastUndoStack) { + this._undoStack.push(new StackElement(prevState, editor2.getScrollTop(), editor2.getScrollLeft())); + this._redoStack = []; + if (this._undoStack.length > 50) { + this._undoStack.shift(); + } + } + })); + } + cursorUndo() { + if (!this._editor.hasModel() || this._undoStack.length === 0) { + return; + } + this._redoStack.push(new StackElement(new CursorState2(this._editor.getSelections()), this._editor.getScrollTop(), this._editor.getScrollLeft())); + this._applyState(this._undoStack.pop()); + } + cursorRedo() { + if (!this._editor.hasModel() || this._redoStack.length === 0) { + return; + } + this._undoStack.push(new StackElement(new CursorState2(this._editor.getSelections()), this._editor.getScrollTop(), this._editor.getScrollLeft())); + this._applyState(this._redoStack.pop()); + } + _applyState(stackElement) { + this._isCursorUndoRedo = true; + this._editor.setSelections(stackElement.cursorState.selections); + this._editor.setScrollPosition({ + scrollTop: stackElement.scrollTop, + scrollLeft: stackElement.scrollLeft + }); + this._isCursorUndoRedo = false; + } +}; +var CursorUndo = class extends EditorAction { + constructor() { + super({ + id: "cursorUndo", + label: localize2(911, "Cursor Undo"), + precondition: void 0, + kbOpts: { + kbExpr: EditorContextKeys.textInputFocus, + primary: 2048 | 51, + weight: 100 + /* KeybindingWeight.EditorContrib */ + } + }); + } + run(accessor, editor2, args) { + CursorUndoRedoController.get(editor2)?.cursorUndo(); + } +}; +var CursorRedo = class extends EditorAction { + constructor() { + super({ + id: "cursorRedo", + label: localize2(912, "Cursor Redo"), + precondition: void 0 + }); + } + run(accessor, editor2, args) { + CursorUndoRedoController.get(editor2)?.cursorRedo(); + } +}; +registerEditorContribution( + CursorUndoRedoController.ID, + CursorUndoRedoController, + 0 + /* EditorContributionInstantiation.Eager */ +); +registerEditorAction(CursorUndo); +registerEditorAction(CursorRedo); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/dnd/browser/dnd.js +init_lifecycle(); +init_platform(); +init_editorExtensions(); +init_position(); +init_range(); +init_selection(); +init_textModel(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/dnd/browser/dragAndDropCommand.js +init_range(); +init_selection(); +var DragAndDropCommand = class { + constructor(selection, targetPosition, copy) { + this.selection = selection; + this.targetPosition = targetPosition; + this.copy = copy; + this.targetSelection = null; + } + getEditOperations(model, builder) { + const text2 = model.getValueInRange(this.selection); + if (!this.copy) { + builder.addEditOperation(this.selection, null); + } + builder.addEditOperation(new Range(this.targetPosition.lineNumber, this.targetPosition.column, this.targetPosition.lineNumber, this.targetPosition.column), text2); + if (this.selection.containsPosition(this.targetPosition) && !(this.copy && (this.selection.getEndPosition().equals(this.targetPosition) || this.selection.getStartPosition().equals(this.targetPosition)))) { + this.targetSelection = this.selection; + return; + } + if (this.copy) { + this.targetSelection = new Selection(this.targetPosition.lineNumber, this.targetPosition.column, this.selection.endLineNumber - this.selection.startLineNumber + this.targetPosition.lineNumber, this.selection.startLineNumber === this.selection.endLineNumber ? this.targetPosition.column + this.selection.endColumn - this.selection.startColumn : this.selection.endColumn); + return; + } + if (this.targetPosition.lineNumber > this.selection.endLineNumber) { + this.targetSelection = new Selection(this.targetPosition.lineNumber - this.selection.endLineNumber + this.selection.startLineNumber, this.targetPosition.column, this.targetPosition.lineNumber, this.selection.startLineNumber === this.selection.endLineNumber ? this.targetPosition.column + this.selection.endColumn - this.selection.startColumn : this.selection.endColumn); + return; + } + if (this.targetPosition.lineNumber < this.selection.endLineNumber) { + this.targetSelection = new Selection(this.targetPosition.lineNumber, this.targetPosition.column, this.targetPosition.lineNumber + this.selection.endLineNumber - this.selection.startLineNumber, this.selection.startLineNumber === this.selection.endLineNumber ? this.targetPosition.column + this.selection.endColumn - this.selection.startColumn : this.selection.endColumn); + return; + } + if (this.selection.endColumn <= this.targetPosition.column) { + this.targetSelection = new Selection(this.targetPosition.lineNumber - this.selection.endLineNumber + this.selection.startLineNumber, this.selection.startLineNumber === this.selection.endLineNumber ? this.targetPosition.column - this.selection.endColumn + this.selection.startColumn : this.targetPosition.column - this.selection.endColumn + this.selection.startColumn, this.targetPosition.lineNumber, this.selection.startLineNumber === this.selection.endLineNumber ? this.targetPosition.column : this.selection.endColumn); + } else { + this.targetSelection = new Selection(this.targetPosition.lineNumber - this.selection.endLineNumber + this.selection.startLineNumber, this.targetPosition.column, this.targetPosition.lineNumber, this.targetPosition.column + this.selection.endColumn - this.selection.startColumn); + } + } + computeCursorState(model, helper) { + return this.targetSelection; + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/dnd/browser/dnd.js +function hasTriggerModifier(e) { + if (isMacintosh) { + return e.altKey; + } else { + return e.ctrlKey; + } +} +var DragAndDropController = class _DragAndDropController extends Disposable { + static { + this.ID = "editor.contrib.dragAndDrop"; + } + static { + this.TRIGGER_KEY_VALUE = isMacintosh ? 6 : 5; + } + constructor(editor2) { + super(); + this._editor = editor2; + this._dndDecorationIds = this._editor.createDecorationsCollection(); + this._register(this._editor.onMouseDown((e) => this._onEditorMouseDown(e))); + this._register(this._editor.onMouseUp((e) => this._onEditorMouseUp(e))); + this._register(this._editor.onMouseDrag((e) => this._onEditorMouseDrag(e))); + this._register(this._editor.onMouseDrop((e) => this._onEditorMouseDrop(e))); + this._register(this._editor.onMouseDropCanceled(() => this._onEditorMouseDropCanceled())); + this._register(this._editor.onKeyDown((e) => this.onEditorKeyDown(e))); + this._register(this._editor.onKeyUp((e) => this.onEditorKeyUp(e))); + this._register(this._editor.onDidBlurEditorWidget(() => this.onEditorBlur())); + this._register(this._editor.onDidBlurEditorText(() => this.onEditorBlur())); + this._mouseDown = false; + this._modifierPressed = false; + this._dragSelection = null; + } + onEditorBlur() { + this._removeDecoration(); + this._dragSelection = null; + this._mouseDown = false; + this._modifierPressed = false; + } + onEditorKeyDown(e) { + if (!this._editor.getOption( + 42 + /* EditorOption.dragAndDrop */ + ) || this._editor.getOption( + 28 + /* EditorOption.columnSelection */ + )) { + return; + } + if (hasTriggerModifier(e)) { + this._modifierPressed = true; + } + if (this._mouseDown && hasTriggerModifier(e)) { + this._editor.updateOptions({ + mouseStyle: "copy" + }); + } + } + onEditorKeyUp(e) { + if (!this._editor.getOption( + 42 + /* EditorOption.dragAndDrop */ + ) || this._editor.getOption( + 28 + /* EditorOption.columnSelection */ + )) { + return; + } + if (hasTriggerModifier(e)) { + this._modifierPressed = false; + } + if (this._mouseDown && e.keyCode === _DragAndDropController.TRIGGER_KEY_VALUE) { + this._editor.updateOptions({ + mouseStyle: "default" + }); + } + } + _onEditorMouseDown(mouseEvent) { + this._mouseDown = true; + } + _onEditorMouseUp(mouseEvent) { + this._mouseDown = false; + this._editor.updateOptions({ + mouseStyle: "text" + }); + } + _onEditorMouseDrag(mouseEvent) { + const target = mouseEvent.target; + if (this._dragSelection === null) { + const selections = this._editor.getSelections() || []; + const possibleSelections = selections.filter((selection) => target.position && selection.containsPosition(target.position)); + if (possibleSelections.length === 1) { + this._dragSelection = possibleSelections[0]; + } else { + return; + } + } + if (hasTriggerModifier(mouseEvent.event)) { + this._editor.updateOptions({ + mouseStyle: "copy" + }); + } else { + this._editor.updateOptions({ + mouseStyle: "default" + }); + } + if (target.position) { + if (this._dragSelection.containsPosition(target.position)) { + this._removeDecoration(); + } else { + this.showAt(target.position); + } + } + } + _onEditorMouseDropCanceled() { + this._editor.updateOptions({ + mouseStyle: "text" + }); + this._removeDecoration(); + this._dragSelection = null; + this._mouseDown = false; + } + _onEditorMouseDrop(mouseEvent) { + if (mouseEvent.target && (this._hitContent(mouseEvent.target) || this._hitMargin(mouseEvent.target)) && mouseEvent.target.position) { + const newCursorPosition = new Position(mouseEvent.target.position.lineNumber, mouseEvent.target.position.column); + if (this._dragSelection === null) { + let newSelections = null; + if (mouseEvent.event.shiftKey) { + const primarySelection = this._editor.getSelection(); + if (primarySelection) { + const { selectionStartLineNumber, selectionStartColumn } = primarySelection; + newSelections = [new Selection(selectionStartLineNumber, selectionStartColumn, newCursorPosition.lineNumber, newCursorPosition.column)]; + } + } else { + newSelections = (this._editor.getSelections() || []).map((selection) => { + if (selection.containsPosition(newCursorPosition)) { + return new Selection(newCursorPosition.lineNumber, newCursorPosition.column, newCursorPosition.lineNumber, newCursorPosition.column); + } else { + return selection; + } + }); + } + this._editor.setSelections( + newSelections || [], + "mouse", + 3 + /* CursorChangeReason.Explicit */ + ); + } else if (!this._dragSelection.containsPosition(newCursorPosition) || (hasTriggerModifier(mouseEvent.event) || this._modifierPressed) && (this._dragSelection.getEndPosition().equals(newCursorPosition) || this._dragSelection.getStartPosition().equals(newCursorPosition))) { + this._editor.pushUndoStop(); + this._editor.executeCommand(_DragAndDropController.ID, new DragAndDropCommand(this._dragSelection, newCursorPosition, hasTriggerModifier(mouseEvent.event) || this._modifierPressed)); + this._editor.pushUndoStop(); + } + } + this._editor.updateOptions({ + mouseStyle: "text" + }); + this._removeDecoration(); + this._dragSelection = null; + this._mouseDown = false; + } + static { + this._DECORATION_OPTIONS = ModelDecorationOptions.register({ + description: "dnd-target", + className: "dnd-target" + }); + } + showAt(position) { + this._dndDecorationIds.set([{ + range: new Range(position.lineNumber, position.column, position.lineNumber, position.column), + options: _DragAndDropController._DECORATION_OPTIONS + }]); + this._editor.revealPosition( + position, + 1 + /* ScrollType.Immediate */ + ); + } + _removeDecoration() { + this._dndDecorationIds.clear(); + } + _hitContent(target) { + return target.type === 6 || target.type === 7; + } + _hitMargin(target) { + return target.type === 2 || target.type === 3 || target.type === 4; + } + dispose() { + this._removeDecoration(); + this._dragSelection = null; + this._mouseDown = false; + this._modifierPressed = false; + super.dispose(); + } +}; +registerEditorContribution( + DragAndDropController.ID, + DragAndDropController, + 2 + /* EditorContributionInstantiation.BeforeFirstInteraction */ +); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteContribution.js +init_nls(); +init_editorExtensions(); +init_editorContextKeys(); +var pasteAsCommandId = "editor.action.pasteAs"; +registerEditorContribution( + CopyPasteController.ID, + CopyPasteController, + 0 + /* EditorContributionInstantiation.Eager */ +); +registerEditorFeature(DefaultPasteProvidersFeature); +registerEditorCommand(new class extends EditorCommand { + constructor() { + super({ + id: changePasteTypeCommandId, + precondition: pasteWidgetVisibleCtx, + kbOpts: { + weight: 100, + primary: 2048 | 89 + } + }); + } + runEditorCommand(_accessor, editor2) { + return CopyPasteController.get(editor2)?.changePasteType(); + } +}()); +registerEditorCommand(new class extends EditorCommand { + constructor() { + super({ + id: "editor.hidePasteWidget", + precondition: pasteWidgetVisibleCtx, + kbOpts: { + weight: 100, + primary: 9 + } + }); + } + runEditorCommand(_accessor, editor2) { + CopyPasteController.get(editor2)?.clearWidgets(); + } +}()); +registerEditorAction(class PasteAsAction extends EditorAction { + static { + this.argsSchema = { + oneOf: [ + { + type: "object", + required: ["kind"], + properties: { + kind: { + type: "string", + description: localize(913, "The kind of the paste edit to try pasting with.\nIf there are multiple edits for this kind, the editor will show a picker. If there are no edits of this kind, the editor will show an error message.") + } + } + }, + { + type: "object", + required: ["preferences"], + properties: { + preferences: { + type: "array", + description: localize(914, "List of preferred paste edit kind to try applying.\nThe first edit matching the preferences will be applied."), + items: { type: "string" } + } + } + } + ] + }; + } + constructor() { + super({ + id: pasteAsCommandId, + label: localize2(915, "Paste As..."), + precondition: EditorContextKeys.writable, + metadata: { + description: "Paste as", + args: [{ + name: "args", + schema: PasteAsAction.argsSchema + }] + }, + canTriggerInlineEdits: true + }); + } + run(_accessor, editor2, args) { + let preference; + if (args) { + if ("kind" in args) { + preference = { only: new HierarchicalKind(args.kind) }; + } else if ("preferences" in args) { + preference = { preferences: args.preferences.map((kind) => new HierarchicalKind(kind)) }; + } + } + return CopyPasteController.get(editor2)?.pasteAs(preference); + } +}); +registerEditorAction(class extends EditorAction { + constructor() { + super({ + id: "editor.action.pasteAsText", + label: localize2(916, "Paste as Text"), + precondition: EditorContextKeys.writable, + canTriggerInlineEdits: true + }); + } + run(_accessor, editor2) { + return CopyPasteController.get(editor2)?.pasteAs({ providerId: DefaultTextPasteOrDropEditProvider.id }); + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/dropOrPasteInto/browser/dropIntoEditorContribution.js +init_editorExtensions(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/dropOrPasteInto/browser/dropIntoEditorController.js +init_arrays(); +init_async(); +init_errors(); +init_lifecycle(); +init_nls(); +init_configuration(); +init_contextkey(); +init_instantiation(); +init_range(); +init_languageFeatures(); + +// node_modules/monaco-editor-core/esm/vs/editor/common/services/treeViewsDnd.js +var TreeViewsDnDService = class { + constructor() { + this._dragOperations = /* @__PURE__ */ new Map(); + } + removeDragOperationTransfer(uuid) { + if (uuid && this._dragOperations.has(uuid)) { + const operation = this._dragOperations.get(uuid); + this._dragOperations.delete(uuid); + return operation; + } + return void 0; + } +}; +var DraggedTreeItemsIdentifier = class { + constructor(identifier) { + this.identifier = identifier; + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/common/services/treeViewsDndService.js +init_extensions(); +init_instantiation(); +var ITreeViewsDnDService = createDecorator("treeViewsDndService"); +registerSingleton( + ITreeViewsDnDService, + TreeViewsDnDService, + 1 + /* InstantiationType.Delayed */ +); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/dropOrPasteInto/browser/dropIntoEditorController.js +init_editorState(); +var __decorate89 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param83 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var DropIntoEditorController_1; +var dropAsPreferenceConfig = "editor.dropIntoEditor.preferences"; +var changeDropTypeCommandId = "editor.changeDropType"; +var dropWidgetVisibleCtx = new RawContextKey("dropWidgetVisible", false, localize(934, "Whether the drop widget is showing")); +var DropIntoEditorController = class DropIntoEditorController2 extends Disposable { + static { + DropIntoEditorController_1 = this; + } + static { + this.ID = "editor.contrib.dropIntoEditorController"; + } + static get(editor2) { + return editor2.getContribution(DropIntoEditorController_1.ID); + } + constructor(editor2, instantiationService, _configService, _languageFeaturesService, _treeViewsDragAndDropService) { + super(); + this._configService = _configService; + this._languageFeaturesService = _languageFeaturesService; + this._treeViewsDragAndDropService = _treeViewsDragAndDropService; + this.treeItemsTransfer = LocalSelectionTransfer.getInstance(); + this._dropProgressManager = this._register(instantiationService.createInstance(InlineProgressManager, "dropIntoEditor", editor2)); + this._postDropWidgetManager = this._register(instantiationService.createInstance(PostEditWidgetManager, "dropIntoEditor", editor2, dropWidgetVisibleCtx, { id: changeDropTypeCommandId, label: localize(935, "Show drop options...") }, () => DropIntoEditorController_1._configureDefaultAction ? [DropIntoEditorController_1._configureDefaultAction] : [])); + this._register(editor2.onDropIntoEditor((e) => this.onDropIntoEditor(editor2, e.position, e.event))); + } + clearWidgets() { + this._postDropWidgetManager.clear(); + } + changeDropType() { + this._postDropWidgetManager.tryShowSelector(); + } + async onDropIntoEditor(editor2, position, dragEvent) { + if (!dragEvent.dataTransfer || !editor2.hasModel()) { + return; + } + DropIntoEditorController_1._currentDropOperation?.cancel(); + editor2.focus(); + editor2.setPosition(position); + const p = createCancelablePromise(async (token) => { + const disposables = new DisposableStore(); + const tokenSource = disposables.add(new EditorStateCancellationTokenSource(editor2, 1, void 0, token)); + try { + const ourDataTransfer = await this.extractDataTransferData(dragEvent); + if (ourDataTransfer.size === 0 || tokenSource.token.isCancellationRequested) { + return; + } + const model = editor2.getModel(); + if (!model) { + return; + } + const providers = this._languageFeaturesService.documentDropEditProvider.ordered(model).filter((provider) => { + if (!provider.dropMimeTypes) { + return true; + } + return provider.dropMimeTypes.some((mime) => ourDataTransfer.matches(mime)); + }); + const editSession = disposables.add(await this.getDropEdits(providers, model, position, ourDataTransfer, tokenSource.token)); + if (tokenSource.token.isCancellationRequested) { + return; + } + if (editSession.edits.length) { + const activeEditIndex = this.getInitialActiveEditIndex(model, editSession.edits); + const canShowWidget = editor2.getOption( + 43 + /* EditorOption.dropIntoEditor */ + ).showDropSelector === "afterDrop"; + await this._postDropWidgetManager.applyEditAndShowIfNeeded([Range.fromPositions(position)], { activeEditIndex, allEdits: editSession.edits }, canShowWidget, async (edit2) => edit2, token); + } + } finally { + disposables.dispose(); + if (DropIntoEditorController_1._currentDropOperation === p) { + DropIntoEditorController_1._currentDropOperation = void 0; + } + } + }); + this._dropProgressManager.showWhile(position, localize(936, "Running drop handlers. Click to cancel"), p, { cancel: () => p.cancel() }); + DropIntoEditorController_1._currentDropOperation = p; + } + async getDropEdits(providers, model, position, dataTransfer, token) { + const disposables = new DisposableStore(); + const results = await raceCancellation(Promise.all(providers.map(async (provider) => { + try { + const edits2 = await provider.provideDocumentDropEdits(model, position, dataTransfer, token); + if (edits2) { + disposables.add(edits2); + } + return edits2?.edits.map((edit2) => ({ ...edit2, providerId: provider.id })); + } catch (err) { + if (!isCancellationError(err)) { + console.error(err); + } + console.error(err); + } + return void 0; + })), token); + const edits = coalesce(results ?? []).flat(); + return { + edits: sortEditsByYieldTo(edits), + dispose: () => disposables.dispose() + }; + } + getInitialActiveEditIndex(model, edits) { + const preferredProviders = this._configService.getValue(dropAsPreferenceConfig, { resource: model.uri }); + for (const config of Array.isArray(preferredProviders) ? preferredProviders : []) { + const desiredKind = new HierarchicalKind(config); + const editIndex = edits.findIndex((edit2) => edit2.kind && desiredKind.contains(edit2.kind)); + if (editIndex >= 0) { + return editIndex; + } + } + return 0; + } + async extractDataTransferData(dragEvent) { + if (!dragEvent.dataTransfer) { + return new VSDataTransfer(); + } + const dataTransfer = toExternalVSDataTransfer(dragEvent.dataTransfer); + if (this.treeItemsTransfer.hasData(DraggedTreeItemsIdentifier.prototype)) { + const data = this.treeItemsTransfer.getData(DraggedTreeItemsIdentifier.prototype); + if (Array.isArray(data)) { + for (const id of data) { + const treeDataTransfer = await this._treeViewsDragAndDropService.removeDragOperationTransfer(id.identifier); + if (treeDataTransfer) { + for (const [type, value] of treeDataTransfer) { + dataTransfer.replace(type, value); + } + } + } + } + } + return dataTransfer; + } +}; +DropIntoEditorController = DropIntoEditorController_1 = __decorate89([ + __param83(1, IInstantiationService), + __param83(2, IConfigurationService), + __param83(3, ILanguageFeaturesService), + __param83(4, ITreeViewsDnDService) +], DropIntoEditorController); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/dropOrPasteInto/browser/dropIntoEditorContribution.js +registerEditorContribution( + DropIntoEditorController.ID, + DropIntoEditorController, + 2 + /* EditorContributionInstantiation.BeforeFirstInteraction */ +); +registerEditorFeature(DefaultDropProvidersFeature); +registerEditorCommand(new class extends EditorCommand { + constructor() { + super({ + id: changeDropTypeCommandId, + precondition: dropWidgetVisibleCtx, + kbOpts: { + weight: 100, + primary: 2048 | 89 + } + }); + } + runEditorCommand(_accessor, editor2, _args) { + DropIntoEditorController.get(editor2)?.changeDropType(); + } +}()); +registerEditorCommand(new class extends EditorCommand { + constructor() { + super({ + id: "editor.hideDropWidget", + precondition: dropWidgetVisibleCtx, + kbOpts: { + weight: 100, + primary: 9 + } + }); + } + runEditorCommand(_accessor, editor2, _args) { + DropIntoEditorController.get(editor2)?.clearWidgets(); + } +}()); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/find/browser/findController.js +init_async(); +init_lifecycle(); +init_strings(); +init_editorExtensions(); +init_editorColorRegistry(); +init_editorContextKeys(); +init_model2(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/find/browser/findOptionsWidget.js +init_dom(); +init_async(); +init_colorRegistry(); +var FindOptionsWidget = class _FindOptionsWidget extends Widget { + static { + this.ID = "editor.contrib.findOptionsWidget"; + } + constructor(editor2, state, keybindingService) { + super(); + this._hideSoon = this._register(new RunOnceScheduler(() => this._hide(), 2e3)); + this._isVisible = false; + this._editor = editor2; + this._state = state; + this._keybindingService = keybindingService; + this._domNode = document.createElement("div"); + this._domNode.className = "findOptionsWidget"; + this._domNode.style.display = "none"; + this._domNode.style.top = "10px"; + this._domNode.style.zIndex = "12"; + this._domNode.setAttribute("role", "presentation"); + this._domNode.setAttribute("aria-hidden", "true"); + const toggleStyles = { + inputActiveOptionBorder: asCssVariable(inputActiveOptionBorder), + inputActiveOptionForeground: asCssVariable(inputActiveOptionForeground), + inputActiveOptionBackground: asCssVariable(inputActiveOptionBackground) + }; + const hoverLifecycleOptions = { groupId: "find-options-widget" }; + this.caseSensitive = this._register(new CaseSensitiveToggle({ + appendTitle: this._keybindingLabelFor(FIND_IDS.ToggleCaseSensitiveCommand), + isChecked: this._state.matchCase, + hoverLifecycleOptions, + ...toggleStyles + })); + this._domNode.appendChild(this.caseSensitive.domNode); + this._register(this.caseSensitive.onChange(() => { + this._state.change({ + matchCase: this.caseSensitive.checked + }, false); + })); + this.wholeWords = this._register(new WholeWordsToggle({ + appendTitle: this._keybindingLabelFor(FIND_IDS.ToggleWholeWordCommand), + isChecked: this._state.wholeWord, + hoverLifecycleOptions, + ...toggleStyles + })); + this._domNode.appendChild(this.wholeWords.domNode); + this._register(this.wholeWords.onChange(() => { + this._state.change({ + wholeWord: this.wholeWords.checked + }, false); + })); + this.regex = this._register(new RegexToggle({ + appendTitle: this._keybindingLabelFor(FIND_IDS.ToggleRegexCommand), + isChecked: this._state.isRegex, + hoverLifecycleOptions, + ...toggleStyles + })); + this._domNode.appendChild(this.regex.domNode); + this._register(this.regex.onChange(() => { + this._state.change({ + isRegex: this.regex.checked + }, false); + })); + this._editor.addOverlayWidget(this); + this._register(this._state.onFindReplaceStateChange((e) => { + let somethingChanged = false; + if (e.isRegex) { + this.regex.checked = this._state.isRegex; + somethingChanged = true; + } + if (e.wholeWord) { + this.wholeWords.checked = this._state.wholeWord; + somethingChanged = true; + } + if (e.matchCase) { + this.caseSensitive.checked = this._state.matchCase; + somethingChanged = true; + } + if (!this._state.isRevealed && somethingChanged) { + this._revealTemporarily(); + } + })); + this._register(addDisposableListener(this._domNode, EventType.MOUSE_LEAVE, (e) => this._onMouseLeave())); + this._register(addDisposableListener(this._domNode, "mouseover", (e) => this._onMouseOver())); + } + _keybindingLabelFor(actionId) { + const kb = this._keybindingService.lookupKeybinding(actionId); + if (!kb) { + return ""; + } + return ` (${kb.getLabel()})`; + } + dispose() { + this._editor.removeOverlayWidget(this); + super.dispose(); + } + // ----- IOverlayWidget API + getId() { + return _FindOptionsWidget.ID; + } + getDomNode() { + return this._domNode; + } + getPosition() { + return { + preference: 0 + /* OverlayWidgetPositionPreference.TOP_RIGHT_CORNER */ + }; + } + highlightFindOptions() { + this._revealTemporarily(); + } + _revealTemporarily() { + this._show(); + this._hideSoon.schedule(); + } + _onMouseLeave() { + this._hideSoon.schedule(); + } + _onMouseOver() { + this._hideSoon.cancel(); + } + _show() { + if (this._isVisible) { + return; + } + this._isVisible = true; + this._domNode.style.display = "block"; + } + _hide() { + if (!this._isVisible) { + return; + } + this._isVisible = false; + this._domNode.style.display = "none"; + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/find/browser/findState.js +init_event(); +init_lifecycle(); +init_range(); +function effectiveOptionValue(override, value) { + if (override === 1) { + return true; + } + if (override === 2) { + return false; + } + return value; +} +var FindReplaceState = class extends Disposable { + get searchString() { + return this._searchString; + } + get replaceString() { + return this._replaceString; + } + get isRevealed() { + return this._isRevealed; + } + get isReplaceRevealed() { + return this._isReplaceRevealed; + } + get isRegex() { + return effectiveOptionValue(this._isRegexOverride, this._isRegex); + } + get wholeWord() { + return effectiveOptionValue(this._wholeWordOverride, this._wholeWord); + } + get matchCase() { + return effectiveOptionValue(this._matchCaseOverride, this._matchCase); + } + get preserveCase() { + return effectiveOptionValue(this._preserveCaseOverride, this._preserveCase); + } + get actualIsRegex() { + return this._isRegex; + } + get actualWholeWord() { + return this._wholeWord; + } + get actualMatchCase() { + return this._matchCase; + } + get actualPreserveCase() { + return this._preserveCase; + } + get searchScope() { + return this._searchScope; + } + get matchesPosition() { + return this._matchesPosition; + } + get matchesCount() { + return this._matchesCount; + } + get currentMatch() { + return this._currentMatch; + } + constructor() { + super(); + this._onFindReplaceStateChange = this._register(new Emitter()); + this.onFindReplaceStateChange = this._onFindReplaceStateChange.event; + this._searchString = ""; + this._replaceString = ""; + this._isRevealed = false; + this._isReplaceRevealed = false; + this._isRegex = false; + this._isRegexOverride = 0; + this._wholeWord = false; + this._wholeWordOverride = 0; + this._matchCase = false; + this._matchCaseOverride = 0; + this._preserveCase = false; + this._preserveCaseOverride = 0; + this._searchScope = null; + this._matchesPosition = 0; + this._matchesCount = 0; + this._currentMatch = null; + this._loop = true; + this._isSearching = false; + this._filters = null; + } + changeMatchInfo(matchesPosition, matchesCount, currentMatch) { + const changeEvent = { + moveCursor: false, + updateHistory: false, + searchString: false, + replaceString: false, + isRevealed: false, + isReplaceRevealed: false, + isRegex: false, + wholeWord: false, + matchCase: false, + preserveCase: false, + searchScope: false, + matchesPosition: false, + matchesCount: false, + currentMatch: false, + loop: false, + isSearching: false, + filters: false + }; + let somethingChanged = false; + if (matchesCount === 0) { + matchesPosition = 0; + } + if (matchesPosition > matchesCount) { + matchesPosition = matchesCount; + } + if (this._matchesPosition !== matchesPosition) { + this._matchesPosition = matchesPosition; + changeEvent.matchesPosition = true; + somethingChanged = true; + } + if (this._matchesCount !== matchesCount) { + this._matchesCount = matchesCount; + changeEvent.matchesCount = true; + somethingChanged = true; + } + if (typeof currentMatch !== "undefined") { + if (!Range.equalsRange(this._currentMatch, currentMatch)) { + this._currentMatch = currentMatch; + changeEvent.currentMatch = true; + somethingChanged = true; + } + } + if (somethingChanged) { + this._onFindReplaceStateChange.fire(changeEvent); + } + } + change(newState, moveCursor, updateHistory = true) { + const changeEvent = { + moveCursor, + updateHistory, + searchString: false, + replaceString: false, + isRevealed: false, + isReplaceRevealed: false, + isRegex: false, + wholeWord: false, + matchCase: false, + preserveCase: false, + searchScope: false, + matchesPosition: false, + matchesCount: false, + currentMatch: false, + loop: false, + isSearching: false, + filters: false + }; + let somethingChanged = false; + const oldEffectiveIsRegex = this.isRegex; + const oldEffectiveWholeWords = this.wholeWord; + const oldEffectiveMatchCase = this.matchCase; + const oldEffectivePreserveCase = this.preserveCase; + if (typeof newState.searchString !== "undefined") { + if (this._searchString !== newState.searchString) { + this._searchString = newState.searchString; + changeEvent.searchString = true; + somethingChanged = true; + } + } + if (typeof newState.replaceString !== "undefined") { + if (this._replaceString !== newState.replaceString) { + this._replaceString = newState.replaceString; + changeEvent.replaceString = true; + somethingChanged = true; + } + } + if (typeof newState.isRevealed !== "undefined") { + if (this._isRevealed !== newState.isRevealed) { + this._isRevealed = newState.isRevealed; + changeEvent.isRevealed = true; + somethingChanged = true; + } + } + if (typeof newState.isReplaceRevealed !== "undefined") { + if (this._isReplaceRevealed !== newState.isReplaceRevealed) { + this._isReplaceRevealed = newState.isReplaceRevealed; + changeEvent.isReplaceRevealed = true; + somethingChanged = true; + } + } + if (typeof newState.isRegex !== "undefined") { + this._isRegex = newState.isRegex; + } + if (typeof newState.wholeWord !== "undefined") { + this._wholeWord = newState.wholeWord; + } + if (typeof newState.matchCase !== "undefined") { + this._matchCase = newState.matchCase; + } + if (typeof newState.preserveCase !== "undefined") { + this._preserveCase = newState.preserveCase; + } + if (typeof newState.searchScope !== "undefined") { + if (!newState.searchScope?.every((newSearchScope) => { + return this._searchScope?.some((existingSearchScope) => { + return !Range.equalsRange(existingSearchScope, newSearchScope); + }); + })) { + this._searchScope = newState.searchScope; + changeEvent.searchScope = true; + somethingChanged = true; + } + } + if (typeof newState.loop !== "undefined") { + if (this._loop !== newState.loop) { + this._loop = newState.loop; + changeEvent.loop = true; + somethingChanged = true; + } + } + if (typeof newState.isSearching !== "undefined") { + if (this._isSearching !== newState.isSearching) { + this._isSearching = newState.isSearching; + changeEvent.isSearching = true; + somethingChanged = true; + } + } + if (typeof newState.filters !== "undefined") { + if (this._filters) { + this._filters.update(newState.filters); + } else { + this._filters = newState.filters; + } + changeEvent.filters = true; + somethingChanged = true; + } + this._isRegexOverride = typeof newState.isRegexOverride !== "undefined" ? newState.isRegexOverride : 0; + this._wholeWordOverride = typeof newState.wholeWordOverride !== "undefined" ? newState.wholeWordOverride : 0; + this._matchCaseOverride = typeof newState.matchCaseOverride !== "undefined" ? newState.matchCaseOverride : 0; + this._preserveCaseOverride = typeof newState.preserveCaseOverride !== "undefined" ? newState.preserveCaseOverride : 0; + if (oldEffectiveIsRegex !== this.isRegex) { + somethingChanged = true; + changeEvent.isRegex = true; + } + if (oldEffectiveWholeWords !== this.wholeWord) { + somethingChanged = true; + changeEvent.wholeWord = true; + } + if (oldEffectiveMatchCase !== this.matchCase) { + somethingChanged = true; + changeEvent.matchCase = true; + } + if (oldEffectivePreserveCase !== this.preserveCase) { + somethingChanged = true; + changeEvent.preserveCase = true; + } + if (somethingChanged) { + this._onFindReplaceStateChange.fire(changeEvent); + } + } + canNavigateBack() { + return this.canNavigateInLoop() || this.matchesPosition !== 1; + } + canNavigateForward() { + return this.canNavigateInLoop() || this.matchesPosition < this.matchesCount; + } + canNavigateInLoop() { + return this._loop || this.matchesCount >= MATCHES_LIMIT; + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/find/browser/findController.js +init_nls(); +init_actions2(); +init_contextkey(); +init_themeService(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/find/browser/findWidgetSearchHistory.js +init_event(); +var __decorate90 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param84 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var FindWidgetSearchHistory_1; +var FindWidgetSearchHistory = class FindWidgetSearchHistory2 { + static { + FindWidgetSearchHistory_1 = this; + } + static { + this.FIND_HISTORY_KEY = "workbench.find.history"; + } + static { + this._instance = null; + } + static getOrCreate(storageService) { + if (!FindWidgetSearchHistory_1._instance) { + FindWidgetSearchHistory_1._instance = new FindWidgetSearchHistory_1(storageService); + } + return FindWidgetSearchHistory_1._instance; + } + constructor(storageService) { + this.storageService = storageService; + this.inMemoryValues = /* @__PURE__ */ new Set(); + this._onDidChangeEmitter = new Emitter(); + this.onDidChange = this._onDidChangeEmitter.event; + this.load(); + } + delete(t) { + const result = this.inMemoryValues.delete(t); + this.save(); + return result; + } + add(t) { + this.inMemoryValues.add(t); + this.save(); + return this; + } + has(t) { + return this.inMemoryValues.has(t); + } + forEach(callbackfn, thisArg) { + this.load(); + return this.inMemoryValues.forEach(callbackfn); + } + replace(t) { + this.inMemoryValues = new Set(t); + this.save(); + } + load() { + let result; + const raw = this.storageService.get( + FindWidgetSearchHistory_1.FIND_HISTORY_KEY, + 1 + /* StorageScope.WORKSPACE */ + ); + if (raw) { + try { + result = JSON.parse(raw); + } catch (e) { + } + } + this.inMemoryValues = new Set(result || []); + } + // Run saves async + save() { + const elements = []; + this.inMemoryValues.forEach((e) => elements.push(e)); + return new Promise((resolve3) => { + this.storageService.store( + FindWidgetSearchHistory_1.FIND_HISTORY_KEY, + JSON.stringify(elements), + 1, + 0 + /* StorageTarget.USER */ + ); + this._onDidChangeEmitter.fire(elements); + resolve3(); + }); + } +}; +FindWidgetSearchHistory = FindWidgetSearchHistory_1 = __decorate90([ + __param84(0, IStorageService) +], FindWidgetSearchHistory); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/find/browser/replaceWidgetHistory.js +init_event(); +var __decorate91 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param85 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var ReplaceWidgetHistory_1; +var ReplaceWidgetHistory = class ReplaceWidgetHistory2 { + static { + ReplaceWidgetHistory_1 = this; + } + static { + this.FIND_HISTORY_KEY = "workbench.replace.history"; + } + static { + this._instance = null; + } + static getOrCreate(storageService) { + if (!ReplaceWidgetHistory_1._instance) { + ReplaceWidgetHistory_1._instance = new ReplaceWidgetHistory_1(storageService); + } + return ReplaceWidgetHistory_1._instance; + } + constructor(storageService) { + this.storageService = storageService; + this.inMemoryValues = /* @__PURE__ */ new Set(); + this._onDidChangeEmitter = new Emitter(); + this.onDidChange = this._onDidChangeEmitter.event; + this.load(); + } + delete(t) { + const result = this.inMemoryValues.delete(t); + this.save(); + return result; + } + add(t) { + this.inMemoryValues.add(t); + this.save(); + return this; + } + has(t) { + return this.inMemoryValues.has(t); + } + forEach(callbackfn, thisArg) { + this.load(); + return this.inMemoryValues.forEach(callbackfn); + } + replace(t) { + this.inMemoryValues = new Set(t); + this.save(); + } + load() { + let result; + const raw = this.storageService.get( + ReplaceWidgetHistory_1.FIND_HISTORY_KEY, + 1 + /* StorageScope.WORKSPACE */ + ); + if (raw) { + try { + result = JSON.parse(raw); + } catch (e) { + } + } + this.inMemoryValues = new Set(result || []); + } + // Run saves async + save() { + const elements = []; + this.inMemoryValues.forEach((e) => elements.push(e)); + return new Promise((resolve3) => { + this.storageService.store( + ReplaceWidgetHistory_1.FIND_HISTORY_KEY, + JSON.stringify(elements), + 1, + 0 + /* StorageTarget.USER */ + ); + this._onDidChangeEmitter.fire(elements); + resolve3(); + }); + } +}; +ReplaceWidgetHistory = ReplaceWidgetHistory_1 = __decorate91([ + __param85(0, IStorageService) +], ReplaceWidgetHistory); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/find/browser/findController.js +var __decorate92 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param86 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var CommonFindController_1; +var SEARCH_STRING_MAX_LENGTH = 524288; +function getSelectionSearchString(editor2, seedSearchStringFromSelection = "single", seedSearchStringFromNonEmptySelection = false) { + if (!editor2.hasModel()) { + return null; + } + const selection = editor2.getSelection(); + if (seedSearchStringFromSelection === "single" && selection.startLineNumber === selection.endLineNumber || seedSearchStringFromSelection === "multiple") { + if (selection.isEmpty()) { + const wordAtPosition = editor2.getConfiguredWordAtPosition(selection.getStartPosition()); + if (wordAtPosition && false === seedSearchStringFromNonEmptySelection) { + return wordAtPosition.word; + } + } else { + if (editor2.getModel().getValueLengthInRange(selection) < SEARCH_STRING_MAX_LENGTH) { + return editor2.getModel().getValueInRange(selection); + } + } + } + return null; +} +var CommonFindController = class CommonFindController2 extends Disposable { + static { + CommonFindController_1 = this; + } + static { + this.ID = "editor.contrib.findController"; + } + get editor() { + return this._editor; + } + static get(editor2) { + return editor2.getContribution(CommonFindController_1.ID); + } + constructor(editor2, contextKeyService, storageService, clipboardService, notificationService, hoverService) { + super(); + this._editor = editor2; + this._findWidgetVisible = CONTEXT_FIND_WIDGET_VISIBLE.bindTo(contextKeyService); + this._contextKeyService = contextKeyService; + this._storageService = storageService; + this._clipboardService = clipboardService; + this._notificationService = notificationService; + this._hoverService = hoverService; + this._updateHistoryDelayer = new Delayer(500); + this._state = this._register(new FindReplaceState()); + this.loadQueryState(); + this._register(this._state.onFindReplaceStateChange((e) => this._onStateChanged(e))); + this._model = null; + this._register(this._editor.onDidChangeModel(() => { + const shouldRestartFind = this._editor.getModel() && this._state.isRevealed; + this.disposeModel(); + this._state.change({ + searchScope: null, + matchCase: this._storageService.getBoolean("editor.matchCase", 1, false), + wholeWord: this._storageService.getBoolean("editor.wholeWord", 1, false), + isRegex: this._storageService.getBoolean("editor.isRegex", 1, false), + preserveCase: this._storageService.getBoolean("editor.preserveCase", 1, false) + }, false); + if (shouldRestartFind) { + this._start({ + forceRevealReplace: false, + seedSearchStringFromSelection: "none", + seedSearchStringFromNonEmptySelection: false, + seedSearchStringFromGlobalClipboard: false, + shouldFocus: 0, + shouldAnimate: false, + updateSearchScope: false, + loop: this._editor.getOption( + 50 + /* EditorOption.find */ + ).loop + }); + } + })); + } + dispose() { + this.disposeModel(); + super.dispose(); + } + disposeModel() { + if (this._model) { + this._model.dispose(); + this._model = null; + } + } + _onStateChanged(e) { + this.saveQueryState(e); + if (e.isRevealed) { + if (this._state.isRevealed) { + this._findWidgetVisible.set(true); + } else { + this._findWidgetVisible.reset(); + this.disposeModel(); + } + } + if (e.searchString) { + this.setGlobalBufferTerm(this._state.searchString); + } + } + saveQueryState(e) { + if (e.isRegex) { + this._storageService.store( + "editor.isRegex", + this._state.actualIsRegex, + 1, + 1 + /* StorageTarget.MACHINE */ + ); + } + if (e.wholeWord) { + this._storageService.store( + "editor.wholeWord", + this._state.actualWholeWord, + 1, + 1 + /* StorageTarget.MACHINE */ + ); + } + if (e.matchCase) { + this._storageService.store( + "editor.matchCase", + this._state.actualMatchCase, + 1, + 1 + /* StorageTarget.MACHINE */ + ); + } + if (e.preserveCase) { + this._storageService.store( + "editor.preserveCase", + this._state.actualPreserveCase, + 1, + 1 + /* StorageTarget.MACHINE */ + ); + } + } + loadQueryState() { + this._state.change({ + matchCase: this._storageService.getBoolean("editor.matchCase", 1, this._state.matchCase), + wholeWord: this._storageService.getBoolean("editor.wholeWord", 1, this._state.wholeWord), + isRegex: this._storageService.getBoolean("editor.isRegex", 1, this._state.isRegex), + preserveCase: this._storageService.getBoolean("editor.preserveCase", 1, this._state.preserveCase) + }, false); + } + isFindInputFocused() { + return !!CONTEXT_FIND_INPUT_FOCUSED.getValue(this._contextKeyService); + } + getState() { + return this._state; + } + closeFindWidget() { + this._state.change({ + isRevealed: false, + searchScope: null + }, false); + this._editor.focus(); + } + toggleCaseSensitive() { + this._state.change({ matchCase: !this._state.matchCase }, false); + if (!this._state.isRevealed) { + this.highlightFindOptions(); + } + } + toggleWholeWords() { + this._state.change({ wholeWord: !this._state.wholeWord }, false); + if (!this._state.isRevealed) { + this.highlightFindOptions(); + } + } + toggleRegex() { + this._state.change({ isRegex: !this._state.isRegex }, false); + if (!this._state.isRevealed) { + this.highlightFindOptions(); + } + } + togglePreserveCase() { + this._state.change({ preserveCase: !this._state.preserveCase }, false); + if (!this._state.isRevealed) { + this.highlightFindOptions(); + } + } + toggleSearchScope() { + if (this._state.searchScope) { + this._state.change({ searchScope: null }, true); + } else { + if (this._editor.hasModel()) { + let selections = this._editor.getSelections(); + selections = selections.map((selection) => { + if (selection.endColumn === 1 && selection.endLineNumber > selection.startLineNumber) { + selection = selection.setEndPosition(selection.endLineNumber - 1, this._editor.getModel().getLineMaxColumn(selection.endLineNumber - 1)); + } + if (!selection.isEmpty()) { + return selection; + } + return null; + }).filter((element) => !!element); + if (selections.length) { + this._state.change({ searchScope: selections }, true); + } + } + } + } + setSearchString(searchString) { + if (this._state.isRegex) { + searchString = escapeRegExpCharacters(searchString); + } + this._state.change({ searchString }, false); + } + highlightFindOptions(ignoreWhenVisible = false) { + } + async _start(opts, newState) { + this.disposeModel(); + if (!this._editor.hasModel()) { + return; + } + const stateChanges = { + ...newState, + isRevealed: true + }; + if (opts.seedSearchStringFromSelection === "single") { + const selectionSearchString = getSelectionSearchString(this._editor, opts.seedSearchStringFromSelection, opts.seedSearchStringFromNonEmptySelection); + if (selectionSearchString) { + if (this._state.isRegex) { + stateChanges.searchString = escapeRegExpCharacters(selectionSearchString); + } else { + stateChanges.searchString = selectionSearchString; + } + } + } else if (opts.seedSearchStringFromSelection === "multiple" && !opts.updateSearchScope) { + const selectionSearchString = getSelectionSearchString(this._editor, opts.seedSearchStringFromSelection); + if (selectionSearchString) { + stateChanges.searchString = selectionSearchString; + } + } + if (!stateChanges.searchString && opts.seedSearchStringFromGlobalClipboard) { + const selectionSearchString = await this.getGlobalBufferTerm(); + if (!this._editor.hasModel()) { + return; + } + if (selectionSearchString) { + stateChanges.searchString = selectionSearchString; + } + } + if (opts.forceRevealReplace || stateChanges.isReplaceRevealed) { + stateChanges.isReplaceRevealed = true; + } else if (!this._findWidgetVisible.get()) { + stateChanges.isReplaceRevealed = false; + } + if (opts.updateSearchScope) { + const currentSelections = this._editor.getSelections(); + if (currentSelections.some((selection) => !selection.isEmpty())) { + stateChanges.searchScope = currentSelections; + } + } + stateChanges.loop = opts.loop; + this._state.change(stateChanges, false); + if (!this._model) { + this._model = new FindModelBoundToEditorModel(this._editor, this._state); + } + } + start(opts, newState) { + return this._start(opts, newState); + } + moveToNextMatch() { + if (this._model) { + this._model.moveToNextMatch(); + return true; + } + return false; + } + moveToPrevMatch() { + if (this._model) { + this._model.moveToPrevMatch(); + return true; + } + return false; + } + goToMatch(index) { + if (this._model) { + this._model.moveToMatch(index); + return true; + } + return false; + } + replace() { + if (this._model) { + this._model.replace(); + return true; + } + return false; + } + replaceAll() { + if (this._model) { + if (this._editor.getModel()?.isTooLargeForHeapOperation()) { + this._notificationService.warn(localize(940, "The file is too large to perform a replace all operation.")); + return false; + } + this._model.replaceAll(); + return true; + } + return false; + } + selectAllMatches() { + if (this._model) { + this._model.selectAllMatches(); + this._editor.focus(); + return true; + } + return false; + } + async getGlobalBufferTerm() { + if (this._editor.getOption( + 50 + /* EditorOption.find */ + ).globalFindClipboard && this._editor.hasModel() && !this._editor.getModel().isTooLargeForSyncing()) { + return this._clipboardService.readFindText(); + } + return ""; + } + setGlobalBufferTerm(text2) { + if (this._editor.getOption( + 50 + /* EditorOption.find */ + ).globalFindClipboard && this._editor.hasModel() && !this._editor.getModel().isTooLargeForSyncing()) { + this._clipboardService.writeFindText(text2); + } + } +}; +CommonFindController = CommonFindController_1 = __decorate92([ + __param86(1, IContextKeyService), + __param86(2, IStorageService), + __param86(3, IClipboardService), + __param86(4, INotificationService), + __param86(5, IHoverService) +], CommonFindController); +var FindController2 = class FindController3 extends CommonFindController { + constructor(editor2, _contextViewService, _contextKeyService, _keybindingService, notificationService, _storageService, clipboardService, hoverService) { + super(editor2, _contextKeyService, _storageService, clipboardService, notificationService, hoverService); + this._contextViewService = _contextViewService; + this._keybindingService = _keybindingService; + this._widget = null; + this._findOptionsWidget = null; + this._findWidgetSearchHistory = FindWidgetSearchHistory.getOrCreate(_storageService); + this._replaceWidgetHistory = ReplaceWidgetHistory.getOrCreate(_storageService); + } + async _start(opts, newState) { + if (!this._widget) { + this._createFindWidget(); + } + const selection = this._editor.getSelection(); + let updateSearchScope = false; + switch (this._editor.getOption( + 50 + /* EditorOption.find */ + ).autoFindInSelection) { + case "always": + updateSearchScope = true; + break; + case "never": + updateSearchScope = false; + break; + case "multiline": { + const isSelectionMultipleLine = !!selection && selection.startLineNumber !== selection.endLineNumber; + updateSearchScope = isSelectionMultipleLine; + break; + } + default: + break; + } + opts.updateSearchScope = opts.updateSearchScope || updateSearchScope; + await super._start(opts, newState); + if (this._widget) { + if (opts.shouldFocus === 2) { + this._widget.focusReplaceInput(); + } else if (opts.shouldFocus === 1) { + this._widget.focusFindInput(); + } + } + } + highlightFindOptions(ignoreWhenVisible = false) { + if (!this._widget) { + this._createFindWidget(); + } + if (this._state.isRevealed && !ignoreWhenVisible) { + this._widget.highlightFindOptions(); + } else { + this._findOptionsWidget.highlightFindOptions(); + } + } + _createFindWidget() { + this._widget = this._register(new FindWidget(this._editor, this, this._state, this._contextViewService, this._keybindingService, this._contextKeyService, this._hoverService, this._findWidgetSearchHistory, this._replaceWidgetHistory)); + this._findOptionsWidget = this._register(new FindOptionsWidget(this._editor, this._state, this._keybindingService)); + } + saveViewState() { + return this._widget?.getViewState(); + } + restoreViewState(state) { + this._widget?.setViewState(state); + } +}; +FindController2 = __decorate92([ + __param86(1, IContextViewService), + __param86(2, IContextKeyService), + __param86(3, IKeybindingService), + __param86(4, INotificationService), + __param86(5, IStorageService), + __param86(6, IClipboardService), + __param86(7, IHoverService) +], FindController2); +var StartFindAction = registerMultiEditorAction(new MultiEditorAction({ + id: FIND_IDS.StartFindAction, + label: localize2(947, "Find"), + precondition: ContextKeyExpr.or(EditorContextKeys.focus, ContextKeyExpr.has("editorIsOpen")), + kbOpts: { + kbExpr: null, + primary: 2048 | 36, + weight: 100 + /* KeybindingWeight.EditorContrib */ + }, + menuOpts: { + menuId: MenuId.MenubarEditMenu, + group: "3_find", + title: localize(941, "&&Find"), + order: 1 + } +})); +StartFindAction.addImplementation(0, (accessor, editor2, args) => { + const controller = CommonFindController.get(editor2); + if (!controller) { + return false; + } + return controller.start({ + forceRevealReplace: false, + seedSearchStringFromSelection: editor2.getOption( + 50 + /* EditorOption.find */ + ).seedSearchStringFromSelection !== "never" ? "single" : "none", + seedSearchStringFromNonEmptySelection: editor2.getOption( + 50 + /* EditorOption.find */ + ).seedSearchStringFromSelection === "selection", + seedSearchStringFromGlobalClipboard: editor2.getOption( + 50 + /* EditorOption.find */ + ).globalFindClipboard, + shouldFocus: 1, + shouldAnimate: true, + updateSearchScope: false, + loop: editor2.getOption( + 50 + /* EditorOption.find */ + ).loop + }); +}); +var findArgDescription = { + description: "Open a new In-Editor Find Widget.", + args: [{ + name: "Open a new In-Editor Find Widget args", + schema: { + properties: { + searchString: { type: "string" }, + replaceString: { type: "string" }, + isRegex: { type: "boolean" }, + matchWholeWord: { type: "boolean" }, + isCaseSensitive: { type: "boolean" }, + preserveCase: { type: "boolean" }, + findInSelection: { type: "boolean" } + } + } + }] +}; +var StartFindWithArgsAction = class extends EditorAction { + constructor() { + super({ + id: FIND_IDS.StartFindWithArgs, + label: localize2(948, "Find with Arguments"), + precondition: void 0, + kbOpts: { + kbExpr: null, + primary: 0, + weight: 100 + /* KeybindingWeight.EditorContrib */ + }, + metadata: findArgDescription + }); + } + async run(accessor, editor2, args) { + const controller = CommonFindController.get(editor2); + if (controller) { + const newState = args ? { + searchString: args.searchString, + replaceString: args.replaceString, + isReplaceRevealed: args.replaceString !== void 0, + isRegex: args.isRegex, + // isRegexOverride: args.regexOverride, + wholeWord: args.matchWholeWord, + // wholeWordOverride: args.wholeWordOverride, + matchCase: args.isCaseSensitive, + // matchCaseOverride: args.matchCaseOverride, + preserveCase: args.preserveCase + // preserveCaseOverride: args.preserveCaseOverride, + } : {}; + await controller.start({ + forceRevealReplace: false, + seedSearchStringFromSelection: controller.getState().searchString.length === 0 && editor2.getOption( + 50 + /* EditorOption.find */ + ).seedSearchStringFromSelection !== "never" ? "single" : "none", + seedSearchStringFromNonEmptySelection: editor2.getOption( + 50 + /* EditorOption.find */ + ).seedSearchStringFromSelection === "selection", + seedSearchStringFromGlobalClipboard: true, + shouldFocus: 1, + shouldAnimate: true, + updateSearchScope: args?.findInSelection || false, + loop: editor2.getOption( + 50 + /* EditorOption.find */ + ).loop + }, newState); + controller.setGlobalBufferTerm(controller.getState().searchString); + } + } +}; +var StartFindWithSelectionAction = class extends EditorAction { + constructor() { + super({ + id: FIND_IDS.StartFindWithSelection, + label: localize2(949, "Find with Selection"), + precondition: void 0, + kbOpts: { + kbExpr: null, + primary: 0, + mac: { + primary: 2048 | 35 + }, + weight: 100 + /* KeybindingWeight.EditorContrib */ + } + }); + } + async run(accessor, editor2) { + const controller = CommonFindController.get(editor2); + if (controller) { + await controller.start({ + forceRevealReplace: false, + seedSearchStringFromSelection: "multiple", + seedSearchStringFromNonEmptySelection: false, + seedSearchStringFromGlobalClipboard: false, + shouldFocus: 0, + shouldAnimate: true, + updateSearchScope: false, + loop: editor2.getOption( + 50 + /* EditorOption.find */ + ).loop + }); + controller.setGlobalBufferTerm(controller.getState().searchString); + } + } +}; +async function matchFindAction(editor2, next) { + const controller = CommonFindController.get(editor2); + if (!controller) { + return; + } + const runMatch = () => { + const result = next ? controller.moveToNextMatch() : controller.moveToPrevMatch(); + if (result) { + controller.editor.pushUndoStop(); + return true; + } + return false; + }; + if (!runMatch()) { + await controller.start({ + forceRevealReplace: false, + seedSearchStringFromSelection: controller.getState().searchString.length === 0 && editor2.getOption( + 50 + /* EditorOption.find */ + ).seedSearchStringFromSelection !== "never" ? "single" : "none", + seedSearchStringFromNonEmptySelection: editor2.getOption( + 50 + /* EditorOption.find */ + ).seedSearchStringFromSelection === "selection", + seedSearchStringFromGlobalClipboard: true, + shouldFocus: 0, + shouldAnimate: true, + updateSearchScope: false, + loop: editor2.getOption( + 50 + /* EditorOption.find */ + ).loop + }); + runMatch(); + } +} +var NextMatchFindAction = registerMultiEditorAction(new MultiEditorAction({ + id: FIND_IDS.NextMatchFindAction, + label: localize2(950, "Find Next"), + precondition: void 0, + kbOpts: [{ + kbExpr: EditorContextKeys.focus, + primary: 61, + mac: { primary: 2048 | 37, secondary: [ + 61 + /* KeyCode.F3 */ + ] }, + weight: 100 + /* KeybindingWeight.EditorContrib */ + }, { + kbExpr: ContextKeyExpr.and(EditorContextKeys.focus, CONTEXT_FIND_INPUT_FOCUSED), + primary: 3, + weight: 100 + /* KeybindingWeight.EditorContrib */ + }] +})); +NextMatchFindAction.addImplementation(0, async (accessor, editor2, args) => { + return matchFindAction(editor2, true); +}); +var PreviousMatchFindAction = registerMultiEditorAction(new MultiEditorAction({ + id: FIND_IDS.PreviousMatchFindAction, + label: localize2(951, "Find Previous"), + precondition: void 0, + kbOpts: [{ + kbExpr: EditorContextKeys.focus, + primary: 1024 | 61, + mac: { primary: 2048 | 1024 | 37, secondary: [ + 1024 | 61 + /* KeyCode.F3 */ + ] }, + weight: 100 + /* KeybindingWeight.EditorContrib */ + }, { + kbExpr: ContextKeyExpr.and(EditorContextKeys.focus, CONTEXT_FIND_INPUT_FOCUSED), + primary: 1024 | 3, + weight: 100 + /* KeybindingWeight.EditorContrib */ + }] +})); +PreviousMatchFindAction.addImplementation(0, async (accessor, editor2, args) => { + return matchFindAction(editor2, false); +}); +var MoveToMatchFindAction = class extends EditorAction { + constructor() { + super({ + id: FIND_IDS.GoToMatchFindAction, + label: localize2(952, "Go to Match..."), + precondition: CONTEXT_FIND_WIDGET_VISIBLE + }); + this._highlightDecorations = []; + } + run(accessor, editor2, args) { + const controller = CommonFindController.get(editor2); + if (!controller) { + return; + } + const matchesCount = controller.getState().matchesCount; + if (matchesCount < 1) { + const notificationService = accessor.get(INotificationService); + notificationService.notify({ + severity: Severity2.Warning, + message: localize(942, "No matches. Try searching for something else.") + }); + return; + } + const quickInputService = accessor.get(IQuickInputService); + const disposables = new DisposableStore(); + const inputBox = disposables.add(quickInputService.createInputBox()); + inputBox.placeholder = localize(943, "Type a number to go to a specific match (between 1 and {0})", matchesCount); + const toFindMatchIndex = (value) => { + const index = parseInt(value); + if (isNaN(index)) { + return void 0; + } + const matchCount = controller.getState().matchesCount; + if (index > 0 && index <= matchCount) { + return index - 1; + } else if (index < 0 && index >= -matchCount) { + return matchCount + index; + } + return void 0; + }; + const updatePickerAndEditor = (value) => { + const index = toFindMatchIndex(value); + if (typeof index === "number") { + inputBox.validationMessage = void 0; + controller.goToMatch(index); + const currentMatch = controller.getState().currentMatch; + if (currentMatch) { + this.addDecorations(editor2, currentMatch); + } + } else { + inputBox.validationMessage = localize(944, "Please type a number between 1 and {0}", controller.getState().matchesCount); + this.clearDecorations(editor2); + } + }; + disposables.add(inputBox.onDidChangeValue((value) => { + updatePickerAndEditor(value); + })); + disposables.add(inputBox.onDidAccept(() => { + const index = toFindMatchIndex(inputBox.value); + if (typeof index === "number") { + controller.goToMatch(index); + inputBox.hide(); + } else { + inputBox.validationMessage = localize(945, "Please type a number between 1 and {0}", controller.getState().matchesCount); + } + })); + disposables.add(inputBox.onDidHide(() => { + this.clearDecorations(editor2); + disposables.dispose(); + })); + inputBox.show(); + } + clearDecorations(editor2) { + editor2.changeDecorations((changeAccessor) => { + this._highlightDecorations = changeAccessor.deltaDecorations(this._highlightDecorations, []); + }); + } + addDecorations(editor2, range2) { + editor2.changeDecorations((changeAccessor) => { + this._highlightDecorations = changeAccessor.deltaDecorations(this._highlightDecorations, [ + { + range: range2, + options: { + description: "find-match-quick-access-range-highlight", + className: "rangeHighlight", + isWholeLine: true + } + }, + { + range: range2, + options: { + description: "find-match-quick-access-range-highlight-overview", + overviewRuler: { + color: themeColorFromId(overviewRulerRangeHighlight), + position: OverviewRulerLane.Full + } + } + } + ]); + }); + } +}; +var SelectionMatchFindAction = class extends EditorAction { + async run(accessor, editor2) { + const controller = CommonFindController.get(editor2); + if (!controller) { + return; + } + const selectionSearchString = getSelectionSearchString(editor2, "single", false); + if (selectionSearchString) { + controller.setSearchString(selectionSearchString); + } + if (!this._run(controller)) { + await controller.start({ + forceRevealReplace: false, + seedSearchStringFromSelection: "none", + seedSearchStringFromNonEmptySelection: false, + seedSearchStringFromGlobalClipboard: false, + shouldFocus: 0, + shouldAnimate: true, + updateSearchScope: false, + loop: editor2.getOption( + 50 + /* EditorOption.find */ + ).loop + }); + this._run(controller); + } + } +}; +var NextSelectionMatchFindAction = class extends SelectionMatchFindAction { + constructor() { + super({ + id: FIND_IDS.NextSelectionMatchFindAction, + label: localize2(953, "Find Next Selection"), + precondition: void 0, + kbOpts: { + kbExpr: EditorContextKeys.focus, + primary: 2048 | 61, + weight: 100 + /* KeybindingWeight.EditorContrib */ + } + }); + } + _run(controller) { + return controller.moveToNextMatch(); + } +}; +var PreviousSelectionMatchFindAction = class extends SelectionMatchFindAction { + constructor() { + super({ + id: FIND_IDS.PreviousSelectionMatchFindAction, + label: localize2(954, "Find Previous Selection"), + precondition: void 0, + kbOpts: { + kbExpr: EditorContextKeys.focus, + primary: 2048 | 1024 | 61, + weight: 100 + /* KeybindingWeight.EditorContrib */ + } + }); + } + _run(controller) { + return controller.moveToPrevMatch(); + } +}; +var StartFindReplaceAction = registerMultiEditorAction(new MultiEditorAction({ + id: FIND_IDS.StartFindReplaceAction, + label: localize2(955, "Replace"), + precondition: ContextKeyExpr.or(EditorContextKeys.focus, ContextKeyExpr.has("editorIsOpen")), + kbOpts: { + kbExpr: null, + primary: 2048 | 38, + mac: { + primary: 2048 | 512 | 36 + /* KeyCode.KeyF */ + }, + weight: 100 + /* KeybindingWeight.EditorContrib */ + }, + menuOpts: { + menuId: MenuId.MenubarEditMenu, + group: "3_find", + title: localize(946, "&&Replace"), + order: 2 + } +})); +StartFindReplaceAction.addImplementation(0, (accessor, editor2, args) => { + if (!editor2.hasModel() || editor2.getOption( + 104 + /* EditorOption.readOnly */ + )) { + return false; + } + const controller = CommonFindController.get(editor2); + if (!controller) { + return false; + } + const currentSelection = editor2.getSelection(); + const findInputFocused = controller.isFindInputFocused(); + const seedSearchStringFromSelection = !currentSelection.isEmpty() && currentSelection.startLineNumber === currentSelection.endLineNumber && editor2.getOption( + 50 + /* EditorOption.find */ + ).seedSearchStringFromSelection !== "never" && !findInputFocused; + const shouldFocus = findInputFocused || seedSearchStringFromSelection ? 2 : 1; + return controller.start({ + forceRevealReplace: true, + seedSearchStringFromSelection: seedSearchStringFromSelection ? "single" : "none", + seedSearchStringFromNonEmptySelection: editor2.getOption( + 50 + /* EditorOption.find */ + ).seedSearchStringFromSelection === "selection", + seedSearchStringFromGlobalClipboard: editor2.getOption( + 50 + /* EditorOption.find */ + ).seedSearchStringFromSelection !== "never", + shouldFocus, + shouldAnimate: true, + updateSearchScope: false, + loop: editor2.getOption( + 50 + /* EditorOption.find */ + ).loop + }); +}); +registerEditorContribution( + CommonFindController.ID, + FindController2, + 0 + /* EditorContributionInstantiation.Eager */ +); +registerEditorAction(StartFindWithArgsAction); +registerEditorAction(StartFindWithSelectionAction); +registerEditorAction(MoveToMatchFindAction); +registerEditorAction(NextSelectionMatchFindAction); +registerEditorAction(PreviousSelectionMatchFindAction); +var FindCommand = EditorCommand.bindToContribution(CommonFindController.get); +registerEditorCommand(new FindCommand({ + id: FIND_IDS.CloseFindWidgetCommand, + precondition: CONTEXT_FIND_WIDGET_VISIBLE, + handler: (x) => x.closeFindWidget(), + kbOpts: { + weight: 100 + 5, + kbExpr: ContextKeyExpr.and(EditorContextKeys.focus, ContextKeyExpr.not("isComposing")), + primary: 9, + secondary: [ + 1024 | 9 + /* KeyCode.Escape */ + ] + } +})); +registerEditorCommand(new FindCommand({ + id: FIND_IDS.ToggleCaseSensitiveCommand, + precondition: void 0, + handler: (x) => x.toggleCaseSensitive(), + kbOpts: { + weight: 100 + 5, + kbExpr: EditorContextKeys.focus, + primary: ToggleCaseSensitiveKeybinding.primary, + mac: ToggleCaseSensitiveKeybinding.mac, + win: ToggleCaseSensitiveKeybinding.win, + linux: ToggleCaseSensitiveKeybinding.linux + } +})); +registerEditorCommand(new FindCommand({ + id: FIND_IDS.ToggleWholeWordCommand, + precondition: void 0, + handler: (x) => x.toggleWholeWords(), + kbOpts: { + weight: 100 + 5, + kbExpr: EditorContextKeys.focus, + primary: ToggleWholeWordKeybinding.primary, + mac: ToggleWholeWordKeybinding.mac, + win: ToggleWholeWordKeybinding.win, + linux: ToggleWholeWordKeybinding.linux + } +})); +registerEditorCommand(new FindCommand({ + id: FIND_IDS.ToggleRegexCommand, + precondition: void 0, + handler: (x) => x.toggleRegex(), + kbOpts: { + weight: 100 + 5, + kbExpr: EditorContextKeys.focus, + primary: ToggleRegexKeybinding.primary, + mac: ToggleRegexKeybinding.mac, + win: ToggleRegexKeybinding.win, + linux: ToggleRegexKeybinding.linux + } +})); +registerEditorCommand(new FindCommand({ + id: FIND_IDS.ToggleSearchScopeCommand, + precondition: void 0, + handler: (x) => x.toggleSearchScope(), + kbOpts: { + weight: 100 + 5, + kbExpr: EditorContextKeys.focus, + primary: ToggleSearchScopeKeybinding.primary, + mac: ToggleSearchScopeKeybinding.mac, + win: ToggleSearchScopeKeybinding.win, + linux: ToggleSearchScopeKeybinding.linux + } +})); +registerEditorCommand(new FindCommand({ + id: FIND_IDS.TogglePreserveCaseCommand, + precondition: void 0, + handler: (x) => x.togglePreserveCase(), + kbOpts: { + weight: 100 + 5, + kbExpr: EditorContextKeys.focus, + primary: TogglePreserveCaseKeybinding.primary, + mac: TogglePreserveCaseKeybinding.mac, + win: TogglePreserveCaseKeybinding.win, + linux: TogglePreserveCaseKeybinding.linux + } +})); +registerEditorCommand(new FindCommand({ + id: FIND_IDS.ReplaceOneAction, + precondition: CONTEXT_FIND_WIDGET_VISIBLE, + handler: (x) => x.replace(), + kbOpts: { + weight: 100 + 5, + kbExpr: EditorContextKeys.focus, + primary: 2048 | 1024 | 22 + /* KeyCode.Digit1 */ + } +})); +registerEditorCommand(new FindCommand({ + id: FIND_IDS.ReplaceOneAction, + precondition: CONTEXT_FIND_WIDGET_VISIBLE, + handler: (x) => x.replace(), + kbOpts: { + weight: 100 + 5, + kbExpr: ContextKeyExpr.and(EditorContextKeys.focus, CONTEXT_REPLACE_INPUT_FOCUSED), + primary: 3 + /* KeyCode.Enter */ + } +})); +registerEditorCommand(new FindCommand({ + id: FIND_IDS.ReplaceAllAction, + precondition: CONTEXT_FIND_WIDGET_VISIBLE, + handler: (x) => x.replaceAll(), + kbOpts: { + weight: 100 + 5, + kbExpr: EditorContextKeys.focus, + primary: 2048 | 512 | 3 + /* KeyCode.Enter */ + } +})); +registerEditorCommand(new FindCommand({ + id: FIND_IDS.ReplaceAllAction, + precondition: CONTEXT_FIND_WIDGET_VISIBLE, + handler: (x) => x.replaceAll(), + kbOpts: { + weight: 100 + 5, + kbExpr: ContextKeyExpr.and(EditorContextKeys.focus, CONTEXT_REPLACE_INPUT_FOCUSED), + primary: void 0, + mac: { + primary: 2048 | 3 + } + } +})); +registerEditorCommand(new FindCommand({ + id: FIND_IDS.SelectAllMatchesAction, + precondition: CONTEXT_FIND_WIDGET_VISIBLE, + handler: (x) => x.selectAllMatches(), + kbOpts: { + weight: 100 + 5, + kbExpr: EditorContextKeys.focus, + primary: 512 | 3 + /* KeyCode.Enter */ + } +})); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/folding/browser/folding.js +init_async(); +init_cancellation(); +init_errors(); +init_keyCodes(); +init_lifecycle(); +init_strings(); +init_types(); +init_editorExtensions(); +init_editorContextKeys(); +init_languages(); +init_languageConfigurationRegistry(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/folding/browser/foldingModel.js +init_event(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/folding/browser/foldingRanges.js +var foldSourceAbbr = { + [ + 0 + /* FoldSource.provider */ + ]: " ", + [ + 1 + /* FoldSource.userDefined */ + ]: "u", + [ + 2 + /* FoldSource.recovered */ + ]: "r" +}; +var MAX_FOLDING_REGIONS = 65535; +var MAX_LINE_NUMBER = 16777215; +var MASK_INDENT = 4278190080; +var BitField = class { + constructor(size2) { + const numWords = Math.ceil(size2 / 32); + this._states = new Uint32Array(numWords); + } + get(index) { + const arrayIndex = index / 32 | 0; + const bit = index % 32; + return (this._states[arrayIndex] & 1 << bit) !== 0; + } + set(index, newState) { + const arrayIndex = index / 32 | 0; + const bit = index % 32; + const value = this._states[arrayIndex]; + if (newState) { + this._states[arrayIndex] = value | 1 << bit; + } else { + this._states[arrayIndex] = value & ~(1 << bit); + } + } +}; +var FoldingRegions = class _FoldingRegions { + constructor(startIndexes, endIndexes, types) { + if (startIndexes.length !== endIndexes.length || startIndexes.length > MAX_FOLDING_REGIONS) { + throw new Error("invalid startIndexes or endIndexes size"); + } + this._startIndexes = startIndexes; + this._endIndexes = endIndexes; + this._collapseStates = new BitField(startIndexes.length); + this._userDefinedStates = new BitField(startIndexes.length); + this._recoveredStates = new BitField(startIndexes.length); + this._types = types; + this._parentsComputed = false; + } + ensureParentIndices() { + if (!this._parentsComputed) { + this._parentsComputed = true; + const parentIndexes = []; + const isInsideLast = (startLineNumber, endLineNumber) => { + const index = parentIndexes[parentIndexes.length - 1]; + return this.getStartLineNumber(index) <= startLineNumber && this.getEndLineNumber(index) >= endLineNumber; + }; + for (let i2 = 0, len = this._startIndexes.length; i2 < len; i2++) { + const startLineNumber = this._startIndexes[i2]; + const endLineNumber = this._endIndexes[i2]; + if (startLineNumber > MAX_LINE_NUMBER || endLineNumber > MAX_LINE_NUMBER) { + throw new Error("startLineNumber or endLineNumber must not exceed " + MAX_LINE_NUMBER); + } + while (parentIndexes.length > 0 && !isInsideLast(startLineNumber, endLineNumber)) { + parentIndexes.pop(); + } + const parentIndex = parentIndexes.length > 0 ? parentIndexes[parentIndexes.length - 1] : -1; + parentIndexes.push(i2); + this._startIndexes[i2] = startLineNumber + ((parentIndex & 255) << 24); + this._endIndexes[i2] = endLineNumber + ((parentIndex & 65280) << 16); + } + } + } + get length() { + return this._startIndexes.length; + } + getStartLineNumber(index) { + return this._startIndexes[index] & MAX_LINE_NUMBER; + } + getEndLineNumber(index) { + return this._endIndexes[index] & MAX_LINE_NUMBER; + } + getType(index) { + return this._types ? this._types[index] : void 0; + } + hasTypes() { + return !!this._types; + } + isCollapsed(index) { + return this._collapseStates.get(index); + } + setCollapsed(index, newState) { + this._collapseStates.set(index, newState); + } + isUserDefined(index) { + return this._userDefinedStates.get(index); + } + setUserDefined(index, newState) { + return this._userDefinedStates.set(index, newState); + } + isRecovered(index) { + return this._recoveredStates.get(index); + } + setRecovered(index, newState) { + return this._recoveredStates.set(index, newState); + } + getSource(index) { + if (this.isUserDefined(index)) { + return 1; + } else if (this.isRecovered(index)) { + return 2; + } + return 0; + } + setSource(index, source) { + if (source === 1) { + this.setUserDefined(index, true); + this.setRecovered(index, false); + } else if (source === 2) { + this.setUserDefined(index, false); + this.setRecovered(index, true); + } else { + this.setUserDefined(index, false); + this.setRecovered(index, false); + } + } + setCollapsedAllOfType(type, newState) { + let hasChanged = false; + if (this._types) { + for (let i2 = 0; i2 < this._types.length; i2++) { + if (this._types[i2] === type) { + this.setCollapsed(i2, newState); + hasChanged = true; + } + } + } + return hasChanged; + } + toRegion(index) { + return new FoldingRegion(this, index); + } + getParentIndex(index) { + this.ensureParentIndices(); + const parent = ((this._startIndexes[index] & MASK_INDENT) >>> 24) + ((this._endIndexes[index] & MASK_INDENT) >>> 16); + if (parent === MAX_FOLDING_REGIONS) { + return -1; + } + return parent; + } + contains(index, line) { + return this.getStartLineNumber(index) <= line && this.getEndLineNumber(index) >= line; + } + findIndex(line) { + let low = 0, high = this._startIndexes.length; + if (high === 0) { + return -1; + } + while (low < high) { + const mid = Math.floor((low + high) / 2); + if (line < this.getStartLineNumber(mid)) { + high = mid; + } else { + low = mid + 1; + } + } + return low - 1; + } + findRange(line) { + let index = this.findIndex(line); + if (index >= 0) { + const endLineNumber = this.getEndLineNumber(index); + if (endLineNumber >= line) { + return index; + } + index = this.getParentIndex(index); + while (index !== -1) { + if (this.contains(index, line)) { + return index; + } + index = this.getParentIndex(index); + } + } + return -1; + } + toString() { + const res = []; + for (let i2 = 0; i2 < this.length; i2++) { + res[i2] = `[${foldSourceAbbr[this.getSource(i2)]}${this.isCollapsed(i2) ? "+" : "-"}] ${this.getStartLineNumber(i2)}/${this.getEndLineNumber(i2)}`; + } + return res.join(", "); + } + toFoldRange(index) { + return { + startLineNumber: this._startIndexes[index] & MAX_LINE_NUMBER, + endLineNumber: this._endIndexes[index] & MAX_LINE_NUMBER, + type: this._types ? this._types[index] : void 0, + isCollapsed: this.isCollapsed(index), + source: this.getSource(index) + }; + } + static fromFoldRanges(ranges) { + const rangesLength = ranges.length; + const startIndexes = new Uint32Array(rangesLength); + const endIndexes = new Uint32Array(rangesLength); + let types = []; + let gotTypes = false; + for (let i2 = 0; i2 < rangesLength; i2++) { + const range2 = ranges[i2]; + startIndexes[i2] = range2.startLineNumber; + endIndexes[i2] = range2.endLineNumber; + types.push(range2.type); + if (range2.type) { + gotTypes = true; + } + } + if (!gotTypes) { + types = void 0; + } + const regions = new _FoldingRegions(startIndexes, endIndexes, types); + for (let i2 = 0; i2 < rangesLength; i2++) { + if (ranges[i2].isCollapsed) { + regions.setCollapsed(i2, true); + } + regions.setSource(i2, ranges[i2].source); + } + return regions; + } + /** + * Two inputs, each a FoldingRegions or a FoldRange[], are merged. + * Each input must be pre-sorted on startLineNumber. + * The first list is assumed to always include all regions currently defined by range providers. + * The second list only contains the previously collapsed and all manual ranges. + * If the line position matches, the range of the new range is taken, and the range is no longer manual + * When an entry in one list overlaps an entry in the other, the second list's entry "wins" and + * overlapping entries in the first list are discarded. + * Invalid entries are discarded. An entry is invalid if: + * the start and end line numbers aren't a valid range of line numbers, + * it is out of sequence or has the same start line as a preceding entry, + * it overlaps a preceding entry and is not fully contained by that entry. + */ + static sanitizeAndMerge(rangesA, rangesB, maxLineNumber, selection) { + maxLineNumber = maxLineNumber ?? Number.MAX_VALUE; + const getIndexedFunction = (r, limit) => { + return Array.isArray(r) ? ((i2) => { + return i2 < limit ? r[i2] : void 0; + }) : ((i2) => { + return i2 < limit ? r.toFoldRange(i2) : void 0; + }); + }; + const getA = getIndexedFunction(rangesA, rangesA.length); + const getB = getIndexedFunction(rangesB, rangesB.length); + let indexA = 0; + let indexB = 0; + let nextA = getA(0); + let nextB = getB(0); + const stackedRanges = []; + let topStackedRange; + let prevLineNumber = 0; + const resultRanges = []; + while (nextA || nextB) { + let useRange = void 0; + if (nextB && (!nextA || nextA.startLineNumber >= nextB.startLineNumber)) { + if (nextA && nextA.startLineNumber === nextB.startLineNumber) { + if (nextB.source === 1) { + useRange = nextB; + } else { + useRange = nextA; + useRange.isCollapsed = nextB.isCollapsed && (nextA.endLineNumber === nextB.endLineNumber || !selection?.startsInside(nextA.startLineNumber + 1, nextA.endLineNumber + 1)); + useRange.source = 0; + } + nextA = getA(++indexA); + } else { + useRange = nextB; + if (nextB.isCollapsed && nextB.source === 0) { + useRange.source = 2; + } + } + nextB = getB(++indexB); + } else { + let scanIndex = indexB; + let prescanB = nextB; + while (true) { + if (!prescanB || prescanB.startLineNumber > nextA.endLineNumber) { + useRange = nextA; + break; + } + if (prescanB.source === 1 && prescanB.endLineNumber > nextA.endLineNumber) { + break; + } + prescanB = getB(++scanIndex); + } + nextA = getA(++indexA); + } + if (useRange) { + while (topStackedRange && topStackedRange.endLineNumber < useRange.startLineNumber) { + topStackedRange = stackedRanges.pop(); + } + if (useRange.endLineNumber > useRange.startLineNumber && useRange.startLineNumber > prevLineNumber && useRange.endLineNumber <= maxLineNumber && (!topStackedRange || topStackedRange.endLineNumber >= useRange.endLineNumber)) { + resultRanges.push(useRange); + prevLineNumber = useRange.startLineNumber; + if (topStackedRange) { + stackedRanges.push(topStackedRange); + } + topStackedRange = useRange; + } + } + } + return resultRanges; + } +}; +var FoldingRegion = class { + constructor(ranges, index) { + this.ranges = ranges; + this.index = index; + } + get startLineNumber() { + return this.ranges.getStartLineNumber(this.index); + } + get endLineNumber() { + return this.ranges.getEndLineNumber(this.index); + } + get regionIndex() { + return this.index; + } + get parentIndex() { + return this.ranges.getParentIndex(this.index); + } + get isCollapsed() { + return this.ranges.isCollapsed(this.index); + } + containedBy(range2) { + return range2.startLineNumber <= this.startLineNumber && range2.endLineNumber >= this.endLineNumber; + } + containsLine(lineNumber) { + return this.startLineNumber <= lineNumber && lineNumber <= this.endLineNumber; + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/folding/browser/foldingModel.js +init_hash(); +var FoldingModel = class { + get regions() { + return this._regions; + } + get textModel() { + return this._textModel; + } + constructor(textModel, decorationProvider) { + this._updateEventEmitter = new Emitter(); + this.onDidChange = this._updateEventEmitter.event; + this._textModel = textModel; + this._decorationProvider = decorationProvider; + this._regions = new FoldingRegions(new Uint32Array(0), new Uint32Array(0)); + this._editorDecorationIds = []; + } + toggleCollapseState(toggledRegions) { + if (!toggledRegions.length) { + return; + } + toggledRegions = toggledRegions.sort((r1, r2) => r1.regionIndex - r2.regionIndex); + const processed = {}; + this._decorationProvider.changeDecorations((accessor) => { + let k = 0; + let dirtyRegionEndLine = -1; + let lastHiddenLine = -1; + const updateDecorationsUntil = (index) => { + while (k < index) { + const endLineNumber = this._regions.getEndLineNumber(k); + const isCollapsed = this._regions.isCollapsed(k); + if (endLineNumber <= dirtyRegionEndLine) { + const isManual = this.regions.getSource(k) !== 0; + accessor.changeDecorationOptions(this._editorDecorationIds[k], this._decorationProvider.getDecorationOption(isCollapsed, endLineNumber <= lastHiddenLine, isManual)); + } + if (isCollapsed && endLineNumber > lastHiddenLine) { + lastHiddenLine = endLineNumber; + } + k++; + } + }; + for (const region of toggledRegions) { + const index = region.regionIndex; + const editorDecorationId = this._editorDecorationIds[index]; + if (editorDecorationId && !processed[editorDecorationId]) { + processed[editorDecorationId] = true; + updateDecorationsUntil(index); + const newCollapseState = !this._regions.isCollapsed(index); + this._regions.setCollapsed(index, newCollapseState); + dirtyRegionEndLine = Math.max(dirtyRegionEndLine, this._regions.getEndLineNumber(index)); + } + } + updateDecorationsUntil(this._regions.length); + }); + this._updateEventEmitter.fire({ model: this, collapseStateChanged: toggledRegions }); + } + removeManualRanges(ranges) { + const newFoldingRanges = new Array(); + const intersects2 = (foldRange) => { + for (const range2 of ranges) { + if (!(range2.startLineNumber > foldRange.endLineNumber || foldRange.startLineNumber > range2.endLineNumber)) { + return true; + } + } + return false; + }; + for (let i2 = 0; i2 < this._regions.length; i2++) { + const foldRange = this._regions.toFoldRange(i2); + if (foldRange.source === 0 || !intersects2(foldRange)) { + newFoldingRanges.push(foldRange); + } + } + this.updatePost(FoldingRegions.fromFoldRanges(newFoldingRanges)); + } + update(newRegions, selection) { + const foldedOrManualRanges = this._currentFoldedOrManualRanges(selection); + const newRanges = FoldingRegions.sanitizeAndMerge(newRegions, foldedOrManualRanges, this._textModel.getLineCount(), selection); + this.updatePost(FoldingRegions.fromFoldRanges(newRanges)); + } + updatePost(newRegions) { + const newEditorDecorations = []; + let lastHiddenLine = -1; + for (let index = 0, limit = newRegions.length; index < limit; index++) { + const startLineNumber = newRegions.getStartLineNumber(index); + const endLineNumber = newRegions.getEndLineNumber(index); + const isCollapsed = newRegions.isCollapsed(index); + const isManual = newRegions.getSource(index) !== 0; + const decorationRange = { + startLineNumber, + startColumn: this._textModel.getLineMaxColumn(startLineNumber), + endLineNumber, + endColumn: this._textModel.getLineMaxColumn(endLineNumber) + 1 + }; + newEditorDecorations.push({ range: decorationRange, options: this._decorationProvider.getDecorationOption(isCollapsed, endLineNumber <= lastHiddenLine, isManual) }); + if (isCollapsed && endLineNumber > lastHiddenLine) { + lastHiddenLine = endLineNumber; + } + } + this._decorationProvider.changeDecorations((accessor) => this._editorDecorationIds = accessor.deltaDecorations(this._editorDecorationIds, newEditorDecorations)); + this._regions = newRegions; + this._updateEventEmitter.fire({ model: this }); + } + _currentFoldedOrManualRanges(selection) { + const foldedRanges = []; + for (let i2 = 0, limit = this._regions.length; i2 < limit; i2++) { + let isCollapsed = this.regions.isCollapsed(i2); + const source = this.regions.getSource(i2); + if (isCollapsed || source !== 0) { + const foldRange = this._regions.toFoldRange(i2); + const decRange = this._textModel.getDecorationRange(this._editorDecorationIds[i2]); + if (decRange) { + if (isCollapsed && selection?.startsInside(decRange.startLineNumber + 1, decRange.endLineNumber)) { + isCollapsed = false; + } + foldedRanges.push({ + startLineNumber: decRange.startLineNumber, + endLineNumber: decRange.endLineNumber, + type: foldRange.type, + isCollapsed, + source + }); + } + } + } + return foldedRanges; + } + /** + * Collapse state memento, for persistence only + */ + getMemento() { + const foldedOrManualRanges = this._currentFoldedOrManualRanges(); + const result = []; + const maxLineNumber = this._textModel.getLineCount(); + for (let i2 = 0, limit = foldedOrManualRanges.length; i2 < limit; i2++) { + const range2 = foldedOrManualRanges[i2]; + if (range2.startLineNumber >= range2.endLineNumber || range2.startLineNumber < 1 || range2.endLineNumber > maxLineNumber) { + continue; + } + const checksum = this._getLinesChecksum(range2.startLineNumber + 1, range2.endLineNumber); + result.push({ + startLineNumber: range2.startLineNumber, + endLineNumber: range2.endLineNumber, + isCollapsed: range2.isCollapsed, + source: range2.source, + checksum + }); + } + return result.length > 0 ? result : void 0; + } + /** + * Apply persisted state, for persistence only + */ + applyMemento(state) { + if (!Array.isArray(state)) { + return; + } + const rangesToRestore = []; + const maxLineNumber = this._textModel.getLineCount(); + for (const range2 of state) { + if (range2.startLineNumber >= range2.endLineNumber || range2.startLineNumber < 1 || range2.endLineNumber > maxLineNumber) { + continue; + } + const checksum = this._getLinesChecksum(range2.startLineNumber + 1, range2.endLineNumber); + if (!range2.checksum || checksum === range2.checksum) { + rangesToRestore.push({ + startLineNumber: range2.startLineNumber, + endLineNumber: range2.endLineNumber, + type: void 0, + isCollapsed: range2.isCollapsed ?? true, + source: range2.source ?? 0 + /* FoldSource.provider */ + }); + } + } + const newRanges = FoldingRegions.sanitizeAndMerge(this._regions, rangesToRestore, maxLineNumber); + this.updatePost(FoldingRegions.fromFoldRanges(newRanges)); + } + _getLinesChecksum(lineNumber1, lineNumber2) { + const h2 = hash(this._textModel.getLineContent(lineNumber1) + this._textModel.getLineContent(lineNumber2)); + return h2 % 1e6; + } + dispose() { + this._decorationProvider.removeDecorations(this._editorDecorationIds); + } + getAllRegionsAtLine(lineNumber, filter) { + const result = []; + if (this._regions) { + let index = this._regions.findRange(lineNumber); + let level = 1; + while (index >= 0) { + const current = this._regions.toRegion(index); + if (!filter || filter(current, level)) { + result.push(current); + } + level++; + index = current.parentIndex; + } + } + return result; + } + getRegionAtLine(lineNumber) { + if (this._regions) { + const index = this._regions.findRange(lineNumber); + if (index >= 0) { + return this._regions.toRegion(index); + } + } + return null; + } + getRegionsInside(region, filter) { + const result = []; + const index = region ? region.regionIndex + 1 : 0; + const endLineNumber = region ? region.endLineNumber : Number.MAX_VALUE; + if (filter && filter.length === 2) { + const levelStack = []; + for (let i2 = index, len = this._regions.length; i2 < len; i2++) { + const current = this._regions.toRegion(i2); + if (this._regions.getStartLineNumber(i2) < endLineNumber) { + while (levelStack.length > 0 && !current.containedBy(levelStack[levelStack.length - 1])) { + levelStack.pop(); + } + levelStack.push(current); + if (filter(current, levelStack.length)) { + result.push(current); + } + } else { + break; + } + } + } else { + for (let i2 = index, len = this._regions.length; i2 < len; i2++) { + const current = this._regions.toRegion(i2); + if (this._regions.getStartLineNumber(i2) < endLineNumber) { + if (!filter || filter(current)) { + result.push(current); + } + } else { + break; + } + } + } + return result; + } +}; +function toggleCollapseState(foldingModel, levels, lineNumbers) { + const toToggle = []; + for (const lineNumber of lineNumbers) { + const region = foldingModel.getRegionAtLine(lineNumber); + if (region) { + const doCollapse = !region.isCollapsed; + toToggle.push(region); + if (levels > 1) { + const regionsInside = foldingModel.getRegionsInside(region, (r, level) => r.isCollapsed !== doCollapse && level < levels); + toToggle.push(...regionsInside); + } + } + } + foldingModel.toggleCollapseState(toToggle); +} +function setCollapseStateLevelsDown(foldingModel, doCollapse, levels = Number.MAX_VALUE, lineNumbers) { + const toToggle = []; + if (lineNumbers && lineNumbers.length > 0) { + for (const lineNumber of lineNumbers) { + const region = foldingModel.getRegionAtLine(lineNumber); + if (region) { + if (region.isCollapsed !== doCollapse) { + toToggle.push(region); + } + if (levels > 1) { + const regionsInside = foldingModel.getRegionsInside(region, (r, level) => r.isCollapsed !== doCollapse && level < levels); + toToggle.push(...regionsInside); + } + } + } + } else { + const regionsInside = foldingModel.getRegionsInside(null, (r, level) => r.isCollapsed !== doCollapse && level < levels); + toToggle.push(...regionsInside); + } + foldingModel.toggleCollapseState(toToggle); +} +function setCollapseStateLevelsUp(foldingModel, doCollapse, levels, lineNumbers) { + const toToggle = []; + for (const lineNumber of lineNumbers) { + const regions = foldingModel.getAllRegionsAtLine(lineNumber, (region, level) => region.isCollapsed !== doCollapse && level <= levels); + toToggle.push(...regions); + } + foldingModel.toggleCollapseState(toToggle); +} +function setCollapseStateUp(foldingModel, doCollapse, lineNumbers) { + const toToggle = []; + for (const lineNumber of lineNumbers) { + const regions = foldingModel.getAllRegionsAtLine(lineNumber, (region) => region.isCollapsed !== doCollapse); + if (regions.length > 0) { + toToggle.push(regions[0]); + } + } + foldingModel.toggleCollapseState(toToggle); +} +function setCollapseStateAtLevel(foldingModel, foldLevel, doCollapse, blockedLineNumbers) { + const filter = (region, level) => level === foldLevel && region.isCollapsed !== doCollapse && !blockedLineNumbers.some((line) => region.containsLine(line)); + const toToggle = foldingModel.getRegionsInside(null, filter); + foldingModel.toggleCollapseState(toToggle); +} +function setCollapseStateForRest(foldingModel, doCollapse, blockedLineNumbers) { + const filteredRegions = []; + for (const lineNumber of blockedLineNumbers) { + const regions = foldingModel.getAllRegionsAtLine(lineNumber, void 0); + if (regions.length > 0) { + filteredRegions.push(regions[0]); + } + } + const filter = (region) => filteredRegions.every((filteredRegion) => !filteredRegion.containedBy(region) && !region.containedBy(filteredRegion)) && region.isCollapsed !== doCollapse; + const toToggle = foldingModel.getRegionsInside(null, filter); + foldingModel.toggleCollapseState(toToggle); +} +function setCollapseStateForMatchingLines(foldingModel, regExp, doCollapse) { + const editorModel = foldingModel.textModel; + const regions = foldingModel.regions; + const toToggle = []; + for (let i2 = regions.length - 1; i2 >= 0; i2--) { + if (doCollapse !== regions.isCollapsed(i2)) { + const startLineNumber = regions.getStartLineNumber(i2); + if (regExp.test(editorModel.getLineContent(startLineNumber))) { + toToggle.push(regions.toRegion(i2)); + } + } + } + foldingModel.toggleCollapseState(toToggle); +} +function setCollapseStateForType(foldingModel, type, doCollapse) { + const regions = foldingModel.regions; + const toToggle = []; + for (let i2 = regions.length - 1; i2 >= 0; i2--) { + if (doCollapse !== regions.isCollapsed(i2) && type === regions.getType(i2)) { + toToggle.push(regions.toRegion(i2)); + } + } + foldingModel.toggleCollapseState(toToggle); +} +function getParentFoldLine(lineNumber, foldingModel) { + let startLineNumber = null; + const foldingRegion = foldingModel.getRegionAtLine(lineNumber); + if (foldingRegion !== null) { + startLineNumber = foldingRegion.startLineNumber; + if (lineNumber === startLineNumber) { + const parentFoldingIdx = foldingRegion.parentIndex; + if (parentFoldingIdx !== -1) { + startLineNumber = foldingModel.regions.getStartLineNumber(parentFoldingIdx); + } else { + startLineNumber = null; + } + } + } + return startLineNumber; +} +function getPreviousFoldLine(lineNumber, foldingModel) { + let foldingRegion = foldingModel.getRegionAtLine(lineNumber); + if (foldingRegion !== null && foldingRegion.startLineNumber === lineNumber) { + if (lineNumber !== foldingRegion.startLineNumber) { + return foldingRegion.startLineNumber; + } else { + const expectedParentIndex = foldingRegion.parentIndex; + let minLineNumber = 0; + if (expectedParentIndex !== -1) { + minLineNumber = foldingModel.regions.getStartLineNumber(foldingRegion.parentIndex); + } + while (foldingRegion !== null) { + if (foldingRegion.regionIndex > 0) { + foldingRegion = foldingModel.regions.toRegion(foldingRegion.regionIndex - 1); + if (foldingRegion.startLineNumber <= minLineNumber) { + return null; + } else if (foldingRegion.parentIndex === expectedParentIndex) { + return foldingRegion.startLineNumber; + } + } else { + return null; + } + } + } + } else { + if (foldingModel.regions.length > 0) { + foldingRegion = foldingModel.regions.toRegion(foldingModel.regions.length - 1); + while (foldingRegion !== null) { + if (foldingRegion.startLineNumber < lineNumber) { + return foldingRegion.startLineNumber; + } + if (foldingRegion.regionIndex > 0) { + foldingRegion = foldingModel.regions.toRegion(foldingRegion.regionIndex - 1); + } else { + foldingRegion = null; + } + } + } + } + return null; +} +function getNextFoldLine(lineNumber, foldingModel) { + let foldingRegion = foldingModel.getRegionAtLine(lineNumber); + if (foldingRegion !== null && foldingRegion.startLineNumber === lineNumber) { + const expectedParentIndex = foldingRegion.parentIndex; + let maxLineNumber = 0; + if (expectedParentIndex !== -1) { + maxLineNumber = foldingModel.regions.getEndLineNumber(foldingRegion.parentIndex); + } else if (foldingModel.regions.length === 0) { + return null; + } else { + maxLineNumber = foldingModel.regions.getEndLineNumber(foldingModel.regions.length - 1); + } + while (foldingRegion !== null) { + if (foldingRegion.regionIndex < foldingModel.regions.length) { + foldingRegion = foldingModel.regions.toRegion(foldingRegion.regionIndex + 1); + if (foldingRegion.startLineNumber >= maxLineNumber) { + return null; + } else if (foldingRegion.parentIndex === expectedParentIndex) { + return foldingRegion.startLineNumber; + } + } else { + return null; + } + } + } else { + if (foldingModel.regions.length > 0) { + foldingRegion = foldingModel.regions.toRegion(0); + while (foldingRegion !== null) { + if (foldingRegion.startLineNumber > lineNumber) { + return foldingRegion.startLineNumber; + } + if (foldingRegion.regionIndex < foldingModel.regions.length) { + foldingRegion = foldingModel.regions.toRegion(foldingRegion.regionIndex + 1); + } else { + foldingRegion = null; + } + } + } + } + return null; +} + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/folding/browser/hiddenRangeModel.js +init_arraysFind(); +init_event(); +init_range(); +init_eolCounter(); +var HiddenRangeModel = class { + get onDidChange() { + return this._updateEventEmitter.event; + } + get hiddenRanges() { + return this._hiddenRanges; + } + constructor(model) { + this._updateEventEmitter = new Emitter(); + this._hasLineChanges = false; + this._foldingModel = model; + this._foldingModelListener = model.onDidChange((_) => this.updateHiddenRanges()); + this._hiddenRanges = []; + if (model.regions.length) { + this.updateHiddenRanges(); + } + } + notifyChangeModelContent(e) { + if (this._hiddenRanges.length && !this._hasLineChanges) { + this._hasLineChanges = e.changes.some((change) => { + return change.range.endLineNumber !== change.range.startLineNumber || countEOL(change.text)[0] !== 0; + }); + } + } + updateHiddenRanges() { + let updateHiddenAreas = false; + const newHiddenAreas = []; + let i2 = 0; + let k = 0; + let lastCollapsedStart = Number.MAX_VALUE; + let lastCollapsedEnd = -1; + const ranges = this._foldingModel.regions; + for (; i2 < ranges.length; i2++) { + if (!ranges.isCollapsed(i2)) { + continue; + } + const startLineNumber = ranges.getStartLineNumber(i2) + 1; + const endLineNumber = ranges.getEndLineNumber(i2); + if (lastCollapsedStart <= startLineNumber && endLineNumber <= lastCollapsedEnd) { + continue; + } + if (!updateHiddenAreas && k < this._hiddenRanges.length && this._hiddenRanges[k].startLineNumber === startLineNumber && this._hiddenRanges[k].endLineNumber === endLineNumber) { + newHiddenAreas.push(this._hiddenRanges[k]); + k++; + } else { + updateHiddenAreas = true; + newHiddenAreas.push(new Range(startLineNumber, 1, endLineNumber, 1)); + } + lastCollapsedStart = startLineNumber; + lastCollapsedEnd = endLineNumber; + } + if (this._hasLineChanges || updateHiddenAreas || k < this._hiddenRanges.length) { + this.applyHiddenRanges(newHiddenAreas); + } + } + applyHiddenRanges(newHiddenAreas) { + this._hiddenRanges = newHiddenAreas; + this._hasLineChanges = false; + this._updateEventEmitter.fire(newHiddenAreas); + } + hasRanges() { + return this._hiddenRanges.length > 0; + } + isHidden(line) { + return findRange(this._hiddenRanges, line) !== null; + } + adjustSelections(selections) { + let hasChanges = false; + const editorModel = this._foldingModel.textModel; + let lastRange = null; + const adjustLine = (line) => { + if (!lastRange || !isInside(line, lastRange)) { + lastRange = findRange(this._hiddenRanges, line); + } + if (lastRange) { + return lastRange.startLineNumber - 1; + } + return null; + }; + for (let i2 = 0, len = selections.length; i2 < len; i2++) { + let selection = selections[i2]; + const adjustedStartLine = adjustLine(selection.startLineNumber); + if (adjustedStartLine) { + selection = selection.setStartPosition(adjustedStartLine, editorModel.getLineMaxColumn(adjustedStartLine)); + hasChanges = true; + } + const adjustedEndLine = adjustLine(selection.endLineNumber); + if (adjustedEndLine) { + selection = selection.setEndPosition(adjustedEndLine, editorModel.getLineMaxColumn(adjustedEndLine)); + hasChanges = true; + } + selections[i2] = selection; + } + return hasChanges; + } + dispose() { + if (this.hiddenRanges.length > 0) { + this._hiddenRanges = []; + this._updateEventEmitter.fire(this._hiddenRanges); + } + if (this._foldingModelListener) { + this._foldingModelListener.dispose(); + this._foldingModelListener = null; + } + } +}; +function isInside(line, range2) { + return line >= range2.startLineNumber && line <= range2.endLineNumber; +} +function findRange(ranges, line) { + const i2 = findFirstIdxMonotonousOrArrLen(ranges, (r) => line < r.startLineNumber) - 1; + if (i2 >= 0 && ranges[i2].endLineNumber >= line) { + return ranges[i2]; + } + return null; +} + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/folding/browser/indentRangeProvider.js +init_utils4(); +var MAX_FOLDING_REGIONS_FOR_INDENT_DEFAULT = 5e3; +var ID_INDENT_PROVIDER = "indent"; +var IndentRangeProvider = class { + constructor(editorModel, languageConfigurationService, foldingRangesLimit) { + this.editorModel = editorModel; + this.languageConfigurationService = languageConfigurationService; + this.foldingRangesLimit = foldingRangesLimit; + this.id = ID_INDENT_PROVIDER; + } + dispose() { + } + compute(cancelationToken) { + const foldingRules = this.languageConfigurationService.getLanguageConfiguration(this.editorModel.getLanguageId()).foldingRules; + const offSide = foldingRules && !!foldingRules.offSide; + const markers = foldingRules && foldingRules.markers; + return Promise.resolve(computeRanges(this.editorModel, offSide, markers, this.foldingRangesLimit)); + } +}; +var RangesCollector = class { + constructor(foldingRangesLimit) { + this._startIndexes = []; + this._endIndexes = []; + this._indentOccurrences = []; + this._length = 0; + this._foldingRangesLimit = foldingRangesLimit; + } + insertFirst(startLineNumber, endLineNumber, indent) { + if (startLineNumber > MAX_LINE_NUMBER || endLineNumber > MAX_LINE_NUMBER) { + return; + } + const index = this._length; + this._startIndexes[index] = startLineNumber; + this._endIndexes[index] = endLineNumber; + this._length++; + if (indent < 1e3) { + this._indentOccurrences[indent] = (this._indentOccurrences[indent] || 0) + 1; + } + } + toIndentRanges(model) { + const limit = this._foldingRangesLimit.limit; + if (this._length <= limit) { + this._foldingRangesLimit.update(this._length, false); + const startIndexes = new Uint32Array(this._length); + const endIndexes = new Uint32Array(this._length); + for (let i2 = this._length - 1, k = 0; i2 >= 0; i2--, k++) { + startIndexes[k] = this._startIndexes[i2]; + endIndexes[k] = this._endIndexes[i2]; + } + return new FoldingRegions(startIndexes, endIndexes); + } else { + this._foldingRangesLimit.update(this._length, limit); + let entries2 = 0; + let maxIndent = this._indentOccurrences.length; + for (let i2 = 0; i2 < this._indentOccurrences.length; i2++) { + const n2 = this._indentOccurrences[i2]; + if (n2) { + if (n2 + entries2 > limit) { + maxIndent = i2; + break; + } + entries2 += n2; + } + } + const tabSize = model.getOptions().tabSize; + const startIndexes = new Uint32Array(limit); + const endIndexes = new Uint32Array(limit); + for (let i2 = this._length - 1, k = 0; i2 >= 0; i2--) { + const startIndex = this._startIndexes[i2]; + const lineContent = model.getLineContent(startIndex); + const indent = computeIndentLevel(lineContent, tabSize); + if (indent < maxIndent || indent === maxIndent && entries2++ < limit) { + startIndexes[k] = startIndex; + endIndexes[k] = this._endIndexes[i2]; + k++; + } + } + return new FoldingRegions(startIndexes, endIndexes); + } + } +}; +var foldingRangesLimitDefault = { + limit: MAX_FOLDING_REGIONS_FOR_INDENT_DEFAULT, + update: () => { + } +}; +function computeRanges(model, offSide, markers, foldingRangesLimit = foldingRangesLimitDefault) { + const tabSize = model.getOptions().tabSize; + const result = new RangesCollector(foldingRangesLimit); + let pattern = void 0; + if (markers) { + pattern = new RegExp(`(${markers.start.source})|(?:${markers.end.source})`); + } + const previousRegions = []; + const line = model.getLineCount() + 1; + previousRegions.push({ indent: -1, endAbove: line, line }); + for (let line2 = model.getLineCount(); line2 > 0; line2--) { + const lineContent = model.getLineContent(line2); + const indent = computeIndentLevel(lineContent, tabSize); + let previous = previousRegions[previousRegions.length - 1]; + if (indent === -1) { + if (offSide) { + previous.endAbove = line2; + } + continue; + } + let m; + if (pattern && (m = lineContent.match(pattern))) { + if (m[1]) { + let i2 = previousRegions.length - 1; + while (i2 > 0 && previousRegions[i2].indent !== -2) { + i2--; + } + if (i2 > 0) { + previousRegions.length = i2 + 1; + previous = previousRegions[i2]; + result.insertFirst(line2, previous.line, indent); + previous.line = line2; + previous.indent = indent; + previous.endAbove = line2; + continue; + } else { + } + } else { + previousRegions.push({ indent: -2, endAbove: line2, line: line2 }); + continue; + } + } + if (previous.indent > indent) { + do { + previousRegions.pop(); + previous = previousRegions[previousRegions.length - 1]; + } while (previous.indent > indent); + const endLineNumber = previous.endAbove - 1; + if (endLineNumber - line2 >= 1) { + result.insertFirst(line2, endLineNumber, indent); + } + } + if (previous.indent === indent) { + previous.endAbove = line2; + } else { + previousRegions.push({ indent, endAbove: line2, line: line2 }); + } + } + return result.toIndentRanges(model); +} + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/folding/browser/folding.js +init_nls(); +init_contextkey(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/folding/browser/foldingDecorations.js +init_codicons(); +init_textModel(); +init_nls(); +init_colorRegistry(); +init_themeService(); +init_themables(); +var foldBackground = registerColor("editor.foldBackground", { light: transparent(editorSelectionBackground, 0.3), dark: transparent(editorSelectionBackground, 0.3), hcDark: null, hcLight: null }, localize(1002, "Background color behind folded ranges. The color must not be opaque so as not to hide underlying decorations."), true); +registerColor("editor.foldPlaceholderForeground", { light: "#808080", dark: "#808080", hcDark: null, hcLight: null }, localize(1003, "Color of the collapsed text after the first line of a folded range.")); +registerColor("editorGutter.foldingControlForeground", iconForeground, localize(1004, "Color of the folding control in the editor gutter.")); +var foldingExpandedIcon = registerIcon("folding-expanded", Codicon.chevronDown, localize(1005, "Icon for expanded ranges in the editor glyph margin.")); +var foldingCollapsedIcon = registerIcon("folding-collapsed", Codicon.chevronRight, localize(1006, "Icon for collapsed ranges in the editor glyph margin.")); +var foldingManualCollapsedIcon = registerIcon("folding-manual-collapsed", foldingCollapsedIcon, localize(1007, "Icon for manually collapsed ranges in the editor glyph margin.")); +var foldingManualExpandedIcon = registerIcon("folding-manual-expanded", foldingExpandedIcon, localize(1008, "Icon for manually expanded ranges in the editor glyph margin.")); +var foldedBackgroundMinimap = { + color: themeColorFromId(foldBackground), + position: 1 + /* MinimapPosition.Inline */ +}; +var collapsed = localize(1009, "Click to expand the range."); +var expanded = localize(1010, "Click to collapse the range."); +var FoldingDecorationProvider = class _FoldingDecorationProvider { + static { + this.COLLAPSED_VISUAL_DECORATION = ModelDecorationOptions.register({ + description: "folding-collapsed-visual-decoration", + stickiness: 0, + afterContentClassName: "inline-folded", + isWholeLine: true, + linesDecorationsTooltip: collapsed, + firstLineDecorationClassName: ThemeIcon.asClassName(foldingCollapsedIcon) + }); + } + static { + this.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION = ModelDecorationOptions.register({ + description: "folding-collapsed-highlighted-visual-decoration", + stickiness: 0, + afterContentClassName: "inline-folded", + className: "folded-background", + minimap: foldedBackgroundMinimap, + isWholeLine: true, + linesDecorationsTooltip: collapsed, + firstLineDecorationClassName: ThemeIcon.asClassName(foldingCollapsedIcon) + }); + } + static { + this.MANUALLY_COLLAPSED_VISUAL_DECORATION = ModelDecorationOptions.register({ + description: "folding-manually-collapsed-visual-decoration", + stickiness: 0, + afterContentClassName: "inline-folded", + isWholeLine: true, + linesDecorationsTooltip: collapsed, + firstLineDecorationClassName: ThemeIcon.asClassName(foldingManualCollapsedIcon) + }); + } + static { + this.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION = ModelDecorationOptions.register({ + description: "folding-manually-collapsed-highlighted-visual-decoration", + stickiness: 0, + afterContentClassName: "inline-folded", + className: "folded-background", + minimap: foldedBackgroundMinimap, + isWholeLine: true, + linesDecorationsTooltip: collapsed, + firstLineDecorationClassName: ThemeIcon.asClassName(foldingManualCollapsedIcon) + }); + } + static { + this.NO_CONTROLS_COLLAPSED_RANGE_DECORATION = ModelDecorationOptions.register({ + description: "folding-no-controls-range-decoration", + stickiness: 0, + afterContentClassName: "inline-folded", + isWholeLine: true, + linesDecorationsTooltip: collapsed + }); + } + static { + this.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION = ModelDecorationOptions.register({ + description: "folding-no-controls-range-decoration", + stickiness: 0, + afterContentClassName: "inline-folded", + className: "folded-background", + minimap: foldedBackgroundMinimap, + isWholeLine: true, + linesDecorationsTooltip: collapsed + }); + } + static { + this.EXPANDED_VISUAL_DECORATION = ModelDecorationOptions.register({ + description: "folding-expanded-visual-decoration", + stickiness: 1, + isWholeLine: true, + firstLineDecorationClassName: "alwaysShowFoldIcons " + ThemeIcon.asClassName(foldingExpandedIcon), + linesDecorationsTooltip: expanded + }); + } + static { + this.EXPANDED_AUTO_HIDE_VISUAL_DECORATION = ModelDecorationOptions.register({ + description: "folding-expanded-auto-hide-visual-decoration", + stickiness: 1, + isWholeLine: true, + firstLineDecorationClassName: ThemeIcon.asClassName(foldingExpandedIcon), + linesDecorationsTooltip: expanded + }); + } + static { + this.MANUALLY_EXPANDED_VISUAL_DECORATION = ModelDecorationOptions.register({ + description: "folding-manually-expanded-visual-decoration", + stickiness: 0, + isWholeLine: true, + firstLineDecorationClassName: "alwaysShowFoldIcons " + ThemeIcon.asClassName(foldingManualExpandedIcon), + linesDecorationsTooltip: expanded + }); + } + static { + this.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION = ModelDecorationOptions.register({ + description: "folding-manually-expanded-auto-hide-visual-decoration", + stickiness: 0, + isWholeLine: true, + firstLineDecorationClassName: ThemeIcon.asClassName(foldingManualExpandedIcon), + linesDecorationsTooltip: expanded + }); + } + static { + this.NO_CONTROLS_EXPANDED_RANGE_DECORATION = ModelDecorationOptions.register({ + description: "folding-no-controls-range-decoration", + stickiness: 0, + isWholeLine: true + }); + } + static { + this.HIDDEN_RANGE_DECORATION = ModelDecorationOptions.register({ + description: "folding-hidden-range-decoration", + stickiness: 1 + /* TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges */ + }); + } + constructor(editor2) { + this.editor = editor2; + this.showFoldingControls = "mouseover"; + this.showFoldingHighlights = true; + } + getDecorationOption(isCollapsed, isHidden, isManual) { + if (isHidden) { + return _FoldingDecorationProvider.HIDDEN_RANGE_DECORATION; + } + if (this.showFoldingControls === "never") { + if (isCollapsed) { + return this.showFoldingHighlights ? _FoldingDecorationProvider.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION : _FoldingDecorationProvider.NO_CONTROLS_COLLAPSED_RANGE_DECORATION; + } + return _FoldingDecorationProvider.NO_CONTROLS_EXPANDED_RANGE_DECORATION; + } + if (isCollapsed) { + return isManual ? this.showFoldingHighlights ? _FoldingDecorationProvider.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION : _FoldingDecorationProvider.MANUALLY_COLLAPSED_VISUAL_DECORATION : this.showFoldingHighlights ? _FoldingDecorationProvider.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION : _FoldingDecorationProvider.COLLAPSED_VISUAL_DECORATION; + } else if (this.showFoldingControls === "mouseover") { + return isManual ? _FoldingDecorationProvider.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION : _FoldingDecorationProvider.EXPANDED_AUTO_HIDE_VISUAL_DECORATION; + } else { + return isManual ? _FoldingDecorationProvider.MANUALLY_EXPANDED_VISUAL_DECORATION : _FoldingDecorationProvider.EXPANDED_VISUAL_DECORATION; + } + } + changeDecorations(callback) { + return this.editor.changeDecorations(callback); + } + removeDecorations(decorationIds) { + this.editor.removeDecorations(decorationIds); + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/folding/browser/syntaxRangeProvider.js +init_errors(); +init_lifecycle(); +var foldingContext = {}; +var ID_SYNTAX_PROVIDER = "syntax"; +var SyntaxRangeProvider = class { + constructor(editorModel, providers, handleFoldingRangesChange, foldingRangesLimit, fallbackRangeProvider) { + this.editorModel = editorModel; + this.providers = providers; + this.handleFoldingRangesChange = handleFoldingRangesChange; + this.foldingRangesLimit = foldingRangesLimit; + this.fallbackRangeProvider = fallbackRangeProvider; + this.id = ID_SYNTAX_PROVIDER; + this.disposables = new DisposableStore(); + if (fallbackRangeProvider) { + this.disposables.add(fallbackRangeProvider); + } + for (const provider of providers) { + if (typeof provider.onDidChange === "function") { + this.disposables.add(provider.onDidChange(handleFoldingRangesChange)); + } + } + } + compute(cancellationToken) { + return collectSyntaxRanges(this.providers, this.editorModel, cancellationToken).then((ranges) => { + if (this.editorModel.isDisposed()) { + return null; + } + if (ranges) { + const res = sanitizeRanges(ranges, this.foldingRangesLimit); + return res; + } + return this.fallbackRangeProvider?.compute(cancellationToken) ?? null; + }); + } + dispose() { + this.disposables.dispose(); + } +}; +function collectSyntaxRanges(providers, model, cancellationToken) { + let rangeData = null; + const promises = providers.map((provider, i2) => { + return Promise.resolve(provider.provideFoldingRanges(model, foldingContext, cancellationToken)).then((ranges) => { + if (cancellationToken.isCancellationRequested) { + return; + } + if (Array.isArray(ranges)) { + if (!Array.isArray(rangeData)) { + rangeData = []; + } + const nLines = model.getLineCount(); + for (const r of ranges) { + if (r.start > 0 && r.end > r.start && r.end <= nLines) { + rangeData.push({ start: r.start, end: r.end, rank: i2, kind: r.kind }); + } + } + } + }, onUnexpectedExternalError); + }); + return Promise.all(promises).then((_) => { + return rangeData; + }); +} +var RangesCollector2 = class { + constructor(foldingRangesLimit) { + this._startIndexes = []; + this._endIndexes = []; + this._nestingLevels = []; + this._nestingLevelCounts = []; + this._types = []; + this._length = 0; + this._foldingRangesLimit = foldingRangesLimit; + } + add(startLineNumber, endLineNumber, type, nestingLevel) { + if (startLineNumber > MAX_LINE_NUMBER || endLineNumber > MAX_LINE_NUMBER) { + return; + } + const index = this._length; + this._startIndexes[index] = startLineNumber; + this._endIndexes[index] = endLineNumber; + this._nestingLevels[index] = nestingLevel; + this._types[index] = type; + this._length++; + if (nestingLevel < 30) { + this._nestingLevelCounts[nestingLevel] = (this._nestingLevelCounts[nestingLevel] || 0) + 1; + } + } + toIndentRanges() { + const limit = this._foldingRangesLimit.limit; + if (this._length <= limit) { + this._foldingRangesLimit.update(this._length, false); + const startIndexes = new Uint32Array(this._length); + const endIndexes = new Uint32Array(this._length); + for (let i2 = 0; i2 < this._length; i2++) { + startIndexes[i2] = this._startIndexes[i2]; + endIndexes[i2] = this._endIndexes[i2]; + } + return new FoldingRegions(startIndexes, endIndexes, this._types); + } else { + this._foldingRangesLimit.update(this._length, limit); + let entries2 = 0; + let maxLevel = this._nestingLevelCounts.length; + for (let i2 = 0; i2 < this._nestingLevelCounts.length; i2++) { + const n2 = this._nestingLevelCounts[i2]; + if (n2) { + if (n2 + entries2 > limit) { + maxLevel = i2; + break; + } + entries2 += n2; + } + } + const startIndexes = new Uint32Array(limit); + const endIndexes = new Uint32Array(limit); + const types = []; + for (let i2 = 0, k = 0; i2 < this._length; i2++) { + const level = this._nestingLevels[i2]; + if (level < maxLevel || level === maxLevel && entries2++ < limit) { + startIndexes[k] = this._startIndexes[i2]; + endIndexes[k] = this._endIndexes[i2]; + types[k] = this._types[i2]; + k++; + } + } + return new FoldingRegions(startIndexes, endIndexes, types); + } + } +}; +function sanitizeRanges(rangeData, foldingRangesLimit) { + const sorted = rangeData.sort((d1, d2) => { + let diff = d1.start - d2.start; + if (diff === 0) { + diff = d1.rank - d2.rank; + } + return diff; + }); + const collector = new RangesCollector2(foldingRangesLimit); + let top = void 0; + const previous = []; + for (const entry of sorted) { + if (!top) { + top = entry; + collector.add(entry.start, entry.end, entry.kind && entry.kind.value, previous.length); + } else { + if (entry.start > top.start) { + if (entry.end <= top.end) { + previous.push(top); + top = entry; + collector.add(entry.start, entry.end, entry.kind && entry.kind.value, previous.length); + } else { + if (entry.start > top.end) { + do { + top = previous.pop(); + } while (top && entry.start > top.end); + if (top) { + previous.push(top); + } + top = entry; + } + collector.add(entry.start, entry.end, entry.kind && entry.kind.value, previous.length); + } + } + } + } + return collector.toIndentRanges(); +} + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/folding/browser/folding.js +init_languageFeatureDebounce(); +init_stopwatch(); +init_languageFeatures(); +init_event(); +init_commands(); +init_uri(); +init_model(); +init_configuration(); +var __decorate93 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param87 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var FoldingController_1; +var CONTEXT_FOLDING_ENABLED = new RawContextKey("foldingEnabled", false); +var FoldingController = class FoldingController2 extends Disposable { + static { + FoldingController_1 = this; + } + static { + this.ID = "editor.contrib.folding"; + } + static get(editor2) { + return editor2.getContribution(FoldingController_1.ID); + } + static getFoldingRangeProviders(languageFeaturesService, model) { + const foldingRangeProviders = languageFeaturesService.foldingRangeProvider.ordered(model); + return FoldingController_1._foldingRangeSelector?.(foldingRangeProviders, model) ?? foldingRangeProviders; + } + constructor(editor2, contextKeyService, languageConfigurationService, notificationService, languageFeatureDebounceService, languageFeaturesService) { + super(); + this.contextKeyService = contextKeyService; + this.languageConfigurationService = languageConfigurationService; + this.languageFeaturesService = languageFeaturesService; + this.localToDispose = this._register(new DisposableStore()); + this.editor = editor2; + this._foldingLimitReporter = this._register(new RangesLimitReporter(editor2)); + const options2 = this.editor.getOptions(); + this._isEnabled = options2.get( + 52 + /* EditorOption.folding */ + ); + this._useFoldingProviders = options2.get( + 53 + /* EditorOption.foldingStrategy */ + ) !== "indentation"; + this._unfoldOnClickAfterEndOfLine = options2.get( + 57 + /* EditorOption.unfoldOnClickAfterEndOfLine */ + ); + this._restoringViewState = false; + this._currentModelHasFoldedImports = false; + this._foldingImportsByDefault = options2.get( + 55 + /* EditorOption.foldingImportsByDefault */ + ); + this.updateDebounceInfo = languageFeatureDebounceService.for(languageFeaturesService.foldingRangeProvider, "Folding", { min: 200 }); + this.foldingModel = null; + this.hiddenRangeModel = null; + this.rangeProvider = null; + this.foldingRegionPromise = null; + this.foldingModelPromise = null; + this.updateScheduler = null; + this.cursorChangedScheduler = null; + this.mouseDownInfo = null; + this.foldingDecorationProvider = new FoldingDecorationProvider(editor2); + this.foldingDecorationProvider.showFoldingControls = options2.get( + 126 + /* EditorOption.showFoldingControls */ + ); + this.foldingDecorationProvider.showFoldingHighlights = options2.get( + 54 + /* EditorOption.foldingHighlight */ + ); + this.foldingEnabled = CONTEXT_FOLDING_ENABLED.bindTo(this.contextKeyService); + this.foldingEnabled.set(this._isEnabled); + this._register(this.editor.onDidChangeModel(() => this.onModelChanged())); + this._register(this.editor.onDidChangeConfiguration((e) => { + if (e.hasChanged( + 52 + /* EditorOption.folding */ + )) { + this._isEnabled = this.editor.getOptions().get( + 52 + /* EditorOption.folding */ + ); + this.foldingEnabled.set(this._isEnabled); + this.onModelChanged(); + } + if (e.hasChanged( + 56 + /* EditorOption.foldingMaximumRegions */ + )) { + this.onModelChanged(); + } + if (e.hasChanged( + 126 + /* EditorOption.showFoldingControls */ + ) || e.hasChanged( + 54 + /* EditorOption.foldingHighlight */ + )) { + const options3 = this.editor.getOptions(); + this.foldingDecorationProvider.showFoldingControls = options3.get( + 126 + /* EditorOption.showFoldingControls */ + ); + this.foldingDecorationProvider.showFoldingHighlights = options3.get( + 54 + /* EditorOption.foldingHighlight */ + ); + this.triggerFoldingModelChanged(); + } + if (e.hasChanged( + 53 + /* EditorOption.foldingStrategy */ + )) { + this._useFoldingProviders = this.editor.getOptions().get( + 53 + /* EditorOption.foldingStrategy */ + ) !== "indentation"; + this.onFoldingStrategyChanged(); + } + if (e.hasChanged( + 57 + /* EditorOption.unfoldOnClickAfterEndOfLine */ + )) { + this._unfoldOnClickAfterEndOfLine = this.editor.getOptions().get( + 57 + /* EditorOption.unfoldOnClickAfterEndOfLine */ + ); + } + if (e.hasChanged( + 55 + /* EditorOption.foldingImportsByDefault */ + )) { + this._foldingImportsByDefault = this.editor.getOptions().get( + 55 + /* EditorOption.foldingImportsByDefault */ + ); + } + })); + this.onModelChanged(); + } + /** + * Store view state. + */ + saveViewState() { + const model = this.editor.getModel(); + if (!model || !this._isEnabled || model.isTooLargeForTokenization()) { + return {}; + } + if (this.foldingModel) { + const collapsedRegions = this.foldingModel.getMemento(); + const provider = this.rangeProvider ? this.rangeProvider.id : void 0; + return { collapsedRegions, lineCount: model.getLineCount(), provider, foldedImports: this._currentModelHasFoldedImports }; + } + return void 0; + } + /** + * Restore view state. + */ + restoreViewState(state) { + const model = this.editor.getModel(); + if (!model || !this._isEnabled || model.isTooLargeForTokenization() || !this.hiddenRangeModel) { + return; + } + if (!state) { + return; + } + this._currentModelHasFoldedImports = !!state.foldedImports; + if (state.collapsedRegions && state.collapsedRegions.length > 0 && this.foldingModel) { + this._restoringViewState = true; + try { + this.foldingModel.applyMemento(state.collapsedRegions); + } finally { + this._restoringViewState = false; + } + } + } + onModelChanged() { + this.localToDispose.clear(); + const model = this.editor.getModel(); + if (!this._isEnabled || !model || model.isTooLargeForTokenization()) { + return; + } + this._currentModelHasFoldedImports = false; + this.foldingModel = new FoldingModel(model, this.foldingDecorationProvider); + this.localToDispose.add(this.foldingModel); + this.hiddenRangeModel = new HiddenRangeModel(this.foldingModel); + this.localToDispose.add(this.hiddenRangeModel); + this.localToDispose.add(this.hiddenRangeModel.onDidChange((hr2) => this.onHiddenRangesChanges(hr2))); + this.updateScheduler = new Delayer(this.updateDebounceInfo.get(model)); + this.localToDispose.add(this.updateScheduler); + this.cursorChangedScheduler = new RunOnceScheduler(() => this.revealCursor(), 200); + this.localToDispose.add(this.cursorChangedScheduler); + this.localToDispose.add(this.languageFeaturesService.foldingRangeProvider.onDidChange(() => this.onFoldingStrategyChanged())); + this.localToDispose.add(this.editor.onDidChangeModelLanguageConfiguration(() => this.onFoldingStrategyChanged())); + this.localToDispose.add(this.editor.onDidChangeModelContent((e) => this.onDidChangeModelContent(e))); + this.localToDispose.add(this.editor.onDidChangeCursorPosition(() => this.onCursorPositionChanged())); + this.localToDispose.add(this.editor.onMouseDown((e) => this.onEditorMouseDown(e))); + this.localToDispose.add(this.editor.onMouseUp((e) => this.onEditorMouseUp(e))); + this.localToDispose.add({ + dispose: () => { + if (this.foldingRegionPromise) { + this.foldingRegionPromise.cancel(); + this.foldingRegionPromise = null; + } + this.updateScheduler?.cancel(); + this.updateScheduler = null; + this.foldingModel = null; + this.foldingModelPromise = null; + this.hiddenRangeModel = null; + this.cursorChangedScheduler = null; + this.rangeProvider?.dispose(); + this.rangeProvider = null; + } + }); + this.triggerFoldingModelChanged(); + } + onFoldingStrategyChanged() { + this.rangeProvider?.dispose(); + this.rangeProvider = null; + this.triggerFoldingModelChanged(); + } + getRangeProvider(editorModel) { + if (this.rangeProvider) { + return this.rangeProvider; + } + const indentRangeProvider = new IndentRangeProvider(editorModel, this.languageConfigurationService, this._foldingLimitReporter); + this.rangeProvider = indentRangeProvider; + if (this._useFoldingProviders && this.foldingModel) { + const selectedProviders = FoldingController_1.getFoldingRangeProviders(this.languageFeaturesService, editorModel); + if (selectedProviders.length > 0) { + this.rangeProvider = new SyntaxRangeProvider(editorModel, selectedProviders, () => this.triggerFoldingModelChanged(), this._foldingLimitReporter, indentRangeProvider); + } + } + return this.rangeProvider; + } + getFoldingModel() { + return this.foldingModelPromise; + } + onDidChangeModelContent(e) { + this.hiddenRangeModel?.notifyChangeModelContent(e); + this.triggerFoldingModelChanged(); + } + triggerFoldingModelChanged() { + if (this.updateScheduler) { + if (this.foldingRegionPromise) { + this.foldingRegionPromise.cancel(); + this.foldingRegionPromise = null; + } + this.foldingModelPromise = this.updateScheduler.trigger(() => { + const foldingModel = this.foldingModel; + if (!foldingModel) { + return null; + } + const sw = new StopWatch(); + const provider = this.getRangeProvider(foldingModel.textModel); + const foldingRegionPromise = this.foldingRegionPromise = createCancelablePromise((token) => provider.compute(token)); + return foldingRegionPromise.then((foldingRanges) => { + if (foldingRanges && foldingRegionPromise === this.foldingRegionPromise) { + let scrollState; + if (this._foldingImportsByDefault && !this._currentModelHasFoldedImports) { + const hasChanges = foldingRanges.setCollapsedAllOfType(FoldingRangeKind.Imports.value, true); + if (hasChanges) { + scrollState = StableEditorScrollState.capture(this.editor); + this._currentModelHasFoldedImports = hasChanges; + } + } + const selections = this.editor.getSelections(); + foldingModel.update(foldingRanges, toSelectedLines(selections)); + scrollState?.restore(this.editor); + const newValue = this.updateDebounceInfo.update(foldingModel.textModel, sw.elapsed()); + if (this.updateScheduler) { + this.updateScheduler.defaultDelay = newValue; + } + } + return foldingModel; + }); + }).then(void 0, (err) => { + onUnexpectedError(err); + return null; + }); + } + } + onHiddenRangesChanges(hiddenRanges) { + if (this.hiddenRangeModel && hiddenRanges.length && !this._restoringViewState) { + const selections = this.editor.getSelections(); + if (selections) { + if (this.hiddenRangeModel.adjustSelections(selections)) { + this.editor.setSelections(selections); + } + } + } + this.editor.setHiddenAreas(hiddenRanges, this); + } + onCursorPositionChanged() { + if (this.hiddenRangeModel && this.hiddenRangeModel.hasRanges()) { + this.cursorChangedScheduler.schedule(); + } + } + revealCursor() { + const foldingModel = this.getFoldingModel(); + if (!foldingModel) { + return; + } + foldingModel.then((foldingModel2) => { + if (foldingModel2) { + const selections = this.editor.getSelections(); + if (selections && selections.length > 0) { + const toToggle = []; + for (const selection of selections) { + const lineNumber = selection.selectionStartLineNumber; + if (this.hiddenRangeModel && this.hiddenRangeModel.isHidden(lineNumber)) { + toToggle.push(...foldingModel2.getAllRegionsAtLine(lineNumber, (r) => r.isCollapsed && lineNumber > r.startLineNumber)); + } + } + if (toToggle.length) { + foldingModel2.toggleCollapseState(toToggle); + this.reveal(selections[0].getPosition()); + } + } + } + }).then(void 0, onUnexpectedError); + } + onEditorMouseDown(e) { + this.mouseDownInfo = null; + if (!this.hiddenRangeModel || !e.target || !e.target.range) { + return; + } + if (!e.event.leftButton && !e.event.middleButton) { + return; + } + const range2 = e.target.range; + let iconClicked = false; + switch (e.target.type) { + case 4: { + const data = e.target.detail; + const offsetLeftInGutter = e.target.element.offsetLeft; + const gutterOffsetX = data.offsetX - offsetLeftInGutter; + if (gutterOffsetX < 4) { + return; + } + iconClicked = true; + break; + } + case 7: { + if (this._unfoldOnClickAfterEndOfLine && this.hiddenRangeModel.hasRanges()) { + const data = e.target.detail; + if (!data.isAfterLines) { + break; + } + } + return; + } + case 6: { + if (this.hiddenRangeModel.hasRanges()) { + const model = this.editor.getModel(); + if (model && range2.startColumn === model.getLineMaxColumn(range2.startLineNumber)) { + break; + } + } + return; + } + default: + return; + } + this.mouseDownInfo = { lineNumber: range2.startLineNumber, iconClicked }; + } + onEditorMouseUp(e) { + const foldingModel = this.foldingModel; + if (!foldingModel || !this.mouseDownInfo || !e.target) { + return; + } + const lineNumber = this.mouseDownInfo.lineNumber; + const iconClicked = this.mouseDownInfo.iconClicked; + const range2 = e.target.range; + if (!range2 || range2.startLineNumber !== lineNumber) { + return; + } + if (iconClicked) { + if (e.target.type !== 4) { + return; + } + } else { + const model = this.editor.getModel(); + if (!model || range2.startColumn !== model.getLineMaxColumn(lineNumber)) { + return; + } + } + const region = foldingModel.getRegionAtLine(lineNumber); + if (region && region.startLineNumber === lineNumber) { + const isCollapsed = region.isCollapsed; + if (iconClicked || isCollapsed) { + const surrounding = e.event.altKey; + let toToggle = []; + if (surrounding) { + const filter = (otherRegion) => !otherRegion.containedBy(region) && !region.containedBy(otherRegion); + const toMaybeToggle = foldingModel.getRegionsInside(null, filter); + for (const r of toMaybeToggle) { + if (r.isCollapsed) { + toToggle.push(r); + } + } + if (toToggle.length === 0) { + toToggle = toMaybeToggle; + } + } else { + const recursive = e.event.middleButton || e.event.shiftKey; + if (recursive) { + for (const r of foldingModel.getRegionsInside(region)) { + if (r.isCollapsed === isCollapsed) { + toToggle.push(r); + } + } + } + if (isCollapsed || !recursive || toToggle.length === 0) { + toToggle.push(region); + } + } + foldingModel.toggleCollapseState(toToggle); + this.reveal({ lineNumber, column: 1 }); + } + } + } + reveal(position) { + this.editor.revealPositionInCenterIfOutsideViewport( + position, + 0 + /* ScrollType.Smooth */ + ); + } +}; +FoldingController = FoldingController_1 = __decorate93([ + __param87(1, IContextKeyService), + __param87(2, ILanguageConfigurationService), + __param87(3, INotificationService), + __param87(4, ILanguageFeatureDebounceService), + __param87(5, ILanguageFeaturesService) +], FoldingController); +var RangesLimitReporter = class extends Disposable { + constructor(editor2) { + super(); + this.editor = editor2; + this._onDidChange = this._register(new Emitter()); + this._computed = 0; + this._limited = false; + } + get limit() { + return this.editor.getOptions().get( + 56 + /* EditorOption.foldingMaximumRegions */ + ); + } + update(computed, limited) { + if (computed !== this._computed || limited !== this._limited) { + this._computed = computed; + this._limited = limited; + this._onDidChange.fire(); + } + } +}; +var FoldingAction = class extends EditorAction { + runEditorCommand(accessor, editor2, args) { + const languageConfigurationService = accessor.get(ILanguageConfigurationService); + const foldingController = FoldingController.get(editor2); + if (!foldingController) { + return; + } + const foldingModelPromise = foldingController.getFoldingModel(); + if (foldingModelPromise) { + this.reportTelemetry(accessor, editor2); + return foldingModelPromise.then((foldingModel) => { + if (foldingModel) { + this.invoke(foldingController, foldingModel, editor2, args, languageConfigurationService); + const selection = editor2.getSelection(); + if (selection) { + foldingController.reveal(selection.getStartPosition()); + } + } + }); + } + } + getSelectedLines(editor2) { + const selections = editor2.getSelections(); + return selections ? selections.map((s) => s.startLineNumber) : []; + } + getLineNumbers(args, editor2) { + if (args && args.selectionLines) { + return args.selectionLines.map((l) => l + 1); + } + return this.getSelectedLines(editor2); + } + run(_accessor, _editor) { + } +}; +function toSelectedLines(selections) { + if (!selections || selections.length === 0) { + return { + startsInside: () => false + }; + } + return { + startsInside(startLine, endLine) { + for (const s of selections) { + const line = s.startLineNumber; + if (line >= startLine && line <= endLine) { + return true; + } + } + return false; + } + }; +} +function foldingArgumentsConstraint(args) { + if (!isUndefined(args)) { + if (!isObject(args)) { + return false; + } + const foldingArgs = args; + if (!isUndefined(foldingArgs.levels) && !isNumber(foldingArgs.levels)) { + return false; + } + if (!isUndefined(foldingArgs.direction) && !isString(foldingArgs.direction)) { + return false; + } + if (!isUndefined(foldingArgs.selectionLines) && (!Array.isArray(foldingArgs.selectionLines) || !foldingArgs.selectionLines.every(isNumber))) { + return false; + } + } + return true; +} +var UnfoldAction = class extends FoldingAction { + constructor() { + super({ + id: "editor.unfold", + label: localize2(982, "Unfold"), + precondition: CONTEXT_FOLDING_ENABLED, + kbOpts: { + kbExpr: EditorContextKeys.editorTextFocus, + primary: 2048 | 1024 | 94, + mac: { + primary: 2048 | 512 | 94 + /* KeyCode.BracketRight */ + }, + weight: 100 + /* KeybindingWeight.EditorContrib */ + }, + metadata: { + description: "Unfold the content in the editor", + args: [ + { + name: "Unfold editor argument", + description: `Property-value pairs that can be passed through this argument: + * 'levels': Number of levels to unfold. If not set, defaults to 1. + * 'direction': If 'up', unfold given number of levels up otherwise unfolds down. + * 'selectionLines': Array of the start lines (0-based) of the editor selections to apply the unfold action to. If not set, the active selection(s) will be used. + `, + constraint: foldingArgumentsConstraint, + schema: { + "type": "object", + "properties": { + "levels": { + "type": "number", + "default": 1 + }, + "direction": { + "type": "string", + "enum": ["up", "down"], + "default": "down" + }, + "selectionLines": { + "type": "array", + "items": { + "type": "number" + } + } + } + } + } + ] + } + }); + } + invoke(_foldingController, foldingModel, editor2, args) { + const levels = args && args.levels || 1; + const lineNumbers = this.getLineNumbers(args, editor2); + if (args && args.direction === "up") { + setCollapseStateLevelsUp(foldingModel, false, levels, lineNumbers); + } else { + setCollapseStateLevelsDown(foldingModel, false, levels, lineNumbers); + } + } +}; +var UnFoldRecursivelyAction = class extends FoldingAction { + constructor() { + super({ + id: "editor.unfoldRecursively", + label: localize2(983, "Unfold Recursively"), + precondition: CONTEXT_FOLDING_ENABLED, + kbOpts: { + kbExpr: EditorContextKeys.editorTextFocus, + primary: KeyChord( + 2048 | 41, + 2048 | 94 + /* KeyCode.BracketRight */ + ), + weight: 100 + /* KeybindingWeight.EditorContrib */ + } + }); + } + invoke(_foldingController, foldingModel, editor2, _args) { + setCollapseStateLevelsDown(foldingModel, false, Number.MAX_VALUE, this.getSelectedLines(editor2)); + } +}; +var FoldAction = class extends FoldingAction { + constructor() { + super({ + id: "editor.fold", + label: localize2(984, "Fold"), + precondition: CONTEXT_FOLDING_ENABLED, + kbOpts: { + kbExpr: EditorContextKeys.editorTextFocus, + primary: 2048 | 1024 | 92, + mac: { + primary: 2048 | 512 | 92 + /* KeyCode.BracketLeft */ + }, + weight: 100 + /* KeybindingWeight.EditorContrib */ + }, + metadata: { + description: "Fold the content in the editor", + args: [ + { + name: "Fold editor argument", + description: `Property-value pairs that can be passed through this argument: + * 'levels': Number of levels to fold. + * 'direction': If 'up', folds given number of levels up otherwise folds down. + * 'selectionLines': Array of the start lines (0-based) of the editor selections to apply the fold action to. If not set, the active selection(s) will be used. + If no levels or direction is set, folds the region at the locations or if already collapsed, the first uncollapsed parent instead. + `, + constraint: foldingArgumentsConstraint, + schema: { + "type": "object", + "properties": { + "levels": { + "type": "number" + }, + "direction": { + "type": "string", + "enum": ["up", "down"] + }, + "selectionLines": { + "type": "array", + "items": { + "type": "number" + } + } + } + } + } + ] + } + }); + } + invoke(_foldingController, foldingModel, editor2, args) { + const lineNumbers = this.getLineNumbers(args, editor2); + const levels = args && args.levels; + const direction = args && args.direction; + if (typeof levels !== "number" && typeof direction !== "string") { + setCollapseStateUp(foldingModel, true, lineNumbers); + } else { + if (direction === "up") { + setCollapseStateLevelsUp(foldingModel, true, levels || 1, lineNumbers); + } else { + setCollapseStateLevelsDown(foldingModel, true, levels || 1, lineNumbers); + } + } + } +}; +var ToggleFoldAction = class extends FoldingAction { + constructor() { + super({ + id: "editor.toggleFold", + label: localize2(985, "Toggle Fold"), + precondition: CONTEXT_FOLDING_ENABLED, + kbOpts: { + kbExpr: EditorContextKeys.editorTextFocus, + primary: KeyChord( + 2048 | 41, + 2048 | 42 + /* KeyCode.KeyL */ + ), + weight: 100 + /* KeybindingWeight.EditorContrib */ + } + }); + } + invoke(_foldingController, foldingModel, editor2) { + const selectedLines = this.getSelectedLines(editor2); + toggleCollapseState(foldingModel, 1, selectedLines); + } +}; +var FoldRecursivelyAction = class extends FoldingAction { + constructor() { + super({ + id: "editor.foldRecursively", + label: localize2(986, "Fold Recursively"), + precondition: CONTEXT_FOLDING_ENABLED, + kbOpts: { + kbExpr: EditorContextKeys.editorTextFocus, + primary: KeyChord( + 2048 | 41, + 2048 | 92 + /* KeyCode.BracketLeft */ + ), + weight: 100 + /* KeybindingWeight.EditorContrib */ + } + }); + } + invoke(_foldingController, foldingModel, editor2) { + const selectedLines = this.getSelectedLines(editor2); + setCollapseStateLevelsDown(foldingModel, true, Number.MAX_VALUE, selectedLines); + } +}; +var ToggleFoldRecursivelyAction = class extends FoldingAction { + constructor() { + super({ + id: "editor.toggleFoldRecursively", + label: localize2(987, "Toggle Fold Recursively"), + precondition: CONTEXT_FOLDING_ENABLED, + kbOpts: { + kbExpr: EditorContextKeys.editorTextFocus, + primary: KeyChord( + 2048 | 41, + 2048 | 1024 | 42 + /* KeyCode.KeyL */ + ), + weight: 100 + /* KeybindingWeight.EditorContrib */ + } + }); + } + invoke(_foldingController, foldingModel, editor2) { + const selectedLines = this.getSelectedLines(editor2); + toggleCollapseState(foldingModel, Number.MAX_VALUE, selectedLines); + } +}; +var FoldAllBlockCommentsAction = class extends FoldingAction { + constructor() { + super({ + id: "editor.foldAllBlockComments", + label: localize2(988, "Fold All Block Comments"), + precondition: CONTEXT_FOLDING_ENABLED, + kbOpts: { + kbExpr: EditorContextKeys.editorTextFocus, + primary: KeyChord( + 2048 | 41, + 2048 | 90 + /* KeyCode.Slash */ + ), + weight: 100 + /* KeybindingWeight.EditorContrib */ + } + }); + } + invoke(_foldingController, foldingModel, editor2, args, languageConfigurationService) { + if (foldingModel.regions.hasTypes()) { + setCollapseStateForType(foldingModel, FoldingRangeKind.Comment.value, true); + } else { + const editorModel = editor2.getModel(); + if (!editorModel) { + return; + } + const comments = languageConfigurationService.getLanguageConfiguration(editorModel.getLanguageId()).comments; + if (comments && comments.blockCommentStartToken) { + const regExp = new RegExp("^\\s*" + escapeRegExpCharacters(comments.blockCommentStartToken)); + setCollapseStateForMatchingLines(foldingModel, regExp, true); + } + } + } +}; +var FoldAllRegionsAction = class extends FoldingAction { + constructor() { + super({ + id: "editor.foldAllMarkerRegions", + label: localize2(989, "Fold All Regions"), + precondition: CONTEXT_FOLDING_ENABLED, + kbOpts: { + kbExpr: EditorContextKeys.editorTextFocus, + primary: KeyChord( + 2048 | 41, + 2048 | 29 + /* KeyCode.Digit8 */ + ), + weight: 100 + /* KeybindingWeight.EditorContrib */ + } + }); + } + invoke(_foldingController, foldingModel, editor2, args, languageConfigurationService) { + if (foldingModel.regions.hasTypes()) { + setCollapseStateForType(foldingModel, FoldingRangeKind.Region.value, true); + } else { + const editorModel = editor2.getModel(); + if (!editorModel) { + return; + } + const foldingRules = languageConfigurationService.getLanguageConfiguration(editorModel.getLanguageId()).foldingRules; + if (foldingRules && foldingRules.markers && foldingRules.markers.start) { + const regExp = new RegExp(foldingRules.markers.start); + setCollapseStateForMatchingLines(foldingModel, regExp, true); + } + } + } +}; +var UnfoldAllRegionsAction = class extends FoldingAction { + constructor() { + super({ + id: "editor.unfoldAllMarkerRegions", + label: localize2(990, "Unfold All Regions"), + precondition: CONTEXT_FOLDING_ENABLED, + kbOpts: { + kbExpr: EditorContextKeys.editorTextFocus, + primary: KeyChord( + 2048 | 41, + 2048 | 30 + /* KeyCode.Digit9 */ + ), + weight: 100 + /* KeybindingWeight.EditorContrib */ + } + }); + } + invoke(_foldingController, foldingModel, editor2, args, languageConfigurationService) { + if (foldingModel.regions.hasTypes()) { + setCollapseStateForType(foldingModel, FoldingRangeKind.Region.value, false); + } else { + const editorModel = editor2.getModel(); + if (!editorModel) { + return; + } + const foldingRules = languageConfigurationService.getLanguageConfiguration(editorModel.getLanguageId()).foldingRules; + if (foldingRules && foldingRules.markers && foldingRules.markers.start) { + const regExp = new RegExp(foldingRules.markers.start); + setCollapseStateForMatchingLines(foldingModel, regExp, false); + } + } + } +}; +var FoldAllExceptAction = class extends FoldingAction { + constructor() { + super({ + id: "editor.foldAllExcept", + label: localize2(991, "Fold All Except Selected"), + precondition: CONTEXT_FOLDING_ENABLED, + kbOpts: { + kbExpr: EditorContextKeys.editorTextFocus, + primary: KeyChord( + 2048 | 41, + 2048 | 88 + /* KeyCode.Minus */ + ), + weight: 100 + /* KeybindingWeight.EditorContrib */ + } + }); + } + invoke(_foldingController, foldingModel, editor2) { + const selectedLines = this.getSelectedLines(editor2); + setCollapseStateForRest(foldingModel, true, selectedLines); + } +}; +var UnfoldAllExceptAction = class extends FoldingAction { + constructor() { + super({ + id: "editor.unfoldAllExcept", + label: localize2(992, "Unfold All Except Selected"), + precondition: CONTEXT_FOLDING_ENABLED, + kbOpts: { + kbExpr: EditorContextKeys.editorTextFocus, + primary: KeyChord( + 2048 | 41, + 2048 | 86 + /* KeyCode.Equal */ + ), + weight: 100 + /* KeybindingWeight.EditorContrib */ + } + }); + } + invoke(_foldingController, foldingModel, editor2) { + const selectedLines = this.getSelectedLines(editor2); + setCollapseStateForRest(foldingModel, false, selectedLines); + } +}; +var FoldAllAction = class extends FoldingAction { + constructor() { + super({ + id: "editor.foldAll", + label: localize2(993, "Fold All"), + precondition: CONTEXT_FOLDING_ENABLED, + kbOpts: { + kbExpr: EditorContextKeys.editorTextFocus, + primary: KeyChord( + 2048 | 41, + 2048 | 21 + /* KeyCode.Digit0 */ + ), + weight: 100 + /* KeybindingWeight.EditorContrib */ + } + }); + } + invoke(_foldingController, foldingModel, _editor) { + setCollapseStateLevelsDown(foldingModel, true); + } +}; +var UnfoldAllAction = class extends FoldingAction { + constructor() { + super({ + id: "editor.unfoldAll", + label: localize2(994, "Unfold All"), + precondition: CONTEXT_FOLDING_ENABLED, + kbOpts: { + kbExpr: EditorContextKeys.editorTextFocus, + primary: KeyChord( + 2048 | 41, + 2048 | 40 + /* KeyCode.KeyJ */ + ), + weight: 100 + /* KeybindingWeight.EditorContrib */ + } + }); + } + invoke(_foldingController, foldingModel, _editor) { + setCollapseStateLevelsDown(foldingModel, false); + } +}; +var FoldLevelAction = class _FoldLevelAction extends FoldingAction { + static { + this.ID_PREFIX = "editor.foldLevel"; + } + static { + this.ID = (level) => _FoldLevelAction.ID_PREFIX + level; + } + getFoldingLevel() { + return parseInt(this.id.substr(_FoldLevelAction.ID_PREFIX.length)); + } + invoke(_foldingController, foldingModel, editor2) { + setCollapseStateAtLevel(foldingModel, this.getFoldingLevel(), true, this.getSelectedLines(editor2)); + } +}; +var GotoParentFoldAction = class extends FoldingAction { + constructor() { + super({ + id: "editor.gotoParentFold", + label: localize2(995, "Go to Parent Fold"), + precondition: CONTEXT_FOLDING_ENABLED, + kbOpts: { + kbExpr: EditorContextKeys.editorTextFocus, + weight: 100 + /* KeybindingWeight.EditorContrib */ + } + }); + } + invoke(_foldingController, foldingModel, editor2) { + const selectedLines = this.getSelectedLines(editor2); + if (selectedLines.length > 0) { + const startLineNumber = getParentFoldLine(selectedLines[0], foldingModel); + if (startLineNumber !== null) { + editor2.setSelection({ + startLineNumber, + startColumn: 1, + endLineNumber: startLineNumber, + endColumn: 1 + }); + } + } + } +}; +var GotoPreviousFoldAction = class extends FoldingAction { + constructor() { + super({ + id: "editor.gotoPreviousFold", + label: localize2(996, "Go to Previous Folding Range"), + precondition: CONTEXT_FOLDING_ENABLED, + kbOpts: { + kbExpr: EditorContextKeys.editorTextFocus, + weight: 100 + /* KeybindingWeight.EditorContrib */ + } + }); + } + invoke(_foldingController, foldingModel, editor2) { + const selectedLines = this.getSelectedLines(editor2); + if (selectedLines.length > 0) { + const startLineNumber = getPreviousFoldLine(selectedLines[0], foldingModel); + if (startLineNumber !== null) { + editor2.setSelection({ + startLineNumber, + startColumn: 1, + endLineNumber: startLineNumber, + endColumn: 1 + }); + } + } + } +}; +var GotoNextFoldAction = class extends FoldingAction { + constructor() { + super({ + id: "editor.gotoNextFold", + label: localize2(997, "Go to Next Folding Range"), + precondition: CONTEXT_FOLDING_ENABLED, + kbOpts: { + kbExpr: EditorContextKeys.editorTextFocus, + weight: 100 + /* KeybindingWeight.EditorContrib */ + } + }); + } + invoke(_foldingController, foldingModel, editor2) { + const selectedLines = this.getSelectedLines(editor2); + if (selectedLines.length > 0) { + const startLineNumber = getNextFoldLine(selectedLines[0], foldingModel); + if (startLineNumber !== null) { + editor2.setSelection({ + startLineNumber, + startColumn: 1, + endLineNumber: startLineNumber, + endColumn: 1 + }); + } + } + } +}; +var FoldRangeFromSelectionAction = class extends FoldingAction { + constructor() { + super({ + id: "editor.createFoldingRangeFromSelection", + label: localize2(998, "Create Folding Range from Selection"), + precondition: CONTEXT_FOLDING_ENABLED, + kbOpts: { + kbExpr: EditorContextKeys.editorTextFocus, + primary: KeyChord( + 2048 | 41, + 2048 | 87 + /* KeyCode.Comma */ + ), + weight: 100 + /* KeybindingWeight.EditorContrib */ + } + }); + } + invoke(_foldingController, foldingModel, editor2) { + const collapseRanges = []; + const selections = editor2.getSelections(); + if (selections) { + for (const selection of selections) { + let endLineNumber = selection.endLineNumber; + if (selection.endColumn === 1) { + --endLineNumber; + } + if (endLineNumber > selection.startLineNumber) { + collapseRanges.push({ + startLineNumber: selection.startLineNumber, + endLineNumber, + type: void 0, + isCollapsed: true, + source: 1 + /* FoldSource.userDefined */ + }); + editor2.setSelection({ + startLineNumber: selection.startLineNumber, + startColumn: 1, + endLineNumber: selection.startLineNumber, + endColumn: 1 + }); + } + } + if (collapseRanges.length > 0) { + collapseRanges.sort((a, b) => { + return a.startLineNumber - b.startLineNumber; + }); + const newRanges = FoldingRegions.sanitizeAndMerge(foldingModel.regions, collapseRanges, editor2.getModel()?.getLineCount()); + foldingModel.updatePost(FoldingRegions.fromFoldRanges(newRanges)); + } + } + } +}; +var RemoveFoldRangeFromSelectionAction = class extends FoldingAction { + constructor() { + super({ + id: "editor.removeManualFoldingRanges", + label: localize2(999, "Remove Manual Folding Ranges"), + precondition: CONTEXT_FOLDING_ENABLED, + kbOpts: { + kbExpr: EditorContextKeys.editorTextFocus, + primary: KeyChord( + 2048 | 41, + 2048 | 89 + /* KeyCode.Period */ + ), + weight: 100 + /* KeybindingWeight.EditorContrib */ + } + }); + } + invoke(foldingController, foldingModel, editor2) { + const selections = editor2.getSelections(); + if (selections) { + const ranges = []; + for (const selection of selections) { + const { startLineNumber, endLineNumber } = selection; + ranges.push(endLineNumber >= startLineNumber ? { startLineNumber, endLineNumber } : { endLineNumber, startLineNumber }); + } + foldingModel.removeManualRanges(ranges); + foldingController.triggerFoldingModelChanged(); + } + } +}; +var ToggleImportFoldAction = class extends FoldingAction { + constructor() { + super({ + id: "editor.toggleImportFold", + label: localize2(1e3, "Toggle Import Fold"), + precondition: CONTEXT_FOLDING_ENABLED, + kbOpts: { + kbExpr: EditorContextKeys.editorTextFocus, + weight: 100 + /* KeybindingWeight.EditorContrib */ + } + }); + } + async invoke(foldingController, foldingModel) { + const regionsToToggle = []; + const regions = foldingModel.regions; + for (let i2 = regions.length - 1; i2 >= 0; i2--) { + if (regions.getType(i2) === FoldingRangeKind.Imports.value) { + regionsToToggle.push(regions.toRegion(i2)); + } + } + foldingModel.toggleCollapseState(regionsToToggle); + foldingController.triggerFoldingModelChanged(); + } +}; +registerEditorContribution( + FoldingController.ID, + FoldingController, + 0 + /* EditorContributionInstantiation.Eager */ +); +registerEditorAction(UnfoldAction); +registerEditorAction(UnFoldRecursivelyAction); +registerEditorAction(FoldAction); +registerEditorAction(FoldRecursivelyAction); +registerEditorAction(ToggleFoldRecursivelyAction); +registerEditorAction(FoldAllAction); +registerEditorAction(UnfoldAllAction); +registerEditorAction(FoldAllBlockCommentsAction); +registerEditorAction(FoldAllRegionsAction); +registerEditorAction(UnfoldAllRegionsAction); +registerEditorAction(FoldAllExceptAction); +registerEditorAction(UnfoldAllExceptAction); +registerEditorAction(ToggleFoldAction); +registerEditorAction(GotoParentFoldAction); +registerEditorAction(GotoPreviousFoldAction); +registerEditorAction(GotoNextFoldAction); +registerEditorAction(FoldRangeFromSelectionAction); +registerEditorAction(RemoveFoldRangeFromSelectionAction); +registerEditorAction(ToggleImportFoldAction); +for (let i2 = 1; i2 <= 7; i2++) { + registerInstantiatedEditorAction(new FoldLevelAction({ + id: FoldLevelAction.ID(i2), + label: localize2(1001, "Fold Level {0}", i2), + precondition: CONTEXT_FOLDING_ENABLED, + kbOpts: { + kbExpr: EditorContextKeys.editorTextFocus, + primary: KeyChord(2048 | 41, 2048 | 21 + i2), + weight: 100 + /* KeybindingWeight.EditorContrib */ + } + })); +} +CommandsRegistry.registerCommand("_executeFoldingRangeProvider", async function(accessor, ...args) { + const [resource] = args; + if (!(resource instanceof URI)) { + throw illegalArgument(); + } + const languageFeaturesService = accessor.get(ILanguageFeaturesService); + const model = accessor.get(IModelService).getModel(resource); + if (!model) { + throw illegalArgument(); + } + const configurationService = accessor.get(IConfigurationService); + if (!configurationService.getValue("editor.folding", { resource })) { + return []; + } + const languageConfigurationService = accessor.get(ILanguageConfigurationService); + const strategy = configurationService.getValue("editor.foldingStrategy", { resource }); + const foldingLimitReporter = { + get limit() { + return configurationService.getValue("editor.foldingMaximumRegions", { resource }); + }, + update: (computed, limited) => { + } + }; + const indentRangeProvider = new IndentRangeProvider(model, languageConfigurationService, foldingLimitReporter); + let rangeProvider = indentRangeProvider; + if (strategy !== "indentation") { + const providers = FoldingController.getFoldingRangeProviders(languageFeaturesService, model); + if (providers.length) { + rangeProvider = new SyntaxRangeProvider(model, providers, () => { + }, foldingLimitReporter, indentRangeProvider); + } + } + const ranges = await rangeProvider.compute(CancellationToken.None); + const result = []; + try { + if (ranges) { + for (let i2 = 0; i2 < ranges.length; i2++) { + const type = ranges.getType(i2); + result.push({ start: ranges.getStartLineNumber(i2), end: ranges.getEndLineNumber(i2), kind: type ? FoldingRangeKind.fromValue(type) : void 0 }); + } + } + return result; + } finally { + rangeProvider.dispose(); + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/fontZoom/browser/fontZoom.js +init_editorExtensions(); +init_nls(); +var EditorFontZoomIn = class extends EditorAction { + constructor() { + super({ + id: "editor.action.fontZoomIn", + label: localize2(1011, "Increase Editor Font Size"), + precondition: void 0 + }); + } + run(accessor, editor2) { + EditorZoom.setZoomLevel(EditorZoom.getZoomLevel() + 1); + } +}; +var EditorFontZoomOut = class extends EditorAction { + constructor() { + super({ + id: "editor.action.fontZoomOut", + label: localize2(1012, "Decrease Editor Font Size"), + precondition: void 0 + }); + } + run(accessor, editor2) { + EditorZoom.setZoomLevel(EditorZoom.getZoomLevel() - 1); + } +}; +var EditorFontZoomReset = class extends EditorAction { + constructor() { + super({ + id: "editor.action.fontZoomReset", + label: localize2(1013, "Reset Editor Font Size"), + precondition: void 0 + }); + } + run(accessor, editor2) { + EditorZoom.setZoomLevel(0); + } +}; +registerEditorAction(EditorFontZoomIn); +registerEditorAction(EditorFontZoomOut); +registerEditorAction(EditorFontZoomReset); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/format/browser/formatActions.js +init_arrays(); +init_cancellation(); +init_errors(); +init_keyCodes(); +init_lifecycle(); +init_editorExtensions(); +init_codeEditorService(); +init_characterClassifier(); +init_range(); +init_editorContextKeys(); +init_editorWorker(); +init_languageFeatures(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/format/browser/format.js +init_arrays(); +init_cancellation(); +init_errors(); +init_iterator(); +init_linkedList(); +init_types(); +init_uri(); +init_editorState(); +init_position(); +init_range(); +init_selection(); +init_editorWorker(); +init_resolverService(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/format/browser/formattingEdit.js +init_range(); +var FormattingEdit = class _FormattingEdit { + static _handleEolEdits(editor2, edits) { + let newEol = void 0; + const singleEdits = []; + for (const edit2 of edits) { + if (typeof edit2.eol === "number") { + newEol = edit2.eol; + } + if (edit2.range && typeof edit2.text === "string") { + singleEdits.push(edit2); + } + } + if (typeof newEol === "number") { + if (editor2.hasModel()) { + editor2.getModel().pushEOL(newEol); + } + } + return singleEdits; + } + static _isFullModelReplaceEdit(editor2, edit2) { + if (!editor2.hasModel()) { + return false; + } + const model = editor2.getModel(); + const editRange = model.validateRange(edit2.range); + const fullModelRange = model.getFullModelRange(); + return fullModelRange.equalsRange(editRange); + } + static execute(editor2, _edits, addUndoStops) { + if (addUndoStops) { + editor2.pushUndoStop(); + } + const scrollState = StableEditorScrollState.capture(editor2); + const edits = _FormattingEdit._handleEolEdits(editor2, _edits); + if (edits.length === 1 && _FormattingEdit._isFullModelReplaceEdit(editor2, edits[0])) { + editor2.executeEdits("formatEditsCommand", edits.map((edit2) => EditOperation.replace(Range.lift(edit2.range), edit2.text))); + } else { + editor2.executeEdits("formatEditsCommand", edits.map((edit2) => EditOperation.replaceMove(Range.lift(edit2.range), edit2.text))); + } + if (addUndoStops) { + editor2.pushUndoStop(); + } + scrollState.restoreRelativeVerticalPositionOfCursor(editor2); + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/format/browser/format.js +init_commands(); + +// node_modules/monaco-editor-core/esm/vs/platform/extensions/common/extensions.js +var ExtensionIdentifier = class { + constructor(value) { + this.value = value; + this._lower = value.toLowerCase(); + } + /** + * Gives the value by which to index (for equality). + */ + static toKey(id) { + if (typeof id === "string") { + return id.toLowerCase(); + } + return id._lower; + } +}; +var ExtensionIdentifierSet = class { + constructor(iterable) { + this._set = /* @__PURE__ */ new Set(); + if (iterable) { + for (const value of iterable) { + this.add(value); + } + } + } + add(id) { + this._set.add(ExtensionIdentifier.toKey(id)); + } + has(id) { + return this._set.has(ExtensionIdentifier.toKey(id)); + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/format/browser/format.js +init_instantiation(); +init_languageFeatures(); +init_log(); +function getRealAndSyntheticDocumentFormattersOrdered(documentFormattingEditProvider, documentRangeFormattingEditProvider, model) { + const result = []; + const seen = new ExtensionIdentifierSet(); + const docFormatter = documentFormattingEditProvider.ordered(model); + for (const formatter of docFormatter) { + result.push(formatter); + if (formatter.extensionId) { + seen.add(formatter.extensionId); + } + } + const rangeFormatter = documentRangeFormattingEditProvider.ordered(model); + for (const formatter of rangeFormatter) { + if (formatter.extensionId) { + if (seen.has(formatter.extensionId)) { + continue; + } + seen.add(formatter.extensionId); + } + result.push({ + displayName: formatter.displayName, + extensionId: formatter.extensionId, + provideDocumentFormattingEdits(model2, options2, token) { + return formatter.provideDocumentRangeFormattingEdits(model2, model2.getFullModelRange(), options2, token); + } + }); + } + return result; +} +var FormattingConflicts = class _FormattingConflicts { + static { + this._selectors = new LinkedList(); + } + static setFormatterSelector(selector) { + const remove = _FormattingConflicts._selectors.unshift(selector); + return { dispose: remove }; + } + static async select(formatter, document2, mode, kind) { + if (formatter.length === 0) { + return void 0; + } + const selector = Iterable.first(_FormattingConflicts._selectors); + if (selector) { + return await selector(formatter, document2, mode, kind); + } + return void 0; + } +}; +async function formatDocumentRangesWithSelectedProvider(accessor, editorOrModel, rangeOrRanges, mode, progress, token, userGesture) { + const instaService = accessor.get(IInstantiationService); + const { documentRangeFormattingEditProvider: documentRangeFormattingEditProviderRegistry } = accessor.get(ILanguageFeaturesService); + const model = isCodeEditor(editorOrModel) ? editorOrModel.getModel() : editorOrModel; + const provider = documentRangeFormattingEditProviderRegistry.ordered(model); + const selected = await FormattingConflicts.select( + provider, + model, + mode, + 2 + /* FormattingKind.Selection */ + ); + if (selected) { + progress.report(selected); + await instaService.invokeFunction(formatDocumentRangesWithProvider, selected, editorOrModel, rangeOrRanges, token, userGesture); + } +} +async function formatDocumentRangesWithProvider(accessor, provider, editorOrModel, rangeOrRanges, token, userGesture) { + const workerService = accessor.get(IEditorWorkerService); + const logService = accessor.get(ILogService); + const accessibilitySignalService = accessor.get(IAccessibilitySignalService); + let model; + let cts; + if (isCodeEditor(editorOrModel)) { + model = editorOrModel.getModel(); + cts = new EditorStateCancellationTokenSource(editorOrModel, 1 | 4, void 0, token); + } else { + model = editorOrModel; + cts = new TextModelCancellationTokenSource(editorOrModel, token); + } + const ranges = []; + let len = 0; + for (const range2 of asArray(rangeOrRanges).sort(Range.compareRangesUsingStarts)) { + if (len > 0 && Range.areIntersectingOrTouching(ranges[len - 1], range2)) { + ranges[len - 1] = Range.fromPositions(ranges[len - 1].getStartPosition(), range2.getEndPosition()); + } else { + len = ranges.push(range2); + } + } + const computeEdits = async (range2) => { + logService.trace(`[format][provideDocumentRangeFormattingEdits] (request)`, provider.extensionId?.value, range2); + const result = await provider.provideDocumentRangeFormattingEdits(model, range2, model.getFormattingOptions(), cts.token) || []; + logService.trace(`[format][provideDocumentRangeFormattingEdits] (response)`, provider.extensionId?.value, result); + return result; + }; + const hasIntersectingEdit = (a, b) => { + if (!a.length || !b.length) { + return false; + } + const mergedA = a.reduce((acc, val) => { + return Range.plusRange(acc, val.range); + }, a[0].range); + if (!b.some((x) => { + return Range.intersectRanges(mergedA, x.range); + })) { + return false; + } + for (const edit2 of a) { + for (const otherEdit of b) { + if (Range.intersectRanges(edit2.range, otherEdit.range)) { + return true; + } + } + } + return false; + }; + const allEdits = []; + const rawEditsList = []; + try { + if (typeof provider.provideDocumentRangesFormattingEdits === "function") { + logService.trace(`[format][provideDocumentRangeFormattingEdits] (request)`, provider.extensionId?.value, ranges); + const result = await provider.provideDocumentRangesFormattingEdits(model, ranges, model.getFormattingOptions(), cts.token) || []; + logService.trace(`[format][provideDocumentRangeFormattingEdits] (response)`, provider.extensionId?.value, result); + rawEditsList.push(result); + } else { + for (const range2 of ranges) { + if (cts.token.isCancellationRequested) { + return true; + } + rawEditsList.push(await computeEdits(range2)); + } + for (let i2 = 0; i2 < ranges.length; ++i2) { + for (let j = i2 + 1; j < ranges.length; ++j) { + if (cts.token.isCancellationRequested) { + return true; + } + if (hasIntersectingEdit(rawEditsList[i2], rawEditsList[j])) { + const mergedRange = Range.plusRange(ranges[i2], ranges[j]); + const edits = await computeEdits(mergedRange); + ranges.splice(j, 1); + ranges.splice(i2, 1); + ranges.push(mergedRange); + rawEditsList.splice(j, 1); + rawEditsList.splice(i2, 1); + rawEditsList.push(edits); + i2 = 0; + j = 0; + } + } + } + } + for (const rawEdits of rawEditsList) { + if (cts.token.isCancellationRequested) { + return true; + } + const minimalEdits = await workerService.computeMoreMinimalEdits(model.uri, rawEdits); + if (minimalEdits) { + allEdits.push(...minimalEdits); + } + } + if (cts.token.isCancellationRequested) { + return true; + } + } finally { + cts.dispose(); + } + if (allEdits.length === 0) { + return false; + } + if (isCodeEditor(editorOrModel)) { + FormattingEdit.execute(editorOrModel, allEdits, true); + editorOrModel.revealPositionInCenterIfOutsideViewport( + editorOrModel.getPosition(), + 1 + /* ScrollType.Immediate */ + ); + } else { + const [{ range: range2 }] = allEdits; + const initialSelection = new Selection(range2.startLineNumber, range2.startColumn, range2.endLineNumber, range2.endColumn); + model.pushEditOperations([initialSelection], allEdits.map((edit2) => { + return { + text: edit2.text, + range: Range.lift(edit2.range), + forceMoveMarkers: true + }; + }), (undoEdits) => { + for (const { range: range3 } of undoEdits) { + if (Range.areIntersectingOrTouching(range3, initialSelection)) { + return [new Selection(range3.startLineNumber, range3.startColumn, range3.endLineNumber, range3.endColumn)]; + } + } + return null; + }); + } + accessibilitySignalService.playSignal(AccessibilitySignal.format, { userGesture }); + return true; +} +async function formatDocumentWithSelectedProvider(accessor, editorOrModel, mode, progress, token, userGesture) { + const instaService = accessor.get(IInstantiationService); + const languageFeaturesService = accessor.get(ILanguageFeaturesService); + const model = isCodeEditor(editorOrModel) ? editorOrModel.getModel() : editorOrModel; + const provider = getRealAndSyntheticDocumentFormattersOrdered(languageFeaturesService.documentFormattingEditProvider, languageFeaturesService.documentRangeFormattingEditProvider, model); + const selected = await FormattingConflicts.select( + provider, + model, + mode, + 1 + /* FormattingKind.File */ + ); + if (selected) { + progress.report(selected); + await instaService.invokeFunction(formatDocumentWithProvider, selected, editorOrModel, mode, token, userGesture); + } +} +async function formatDocumentWithProvider(accessor, provider, editorOrModel, mode, token, userGesture) { + const workerService = accessor.get(IEditorWorkerService); + const accessibilitySignalService = accessor.get(IAccessibilitySignalService); + let model; + let cts; + if (isCodeEditor(editorOrModel)) { + model = editorOrModel.getModel(); + cts = new EditorStateCancellationTokenSource(editorOrModel, 1 | 4, void 0, token); + } else { + model = editorOrModel; + cts = new TextModelCancellationTokenSource(editorOrModel, token); + } + let edits; + try { + const rawEdits = await provider.provideDocumentFormattingEdits(model, model.getFormattingOptions(), cts.token); + edits = await workerService.computeMoreMinimalEdits(model.uri, rawEdits); + if (cts.token.isCancellationRequested) { + return true; + } + } finally { + cts.dispose(); + } + if (!edits || edits.length === 0) { + return false; + } + if (isCodeEditor(editorOrModel)) { + FormattingEdit.execute( + editorOrModel, + edits, + mode !== 2 + /* FormattingMode.Silent */ + ); + if (mode !== 2) { + editorOrModel.revealPositionInCenterIfOutsideViewport( + editorOrModel.getPosition(), + 1 + /* ScrollType.Immediate */ + ); + } + } else { + const [{ range: range2 }] = edits; + const initialSelection = new Selection(range2.startLineNumber, range2.startColumn, range2.endLineNumber, range2.endColumn); + model.pushEditOperations([initialSelection], edits.map((edit2) => { + return { + text: edit2.text, + range: Range.lift(edit2.range), + forceMoveMarkers: true + }; + }), (undoEdits) => { + for (const { range: range3 } of undoEdits) { + if (Range.areIntersectingOrTouching(range3, initialSelection)) { + return [new Selection(range3.startLineNumber, range3.startColumn, range3.endLineNumber, range3.endColumn)]; + } + } + return null; + }); + } + accessibilitySignalService.playSignal(AccessibilitySignal.format, { userGesture }); + return true; +} +async function getDocumentRangeFormattingEditsUntilResult(workerService, languageFeaturesService, model, range2, options2, token) { + const providers = languageFeaturesService.documentRangeFormattingEditProvider.ordered(model); + for (const provider of providers) { + const rawEdits = await Promise.resolve(provider.provideDocumentRangeFormattingEdits(model, range2, options2, token)).catch(onUnexpectedExternalError); + if (isNonEmptyArray(rawEdits)) { + return await workerService.computeMoreMinimalEdits(model.uri, rawEdits); + } + } + return void 0; +} +async function getDocumentFormattingEditsUntilResult(workerService, languageFeaturesService, model, options2, token) { + const providers = getRealAndSyntheticDocumentFormattersOrdered(languageFeaturesService.documentFormattingEditProvider, languageFeaturesService.documentRangeFormattingEditProvider, model); + for (const provider of providers) { + const rawEdits = await Promise.resolve(provider.provideDocumentFormattingEdits(model, options2, token)).catch(onUnexpectedExternalError); + if (isNonEmptyArray(rawEdits)) { + return await workerService.computeMoreMinimalEdits(model.uri, rawEdits); + } + } + return void 0; +} +function getOnTypeFormattingEdits(workerService, languageFeaturesService, model, position, ch, options2, token) { + const providers = languageFeaturesService.onTypeFormattingEditProvider.ordered(model); + if (providers.length === 0) { + return Promise.resolve(void 0); + } + if (providers[0].autoFormatTriggerCharacters.indexOf(ch) < 0) { + return Promise.resolve(void 0); + } + return Promise.resolve(providers[0].provideOnTypeFormattingEdits(model, position, ch, options2, token)).catch(onUnexpectedExternalError).then((edits) => { + return workerService.computeMoreMinimalEdits(model.uri, edits); + }); +} +CommandsRegistry.registerCommand("_executeFormatRangeProvider", async function(accessor, ...args) { + const [resource, range2, options2] = args; + assertType(URI.isUri(resource)); + assertType(Range.isIRange(range2)); + const resolverService = accessor.get(ITextModelService); + const workerService = accessor.get(IEditorWorkerService); + const languageFeaturesService = accessor.get(ILanguageFeaturesService); + const reference = await resolverService.createModelReference(resource); + try { + return getDocumentRangeFormattingEditsUntilResult(workerService, languageFeaturesService, reference.object.textEditorModel, Range.lift(range2), options2, CancellationToken.None); + } finally { + reference.dispose(); + } +}); +CommandsRegistry.registerCommand("_executeFormatDocumentProvider", async function(accessor, ...args) { + const [resource, options2] = args; + assertType(URI.isUri(resource)); + const resolverService = accessor.get(ITextModelService); + const workerService = accessor.get(IEditorWorkerService); + const languageFeaturesService = accessor.get(ILanguageFeaturesService); + const reference = await resolverService.createModelReference(resource); + try { + return getDocumentFormattingEditsUntilResult(workerService, languageFeaturesService, reference.object.textEditorModel, options2, CancellationToken.None); + } finally { + reference.dispose(); + } +}); +CommandsRegistry.registerCommand("_executeFormatOnTypeProvider", async function(accessor, ...args) { + const [resource, position, ch, options2] = args; + assertType(URI.isUri(resource)); + assertType(Position.isIPosition(position)); + assertType(typeof ch === "string"); + const resolverService = accessor.get(ITextModelService); + const workerService = accessor.get(IEditorWorkerService); + const languageFeaturesService = accessor.get(ILanguageFeaturesService); + const reference = await resolverService.createModelReference(resource); + try { + return getOnTypeFormattingEdits(workerService, languageFeaturesService, reference.object.textEditorModel, Position.lift(position), ch, options2, CancellationToken.None); + } finally { + reference.dispose(); + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/format/browser/formatActions.js +init_nls(); +init_commands(); +init_contextkey(); +init_instantiation(); +var __decorate94 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param88 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var FormatOnType = class FormatOnType2 { + static { + this.ID = "editor.contrib.autoFormat"; + } + constructor(_editor, _languageFeaturesService, _workerService, _accessibilitySignalService) { + this._editor = _editor; + this._languageFeaturesService = _languageFeaturesService; + this._workerService = _workerService; + this._accessibilitySignalService = _accessibilitySignalService; + this._disposables = new DisposableStore(); + this._sessionDisposables = new DisposableStore(); + this._disposables.add(_languageFeaturesService.onTypeFormattingEditProvider.onDidChange(this._update, this)); + this._disposables.add(_editor.onDidChangeModel(() => this._update())); + this._disposables.add(_editor.onDidChangeModelLanguage(() => this._update())); + this._disposables.add(_editor.onDidChangeConfiguration((e) => { + if (e.hasChanged( + 65 + /* EditorOption.formatOnType */ + )) { + this._update(); + } + })); + this._update(); + } + dispose() { + this._disposables.dispose(); + this._sessionDisposables.dispose(); + } + _update() { + this._sessionDisposables.clear(); + if (!this._editor.getOption( + 65 + /* EditorOption.formatOnType */ + )) { + return; + } + if (!this._editor.hasModel()) { + return; + } + const model = this._editor.getModel(); + const [support] = this._languageFeaturesService.onTypeFormattingEditProvider.ordered(model); + if (!support || !support.autoFormatTriggerCharacters) { + return; + } + const triggerChars = new CharacterSet(); + for (const ch of support.autoFormatTriggerCharacters) { + triggerChars.add(ch.charCodeAt(0)); + } + this._sessionDisposables.add(this._editor.onDidType((text2) => { + const lastCharCode = text2.charCodeAt(text2.length - 1); + if (triggerChars.has(lastCharCode)) { + this._trigger(String.fromCharCode(lastCharCode)); + } + })); + } + _trigger(ch) { + if (!this._editor.hasModel()) { + return; + } + if (this._editor.getSelections().length > 1 || !this._editor.getSelection().isEmpty()) { + return; + } + const model = this._editor.getModel(); + const position = this._editor.getPosition(); + const cts = new CancellationTokenSource(); + const unbind = this._editor.onDidChangeModelContent((e) => { + if (e.isFlush) { + cts.cancel(); + unbind.dispose(); + return; + } + for (let i2 = 0, len = e.changes.length; i2 < len; i2++) { + const change = e.changes[i2]; + if (change.range.endLineNumber <= position.lineNumber) { + cts.cancel(); + unbind.dispose(); + return; + } + } + }); + getOnTypeFormattingEdits(this._workerService, this._languageFeaturesService, model, position, ch, model.getFormattingOptions(), cts.token).then((edits) => { + if (cts.token.isCancellationRequested) { + return; + } + if (isNonEmptyArray(edits)) { + this._accessibilitySignalService.playSignal(AccessibilitySignal.format, { userGesture: false }); + FormattingEdit.execute(this._editor, edits, true); + } + }).finally(() => { + unbind.dispose(); + }); + } +}; +FormatOnType = __decorate94([ + __param88(1, ILanguageFeaturesService), + __param88(2, IEditorWorkerService), + __param88(3, IAccessibilitySignalService) +], FormatOnType); +var FormatOnPaste = class FormatOnPaste2 { + static { + this.ID = "editor.contrib.formatOnPaste"; + } + constructor(editor2, _languageFeaturesService, _instantiationService) { + this.editor = editor2; + this._languageFeaturesService = _languageFeaturesService; + this._instantiationService = _instantiationService; + this._callOnDispose = new DisposableStore(); + this._callOnModel = new DisposableStore(); + this._callOnDispose.add(editor2.onDidChangeConfiguration(() => this._update())); + this._callOnDispose.add(editor2.onDidChangeModel(() => this._update())); + this._callOnDispose.add(editor2.onDidChangeModelLanguage(() => this._update())); + this._callOnDispose.add(_languageFeaturesService.documentRangeFormattingEditProvider.onDidChange(this._update, this)); + } + dispose() { + this._callOnDispose.dispose(); + this._callOnModel.dispose(); + } + _update() { + this._callOnModel.clear(); + if (!this.editor.getOption( + 64 + /* EditorOption.formatOnPaste */ + )) { + return; + } + if (!this.editor.hasModel()) { + return; + } + if (!this._languageFeaturesService.documentRangeFormattingEditProvider.has(this.editor.getModel())) { + return; + } + this._callOnModel.add(this.editor.onDidPaste(({ range: range2 }) => this._trigger(range2))); + } + _trigger(range2) { + if (!this.editor.hasModel()) { + return; + } + if (this.editor.getSelections().length > 1) { + return; + } + this._instantiationService.invokeFunction(formatDocumentRangesWithSelectedProvider, this.editor, range2, 2, Progress.None, CancellationToken.None, false).catch(onUnexpectedError); + } +}; +FormatOnPaste = __decorate94([ + __param88(1, ILanguageFeaturesService), + __param88(2, IInstantiationService) +], FormatOnPaste); +var FormatDocumentAction = class extends EditorAction { + constructor() { + super({ + id: "editor.action.formatDocument", + label: localize2(1014, "Format Document"), + precondition: ContextKeyExpr.and(EditorContextKeys.notInCompositeEditor, EditorContextKeys.writable, EditorContextKeys.hasDocumentFormattingProvider), + kbOpts: { + kbExpr: EditorContextKeys.editorTextFocus, + primary: 1024 | 512 | 36, + linux: { + primary: 2048 | 1024 | 39 + /* KeyCode.KeyI */ + }, + weight: 100 + /* KeybindingWeight.EditorContrib */ + }, + contextMenuOpts: { + group: "1_modification", + order: 1.3 + } + }); + } + async run(accessor, editor2) { + if (editor2.hasModel()) { + const instaService = accessor.get(IInstantiationService); + const progressService = accessor.get(IEditorProgressService); + await progressService.showWhile(instaService.invokeFunction(formatDocumentWithSelectedProvider, editor2, 1, Progress.None, CancellationToken.None, true), 250); + } + } +}; +var FormatSelectionAction = class extends EditorAction { + constructor() { + super({ + id: "editor.action.formatSelection", + label: localize2(1015, "Format Selection"), + precondition: ContextKeyExpr.and(EditorContextKeys.writable, EditorContextKeys.hasDocumentSelectionFormattingProvider), + kbOpts: { + kbExpr: EditorContextKeys.editorTextFocus, + primary: KeyChord( + 2048 | 41, + 2048 | 36 + /* KeyCode.KeyF */ + ), + weight: 100 + /* KeybindingWeight.EditorContrib */ + }, + contextMenuOpts: { + when: EditorContextKeys.hasNonEmptySelection, + group: "1_modification", + order: 1.31 + } + }); + } + async run(accessor, editor2) { + if (!editor2.hasModel()) { + return; + } + const instaService = accessor.get(IInstantiationService); + const model = editor2.getModel(); + const ranges = editor2.getSelections().map((range2) => { + return range2.isEmpty() ? new Range(range2.startLineNumber, 1, range2.startLineNumber, model.getLineMaxColumn(range2.startLineNumber)) : range2; + }); + const progressService = accessor.get(IEditorProgressService); + await progressService.showWhile(instaService.invokeFunction(formatDocumentRangesWithSelectedProvider, editor2, ranges, 1, Progress.None, CancellationToken.None, true), 250); + } +}; +registerEditorContribution( + FormatOnType.ID, + FormatOnType, + 2 + /* EditorContributionInstantiation.BeforeFirstInteraction */ +); +registerEditorContribution( + FormatOnPaste.ID, + FormatOnPaste, + 2 + /* EditorContributionInstantiation.BeforeFirstInteraction */ +); +registerEditorAction(FormatDocumentAction); +registerEditorAction(FormatSelectionAction); +CommandsRegistry.registerCommand("editor.action.format", async (accessor) => { + const editor2 = accessor.get(ICodeEditorService).getFocusedCodeEditor(); + if (!editor2 || !editor2.hasModel()) { + return; + } + const commandService = accessor.get(ICommandService); + if (editor2.getSelection().isEmpty()) { + await commandService.executeCommand("editor.action.formatDocument"); + } else { + await commandService.executeCommand("editor.action.formatSelection"); + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/documentSymbols/browser/documentSymbols.js +init_cancellation(); +init_types(); +init_uri(); +init_resolverService(); +init_outlineModel(); +init_commands(); +CommandsRegistry.registerCommand("_executeDocumentSymbolProvider", async function(accessor, ...args) { + const [resource] = args; + assertType(URI.isUri(resource)); + const outlineService = accessor.get(IOutlineModelService); + const modelService = accessor.get(ITextModelService); + const reference = await modelService.createModelReference(resource); + try { + return (await outlineService.getOrCreate(reference.object.textEditorModel, CancellationToken.None)).getTopLevelSymbols(); + } finally { + reference.dispose(); + } +}); + +// node_modules/monaco-editor-core/esm/vs/platform/accessibility/browser/accessibleViewRegistry.js +var AccessibleViewRegistry = new class AccessibleViewRegistry2 { + constructor() { + this._implementations = []; + } + register(implementation) { + this._implementations.push(implementation); + return { + dispose: () => { + const idx = this._implementations.indexOf(implementation); + if (idx !== -1) { + this._implementations.splice(idx, 1); + } + } + }; + } + getImplementations() { + return this._implementations; + } +}(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/inlineCompletions/browser/inlineCompletions.contribution.js +init_actions2(); + +// node_modules/monaco-editor-core/esm/vs/platform/observable/common/wrapInHotClass.js +init_observable(); +init_instantiation(); +var __decorate96 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param90 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +function hotClassGetOriginalInstance(value) { + if (value instanceof BaseClass) { + return value._instance; + } + return value; +} +var BaseClass = class { + constructor(instantiationService) { + this.instantiationService = instantiationService; + } + init(...params) { + } +}; +function createWrapper(clazz, B) { + return class ReloadableWrapper extends B { + constructor() { + super(...arguments); + this._autorun = void 0; + } + init(...params) { + this._autorun = autorunWithStore((reader, store) => { + const clazz_ = clazz.read(reader); + this._instance = store.add(this.instantiationService.createInstance(clazz_, ...params)); + }); + } + dispose() { + this._autorun?.dispose(); + } + }; +} +function wrapInHotClass1(clazz) { + return !isHotReloadEnabled() ? clazz.get() : createWrapper(clazz, BaseClass1); +} +var BaseClass1 = class BaseClass12 extends BaseClass { + constructor(param1, i2) { + super(i2); + this.init(param1); + } +}; +BaseClass1 = __decorate96([ + __param90(1, IInstantiationService) +], BaseClass1); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/inlineCompletions/browser/inlineCompletions.contribution.js +init_editorExtensions(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/inlineCompletions/browser/controller/commands.js +init_observable(); +init_strings(); + +// node_modules/monaco-editor-core/esm/vs/base/common/validation.js +init_arrays(); +var ValidatorBase = class { + validateOrThrow(content) { + const result = this.validate(content); + if (result.error) { + throw new Error(result.error.message); + } + return result.content; + } +}; +var TypeofValidator = class extends ValidatorBase { + constructor(type) { + super(); + this.type = type; + } + validate(content) { + if (typeof content !== this.type) { + return { content: void 0, error: { message: `Expected ${this.type}, but got ${typeof content}` } }; + } + return { content, error: void 0 }; + } + getJSONSchema() { + return { type: this.type }; + } +}; +var vStringValidator = new TypeofValidator("string"); +function vString() { + return vStringValidator; +} +var vNumberValidator = new TypeofValidator("number"); +var vBooleanValidator = new TypeofValidator("boolean"); +function vBoolean() { + return vBooleanValidator; +} +var vObjAnyValidator = new TypeofValidator("object"); +var UndefinedValidator = class extends ValidatorBase { + validate(content) { + if (content !== void 0) { + return { content: void 0, error: { message: `Expected undefined, but got ${typeof content}` } }; + } + return { content: void 0, error: void 0 }; + } + getJSONSchema() { + return {}; + } +}; +function vUndefined() { + return new UndefinedValidator(); +} +var Optional = class { + constructor(validator) { + this.validator = validator; + } +}; +function vOptionalProp(validator) { + return new Optional(validator); +} +var ObjValidator = class extends ValidatorBase { + constructor(properties) { + super(); + this.properties = properties; + } + validate(content) { + if (typeof content !== "object" || content === null) { + return { content: void 0, error: { message: "Expected object" } }; + } + const result = {}; + for (const key in this.properties) { + const prop = this.properties[key]; + const fieldValue = content[key]; + const isOptional = prop instanceof Optional; + const validator = isOptional ? prop.validator : prop; + if (isOptional && fieldValue === void 0) { + continue; + } + const { content: value, error } = validator.validate(fieldValue); + if (error) { + return { content: void 0, error: { message: `Error in property '${key}': ${error.message}` } }; + } + result[key] = value; + } + return { content: result, error: void 0 }; + } + getJSONSchema() { + const requiredFields = []; + const schemaProperties = {}; + for (const [key, prop] of Object.entries(this.properties)) { + const isOptional = prop instanceof Optional; + const validator = isOptional ? prop.validator : prop; + schemaProperties[key] = validator.getJSONSchema(); + if (!isOptional) { + requiredFields.push(key); + } + } + const schema = { + type: "object", + properties: schemaProperties, + ...requiredFields.length > 0 ? { required: requiredFields } : {} + }; + return schema; + } +}; +function vObj(properties) { + return new ObjValidator(properties); +} +var UnionValidator = class extends ValidatorBase { + constructor(validators) { + super(); + this.validators = validators; + } + validate(content) { + let lastError; + for (const validator of this.validators) { + const { content: value, error } = validator.validate(content); + if (!error) { + return { content: value, error: void 0 }; + } + lastError = error; + } + return { content: void 0, error: lastError }; + } + getJSONSchema() { + return { + oneOf: mapFilter(this.validators, (validator) => { + if (validator instanceof UndefinedValidator) { + return void 0; + } + return validator.getJSONSchema(); + }) + }; + } +}; +function vUnion(...validators) { + return new UnionValidator(validators); +} +var UseRefSchemaValidator = class extends ValidatorBase { + constructor(_ref, _validator) { + super(); + this._ref = _ref; + this._validator = _validator; + } + validate(content) { + return this._validator.validate(content); + } + getJSONSchema() { + return { $ref: this._ref }; + } +}; +function vWithJsonSchemaRef(ref, validator) { + return new UseRefSchemaValidator(ref, validator); +} + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/inlineCompletions/browser/controller/commands.js +init_nls(); +init_actions2(); +init_configuration(); +init_contextkey(); +init_keybindingsRegistry(); +init_editorExtensions(); +init_editorContextKeys(); +init_languageFeatures(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/suggest/browser/suggest.js +init_cancellation(); +init_errors(); +init_filters(); +init_lifecycle(); +init_stopwatch(); +init_types(); +init_uri(); +init_position(); +init_range(); +init_resolverService(); +init_nls(); +init_actions2(); +init_commands(); +init_contextkey(); +init_languageFeatures(); +var Context = { + Visible: historyNavigationVisible, + HasFocusedSuggestion: new RawContextKey("suggestWidgetHasFocusedSuggestion", false, localize(1455, "Whether any suggestion is focused")), + DetailsVisible: new RawContextKey("suggestWidgetDetailsVisible", false, localize(1456, "Whether suggestion details are visible")), + MultipleSuggestions: new RawContextKey("suggestWidgetMultipleSuggestions", false, localize(1457, "Whether there are multiple suggestions to pick from")), + MakesTextEdit: new RawContextKey("suggestionMakesTextEdit", true, localize(1458, "Whether inserting the current suggestion yields in a change or has everything already been typed")), + AcceptSuggestionsOnEnter: new RawContextKey("acceptSuggestionOnEnter", true, localize(1459, "Whether suggestions are inserted when pressing Enter")), + HasInsertAndReplaceRange: new RawContextKey("suggestionHasInsertAndReplaceRange", false, localize(1460, "Whether the current suggestion has insert and replace behaviour")), + InsertMode: new RawContextKey("suggestionInsertMode", void 0, { type: "string", description: localize(1461, "Whether the default behaviour is to insert or replace") }), + CanResolve: new RawContextKey("suggestionCanResolve", false, localize(1462, "Whether the current suggestion supports to resolve further details")) +}; +var suggestWidgetStatusbarMenu = new MenuId("suggestWidgetStatusBar"); +var CompletionItem = class { + constructor(position, completion, container, provider) { + this.position = position; + this.completion = completion; + this.container = container; + this.provider = provider; + this.isInvalid = false; + this.score = FuzzyScore.Default; + this.distance = 0; + this.textLabel = typeof completion.label === "string" ? completion.label : completion.label?.label; + this.labelLow = this.textLabel.toLowerCase(); + this.isInvalid = !this.textLabel; + this.sortTextLow = completion.sortText && completion.sortText.toLowerCase(); + this.filterTextLow = completion.filterText && completion.filterText.toLowerCase(); + this.extensionId = completion.extensionId; + if (Range.isIRange(completion.range)) { + this.editStart = new Position(completion.range.startLineNumber, completion.range.startColumn); + this.editInsertEnd = new Position(completion.range.endLineNumber, completion.range.endColumn); + this.editReplaceEnd = new Position(completion.range.endLineNumber, completion.range.endColumn); + this.isInvalid = this.isInvalid || Range.spansMultipleLines(completion.range) || completion.range.startLineNumber !== position.lineNumber; + } else { + this.editStart = new Position(completion.range.insert.startLineNumber, completion.range.insert.startColumn); + this.editInsertEnd = new Position(completion.range.insert.endLineNumber, completion.range.insert.endColumn); + this.editReplaceEnd = new Position(completion.range.replace.endLineNumber, completion.range.replace.endColumn); + this.isInvalid = this.isInvalid || Range.spansMultipleLines(completion.range.insert) || Range.spansMultipleLines(completion.range.replace) || completion.range.insert.startLineNumber !== position.lineNumber || completion.range.replace.startLineNumber !== position.lineNumber || completion.range.insert.startColumn !== completion.range.replace.startColumn; + } + if (typeof provider.resolveCompletionItem !== "function") { + this._resolveCache = Promise.resolve(); + this._resolveDuration = 0; + } + } + // ---- resolving + get isResolved() { + return this._resolveDuration !== void 0; + } + get resolveDuration() { + return this._resolveDuration !== void 0 ? this._resolveDuration : -1; + } + async resolve(token) { + if (!this._resolveCache) { + const sub = token.onCancellationRequested(() => { + this._resolveCache = void 0; + this._resolveDuration = void 0; + }); + const sw = new StopWatch(true); + this._resolveCache = Promise.resolve(this.provider.resolveCompletionItem(this.completion, token)).then((value) => { + Object.assign(this.completion, value); + this._resolveDuration = sw.elapsed(); + }, (err) => { + if (isCancellationError(err)) { + this._resolveCache = void 0; + this._resolveDuration = void 0; + } + }).finally(() => { + sub.dispose(); + }); + } + return this._resolveCache; + } +}; +var CompletionOptions = class _CompletionOptions { + static { + this.default = new _CompletionOptions(); + } + constructor(snippetSortOrder = 2, kindFilter = /* @__PURE__ */ new Set(), providerFilter = /* @__PURE__ */ new Set(), providerItemsToReuse = /* @__PURE__ */ new Map(), showDeprecated = true) { + this.snippetSortOrder = snippetSortOrder; + this.kindFilter = kindFilter; + this.providerFilter = providerFilter; + this.providerItemsToReuse = providerItemsToReuse; + this.showDeprecated = showDeprecated; + } +}; +var _snippetSuggestSupport; +function getSnippetSuggestSupport() { + return _snippetSuggestSupport; +} +var CompletionItemModel = class { + constructor(items, needsClipboard, durations, disposable) { + this.items = items; + this.needsClipboard = needsClipboard; + this.durations = durations; + this.disposable = disposable; + } +}; +async function provideSuggestionItems(registry, model, position, options2 = CompletionOptions.default, context = { + triggerKind: 0 + /* languages.CompletionTriggerKind.Invoke */ +}, token = CancellationToken.None) { + const sw = new StopWatch(); + position = position.clone(); + const word = model.getWordAtPosition(position); + const defaultReplaceRange = word ? new Range(position.lineNumber, word.startColumn, position.lineNumber, word.endColumn) : Range.fromPositions(position); + const defaultRange = { replace: defaultReplaceRange, insert: defaultReplaceRange.setEndPosition(position.lineNumber, position.column) }; + const result = []; + const disposables = new DisposableStore(); + const durations = []; + let needsClipboard = false; + const onCompletionList = (provider, container, sw2) => { + let didAddResult = false; + if (!container) { + return didAddResult; + } + for (const suggestion of container.suggestions) { + if (!options2.kindFilter.has(suggestion.kind)) { + if (!options2.showDeprecated && suggestion?.tags?.includes( + 1 + /* languages.CompletionItemTag.Deprecated */ + )) { + continue; + } + if (!suggestion.range) { + suggestion.range = defaultRange; + } + if (!suggestion.sortText) { + suggestion.sortText = typeof suggestion.label === "string" ? suggestion.label : suggestion.label.label; + } + if (!needsClipboard && suggestion.insertTextRules && suggestion.insertTextRules & 4) { + needsClipboard = SnippetParser.guessNeedsClipboard(suggestion.insertText); + } + result.push(new CompletionItem(position, suggestion, container, provider)); + didAddResult = true; + } + } + if (isDisposable(container)) { + disposables.add(container); + } + durations.push({ + providerName: provider._debugDisplayName ?? "unknown_provider", + elapsedProvider: container.duration ?? -1, + elapsedOverall: sw2.elapsed() + }); + return didAddResult; + }; + const snippetCompletions = (async () => { + if (!_snippetSuggestSupport || options2.kindFilter.has( + 28 + /* languages.CompletionItemKind.Snippet */ + )) { + return; + } + const reuseItems = options2.providerItemsToReuse.get(_snippetSuggestSupport); + if (reuseItems) { + reuseItems.forEach((item) => result.push(item)); + return; + } + if (options2.providerFilter.size > 0 && !options2.providerFilter.has(_snippetSuggestSupport)) { + return; + } + const sw2 = new StopWatch(); + const list2 = await _snippetSuggestSupport.provideCompletionItems(model, position, context, token); + onCompletionList(_snippetSuggestSupport, list2, sw2); + })(); + for (const providerGroup of registry.orderedGroups(model)) { + let didAddResult = false; + await Promise.all(providerGroup.map(async (provider) => { + if (options2.providerItemsToReuse.has(provider)) { + const items = options2.providerItemsToReuse.get(provider); + items.forEach((item) => result.push(item)); + didAddResult = didAddResult || items.length > 0; + return; + } + if (options2.providerFilter.size > 0 && !options2.providerFilter.has(provider)) { + return; + } + try { + const sw2 = new StopWatch(); + const list2 = await provider.provideCompletionItems(model, position, context, token); + didAddResult = onCompletionList(provider, list2, sw2) || didAddResult; + } catch (err) { + onUnexpectedExternalError(err); + } + })); + if (didAddResult || token.isCancellationRequested) { + break; + } + } + await snippetCompletions; + if (token.isCancellationRequested) { + disposables.dispose(); + return Promise.reject(new CancellationError()); + } + return new CompletionItemModel(result.sort(getSuggestionComparator(options2.snippetSortOrder)), needsClipboard, { entries: durations, elapsed: sw.elapsed() }, disposables); +} +function defaultComparator(a, b) { + if (a.sortTextLow && b.sortTextLow) { + if (a.sortTextLow < b.sortTextLow) { + return -1; + } else if (a.sortTextLow > b.sortTextLow) { + return 1; + } + } + if (a.textLabel < b.textLabel) { + return -1; + } else if (a.textLabel > b.textLabel) { + return 1; + } + return a.completion.kind - b.completion.kind; +} +function snippetUpComparator(a, b) { + if (a.completion.kind !== b.completion.kind) { + if (a.completion.kind === 28) { + return -1; + } else if (b.completion.kind === 28) { + return 1; + } + } + return defaultComparator(a, b); +} +function snippetDownComparator(a, b) { + if (a.completion.kind !== b.completion.kind) { + if (a.completion.kind === 28) { + return 1; + } else if (b.completion.kind === 28) { + return -1; + } + } + return defaultComparator(a, b); +} +var _snippetComparators = /* @__PURE__ */ new Map(); +_snippetComparators.set(0, snippetUpComparator); +_snippetComparators.set(2, snippetDownComparator); +_snippetComparators.set(1, defaultComparator); +function getSuggestionComparator(snippetConfig) { + return _snippetComparators.get(snippetConfig); +} +CommandsRegistry.registerCommand("_executeCompletionItemProvider", async (accessor, ...args) => { + const [uri, position, triggerCharacter, maxItemsToResolve] = args; + assertType(URI.isUri(uri)); + assertType(Position.isIPosition(position)); + assertType(typeof triggerCharacter === "string" || !triggerCharacter); + assertType(typeof maxItemsToResolve === "number" || !maxItemsToResolve); + const { completionProvider } = accessor.get(ILanguageFeaturesService); + const ref = await accessor.get(ITextModelService).createModelReference(uri); + try { + const result = { + incomplete: false, + suggestions: [] + }; + const resolving = []; + const actualPosition = ref.object.textEditorModel.validatePosition(position); + const completions = await provideSuggestionItems(completionProvider, ref.object.textEditorModel, actualPosition, void 0, { + triggerCharacter: triggerCharacter ?? void 0, + triggerKind: triggerCharacter ? 1 : 0 + /* languages.CompletionTriggerKind.Invoke */ + }); + for (const item of completions.items) { + if (resolving.length < (maxItemsToResolve ?? 0)) { + resolving.push(item.resolve(CancellationToken.None)); + } + result.incomplete = result.incomplete || item.container.incomplete; + result.suggestions.push(item.completion); + } + try { + await Promise.all(resolving); + return result; + } finally { + setTimeout(() => completions.disposable.dispose(), 100); + } + } finally { + ref.dispose(); + } +}); +function showSimpleSuggestions(editor2, provider) { + editor2.getContribution("editor.contrib.suggestController")?.triggerSuggest((/* @__PURE__ */ new Set()).add(provider), void 0, true); +} +var QuickSuggestionsOptions = class { + static isAllOff(config) { + return config.other === "off" && config.comments === "off" && config.strings === "off"; + } + static isAllOn(config) { + return config.other === "on" && config.comments === "on" && config.strings === "on"; + } + static valueFor(config, tokenType) { + switch (tokenType) { + case 1: + return config.comments; + case 2: + return config.strings; + default: + return config.other; + } + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionContextKeys.js +init_contextkey(); +init_nls(); +init_nls(); +var InlineCompletionContextKeys = class { + static { + this.inlineSuggestionVisible = new RawContextKey("inlineSuggestionVisible", false, localize(1192, "Whether an inline suggestion is visible")); + } + static { + this.inlineSuggestionHasIndentation = new RawContextKey("inlineSuggestionHasIndentation", false, localize(1193, "Whether the inline suggestion starts with whitespace")); + } + static { + this.inlineSuggestionHasIndentationLessThanTabSize = new RawContextKey("inlineSuggestionHasIndentationLessThanTabSize", true, localize(1194, "Whether the inline suggestion starts with whitespace that is less than what would be inserted by tab")); + } + static { + this.suppressSuggestions = new RawContextKey("inlineSuggestionSuppressSuggestions", void 0, localize(1195, "Whether suggestions should be suppressed for the current suggestion")); + } + static { + this.cursorBeforeGhostText = new RawContextKey("cursorBeforeGhostText", false, localize(1196, "Whether the cursor is at ghost text")); + } + static { + this.cursorInIndentation = new RawContextKey("cursorInIndentation", false, localize(1197, "Whether the cursor is in indentation")); + } + static { + this.hasSelection = new RawContextKey("editor.hasSelection", false, localize(1198, "Whether the editor has a selection")); + } + static { + this.cursorAtInlineEdit = new RawContextKey("cursorAtInlineEdit", false, localize(1199, "Whether the cursor is at an inline edit")); + } + static { + this.inlineEditVisible = new RawContextKey("inlineEditIsVisible", false, localize(1200, "Whether an inline edit is visible")); + } + static { + this.tabShouldJumpToInlineEdit = new RawContextKey("tabShouldJumpToInlineEdit", false, localize(1201, "Whether tab should jump to an inline edit.")); + } + static { + this.tabShouldAcceptInlineEdit = new RawContextKey("tabShouldAcceptInlineEdit", false, localize(1202, "Whether tab should accept the inline edit.")); + } + static { + this.inInlineEditsPreviewEditor = new RawContextKey("inInlineEditsPreviewEditor", true, localize(1203, "Whether the current code editor is showing an inline edits preview")); + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController.js +init_async(); +init_cancellation(); +init_lifecycle(); +init_observable(); +init_resources(); +init_types(); +init_nls(); +init_commands(); +init_configuration(); +init_contextkey(); +init_instantiation(); +init_observableCodeEditor(); +init_triggerInlineEditCommandsRegistry(); +init_position(); +init_languageFeatureDebounce(); +init_languageFeatures(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/linesOperations/browser/linesOperations.js +init_keyCodes(); +init_nls(); +init_actions2(); +init_configuration(); +init_editorExtensions(); + +// node_modules/monaco-editor-core/esm/vs/editor/common/commands/trimTrailingWhitespaceCommand.js +init_strings(); +init_range(); +var TrimTrailingWhitespaceCommand = class { + constructor(selection, cursors, trimInRegexesAndStrings) { + this._selection = selection; + this._cursors = cursors; + this._selectionId = null; + this._trimInRegexesAndStrings = trimInRegexesAndStrings; + } + getEditOperations(model, builder) { + const ops = trimTrailingWhitespace(model, this._cursors, this._trimInRegexesAndStrings); + for (let i2 = 0, len = ops.length; i2 < len; i2++) { + const op = ops[i2]; + builder.addEditOperation(op.range, op.text); + } + this._selectionId = builder.trackSelection(this._selection); + } + computeCursorState(model, helper) { + return helper.getTrackedSelection(this._selectionId); + } +}; +function trimTrailingWhitespace(model, cursors, trimInRegexesAndStrings) { + cursors.sort((a, b) => { + if (a.lineNumber === b.lineNumber) { + return a.column - b.column; + } + return a.lineNumber - b.lineNumber; + }); + for (let i2 = cursors.length - 2; i2 >= 0; i2--) { + if (cursors[i2].lineNumber === cursors[i2 + 1].lineNumber) { + cursors.splice(i2, 1); + } + } + const r = []; + let rLen = 0; + let cursorIndex = 0; + const cursorLen = cursors.length; + for (let lineNumber = 1, lineCount = model.getLineCount(); lineNumber <= lineCount; lineNumber++) { + const lineContent = model.getLineContent(lineNumber); + const maxLineColumn = lineContent.length + 1; + let minEditColumn = 0; + if (cursorIndex < cursorLen && cursors[cursorIndex].lineNumber === lineNumber) { + minEditColumn = cursors[cursorIndex].column; + cursorIndex++; + if (minEditColumn === maxLineColumn) { + continue; + } + } + if (lineContent.length === 0) { + continue; + } + const lastNonWhitespaceIndex2 = lastNonWhitespaceIndex(lineContent); + let fromColumn = 0; + if (lastNonWhitespaceIndex2 === -1) { + fromColumn = 1; + } else if (lastNonWhitespaceIndex2 !== lineContent.length - 1) { + fromColumn = lastNonWhitespaceIndex2 + 2; + } else { + continue; + } + if (!trimInRegexesAndStrings) { + if (!model.tokenization.hasAccurateTokensForLine(lineNumber)) { + continue; + } + const lineTokens = model.tokenization.getLineTokens(lineNumber); + const fromColumnType = lineTokens.getStandardTokenType(lineTokens.findTokenIndexAtOffset(fromColumn)); + if (fromColumnType === 2 || fromColumnType === 3) { + continue; + } + } + fromColumn = Math.max(minEditColumn, fromColumn); + r[rLen++] = EditOperation.delete(new Range(lineNumber, fromColumn, lineNumber, maxLineColumn)); + } + return r; +} + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/linesOperations/browser/linesOperations.js +init_position(); +init_range(); +init_selection(); +init_editorContextKeys(); +init_languageConfigurationRegistry(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/linesOperations/browser/copyLinesCommand.js +init_range(); +init_selection(); +var CopyLinesCommand = class { + constructor(selection, isCopyingDown, noop) { + this._selection = selection; + this._isCopyingDown = isCopyingDown; + this._noop = noop || false; + this._selectionDirection = 0; + this._selectionId = null; + this._startLineNumberDelta = 0; + this._endLineNumberDelta = 0; + } + getEditOperations(model, builder) { + let s = this._selection; + this._startLineNumberDelta = 0; + this._endLineNumberDelta = 0; + if (s.startLineNumber < s.endLineNumber && s.endColumn === 1) { + this._endLineNumberDelta = 1; + s = s.setEndPosition(s.endLineNumber - 1, model.getLineMaxColumn(s.endLineNumber - 1)); + } + const sourceLines = []; + for (let i2 = s.startLineNumber; i2 <= s.endLineNumber; i2++) { + sourceLines.push(model.getLineContent(i2)); + } + const sourceText = sourceLines.join("\n"); + if (sourceText === "") { + if (this._isCopyingDown) { + this._startLineNumberDelta++; + this._endLineNumberDelta++; + } + } + if (this._noop) { + builder.addEditOperation(new Range(s.endLineNumber, model.getLineMaxColumn(s.endLineNumber), s.endLineNumber + 1, 1), s.endLineNumber === model.getLineCount() ? "" : "\n"); + } else { + if (!this._isCopyingDown) { + builder.addEditOperation(new Range(s.endLineNumber, model.getLineMaxColumn(s.endLineNumber), s.endLineNumber, model.getLineMaxColumn(s.endLineNumber)), "\n" + sourceText); + } else { + builder.addEditOperation(new Range(s.startLineNumber, 1, s.startLineNumber, 1), sourceText + "\n"); + } + } + this._selectionId = builder.trackSelection(s); + this._selectionDirection = this._selection.getDirection(); + } + computeCursorState(model, helper) { + let result = helper.getTrackedSelection(this._selectionId); + if (this._startLineNumberDelta !== 0 || this._endLineNumberDelta !== 0) { + let startLineNumber = result.startLineNumber; + let startColumn = result.startColumn; + let endLineNumber = result.endLineNumber; + let endColumn = result.endColumn; + if (this._startLineNumberDelta !== 0) { + startLineNumber = startLineNumber + this._startLineNumberDelta; + startColumn = 1; + } + if (this._endLineNumberDelta !== 0) { + endLineNumber = endLineNumber + this._endLineNumberDelta; + endColumn = 1; + } + result = Selection.createWithDirection(startLineNumber, startColumn, endLineNumber, endColumn, this._selectionDirection); + } + return result; + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/linesOperations/browser/moveLinesCommand.js +init_strings(); +init_range(); +init_selection(); +init_languageConfiguration(); +init_languageConfigurationRegistry(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/indentation/common/indentUtils.js +function getSpaceCnt(str, tabSize) { + let spacesCnt = 0; + for (let i2 = 0; i2 < str.length; i2++) { + if (str.charAt(i2) === " ") { + spacesCnt += tabSize; + } else { + spacesCnt++; + } + } + return spacesCnt; +} +function generateIndent(spacesCnt, tabSize, insertSpaces) { + spacesCnt = spacesCnt < 0 ? 0 : spacesCnt; + let result = ""; + if (!insertSpaces) { + const tabsCnt = Math.floor(spacesCnt / tabSize); + spacesCnt = spacesCnt % tabSize; + for (let i2 = 0; i2 < tabsCnt; i2++) { + result += " "; + } + } + for (let i2 = 0; i2 < spacesCnt; i2++) { + result += " "; + } + return result; +} + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/linesOperations/browser/moveLinesCommand.js +var __decorate97 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param91 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var MoveLinesCommand = class MoveLinesCommand2 { + constructor(selection, isMovingDown, autoIndent, _languageConfigurationService) { + this._languageConfigurationService = _languageConfigurationService; + this._selection = selection; + this._isMovingDown = isMovingDown; + this._autoIndent = autoIndent; + this._selectionId = null; + this._moveEndLineSelectionShrink = false; + } + getEditOperations(model, builder) { + const getLanguageId = () => { + return model.getLanguageId(); + }; + const getLanguageIdAtPosition = (lineNumber, column) => { + return model.getLanguageIdAtPosition(lineNumber, column); + }; + const modelLineCount = model.getLineCount(); + if (this._isMovingDown && this._selection.endLineNumber === modelLineCount) { + this._selectionId = builder.trackSelection(this._selection); + return; + } + if (!this._isMovingDown && this._selection.startLineNumber === 1) { + this._selectionId = builder.trackSelection(this._selection); + return; + } + this._moveEndPositionDown = false; + let s = this._selection; + if (s.startLineNumber < s.endLineNumber && s.endColumn === 1) { + this._moveEndPositionDown = true; + s = s.setEndPosition(s.endLineNumber - 1, model.getLineMaxColumn(s.endLineNumber - 1)); + } + const { tabSize, indentSize, insertSpaces } = model.getOptions(); + const indentConverter = this.buildIndentConverter(tabSize, indentSize, insertSpaces); + if (s.startLineNumber === s.endLineNumber && model.getLineMaxColumn(s.startLineNumber) === 1) { + const lineNumber = s.startLineNumber; + const otherLineNumber = this._isMovingDown ? lineNumber + 1 : lineNumber - 1; + if (model.getLineMaxColumn(otherLineNumber) === 1) { + builder.addEditOperation(new Range(1, 1, 1, 1), null); + } else { + builder.addEditOperation(new Range(lineNumber, 1, lineNumber, 1), model.getLineContent(otherLineNumber)); + builder.addEditOperation(new Range(otherLineNumber, 1, otherLineNumber, model.getLineMaxColumn(otherLineNumber)), null); + } + s = new Selection(otherLineNumber, 1, otherLineNumber, 1); + } else { + let movingLineNumber; + let movingLineText; + if (this._isMovingDown) { + movingLineNumber = s.endLineNumber + 1; + movingLineText = model.getLineContent(movingLineNumber); + builder.addEditOperation(new Range(movingLineNumber - 1, model.getLineMaxColumn(movingLineNumber - 1), movingLineNumber, model.getLineMaxColumn(movingLineNumber)), null); + let insertingText = movingLineText; + if (this.shouldAutoIndent(model, s)) { + const movingLineMatchResult = this.matchEnterRule(model, indentConverter, tabSize, movingLineNumber, s.startLineNumber - 1); + if (movingLineMatchResult !== null) { + const oldIndentation = getLeadingWhitespace(model.getLineContent(movingLineNumber)); + const newSpaceCnt = movingLineMatchResult + getSpaceCnt(oldIndentation, tabSize); + const newIndentation = generateIndent(newSpaceCnt, tabSize, insertSpaces); + insertingText = newIndentation + this.trimStart(movingLineText); + } else { + const virtualModel = { + tokenization: { + getLineTokens: (lineNumber) => { + if (lineNumber === s.startLineNumber) { + return model.tokenization.getLineTokens(movingLineNumber); + } else { + return model.tokenization.getLineTokens(lineNumber); + } + }, + getLanguageId, + getLanguageIdAtPosition + }, + getLineContent: (lineNumber) => { + if (lineNumber === s.startLineNumber) { + return model.getLineContent(movingLineNumber); + } else { + return model.getLineContent(lineNumber); + } + } + }; + const indentOfMovingLine = getGoodIndentForLine(this._autoIndent, virtualModel, model.getLanguageIdAtPosition(movingLineNumber, 1), s.startLineNumber, indentConverter, this._languageConfigurationService); + if (indentOfMovingLine !== null) { + const oldIndentation = getLeadingWhitespace(model.getLineContent(movingLineNumber)); + const newSpaceCnt = getSpaceCnt(indentOfMovingLine, tabSize); + const oldSpaceCnt = getSpaceCnt(oldIndentation, tabSize); + if (newSpaceCnt !== oldSpaceCnt) { + const newIndentation = generateIndent(newSpaceCnt, tabSize, insertSpaces); + insertingText = newIndentation + this.trimStart(movingLineText); + } + } + } + builder.addEditOperation(new Range(s.startLineNumber, 1, s.startLineNumber, 1), insertingText + "\n"); + const ret = this.matchEnterRuleMovingDown(model, indentConverter, tabSize, s.startLineNumber, movingLineNumber, insertingText); + if (ret !== null) { + if (ret !== 0) { + this.getIndentEditsOfMovingBlock(model, builder, s, tabSize, insertSpaces, ret); + } + } else { + const virtualModel = { + tokenization: { + getLineTokens: (lineNumber) => { + if (lineNumber === s.startLineNumber) { + return model.tokenization.getLineTokens(movingLineNumber); + } else if (lineNumber >= s.startLineNumber + 1 && lineNumber <= s.endLineNumber + 1) { + return model.tokenization.getLineTokens(lineNumber - 1); + } else { + return model.tokenization.getLineTokens(lineNumber); + } + }, + getLanguageId, + getLanguageIdAtPosition + }, + getLineContent: (lineNumber) => { + if (lineNumber === s.startLineNumber) { + return insertingText; + } else if (lineNumber >= s.startLineNumber + 1 && lineNumber <= s.endLineNumber + 1) { + return model.getLineContent(lineNumber - 1); + } else { + return model.getLineContent(lineNumber); + } + } + }; + const newIndentatOfMovingBlock = getGoodIndentForLine(this._autoIndent, virtualModel, model.getLanguageIdAtPosition(movingLineNumber, 1), s.startLineNumber + 1, indentConverter, this._languageConfigurationService); + if (newIndentatOfMovingBlock !== null) { + const oldIndentation = getLeadingWhitespace(model.getLineContent(s.startLineNumber)); + const newSpaceCnt = getSpaceCnt(newIndentatOfMovingBlock, tabSize); + const oldSpaceCnt = getSpaceCnt(oldIndentation, tabSize); + if (newSpaceCnt !== oldSpaceCnt) { + const spaceCntOffset = newSpaceCnt - oldSpaceCnt; + this.getIndentEditsOfMovingBlock(model, builder, s, tabSize, insertSpaces, spaceCntOffset); + } + } + } + } else { + builder.addEditOperation(new Range(s.startLineNumber, 1, s.startLineNumber, 1), insertingText + "\n"); + } + } else { + movingLineNumber = s.startLineNumber - 1; + movingLineText = model.getLineContent(movingLineNumber); + builder.addEditOperation(new Range(movingLineNumber, 1, movingLineNumber + 1, 1), null); + builder.addEditOperation(new Range(s.endLineNumber, model.getLineMaxColumn(s.endLineNumber), s.endLineNumber, model.getLineMaxColumn(s.endLineNumber)), "\n" + movingLineText); + if (this.shouldAutoIndent(model, s)) { + const virtualModel = { + tokenization: { + getLineTokens: (lineNumber) => { + if (lineNumber === movingLineNumber) { + return model.tokenization.getLineTokens(s.startLineNumber); + } else { + return model.tokenization.getLineTokens(lineNumber); + } + }, + getLanguageId, + getLanguageIdAtPosition + }, + getLineContent: (lineNumber) => { + if (lineNumber === movingLineNumber) { + return model.getLineContent(s.startLineNumber); + } else { + return model.getLineContent(lineNumber); + } + } + }; + const ret = this.matchEnterRule(model, indentConverter, tabSize, s.startLineNumber, s.startLineNumber - 2); + if (ret !== null) { + if (ret !== 0) { + this.getIndentEditsOfMovingBlock(model, builder, s, tabSize, insertSpaces, ret); + } + } else { + const indentOfFirstLine = getGoodIndentForLine(this._autoIndent, virtualModel, model.getLanguageIdAtPosition(s.startLineNumber, 1), movingLineNumber, indentConverter, this._languageConfigurationService); + if (indentOfFirstLine !== null) { + const oldIndent = getLeadingWhitespace(model.getLineContent(s.startLineNumber)); + const newSpaceCnt = getSpaceCnt(indentOfFirstLine, tabSize); + const oldSpaceCnt = getSpaceCnt(oldIndent, tabSize); + if (newSpaceCnt !== oldSpaceCnt) { + const spaceCntOffset = newSpaceCnt - oldSpaceCnt; + this.getIndentEditsOfMovingBlock(model, builder, s, tabSize, insertSpaces, spaceCntOffset); + } + } + } + } + } + } + this._selectionId = builder.trackSelection(s); + } + buildIndentConverter(tabSize, indentSize, insertSpaces) { + return { + shiftIndent: (indentation) => { + return ShiftCommand.shiftIndent(indentation, indentation.length + 1, tabSize, indentSize, insertSpaces); + }, + unshiftIndent: (indentation) => { + return ShiftCommand.unshiftIndent(indentation, indentation.length + 1, tabSize, indentSize, insertSpaces); + } + }; + } + parseEnterResult(model, indentConverter, tabSize, line, enter) { + if (enter) { + let enterPrefix = enter.indentation; + if (enter.indentAction === IndentAction.None) { + enterPrefix = enter.indentation + enter.appendText; + } else if (enter.indentAction === IndentAction.Indent) { + enterPrefix = enter.indentation + enter.appendText; + } else if (enter.indentAction === IndentAction.IndentOutdent) { + enterPrefix = enter.indentation; + } else if (enter.indentAction === IndentAction.Outdent) { + enterPrefix = indentConverter.unshiftIndent(enter.indentation) + enter.appendText; + } + const movingLineText = model.getLineContent(line); + if (this.trimStart(movingLineText).indexOf(this.trimStart(enterPrefix)) >= 0) { + const oldIndentation = getLeadingWhitespace(model.getLineContent(line)); + let newIndentation = getLeadingWhitespace(enterPrefix); + const indentMetadataOfMovelingLine = getIndentMetadata(model, line, this._languageConfigurationService); + if (indentMetadataOfMovelingLine !== null && indentMetadataOfMovelingLine & 2) { + newIndentation = indentConverter.unshiftIndent(newIndentation); + } + const newSpaceCnt = getSpaceCnt(newIndentation, tabSize); + const oldSpaceCnt = getSpaceCnt(oldIndentation, tabSize); + return newSpaceCnt - oldSpaceCnt; + } + } + return null; + } + /** + * + * @param model + * @param indentConverter + * @param tabSize + * @param line the line moving down + * @param futureAboveLineNumber the line which will be at the `line` position + * @param futureAboveLineText + */ + matchEnterRuleMovingDown(model, indentConverter, tabSize, line, futureAboveLineNumber, futureAboveLineText) { + if (lastNonWhitespaceIndex(futureAboveLineText) >= 0) { + const maxColumn = model.getLineMaxColumn(futureAboveLineNumber); + const enter = getEnterAction(this._autoIndent, model, new Range(futureAboveLineNumber, maxColumn, futureAboveLineNumber, maxColumn), this._languageConfigurationService); + return this.parseEnterResult(model, indentConverter, tabSize, line, enter); + } else { + let validPrecedingLine = line - 1; + while (validPrecedingLine >= 1) { + const lineContent = model.getLineContent(validPrecedingLine); + const nonWhitespaceIdx = lastNonWhitespaceIndex(lineContent); + if (nonWhitespaceIdx >= 0) { + break; + } + validPrecedingLine--; + } + if (validPrecedingLine < 1 || line > model.getLineCount()) { + return null; + } + const maxColumn = model.getLineMaxColumn(validPrecedingLine); + const enter = getEnterAction(this._autoIndent, model, new Range(validPrecedingLine, maxColumn, validPrecedingLine, maxColumn), this._languageConfigurationService); + return this.parseEnterResult(model, indentConverter, tabSize, line, enter); + } + } + matchEnterRule(model, indentConverter, tabSize, line, oneLineAbove, previousLineText) { + let validPrecedingLine = oneLineAbove; + while (validPrecedingLine >= 1) { + let lineContent; + if (validPrecedingLine === oneLineAbove && previousLineText !== void 0) { + lineContent = previousLineText; + } else { + lineContent = model.getLineContent(validPrecedingLine); + } + const nonWhitespaceIdx = lastNonWhitespaceIndex(lineContent); + if (nonWhitespaceIdx >= 0) { + break; + } + validPrecedingLine--; + } + if (validPrecedingLine < 1 || line > model.getLineCount()) { + return null; + } + const maxColumn = model.getLineMaxColumn(validPrecedingLine); + const enter = getEnterAction(this._autoIndent, model, new Range(validPrecedingLine, maxColumn, validPrecedingLine, maxColumn), this._languageConfigurationService); + return this.parseEnterResult(model, indentConverter, tabSize, line, enter); + } + trimStart(str) { + return str.replace(/^\s+/, ""); + } + shouldAutoIndent(model, selection) { + if (this._autoIndent < 4) { + return false; + } + if (!model.tokenization.isCheapToTokenize(selection.startLineNumber)) { + return false; + } + const languageAtSelectionStart = model.getLanguageIdAtPosition(selection.startLineNumber, 1); + const languageAtSelectionEnd = model.getLanguageIdAtPosition(selection.endLineNumber, 1); + if (languageAtSelectionStart !== languageAtSelectionEnd) { + return false; + } + if (this._languageConfigurationService.getLanguageConfiguration(languageAtSelectionStart).indentRulesSupport === null) { + return false; + } + return true; + } + getIndentEditsOfMovingBlock(model, builder, s, tabSize, insertSpaces, offset) { + for (let i2 = s.startLineNumber; i2 <= s.endLineNumber; i2++) { + const lineContent = model.getLineContent(i2); + const originalIndent = getLeadingWhitespace(lineContent); + const originalSpacesCnt = getSpaceCnt(originalIndent, tabSize); + const newSpacesCnt = originalSpacesCnt + offset; + const newIndent = generateIndent(newSpacesCnt, tabSize, insertSpaces); + if (newIndent !== originalIndent) { + builder.addEditOperation(new Range(i2, 1, i2, originalIndent.length + 1), newIndent); + if (i2 === s.endLineNumber && s.endColumn <= originalIndent.length + 1 && newIndent === "") { + this._moveEndLineSelectionShrink = true; + } + } + } + } + computeCursorState(model, helper) { + let result = helper.getTrackedSelection(this._selectionId); + if (this._moveEndPositionDown) { + result = result.setEndPosition(result.endLineNumber + 1, 1); + } + if (this._moveEndLineSelectionShrink && result.startLineNumber < result.endLineNumber) { + result = result.setEndPosition(result.endLineNumber, 2); + } + return result; + } +}; +MoveLinesCommand = __decorate97([ + __param91(3, ILanguageConfigurationService) +], MoveLinesCommand); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/linesOperations/browser/sortLinesCommand.js +init_date(); +init_range(); +var SortLinesCommand = class { + static { + this._COLLATOR = safeIntl.Collator(); + } + constructor(selection, descending) { + this.selection = selection; + this.descending = descending; + this.selectionId = null; + } + getEditOperations(model, builder) { + const op = sortLines(model, this.selection, this.descending); + if (op) { + builder.addEditOperation(op.range, op.text); + } + this.selectionId = builder.trackSelection(this.selection); + } + computeCursorState(model, helper) { + return helper.getTrackedSelection(this.selectionId); + } + static canRun(model, selection, descending) { + if (model === null) { + return false; + } + const data = getSortData(model, selection, descending); + if (!data) { + return false; + } + for (let i2 = 0, len = data.before.length; i2 < len; i2++) { + if (data.before[i2] !== data.after[i2]) { + return true; + } + } + return false; + } +}; +function getSortData(model, selection, descending) { + const startLineNumber = selection.startLineNumber; + let endLineNumber = selection.endLineNumber; + if (selection.endColumn === 1) { + endLineNumber--; + } + if (startLineNumber >= endLineNumber) { + return null; + } + const linesToSort = []; + for (let lineNumber = startLineNumber; lineNumber <= endLineNumber; lineNumber++) { + linesToSort.push(model.getLineContent(lineNumber)); + } + let sorted = linesToSort.slice(0); + sorted.sort(SortLinesCommand._COLLATOR.value.compare); + if (descending === true) { + sorted = sorted.reverse(); + } + return { + startLineNumber, + endLineNumber, + before: linesToSort, + after: sorted + }; +} +function sortLines(model, selection, descending) { + const data = getSortData(model, selection, descending); + if (!data) { + return null; + } + return EditOperation.replace(new Range(data.startLineNumber, 1, data.endLineNumber, model.getLineMaxColumn(data.endLineNumber)), data.after.join("\n")); +} + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/linesOperations/browser/linesOperations.js +var AbstractCopyLinesAction = class extends EditorAction { + constructor(down, opts) { + super(opts); + this.down = down; + } + run(_accessor, editor2) { + if (!editor2.hasModel()) { + return; + } + const selections = editor2.getSelections().map((selection, index) => ({ selection, index, ignore: false })); + selections.sort((a, b) => Range.compareRangesUsingStarts(a.selection, b.selection)); + let prev = selections[0]; + for (let i2 = 1; i2 < selections.length; i2++) { + const curr = selections[i2]; + if (prev.selection.endLineNumber === curr.selection.startLineNumber) { + if (prev.index < curr.index) { + curr.ignore = true; + } else { + prev.ignore = true; + prev = curr; + } + } + } + const commands = []; + for (const selection of selections) { + commands.push(new CopyLinesCommand(selection.selection, this.down, selection.ignore)); + } + editor2.pushUndoStop(); + editor2.executeCommands(this.id, commands); + editor2.pushUndoStop(); + } +}; +var CopyLinesUpAction = class extends AbstractCopyLinesAction { + constructor() { + super(false, { + id: "editor.action.copyLinesUpAction", + label: localize2(1249, "Copy Line Up"), + precondition: EditorContextKeys.writable, + kbOpts: { + kbExpr: EditorContextKeys.editorTextFocus, + primary: 512 | 1024 | 16, + linux: { + primary: 2048 | 512 | 1024 | 16 + /* KeyCode.UpArrow */ + }, + weight: 100 + /* KeybindingWeight.EditorContrib */ + }, + menuOpts: { + menuId: MenuId.MenubarSelectionMenu, + group: "2_line", + title: localize(1244, "&&Copy Line Up"), + order: 1 + }, + canTriggerInlineEdits: true + }); + } +}; +var CopyLinesDownAction = class extends AbstractCopyLinesAction { + constructor() { + super(true, { + id: "editor.action.copyLinesDownAction", + label: localize2(1250, "Copy Line Down"), + precondition: EditorContextKeys.writable, + kbOpts: { + kbExpr: EditorContextKeys.editorTextFocus, + primary: 512 | 1024 | 18, + linux: { + primary: 2048 | 512 | 1024 | 18 + /* KeyCode.DownArrow */ + }, + weight: 100 + /* KeybindingWeight.EditorContrib */ + }, + menuOpts: { + menuId: MenuId.MenubarSelectionMenu, + group: "2_line", + title: localize(1245, "Co&&py Line Down"), + order: 2 + }, + canTriggerInlineEdits: true + }); + } +}; +var DuplicateSelectionAction = class extends EditorAction { + constructor() { + super({ + id: "editor.action.duplicateSelection", + label: localize2(1251, "Duplicate Selection"), + precondition: EditorContextKeys.writable, + menuOpts: { + menuId: MenuId.MenubarSelectionMenu, + group: "2_line", + title: localize(1246, "&&Duplicate Selection"), + order: 5 + }, + canTriggerInlineEdits: true + }); + } + run(accessor, editor2, args) { + if (!editor2.hasModel()) { + return; + } + const commands = []; + const selections = editor2.getSelections(); + const model = editor2.getModel(); + for (const selection of selections) { + if (selection.isEmpty()) { + commands.push(new CopyLinesCommand(selection, true)); + } else { + const insertSelection = new Selection(selection.endLineNumber, selection.endColumn, selection.endLineNumber, selection.endColumn); + commands.push(new ReplaceCommandThatSelectsText(insertSelection, model.getValueInRange(selection))); + } + } + editor2.pushUndoStop(); + editor2.executeCommands(this.id, commands); + editor2.pushUndoStop(); + } +}; +var AbstractMoveLinesAction = class extends EditorAction { + constructor(down, opts) { + super(opts); + this.down = down; + } + run(accessor, editor2) { + const languageConfigurationService = accessor.get(ILanguageConfigurationService); + const commands = []; + const selections = editor2.getSelections() || []; + const autoIndent = editor2.getOption( + 16 + /* EditorOption.autoIndent */ + ); + for (const selection of selections) { + commands.push(new MoveLinesCommand(selection, this.down, autoIndent, languageConfigurationService)); + } + editor2.pushUndoStop(); + editor2.executeCommands(this.id, commands); + editor2.pushUndoStop(); + } +}; +var MoveLinesUpAction = class extends AbstractMoveLinesAction { + constructor() { + super(false, { + id: "editor.action.moveLinesUpAction", + label: localize2(1252, "Move Line Up"), + precondition: EditorContextKeys.writable, + kbOpts: { + kbExpr: EditorContextKeys.editorTextFocus, + primary: 512 | 16, + linux: { + primary: 512 | 16 + /* KeyCode.UpArrow */ + }, + weight: 100 + /* KeybindingWeight.EditorContrib */ + }, + menuOpts: { + menuId: MenuId.MenubarSelectionMenu, + group: "2_line", + title: localize(1247, "Mo&&ve Line Up"), + order: 3 + }, + canTriggerInlineEdits: true + }); + } +}; +var MoveLinesDownAction = class extends AbstractMoveLinesAction { + constructor() { + super(true, { + id: "editor.action.moveLinesDownAction", + label: localize2(1253, "Move Line Down"), + precondition: EditorContextKeys.writable, + kbOpts: { + kbExpr: EditorContextKeys.editorTextFocus, + primary: 512 | 18, + linux: { + primary: 512 | 18 + /* KeyCode.DownArrow */ + }, + weight: 100 + /* KeybindingWeight.EditorContrib */ + }, + menuOpts: { + menuId: MenuId.MenubarSelectionMenu, + group: "2_line", + title: localize(1248, "Move &&Line Down"), + order: 4 + }, + canTriggerInlineEdits: true + }); + } +}; +var AbstractSortLinesAction = class extends EditorAction { + constructor(descending, opts) { + super(opts); + this.descending = descending; + } + run(_accessor, editor2) { + if (!editor2.hasModel()) { + return; + } + const model = editor2.getModel(); + let selections = editor2.getSelections(); + if (selections.length === 1 && selections[0].isEmpty()) { + selections = [new Selection(1, 1, model.getLineCount(), model.getLineMaxColumn(model.getLineCount()))]; + } + for (const selection of selections) { + if (!SortLinesCommand.canRun(editor2.getModel(), selection, this.descending)) { + return; + } + } + const commands = []; + for (let i2 = 0, len = selections.length; i2 < len; i2++) { + commands[i2] = new SortLinesCommand(selections[i2], this.descending); + } + editor2.pushUndoStop(); + editor2.executeCommands(this.id, commands); + editor2.pushUndoStop(); + } +}; +var SortLinesAscendingAction = class extends AbstractSortLinesAction { + constructor() { + super(false, { + id: "editor.action.sortLinesAscending", + label: localize2(1254, "Sort Lines Ascending"), + precondition: EditorContextKeys.writable, + canTriggerInlineEdits: true + }); + } +}; +var SortLinesDescendingAction = class extends AbstractSortLinesAction { + constructor() { + super(true, { + id: "editor.action.sortLinesDescending", + label: localize2(1255, "Sort Lines Descending"), + precondition: EditorContextKeys.writable, + canTriggerInlineEdits: true + }); + } +}; +var DeleteDuplicateLinesAction = class extends EditorAction { + constructor() { + super({ + id: "editor.action.removeDuplicateLines", + label: localize2(1256, "Delete Duplicate Lines"), + precondition: EditorContextKeys.writable, + canTriggerInlineEdits: true + }); + } + run(_accessor, editor2) { + if (!editor2.hasModel()) { + return; + } + const model = editor2.getModel(); + if (model.getLineCount() === 1 && model.getLineMaxColumn(1) === 1) { + return; + } + const edits = []; + const endCursorState = []; + let linesDeleted = 0; + let updateSelection = true; + let selections = editor2.getSelections(); + if (selections.length === 1 && selections[0].isEmpty()) { + selections = [new Selection(1, 1, model.getLineCount(), model.getLineMaxColumn(model.getLineCount()))]; + updateSelection = false; + } + for (const selection of selections) { + const uniqueLines = /* @__PURE__ */ new Set(); + const lines = []; + for (let i2 = selection.startLineNumber; i2 <= selection.endLineNumber; i2++) { + const line = model.getLineContent(i2); + if (uniqueLines.has(line)) { + continue; + } + lines.push(line); + uniqueLines.add(line); + } + const selectionToReplace = new Selection(selection.startLineNumber, 1, selection.endLineNumber, model.getLineMaxColumn(selection.endLineNumber)); + const adjustedSelectionStart = selection.startLineNumber - linesDeleted; + const finalSelection = new Selection(adjustedSelectionStart, 1, adjustedSelectionStart + lines.length - 1, lines[lines.length - 1].length); + edits.push(EditOperation.replace(selectionToReplace, lines.join("\n"))); + endCursorState.push(finalSelection); + linesDeleted += selection.endLineNumber - selection.startLineNumber + 1 - lines.length; + } + editor2.pushUndoStop(); + editor2.executeEdits(this.id, edits, updateSelection ? endCursorState : void 0); + editor2.pushUndoStop(); + } +}; +var ReverseLinesAction = class extends EditorAction { + constructor() { + super({ + id: "editor.action.reverseLines", + label: localize2(1257, "Reverse lines"), + precondition: EditorContextKeys.writable, + canTriggerInlineEdits: true + }); + } + run(_accessor, editor2) { + if (!editor2.hasModel()) { + return; + } + const model = editor2.getModel(); + const originalSelections = editor2.getSelections(); + let selections = originalSelections; + if (selections.length === 1 && selections[0].isEmpty()) { + selections = [new Selection(1, 1, model.getLineCount(), model.getLineMaxColumn(model.getLineCount()))]; + } + const edits = []; + const resultingSelections = []; + for (let i2 = 0; i2 < selections.length; i2++) { + const selection = selections[i2]; + const originalSelection = originalSelections[i2]; + let endLineNumber = selection.endLineNumber; + if (selection.startLineNumber < selection.endLineNumber && selection.endColumn === 1) { + endLineNumber--; + } + let range2 = new Range(selection.startLineNumber, 1, endLineNumber, model.getLineMaxColumn(endLineNumber)); + if (endLineNumber === model.getLineCount() && model.getLineContent(range2.endLineNumber) === "") { + range2 = range2.setEndPosition(range2.endLineNumber - 1, model.getLineMaxColumn(range2.endLineNumber - 1)); + } + const lines = []; + for (let i3 = range2.endLineNumber; i3 >= range2.startLineNumber; i3--) { + lines.push(model.getLineContent(i3)); + } + const edit2 = EditOperation.replace(range2, lines.join("\n")); + edits.push(edit2); + const updateLineNumber = function(lineNumber) { + return lineNumber <= range2.endLineNumber ? range2.endLineNumber - lineNumber + range2.startLineNumber : lineNumber; + }; + const updateSelection = function(sel) { + if (sel.isEmpty()) { + return new Selection(updateLineNumber(sel.positionLineNumber), sel.positionColumn, updateLineNumber(sel.positionLineNumber), sel.positionColumn); + } else { + const newSelectionStart = updateLineNumber(sel.selectionStartLineNumber); + const newPosition = updateLineNumber(sel.positionLineNumber); + const newSelectionStartColumn = sel.selectionStartColumn; + const newPositionColumn = sel.positionColumn; + return new Selection(newSelectionStart, newSelectionStartColumn, newPosition, newPositionColumn); + } + }; + resultingSelections.push(updateSelection(originalSelection)); + } + editor2.pushUndoStop(); + editor2.executeEdits(this.id, edits, resultingSelections); + editor2.pushUndoStop(); + } +}; +var TrimTrailingWhitespaceAction = class _TrimTrailingWhitespaceAction extends EditorAction { + static { + this.ID = "editor.action.trimTrailingWhitespace"; + } + constructor() { + super({ + id: _TrimTrailingWhitespaceAction.ID, + label: localize2(1258, "Trim Trailing Whitespace"), + precondition: EditorContextKeys.writable, + kbOpts: { + kbExpr: EditorContextKeys.editorTextFocus, + primary: KeyChord( + 2048 | 41, + 2048 | 54 + /* KeyCode.KeyX */ + ), + weight: 100 + /* KeybindingWeight.EditorContrib */ + } + }); + } + run(_accessor, editor2, args) { + let cursors = []; + if (args.reason === "auto-save") { + cursors = (editor2.getSelections() || []).map((s) => new Position(s.positionLineNumber, s.positionColumn)); + } + const selection = editor2.getSelection(); + if (selection === null) { + return; + } + const config = _accessor.get(IConfigurationService); + const model = editor2.getModel(); + const trimInRegexAndStrings = config.getValue("files.trimTrailingWhitespaceInRegexAndStrings", { overrideIdentifier: model?.getLanguageId(), resource: model?.uri }); + const command = new TrimTrailingWhitespaceCommand(selection, cursors, trimInRegexAndStrings); + editor2.pushUndoStop(); + editor2.executeCommands(this.id, [command]); + editor2.pushUndoStop(); + } +}; +var DeleteLinesAction = class extends EditorAction { + constructor() { + super({ + id: "editor.action.deleteLines", + label: localize2(1259, "Delete Line"), + precondition: EditorContextKeys.writable, + kbOpts: { + kbExpr: EditorContextKeys.textInputFocus, + primary: 2048 | 1024 | 41, + weight: 100 + /* KeybindingWeight.EditorContrib */ + }, + canTriggerInlineEdits: true + }); + } + run(_accessor, editor2) { + if (!editor2.hasModel()) { + return; + } + const ops = this._getLinesToRemove(editor2); + const model = editor2.getModel(); + if (model.getLineCount() === 1 && model.getLineMaxColumn(1) === 1) { + return; + } + let linesDeleted = 0; + const edits = []; + const cursorState = []; + for (let i2 = 0, len = ops.length; i2 < len; i2++) { + const op = ops[i2]; + let startLineNumber = op.startLineNumber; + let endLineNumber = op.endLineNumber; + let startColumn = 1; + let endColumn = model.getLineMaxColumn(endLineNumber); + if (endLineNumber < model.getLineCount()) { + endLineNumber += 1; + endColumn = 1; + } else if (startLineNumber > 1) { + startLineNumber -= 1; + startColumn = model.getLineMaxColumn(startLineNumber); + } + edits.push(EditOperation.replace(new Selection(startLineNumber, startColumn, endLineNumber, endColumn), "")); + cursorState.push(new Selection(startLineNumber - linesDeleted, op.positionColumn, startLineNumber - linesDeleted, op.positionColumn)); + linesDeleted += op.endLineNumber - op.startLineNumber + 1; + } + editor2.pushUndoStop(); + editor2.executeEdits(this.id, edits, cursorState); + editor2.pushUndoStop(); + } + _getLinesToRemove(editor2) { + const operations = editor2.getSelections().map((s) => { + let endLineNumber = s.endLineNumber; + if (s.startLineNumber < s.endLineNumber && s.endColumn === 1) { + endLineNumber -= 1; + } + return { + startLineNumber: s.startLineNumber, + selectionStartColumn: s.selectionStartColumn, + endLineNumber, + positionColumn: s.positionColumn + }; + }); + operations.sort((a, b) => { + if (a.startLineNumber === b.startLineNumber) { + return a.endLineNumber - b.endLineNumber; + } + return a.startLineNumber - b.startLineNumber; + }); + const mergedOperations = []; + let previousOperation = operations[0]; + for (let i2 = 1; i2 < operations.length; i2++) { + if (previousOperation.endLineNumber + 1 >= operations[i2].startLineNumber) { + previousOperation.endLineNumber = operations[i2].endLineNumber; + } else { + mergedOperations.push(previousOperation); + previousOperation = operations[i2]; + } + } + mergedOperations.push(previousOperation); + return mergedOperations; + } +}; +var IndentLinesAction = class extends EditorAction { + constructor() { + super({ + id: "editor.action.indentLines", + label: localize2(1260, "Indent Line"), + precondition: EditorContextKeys.writable, + kbOpts: { + kbExpr: EditorContextKeys.editorTextFocus, + primary: 2048 | 94, + weight: 100 + /* KeybindingWeight.EditorContrib */ + }, + canTriggerInlineEdits: true + }); + } + run(_accessor, editor2) { + const viewModel = editor2._getViewModel(); + if (!viewModel) { + return; + } + editor2.pushUndoStop(); + editor2.executeCommands(this.id, TypeOperations.indent(viewModel.cursorConfig, editor2.getModel(), editor2.getSelections())); + editor2.pushUndoStop(); + } +}; +var OutdentLinesAction = class extends EditorAction { + constructor() { + super({ + id: "editor.action.outdentLines", + label: localize2(1261, "Outdent Line"), + precondition: EditorContextKeys.writable, + kbOpts: { + kbExpr: EditorContextKeys.editorTextFocus, + primary: 2048 | 92, + weight: 100 + /* KeybindingWeight.EditorContrib */ + }, + canTriggerInlineEdits: true + }); + } + run(_accessor, editor2) { + CoreEditingCommands.Outdent.runEditorCommand(_accessor, editor2, null); + } +}; +var InsertLineBeforeAction = class _InsertLineBeforeAction extends EditorAction { + static { + this.ID = "editor.action.insertLineBefore"; + } + constructor() { + super({ + id: _InsertLineBeforeAction.ID, + label: localize2(1262, "Insert Line Above"), + precondition: EditorContextKeys.writable, + kbOpts: { + kbExpr: EditorContextKeys.editorTextFocus, + primary: 2048 | 1024 | 3, + weight: 100 + /* KeybindingWeight.EditorContrib */ + }, + canTriggerInlineEdits: true + }); + } + run(_accessor, editor2) { + const viewModel = editor2._getViewModel(); + if (!viewModel) { + return; + } + editor2.pushUndoStop(); + editor2.executeCommands(this.id, EnterOperation.lineInsertBefore(viewModel.cursorConfig, editor2.getModel(), editor2.getSelections())); + } +}; +var InsertLineAfterAction = class _InsertLineAfterAction extends EditorAction { + static { + this.ID = "editor.action.insertLineAfter"; + } + constructor() { + super({ + id: _InsertLineAfterAction.ID, + label: localize2(1263, "Insert Line Below"), + precondition: EditorContextKeys.writable, + kbOpts: { + kbExpr: EditorContextKeys.editorTextFocus, + primary: 2048 | 3, + weight: 100 + /* KeybindingWeight.EditorContrib */ + }, + canTriggerInlineEdits: true + }); + } + run(_accessor, editor2) { + const viewModel = editor2._getViewModel(); + if (!viewModel) { + return; + } + editor2.pushUndoStop(); + editor2.executeCommands(this.id, EnterOperation.lineInsertAfter(viewModel.cursorConfig, editor2.getModel(), editor2.getSelections())); + } +}; +var AbstractDeleteAllToBoundaryAction = class extends EditorAction { + run(_accessor, editor2) { + if (!editor2.hasModel()) { + return; + } + const primaryCursor = editor2.getSelection(); + const rangesToDelete = this._getRangesToDelete(editor2); + const effectiveRanges = []; + for (let i2 = 0, count = rangesToDelete.length - 1; i2 < count; i2++) { + const range2 = rangesToDelete[i2]; + const nextRange = rangesToDelete[i2 + 1]; + if (Range.intersectRanges(range2, nextRange) === null) { + effectiveRanges.push(range2); + } else { + rangesToDelete[i2 + 1] = Range.plusRange(range2, nextRange); + } + } + effectiveRanges.push(rangesToDelete[rangesToDelete.length - 1]); + const endCursorState = this._getEndCursorState(primaryCursor, effectiveRanges); + const edits = effectiveRanges.map((range2) => { + return EditOperation.replace(range2, ""); + }); + editor2.pushUndoStop(); + editor2.executeEdits(this.id, edits, endCursorState); + editor2.pushUndoStop(); + } +}; +var DeleteAllLeftAction = class extends AbstractDeleteAllToBoundaryAction { + constructor() { + super({ + id: "deleteAllLeft", + label: localize2(1264, "Delete All Left"), + precondition: EditorContextKeys.writable, + kbOpts: { + kbExpr: EditorContextKeys.textInputFocus, + primary: 0, + mac: { + primary: 2048 | 1 + /* KeyCode.Backspace */ + }, + weight: 100 + /* KeybindingWeight.EditorContrib */ + }, + canTriggerInlineEdits: true + }); + } + _getEndCursorState(primaryCursor, rangesToDelete) { + let endPrimaryCursor = null; + const endCursorState = []; + let deletedLines = 0; + rangesToDelete.forEach((range2) => { + let endCursor; + if (range2.endColumn === 1 && deletedLines > 0) { + const newStartLine = range2.startLineNumber - deletedLines; + endCursor = new Selection(newStartLine, range2.startColumn, newStartLine, range2.startColumn); + } else { + endCursor = new Selection(range2.startLineNumber, range2.startColumn, range2.startLineNumber, range2.startColumn); + } + deletedLines += range2.endLineNumber - range2.startLineNumber; + if (range2.intersectRanges(primaryCursor)) { + endPrimaryCursor = endCursor; + } else { + endCursorState.push(endCursor); + } + }); + if (endPrimaryCursor) { + endCursorState.unshift(endPrimaryCursor); + } + return endCursorState; + } + _getRangesToDelete(editor2) { + const selections = editor2.getSelections(); + if (selections === null) { + return []; + } + let rangesToDelete = selections; + const model = editor2.getModel(); + if (model === null) { + return []; + } + rangesToDelete.sort(Range.compareRangesUsingStarts); + rangesToDelete = rangesToDelete.map((selection) => { + if (selection.isEmpty()) { + if (selection.startColumn === 1) { + const deleteFromLine = Math.max(1, selection.startLineNumber - 1); + const deleteFromColumn = selection.startLineNumber === 1 ? 1 : model.getLineLength(deleteFromLine) + 1; + return new Range(deleteFromLine, deleteFromColumn, selection.startLineNumber, 1); + } else { + return new Range(selection.startLineNumber, 1, selection.startLineNumber, selection.startColumn); + } + } else { + return new Range(selection.startLineNumber, 1, selection.endLineNumber, selection.endColumn); + } + }); + return rangesToDelete; + } +}; +var DeleteAllRightAction = class extends AbstractDeleteAllToBoundaryAction { + constructor() { + super({ + id: "deleteAllRight", + label: localize2(1265, "Delete All Right"), + precondition: EditorContextKeys.writable, + kbOpts: { + kbExpr: EditorContextKeys.textInputFocus, + primary: 0, + mac: { primary: 256 | 41, secondary: [ + 2048 | 20 + /* KeyCode.Delete */ + ] }, + weight: 100 + /* KeybindingWeight.EditorContrib */ + }, + canTriggerInlineEdits: true + }); + } + _getEndCursorState(primaryCursor, rangesToDelete) { + let endPrimaryCursor = null; + const endCursorState = []; + for (let i2 = 0, len = rangesToDelete.length, offset = 0; i2 < len; i2++) { + const range2 = rangesToDelete[i2]; + const endCursor = new Selection(range2.startLineNumber - offset, range2.startColumn, range2.startLineNumber - offset, range2.startColumn); + if (range2.intersectRanges(primaryCursor)) { + endPrimaryCursor = endCursor; + } else { + endCursorState.push(endCursor); + } + } + if (endPrimaryCursor) { + endCursorState.unshift(endPrimaryCursor); + } + return endCursorState; + } + _getRangesToDelete(editor2) { + const model = editor2.getModel(); + if (model === null) { + return []; + } + const selections = editor2.getSelections(); + if (selections === null) { + return []; + } + const rangesToDelete = selections.map((sel) => { + if (sel.isEmpty()) { + const maxColumn = model.getLineMaxColumn(sel.startLineNumber); + if (sel.startColumn === maxColumn) { + return new Range(sel.startLineNumber, sel.startColumn, sel.startLineNumber + 1, 1); + } else { + return new Range(sel.startLineNumber, sel.startColumn, sel.startLineNumber, maxColumn); + } + } + return sel; + }); + rangesToDelete.sort(Range.compareRangesUsingStarts); + return rangesToDelete; + } +}; +var JoinLinesAction = class extends EditorAction { + constructor() { + super({ + id: "editor.action.joinLines", + label: localize2(1266, "Join Lines"), + precondition: EditorContextKeys.writable, + kbOpts: { + kbExpr: EditorContextKeys.editorTextFocus, + primary: 0, + mac: { + primary: 256 | 40 + /* KeyCode.KeyJ */ + }, + weight: 100 + /* KeybindingWeight.EditorContrib */ + }, + canTriggerInlineEdits: true + }); + } + run(_accessor, editor2) { + const selections = editor2.getSelections(); + if (selections === null) { + return; + } + let primaryCursor = editor2.getSelection(); + if (primaryCursor === null) { + return; + } + selections.sort(Range.compareRangesUsingStarts); + const reducedSelections = []; + const lastSelection = selections.reduce((previousValue, currentValue) => { + if (previousValue.isEmpty()) { + if (previousValue.endLineNumber === currentValue.startLineNumber) { + if (primaryCursor.equalsSelection(previousValue)) { + primaryCursor = currentValue; + } + return currentValue; + } + if (currentValue.startLineNumber > previousValue.endLineNumber + 1) { + reducedSelections.push(previousValue); + return currentValue; + } else { + return new Selection(previousValue.startLineNumber, previousValue.startColumn, currentValue.endLineNumber, currentValue.endColumn); + } + } else { + if (currentValue.startLineNumber > previousValue.endLineNumber) { + reducedSelections.push(previousValue); + return currentValue; + } else { + return new Selection(previousValue.startLineNumber, previousValue.startColumn, currentValue.endLineNumber, currentValue.endColumn); + } + } + }); + reducedSelections.push(lastSelection); + const model = editor2.getModel(); + if (model === null) { + return; + } + const edits = []; + const endCursorState = []; + let endPrimaryCursor = primaryCursor; + let lineOffset = 0; + for (let i2 = 0, len = reducedSelections.length; i2 < len; i2++) { + const selection = reducedSelections[i2]; + const startLineNumber = selection.startLineNumber; + const startColumn = 1; + let columnDeltaOffset = 0; + let endLineNumber, endColumn; + const selectionEndPositionOffset = model.getLineLength(selection.endLineNumber) - selection.endColumn; + if (selection.isEmpty() || selection.startLineNumber === selection.endLineNumber) { + const position = selection.getStartPosition(); + if (position.lineNumber < model.getLineCount()) { + endLineNumber = startLineNumber + 1; + endColumn = model.getLineMaxColumn(endLineNumber); + } else { + endLineNumber = position.lineNumber; + endColumn = model.getLineMaxColumn(position.lineNumber); + } + } else { + endLineNumber = selection.endLineNumber; + endColumn = model.getLineMaxColumn(endLineNumber); + } + let trimmedLinesContent = model.getLineContent(startLineNumber); + for (let i3 = startLineNumber + 1; i3 <= endLineNumber; i3++) { + const lineText = model.getLineContent(i3); + const firstNonWhitespaceIdx = model.getLineFirstNonWhitespaceColumn(i3); + if (firstNonWhitespaceIdx >= 1) { + let insertSpace = true; + if (trimmedLinesContent === "") { + insertSpace = false; + } + if (insertSpace && (trimmedLinesContent.charAt(trimmedLinesContent.length - 1) === " " || trimmedLinesContent.charAt(trimmedLinesContent.length - 1) === " ")) { + insertSpace = false; + trimmedLinesContent = trimmedLinesContent.replace(/[\s\uFEFF\xA0]+$/g, " "); + } + const lineTextWithoutIndent = lineText.substr(firstNonWhitespaceIdx - 1); + trimmedLinesContent += (insertSpace ? " " : "") + lineTextWithoutIndent; + if (insertSpace) { + columnDeltaOffset = lineTextWithoutIndent.length + 1; + } else { + columnDeltaOffset = lineTextWithoutIndent.length; + } + } else { + columnDeltaOffset = 0; + } + } + const deleteSelection = new Range(startLineNumber, startColumn, endLineNumber, endColumn); + if (!deleteSelection.isEmpty()) { + let resultSelection; + if (selection.isEmpty()) { + edits.push(EditOperation.replace(deleteSelection, trimmedLinesContent)); + resultSelection = new Selection(deleteSelection.startLineNumber - lineOffset, trimmedLinesContent.length - columnDeltaOffset + 1, startLineNumber - lineOffset, trimmedLinesContent.length - columnDeltaOffset + 1); + } else { + if (selection.startLineNumber === selection.endLineNumber) { + edits.push(EditOperation.replace(deleteSelection, trimmedLinesContent)); + resultSelection = new Selection(selection.startLineNumber - lineOffset, selection.startColumn, selection.endLineNumber - lineOffset, selection.endColumn); + } else { + edits.push(EditOperation.replace(deleteSelection, trimmedLinesContent)); + resultSelection = new Selection(selection.startLineNumber - lineOffset, selection.startColumn, selection.startLineNumber - lineOffset, trimmedLinesContent.length - selectionEndPositionOffset); + } + } + if (Range.intersectRanges(deleteSelection, primaryCursor) !== null) { + endPrimaryCursor = resultSelection; + } else { + endCursorState.push(resultSelection); + } + } + lineOffset += deleteSelection.endLineNumber - deleteSelection.startLineNumber; + } + endCursorState.unshift(endPrimaryCursor); + editor2.pushUndoStop(); + editor2.executeEdits(this.id, edits, endCursorState); + editor2.pushUndoStop(); + } +}; +var TransposeAction = class extends EditorAction { + constructor() { + super({ + id: "editor.action.transpose", + label: localize2(1267, "Transpose Characters around the Cursor"), + precondition: EditorContextKeys.writable, + canTriggerInlineEdits: true + }); + } + run(_accessor, editor2) { + const selections = editor2.getSelections(); + if (selections === null) { + return; + } + const model = editor2.getModel(); + if (model === null) { + return; + } + const commands = []; + for (let i2 = 0, len = selections.length; i2 < len; i2++) { + const selection = selections[i2]; + if (!selection.isEmpty()) { + continue; + } + const cursor = selection.getStartPosition(); + const maxColumn = model.getLineMaxColumn(cursor.lineNumber); + if (cursor.column >= maxColumn) { + if (cursor.lineNumber === model.getLineCount()) { + continue; + } + const deleteSelection = new Range(cursor.lineNumber, Math.max(1, cursor.column - 1), cursor.lineNumber + 1, 1); + const chars = model.getValueInRange(deleteSelection).split("").reverse().join(""); + commands.push(new ReplaceCommand(new Selection(cursor.lineNumber, Math.max(1, cursor.column - 1), cursor.lineNumber + 1, 1), chars)); + } else { + const deleteSelection = new Range(cursor.lineNumber, Math.max(1, cursor.column - 1), cursor.lineNumber, cursor.column + 1); + const chars = model.getValueInRange(deleteSelection).split("").reverse().join(""); + commands.push(new ReplaceCommandThatPreservesSelection(deleteSelection, chars, new Selection(cursor.lineNumber, cursor.column + 1, cursor.lineNumber, cursor.column + 1))); + } + } + editor2.pushUndoStop(); + editor2.executeCommands(this.id, commands); + editor2.pushUndoStop(); + } +}; +var AbstractCaseAction = class extends EditorAction { + run(_accessor, editor2) { + const selections = editor2.getSelections(); + if (selections === null) { + return; + } + const model = editor2.getModel(); + if (model === null) { + return; + } + const wordSeparators2 = editor2.getOption( + 148 + /* EditorOption.wordSeparators */ + ); + const textEdits = []; + for (const selection of selections) { + if (selection.isEmpty()) { + const cursor = selection.getStartPosition(); + const word = editor2.getConfiguredWordAtPosition(cursor); + if (!word) { + continue; + } + const wordRange = new Range(cursor.lineNumber, word.startColumn, cursor.lineNumber, word.endColumn); + const text2 = model.getValueInRange(wordRange); + textEdits.push(EditOperation.replace(wordRange, this._modifyText(text2, wordSeparators2))); + } else { + const text2 = model.getValueInRange(selection); + textEdits.push(EditOperation.replace(selection, this._modifyText(text2, wordSeparators2))); + } + } + editor2.pushUndoStop(); + editor2.executeEdits(this.id, textEdits); + editor2.pushUndoStop(); + } +}; +var UpperCaseAction = class extends AbstractCaseAction { + constructor() { + super({ + id: "editor.action.transformToUppercase", + label: localize2(1268, "Transform to Uppercase"), + precondition: EditorContextKeys.writable, + canTriggerInlineEdits: true + }); + } + _modifyText(text2, wordSeparators2) { + return text2.toLocaleUpperCase(); + } +}; +var LowerCaseAction = class extends AbstractCaseAction { + constructor() { + super({ + id: "editor.action.transformToLowercase", + label: localize2(1269, "Transform to Lowercase"), + precondition: EditorContextKeys.writable, + canTriggerInlineEdits: true + }); + } + _modifyText(text2, wordSeparators2) { + return text2.toLocaleLowerCase(); + } +}; +var BackwardsCompatibleRegExp = class { + constructor(_pattern, _flags) { + this._pattern = _pattern; + this._flags = _flags; + this._actual = null; + this._evaluated = false; + } + get() { + if (!this._evaluated) { + this._evaluated = true; + try { + this._actual = new RegExp(this._pattern, this._flags); + } catch (err) { + } + } + return this._actual; + } + isSupported() { + return this.get() !== null; + } +}; +var TitleCaseAction = class _TitleCaseAction extends AbstractCaseAction { + static { + this.titleBoundary = new BackwardsCompatibleRegExp("(^|[^\\p{L}\\p{N}']|((^|\\P{L})'))\\p{L}", "gmu"); + } + constructor() { + super({ + id: "editor.action.transformToTitlecase", + label: localize2(1270, "Transform to Title Case"), + precondition: EditorContextKeys.writable, + canTriggerInlineEdits: true + }); + } + _modifyText(text2, wordSeparators2) { + const titleBoundary = _TitleCaseAction.titleBoundary.get(); + if (!titleBoundary) { + return text2; + } + return text2.toLocaleLowerCase().replace(titleBoundary, (b) => b.toLocaleUpperCase()); + } +}; +var SnakeCaseAction = class _SnakeCaseAction extends AbstractCaseAction { + static { + this.caseBoundary = new BackwardsCompatibleRegExp("(\\p{Ll})(\\p{Lu})", "gmu"); + } + static { + this.singleLetters = new BackwardsCompatibleRegExp("(\\p{Lu}|\\p{N})(\\p{Lu})(\\p{Ll})", "gmu"); + } + constructor() { + super({ + id: "editor.action.transformToSnakecase", + label: localize2(1271, "Transform to Snake Case"), + precondition: EditorContextKeys.writable, + canTriggerInlineEdits: true + }); + } + _modifyText(text2, wordSeparators2) { + const caseBoundary = _SnakeCaseAction.caseBoundary.get(); + const singleLetters = _SnakeCaseAction.singleLetters.get(); + if (!caseBoundary || !singleLetters) { + return text2; + } + return text2.replace(caseBoundary, "$1_$2").replace(singleLetters, "$1_$2$3").toLocaleLowerCase(); + } +}; +var CamelCaseAction = class _CamelCaseAction extends AbstractCaseAction { + static { + this.singleLineWordBoundary = new BackwardsCompatibleRegExp("[_\\s-]+", "gm"); + } + static { + this.multiLineWordBoundary = new BackwardsCompatibleRegExp("[_-]+", "gm"); + } + static { + this.validWordStart = new BackwardsCompatibleRegExp("^(\\p{Lu}[^\\p{Lu}])", "gmu"); + } + constructor() { + super({ + id: "editor.action.transformToCamelcase", + label: localize2(1272, "Transform to Camel Case"), + precondition: EditorContextKeys.writable, + canTriggerInlineEdits: true + }); + } + _modifyText(text2, wordSeparators2) { + const wordBoundary = /\r\n|\r|\n/.test(text2) ? _CamelCaseAction.multiLineWordBoundary.get() : _CamelCaseAction.singleLineWordBoundary.get(); + const validWordStart = _CamelCaseAction.validWordStart.get(); + if (!wordBoundary || !validWordStart) { + return text2; + } + const words = text2.split(wordBoundary); + const firstWord = words.shift()?.replace(validWordStart, (start) => start.toLocaleLowerCase()); + return firstWord + words.map((word) => word.substring(0, 1).toLocaleUpperCase() + word.substring(1)).join(""); + } +}; +var PascalCaseAction = class _PascalCaseAction extends AbstractCaseAction { + static { + this.wordBoundary = new BackwardsCompatibleRegExp("[_ \\t-]", "gm"); + } + static { + this.wordBoundaryToMaintain = new BackwardsCompatibleRegExp("(?<=\\.)", "gm"); + } + static { + this.upperCaseWordMatcher = new BackwardsCompatibleRegExp("^\\p{Lu}+$", "mu"); + } + constructor() { + super({ + id: "editor.action.transformToPascalcase", + label: localize2(1273, "Transform to Pascal Case"), + precondition: EditorContextKeys.writable, + canTriggerInlineEdits: true + }); + } + _modifyText(text2, wordSeparators2) { + const wordBoundary = _PascalCaseAction.wordBoundary.get(); + const wordBoundaryToMaintain = _PascalCaseAction.wordBoundaryToMaintain.get(); + const upperCaseWordMatcher = _PascalCaseAction.upperCaseWordMatcher.get(); + if (!wordBoundary || !wordBoundaryToMaintain || !upperCaseWordMatcher) { + return text2; + } + const wordsWithMaintainBoundaries = text2.split(wordBoundaryToMaintain); + const words = wordsWithMaintainBoundaries.map((word) => word.split(wordBoundary)).flat(); + return words.map((word) => { + const normalizedWord = word.charAt(0).toLocaleUpperCase() + word.slice(1); + const isAllCaps = normalizedWord.length > 1 && upperCaseWordMatcher.test(normalizedWord); + if (isAllCaps) { + return normalizedWord.charAt(0) + normalizedWord.slice(1).toLocaleLowerCase(); + } + return normalizedWord; + }).join(""); + } +}; +var KebabCaseAction = class _KebabCaseAction extends AbstractCaseAction { + static isSupported() { + const areAllRegexpsSupported = [ + this.caseBoundary, + this.singleLetters, + this.underscoreBoundary + ].every((regexp) => regexp.isSupported()); + return areAllRegexpsSupported; + } + static { + this.caseBoundary = new BackwardsCompatibleRegExp("(\\p{Ll})(\\p{Lu})", "gmu"); + } + static { + this.singleLetters = new BackwardsCompatibleRegExp("(\\p{Lu}|\\p{N})(\\p{Lu}\\p{Ll})", "gmu"); + } + static { + this.underscoreBoundary = new BackwardsCompatibleRegExp("(\\S)(_)(\\S)", "gm"); + } + constructor() { + super({ + id: "editor.action.transformToKebabcase", + label: localize2(1274, "Transform to Kebab Case"), + precondition: EditorContextKeys.writable, + canTriggerInlineEdits: true + }); + } + _modifyText(text2, _) { + const caseBoundary = _KebabCaseAction.caseBoundary.get(); + const singleLetters = _KebabCaseAction.singleLetters.get(); + const underscoreBoundary = _KebabCaseAction.underscoreBoundary.get(); + if (!caseBoundary || !singleLetters || !underscoreBoundary) { + return text2; + } + return text2.replace(underscoreBoundary, "$1-$3").replace(caseBoundary, "$1-$2").replace(singleLetters, "$1-$2").toLocaleLowerCase(); + } +}; +registerEditorAction(CopyLinesUpAction); +registerEditorAction(CopyLinesDownAction); +registerEditorAction(DuplicateSelectionAction); +registerEditorAction(MoveLinesUpAction); +registerEditorAction(MoveLinesDownAction); +registerEditorAction(SortLinesAscendingAction); +registerEditorAction(SortLinesDescendingAction); +registerEditorAction(DeleteDuplicateLinesAction); +registerEditorAction(TrimTrailingWhitespaceAction); +registerEditorAction(DeleteLinesAction); +registerEditorAction(IndentLinesAction); +registerEditorAction(OutdentLinesAction); +registerEditorAction(InsertLineBeforeAction); +registerEditorAction(InsertLineAfterAction); +registerEditorAction(DeleteAllLeftAction); +registerEditorAction(DeleteAllRightAction); +registerEditorAction(JoinLinesAction); +registerEditorAction(TransposeAction); +registerEditorAction(UpperCaseAction); +registerEditorAction(LowerCaseAction); +registerEditorAction(ReverseLinesAction); +if (SnakeCaseAction.caseBoundary.isSupported() && SnakeCaseAction.singleLetters.isSupported()) { + registerEditorAction(SnakeCaseAction); +} +if (CamelCaseAction.singleLineWordBoundary.isSupported() && CamelCaseAction.multiLineWordBoundary.isSupported()) { + registerEditorAction(CamelCaseAction); +} +if (PascalCaseAction.wordBoundary.isSupported()) { + registerEditorAction(PascalCaseAction); +} +if (TitleCaseAction.titleBoundary.isSupported()) { + registerEditorAction(TitleCaseAction); +} +if (KebabCaseAction.isSupported()) { + registerEditorAction(KebabCaseAction); +} + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/inlineCompletions/browser/model/changeRecorder.js +init_lifecycle(); +init_observable(); +init_instantiation(); +init_log(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/inlineCompletions/browser/structuredLogger.js +init_lifecycle(); +init_observable(); +init_contextkey(); + +// node_modules/monaco-editor-core/esm/vs/platform/dataChannel/common/dataChannel.js +init_instantiation(); +var IDataChannelService = createDecorator("dataChannelService"); +var NullDataChannelService = class { + getDataChannel(_channelId) { + return { + sendData: () => { + } + }; + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/inlineCompletions/browser/structuredLogger.js +var __decorate98 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param92 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var StructuredLogger_1; +function formatRecordableLogEntry(entry) { + return entry.sourceId + " @@ " + JSON.stringify({ ...entry, modelUri: entry.modelUri?.toString(), sourceId: void 0 }); +} +var StructuredLogger = StructuredLogger_1 = class StructuredLogger2 extends Disposable { + static cast() { + return this; + } + constructor(_key, _contextKeyService, _dataChannelService) { + super(); + this._key = _key; + this._contextKeyService = _contextKeyService; + this._dataChannelService = _dataChannelService; + this._isEnabledContextKeyValue = observableContextKey("structuredLogger.enabled:" + this._key, this._contextKeyService).recomputeInitiallyAndOnChange(this._store); + this.isEnabled = this._isEnabledContextKeyValue.map((v) => v !== void 0); + } + log(data) { + const enabled = this._isEnabledContextKeyValue.get(); + if (!enabled) { + return false; + } + this._dataChannelService.getDataChannel("structuredLogger:" + this._key).sendData(data); + return true; + } +}; +StructuredLogger = StructuredLogger_1 = __decorate98([ + __param92(1, IContextKeyService), + __param92(2, IDataChannelService) +], StructuredLogger); +function observableContextKey(key, contextKeyService) { + return observableFromEvent(contextKeyService.onDidChangeContext, () => contextKeyService.getContextKeyValue(key)); +} + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/inlineCompletions/browser/model/changeRecorder.js +var __decorate99 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param93 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var TextModelChangeRecorder = class TextModelChangeRecorder2 extends Disposable { + constructor(_editor, _instantiationService, _loggerService) { + super(); + this._editor = _editor; + this._instantiationService = _instantiationService; + this._loggerService = _loggerService; + this._structuredLogger = this._register(this._instantiationService.createInstance(StructuredLogger.cast(), "editor.inlineSuggest.logChangeReason.commandId")); + const logger = this._loggerService?.createLogger("textModelChanges", { hidden: false, name: "Text Model Changes Reason" }); + const loggingLevel = observableFromEvent(this, logger.onDidChangeLogLevel, () => logger.getLevel()); + this._register(autorun((reader) => { + if (!canLog(loggingLevel.read(reader), LogLevel.Trace)) { + return; + } + reader.store.add(this._editor.onDidChangeModelContent((e) => { + if (this._editor.getModel()?.uri.scheme === "output") { + return; + } + logger.trace("onDidChangeModelContent: " + e.detailedReasons.map((r) => r.toKey(Number.MAX_VALUE)).join(", ")); + })); + })); + this._register(autorun((reader) => { + if (!(this._editor instanceof CodeEditorWidget)) { + return; + } + if (!this._structuredLogger.isEnabled.read(reader)) { + return; + } + reader.store.add(this._editor.onDidChangeModelContent((e) => { + const tm = this._editor.getModel(); + if (!tm) { + return; + } + const reason = e.detailedReasons[0]; + const data = { + ...reason.metadata, + sourceId: "TextModel.setChangeReason", + source: reason.metadata.source, + time: Date.now(), + modelUri: tm.uri, + modelVersion: tm.getVersionId() + }; + setTimeout(() => { + this._structuredLogger.log(data); + }, 0); + })); + })); + } +}; +TextModelChangeRecorder = __decorate99([ + __param93(1, IInstantiationService), + __param93(2, ILoggerService) +], TextModelChangeRecorder); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js +init_arraysFind(); +init_equals(); +init_errors(); +init_event(); +init_lifecycle(); +init_observable(); +init_strings(); +init_types(); +init_commands(); +init_instantiation(); +init_observableCodeEditor(); +init_cursorColumns(); +init_lineRange(); +init_position(); +init_range(); +init_selection(); +init_textLength(); +init_languages(); +init_languageConfigurationRegistry(); +init_languageFeatures(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/snippet/browser/snippetController2.js +init_lifecycle(); +init_types(); +init_editorExtensions(); +init_position(); +init_editorContextKeys(); +init_languageConfigurationRegistry(); +init_languageFeatures(); +init_nls(); +init_contextkey(); +init_log(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/snippet/browser/snippetSession.js +init_arrays(); +init_lifecycle(); +init_strings(); +init_range(); +init_selection(); +init_languageConfigurationRegistry(); +init_textModel(); + +// node_modules/monaco-editor-core/esm/vs/base/common/labels.js +init_extpath(); +init_platform(); +function normalizeDriveLetter(path, isWindowsOS = isWindows) { + if (hasDriveLetter(path, isWindowsOS)) { + return path.charAt(0).toUpperCase() + path.slice(1); + } + return path; +} + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/snippet/browser/snippetVariables.js +init_path(); +init_resources(); +init_strings(); +init_uuid(); +init_languageConfigurationRegistry(); +init_nls(); +var __decorate100 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param94 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var KnownSnippetVariableNames = Object.freeze({ + "CURRENT_YEAR": true, + "CURRENT_YEAR_SHORT": true, + "CURRENT_MONTH": true, + "CURRENT_DATE": true, + "CURRENT_HOUR": true, + "CURRENT_MINUTE": true, + "CURRENT_SECOND": true, + "CURRENT_DAY_NAME": true, + "CURRENT_DAY_NAME_SHORT": true, + "CURRENT_MONTH_NAME": true, + "CURRENT_MONTH_NAME_SHORT": true, + "CURRENT_SECONDS_UNIX": true, + "CURRENT_TIMEZONE_OFFSET": true, + "SELECTION": true, + "CLIPBOARD": true, + "TM_SELECTED_TEXT": true, + "TM_CURRENT_LINE": true, + "TM_CURRENT_WORD": true, + "TM_LINE_INDEX": true, + "TM_LINE_NUMBER": true, + "TM_FILENAME": true, + "TM_FILENAME_BASE": true, + "TM_DIRECTORY": true, + "TM_DIRECTORY_BASE": true, + "TM_FILEPATH": true, + "CURSOR_INDEX": true, + // 0-offset + "CURSOR_NUMBER": true, + // 1-offset + "RELATIVE_FILEPATH": true, + "BLOCK_COMMENT_START": true, + "BLOCK_COMMENT_END": true, + "LINE_COMMENT": true, + "WORKSPACE_NAME": true, + "WORKSPACE_FOLDER": true, + "RANDOM": true, + "RANDOM_HEX": true, + "UUID": true +}); +var CompositeSnippetVariableResolver = class { + constructor(_delegates) { + this._delegates = _delegates; + } + resolve(variable) { + for (const delegate of this._delegates) { + const value = delegate.resolve(variable); + if (value !== void 0) { + return value; + } + } + return void 0; + } +}; +var SelectionBasedVariableResolver = class { + constructor(_model, _selection, _selectionIdx, _overtypingCapturer) { + this._model = _model; + this._selection = _selection; + this._selectionIdx = _selectionIdx; + this._overtypingCapturer = _overtypingCapturer; + } + resolve(variable) { + const { name } = variable; + if (name === "SELECTION" || name === "TM_SELECTED_TEXT") { + let value = this._model.getValueInRange(this._selection) || void 0; + let isMultiline = this._selection.startLineNumber !== this._selection.endLineNumber; + if (!value && this._overtypingCapturer) { + const info = this._overtypingCapturer.getLastOvertypedInfo(this._selectionIdx); + if (info) { + value = info.value; + isMultiline = info.multiline; + } + } + if (value && isMultiline && variable.snippet) { + const line = this._model.getLineContent(this._selection.startLineNumber); + const lineLeadingWhitespace = getLeadingWhitespace(line, 0, this._selection.startColumn - 1); + let varLeadingWhitespace = lineLeadingWhitespace; + variable.snippet.walk((marker) => { + if (marker === variable) { + return false; + } + if (marker instanceof Text) { + varLeadingWhitespace = getLeadingWhitespace(splitLines(marker.value).pop()); + } + return true; + }); + const whitespaceCommonLength = commonPrefixLength(varLeadingWhitespace, lineLeadingWhitespace); + value = value.replace(/(\r\n|\r|\n)(.*)/g, (m, newline2, rest) => `${newline2}${varLeadingWhitespace.substr(whitespaceCommonLength)}${rest}`); + } + return value; + } else if (name === "TM_CURRENT_LINE") { + return this._model.getLineContent(this._selection.positionLineNumber); + } else if (name === "TM_CURRENT_WORD") { + const info = this._model.getWordAtPosition({ + lineNumber: this._selection.positionLineNumber, + column: this._selection.positionColumn + }); + return info && info.word || void 0; + } else if (name === "TM_LINE_INDEX") { + return String(this._selection.positionLineNumber - 1); + } else if (name === "TM_LINE_NUMBER") { + return String(this._selection.positionLineNumber); + } else if (name === "CURSOR_INDEX") { + return String(this._selectionIdx); + } else if (name === "CURSOR_NUMBER") { + return String(this._selectionIdx + 1); + } + return void 0; + } +}; +var ModelBasedVariableResolver = class { + constructor(_labelService, _model) { + this._labelService = _labelService; + this._model = _model; + } + resolve(variable) { + const { name } = variable; + if (name === "TM_FILENAME") { + return basename(this._model.uri.fsPath); + } else if (name === "TM_FILENAME_BASE") { + const name2 = basename(this._model.uri.fsPath); + const idx = name2.lastIndexOf("."); + if (idx <= 0) { + return name2; + } else { + return name2.slice(0, idx); + } + } else if (name === "TM_DIRECTORY") { + if (dirname(this._model.uri.fsPath) === ".") { + return ""; + } + return this._labelService.getUriLabel(dirname2(this._model.uri)); + } else if (name === "TM_DIRECTORY_BASE") { + if (dirname(this._model.uri.fsPath) === ".") { + return ""; + } + return basename(dirname(this._model.uri.fsPath)); + } else if (name === "TM_FILEPATH") { + return this._labelService.getUriLabel(this._model.uri); + } else if (name === "RELATIVE_FILEPATH") { + return this._labelService.getUriLabel(this._model.uri, { relative: true, noPrefix: true }); + } + return void 0; + } +}; +var ClipboardBasedVariableResolver = class { + constructor(_readClipboardText, _selectionIdx, _selectionCount, _spread) { + this._readClipboardText = _readClipboardText; + this._selectionIdx = _selectionIdx; + this._selectionCount = _selectionCount; + this._spread = _spread; + } + resolve(variable) { + if (variable.name !== "CLIPBOARD") { + return void 0; + } + const clipboardText = this._readClipboardText(); + if (!clipboardText) { + return void 0; + } + if (this._spread) { + const lines = clipboardText.split(/\r\n|\n|\r/).filter((s) => !isFalsyOrWhitespace(s)); + if (lines.length === this._selectionCount) { + return lines[this._selectionIdx]; + } + } + return clipboardText; + } +}; +var CommentBasedVariableResolver = class CommentBasedVariableResolver2 { + constructor(_model, _selection, _languageConfigurationService) { + this._model = _model; + this._selection = _selection; + this._languageConfigurationService = _languageConfigurationService; + } + resolve(variable) { + const { name } = variable; + const langId = this._model.getLanguageIdAtPosition(this._selection.selectionStartLineNumber, this._selection.selectionStartColumn); + const config = this._languageConfigurationService.getLanguageConfiguration(langId).comments; + if (!config) { + return void 0; + } + if (name === "LINE_COMMENT") { + return config.lineCommentToken || void 0; + } else if (name === "BLOCK_COMMENT_START") { + return config.blockCommentStartToken || void 0; + } else if (name === "BLOCK_COMMENT_END") { + return config.blockCommentEndToken || void 0; + } + return void 0; + } +}; +CommentBasedVariableResolver = __decorate100([ + __param94(2, ILanguageConfigurationService) +], CommentBasedVariableResolver); +var TimeBasedVariableResolver = class _TimeBasedVariableResolver { + constructor() { + this._date = /* @__PURE__ */ new Date(); + } + static { + this.dayNames = [localize(1406, "Sunday"), localize(1407, "Monday"), localize(1408, "Tuesday"), localize(1409, "Wednesday"), localize(1410, "Thursday"), localize(1411, "Friday"), localize(1412, "Saturday")]; + } + static { + this.dayNamesShort = [localize(1413, "Sun"), localize(1414, "Mon"), localize(1415, "Tue"), localize(1416, "Wed"), localize(1417, "Thu"), localize(1418, "Fri"), localize(1419, "Sat")]; + } + static { + this.monthNames = [localize(1420, "January"), localize(1421, "February"), localize(1422, "March"), localize(1423, "April"), localize(1424, "May"), localize(1425, "June"), localize(1426, "July"), localize(1427, "August"), localize(1428, "September"), localize(1429, "October"), localize(1430, "November"), localize(1431, "December")]; + } + static { + this.monthNamesShort = [localize(1432, "Jan"), localize(1433, "Feb"), localize(1434, "Mar"), localize(1435, "Apr"), localize(1436, "May"), localize(1437, "Jun"), localize(1438, "Jul"), localize(1439, "Aug"), localize(1440, "Sep"), localize(1441, "Oct"), localize(1442, "Nov"), localize(1443, "Dec")]; + } + resolve(variable) { + const { name } = variable; + if (name === "CURRENT_YEAR") { + return String(this._date.getFullYear()); + } else if (name === "CURRENT_YEAR_SHORT") { + return String(this._date.getFullYear()).slice(-2); + } else if (name === "CURRENT_MONTH") { + return String(this._date.getMonth().valueOf() + 1).padStart(2, "0"); + } else if (name === "CURRENT_DATE") { + return String(this._date.getDate().valueOf()).padStart(2, "0"); + } else if (name === "CURRENT_HOUR") { + return String(this._date.getHours().valueOf()).padStart(2, "0"); + } else if (name === "CURRENT_MINUTE") { + return String(this._date.getMinutes().valueOf()).padStart(2, "0"); + } else if (name === "CURRENT_SECOND") { + return String(this._date.getSeconds().valueOf()).padStart(2, "0"); + } else if (name === "CURRENT_DAY_NAME") { + return _TimeBasedVariableResolver.dayNames[this._date.getDay()]; + } else if (name === "CURRENT_DAY_NAME_SHORT") { + return _TimeBasedVariableResolver.dayNamesShort[this._date.getDay()]; + } else if (name === "CURRENT_MONTH_NAME") { + return _TimeBasedVariableResolver.monthNames[this._date.getMonth()]; + } else if (name === "CURRENT_MONTH_NAME_SHORT") { + return _TimeBasedVariableResolver.monthNamesShort[this._date.getMonth()]; + } else if (name === "CURRENT_SECONDS_UNIX") { + return String(Math.floor(this._date.getTime() / 1e3)); + } else if (name === "CURRENT_TIMEZONE_OFFSET") { + const rawTimeOffset = this._date.getTimezoneOffset(); + const sign = rawTimeOffset > 0 ? "-" : "+"; + const hours = Math.trunc(Math.abs(rawTimeOffset / 60)); + const hoursString = hours < 10 ? "0" + hours : hours; + const minutes = Math.abs(rawTimeOffset) - hours * 60; + const minutesString = minutes < 10 ? "0" + minutes : minutes; + return sign + hoursString + ":" + minutesString; + } + return void 0; + } +}; +var WorkspaceBasedVariableResolver = class { + constructor(_workspaceService) { + this._workspaceService = _workspaceService; + } + resolve(variable) { + if (!this._workspaceService) { + return void 0; + } + const workspaceIdentifier = toWorkspaceIdentifier(this._workspaceService.getWorkspace()); + if (isEmptyWorkspaceIdentifier(workspaceIdentifier)) { + return void 0; + } + if (variable.name === "WORKSPACE_NAME") { + return this._resolveWorkspaceName(workspaceIdentifier); + } else if (variable.name === "WORKSPACE_FOLDER") { + return this._resoveWorkspacePath(workspaceIdentifier); + } + return void 0; + } + _resolveWorkspaceName(workspaceIdentifier) { + if (isSingleFolderWorkspaceIdentifier(workspaceIdentifier)) { + return basename(workspaceIdentifier.uri.path); + } + let filename = basename(workspaceIdentifier.configPath.path); + if (filename.endsWith(WORKSPACE_EXTENSION)) { + filename = filename.substr(0, filename.length - WORKSPACE_EXTENSION.length - 1); + } + return filename; + } + _resoveWorkspacePath(workspaceIdentifier) { + if (isSingleFolderWorkspaceIdentifier(workspaceIdentifier)) { + return normalizeDriveLetter(workspaceIdentifier.uri.fsPath); + } + const filename = basename(workspaceIdentifier.configPath.path); + let folderpath = workspaceIdentifier.configPath.fsPath; + if (folderpath.endsWith(filename)) { + folderpath = folderpath.substr(0, folderpath.length - filename.length - 1); + } + return folderpath ? normalizeDriveLetter(folderpath) : "/"; + } +}; +var RandomBasedVariableResolver = class { + resolve(variable) { + const { name } = variable; + if (name === "RANDOM") { + return Math.random().toString().slice(-6); + } else if (name === "RANDOM_HEX") { + return Math.random().toString(16).slice(-6); + } else if (name === "UUID") { + return generateUuid(); + } + return void 0; + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/snippet/browser/snippetSession.js +init_textModelEditSource(); +var __decorate101 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param95 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var SnippetSession_1; +var OneSnippet = class _OneSnippet { + static { + this._decor = { + active: ModelDecorationOptions.register({ description: "snippet-placeholder-1", stickiness: 0, className: "snippet-placeholder" }), + inactive: ModelDecorationOptions.register({ description: "snippet-placeholder-2", stickiness: 1, className: "snippet-placeholder" }), + activeFinal: ModelDecorationOptions.register({ description: "snippet-placeholder-3", stickiness: 1, className: "finish-snippet-placeholder" }), + inactiveFinal: ModelDecorationOptions.register({ description: "snippet-placeholder-4", stickiness: 1, className: "finish-snippet-placeholder" }) + }; + } + constructor(_editor, _snippet, _snippetLineLeadingWhitespace) { + this._editor = _editor; + this._snippet = _snippet; + this._snippetLineLeadingWhitespace = _snippetLineLeadingWhitespace; + this._offset = -1; + this._nestingLevel = 1; + this._placeholderGroups = groupBy(_snippet.placeholders, Placeholder.compareByIndex); + this._placeholderGroupsIdx = -1; + } + initialize(textChange) { + this._offset = textChange.newPosition; + } + dispose() { + if (this._placeholderDecorations) { + this._editor.removeDecorations([...this._placeholderDecorations.values()]); + } + this._placeholderGroups.length = 0; + } + _initDecorations() { + if (this._offset === -1) { + throw new Error(`Snippet not initialized!`); + } + if (this._placeholderDecorations) { + return; + } + this._placeholderDecorations = /* @__PURE__ */ new Map(); + const model = this._editor.getModel(); + this._editor.changeDecorations((accessor) => { + for (const placeholder of this._snippet.placeholders) { + const placeholderOffset = this._snippet.offset(placeholder); + const placeholderLen = this._snippet.fullLen(placeholder); + const range2 = Range.fromPositions(model.getPositionAt(this._offset + placeholderOffset), model.getPositionAt(this._offset + placeholderOffset + placeholderLen)); + const options2 = placeholder.isFinalTabstop ? _OneSnippet._decor.inactiveFinal : _OneSnippet._decor.inactive; + const handle = accessor.addDecoration(range2, options2); + this._placeholderDecorations.set(placeholder, handle); + } + }); + } + move(fwd) { + if (!this._editor.hasModel()) { + return []; + } + this._initDecorations(); + if (this._placeholderGroupsIdx >= 0) { + const operations = []; + for (const placeholder of this._placeholderGroups[this._placeholderGroupsIdx]) { + if (placeholder.transform) { + const id = this._placeholderDecorations.get(placeholder); + const range2 = this._editor.getModel().getDecorationRange(id); + const currentValue = this._editor.getModel().getValueInRange(range2); + const transformedValueLines = placeholder.transform.resolve(currentValue).split(/\r\n|\r|\n/); + for (let i2 = 1; i2 < transformedValueLines.length; i2++) { + transformedValueLines[i2] = this._editor.getModel().normalizeIndentation(this._snippetLineLeadingWhitespace + transformedValueLines[i2]); + } + operations.push(EditOperation.replace(range2, transformedValueLines.join(this._editor.getModel().getEOL()))); + } + } + if (operations.length > 0) { + this._editor.executeEdits("snippet.placeholderTransform", operations); + } + } + let couldSkipThisPlaceholder = false; + if (fwd === true && this._placeholderGroupsIdx < this._placeholderGroups.length - 1) { + this._placeholderGroupsIdx += 1; + couldSkipThisPlaceholder = true; + } else if (fwd === false && this._placeholderGroupsIdx > 0) { + this._placeholderGroupsIdx -= 1; + couldSkipThisPlaceholder = true; + } else { + } + const newSelections = this._editor.getModel().changeDecorations((accessor) => { + const activePlaceholders = /* @__PURE__ */ new Set(); + const selections = []; + for (const placeholder of this._placeholderGroups[this._placeholderGroupsIdx]) { + const id = this._placeholderDecorations.get(placeholder); + const range2 = this._editor.getModel().getDecorationRange(id); + selections.push(new Selection(range2.startLineNumber, range2.startColumn, range2.endLineNumber, range2.endColumn)); + couldSkipThisPlaceholder = couldSkipThisPlaceholder && this._hasPlaceholderBeenCollapsed(placeholder); + accessor.changeDecorationOptions(id, placeholder.isFinalTabstop ? _OneSnippet._decor.activeFinal : _OneSnippet._decor.active); + activePlaceholders.add(placeholder); + for (const enclosingPlaceholder of this._snippet.enclosingPlaceholders(placeholder)) { + const id2 = this._placeholderDecorations.get(enclosingPlaceholder); + accessor.changeDecorationOptions(id2, enclosingPlaceholder.isFinalTabstop ? _OneSnippet._decor.activeFinal : _OneSnippet._decor.active); + activePlaceholders.add(enclosingPlaceholder); + } + } + for (const [placeholder, id] of this._placeholderDecorations) { + if (!activePlaceholders.has(placeholder)) { + accessor.changeDecorationOptions(id, placeholder.isFinalTabstop ? _OneSnippet._decor.inactiveFinal : _OneSnippet._decor.inactive); + } + } + return selections; + }); + return !couldSkipThisPlaceholder ? newSelections ?? [] : this.move(fwd); + } + _hasPlaceholderBeenCollapsed(placeholder) { + let marker = placeholder; + while (marker) { + if (marker instanceof Placeholder) { + const id = this._placeholderDecorations.get(marker); + const range2 = this._editor.getModel().getDecorationRange(id); + if (range2.isEmpty() && marker.toString().length > 0) { + return true; + } + } + marker = marker.parent; + } + return false; + } + get isAtFirstPlaceholder() { + return this._placeholderGroupsIdx <= 0 || this._placeholderGroups.length === 0; + } + get isAtLastPlaceholder() { + return this._placeholderGroupsIdx === this._placeholderGroups.length - 1; + } + get hasPlaceholder() { + return this._snippet.placeholders.length > 0; + } + /** + * A snippet is trivial when it has no placeholder or only a final placeholder at + * its very end + */ + get isTrivialSnippet() { + if (this._snippet.placeholders.length === 0) { + return true; + } + if (this._snippet.placeholders.length === 1) { + const [placeholder] = this._snippet.placeholders; + if (placeholder.isFinalTabstop) { + if (this._snippet.rightMostDescendant === placeholder) { + return true; + } + } + } + return false; + } + computePossibleSelections() { + const result = /* @__PURE__ */ new Map(); + for (const placeholdersWithEqualIndex of this._placeholderGroups) { + let ranges; + for (const placeholder of placeholdersWithEqualIndex) { + if (placeholder.isFinalTabstop) { + break; + } + if (!ranges) { + ranges = []; + result.set(placeholder.index, ranges); + } + const id = this._placeholderDecorations.get(placeholder); + const range2 = this._editor.getModel().getDecorationRange(id); + if (!range2) { + result.delete(placeholder.index); + break; + } + ranges.push(range2); + } + } + return result; + } + get activeChoice() { + if (!this._placeholderDecorations) { + return void 0; + } + const placeholder = this._placeholderGroups[this._placeholderGroupsIdx][0]; + if (!placeholder?.choice) { + return void 0; + } + const id = this._placeholderDecorations.get(placeholder); + if (!id) { + return void 0; + } + const range2 = this._editor.getModel().getDecorationRange(id); + if (!range2) { + return void 0; + } + return { range: range2, choice: placeholder.choice }; + } + get hasChoice() { + let result = false; + this._snippet.walk((marker) => { + result = marker instanceof Choice; + return !result; + }); + return result; + } + merge(others) { + const model = this._editor.getModel(); + this._nestingLevel *= 10; + this._editor.changeDecorations((accessor) => { + for (const placeholder of this._placeholderGroups[this._placeholderGroupsIdx]) { + const nested = others.shift(); + console.assert(nested._offset !== -1); + console.assert(!nested._placeholderDecorations); + const indexLastPlaceholder = nested._snippet.placeholderInfo.last.index; + for (const nestedPlaceholder of nested._snippet.placeholderInfo.all) { + if (nestedPlaceholder.isFinalTabstop) { + nestedPlaceholder.index = placeholder.index + (indexLastPlaceholder + 1) / this._nestingLevel; + } else { + nestedPlaceholder.index = placeholder.index + nestedPlaceholder.index / this._nestingLevel; + } + } + this._snippet.replace(placeholder, nested._snippet.children); + const id = this._placeholderDecorations.get(placeholder); + accessor.removeDecoration(id); + this._placeholderDecorations.delete(placeholder); + for (const placeholder2 of nested._snippet.placeholders) { + const placeholderOffset = nested._snippet.offset(placeholder2); + const placeholderLen = nested._snippet.fullLen(placeholder2); + const range2 = Range.fromPositions(model.getPositionAt(nested._offset + placeholderOffset), model.getPositionAt(nested._offset + placeholderOffset + placeholderLen)); + const handle = accessor.addDecoration(range2, _OneSnippet._decor.inactive); + this._placeholderDecorations.set(placeholder2, handle); + } + } + this._placeholderGroups = groupBy(this._snippet.placeholders, Placeholder.compareByIndex); + }); + } +}; +var _defaultOptions = { + overwriteBefore: 0, + overwriteAfter: 0, + adjustWhitespace: true, + clipboardText: void 0, + overtypingCapturer: void 0 +}; +var SnippetSession = SnippetSession_1 = class SnippetSession2 { + static adjustWhitespace(model, position, adjustIndentation, snippet, filter) { + const line = model.getLineContent(position.lineNumber); + const lineLeadingWhitespace = getLeadingWhitespace(line, 0, position.column - 1); + let snippetTextString; + snippet.walk((marker) => { + if (!(marker instanceof Text) || marker.parent instanceof Choice) { + return true; + } + if (filter && !filter.has(marker)) { + return true; + } + const lines = marker.value.split(/\r\n|\r|\n/); + if (adjustIndentation) { + const offset = snippet.offset(marker); + if (offset === 0) { + lines[0] = model.normalizeIndentation(lines[0]); + } else { + snippetTextString = snippetTextString ?? snippet.toString(); + const prevChar = snippetTextString.charCodeAt(offset - 1); + if (prevChar === 10 || prevChar === 13) { + lines[0] = model.normalizeIndentation(lineLeadingWhitespace + lines[0]); + } + } + for (let i2 = 1; i2 < lines.length; i2++) { + lines[i2] = model.normalizeIndentation(lineLeadingWhitespace + lines[i2]); + } + } + const newValue = lines.join(model.getEOL()); + if (newValue !== marker.value) { + marker.parent.replace(marker, [new Text(newValue)]); + snippetTextString = void 0; + } + return true; + }); + return lineLeadingWhitespace; + } + static adjustSelection(model, selection, overwriteBefore, overwriteAfter) { + if (overwriteBefore !== 0 || overwriteAfter !== 0) { + const { positionLineNumber, positionColumn } = selection; + const positionColumnBefore = positionColumn - overwriteBefore; + const positionColumnAfter = positionColumn + overwriteAfter; + const range2 = model.validateRange({ + startLineNumber: positionLineNumber, + startColumn: positionColumnBefore, + endLineNumber: positionLineNumber, + endColumn: positionColumnAfter + }); + selection = Selection.createWithDirection(range2.startLineNumber, range2.startColumn, range2.endLineNumber, range2.endColumn, selection.getDirection()); + } + return selection; + } + static createEditsAndSnippetsFromSelections(editor2, template, overwriteBefore, overwriteAfter, enforceFinalTabstop, adjustWhitespace, clipboardText, overtypingCapturer, languageConfigurationService) { + const edits = []; + const snippets = []; + if (!editor2.hasModel()) { + return { edits, snippets }; + } + const model = editor2.getModel(); + const workspaceService = editor2.invokeWithinContext((accessor) => accessor.get(IWorkspaceContextService)); + const modelBasedVariableResolver = editor2.invokeWithinContext((accessor) => new ModelBasedVariableResolver(accessor.get(ILabelService), model)); + const readClipboardText = () => clipboardText; + const firstBeforeText = model.getValueInRange(SnippetSession_1.adjustSelection(model, editor2.getSelection(), overwriteBefore, 0)); + const firstAfterText = model.getValueInRange(SnippetSession_1.adjustSelection(model, editor2.getSelection(), 0, overwriteAfter)); + const firstLineFirstNonWhitespace = model.getLineFirstNonWhitespaceColumn(editor2.getSelection().positionLineNumber); + const indexedSelections = editor2.getSelections().map((selection, idx) => ({ selection, idx })).sort((a, b) => Range.compareRangesUsingStarts(a.selection, b.selection)); + for (const { selection, idx } of indexedSelections) { + let extensionBefore = SnippetSession_1.adjustSelection(model, selection, overwriteBefore, 0); + let extensionAfter = SnippetSession_1.adjustSelection(model, selection, 0, overwriteAfter); + if (firstBeforeText !== model.getValueInRange(extensionBefore)) { + extensionBefore = selection; + } + if (firstAfterText !== model.getValueInRange(extensionAfter)) { + extensionAfter = selection; + } + const snippetSelection = selection.setStartPosition(extensionBefore.startLineNumber, extensionBefore.startColumn).setEndPosition(extensionAfter.endLineNumber, extensionAfter.endColumn); + const snippet = new SnippetParser().parse(template, true, enforceFinalTabstop); + const start = snippetSelection.getStartPosition(); + const snippetLineLeadingWhitespace = SnippetSession_1.adjustWhitespace(model, start, adjustWhitespace || idx > 0 && firstLineFirstNonWhitespace !== model.getLineFirstNonWhitespaceColumn(selection.positionLineNumber), snippet); + snippet.resolveVariables(new CompositeSnippetVariableResolver([ + modelBasedVariableResolver, + new ClipboardBasedVariableResolver(readClipboardText, idx, indexedSelections.length, editor2.getOption( + 88 + /* EditorOption.multiCursorPaste */ + ) === "spread"), + new SelectionBasedVariableResolver(model, selection, idx, overtypingCapturer), + new CommentBasedVariableResolver(model, selection, languageConfigurationService), + new TimeBasedVariableResolver(), + new WorkspaceBasedVariableResolver(workspaceService), + new RandomBasedVariableResolver() + ])); + edits[idx] = EditOperation.replace(snippetSelection, snippet.toString()); + edits[idx].identifier = { major: idx, minor: 0 }; + edits[idx]._isTracked = true; + snippets[idx] = new OneSnippet(editor2, snippet, snippetLineLeadingWhitespace); + } + return { edits, snippets }; + } + static createEditsAndSnippetsFromEdits(editor2, snippetEdits, enforceFinalTabstop, adjustWhitespace, clipboardText, overtypingCapturer, languageConfigurationService) { + if (!editor2.hasModel() || snippetEdits.length === 0) { + return { edits: [], snippets: [] }; + } + const edits = []; + const model = editor2.getModel(); + const parser2 = new SnippetParser(); + const snippet = new TextmateSnippet(); + const resolver = new CompositeSnippetVariableResolver([ + editor2.invokeWithinContext((accessor) => new ModelBasedVariableResolver(accessor.get(ILabelService), model)), + new ClipboardBasedVariableResolver(() => clipboardText, 0, editor2.getSelections().length, editor2.getOption( + 88 + /* EditorOption.multiCursorPaste */ + ) === "spread"), + new SelectionBasedVariableResolver(model, editor2.getSelection(), 0, overtypingCapturer), + new CommentBasedVariableResolver(model, editor2.getSelection(), languageConfigurationService), + new TimeBasedVariableResolver(), + new WorkspaceBasedVariableResolver(editor2.invokeWithinContext((accessor) => accessor.get(IWorkspaceContextService))), + new RandomBasedVariableResolver() + ]); + snippetEdits = snippetEdits.sort((a, b) => Range.compareRangesUsingStarts(a.range, b.range)); + let offset = 0; + for (let i2 = 0; i2 < snippetEdits.length; i2++) { + const { range: range2, template, keepWhitespace } = snippetEdits[i2]; + if (i2 > 0) { + const lastRange = snippetEdits[i2 - 1].range; + const textRange = Range.fromPositions(lastRange.getEndPosition(), range2.getStartPosition()); + const textNode = new Text(model.getValueInRange(textRange)); + snippet.appendChild(textNode); + offset += textNode.value.length; + } + const newNodes = parser2.parseFragment(template, snippet); + SnippetSession_1.adjustWhitespace(model, range2.getStartPosition(), keepWhitespace !== void 0 ? !keepWhitespace : adjustWhitespace, snippet, new Set(newNodes)); + snippet.resolveVariables(resolver); + const snippetText = snippet.toString(); + const snippetFragmentText = snippetText.slice(offset); + offset = snippetText.length; + const edit2 = EditOperation.replace(range2, snippetFragmentText); + edit2.identifier = { major: i2, minor: 0 }; + edit2._isTracked = true; + edits.push(edit2); + } + parser2.ensureFinalTabstop(snippet, enforceFinalTabstop, true); + return { + edits, + snippets: [new OneSnippet(editor2, snippet, "")] + }; + } + constructor(_editor, _template, _options = _defaultOptions, _languageConfigurationService) { + this._editor = _editor; + this._template = _template; + this._options = _options; + this._languageConfigurationService = _languageConfigurationService; + this._templateMerges = []; + this._snippets = []; + } + dispose() { + dispose(this._snippets); + } + _logInfo() { + return `template="${this._template}", merged_templates="${this._templateMerges.join(" -> ")}"`; + } + insert(editReason) { + if (!this._editor.hasModel()) { + return; + } + const { edits, snippets } = typeof this._template === "string" ? SnippetSession_1.createEditsAndSnippetsFromSelections(this._editor, this._template, this._options.overwriteBefore, this._options.overwriteAfter, false, this._options.adjustWhitespace, this._options.clipboardText, this._options.overtypingCapturer, this._languageConfigurationService) : SnippetSession_1.createEditsAndSnippetsFromEdits(this._editor, this._template, false, this._options.adjustWhitespace, this._options.clipboardText, this._options.overtypingCapturer, this._languageConfigurationService); + this._snippets = snippets; + this._editor.executeEdits(editReason ?? EditSources.snippet(), edits, (_undoEdits) => { + const undoEdits = _undoEdits.filter((edit2) => !!edit2.identifier); + for (let idx = 0; idx < snippets.length; idx++) { + snippets[idx].initialize(undoEdits[idx].textChange); + } + if (this._snippets[0].hasPlaceholder) { + return this._move(true); + } else { + return undoEdits.map((edit2) => Selection.fromPositions(edit2.range.getEndPosition())); + } + }); + this._editor.revealRange(this._editor.getSelections()[0]); + } + merge(template, options2 = _defaultOptions) { + if (!this._editor.hasModel()) { + return; + } + this._templateMerges.push([this._snippets[0]._nestingLevel, this._snippets[0]._placeholderGroupsIdx, template]); + const { edits, snippets } = SnippetSession_1.createEditsAndSnippetsFromSelections(this._editor, template, options2.overwriteBefore, options2.overwriteAfter, true, options2.adjustWhitespace, options2.clipboardText, options2.overtypingCapturer, this._languageConfigurationService); + this._editor.executeEdits("snippet", edits, (_undoEdits) => { + const undoEdits = _undoEdits.filter((edit2) => !!edit2.identifier); + for (let idx = 0; idx < snippets.length; idx++) { + snippets[idx].initialize(undoEdits[idx].textChange); + } + const isTrivialSnippet = snippets[0].isTrivialSnippet; + if (!isTrivialSnippet) { + for (const snippet of this._snippets) { + snippet.merge(snippets); + } + console.assert(snippets.length === 0); + } + if (this._snippets[0].hasPlaceholder && !isTrivialSnippet) { + return this._move(void 0); + } else { + return undoEdits.map((edit2) => Selection.fromPositions(edit2.range.getEndPosition())); + } + }); + } + next() { + const newSelections = this._move(true); + this._editor.setSelections(newSelections); + this._editor.revealPositionInCenterIfOutsideViewport(newSelections[0].getPosition()); + } + prev() { + const newSelections = this._move(false); + this._editor.setSelections(newSelections); + this._editor.revealPositionInCenterIfOutsideViewport(newSelections[0].getPosition()); + } + _move(fwd) { + const selections = []; + for (const snippet of this._snippets) { + const oneSelection = snippet.move(fwd); + selections.push(...oneSelection); + } + return selections; + } + get isAtFirstPlaceholder() { + return this._snippets[0].isAtFirstPlaceholder; + } + get isAtLastPlaceholder() { + return this._snippets[0].isAtLastPlaceholder; + } + get hasPlaceholder() { + return this._snippets[0].hasPlaceholder; + } + get hasChoice() { + return this._snippets[0].hasChoice; + } + get activeChoice() { + return this._snippets[0].activeChoice; + } + isSelectionWithinPlaceholders() { + if (!this.hasPlaceholder) { + return false; + } + const selections = this._editor.getSelections(); + if (selections.length < this._snippets.length) { + return false; + } + const allPossibleSelections = /* @__PURE__ */ new Map(); + for (const snippet of this._snippets) { + const possibleSelections = snippet.computePossibleSelections(); + if (allPossibleSelections.size === 0) { + for (const [index, ranges] of possibleSelections) { + ranges.sort(Range.compareRangesUsingStarts); + for (const selection of selections) { + if (ranges[0].containsRange(selection)) { + allPossibleSelections.set(index, []); + break; + } + } + } + } + if (allPossibleSelections.size === 0) { + return false; + } + allPossibleSelections.forEach((array2, index) => { + array2.push(...possibleSelections.get(index)); + }); + } + selections.sort(Range.compareRangesUsingStarts); + for (const [index, ranges] of allPossibleSelections) { + if (ranges.length !== selections.length) { + allPossibleSelections.delete(index); + continue; + } + ranges.sort(Range.compareRangesUsingStarts); + for (let i2 = 0; i2 < ranges.length; i2++) { + if (!ranges[i2].containsRange(selections[i2])) { + allPossibleSelections.delete(index); + continue; + } + } + } + return allPossibleSelections.size > 0; + } +}; +SnippetSession = SnippetSession_1 = __decorate101([ + __param95(3, ILanguageConfigurationService) +], SnippetSession); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/snippet/browser/snippetController2.js +init_observable(); +var __decorate102 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param96 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var SnippetController2_1; +var _defaultOptions2 = { + overwriteBefore: 0, + overwriteAfter: 0, + undoStopBefore: true, + undoStopAfter: true, + adjustWhitespace: true, + clipboardText: void 0, + overtypingCapturer: void 0 +}; +var SnippetController2 = class SnippetController22 { + static { + SnippetController2_1 = this; + } + static { + this.ID = "snippetController2"; + } + static get(editor2) { + return editor2.getContribution(SnippetController2_1.ID); + } + static { + this.InSnippetMode = new RawContextKey("inSnippetMode", false, localize(1402, "Whether the editor in current in snippet mode")); + } + static { + this.HasNextTabstop = new RawContextKey("hasNextTabstop", false, localize(1403, "Whether there is a next tab stop when in snippet mode")); + } + static { + this.HasPrevTabstop = new RawContextKey("hasPrevTabstop", false, localize(1404, "Whether there is a previous tab stop when in snippet mode")); + } + constructor(_editor, _logService, _languageFeaturesService, contextKeyService, _languageConfigurationService) { + this._editor = _editor; + this._logService = _logService; + this._languageFeaturesService = _languageFeaturesService; + this._languageConfigurationService = _languageConfigurationService; + this._inSnippetObservable = observableValue(this, false); + this._snippetListener = new DisposableStore(); + this._modelVersionId = -1; + this._inSnippet = SnippetController2_1.InSnippetMode.bindTo(contextKeyService); + this._hasNextTabstop = SnippetController2_1.HasNextTabstop.bindTo(contextKeyService); + this._hasPrevTabstop = SnippetController2_1.HasPrevTabstop.bindTo(contextKeyService); + } + dispose() { + this._inSnippet.reset(); + this._inSnippetObservable.set(false, void 0); + this._hasPrevTabstop.reset(); + this._hasNextTabstop.reset(); + this._session?.dispose(); + this._snippetListener.dispose(); + } + insert(template, opts) { + try { + this._doInsert(template, typeof opts === "undefined" ? _defaultOptions2 : { ..._defaultOptions2, ...opts }); + } catch (e) { + this.cancel(); + this._logService.error(e); + this._logService.error("snippet_error"); + this._logService.error("insert_template=", template); + this._logService.error("existing_template=", this._session ? this._session._logInfo() : ""); + } + } + _doInsert(template, opts) { + if (!this._editor.hasModel()) { + return; + } + this._snippetListener.clear(); + if (opts.undoStopBefore) { + this._editor.getModel().pushStackElement(); + } + if (this._session && typeof template !== "string") { + this.cancel(); + } + if (!this._session) { + this._modelVersionId = this._editor.getModel().getAlternativeVersionId(); + this._session = new SnippetSession(this._editor, template, opts, this._languageConfigurationService); + this._session.insert(opts.reason); + } else { + assertType(typeof template === "string"); + this._session.merge(template, opts); + } + if (opts.undoStopAfter) { + this._editor.getModel().pushStackElement(); + } + if (this._session?.hasChoice) { + const provider = { + _debugDisplayName: "snippetChoiceCompletions", + provideCompletionItems: (model2, position) => { + if (!this._session || model2 !== this._editor.getModel() || !Position.equals(this._editor.getPosition(), position)) { + return void 0; + } + const { activeChoice } = this._session; + if (!activeChoice || activeChoice.choice.options.length === 0) { + return void 0; + } + const word = model2.getValueInRange(activeChoice.range); + const isAnyOfOptions = Boolean(activeChoice.choice.options.find((o) => o.value === word)); + const suggestions = []; + for (let i2 = 0; i2 < activeChoice.choice.options.length; i2++) { + const option2 = activeChoice.choice.options[i2]; + suggestions.push({ + kind: 13, + label: option2.value, + insertText: option2.value, + sortText: "a".repeat(i2 + 1), + range: activeChoice.range, + filterText: isAnyOfOptions ? `${word}_${option2.value}` : void 0, + command: { id: "jumpToNextSnippetPlaceholder", title: localize(1405, "Go to next placeholder...") } + }); + } + return { suggestions }; + } + }; + const model = this._editor.getModel(); + let registration; + let isRegistered = false; + const disable = () => { + registration?.dispose(); + isRegistered = false; + }; + const enable = () => { + if (!isRegistered) { + registration = this._languageFeaturesService.completionProvider.register({ + language: model.getLanguageId(), + pattern: model.uri.fsPath, + scheme: model.uri.scheme, + exclusive: true + }, provider); + this._snippetListener.add(registration); + isRegistered = true; + } + }; + this._choiceCompletions = { provider, enable, disable }; + } + this._updateState(); + this._snippetListener.add(this._editor.onDidChangeModelContent((e) => e.isFlush && this.cancel())); + this._snippetListener.add(this._editor.onDidChangeModel(() => this.cancel())); + this._snippetListener.add(this._editor.onDidChangeCursorSelection(() => this._updateState())); + } + _updateState() { + if (!this._session || !this._editor.hasModel()) { + return; + } + if (this._modelVersionId === this._editor.getModel().getAlternativeVersionId()) { + return this.cancel(); + } + if (!this._session.hasPlaceholder) { + return this.cancel(); + } + if (this._session.isAtLastPlaceholder || !this._session.isSelectionWithinPlaceholders()) { + this._editor.getModel().pushStackElement(); + return this.cancel(); + } + this._inSnippet.set(true); + this._inSnippetObservable.set(true, void 0); + this._hasPrevTabstop.set(!this._session.isAtFirstPlaceholder); + this._hasNextTabstop.set(!this._session.isAtLastPlaceholder); + this._handleChoice(); + } + _handleChoice() { + if (!this._session || !this._editor.hasModel()) { + this._currentChoice = void 0; + return; + } + const { activeChoice } = this._session; + if (!activeChoice || !this._choiceCompletions) { + this._choiceCompletions?.disable(); + this._currentChoice = void 0; + return; + } + if (this._currentChoice !== activeChoice.choice) { + this._currentChoice = activeChoice.choice; + this._choiceCompletions.enable(); + queueMicrotask(() => { + showSimpleSuggestions(this._editor, this._choiceCompletions.provider); + }); + } + } + finish() { + while (this._inSnippet.get()) { + this.next(); + } + } + cancel(resetSelection = false) { + this._inSnippet.reset(); + this._inSnippetObservable.set(false, void 0); + this._hasPrevTabstop.reset(); + this._hasNextTabstop.reset(); + this._snippetListener.clear(); + this._currentChoice = void 0; + this._session?.dispose(); + this._session = void 0; + this._modelVersionId = -1; + if (resetSelection) { + this._editor.setSelections([this._editor.getSelection()]); + } + } + prev() { + this._session?.prev(); + this._updateState(); + } + next() { + this._session?.next(); + this._updateState(); + } + isInSnippet() { + return Boolean(this._inSnippet.get()); + } + get isInSnippetObservable() { + return this._inSnippetObservable; + } +}; +SnippetController2 = SnippetController2_1 = __decorate102([ + __param96(1, ILogService), + __param96(2, ILanguageFeaturesService), + __param96(3, IContextKeyService), + __param96(4, ILanguageConfigurationService) +], SnippetController2); +registerEditorContribution( + SnippetController2.ID, + SnippetController2, + 4 + /* EditorContributionInstantiation.Lazy */ +); +var CommandCtor = EditorCommand.bindToContribution(SnippetController2.get); +registerEditorCommand(new CommandCtor({ + id: "jumpToNextSnippetPlaceholder", + precondition: ContextKeyExpr.and(SnippetController2.InSnippetMode, SnippetController2.HasNextTabstop), + handler: (ctrl) => ctrl.next(), + kbOpts: { + weight: 100 + 30, + kbExpr: EditorContextKeys.textInputFocus, + primary: 2 + /* KeyCode.Tab */ + } +})); +registerEditorCommand(new CommandCtor({ + id: "jumpToPrevSnippetPlaceholder", + precondition: ContextKeyExpr.and(SnippetController2.InSnippetMode, SnippetController2.HasPrevTabstop), + handler: (ctrl) => ctrl.prev(), + kbOpts: { + weight: 100 + 30, + kbExpr: EditorContextKeys.textInputFocus, + primary: 1024 | 2 + /* KeyCode.Tab */ + } +})); +registerEditorCommand(new CommandCtor({ + id: "leaveSnippet", + precondition: SnippetController2.InSnippetMode, + handler: (ctrl) => ctrl.cancel(true), + kbOpts: { + weight: 100 + 30, + kbExpr: EditorContextKeys.textInputFocus, + primary: 9, + secondary: [ + 1024 | 9 + /* KeyCode.Escape */ + ] + } +})); +registerEditorCommand(new CommandCtor({ + id: "acceptSnippet", + precondition: SnippetController2.InSnippetMode, + handler: (ctrl) => ctrl.finish() + // kbOpts: { + // weight: KeybindingWeight.EditorContrib + 30, + // kbExpr: EditorContextKeys.textFocus, + // primary: KeyCode.Enter, + // } +})); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/inlineCompletions/browser/utils.js +init_arrays(); +init_observable(); +init_range(); + +// node_modules/monaco-editor-core/esm/vs/editor/common/core/text/getPositionOffsetTransformerFromTextModel.js +function getPositionOffsetTransformerFromTextModel(textModel) { + return new PositionOffsetTransformerWithTextModel(textModel); +} +var PositionOffsetTransformerWithTextModel = class extends PositionOffsetTransformerBase { + constructor(_textModel) { + super(); + this._textModel = _textModel; + } + getOffset(position) { + return this._textModel.getOffsetAt(position); + } + getPosition(offset) { + return this._textModel.getPositionAt(offset); + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/inlineCompletions/browser/utils.js +var array = []; +function getReadonlyEmptyArray() { + return array; +} +function getEndPositionsAfterApplying(edits) { + const newRanges = getModifiedRangesAfterApplying(edits); + return newRanges.map((range2) => range2.getEndPosition()); +} +function getModifiedRangesAfterApplying(edits) { + const sortPerm = Permutation.createSortPermutation(edits, compareBy((e) => e.range, Range.compareRangesUsingStarts)); + const edit2 = new TextEdit(sortPerm.apply(edits)); + const sortedNewRanges = edit2.getNewRanges(); + return sortPerm.inverse().apply(sortedNewRanges); +} +function removeTextReplacementCommonSuffixPrefix(edits, textModel) { + const transformer = getPositionOffsetTransformerFromTextModel(textModel); + const text2 = textModel.getValue(); + const stringReplacements = edits.map((edit2) => transformer.getStringReplacement(edit2)); + const minimalStringReplacements = stringReplacements.map((replacement) => replacement.removeCommonSuffixPrefix(text2)); + return minimalStringReplacements.map((replacement) => transformer.getTextReplacement(replacement)); +} +function convertItemsToStableObservables(items, store) { + const result = observableValue("result", []); + const innerObservables = []; + store.add(autorun((reader) => { + const itemsValue = items.read(reader); + transaction((tx) => { + if (itemsValue.length !== innerObservables.length) { + innerObservables.length = itemsValue.length; + for (let i2 = 0; i2 < innerObservables.length; i2++) { + if (!innerObservables[i2]) { + innerObservables[i2] = observableValue("item", itemsValue[i2]); + } + } + result.set([...innerObservables], tx); + } + innerObservables.forEach((o, i2) => o.set(itemsValue[i2], tx)); + }); + })); + return result; +} +var ObservableContextKeyService = class { + constructor(_contextKeyService) { + this._contextKeyService = _contextKeyService; + } + bind(key, obs) { + return bindContextKey(key, this._contextKeyService, obs instanceof Function ? obs : (reader) => obs.read(reader)); + } +}; +function wait(ms, cancellationToken) { + return new Promise((resolve3) => { + let d = void 0; + const handle = setTimeout(() => { + if (d) { + d.dispose(); + } + resolve3(); + }, ms); + if (cancellationToken) { + d = cancellationToken.onCancellationRequested(() => { + clearTimeout(handle); + if (d) { + d.dispose(); + } + resolve3(); + }); + } + }); +} + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/inlineCompletions/browser/model/animation.js +init_dom(); +init_observable(); +var AnimatedValue = class { + constructor(startValue, endValue, durationMs, _interpolationFunction = easeOutExpo2) { + this.startValue = startValue; + this.endValue = endValue; + this.durationMs = durationMs; + this._interpolationFunction = _interpolationFunction; + this.startTimeMs = Date.now(); + if (startValue === endValue) { + this.durationMs = 0; + } + } + isFinished() { + return Date.now() >= this.startTimeMs + this.durationMs; + } + getValue() { + const timePassed = Date.now() - this.startTimeMs; + if (timePassed >= this.durationMs) { + return this.endValue; + } + const value = this._interpolationFunction(timePassed, this.startValue, this.endValue - this.startValue, this.durationMs); + return value; + } +}; +function easeOutExpo2(passedTime, start, length, totalDuration) { + return passedTime === totalDuration ? start + length : length * (-Math.pow(2, -10 * passedTime / totalDuration) + 1) + start; +} +function easeOutCubic2(passedTime, start, length, totalDuration) { + return length * ((passedTime = passedTime / totalDuration - 1) * passedTime * passedTime + 1) + start; +} +var ObservableAnimatedValue = class { + constructor(initialValue) { + this._value = observableValue(this, initialValue); + } + getValue(reader) { + const value = this._value.read(reader); + if (!value.isFinished()) { + AnimationFrameScheduler.instance.invalidateOnNextAnimationFrame(reader); + } + return value.getValue(); + } +}; +var AnimationFrameScheduler = class _AnimationFrameScheduler { + constructor() { + this._counter = observableSignal(this); + this._isScheduled = false; + } + static { + this.instance = new _AnimationFrameScheduler(); + } + invalidateOnNextAnimationFrame(reader) { + this._counter.read(reader); + if (!this._isScheduled) { + this._isScheduled = true; + getActiveWindow().requestAnimationFrame(() => { + this._isScheduled = false; + this._update(); + }); + } + } + _update() { + this._counter.trigger(void 0); + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/inlineCompletions/browser/model/computeGhostText.js +init_strings(); +init_range(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/inlineCompletions/browser/model/ghostText.js +init_arrays(); +init_strings(); +init_position(); +init_range(); +init_assert(); +var GhostText = class { + constructor(lineNumber, parts) { + this.lineNumber = lineNumber; + this.parts = parts; + assertFn(() => checkAdjacentItems(parts, (p1, p2) => p1.column <= p2.column)); + } + equals(other) { + return this.lineNumber === other.lineNumber && this.parts.length === other.parts.length && this.parts.every((part, index) => part.equals(other.parts[index])); + } + renderForScreenReader(lineText) { + if (this.parts.length === 0) { + return ""; + } + const lastPart = this.parts[this.parts.length - 1]; + const cappedLineText = lineText.substr(0, lastPart.column - 1); + const text2 = new TextEdit([ + ...this.parts.map((p) => new TextReplacement(Range.fromPositions(new Position(1, p.column)), p.lines.map((line) => line.line).join("\n"))) + ]).applyToString(cappedLineText); + return text2.substring(this.parts[0].column - 1); + } + isEmpty() { + return this.parts.every((p) => p.lines.length === 0); + } + get lineCount() { + return 1 + this.parts.reduce((r, p) => r + p.lines.length - 1, 0); + } +}; +var GhostTextPart = class { + constructor(column, text2, preview, _inlineDecorations = []) { + this.column = column; + this.text = text2; + this.preview = preview; + this._inlineDecorations = _inlineDecorations; + this.lines = splitLines(this.text).map((line, i2) => ({ + line, + lineDecorations: LineDecoration.filter(this._inlineDecorations, i2 + 1, 1, line.length + 1) + })); + } + equals(other) { + return this.column === other.column && this.lines.length === other.lines.length && this.lines.every((line, index) => line.line === other.lines[index].line && LineDecoration.equalsArr(line.lineDecorations, other.lines[index].lineDecorations)); + } +}; +var GhostTextReplacement = class { + constructor(lineNumber, columnRange, text2, additionalReservedLineCount = 0) { + this.lineNumber = lineNumber; + this.columnRange = columnRange; + this.text = text2; + this.additionalReservedLineCount = additionalReservedLineCount; + this.parts = [ + new GhostTextPart(this.columnRange.endColumnExclusive, this.text, false) + ]; + this.newLines = splitLines(this.text); + } + renderForScreenReader(_lineText) { + return this.newLines.join("\n"); + } + get lineCount() { + return this.newLines.length; + } + isEmpty() { + return this.parts.every((p) => p.lines.length === 0); + } + equals(other) { + return this.lineNumber === other.lineNumber && this.columnRange.equals(other.columnRange) && this.newLines.length === other.newLines.length && this.newLines.every((line, index) => line === other.newLines[index]) && this.additionalReservedLineCount === other.additionalReservedLineCount; + } +}; +function ghostTextsOrReplacementsEqual(a, b) { + return equals(a, b, ghostTextOrReplacementEquals); +} +function ghostTextOrReplacementEquals(a, b) { + if (a === b) { + return true; + } + if (!a || !b) { + return false; + } + if (a instanceof GhostText && b instanceof GhostText) { + return a.equals(b); + } + if (a instanceof GhostTextReplacement && b instanceof GhostTextReplacement) { + return a.equals(b); + } + return false; +} + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/inlineCompletions/browser/model/singleTextEditHelpers.js +init_strings(); +init_range(); +init_textLength(); +function singleTextRemoveCommonPrefix(edit2, model, validModelRange) { + const modelRange = validModelRange ? edit2.range.intersectRanges(validModelRange) : edit2.range; + if (!modelRange) { + return edit2; + } + const normalizedText = edit2.text.replaceAll("\r\n", "\n"); + const valueToReplace = model.getValueInRange( + modelRange, + 1 + /* EndOfLinePreference.LF */ + ); + const commonPrefixLen = commonPrefixLength(valueToReplace, normalizedText); + const start = TextLength.ofText(valueToReplace.substring(0, commonPrefixLen)).addToPosition(edit2.range.getStartPosition()); + const text2 = normalizedText.substring(commonPrefixLen); + const range2 = Range.fromPositions(start, edit2.range.getEndPosition()); + return new TextReplacement(range2, text2); +} +function singleTextEditAugments(edit2, base) { + return edit2.text.startsWith(base.text) && rangeExtends(edit2.range, base.range); +} +function rangeExtends(extendingRange, rangeToExtend) { + return rangeToExtend.getStartPosition().equals(extendingRange.getStartPosition()) && rangeToExtend.getEndPosition().isBeforeOrEqual(extendingRange.getEndPosition()); +} + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/inlineCompletions/browser/model/computeGhostText.js +function computeGhostText(edit2, model, mode, cursorPosition, previewSuffixLength = 0) { + let e = singleTextRemoveCommonPrefix(edit2, model); + if (e.range.endLineNumber !== e.range.startLineNumber) { + return void 0; + } + const sourceLine = model.getLineContent(e.range.startLineNumber); + const sourceIndentationLength = getLeadingWhitespace(sourceLine).length; + const suggestionTouchesIndentation = e.range.startColumn - 1 <= sourceIndentationLength; + if (suggestionTouchesIndentation) { + const suggestionAddedIndentationLength = getLeadingWhitespace(e.text).length; + const replacedIndentation = sourceLine.substring(e.range.startColumn - 1, sourceIndentationLength); + const [startPosition, endPosition] = [e.range.getStartPosition(), e.range.getEndPosition()]; + const newStartPosition = startPosition.column + replacedIndentation.length <= endPosition.column ? startPosition.delta(0, replacedIndentation.length) : endPosition; + const rangeThatDoesNotReplaceIndentation = Range.fromPositions(newStartPosition, endPosition); + const suggestionWithoutIndentationChange = e.text.startsWith(replacedIndentation) ? e.text.substring(replacedIndentation.length) : e.text.substring(suggestionAddedIndentationLength); + e = new TextReplacement(rangeThatDoesNotReplaceIndentation, suggestionWithoutIndentationChange); + } + const valueToBeReplaced = model.getValueInRange(e.range); + const changes = cachingDiff(valueToBeReplaced, e.text); + if (!changes) { + return void 0; + } + const lineNumber = e.range.startLineNumber; + const parts = new Array(); + if (mode === "prefix") { + const filteredChanges = changes.filter((c) => c.originalLength === 0); + if (filteredChanges.length > 1 || filteredChanges.length === 1 && filteredChanges[0].originalStart !== valueToBeReplaced.length) { + return void 0; + } + } + const previewStartInCompletionText = e.text.length - previewSuffixLength; + for (const c of changes) { + const insertColumn = e.range.startColumn + c.originalStart + c.originalLength; + if (mode === "subwordSmart" && cursorPosition && cursorPosition.lineNumber === e.range.startLineNumber && insertColumn < cursorPosition.column) { + return void 0; + } + if (c.originalLength > 0) { + return void 0; + } + if (c.modifiedLength === 0) { + continue; + } + const modifiedEnd = c.modifiedStart + c.modifiedLength; + const nonPreviewTextEnd = Math.max(c.modifiedStart, Math.min(modifiedEnd, previewStartInCompletionText)); + const nonPreviewText = e.text.substring(c.modifiedStart, nonPreviewTextEnd); + const italicText = e.text.substring(nonPreviewTextEnd, Math.max(c.modifiedStart, modifiedEnd)); + if (nonPreviewText.length > 0) { + parts.push(new GhostTextPart(insertColumn, nonPreviewText, false)); + } + if (italicText.length > 0) { + parts.push(new GhostTextPart(insertColumn, italicText, true)); + } + } + return new GhostText(lineNumber, parts); +} +var lastRequest = void 0; +function cachingDiff(originalValue, newValue) { + if (lastRequest?.originalValue === originalValue && lastRequest?.newValue === newValue) { + return lastRequest?.changes; + } else { + let changes = smartDiff(originalValue, newValue, true); + if (changes) { + const deletedChars = deletedCharacters(changes); + if (deletedChars > 0) { + const newChanges = smartDiff(originalValue, newValue, false); + if (newChanges && deletedCharacters(newChanges) < deletedChars) { + changes = newChanges; + } + } + } + lastRequest = { + originalValue, + newValue, + changes + }; + return changes; + } +} +function deletedCharacters(changes) { + let sum2 = 0; + for (const c of changes) { + sum2 += c.originalLength; + } + return sum2; +} +function smartDiff(originalValue, newValue, smartBracketMatching) { + if (originalValue.length > 5e3 || newValue.length > 5e3) { + return void 0; + } + function getMaxCharCode(val) { + let maxCharCode2 = 0; + for (let i2 = 0, len = val.length; i2 < len; i2++) { + const charCode = val.charCodeAt(i2); + if (charCode > maxCharCode2) { + maxCharCode2 = charCode; + } + } + return maxCharCode2; + } + const maxCharCode = Math.max(getMaxCharCode(originalValue), getMaxCharCode(newValue)); + function getUniqueCharCode(id) { + if (id < 0) { + throw new Error("unexpected"); + } + return maxCharCode + id + 1; + } + function getElements(source) { + let level = 0; + let group = 0; + const characters = new Int32Array(source.length); + for (let i2 = 0, len = source.length; i2 < len; i2++) { + if (smartBracketMatching && source[i2] === "(") { + const id = group * 100 + level; + characters[i2] = getUniqueCharCode(2 * id); + level++; + } else if (smartBracketMatching && source[i2] === ")") { + level = Math.max(level - 1, 0); + const id = group * 100 + level; + characters[i2] = getUniqueCharCode(2 * id + 1); + if (level === 0) { + group++; + } + } else { + characters[i2] = source.charCodeAt(i2); + } + } + return characters; + } + const elements1 = getElements(originalValue); + const elements2 = getElements(newValue); + return new LcsDiff({ getElements: () => elements1 }, { getElements: () => elements2 }).ComputeDiff(false).changes; +} + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsSource.js +init_arrays(); +init_arraysFind(); +init_async(); +init_cancellation(); +init_equals(); +init_lifecycle(); +init_observable(); + +// node_modules/monaco-editor-core/esm/vs/base/common/observableInternal/experimental/reducer.js +init_deps(); +init_transaction(); +init_debugName(); +init_derivedImpl(); +init_debugLocation(); +function observableReducerSettable(owner, options2) { + let prevValue = void 0; + let hasValue = false; + const d = new DerivedWithSetter(new DebugNameData(owner, void 0, options2.update), (reader, changeSummary) => { + if (!hasValue) { + prevValue = options2.initial instanceof Function ? options2.initial() : options2.initial; + hasValue = true; + } + const newValue = options2.update(reader, prevValue, changeSummary); + prevValue = newValue; + return newValue; + }, options2.changeTracker, () => { + if (hasValue) { + options2.disposeFinal?.(prevValue); + hasValue = false; + } + }, options2.equalityComparer ?? strictEquals, (value, tx, change) => { + if (!hasValue) { + throw new BugIndicatingError("Can only set when there is a listener! This is to prevent leaks."); + } + subtransaction(tx, (tx2) => { + prevValue = value; + d.setValue(value, tx2, change); + }); + }, DebugLocation.ofCaller()); + return d; +} + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsSource.js +init_types(); +init_configuration(); +init_contextkey(); + +// node_modules/monaco-editor-core/esm/vs/platform/dataChannel/browser/forwardingTelemetryService.js +init_telemetry(); +var __decorate103 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param97 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var InterceptingTelemetryService = class { + constructor(_baseService, _intercept) { + this._baseService = _baseService; + this._intercept = _intercept; + } + publicLog2(eventName, data) { + this._intercept(eventName, data); + this._baseService.publicLog2(eventName, data); + } +}; +var DataChannelForwardingTelemetryService = class DataChannelForwardingTelemetryService2 extends InterceptingTelemetryService { + constructor(telemetryService, dataChannelService) { + super(telemetryService, (eventName, data) => { + let forward = true; + if (data && shouldForwardToChannel in data) { + forward = Boolean(data[shouldForwardToChannel]); + } + if (forward) { + dataChannelService.getDataChannel("editTelemetry").sendData({ eventName, data: data ?? {} }); + } + }); + } +}; +DataChannelForwardingTelemetryService = __decorate103([ + __param97(0, ITelemetryService), + __param97(1, IDataChannelService) +], DataChannelForwardingTelemetryService); +var shouldForwardToChannel = /* @__PURE__ */ Symbol("shouldForwardToChannel"); +function forwardToChannelIf(value) { + return { + // This will not be sent via telemetry, it is just a marker + [shouldForwardToChannel]: value + }; +} +function isCopilotLikeExtension(extensionId) { + if (!extensionId) { + return false; + } + const extIdLowerCase = extensionId.toLowerCase(); + return extIdLowerCase === "github.copilot" || extIdLowerCase === "github.copilot-chat"; +} + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsSource.js +init_instantiation(); +init_log(); +init_product(); +init_languages(); +init_languageConfigurationRegistry(); + +// node_modules/monaco-editor-core/esm/vs/editor/common/model/textModelStringEdit.js +init_offsetRange(); +function offsetEditFromContentChanges(contentChanges) { + const editsArr = contentChanges.map((c) => new StringReplacement(OffsetRange.ofStartAndLength(c.rangeOffset, c.rangeLength), c.text)); + editsArr.reverse(); + const edits = new StringEdit(editsArr); + return edits; +} + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/inlineCompletions/browser/telemetry.js +function sendInlineCompletionsEndOfLifeTelemetry(dataChannel, endOfLifeSummary) { + dataChannel.publicLog2("inlineCompletion.endOfLife", endOfLifeSummary); +} + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineSuggestionItem.js +init_errors(); +init_filters(); +init_observable(); +init_strings(); +init_range(); +init_offsetRange(); +init_textLength(); + +// node_modules/monaco-editor-core/esm/vs/editor/common/diff/legacyLinesDiffComputer.js +init_strings(); +init_range(); +init_assert(); +init_lineRange(); +var MINIMUM_MATCHING_CHARACTER_LENGTH = 3; +var LegacyLinesDiffComputer = class { + computeDiff(originalLines, modifiedLines, options2) { + const diffComputer = new DiffComputer(originalLines, modifiedLines, { + maxComputationTime: options2.maxComputationTimeMs, + shouldIgnoreTrimWhitespace: options2.ignoreTrimWhitespace, + shouldComputeCharChanges: true, + shouldMakePrettyDiff: true, + shouldPostProcessCharChanges: true + }); + const result = diffComputer.computeDiff(); + const changes = []; + let lastChange = null; + for (const c of result.changes) { + let originalRange; + if (c.originalEndLineNumber === 0) { + originalRange = new LineRange(c.originalStartLineNumber + 1, c.originalStartLineNumber + 1); + } else { + originalRange = new LineRange(c.originalStartLineNumber, c.originalEndLineNumber + 1); + } + let modifiedRange; + if (c.modifiedEndLineNumber === 0) { + modifiedRange = new LineRange(c.modifiedStartLineNumber + 1, c.modifiedStartLineNumber + 1); + } else { + modifiedRange = new LineRange(c.modifiedStartLineNumber, c.modifiedEndLineNumber + 1); + } + let change = new DetailedLineRangeMapping(originalRange, modifiedRange, c.charChanges?.map((c2) => new RangeMapping(new Range(c2.originalStartLineNumber, c2.originalStartColumn, c2.originalEndLineNumber, c2.originalEndColumn), new Range(c2.modifiedStartLineNumber, c2.modifiedStartColumn, c2.modifiedEndLineNumber, c2.modifiedEndColumn)))); + if (lastChange) { + if (lastChange.modified.endLineNumberExclusive === change.modified.startLineNumber || lastChange.original.endLineNumberExclusive === change.original.startLineNumber) { + change = new DetailedLineRangeMapping(lastChange.original.join(change.original), lastChange.modified.join(change.modified), lastChange.innerChanges && change.innerChanges ? lastChange.innerChanges.concat(change.innerChanges) : void 0); + changes.pop(); + } + } + changes.push(change); + lastChange = change; + } + assertFn(() => { + return checkAdjacentItems(changes, (m1, m2) => m2.original.startLineNumber - m1.original.endLineNumberExclusive === m2.modified.startLineNumber - m1.modified.endLineNumberExclusive && // There has to be an unchanged line in between (otherwise both diffs should have been joined) + m1.original.endLineNumberExclusive < m2.original.startLineNumber && m1.modified.endLineNumberExclusive < m2.modified.startLineNumber); + }); + return new LinesDiff(changes, [], result.quitEarly); + } +}; +function computeDiff(originalSequence, modifiedSequence, continueProcessingPredicate, pretty) { + const diffAlgo = new LcsDiff(originalSequence, modifiedSequence, continueProcessingPredicate); + return diffAlgo.ComputeDiff(pretty); +} +var LineSequence2 = class { + constructor(lines) { + const startColumns = []; + const endColumns = []; + for (let i2 = 0, length = lines.length; i2 < length; i2++) { + startColumns[i2] = getFirstNonBlankColumn(lines[i2], 1); + endColumns[i2] = getLastNonBlankColumn(lines[i2], 1); + } + this.lines = lines; + this._startColumns = startColumns; + this._endColumns = endColumns; + } + getElements() { + const elements = []; + for (let i2 = 0, len = this.lines.length; i2 < len; i2++) { + elements[i2] = this.lines[i2].substring(this._startColumns[i2] - 1, this._endColumns[i2] - 1); + } + return elements; + } + getStrictElement(index) { + return this.lines[index]; + } + getStartLineNumber(i2) { + return i2 + 1; + } + getEndLineNumber(i2) { + return i2 + 1; + } + createCharSequence(shouldIgnoreTrimWhitespace, startIndex, endIndex) { + const charCodes = []; + const lineNumbers = []; + const columns = []; + let len = 0; + for (let index = startIndex; index <= endIndex; index++) { + const lineContent = this.lines[index]; + const startColumn = shouldIgnoreTrimWhitespace ? this._startColumns[index] : 1; + const endColumn = shouldIgnoreTrimWhitespace ? this._endColumns[index] : lineContent.length + 1; + for (let col = startColumn; col < endColumn; col++) { + charCodes[len] = lineContent.charCodeAt(col - 1); + lineNumbers[len] = index + 1; + columns[len] = col; + len++; + } + if (!shouldIgnoreTrimWhitespace && index < endIndex) { + charCodes[len] = 10; + lineNumbers[len] = index + 1; + columns[len] = lineContent.length + 1; + len++; + } + } + return new CharSequence(charCodes, lineNumbers, columns); + } +}; +var CharSequence = class { + constructor(charCodes, lineNumbers, columns) { + this._charCodes = charCodes; + this._lineNumbers = lineNumbers; + this._columns = columns; + } + toString() { + return "[" + this._charCodes.map((s, idx) => (s === 10 ? "\\n" : String.fromCharCode(s)) + `-(${this._lineNumbers[idx]},${this._columns[idx]})`).join(", ") + "]"; + } + _assertIndex(index, arr) { + if (index < 0 || index >= arr.length) { + throw new Error(`Illegal index`); + } + } + getElements() { + return this._charCodes; + } + getStartLineNumber(i2) { + if (i2 > 0 && i2 === this._lineNumbers.length) { + return this.getEndLineNumber(i2 - 1); + } + this._assertIndex(i2, this._lineNumbers); + return this._lineNumbers[i2]; + } + getEndLineNumber(i2) { + if (i2 === -1) { + return this.getStartLineNumber(i2 + 1); + } + this._assertIndex(i2, this._lineNumbers); + if (this._charCodes[i2] === 10) { + return this._lineNumbers[i2] + 1; + } + return this._lineNumbers[i2]; + } + getStartColumn(i2) { + if (i2 > 0 && i2 === this._columns.length) { + return this.getEndColumn(i2 - 1); + } + this._assertIndex(i2, this._columns); + return this._columns[i2]; + } + getEndColumn(i2) { + if (i2 === -1) { + return this.getStartColumn(i2 + 1); + } + this._assertIndex(i2, this._columns); + if (this._charCodes[i2] === 10) { + return 1; + } + return this._columns[i2] + 1; + } +}; +var CharChange = class _CharChange { + constructor(originalStartLineNumber, originalStartColumn, originalEndLineNumber, originalEndColumn, modifiedStartLineNumber, modifiedStartColumn, modifiedEndLineNumber, modifiedEndColumn) { + this.originalStartLineNumber = originalStartLineNumber; + this.originalStartColumn = originalStartColumn; + this.originalEndLineNumber = originalEndLineNumber; + this.originalEndColumn = originalEndColumn; + this.modifiedStartLineNumber = modifiedStartLineNumber; + this.modifiedStartColumn = modifiedStartColumn; + this.modifiedEndLineNumber = modifiedEndLineNumber; + this.modifiedEndColumn = modifiedEndColumn; + } + static createFromDiffChange(diffChange, originalCharSequence, modifiedCharSequence) { + const originalStartLineNumber = originalCharSequence.getStartLineNumber(diffChange.originalStart); + const originalStartColumn = originalCharSequence.getStartColumn(diffChange.originalStart); + const originalEndLineNumber = originalCharSequence.getEndLineNumber(diffChange.originalStart + diffChange.originalLength - 1); + const originalEndColumn = originalCharSequence.getEndColumn(diffChange.originalStart + diffChange.originalLength - 1); + const modifiedStartLineNumber = modifiedCharSequence.getStartLineNumber(diffChange.modifiedStart); + const modifiedStartColumn = modifiedCharSequence.getStartColumn(diffChange.modifiedStart); + const modifiedEndLineNumber = modifiedCharSequence.getEndLineNumber(diffChange.modifiedStart + diffChange.modifiedLength - 1); + const modifiedEndColumn = modifiedCharSequence.getEndColumn(diffChange.modifiedStart + diffChange.modifiedLength - 1); + return new _CharChange(originalStartLineNumber, originalStartColumn, originalEndLineNumber, originalEndColumn, modifiedStartLineNumber, modifiedStartColumn, modifiedEndLineNumber, modifiedEndColumn); + } +}; +function postProcessCharChanges(rawChanges) { + if (rawChanges.length <= 1) { + return rawChanges; + } + const result = [rawChanges[0]]; + let prevChange = result[0]; + for (let i2 = 1, len = rawChanges.length; i2 < len; i2++) { + const currChange = rawChanges[i2]; + const originalMatchingLength = currChange.originalStart - (prevChange.originalStart + prevChange.originalLength); + const modifiedMatchingLength = currChange.modifiedStart - (prevChange.modifiedStart + prevChange.modifiedLength); + const matchingLength = Math.min(originalMatchingLength, modifiedMatchingLength); + if (matchingLength < MINIMUM_MATCHING_CHARACTER_LENGTH) { + prevChange.originalLength = currChange.originalStart + currChange.originalLength - prevChange.originalStart; + prevChange.modifiedLength = currChange.modifiedStart + currChange.modifiedLength - prevChange.modifiedStart; + } else { + result.push(currChange); + prevChange = currChange; + } + } + return result; +} +var LineChange = class _LineChange { + constructor(originalStartLineNumber, originalEndLineNumber, modifiedStartLineNumber, modifiedEndLineNumber, charChanges) { + this.originalStartLineNumber = originalStartLineNumber; + this.originalEndLineNumber = originalEndLineNumber; + this.modifiedStartLineNumber = modifiedStartLineNumber; + this.modifiedEndLineNumber = modifiedEndLineNumber; + this.charChanges = charChanges; + } + static createFromDiffResult(shouldIgnoreTrimWhitespace, diffChange, originalLineSequence, modifiedLineSequence, continueCharDiff, shouldComputeCharChanges, shouldPostProcessCharChanges) { + let originalStartLineNumber; + let originalEndLineNumber; + let modifiedStartLineNumber; + let modifiedEndLineNumber; + let charChanges = void 0; + if (diffChange.originalLength === 0) { + originalStartLineNumber = originalLineSequence.getStartLineNumber(diffChange.originalStart) - 1; + originalEndLineNumber = 0; + } else { + originalStartLineNumber = originalLineSequence.getStartLineNumber(diffChange.originalStart); + originalEndLineNumber = originalLineSequence.getEndLineNumber(diffChange.originalStart + diffChange.originalLength - 1); + } + if (diffChange.modifiedLength === 0) { + modifiedStartLineNumber = modifiedLineSequence.getStartLineNumber(diffChange.modifiedStart) - 1; + modifiedEndLineNumber = 0; + } else { + modifiedStartLineNumber = modifiedLineSequence.getStartLineNumber(diffChange.modifiedStart); + modifiedEndLineNumber = modifiedLineSequence.getEndLineNumber(diffChange.modifiedStart + diffChange.modifiedLength - 1); + } + if (shouldComputeCharChanges && diffChange.originalLength > 0 && diffChange.originalLength < 20 && diffChange.modifiedLength > 0 && diffChange.modifiedLength < 20 && continueCharDiff()) { + const originalCharSequence = originalLineSequence.createCharSequence(shouldIgnoreTrimWhitespace, diffChange.originalStart, diffChange.originalStart + diffChange.originalLength - 1); + const modifiedCharSequence = modifiedLineSequence.createCharSequence(shouldIgnoreTrimWhitespace, diffChange.modifiedStart, diffChange.modifiedStart + diffChange.modifiedLength - 1); + if (originalCharSequence.getElements().length > 0 && modifiedCharSequence.getElements().length > 0) { + let rawChanges = computeDiff(originalCharSequence, modifiedCharSequence, continueCharDiff, true).changes; + if (shouldPostProcessCharChanges) { + rawChanges = postProcessCharChanges(rawChanges); + } + charChanges = []; + for (let i2 = 0, length = rawChanges.length; i2 < length; i2++) { + charChanges.push(CharChange.createFromDiffChange(rawChanges[i2], originalCharSequence, modifiedCharSequence)); + } + } + } + return new _LineChange(originalStartLineNumber, originalEndLineNumber, modifiedStartLineNumber, modifiedEndLineNumber, charChanges); + } +}; +var DiffComputer = class { + constructor(originalLines, modifiedLines, opts) { + this.shouldComputeCharChanges = opts.shouldComputeCharChanges; + this.shouldPostProcessCharChanges = opts.shouldPostProcessCharChanges; + this.shouldIgnoreTrimWhitespace = opts.shouldIgnoreTrimWhitespace; + this.shouldMakePrettyDiff = opts.shouldMakePrettyDiff; + this.originalLines = originalLines; + this.modifiedLines = modifiedLines; + this.original = new LineSequence2(originalLines); + this.modified = new LineSequence2(modifiedLines); + this.continueLineDiff = createContinueProcessingPredicate(opts.maxComputationTime); + this.continueCharDiff = createContinueProcessingPredicate(opts.maxComputationTime === 0 ? 0 : Math.min(opts.maxComputationTime, 5e3)); + } + computeDiff() { + if (this.original.lines.length === 1 && this.original.lines[0].length === 0) { + if (this.modified.lines.length === 1 && this.modified.lines[0].length === 0) { + return { + quitEarly: false, + changes: [] + }; + } + return { + quitEarly: false, + changes: [{ + originalStartLineNumber: 1, + originalEndLineNumber: 1, + modifiedStartLineNumber: 1, + modifiedEndLineNumber: this.modified.lines.length, + charChanges: void 0 + }] + }; + } + if (this.modified.lines.length === 1 && this.modified.lines[0].length === 0) { + return { + quitEarly: false, + changes: [{ + originalStartLineNumber: 1, + originalEndLineNumber: this.original.lines.length, + modifiedStartLineNumber: 1, + modifiedEndLineNumber: 1, + charChanges: void 0 + }] + }; + } + const diffResult = computeDiff(this.original, this.modified, this.continueLineDiff, this.shouldMakePrettyDiff); + const rawChanges = diffResult.changes; + const quitEarly = diffResult.quitEarly; + if (this.shouldIgnoreTrimWhitespace) { + const lineChanges = []; + for (let i2 = 0, length = rawChanges.length; i2 < length; i2++) { + lineChanges.push(LineChange.createFromDiffResult(this.shouldIgnoreTrimWhitespace, rawChanges[i2], this.original, this.modified, this.continueCharDiff, this.shouldComputeCharChanges, this.shouldPostProcessCharChanges)); + } + return { + quitEarly, + changes: lineChanges + }; + } + const result = []; + let originalLineIndex = 0; + let modifiedLineIndex = 0; + for (let i2 = -1, len = rawChanges.length; i2 < len; i2++) { + const nextChange = i2 + 1 < len ? rawChanges[i2 + 1] : null; + const originalStop = nextChange ? nextChange.originalStart : this.originalLines.length; + const modifiedStop = nextChange ? nextChange.modifiedStart : this.modifiedLines.length; + while (originalLineIndex < originalStop && modifiedLineIndex < modifiedStop) { + const originalLine = this.originalLines[originalLineIndex]; + const modifiedLine = this.modifiedLines[modifiedLineIndex]; + if (originalLine !== modifiedLine) { + { + let originalStartColumn = getFirstNonBlankColumn(originalLine, 1); + let modifiedStartColumn = getFirstNonBlankColumn(modifiedLine, 1); + while (originalStartColumn > 1 && modifiedStartColumn > 1) { + const originalChar = originalLine.charCodeAt(originalStartColumn - 2); + const modifiedChar = modifiedLine.charCodeAt(modifiedStartColumn - 2); + if (originalChar !== modifiedChar) { + break; + } + originalStartColumn--; + modifiedStartColumn--; + } + if (originalStartColumn > 1 || modifiedStartColumn > 1) { + this._pushTrimWhitespaceCharChange(result, originalLineIndex + 1, 1, originalStartColumn, modifiedLineIndex + 1, 1, modifiedStartColumn); + } + } + { + let originalEndColumn = getLastNonBlankColumn(originalLine, 1); + let modifiedEndColumn = getLastNonBlankColumn(modifiedLine, 1); + const originalMaxColumn = originalLine.length + 1; + const modifiedMaxColumn = modifiedLine.length + 1; + while (originalEndColumn < originalMaxColumn && modifiedEndColumn < modifiedMaxColumn) { + const originalChar = originalLine.charCodeAt(originalEndColumn - 1); + const modifiedChar = originalLine.charCodeAt(modifiedEndColumn - 1); + if (originalChar !== modifiedChar) { + break; + } + originalEndColumn++; + modifiedEndColumn++; + } + if (originalEndColumn < originalMaxColumn || modifiedEndColumn < modifiedMaxColumn) { + this._pushTrimWhitespaceCharChange(result, originalLineIndex + 1, originalEndColumn, originalMaxColumn, modifiedLineIndex + 1, modifiedEndColumn, modifiedMaxColumn); + } + } + } + originalLineIndex++; + modifiedLineIndex++; + } + if (nextChange) { + result.push(LineChange.createFromDiffResult(this.shouldIgnoreTrimWhitespace, nextChange, this.original, this.modified, this.continueCharDiff, this.shouldComputeCharChanges, this.shouldPostProcessCharChanges)); + originalLineIndex += nextChange.originalLength; + modifiedLineIndex += nextChange.modifiedLength; + } + } + return { + quitEarly, + changes: result + }; + } + _pushTrimWhitespaceCharChange(result, originalLineNumber, originalStartColumn, originalEndColumn, modifiedLineNumber, modifiedStartColumn, modifiedEndColumn) { + if (this._mergeTrimWhitespaceCharChange(result, originalLineNumber, originalStartColumn, originalEndColumn, modifiedLineNumber, modifiedStartColumn, modifiedEndColumn)) { + return; + } + let charChanges = void 0; + if (this.shouldComputeCharChanges) { + charChanges = [new CharChange(originalLineNumber, originalStartColumn, originalLineNumber, originalEndColumn, modifiedLineNumber, modifiedStartColumn, modifiedLineNumber, modifiedEndColumn)]; + } + result.push(new LineChange(originalLineNumber, originalLineNumber, modifiedLineNumber, modifiedLineNumber, charChanges)); + } + _mergeTrimWhitespaceCharChange(result, originalLineNumber, originalStartColumn, originalEndColumn, modifiedLineNumber, modifiedStartColumn, modifiedEndColumn) { + const len = result.length; + if (len === 0) { + return false; + } + const prevChange = result[len - 1]; + if (prevChange.originalEndLineNumber === 0 || prevChange.modifiedEndLineNumber === 0) { + return false; + } + if (prevChange.originalEndLineNumber === originalLineNumber && prevChange.modifiedEndLineNumber === modifiedLineNumber) { + if (this.shouldComputeCharChanges && prevChange.charChanges) { + prevChange.charChanges.push(new CharChange(originalLineNumber, originalStartColumn, originalLineNumber, originalEndColumn, modifiedLineNumber, modifiedStartColumn, modifiedLineNumber, modifiedEndColumn)); + } + return true; + } + if (prevChange.originalEndLineNumber + 1 === originalLineNumber && prevChange.modifiedEndLineNumber + 1 === modifiedLineNumber) { + prevChange.originalEndLineNumber = originalLineNumber; + prevChange.modifiedEndLineNumber = modifiedLineNumber; + if (this.shouldComputeCharChanges && prevChange.charChanges) { + prevChange.charChanges.push(new CharChange(originalLineNumber, originalStartColumn, originalLineNumber, originalEndColumn, modifiedLineNumber, modifiedStartColumn, modifiedLineNumber, modifiedEndColumn)); + } + return true; + } + return false; + } +}; +function getFirstNonBlankColumn(txt, defaultValue) { + const r = firstNonWhitespaceIndex(txt); + if (r === -1) { + return defaultValue; + } + return r + 1; +} +function getLastNonBlankColumn(txt, defaultValue) { + const r = lastNonWhitespaceIndex(txt); + if (r === -1) { + return defaultValue; + } + return r + 2; +} +function createContinueProcessingPredicate(maximumRuntime) { + if (maximumRuntime === 0) { + return () => true; + } + const startTime = Date.now(); + return () => { + return Date.now() - startTime < maximumRuntime; + }; +} + +// node_modules/monaco-editor-core/esm/vs/editor/common/diff/linesDiffComputers.js +var linesDiffComputers = { + getLegacy: () => new LegacyLinesDiffComputer(), + getDefault: () => new DefaultLinesDiffComputer() +}; + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineSuggestionItem.js +init_languages(); +var InlineSuggestionItem; +(function(InlineSuggestionItem2) { + function create4(data, textModel) { + if (!data.isInlineEdit && !data.uri) { + return InlineCompletionItem.create(data, textModel); + } else { + return InlineEditItem.create(data, textModel); + } + } + InlineSuggestionItem2.create = create4; +})(InlineSuggestionItem || (InlineSuggestionItem = {})); +var InlineSuggestionItemBase = class { + constructor(_data, identity2, hint) { + this._data = _data; + this.identity = identity2; + this.hint = hint; + } + /** + * A reference to the original inline completion list this inline completion has been constructed from. + * Used for event data to ensure referential equality. + */ + get source() { + return this._data.source; + } + get isFromExplicitRequest() { + return this._data.context.triggerKind === InlineCompletionTriggerKind.Explicit; + } + get forwardStable() { + return this.source.inlineSuggestions.enableForwardStability ?? false; + } + get editRange() { + return this.getSingleTextEdit().range; + } + get targetRange() { + return this.hint?.range && !this.hint.jumpToEdit ? this.hint?.range : this.editRange; + } + get insertText() { + return this.getSingleTextEdit().text; + } + get semanticId() { + return this.hash; + } + get action() { + return this._sourceInlineCompletion.gutterMenuLinkAction; + } + get command() { + return this._sourceInlineCompletion.command; + } + get warning() { + return this._sourceInlineCompletion.warning; + } + get showInlineEditMenu() { + return !!this._sourceInlineCompletion.showInlineEditMenu; + } + get hash() { + return JSON.stringify([ + this.getSingleTextEdit().text, + this.getSingleTextEdit().range.getStartPosition().toString() + ]); + } + get requestUuid() { + return this._data.context.requestUuid; + } + get partialAccepts() { + return this._data.partialAccepts; + } + /** + * A reference to the original inline completion this inline completion has been constructed from. + * Used for event data to ensure referential equality. + */ + get _sourceInlineCompletion() { + return this._data.sourceInlineCompletion; + } + addRef() { + this.identity.addRef(); + this.source.addRef(); + } + removeRef() { + this.identity.removeRef(); + this.source.removeRef(); + } + reportInlineEditShown(commandService, viewKind, viewData) { + this._data.reportInlineEditShown(commandService, this.insertText, viewKind, viewData); + } + reportPartialAccept(acceptedCharacters, info, partialAcceptance) { + this._data.reportPartialAccept(acceptedCharacters, info, partialAcceptance); + } + reportEndOfLife(reason) { + this._data.reportEndOfLife(reason); + } + setEndOfLifeReason(reason) { + this._data.setEndOfLifeReason(reason); + } + setIsPreceeded(item) { + this._data.setIsPreceeded(item.partialAccepts); + } + setNotShownReasonIfNotSet(reason) { + this._data.setNotShownReason(reason); + } + /** + * Avoid using this method. Instead introduce getters for the needed properties. + */ + getSourceCompletion() { + return this._sourceInlineCompletion; + } +}; +var InlineSuggestionIdentity = class _InlineSuggestionIdentity { + constructor() { + this._onDispose = observableSignal(this); + this._jumpedTo = observableValue(this, false); + this._refCount = 1; + this.id = "InlineCompletionIdentity" + _InlineSuggestionIdentity.idCounter++; + } + static { + this.idCounter = 0; + } + get jumpedTo() { + return this._jumpedTo; + } + addRef() { + this._refCount++; + } + removeRef() { + this._refCount--; + if (this._refCount === 0) { + this._onDispose.trigger(void 0); + } + } + setJumpTo(tx) { + this._jumpedTo.set(true, tx); + } +}; +var InlineSuggestHint = class _InlineSuggestHint { + static create(displayLocation) { + return new _InlineSuggestHint(Range.lift(displayLocation.range), displayLocation.content, displayLocation.style, displayLocation.jumpToEdit); + } + constructor(range2, content, style, jumpToEdit) { + this.range = range2; + this.content = content; + this.style = style; + this.jumpToEdit = jumpToEdit; + } + withEdit(edit2, positionOffsetTransformer) { + const offsetRange = new OffsetRange(positionOffsetTransformer.getOffset(this.range.getStartPosition()), positionOffsetTransformer.getOffset(this.range.getEndPosition())); + const newOffsetRange = applyEditsToRanges([offsetRange], edit2)[0]; + if (!newOffsetRange) { + return void 0; + } + const newRange = positionOffsetTransformer.getRange(newOffsetRange); + return new _InlineSuggestHint(newRange, this.content, this.style, this.jumpToEdit); + } +}; +var InlineCompletionItem = class _InlineCompletionItem extends InlineSuggestionItemBase { + static create(data, textModel) { + const identity2 = new InlineSuggestionIdentity(); + const transformer = getPositionOffsetTransformerFromTextModel(textModel); + const insertText = data.insertText.replace(/\r\n|\r|\n/g, textModel.getEOL()); + const edit2 = reshapeInlineCompletion(new StringReplacement(transformer.getOffsetRange(data.range), insertText), textModel); + const trimmedEdit = edit2.removeCommonSuffixAndPrefix(textModel.getValue()); + const textEdit = transformer.getTextReplacement(edit2); + const displayLocation = data.hint ? InlineSuggestHint.create(data.hint) : void 0; + return new _InlineCompletionItem(edit2, trimmedEdit, textEdit, textEdit.range, data.snippetInfo, data.additionalTextEdits, data, identity2, displayLocation); + } + constructor(_edit, _trimmedEdit, _textEdit, _originalRange, snippetInfo, additionalTextEdits, data, identity2, displayLocation) { + super(data, identity2, displayLocation); + this._edit = _edit; + this._trimmedEdit = _trimmedEdit; + this._textEdit = _textEdit; + this._originalRange = _originalRange; + this.snippetInfo = snippetInfo; + this.additionalTextEdits = additionalTextEdits; + this.isInlineEdit = false; + } + get hash() { + return JSON.stringify(this._trimmedEdit.toJson()); + } + getSingleTextEdit() { + return this._textEdit; + } + withIdentity(identity2) { + return new _InlineCompletionItem(this._edit, this._trimmedEdit, this._textEdit, this._originalRange, this.snippetInfo, this.additionalTextEdits, this._data, identity2, this.hint); + } + withEdit(textModelEdit, textModel) { + const newEditRange = applyEditsToRanges([this._edit.replaceRange], textModelEdit); + if (newEditRange.length === 0) { + return void 0; + } + const newEdit = new StringReplacement(newEditRange[0], this._textEdit.text); + const positionOffsetTransformer = getPositionOffsetTransformerFromTextModel(textModel); + const newTextEdit = positionOffsetTransformer.getTextReplacement(newEdit); + let newDisplayLocation = this.hint; + if (newDisplayLocation) { + newDisplayLocation = newDisplayLocation.withEdit(textModelEdit, positionOffsetTransformer); + if (!newDisplayLocation) { + return void 0; + } + } + const trimmedEdit = newEdit.removeCommonSuffixAndPrefix(textModel.getValue()); + return new _InlineCompletionItem(newEdit, trimmedEdit, newTextEdit, this._originalRange, this.snippetInfo, this.additionalTextEdits, this._data, this.identity, newDisplayLocation); + } + canBeReused(model, position) { + const updatedRange = this._textEdit.range; + const result = !!updatedRange && updatedRange.containsPosition(position) && this.isVisible(model, position) && TextLength.ofRange(updatedRange).isGreaterThanOrEqualTo(TextLength.ofRange(this._originalRange)); + return result; + } + isVisible(model, cursorPosition) { + const singleTextEdit = this.getSingleTextEdit(); + return inlineCompletionIsVisible(singleTextEdit, this._originalRange, model, cursorPosition); + } +}; +function inlineCompletionIsVisible(singleTextEdit, originalRange, model, cursorPosition) { + const minimizedReplacement = singleTextRemoveCommonPrefix(singleTextEdit, model); + const editRange = singleTextEdit.range; + if (!editRange || originalRange && !originalRange.getStartPosition().equals(editRange.getStartPosition()) || cursorPosition.lineNumber !== minimizedReplacement.range.startLineNumber || minimizedReplacement.isEmpty) { + return false; + } + const originalValue = model.getValueInRange( + minimizedReplacement.range, + 1 + /* EndOfLinePreference.LF */ + ); + const filterText = minimizedReplacement.text; + const cursorPosIndex = Math.max(0, cursorPosition.column - minimizedReplacement.range.startColumn); + let filterTextBefore = filterText.substring(0, cursorPosIndex); + let filterTextAfter = filterText.substring(cursorPosIndex); + let originalValueBefore = originalValue.substring(0, cursorPosIndex); + let originalValueAfter = originalValue.substring(cursorPosIndex); + const originalValueIndent = model.getLineIndentColumn(minimizedReplacement.range.startLineNumber); + if (minimizedReplacement.range.startColumn <= originalValueIndent) { + originalValueBefore = originalValueBefore.trimStart(); + if (originalValueBefore.length === 0) { + originalValueAfter = originalValueAfter.trimStart(); + } + filterTextBefore = filterTextBefore.trimStart(); + if (filterTextBefore.length === 0) { + filterTextAfter = filterTextAfter.trimStart(); + } + } + return filterTextBefore.startsWith(originalValueBefore) && !!matchesSubString(originalValueAfter, filterTextAfter); +} +var InlineEditItem = class _InlineEditItem extends InlineSuggestionItemBase { + static create(data, textModel) { + const offsetEdit = getStringEdit(textModel, data.range, data.insertText); + const text2 = new TextModelText(textModel); + const textEdit = TextEdit.fromStringEdit(offsetEdit, text2); + const singleTextEdit = offsetEdit.isEmpty() ? new TextReplacement(new Range(1, 1, 1, 1), "") : textEdit.toReplacement(text2); + const identity2 = new InlineSuggestionIdentity(); + const edits = offsetEdit.replacements.map((edit2) => { + const replacedRange = Range.fromPositions(textModel.getPositionAt(edit2.replaceRange.start), textModel.getPositionAt(edit2.replaceRange.endExclusive)); + const replacedText = textModel.getValueInRange(replacedRange); + return SingleUpdatedNextEdit.create(edit2, replacedText); + }); + const hint = data.hint ? InlineSuggestHint.create(data.hint) : void 0; + return new _InlineEditItem(offsetEdit, singleTextEdit, data.uri, data, identity2, edits, hint, false, textModel.getVersionId()); + } + constructor(_edit, _textEdit, uri, data, identity2, _edits, hint, _lastChangePartOfInlineEdit = false, _inlineEditModelVersion) { + super(data, identity2, hint); + this._edit = _edit; + this._textEdit = _textEdit; + this.uri = uri; + this._edits = _edits; + this._lastChangePartOfInlineEdit = _lastChangePartOfInlineEdit; + this._inlineEditModelVersion = _inlineEditModelVersion; + this.snippetInfo = void 0; + this.additionalTextEdits = []; + this.isInlineEdit = true; + } + get updatedEditModelVersion() { + return this._inlineEditModelVersion; + } + get updatedEdit() { + return this._edit; + } + getSingleTextEdit() { + return this._textEdit; + } + withIdentity(identity2) { + return new _InlineEditItem(this._edit, this._textEdit, this.uri, this._data, identity2, this._edits, this.hint, this._lastChangePartOfInlineEdit, this._inlineEditModelVersion); + } + canBeReused(model, position) { + return this._lastChangePartOfInlineEdit && this.updatedEditModelVersion === model.getVersionId(); + } + withEdit(textModelChanges, textModel) { + const edit2 = this._applyTextModelChanges(textModelChanges, this._edits, textModel); + return edit2; + } + _applyTextModelChanges(textModelChanges, edits, textModel) { + edits = edits.map((innerEdit) => innerEdit.applyTextModelChanges(textModelChanges)); + if (edits.some((edit2) => edit2.edit === void 0)) { + return void 0; + } + const newTextModelVersion = textModel.getVersionId(); + let inlineEditModelVersion = this._inlineEditModelVersion; + const lastChangePartOfInlineEdit = edits.some((edit2) => edit2.lastChangeUpdatedEdit); + if (lastChangePartOfInlineEdit) { + inlineEditModelVersion = newTextModelVersion ?? -1; + } + if (newTextModelVersion === null || inlineEditModelVersion + 20 < newTextModelVersion) { + return void 0; + } + edits = edits.filter((innerEdit) => !innerEdit.edit.isEmpty); + if (edits.length === 0) { + return void 0; + } + const newEdit = new StringEdit(edits.map((edit2) => edit2.edit)); + const positionOffsetTransformer = getPositionOffsetTransformerFromTextModel(textModel); + const newTextEdit = positionOffsetTransformer.getTextEdit(newEdit).toReplacement(new TextModelText(textModel)); + let newDisplayLocation = this.hint; + if (newDisplayLocation) { + newDisplayLocation = newDisplayLocation.withEdit(textModelChanges, positionOffsetTransformer); + if (!newDisplayLocation) { + return void 0; + } + } + return new _InlineEditItem(newEdit, newTextEdit, this.uri, this._data, this.identity, edits, newDisplayLocation, lastChangePartOfInlineEdit, inlineEditModelVersion); + } +}; +function getStringEdit(textModel, editRange, replaceText) { + const eol = textModel.getEOL(); + const editOriginalText = textModel.getValueInRange(editRange); + const editReplaceText = replaceText.replace(/\r\n|\r|\n/g, eol); + const diffAlgorithm = linesDiffComputers.getDefault(); + const lineDiffs = diffAlgorithm.computeDiff(splitLines(editOriginalText), splitLines(editReplaceText), { + ignoreTrimWhitespace: false, + computeMoves: false, + extendToSubwords: true, + maxComputationTimeMs: 500 + }); + const innerChanges = lineDiffs.changes.flatMap((c) => c.innerChanges ?? []); + function addRangeToPos(pos, range2) { + const start = TextLength.fromPosition(range2.getStartPosition()); + return TextLength.ofRange(range2).createRange(start.addToPosition(pos)); + } + const modifiedText = new StringText(editReplaceText); + const offsetEdit = new StringEdit(innerChanges.map((c) => { + const rangeInModel = addRangeToPos(editRange.getStartPosition(), c.originalRange); + const originalRange = getPositionOffsetTransformerFromTextModel(textModel).getOffsetRange(rangeInModel); + const replaceText2 = modifiedText.getValueOfRange(c.modifiedRange); + const edit2 = new StringReplacement(originalRange, replaceText2); + const originalText = textModel.getValueInRange(rangeInModel); + return reshapeInlineEdit(edit2, originalText, innerChanges.length, textModel); + })); + return offsetEdit; +} +var SingleUpdatedNextEdit = class _SingleUpdatedNextEdit { + static create(edit2, replacedText) { + const prefixLength = commonPrefixLength(edit2.newText, replacedText); + const suffixLength = commonSuffixLength(edit2.newText, replacedText); + const trimmedNewText = edit2.newText.substring(prefixLength, edit2.newText.length - suffixLength); + return new _SingleUpdatedNextEdit(edit2, trimmedNewText, prefixLength, suffixLength); + } + get edit() { + return this._edit; + } + get lastChangeUpdatedEdit() { + return this._lastChangeUpdatedEdit; + } + constructor(_edit, _trimmedNewText, _prefixLength, _suffixLength, _lastChangeUpdatedEdit = false) { + this._edit = _edit; + this._trimmedNewText = _trimmedNewText; + this._prefixLength = _prefixLength; + this._suffixLength = _suffixLength; + this._lastChangeUpdatedEdit = _lastChangeUpdatedEdit; + } + applyTextModelChanges(textModelChanges) { + const c = this._clone(); + c._applyTextModelChanges(textModelChanges); + return c; + } + _clone() { + return new _SingleUpdatedNextEdit(this._edit, this._trimmedNewText, this._prefixLength, this._suffixLength, this._lastChangeUpdatedEdit); + } + _applyTextModelChanges(textModelChanges) { + this._lastChangeUpdatedEdit = false; + if (!this._edit) { + throw new BugIndicatingError("UpdatedInnerEdits: No edit to apply changes to"); + } + const result = this._applyChanges(this._edit, textModelChanges); + if (!result) { + this._edit = void 0; + return; + } + this._edit = result.edit; + this._lastChangeUpdatedEdit = result.editHasChanged; + } + _applyChanges(edit2, textModelChanges) { + let editStart = edit2.replaceRange.start; + let editEnd = edit2.replaceRange.endExclusive; + let editReplaceText = edit2.newText; + let editHasChanged = false; + const shouldPreserveEditShape = this._prefixLength > 0 || this._suffixLength > 0; + for (let i2 = textModelChanges.replacements.length - 1; i2 >= 0; i2--) { + const change = textModelChanges.replacements[i2]; + const isInsertion2 = change.newText.length > 0 && change.replaceRange.isEmpty; + if (isInsertion2 && !shouldPreserveEditShape && change.replaceRange.start === editStart && editReplaceText.startsWith(change.newText)) { + editStart += change.newText.length; + editReplaceText = editReplaceText.substring(change.newText.length); + editEnd = Math.max(editStart, editEnd); + editHasChanged = true; + continue; + } + if (isInsertion2 && shouldPreserveEditShape && change.replaceRange.start === editStart + this._prefixLength && this._trimmedNewText.startsWith(change.newText)) { + editEnd += change.newText.length; + editHasChanged = true; + this._prefixLength += change.newText.length; + this._trimmedNewText = this._trimmedNewText.substring(change.newText.length); + continue; + } + const isDeletion3 = change.newText.length === 0 && change.replaceRange.length > 0; + if (isDeletion3 && change.replaceRange.start >= editStart + this._prefixLength && change.replaceRange.endExclusive <= editEnd - this._suffixLength) { + editEnd -= change.replaceRange.length; + editHasChanged = true; + continue; + } + if (change.equals(edit2)) { + editHasChanged = true; + editStart = change.replaceRange.endExclusive; + editReplaceText = ""; + continue; + } + if (change.replaceRange.start > editEnd) { + continue; + } + if (change.replaceRange.endExclusive < editStart) { + editStart += change.newText.length - change.replaceRange.length; + editEnd += change.newText.length - change.replaceRange.length; + continue; + } + return void 0; + } + if (this._trimmedNewText.length === 0 && editStart + this._prefixLength === editEnd - this._suffixLength) { + return { edit: new StringReplacement(new OffsetRange(editStart + this._prefixLength, editStart + this._prefixLength), ""), editHasChanged: true }; + } + return { edit: new StringReplacement(new OffsetRange(editStart, editEnd), editReplaceText), editHasChanged }; + } +}; +function reshapeInlineCompletion(edit2, textModel) { + const eol = textModel.getEOL(); + if (edit2.replaceRange.isEmpty && edit2.newText.includes(eol)) { + edit2 = reshapeMultiLineInsertion(edit2, textModel); + } + return edit2; +} +function reshapeInlineEdit(edit2, originalText, totalInnerEdits, textModel) { + const eol = textModel.getEOL(); + if (edit2.newText.endsWith(eol) && originalText.endsWith(eol)) { + edit2 = new StringReplacement(edit2.replaceRange.deltaEnd(-eol.length), edit2.newText.slice(0, -eol.length)); + } + if (totalInnerEdits === 1 && edit2.replaceRange.isEmpty && edit2.newText.includes(eol)) { + const startPosition = textModel.getPositionAt(edit2.replaceRange.start); + const hasTextOnInsertionLine = textModel.getLineLength(startPosition.lineNumber) !== 0; + if (hasTextOnInsertionLine) { + edit2 = reshapeMultiLineInsertion(edit2, textModel); + } + } + if (totalInnerEdits === 1) { + const prefixLength = commonPrefixLength(originalText, edit2.newText); + const suffixLength = commonSuffixLength(originalText.slice(prefixLength), edit2.newText.slice(prefixLength)); + if (prefixLength + suffixLength === originalText.length) { + return new StringReplacement(edit2.replaceRange.deltaStart(prefixLength).deltaEnd(-suffixLength), edit2.newText.substring(prefixLength, edit2.newText.length - suffixLength)); + } + if (prefixLength + suffixLength === edit2.newText.length) { + return new StringReplacement(edit2.replaceRange.deltaStart(prefixLength).deltaEnd(-suffixLength), ""); + } + } + return edit2; +} +function reshapeMultiLineInsertion(edit2, textModel) { + if (!edit2.replaceRange.isEmpty) { + throw new BugIndicatingError("Unexpected original range"); + } + if (edit2.replaceRange.start === 0) { + return edit2; + } + const eol = textModel.getEOL(); + const startPosition = textModel.getPositionAt(edit2.replaceRange.start); + const startColumn = startPosition.column; + const startLineNumber = startPosition.lineNumber; + if (startColumn === 1 && startLineNumber > 1 && edit2.newText.endsWith(eol) && !edit2.newText.startsWith(eol)) { + return new StringReplacement(edit2.replaceRange.delta(-1), eol + edit2.newText.slice(0, -eol.length)); + } + return edit2; +} + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/inlineCompletions/browser/model/provideInlineCompletions.js +init_assert(); +init_async(); +init_cancellation(); +init_errors(); +init_lifecycle(); +init_uuid(); +init_offsetRange(); +init_range(); +init_languages(); + +// node_modules/monaco-editor-core/esm/vs/editor/common/model/bracketPairsTextModelPart/fixBrackets.js +init_brackets(); +init_length(); +init_parser(); +init_smallImmutableSet(); +init_tokenizer(); +function fixBracketsInLine(tokens, languageConfigurationService) { + const denseKeyProvider = new DenseKeyProvider(); + const bracketTokens = new LanguageAgnosticBracketTokens(denseKeyProvider, (languageId) => languageConfigurationService.getLanguageConfiguration(languageId)); + const tokenizer = new TextBufferTokenizer(new StaticTokenizerSource([tokens]), bracketTokens); + const node = parseDocument(tokenizer, [], void 0, true); + let str = ""; + const line = tokens.getLineContent(); + function processNode(node2, offset) { + if (node2.kind === 2) { + processNode(node2.openingBracket, offset); + offset = lengthAdd(offset, node2.openingBracket.length); + if (node2.child) { + processNode(node2.child, offset); + offset = lengthAdd(offset, node2.child.length); + } + if (node2.closingBracket) { + processNode(node2.closingBracket, offset); + offset = lengthAdd(offset, node2.closingBracket.length); + } else { + const singleLangBracketTokens = bracketTokens.getSingleLanguageBracketTokens(node2.openingBracket.languageId); + const closingTokenText = singleLangBracketTokens.findClosingTokenText(node2.openingBracket.bracketIds); + str += closingTokenText; + } + } else if (node2.kind === 3) { + } else if (node2.kind === 0 || node2.kind === 1) { + str += line.substring(lengthGetColumnCountIfZeroLineCount(offset), lengthGetColumnCountIfZeroLineCount(lengthAdd(offset, node2.length))); + } else if (node2.kind === 4) { + for (const child of node2.children) { + processNode(child, offset); + offset = lengthAdd(offset, child.length); + } + } + } + processNode(node, lengthZero); + return str; +} +var StaticTokenizerSource = class { + constructor(lines) { + this.lines = lines; + this.tokenization = { + getLineTokens: (lineNumber) => { + return this.lines[lineNumber - 1]; + } + }; + } + getLineCount() { + return this.lines.length; + } + getLineLength(lineNumber) { + return this.lines[lineNumber - 1].getLineContent().length; + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/inlineCompletions/browser/model/provideInlineCompletions.js +init_collections(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/inlineCompletions/browser/model/graph.js +var DirectedGraph = class _DirectedGraph { + constructor() { + this._nodes = /* @__PURE__ */ new Set(); + this._outgoingEdges = /* @__PURE__ */ new Map(); + } + static from(nodes, getOutgoing) { + const graph = new _DirectedGraph(); + for (const node of nodes) { + graph._nodes.add(node); + } + for (const node of nodes) { + const outgoing = getOutgoing(node); + if (outgoing.length > 0) { + const outgoingSet = /* @__PURE__ */ new Set(); + for (const target of outgoing) { + outgoingSet.add(target); + } + graph._outgoingEdges.set(node, outgoingSet); + } + } + return graph; + } + /** + * After this, the graph is guaranteed to have no cycles. + */ + removeCycles() { + const foundCycles = []; + const visited = /* @__PURE__ */ new Set(); + const recursionStack = /* @__PURE__ */ new Set(); + const toRemove = []; + const dfs3 = (node) => { + visited.add(node); + recursionStack.add(node); + const outgoing = this._outgoingEdges.get(node); + if (outgoing) { + for (const neighbor of outgoing) { + if (!visited.has(neighbor)) { + dfs3(neighbor); + } else if (recursionStack.has(neighbor)) { + foundCycles.push(neighbor); + toRemove.push({ from: node, to: neighbor }); + } + } + } + recursionStack.delete(node); + }; + for (const node of this._nodes) { + if (!visited.has(node)) { + dfs3(node); + } + } + for (const { from, to } of toRemove) { + const outgoingSet = this._outgoingEdges.get(from); + if (outgoingSet) { + outgoingSet.delete(to); + } + } + return { foundCycles }; + } + getOutgoing(node) { + const outgoing = this._outgoingEdges.get(node); + return outgoing ? Array.from(outgoing) : []; + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/inlineCompletions/browser/model/provideInlineCompletions.js +init_cache(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViewInterface.js +var InlineEditTabAction; +(function(InlineEditTabAction2) { + InlineEditTabAction2["Jump"] = "jump"; + InlineEditTabAction2["Accept"] = "accept"; + InlineEditTabAction2["Inactive"] = "inactive"; +})(InlineEditTabAction || (InlineEditTabAction = {})); +var InlineCompletionViewKind; +(function(InlineCompletionViewKind2) { + InlineCompletionViewKind2["GhostText"] = "ghostText"; + InlineCompletionViewKind2["Custom"] = "custom"; + InlineCompletionViewKind2["SideBySide"] = "sideBySide"; + InlineCompletionViewKind2["Deletion"] = "deletion"; + InlineCompletionViewKind2["InsertionInline"] = "insertionInline"; + InlineCompletionViewKind2["InsertionMultiLine"] = "insertionMultiLine"; + InlineCompletionViewKind2["WordReplacements"] = "wordReplacements"; + InlineCompletionViewKind2["LineReplacement"] = "lineReplacement"; + InlineCompletionViewKind2["Collapsed"] = "collapsed"; +})(InlineCompletionViewKind || (InlineCompletionViewKind = {})); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/inlineCompletions/browser/model/provideInlineCompletions.js +init_types(); +init_textModelEditSource(); +init_uri(); +function provideInlineCompletions(providers, position, model, context, requestInfo, languageConfigurationService) { + const requestUuid = prefixedUuid("icr"); + const cancellationTokenSource = new CancellationTokenSource(); + let cancelReason = void 0; + const contextWithUuid = { ...context, requestUuid }; + const defaultReplaceRange = getDefaultRange(position, model); + const providersByGroupId = groupByMap(providers, (p) => p.groupId); + const yieldsToGraph = DirectedGraph.from(providers, (p) => { + return p.yieldsToGroupIds?.flatMap((groupId) => providersByGroupId.get(groupId) ?? []) ?? []; + }); + const { foundCycles } = yieldsToGraph.removeCycles(); + if (foundCycles.length > 0) { + onUnexpectedExternalError(new Error(`Inline completions: cyclic yield-to dependency detected. Path: ${foundCycles.map((s) => s.toString ? s.toString() : "" + s).join(" -> ")}`)); + } + let runningCount = 0; + const queryProvider = new CachedFunction(async (provider) => { + try { + runningCount++; + if (cancellationTokenSource.token.isCancellationRequested) { + return void 0; + } + const yieldsTo = yieldsToGraph.getOutgoing(provider); + for (const p of yieldsTo) { + const result2 = await queryProvider.get(p); + if (result2) { + for (const item of result2.inlineSuggestions.items) { + if (item.isInlineEdit || typeof item.insertText !== "string" && item.insertText !== void 0) { + return void 0; + } + if (item.insertText !== void 0) { + const t = new TextReplacement(Range.lift(item.range) ?? defaultReplaceRange, item.insertText); + if (inlineCompletionIsVisible(t, void 0, model, position)) { + return void 0; + } + } + } + } + } + let result; + const providerStartTime = Date.now(); + try { + result = await provider.provideInlineCompletions(model, position, contextWithUuid, cancellationTokenSource.token); + } catch (e) { + onUnexpectedExternalError(e); + return void 0; + } + const providerEndTime = Date.now(); + if (!result) { + return void 0; + } + const data = []; + const list2 = new InlineSuggestionList(result, data, provider); + list2.addRef(); + runWhenCancelled(cancellationTokenSource.token, () => { + return list2.removeRef(cancelReason); + }); + if (cancellationTokenSource.token.isCancellationRequested) { + return void 0; + } + for (const item of result.items) { + data.push(toInlineSuggestData(item, list2, defaultReplaceRange, model, languageConfigurationService, contextWithUuid, requestInfo, { startTime: providerStartTime, endTime: providerEndTime })); + } + return list2; + } finally { + runningCount--; + } + }); + const inlineCompletionLists = AsyncIterableProducer.fromPromisesResolveOrder(providers.map((p) => queryProvider.get(p))).filter(isDefined); + return { + contextWithUuid, + get didAllProvidersReturn() { + return runningCount === 0; + }, + lists: inlineCompletionLists, + cancelAndDispose: (reason) => { + if (cancelReason !== void 0) { + return; + } + cancelReason = reason; + cancellationTokenSource.dispose(true); + } + }; +} +function runWhenCancelled(token, callback) { + if (token.isCancellationRequested) { + callback(); + return Disposable.None; + } else { + const listener = token.onCancellationRequested(() => { + listener.dispose(); + callback(); + }); + return { dispose: () => listener.dispose() }; + } +} +function toInlineSuggestData(inlineCompletion, source, defaultReplaceRange, textModel, languageConfigurationService, context, requestInfo, providerRequestInfo) { + let insertText; + let snippetInfo; + let range2 = inlineCompletion.range ? Range.lift(inlineCompletion.range) : defaultReplaceRange; + if (typeof inlineCompletion.insertText === "string") { + insertText = inlineCompletion.insertText; + if (languageConfigurationService && inlineCompletion.completeBracketPairs) { + insertText = closeBrackets(insertText, range2.getStartPosition(), textModel, languageConfigurationService); + const diff = insertText.length - inlineCompletion.insertText.length; + if (diff !== 0) { + range2 = new Range(range2.startLineNumber, range2.startColumn, range2.endLineNumber, range2.endColumn + diff); + } + } + snippetInfo = void 0; + } else if (inlineCompletion.insertText === void 0) { + insertText = ""; + snippetInfo = void 0; + range2 = new Range(1, 1, 1, 1); + } else if ("snippet" in inlineCompletion.insertText) { + const preBracketCompletionLength = inlineCompletion.insertText.snippet.length; + if (languageConfigurationService && inlineCompletion.completeBracketPairs) { + inlineCompletion.insertText.snippet = closeBrackets(inlineCompletion.insertText.snippet, range2.getStartPosition(), textModel, languageConfigurationService); + const diff = inlineCompletion.insertText.snippet.length - preBracketCompletionLength; + if (diff !== 0) { + range2 = new Range(range2.startLineNumber, range2.startColumn, range2.endLineNumber, range2.endColumn + diff); + } + } + const snippet = new SnippetParser().parse(inlineCompletion.insertText.snippet); + if (snippet.children.length === 1 && snippet.children[0] instanceof Text) { + insertText = snippet.children[0].value; + snippetInfo = void 0; + } else { + insertText = snippet.toString(); + snippetInfo = { + snippet: inlineCompletion.insertText.snippet, + range: range2 + }; + } + } else { + assertNever(inlineCompletion.insertText); + } + return new InlineSuggestData(range2, insertText, snippetInfo, URI.revive(inlineCompletion.uri), inlineCompletion.hint, inlineCompletion.additionalTextEdits || getReadonlyEmptyArray(), inlineCompletion, source, context, inlineCompletion.isInlineEdit ?? false, requestInfo, providerRequestInfo, inlineCompletion.correlationId); +} +var InlineSuggestData = class { + constructor(range2, insertText, snippetInfo, uri, hint, additionalTextEdits, sourceInlineCompletion, source, context, isInlineEdit, _requestInfo, _providerRequestInfo, _correlationId) { + this.range = range2; + this.insertText = insertText; + this.snippetInfo = snippetInfo; + this.uri = uri; + this.hint = hint; + this.additionalTextEdits = additionalTextEdits; + this.sourceInlineCompletion = sourceInlineCompletion; + this.source = source; + this.context = context; + this.isInlineEdit = isInlineEdit; + this._requestInfo = _requestInfo; + this._providerRequestInfo = _providerRequestInfo; + this._correlationId = _correlationId; + this._didShow = false; + this._timeUntilShown = void 0; + this._showStartTime = void 0; + this._shownDuration = 0; + this._showUncollapsedStartTime = void 0; + this._showUncollapsedDuration = 0; + this._notShownReason = void 0; + this._didReportEndOfLife = false; + this._lastSetEndOfLifeReason = void 0; + this._isPreceeded = false; + this._partiallyAcceptedCount = 0; + this._partiallyAcceptedSinceOriginal = { characters: 0, ratio: 0, count: 0 }; + this._viewData = { editorType: _requestInfo.editorType }; + } + get showInlineEditMenu() { + return this.sourceInlineCompletion.showInlineEditMenu ?? false; + } + get partialAccepts() { + return this._partiallyAcceptedSinceOriginal; + } + async reportInlineEditShown(commandService, updatedInsertText, viewKind, viewData) { + this.updateShownDuration(viewKind); + if (this._didShow) { + return; + } + this._didShow = true; + this._viewData.viewKind = viewKind; + this._viewData.renderData = viewData; + this._timeUntilShown = Date.now() - this._requestInfo.startTime; + const editDeltaInfo = new EditDeltaInfo(viewData.lineCountModified, viewData.lineCountOriginal, viewData.characterCountModified, viewData.characterCountOriginal); + this.source.provider.handleItemDidShow?.(this.source.inlineSuggestions, this.sourceInlineCompletion, updatedInsertText, editDeltaInfo); + if (this.sourceInlineCompletion.shownCommand) { + await commandService.executeCommand(this.sourceInlineCompletion.shownCommand.id, ...this.sourceInlineCompletion.shownCommand.arguments || []); + } + } + reportPartialAccept(acceptedCharacters, info, partialAcceptance) { + this._partiallyAcceptedCount++; + this._partiallyAcceptedSinceOriginal.characters += partialAcceptance.characters; + this._partiallyAcceptedSinceOriginal.ratio = Math.min(this._partiallyAcceptedSinceOriginal.ratio + (1 - this._partiallyAcceptedSinceOriginal.ratio) * partialAcceptance.ratio, 1); + this._partiallyAcceptedSinceOriginal.count += partialAcceptance.count; + this.source.provider.handlePartialAccept?.(this.source.inlineSuggestions, this.sourceInlineCompletion, acceptedCharacters, info); + } + /** + * Sends the end of life event to the provider. + * If no reason is provided, the last set reason is used. + * If no reason was set, the default reason is used. + */ + reportEndOfLife(reason) { + if (this._didReportEndOfLife) { + return; + } + this._didReportEndOfLife = true; + this.reportInlineEditHidden(); + if (!reason) { + reason = this._lastSetEndOfLifeReason ?? { kind: InlineCompletionEndOfLifeReasonKind.Ignored, userTypingDisagreed: false, supersededBy: void 0 }; + } + if (reason.kind === InlineCompletionEndOfLifeReasonKind.Rejected && this.source.provider.handleRejection) { + this.source.provider.handleRejection(this.source.inlineSuggestions, this.sourceInlineCompletion); + } + if (this.source.provider.handleEndOfLifetime) { + const summary = { + requestUuid: this.context.requestUuid, + correlationId: this._correlationId, + selectedSuggestionInfo: !!this.context.selectedSuggestionInfo, + partiallyAccepted: this._partiallyAcceptedCount, + partiallyAcceptedCountSinceOriginal: this._partiallyAcceptedSinceOriginal.count, + partiallyAcceptedRatioSinceOriginal: this._partiallyAcceptedSinceOriginal.ratio, + partiallyAcceptedCharactersSinceOriginal: this._partiallyAcceptedSinceOriginal.characters, + shown: this._didShow, + shownDuration: this._shownDuration, + shownDurationUncollapsed: this._showUncollapsedDuration, + preceeded: this._isPreceeded, + timeUntilShown: this._timeUntilShown, + timeUntilProviderRequest: this._providerRequestInfo.startTime - this._requestInfo.startTime, + timeUntilProviderResponse: this._providerRequestInfo.endTime - this._requestInfo.startTime, + editorType: this._viewData.editorType, + languageId: this._requestInfo.languageId, + requestReason: this._requestInfo.reason, + viewKind: this._viewData.viewKind, + notShownReason: this._notShownReason, + typingInterval: this._requestInfo.typingInterval, + typingIntervalCharacterCount: this._requestInfo.typingIntervalCharacterCount, + availableProviders: this._requestInfo.availableProviders.map((p) => p.toString()).join(","), + ...this._viewData.renderData + }; + this.source.provider.handleEndOfLifetime(this.source.inlineSuggestions, this.sourceInlineCompletion, reason, summary); + } + } + setIsPreceeded(partialAccepts) { + this._isPreceeded = true; + if (this._partiallyAcceptedSinceOriginal.characters !== 0 || this._partiallyAcceptedSinceOriginal.ratio !== 0 || this._partiallyAcceptedSinceOriginal.count !== 0) { + console.warn("Expected partiallyAcceptedCountSinceOriginal to be { characters: 0, rate: 0, partialAcceptances: 0 } before setIsPreceeded."); + } + this._partiallyAcceptedSinceOriginal = partialAccepts; + } + setNotShownReason(reason) { + this._notShownReason ??= reason; + } + /** + * Sets the end of life reason, but does not send the event to the provider yet. + */ + setEndOfLifeReason(reason) { + this.reportInlineEditHidden(); + this._lastSetEndOfLifeReason = reason; + } + updateShownDuration(viewKind) { + const timeNow = Date.now(); + if (!this._showStartTime) { + this._showStartTime = timeNow; + } + const isCollapsed = viewKind === InlineCompletionViewKind.Collapsed; + if (!isCollapsed && this._showUncollapsedStartTime === void 0) { + this._showUncollapsedStartTime = timeNow; + } + if (isCollapsed && this._showUncollapsedStartTime !== void 0) { + this._showUncollapsedDuration += timeNow - this._showUncollapsedStartTime; + } + } + reportInlineEditHidden() { + if (this._showStartTime === void 0) { + return; + } + const timeNow = Date.now(); + this._shownDuration += timeNow - this._showStartTime; + this._showStartTime = void 0; + if (this._showUncollapsedStartTime === void 0) { + return; + } + this._showUncollapsedDuration += timeNow - this._showUncollapsedStartTime; + this._showUncollapsedStartTime = void 0; + } +}; +var InlineCompletionEditorType; +(function(InlineCompletionEditorType2) { + InlineCompletionEditorType2["TextEditor"] = "textEditor"; + InlineCompletionEditorType2["DiffEditor"] = "diffEditor"; + InlineCompletionEditorType2["Notebook"] = "notebook"; +})(InlineCompletionEditorType || (InlineCompletionEditorType = {})); +var InlineSuggestionList = class { + constructor(inlineSuggestions, inlineSuggestionsData, provider) { + this.inlineSuggestions = inlineSuggestions; + this.inlineSuggestionsData = inlineSuggestionsData; + this.provider = provider; + this.refCount = 0; + } + addRef() { + this.refCount++; + } + removeRef(reason = { kind: "other" }) { + this.refCount--; + if (this.refCount === 0) { + for (const item of this.inlineSuggestionsData) { + item.reportEndOfLife(); + } + this.provider.disposeInlineCompletions(this.inlineSuggestions, reason); + } + } +}; +function getDefaultRange(position, model) { + const word = model.getWordAtPosition(position); + const maxColumn = model.getLineMaxColumn(position.lineNumber); + return word ? new Range(position.lineNumber, word.startColumn, position.lineNumber, maxColumn) : Range.fromPositions(position, position.with(void 0, maxColumn)); +} +function closeBrackets(text2, position, model, languageConfigurationService) { + const currentLine = model.getLineContent(position.lineNumber); + const edit2 = StringReplacement.replace(new OffsetRange(position.column - 1, currentLine.length), text2); + const proposedLineTokens = model.tokenization.tokenizeLinesAt(position.lineNumber, [edit2.replace(currentLine)]); + const textTokens = proposedLineTokens?.[0].sliceZeroCopy(edit2.getRangeAfterReplace()); + if (!textTokens) { + return text2; + } + const fixedText = fixBracketsInLine(textTokens, languageConfigurationService); + return fixedText; +} + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsSource.js +var __decorate104 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param98 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var InlineCompletionsSource_1; +var InlineCompletionsSource = class InlineCompletionsSource2 extends Disposable { + static { + InlineCompletionsSource_1 = this; + } + static { + this._requestId = 0; + } + constructor(_textModel, _versionId, _debounceValue, _cursorPosition, _languageConfigurationService, _logService, _configurationService, _instantiationService, _contextKeyService) { + super(); + this._textModel = _textModel; + this._versionId = _versionId; + this._debounceValue = _debounceValue; + this._cursorPosition = _cursorPosition; + this._languageConfigurationService = _languageConfigurationService; + this._logService = _logService; + this._configurationService = _configurationService; + this._instantiationService = _instantiationService; + this._contextKeyService = _contextKeyService; + this._updateOperation = this._register(new MutableDisposable()); + this._state = observableReducerSettable(this, { + initial: () => ({ + inlineCompletions: InlineCompletionsState.createEmpty(), + suggestWidgetInlineCompletions: InlineCompletionsState.createEmpty() + }), + disposeFinal: (values) => { + values.inlineCompletions.dispose(); + values.suggestWidgetInlineCompletions.dispose(); + }, + changeTracker: recordChangesLazy(() => ({ versionId: this._versionId })), + update: (reader, previousValue, changes) => { + const edit2 = StringEdit.compose(changes.changes.map((c) => c.change ? offsetEditFromContentChanges(c.change.changes) : StringEdit.empty).filter(isDefined)); + if (edit2.isEmpty()) { + return previousValue; + } + try { + return { + inlineCompletions: previousValue.inlineCompletions.createStateWithAppliedEdit(edit2, this._textModel), + suggestWidgetInlineCompletions: previousValue.suggestWidgetInlineCompletions.createStateWithAppliedEdit(edit2, this._textModel) + }; + } finally { + previousValue.inlineCompletions.dispose(); + previousValue.suggestWidgetInlineCompletions.dispose(); + } + } + }); + this.inlineCompletions = this._state.map(this, (v) => v.inlineCompletions); + this.suggestWidgetInlineCompletions = this._state.map(this, (v) => v.suggestWidgetInlineCompletions); + this._completionsEnabled = void 0; + this.clearOperationOnTextModelChange = derived(this, (reader) => { + this._versionId.read(reader); + this._updateOperation.clear(); + return void 0; + }); + this._loadingCount = observableValue(this, 0); + this._loggingEnabled = observableConfigValue("editor.inlineSuggest.logFetch", false, this._configurationService).recomputeInitiallyAndOnChange(this._store); + this._sendRequestData = observableConfigValue("editor.inlineSuggest.emptyResponseInformation", true, this._configurationService).recomputeInitiallyAndOnChange(this._store); + this._structuredFetchLogger = this._register(this._instantiationService.createInstance(StructuredLogger.cast(), "editor.inlineSuggest.logFetch.commandId")); + this.clearOperationOnTextModelChange.recomputeInitiallyAndOnChange(this._store); + const enablementSetting = product_default.defaultChatAgent?.completionsEnablementSetting ?? void 0; + if (enablementSetting) { + this._updateCompletionsEnablement(enablementSetting); + this._register(this._configurationService.onDidChangeConfiguration((e) => { + if (e.affectsConfiguration(enablementSetting)) { + this._updateCompletionsEnablement(enablementSetting); + } + })); + } + this._state.recomputeInitiallyAndOnChange(this._store); + } + _updateCompletionsEnablement(enalementSetting) { + const result = this._configurationService.getValue(enalementSetting); + if (!isObject(result)) { + this._completionsEnabled = void 0; + } else { + this._completionsEnabled = result; + } + } + _log(entry) { + if (this._loggingEnabled.get()) { + this._logService.info(formatRecordableLogEntry(entry)); + } + this._structuredFetchLogger.log(entry); + } + fetch(providers, providersLabel, context, activeInlineCompletion, withDebounce, userJumpedToActiveCompletion, requestInfo) { + const position = this._cursorPosition.get(); + const request = new UpdateRequest(position, context, this._textModel.getVersionId(), new Set(providers)); + const target = context.selectedSuggestionInfo ? this.suggestWidgetInlineCompletions.get() : this.inlineCompletions.get(); + if (this._updateOperation.value?.request.satisfies(request)) { + return this._updateOperation.value.promise; + } else if (target?.request?.satisfies(request)) { + return Promise.resolve(true); + } + const updateOngoing = !!this._updateOperation.value; + this._updateOperation.clear(); + const source = new CancellationTokenSource(); + const promise = (async () => { + const store = new DisposableStore(); + this._loadingCount.set(this._loadingCount.get() + 1, void 0); + let didDecrease = false; + const decreaseLoadingCount = () => { + if (!didDecrease) { + didDecrease = true; + this._loadingCount.set(this._loadingCount.get() - 1, void 0); + } + }; + const loadingReset = store.add(new RunOnceScheduler(() => decreaseLoadingCount(), 10 * 1e3)); + loadingReset.schedule(); + const inlineSuggestionsProviders = providers.filter((p) => p.providerId); + const requestResponseInfo = new RequestResponseData(context, requestInfo, inlineSuggestionsProviders); + try { + const recommendedDebounceValue = this._debounceValue.get(this._textModel); + const debounceValue = findLastMax(providers.map((p) => p.debounceDelayMs), compareUndefinedSmallest(numberComparator)) ?? recommendedDebounceValue; + const shouldDebounce = updateOngoing || withDebounce && context.triggerKind === InlineCompletionTriggerKind.Automatic; + if (shouldDebounce) { + await wait(debounceValue, source.token); + } + if (source.token.isCancellationRequested || this._store.isDisposed || this._textModel.getVersionId() !== request.versionId) { + requestResponseInfo.setNoSuggestionReasonIfNotSet("canceled:beforeFetch"); + return false; + } + const requestId = InlineCompletionsSource_1._requestId++; + if (this._loggingEnabled.get() || this._structuredFetchLogger.isEnabled.get()) { + this._log({ + sourceId: "InlineCompletions.fetch", + kind: "start", + requestId, + modelUri: this._textModel.uri, + modelVersion: this._textModel.getVersionId(), + context: { triggerKind: context.triggerKind, suggestInfo: context.selectedSuggestionInfo ? true : void 0 }, + time: Date.now(), + provider: providersLabel + }); + } + const startTime = /* @__PURE__ */ new Date(); + const providerResult = provideInlineCompletions(providers, this._cursorPosition.get(), this._textModel, context, requestInfo, this._languageConfigurationService); + runWhenCancelled(source.token, () => providerResult.cancelAndDispose({ kind: "tokenCancellation" })); + let shouldStopEarly = false; + let producedSuggestion = false; + const suggestions = []; + for await (const list2 of providerResult.lists) { + if (!list2) { + continue; + } + list2.addRef(); + store.add(toDisposable(() => list2.removeRef(list2.inlineSuggestionsData.length === 0 ? { kind: "empty" } : { kind: "notTaken" }))); + for (const item of list2.inlineSuggestionsData) { + producedSuggestion = true; + if (!context.includeInlineEdits && (item.isInlineEdit || item.showInlineEditMenu)) { + item.setNotShownReason("notInlineEditRequested"); + continue; + } + if (!context.includeInlineCompletions && !(item.isInlineEdit || item.showInlineEditMenu)) { + item.setNotShownReason("notInlineCompletionRequested"); + continue; + } + const i2 = InlineSuggestionItem.create(item, this._textModel); + suggestions.push(i2); + if (!i2.isInlineEdit && !i2.showInlineEditMenu && context.triggerKind === InlineCompletionTriggerKind.Automatic) { + if (i2.isVisible(this._textModel, this._cursorPosition.get())) { + shouldStopEarly = true; + } + } + } + if (shouldStopEarly) { + break; + } + } + providerResult.cancelAndDispose({ kind: "lostRace" }); + if (this._loggingEnabled.get() || this._structuredFetchLogger.isEnabled.get()) { + const didAllProvidersReturn = providerResult.didAllProvidersReturn; + let error = void 0; + if (source.token.isCancellationRequested || this._store.isDisposed || this._textModel.getVersionId() !== request.versionId) { + error = "canceled"; + } + const result = suggestions.map((c) => ({ + range: c.editRange.toString(), + text: c.insertText, + hint: c.hint, + isInlineEdit: c.isInlineEdit, + showInlineEditMenu: c.showInlineEditMenu, + providerId: c.source.provider.providerId?.toString() + })); + this._log({ sourceId: "InlineCompletions.fetch", kind: "end", requestId, durationMs: Date.now() - startTime.getTime(), error, result, time: Date.now(), didAllProvidersReturn }); + } + requestResponseInfo.setRequestUuid(providerResult.contextWithUuid.requestUuid); + if (producedSuggestion) { + requestResponseInfo.setHasProducedSuggestion(); + if (suggestions.length > 0 && source.token.isCancellationRequested) { + suggestions.forEach((s) => s.setNotShownReasonIfNotSet("canceled:whileAwaitingOtherProviders")); + } + } else { + if (source.token.isCancellationRequested) { + requestResponseInfo.setNoSuggestionReasonIfNotSet("canceled:whileFetching"); + } else { + const completionsQuotaExceeded = this._contextKeyService.getContextKeyValue("completionsQuotaExceeded"); + requestResponseInfo.setNoSuggestionReasonIfNotSet(completionsQuotaExceeded ? "completionsQuotaExceeded" : "noSuggestion"); + } + } + const remainingTimeToWait = context.earliestShownDateTime - Date.now(); + if (remainingTimeToWait > 0) { + await wait(remainingTimeToWait, source.token); + } + if (source.token.isCancellationRequested || this._store.isDisposed || this._textModel.getVersionId() !== request.versionId || userJumpedToActiveCompletion.get()) { + const notShownReason = source.token.isCancellationRequested ? "canceled:afterMinShowDelay" : this._store.isDisposed ? "canceled:disposed" : this._textModel.getVersionId() !== request.versionId ? "canceled:documentChanged" : userJumpedToActiveCompletion.get() ? "canceled:userJumped" : "unknown"; + suggestions.forEach((s) => s.setNotShownReasonIfNotSet(notShownReason)); + return false; + } + const endTime = /* @__PURE__ */ new Date(); + this._debounceValue.update(this._textModel, endTime.getTime() - startTime.getTime()); + const cursorPosition = this._cursorPosition.get(); + this._updateOperation.clear(); + transaction((tx) => { + const v = this._state.get(); + if (context.selectedSuggestionInfo) { + this._state.set({ + inlineCompletions: InlineCompletionsState.createEmpty(), + suggestWidgetInlineCompletions: v.suggestWidgetInlineCompletions.createStateWithAppliedResults(suggestions, request, this._textModel, cursorPosition, activeInlineCompletion) + }, tx); + } else { + this._state.set({ + inlineCompletions: v.inlineCompletions.createStateWithAppliedResults(suggestions, request, this._textModel, cursorPosition, activeInlineCompletion), + suggestWidgetInlineCompletions: InlineCompletionsState.createEmpty() + }, tx); + } + v.inlineCompletions.dispose(); + v.suggestWidgetInlineCompletions.dispose(); + }); + } finally { + store.dispose(); + decreaseLoadingCount(); + this.sendInlineCompletionsRequestTelemetry(requestResponseInfo); + } + return true; + })(); + const updateOperation = new UpdateOperation(request, source, promise); + this._updateOperation.value = updateOperation; + return promise; + } + clear(tx) { + this._updateOperation.clear(); + const v = this._state.get(); + this._state.set({ + inlineCompletions: InlineCompletionsState.createEmpty(), + suggestWidgetInlineCompletions: InlineCompletionsState.createEmpty() + }, tx); + v.inlineCompletions.dispose(); + v.suggestWidgetInlineCompletions.dispose(); + } + seedInlineCompletionsWithSuggestWidget() { + const inlineCompletions = this.inlineCompletions.get(); + const suggestWidgetInlineCompletions = this.suggestWidgetInlineCompletions.get(); + if (!suggestWidgetInlineCompletions) { + return; + } + transaction((tx) => { + if (!inlineCompletions || (suggestWidgetInlineCompletions.request?.versionId ?? -1) > (inlineCompletions.request?.versionId ?? -1)) { + inlineCompletions?.dispose(); + const s = this._state.get(); + this._state.set({ + inlineCompletions: suggestWidgetInlineCompletions.clone(), + suggestWidgetInlineCompletions: InlineCompletionsState.createEmpty() + }, tx); + s.inlineCompletions.dispose(); + s.suggestWidgetInlineCompletions.dispose(); + } + this.clearSuggestWidgetInlineCompletions(tx); + }); + } + sendInlineCompletionsRequestTelemetry(requestResponseInfo) { + if (!this._sendRequestData.get() && !this._contextKeyService.getContextKeyValue("isRunningUnificationExperiment")) { + return; + } + if (requestResponseInfo.requestUuid === void 0 || requestResponseInfo.hasProducedSuggestion) { + return; + } + if (!isCompletionsEnabled(this._completionsEnabled, this._textModel.getLanguageId())) { + return; + } + if (!requestResponseInfo.providers.some((p) => isCopilotLikeExtension(p.providerId?.extensionId))) { + return; + } + const emptyEndOfLifeEvent = { + opportunityId: requestResponseInfo.requestUuid, + noSuggestionReason: requestResponseInfo.noSuggestionReason ?? "unknown", + extensionId: "vscode-core", + extensionVersion: "0.0.0", + groupId: "empty", + shown: false, + editorType: requestResponseInfo.requestInfo.editorType, + requestReason: requestResponseInfo.requestInfo.reason, + typingInterval: requestResponseInfo.requestInfo.typingInterval, + typingIntervalCharacterCount: requestResponseInfo.requestInfo.typingIntervalCharacterCount, + languageId: requestResponseInfo.requestInfo.languageId, + selectedSuggestionInfo: !!requestResponseInfo.context.selectedSuggestionInfo, + availableProviders: requestResponseInfo.providers.map((p) => p.providerId?.toString()).filter(isDefined).join(","), + ...forwardToChannelIf(requestResponseInfo.providers.some((p) => isCopilotLikeExtension(p.providerId?.extensionId))), + timeUntilProviderRequest: void 0, + timeUntilProviderResponse: void 0, + viewKind: void 0, + preceeded: void 0, + superseded: void 0, + reason: void 0, + correlationId: void 0, + shownDuration: void 0, + shownDurationUncollapsed: void 0, + timeUntilShown: void 0, + partiallyAccepted: void 0, + partiallyAcceptedCountSinceOriginal: void 0, + partiallyAcceptedRatioSinceOriginal: void 0, + partiallyAcceptedCharactersSinceOriginal: void 0, + cursorColumnDistance: void 0, + cursorLineDistance: void 0, + lineCountOriginal: void 0, + lineCountModified: void 0, + characterCountOriginal: void 0, + characterCountModified: void 0, + disjointReplacements: void 0, + sameShapeReplacements: void 0, + notShownReason: void 0 + }; + const dataChannel = this._instantiationService.createInstance(DataChannelForwardingTelemetryService); + sendInlineCompletionsEndOfLifeTelemetry(dataChannel, emptyEndOfLifeEvent); + } + clearSuggestWidgetInlineCompletions(tx) { + if (this._updateOperation.value?.request.context.selectedSuggestionInfo) { + this._updateOperation.clear(); + } + } + cancelUpdate() { + this._updateOperation.clear(); + } +}; +InlineCompletionsSource = InlineCompletionsSource_1 = __decorate104([ + __param98(4, ILanguageConfigurationService), + __param98(5, ILogService), + __param98(6, IConfigurationService), + __param98(7, IInstantiationService), + __param98(8, IContextKeyService) +], InlineCompletionsSource); +var UpdateRequest = class { + constructor(position, context, versionId, providers) { + this.position = position; + this.context = context; + this.versionId = versionId; + this.providers = providers; + } + satisfies(other) { + return this.position.equals(other.position) && equalsIfDefined(this.context.selectedSuggestionInfo, other.context.selectedSuggestionInfo, itemEquals()) && (other.context.triggerKind === InlineCompletionTriggerKind.Automatic || this.context.triggerKind === InlineCompletionTriggerKind.Explicit) && this.versionId === other.versionId && isSubset(other.providers, this.providers); + } +}; +var RequestResponseData = class { + constructor(context, requestInfo, providers) { + this.context = context; + this.requestInfo = requestInfo; + this.providers = providers; + this.hasProducedSuggestion = false; + } + setRequestUuid(uuid) { + this.requestUuid = uuid; + } + setNoSuggestionReasonIfNotSet(type) { + this.noSuggestionReason ??= type; + } + setHasProducedSuggestion() { + this.hasProducedSuggestion = true; + } +}; +function isSubset(set1, set2) { + return [...set1].every((item) => set2.has(item)); +} +function isCompletionsEnabled(completionsEnablementObject, modeId = "*") { + if (completionsEnablementObject === void 0) { + return false; + } + if (typeof completionsEnablementObject[modeId] !== "undefined") { + return Boolean(completionsEnablementObject[modeId]); + } + return Boolean(completionsEnablementObject["*"]); +} +var UpdateOperation = class { + constructor(request, cancellationTokenSource, promise) { + this.request = request; + this.cancellationTokenSource = cancellationTokenSource; + this.promise = promise; + } + dispose() { + this.cancellationTokenSource.cancel(); + } +}; +var InlineCompletionsState = class _InlineCompletionsState extends Disposable { + static createEmpty() { + return new _InlineCompletionsState([], void 0); + } + constructor(inlineCompletions, request) { + for (const inlineCompletion of inlineCompletions) { + inlineCompletion.addRef(); + } + super(); + this.inlineCompletions = inlineCompletions; + this.request = request; + this._register({ + dispose: () => { + for (const inlineCompletion of this.inlineCompletions) { + inlineCompletion.removeRef(); + } + } + }); + } + _findById(id) { + return this.inlineCompletions.find((i2) => i2.identity === id); + } + _findByHash(hash2) { + return this.inlineCompletions.find((i2) => i2.hash === hash2); + } + /** + * Applies the edit on the state. + */ + createStateWithAppliedEdit(edit2, textModel) { + const newInlineCompletions = this.inlineCompletions.map((i2) => i2.withEdit(edit2, textModel)).filter(isDefined); + return new _InlineCompletionsState(newInlineCompletions, this.request); + } + createStateWithAppliedResults(updatedSuggestions, request, textModel, cursorPosition, itemIdToPreserveAtTop) { + let itemToPreserve = void 0; + if (itemIdToPreserveAtTop) { + const itemToPreserveCandidate = this._findById(itemIdToPreserveAtTop); + if (itemToPreserveCandidate && itemToPreserveCandidate.canBeReused(textModel, request.position)) { + itemToPreserve = itemToPreserveCandidate; + const updatedItemToPreserve = updatedSuggestions.find((i2) => i2.hash === itemToPreserveCandidate.hash); + if (updatedItemToPreserve) { + updatedSuggestions = moveToFront(updatedItemToPreserve, updatedSuggestions); + } else { + updatedSuggestions = [itemToPreserveCandidate, ...updatedSuggestions]; + } + } + } + const preferInlineCompletions = itemToPreserve ? !itemToPreserve.isInlineEdit : updatedSuggestions.some((i2) => !i2.isInlineEdit && i2.isVisible(textModel, cursorPosition)); + let updatedItems = []; + for (const i2 of updatedSuggestions) { + const oldItem = this._findByHash(i2.hash); + let item; + if (oldItem && oldItem !== i2) { + item = i2.withIdentity(oldItem.identity); + i2.setIsPreceeded(oldItem); + oldItem.setEndOfLifeReason({ kind: InlineCompletionEndOfLifeReasonKind.Ignored, userTypingDisagreed: false, supersededBy: i2.getSourceCompletion() }); + } else { + item = i2; + } + if (preferInlineCompletions !== item.isInlineEdit) { + updatedItems.push(item); + } + } + updatedItems.sort(compareBy((i2) => i2.showInlineEditMenu, booleanComparator)); + updatedItems = distinctByKey(updatedItems, (i2) => i2.semanticId); + return new _InlineCompletionsState(updatedItems, request); + } + clone() { + return new _InlineCompletionsState(this.inlineCompletions, this.request); + } +}; +function distinctByKey(items, key) { + const seen = /* @__PURE__ */ new Set(); + return items.filter((item) => { + const k = key(item); + if (seen.has(k)) { + return false; + } + seen.add(k); + return true; + }); +} +function moveToFront(item, items) { + const index = items.indexOf(item); + if (index > -1) { + return [item, ...items.slice(0, index), ...items.slice(index + 1)]; + } + return items; +} + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineEdit.js +var InlineEdit = class { + constructor(edit2, commands, inlineCompletion) { + this.edit = edit2; + this.commands = commands; + this.inlineCompletion = inlineCompletion; + } + equals(other) { + return this.edit.equals(other.edit) && this.inlineCompletion === other.inlineCompletion; + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js +init_textModelEditSource(); +init_codeEditorService(); + +// node_modules/monaco-editor-core/esm/vs/editor/browser/services/inlineCompletionsService.js +init_async(); +init_errors(); +init_event(); +init_lifecycle(); +init_nls(); +init_actions2(); +init_contextkey(); +init_extensions(); +init_instantiation(); +init_telemetry(); +var __decorate105 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param99 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var IInlineCompletionsService = createDecorator("IInlineCompletionsService"); +var InlineCompletionsSnoozing = new RawContextKey("inlineCompletions.snoozed", false, localize(79, "Whether inline completions are currently snoozed")); +var InlineCompletionsService = class InlineCompletionsService2 extends Disposable { + get snoozeTimeLeft() { + if (this._snoozeTimeEnd === void 0) { + return 0; + } + return Math.max(0, this._snoozeTimeEnd - Date.now()); + } + constructor(_contextKeyService, _telemetryService) { + super(); + this._contextKeyService = _contextKeyService; + this._telemetryService = _telemetryService; + this._onDidChangeIsSnoozing = this._register(new Emitter()); + this.onDidChangeIsSnoozing = this._onDidChangeIsSnoozing.event; + this._snoozeTimeEnd = void 0; + this._recentCompletionIds = []; + this._timer = this._register(new TimeoutTimer()); + const inlineCompletionsSnoozing = InlineCompletionsSnoozing.bindTo(this._contextKeyService); + this._register(this.onDidChangeIsSnoozing(() => inlineCompletionsSnoozing.set(this.isSnoozing()))); + } + setSnoozeDuration(durationMs) { + if (durationMs < 0) { + throw new BugIndicatingError(`Invalid snooze duration: ${durationMs}. Duration must be non-negative.`); + } + if (durationMs === 0) { + this.cancelSnooze(); + return; + } + const wasSnoozing = this.isSnoozing(); + const timeLeft = this.snoozeTimeLeft; + this._snoozeTimeEnd = Date.now() + durationMs; + if (!wasSnoozing) { + this._onDidChangeIsSnoozing.fire(true); + } + this._timer.cancelAndSet(() => { + if (!this.isSnoozing()) { + this._onDidChangeIsSnoozing.fire(false); + } else { + throw new BugIndicatingError("Snooze timer did not fire as expected"); + } + }, this.snoozeTimeLeft + 1); + this._reportSnooze(durationMs - timeLeft, durationMs); + } + isSnoozing() { + return this.snoozeTimeLeft > 0; + } + cancelSnooze() { + if (this.isSnoozing()) { + this._reportSnooze(-this.snoozeTimeLeft, 0); + this._snoozeTimeEnd = void 0; + this._timer.cancel(); + this._onDidChangeIsSnoozing.fire(false); + } + } + reportNewCompletion(requestUuid) { + this._lastCompletionId = requestUuid; + this._recentCompletionIds.unshift(requestUuid); + if (this._recentCompletionIds.length > 5) { + this._recentCompletionIds.pop(); + } + } + _reportSnooze(deltaMs, totalMs) { + const deltaSeconds = Math.round(deltaMs / 1e3); + const totalSeconds = Math.round(totalMs / 1e3); + this._telemetryService.publicLog2("inlineCompletions.snooze", { + deltaSeconds, + totalSeconds, + lastCompletionId: this._lastCompletionId, + recentCompletionIds: this._recentCompletionIds + }); + } +}; +InlineCompletionsService = __decorate105([ + __param99(0, IContextKeyService), + __param99(1, ITelemetryService) +], InlineCompletionsService); +registerSingleton( + IInlineCompletionsService, + InlineCompletionsService, + 1 + /* InstantiationType.Delayed */ +); +var snoozeInlineSuggestId = "editor.action.inlineSuggest.snooze"; +var cancelSnoozeInlineSuggestId = "editor.action.inlineSuggest.cancelSnooze"; +var LAST_SNOOZE_DURATION_KEY = "inlineCompletions.lastSnoozeDuration"; +var SnoozeInlineCompletion = class _SnoozeInlineCompletion extends Action2 { + static { + this.ID = snoozeInlineSuggestId; + } + constructor() { + super({ + id: _SnoozeInlineCompletion.ID, + title: localize2(81, "Snooze Inline Suggestions"), + precondition: ContextKeyExpr.true(), + f1: true + }); + } + async run(accessor, ...args) { + const quickInputService = accessor.get(IQuickInputService); + const inlineCompletionsService = accessor.get(IInlineCompletionsService); + const storageService = accessor.get(IStorageService); + let durationMs; + if (args.length > 0 && typeof args[0] === "number") { + durationMs = args[0] * 6e4; + } + if (!durationMs) { + durationMs = await this.getDurationFromUser(quickInputService, storageService); + } + if (durationMs) { + inlineCompletionsService.setSnoozeDuration(durationMs); + } + } + async getDurationFromUser(quickInputService, storageService) { + const lastSelectedDuration = storageService.getNumber(LAST_SNOOZE_DURATION_KEY, 0, 3e5); + const items = [ + { label: "1 minute", id: "1", value: 6e4 }, + { label: "5 minutes", id: "5", value: 3e5 }, + { label: "10 minutes", id: "10", value: 6e5 }, + { label: "15 minutes", id: "15", value: 9e5 }, + { label: "30 minutes", id: "30", value: 18e5 }, + { label: "60 minutes", id: "60", value: 36e5 } + ]; + const picked = await quickInputService.pick(items, { + placeHolder: localize(80, "Select snooze duration for Inline Suggestions"), + activeItem: items.find((item) => item.value === lastSelectedDuration) + }); + if (picked) { + storageService.store( + LAST_SNOOZE_DURATION_KEY, + picked.value, + 0, + 0 + /* StorageTarget.USER */ + ); + return picked.value; + } + return void 0; + } +}; +var CancelSnoozeInlineCompletion = class _CancelSnoozeInlineCompletion extends Action2 { + static { + this.ID = cancelSnoozeInlineSuggestId; + } + constructor() { + super({ + id: _CancelSnoozeInlineCompletion.ID, + title: localize2(82, "Cancel Snooze Inline Suggestions"), + precondition: InlineCompletionsSnoozing, + f1: true + }); + } + async run(accessor) { + accessor.get(IInlineCompletionsService).cancelSnooze(); + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/inlineCompletions/browser/model/typingSpeed.js +init_arrays(); +init_lifecycle(); +var TypingInterval = class _TypingInterval extends Disposable { + static { + this.MAX_SESSION_GAP_MS = 3e3; + } + static { + this.MIN_SESSION_DURATION_MS = 1e3; + } + static { + this.SESSION_HISTORY_LIMIT = 50; + } + static { + this.TYPING_SPEED_WINDOW_MS = 3e5; + } + static { + this.MIN_CHARS_FOR_RELIABLE_SPEED = 20; + } + // Minimum characters needed for reliable speed calculation + /** + * Gets the current typing interval as average milliseconds between keystrokes + * and the number of characters involved in the computation. + * Higher interval values indicate slower typing. + * Returns { interval: 0, characterCount: 0 } if no typing data is available. + */ + getTypingInterval() { + if (this._cacheInvalidated || this._cachedTypingIntervalResult === null) { + this._cachedTypingIntervalResult = this._calculateTypingInterval(); + this._cacheInvalidated = false; + } + return this._cachedTypingIntervalResult; + } + constructor(_textModel) { + super(); + this._textModel = _textModel; + this._typingSessions = []; + this._currentSession = null; + this._lastChangeTime = 0; + this._cachedTypingIntervalResult = null; + this._cacheInvalidated = true; + this._register(this._textModel.onDidChangeContent((e) => this._updateTypingSpeed(e))); + } + _updateTypingSpeed(change) { + const now = Date.now(); + if (!this._isUserTyping(change)) { + this._finalizeCurrentSession(); + return; + } + if (this._currentSession && now - this._lastChangeTime > _TypingInterval.MAX_SESSION_GAP_MS) { + this._finalizeCurrentSession(); + } + if (!this._currentSession) { + this._currentSession = { + startTime: now, + endTime: now, + characterCount: 0 + }; + } + this._currentSession.endTime = now; + this._currentSession.characterCount += this._getActualCharacterCount(change); + this._lastChangeTime = now; + this._cacheInvalidated = true; + } + _getActualCharacterCount(change) { + let totalChars = 0; + for (const c of change.changes) { + totalChars += Math.max(c.text.length, c.rangeLength); + } + return totalChars; + } + _isUserTyping(change) { + if (!change.detailedReasons || change.detailedReasons.length === 0) { + return false; + } + for (const reason of change.detailedReasons) { + if (this._isUserTypingReason(reason)) { + return true; + } + } + return false; + } + _isUserTypingReason(reason) { + if (reason.metadata.isUndoing || reason.metadata.isRedoing) { + return false; + } + switch (reason.metadata.source) { + case "cursor": { + const kind = reason.metadata.kind; + return kind === "type" || kind === "compositionType" || kind === "compositionEnd"; + } + default: + return false; + } + } + _finalizeCurrentSession() { + if (!this._currentSession) { + return; + } + const sessionDuration = this._currentSession.endTime - this._currentSession.startTime; + if (sessionDuration >= _TypingInterval.MIN_SESSION_DURATION_MS && this._currentSession.characterCount > 0) { + this._typingSessions.push(this._currentSession); + if (this._typingSessions.length > _TypingInterval.SESSION_HISTORY_LIMIT) { + this._typingSessions.shift(); + } + } + this._currentSession = null; + } + _calculateTypingInterval() { + if (this._currentSession) { + const tempSession = { ...this._currentSession }; + const sessionDuration = tempSession.endTime - tempSession.startTime; + if (sessionDuration >= _TypingInterval.MIN_SESSION_DURATION_MS && tempSession.characterCount > 0) { + const allSessions = [...this._typingSessions, tempSession]; + return this._calculateSpeedFromSessions(allSessions); + } + } + return this._calculateSpeedFromSessions(this._typingSessions); + } + _calculateSpeedFromSessions(sessions) { + if (sessions.length === 0) { + return { averageInterval: 0, characterCount: 0 }; + } + const sortedSessions = [...sessions].sort((a, b) => b.endTime - a.endTime); + const cutoffTime = Date.now() - _TypingInterval.TYPING_SPEED_WINDOW_MS; + const recentSessions = sortedSessions.filter((session) => session.endTime > cutoffTime); + const olderSessions = sortedSessions.splice(recentSessions.length); + let totalChars = sum(recentSessions.map((session) => session.characterCount)); + for (let i2 = 0; i2 < olderSessions.length && totalChars < _TypingInterval.MIN_CHARS_FOR_RELIABLE_SPEED; i2++) { + recentSessions.push(olderSessions[i2]); + totalChars += olderSessions[i2].characterCount; + } + const totalTime = sum(recentSessions.map((session) => session.endTime - session.startTime)); + if (totalTime === 0 || totalChars <= 1) { + return { averageInterval: 0, characterCount: totalChars }; + } + const keystrokeIntervals = Math.max(1, totalChars - 1); + const avgMsBetweenKeystrokes = totalTime / keystrokeIntervals; + return { + averageInterval: Math.round(avgMsBetweenKeystrokes), + characterCount: totalChars + }; + } + dispose() { + this._finalizeCurrentSession(); + super.dispose(); + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js +init_offsetRange(); +init_uri(); +var __decorate106 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param100 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var InlineCompletionsModel = class InlineCompletionsModel2 extends Disposable { + get isAcceptingPartially() { + return this._isAcceptingPartially; + } + constructor(textModel, _selectedSuggestItem, _textModelVersionId, _positions, _debounceValue, _enabled, _editor, _instantiationService, _commandService, _languageConfigurationService, _accessibilityService, _languageFeaturesService, _codeEditorService, _inlineCompletionsService) { + super(); + this.textModel = textModel; + this._selectedSuggestItem = _selectedSuggestItem; + this._textModelVersionId = _textModelVersionId; + this._positions = _positions; + this._debounceValue = _debounceValue; + this._enabled = _enabled; + this._editor = _editor; + this._instantiationService = _instantiationService; + this._commandService = _commandService; + this._languageConfigurationService = _languageConfigurationService; + this._accessibilityService = _accessibilityService; + this._languageFeaturesService = _languageFeaturesService; + this._codeEditorService = _codeEditorService; + this._inlineCompletionsService = _inlineCompletionsService; + this._isActive = observableValue(this, false); + this._onlyRequestInlineEditsSignal = observableSignal(this); + this._forceUpdateExplicitlySignal = observableSignal(this); + this._noDelaySignal = observableSignal(this); + this._fetchSpecificProviderSignal = observableSignal(this); + this._selectedInlineCompletionId = observableValue(this, void 0); + this.primaryPosition = derived(this, (reader) => this._positions.read(reader)[0] ?? new Position(1, 1)); + this.allPositions = derived(this, (reader) => this._positions.read(reader)); + this._isAcceptingPartially = false; + this._appearedInsideViewport = derived(this, (reader) => { + const state = this.state.read(reader); + if (!state || !state.inlineCompletion) { + return false; + } + return isSuggestionInViewport(this._editor, state.inlineCompletion); + }); + this._onDidAccept = new Emitter(); + this.onDidAccept = this._onDidAccept.event; + this._lastShownInlineCompletionInfo = void 0; + this._lastAcceptedInlineCompletionInfo = void 0; + this._didUndoInlineEdits = derivedHandleChanges({ + owner: this, + changeTracker: { + createChangeSummary: () => ({ didUndo: false }), + handleChange: (ctx, changeSummary) => { + changeSummary.didUndo = ctx.didChange(this._textModelVersionId) && !!ctx.change?.isUndoing; + return true; + } + } + }, (reader, changeSummary) => { + const versionId = this._textModelVersionId.read(reader); + if (versionId !== null && this._lastAcceptedInlineCompletionInfo && this._lastAcceptedInlineCompletionInfo.textModelVersionIdAfter === versionId - 1 && this._lastAcceptedInlineCompletionInfo.inlineCompletion.isInlineEdit && changeSummary.didUndo) { + this._lastAcceptedInlineCompletionInfo = void 0; + return true; + } + return false; + }); + this._preserveCurrentCompletionReasons = /* @__PURE__ */ new Set([ + VersionIdChangeReason.Redo, + VersionIdChangeReason.Undo, + VersionIdChangeReason.AcceptWord + ]); + this.dontRefetchSignal = observableSignal(this); + this._fetchInlineCompletionsPromise = derivedHandleChanges({ + owner: this, + changeTracker: { + createChangeSummary: () => ({ + dontRefetch: false, + preserveCurrentCompletion: false, + inlineCompletionTriggerKind: InlineCompletionTriggerKind.Automatic, + onlyRequestInlineEdits: false, + shouldDebounce: true, + provider: void 0, + textChange: false, + changeReason: "" + }), + handleChange: (ctx, changeSummary) => { + if (ctx.didChange(this._textModelVersionId)) { + if (this._preserveCurrentCompletionReasons.has(this._getReason(ctx.change))) { + changeSummary.preserveCurrentCompletion = true; + } + const detailedReasons = ctx.change?.detailedReasons ?? []; + changeSummary.changeReason = detailedReasons.length > 0 ? detailedReasons[0].getType() : ""; + changeSummary.textChange = true; + } else if (ctx.didChange(this._forceUpdateExplicitlySignal)) { + changeSummary.preserveCurrentCompletion = true; + changeSummary.inlineCompletionTriggerKind = InlineCompletionTriggerKind.Explicit; + } else if (ctx.didChange(this.dontRefetchSignal)) { + changeSummary.dontRefetch = true; + } else if (ctx.didChange(this._onlyRequestInlineEditsSignal)) { + changeSummary.onlyRequestInlineEdits = true; + } else if (ctx.didChange(this._fetchSpecificProviderSignal)) { + changeSummary.provider = ctx.change; + } + return true; + } + } + }, (reader, changeSummary) => { + this._source.clearOperationOnTextModelChange.read(reader); + this._noDelaySignal.read(reader); + this.dontRefetchSignal.read(reader); + this._onlyRequestInlineEditsSignal.read(reader); + this._forceUpdateExplicitlySignal.read(reader); + this._fetchSpecificProviderSignal.read(reader); + const shouldUpdate = (this._enabled.read(reader) && this._selectedSuggestItem.read(reader) || this._isActive.read(reader)) && (!this._inlineCompletionsService.isSnoozing() || changeSummary.inlineCompletionTriggerKind === InlineCompletionTriggerKind.Explicit); + if (!shouldUpdate) { + this._source.cancelUpdate(); + return void 0; + } + this._textModelVersionId.read(reader); + const suggestWidgetInlineCompletions = this._source.suggestWidgetInlineCompletions.read(void 0); + let suggestItem = this._selectedSuggestItem.read(reader); + if (this._shouldShowOnSuggestConflict.read(void 0)) { + suggestItem = void 0; + } + if (suggestWidgetInlineCompletions && !suggestItem) { + this._source.seedInlineCompletionsWithSuggestWidget(); + } + if (changeSummary.dontRefetch) { + return Promise.resolve(true); + } + if (this._didUndoInlineEdits.read(reader) && changeSummary.inlineCompletionTriggerKind !== InlineCompletionTriggerKind.Explicit) { + transaction((tx) => { + this._source.clear(tx); + }); + return void 0; + } + let reason = ""; + if (changeSummary.provider) { + reason += "providerOnDidChange"; + } else if (changeSummary.inlineCompletionTriggerKind === InlineCompletionTriggerKind.Explicit) { + reason += "explicit"; + } + if (changeSummary.changeReason) { + reason += reason.length > 0 ? `:${changeSummary.changeReason}` : changeSummary.changeReason; + } + const typingInterval = this._typing.getTypingInterval(); + const requestInfo = { + editorType: this.editorType, + startTime: Date.now(), + languageId: this.textModel.getLanguageId(), + reason, + typingInterval: typingInterval.averageInterval, + typingIntervalCharacterCount: typingInterval.characterCount, + availableProviders: [] + }; + let context = { + triggerKind: changeSummary.inlineCompletionTriggerKind, + selectedSuggestionInfo: suggestItem?.toSelectedSuggestionInfo(), + includeInlineCompletions: !changeSummary.onlyRequestInlineEdits, + includeInlineEdits: this._inlineEditsEnabled.read(reader), + requestIssuedDateTime: requestInfo.startTime, + earliestShownDateTime: requestInfo.startTime + (changeSummary.inlineCompletionTriggerKind === InlineCompletionTriggerKind.Explicit || this.inAcceptFlow.read(void 0) ? 0 : this._minShowDelay.read(void 0)) + }; + if (context.triggerKind === InlineCompletionTriggerKind.Automatic && changeSummary.textChange) { + if (this.textModel.getAlternativeVersionId() === this._lastShownInlineCompletionInfo?.alternateTextModelVersionId) { + context = { + ...context, + includeInlineCompletions: !this._lastShownInlineCompletionInfo.inlineCompletion.isInlineEdit, + includeInlineEdits: this._lastShownInlineCompletionInfo.inlineCompletion.isInlineEdit + }; + } + } + const itemToPreserveCandidate = this.selectedInlineCompletion.read(void 0) ?? this._inlineCompletionItems.read(void 0)?.inlineEdit; + const itemToPreserve = changeSummary.preserveCurrentCompletion || itemToPreserveCandidate?.forwardStable ? itemToPreserveCandidate : void 0; + const userJumpedToActiveCompletion = this._jumpedToId.map((jumpedTo) => !!jumpedTo && jumpedTo === this._inlineCompletionItems.read(void 0)?.inlineEdit?.semanticId); + const providers = changeSummary.provider ? { providers: [changeSummary.provider], label: "single:" + changeSummary.provider.providerId?.toString() } : { providers: this._languageFeaturesService.inlineCompletionsProvider.all(this.textModel), label: void 0 }; + const availableProviders = this.getAvailableProviders(providers.providers); + requestInfo.availableProviders = availableProviders.map((p) => p.providerId).filter(isDefined); + return this._source.fetch(availableProviders, providers.label, context, itemToPreserve?.identity, changeSummary.shouldDebounce, userJumpedToActiveCompletion, requestInfo); + }); + this._inlineCompletionItems = derivedOpts({ owner: this }, (reader) => { + const c = this._source.inlineCompletions.read(reader); + if (!c) { + return void 0; + } + const cursorPosition = this.primaryPosition.read(reader); + let inlineEdit = void 0; + const visibleCompletions = []; + for (const completion of c.inlineCompletions) { + if (!completion.isInlineEdit) { + if (completion.isVisible(this.textModel, cursorPosition)) { + visibleCompletions.push(completion); + } + } else { + inlineEdit = completion; + } + } + if (visibleCompletions.length !== 0) { + inlineEdit = void 0; + } + return { + inlineCompletions: visibleCompletions, + inlineEdit + }; + }); + this._filteredInlineCompletionItems = derivedOpts({ owner: this, equalsFn: itemsEquals() }, (reader) => { + const c = this._inlineCompletionItems.read(reader); + return c?.inlineCompletions ?? []; + }); + this.selectedInlineCompletionIndex = derived(this, (reader) => { + const selectedInlineCompletionId = this._selectedInlineCompletionId.read(reader); + const filteredCompletions = this._filteredInlineCompletionItems.read(reader); + const idx = this._selectedInlineCompletionId === void 0 ? -1 : filteredCompletions.findIndex((v) => v.semanticId === selectedInlineCompletionId); + if (idx === -1) { + this._selectedInlineCompletionId.set(void 0, void 0); + return 0; + } + return idx; + }); + this.selectedInlineCompletion = derived(this, (reader) => { + const filteredCompletions = this._filteredInlineCompletionItems.read(reader); + const idx = this.selectedInlineCompletionIndex.read(reader); + return filteredCompletions[idx]; + }); + this.activeCommands = derivedOpts({ owner: this, equalsFn: itemsEquals() }, (r) => this.selectedInlineCompletion.read(r)?.source.inlineSuggestions.commands ?? []); + this.inlineCompletionsCount = derived(this, (reader) => { + if (this.lastTriggerKind.read(reader) === InlineCompletionTriggerKind.Explicit) { + return this._filteredInlineCompletionItems.read(reader).length; + } else { + return void 0; + } + }); + this._hasVisiblePeekWidgets = derived(this, (reader) => this._editorObs.openedPeekWidgets.read(reader) > 0); + this._shouldShowOnSuggestConflict = derived(this, (reader) => { + const showOnSuggestConflict = this._showOnSuggestConflict.read(reader); + if (showOnSuggestConflict !== "never") { + const hasInlineCompletion = !!this.selectedInlineCompletion.read(reader); + if (hasInlineCompletion) { + const item = this._selectedSuggestItem.read(reader); + if (!item) { + return false; + } + if (showOnSuggestConflict === "whenSuggestListIsIncomplete") { + return item.listIncomplete; + } + return true; + } + } + return false; + }); + this.state = derivedOpts({ + owner: this, + equalsFn: (a, b) => { + if (!a || !b) { + return a === b; + } + if (a.kind === "ghostText" && b.kind === "ghostText") { + return ghostTextsOrReplacementsEqual(a.ghostTexts, b.ghostTexts) && a.inlineCompletion === b.inlineCompletion && a.suggestItem === b.suggestItem; + } else if (a.kind === "inlineEdit" && b.kind === "inlineEdit") { + return a.inlineEdit.equals(b.inlineEdit); + } + return false; + } + }, (reader) => { + const model = this.textModel; + if (this._suppressInSnippetMode.read(reader) && this._isInSnippetMode.read(reader)) { + return void 0; + } + const item = this._inlineCompletionItems.read(reader); + const inlineEditResult = item?.inlineEdit; + if (inlineEditResult) { + if (this._hasVisiblePeekWidgets.read(reader)) { + return void 0; + } + let edit2 = inlineEditResult.getSingleTextEdit(); + edit2 = singleTextRemoveCommonPrefix(edit2, model); + const cursorAtInlineEdit = this.primaryPosition.map((cursorPos) => LineRange.fromRangeInclusive(inlineEditResult.targetRange).addMargin(1, 1).contains(cursorPos.lineNumber)); + const commands = inlineEditResult.source.inlineSuggestions.commands; + const inlineEdit = new InlineEdit(edit2, commands ?? [], inlineEditResult); + const edits = inlineEditResult.updatedEdit; + const e = edits ? TextEdit.fromStringEdit(edits, new TextModelText(this.textModel)).replacements : [edit2]; + const nextEditUri = (item.inlineEdit?.command?.id === "vscode.open" || item.inlineEdit?.command?.id === "_workbench.open") && // eslint-disable-next-line local/code-no-any-casts + item.inlineEdit?.command.arguments?.length ? URI.from(item.inlineEdit?.command.arguments[0]) : void 0; + return { kind: "inlineEdit", inlineEdit, inlineCompletion: inlineEditResult, edits: e, cursorAtInlineEdit, nextEditUri }; + } + const suggestItem = this._selectedSuggestItem.read(reader); + if (!this._shouldShowOnSuggestConflict.read(reader) && suggestItem) { + const suggestCompletionEdit = singleTextRemoveCommonPrefix(suggestItem.getSingleTextEdit(), model); + const augmentation = this._computeAugmentation(suggestCompletionEdit, reader); + const isSuggestionPreviewEnabled = this._suggestPreviewEnabled.read(reader); + if (!isSuggestionPreviewEnabled && !augmentation) { + return void 0; + } + const fullEdit = augmentation?.edit ?? suggestCompletionEdit; + const fullEditPreviewLength = augmentation ? augmentation.edit.text.length - suggestCompletionEdit.text.length : 0; + const mode = this._suggestPreviewMode.read(reader); + const positions = this._positions.read(reader); + const allPotentialEdits = [fullEdit, ...getSecondaryEdits(this.textModel, positions, fullEdit)]; + const validEditsAndGhostTexts = allPotentialEdits.map((edit2, idx) => ({ edit: edit2, ghostText: edit2 ? computeGhostText(edit2, model, mode, positions[idx], fullEditPreviewLength) : void 0 })).filter(({ edit: edit2, ghostText }) => edit2 !== void 0 && ghostText !== void 0); + const edits = validEditsAndGhostTexts.map(({ edit: edit2 }) => edit2); + const ghostTexts = validEditsAndGhostTexts.map(({ ghostText }) => ghostText); + const primaryGhostText = ghostTexts[0] ?? new GhostText(fullEdit.range.endLineNumber, []); + return { kind: "ghostText", edits, primaryGhostText, ghostTexts, inlineCompletion: augmentation?.completion, suggestItem }; + } else { + if (!this._isActive.read(reader)) { + return void 0; + } + const inlineCompletion = this.selectedInlineCompletion.read(reader); + if (!inlineCompletion) { + return void 0; + } + const replacement = inlineCompletion.getSingleTextEdit(); + const mode = this._inlineSuggestMode.read(reader); + const positions = this._positions.read(reader); + const allPotentialEdits = [replacement, ...getSecondaryEdits(this.textModel, positions, replacement)]; + const validEditsAndGhostTexts = allPotentialEdits.map((edit2, idx) => ({ edit: edit2, ghostText: edit2 ? computeGhostText(edit2, model, mode, positions[idx], 0) : void 0 })).filter(({ edit: edit2, ghostText }) => edit2 !== void 0 && ghostText !== void 0); + const edits = validEditsAndGhostTexts.map(({ edit: edit2 }) => edit2); + const ghostTexts = validEditsAndGhostTexts.map(({ ghostText }) => ghostText); + if (!ghostTexts[0]) { + return void 0; + } + return { kind: "ghostText", edits, primaryGhostText: ghostTexts[0], ghostTexts, inlineCompletion, suggestItem: void 0 }; + } + }); + this.inlineCompletionState = derived(this, (reader) => { + const s = this.state.read(reader); + if (!s || s.kind !== "ghostText") { + return void 0; + } + if (this._editorObs.inComposition.read(reader)) { + return void 0; + } + return s; + }); + this.inlineEditState = derived(this, (reader) => { + const s = this.state.read(reader); + if (!s || s.kind !== "inlineEdit") { + return void 0; + } + return s; + }); + this.inlineEditAvailable = derived(this, (reader) => { + const s = this.inlineEditState.read(reader); + return !!s; + }); + this.warning = derived(this, (reader) => { + return this.inlineCompletionState.read(reader)?.inlineCompletion?.warning; + }); + this.ghostTexts = derivedOpts({ owner: this, equalsFn: ghostTextsOrReplacementsEqual }, (reader) => { + const v = this.inlineCompletionState.read(reader); + if (!v) { + return void 0; + } + return v.ghostTexts; + }); + this.primaryGhostText = derivedOpts({ owner: this, equalsFn: ghostTextOrReplacementEquals }, (reader) => { + const v = this.inlineCompletionState.read(reader); + if (!v) { + return void 0; + } + return v?.primaryGhostText; + }); + this.showCollapsed = derived(this, (reader) => { + const state = this.state.read(reader); + if (!state || state.kind !== "inlineEdit") { + return false; + } + if (state.inlineCompletion.hint) { + return false; + } + const isCurrentModelVersion = state.inlineCompletion.updatedEditModelVersion === this._textModelVersionId.read(reader); + return (this._inlineEditsShowCollapsedEnabled.read(reader) || !isCurrentModelVersion) && this._jumpedToId.read(reader) !== state.inlineCompletion.semanticId && !this._inAcceptFlow.read(reader); + }); + this._tabShouldIndent = derived(this, (reader) => { + if (this._inAcceptFlow.read(reader)) { + return false; + } + function isMultiLine(range2) { + return range2.startLineNumber !== range2.endLineNumber; + } + function getNonIndentationRange(model, lineNumber) { + const columnStart = model.getLineIndentColumn(lineNumber); + const lastNonWsColumn = model.getLineLastNonWhitespaceColumn(lineNumber); + const columnEnd = Math.max(lastNonWsColumn, columnStart); + return new Range(lineNumber, columnStart, lineNumber, columnEnd); + } + const selections = this._editorObs.selections.read(reader); + return selections?.some((s) => { + if (s.isEmpty()) { + return this.textModel.getLineLength(s.startLineNumber) === 0; + } else { + return isMultiLine(s) || s.containsRange(getNonIndentationRange(this.textModel, s.startLineNumber)); + } + }); + }); + this.tabShouldJumpToInlineEdit = derived(this, (reader) => { + if (this._tabShouldIndent.read(reader)) { + return false; + } + const s = this.inlineEditState.read(reader); + if (!s) { + return false; + } + if (this.showCollapsed.read(reader)) { + return true; + } + if (this._inAcceptFlow.read(reader) && this._appearedInsideViewport.read(reader) && !s.inlineCompletion.hint?.jumpToEdit) { + return false; + } + return !s.cursorAtInlineEdit.read(reader); + }); + this.tabShouldAcceptInlineEdit = derived(this, (reader) => { + const s = this.inlineEditState.read(reader); + if (!s) { + return false; + } + if (this.showCollapsed.read(reader)) { + return false; + } + if (this._tabShouldIndent.read(reader)) { + return false; + } + if (this._inAcceptFlow.read(reader) && this._appearedInsideViewport.read(reader) && !s.inlineCompletion.hint?.jumpToEdit) { + return true; + } + if (s.inlineCompletion.targetRange.startLineNumber === this._editorObs.cursorLineNumber.read(reader)) { + return true; + } + if (this._jumpedToId.read(reader) === s.inlineCompletion.semanticId) { + return true; + } + return s.cursorAtInlineEdit.read(reader); + }); + this._jumpedToId = observableValue(this, void 0); + this._inAcceptFlow = observableValue(this, false); + this.inAcceptFlow = this._inAcceptFlow; + this._source = this._register(this._instantiationService.createInstance(InlineCompletionsSource, this.textModel, this._textModelVersionId, this._debounceValue, this.primaryPosition)); + this.lastTriggerKind = this._source.inlineCompletions.map(this, (v) => v?.request?.context.triggerKind); + this._editorObs = observableCodeEditor(this._editor); + const suggest = this._editorObs.getOption( + 134 + /* EditorOption.suggest */ + ); + this._suggestPreviewEnabled = suggest.map((v) => v.preview); + this._suggestPreviewMode = suggest.map((v) => v.previewMode); + const inlineSuggest = this._editorObs.getOption( + 71 + /* EditorOption.inlineSuggest */ + ); + this._inlineSuggestMode = inlineSuggest.map((v) => v.mode); + this._suppressedInlineCompletionGroupIds = inlineSuggest.map((v) => new Set(v.experimental.suppressInlineSuggestions.split(","))); + this._inlineEditsEnabled = inlineSuggest.map((v) => !!v.edits.enabled); + this._inlineEditsShowCollapsedEnabled = inlineSuggest.map((s) => s.edits.showCollapsed); + this._triggerCommandOnProviderChange = inlineSuggest.map((s) => s.triggerCommandOnProviderChange); + this._minShowDelay = inlineSuggest.map((s) => s.minShowDelay); + this._showOnSuggestConflict = inlineSuggest.map((s) => s.experimental.showOnSuggestConflict); + this._suppressInSnippetMode = inlineSuggest.map((s) => s.suppressInSnippetMode); + const snippetController = SnippetController2.get(this._editor); + this._isInSnippetMode = snippetController?.isInSnippetObservable ?? constObservable(false); + this._typing = this._register(new TypingInterval(this.textModel)); + this._register(this._inlineCompletionsService.onDidChangeIsSnoozing((isSnoozing) => { + if (isSnoozing) { + this.stop(); + } + })); + { + const isNotebook = this.textModel.uri.scheme === "vscode-notebook-cell"; + const [diffEditor] = this._codeEditorService.listDiffEditors().filter((d) => d.getOriginalEditor().getId() === this._editor.getId() || d.getModifiedEditor().getId() === this._editor.getId()); + this.isInDiffEditor = !!diffEditor; + this.editorType = isNotebook ? InlineCompletionEditorType.Notebook : this.isInDiffEditor ? InlineCompletionEditorType.DiffEditor : InlineCompletionEditorType.TextEditor; + } + this._register(recomputeInitiallyAndOnChange(this.state, (s) => { + if (s && s.inlineCompletion) { + this._inlineCompletionsService.reportNewCompletion(s.inlineCompletion.requestUuid); + } + })); + this._register(recomputeInitiallyAndOnChange(this._fetchInlineCompletionsPromise)); + this._register(autorun((reader) => { + this._editorObs.versionId.read(reader); + this._inAcceptFlow.set(false, void 0); + })); + this._register(autorun((reader) => { + const jumpToReset = this.state.map((s, reader2) => !s || s.kind === "inlineEdit" && !s.cursorAtInlineEdit.read(reader2)).read(reader); + if (jumpToReset) { + this._jumpedToId.set(void 0, void 0); + } + })); + const inlineEditSemanticId = this.inlineEditState.map((s) => s?.inlineCompletion.semanticId); + this._register(autorun((reader) => { + const id = inlineEditSemanticId.read(reader); + if (id) { + this._editor.pushUndoStop(); + this._lastShownInlineCompletionInfo = { + alternateTextModelVersionId: this.textModel.getAlternativeVersionId(), + inlineCompletion: this.state.get().inlineCompletion + }; + } + })); + const inlineCompletionProviders = observableFromEvent(this._languageFeaturesService.inlineCompletionsProvider.onDidChange, () => this._languageFeaturesService.inlineCompletionsProvider.all(textModel)); + mapObservableArrayCached(this, inlineCompletionProviders, (provider, store) => { + if (!provider.onDidChangeInlineCompletions) { + return; + } + store.add(provider.onDidChangeInlineCompletions(() => { + if (!this._enabled.get()) { + return; + } + const activeEditor = this._codeEditorService.getFocusedCodeEditor() || this._codeEditorService.getActiveCodeEditor(); + if (activeEditor !== this._editor) { + return; + } + if (this._triggerCommandOnProviderChange.get()) { + this.trigger(void 0, { onlyFetchInlineEdits: true }); + return; + } + const activeState = this.state.get(); + if (activeState && (activeState.inlineCompletion || activeState.edits) && activeState.inlineCompletion?.source.provider !== provider) { + return; + } + transaction((tx) => { + this._fetchSpecificProviderSignal.trigger(tx, provider); + this.trigger(tx); + }); + })); + }).recomputeInitiallyAndOnChange(this._store); + this._didUndoInlineEdits.recomputeInitiallyAndOnChange(this._store); + } + getIndentationInfo(reader) { + let startsWithIndentation = false; + let startsWithIndentationLessThanTabSize = true; + const ghostText = this?.primaryGhostText.read(reader); + if (!!this?._selectedSuggestItem && ghostText && ghostText.parts.length > 0) { + const { column, lines } = ghostText.parts[0]; + const firstLine = lines[0].line; + const indentationEndColumn = this.textModel.getLineIndentColumn(ghostText.lineNumber); + const inIndentation = column <= indentationEndColumn; + if (inIndentation) { + let firstNonWsIdx = firstNonWhitespaceIndex(firstLine); + if (firstNonWsIdx === -1) { + firstNonWsIdx = firstLine.length - 1; + } + startsWithIndentation = firstNonWsIdx > 0; + const tabSize = this.textModel.getOptions().tabSize; + const visibleColumnIndentation = CursorColumns.visibleColumnFromColumn(firstLine, firstNonWsIdx + 1, tabSize); + startsWithIndentationLessThanTabSize = visibleColumnIndentation < tabSize; + } + } + return { + startsWithIndentation, + startsWithIndentationLessThanTabSize + }; + } + _getReason(e) { + if (e?.isUndoing) { + return VersionIdChangeReason.Undo; + } + if (e?.isRedoing) { + return VersionIdChangeReason.Redo; + } + if (this.isAcceptingPartially) { + return VersionIdChangeReason.AcceptWord; + } + return VersionIdChangeReason.Other; + } + // TODO: This is not an ideal implementation of excludesGroupIds, however as this is currently still behind proposed API + // and due to the time constraints, we are using a simplified approach + getAvailableProviders(providers) { + const suppressedProviderGroupIds = this._suppressedInlineCompletionGroupIds.get(); + const unsuppressedProviders = providers.filter((provider) => !(provider.groupId && suppressedProviderGroupIds.has(provider.groupId))); + const excludedGroupIds = /* @__PURE__ */ new Set(); + for (const provider of unsuppressedProviders) { + provider.excludesGroupIds?.forEach((p) => excludedGroupIds.add(p)); + } + const availableProviders = []; + for (const provider of unsuppressedProviders) { + if (provider.groupId && excludedGroupIds.has(provider.groupId)) { + continue; + } + availableProviders.push(provider); + } + return availableProviders; + } + async trigger(tx, options2 = {}) { + subtransaction(tx, (tx2) => { + if (options2.onlyFetchInlineEdits) { + this._onlyRequestInlineEditsSignal.trigger(tx2); + } + if (options2.noDelay) { + this._noDelaySignal.trigger(tx2); + } + this._isActive.set(true, tx2); + if (options2.explicit) { + this._inAcceptFlow.set(true, tx2); + this._forceUpdateExplicitlySignal.trigger(tx2); + } + if (options2.provider) { + this._fetchSpecificProviderSignal.trigger(tx2, options2.provider); + } + }); + await this._fetchInlineCompletionsPromise.get(); + } + async triggerExplicitly(tx, onlyFetchInlineEdits = false) { + return this.trigger(tx, { onlyFetchInlineEdits, explicit: true }); + } + stop(stopReason = "automatic", tx) { + subtransaction(tx, (tx2) => { + if (stopReason === "explicitCancel") { + const inlineCompletion = this.state.get()?.inlineCompletion; + if (inlineCompletion) { + inlineCompletion.reportEndOfLife({ kind: InlineCompletionEndOfLifeReasonKind.Rejected }); + } + } + this._isActive.set(false, tx2); + this._source.clear(tx2); + }); + } + _computeAugmentation(suggestCompletion, reader) { + const model = this.textModel; + const suggestWidgetInlineCompletions = this._source.suggestWidgetInlineCompletions.read(reader); + const candidateInlineCompletions = suggestWidgetInlineCompletions ? suggestWidgetInlineCompletions.inlineCompletions.filter((c) => !c.isInlineEdit) : [this.selectedInlineCompletion.read(reader)].filter(isDefined); + const augmentedCompletion = mapFindFirst(candidateInlineCompletions, (completion) => { + let r = completion.getSingleTextEdit(); + r = singleTextRemoveCommonPrefix(r, model, Range.fromPositions(r.range.getStartPosition(), suggestCompletion.range.getEndPosition())); + return singleTextEditAugments(r, suggestCompletion) ? { completion, edit: r } : void 0; + }); + return augmentedCompletion; + } + async _deltaSelectedInlineCompletionIndex(delta) { + await this.triggerExplicitly(); + const completions = this._filteredInlineCompletionItems.get() || []; + if (completions.length > 0) { + const newIdx = (this.selectedInlineCompletionIndex.get() + delta + completions.length) % completions.length; + this._selectedInlineCompletionId.set(completions[newIdx].semanticId, void 0); + } else { + this._selectedInlineCompletionId.set(void 0, void 0); + } + } + async next() { + await this._deltaSelectedInlineCompletionIndex(1); + } + async previous() { + await this._deltaSelectedInlineCompletionIndex(-1); + } + _getMetadata(completion, languageId, type = void 0) { + if (type) { + return EditSources.inlineCompletionPartialAccept({ + nes: completion.isInlineEdit, + requestUuid: completion.requestUuid, + providerId: completion.source.provider.providerId, + languageId, + type + }); + } else { + return EditSources.inlineCompletionAccept({ + nes: completion.isInlineEdit, + requestUuid: completion.requestUuid, + providerId: completion.source.provider.providerId, + languageId + }); + } + } + async accept(editor2 = this._editor) { + if (editor2.getModel() !== this.textModel) { + throw new BugIndicatingError(); + } + let completion; + let isNextEditUri = false; + const state = this.state.get(); + if (state?.kind === "ghostText") { + if (!state || state.primaryGhostText.isEmpty() || !state.inlineCompletion) { + return; + } + completion = state.inlineCompletion; + } else if (state?.kind === "inlineEdit") { + completion = state.inlineCompletion; + isNextEditUri = !!state.nextEditUri; + } else { + return; + } + completion.addRef(); + try { + editor2.pushUndoStop(); + if (isNextEditUri) { + } else if (completion.snippetInfo) { + const mainEdit = TextReplacement.delete(completion.editRange); + const additionalEdits = completion.additionalTextEdits.map((e) => new TextReplacement(Range.lift(e.range), e.text ?? "")); + const edit2 = TextEdit.fromParallelReplacementsUnsorted([mainEdit, ...additionalEdits]); + editor2.edit(edit2, this._getMetadata(completion, this.textModel.getLanguageId())); + editor2.setPosition(completion.snippetInfo.range.getStartPosition(), "inlineCompletionAccept"); + SnippetController2.get(editor2)?.insert(completion.snippetInfo.snippet, { undoStopBefore: false }); + } else { + const edits = state.edits; + let minimalEdits = edits; + if (state.kind === "ghostText") { + minimalEdits = removeTextReplacementCommonSuffixPrefix(edits, this.textModel); + } + const selections = getEndPositionsAfterApplying(minimalEdits).map((p) => Selection.fromPositions(p)); + const additionalEdits = completion.additionalTextEdits.map((e) => new TextReplacement(Range.lift(e.range), e.text ?? "")); + const edit2 = TextEdit.fromParallelReplacementsUnsorted([...edits, ...additionalEdits]); + editor2.edit(edit2, this._getMetadata(completion, this.textModel.getLanguageId())); + if (completion.hint === void 0) { + editor2.setSelections(state.kind === "inlineEdit" ? selections.slice(-1) : selections, "inlineCompletionAccept"); + } + if (state.kind === "inlineEdit" && !this._accessibilityService.isMotionReduced()) { + const editRanges = edit2.getNewRanges(); + const dec = this._store.add(new FadeoutDecoration(editor2, editRanges, () => { + this._store.delete(dec); + })); + } + } + this._onDidAccept.fire(); + this.stop(); + if (completion.command) { + await this._commandService.executeCommand(completion.command.id, ...completion.command.arguments || []).then(void 0, onUnexpectedExternalError); + } + completion.reportEndOfLife({ kind: InlineCompletionEndOfLifeReasonKind.Accepted }); + } finally { + completion.removeRef(); + this._inAcceptFlow.set(true, void 0); + this._lastAcceptedInlineCompletionInfo = { textModelVersionIdAfter: this.textModel.getVersionId(), inlineCompletion: completion }; + } + } + async acceptNextWord() { + await this._acceptNext( + this._editor, + "word", + (pos, text2) => { + const langId = this.textModel.getLanguageIdAtPosition(pos.lineNumber, pos.column); + const config = this._languageConfigurationService.getLanguageConfiguration(langId); + const wordRegExp = new RegExp(config.wordDefinition.source, config.wordDefinition.flags.replace("g", "")); + const m1 = text2.match(wordRegExp); + let acceptUntilIndexExclusive = 0; + if (m1 && m1.index !== void 0) { + if (m1.index === 0) { + acceptUntilIndexExclusive = m1[0].length; + } else { + acceptUntilIndexExclusive = m1.index; + } + } else { + acceptUntilIndexExclusive = text2.length; + } + const wsRegExp = /\s+/g; + const m2 = wsRegExp.exec(text2); + if (m2 && m2.index !== void 0) { + if (m2.index + m2[0].length < acceptUntilIndexExclusive) { + acceptUntilIndexExclusive = m2.index + m2[0].length; + } + } + return acceptUntilIndexExclusive; + }, + 0 + /* PartialAcceptTriggerKind.Word */ + ); + } + async acceptNextLine() { + await this._acceptNext( + this._editor, + "line", + (pos, text2) => { + const m = text2.match(/\n/); + if (m && m.index !== void 0) { + return m.index + 1; + } + return text2.length; + }, + 1 + /* PartialAcceptTriggerKind.Line */ + ); + } + async _acceptNext(editor2, type, getAcceptUntilIndex, kind) { + if (editor2.getModel() !== this.textModel) { + throw new BugIndicatingError(); + } + const state = this.inlineCompletionState.get(); + if (!state || state.primaryGhostText.isEmpty() || !state.inlineCompletion) { + return; + } + const ghostText = state.primaryGhostText; + const completion = state.inlineCompletion; + if (completion.snippetInfo) { + await this.accept(editor2); + return; + } + const firstPart = ghostText.parts[0]; + const ghostTextPos = new Position(ghostText.lineNumber, firstPart.column); + const ghostTextVal = firstPart.text; + const acceptUntilIndexExclusive = getAcceptUntilIndex(ghostTextPos, ghostTextVal); + if (acceptUntilIndexExclusive === ghostTextVal.length && ghostText.parts.length === 1) { + this.accept(editor2); + return; + } + const partialGhostTextVal = ghostTextVal.substring(0, acceptUntilIndexExclusive); + const positions = this._positions.get(); + const cursorPosition = positions[0]; + completion.addRef(); + try { + this._isAcceptingPartially = true; + try { + editor2.pushUndoStop(); + const replaceRange = Range.fromPositions(cursorPosition, ghostTextPos); + const newText = editor2.getModel().getValueInRange(replaceRange) + partialGhostTextVal; + const primaryEdit = new TextReplacement(replaceRange, newText); + const edits = [primaryEdit, ...getSecondaryEdits(this.textModel, positions, primaryEdit)].filter(isDefined); + const selections = getEndPositionsAfterApplying(edits).map((p) => Selection.fromPositions(p)); + editor2.edit(TextEdit.fromParallelReplacementsUnsorted(edits), this._getMetadata(completion, type)); + editor2.setSelections(selections, "inlineCompletionPartialAccept"); + editor2.revealPositionInCenterIfOutsideViewport( + editor2.getPosition(), + 1 + /* ScrollType.Immediate */ + ); + } finally { + this._isAcceptingPartially = false; + } + const acceptedRange = Range.fromPositions(completion.editRange.getStartPosition(), TextLength.ofText(partialGhostTextVal).addToPosition(ghostTextPos)); + const text2 = editor2.getModel().getValueInRange( + acceptedRange, + 1 + /* EndOfLinePreference.LF */ + ); + const acceptedLength = text2.length; + completion.reportPartialAccept(acceptedLength, { kind, acceptedLength }, { characters: acceptUntilIndexExclusive, ratio: acceptUntilIndexExclusive / ghostTextVal.length, count: 1 }); + } finally { + completion.removeRef(); + } + } + handleSuggestAccepted(item) { + const itemEdit = singleTextRemoveCommonPrefix(item.getSingleTextEdit(), this.textModel); + const augmentedCompletion = this._computeAugmentation(itemEdit, void 0); + if (!augmentedCompletion) { + return; + } + const alreadyAcceptedLength = this.textModel.getValueInRange( + augmentedCompletion.completion.editRange, + 1 + /* EndOfLinePreference.LF */ + ).length; + const acceptedLength = alreadyAcceptedLength + itemEdit.text.length; + augmentedCompletion.completion.reportPartialAccept(itemEdit.text.length, { + kind: 2, + acceptedLength + }, { + characters: itemEdit.text.length, + count: 1, + ratio: 1 + }); + } + extractReproSample() { + const value = this.textModel.getValue(); + const item = this.state.get()?.inlineCompletion; + return { + documentValue: value, + inlineCompletion: item?.getSourceCompletion() + }; + } + jump() { + const s = this.inlineEditState.get(); + if (!s) { + return; + } + transaction((tx) => { + this._jumpedToId.set(s.inlineCompletion.semanticId, tx); + this.dontRefetchSignal.trigger(tx); + const targetRange = s.inlineCompletion.targetRange; + const targetPosition = targetRange.getStartPosition(); + this._editor.setPosition(targetPosition, "inlineCompletions.jump"); + const isSingleLineChange = targetRange.isSingleLine() && (s.inlineCompletion.hint || !s.inlineCompletion.insertText.includes("\n")); + if (isSingleLineChange) { + this._editor.revealPosition(targetPosition); + } else { + const revealRange = new Range(targetRange.startLineNumber - 1, 1, targetRange.endLineNumber + 1, 1); + this._editor.revealRange( + revealRange, + 1 + /* ScrollType.Immediate */ + ); + } + s.inlineCompletion.identity.setJumpTo(tx); + this._editor.focus(); + }); + } + async handleInlineSuggestionShown(inlineCompletion, viewKind, viewData) { + await inlineCompletion.reportInlineEditShown(this._commandService, viewKind, viewData); + } +}; +InlineCompletionsModel = __decorate106([ + __param100(7, IInstantiationService), + __param100(8, ICommandService), + __param100(9, ILanguageConfigurationService), + __param100(10, IAccessibilityService), + __param100(11, ILanguageFeaturesService), + __param100(12, ICodeEditorService), + __param100(13, IInlineCompletionsService) +], InlineCompletionsModel); +var VersionIdChangeReason; +(function(VersionIdChangeReason2) { + VersionIdChangeReason2[VersionIdChangeReason2["Undo"] = 0] = "Undo"; + VersionIdChangeReason2[VersionIdChangeReason2["Redo"] = 1] = "Redo"; + VersionIdChangeReason2[VersionIdChangeReason2["AcceptWord"] = 2] = "AcceptWord"; + VersionIdChangeReason2[VersionIdChangeReason2["Other"] = 3] = "Other"; +})(VersionIdChangeReason || (VersionIdChangeReason = {})); +function getSecondaryEdits(textModel, positions, primaryTextRepl) { + if (positions.length === 1) { + return []; + } + const text2 = new TextModelText(textModel); + const textTransformer = text2.getTransformer(); + const primaryOffset = textTransformer.getOffset(positions[0]); + const secondaryOffsets = positions.slice(1).map((pos) => textTransformer.getOffset(pos)); + primaryTextRepl = primaryTextRepl.removeCommonPrefixAndSuffix(text2); + const primaryStringRepl = textTransformer.getStringReplacement(primaryTextRepl); + const deltaFromOffsetToRangeStart = primaryStringRepl.replaceRange.start - primaryOffset; + const primaryContextRange = primaryStringRepl.replaceRange.join(OffsetRange.emptyAt(primaryOffset)); + const primaryContextValue = text2.getValueOfOffsetRange(primaryContextRange); + const replacements = secondaryOffsets.map((secondaryOffset) => { + const newRangeStart = secondaryOffset + deltaFromOffsetToRangeStart; + const newRangeEnd = newRangeStart + primaryStringRepl.replaceRange.length; + const range2 = new OffsetRange(newRangeStart, newRangeEnd); + const contextRange = range2.join(OffsetRange.emptyAt(secondaryOffset)); + const contextValue = text2.getValueOfOffsetRange(contextRange); + if (contextValue !== primaryContextValue) { + return void 0; + } + const stringRepl = new StringReplacement(range2, primaryStringRepl.newText); + const repl = textTransformer.getTextReplacement(stringRepl); + return repl; + }).filter(isDefined); + return replacements; +} +var FadeoutDecoration = class extends Disposable { + constructor(editor2, ranges, onDispose) { + super(); + if (onDispose) { + this._register({ dispose: () => onDispose() }); + } + this._register(observableCodeEditor(editor2).setDecorations(constObservable(ranges.map((range2) => ({ + range: range2, + options: { + description: "animation", + className: "edits-fadeout-decoration", + zIndex: 1 + } + }))))); + const animation = new AnimatedValue(1, 0, 1e3, easeOutCubic2); + const val = new ObservableAnimatedValue(animation); + this._register(autorun((reader) => { + const opacity = val.getValue(reader); + editor2.getContainerDomNode().style.setProperty("--animation-opacity", opacity.toString()); + if (animation.isFinished()) { + this.dispose(); + } + })); + } +}; +function isSuggestionInViewport(editor2, suggestion) { + const targetRange = suggestion.targetRange; + const visibleRanges = editor2.getVisibleRanges(); + if (visibleRanges.length < 1) { + return false; + } + const viewportRange = new Range(visibleRanges[0].startLineNumber, visibleRanges[0].startColumn, visibleRanges[visibleRanges.length - 1].endLineNumber, visibleRanges[visibleRanges.length - 1].endColumn); + return viewportRange.containsRange(targetRange); +} + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/inlineCompletions/browser/model/suggestWidgetAdapter.js +init_arrays(); +init_arraysFind(); +init_event(); +init_lifecycle(); +init_position(); +init_range(); +init_languages(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/suggest/browser/suggestController.js +init_arrays(); +init_cancellation(); +init_errors(); +init_event(); +init_keybindings(); +init_lifecycle(); +init_platform(); +init_stopwatch(); +init_types(); +init_editorExtensions(); +init_position(); +init_range(); +init_editorContextKeys(); +init_languages(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/suggest/browser/suggestMemory.js +init_async(); +init_lifecycle(); +init_map(); +init_languages(); +init_configuration(); +init_extensions(); +init_instantiation(); +var __decorate107 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param101 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var SuggestMemoryService_1; +var Memory = class { + constructor(name) { + this.name = name; + } + select(model, pos, items) { + if (items.length === 0) { + return 0; + } + const topScore = items[0].score[0]; + for (let i2 = 0; i2 < items.length; i2++) { + const { score: score3, completion: suggestion } = items[i2]; + if (score3[0] !== topScore) { + break; + } + if (suggestion.preselect) { + return i2; + } + } + return 0; + } +}; +var NoMemory = class extends Memory { + constructor() { + super("first"); + } + memorize(model, pos, item) { + } + toJSON() { + return void 0; + } + fromJSON() { + } +}; +var LRUMemory = class extends Memory { + constructor() { + super("recentlyUsed"); + this._cache = new LRUCache(300, 0.66); + this._seq = 0; + } + memorize(model, pos, item) { + const key = `${model.getLanguageId()}/${item.textLabel}`; + this._cache.set(key, { + touch: this._seq++, + type: item.completion.kind, + insertText: item.completion.insertText + }); + } + select(model, pos, items) { + if (items.length === 0) { + return 0; + } + const lineSuffix = model.getLineContent(pos.lineNumber).substr(pos.column - 10, pos.column - 1); + if (/\s$/.test(lineSuffix)) { + return super.select(model, pos, items); + } + const topScore = items[0].score[0]; + let indexPreselect = -1; + let indexRecency = -1; + let seq = -1; + for (let i2 = 0; i2 < items.length; i2++) { + if (items[i2].score[0] !== topScore) { + break; + } + const key = `${model.getLanguageId()}/${items[i2].textLabel}`; + const item = this._cache.peek(key); + if (item && item.touch > seq && item.type === items[i2].completion.kind && item.insertText === items[i2].completion.insertText) { + seq = item.touch; + indexRecency = i2; + } + if (items[i2].completion.preselect && indexPreselect === -1) { + return indexPreselect = i2; + } + } + if (indexRecency !== -1) { + return indexRecency; + } else if (indexPreselect !== -1) { + return indexPreselect; + } else { + return 0; + } + } + toJSON() { + return this._cache.toJSON(); + } + fromJSON(data) { + this._cache.clear(); + const seq = 0; + for (const [key, value] of data) { + value.touch = seq; + value.type = typeof value.type === "number" ? value.type : CompletionItemKinds.fromString(value.type); + this._cache.set(key, value); + } + this._seq = this._cache.size; + } +}; +var PrefixMemory = class extends Memory { + constructor() { + super("recentlyUsedByPrefix"); + this._trie = TernarySearchTree.forStrings(); + this._seq = 0; + } + memorize(model, pos, item) { + const { word } = model.getWordUntilPosition(pos); + const key = `${model.getLanguageId()}/${word}`; + this._trie.set(key, { + type: item.completion.kind, + insertText: item.completion.insertText, + touch: this._seq++ + }); + } + select(model, pos, items) { + const { word } = model.getWordUntilPosition(pos); + if (!word) { + return super.select(model, pos, items); + } + const key = `${model.getLanguageId()}/${word}`; + let item = this._trie.get(key); + if (!item) { + item = this._trie.findSubstr(key); + } + if (item) { + for (let i2 = 0; i2 < items.length; i2++) { + const { kind, insertText } = items[i2].completion; + if (kind === item.type && insertText === item.insertText) { + return i2; + } + } + } + return super.select(model, pos, items); + } + toJSON() { + const entries2 = []; + this._trie.forEach((value, key) => entries2.push([key, value])); + entries2.sort((a, b) => -(a[1].touch - b[1].touch)).forEach((value, i2) => value[1].touch = i2); + return entries2.slice(0, 200); + } + fromJSON(data) { + this._trie.clear(); + if (data.length > 0) { + this._seq = data[0][1].touch + 1; + for (const [key, value] of data) { + value.type = typeof value.type === "number" ? value.type : CompletionItemKinds.fromString(value.type); + this._trie.set(key, value); + } + } + } +}; +var SuggestMemoryService = class SuggestMemoryService2 { + static { + SuggestMemoryService_1 = this; + } + static { + this._strategyCtors = /* @__PURE__ */ new Map([ + ["recentlyUsedByPrefix", PrefixMemory], + ["recentlyUsed", LRUMemory], + ["first", NoMemory] + ]); + } + static { + this._storagePrefix = "suggest/memories"; + } + constructor(_storageService, _configService) { + this._storageService = _storageService; + this._configService = _configService; + this._disposables = new DisposableStore(); + this._persistSoon = new RunOnceScheduler(() => this._saveState(), 500); + this._disposables.add(_storageService.onWillSaveState((e) => { + if (e.reason === WillSaveStateReason.SHUTDOWN) { + this._saveState(); + } + })); + } + dispose() { + this._disposables.dispose(); + this._persistSoon.dispose(); + } + memorize(model, pos, item) { + this._withStrategy(model, pos).memorize(model, pos, item); + this._persistSoon.schedule(); + } + select(model, pos, items) { + return this._withStrategy(model, pos).select(model, pos, items); + } + _withStrategy(model, pos) { + const mode = this._configService.getValue("editor.suggestSelection", { + overrideIdentifier: model.getLanguageIdAtPosition(pos.lineNumber, pos.column), + resource: model.uri + }); + if (this._strategy?.name !== mode) { + this._saveState(); + const ctor = SuggestMemoryService_1._strategyCtors.get(mode) || NoMemory; + this._strategy = new ctor(); + try { + const share = this._configService.getValue("editor.suggest.shareSuggestSelections"); + const scope = share ? 0 : 1; + const raw = this._storageService.get(`${SuggestMemoryService_1._storagePrefix}/${mode}`, scope); + if (raw) { + this._strategy.fromJSON(JSON.parse(raw)); + } + } catch (e) { + } + } + return this._strategy; + } + _saveState() { + if (this._strategy) { + const share = this._configService.getValue("editor.suggest.shareSuggestSelections"); + const scope = share ? 0 : 1; + const raw = JSON.stringify(this._strategy); + this._storageService.store( + `${SuggestMemoryService_1._storagePrefix}/${this._strategy.name}`, + raw, + scope, + 1 + /* StorageTarget.MACHINE */ + ); + } + } +}; +SuggestMemoryService = SuggestMemoryService_1 = __decorate107([ + __param101(0, IStorageService), + __param101(1, IConfigurationService) +], SuggestMemoryService); +var ISuggestMemoryService = createDecorator("ISuggestMemories"); +registerSingleton( + ISuggestMemoryService, + SuggestMemoryService, + 1 + /* InstantiationType.Delayed */ +); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/suggest/browser/wordContextKey.js +init_contextkey(); +init_nls(); +var __decorate108 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param102 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var WordContextKey_1; +var WordContextKey = class WordContextKey2 { + static { + WordContextKey_1 = this; + } + static { + this.AtEnd = new RawContextKey("atEndOfWord", false, { type: "boolean", description: localize(1494, "A context key that is true when at the end of a word. Note that this is only defined when tab-completions are enabled") }); + } + constructor(_editor, contextKeyService) { + this._editor = _editor; + this._enabled = false; + this._ckAtEnd = WordContextKey_1.AtEnd.bindTo(contextKeyService); + this._configListener = this._editor.onDidChangeConfiguration((e) => e.hasChanged( + 139 + /* EditorOption.tabCompletion */ + ) && this._update()); + this._update(); + } + dispose() { + this._configListener.dispose(); + this._selectionListener?.dispose(); + this._ckAtEnd.reset(); + } + _update() { + const enabled = this._editor.getOption( + 139 + /* EditorOption.tabCompletion */ + ) === "on"; + if (this._enabled === enabled) { + return; + } + this._enabled = enabled; + if (this._enabled) { + const checkForWordEnd = () => { + if (!this._editor.hasModel()) { + this._ckAtEnd.set(false); + return; + } + const model = this._editor.getModel(); + const selection = this._editor.getSelection(); + const word = model.getWordAtPosition(selection.getStartPosition()); + if (!word) { + this._ckAtEnd.set(false); + return; + } + this._ckAtEnd.set(word.endColumn === selection.getStartPosition().column && selection.getStartPosition().lineNumber === selection.getEndPosition().lineNumber); + }; + this._selectionListener = this._editor.onDidChangeCursorSelection(checkForWordEnd); + checkForWordEnd(); + } else if (this._selectionListener) { + this._ckAtEnd.reset(); + this._selectionListener.dispose(); + this._selectionListener = void 0; + } + } +}; +WordContextKey = WordContextKey_1 = __decorate108([ + __param102(1, IContextKeyService) +], WordContextKey); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/suggest/browser/suggestController.js +init_nls(); +init_commands(); +init_contextkey(); +init_instantiation(); +init_log(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/suggest/browser/suggestAlternatives.js +init_contextkey(); +var __decorate109 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param103 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var SuggestAlternatives_1; +var SuggestAlternatives = class SuggestAlternatives2 { + static { + SuggestAlternatives_1 = this; + } + static { + this.OtherSuggestions = new RawContextKey("hasOtherSuggestions", false); + } + constructor(_editor, contextKeyService) { + this._editor = _editor; + this._index = 0; + this._ckOtherSuggestions = SuggestAlternatives_1.OtherSuggestions.bindTo(contextKeyService); + } + dispose() { + this.reset(); + } + reset() { + this._ckOtherSuggestions.reset(); + this._listener?.dispose(); + this._model = void 0; + this._acceptNext = void 0; + this._ignore = false; + } + set({ model, index }, acceptNext) { + if (model.items.length === 0) { + this.reset(); + return; + } + const nextIndex = SuggestAlternatives_1._moveIndex(true, model, index); + if (nextIndex === index) { + this.reset(); + return; + } + this._acceptNext = acceptNext; + this._model = model; + this._index = index; + this._listener = this._editor.onDidChangeCursorPosition(() => { + if (!this._ignore) { + this.reset(); + } + }); + this._ckOtherSuggestions.set(true); + } + static _moveIndex(fwd, model, index) { + let newIndex = index; + for (let rounds = model.items.length; rounds > 0; rounds--) { + newIndex = (newIndex + model.items.length + (fwd ? 1 : -1)) % model.items.length; + if (newIndex === index) { + break; + } + if (!model.items[newIndex].completion.additionalTextEdits) { + break; + } + } + return newIndex; + } + next() { + this._move(true); + } + prev() { + this._move(false); + } + _move(fwd) { + if (!this._model) { + return; + } + try { + this._ignore = true; + this._index = SuggestAlternatives_1._moveIndex(fwd, this._model, this._index); + this._acceptNext({ index: this._index, item: this._model.items[this._index], model: this._model }); + } finally { + this._ignore = false; + } + } +}; +SuggestAlternatives = SuggestAlternatives_1 = __decorate109([ + __param103(1, IContextKeyService) +], SuggestAlternatives); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/suggest/browser/suggestCommitCharacters.js +init_arrays(); +init_lifecycle(); +init_characterClassifier(); +var CommitCharacterController = class { + constructor(editor2, widget, model, accept) { + this._disposables = new DisposableStore(); + this._disposables.add(model.onDidSuggest((e) => { + if (e.completionModel.items.length === 0) { + this.reset(); + } + })); + this._disposables.add(model.onDidCancel((e) => { + this.reset(); + })); + this._disposables.add(widget.onDidShow(() => this._onItem(widget.getFocusedItem()))); + this._disposables.add(widget.onDidFocus(this._onItem, this)); + this._disposables.add(widget.onDidHide(this.reset, this)); + this._disposables.add(editor2.onWillType((text2) => { + if (this._active && !widget.isFrozen() && model.state !== 0) { + const ch = text2.charCodeAt(text2.length - 1); + if (this._active.acceptCharacters.has(ch) && editor2.getOption( + 0 + /* EditorOption.acceptSuggestionOnCommitCharacter */ + )) { + accept(this._active.item); + } + } + })); + } + _onItem(selected) { + if (!selected || !isNonEmptyArray(selected.item.completion.commitCharacters)) { + this.reset(); + return; + } + if (this._active && this._active.item.item === selected.item) { + return; + } + const acceptCharacters = new CharacterSet(); + for (const ch of selected.item.completion.commitCharacters) { + if (ch.length > 0) { + acceptCharacters.add(ch.charCodeAt(0)); + } + } + this._active = { acceptCharacters, item: selected }; + } + reset() { + this._active = void 0; + } + dispose() { + this._disposables.dispose(); + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/suggest/browser/suggestModel.js +init_async(); +init_cancellation(); +init_errors(); +init_event(); +init_lifecycle(); +init_strings(); +init_selection(); +init_editorWorker(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/suggest/browser/wordDistance.js +init_arrays(); +init_range(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/smartSelect/browser/bracketSelections.js +init_linkedList(); +init_position(); +init_range(); +var BracketSelectionRangeProvider = class _BracketSelectionRangeProvider { + async provideSelectionRanges(model, positions) { + const result = []; + for (const position of positions) { + const bucket = []; + result.push(bucket); + const ranges = /* @__PURE__ */ new Map(); + await new Promise((resolve3) => _BracketSelectionRangeProvider._bracketsRightYield(resolve3, 0, model, position, ranges)); + await new Promise((resolve3) => _BracketSelectionRangeProvider._bracketsLeftYield(resolve3, 0, model, position, ranges, bucket)); + } + return result; + } + static { + this._maxDuration = 30; + } + static { + this._maxRounds = 2; + } + static _bracketsRightYield(resolve3, round, model, pos, ranges) { + const counts = /* @__PURE__ */ new Map(); + const t1 = Date.now(); + while (true) { + if (round >= _BracketSelectionRangeProvider._maxRounds) { + resolve3(); + break; + } + if (!pos) { + resolve3(); + break; + } + const bracket = model.bracketPairs.findNextBracket(pos); + if (!bracket) { + resolve3(); + break; + } + const d = Date.now() - t1; + if (d > _BracketSelectionRangeProvider._maxDuration) { + setTimeout(() => _BracketSelectionRangeProvider._bracketsRightYield(resolve3, round + 1, model, pos, ranges)); + break; + } + if (bracket.bracketInfo.isOpeningBracket) { + const key = bracket.bracketInfo.bracketText; + const val = counts.has(key) ? counts.get(key) : 0; + counts.set(key, val + 1); + } else { + const key = bracket.bracketInfo.getOpeningBrackets()[0].bracketText; + let val = counts.has(key) ? counts.get(key) : 0; + val -= 1; + counts.set(key, Math.max(0, val)); + if (val < 0) { + let list2 = ranges.get(key); + if (!list2) { + list2 = new LinkedList(); + ranges.set(key, list2); + } + list2.push(bracket.range); + } + } + pos = bracket.range.getEndPosition(); + } + } + static _bracketsLeftYield(resolve3, round, model, pos, ranges, bucket) { + const counts = /* @__PURE__ */ new Map(); + const t1 = Date.now(); + while (true) { + if (round >= _BracketSelectionRangeProvider._maxRounds && ranges.size === 0) { + resolve3(); + break; + } + if (!pos) { + resolve3(); + break; + } + const bracket = model.bracketPairs.findPrevBracket(pos); + if (!bracket) { + resolve3(); + break; + } + const d = Date.now() - t1; + if (d > _BracketSelectionRangeProvider._maxDuration) { + setTimeout(() => _BracketSelectionRangeProvider._bracketsLeftYield(resolve3, round + 1, model, pos, ranges, bucket)); + break; + } + if (!bracket.bracketInfo.isOpeningBracket) { + const key = bracket.bracketInfo.getOpeningBrackets()[0].bracketText; + const val = counts.has(key) ? counts.get(key) : 0; + counts.set(key, val + 1); + } else { + const key = bracket.bracketInfo.bracketText; + let val = counts.has(key) ? counts.get(key) : 0; + val -= 1; + counts.set(key, Math.max(0, val)); + if (val < 0) { + const list2 = ranges.get(key); + if (list2) { + const closing = list2.shift(); + if (list2.size === 0) { + ranges.delete(key); + } + const innerBracket = Range.fromPositions(bracket.range.getEndPosition(), closing.getStartPosition()); + const outerBracket = Range.fromPositions(bracket.range.getStartPosition(), closing.getEndPosition()); + bucket.push({ range: innerBracket }); + bucket.push({ range: outerBracket }); + _BracketSelectionRangeProvider._addBracketLeading(model, outerBracket, bucket); + } + } + } + pos = bracket.range.getStartPosition(); + } + } + static _addBracketLeading(model, bracket, bucket) { + if (bracket.startLineNumber === bracket.endLineNumber) { + return; + } + const startLine = bracket.startLineNumber; + const column = model.getLineFirstNonWhitespaceColumn(startLine); + if (column !== 0 && column !== bracket.startColumn) { + bucket.push({ range: Range.fromPositions(new Position(startLine, column), bracket.getEndPosition()) }); + bucket.push({ range: Range.fromPositions(new Position(startLine, 1), bracket.getEndPosition()) }); + } + const aboveLine = startLine - 1; + if (aboveLine > 0) { + const column2 = model.getLineFirstNonWhitespaceColumn(aboveLine); + if (column2 === bracket.startColumn && column2 !== model.getLineLastNonWhitespaceColumn(aboveLine)) { + bucket.push({ range: Range.fromPositions(new Position(aboveLine, column2), bracket.getEndPosition()) }); + bucket.push({ range: Range.fromPositions(new Position(aboveLine, 1), bracket.getEndPosition()) }); + } + } + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/suggest/browser/wordDistance.js +var WordDistance = class _WordDistance { + static { + this.None = new class extends _WordDistance { + distance() { + return 0; + } + }(); + } + static async create(service, editor2) { + if (!editor2.getOption( + 134 + /* EditorOption.suggest */ + ).localityBonus) { + return _WordDistance.None; + } + if (!editor2.hasModel()) { + return _WordDistance.None; + } + const model = editor2.getModel(); + const position = editor2.getPosition(); + if (!service.canComputeWordRanges(model.uri)) { + return _WordDistance.None; + } + const [ranges] = await new BracketSelectionRangeProvider().provideSelectionRanges(model, [position]); + if (ranges.length === 0) { + return _WordDistance.None; + } + const wordRanges = await service.computeWordRanges(model.uri, ranges[0].range); + if (!wordRanges) { + return _WordDistance.None; + } + const wordUntilPos = model.getWordUntilPosition(position); + delete wordRanges[wordUntilPos.word]; + return new class extends _WordDistance { + distance(anchor, item) { + if (!position.equals(editor2.getPosition())) { + return 0; + } + if (item.kind === 17) { + return 2 << 20; + } + const word = typeof item.label === "string" ? item.label : item.label.label; + const wordLines = wordRanges[word]; + if (isFalsyOrEmpty(wordLines)) { + return 2 << 20; + } + const idx = binarySearch(wordLines, Range.fromPositions(anchor), Range.compareRangesUsingStarts); + const bestWordRange = idx >= 0 ? wordLines[idx] : wordLines[Math.max(0, ~idx - 1)]; + let blockDistance = ranges.length; + for (const range2 of ranges) { + if (!Range.containsRange(range2.range, bestWordRange)) { + break; + } + blockDistance -= 1; + } + return blockDistance; + } + }(); + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/suggest/browser/suggestModel.js +init_configuration(); +init_contextkey(); +init_log(); +init_telemetry(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/suggest/browser/completionModel.js +init_arrays(); +init_filters(); +init_strings(); +var LineContext = class { + constructor(leadingLineContent, characterCountDelta) { + this.leadingLineContent = leadingLineContent; + this.characterCountDelta = characterCountDelta; + } +}; +var CompletionModel = class _CompletionModel { + constructor(items, column, lineContext, wordDistance, options2, snippetSuggestions, fuzzyScoreOptions = FuzzyScoreOptions.default, clipboardText = void 0) { + this.clipboardText = clipboardText; + this._snippetCompareFn = _CompletionModel._compareCompletionItems; + this._items = items; + this._column = column; + this._wordDistance = wordDistance; + this._options = options2; + this._refilterKind = 1; + this._lineContext = lineContext; + this._fuzzyScoreOptions = fuzzyScoreOptions; + if (snippetSuggestions === "top") { + this._snippetCompareFn = _CompletionModel._compareCompletionItemsSnippetsUp; + } else if (snippetSuggestions === "bottom") { + this._snippetCompareFn = _CompletionModel._compareCompletionItemsSnippetsDown; + } + } + get lineContext() { + return this._lineContext; + } + set lineContext(value) { + if (this._lineContext.leadingLineContent !== value.leadingLineContent || this._lineContext.characterCountDelta !== value.characterCountDelta) { + this._refilterKind = this._lineContext.characterCountDelta < value.characterCountDelta && this._filteredItems ? 2 : 1; + this._lineContext = value; + } + } + get items() { + this._ensureCachedState(); + return this._filteredItems; + } + getItemsByProvider() { + this._ensureCachedState(); + return this._itemsByProvider; + } + getIncompleteProvider() { + this._ensureCachedState(); + const result = /* @__PURE__ */ new Set(); + for (const [provider, items] of this.getItemsByProvider()) { + if (items.length > 0 && items[0].container.incomplete) { + result.add(provider); + } + } + return result; + } + get stats() { + this._ensureCachedState(); + return this._stats; + } + _ensureCachedState() { + if (this._refilterKind !== 0) { + this._createCachedState(); + } + } + _createCachedState() { + this._itemsByProvider = /* @__PURE__ */ new Map(); + const labelLengths = []; + const { leadingLineContent, characterCountDelta } = this._lineContext; + let word = ""; + let wordLow = ""; + const source = this._refilterKind === 1 ? this._items : this._filteredItems; + const target = []; + const scoreFn = !this._options.filterGraceful || source.length > 2e3 ? fuzzyScore : fuzzyScoreGracefulAggressive; + for (let i2 = 0; i2 < source.length; i2++) { + const item = source[i2]; + if (item.isInvalid) { + continue; + } + const arr = this._itemsByProvider.get(item.provider); + if (arr) { + arr.push(item); + } else { + this._itemsByProvider.set(item.provider, [item]); + } + const overwriteBefore = item.position.column - item.editStart.column; + const wordLen = overwriteBefore + characterCountDelta - (item.position.column - this._column); + if (word.length !== wordLen) { + word = wordLen === 0 ? "" : leadingLineContent.slice(-wordLen); + wordLow = word.toLowerCase(); + } + item.word = word; + if (wordLen === 0) { + item.score = FuzzyScore.Default; + } else { + let wordPos = 0; + while (wordPos < overwriteBefore) { + const ch = word.charCodeAt(wordPos); + if (ch === 32 || ch === 9) { + wordPos += 1; + } else { + break; + } + } + if (wordPos >= wordLen) { + item.score = FuzzyScore.Default; + } else if (typeof item.completion.filterText === "string") { + const match2 = scoreFn(word, wordLow, wordPos, item.completion.filterText, item.filterTextLow, 0, this._fuzzyScoreOptions); + if (!match2) { + continue; + } + if (compareIgnoreCase(item.completion.filterText, item.textLabel) === 0) { + item.score = match2; + } else { + item.score = anyScore(word, wordLow, wordPos, item.textLabel, item.labelLow, 0); + item.score[0] = match2[0]; + } + } else { + const match2 = scoreFn(word, wordLow, wordPos, item.textLabel, item.labelLow, 0, this._fuzzyScoreOptions); + if (!match2) { + continue; + } + item.score = match2; + } + } + item.idx = i2; + item.distance = this._wordDistance.distance(item.position, item.completion); + target.push(item); + labelLengths.push(item.textLabel.length); + } + this._filteredItems = target.sort(this._snippetCompareFn); + this._refilterKind = 0; + this._stats = { + pLabelLen: labelLengths.length ? quickSelect(labelLengths.length - 0.85, labelLengths, (a, b) => a - b) : 0 + }; + } + static _compareCompletionItems(a, b) { + if (a.score[0] > b.score[0]) { + return -1; + } else if (a.score[0] < b.score[0]) { + return 1; + } else if (a.distance < b.distance) { + return -1; + } else if (a.distance > b.distance) { + return 1; + } else if (a.idx < b.idx) { + return -1; + } else if (a.idx > b.idx) { + return 1; + } else { + return 0; + } + } + static _compareCompletionItemsSnippetsDown(a, b) { + if (a.completion.kind !== b.completion.kind) { + if (a.completion.kind === 28) { + return 1; + } else if (b.completion.kind === 28) { + return -1; + } + } + return _CompletionModel._compareCompletionItems(a, b); + } + static _compareCompletionItemsSnippetsUp(a, b) { + if (a.completion.kind !== b.completion.kind) { + if (a.completion.kind === 28) { + return -1; + } else if (b.completion.kind === 28) { + return 1; + } + } + return _CompletionModel._compareCompletionItems(a, b); + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/suggest/browser/suggestModel.js +init_languageFeatures(); +init_filters(); +init_types(); +init_environment(); +var __decorate110 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param104 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var SuggestModel_1; +var LineContext2 = class { + static shouldAutoTrigger(editor2) { + if (!editor2.hasModel()) { + return false; + } + const model = editor2.getModel(); + const pos = editor2.getPosition(); + model.tokenization.tokenizeIfCheap(pos.lineNumber); + const word = model.getWordAtPosition(pos); + if (!word) { + return false; + } + if (word.endColumn !== pos.column && word.startColumn + 1 !== pos.column) { + return false; + } + if (!isNaN(Number(word.word))) { + return false; + } + return true; + } + constructor(model, position, triggerOptions) { + this.leadingLineContent = model.getLineContent(position.lineNumber).substr(0, position.column - 1); + this.leadingWord = model.getWordUntilPosition(position); + this.lineNumber = position.lineNumber; + this.column = position.column; + this.triggerOptions = triggerOptions; + } +}; +function canShowQuickSuggest(editor2, contextKeyService, configurationService) { + if (!Boolean(contextKeyService.getContextKeyValue(InlineCompletionContextKeys.inlineSuggestionVisible.key))) { + return true; + } + const suppressSuggestions = contextKeyService.getContextKeyValue(InlineCompletionContextKeys.suppressSuggestions.key); + if (suppressSuggestions !== void 0) { + return !suppressSuggestions; + } + return !editor2.getOption( + 71 + /* EditorOption.inlineSuggest */ + ).suppressSuggestions; +} +function canShowSuggestOnTriggerCharacters(editor2, contextKeyService, configurationService) { + if (!Boolean(contextKeyService.getContextKeyValue("inlineSuggestionVisible"))) { + return true; + } + const suppressSuggestions = contextKeyService.getContextKeyValue(InlineCompletionContextKeys.suppressSuggestions.key); + if (suppressSuggestions !== void 0) { + return !suppressSuggestions; + } + return !editor2.getOption( + 71 + /* EditorOption.inlineSuggest */ + ).suppressSuggestions; +} +var SuggestModel = SuggestModel_1 = class SuggestModel2 { + constructor(_editor, _editorWorkerService, _clipboardService, _telemetryService, _logService, _contextKeyService, _configurationService, _languageFeaturesService, _envService) { + this._editor = _editor; + this._editorWorkerService = _editorWorkerService; + this._clipboardService = _clipboardService; + this._telemetryService = _telemetryService; + this._logService = _logService; + this._contextKeyService = _contextKeyService; + this._configurationService = _configurationService; + this._languageFeaturesService = _languageFeaturesService; + this._envService = _envService; + this._toDispose = new DisposableStore(); + this._triggerCharacterListener = new DisposableStore(); + this._triggerQuickSuggest = new TimeoutTimer(); + this._triggerState = void 0; + this._completionDisposables = new DisposableStore(); + this._onDidCancel = new Emitter(); + this._onDidTrigger = new Emitter(); + this._onDidSuggest = new Emitter(); + this.onDidCancel = this._onDidCancel.event; + this.onDidTrigger = this._onDidTrigger.event; + this.onDidSuggest = this._onDidSuggest.event; + this._currentSelection = this._editor.getSelection() || new Selection(1, 1, 1, 1); + this._toDispose.add(this._editor.onDidChangeModel(() => { + this._updateTriggerCharacters(); + this.cancel(); + })); + this._toDispose.add(this._editor.onDidChangeModelLanguage(() => { + this._updateTriggerCharacters(); + this.cancel(); + })); + this._toDispose.add(this._editor.onDidChangeConfiguration(() => { + this._updateTriggerCharacters(); + })); + this._toDispose.add(this._languageFeaturesService.completionProvider.onDidChange(() => { + this._updateTriggerCharacters(); + this._updateActiveSuggestSession(); + })); + let editorIsComposing = false; + this._toDispose.add(this._editor.onDidCompositionStart(() => { + editorIsComposing = true; + })); + this._toDispose.add(this._editor.onDidCompositionEnd(() => { + editorIsComposing = false; + this._onCompositionEnd(); + })); + this._toDispose.add(this._editor.onDidChangeCursorSelection((e) => { + if (!editorIsComposing) { + this._onCursorChange(e); + } + })); + this._toDispose.add(this._editor.onDidChangeModelContent(() => { + if (!editorIsComposing && this._triggerState !== void 0) { + this._refilterCompletionItems(); + } + })); + this._updateTriggerCharacters(); + } + dispose() { + dispose(this._triggerCharacterListener); + dispose([this._onDidCancel, this._onDidSuggest, this._onDidTrigger, this._triggerQuickSuggest]); + this._toDispose.dispose(); + this._completionDisposables.dispose(); + this.cancel(); + } + _updateTriggerCharacters() { + this._triggerCharacterListener.clear(); + if (this._editor.getOption( + 104 + /* EditorOption.readOnly */ + ) || !this._editor.hasModel() || !this._editor.getOption( + 137 + /* EditorOption.suggestOnTriggerCharacters */ + )) { + return; + } + const supportsByTriggerCharacter = /* @__PURE__ */ new Map(); + for (const support of this._languageFeaturesService.completionProvider.all(this._editor.getModel())) { + for (const ch of support.triggerCharacters || []) { + let set = supportsByTriggerCharacter.get(ch); + if (!set) { + set = /* @__PURE__ */ new Set(); + const suggestSupport = getSnippetSuggestSupport(); + if (suggestSupport) { + set.add(suggestSupport); + } + supportsByTriggerCharacter.set(ch, set); + } + set.add(support); + } + } + const checkTriggerCharacter = (text2) => { + if (!canShowSuggestOnTriggerCharacters(this._editor, this._contextKeyService, this._configurationService)) { + return; + } + if (LineContext2.shouldAutoTrigger(this._editor)) { + return; + } + if (!text2) { + const position = this._editor.getPosition(); + const model = this._editor.getModel(); + text2 = model.getLineContent(position.lineNumber).substr(0, position.column - 1); + } + let lastChar = ""; + if (isLowSurrogate(text2.charCodeAt(text2.length - 1))) { + if (isHighSurrogate(text2.charCodeAt(text2.length - 2))) { + lastChar = text2.substr(text2.length - 2); + } + } else { + lastChar = text2.charAt(text2.length - 1); + } + const supports = supportsByTriggerCharacter.get(lastChar); + if (supports) { + const providerItemsToReuse = /* @__PURE__ */ new Map(); + if (this._completionModel) { + for (const [provider, items] of this._completionModel.getItemsByProvider()) { + if (!supports.has(provider)) { + providerItemsToReuse.set(provider, items); + } + } + } + this.trigger({ + auto: true, + triggerKind: 1, + triggerCharacter: lastChar, + retrigger: Boolean(this._completionModel), + clipboardText: this._completionModel?.clipboardText, + completionOptions: { providerFilter: supports, providerItemsToReuse } + }); + } + }; + this._triggerCharacterListener.add(this._editor.onDidType(checkTriggerCharacter)); + this._triggerCharacterListener.add(this._editor.onDidCompositionEnd(() => checkTriggerCharacter())); + } + // --- trigger/retrigger/cancel suggest + get state() { + if (!this._triggerState) { + return 0; + } else if (!this._triggerState.auto) { + return 1; + } else { + return 2; + } + } + cancel(retrigger = false) { + if (this._triggerState !== void 0) { + this._triggerQuickSuggest.cancel(); + this._requestToken?.cancel(); + this._requestToken = void 0; + this._triggerState = void 0; + this._completionModel = void 0; + this._context = void 0; + this._onDidCancel.fire({ retrigger }); + } + } + clear() { + this._completionDisposables.clear(); + } + _updateActiveSuggestSession() { + if (this._triggerState !== void 0) { + if (!this._editor.hasModel() || !this._languageFeaturesService.completionProvider.has(this._editor.getModel())) { + this.cancel(); + } else { + this.trigger({ auto: this._triggerState.auto, retrigger: true }); + } + } + } + _onCursorChange(e) { + if (!this._editor.hasModel()) { + return; + } + const prevSelection = this._currentSelection; + this._currentSelection = this._editor.getSelection(); + if (!e.selection.isEmpty() || e.reason !== 0 && e.reason !== 3 || e.source !== "keyboard" && e.source !== "deleteLeft") { + this.cancel(); + return; + } + if (this._triggerState === void 0 && e.reason === 0) { + if (prevSelection.containsRange(this._currentSelection) || prevSelection.getEndPosition().isBeforeOrEqual(this._currentSelection.getPosition())) { + this._doTriggerQuickSuggest(); + } + } else if (this._triggerState !== void 0 && e.reason === 3) { + this._refilterCompletionItems(); + } + } + _onCompositionEnd() { + if (this._triggerState === void 0) { + this._doTriggerQuickSuggest(); + } else { + this._refilterCompletionItems(); + } + } + _doTriggerQuickSuggest() { + if (QuickSuggestionsOptions.isAllOff(this._editor.getOption( + 102 + /* EditorOption.quickSuggestions */ + ))) { + return; + } + if (this._editor.getOption( + 134 + /* EditorOption.suggest */ + ).snippetsPreventQuickSuggestions && SnippetController2.get(this._editor)?.isInSnippet()) { + return; + } + this.cancel(); + this._triggerQuickSuggest.cancelAndSet(() => { + if (this._triggerState !== void 0) { + return; + } + if (!LineContext2.shouldAutoTrigger(this._editor)) { + return; + } + if (!this._editor.hasModel() || !this._editor.hasWidgetFocus()) { + return; + } + const model = this._editor.getModel(); + const pos = this._editor.getPosition(); + const config = this._editor.getOption( + 102 + /* EditorOption.quickSuggestions */ + ); + if (QuickSuggestionsOptions.isAllOff(config)) { + return; + } + if (!QuickSuggestionsOptions.isAllOn(config)) { + model.tokenization.tokenizeIfCheap(pos.lineNumber); + const lineTokens = model.tokenization.getLineTokens(pos.lineNumber); + const tokenType = lineTokens.getStandardTokenType(lineTokens.findTokenIndexAtOffset(Math.max(pos.column - 1 - 1, 0))); + if (QuickSuggestionsOptions.valueFor(config, tokenType) !== "on") { + return; + } + } + if (!canShowQuickSuggest(this._editor, this._contextKeyService, this._configurationService)) { + return; + } + if (!this._languageFeaturesService.completionProvider.has(model)) { + return; + } + this.trigger({ auto: true }); + }, this._editor.getOption( + 103 + /* EditorOption.quickSuggestionsDelay */ + )); + } + _refilterCompletionItems() { + assertType(this._editor.hasModel()); + assertType(this._triggerState !== void 0); + const model = this._editor.getModel(); + const position = this._editor.getPosition(); + const ctx = new LineContext2(model, position, { ...this._triggerState, refilter: true }); + this._onNewContext(ctx); + } + trigger(options2) { + if (!this._editor.hasModel()) { + return; + } + const model = this._editor.getModel(); + const ctx = new LineContext2(model, this._editor.getPosition(), options2); + this.cancel(options2.retrigger); + this._triggerState = options2; + this._onDidTrigger.fire({ auto: options2.auto, shy: options2.shy ?? false, position: this._editor.getPosition() }); + this._context = ctx; + let suggestCtx = { + triggerKind: options2.triggerKind ?? 0 + /* CompletionTriggerKind.Invoke */ + }; + if (options2.triggerCharacter) { + suggestCtx = { + triggerKind: 1, + triggerCharacter: options2.triggerCharacter + }; + } + this._requestToken = new CancellationTokenSource(); + const snippetSuggestions = this._editor.getOption( + 128 + /* EditorOption.snippetSuggestions */ + ); + let snippetSortOrder = 1; + switch (snippetSuggestions) { + case "top": + snippetSortOrder = 0; + break; + // ↓ that's the default anyways... + // case 'inline': + // snippetSortOrder = SnippetSortOrder.Inline; + // break; + case "bottom": + snippetSortOrder = 2; + break; + } + const { itemKind: itemKindFilter, showDeprecated } = SuggestModel_1.createSuggestFilter(this._editor); + const completionOptions = new CompletionOptions(snippetSortOrder, options2.completionOptions?.kindFilter ?? itemKindFilter, options2.completionOptions?.providerFilter, options2.completionOptions?.providerItemsToReuse, showDeprecated); + const wordDistance = WordDistance.create(this._editorWorkerService, this._editor); + const completions = provideSuggestionItems(this._languageFeaturesService.completionProvider, model, this._editor.getPosition(), completionOptions, suggestCtx, this._requestToken.token); + Promise.all([completions, wordDistance]).then(async ([completions2, wordDistance2]) => { + this._requestToken?.dispose(); + if (!this._editor.hasModel()) { + completions2.disposable.dispose(); + return; + } + let clipboardText = options2?.clipboardText; + if (!clipboardText && completions2.needsClipboard) { + clipboardText = await this._clipboardService.readText(); + } + if (this._triggerState === void 0) { + completions2.disposable.dispose(); + return; + } + const model2 = this._editor.getModel(); + const ctx2 = new LineContext2(model2, this._editor.getPosition(), options2); + const fuzzySearchOptions = { + ...FuzzyScoreOptions.default, + firstMatchCanBeWeak: !this._editor.getOption( + 134 + /* EditorOption.suggest */ + ).matchOnWordStartOnly + }; + this._completionModel = new CompletionModel(completions2.items, this._context.column, { + leadingLineContent: ctx2.leadingLineContent, + characterCountDelta: ctx2.column - this._context.column + }, wordDistance2, this._editor.getOption( + 134 + /* EditorOption.suggest */ + ), this._editor.getOption( + 128 + /* EditorOption.snippetSuggestions */ + ), fuzzySearchOptions, clipboardText); + this._completionDisposables.add(completions2.disposable); + this._onNewContext(ctx2); + this._reportDurationsTelemetry(completions2.durations); + if (!this._envService.isBuilt || this._envService.isExtensionDevelopment) { + for (const item of completions2.items) { + if (item.isInvalid) { + this._logService.warn(`[suggest] did IGNORE invalid completion item from ${item.provider._debugDisplayName}`, item.completion); + } + } + } + }).catch(onUnexpectedError); + } + /** + * Report durations telemetry with a 1% sampling rate. + * The telemetry is reported only if a random number between 0 and 100 is less than or equal to 1. + */ + _reportDurationsTelemetry(durations) { + if (Math.random() > 1e-4) { + return; + } + setTimeout(() => { + this._telemetryService.publicLog2("suggest.durations.json", { data: JSON.stringify(durations) }); + this._logService.debug("suggest.durations.json", durations); + }); + } + static createSuggestFilter(editor2) { + const result = /* @__PURE__ */ new Set(); + const snippetSuggestions = editor2.getOption( + 128 + /* EditorOption.snippetSuggestions */ + ); + if (snippetSuggestions === "none") { + result.add( + 28 + /* CompletionItemKind.Snippet */ + ); + } + const suggestOptions = editor2.getOption( + 134 + /* EditorOption.suggest */ + ); + if (!suggestOptions.showMethods) { + result.add( + 0 + /* CompletionItemKind.Method */ + ); + } + if (!suggestOptions.showFunctions) { + result.add( + 1 + /* CompletionItemKind.Function */ + ); + } + if (!suggestOptions.showConstructors) { + result.add( + 2 + /* CompletionItemKind.Constructor */ + ); + } + if (!suggestOptions.showFields) { + result.add( + 3 + /* CompletionItemKind.Field */ + ); + } + if (!suggestOptions.showVariables) { + result.add( + 4 + /* CompletionItemKind.Variable */ + ); + } + if (!suggestOptions.showClasses) { + result.add( + 5 + /* CompletionItemKind.Class */ + ); + } + if (!suggestOptions.showStructs) { + result.add( + 6 + /* CompletionItemKind.Struct */ + ); + } + if (!suggestOptions.showInterfaces) { + result.add( + 7 + /* CompletionItemKind.Interface */ + ); + } + if (!suggestOptions.showModules) { + result.add( + 8 + /* CompletionItemKind.Module */ + ); + } + if (!suggestOptions.showProperties) { + result.add( + 9 + /* CompletionItemKind.Property */ + ); + } + if (!suggestOptions.showEvents) { + result.add( + 10 + /* CompletionItemKind.Event */ + ); + } + if (!suggestOptions.showOperators) { + result.add( + 11 + /* CompletionItemKind.Operator */ + ); + } + if (!suggestOptions.showUnits) { + result.add( + 12 + /* CompletionItemKind.Unit */ + ); + } + if (!suggestOptions.showValues) { + result.add( + 13 + /* CompletionItemKind.Value */ + ); + } + if (!suggestOptions.showConstants) { + result.add( + 14 + /* CompletionItemKind.Constant */ + ); + } + if (!suggestOptions.showEnums) { + result.add( + 15 + /* CompletionItemKind.Enum */ + ); + } + if (!suggestOptions.showEnumMembers) { + result.add( + 16 + /* CompletionItemKind.EnumMember */ + ); + } + if (!suggestOptions.showKeywords) { + result.add( + 17 + /* CompletionItemKind.Keyword */ + ); + } + if (!suggestOptions.showWords) { + result.add( + 18 + /* CompletionItemKind.Text */ + ); + } + if (!suggestOptions.showColors) { + result.add( + 19 + /* CompletionItemKind.Color */ + ); + } + if (!suggestOptions.showFiles) { + result.add( + 20 + /* CompletionItemKind.File */ + ); + } + if (!suggestOptions.showReferences) { + result.add( + 21 + /* CompletionItemKind.Reference */ + ); + } + if (!suggestOptions.showColors) { + result.add( + 22 + /* CompletionItemKind.Customcolor */ + ); + } + if (!suggestOptions.showFolders) { + result.add( + 23 + /* CompletionItemKind.Folder */ + ); + } + if (!suggestOptions.showTypeParameters) { + result.add( + 24 + /* CompletionItemKind.TypeParameter */ + ); + } + if (!suggestOptions.showSnippets) { + result.add( + 28 + /* CompletionItemKind.Snippet */ + ); + } + if (!suggestOptions.showUsers) { + result.add( + 25 + /* CompletionItemKind.User */ + ); + } + if (!suggestOptions.showIssues) { + result.add( + 26 + /* CompletionItemKind.Issue */ + ); + } + return { itemKind: result, showDeprecated: suggestOptions.showDeprecated }; + } + _onNewContext(ctx) { + if (!this._context) { + return; + } + if (ctx.lineNumber !== this._context.lineNumber) { + this.cancel(); + return; + } + if (getLeadingWhitespace(ctx.leadingLineContent) !== getLeadingWhitespace(this._context.leadingLineContent)) { + this.cancel(); + return; + } + if (ctx.column < this._context.column) { + if (ctx.leadingWord.word) { + this.trigger({ auto: this._context.triggerOptions.auto, retrigger: true }); + } else { + this.cancel(); + } + return; + } + if (!this._completionModel) { + return; + } + if (ctx.leadingWord.word.length !== 0 && ctx.leadingWord.startColumn > this._context.leadingWord.startColumn) { + const shouldAutoTrigger = LineContext2.shouldAutoTrigger(this._editor); + if (shouldAutoTrigger && this._context) { + const map = this._completionModel.getItemsByProvider(); + this.trigger({ + auto: this._context.triggerOptions.auto, + retrigger: true, + clipboardText: this._completionModel.clipboardText, + completionOptions: { providerItemsToReuse: map } + }); + } + return; + } + if (ctx.column > this._context.column && this._completionModel.getIncompleteProvider().size > 0 && ctx.leadingWord.word.length !== 0) { + const providerItemsToReuse = /* @__PURE__ */ new Map(); + const providerFilter = /* @__PURE__ */ new Set(); + for (const [provider, items] of this._completionModel.getItemsByProvider()) { + if (items.length > 0 && items[0].container.incomplete) { + providerFilter.add(provider); + } else { + providerItemsToReuse.set(provider, items); + } + } + this.trigger({ + auto: this._context.triggerOptions.auto, + triggerKind: 2, + retrigger: true, + clipboardText: this._completionModel.clipboardText, + completionOptions: { providerFilter, providerItemsToReuse } + }); + } else { + const oldLineContext = this._completionModel.lineContext; + let isFrozen2 = false; + this._completionModel.lineContext = { + leadingLineContent: ctx.leadingLineContent, + characterCountDelta: ctx.column - this._context.column + }; + if (this._completionModel.items.length === 0) { + const shouldAutoTrigger = LineContext2.shouldAutoTrigger(this._editor); + if (!this._context) { + this.cancel(); + return; + } + if (shouldAutoTrigger && this._context.leadingWord.endColumn < ctx.leadingWord.startColumn) { + this.trigger({ auto: this._context.triggerOptions.auto, retrigger: true }); + return; + } + if (!this._context.triggerOptions.auto) { + this._completionModel.lineContext = oldLineContext; + isFrozen2 = this._completionModel.items.length > 0; + if (isFrozen2 && ctx.leadingWord.word.length === 0) { + this.cancel(); + return; + } + } else { + this.cancel(); + return; + } + } + this._onDidSuggest.fire({ + completionModel: this._completionModel, + triggerOptions: ctx.triggerOptions, + isFrozen: isFrozen2 + }); + } + } +}; +SuggestModel = SuggestModel_1 = __decorate110([ + __param104(1, IEditorWorkerService), + __param104(2, IClipboardService), + __param104(3, ITelemetryService), + __param104(4, ILogService), + __param104(5, IContextKeyService), + __param104(6, IConfigurationService), + __param104(7, ILanguageFeaturesService), + __param104(8, IEnvironmentService) +], SuggestModel); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/suggest/browser/suggestOvertypingCapturer.js +init_lifecycle(); +var OvertypingCapturer = class _OvertypingCapturer { + static { + this._maxSelectionLength = 51200; + } + constructor(editor2, suggestModel) { + this._disposables = new DisposableStore(); + this._lastOvertyped = []; + this._locked = false; + this._disposables.add(editor2.onWillType(() => { + if (this._locked || !editor2.hasModel()) { + return; + } + const selections = editor2.getSelections(); + const selectionsLength = selections.length; + let willOvertype = false; + for (let i2 = 0; i2 < selectionsLength; i2++) { + if (!selections[i2].isEmpty()) { + willOvertype = true; + break; + } + } + if (!willOvertype) { + if (this._lastOvertyped.length !== 0) { + this._lastOvertyped.length = 0; + } + return; + } + this._lastOvertyped = []; + const model = editor2.getModel(); + for (let i2 = 0; i2 < selectionsLength; i2++) { + const selection = selections[i2]; + if (model.getValueLengthInRange(selection) > _OvertypingCapturer._maxSelectionLength) { + return; + } + this._lastOvertyped[i2] = { value: model.getValueInRange(selection), multiline: selection.startLineNumber !== selection.endLineNumber }; + } + })); + this._disposables.add(suggestModel.onDidTrigger((e) => { + this._locked = true; + })); + this._disposables.add(suggestModel.onDidCancel((e) => { + this._locked = false; + })); + } + getLastOvertypedInfo(idx) { + if (idx >= 0 && idx < this._lastOvertyped.length) { + return this._lastOvertyped[idx]; + } + return void 0; + } + dispose() { + this._disposables.dispose(); + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/suggest/browser/suggestWidget.js +init_dom(); +init_async(); +init_errors(); +init_event(); +init_lifecycle(); +init_numbers(); +init_strings(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/suggest/browser/suggestWidgetStatus.js +init_dom(); +init_lifecycle(); +init_actions2(); +init_contextkey(); +init_instantiation(); +var __decorate111 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param105 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var SuggestWidgetStatus = class SuggestWidgetStatus2 { + constructor(container, _menuId, instantiationService, _menuService, _contextKeyService) { + this._menuId = _menuId; + this._menuService = _menuService; + this._contextKeyService = _contextKeyService; + this._menuDisposables = new DisposableStore(); + this.element = append(container, $(".suggest-status-bar")); + const actionViewItemProvider = ((action) => { + return action instanceof MenuItemAction ? instantiationService.createInstance(TextOnlyMenuEntryActionViewItem, action, { useComma: false }) : void 0; + }); + this._leftActions = new ActionBar(this.element, { actionViewItemProvider }); + this._rightActions = new ActionBar(this.element, { actionViewItemProvider }); + this._leftActions.domNode.classList.add("left"); + this._rightActions.domNode.classList.add("right"); + } + dispose() { + this._menuDisposables.dispose(); + this._leftActions.dispose(); + this._rightActions.dispose(); + this.element.remove(); + } + show() { + const menu = this._menuService.createMenu(this._menuId, this._contextKeyService); + const renderMenu = () => { + const left = []; + const right = []; + for (const [group, actions] of menu.getActions()) { + if (group === "left") { + left.push(...actions); + } else { + right.push(...actions); + } + } + this._leftActions.clear(); + this._leftActions.push(left); + this._rightActions.clear(); + this._rightActions.push(right); + }; + this._menuDisposables.add(menu.onDidChange(() => renderMenu())); + this._menuDisposables.add(menu); + } + hide() { + this._menuDisposables.clear(); + } +}; +SuggestWidgetStatus = __decorate111([ + __param105(2, IInstantiationService), + __param105(3, IMenuService), + __param105(4, IContextKeyService) +], SuggestWidgetStatus); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/suggest/browser/suggestWidget.js +init_nls(); +init_contextkey(); +init_instantiation(); +init_colorRegistry(); +init_themeService(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/suggest/browser/suggestWidgetDetails.js +init_dom(); +init_codicons(); +init_event(); +init_htmlContent(); +init_lifecycle(); +init_themables(); +init_nls(); +init_theme(); +init_themeService(); +var __decorate112 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param106 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +function canExpandCompletionItem(item) { + return !!item && Boolean(item.completion.documentation || item.completion.detail && item.completion.detail !== item.completion.label); +} +var SuggestDetailsWidget = class SuggestDetailsWidget2 { + constructor(_editor, _themeService, _markdownRendererService) { + this._editor = _editor; + this._themeService = _themeService; + this._markdownRendererService = _markdownRendererService; + this._onDidClose = new Emitter(); + this.onDidClose = this._onDidClose.event; + this._onDidChangeContents = new Emitter(); + this.onDidChangeContents = this._onDidChangeContents.event; + this._disposables = new DisposableStore(); + this._renderDisposeable = new DisposableStore(); + this._size = new Dimension(330, 0); + this.domNode = $(".suggest-details"); + this.domNode.classList.add("no-docs"); + this._body = $(".body"); + this._scrollbar = new DomScrollableElement(this._body, { + alwaysConsumeMouseWheel: true + }); + append(this.domNode, this._scrollbar.getDomNode()); + this._disposables.add(this._scrollbar); + this._header = append(this._body, $(".header")); + this._close = append(this._header, $("span" + ThemeIcon.asCSSSelector(Codicon.close))); + this._close.title = localize(1490, "Close"); + this._close.role = "button"; + this._close.tabIndex = -1; + this._type = append(this._header, $("p.type")); + this._docs = append(this._body, $("p.docs")); + this._configureFont(); + this._disposables.add(this._editor.onDidChangeConfiguration((e) => { + if (e.hasChanged( + 59 + /* EditorOption.fontInfo */ + )) { + this._configureFont(); + } + })); + } + dispose() { + this._disposables.dispose(); + this._renderDisposeable.dispose(); + } + _configureFont() { + const options2 = this._editor.getOptions(); + const fontInfo = options2.get( + 59 + /* EditorOption.fontInfo */ + ); + const fontFamily = fontInfo.getMassagedFontFamily(); + const fontSize = options2.get( + 135 + /* EditorOption.suggestFontSize */ + ) || fontInfo.fontSize; + const lineHeight = options2.get( + 136 + /* EditorOption.suggestLineHeight */ + ) || fontInfo.lineHeight; + const fontWeight = fontInfo.fontWeight; + const fontSizePx = `${fontSize}px`; + const lineHeightPx = `${lineHeight}px`; + this.domNode.style.fontSize = fontSizePx; + this.domNode.style.lineHeight = `${lineHeight / fontSize}`; + this.domNode.style.fontWeight = fontWeight; + this.domNode.style.fontFeatureSettings = fontInfo.fontFeatureSettings; + this._type.style.fontFamily = fontFamily; + this._close.style.height = lineHeightPx; + this._close.style.width = lineHeightPx; + } + getLayoutInfo() { + const lineHeight = this._editor.getOption( + 136 + /* EditorOption.suggestLineHeight */ + ) || this._editor.getOption( + 59 + /* EditorOption.fontInfo */ + ).lineHeight; + const borderWidth = isHighContrast(this._themeService.getColorTheme().type) ? 2 : 1; + const borderHeight = borderWidth * 2; + return { + lineHeight, + borderWidth, + borderHeight, + verticalPadding: 22, + horizontalPadding: 14 + }; + } + renderLoading() { + this._type.textContent = localize(1491, "Loading..."); + this._docs.textContent = ""; + this.domNode.classList.remove("no-docs", "no-type"); + this.layout(this.size.width, this.getLayoutInfo().lineHeight * 2); + this._onDidChangeContents.fire(this); + } + renderItem(item, explainMode) { + this._renderDisposeable.clear(); + let { detail, documentation } = item.completion; + if (explainMode) { + let md = ""; + md += `score: ${item.score[0]} +`; + md += `prefix: ${item.word ?? "(no prefix)"} +`; + md += `word: ${item.completion.filterText ? item.completion.filterText + " (filterText)" : item.textLabel} +`; + md += `distance: ${item.distance} (localityBonus-setting) +`; + md += `index: ${item.idx}, based on ${item.completion.sortText && `sortText: "${item.completion.sortText}"` || "label"} +`; + md += `commit_chars: ${item.completion.commitCharacters?.join("")} +`; + documentation = new MarkdownString().appendCodeblock("empty", md); + detail = `Provider: ${item.provider._debugDisplayName}`; + } + if (!explainMode && !canExpandCompletionItem(item)) { + this.clearContents(); + return; + } + this.domNode.classList.remove("no-docs", "no-type"); + if (detail) { + const cappedDetail = detail.length > 1e5 ? `${detail.substr(0, 1e5)}\u2026` : detail; + this._type.textContent = cappedDetail; + this._type.title = cappedDetail; + show(this._type); + this._type.classList.toggle("auto-wrap", !/\r?\n^\s+/gmi.test(cappedDetail)); + } else { + clearNode(this._type); + this._type.title = ""; + hide(this._type); + this.domNode.classList.add("no-type"); + } + clearNode(this._docs); + if (typeof documentation === "string") { + this._docs.classList.remove("markdown-docs"); + this._docs.textContent = documentation; + } else if (documentation) { + this._docs.classList.add("markdown-docs"); + clearNode(this._docs); + const renderedContents = this._markdownRendererService.render(documentation, { + context: this._editor, + asyncRenderCallback: () => { + this.layout(this._size.width, this._type.clientHeight + this._docs.clientHeight); + this._onDidChangeContents.fire(this); + } + }); + this._docs.appendChild(renderedContents.element); + this._renderDisposeable.add(renderedContents); + } + this.domNode.classList.toggle("detail-and-doc", !!detail && !!documentation); + this.domNode.style.userSelect = "text"; + this.domNode.tabIndex = -1; + this._close.onmousedown = (e) => { + e.preventDefault(); + e.stopPropagation(); + }; + this._close.onclick = (e) => { + e.preventDefault(); + e.stopPropagation(); + this._onDidClose.fire(); + }; + this._body.scrollTop = 0; + this.layout(this._size.width, this._type.clientHeight + this._docs.clientHeight); + this._onDidChangeContents.fire(this); + } + clearContents() { + this.domNode.classList.add("no-docs"); + this._type.textContent = ""; + this._docs.textContent = ""; + } + get isEmpty() { + return this.domNode.classList.contains("no-docs"); + } + get size() { + return this._size; + } + layout(width2, height) { + const newSize = new Dimension(width2, height); + if (!Dimension.equals(newSize, this._size)) { + this._size = newSize; + size(this.domNode, width2, height); + } + this._scrollbar.scanDomNode(); + } + scrollDown(much = 8) { + this._body.scrollTop += much; + } + scrollUp(much = 8) { + this._body.scrollTop -= much; + } + scrollTop() { + this._body.scrollTop = 0; + } + scrollBottom() { + this._body.scrollTop = this._body.scrollHeight; + } + pageDown() { + this.scrollDown(80); + } + pageUp() { + this.scrollUp(80); + } + focus() { + this.domNode.focus(); + } +}; +SuggestDetailsWidget = __decorate112([ + __param106(1, IThemeService), + __param106(2, IMarkdownRendererService) +], SuggestDetailsWidget); +var SuggestDetailsOverlay = class { + constructor(widget, _editor) { + this.widget = widget; + this._editor = _editor; + this.allowEditorOverflow = true; + this._disposables = new DisposableStore(); + this._added = false; + this._preferAlignAtTop = true; + this._resizable = new ResizableHTMLElement(); + this._resizable.domNode.classList.add("suggest-details-container"); + this._resizable.domNode.appendChild(widget.domNode); + this._resizable.enableSashes(false, true, true, false); + let topLeftNow; + let sizeNow; + let deltaTop = 0; + let deltaLeft = 0; + this._disposables.add(this._resizable.onDidWillResize(() => { + topLeftNow = this._topLeft; + sizeNow = this._resizable.size; + })); + this._disposables.add(this._resizable.onDidResize((e) => { + if (topLeftNow && sizeNow) { + this.widget.layout(e.dimension.width, e.dimension.height); + let updateTopLeft = false; + if (e.west) { + deltaLeft = sizeNow.width - e.dimension.width; + updateTopLeft = true; + } + if (e.north) { + deltaTop = sizeNow.height - e.dimension.height; + updateTopLeft = true; + } + if (updateTopLeft) { + this._applyTopLeft({ + top: topLeftNow.top + deltaTop, + left: topLeftNow.left + deltaLeft + }); + } + } + if (e.done) { + topLeftNow = void 0; + sizeNow = void 0; + deltaTop = 0; + deltaLeft = 0; + this._userSize = e.dimension; + } + })); + this._disposables.add(this.widget.onDidChangeContents(() => { + if (this._anchorBox) { + this._placeAtAnchor(this._anchorBox, this._userSize ?? this.widget.size, this._preferAlignAtTop); + } + })); + } + dispose() { + this._resizable.dispose(); + this._disposables.dispose(); + this.hide(); + } + getId() { + return "suggest.details"; + } + getDomNode() { + return this._resizable.domNode; + } + getPosition() { + return this._topLeft ? { preference: this._topLeft } : null; + } + show() { + if (!this._added) { + this._editor.addOverlayWidget(this); + this._added = true; + } + } + hide(sessionEnded = false) { + this._resizable.clearSashHoverState(); + if (this._added) { + this._editor.removeOverlayWidget(this); + this._added = false; + this._anchorBox = void 0; + this._topLeft = void 0; + } + if (sessionEnded) { + this._userSize = void 0; + this.widget.clearContents(); + } + } + placeAtAnchor(anchor, preferAlignAtTop) { + const anchorBox = anchor.getBoundingClientRect(); + this._anchorBox = anchorBox; + this._preferAlignAtTop = preferAlignAtTop; + this._placeAtAnchor(this._anchorBox, this._userSize ?? this.widget.size, preferAlignAtTop); + } + _placeAtAnchor(anchorBox, size2, preferAlignAtTop) { + const bodyBox = getClientArea(this.getDomNode().ownerDocument.body); + const info = this.widget.getLayoutInfo(); + const defaultMinSize = new Dimension(220, 2 * info.lineHeight); + const defaultTop = anchorBox.top; + const eastPlacement = (function() { + const width2 = bodyBox.width - (anchorBox.left + anchorBox.width + info.borderWidth + info.horizontalPadding); + const left2 = -info.borderWidth + anchorBox.left + anchorBox.width; + const maxSizeTop = new Dimension(width2, bodyBox.height - anchorBox.top - info.borderHeight - info.verticalPadding); + const maxSizeBottom = maxSizeTop.with(void 0, anchorBox.top + anchorBox.height - info.borderHeight - info.verticalPadding); + return { top: defaultTop, left: left2, fit: width2 - size2.width, maxSizeTop, maxSizeBottom, minSize: defaultMinSize.with(Math.min(width2, defaultMinSize.width)) }; + })(); + const westPlacement = (function() { + const width2 = anchorBox.left - info.borderWidth - info.horizontalPadding; + const left2 = Math.max(info.horizontalPadding, anchorBox.left - size2.width - info.borderWidth); + const maxSizeTop = new Dimension(width2, bodyBox.height - anchorBox.top - info.borderHeight - info.verticalPadding); + const maxSizeBottom = maxSizeTop.with(void 0, anchorBox.top + anchorBox.height - info.borderHeight - info.verticalPadding); + return { top: defaultTop, left: left2, fit: width2 - size2.width, maxSizeTop, maxSizeBottom, minSize: defaultMinSize.with(Math.min(width2, defaultMinSize.width)) }; + })(); + const southPacement = (function() { + const left2 = anchorBox.left; + const top2 = -info.borderWidth + anchorBox.top + anchorBox.height; + const maxSizeBottom = new Dimension(anchorBox.width - info.borderHeight, bodyBox.height - anchorBox.top - anchorBox.height - info.verticalPadding); + return { top: top2, left: left2, fit: maxSizeBottom.height - size2.height, maxSizeBottom, maxSizeTop: maxSizeBottom, minSize: defaultMinSize.with(maxSizeBottom.width) }; + })(); + const placements = [eastPlacement, westPlacement, southPacement]; + const placement = placements.find((p) => p.fit >= 0) ?? placements.sort((a, b) => b.fit - a.fit)[0]; + const bottom = anchorBox.top + anchorBox.height - info.borderHeight; + let alignAtTop; + let height = size2.height; + const maxHeight = Math.max(placement.maxSizeTop.height, placement.maxSizeBottom.height); + if (height > maxHeight) { + height = maxHeight; + } + let maxSize; + if (preferAlignAtTop) { + if (height <= placement.maxSizeTop.height) { + alignAtTop = true; + maxSize = placement.maxSizeTop; + } else { + alignAtTop = false; + maxSize = placement.maxSizeBottom; + } + } else { + if (height <= placement.maxSizeBottom.height) { + alignAtTop = false; + maxSize = placement.maxSizeBottom; + } else { + alignAtTop = true; + maxSize = placement.maxSizeTop; + } + } + let { top, left } = placement; + if (!alignAtTop && height > anchorBox.height) { + top = bottom - height; + } + const editorDomNode = this._editor.getDomNode(); + if (editorDomNode) { + const editorBoundingBox = editorDomNode.getBoundingClientRect(); + top -= editorBoundingBox.top; + left -= editorBoundingBox.left; + } + this._applyTopLeft({ left, top }); + this._resizable.enableSashes(!alignAtTop, placement === eastPlacement, alignAtTop, placement !== eastPlacement); + this._resizable.minSize = placement.minSize; + this._resizable.maxSize = maxSize; + this._resizable.layout(height, Math.min(maxSize.width, size2.width)); + this.widget.layout(this._resizable.size.width, this._resizable.size.height); + } + _applyTopLeft(topLeft) { + this._topLeft = topLeft; + this._editor.layoutOverlayWidget(this); + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/suggest/browser/suggestWidgetRenderer.js +init_dom(); +init_codicons(); +init_themables(); +init_event(); +init_filters(); +init_lifecycle(); +init_uri(); +init_languages(); + +// node_modules/monaco-editor-core/esm/vs/editor/common/services/getIconClasses.js +init_network(); +init_resources(); +init_uri(); +init_modesRegistry(); + +// node_modules/monaco-editor-core/esm/vs/platform/files/common/files.js +init_instantiation(); +var IFileService = createDecorator("fileService"); +var FileKind; +(function(FileKind2) { + FileKind2[FileKind2["FILE"] = 0] = "FILE"; + FileKind2[FileKind2["FOLDER"] = 1] = "FOLDER"; + FileKind2[FileKind2["ROOT_FOLDER"] = 2] = "ROOT_FOLDER"; +})(FileKind || (FileKind = {})); + +// node_modules/monaco-editor-core/esm/vs/editor/common/services/getIconClasses.js +init_themables(); +var fileIconDirectoryRegex = /(?:\/|^)(?:([^\/]+)\/)?([^\/]+)$/; +function getIconClasses(modelService, languageService, resource, fileKind, icon) { + if (ThemeIcon.isThemeIcon(icon)) { + return [`codicon-${icon.id}`, "predefined-file-icon"]; + } + if (URI.isUri(icon)) { + return []; + } + const classes2 = fileKind === FileKind.ROOT_FOLDER ? ["rootfolder-icon"] : fileKind === FileKind.FOLDER ? ["folder-icon"] : ["file-icon"]; + if (resource) { + let name; + if (resource.scheme === Schemas.data) { + const metadata = DataUri.parseMetaData(resource); + name = metadata.get(DataUri.META_DATA_LABEL); + } else { + const match2 = resource.path.match(fileIconDirectoryRegex); + if (match2) { + name = fileIconSelectorEscape(match2[2].toLowerCase()); + if (match2[1]) { + classes2.push(`${fileIconSelectorEscape(match2[1].toLowerCase())}-name-dir-icon`); + } + } else { + name = fileIconSelectorEscape(resource.authority.toLowerCase()); + } + } + if (fileKind === FileKind.ROOT_FOLDER) { + classes2.push(`${name}-root-name-folder-icon`); + } else if (fileKind === FileKind.FOLDER) { + classes2.push(`${name}-name-folder-icon`); + } else { + if (name) { + classes2.push(`${name}-name-file-icon`); + classes2.push(`name-file-icon`); + if (name.length <= 255) { + const dotSegments = name.split("."); + for (let i2 = 1; i2 < dotSegments.length; i2++) { + classes2.push(`${dotSegments.slice(i2).join(".")}-ext-file-icon`); + } + } + classes2.push(`ext-file-icon`); + } + const detectedLanguageId = detectLanguageId(modelService, languageService, resource); + if (detectedLanguageId) { + classes2.push(`${fileIconSelectorEscape(detectedLanguageId)}-lang-file-icon`); + } + } + } + return classes2; +} +function detectLanguageId(modelService, languageService, resource) { + if (!resource) { + return null; + } + let languageId = null; + if (resource.scheme === Schemas.data) { + const metadata = DataUri.parseMetaData(resource); + const mime = metadata.get(DataUri.META_DATA_MIME); + if (mime) { + languageId = languageService.getLanguageIdByMimeType(mime); + } + } else { + const model = modelService.getModel(resource); + if (model) { + languageId = model.getLanguageId(); + } + } + if (languageId && languageId !== PLAINTEXT_LANGUAGE_ID) { + return languageId; + } + return languageService.guessLanguageIdByFilepathOrFirstLine(resource); +} +function fileIconSelectorEscape(str) { + return str.replace(/[\s]/g, "/"); +} + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/suggest/browser/suggestWidgetRenderer.js +init_model(); +init_language(); +init_nls(); +init_themeService(); +var __decorate113 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param107 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var suggestMoreInfoIcon = registerIcon("suggest-more-info", Codicon.chevronRight, localize(1492, "Icon for more information in the suggest widget.")); +var _completionItemColor = new class ColorExtractor { + static { + this._regexRelaxed = /(#([\da-fA-F]{3}){1,2}|(rgb|hsl)a\(\s*(\d{1,3}%?\s*,\s*){3}(1|0?\.\d+)\)|(rgb|hsl)\(\s*\d{1,3}%?(\s*,\s*\d{1,3}%?){2}\s*\))/; + } + static { + this._regexStrict = new RegExp(`^${ColorExtractor._regexRelaxed.source}$`, "i"); + } + extract(item, out) { + if (item.textLabel.match(ColorExtractor._regexStrict)) { + out[0] = item.textLabel; + return true; + } + if (item.completion.detail && item.completion.detail.match(ColorExtractor._regexStrict)) { + out[0] = item.completion.detail; + return true; + } + if (item.completion.documentation) { + const value = typeof item.completion.documentation === "string" ? item.completion.documentation : item.completion.documentation.value; + const match2 = ColorExtractor._regexRelaxed.exec(value); + if (match2 && (match2.index === 0 || match2.index + match2[0].length === value.length)) { + out[0] = match2[0]; + return true; + } + } + return false; + } +}(); +var ItemRenderer = class ItemRenderer2 { + constructor(_editor, _modelService, _languageService, _themeService) { + this._editor = _editor; + this._modelService = _modelService; + this._languageService = _languageService; + this._themeService = _themeService; + this._onDidToggleDetails = new Emitter(); + this.onDidToggleDetails = this._onDidToggleDetails.event; + this.templateId = "suggestion"; + } + dispose() { + this._onDidToggleDetails.dispose(); + } + renderTemplate(container) { + const disposables = new DisposableStore(); + const root = container; + root.classList.add("show-file-icons"); + const icon = append(container, $(".icon")); + const colorspan = append(icon, $("span.colorspan")); + const text2 = append(container, $(".contents")); + const main = append(text2, $(".main")); + const iconContainer = append(main, $(".icon-label.codicon")); + const left = append(main, $("span.left")); + const right = append(main, $("span.right")); + const iconLabel = new IconLabel(left, { supportHighlights: true, supportIcons: true }); + disposables.add(iconLabel); + const parametersLabel = append(left, $("span.signature-label")); + const qualifierLabel = append(left, $("span.qualifier-label")); + const detailsLabel = append(right, $("span.details-label")); + const readMore = append(right, $("span.readMore" + ThemeIcon.asCSSSelector(suggestMoreInfoIcon))); + readMore.title = localize(1493, "Read More"); + const configureFont = () => { + const options2 = this._editor.getOptions(); + const fontInfo = options2.get( + 59 + /* EditorOption.fontInfo */ + ); + const fontFamily = fontInfo.getMassagedFontFamily(); + const fontFeatureSettings = fontInfo.fontFeatureSettings; + const fontVariationSettings = fontInfo.fontVariationSettings; + const fontSize = options2.get( + 135 + /* EditorOption.suggestFontSize */ + ) || fontInfo.fontSize; + const lineHeight = options2.get( + 136 + /* EditorOption.suggestLineHeight */ + ) || fontInfo.lineHeight; + const fontWeight = fontInfo.fontWeight; + const letterSpacing = fontInfo.letterSpacing; + const fontSizePx = `${fontSize}px`; + const lineHeightPx = `${lineHeight}px`; + const letterSpacingPx = `${letterSpacing}px`; + root.style.fontSize = fontSizePx; + root.style.fontWeight = fontWeight; + root.style.letterSpacing = letterSpacingPx; + main.style.fontFamily = fontFamily; + main.style.fontFeatureSettings = fontFeatureSettings; + main.style.fontVariationSettings = fontVariationSettings; + main.style.lineHeight = lineHeightPx; + icon.style.height = lineHeightPx; + icon.style.width = lineHeightPx; + readMore.style.height = lineHeightPx; + readMore.style.width = lineHeightPx; + }; + return { root, left, right, icon, colorspan, iconLabel, iconContainer, parametersLabel, qualifierLabel, detailsLabel, readMore, disposables, configureFont }; + } + renderElement(element, index, data) { + data.configureFont(); + const { completion } = element; + data.colorspan.style.backgroundColor = ""; + const labelOptions = { + labelEscapeNewLines: true, + matches: createMatches(element.score) + }; + const color = []; + if (completion.kind === 19 && _completionItemColor.extract(element, color)) { + data.icon.className = "icon customcolor"; + data.iconContainer.className = "icon hide"; + data.colorspan.style.backgroundColor = color[0]; + } else if (completion.kind === 20 && this._themeService.getFileIconTheme().hasFileIcons) { + data.icon.className = "icon hide"; + data.iconContainer.className = "icon hide"; + const labelClasses = getIconClasses(this._modelService, this._languageService, URI.from({ scheme: "fake", path: element.textLabel }), FileKind.FILE); + const detailClasses = getIconClasses(this._modelService, this._languageService, URI.from({ scheme: "fake", path: completion.detail }), FileKind.FILE); + labelOptions.extraClasses = labelClasses.length > detailClasses.length ? labelClasses : detailClasses; + } else if (completion.kind === 23 && this._themeService.getFileIconTheme().hasFolderIcons) { + data.icon.className = "icon hide"; + data.iconContainer.className = "icon hide"; + labelOptions.extraClasses = [ + getIconClasses(this._modelService, this._languageService, URI.from({ scheme: "fake", path: element.textLabel }), FileKind.FOLDER), + getIconClasses(this._modelService, this._languageService, URI.from({ scheme: "fake", path: completion.detail }), FileKind.FOLDER) + ].flat(); + } else { + data.icon.className = "icon hide"; + data.iconContainer.className = ""; + data.iconContainer.classList.add("suggest-icon", ...ThemeIcon.asClassNameArray(CompletionItemKinds.toIcon(completion.kind))); + } + if (completion.tags && completion.tags.indexOf( + 1 + /* CompletionItemTag.Deprecated */ + ) >= 0) { + labelOptions.extraClasses = (labelOptions.extraClasses || []).concat(["deprecated"]); + labelOptions.matches = []; + } + data.iconLabel.setLabel(element.textLabel, void 0, labelOptions); + if (typeof completion.label === "string") { + data.parametersLabel.textContent = ""; + data.detailsLabel.textContent = stripNewLines(completion.detail || ""); + data.root.classList.add("string-label"); + } else { + data.parametersLabel.textContent = stripNewLines(completion.label.detail || ""); + data.detailsLabel.textContent = stripNewLines(completion.label.description || ""); + data.root.classList.remove("string-label"); + } + if (this._editor.getOption( + 134 + /* EditorOption.suggest */ + ).showInlineDetails) { + show(data.detailsLabel); + } else { + hide(data.detailsLabel); + } + if (canExpandCompletionItem(element)) { + data.right.classList.add("can-expand-details"); + show(data.readMore); + data.readMore.onmousedown = (e) => { + e.stopPropagation(); + e.preventDefault(); + }; + data.readMore.onclick = (e) => { + e.stopPropagation(); + e.preventDefault(); + this._onDidToggleDetails.fire(); + }; + } else { + data.right.classList.remove("can-expand-details"); + hide(data.readMore); + data.readMore.onmousedown = null; + data.readMore.onclick = null; + } + } + disposeTemplate(templateData) { + templateData.disposables.dispose(); + } +}; +ItemRenderer = __decorate113([ + __param107(1, IModelService), + __param107(2, ILanguageService), + __param107(3, IThemeService) +], ItemRenderer); +function stripNewLines(str) { + return str.replace(/\r\n|\r|\n/g, ""); +} + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/suggest/browser/suggestWidget.js +init_languages(); +init_platform(); +var __decorate114 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param108 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var SuggestWidget_1; +registerColor("editorSuggestWidget.background", editorWidgetBackground, localize(1473, "Background color of the suggest widget.")); +registerColor("editorSuggestWidget.border", editorWidgetBorder, localize(1474, "Border color of the suggest widget.")); +var editorSuggestWidgetForeground = registerColor("editorSuggestWidget.foreground", editorForeground, localize(1475, "Foreground color of the suggest widget.")); +registerColor("editorSuggestWidget.selectedForeground", quickInputListFocusForeground, localize(1476, "Foreground color of the selected entry in the suggest widget.")); +registerColor("editorSuggestWidget.selectedIconForeground", quickInputListFocusIconForeground, localize(1477, "Icon foreground color of the selected entry in the suggest widget.")); +var editorSuggestWidgetSelectedBackground = registerColor("editorSuggestWidget.selectedBackground", quickInputListFocusBackground, localize(1478, "Background color of the selected entry in the suggest widget.")); +registerColor("editorSuggestWidget.highlightForeground", listHighlightForeground, localize(1479, "Color of the match highlights in the suggest widget.")); +registerColor("editorSuggestWidget.focusHighlightForeground", listFocusHighlightForeground, localize(1480, "Color of the match highlights in the suggest widget when an item is focused.")); +registerColor("editorSuggestWidgetStatus.foreground", transparent(editorSuggestWidgetForeground, 0.5), localize(1481, "Foreground color of the suggest widget status.")); +var PersistedWidgetSize = class { + constructor(_service, editor2) { + this._service = _service; + this._key = `suggestWidget.size/${editor2.getEditorType()}/${editor2 instanceof EmbeddedCodeEditorWidget}`; + } + restore() { + const raw = this._service.get( + this._key, + 0 + /* StorageScope.PROFILE */ + ) ?? ""; + try { + const obj = JSON.parse(raw); + if (Dimension.is(obj)) { + return Dimension.lift(obj); + } + } catch { + } + return void 0; + } + store(size2) { + this._service.store( + this._key, + JSON.stringify(size2), + 0, + 1 + /* StorageTarget.MACHINE */ + ); + } + reset() { + this._service.remove( + this._key, + 0 + /* StorageScope.PROFILE */ + ); + } +}; +var SuggestWidget = class SuggestWidget2 { + static { + SuggestWidget_1 = this; + } + static { + this.LOADING_MESSAGE = localize(1482, "Loading..."); + } + static { + this.NO_SUGGESTIONS_MESSAGE = localize(1483, "No suggestions."); + } + constructor(editor2, _storageService, _contextKeyService, _themeService, instantiationService) { + this.editor = editor2; + this._storageService = _storageService; + this._state = 0; + this._isAuto = false; + this._pendingLayout = new MutableDisposable(); + this._pendingShowDetails = new MutableDisposable(); + this._ignoreFocusEvents = false; + this._forceRenderingAbove = false; + this._explainMode = false; + this._showTimeout = new TimeoutTimer(); + this._disposables = new DisposableStore(); + this._onDidSelect = new PauseableEmitter(); + this._onDidFocus = new PauseableEmitter(); + this._onDidHide = new Emitter(); + this._onDidShow = new Emitter(); + this.onDidSelect = this._onDidSelect.event; + this.onDidFocus = this._onDidFocus.event; + this.onDidHide = this._onDidHide.event; + this.onDidShow = this._onDidShow.event; + this._onDetailsKeydown = new Emitter(); + this.onDetailsKeyDown = this._onDetailsKeydown.event; + this.element = new ResizableHTMLElement(); + this.element.domNode.classList.add("editor-widget", "suggest-widget"); + this._contentWidget = new SuggestContentWidget(this, editor2); + this._persistedSize = new PersistedWidgetSize(_storageService, editor2); + class ResizeState { + constructor(persistedSize, currentSize, persistHeight = false, persistWidth = false) { + this.persistedSize = persistedSize; + this.currentSize = currentSize; + this.persistHeight = persistHeight; + this.persistWidth = persistWidth; + } + } + let state; + this._disposables.add(this.element.onDidWillResize(() => { + this._contentWidget.lockPreference(); + state = new ResizeState(this._persistedSize.restore(), this.element.size); + })); + this._disposables.add(this.element.onDidResize((e) => { + this._resize(e.dimension.width, e.dimension.height); + if (state) { + state.persistHeight = state.persistHeight || !!e.north || !!e.south; + state.persistWidth = state.persistWidth || !!e.east || !!e.west; + } + if (!e.done) { + return; + } + if (state) { + const { itemHeight, defaultSize } = this.getLayoutInfo(); + const threshold = Math.round(itemHeight / 2); + let { width: width2, height } = this.element.size; + if (!state.persistHeight || Math.abs(state.currentSize.height - height) <= threshold) { + height = state.persistedSize?.height ?? defaultSize.height; + } + if (!state.persistWidth || Math.abs(state.currentSize.width - width2) <= threshold) { + width2 = state.persistedSize?.width ?? defaultSize.width; + } + this._persistedSize.store(new Dimension(width2, height)); + } + this._contentWidget.unlockPreference(); + state = void 0; + })); + this._messageElement = append(this.element.domNode, $(".message")); + this._listElement = append(this.element.domNode, $(".tree")); + const details = this._disposables.add(instantiationService.createInstance(SuggestDetailsWidget, this.editor)); + details.onDidClose(() => this.toggleDetails(), this, this._disposables); + this._details = new SuggestDetailsOverlay(details, this.editor); + const applyIconStyle = () => this.element.domNode.classList.toggle("no-icons", !this.editor.getOption( + 134 + /* EditorOption.suggest */ + ).showIcons); + applyIconStyle(); + const renderer = instantiationService.createInstance(ItemRenderer, this.editor); + this._disposables.add(renderer); + this._disposables.add(renderer.onDidToggleDetails(() => this.toggleDetails())); + this._list = new List("SuggestWidget", this._listElement, { + getHeight: (_element) => this.getLayoutInfo().itemHeight, + getTemplateId: (_element) => "suggestion" + }, [renderer], { + alwaysConsumeMouseWheel: true, + useShadows: false, + mouseSupport: false, + multipleSelectionSupport: false, + accessibilityProvider: { + getRole: () => isWindows ? "listitem" : "option", + getWidgetAriaLabel: () => localize(1484, "Suggest"), + getWidgetRole: () => "listbox", + getAriaLabel: (item) => { + let label = item.textLabel; + const kindLabel = CompletionItemKinds.toLabel(item.completion.kind); + if (typeof item.completion.label !== "string") { + const { detail: detail2, description } = item.completion.label; + if (detail2 && description) { + label = localize(1485, "{0} {1}, {2}, {3}", label, detail2, description, kindLabel); + } else if (detail2) { + label = localize(1486, "{0} {1}, {2}", label, detail2, kindLabel); + } else if (description) { + label = localize(1487, "{0}, {1}, {2}", label, description, kindLabel); + } + } else { + label = localize(1488, "{0}, {1}", label, kindLabel); + } + if (!item.isResolved || !this._isDetailsVisible()) { + return label; + } + const { documentation, detail } = item.completion; + const docs = format("{0}{1}", detail || "", documentation ? typeof documentation === "string" ? documentation : documentation.value : ""); + return localize(1489, "{0}, docs: {1}", label, docs); + } + } + }); + this._list.style(getListStyles({ + listInactiveFocusBackground: editorSuggestWidgetSelectedBackground, + listInactiveFocusOutline: activeContrastBorder + })); + this._status = instantiationService.createInstance(SuggestWidgetStatus, this.element.domNode, suggestWidgetStatusbarMenu); + const applyStatusBarStyle = () => this.element.domNode.classList.toggle("with-status-bar", this.editor.getOption( + 134 + /* EditorOption.suggest */ + ).showStatusBar); + applyStatusBarStyle(); + this._disposables.add(this._list.onMouseDown((e) => this._onListMouseDownOrTap(e))); + this._disposables.add(this._list.onTap((e) => this._onListMouseDownOrTap(e))); + this._disposables.add(this._list.onDidChangeSelection((e) => this._onListSelection(e))); + this._disposables.add(this._list.onDidChangeFocus((e) => this._onListFocus(e))); + this._disposables.add(this.editor.onDidChangeCursorSelection(() => this._onCursorSelectionChanged())); + this._disposables.add(this.editor.onDidChangeConfiguration((e) => { + if (e.hasChanged( + 134 + /* EditorOption.suggest */ + )) { + applyStatusBarStyle(); + applyIconStyle(); + } + if (this._completionModel && (e.hasChanged( + 59 + /* EditorOption.fontInfo */ + ) || e.hasChanged( + 135 + /* EditorOption.suggestFontSize */ + ) || e.hasChanged( + 136 + /* EditorOption.suggestLineHeight */ + ))) { + this._list.splice(0, this._list.length, this._completionModel.items); + } + })); + this._ctxSuggestWidgetVisible = Context.Visible.bindTo(_contextKeyService); + this._ctxSuggestWidgetDetailsVisible = Context.DetailsVisible.bindTo(_contextKeyService); + this._ctxSuggestWidgetMultipleSuggestions = Context.MultipleSuggestions.bindTo(_contextKeyService); + this._ctxSuggestWidgetHasFocusedSuggestion = Context.HasFocusedSuggestion.bindTo(_contextKeyService); + this._disposables.add(addStandardDisposableListener(this._details.widget.domNode, "keydown", (e) => { + this._onDetailsKeydown.fire(e); + })); + this._disposables.add(this.editor.onMouseDown((e) => this._onEditorMouseDown(e))); + } + dispose() { + this._details.widget.dispose(); + this._details.dispose(); + this._list.dispose(); + this._status.dispose(); + this._disposables.dispose(); + this._loadingTimeout?.dispose(); + this._pendingLayout.dispose(); + this._pendingShowDetails.dispose(); + this._showTimeout.dispose(); + this._contentWidget.dispose(); + this.element.dispose(); + } + _onEditorMouseDown(mouseEvent) { + if (this._details.widget.domNode.contains(mouseEvent.target.element)) { + this._details.widget.domNode.focus(); + } else { + if (this.element.domNode.contains(mouseEvent.target.element)) { + this.editor.focus(); + } + } + } + _onCursorSelectionChanged() { + if (this._state !== 0) { + this._contentWidget.layout(); + } + } + _onListMouseDownOrTap(e) { + if (typeof e.element === "undefined" || typeof e.index === "undefined") { + return; + } + e.browserEvent.preventDefault(); + e.browserEvent.stopPropagation(); + this._select(e.element, e.index); + } + _onListSelection(e) { + if (e.elements.length) { + this._select(e.elements[0], e.indexes[0]); + } + } + _select(item, index) { + const completionModel = this._completionModel; + if (completionModel) { + this._onDidSelect.fire({ item, index, model: completionModel }); + this.editor.focus(); + } + } + _onListFocus(e) { + if (this._ignoreFocusEvents) { + return; + } + if (this._state === 5) { + this._setState( + 3 + /* State.Open */ + ); + } + if (!e.elements.length) { + if (this._currentSuggestionDetails) { + this._currentSuggestionDetails.cancel(); + this._currentSuggestionDetails = void 0; + this._focusedItem = void 0; + } + this.editor.setAriaOptions({ activeDescendant: void 0 }); + this._ctxSuggestWidgetHasFocusedSuggestion.set(false); + return; + } + if (!this._completionModel) { + return; + } + this._ctxSuggestWidgetHasFocusedSuggestion.set(true); + const item = e.elements[0]; + const index = e.indexes[0]; + if (item !== this._focusedItem) { + this._currentSuggestionDetails?.cancel(); + this._currentSuggestionDetails = void 0; + this._focusedItem = item; + this._list.reveal(index); + this._currentSuggestionDetails = createCancelablePromise(async (token) => { + const loading = disposableTimeout(() => { + if (this._isDetailsVisible()) { + this._showDetails(true, false); + } + }, 250); + const sub = token.onCancellationRequested(() => loading.dispose()); + try { + return await item.resolve(token); + } finally { + loading.dispose(); + sub.dispose(); + } + }); + this._currentSuggestionDetails.then(() => { + if (index >= this._list.length || item !== this._list.element(index)) { + return; + } + this._ignoreFocusEvents = true; + this._list.splice(index, 1, [item]); + this._list.setFocus([index]); + this._ignoreFocusEvents = false; + if (this._isDetailsVisible()) { + this._showDetails(false, false); + } else { + this.element.domNode.classList.remove("docs-side"); + } + this.editor.setAriaOptions({ activeDescendant: this._list.getElementID(index) }); + }).catch(onUnexpectedError); + } + this._onDidFocus.fire({ item, index, model: this._completionModel }); + } + _setState(state) { + if (this._state === state) { + return; + } + this._state = state; + this.element.domNode.classList.toggle( + "frozen", + state === 4 + /* State.Frozen */ + ); + this.element.domNode.classList.remove("message"); + switch (state) { + case 0: + hide(this._messageElement, this._listElement, this._status.element); + this._details.hide(true); + this._status.hide(); + this._contentWidget.hide(); + this._ctxSuggestWidgetVisible.reset(); + this._ctxSuggestWidgetMultipleSuggestions.reset(); + this._ctxSuggestWidgetHasFocusedSuggestion.reset(); + this._showTimeout.cancel(); + this.element.domNode.classList.remove("visible"); + this._list.splice(0, this._list.length); + this._focusedItem = void 0; + this._cappedHeight = void 0; + this._explainMode = false; + break; + case 1: + this.element.domNode.classList.add("message"); + this._messageElement.textContent = SuggestWidget_1.LOADING_MESSAGE; + hide(this._listElement, this._status.element); + show(this._messageElement); + this._details.hide(); + this._show(); + this._focusedItem = void 0; + status(SuggestWidget_1.LOADING_MESSAGE); + break; + case 2: + this.element.domNode.classList.add("message"); + this._messageElement.textContent = SuggestWidget_1.NO_SUGGESTIONS_MESSAGE; + hide(this._listElement, this._status.element); + show(this._messageElement); + this._details.hide(); + this._show(); + this._focusedItem = void 0; + status(SuggestWidget_1.NO_SUGGESTIONS_MESSAGE); + break; + case 3: + hide(this._messageElement); + show(this._listElement, this._status.element); + this._show(); + break; + case 4: + hide(this._messageElement); + show(this._listElement, this._status.element); + this._show(); + break; + case 5: + hide(this._messageElement); + show(this._listElement, this._status.element); + this._details.show(); + this._show(); + this._details.widget.focus(); + break; + } + } + _show() { + this._status.show(); + this._contentWidget.show(); + this._layout(this._persistedSize.restore()); + this._ctxSuggestWidgetVisible.set(true); + this._showTimeout.cancelAndSet(() => { + this.element.domNode.classList.add("visible"); + this._onDidShow.fire(this); + }, 100); + } + showTriggered(auto, delay) { + if (this._state !== 0) { + return; + } + this._contentWidget.setPosition(this.editor.getPosition()); + this._isAuto = !!auto; + if (!this._isAuto) { + this._loadingTimeout = disposableTimeout(() => this._setState( + 1 + /* State.Loading */ + ), delay); + } + } + showSuggestions(completionModel, selectionIndex, isFrozen2, isAuto, noFocus) { + this._contentWidget.setPosition(this.editor.getPosition()); + this._loadingTimeout?.dispose(); + this._currentSuggestionDetails?.cancel(); + this._currentSuggestionDetails = void 0; + if (this._completionModel !== completionModel) { + this._completionModel = completionModel; + } + if (isFrozen2 && this._state !== 2 && this._state !== 0) { + this._setState( + 4 + /* State.Frozen */ + ); + return; + } + const visibleCount = this._completionModel.items.length; + const isEmpty = visibleCount === 0; + this._ctxSuggestWidgetMultipleSuggestions.set(visibleCount > 1); + if (isEmpty) { + this._setState( + isAuto ? 0 : 2 + /* State.Empty */ + ); + this._completionModel = void 0; + return; + } + this._focusedItem = void 0; + this._onDidFocus.pause(); + this._onDidSelect.pause(); + try { + this._list.splice(0, this._list.length, this._completionModel.items); + this._setState( + isFrozen2 ? 4 : 3 + /* State.Open */ + ); + this._list.reveal(selectionIndex, 0, selectionIndex === 0 ? 0 : this.getLayoutInfo().itemHeight * 0.33); + this._list.setFocus(noFocus ? [] : [selectionIndex]); + } finally { + this._onDidFocus.resume(); + this._onDidSelect.resume(); + } + this._pendingLayout.value = runAtThisOrScheduleAtNextAnimationFrame(getWindow(this.element.domNode), () => { + this._pendingLayout.clear(); + this._layout(this.element.size); + this._details.widget.domNode.classList.remove("focused"); + }); + } + focusSelected() { + if (this._list.length > 0) { + this._list.setFocus([0]); + } + } + selectNextPage() { + switch (this._state) { + case 0: + return false; + case 5: + this._details.widget.pageDown(); + return true; + case 1: + return !this._isAuto; + default: + this._list.focusNextPage(); + return true; + } + } + selectNext() { + switch (this._state) { + case 0: + return false; + case 1: + return !this._isAuto; + default: + this._list.focusNext(1, true); + return true; + } + } + selectLast() { + switch (this._state) { + case 0: + return false; + case 5: + this._details.widget.scrollBottom(); + return true; + case 1: + return !this._isAuto; + default: + this._list.focusLast(); + return true; + } + } + selectPreviousPage() { + switch (this._state) { + case 0: + return false; + case 5: + this._details.widget.pageUp(); + return true; + case 1: + return !this._isAuto; + default: + this._list.focusPreviousPage(); + return true; + } + } + selectPrevious() { + switch (this._state) { + case 0: + return false; + case 1: + return !this._isAuto; + default: + this._list.focusPrevious(1, true); + return false; + } + } + selectFirst() { + switch (this._state) { + case 0: + return false; + case 5: + this._details.widget.scrollTop(); + return true; + case 1: + return !this._isAuto; + default: + this._list.focusFirst(); + return true; + } + } + getFocusedItem() { + if (this._state !== 0 && this._state !== 2 && this._state !== 1 && this._completionModel && this._list.getFocus().length > 0) { + return { + item: this._list.getFocusedElements()[0], + index: this._list.getFocus()[0], + model: this._completionModel + }; + } + return void 0; + } + toggleDetailsFocus() { + if (this._state === 5) { + this._list.setFocus(this._list.getFocus()); + this._setState( + 3 + /* State.Open */ + ); + } else if (this._state === 3) { + this._setState( + 5 + /* State.Details */ + ); + if (!this._isDetailsVisible()) { + this.toggleDetails(true); + } else { + this._details.widget.focus(); + } + } + } + toggleDetails(focused = false) { + if (this._isDetailsVisible()) { + this._pendingShowDetails.clear(); + this._ctxSuggestWidgetDetailsVisible.set(false); + this._setDetailsVisible(false); + this._details.hide(); + this.element.domNode.classList.remove("shows-details"); + } else if ((canExpandCompletionItem(this._list.getFocusedElements()[0]) || this._explainMode) && (this._state === 3 || this._state === 5 || this._state === 4)) { + this._ctxSuggestWidgetDetailsVisible.set(true); + this._setDetailsVisible(true); + this._showDetails(false, focused); + } + } + _showDetails(loading, focused) { + this._pendingShowDetails.value = runAtThisOrScheduleAtNextAnimationFrame(getWindow(this.element.domNode), () => { + this._pendingShowDetails.clear(); + this._details.show(); + let didFocusDetails = false; + if (loading) { + this._details.widget.renderLoading(); + } else { + this._details.widget.renderItem(this._list.getFocusedElements()[0], this._explainMode); + } + if (!this._details.widget.isEmpty) { + this._positionDetails(); + this.element.domNode.classList.add("shows-details"); + if (focused) { + this._details.widget.focus(); + didFocusDetails = true; + } + } else { + this._details.hide(); + } + if (!didFocusDetails) { + this.editor.focus(); + } + }); + } + toggleExplainMode() { + if (this._list.getFocusedElements()[0]) { + this._explainMode = !this._explainMode; + if (!this._isDetailsVisible()) { + this.toggleDetails(); + } else { + this._showDetails(false, false); + } + } + } + resetPersistedSize() { + this._persistedSize.reset(); + } + hideWidget() { + this._pendingLayout.clear(); + this._pendingShowDetails.clear(); + this._loadingTimeout?.dispose(); + this._setState( + 0 + /* State.Hidden */ + ); + this._onDidHide.fire(this); + this.element.clearSashHoverState(); + const dim = this._persistedSize.restore(); + const minPersistedHeight = Math.ceil(this.getLayoutInfo().itemHeight * 4.3); + if (dim && dim.height < minPersistedHeight) { + this._persistedSize.store(dim.with(void 0, minPersistedHeight)); + } + } + isFrozen() { + return this._state === 4; + } + _afterRender(position) { + if (position === null) { + if (this._isDetailsVisible()) { + this._details.hide(); + } + return; + } + if (this._state === 2 || this._state === 1) { + return; + } + if (this._isDetailsVisible() && !this._details.widget.isEmpty) { + this._details.show(); + } + this._positionDetails(); + } + _layout(size2) { + if (!this.editor.hasModel()) { + return; + } + if (!this.editor.getDomNode()) { + return; + } + const bodyBox = getClientArea(this.element.domNode.ownerDocument.body); + const info = this.getLayoutInfo(); + if (!size2) { + size2 = info.defaultSize; + } + let height = size2.height; + let width2 = size2.width; + this._status.element.style.height = `${info.itemHeight}px`; + if (this._state === 2 || this._state === 1) { + height = info.itemHeight + info.borderHeight; + width2 = info.defaultSize.width / 2; + this.element.enableSashes(false, false, false, false); + this.element.minSize = this.element.maxSize = new Dimension(width2, height); + this._contentWidget.setPreference( + 2 + /* ContentWidgetPositionPreference.BELOW */ + ); + } else { + const maxWidth = bodyBox.width - info.borderHeight - 2 * info.horizontalPadding; + if (width2 > maxWidth) { + width2 = maxWidth; + } + const preferredWidth = this._completionModel ? this._completionModel.stats.pLabelLen * info.typicalHalfwidthCharacterWidth : width2; + const fullHeight = info.statusBarHeight + this._list.contentHeight + info.borderHeight; + const minHeight = info.itemHeight + info.statusBarHeight; + const editorBox = getDomNodePagePosition(this.editor.getDomNode()); + const cursorBox = this.editor.getScrolledVisiblePosition(this.editor.getPosition()); + const cursorBottom = editorBox.top + cursorBox.top + cursorBox.height; + const maxHeightBelow = Math.min(bodyBox.height - cursorBottom - info.verticalPadding, fullHeight); + const availableSpaceAbove = editorBox.top + cursorBox.top - info.verticalPadding; + const maxHeightAbove = Math.min(availableSpaceAbove, fullHeight); + let maxHeight = Math.min(Math.max(maxHeightAbove, maxHeightBelow) + info.borderHeight, fullHeight); + if (height === this._cappedHeight?.capped) { + height = this._cappedHeight.wanted; + } + if (height < minHeight) { + height = minHeight; + } + if (height > maxHeight) { + height = maxHeight; + } + const forceRenderingAboveRequiredSpace = 150; + if (height > maxHeightBelow && maxHeightAbove > maxHeightBelow || this._forceRenderingAbove && availableSpaceAbove > forceRenderingAboveRequiredSpace) { + this._contentWidget.setPreference( + 1 + /* ContentWidgetPositionPreference.ABOVE */ + ); + this.element.enableSashes(true, true, false, false); + maxHeight = maxHeightAbove; + } else { + this._contentWidget.setPreference( + 2 + /* ContentWidgetPositionPreference.BELOW */ + ); + this.element.enableSashes(false, true, true, false); + maxHeight = maxHeightBelow; + } + this.element.preferredSize = new Dimension(preferredWidth, info.defaultSize.height); + this.element.maxSize = new Dimension(maxWidth, maxHeight); + this.element.minSize = new Dimension(220, minHeight); + this._cappedHeight = height === fullHeight ? { wanted: this._cappedHeight?.wanted ?? size2.height, capped: height } : void 0; + } + this._resize(width2, height); + } + _resize(width2, height) { + const { width: maxWidth, height: maxHeight } = this.element.maxSize; + width2 = Math.min(maxWidth, width2); + height = Math.min(maxHeight, height); + const { statusBarHeight } = this.getLayoutInfo(); + this._list.layout(height - statusBarHeight, width2); + this._listElement.style.height = `${height - statusBarHeight}px`; + this.element.layout(height, width2); + this._contentWidget.layout(); + this._positionDetails(); + } + _positionDetails() { + if (this._isDetailsVisible()) { + this._details.placeAtAnchor( + this.element.domNode, + this._contentWidget.getPosition()?.preference[0] === 2 + /* ContentWidgetPositionPreference.BELOW */ + ); + } + } + getLayoutInfo() { + const fontInfo = this.editor.getOption( + 59 + /* EditorOption.fontInfo */ + ); + const itemHeight = clamp(this.editor.getOption( + 136 + /* EditorOption.suggestLineHeight */ + ) || fontInfo.lineHeight, 8, 1e3); + const statusBarHeight = !this.editor.getOption( + 134 + /* EditorOption.suggest */ + ).showStatusBar || this._state === 2 || this._state === 1 ? 0 : itemHeight; + const borderWidth = this._details.widget.getLayoutInfo().borderWidth; + const borderHeight = 2 * borderWidth; + return { + itemHeight, + statusBarHeight, + borderWidth, + borderHeight, + typicalHalfwidthCharacterWidth: fontInfo.typicalHalfwidthCharacterWidth, + verticalPadding: 22, + horizontalPadding: 14, + defaultSize: new Dimension(430, statusBarHeight + 12 * itemHeight) + }; + } + _isDetailsVisible() { + return this._storageService.getBoolean("expandSuggestionDocs", 0, false); + } + _setDetailsVisible(value) { + this._storageService.store( + "expandSuggestionDocs", + value, + 0, + 0 + /* StorageTarget.USER */ + ); + } + forceRenderingAbove() { + if (!this._forceRenderingAbove) { + this._forceRenderingAbove = true; + this._layout(this._persistedSize.restore()); + } + } + stopForceRenderingAbove() { + this._forceRenderingAbove = false; + } +}; +SuggestWidget = SuggestWidget_1 = __decorate114([ + __param108(1, IStorageService), + __param108(2, IContextKeyService), + __param108(3, IThemeService), + __param108(4, IInstantiationService) +], SuggestWidget); +var SuggestContentWidget = class { + constructor(_widget, _editor) { + this._widget = _widget; + this._editor = _editor; + this.allowEditorOverflow = true; + this.suppressMouseDown = false; + this._preferenceLocked = false; + this._added = false; + this._hidden = false; + } + dispose() { + if (this._added) { + this._added = false; + this._editor.removeContentWidget(this); + } + } + getId() { + return "editor.widget.suggestWidget"; + } + getDomNode() { + return this._widget.element.domNode; + } + show() { + this._hidden = false; + if (!this._added) { + this._added = true; + this._editor.addContentWidget(this); + } + } + hide() { + if (!this._hidden) { + this._hidden = true; + this.layout(); + } + } + layout() { + this._editor.layoutContentWidget(this); + } + getPosition() { + if (this._hidden || !this._position || !this._preference) { + return null; + } + return { + position: this._position, + preference: [this._preference] + }; + } + beforeRender() { + const { height, width: width2 } = this._widget.element.size; + const { borderWidth, horizontalPadding } = this._widget.getLayoutInfo(); + return new Dimension(width2 + 2 * borderWidth + horizontalPadding, height + 2 * borderWidth); + } + afterRender(position) { + this._widget._afterRender(position); + } + setPreference(preference) { + if (!this._preferenceLocked) { + this._preference = preference; + } + } + lockPreference() { + this._preferenceLocked = true; + } + unlockPreference() { + this._preferenceLocked = false; + } + setPosition(position) { + this._position = position; + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/suggest/browser/suggestController.js +init_telemetry(); +init_resources(); +init_hash(); +init_dom(); +init_textModel(); +init_textModelEditSource(); +var __decorate115 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param109 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var SuggestController_1; +var _sticky2 = false; +var LineSuffix = class { + constructor(_model, _position) { + this._model = _model; + this._position = _position; + this._decorationOptions = ModelDecorationOptions.register({ + description: "suggest-line-suffix", + stickiness: 1 + /* TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges */ + }); + const maxColumn = _model.getLineMaxColumn(_position.lineNumber); + if (maxColumn !== _position.column) { + const offset = _model.getOffsetAt(_position); + const end = _model.getPositionAt(offset + 1); + _model.changeDecorations((accessor) => { + if (this._marker) { + accessor.removeDecoration(this._marker); + } + this._marker = accessor.addDecoration(Range.fromPositions(_position, end), this._decorationOptions); + }); + } + } + dispose() { + if (this._marker && !this._model.isDisposed()) { + this._model.changeDecorations((accessor) => { + accessor.removeDecoration(this._marker); + this._marker = void 0; + }); + } + } + delta(position) { + if (this._model.isDisposed() || this._position.lineNumber !== position.lineNumber) { + return 0; + } + if (this._marker) { + const range2 = this._model.getDecorationRange(this._marker); + const end = this._model.getOffsetAt(range2.getStartPosition()); + return end - this._model.getOffsetAt(position); + } else { + return this._model.getLineMaxColumn(position.lineNumber) - position.column; + } + } +}; +var SuggestController = class SuggestController2 { + static { + SuggestController_1 = this; + } + static { + this.ID = "editor.contrib.suggestController"; + } + static get(editor2) { + return editor2.getContribution(SuggestController_1.ID); + } + get onWillInsertSuggestItem() { + return this._onWillInsertSuggestItem.event; + } + constructor(editor2, _memoryService, _commandService, _contextKeyService, _instantiationService, _logService, _telemetryService) { + this._memoryService = _memoryService; + this._commandService = _commandService; + this._contextKeyService = _contextKeyService; + this._instantiationService = _instantiationService; + this._logService = _logService; + this._telemetryService = _telemetryService; + this._lineSuffix = new MutableDisposable(); + this._toDispose = new DisposableStore(); + this._selectors = new PriorityRegistry((s) => s.priority); + this._onWillInsertSuggestItem = new Emitter(); + this._wantsForceRenderingAbove = false; + this.editor = editor2; + this.model = _instantiationService.createInstance(SuggestModel, this.editor); + this._selectors.register({ + priority: 0, + select: (model, pos, items) => this._memoryService.select(model, pos, items) + }); + const ctxInsertMode = Context.InsertMode.bindTo(_contextKeyService); + ctxInsertMode.set(editor2.getOption( + 134 + /* EditorOption.suggest */ + ).insertMode); + this._toDispose.add(this.model.onDidTrigger(() => ctxInsertMode.set(editor2.getOption( + 134 + /* EditorOption.suggest */ + ).insertMode))); + this.widget = this._toDispose.add(new WindowIdleValue(getWindow(editor2.getDomNode()), () => { + const widget = this._instantiationService.createInstance(SuggestWidget, this.editor); + this._toDispose.add(widget); + this._toDispose.add(widget.onDidSelect((item) => this._insertSuggestion( + item, + 0 + /* InsertFlags.None */ + ), this)); + const commitCharacterController = new CommitCharacterController(this.editor, widget, this.model, (item) => this._insertSuggestion( + item, + 2 + /* InsertFlags.NoAfterUndoStop */ + )); + this._toDispose.add(commitCharacterController); + const ctxMakesTextEdit = Context.MakesTextEdit.bindTo(this._contextKeyService); + const ctxHasInsertAndReplace = Context.HasInsertAndReplaceRange.bindTo(this._contextKeyService); + const ctxCanResolve = Context.CanResolve.bindTo(this._contextKeyService); + this._toDispose.add(toDisposable(() => { + ctxMakesTextEdit.reset(); + ctxHasInsertAndReplace.reset(); + ctxCanResolve.reset(); + })); + this._toDispose.add(widget.onDidFocus(({ item }) => { + const position = this.editor.getPosition(); + const startColumn = item.editStart.column; + const endColumn = position.column; + let value = true; + if (this.editor.getOption( + 1 + /* EditorOption.acceptSuggestionOnEnter */ + ) === "smart" && this.model.state === 2 && !item.completion.additionalTextEdits && !(item.completion.insertTextRules & 4) && endColumn - startColumn === item.completion.insertText.length) { + const oldText = this.editor.getModel().getValueInRange({ + startLineNumber: position.lineNumber, + startColumn, + endLineNumber: position.lineNumber, + endColumn + }); + value = oldText !== item.completion.insertText; + } + ctxMakesTextEdit.set(value); + ctxHasInsertAndReplace.set(!Position.equals(item.editInsertEnd, item.editReplaceEnd)); + ctxCanResolve.set(Boolean(item.provider.resolveCompletionItem) || Boolean(item.completion.documentation) || item.completion.detail !== item.completion.label); + })); + this._toDispose.add(widget.onDetailsKeyDown((e) => { + if (e.toKeyCodeChord().equals(new KeyCodeChord( + true, + false, + false, + false, + 33 + /* KeyCode.KeyC */ + )) || isMacintosh && e.toKeyCodeChord().equals(new KeyCodeChord( + false, + false, + false, + true, + 33 + /* KeyCode.KeyC */ + ))) { + e.stopPropagation(); + return; + } + if (!e.toKeyCodeChord().isModifierKey()) { + this.editor.focus(); + } + })); + if (this._wantsForceRenderingAbove) { + widget.forceRenderingAbove(); + } + return widget; + })); + this._overtypingCapturer = this._toDispose.add(new WindowIdleValue(getWindow(editor2.getDomNode()), () => { + return this._toDispose.add(new OvertypingCapturer(this.editor, this.model)); + })); + this._alternatives = this._toDispose.add(new WindowIdleValue(getWindow(editor2.getDomNode()), () => { + return this._toDispose.add(new SuggestAlternatives(this.editor, this._contextKeyService)); + })); + this._toDispose.add(_instantiationService.createInstance(WordContextKey, editor2)); + this._toDispose.add(this.model.onDidTrigger((e) => { + this.widget.value.showTriggered(e.auto, e.shy ? 250 : 50); + this._lineSuffix.value = new LineSuffix(this.editor.getModel(), e.position); + })); + this._toDispose.add(this.model.onDidSuggest((e) => { + if (e.triggerOptions.shy) { + return; + } + let index = -1; + for (const selector of this._selectors.itemsOrderedByPriorityDesc) { + index = selector.select(this.editor.getModel(), this.editor.getPosition(), e.completionModel.items); + if (index !== -1) { + break; + } + } + if (index === -1) { + index = 0; + } + if (this.model.state === 0) { + return; + } + let noFocus = false; + if (e.triggerOptions.auto) { + const options2 = this.editor.getOption( + 134 + /* EditorOption.suggest */ + ); + if (options2.selectionMode === "never" || options2.selectionMode === "always") { + noFocus = options2.selectionMode === "never"; + } else if (options2.selectionMode === "whenTriggerCharacter") { + noFocus = e.triggerOptions.triggerKind !== 1; + } else if (options2.selectionMode === "whenQuickSuggestion") { + noFocus = e.triggerOptions.triggerKind === 1 && !e.triggerOptions.refilter; + } + } + this.widget.value.showSuggestions(e.completionModel, index, e.isFrozen, e.triggerOptions.auto, noFocus); + })); + this._toDispose.add(this.model.onDidCancel((e) => { + if (!e.retrigger) { + this.widget.value.hideWidget(); + } + })); + this._toDispose.add(this.editor.onDidBlurEditorWidget(() => { + if (!_sticky2) { + this.model.cancel(); + this.model.clear(); + } + })); + const acceptSuggestionsOnEnter = Context.AcceptSuggestionsOnEnter.bindTo(_contextKeyService); + const updateFromConfig = () => { + const acceptSuggestionOnEnter = this.editor.getOption( + 1 + /* EditorOption.acceptSuggestionOnEnter */ + ); + acceptSuggestionsOnEnter.set(acceptSuggestionOnEnter === "on" || acceptSuggestionOnEnter === "smart"); + }; + this._toDispose.add(this.editor.onDidChangeConfiguration(() => updateFromConfig())); + updateFromConfig(); + } + dispose() { + this._alternatives.dispose(); + this._toDispose.dispose(); + this.widget.dispose(); + this.model.dispose(); + this._lineSuffix.dispose(); + this._onWillInsertSuggestItem.dispose(); + } + _insertSuggestion(event, flags) { + if (!event || !event.item) { + this._alternatives.value.reset(); + this.model.cancel(); + this.model.clear(); + return; + } + if (!this.editor.hasModel()) { + return; + } + const snippetController = SnippetController2.get(this.editor); + if (!snippetController) { + return; + } + this._onWillInsertSuggestItem.fire({ item: event.item }); + const model = this.editor.getModel(); + const modelVersionNow = model.getAlternativeVersionId(); + const { item } = event; + const tasks = []; + const cts = new CancellationTokenSource(); + if (!(flags & 1)) { + this.editor.pushUndoStop(); + } + const info = this.getOverwriteInfo(item, Boolean( + flags & 8 + /* InsertFlags.AlternativeOverwriteConfig */ + )); + this._memoryService.memorize(model, this.editor.getPosition(), item); + const isResolved = item.isResolved; + let _commandExectionDuration = -1; + let _additionalEditsAppliedAsync = -1; + if (Array.isArray(item.completion.additionalTextEdits)) { + this.model.cancel(); + const scrollState = StableEditorScrollState.capture(this.editor); + this.editor.executeEdits("suggestController.additionalTextEdits.sync", item.completion.additionalTextEdits.map((edit2) => { + let range2 = Range.lift(edit2.range); + if (range2.startLineNumber === item.position.lineNumber && range2.startColumn > item.position.column) { + const columnDelta = this.editor.getPosition().column - item.position.column; + const startColumnDelta = columnDelta; + const endColumnDelta = Range.spansMultipleLines(range2) ? 0 : columnDelta; + range2 = new Range(range2.startLineNumber, range2.startColumn + startColumnDelta, range2.endLineNumber, range2.endColumn + endColumnDelta); + } + return EditOperation.replaceMove(range2, edit2.text); + })); + scrollState.restoreRelativeVerticalPositionOfCursor(this.editor); + } else if (!isResolved) { + const sw = new StopWatch(); + let position; + const docListener = model.onDidChangeContent((e) => { + if (e.isFlush) { + cts.cancel(); + docListener.dispose(); + return; + } + for (const change of e.changes) { + const thisPosition = Range.getEndPosition(change.range); + if (!position || Position.isBefore(thisPosition, position)) { + position = thisPosition; + } + } + }); + const oldFlags = flags; + flags |= 2; + let didType = false; + const typeListener = this.editor.onWillType(() => { + typeListener.dispose(); + didType = true; + if (!(oldFlags & 2)) { + this.editor.pushUndoStop(); + } + }); + tasks.push(item.resolve(cts.token).then(() => { + if (!item.completion.additionalTextEdits || cts.token.isCancellationRequested) { + return void 0; + } + if (position && item.completion.additionalTextEdits.some((edit2) => Position.isBefore(position, Range.getStartPosition(edit2.range)))) { + return false; + } + if (didType) { + this.editor.pushUndoStop(); + } + const scrollState = StableEditorScrollState.capture(this.editor); + this.editor.executeEdits("suggestController.additionalTextEdits.async", item.completion.additionalTextEdits.map((edit2) => EditOperation.replaceMove(Range.lift(edit2.range), edit2.text))); + scrollState.restoreRelativeVerticalPositionOfCursor(this.editor); + if (didType || !(oldFlags & 2)) { + this.editor.pushUndoStop(); + } + return true; + }).then((applied) => { + this._logService.trace("[suggest] async resolving of edits DONE (ms, applied?)", sw.elapsed(), applied); + _additionalEditsAppliedAsync = applied === true ? 1 : applied === false ? 0 : -2; + }).finally(() => { + docListener.dispose(); + typeListener.dispose(); + })); + } + let { insertText } = item.completion; + if (!(item.completion.insertTextRules & 4)) { + insertText = SnippetParser.escape(insertText); + } + this.model.cancel(); + snippetController.insert(insertText, { + overwriteBefore: info.overwriteBefore, + overwriteAfter: info.overwriteAfter, + undoStopBefore: false, + undoStopAfter: false, + adjustWhitespace: !(item.completion.insertTextRules & 1), + clipboardText: event.model.clipboardText, + overtypingCapturer: this._overtypingCapturer.value, + reason: EditSources.suggest({ providerId: ProviderId.fromExtensionId(item.extensionId?.value) }) + }); + if (!(flags & 2)) { + this.editor.pushUndoStop(); + } + if (item.completion.command) { + if (item.completion.command.id === TriggerSuggestAction.id) { + this.model.trigger({ auto: true, retrigger: true }); + } else { + const sw = new StopWatch(); + tasks.push(this._commandService.executeCommand(item.completion.command.id, ...item.completion.command.arguments ? [...item.completion.command.arguments] : []).catch((e) => { + if (item.completion.extensionId) { + onUnexpectedExternalError(e); + } else { + onUnexpectedError(e); + } + }).finally(() => { + _commandExectionDuration = sw.elapsed(); + })); + } + } + if (flags & 4) { + this._alternatives.value.set(event, (next) => { + cts.cancel(); + while (model.canUndo()) { + if (modelVersionNow !== model.getAlternativeVersionId()) { + model.undo(); + } + this._insertSuggestion(next, 1 | 2 | (flags & 8 ? 8 : 0)); + break; + } + }); + } + this._alertCompletionItem(item); + Promise.all(tasks).finally(() => { + this._reportSuggestionAcceptedTelemetry(item, model, isResolved, _commandExectionDuration, _additionalEditsAppliedAsync, event.index, event.model.items); + this.model.clear(); + cts.dispose(); + }); + } + _reportSuggestionAcceptedTelemetry(item, model, itemResolved, commandExectionDuration, additionalEditsAppliedAsync, index, completionItems) { + if (Math.random() > 1e-4) { + return; + } + const labelMap = /* @__PURE__ */ new Map(); + for (let i2 = 0; i2 < Math.min(30, completionItems.length); i2++) { + const label = completionItems[i2].textLabel; + if (labelMap.has(label)) { + labelMap.get(label).push(i2); + } else { + labelMap.set(label, [i2]); + } + } + const firstIndexArray = labelMap.get(item.textLabel); + const hasDuplicates = firstIndexArray && firstIndexArray.length > 1; + const firstIndex = hasDuplicates ? firstIndexArray[0] : -1; + this._telemetryService.publicLog2("suggest.acceptedSuggestion", { + extensionId: item.extensionId?.value ?? "unknown", + providerId: item.provider._debugDisplayName ?? "unknown", + kind: item.completion.kind, + basenameHash: hash(basename2(model.uri)).toString(16), + languageId: model.getLanguageId(), + fileExtension: extname2(model.uri), + resolveInfo: !item.provider.resolveCompletionItem ? -1 : itemResolved ? 1 : 0, + resolveDuration: item.resolveDuration, + commandDuration: commandExectionDuration, + additionalEditsAsync: additionalEditsAppliedAsync, + index, + firstIndex + }); + } + getOverwriteInfo(item, toggleMode) { + assertType(this.editor.hasModel()); + let replace = this.editor.getOption( + 134 + /* EditorOption.suggest */ + ).insertMode === "replace"; + if (toggleMode) { + replace = !replace; + } + const overwriteBefore = item.position.column - item.editStart.column; + const overwriteAfter = (replace ? item.editReplaceEnd.column : item.editInsertEnd.column) - item.position.column; + const columnDelta = this.editor.getPosition().column - item.position.column; + const suffixDelta = this._lineSuffix.value ? this._lineSuffix.value.delta(this.editor.getPosition()) : 0; + return { + overwriteBefore: overwriteBefore + columnDelta, + overwriteAfter: overwriteAfter + suffixDelta + }; + } + _alertCompletionItem(item) { + if (isNonEmptyArray(item.completion.additionalTextEdits)) { + const msg = localize(1463, "Accepting '{0}' made {1} additional edits", item.textLabel, item.completion.additionalTextEdits.length); + alert(msg); + } + } + triggerSuggest(onlyFrom, auto, noFilter) { + if (this.editor.hasModel()) { + this.model.trigger({ + auto: auto ?? false, + completionOptions: { providerFilter: onlyFrom, kindFilter: noFilter ? /* @__PURE__ */ new Set() : void 0 } + }); + this.editor.revealPosition( + this.editor.getPosition(), + 0 + /* ScrollType.Smooth */ + ); + this.editor.focus(); + } + } + triggerSuggestAndAcceptBest(arg) { + if (!this.editor.hasModel()) { + return; + } + const positionNow = this.editor.getPosition(); + const fallback2 = () => { + if (positionNow.equals(this.editor.getPosition())) { + this._commandService.executeCommand(arg.fallback); + } + }; + const makesTextEdit = (item) => { + if (item.completion.insertTextRules & 4 || item.completion.additionalTextEdits) { + return true; + } + const position = this.editor.getPosition(); + const startColumn = item.editStart.column; + const endColumn = position.column; + if (endColumn - startColumn !== item.completion.insertText.length) { + return true; + } + const textNow = this.editor.getModel().getValueInRange({ + startLineNumber: position.lineNumber, + startColumn, + endLineNumber: position.lineNumber, + endColumn + }); + return textNow !== item.completion.insertText; + }; + Event.once(this.model.onDidTrigger)((_) => { + const listener = []; + Event.any(this.model.onDidTrigger, this.model.onDidCancel)(() => { + dispose(listener); + fallback2(); + }, void 0, listener); + this.model.onDidSuggest(({ completionModel }) => { + dispose(listener); + if (completionModel.items.length === 0) { + fallback2(); + return; + } + const index = this._memoryService.select(this.editor.getModel(), this.editor.getPosition(), completionModel.items); + const item = completionModel.items[index]; + if (!makesTextEdit(item)) { + fallback2(); + return; + } + this.editor.pushUndoStop(); + this._insertSuggestion( + { index, item, model: completionModel }, + 4 | 1 | 2 + /* InsertFlags.NoAfterUndoStop */ + ); + }, void 0, listener); + }); + this.model.trigger({ auto: false, shy: true }); + this.editor.revealPosition( + positionNow, + 0 + /* ScrollType.Smooth */ + ); + this.editor.focus(); + } + acceptSelectedSuggestion(keepAlternativeSuggestions, alternativeOverwriteConfig) { + const item = this.widget.value.getFocusedItem(); + let flags = 0; + if (keepAlternativeSuggestions) { + flags |= 4; + } + if (alternativeOverwriteConfig) { + flags |= 8; + } + this._insertSuggestion(item, flags); + } + acceptNextSuggestion() { + this._alternatives.value.next(); + } + acceptPrevSuggestion() { + this._alternatives.value.prev(); + } + cancelSuggestWidget() { + this.model.cancel(); + this.model.clear(); + this.widget.value.hideWidget(); + } + focusSuggestion() { + this.widget.value.focusSelected(); + } + selectNextSuggestion() { + this.widget.value.selectNext(); + } + selectNextPageSuggestion() { + this.widget.value.selectNextPage(); + } + selectLastSuggestion() { + this.widget.value.selectLast(); + } + selectPrevSuggestion() { + this.widget.value.selectPrevious(); + } + selectPrevPageSuggestion() { + this.widget.value.selectPreviousPage(); + } + selectFirstSuggestion() { + this.widget.value.selectFirst(); + } + toggleSuggestionDetails() { + this.widget.value.toggleDetails(); + } + toggleExplainMode() { + this.widget.value.toggleExplainMode(); + } + toggleSuggestionFocus() { + this.widget.value.toggleDetailsFocus(); + } + resetWidgetSize() { + this.widget.value.resetPersistedSize(); + } + forceRenderingAbove() { + if (this.widget.isInitialized) { + this.widget.value.forceRenderingAbove(); + } else { + this._wantsForceRenderingAbove = true; + } + } + stopForceRenderingAbove() { + if (this.widget.isInitialized) { + this.widget.value.stopForceRenderingAbove(); + } else { + this._wantsForceRenderingAbove = false; + } + } + registerSelector(selector) { + return this._selectors.register(selector); + } +}; +SuggestController = SuggestController_1 = __decorate115([ + __param109(1, ISuggestMemoryService), + __param109(2, ICommandService), + __param109(3, IContextKeyService), + __param109(4, IInstantiationService), + __param109(5, ILogService), + __param109(6, ITelemetryService) +], SuggestController); +var PriorityRegistry = class { + constructor(prioritySelector) { + this.prioritySelector = prioritySelector; + this._items = new Array(); + } + register(value) { + if (this._items.indexOf(value) !== -1) { + throw new Error("Value is already registered"); + } + this._items.push(value); + this._items.sort((s1, s2) => this.prioritySelector(s2) - this.prioritySelector(s1)); + return { + dispose: () => { + const idx = this._items.indexOf(value); + if (idx >= 0) { + this._items.splice(idx, 1); + } + } + }; + } + get itemsOrderedByPriorityDesc() { + return this._items; + } +}; +var TriggerSuggestAction = class _TriggerSuggestAction extends EditorAction { + static { + this.id = "editor.action.triggerSuggest"; + } + constructor() { + super({ + id: _TriggerSuggestAction.id, + label: localize2(1471, "Trigger Suggest"), + precondition: ContextKeyExpr.and(EditorContextKeys.writable, EditorContextKeys.hasCompletionItemProvider, Context.Visible.toNegated()), + kbOpts: { + kbExpr: EditorContextKeys.textInputFocus, + primary: 2048 | 10, + secondary: [ + 2048 | 39 + /* KeyCode.KeyI */ + ], + mac: { primary: 256 | 10, secondary: [ + 512 | 9, + 2048 | 39 + /* KeyCode.KeyI */ + ] }, + weight: 100 + /* KeybindingWeight.EditorContrib */ + } + }); + } + run(_accessor, editor2, args) { + const controller = SuggestController.get(editor2); + if (!controller) { + return; + } + let auto; + if (args && typeof args === "object") { + if (args.auto === true) { + auto = true; + } + } + controller.triggerSuggest(void 0, auto, void 0); + } +}; +registerEditorContribution( + SuggestController.ID, + SuggestController, + 2 + /* EditorContributionInstantiation.BeforeFirstInteraction */ +); +registerEditorAction(TriggerSuggestAction); +var weight2 = 100 + 90; +var SuggestCommand = EditorCommand.bindToContribution(SuggestController.get); +registerEditorCommand(new SuggestCommand({ + id: "acceptSelectedSuggestion", + precondition: ContextKeyExpr.and(Context.Visible, Context.HasFocusedSuggestion), + handler(x) { + x.acceptSelectedSuggestion(true, false); + }, + kbOpts: [{ + // normal tab + primary: 2, + kbExpr: ContextKeyExpr.and(Context.Visible, EditorContextKeys.textInputFocus), + weight: weight2 + }, { + // accept on enter has special rules + primary: 3, + kbExpr: ContextKeyExpr.and(Context.Visible, EditorContextKeys.textInputFocus, Context.AcceptSuggestionsOnEnter, Context.MakesTextEdit), + weight: weight2 + }], + menuOpts: [{ + menuId: suggestWidgetStatusbarMenu, + title: localize(1464, "Insert"), + group: "left", + order: 1, + when: Context.HasInsertAndReplaceRange.toNegated() + }, { + menuId: suggestWidgetStatusbarMenu, + title: localize(1465, "Insert"), + group: "left", + order: 1, + when: ContextKeyExpr.and(Context.HasInsertAndReplaceRange, Context.InsertMode.isEqualTo("insert")) + }, { + menuId: suggestWidgetStatusbarMenu, + title: localize(1466, "Replace"), + group: "left", + order: 1, + when: ContextKeyExpr.and(Context.HasInsertAndReplaceRange, Context.InsertMode.isEqualTo("replace")) + }] +})); +registerEditorCommand(new SuggestCommand({ + id: "acceptAlternativeSelectedSuggestion", + precondition: ContextKeyExpr.and(Context.Visible, EditorContextKeys.textInputFocus, Context.HasFocusedSuggestion), + kbOpts: { + weight: weight2, + kbExpr: EditorContextKeys.textInputFocus, + primary: 1024 | 3, + secondary: [ + 1024 | 2 + /* KeyCode.Tab */ + ] + }, + handler(x) { + x.acceptSelectedSuggestion(false, true); + }, + menuOpts: [{ + menuId: suggestWidgetStatusbarMenu, + group: "left", + order: 2, + when: ContextKeyExpr.and(Context.HasInsertAndReplaceRange, Context.InsertMode.isEqualTo("insert")), + title: localize(1467, "Replace") + }, { + menuId: suggestWidgetStatusbarMenu, + group: "left", + order: 2, + when: ContextKeyExpr.and(Context.HasInsertAndReplaceRange, Context.InsertMode.isEqualTo("replace")), + title: localize(1468, "Insert") + }] +})); +CommandsRegistry.registerCommandAlias("acceptSelectedSuggestionOnEnter", "acceptSelectedSuggestion"); +registerEditorCommand(new SuggestCommand({ + id: "hideSuggestWidget", + precondition: Context.Visible, + handler: (x) => x.cancelSuggestWidget(), + kbOpts: { + weight: weight2, + kbExpr: EditorContextKeys.textInputFocus, + primary: 9, + secondary: [ + 1024 | 9 + /* KeyCode.Escape */ + ] + } +})); +registerEditorCommand(new SuggestCommand({ + id: "selectNextSuggestion", + precondition: ContextKeyExpr.and(Context.Visible, ContextKeyExpr.or(Context.MultipleSuggestions, Context.HasFocusedSuggestion.negate())), + handler: (c) => c.selectNextSuggestion(), + kbOpts: { + weight: weight2, + kbExpr: EditorContextKeys.textInputFocus, + primary: 18, + secondary: [ + 2048 | 18 + /* KeyCode.DownArrow */ + ], + mac: { primary: 18, secondary: [ + 2048 | 18, + 256 | 44 + /* KeyCode.KeyN */ + ] } + } +})); +registerEditorCommand(new SuggestCommand({ + id: "selectNextPageSuggestion", + precondition: ContextKeyExpr.and(Context.Visible, ContextKeyExpr.or(Context.MultipleSuggestions, Context.HasFocusedSuggestion.negate())), + handler: (c) => c.selectNextPageSuggestion(), + kbOpts: { + weight: weight2, + kbExpr: EditorContextKeys.textInputFocus, + primary: 12, + secondary: [ + 2048 | 12 + /* KeyCode.PageDown */ + ] + } +})); +registerEditorCommand(new SuggestCommand({ + id: "selectLastSuggestion", + precondition: ContextKeyExpr.and(Context.Visible, ContextKeyExpr.or(Context.MultipleSuggestions, Context.HasFocusedSuggestion.negate())), + handler: (c) => c.selectLastSuggestion() +})); +registerEditorCommand(new SuggestCommand({ + id: "selectPrevSuggestion", + precondition: ContextKeyExpr.and(Context.Visible, ContextKeyExpr.or(Context.MultipleSuggestions, Context.HasFocusedSuggestion.negate())), + handler: (c) => c.selectPrevSuggestion(), + kbOpts: { + weight: weight2, + kbExpr: EditorContextKeys.textInputFocus, + primary: 16, + secondary: [ + 2048 | 16 + /* KeyCode.UpArrow */ + ], + mac: { primary: 16, secondary: [ + 2048 | 16, + 256 | 46 + /* KeyCode.KeyP */ + ] } + } +})); +registerEditorCommand(new SuggestCommand({ + id: "selectPrevPageSuggestion", + precondition: ContextKeyExpr.and(Context.Visible, ContextKeyExpr.or(Context.MultipleSuggestions, Context.HasFocusedSuggestion.negate())), + handler: (c) => c.selectPrevPageSuggestion(), + kbOpts: { + weight: weight2, + kbExpr: EditorContextKeys.textInputFocus, + primary: 11, + secondary: [ + 2048 | 11 + /* KeyCode.PageUp */ + ] + } +})); +registerEditorCommand(new SuggestCommand({ + id: "selectFirstSuggestion", + precondition: ContextKeyExpr.and(Context.Visible, ContextKeyExpr.or(Context.MultipleSuggestions, Context.HasFocusedSuggestion.negate())), + handler: (c) => c.selectFirstSuggestion() +})); +registerEditorCommand(new SuggestCommand({ + id: "focusSuggestion", + precondition: ContextKeyExpr.and(Context.Visible, Context.HasFocusedSuggestion.negate()), + handler: (x) => x.focusSuggestion(), + kbOpts: { + weight: weight2, + kbExpr: EditorContextKeys.textInputFocus, + primary: 2048 | 10, + secondary: [ + 2048 | 39 + /* KeyCode.KeyI */ + ], + mac: { primary: 256 | 10, secondary: [ + 2048 | 39 + /* KeyCode.KeyI */ + ] } + } +})); +registerEditorCommand(new SuggestCommand({ + id: "focusAndAcceptSuggestion", + precondition: ContextKeyExpr.and(Context.Visible, Context.HasFocusedSuggestion.negate()), + handler: (c) => { + c.focusSuggestion(); + c.acceptSelectedSuggestion(true, false); + } +})); +registerEditorCommand(new SuggestCommand({ + id: "toggleSuggestionDetails", + precondition: ContextKeyExpr.and(Context.Visible, Context.HasFocusedSuggestion), + handler: (x) => x.toggleSuggestionDetails(), + kbOpts: { + weight: weight2, + kbExpr: EditorContextKeys.textInputFocus, + primary: 2048 | 10, + secondary: [ + 2048 | 39 + /* KeyCode.KeyI */ + ], + mac: { primary: 256 | 10, secondary: [ + 2048 | 39 + /* KeyCode.KeyI */ + ] } + }, + menuOpts: [{ + menuId: suggestWidgetStatusbarMenu, + group: "right", + order: 1, + when: ContextKeyExpr.and(Context.DetailsVisible, Context.CanResolve), + title: localize(1469, "Show Less") + }, { + menuId: suggestWidgetStatusbarMenu, + group: "right", + order: 1, + when: ContextKeyExpr.and(Context.DetailsVisible.toNegated(), Context.CanResolve), + title: localize(1470, "Show More") + }] +})); +registerEditorCommand(new SuggestCommand({ + id: "toggleExplainMode", + precondition: Context.Visible, + handler: (x) => x.toggleExplainMode(), + kbOpts: { + weight: 100, + primary: 2048 | 90 + } +})); +registerEditorCommand(new SuggestCommand({ + id: "toggleSuggestionFocus", + precondition: Context.Visible, + handler: (x) => x.toggleSuggestionFocus(), + kbOpts: { + weight: weight2, + kbExpr: EditorContextKeys.textInputFocus, + primary: 2048 | 512 | 10, + mac: { + primary: 256 | 512 | 10 + /* KeyCode.Space */ + } + } +})); +registerEditorCommand(new SuggestCommand({ + id: "insertBestCompletion", + precondition: ContextKeyExpr.and(EditorContextKeys.textInputFocus, ContextKeyExpr.equals("config.editor.tabCompletion", "on"), WordContextKey.AtEnd, Context.Visible.toNegated(), SuggestAlternatives.OtherSuggestions.toNegated(), SnippetController2.InSnippetMode.toNegated()), + handler: (x, arg) => { + x.triggerSuggestAndAcceptBest(isObject(arg) ? { fallback: "tab", ...arg } : { fallback: "tab" }); + }, + kbOpts: { + weight: weight2, + primary: 2 + /* KeyCode.Tab */ + } +})); +registerEditorCommand(new SuggestCommand({ + id: "insertNextSuggestion", + precondition: ContextKeyExpr.and(EditorContextKeys.textInputFocus, ContextKeyExpr.equals("config.editor.tabCompletion", "on"), SuggestAlternatives.OtherSuggestions, Context.Visible.toNegated(), SnippetController2.InSnippetMode.toNegated()), + handler: (x) => x.acceptNextSuggestion(), + kbOpts: { + weight: weight2, + kbExpr: EditorContextKeys.textInputFocus, + primary: 2 + /* KeyCode.Tab */ + } +})); +registerEditorCommand(new SuggestCommand({ + id: "insertPrevSuggestion", + precondition: ContextKeyExpr.and(EditorContextKeys.textInputFocus, ContextKeyExpr.equals("config.editor.tabCompletion", "on"), SuggestAlternatives.OtherSuggestions, Context.Visible.toNegated(), SnippetController2.InSnippetMode.toNegated()), + handler: (x) => x.acceptPrevSuggestion(), + kbOpts: { + weight: weight2, + kbExpr: EditorContextKeys.textInputFocus, + primary: 1024 | 2 + /* KeyCode.Tab */ + } +})); +registerEditorAction(class extends EditorAction { + constructor() { + super({ + id: "editor.action.resetSuggestSize", + label: localize2(1472, "Reset Suggest Widget Size"), + precondition: void 0 + }); + } + run(_accessor, editor2) { + SuggestController.get(editor2)?.resetWidgetSize(); + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/inlineCompletions/browser/model/suggestWidgetAdapter.js +init_observable(); +var SuggestWidgetAdaptor = class extends Disposable { + get selectedItem() { + return this._currentSuggestItemInfo; + } + constructor(editor2, suggestControllerPreselector, onWillAccept) { + super(); + this.editor = editor2; + this.suggestControllerPreselector = suggestControllerPreselector; + this.onWillAccept = onWillAccept; + this.isSuggestWidgetVisible = false; + this.isShiftKeyPressed = false; + this._isActive = false; + this._currentSuggestItemInfo = void 0; + this._onDidSelectedItemChange = this._register(new Emitter()); + this.onDidSelectedItemChange = this._onDidSelectedItemChange.event; + this._register(editor2.onKeyDown((e) => { + if (e.shiftKey && !this.isShiftKeyPressed) { + this.isShiftKeyPressed = true; + this.update(this._isActive); + } + })); + this._register(editor2.onKeyUp((e) => { + if (e.shiftKey && this.isShiftKeyPressed) { + this.isShiftKeyPressed = false; + this.update(this._isActive); + } + })); + const suggestController = SuggestController.get(this.editor); + if (suggestController) { + this._register(suggestController.registerSelector({ + priority: 100, + select: (model, pos, suggestItems) => { + const textModel = this.editor.getModel(); + if (!textModel) { + return -1; + } + const i2 = this.suggestControllerPreselector(); + const itemToPreselect = i2 ? singleTextRemoveCommonPrefix(i2, textModel) : void 0; + if (!itemToPreselect) { + return -1; + } + const position = Position.lift(pos); + const candidates = suggestItems.map((suggestItem, index) => { + const suggestItemInfo = SuggestItemInfo.fromSuggestion(suggestController, textModel, position, suggestItem, this.isShiftKeyPressed); + const suggestItemTextEdit = singleTextRemoveCommonPrefix(suggestItemInfo.getSingleTextEdit(), textModel); + const valid = singleTextEditAugments(itemToPreselect, suggestItemTextEdit); + return { index, valid, prefixLength: suggestItemTextEdit.text.length, suggestItem }; + }).filter((item) => item && item.valid && item.prefixLength > 0); + const result = findFirstMax(candidates, compareBy((s) => s.prefixLength, numberComparator)); + return result ? result.index : -1; + } + })); + let isBoundToSuggestWidget = false; + const bindToSuggestWidget = () => { + if (isBoundToSuggestWidget) { + return; + } + isBoundToSuggestWidget = true; + this._register(suggestController.widget.value.onDidShow(() => { + this.isSuggestWidgetVisible = true; + this.update(true); + })); + this._register(suggestController.widget.value.onDidHide(() => { + this.isSuggestWidgetVisible = false; + this.update(false); + })); + this._register(suggestController.widget.value.onDidFocus(() => { + this.isSuggestWidgetVisible = true; + this.update(true); + })); + }; + this._register(Event.once(suggestController.model.onDidTrigger)((e) => { + bindToSuggestWidget(); + })); + this._register(suggestController.onWillInsertSuggestItem((e) => { + const position = this.editor.getPosition(); + const model = this.editor.getModel(); + if (!position || !model) { + return void 0; + } + const suggestItemInfo = SuggestItemInfo.fromSuggestion(suggestController, model, position, e.item, this.isShiftKeyPressed); + this.onWillAccept(suggestItemInfo); + })); + } + this.update(this._isActive); + } + update(newActive) { + const newInlineCompletion = this.getSuggestItemInfo(); + if (this._isActive !== newActive || !suggestItemInfoEquals(this._currentSuggestItemInfo, newInlineCompletion)) { + this._isActive = newActive; + this._currentSuggestItemInfo = newInlineCompletion; + this._onDidSelectedItemChange.fire(); + } + } + getSuggestItemInfo() { + const suggestController = SuggestController.get(this.editor); + if (!suggestController || !this.isSuggestWidgetVisible) { + return void 0; + } + const focusedItem = suggestController.widget.value.getFocusedItem(); + const position = this.editor.getPosition(); + const model = this.editor.getModel(); + if (!focusedItem || !position || !model) { + return void 0; + } + return SuggestItemInfo.fromSuggestion(suggestController, model, position, focusedItem.item, this.isShiftKeyPressed); + } + stopForceRenderingAbove() { + const suggestController = SuggestController.get(this.editor); + suggestController?.stopForceRenderingAbove(); + } + forceRenderingAbove() { + const suggestController = SuggestController.get(this.editor); + suggestController?.forceRenderingAbove(); + } +}; +var SuggestItemInfo = class _SuggestItemInfo { + static fromSuggestion(suggestController, model, position, item, toggleMode) { + let { insertText } = item.completion; + let isSnippetText = false; + if (item.completion.insertTextRules & 4) { + const snippet = new SnippetParser().parse(insertText); + if (snippet.children.length < 100) { + SnippetSession.adjustWhitespace(model, position, true, snippet); + } + insertText = snippet.toString(); + isSnippetText = true; + } + const info = suggestController.getOverwriteInfo(item, toggleMode); + return new _SuggestItemInfo(Range.fromPositions(position.delta(0, -info.overwriteBefore), position.delta(0, Math.max(info.overwriteAfter, 0))), insertText, item.completion.kind, isSnippetText, item.container.incomplete ?? false); + } + constructor(range2, insertText, completionItemKind, isSnippetText, listIncomplete) { + this.range = range2; + this.insertText = insertText; + this.completionItemKind = completionItemKind; + this.isSnippetText = isSnippetText; + this.listIncomplete = listIncomplete; + } + equals(other) { + return this.range.equalsRange(other.range) && this.insertText === other.insertText && this.completionItemKind === other.completionItemKind && this.isSnippetText === other.isSnippetText; + } + toSelectedSuggestionInfo() { + return new SelectedSuggestionInfo(this.range, this.insertText, this.completionItemKind, this.isSnippetText); + } + getSingleTextEdit() { + return new TextReplacement(this.range, this.insertText); + } +}; +function suggestItemInfoEquals(a, b) { + if (a === b) { + return true; + } + if (!a || !b) { + return false; + } + return a.equals(b); +} +var ObservableSuggestWidgetAdapter = class extends Disposable { + constructor(_editorObs, _handleSuggestAccepted, _suggestControllerPreselector) { + super(); + this._editorObs = _editorObs; + this._handleSuggestAccepted = _handleSuggestAccepted; + this._suggestControllerPreselector = _suggestControllerPreselector; + this._suggestWidgetAdaptor = this._register(new SuggestWidgetAdaptor(this._editorObs.editor, () => { + this._editorObs.forceUpdate(); + return this._suggestControllerPreselector(); + }, (item) => this._editorObs.forceUpdate((_tx) => { + this._handleSuggestAccepted(item); + }))); + this.selectedItem = observableFromEvent(this, (cb) => this._suggestWidgetAdaptor.onDidSelectedItemChange(() => { + this._editorObs.forceUpdate((_tx) => cb(void 0)); + }), () => this._suggestWidgetAdaptor.selectedItem); + } + stopForceRenderingAbove() { + this._suggestWidgetAdaptor.stopForceRenderingAbove(); + } + forceRenderingAbove() { + this._suggestWidgetAdaptor.forceRenderingAbove(); + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineCompletionsView.js +init_lifecycle(); +init_observable(); +init_instantiation(); +init_observableCodeEditor(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/inlineCompletions/browser/view/ghostText/ghostTextView.js +init_iconLabels2(); +init_codicons(); +init_event(); +init_lifecycle(); +init_observable(); +init_strings(); +init_observableCodeEditor(); +init_position(); +init_range(); +init_stringBuilder(); +init_language(); +init_model2(); +init_lineTokens(); + +// node_modules/monaco-editor-core/esm/vs/editor/common/core/ranges/rangeSingleLine.js +var RangeSingleLine = class { + constructor(lineNumber, columnRange) { + this.lineNumber = lineNumber; + this.columnRange = columnRange; + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/common/core/ranges/columnRange.js +init_errors(); +init_offsetRange(); +init_range(); +var ColumnRange = class { + constructor(startColumn, endColumnExclusive) { + this.startColumn = startColumn; + this.endColumnExclusive = endColumnExclusive; + if (startColumn > endColumnExclusive) { + throw new BugIndicatingError(`startColumn ${startColumn} cannot be after endColumnExclusive ${endColumnExclusive}`); + } + } + toRange(lineNumber) { + return new Range(lineNumber, this.startColumn, lineNumber, this.endColumnExclusive); + } + equals(other) { + return this.startColumn === other.startColumn && this.endColumnExclusive === other.endColumnExclusive; + } + toZeroBasedOffsetRange() { + return new OffsetRange(this.startColumn - 1, this.endColumnExclusive - 1); + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/inlineCompletions/browser/view/ghostText/ghostTextView.js +init_dom(); +init_mouseEvent(); + +// node_modules/monaco-editor-core/esm/vs/editor/common/tokens/tokenWithTextArray.js +init_offsetRange(); +init_lineTokens(); +var TokenWithTextArray = class _TokenWithTextArray { + static fromLineTokens(lineTokens) { + const tokenInfo = []; + for (let i2 = 0; i2 < lineTokens.getCount(); i2++) { + tokenInfo.push(new TokenWithTextInfo(lineTokens.getTokenText(i2), lineTokens.getMetadata(i2))); + } + return _TokenWithTextArray.create(tokenInfo); + } + static create(tokenInfo) { + return new _TokenWithTextArray(tokenInfo); + } + constructor(_tokenInfo) { + this._tokenInfo = _tokenInfo; + } + toLineTokens(decoder) { + return LineTokens.createFromTextAndMetadata(this.map((_r, t) => ({ text: t.text, metadata: t.metadata })), decoder); + } + map(cb) { + const result = []; + let lengthSum = 0; + for (const tokenInfo of this._tokenInfo) { + const range2 = new OffsetRange(lengthSum, lengthSum + tokenInfo.text.length); + result.push(cb(range2, tokenInfo)); + lengthSum += tokenInfo.text.length; + } + return result; + } + slice(range2) { + const result = []; + let lengthSum = 0; + for (const tokenInfo of this._tokenInfo) { + const tokenStart = lengthSum; + const tokenEndEx = tokenStart + tokenInfo.text.length; + if (tokenEndEx > range2.start) { + if (tokenStart >= range2.endExclusive) { + break; + } + const deltaBefore = Math.max(0, range2.start - tokenStart); + const deltaAfter = Math.max(0, tokenEndEx - range2.endExclusive); + result.push(new TokenWithTextInfo(tokenInfo.text.slice(deltaBefore, tokenInfo.text.length - deltaAfter), tokenInfo.metadata)); + } + lengthSum += tokenInfo.text.length; + } + return _TokenWithTextArray.create(result); + } + append(other) { + const result = this._tokenInfo.concat(other._tokenInfo); + return _TokenWithTextArray.create(result); + } +}; +var TokenWithTextInfo = class { + constructor(text2, metadata) { + this.text = text2; + this.metadata = metadata; + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/inlineCompletions/browser/view/ghostText/ghostTextView.js +init_arrays(); +var __decorate116 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param110 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var USE_SQUIGGLES_FOR_WARNING = true; +var GHOST_TEXT_CLASS_NAME = "ghost-text"; +var GhostTextView = class GhostTextView2 extends Disposable { + static { + this.hot = createHotClass(this); + } + constructor(_editor, _model, _options, _shouldKeepCursorStable, _isClickable, _languageService) { + super(); + this._editor = _editor; + this._model = _model; + this._options = _options; + this._shouldKeepCursorStable = _shouldKeepCursorStable; + this._isClickable = _isClickable; + this._languageService = _languageService; + this._isDisposed = observableValue(this, false); + this._editorObs = observableCodeEditor(this._editor); + this._warningState = derived((reader) => { + const gt = this._model.ghostText.read(reader); + if (!gt) { + return void 0; + } + const warning = this._model.warning.read(reader); + if (!warning) { + return void 0; + } + return { lineNumber: gt.lineNumber, position: new Position(gt.lineNumber, gt.parts[0].column), icon: warning.icon }; + }); + this._onDidClick = this._register(new Emitter()); + this.onDidClick = this._onDidClick.event; + this._useSyntaxHighlighting = this._options.map((o) => o.syntaxHighlightingEnabled); + this._extraClassNames = derived(this, (reader) => { + const extraClasses = [...this._options.read(reader).extraClasses ?? []]; + if (this._useSyntaxHighlighting.read(reader)) { + extraClasses.push("syntax-highlighted"); + } + if (USE_SQUIGGLES_FOR_WARNING && this._warningState.read(reader)) { + extraClasses.push("warning"); + } + const extraClassNames = extraClasses.map((c) => ` ${c}`).join(""); + return extraClassNames; + }); + this.uiState = derived(this, (reader) => { + if (this._isDisposed.read(reader)) { + return void 0; + } + const textModel = this._editorObs.model.read(reader); + if (textModel !== this._model.targetTextModel.read(reader)) { + return void 0; + } + const ghostText = this._model.ghostText.read(reader); + if (!ghostText) { + return void 0; + } + const replacedRange = ghostText instanceof GhostTextReplacement ? ghostText.columnRange : void 0; + const syntaxHighlightingEnabled = this._useSyntaxHighlighting.read(reader); + const extraClassNames = this._extraClassNames.read(reader); + const { inlineTexts, additionalLines, hiddenRange, additionalLinesOriginalSuffix } = computeGhostTextViewData(ghostText, textModel, GHOST_TEXT_CLASS_NAME + extraClassNames); + const currentLine = textModel.getLineContent(ghostText.lineNumber); + const edit2 = new StringEdit(inlineTexts.map((t) => StringReplacement.insert(t.column - 1, t.text))); + const tokens = syntaxHighlightingEnabled ? textModel.tokenization.tokenizeLinesAt(ghostText.lineNumber, [edit2.apply(currentLine), ...additionalLines.map((l) => l.content)]) : void 0; + const newRanges = edit2.getNewRanges(); + const inlineTextsWithTokens = inlineTexts.map((t, idx) => ({ ...t, tokens: tokens?.[0]?.getTokensInRange(newRanges[idx]) })); + const tokenizedAdditionalLines = additionalLines.map((l, idx) => { + let content = tokens?.[idx + 1] ?? LineTokens.createEmpty(l.content, this._languageService.languageIdCodec); + if (idx === additionalLines.length - 1 && additionalLinesOriginalSuffix) { + const t = TokenWithTextArray.fromLineTokens(textModel.tokenization.getLineTokens(additionalLinesOriginalSuffix.lineNumber)); + const existingContent = t.slice(additionalLinesOriginalSuffix.columnRange.toZeroBasedOffsetRange()); + content = TokenWithTextArray.fromLineTokens(content).append(existingContent).toLineTokens(content.languageIdCodec); + } + return { + content, + decorations: l.decorations + }; + }); + const cursorColumn = this._editor.getSelection()?.getStartPosition().column; + const disjointInlineTexts = inlineTextsWithTokens.filter((inline3) => inline3.text !== ""); + const hasInsertionOnCurrentLine = disjointInlineTexts.length !== 0; + const renderData = { + cursorColumnDistance: (hasInsertionOnCurrentLine ? disjointInlineTexts[0].column : 1) - cursorColumn, + cursorLineDistance: hasInsertionOnCurrentLine ? 0 : additionalLines.findIndex((line) => line.content !== "") + 1, + lineCountOriginal: hasInsertionOnCurrentLine ? 1 : 0, + lineCountModified: additionalLines.length + (hasInsertionOnCurrentLine ? 1 : 0), + characterCountOriginal: 0, + characterCountModified: sum(disjointInlineTexts.map((inline3) => inline3.text.length)) + sum(tokenizedAdditionalLines.map((line) => line.content.getTextLength())), + disjointReplacements: disjointInlineTexts.length + (additionalLines.length > 0 ? 1 : 0), + sameShapeReplacements: disjointInlineTexts.length > 1 && tokenizedAdditionalLines.length === 0 ? disjointInlineTexts.every((inline3) => inline3.text === disjointInlineTexts[0].text) : void 0 + }; + this._model.handleInlineCompletionShown.read(reader)?.(renderData); + return { + replacedRange, + inlineTexts: inlineTextsWithTokens, + additionalLines: tokenizedAdditionalLines, + hiddenRange, + lineNumber: ghostText.lineNumber, + additionalReservedLineCount: this._model.minReservedLineCount.read(reader), + targetTextModel: textModel, + syntaxHighlightingEnabled + }; + }); + this.decorations = derived(this, (reader) => { + const uiState = this.uiState.read(reader); + if (!uiState) { + return []; + } + const decorations = []; + const extraClassNames = this._extraClassNames.read(reader); + if (uiState.replacedRange) { + decorations.push({ + range: uiState.replacedRange.toRange(uiState.lineNumber), + options: { inlineClassName: "inline-completion-text-to-replace" + extraClassNames, description: "GhostTextReplacement" } + }); + } + if (uiState.hiddenRange) { + decorations.push({ + range: uiState.hiddenRange.toRange(uiState.lineNumber), + options: { inlineClassName: "ghost-text-hidden", description: "ghost-text-hidden" } + }); + } + for (const p of uiState.inlineTexts) { + decorations.push({ + range: Range.fromPositions(new Position(uiState.lineNumber, p.column)), + options: { + description: "ghost-text-decoration", + after: { + content: p.text, + tokens: p.tokens, + inlineClassName: (p.preview ? "ghost-text-decoration-preview" : "ghost-text-decoration") + (this._isClickable ? " clickable" : "") + extraClassNames + p.lineDecorations.map((d) => " " + d.className).join(" "), + // TODO: take the ranges into account for line decorations + cursorStops: InjectedTextCursorStops.Left, + attachedData: new GhostTextAttachedData(this) + }, + showIfCollapsed: true + } + }); + } + return decorations; + }); + this._additionalLinesWidget = this._register(new AdditionalLinesWidget(this._editor, derived((reader) => { + const uiState = this.uiState.read(reader); + return uiState ? { + lineNumber: uiState.lineNumber, + additionalLines: uiState.additionalLines, + minReservedLineCount: uiState.additionalReservedLineCount, + targetTextModel: uiState.targetTextModel + } : void 0; + }), this._shouldKeepCursorStable, this._isClickable)); + this._isInlineTextHovered = this._editorObs.isTargetHovered((p) => p.target.type === 6 && p.target.detail.injectedText?.options.attachedData instanceof GhostTextAttachedData && p.target.detail.injectedText.options.attachedData.owner === this, this._store); + this.isHovered = derived(this, (reader) => { + if (this._isDisposed.read(reader)) { + return false; + } + return this._isInlineTextHovered.read(reader) || this._additionalLinesWidget.isHovered.read(reader); + }); + this.height = derived(this, (reader) => { + const lineHeight = this._editorObs.getOption( + 75 + /* EditorOption.lineHeight */ + ).read(reader); + return lineHeight + (this._additionalLinesWidget.viewZoneHeight.read(reader) ?? 0); + }); + this._register(toDisposable(() => { + this._isDisposed.set(true, void 0); + })); + this._register(this._editorObs.setDecorations(this.decorations)); + if (this._isClickable) { + this._register(this._additionalLinesWidget.onDidClick((e) => this._onDidClick.fire(e))); + this._register(this._editor.onMouseUp((e) => { + if (e.target.type !== 6) { + return; + } + const a = e.target.detail.injectedText?.options.attachedData; + if (a instanceof GhostTextAttachedData && a.owner === this) { + this._onDidClick.fire(e.event); + } + })); + } + this._register(autorunWithStore((reader, store) => { + if (USE_SQUIGGLES_FOR_WARNING) { + return; + } + const state = this._warningState.read(reader); + if (!state) { + return; + } + const lineHeight = this._editorObs.getOption( + 75 + /* EditorOption.lineHeight */ + ); + store.add(this._editorObs.createContentWidget({ + position: constObservable({ + position: new Position(state.lineNumber, Number.MAX_SAFE_INTEGER), + preference: [ + 0 + /* ContentWidgetPositionPreference.EXACT */ + ], + positionAffinity: 1 + }), + allowEditorOverflow: false, + domNode: n.div({ + class: "ghost-text-view-warning-widget", + style: { + width: lineHeight, + height: lineHeight, + marginLeft: 4, + color: "orange" + }, + ref: (dom) => { + dom.ghostTextViewWarningWidgetData = { range: Range.fromPositions(state.position) }; + } + }, [ + n.div({ + class: "ghost-text-view-warning-widget-icon", + style: { + width: "100%", + height: "100%", + display: "flex", + alignContent: "center", + alignItems: "center" + } + }, [ + renderIcon(state.icon && "id" in state.icon ? state.icon : Codicon.warning) + ]) + ]).keepUpdated(store).element + })); + })); + } + static getWarningWidgetContext(domNode) { + const data = domNode.ghostTextViewWarningWidgetData; + if (data) { + return data; + } else if (domNode.parentElement) { + return this.getWarningWidgetContext(domNode.parentElement); + } + return void 0; + } + ownsViewZone(viewZoneId) { + return this._additionalLinesWidget.viewZoneId === viewZoneId; + } +}; +GhostTextView = __decorate116([ + __param110(5, ILanguageService) +], GhostTextView); +var GhostTextAttachedData = class { + constructor(owner) { + this.owner = owner; + } +}; +function computeGhostTextViewData(ghostText, textModel, ghostTextClassName) { + const inlineTexts = []; + const additionalLines = []; + function addToAdditionalLines(ghLines, className2) { + if (additionalLines.length > 0) { + const lastLine = additionalLines[additionalLines.length - 1]; + if (className2) { + lastLine.decorations.push(new LineDecoration( + lastLine.content.length + 1, + lastLine.content.length + 1 + ghLines[0].line.length, + className2, + 0 + /* InlineDecorationType.Regular */ + )); + } + lastLine.content += ghLines[0].line; + ghLines = ghLines.slice(1); + } + for (const ghLine of ghLines) { + additionalLines.push({ + content: ghLine.line, + decorations: className2 ? [new LineDecoration( + 1, + ghLine.line.length + 1, + className2, + 0 + /* InlineDecorationType.Regular */ + ), ...ghLine.lineDecorations] : [...ghLine.lineDecorations] + }); + } + } + const textBufferLine = textModel.getLineContent(ghostText.lineNumber); + let hiddenTextStartColumn = void 0; + let lastIdx = 0; + for (const part of ghostText.parts) { + let ghLines = part.lines; + if (hiddenTextStartColumn === void 0) { + inlineTexts.push({ column: part.column, text: ghLines[0].line, preview: part.preview, lineDecorations: ghLines[0].lineDecorations }); + ghLines = ghLines.slice(1); + } else { + addToAdditionalLines([{ line: textBufferLine.substring(lastIdx, part.column - 1), lineDecorations: [] }], void 0); + } + if (ghLines.length > 0) { + addToAdditionalLines(ghLines, ghostTextClassName); + if (hiddenTextStartColumn === void 0 && part.column <= textBufferLine.length) { + hiddenTextStartColumn = part.column; + } + } + lastIdx = part.column - 1; + } + let additionalLinesOriginalSuffix = void 0; + if (hiddenTextStartColumn !== void 0) { + additionalLinesOriginalSuffix = new RangeSingleLine(ghostText.lineNumber, new ColumnRange(lastIdx + 1, textBufferLine.length + 1)); + } + const hiddenRange = hiddenTextStartColumn !== void 0 ? new ColumnRange(hiddenTextStartColumn, textBufferLine.length + 1) : void 0; + return { + inlineTexts, + additionalLines, + hiddenRange, + additionalLinesOriginalSuffix + }; +} +var AdditionalLinesWidget = class extends Disposable { + get viewZoneId() { + return this._viewZoneInfo?.viewZoneId; + } + get viewZoneHeight() { + return this._viewZoneHeight; + } + constructor(_editor, _lines, _shouldKeepCursorStable, _isClickable) { + super(); + this._editor = _editor; + this._lines = _lines; + this._shouldKeepCursorStable = _shouldKeepCursorStable; + this._isClickable = _isClickable; + this._viewZoneHeight = observableValue("viewZoneHeight", void 0); + this.editorOptionsChanged = observableSignalFromEvent("editorOptionChanged", Event.filter(this._editor.onDidChangeConfiguration, (e) => e.hasChanged( + 40 + /* EditorOption.disableMonospaceOptimizations */ + ) || e.hasChanged( + 133 + /* EditorOption.stopRenderingLineAfter */ + ) || e.hasChanged( + 113 + /* EditorOption.renderWhitespace */ + ) || e.hasChanged( + 108 + /* EditorOption.renderControlCharacters */ + ) || e.hasChanged( + 60 + /* EditorOption.fontLigatures */ + ) || e.hasChanged( + 59 + /* EditorOption.fontInfo */ + ) || e.hasChanged( + 75 + /* EditorOption.lineHeight */ + ))); + this._onDidClick = this._register(new Emitter()); + this.onDidClick = this._onDidClick.event; + this._viewZoneListener = this._register(new MutableDisposable()); + this.isHovered = observableCodeEditor(this._editor).isTargetHovered((p) => isTargetGhostText(p.target.element), this._store); + this.hasBeenAccepted = false; + if (this._editor instanceof CodeEditorWidget && this._shouldKeepCursorStable) { + this._register(this._editor.onBeforeExecuteEdit((e) => this.hasBeenAccepted = e.source === "inlineSuggestion.accept")); + } + this._register(autorun((reader) => { + const lines = this._lines.read(reader); + this.editorOptionsChanged.read(reader); + if (lines) { + this.hasBeenAccepted = false; + this.updateLines(lines.lineNumber, lines.additionalLines, lines.minReservedLineCount); + } else { + this.clear(); + } + })); + } + dispose() { + super.dispose(); + this.clear(); + } + clear() { + this._viewZoneListener.clear(); + this._editor.changeViewZones((changeAccessor) => { + this.removeActiveViewZone(changeAccessor); + }); + } + updateLines(lineNumber, additionalLines, minReservedLineCount) { + const textModel = this._editor.getModel(); + if (!textModel) { + return; + } + const { tabSize } = textModel.getOptions(); + this._editor.changeViewZones((changeAccessor) => { + const store = new DisposableStore(); + this.removeActiveViewZone(changeAccessor); + const heightInLines = Math.max(additionalLines.length, minReservedLineCount); + if (heightInLines > 0) { + const domNode = document.createElement("div"); + renderLines2(domNode, tabSize, additionalLines, this._editor.getOptions(), this._isClickable); + if (this._isClickable) { + store.add(addDisposableListener(domNode, "mousedown", (e) => { + e.preventDefault(); + })); + store.add(addDisposableListener(domNode, "click", (e) => { + if (isTargetGhostText(e.target)) { + this._onDidClick.fire(new StandardMouseEvent(getWindow(e), e)); + } + })); + } + this.addViewZone(changeAccessor, lineNumber, heightInLines, domNode); + } + this._viewZoneListener.value = store; + }); + } + addViewZone(changeAccessor, afterLineNumber, heightInLines, domNode) { + const id = changeAccessor.addZone({ + afterLineNumber, + heightInLines, + domNode, + afterColumnAffinity: 1, + onComputedHeight: (height) => { + this._viewZoneHeight.set(height, void 0); + } + }); + this.keepCursorStable(afterLineNumber, heightInLines); + this._viewZoneInfo = { viewZoneId: id, heightInLines, lineNumber: afterLineNumber }; + } + removeActiveViewZone(changeAccessor) { + if (this._viewZoneInfo) { + changeAccessor.removeZone(this._viewZoneInfo.viewZoneId); + if (!this.hasBeenAccepted) { + this.keepCursorStable(this._viewZoneInfo.lineNumber, -this._viewZoneInfo.heightInLines); + } + this._viewZoneInfo = void 0; + this._viewZoneHeight.set(void 0, void 0); + } + } + keepCursorStable(lineNumber, heightInLines) { + if (!this._shouldKeepCursorStable) { + return; + } + const cursorLineNumber = this._editor.getSelection()?.getStartPosition()?.lineNumber; + if (cursorLineNumber !== void 0 && lineNumber < cursorLineNumber) { + this._editor.setScrollTop(this._editor.getScrollTop() + heightInLines * this._editor.getOption( + 75 + /* EditorOption.lineHeight */ + )); + } + } +}; +function isTargetGhostText(target) { + return isHTMLElement(target) && target.classList.contains(GHOST_TEXT_CLASS_NAME); +} +function renderLines2(domNode, tabSize, lines, opts, isClickable) { + const disableMonospaceOptimizations = opts.get( + 40 + /* EditorOption.disableMonospaceOptimizations */ + ); + const stopRenderingLineAfter = opts.get( + 133 + /* EditorOption.stopRenderingLineAfter */ + ); + const renderWhitespace = "none"; + const renderControlCharacters = opts.get( + 108 + /* EditorOption.renderControlCharacters */ + ); + const fontLigatures = opts.get( + 60 + /* EditorOption.fontLigatures */ + ); + const fontInfo = opts.get( + 59 + /* EditorOption.fontInfo */ + ); + const lineHeight = opts.get( + 75 + /* EditorOption.lineHeight */ + ); + let classNames2 = "suggest-preview-text"; + if (isClickable) { + classNames2 += " clickable"; + } + const sb = new StringBuilder(1e4); + sb.appendString(`
    `); + for (let i2 = 0, len = lines.length; i2 < len; i2++) { + const lineData = lines[i2]; + const lineTokens = lineData.content; + sb.appendString('
    '); + const line = lineTokens.getLineContent(); + const isBasicASCII2 = isBasicASCII(line); + const containsRTL2 = containsRTL(line); + renderViewLine(new RenderLineInput(fontInfo.isMonospace && !disableMonospaceOptimizations, fontInfo.canUseHalfwidthRightwardsArrow, line, false, isBasicASCII2, containsRTL2, 0, lineTokens, lineData.decorations, tabSize, 0, fontInfo.spaceWidth, fontInfo.middotWidth, fontInfo.wsmiddotWidth, stopRenderingLineAfter, renderWhitespace, renderControlCharacters, fontLigatures !== EditorFontLigatures.OFF, null, null, 0), sb); + sb.appendString("
    "); + } + sb.appendString("
    "); + applyFontInfo(domNode, fontInfo); + const html3 = sb.build(); + const trustedhtml = ttPolicy4 ? ttPolicy4.createHTML(html3) : html3; + domNode.innerHTML = trustedhtml; +} +var ttPolicy4 = createTrustedTypesPolicy("editorGhostText", { createHTML: (value) => value }); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViewProducer.js +init_lifecycle(); +init_observable(); +init_instantiation(); +init_observableCodeEditor(); +init_lineRange(); +init_range(); + +// node_modules/monaco-editor-core/esm/vs/editor/common/core/edits/lineEdit.js +init_assert(); +init_strings(); +init_lineRange(); +init_position(); +init_range(); +var LineEdit = class _LineEdit { + static { + this.empty = new _LineEdit([]); + } + constructor(replacements) { + this.replacements = replacements; + assert(checkAdjacentItems(replacements, (i1, i2) => i1.lineRange.endLineNumberExclusive <= i2.lineRange.startLineNumber)); + } + toString() { + return this.replacements.map((e) => e.toString()).join(","); + } + getNewLineRanges() { + const ranges = []; + let offset = 0; + for (const e of this.replacements) { + ranges.push(LineRange.ofLength(e.lineRange.startLineNumber + offset, e.newLines.length)); + offset += e.newLines.length - e.lineRange.length; + } + return ranges; + } +}; +var LineReplacement = class _LineReplacement { + static fromSingleTextEdit(edit2, initialValue) { + const newLines = splitLines(edit2.text); + let startLineNumber = edit2.range.startLineNumber; + const survivingFirstLineText = initialValue.getValueOfRange(Range.fromPositions(new Position(edit2.range.startLineNumber, 1), edit2.range.getStartPosition())); + newLines[0] = survivingFirstLineText + newLines[0]; + let endLineNumberEx = edit2.range.endLineNumber + 1; + const editEndLineNumberMaxColumn = initialValue.getTransformer().getLineLength(edit2.range.endLineNumber) + 1; + const survivingEndLineText = initialValue.getValueOfRange(Range.fromPositions(edit2.range.getEndPosition(), new Position(edit2.range.endLineNumber, editEndLineNumberMaxColumn))); + newLines[newLines.length - 1] = newLines[newLines.length - 1] + survivingEndLineText; + const startBeforeNewLine = edit2.range.startColumn === initialValue.getTransformer().getLineLength(edit2.range.startLineNumber) + 1; + const endAfterNewLine = edit2.range.endColumn === 1; + if (startBeforeNewLine && newLines[0].length === survivingFirstLineText.length) { + startLineNumber++; + newLines.shift(); + } + if (newLines.length > 0 && startLineNumber < endLineNumberEx && endAfterNewLine && newLines[newLines.length - 1].length === survivingEndLineText.length) { + endLineNumberEx--; + newLines.pop(); + } + return new _LineReplacement(new LineRange(startLineNumber, endLineNumberEx), newLines); + } + constructor(lineRange, newLines) { + this.lineRange = lineRange; + this.newLines = newLines; + } + toString() { + return `${this.lineRange}->${JSON.stringify(this.newLines)}`; + } + toLineEdit() { + return new LineEdit([this]); + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditWithChanges.js +init_lineRange(); +var InlineEditWithChanges = class { + get lineEdit() { + if (this.edit.replacements.length === 0) { + return new LineReplacement(new LineRange(1, 1), []); + } + return LineReplacement.fromSingleTextEdit(this.edit.toReplacement(this.originalText), this.originalText); + } + get originalLineRange() { + return this.lineEdit.lineRange; + } + get modifiedLineRange() { + return this.lineEdit.toLineEdit().getNewLineRanges()[0]; + } + get displayRange() { + return this.originalText.lineRange.intersect(this.originalLineRange.join(LineRange.ofLength(this.originalLineRange.startLineNumber, this.lineEdit.newLines.length))); + } + constructor(originalText, edit2, cursorPosition, multiCursorPositions, commands, inlineCompletion) { + this.originalText = originalText; + this.edit = edit2; + this.cursorPosition = cursorPosition; + this.multiCursorPositions = multiCursorPositions; + this.commands = commands; + this.inlineCompletion = inlineCompletion; + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsModel.js +init_observable(); +init_nls(); +init_observableCodeEditor(); +var InlineEditModel = class { + constructor(_model, inlineEdit, tabAction) { + this._model = _model; + this.inlineEdit = inlineEdit; + this.tabAction = tabAction; + this.action = this.inlineEdit.inlineCompletion.action; + this.displayName = this.inlineEdit.inlineCompletion.source.provider.displayName ?? localize(1219, "Inline Edit"); + this.extensionCommands = this.inlineEdit.inlineCompletion.source.inlineSuggestions.commands ?? []; + this.isInDiffEditor = this._model.isInDiffEditor; + this.displayLocation = this.inlineEdit.inlineCompletion.hint; + this.showCollapsed = this._model.showCollapsed; + } + accept() { + this._model.accept(); + } + jump() { + this._model.jump(); + } + handleInlineEditShown(viewKind, viewData) { + this._model.handleInlineSuggestionShown(this.inlineEdit.inlineCompletion, viewKind, viewData); + } +}; +var InlineEditHost = class { + constructor(_model) { + this._model = _model; + this.onDidAccept = this._model.onDidAccept; + this.inAcceptFlow = this._model.inAcceptFlow; + } +}; +var GhostTextIndicator = class { + constructor(editor2, model, lineRange, inlineCompletion) { + this.lineRange = lineRange; + const editorObs = observableCodeEditor(editor2); + const tabAction = derived(this, (reader) => { + if (editorObs.isFocused.read(reader)) { + if (inlineCompletion.showInlineEditMenu) { + return InlineEditTabAction.Accept; + } + } + return InlineEditTabAction.Inactive; + }); + this.model = new InlineEditModel(model, new InlineEditWithChanges(new StringText(""), new TextEdit([inlineCompletion.getSingleTextEdit()]), model.primaryPosition.get(), model.allPositions.get(), inlineCompletion.source.inlineSuggestions.commands ?? [], inlineCompletion), tabAction); + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsView.js +init_dom(); +init_equals(); +init_errors(); +init_event(); +init_lifecycle(); +init_observable(); +init_instantiation(); +init_observableCodeEditor(); +init_range(); +init_lineRange(); +init_textLength(); +init_textModel(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.js +init_dom(); +init_iconLabels2(); +init_codicons(); +init_errors(); +init_lifecycle(); +init_observable(); +init_instantiation(); +init_colorUtils(); +init_themeService(); +init_point(); + +// node_modules/monaco-editor-core/esm/vs/editor/common/core/2d/rect.js +init_errors(); +init_point(); +var Rect = class _Rect { + static fromPoints(topLeft, bottomRight) { + return new _Rect(topLeft.x, topLeft.y, bottomRight.x, bottomRight.y); + } + static fromPointSize(point, size2) { + return new _Rect(point.x, point.y, point.x + size2.x, point.y + size2.y); + } + static fromLeftTopRightBottom(left, top, right, bottom) { + return new _Rect(left, top, right, bottom); + } + static fromLeftTopWidthHeight(left, top, width2, height) { + return new _Rect(left, top, left + width2, top + height); + } + static fromRanges(leftRight, topBottom) { + return new _Rect(leftRight.start, topBottom.start, leftRight.endExclusive, topBottom.endExclusive); + } + static hull(rects) { + let left = Number.MAX_SAFE_INTEGER; + let top = Number.MAX_SAFE_INTEGER; + let right = Number.MIN_SAFE_INTEGER; + let bottom = Number.MIN_SAFE_INTEGER; + for (const rect of rects) { + left = Math.min(left, rect.left); + top = Math.min(top, rect.top); + right = Math.max(right, rect.right); + bottom = Math.max(bottom, rect.bottom); + } + return new _Rect(left, top, right, bottom); + } + get width() { + return this.right - this.left; + } + get height() { + return this.bottom - this.top; + } + constructor(left, top, right, bottom) { + this.left = left; + this.top = top; + this.right = right; + this.bottom = bottom; + if (left > right) { + throw new BugIndicatingError("Invalid arguments: Horizontally offset by " + (left - right)); + } + if (top > bottom) { + throw new BugIndicatingError("Invalid arguments: Vertically offset by " + (top - bottom)); + } + } + withMargin(marginOrVerticalOrTop, rightOrHorizontal, bottom, left) { + let marginLeft, marginRight, marginTop, marginBottom; + if (rightOrHorizontal === void 0 && bottom === void 0 && left === void 0) { + marginLeft = marginRight = marginTop = marginBottom = marginOrVerticalOrTop; + } else if (bottom === void 0 && left === void 0) { + marginLeft = marginRight = rightOrHorizontal; + marginTop = marginBottom = marginOrVerticalOrTop; + } else { + marginLeft = left; + marginRight = rightOrHorizontal; + marginTop = marginOrVerticalOrTop; + marginBottom = bottom; + } + return new _Rect(this.left - marginLeft, this.top - marginTop, this.right + marginRight, this.bottom + marginBottom); + } + intersectVertical(range2) { + const newTop = Math.max(this.top, range2.start); + const newBottom = Math.min(this.bottom, range2.endExclusive); + return new _Rect(this.left, newTop, this.right, Math.max(newTop, newBottom)); + } + intersectHorizontal(range2) { + const newLeft = Math.max(this.left, range2.start); + const newRight = Math.min(this.right, range2.endExclusive); + return new _Rect(newLeft, this.top, Math.max(newLeft, newRight), this.bottom); + } + toString() { + return `Rect{(${this.left},${this.top}), (${this.right},${this.bottom})}`; + } + intersect(parent) { + const left = Math.max(this.left, parent.left); + const right = Math.min(this.right, parent.right); + const top = Math.max(this.top, parent.top); + const bottom = Math.min(this.bottom, parent.bottom); + if (left > right || top > bottom) { + return void 0; + } + return new _Rect(left, top, right, bottom); + } + containsRect(other) { + return this.left <= other.left && this.top <= other.top && this.right >= other.right && this.bottom >= other.bottom; + } + containsPoint(point) { + return this.left <= point.x && this.top <= point.y && this.right >= point.x && this.bottom >= point.y; + } + moveToBeContainedIn(parent) { + const width2 = this.width; + const height = this.height; + let left = this.left; + let top = this.top; + if (left < parent.left) { + left = parent.left; + } else if (left + width2 > parent.right) { + left = parent.right - width2; + } + if (top < parent.top) { + top = parent.top; + } else if (top + height > parent.bottom) { + top = parent.bottom - height; + } + return new _Rect(left, top, left + width2, top + height); + } + withWidth(width2) { + return new _Rect(this.left, this.top, this.left + width2, this.bottom); + } + withHeight(height) { + return new _Rect(this.left, this.top, this.right, this.top + height); + } + withTop(top) { + return new _Rect(this.left, top, this.right, this.bottom); + } + withLeft(left) { + return new _Rect(left, this.top, this.right, this.bottom); + } + translateX(delta) { + return new _Rect(this.left + delta, this.top, this.right + delta, this.bottom); + } + translateY(delta) { + return new _Rect(this.left, this.top + delta, this.right, this.bottom + delta); + } + getLeftBottom() { + return new Point(this.left, this.bottom); + } + getRightBottom() { + return new Point(this.right, this.bottom); + } + getRightTop() { + return new Point(this.right, this.top); + } + toStyles() { + return { + position: "absolute", + left: `${this.left}px`, + top: `${this.top}px`, + width: `${this.width}px`, + height: `${this.height}px` + }; + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.js +init_offsetRange(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollController.js +init_lifecycle(); +init_languageFeatures(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollWidget.js +init_dom(); +init_arrays(); +init_lifecycle(); +init_themables(); +init_position(); +init_stringBuilder(); +init_event(); +var StickyScrollWidgetState = class _StickyScrollWidgetState { + constructor(startLineNumbers, endLineNumbers, lastLineRelativePosition, showEndForLine = null) { + this.startLineNumbers = startLineNumbers; + this.endLineNumbers = endLineNumbers; + this.lastLineRelativePosition = lastLineRelativePosition; + this.showEndForLine = showEndForLine; + } + equals(other) { + return !!other && this.lastLineRelativePosition === other.lastLineRelativePosition && this.showEndForLine === other.showEndForLine && equals(this.startLineNumbers, other.startLineNumbers) && equals(this.endLineNumbers, other.endLineNumbers); + } + static get Empty() { + return new _StickyScrollWidgetState([], [], 0); + } +}; +var _ttPolicy = createTrustedTypesPolicy("stickyScrollViewLayer", { createHTML: (value) => value }); +var STICKY_INDEX_ATTR = "data-sticky-line-index"; +var STICKY_IS_LINE_ATTR = "data-sticky-is-line"; +var STICKY_IS_LINE_NUMBER_ATTR = "data-sticky-is-line-number"; +var STICKY_IS_FOLDING_ICON_ATTR = "data-sticky-is-folding-icon"; +var StickyScrollWidget2 = class extends Disposable { + get height() { + return this._height; + } + constructor(editor2) { + super(); + this._foldingIconStore = this._register(new DisposableStore()); + this._rootDomNode = document.createElement("div"); + this._lineNumbersDomNode = document.createElement("div"); + this._linesDomNodeScrollable = document.createElement("div"); + this._linesDomNode = document.createElement("div"); + this._renderedStickyLines = []; + this._lineNumbers = []; + this._lastLineRelativePosition = 0; + this._minContentWidthInPx = 0; + this._isOnGlyphMargin = false; + this._height = -1; + this._onDidChangeStickyScrollHeight = this._register(new Emitter()); + this.onDidChangeStickyScrollHeight = this._onDidChangeStickyScrollHeight.event; + this._editor = editor2; + this._lineHeight = editor2.getOption( + 75 + /* EditorOption.lineHeight */ + ); + 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", editor2 instanceof EmbeddedCodeEditorWidget); + this._rootDomNode.appendChild(this._lineNumbersDomNode); + this._rootDomNode.appendChild(this._linesDomNodeScrollable); + this._setHeight(0); + const updateScrollLeftPosition = () => { + this._linesDomNode.style.left = this._editor.getOption( + 131 + /* EditorOption.stickyScroll */ + ).scrollWithEditor ? `-${this._editor.getScrollLeft()}px` : "0px"; + }; + this._register(this._editor.onDidChangeConfiguration((e) => { + if (e.hasChanged( + 131 + /* EditorOption.stickyScroll */ + )) { + updateScrollLeftPosition(); + } + if (e.hasChanged( + 75 + /* EditorOption.lineHeight */ + )) { + this._lineHeight = this._editor.getOption( + 75 + /* EditorOption.lineHeight */ + ); + } + })); + this._register(this._editor.onDidScrollChange((e) => { + if (e.scrollLeftChanged) { + updateScrollLeftPosition(); + } + if (e.scrollWidthChanged) { + this._updateWidgetWidth(); + } + })); + this._register(this._editor.onDidChangeModel(() => { + updateScrollLeftPosition(); + this._updateWidgetWidth(); + })); + updateScrollLeftPosition(); + this._register(this._editor.onDidLayoutChange((e) => { + this._updateWidgetWidth(); + })); + this._updateWidgetWidth(); + } + get lineNumbers() { + return this._lineNumbers; + } + get lineNumberCount() { + return this._lineNumbers.length; + } + getRenderedStickyLine(lineNumber) { + return this._renderedStickyLines.find((stickyLine) => stickyLine.lineNumber === lineNumber); + } + getCurrentLines() { + return this._lineNumbers; + } + setState(state, foldingModel, rebuildFromIndexCandidate) { + const currentStateAndPreviousStateUndefined = !this._state && !state; + const currentStateDefinedAndEqualsPreviousState = this._state && this._state.equals(state); + if (rebuildFromIndexCandidate === void 0 && (currentStateAndPreviousStateUndefined || currentStateDefinedAndEqualsPreviousState)) { + return; + } + const data = this._findRenderingData(state); + const previousLineNumbers = this._lineNumbers; + this._lineNumbers = data.lineNumbers; + this._lastLineRelativePosition = data.lastLineRelativePosition; + const rebuildFromIndex = this._findIndexToRebuildFrom(previousLineNumbers, this._lineNumbers, rebuildFromIndexCandidate); + this._renderRootNode(this._lineNumbers, this._lastLineRelativePosition, foldingModel, rebuildFromIndex); + this._state = state; + } + _findRenderingData(state) { + if (!state) { + return { lineNumbers: [], lastLineRelativePosition: 0 }; + } + const candidateLineNumbers = [...state.startLineNumbers]; + if (state.showEndForLine !== null) { + candidateLineNumbers[state.showEndForLine] = state.endLineNumbers[state.showEndForLine]; + } + let totalHeight = 0; + for (let i2 = 0; i2 < candidateLineNumbers.length; i2++) { + totalHeight += this._editor.getLineHeightForPosition(new Position(candidateLineNumbers[i2], 1)); + } + if (totalHeight === 0) { + return { lineNumbers: [], lastLineRelativePosition: 0 }; + } + return { lineNumbers: candidateLineNumbers, lastLineRelativePosition: state.lastLineRelativePosition }; + } + _findIndexToRebuildFrom(previousLineNumbers, newLineNumbers, rebuildFromIndexCandidate) { + if (newLineNumbers.length === 0) { + return 0; + } + if (rebuildFromIndexCandidate !== void 0) { + return rebuildFromIndexCandidate; + } + const validIndex = newLineNumbers.findIndex((startLineNumber) => !previousLineNumbers.includes(startLineNumber)); + return validIndex === -1 ? 0 : validIndex; + } + _updateWidgetWidth() { + const layoutInfo = this._editor.getLayoutInfo(); + const lineNumbersWidth = layoutInfo.contentLeft; + this._lineNumbersDomNode.style.width = `${lineNumbersWidth}px`; + this._linesDomNodeScrollable.style.setProperty("--vscode-editorStickyScroll-scrollableWidth", `${this._editor.getScrollWidth() - layoutInfo.verticalScrollbarWidth}px`); + this._rootDomNode.style.width = `${layoutInfo.width - layoutInfo.verticalScrollbarWidth}px`; + } + _useFoldingOpacityTransition(requireTransitions) { + this._lineNumbersDomNode.style.setProperty("--vscode-editorStickyScroll-foldingOpacityTransition", `opacity ${requireTransitions ? 0.5 : 0}s`); + } + _setFoldingIconsVisibility(allVisible) { + for (const line of this._renderedStickyLines) { + const foldingIcon = line.foldingIcon; + if (!foldingIcon) { + continue; + } + foldingIcon.setVisible(allVisible ? true : foldingIcon.isCollapsed); + } + } + async _renderRootNode(lineNumbers, lastLineRelativePosition, foldingModel, rebuildFromIndex) { + const viewModel = this._editor._getViewModel(); + if (!viewModel) { + this._clearWidget(); + return; + } + if (lineNumbers.length === 0) { + this._clearWidget(); + return; + } + const renderedStickyLines = []; + const lastLineNumber = lineNumbers[lineNumbers.length - 1]; + let top = 0; + for (let i2 = 0; i2 < this._renderedStickyLines.length; i2++) { + if (i2 < rebuildFromIndex) { + const renderedLine = this._renderedStickyLines[i2]; + renderedStickyLines.push(this._updatePosition(renderedLine, top, renderedLine.lineNumber === lastLineNumber)); + top += renderedLine.height; + } else { + const renderedLine = this._renderedStickyLines[i2]; + renderedLine.lineNumberDomNode.remove(); + renderedLine.lineDomNode.remove(); + } + } + const layoutInfo = this._editor.getLayoutInfo(); + for (let i2 = rebuildFromIndex; i2 < lineNumbers.length; i2++) { + const stickyLine = this._renderChildNode(viewModel, i2, lineNumbers[i2], top, lastLineNumber === lineNumbers[i2], foldingModel, layoutInfo); + top += stickyLine.height; + this._linesDomNode.appendChild(stickyLine.lineDomNode); + this._lineNumbersDomNode.appendChild(stickyLine.lineNumberDomNode); + renderedStickyLines.push(stickyLine); + } + if (foldingModel) { + this._setFoldingHoverListeners(); + this._useFoldingOpacityTransition(!this._isOnGlyphMargin); + } + this._minContentWidthInPx = Math.max(...this._renderedStickyLines.map((l) => l.scrollWidth)) + layoutInfo.verticalScrollbarWidth; + this._renderedStickyLines = renderedStickyLines; + this._setHeight(top + lastLineRelativePosition); + this._editor.layoutOverlayWidget(this); + } + _clearWidget() { + for (let i2 = 0; i2 < this._renderedStickyLines.length; i2++) { + const stickyLine = this._renderedStickyLines[i2]; + stickyLine.lineNumberDomNode.remove(); + stickyLine.lineDomNode.remove(); + } + this._setHeight(0); + } + _setHeight(height) { + if (this._height === height) { + return; + } + this._height = height; + if (this._height === 0) { + this._rootDomNode.style.display = "none"; + } else { + this._rootDomNode.style.display = "block"; + this._lineNumbersDomNode.style.height = `${this._height}px`; + this._linesDomNodeScrollable.style.height = `${this._height}px`; + this._rootDomNode.style.height = `${this._height}px`; + } + this._onDidChangeStickyScrollHeight.fire({ height: this._height }); + } + _setFoldingHoverListeners() { + const showFoldingControls = this._editor.getOption( + 126 + /* EditorOption.showFoldingControls */ + ); + if (showFoldingControls !== "mouseover") { + return; + } + this._foldingIconStore.clear(); + this._foldingIconStore.add(addDisposableListener(this._lineNumbersDomNode, EventType.MOUSE_ENTER, () => { + this._isOnGlyphMargin = true; + this._setFoldingIconsVisibility(true); + })); + this._foldingIconStore.add(addDisposableListener(this._lineNumbersDomNode, EventType.MOUSE_LEAVE, () => { + this._isOnGlyphMargin = false; + this._useFoldingOpacityTransition(true); + this._setFoldingIconsVisibility(false); + })); + } + _renderChildNode(viewModel, index, line, top, isLastLine, foldingModel, layoutInfo) { + const viewLineNumber = viewModel.coordinatesConverter.convertModelPositionToViewPosition(new Position(line, 1)).lineNumber; + const lineRenderingData = viewModel.getViewLineRenderingData(viewLineNumber); + const lineNumberOption = this._editor.getOption( + 76 + /* EditorOption.lineNumbers */ + ); + const verticalScrollbarSize = this._editor.getOption( + 117 + /* EditorOption.scrollbar */ + ).verticalScrollbarSize; + let actualInlineDecorations; + try { + actualInlineDecorations = LineDecoration.filter(lineRenderingData.inlineDecorations, viewLineNumber, lineRenderingData.minColumn, lineRenderingData.maxColumn); + } catch (err) { + actualInlineDecorations = []; + } + const lineHeight = this._editor.getLineHeightForPosition(new Position(line, 1)); + const textDirection = viewModel.getTextDirection(line); + const renderLineInput = new RenderLineInput(true, true, lineRenderingData.content, lineRenderingData.continuesWithWrappedLine, lineRenderingData.isBasicASCII, lineRenderingData.containsRTL, 0, lineRenderingData.tokens, actualInlineDecorations, lineRenderingData.tabSize, lineRenderingData.startVisibleColumn, 1, 1, 1, 500, "none", true, true, null, textDirection, verticalScrollbarSize); + const sb = new StringBuilder(2e3); + const renderOutput = renderViewLine(renderLineInput, sb); + let newLine; + if (_ttPolicy) { + newLine = _ttPolicy.createHTML(sb.build()); + } else { + newLine = sb.build(); + } + const lineHTMLNode = document.createElement("span"); + lineHTMLNode.setAttribute(STICKY_INDEX_ATTR, String(index)); + lineHTMLNode.setAttribute(STICKY_IS_LINE_ATTR, ""); + lineHTMLNode.setAttribute("role", "listitem"); + lineHTMLNode.tabIndex = 0; + lineHTMLNode.className = "sticky-line-content"; + lineHTMLNode.classList.add(`stickyLine${line}`); + lineHTMLNode.style.lineHeight = `${lineHeight}px`; + lineHTMLNode.innerHTML = newLine; + const lineNumberHTMLNode = document.createElement("span"); + lineNumberHTMLNode.setAttribute(STICKY_INDEX_ATTR, String(index)); + lineNumberHTMLNode.setAttribute(STICKY_IS_LINE_NUMBER_ATTR, ""); + lineNumberHTMLNode.className = "sticky-line-number"; + lineNumberHTMLNode.style.lineHeight = `${lineHeight}px`; + const lineNumbersWidth = layoutInfo.contentLeft; + lineNumberHTMLNode.style.width = `${lineNumbersWidth}px`; + const innerLineNumberHTML = document.createElement("span"); + if (lineNumberOption.renderType === 1 || lineNumberOption.renderType === 3 && line % 10 === 0) { + innerLineNumberHTML.innerText = line.toString(); + } else if (lineNumberOption.renderType === 2) { + innerLineNumberHTML.innerText = Math.abs(line - this._editor.getPosition().lineNumber).toString(); + } + innerLineNumberHTML.className = "sticky-line-number-inner"; + innerLineNumberHTML.style.width = `${layoutInfo.lineNumbersWidth}px`; + innerLineNumberHTML.style.paddingLeft = `${layoutInfo.lineNumbersLeft}px`; + lineNumberHTMLNode.appendChild(innerLineNumberHTML); + const foldingIcon = this._renderFoldingIconForLine(foldingModel, line); + if (foldingIcon) { + lineNumberHTMLNode.appendChild(foldingIcon.domNode); + foldingIcon.domNode.style.left = `${layoutInfo.lineNumbersWidth + layoutInfo.lineNumbersLeft}px`; + foldingIcon.domNode.style.lineHeight = `${lineHeight}px`; + } + this._editor.applyFontInfo(lineHTMLNode); + this._editor.applyFontInfo(lineNumberHTMLNode); + lineNumberHTMLNode.style.lineHeight = `${lineHeight}px`; + lineHTMLNode.style.lineHeight = `${lineHeight}px`; + lineNumberHTMLNode.style.height = `${lineHeight}px`; + lineHTMLNode.style.height = `${lineHeight}px`; + const renderedLine = new RenderedStickyLine(index, line, lineHTMLNode, lineNumberHTMLNode, foldingIcon, renderOutput.characterMapping, lineHTMLNode.scrollWidth, lineHeight); + return this._updatePosition(renderedLine, top, isLastLine); + } + _updatePosition(stickyLine, top, isLastLine) { + const lineHTMLNode = stickyLine.lineDomNode; + const lineNumberHTMLNode = stickyLine.lineNumberDomNode; + if (isLastLine) { + const zIndex = "0"; + lineHTMLNode.style.zIndex = zIndex; + lineNumberHTMLNode.style.zIndex = zIndex; + const updatedTop = `${top + this._lastLineRelativePosition + (stickyLine.foldingIcon?.isCollapsed ? 1 : 0)}px`; + lineHTMLNode.style.top = updatedTop; + lineNumberHTMLNode.style.top = updatedTop; + } else { + const zIndex = "1"; + lineHTMLNode.style.zIndex = zIndex; + lineNumberHTMLNode.style.zIndex = zIndex; + lineHTMLNode.style.top = `${top}px`; + lineNumberHTMLNode.style.top = `${top}px`; + } + return stickyLine; + } + _renderFoldingIconForLine(foldingModel, line) { + const showFoldingControls = this._editor.getOption( + 126 + /* EditorOption.showFoldingControls */ + ); + if (!foldingModel || showFoldingControls === "never") { + return; + } + const foldingRegions = foldingModel.regions; + const indexOfFoldingRegion = foldingRegions.findRange(line); + const startLineNumber = foldingRegions.getStartLineNumber(indexOfFoldingRegion); + const isFoldingScope = line === startLineNumber; + if (!isFoldingScope) { + return; + } + const isCollapsed = foldingRegions.isCollapsed(indexOfFoldingRegion); + const foldingIcon = new StickyFoldingIcon(isCollapsed, startLineNumber, foldingRegions.getEndLineNumber(indexOfFoldingRegion), this._lineHeight); + foldingIcon.setVisible(this._isOnGlyphMargin ? true : isCollapsed || showFoldingControls === "always"); + foldingIcon.domNode.setAttribute(STICKY_IS_FOLDING_ICON_ATTR, ""); + return foldingIcon; + } + getId() { + return "editor.contrib.stickyScrollWidget"; + } + getDomNode() { + return this._rootDomNode; + } + getPosition() { + return { + preference: 2, + stackOridinal: 10 + }; + } + getMinContentWidthInPx() { + return this._minContentWidthInPx; + } + focusLineWithIndex(index) { + if (0 <= index && index < this._renderedStickyLines.length) { + this._renderedStickyLines[index].lineDomNode.focus(); + } + } + /** + * Given a leaf dom node, tries to find the editor position. + */ + getEditorPositionFromNode(spanDomNode) { + if (!spanDomNode || spanDomNode.children.length > 0) { + return null; + } + const renderedStickyLine = this._getRenderedStickyLineFromChildDomNode(spanDomNode); + if (!renderedStickyLine) { + return null; + } + const column = getColumnOfNodeOffset(renderedStickyLine.characterMapping, spanDomNode, 0); + return new Position(renderedStickyLine.lineNumber, column); + } + getLineNumberFromChildDomNode(domNode) { + return this._getRenderedStickyLineFromChildDomNode(domNode)?.lineNumber ?? null; + } + _getRenderedStickyLineFromChildDomNode(domNode) { + const index = this.getLineIndexFromChildDomNode(domNode); + if (index === null || index < 0 || index >= this._renderedStickyLines.length) { + return null; + } + return this._renderedStickyLines[index]; + } + /** + * Given a child dom node, tries to find the line number attribute that was stored in the node. + * @returns the attribute value or null if none is found. + */ + getLineIndexFromChildDomNode(domNode) { + const lineIndex = this._getAttributeValue(domNode, STICKY_INDEX_ATTR); + return lineIndex ? parseInt(lineIndex, 10) : null; + } + /** + * Given a child dom node, tries to find if it is (contained in) a sticky line. + * @returns a boolean. + */ + isInStickyLine(domNode) { + const isInLine = this._getAttributeValue(domNode, STICKY_IS_LINE_ATTR); + return isInLine !== void 0; + } + /** + * Given a child dom node, tries to find if this dom node is (contained in) a sticky folding icon. + * @returns a boolean. + */ + isInFoldingIconDomNode(domNode) { + const isInFoldingIcon = this._getAttributeValue(domNode, STICKY_IS_FOLDING_ICON_ATTR); + return isInFoldingIcon !== void 0; + } + /** + * Given the dom node, finds if it or its parent sequence contains the given attribute. + * @returns the attribute value or undefined. + */ + _getAttributeValue(domNode, attribute) { + while (domNode && domNode !== this._rootDomNode) { + const line = domNode.getAttribute(attribute); + if (line !== null) { + return line; + } + domNode = domNode.parentElement; + } + return; + } +}; +var RenderedStickyLine = class { + constructor(index, lineNumber, lineDomNode, lineNumberDomNode, foldingIcon, characterMapping, scrollWidth, height) { + this.index = index; + this.lineNumber = lineNumber; + this.lineDomNode = lineDomNode; + this.lineNumberDomNode = lineNumberDomNode; + this.foldingIcon = foldingIcon; + this.characterMapping = characterMapping; + this.scrollWidth = scrollWidth; + this.height = height; + } +}; +var StickyFoldingIcon = class { + constructor(isCollapsed, foldingStartLine, foldingEndLine, dimension) { + this.isCollapsed = isCollapsed; + this.foldingStartLine = foldingStartLine; + this.foldingEndLine = foldingEndLine; + this.dimension = dimension; + this.domNode = document.createElement("div"); + this.domNode.style.width = `26px`; + this.domNode.style.height = `${dimension}px`; + this.domNode.style.lineHeight = `${dimension}px`; + this.domNode.className = ThemeIcon.asClassName(isCollapsed ? foldingCollapsedIcon : foldingExpandedIcon); + } + setVisible(visible) { + this.domNode.style.cursor = visible ? "pointer" : "default"; + this.domNode.style.opacity = visible ? "1" : "0"; + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollProvider.js +init_lifecycle(); +init_languageFeatures(); +init_cancellation(); +init_async(); +init_arrays(); +init_event(); +init_languageConfigurationRegistry(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollModelProvider.js +init_lifecycle(); +init_languageFeatures(); +init_outlineModel(); +init_async(); +init_languageConfigurationRegistry(); +init_errors(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollElement.js +var StickyRange = class { + constructor(startLineNumber, endLineNumber) { + this.startLineNumber = startLineNumber; + this.endLineNumber = endLineNumber; + } +}; +var StickyElement = class { + constructor(range2, children, parent) { + this.range = range2; + this.children = children; + this.parent = parent; + } +}; +var StickyModel = class { + constructor(uri, version, element, outlineProviderId) { + this.uri = uri; + this.version = version; + this.element = element; + this.outlineProviderId = outlineProviderId; + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollModelProvider.js +init_iterator(); +init_instantiation(); +var __decorate117 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param111 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var ModelProvider; +(function(ModelProvider2) { + ModelProvider2["OUTLINE_MODEL"] = "outlineModel"; + ModelProvider2["FOLDING_PROVIDER_MODEL"] = "foldingProviderModel"; + ModelProvider2["INDENTATION_MODEL"] = "indentationModel"; +})(ModelProvider || (ModelProvider = {})); +var Status; +(function(Status2) { + Status2[Status2["VALID"] = 0] = "VALID"; + Status2[Status2["INVALID"] = 1] = "INVALID"; + Status2[Status2["CANCELED"] = 2] = "CANCELED"; +})(Status || (Status = {})); +var StickyModelProvider = class StickyModelProvider2 extends Disposable { + constructor(_editor, onProviderUpdate, _languageConfigurationService, _languageFeaturesService) { + super(); + this._editor = _editor; + this._modelProviders = []; + this._modelPromise = null; + this._updateScheduler = this._register(new Delayer(300)); + this._updateOperation = this._register(new DisposableStore()); + switch (this._editor.getOption( + 131 + /* EditorOption.stickyScroll */ + ).defaultModel) { + case ModelProvider.OUTLINE_MODEL: + this._modelProviders.push(new StickyModelFromCandidateOutlineProvider(this._editor, _languageFeaturesService)); + // fall through + case ModelProvider.FOLDING_PROVIDER_MODEL: + this._modelProviders.push(new StickyModelFromCandidateSyntaxFoldingProvider(this._editor, onProviderUpdate, _languageFeaturesService)); + // fall through + case ModelProvider.INDENTATION_MODEL: + this._modelProviders.push(new StickyModelFromCandidateIndentationFoldingProvider(this._editor, _languageConfigurationService)); + break; + } + } + dispose() { + this._modelProviders.forEach((provider) => provider.dispose()); + this._updateOperation.clear(); + this._cancelModelPromise(); + super.dispose(); + } + _cancelModelPromise() { + if (this._modelPromise) { + this._modelPromise.cancel(); + this._modelPromise = null; + } + } + async update(token) { + this._updateOperation.clear(); + this._updateOperation.add({ + dispose: () => { + this._cancelModelPromise(); + this._updateScheduler.cancel(); + } + }); + this._cancelModelPromise(); + return await this._updateScheduler.trigger(async () => { + for (const modelProvider of this._modelProviders) { + const { statusPromise, modelPromise } = modelProvider.computeStickyModel(token); + this._modelPromise = modelPromise; + const status2 = await statusPromise; + if (this._modelPromise !== modelPromise) { + return null; + } + switch (status2) { + case Status.CANCELED: + this._updateOperation.clear(); + return null; + case Status.VALID: + return modelProvider.stickyModel; + } + } + return null; + }).catch((error) => { + onUnexpectedError(error); + return null; + }); + } +}; +StickyModelProvider = __decorate117([ + __param111(2, IInstantiationService), + __param111(3, ILanguageFeaturesService) +], StickyModelProvider); +var StickyModelCandidateProvider = class extends Disposable { + constructor(_editor) { + super(); + this._editor = _editor; + this._stickyModel = null; + } + get stickyModel() { + return this._stickyModel; + } + _invalid() { + this._stickyModel = null; + return Status.INVALID; + } + computeStickyModel(token) { + if (token.isCancellationRequested || !this.isProviderValid()) { + return { statusPromise: this._invalid(), modelPromise: null }; + } + const providerModelPromise = createCancelablePromise((token2) => this.createModelFromProvider(token2)); + return { + statusPromise: providerModelPromise.then((providerModel) => { + if (!this.isModelValid(providerModel)) { + return this._invalid(); + } + if (token.isCancellationRequested) { + return Status.CANCELED; + } + this._stickyModel = this.createStickyModel(token, providerModel); + return Status.VALID; + }).then(void 0, (err) => { + onUnexpectedError(err); + return Status.CANCELED; + }), + modelPromise: providerModelPromise + }; + } + /** + * Method which checks whether the model returned by the provider is valid and can be used to compute a sticky model. + * This method by default returns true. + * @param model model returned by the provider + * @returns boolean indicating whether the model is valid + */ + isModelValid(model) { + return true; + } + /** + * Method which checks whether the provider is valid before applying it to find the provider model. + * This method by default returns true. + * @returns boolean indicating whether the provider is valid + */ + isProviderValid() { + return true; + } +}; +var StickyModelFromCandidateOutlineProvider = class StickyModelFromCandidateOutlineProvider2 extends StickyModelCandidateProvider { + constructor(_editor, _languageFeaturesService) { + super(_editor); + this._languageFeaturesService = _languageFeaturesService; + } + createModelFromProvider(token) { + return OutlineModel.create(this._languageFeaturesService.documentSymbolProvider, this._editor.getModel(), token); + } + createStickyModel(token, model) { + const { stickyOutlineElement, providerID } = this._stickyModelFromOutlineModel(model, this._stickyModel?.outlineProviderId); + const textModel = this._editor.getModel(); + return new StickyModel(textModel.uri, textModel.getVersionId(), stickyOutlineElement, providerID); + } + isModelValid(model) { + return model && model.children.size > 0; + } + _stickyModelFromOutlineModel(outlineModel, preferredProvider) { + let outlineElements; + if (Iterable.first(outlineModel.children.values()) instanceof OutlineGroup) { + const provider = Iterable.find(outlineModel.children.values(), (outlineGroupOfModel) => outlineGroupOfModel.id === preferredProvider); + if (provider) { + outlineElements = provider.children; + } else { + let tempID = ""; + let maxTotalSumOfRanges = -1; + let optimalOutlineGroup = void 0; + for (const [_key, outlineGroup] of outlineModel.children.entries()) { + const totalSumRanges = this._findSumOfRangesOfGroup(outlineGroup); + if (totalSumRanges > maxTotalSumOfRanges) { + optimalOutlineGroup = outlineGroup; + maxTotalSumOfRanges = totalSumRanges; + tempID = outlineGroup.id; + } + } + preferredProvider = tempID; + outlineElements = optimalOutlineGroup.children; + } + } else { + outlineElements = outlineModel.children; + } + const stickyChildren = []; + const outlineElementsArray = Array.from(outlineElements.values()).sort((element1, element2) => { + const range1 = new StickyRange(element1.symbol.range.startLineNumber, element1.symbol.range.endLineNumber); + const range2 = new StickyRange(element2.symbol.range.startLineNumber, element2.symbol.range.endLineNumber); + return this._comparator(range1, range2); + }); + for (const outlineElement of outlineElementsArray) { + stickyChildren.push(this._stickyModelFromOutlineElement(outlineElement, outlineElement.symbol.selectionRange.startLineNumber)); + } + const stickyOutlineElement = new StickyElement(void 0, stickyChildren, void 0); + return { + stickyOutlineElement, + providerID: preferredProvider + }; + } + _stickyModelFromOutlineElement(outlineElement, previousStartLine) { + const children = []; + for (const child of outlineElement.children.values()) { + if (child.symbol.selectionRange.startLineNumber !== child.symbol.range.endLineNumber) { + if (child.symbol.selectionRange.startLineNumber !== previousStartLine) { + children.push(this._stickyModelFromOutlineElement(child, child.symbol.selectionRange.startLineNumber)); + } else { + for (const subchild of child.children.values()) { + children.push(this._stickyModelFromOutlineElement(subchild, child.symbol.selectionRange.startLineNumber)); + } + } + } + } + children.sort((child1, child2) => this._comparator(child1.range, child2.range)); + const range2 = new StickyRange(outlineElement.symbol.selectionRange.startLineNumber, outlineElement.symbol.range.endLineNumber); + return new StickyElement(range2, children, void 0); + } + _comparator(range1, range2) { + if (range1.startLineNumber !== range2.startLineNumber) { + return range1.startLineNumber - range2.startLineNumber; + } else { + return range2.endLineNumber - range1.endLineNumber; + } + } + _findSumOfRangesOfGroup(outline) { + let res = 0; + for (const child of outline.children.values()) { + res += this._findSumOfRangesOfGroup(child); + } + if (outline instanceof OutlineElement) { + return res + outline.symbol.range.endLineNumber - outline.symbol.selectionRange.startLineNumber; + } else { + return res; + } + } +}; +StickyModelFromCandidateOutlineProvider = __decorate117([ + __param111(1, ILanguageFeaturesService) +], StickyModelFromCandidateOutlineProvider); +var StickyModelFromCandidateFoldingProvider = class extends StickyModelCandidateProvider { + constructor(editor2) { + super(editor2); + this._foldingLimitReporter = this._register(new RangesLimitReporter(editor2)); + } + createStickyModel(token, model) { + const foldingElement = this._fromFoldingRegions(model); + const textModel = this._editor.getModel(); + return new StickyModel(textModel.uri, textModel.getVersionId(), foldingElement, void 0); + } + isModelValid(model) { + return model !== null; + } + _fromFoldingRegions(foldingRegions) { + const length = foldingRegions.length; + const orderedStickyElements = []; + const stickyOutlineElement = new StickyElement(void 0, [], void 0); + for (let i2 = 0; i2 < length; i2++) { + const parentIndex = foldingRegions.getParentIndex(i2); + let parentNode; + if (parentIndex !== -1) { + parentNode = orderedStickyElements[parentIndex]; + } else { + parentNode = stickyOutlineElement; + } + const child = new StickyElement(new StickyRange(foldingRegions.getStartLineNumber(i2), foldingRegions.getEndLineNumber(i2) + 1), [], parentNode); + parentNode.children.push(child); + orderedStickyElements.push(child); + } + return stickyOutlineElement; + } +}; +var StickyModelFromCandidateIndentationFoldingProvider = class StickyModelFromCandidateIndentationFoldingProvider2 extends StickyModelFromCandidateFoldingProvider { + constructor(editor2, _languageConfigurationService) { + super(editor2); + this._languageConfigurationService = _languageConfigurationService; + this.provider = this._register(new IndentRangeProvider(editor2.getModel(), this._languageConfigurationService, this._foldingLimitReporter)); + } + async createModelFromProvider(token) { + return this.provider.compute(token); + } +}; +StickyModelFromCandidateIndentationFoldingProvider = __decorate117([ + __param111(1, ILanguageConfigurationService) +], StickyModelFromCandidateIndentationFoldingProvider); +var StickyModelFromCandidateSyntaxFoldingProvider = class StickyModelFromCandidateSyntaxFoldingProvider2 extends StickyModelFromCandidateFoldingProvider { + constructor(editor2, onProviderUpdate, _languageFeaturesService) { + super(editor2); + this._languageFeaturesService = _languageFeaturesService; + this.provider = this._register(new MutableDisposable()); + this._register(this._languageFeaturesService.foldingRangeProvider.onDidChange(() => { + this._updateProvider(editor2, onProviderUpdate); + })); + this._updateProvider(editor2, onProviderUpdate); + } + _updateProvider(editor2, onProviderUpdate) { + const selectedProviders = FoldingController.getFoldingRangeProviders(this._languageFeaturesService, editor2.getModel()); + if (selectedProviders.length === 0) { + return; + } + this.provider.value = new SyntaxRangeProvider(editor2.getModel(), selectedProviders, onProviderUpdate, this._foldingLimitReporter, void 0); + } + isProviderValid() { + return this.provider !== void 0; + } + async createModelFromProvider(token) { + return this.provider.value?.compute(token) ?? null; + } +}; +StickyModelFromCandidateSyntaxFoldingProvider = __decorate117([ + __param111(2, ILanguageFeaturesService) +], StickyModelFromCandidateSyntaxFoldingProvider); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollProvider.js +init_position(); +init_range(); +var __decorate118 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param112 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var StickyLineCandidate = class { + constructor(startLineNumber, endLineNumber, top, height) { + this.startLineNumber = startLineNumber; + this.endLineNumber = endLineNumber; + this.top = top; + this.height = height; + } +}; +var StickyLineCandidateProvider = class StickyLineCandidateProvider2 extends Disposable { + constructor(editor2, _languageFeaturesService, _languageConfigurationService) { + super(); + this._languageFeaturesService = _languageFeaturesService; + this._languageConfigurationService = _languageConfigurationService; + this._onDidChangeStickyScroll = this._register(new Emitter()); + this.onDidChangeStickyScroll = this._onDidChangeStickyScroll.event; + this._model = null; + this._cts = null; + this._stickyModelProvider = null; + this._editor = editor2; + this._sessionStore = this._register(new DisposableStore()); + this._updateSoon = this._register(new RunOnceScheduler(() => this.update(), 50)); + this._register(this._editor.onDidChangeConfiguration((e) => { + if (e.hasChanged( + 131 + /* EditorOption.stickyScroll */ + )) { + this.readConfiguration(); + } + })); + this.readConfiguration(); + } + /** + * Read and apply the sticky scroll configuration. + */ + readConfiguration() { + this._sessionStore.clear(); + const options2 = this._editor.getOption( + 131 + /* EditorOption.stickyScroll */ + ); + if (!options2.enabled) { + return; + } + 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(toDisposable(() => { + this._stickyModelProvider?.dispose(); + this._stickyModelProvider = null; + })); + this.updateStickyModelProvider(); + this.update(); + } + /** + * Get the version ID of the sticky model. + */ + getVersionId() { + return this._model?.version; + } + /** + * Update the sticky model provider. + */ + updateStickyModelProvider() { + this._stickyModelProvider?.dispose(); + this._stickyModelProvider = null; + if (this._editor.hasModel()) { + this._stickyModelProvider = new StickyModelProvider(this._editor, () => this._updateSoon.schedule(), this._languageConfigurationService, this._languageFeaturesService); + } + } + /** + * Update the sticky line candidates. + */ + async update() { + this._cts?.dispose(true); + this._cts = new CancellationTokenSource(); + await this.updateStickyModel(this._cts.token); + this._onDidChangeStickyScroll.fire(); + } + /** + * Update the sticky model based on the current editor state. + */ + async updateStickyModel(token) { + if (!this._editor.hasModel() || !this._stickyModelProvider || this._editor.getModel().isTooLargeForTokenization()) { + this._model = null; + return; + } + const model = await this._stickyModelProvider.update(token); + if (!token.isCancellationRequested) { + this._model = model; + } + } + /** + * Get sticky line candidates intersecting a given range. + */ + getCandidateStickyLinesIntersecting(range2) { + if (!this._model?.element) { + return []; + } + const stickyLineCandidates = []; + this.getCandidateStickyLinesIntersectingFromStickyModel(range2, this._model.element, stickyLineCandidates, 0, 0, -1); + return this.filterHiddenRanges(stickyLineCandidates); + } + /** + * Get sticky line candidates intersecting a given range from the sticky model. + */ + getCandidateStickyLinesIntersectingFromStickyModel(range2, outlineModel, result, depth, top, lastStartLineNumber) { + const textModel = this._editor.getModel(); + if (!textModel) { + return; + } + if (outlineModel.children.length === 0) { + return; + } + let lastLine = lastStartLineNumber; + const childrenStartLines = []; + for (let i2 = 0; i2 < outlineModel.children.length; i2++) { + const child = outlineModel.children[i2]; + if (child.range) { + childrenStartLines.push(child.range.startLineNumber); + } + } + const lowerBound = this.updateIndex(binarySearch(childrenStartLines, range2.startLineNumber, (a, b) => { + return a - b; + })); + const upperBound = this.updateIndex(binarySearch(childrenStartLines, range2.endLineNumber, (a, b) => { + return a - b; + })); + for (let i2 = lowerBound; i2 <= upperBound; i2++) { + const child = outlineModel.children[i2]; + if (!child || !child.range) { + continue; + } + const { startLineNumber, endLineNumber } = child.range; + if (endLineNumber > startLineNumber + 1 && range2.startLineNumber <= endLineNumber + 1 && startLineNumber - 1 <= range2.endLineNumber && startLineNumber !== lastLine && textModel.isValidRange(new Range(startLineNumber, 1, endLineNumber, 1))) { + lastLine = startLineNumber; + const lineHeight = this._editor.getLineHeightForPosition(new Position(startLineNumber, 1)); + result.push(new StickyLineCandidate(startLineNumber, endLineNumber - 1, top, lineHeight)); + this.getCandidateStickyLinesIntersectingFromStickyModel(range2, child, result, depth + 1, top + lineHeight, startLineNumber); + } + } + } + /** + * Filter out sticky line candidates that are within hidden ranges. + */ + filterHiddenRanges(stickyLineCandidates) { + const hiddenRanges = this._editor._getViewModel()?.getHiddenAreas(); + if (!hiddenRanges) { + return stickyLineCandidates; + } + return stickyLineCandidates.filter((candidate) => { + return !hiddenRanges.some((hiddenRange) => candidate.startLineNumber >= hiddenRange.startLineNumber && candidate.endLineNumber <= hiddenRange.endLineNumber + 1); + }); + } + /** + * Update the binary search index. + */ + updateIndex(index) { + if (index === -1) { + return 0; + } else if (index < 0) { + return -index - 2; + } + return index; + } +}; +StickyLineCandidateProvider = __decorate118([ + __param112(1, ILanguageFeaturesService), + __param112(2, ILanguageConfigurationService) +], StickyLineCandidateProvider); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollController.js +init_instantiation(); +init_actions2(); +init_contextkey(); +init_editorContextKeys(); +init_range(); +init_position(); +init_cancellation(); +init_languageConfigurationRegistry(); +init_languageFeatureDebounce(); +init_dom(); +init_mouseEvent(); +init_event(); +init_window(); +var __decorate119 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param113 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var StickyScrollController_1; +var StickyScrollController2 = class StickyScrollController3 extends Disposable { + static { + StickyScrollController_1 = this; + } + static { + this.ID = "store.contrib.stickyScrollController"; + } + constructor(_editor, _contextMenuService, _languageFeaturesService, _instaService, _languageConfigurationService, _languageFeatureDebounceService, _contextKeyService) { + super(); + this._editor = _editor; + this._contextMenuService = _contextMenuService; + this._languageFeaturesService = _languageFeaturesService; + this._instaService = _instaService; + this._contextKeyService = _contextKeyService; + this._sessionStore = new DisposableStore(); + this._maxStickyLines = Number.MAX_SAFE_INTEGER; + this._candidateDefinitionsLength = -1; + this._focusedStickyElementIndex = -1; + this._enabled = false; + this._focused = false; + this._positionRevealed = false; + this._onMouseDown = false; + this._endLineNumbers = []; + this._mouseTarget = null; + this._onDidChangeStickyScrollHeight = this._register(new Emitter()); + this.onDidChangeStickyScrollHeight = this._onDidChangeStickyScrollHeight.event; + this._stickyScrollWidget = new StickyScrollWidget2(this._editor); + this._stickyLineCandidateProvider = new StickyLineCandidateProvider(this._editor, _languageFeaturesService, _languageConfigurationService); + this._register(this._stickyScrollWidget); + this._register(this._stickyLineCandidateProvider); + this._widgetState = StickyScrollWidgetState.Empty; + const stickyScrollDomNode = this._stickyScrollWidget.getDomNode(); + this._register(this._editor.onDidChangeLineHeight((e) => { + e.changes.forEach((change) => { + const lineNumber = change.lineNumber; + if (this._widgetState.startLineNumbers.includes(lineNumber)) { + this._renderStickyScroll(lineNumber); + } + }); + })); + this._register(this._editor.onDidChangeFont((e) => { + e.changes.forEach((change) => { + const lineNumber = change.lineNumber; + if (this._widgetState.startLineNumbers.includes(lineNumber)) { + this._renderStickyScroll(lineNumber); + } + }); + })); + this._register(this._editor.onDidChangeConfiguration((e) => { + this._readConfigurationChange(e); + })); + this._register(addDisposableListener(stickyScrollDomNode, EventType.CONTEXT_MENU, async (event) => { + this._onContextMenu(getWindow(stickyScrollDomNode), event); + })); + this._stickyScrollFocusedContextKey = EditorContextKeys.stickyScrollFocused.bindTo(this._contextKeyService); + this._stickyScrollVisibleContextKey = EditorContextKeys.stickyScrollVisible.bindTo(this._contextKeyService); + const focusTracker = this._register(trackFocus(stickyScrollDomNode)); + this._register(focusTracker.onDidBlur((_) => { + if (this._positionRevealed === false && stickyScrollDomNode.clientHeight === 0) { + this._focusedStickyElementIndex = -1; + this.focus(); + } else { + this._disposeFocusStickyScrollStore(); + } + })); + this._register(focusTracker.onDidFocus((_) => { + this.focus(); + })); + this._registerMouseListeners(); + this._register(addDisposableListener(stickyScrollDomNode, EventType.MOUSE_DOWN, (e) => { + this._onMouseDown = true; + })); + this._register(this._stickyScrollWidget.onDidChangeStickyScrollHeight((e) => { + this._onDidChangeStickyScrollHeight.fire(e); + })); + this._onDidResize(); + this._readConfiguration(); + } + get stickyScrollWidgetHeight() { + return this._stickyScrollWidget.height; + } + static get(editor2) { + return editor2.getContribution(StickyScrollController_1.ID); + } + _disposeFocusStickyScrollStore() { + this._stickyScrollFocusedContextKey.set(false); + this._focusDisposableStore?.dispose(); + this._focused = false; + this._positionRevealed = false; + this._onMouseDown = false; + } + isFocused() { + return this._focused; + } + focus() { + if (this._onMouseDown) { + this._onMouseDown = false; + this._editor.focus(); + return; + } + const focusState = this._stickyScrollFocusedContextKey.get(); + if (focusState === true) { + return; + } + this._focused = true; + this._focusDisposableStore = new DisposableStore(); + this._stickyScrollFocusedContextKey.set(true); + this._focusedStickyElementIndex = this._stickyScrollWidget.lineNumbers.length - 1; + this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex); + } + focusNext() { + if (this._focusedStickyElementIndex < this._stickyScrollWidget.lineNumberCount - 1) { + this._focusNav(true); + } + } + focusPrevious() { + if (this._focusedStickyElementIndex > 0) { + this._focusNav(false); + } + } + selectEditor() { + this._editor.focus(); + } + // True is next, false is previous + _focusNav(direction) { + this._focusedStickyElementIndex = direction ? this._focusedStickyElementIndex + 1 : this._focusedStickyElementIndex - 1; + this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex); + } + goToFocused() { + const lineNumbers = this._stickyScrollWidget.lineNumbers; + this._disposeFocusStickyScrollStore(); + this._revealPosition({ lineNumber: lineNumbers[this._focusedStickyElementIndex], column: 1 }); + } + _revealPosition(position) { + this._reveaInEditor(position, () => this._editor.revealPosition(position)); + } + _revealLineInCenterIfOutsideViewport(position) { + this._reveaInEditor(position, () => this._editor.revealLineInCenterIfOutsideViewport( + position.lineNumber, + 0 + /* ScrollType.Smooth */ + )); + } + _reveaInEditor(position, revealFunction) { + if (this._focused) { + this._disposeFocusStickyScrollStore(); + } + this._positionRevealed = true; + revealFunction(); + this._editor.setSelection(Range.fromPositions(position)); + this._editor.focus(); + } + _registerMouseListeners() { + const sessionStore = this._register(new DisposableStore()); + const gesture = this._register(new ClickLinkGesture(this._editor, { + extractLineNumberFromMouseEvent: (e) => { + const position = this._stickyScrollWidget.getEditorPositionFromNode(e.target.element); + return position ? position.lineNumber : 0; + } + })); + const getMouseEventTarget = (mouseEvent) => { + if (!this._editor.hasModel()) { + return null; + } + if (mouseEvent.target.type !== 12 || mouseEvent.target.detail !== this._stickyScrollWidget.getId()) { + return null; + } + const mouseTargetElement = mouseEvent.target.element; + if (!mouseTargetElement || mouseTargetElement.innerText !== mouseTargetElement.innerHTML) { + return null; + } + const position = this._stickyScrollWidget.getEditorPositionFromNode(mouseTargetElement); + if (!position) { + return null; + } + return { + range: new Range(position.lineNumber, position.column, position.lineNumber, position.column + mouseTargetElement.innerText.length), + textElement: mouseTargetElement + }; + }; + const stickyScrollWidgetDomNode = this._stickyScrollWidget.getDomNode(); + this._register(addStandardDisposableListener(stickyScrollWidgetDomNode, EventType.CLICK, (mouseEvent) => { + if (mouseEvent.ctrlKey || mouseEvent.altKey || mouseEvent.metaKey) { + return; + } + if (!mouseEvent.leftButton) { + return; + } + if (mouseEvent.shiftKey) { + const lineIndex = this._stickyScrollWidget.getLineIndexFromChildDomNode(mouseEvent.target); + if (lineIndex === null) { + return; + } + const position2 = new Position(this._endLineNumbers[lineIndex], 1); + this._revealLineInCenterIfOutsideViewport(position2); + return; + } + const isInFoldingIconDomNode = this._stickyScrollWidget.isInFoldingIconDomNode(mouseEvent.target); + if (isInFoldingIconDomNode) { + const lineNumber = this._stickyScrollWidget.getLineNumberFromChildDomNode(mouseEvent.target); + this._toggleFoldingRegionForLine(lineNumber); + return; + } + const isInStickyLine = this._stickyScrollWidget.isInStickyLine(mouseEvent.target); + if (!isInStickyLine) { + return; + } + let position = this._stickyScrollWidget.getEditorPositionFromNode(mouseEvent.target); + if (!position) { + const lineNumber = this._stickyScrollWidget.getLineNumberFromChildDomNode(mouseEvent.target); + if (lineNumber === null) { + return; + } + position = new Position(lineNumber, 1); + } + this._revealPosition(position); + })); + this._register(addDisposableListener(mainWindow, EventType.MOUSE_MOVE, (mouseEvent) => { + this._mouseTarget = mouseEvent.target; + this._onMouseMoveOrKeyDown(mouseEvent); + })); + this._register(addDisposableListener(mainWindow, EventType.KEY_DOWN, (mouseEvent) => { + this._onMouseMoveOrKeyDown(mouseEvent); + })); + this._register(addDisposableListener(mainWindow, EventType.KEY_UP, () => { + if (this._showEndForLine !== void 0) { + this._showEndForLine = void 0; + this._renderStickyScroll(); + } + })); + this._register(gesture.onMouseMoveOrRelevantKeyDown(([mouseEvent, _keyboardEvent]) => { + const mouseTarget = getMouseEventTarget(mouseEvent); + if (!mouseTarget || !mouseEvent.hasTriggerModifier || !this._editor.hasModel()) { + sessionStore.clear(); + return; + } + const { range: range2, textElement } = mouseTarget; + if (!range2.equalsRange(this._stickyRangeProjectedOnEditor)) { + this._stickyRangeProjectedOnEditor = range2; + sessionStore.clear(); + } else if (textElement.style.textDecoration === "underline") { + return; + } + const cancellationToken = new CancellationTokenSource(); + sessionStore.add(toDisposable(() => cancellationToken.dispose(true))); + let currentHTMLChild; + getDefinitionsAtPosition(this._languageFeaturesService.definitionProvider, this._editor.getModel(), new Position(range2.startLineNumber, range2.startColumn + 1), false, cancellationToken.token).then(((candidateDefinitions) => { + if (cancellationToken.token.isCancellationRequested) { + return; + } + if (candidateDefinitions.length !== 0) { + this._candidateDefinitionsLength = candidateDefinitions.length; + const childHTML = textElement; + if (currentHTMLChild !== childHTML) { + sessionStore.clear(); + currentHTMLChild = childHTML; + currentHTMLChild.style.textDecoration = "underline"; + sessionStore.add(toDisposable(() => { + currentHTMLChild.style.textDecoration = "none"; + })); + } else if (!currentHTMLChild) { + currentHTMLChild = childHTML; + currentHTMLChild.style.textDecoration = "underline"; + sessionStore.add(toDisposable(() => { + currentHTMLChild.style.textDecoration = "none"; + })); + } + } else { + sessionStore.clear(); + } + })); + })); + this._register(gesture.onCancel(() => { + sessionStore.clear(); + })); + this._register(gesture.onExecute(async (e) => { + if (e.target.type !== 12 || e.target.detail !== this._stickyScrollWidget.getId()) { + return; + } + const position = this._stickyScrollWidget.getEditorPositionFromNode(e.target.element); + if (!position) { + return; + } + if (!this._editor.hasModel() || !this._stickyRangeProjectedOnEditor) { + return; + } + if (this._candidateDefinitionsLength > 1) { + if (this._focused) { + this._disposeFocusStickyScrollStore(); + } + this._revealPosition({ lineNumber: position.lineNumber, column: 1 }); + } + this._instaService.invokeFunction(goToDefinitionWithLocation, e, this._editor, { uri: this._editor.getModel().uri, range: this._stickyRangeProjectedOnEditor }); + })); + } + _onContextMenu(targetWindow, e) { + const event = new StandardMouseEvent(targetWindow, e); + this._contextMenuService.showContextMenu({ + menuId: MenuId.StickyScrollContext, + getAnchor: () => event + }); + } + _onMouseMoveOrKeyDown(mouseEvent) { + if (!mouseEvent.shiftKey) { + return; + } + if (!this._mouseTarget || !isHTMLElement(this._mouseTarget)) { + return; + } + const currentEndForLineIndex = this._stickyScrollWidget.getLineIndexFromChildDomNode(this._mouseTarget); + if (currentEndForLineIndex === null || this._showEndForLine === currentEndForLineIndex) { + return; + } + this._showEndForLine = currentEndForLineIndex; + this._renderStickyScroll(); + } + _toggleFoldingRegionForLine(line) { + if (!this._foldingModel || line === null) { + return; + } + const stickyLine = this._stickyScrollWidget.getRenderedStickyLine(line); + const foldingIcon = stickyLine?.foldingIcon; + if (!foldingIcon) { + return; + } + toggleCollapseState(this._foldingModel, 1, [line]); + foldingIcon.isCollapsed = !foldingIcon.isCollapsed; + const scrollTop = (foldingIcon.isCollapsed ? this._editor.getTopForLineNumber(foldingIcon.foldingEndLine) : this._editor.getTopForLineNumber(foldingIcon.foldingStartLine)) - this._editor.getOption( + 75 + /* EditorOption.lineHeight */ + ) * stickyLine.index + 1; + this._editor.setScrollTop(scrollTop); + this._renderStickyScroll(line); + } + _readConfiguration() { + const options2 = this._editor.getOption( + 131 + /* EditorOption.stickyScroll */ + ); + if (options2.enabled === false) { + this._editor.removeOverlayWidget(this._stickyScrollWidget); + this._resetState(); + this._sessionStore.clear(); + this._enabled = false; + return; + } else if (options2.enabled && !this._enabled) { + this._editor.addOverlayWidget(this._stickyScrollWidget); + this._sessionStore.add(this._editor.onDidScrollChange((e) => { + if (e.scrollTopChanged) { + this._showEndForLine = void 0; + this._renderStickyScroll(); + } + })); + this._sessionStore.add(this._editor.onDidLayoutChange(() => this._onDidResize())); + this._sessionStore.add(this._editor.onDidChangeModelTokens((e) => this._onTokensChange(e))); + this._sessionStore.add(this._stickyLineCandidateProvider.onDidChangeStickyScroll(() => { + this._showEndForLine = void 0; + this._renderStickyScroll(); + })); + this._enabled = true; + } + const lineNumberOption = this._editor.getOption( + 76 + /* EditorOption.lineNumbers */ + ); + if (lineNumberOption.renderType === 2) { + this._sessionStore.add(this._editor.onDidChangeCursorPosition(() => { + this._showEndForLine = void 0; + this._renderStickyScroll(0); + })); + } + } + _readConfigurationChange(event) { + if (event.hasChanged( + 131 + /* EditorOption.stickyScroll */ + ) || event.hasChanged( + 81 + /* EditorOption.minimap */ + ) || event.hasChanged( + 75 + /* EditorOption.lineHeight */ + ) || event.hasChanged( + 126 + /* EditorOption.showFoldingControls */ + ) || event.hasChanged( + 76 + /* EditorOption.lineNumbers */ + )) { + this._readConfiguration(); + } + if (event.hasChanged( + 76 + /* EditorOption.lineNumbers */ + ) || event.hasChanged( + 52 + /* EditorOption.folding */ + ) || event.hasChanged( + 126 + /* EditorOption.showFoldingControls */ + )) { + this._renderStickyScroll(0); + } + } + _needsUpdate(event) { + const stickyLineNumbers = this._stickyScrollWidget.getCurrentLines(); + for (const stickyLineNumber of stickyLineNumbers) { + for (const range2 of event.ranges) { + if (stickyLineNumber >= range2.fromLineNumber && stickyLineNumber <= range2.toLineNumber) { + return true; + } + } + } + return false; + } + _onTokensChange(event) { + if (this._needsUpdate(event)) { + this._renderStickyScroll(0); + } + } + _onDidResize() { + const layoutInfo = this._editor.getLayoutInfo(); + const theoreticalLines = layoutInfo.height / this._editor.getOption( + 75 + /* EditorOption.lineHeight */ + ); + this._maxStickyLines = Math.round(theoreticalLines * 0.25); + this._renderStickyScroll(0); + } + async _renderStickyScroll(rebuildFromLine) { + const model = this._editor.getModel(); + if (!model || model.isTooLargeForTokenization()) { + this._resetState(); + return; + } + const nextRebuildFromLine = this._updateAndGetMinRebuildFromLine(rebuildFromLine); + const stickyWidgetVersion = this._stickyLineCandidateProvider.getVersionId(); + const shouldUpdateState = stickyWidgetVersion === void 0 || stickyWidgetVersion === model.getVersionId(); + if (shouldUpdateState) { + if (!this._focused) { + await this._updateState(nextRebuildFromLine); + } else { + if (this._focusedStickyElementIndex === -1) { + await this._updateState(nextRebuildFromLine); + this._focusedStickyElementIndex = this._stickyScrollWidget.lineNumberCount - 1; + if (this._focusedStickyElementIndex !== -1) { + this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex); + } + } else { + const focusedStickyElementLineNumber = this._stickyScrollWidget.lineNumbers[this._focusedStickyElementIndex]; + await this._updateState(nextRebuildFromLine); + if (this._stickyScrollWidget.lineNumberCount === 0) { + this._focusedStickyElementIndex = -1; + } else { + const previousFocusedLineNumberExists = this._stickyScrollWidget.lineNumbers.includes(focusedStickyElementLineNumber); + if (!previousFocusedLineNumberExists) { + this._focusedStickyElementIndex = this._stickyScrollWidget.lineNumberCount - 1; + } + this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex); + } + } + } + } + } + _updateAndGetMinRebuildFromLine(rebuildFromLine) { + if (rebuildFromLine !== void 0) { + const minRebuildFromLineOrInfinity = this._minRebuildFromLine !== void 0 ? this._minRebuildFromLine : Infinity; + this._minRebuildFromLine = Math.min(rebuildFromLine, minRebuildFromLineOrInfinity); + } + return this._minRebuildFromLine; + } + async _updateState(rebuildFromLine) { + this._minRebuildFromLine = void 0; + this._foldingModel = await FoldingController.get(this._editor)?.getFoldingModel() ?? void 0; + this._widgetState = this.findScrollWidgetState(); + const stickyWidgetHasLines = this._widgetState.startLineNumbers.length > 0; + this._stickyScrollVisibleContextKey.set(stickyWidgetHasLines); + this._stickyScrollWidget.setState(this._widgetState, this._foldingModel, rebuildFromLine); + } + async _resetState() { + this._minRebuildFromLine = void 0; + this._foldingModel = void 0; + this._widgetState = StickyScrollWidgetState.Empty; + this._stickyScrollVisibleContextKey.set(false); + this._stickyScrollWidget.setState(void 0, void 0); + } + findScrollWidgetState() { + const maxNumberStickyLines = Math.min(this._maxStickyLines, this._editor.getOption( + 131 + /* EditorOption.stickyScroll */ + ).maxLineCount); + const scrollTop = this._editor.getScrollTop(); + let lastLineRelativePosition = 0; + const startLineNumbers = []; + const endLineNumbers = []; + const arrayVisibleRanges = this._editor.getVisibleRanges(); + if (arrayVisibleRanges.length !== 0) { + const fullVisibleRange = new StickyRange(arrayVisibleRanges[0].startLineNumber, arrayVisibleRanges[arrayVisibleRanges.length - 1].endLineNumber); + const candidateRanges = this._stickyLineCandidateProvider.getCandidateStickyLinesIntersecting(fullVisibleRange); + for (const range2 of candidateRanges) { + const start = range2.startLineNumber; + const end = range2.endLineNumber; + const topOfElement = range2.top; + const bottomOfElement = topOfElement + range2.height; + const topOfBeginningLine = this._editor.getTopForLineNumber(start) - scrollTop; + const bottomOfEndLine = this._editor.getBottomForLineNumber(end) - scrollTop; + if (topOfElement > topOfBeginningLine && topOfElement <= bottomOfEndLine) { + startLineNumbers.push(start); + endLineNumbers.push(end + 1); + if (bottomOfElement > bottomOfEndLine) { + lastLineRelativePosition = bottomOfEndLine - bottomOfElement; + } + } + if (startLineNumbers.length === maxNumberStickyLines) { + break; + } + } + } + this._endLineNumbers = endLineNumbers; + return new StickyScrollWidgetState(startLineNumbers, endLineNumbers, lastLineRelativePosition, this._showEndForLine); + } + dispose() { + super.dispose(); + this._sessionStore.dispose(); + } +}; +StickyScrollController2 = StickyScrollController_1 = __decorate119([ + __param113(1, IContextMenuService), + __param113(2, ILanguageFeaturesService), + __param113(3, IInstantiationService), + __param113(4, ILanguageConfigurationService), + __param113(5, ILanguageFeatureDebounceService), + __param113(6, IContextKeyService) +], StickyScrollController2); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/theme.js +init_errors(); +init_observable(); +init_nls(); +init_colorRegistry(); +init_colorUtils(); +var originalBackgroundColor = registerColor("inlineEdit.originalBackground", transparent(diffRemoved, 0.2), localize(1220, "Background color for the original text in inline edits."), true); +var modifiedBackgroundColor = registerColor("inlineEdit.modifiedBackground", transparent(diffInserted, 0.3), localize(1221, "Background color for the modified text in inline edits."), true); +var originalChangedLineBackgroundColor = registerColor("inlineEdit.originalChangedLineBackground", transparent(diffRemoved, 0.8), localize(1222, "Background color for the changed lines in the original text of inline edits."), true); +var originalChangedTextOverlayColor = registerColor("inlineEdit.originalChangedTextBackground", transparent(diffRemoved, 0.8), localize(1223, "Overlay color for the changed text in the original text of inline edits."), true); +var modifiedChangedLineBackgroundColor = registerColor("inlineEdit.modifiedChangedLineBackground", { + light: transparent(diffInsertedLine, 0.7), + dark: transparent(diffInsertedLine, 0.7), + hcDark: diffInsertedLine, + hcLight: diffInsertedLine +}, localize(1224, "Background color for the changed lines in the modified text of inline edits."), true); +var modifiedChangedTextOverlayColor = registerColor("inlineEdit.modifiedChangedTextBackground", transparent(diffInserted, 0.7), localize(1225, "Overlay color for the changed text in the modified text of inline edits."), true); +var inlineEditIndicatorPrimaryForeground = registerColor("inlineEdit.gutterIndicator.primaryForeground", buttonForeground, localize(1226, "Foreground color for the primary inline edit gutter indicator.")); +var inlineEditIndicatorPrimaryBorder = registerColor("inlineEdit.gutterIndicator.primaryBorder", buttonBackground, localize(1227, "Border color for the primary inline edit gutter indicator.")); +var inlineEditIndicatorPrimaryBackground = registerColor("inlineEdit.gutterIndicator.primaryBackground", { + light: transparent(inlineEditIndicatorPrimaryBorder, 0.5), + dark: transparent(inlineEditIndicatorPrimaryBorder, 0.4), + hcDark: transparent(inlineEditIndicatorPrimaryBorder, 0.4), + hcLight: transparent(inlineEditIndicatorPrimaryBorder, 0.5) +}, localize(1228, "Background color for the primary inline edit gutter indicator.")); +var inlineEditIndicatorSecondaryForeground = registerColor("inlineEdit.gutterIndicator.secondaryForeground", buttonSecondaryForeground, localize(1229, "Foreground color for the secondary inline edit gutter indicator.")); +var inlineEditIndicatorSecondaryBorder = registerColor("inlineEdit.gutterIndicator.secondaryBorder", buttonSecondaryBackground, localize(1230, "Border color for the secondary inline edit gutter indicator.")); +var inlineEditIndicatorSecondaryBackground = registerColor("inlineEdit.gutterIndicator.secondaryBackground", inlineEditIndicatorSecondaryBorder, localize(1231, "Background color for the secondary inline edit gutter indicator.")); +var inlineEditIndicatorsuccessfulForeground = registerColor("inlineEdit.gutterIndicator.successfulForeground", buttonForeground, localize(1232, "Foreground color for the successful inline edit gutter indicator.")); +var inlineEditIndicatorsuccessfulBorder = registerColor("inlineEdit.gutterIndicator.successfulBorder", buttonBackground, localize(1233, "Border color for the successful inline edit gutter indicator.")); +var inlineEditIndicatorsuccessfulBackground = registerColor("inlineEdit.gutterIndicator.successfulBackground", inlineEditIndicatorsuccessfulBorder, localize(1234, "Background color for the successful inline edit gutter indicator.")); +var inlineEditIndicatorBackground = registerColor("inlineEdit.gutterIndicator.background", { + hcDark: transparent("tab.inactiveBackground", 0.5), + hcLight: transparent("tab.inactiveBackground", 0.5), + dark: transparent("tab.inactiveBackground", 0.5), + light: "#5f5f5f18" +}, localize(1235, "Background color for the inline edit gutter indicator.")); +var originalBorder = registerColor("inlineEdit.originalBorder", { + light: diffRemoved, + dark: diffRemoved, + hcDark: diffRemoved, + hcLight: diffRemoved +}, localize(1236, "Border color for the original text in inline edits.")); +var modifiedBorder = registerColor("inlineEdit.modifiedBorder", { + light: darken(diffInserted, 0.6), + dark: diffInserted, + hcDark: diffInserted, + hcLight: diffInserted +}, localize(1237, "Border color for the modified text in inline edits.")); +var tabWillAcceptModifiedBorder = registerColor("inlineEdit.tabWillAcceptModifiedBorder", { + light: darken(modifiedBorder, 0), + dark: darken(modifiedBorder, 0), + hcDark: darken(modifiedBorder, 0), + hcLight: darken(modifiedBorder, 0) +}, localize(1238, "Modified border color for the inline edits widget when tab will accept it.")); +var tabWillAcceptOriginalBorder = registerColor("inlineEdit.tabWillAcceptOriginalBorder", { + light: darken(originalBorder, 0), + dark: darken(originalBorder, 0), + hcDark: darken(originalBorder, 0), + hcLight: darken(originalBorder, 0) +}, localize(1239, "Original border color for the inline edits widget over the original text when tab will accept it.")); +function getModifiedBorderColor(tabAction) { + return tabAction.map((a) => a === InlineEditTabAction.Accept ? tabWillAcceptModifiedBorder : modifiedBorder); +} +function getOriginalBorderColor(tabAction) { + return tabAction.map((a) => a === InlineEditTabAction.Accept ? tabWillAcceptOriginalBorder : originalBorder); +} +function getEditorBlendedColor(colorIdentifier, themeService) { + let color; + if (typeof colorIdentifier === "string") { + color = observeColor(colorIdentifier, themeService); + } else { + color = colorIdentifier.map((identifier, reader) => observeColor(identifier, themeService).read(reader)); + } + const backgroundColor = observeColor(editorBackground, themeService); + return color.map((c, reader) => ( + /** @description makeOpaque */ + c.makeOpaque(backgroundColor.read(reader)) + )); +} +function observeColor(colorIdentifier, themeService) { + return observableFromEventOpts({ + owner: { observeColor: colorIdentifier }, + equalsFn: (a, b) => a.equals(b), + debugName: () => `observeColor(${colorIdentifier})` + }, themeService.onDidColorThemeChange, () => { + const color = themeService.getColorTheme().getColor(colorIdentifier); + if (!color) { + throw new BugIndicatingError(`Missing color: ${colorIdentifier}`); + } + return color; + }); +} + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/utils/utils.js +init_arrays(); +init_arraysFind(); +init_observable(); +init_strings(); +init_observableCodeEditor(); +init_offsetRange(); +init_position(); +init_range(); +init_textModel(); +init_errors(); +function maxContentWidthInRange(editor2, range2, reader) { + editor2.layoutInfo.read(reader); + editor2.value.read(reader); + const model = editor2.model.read(reader); + if (!model) { + return 0; + } + let maxContentWidth = 0; + editor2.scrollTop.read(reader); + for (let i2 = range2.startLineNumber; i2 < range2.endLineNumberExclusive; i2++) { + const column = model.getLineMaxColumn(i2); + let lineContentWidth = editor2.editor.getOffsetForColumn(i2, column); + if (lineContentWidth === -1) { + const typicalHalfwidthCharacterWidth = editor2.editor.getOption( + 59 + /* EditorOption.fontInfo */ + ).typicalHalfwidthCharacterWidth; + const approximation = column * typicalHalfwidthCharacterWidth; + lineContentWidth = approximation; + } + maxContentWidth = Math.max(maxContentWidth, lineContentWidth); + } + const lines = range2.mapToLineArray((l) => model.getLineContent(l)); + if (maxContentWidth < 5 && lines.some((l) => l.length > 0) && model.uri.scheme !== "file") { + console.error("unexpected width"); + } + return maxContentWidth; +} +function getOffsetForPos(editor2, pos, reader) { + editor2.layoutInfo.read(reader); + editor2.value.read(reader); + const model = editor2.model.read(reader); + if (!model) { + return 0; + } + editor2.scrollTop.read(reader); + const lineContentWidth = editor2.editor.getOffsetForColumn(pos.lineNumber, pos.column); + return lineContentWidth; +} +function getPrefixTrim(diffRanges, originalLinesRange, modifiedLines, editor2, reader = void 0) { + const textModel = editor2.getModel(); + if (!textModel) { + return { prefixTrim: 0, prefixLeftOffset: 0 }; + } + const replacementStart = diffRanges.map((r) => r.isSingleLine() ? r.startColumn - 1 : 0); + const originalIndents = originalLinesRange.mapToLineArray((line) => indentOfLine(textModel.getLineContent(line))); + const modifiedIndents = modifiedLines.filter((line) => line !== "").map((line) => indentOfLine(line)); + const prefixTrim = Math.min(...replacementStart, ...originalIndents, ...modifiedIndents); + let prefixLeftOffset; + const startLineIndent = textModel.getLineIndentColumn(originalLinesRange.startLineNumber); + if (startLineIndent >= prefixTrim + 1) { + observableCodeEditor(editor2).scrollTop.read(reader); + prefixLeftOffset = editor2.getOffsetForColumn(originalLinesRange.startLineNumber, prefixTrim + 1); + } else if (modifiedLines.length > 0) { + prefixLeftOffset = getContentRenderWidth(modifiedLines[0].slice(0, prefixTrim), editor2, textModel); + } else { + return { prefixTrim: 0, prefixLeftOffset: 0 }; + } + return { prefixTrim, prefixLeftOffset }; +} +function getContentRenderWidth(content, editor2, textModel) { + const w = editor2.getOption( + 59 + /* EditorOption.fontInfo */ + ).typicalHalfwidthCharacterWidth; + const tabSize = textModel.getOptions().tabSize * w; + const numTabs = content.split(" ").length - 1; + const numNoneTabs = content.length - numTabs; + return numNoneTabs * w + numTabs * tabSize; +} +function getEditorValidOverlayRect(editor2) { + const contentLeft = editor2.layoutInfoContentLeft; + const width2 = derived({ name: "editor.validOverlay.width" }, (r) => { + const hasMinimapOnTheRight = editor2.layoutInfoMinimap.read(r).minimapLeft !== 0; + const editorWidth = editor2.layoutInfoWidth.read(r) - contentLeft.read(r); + if (hasMinimapOnTheRight) { + const minimapAndScrollbarWidth = editor2.layoutInfoMinimap.read(r).minimapWidth + editor2.layoutInfoVerticalScrollbarWidth.read(r); + return editorWidth - minimapAndScrollbarWidth; + } + return editorWidth; + }); + const height = derived({ name: "editor.validOverlay.height" }, (r) => editor2.layoutInfoHeight.read(r) + editor2.contentHeight.read(r)); + return derived({ name: "editor.validOverlay" }, (r) => Rect.fromLeftTopWidthHeight(contentLeft.read(r), 0, width2.read(r), height.read(r))); +} +function applyEditToModifiedRangeMappings(rangeMapping, edit2) { + const updatedMappings = []; + for (const m of rangeMapping) { + const updatedRange = edit2.mapRange(m.modifiedRange); + updatedMappings.push(new RangeMapping(m.originalRange, updatedRange)); + } + return updatedMappings; +} +function classNames(...classes2) { + return classes2.filter((c) => typeof c === "string").join(" "); +} +function offsetRangeToRange(columnOffsetRange, startPos) { + return new Range(startPos.lineNumber, startPos.column + columnOffsetRange.start, startPos.lineNumber, startPos.column + columnOffsetRange.endExclusive); +} +function getIndentationSize(line, tabSize) { + let currentSize = 0; + loop: for (let i2 = 0, len = line.length; i2 < len; i2++) { + switch (line.charCodeAt(i2)) { + case 9: + currentSize += tabSize; + break; + case 32: + currentSize++; + break; + default: + break loop; + } + } + return currentSize - currentSize % tabSize; +} +function indentSizeToIndentLength(line, indentSize, tabSize) { + let remainingSize = indentSize - indentSize % tabSize; + let i2 = 0; + for (; i2 < line.length; i2++) { + if (remainingSize === 0) { + break; + } + switch (line.charCodeAt(i2)) { + case 9: + remainingSize -= tabSize; + break; + case 32: + remainingSize--; + break; + default: + throw new BugIndicatingError("Unexpected character found while calculating indent length"); + } + } + return i2; +} +function createReindentEdit(text2, range2, tabSize) { + const newLines = splitLines(text2); + const edits = []; + const minIndentSize = findFirstMin(range2.mapToLineArray((l) => getIndentationSize(newLines[l - 1], tabSize)), numberComparator); + range2.forEach((lineNumber) => { + const indentLength = indentSizeToIndentLength(newLines[lineNumber - 1], minIndentSize, tabSize); + edits.push(new TextReplacement(offsetRangeToRange(new OffsetRange(0, indentLength), new Position(lineNumber, 1)), "")); + }); + return new TextEdit(edits); +} +var PathBuilder = class { + constructor() { + this._data = ""; + } + moveTo(point) { + this._data += `M ${point.x} ${point.y} `; + return this; + } + lineTo(point) { + this._data += `L ${point.x} ${point.y} `; + return this; + } + build() { + return this._data; + } +}; +function mapOutFalsy(obs) { + const nonUndefinedObs = derivedObservableWithCache(void 0, (reader, lastValue) => obs.read(reader) || lastValue); + return derivedOpts({ + debugName: () => `${obs.debugName}.mapOutFalsy` + }, (reader) => { + nonUndefinedObs.read(reader); + const val = obs.read(reader); + if (!val) { + return void 0; + } + return nonUndefinedObs; + }); +} +function rectToProps(fn, debugLocation = DebugLocation.ofCaller()) { + return { + left: derived({ name: "editor.validOverlay.left" }, (reader) => ( + /** @description left */ + fn(reader).left + ), debugLocation), + top: derived({ name: "editor.validOverlay.top" }, (reader) => ( + /** @description top */ + fn(reader).top + ), debugLocation), + width: derived({ name: "editor.validOverlay.width" }, (reader) => ( + /** @description width */ + fn(reader).right - fn(reader).left + ), debugLocation), + height: derived({ name: "editor.validOverlay.height" }, (reader) => ( + /** @description height */ + fn(reader).bottom - fn(reader).top + ), debugLocation) + }; +} + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorMenu.js +init_dom(); +init_iconLabels2(); +init_codicons(); +init_observable(); +init_platform(); +init_themables(); +init_nls(); +init_commands(); +init_contextkey(); +init_colorRegistry(); +var __decorate120 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param114 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var GutterIndicatorMenuContent = class GutterIndicatorMenuContent2 { + constructor(_model, _close, _editorObs, _contextKeyService, _keybindingService, _commandService) { + this._model = _model; + this._close = _close; + this._editorObs = _editorObs; + this._contextKeyService = _contextKeyService; + this._keybindingService = _keybindingService; + this._commandService = _commandService; + this._inlineEditsShowCollapsed = this._editorObs.getOption( + 71 + /* EditorOption.inlineSuggest */ + ).map((s) => s.edits.showCollapsed); + } + toDisposableLiveElement() { + return this._createHoverContent().toDisposableLiveElement(); + } + _createHoverContent() { + const activeElement = observableValue("active", void 0); + const createOptionArgs = (options2) => { + return { + title: options2.title, + icon: options2.icon, + keybinding: typeof options2.commandId === "string" ? this._getKeybinding(options2.commandArgs ? void 0 : options2.commandId) : derived(this, (reader) => typeof options2.commandId === "string" ? void 0 : this._getKeybinding(options2.commandArgs ? void 0 : options2.commandId.read(reader)).read(reader)), + isActive: activeElement.map((v) => v === options2.id), + onHoverChange: (v) => activeElement.set(v ? options2.id : void 0, void 0), + onAction: () => { + this._close(true); + return this._commandService.executeCommand(typeof options2.commandId === "string" ? options2.commandId : options2.commandId.get(), ...options2.commandArgs ?? []); + } + }; + }; + const title = header(this._model.displayName); + const gotoAndAccept = option(createOptionArgs({ + id: "gotoAndAccept", + title: `${localize(1212, "Go To")} / ${localize(1213, "Accept")}`, + icon: Codicon.check, + commandId: inlineSuggestCommitId + })); + const reject = option(createOptionArgs({ + id: "reject", + title: localize(1214, "Reject"), + icon: Codicon.close, + commandId: hideInlineCompletionId + })); + const extensionCommands = this._model.extensionCommands.map((c, idx) => option(createOptionArgs({ + id: c.command.id + "_" + idx, + title: c.command.title, + icon: c.icon ?? Codicon.symbolEvent, + commandId: c.command.id, + commandArgs: c.command.arguments + }))); + const toggleCollapsedMode = this._inlineEditsShowCollapsed.map((showCollapsed) => showCollapsed ? option(createOptionArgs({ + id: "showExpanded", + title: localize(1215, "Show Expanded"), + icon: Codicon.expandAll, + commandId: toggleShowCollapsedId + })) : option(createOptionArgs({ + id: "showCollapsed", + title: localize(1216, "Show Collapsed"), + icon: Codicon.collapseAll, + commandId: toggleShowCollapsedId + }))); + const snooze = option(createOptionArgs({ + id: "snooze", + title: localize(1217, "Snooze"), + icon: Codicon.bellSlash, + commandId: "editor.action.inlineSuggest.snooze" + })); + const settings = option(createOptionArgs({ + id: "settings", + title: localize(1218, "Settings"), + icon: Codicon.gear, + commandId: "workbench.action.openSettings", + commandArgs: ["@tag:nextEditSuggestions"] + })); + const actions = this._model.action ? [this._model.action] : []; + const actionBarFooter = actions.length > 0 ? actionBar(actions.map((action) => ({ + id: action.id, + label: action.title + "...", + enabled: true, + run: () => this._commandService.executeCommand(action.id, ...action.arguments ?? []), + class: void 0, + tooltip: action.tooltip ?? action.title + })), { + hoverDelegate: nativeHoverDelegate + /* unable to show hover inside another hover */ + }) : void 0; + return hoverContent([ + title, + gotoAndAccept, + reject, + toggleCollapsedMode, + extensionCommands.length ? separator() : void 0, + snooze, + settings, + ...extensionCommands, + actionBarFooter ? separator() : void 0, + actionBarFooter + ]); + } + _getKeybinding(commandId) { + if (!commandId) { + return constObservable(void 0); + } + return observableFromEvent(this._contextKeyService.onDidChangeContext, () => this._keybindingService.lookupKeybinding(commandId)); + } +}; +GutterIndicatorMenuContent = __decorate120([ + __param114(3, IContextKeyService), + __param114(4, IKeybindingService), + __param114(5, ICommandService) +], GutterIndicatorMenuContent); +function hoverContent(content) { + return n.div({ + class: "content", + style: { + margin: 4, + minWidth: 180 + } + }, content); +} +function header(title) { + return n.div({ + class: "header", + style: { + color: asCssVariable(descriptionForeground), + fontSize: "13px", + fontWeight: "600", + padding: "0 4px", + lineHeight: 28 + } + }, [title]); +} +function option(props) { + return derived({ name: "inlineEdits.option" }, (_reader) => n.div({ + class: ["monaco-menu-option", props.isActive?.map((v) => v && "active")], + onmouseenter: () => props.onHoverChange?.(true), + onmouseleave: () => props.onHoverChange?.(false), + onclick: props.onAction, + onkeydown: (e) => { + if (e.key === "Enter") { + props.onAction?.(); + } + }, + tabIndex: 0, + style: { + borderRadius: 3 + // same as hover widget border radius + } + }, [ + n.elem("span", { + style: { + fontSize: 16, + display: "flex" + } + }, [ThemeIcon.isThemeIcon(props.icon) ? renderIcon(props.icon) : props.icon.map((icon) => renderIcon(icon))]), + n.elem("span", {}, [props.title]), + n.div({ + style: { marginLeft: "auto" }, + ref: (elem) => { + const keybindingLabel = _reader.store.add(new KeybindingLabel(elem, OS, { + disableTitle: true, + ...defaultKeybindingLabelStyles, + keybindingLabelShadow: void 0, + keybindingLabelForeground: asCssVariable(descriptionForeground), + keybindingLabelBackground: "transparent", + keybindingLabelBorder: "transparent", + keybindingLabelBottomBorder: void 0 + })); + _reader.store.add(autorun((reader) => { + keybindingLabel.set(props.keybinding.read(reader)); + })); + } + }) + ])); +} +function actionBar(actions, options2) { + return derived({ name: "inlineEdits.actionBar" }, (_reader) => n.div({ + class: ["action-widget-action-bar"], + style: { + padding: "3px 24px" + } + }, [ + n.div({ + ref: (elem) => { + const actionBar2 = _reader.store.add(new ActionBar(elem, options2)); + actionBar2.push(actions, { icon: false, label: true }); + } + }) + ])); +} +function separator() { + return n.div({ + id: "inline-edit-gutter-indicator-menu-separator", + class: "menu-separator", + style: { + color: asCssVariable(editorActionListForeground), + padding: "2px 0" + } + }, n.div({ + style: { + borderBottom: `1px solid ${asCssVariable(editorHoverBorder)}` + } + })); +} + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.js +init_assert(); +var __decorate121 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param115 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var InlineEditsGutterIndicator = class InlineEditsGutterIndicator2 extends Disposable { + get model() { + const model = this._model.get(); + if (!model) { + throw new BugIndicatingError("Inline Edit Model not available"); + } + return model; + } + constructor(_editorObs, _originalRange, _verticalOffset, _model, _isHoveringOverInlineEdit, _focusIsInMenu, _hoverService, _instantiationService, _accessibilityService, themeService) { + super(); + this._editorObs = _editorObs; + this._originalRange = _originalRange; + this._verticalOffset = _verticalOffset; + this._model = _model; + this._isHoveringOverInlineEdit = _isHoveringOverInlineEdit; + this._focusIsInMenu = _focusIsInMenu; + this._hoverService = _hoverService; + this._instantiationService = _instantiationService; + this._accessibilityService = _accessibilityService; + this._tabAction = derived(this, (reader) => { + const model = this._model.read(reader); + if (!model) { + return InlineEditTabAction.Inactive; + } + return model.tabAction.read(reader); + }); + this._hoverVisible = observableValue(this, false); + this.isHoverVisible = this._hoverVisible; + this._isHoveredOverIcon = observableValue(this, false); + this._isHoveredOverIconDebounced = debouncedObservable(this._isHoveredOverIcon, 100); + this.isHoveredOverIcon = this._isHoveredOverIconDebounced; + this._isHoveredOverInlineEditDebounced = debouncedObservable(this._isHoveringOverInlineEdit, 100); + this._gutterIndicatorStyles = this._tabAction.map(this, (v, reader) => { + switch (v) { + case InlineEditTabAction.Inactive: + return { + background: getEditorBlendedColor(inlineEditIndicatorSecondaryBackground, themeService).read(reader).toString(), + foreground: getEditorBlendedColor(inlineEditIndicatorSecondaryForeground, themeService).read(reader).toString(), + border: getEditorBlendedColor(inlineEditIndicatorSecondaryBorder, themeService).read(reader).toString() + }; + case InlineEditTabAction.Jump: + return { + background: getEditorBlendedColor(inlineEditIndicatorPrimaryBackground, themeService).read(reader).toString(), + foreground: getEditorBlendedColor(inlineEditIndicatorPrimaryForeground, themeService).read(reader).toString(), + border: getEditorBlendedColor(inlineEditIndicatorPrimaryBorder, themeService).read(reader).toString() + }; + case InlineEditTabAction.Accept: + return { + background: getEditorBlendedColor(inlineEditIndicatorsuccessfulBackground, themeService).read(reader).toString(), + foreground: getEditorBlendedColor(inlineEditIndicatorsuccessfulForeground, themeService).read(reader).toString(), + border: getEditorBlendedColor(inlineEditIndicatorsuccessfulBorder, themeService).read(reader).toString() + }; + default: + assertNever(v); + } + }); + this._originalRangeObs = mapOutFalsy(this._originalRange); + this._state = derived(this, (reader) => { + const range2 = this._originalRangeObs.read(reader); + if (!range2) { + return void 0; + } + return { + range: range2, + lineOffsetRange: this._editorObs.observeLineOffsetRange(range2, reader.store) + }; + }); + this._stickyScrollController = StickyScrollController2.get(this._editorObs.editor); + this._stickyScrollHeight = this._stickyScrollController ? observableFromEvent(this._stickyScrollController.onDidChangeStickyScrollHeight, () => this._stickyScrollController.stickyScrollWidgetHeight) : constObservable(0); + this._lineNumberToRender = derived(this, (reader) => { + if (this._verticalOffset.read(reader) !== 0) { + return ""; + } + const lineNumber = this._originalRange.read(reader)?.startLineNumber; + const lineNumberOptions = this._editorObs.getOption( + 76 + /* EditorOption.lineNumbers */ + ).read(reader); + if (lineNumber === void 0 || lineNumberOptions.renderType === 0) { + return ""; + } + if (lineNumberOptions.renderType === 3) { + const cursorPosition = this._editorObs.cursorPosition.read(reader); + if (lineNumber % 10 === 0 || cursorPosition && cursorPosition.lineNumber === lineNumber) { + return lineNumber.toString(); + } + return ""; + } + if (lineNumberOptions.renderType === 2) { + const cursorPosition = this._editorObs.cursorPosition.read(reader); + if (!cursorPosition) { + return ""; + } + const relativeLineNumber = Math.abs(lineNumber - cursorPosition.lineNumber); + if (relativeLineNumber === 0) { + return lineNumber.toString(); + } + return relativeLineNumber.toString(); + } + if (lineNumberOptions.renderType === 4) { + if (lineNumberOptions.renderFn) { + return lineNumberOptions.renderFn(lineNumber); + } + return ""; + } + return lineNumber.toString(); + }); + this._availableWidthForIcon = derived(this, (reader) => { + const textModel = this._editorObs.editor.getModel(); + const editor2 = this._editorObs.editor; + const layout2 = this._editorObs.layoutInfo.read(reader); + const gutterWidth = layout2.decorationsLeft + layout2.decorationsWidth - layout2.glyphMarginLeft; + if (!textModel || gutterWidth <= 0) { + return () => 0; + } + if (layout2.lineNumbersLeft === 0) { + return () => gutterWidth; + } + const lineNumberOptions = this._editorObs.getOption( + 76 + /* EditorOption.lineNumbers */ + ).read(reader); + if (lineNumberOptions.renderType === 2 || /* likely to flicker */ + lineNumberOptions.renderType === 0) { + return () => gutterWidth; + } + const w = editor2.getOption( + 59 + /* EditorOption.fontInfo */ + ).typicalHalfwidthCharacterWidth; + const rightOfLineNumber = layout2.lineNumbersLeft + layout2.lineNumbersWidth; + const totalLines = textModel.getLineCount(); + const totalLinesDigits = (totalLines + 1).toString().length; + const offsetDigits = []; + for (let digits = 1; digits <= totalLinesDigits; digits++) { + const firstLineNumberWithDigitCount = 10 ** (digits - 1); + const topOfLineNumber = editor2.getTopForLineNumber(firstLineNumberWithDigitCount); + const digitsWidth = digits * w; + const usableWidthLeftOfLineNumber = Math.min(gutterWidth, Math.max(0, rightOfLineNumber - digitsWidth - layout2.glyphMarginLeft)); + offsetDigits.push({ firstLineNumberWithDigitCount, topOfLineNumber, usableWidthLeftOfLineNumber }); + } + return (topOffset) => { + for (let i2 = offsetDigits.length - 1; i2 >= 0; i2--) { + if (topOffset >= offsetDigits[i2].topOfLineNumber) { + return offsetDigits[i2].usableWidthLeftOfLineNumber; + } + } + throw new BugIndicatingError("Could not find avilable width for icon"); + }; + }); + this._layout = derived(this, (reader) => { + const s = this._state.read(reader); + if (!s) { + return void 0; + } + const layout2 = this._editorObs.layoutInfo.read(reader); + const lineHeight = this._editorObs.observeLineHeightForLine(s.range.map((r) => r.startLineNumber)).read(reader); + const gutterViewPortPadding = 2; + const gutterWidthWithoutPadding = layout2.decorationsLeft + layout2.decorationsWidth - layout2.glyphMarginLeft - 2 * gutterViewPortPadding; + const gutterHeightWithoutPadding = layout2.height - 2 * gutterViewPortPadding; + const gutterViewPortWithStickyScroll = Rect.fromLeftTopWidthHeight(gutterViewPortPadding, gutterViewPortPadding, gutterWidthWithoutPadding, gutterHeightWithoutPadding); + const gutterViewPortWithoutStickyScrollWithoutPaddingTop = gutterViewPortWithStickyScroll.withTop(this._stickyScrollHeight.read(reader)); + const gutterViewPortWithoutStickyScroll = gutterViewPortWithStickyScroll.withTop(gutterViewPortWithoutStickyScrollWithoutPaddingTop.top + gutterViewPortPadding); + const verticalEditRange = s.lineOffsetRange.read(reader); + const gutterEditArea = Rect.fromRanges(OffsetRange.fromTo(gutterViewPortWithoutStickyScroll.left, gutterViewPortWithoutStickyScroll.right), verticalEditRange); + const pillHeight = lineHeight; + const pillOffset = this._verticalOffset.read(reader); + const pillFullyDockedRect = gutterEditArea.withHeight(pillHeight).translateY(pillOffset); + const pillIsFullyDocked = gutterViewPortWithoutStickyScrollWithoutPaddingTop.containsRect(pillFullyDockedRect); + const iconNoneDocked = this._tabAction.map((action) => action === InlineEditTabAction.Accept ? Codicon.keyboardTab : Codicon.arrowRight); + const iconDocked = derived(this, (reader2) => { + if (this._isHoveredOverIconDebounced.read(reader2) || this._isHoveredOverInlineEditDebounced.read(reader2)) { + return Codicon.check; + } + if (this._tabAction.read(reader2) === InlineEditTabAction.Accept) { + return Codicon.keyboardTab; + } + const cursorLineNumber = this._editorObs.cursorLineNumber.read(reader2) ?? 0; + const editStartLineNumber = s.range.read(reader2).startLineNumber; + return cursorLineNumber <= editStartLineNumber ? Codicon.keyboardTabAbove : Codicon.keyboardTabBelow; + }); + const idealIconWidth = 22; + const minimalIconWidth = 16; + const iconWidth = (pillRect2) => { + const availableWidth = this._availableWidthForIcon.read(void 0)(pillRect2.bottom + this._editorObs.editor.getScrollTop()) - gutterViewPortPadding; + return Math.max(Math.min(availableWidth, idealIconWidth), minimalIconWidth); + }; + if (pillIsFullyDocked) { + const pillRect2 = pillFullyDockedRect; + let lineNumberWidth; + if (layout2.lineNumbersWidth === 0) { + lineNumberWidth = Math.min(Math.max(layout2.lineNumbersLeft - gutterViewPortWithStickyScroll.left, 0), pillRect2.width - idealIconWidth); + } else { + lineNumberWidth = Math.max(layout2.lineNumbersLeft + layout2.lineNumbersWidth - gutterViewPortWithStickyScroll.left, 0); + } + const lineNumberRect = pillRect2.withWidth(lineNumberWidth); + const iconWidth2 = Math.max(Math.min(layout2.decorationsWidth, idealIconWidth), minimalIconWidth); + const iconRect2 = pillRect2.withWidth(iconWidth2).translateX(lineNumberWidth); + return { + gutterEditArea, + icon: iconDocked, + iconDirection: "right", + iconRect: iconRect2, + pillRect: pillRect2, + lineNumberRect + }; + } + const pillPartiallyDockedPossibleArea = gutterViewPortWithStickyScroll.intersect(gutterEditArea); + const pillIsPartiallyDocked = pillPartiallyDockedPossibleArea && pillPartiallyDockedPossibleArea.height >= pillHeight; + if (pillIsPartiallyDocked) { + const pillRectMoved2 = pillFullyDockedRect.moveToBeContainedIn(gutterViewPortWithoutStickyScroll).moveToBeContainedIn(pillPartiallyDockedPossibleArea); + const pillRect2 = pillRectMoved2.withWidth(iconWidth(pillRectMoved2)); + const iconRect2 = pillRect2; + return { + gutterEditArea, + icon: iconDocked, + iconDirection: "right", + iconRect: iconRect2, + pillRect: pillRect2 + }; + } + const pillRectMoved = pillFullyDockedRect.moveToBeContainedIn(gutterViewPortWithStickyScroll); + const pillRect = pillRectMoved.withWidth(iconWidth(pillRectMoved)); + const iconRect = pillRect; + const iconDirection = pillRect.top < pillFullyDockedRect.top ? "top" : "bottom"; + return { + gutterEditArea, + icon: iconNoneDocked, + iconDirection, + iconRect, + pillRect + }; + }); + this._iconRef = n.ref(); + this.isVisible = this._layout.map((l) => !!l); + this._indicator = n.div({ + class: "inline-edits-view-gutter-indicator", + onclick: () => { + const layout2 = this._layout.get(); + const acceptOnClick = layout2?.icon.get() === Codicon.check; + this._editorObs.editor.focus(); + if (acceptOnClick) { + this.model.accept(); + } else { + this.model.jump(); + } + }, + tabIndex: 0, + style: { + position: "absolute", + overflow: "visible" + } + }, mapOutFalsy(this._layout).map((layout2) => !layout2 ? [] : [ + n.div({ + style: { + position: "absolute", + background: asCssVariable(inlineEditIndicatorBackground), + borderRadius: "4px", + ...rectToProps((reader) => layout2.read(reader).gutterEditArea) + } + }), + n.div({ + class: "icon", + ref: this._iconRef, + onmouseenter: () => { + this._showHover(); + }, + style: { + cursor: "pointer", + zIndex: "20", + position: "absolute", + backgroundColor: this._gutterIndicatorStyles.map((v) => v.background), + // eslint-disable-next-line local/code-no-any-casts + ["--vscodeIconForeground"]: this._gutterIndicatorStyles.map((v) => v.foreground), + border: this._gutterIndicatorStyles.map((v) => `1px solid ${v.border}`), + boxSizing: "border-box", + borderRadius: "4px", + display: "flex", + justifyContent: "flex-end", + transition: "background-color 0.2s ease-in-out, width 0.2s ease-in-out", + ...rectToProps((reader) => layout2.read(reader).pillRect) + } + }, [ + n.div({ + className: "line-number", + style: { + lineHeight: layout2.map((l) => l.lineNumberRect ? l.lineNumberRect.height : 0), + display: layout2.map((l) => l.lineNumberRect ? "flex" : "none"), + alignItems: "center", + justifyContent: "flex-end", + width: layout2.map((l) => l.lineNumberRect ? l.lineNumberRect.width : 0), + height: "100%", + color: this._gutterIndicatorStyles.map((v) => v.foreground) + } + }, this._lineNumberToRender), + n.div({ + style: { + rotate: layout2.map((l) => `${getRotationFromDirection(l.iconDirection)}deg`), + transition: "rotate 0.2s ease-in-out", + display: "flex", + alignItems: "center", + justifyContent: "center", + height: "100%", + marginRight: layout2.map((l) => l.pillRect.width - l.iconRect.width - (l.lineNumberRect?.width ?? 0)), + width: layout2.map((l) => l.iconRect.width) + } + }, [ + layout2.map((l, reader) => renderIcon(l.icon.read(reader))) + ]) + ]) + ])).keepUpdated(this._store); + this._register(this._editorObs.createOverlayWidget({ + domNode: this._indicator.element, + position: constObservable(null), + allowEditorOverflow: false, + minContentWidthInPx: constObservable(0) + })); + this._register(this._editorObs.editor.onMouseMove((e) => { + const state = this._state.get(); + if (state === void 0) { + return; + } + const el = this._iconRef.element; + const rect = el.getBoundingClientRect(); + const rectangularArea = Rect.fromLeftTopWidthHeight(rect.left, rect.top, rect.width, rect.height); + const point = new Point(e.event.posx, e.event.posy); + this._isHoveredOverIcon.set(rectangularArea.containsPoint(point), void 0); + })); + this._register(this._editorObs.editor.onDidScrollChange(() => { + this._isHoveredOverIcon.set(false, void 0); + })); + this._register(runOnChange(this._isHoveredOverInlineEditDebounced, (isHovering) => { + if (isHovering) { + this.triggerAnimation(); + } + })); + this._register(autorun((reader) => { + this._indicator.readEffect(reader); + if (this._indicator.element) { + this._editorObs.editor.applyFontInfo(this._indicator.element); + } + })); + } + triggerAnimation() { + if (this._accessibilityService.isMotionReduced()) { + return new Animation(null, null).finished; + } + const animation = this._iconRef.element.animate([ + { + outline: `2px solid ${this._gutterIndicatorStyles.map((v) => v.border).get()}`, + outlineOffset: "-1px", + offset: 0 + }, + { + outline: `2px solid transparent`, + outlineOffset: "10px", + offset: 1 + } + ], { duration: 500 }); + return animation.finished; + } + _showHover() { + if (this._hoverVisible.get()) { + return; + } + const disposableStore = new DisposableStore(); + const content = disposableStore.add(this._instantiationService.createInstance(GutterIndicatorMenuContent, this.model, (focusEditor) => { + if (focusEditor) { + this._editorObs.editor.focus(); + } + h2?.dispose(); + }, this._editorObs).toDisposableLiveElement()); + const focusTracker = disposableStore.add(trackFocus(content.element)); + disposableStore.add(focusTracker.onDidBlur(() => this._focusIsInMenu.set(false, void 0))); + disposableStore.add(focusTracker.onDidFocus(() => this._focusIsInMenu.set(true, void 0))); + disposableStore.add(toDisposable(() => this._focusIsInMenu.set(false, void 0))); + const h2 = this._hoverService.showInstantHover({ + target: this._iconRef.element, + content: content.element + }); + if (h2) { + this._hoverVisible.set(true, void 0); + disposableStore.add(this._editorObs.editor.onDidScrollChange(() => h2.dispose())); + disposableStore.add(h2.onDispose(() => { + this._hoverVisible.set(false, void 0); + disposableStore.dispose(); + })); + } else { + disposableStore.dispose(); + } + } +}; +InlineEditsGutterIndicator = __decorate121([ + __param115(6, IHoverService), + __param115(7, IInstantiationService), + __param115(8, IAccessibilityService), + __param115(9, IThemeService) +], InlineEditsGutterIndicator); +function getRotationFromDirection(direction) { + switch (direction) { + case "top": + return 90; + case "bottom": + return -90; + case "right": + return 0; + } +} + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsNewUsers.js +init_async(); +init_errors(); +init_lifecycle(); +init_observable(); +init_configuration(); +var __decorate122 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param116 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var UserKind; +(function(UserKind2) { + UserKind2["FirstTime"] = "firstTime"; + UserKind2["SecondTime"] = "secondTime"; + UserKind2["Active"] = "active"; +})(UserKind || (UserKind = {})); +var InlineEditsOnboardingExperience = class InlineEditsOnboardingExperience2 extends Disposable { + constructor(_host, _model, _indicator, _collapsedView, _storageService, _configurationService) { + super(); + this._host = _host; + this._model = _model; + this._indicator = _indicator; + this._collapsedView = _collapsedView; + this._storageService = _storageService; + this._configurationService = _configurationService; + this._disposables = this._register(new MutableDisposable()); + this._setupDone = observableValue({ name: "setupDone" }, false); + this._activeCompletionId = derived((reader) => { + const model = this._model.read(reader); + if (!model) { + return void 0; + } + if (!this._setupDone.read(reader)) { + return void 0; + } + const indicator = this._indicator.read(reader); + if (!indicator || !indicator.isVisible.read(reader)) { + return void 0; + } + return model.inlineEdit.inlineCompletion.identity.id; + }); + this._register(this._initializeDebugSetting()); + this._disposables.value = this.setupNewUserExperience(); + this._setupDone.set(true, void 0); + } + setupNewUserExperience() { + if (this.getNewUserType() === UserKind.Active) { + return void 0; + } + const disposableStore = new DisposableStore(); + let userHasHoveredOverIcon = false; + let inlineEditHasBeenAccepted = false; + let firstTimeUserAnimationCount = 0; + let secondTimeUserAnimationCount = 0; + disposableStore.add(runOnChangeWithCancellationToken(this._activeCompletionId, async (id, _, __, token) => { + if (id === void 0) { + return; + } + let userType = this.getNewUserType(); + switch (userType) { + case UserKind.FirstTime: { + if (firstTimeUserAnimationCount++ >= 5 || userHasHoveredOverIcon) { + userType = UserKind.SecondTime; + this.setNewUserType(userType); + } + break; + } + case UserKind.SecondTime: { + if (secondTimeUserAnimationCount++ >= 3 && inlineEditHasBeenAccepted) { + userType = UserKind.Active; + this.setNewUserType(userType); + } + break; + } + } + switch (userType) { + case UserKind.FirstTime: { + for (let i2 = 0; i2 < 3 && !token.isCancellationRequested; i2++) { + await this._indicator.get()?.triggerAnimation(); + await timeout(500); + } + break; + } + case UserKind.SecondTime: { + this._indicator.get()?.triggerAnimation(); + break; + } + } + })); + disposableStore.add(autorun((reader) => { + if (this._collapsedView.isVisible.read(reader)) { + if (this.getNewUserType() !== UserKind.Active) { + this._collapsedView.triggerAnimation(); + } + } + })); + disposableStore.add(autorunWithStore((reader, store) => { + const indicator = this._indicator.read(reader); + if (!indicator) { + return; + } + store.add(runOnChange(indicator.isHoveredOverIcon, async (isHovered) => { + if (isHovered) { + userHasHoveredOverIcon = true; + } + })); + })); + disposableStore.add(autorunWithStore((reader, store) => { + const host = this._host.read(reader); + if (!host) { + return; + } + store.add(host.onDidAccept(() => { + inlineEditHasBeenAccepted = true; + })); + })); + return disposableStore; + } + getNewUserType() { + return this._storageService.get("inlineEditsGutterIndicatorUserKind", -1, UserKind.FirstTime); + } + setNewUserType(value) { + switch (value) { + case UserKind.FirstTime: + throw new BugIndicatingError("UserKind should not be set to first time"); + case UserKind.SecondTime: + break; + case UserKind.Active: + this._disposables.clear(); + break; + } + this._storageService.store( + "inlineEditsGutterIndicatorUserKind", + value, + -1, + 0 + /* StorageTarget.USER */ + ); + } + _initializeDebugSetting() { + const hiddenDebugSetting = "editor.inlineSuggest.edits.resetNewUserExperience"; + if (this._configurationService.getValue(hiddenDebugSetting)) { + this._storageService.remove( + "inlineEditsGutterIndicatorUserKind", + -1 + /* StorageScope.APPLICATION */ + ); + } + const disposable = this._configurationService.onDidChangeConfiguration((e) => { + if (e.affectsConfiguration(hiddenDebugSetting) && this._configurationService.getValue(hiddenDebugSetting)) { + this._storageService.remove( + "inlineEditsGutterIndicatorUserKind", + -1 + /* StorageScope.APPLICATION */ + ); + this._disposables.value = this.setupNewUserExperience(); + } + }); + return disposable; + } +}; +InlineEditsOnboardingExperience = __decorate122([ + __param116(4, IStorageService), + __param116(5, IConfigurationService) +], InlineEditsOnboardingExperience); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsCollapsedView.js +init_dom(); +init_event(); +init_lifecycle(); +init_observable(); +init_colorUtils(); +init_observableCodeEditor(); +init_point(); +var __decorate123 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param117 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var InlineEditsCollapsedView = class InlineEditsCollapsedView2 extends Disposable { + constructor(_editor, _edit, _accessibilityService) { + super(); + this._editor = _editor; + this._edit = _edit; + this._accessibilityService = _accessibilityService; + this._onDidClick = this._register(new Emitter()); + this.onDidClick = this._onDidClick.event; + this._iconRef = n.ref(); + this.isHovered = constObservable(false); + this._editorObs = observableCodeEditor(this._editor); + const firstEdit = this._edit.map((inlineEdit) => inlineEdit?.edit.replacements[0] ?? null); + const startPosition = firstEdit.map((edit2) => edit2 ? singleTextRemoveCommonPrefix(edit2, this._editor.getModel()).range.getStartPosition() : null); + const observedStartPoint = this._editorObs.observePosition(startPosition, this._store); + const startPoint = derived((reader) => { + const point = observedStartPoint.read(reader); + if (!point) { + return null; + } + const contentLeft = this._editorObs.layoutInfoContentLeft.read(reader); + const scrollLeft = this._editorObs.scrollLeft.read(reader); + return new Point(contentLeft + point.x - scrollLeft, point.y); + }); + const overlayElement = n.div({ + class: "inline-edits-collapsed-view", + style: { + position: "absolute", + overflow: "visible", + top: "0px", + left: "0px", + display: "block" + } + }, [ + [this.getCollapsedIndicator(startPoint)] + ]).keepUpdated(this._store).element; + this._register(this._editorObs.createOverlayWidget({ + domNode: overlayElement, + position: constObservable(null), + allowEditorOverflow: false, + minContentWidthInPx: constObservable(0) + })); + this.isVisible = this._edit.map((inlineEdit, reader) => !!inlineEdit && startPoint.read(reader) !== null); + } + triggerAnimation() { + if (this._accessibilityService.isMotionReduced()) { + return new Animation(null, null).finished; + } + const animation = this._iconRef.element.animate([ + { offset: 0, transform: "translateY(-3px)" }, + { offset: 0.2, transform: "translateY(1px)" }, + { offset: 0.36, transform: "translateY(-1px)" }, + { offset: 0.52, transform: "translateY(1px)" }, + { offset: 0.68, transform: "translateY(-1px)" }, + { offset: 0.84, transform: "translateY(1px)" }, + { offset: 1, transform: "translateY(0px)" } + ], { duration: 2e3 }); + return animation.finished; + } + getCollapsedIndicator(startPoint) { + const contentLeft = this._editorObs.layoutInfoContentLeft; + const startPointTranslated = startPoint.map((p, reader) => p ? p.deltaX(-contentLeft.read(reader)) : null); + const iconPath = this.createIconPath(startPointTranslated); + return n.svg({ + class: "collapsedView", + ref: this._iconRef, + style: { + position: "absolute", + ...rectToProps((r) => getEditorValidOverlayRect(this._editorObs).read(r)), + overflow: "hidden", + pointerEvents: "none" + } + }, [ + n.svgElem("path", { + class: "collapsedViewPath", + d: iconPath, + fill: asCssVariable(inlineEditIndicatorPrimaryBorder) + }) + ]); + } + createIconPath(indicatorPoint) { + const width2 = 6; + const triangleHeight = 3; + const baseHeight = 1; + return indicatorPoint.map((point) => { + if (!point) { + return new PathBuilder().build(); + } + const baseTopLeft = point.deltaX(-width2 / 2).deltaY(-baseHeight); + const baseTopRight = baseTopLeft.deltaX(width2); + const baseBottomLeft = baseTopLeft.deltaY(baseHeight); + const baseBottomRight = baseTopRight.deltaY(baseHeight); + const triangleBottomCenter = baseBottomLeft.deltaX(width2 / 2).deltaY(triangleHeight); + return new PathBuilder().moveTo(baseTopLeft).lineTo(baseTopRight).lineTo(baseBottomRight).lineTo(triangleBottomCenter).lineTo(baseBottomLeft).lineTo(baseTopLeft).build(); + }); + } +}; +InlineEditsCollapsedView = __decorate123([ + __param117(2, IAccessibilityService) +], InlineEditsCollapsedView); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsCustomView.js +init_dom(); +init_mouseEvent(); +init_event(); +init_lifecycle(); +init_observable(); +init_colorRegistry(); +init_colorUtils(); +init_themeService(); +init_observableCodeEditor(); +init_lineRange(); +init_languages(); +init_language(); +init_lineTokens(); +var __decorate124 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param118 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var MIN_END_OF_LINE_PADDING = 14; +var PADDING_VERTICALLY = 0; +var PADDING_HORIZONTALLY = 4; +var HORIZONTAL_OFFSET_WHEN_ABOVE_BELOW = 4; +var VERTICAL_OFFSET_WHEN_ABOVE_BELOW = 2; +var InlineEditsCustomView = class InlineEditsCustomView2 extends Disposable { + constructor(_editor, displayLocation, tabAction, themeService, _languageService) { + super(); + this._editor = _editor; + this._languageService = _languageService; + this._onDidClick = this._register(new Emitter()); + this.onDidClick = this._onDidClick.event; + this._isHovered = observableValue(this, false); + this.isHovered = this._isHovered; + this._viewRef = n.ref(); + this._editorObs = observableCodeEditor(this._editor); + const styles = tabAction.map((v, reader) => { + let border; + switch (v) { + case InlineEditTabAction.Inactive: + border = inlineEditIndicatorSecondaryBackground; + break; + case InlineEditTabAction.Jump: + border = inlineEditIndicatorPrimaryBackground; + break; + case InlineEditTabAction.Accept: + border = inlineEditIndicatorsuccessfulBackground; + break; + } + return { + border: getEditorBlendedColor(border, themeService).read(reader).toString(), + background: asCssVariable(editorBackground) + }; + }); + const state = displayLocation.map((dl) => dl ? this.getState(dl) : void 0); + const view = state.map((s) => s ? this.getRendering(s, styles) : void 0); + this.minEditorScrollHeight = derived(this, (reader) => { + const s = state.read(reader); + if (!s) { + return 0; + } + return s.rect.read(reader).bottom + this._editor.getScrollTop(); + }); + const overlay = n.div({ + class: "inline-edits-custom-view", + style: { + position: "absolute", + overflow: "visible", + top: "0px", + left: "0px", + display: "block" + } + }, [view]).keepUpdated(this._store); + this._register(this._editorObs.createOverlayWidget({ + domNode: overlay.element, + position: constObservable(null), + allowEditorOverflow: false, + minContentWidthInPx: derivedObservableWithCache(this, (reader, prev) => { + const s = state.read(reader); + if (!s) { + return prev ?? 0; + } + const current = s.rect.map((rect) => rect.right).read(reader) + this._editorObs.layoutInfoVerticalScrollbarWidth.read(reader) + PADDING_HORIZONTALLY - this._editorObs.layoutInfoContentLeft.read(reader); + return Math.max(prev ?? 0, current); + }).recomputeInitiallyAndOnChange(this._store) + })); + this._register(autorun((reader) => { + const v = view.read(reader); + if (!v) { + this._isHovered.set(false, void 0); + return; + } + this._isHovered.set(overlay.isHovered.read(reader), void 0); + })); + } + // TODO: this is very similar to side by side `fitsInsideViewport`, try to use the same function + fitsInsideViewport(range2, displayLabel, reader) { + const editorWidth = this._editorObs.layoutInfoWidth.read(reader); + const editorContentLeft = this._editorObs.layoutInfoContentLeft.read(reader); + const editorVerticalScrollbar = this._editor.getLayoutInfo().verticalScrollbarWidth; + const minimapWidth = this._editorObs.layoutInfoMinimap.read(reader).minimapLeft !== 0 ? this._editorObs.layoutInfoMinimap.read(reader).minimapWidth : 0; + const maxOriginalContent = maxContentWidthInRange(this._editorObs, range2, void 0); + const maxModifiedContent = getContentRenderWidth(displayLabel, this._editor, this._editor.getModel()); + const padding = PADDING_HORIZONTALLY + MIN_END_OF_LINE_PADDING; + return maxOriginalContent + maxModifiedContent + padding < editorWidth - editorContentLeft - editorVerticalScrollbar - minimapWidth; + } + getState(displayLocation) { + const contentState = derived(this, (reader) => { + const startLineNumber2 = displayLocation.range.startLineNumber; + const endLineNumber2 = displayLocation.range.endLineNumber; + const startColumn = displayLocation.range.startColumn; + const endColumn = displayLocation.range.endColumn; + const lineCount = this._editor.getModel()?.getLineCount() ?? 0; + const lineWidth = maxContentWidthInRange(this._editorObs, new LineRange(startLineNumber2, startLineNumber2 + 1), reader); + const lineWidthBelow = startLineNumber2 + 1 <= lineCount ? maxContentWidthInRange(this._editorObs, new LineRange(startLineNumber2 + 1, startLineNumber2 + 2), reader) : void 0; + const lineWidthAbove = startLineNumber2 - 1 >= 1 ? maxContentWidthInRange(this._editorObs, new LineRange(startLineNumber2 - 1, startLineNumber2), reader) : void 0; + const startContentLeftOffset = this._editor.getOffsetForColumn(startLineNumber2, startColumn); + const endContentLeftOffset = this._editor.getOffsetForColumn(endLineNumber2, endColumn); + return { + lineWidth, + lineWidthBelow, + lineWidthAbove, + startContentLeftOffset, + endContentLeftOffset + }; + }); + const startLineNumber = displayLocation.range.startLineNumber; + const endLineNumber = displayLocation.range.endLineNumber; + const fitsInsideViewport = this.fitsInsideViewport(new LineRange(startLineNumber, endLineNumber + 1), displayLocation.content, void 0); + const rect = derived(this, (reader) => { + const w = this._editorObs.getOption( + 59 + /* EditorOption.fontInfo */ + ).read(reader).typicalHalfwidthCharacterWidth; + const { lineWidth, lineWidthBelow, lineWidthAbove, startContentLeftOffset, endContentLeftOffset } = contentState.read(reader); + const contentLeft = this._editorObs.layoutInfoContentLeft.read(reader); + const lineHeight = this._editorObs.observeLineHeightForLine(startLineNumber).recomputeInitiallyAndOnChange(reader.store).read(reader); + const scrollTop = this._editorObs.scrollTop.read(reader); + const scrollLeft = this._editorObs.scrollLeft.read(reader); + let position; + if (startLineNumber === endLineNumber && endContentLeftOffset + 5 * w >= lineWidth && fitsInsideViewport) { + position = "end"; + } else if (lineWidthBelow !== void 0 && lineWidthBelow + MIN_END_OF_LINE_PADDING - HORIZONTAL_OFFSET_WHEN_ABOVE_BELOW - PADDING_HORIZONTALLY < startContentLeftOffset) { + position = "below"; + } else if (lineWidthAbove !== void 0 && lineWidthAbove + MIN_END_OF_LINE_PADDING - HORIZONTAL_OFFSET_WHEN_ABOVE_BELOW - PADDING_HORIZONTALLY < startContentLeftOffset) { + position = "above"; + } else { + position = "end"; + } + let topOfLine; + let contentStartOffset; + let deltaX = 0; + let deltaY = 0; + switch (position) { + case "end": { + topOfLine = this._editorObs.editor.getTopForLineNumber(startLineNumber); + contentStartOffset = lineWidth; + deltaX = PADDING_HORIZONTALLY + MIN_END_OF_LINE_PADDING; + break; + } + case "below": { + topOfLine = this._editorObs.editor.getTopForLineNumber(startLineNumber + 1); + contentStartOffset = startContentLeftOffset; + deltaX = PADDING_HORIZONTALLY + HORIZONTAL_OFFSET_WHEN_ABOVE_BELOW; + deltaY = PADDING_VERTICALLY + VERTICAL_OFFSET_WHEN_ABOVE_BELOW; + break; + } + case "above": { + topOfLine = this._editorObs.editor.getTopForLineNumber(startLineNumber - 1); + contentStartOffset = startContentLeftOffset; + deltaX = PADDING_HORIZONTALLY + HORIZONTAL_OFFSET_WHEN_ABOVE_BELOW; + deltaY = -PADDING_VERTICALLY + VERTICAL_OFFSET_WHEN_ABOVE_BELOW; + break; + } + } + const textRect = Rect.fromLeftTopWidthHeight(contentLeft + contentStartOffset - scrollLeft, topOfLine - scrollTop, w * displayLocation.content.length, lineHeight); + return textRect.withMargin(PADDING_VERTICALLY, PADDING_HORIZONTALLY).translateX(deltaX).translateY(deltaY); + }); + return { + rect, + label: displayLocation.content, + kind: displayLocation.style + }; + } + getRendering(state, styles) { + const line = document.createElement("div"); + const t = this._editor.getModel().tokenization.tokenizeLinesAt(1, [state.label])?.[0]; + let tokens; + if (t && state.kind === InlineCompletionHintStyle.Code) { + tokens = TokenArray.fromLineTokens(t).toLineTokens(state.label, this._languageService.languageIdCodec); + } else { + tokens = LineTokens.createEmpty(state.label, this._languageService.languageIdCodec); + } + const result = renderLines(new LineSource([tokens]), RenderOptions.fromEditor(this._editor).withSetWidth(false).withScrollBeyondLastColumn(0), [], line, true); + line.style.width = `${result.minWidthInPx}px`; + const rect = state.rect.map((r) => r.withMargin(0, PADDING_HORIZONTALLY)); + return n.div({ + class: "collapsedView", + ref: this._viewRef, + style: { + position: "absolute", + ...rectToProps((reader) => rect.read(reader)), + overflow: "hidden", + boxSizing: "border-box", + cursor: "pointer", + border: styles.map((s) => `1px solid ${s.border}`), + borderRadius: "4px", + backgroundColor: styles.map((s) => s.background), + display: "flex", + alignItems: "center", + justifyContent: "center", + whiteSpace: "nowrap" + }, + onmousedown: (e) => { + e.preventDefault(); + }, + onclick: (e) => { + this._onDidClick.fire(new StandardMouseEvent(getWindow(e), e)); + } + }, [ + line + ]); + } +}; +InlineEditsCustomView = __decorate124([ + __param118(3, IThemeService), + __param118(4, ILanguageService) +], InlineEditsCustomView); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsDeletionView.js +init_dom(); +init_event(); +init_lifecycle(); +init_observable(); +init_colorRegistry(); +init_colorUtils(); +init_observableCodeEditor(); +init_offsetRange(); +init_position(); +var HORIZONTAL_PADDING = 0; +var VERTICAL_PADDING = 0; +var BORDER_WIDTH = 1; +var WIDGET_SEPARATOR_WIDTH = 1; +var WIDGET_SEPARATOR_DIFF_EDITOR_WIDTH = 3; +var BORDER_RADIUS = 4; +var InlineEditsDeletionView = class extends Disposable { + constructor(_editor, _edit, _uiState, _tabAction) { + super(); + this._editor = _editor; + this._edit = _edit; + this._uiState = _uiState; + this._tabAction = _tabAction; + this._onDidClick = this._register(new Emitter()); + this.onDidClick = this._onDidClick.event; + this._display = derived(this, (reader) => !!this._uiState.read(reader) ? "block" : "none"); + this._editorMaxContentWidthInRange = derived(this, (reader) => { + const originalDisplayRange = this._originalDisplayRange.read(reader); + if (!originalDisplayRange) { + return constObservable(0); + } + this._editorObs.versionId.read(reader); + return derivedObservableWithCache(this, (reader2, lastValue) => { + const maxWidth = maxContentWidthInRange(this._editorObs, originalDisplayRange, reader2); + return Math.max(maxWidth, lastValue ?? 0); + }); + }).map((v, r) => v.read(r)); + this._maxPrefixTrim = derived(this, (reader) => { + const state = this._uiState.read(reader); + if (!state) { + return { prefixTrim: 0, prefixLeftOffset: 0 }; + } + return getPrefixTrim(state.deletions, state.originalRange, [], this._editor); + }); + this._editorLayoutInfo = derived(this, (reader) => { + const inlineEdit = this._edit.read(reader); + if (!inlineEdit) { + return null; + } + const state = this._uiState.read(reader); + if (!state) { + return null; + } + const editorLayout = this._editorObs.layoutInfo.read(reader); + const horizontalScrollOffset = this._editorObs.scrollLeft.read(reader); + const w = this._editorObs.getOption( + 59 + /* EditorOption.fontInfo */ + ).map((f) => f.typicalHalfwidthCharacterWidth).read(reader); + const right = editorLayout.contentLeft + Math.max(this._editorMaxContentWidthInRange.read(reader), w) - horizontalScrollOffset; + const range2 = inlineEdit.originalLineRange; + const selectionTop = this._originalVerticalStartPosition.read(reader) ?? this._editor.getTopForLineNumber(range2.startLineNumber) - this._editorObs.scrollTop.read(reader); + const selectionBottom = this._originalVerticalEndPosition.read(reader) ?? this._editor.getTopForLineNumber(range2.endLineNumberExclusive) - this._editorObs.scrollTop.read(reader); + const left = editorLayout.contentLeft + this._maxPrefixTrim.read(reader).prefixLeftOffset - horizontalScrollOffset; + if (right <= left) { + return null; + } + const codeRect = Rect.fromLeftTopRightBottom(left, selectionTop, right, selectionBottom).withMargin(VERTICAL_PADDING, HORIZONTAL_PADDING); + return { + codeRect, + contentLeft: editorLayout.contentLeft + }; + }).recomputeInitiallyAndOnChange(this._store); + this._originalOverlay = n.div({ + style: { pointerEvents: "none" } + }, derived(this, (reader) => { + const layoutInfoObs = mapOutFalsy(this._editorLayoutInfo).read(reader); + if (!layoutInfoObs) { + return void 0; + } + const overlayhider = layoutInfoObs.map((layoutInfo) => Rect.fromLeftTopRightBottom(layoutInfo.contentLeft - BORDER_RADIUS - BORDER_WIDTH, layoutInfo.codeRect.top, layoutInfo.contentLeft, layoutInfo.codeRect.bottom)); + const overlayRect = derived(this, (reader2) => { + const rect = layoutInfoObs.read(reader2).codeRect; + const overlayHider = overlayhider.read(reader2); + return rect.intersectHorizontal(new OffsetRange(overlayHider.left, Number.MAX_SAFE_INTEGER)); + }); + const separatorWidth = this._uiState.map((s) => s?.inDiffEditor ? WIDGET_SEPARATOR_DIFF_EDITOR_WIDTH : WIDGET_SEPARATOR_WIDTH).read(reader); + const separatorRect = overlayRect.map((rect) => rect.withMargin(separatorWidth, separatorWidth)); + return [ + n.div({ + class: "originalSeparatorDeletion", + style: { + ...separatorRect.read(reader).toStyles(), + borderRadius: `${BORDER_RADIUS}px`, + border: `${BORDER_WIDTH + separatorWidth}px solid ${asCssVariable(editorBackground)}`, + boxSizing: "border-box" + } + }), + n.div({ + class: "originalOverlayDeletion", + style: { + ...overlayRect.read(reader).toStyles(), + borderRadius: `${BORDER_RADIUS}px`, + border: getOriginalBorderColor(this._tabAction).map((bc) => `${BORDER_WIDTH}px solid ${asCssVariable(bc)}`), + boxSizing: "border-box", + backgroundColor: asCssVariable(originalBackgroundColor) + } + }), + n.div({ + class: "originalOverlayHiderDeletion", + style: { + ...overlayhider.read(reader).toStyles(), + backgroundColor: asCssVariable(editorBackground) + } + }) + ]; + })).keepUpdated(this._store); + this._nonOverflowView = n.div({ + class: "inline-edits-view", + style: { + position: "absolute", + overflow: "visible", + top: "0px", + left: "0px", + display: this._display + } + }, [ + [this._originalOverlay] + ]).keepUpdated(this._store); + this.isHovered = constObservable(false); + this._editorObs = observableCodeEditor(this._editor); + const originalStartPosition = derived(this, (reader) => { + const inlineEdit = this._edit.read(reader); + return inlineEdit ? new Position(inlineEdit.originalLineRange.startLineNumber, 1) : null; + }); + const originalEndPosition = derived(this, (reader) => { + const inlineEdit = this._edit.read(reader); + return inlineEdit ? new Position(inlineEdit.originalLineRange.endLineNumberExclusive, 1) : null; + }); + this._originalDisplayRange = this._uiState.map((s) => s?.originalRange); + this._originalVerticalStartPosition = this._editorObs.observePosition(originalStartPosition, this._store).map((p) => p?.y); + this._originalVerticalEndPosition = this._editorObs.observePosition(originalEndPosition, this._store).map((p) => p?.y); + this._register(this._editorObs.createOverlayWidget({ + domNode: this._nonOverflowView.element, + position: constObservable(null), + allowEditorOverflow: false, + minContentWidthInPx: derived(this, (reader) => { + const info = this._editorLayoutInfo.read(reader); + if (info === null) { + return 0; + } + return info.codeRect.width; + }) + })); + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsInsertionView.js +init_dom(); +init_event(); +init_lifecycle(); +init_observable(); +init_instantiation(); +init_colorRegistry(); +init_colorUtils(); +init_observableCodeEditor(); +init_position(); +init_range(); +init_lineRange(); +init_offsetRange(); +init_language(); +init_lineTokens(); +var __decorate125 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param119 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var BORDER_WIDTH2 = 1; +var WIDGET_SEPARATOR_WIDTH2 = 1; +var WIDGET_SEPARATOR_DIFF_EDITOR_WIDTH2 = 3; +var BORDER_RADIUS2 = 4; +var InlineEditsInsertionView = class InlineEditsInsertionView2 extends Disposable { + constructor(_editor, _input, _tabAction, instantiationService, _languageService) { + super(); + this._editor = _editor; + this._input = _input; + this._tabAction = _tabAction; + this._languageService = _languageService; + this._onDidClick = this._register(new Emitter()); + this.onDidClick = this._onDidClick.event; + this._state = derived(this, (reader) => { + const state = this._input.read(reader); + if (!state) { + return void 0; + } + const textModel = this._editor.getModel(); + const eol = textModel.getEOL(); + if (state.startColumn === 1 && state.lineNumber > 1 && textModel.getLineLength(state.lineNumber) !== 0 && state.text.endsWith(eol) && !state.text.startsWith(eol)) { + const endOfLineColumn = textModel.getLineLength(state.lineNumber - 1) + 1; + return { lineNumber: state.lineNumber - 1, column: endOfLineColumn, text: eol + state.text.slice(0, -eol.length) }; + } + return { lineNumber: state.lineNumber, column: state.startColumn, text: state.text }; + }); + this._trimVertically = derived(this, (reader) => { + const state = this._state.read(reader); + const text2 = state?.text; + if (!text2 || text2.trim() === "") { + return { topOffset: 0, bottomOffset: 0, linesTop: 0, linesBottom: 0 }; + } + const lineHeight = this._editor.getLineHeightForPosition(new Position(state.lineNumber, 1)); + const eol = this._editor.getModel().getEOL(); + let linesTop = 0; + let linesBottom = 0; + let i2 = 0; + for (; i2 < text2.length && text2.startsWith(eol, i2); i2 += eol.length) { + linesTop += 1; + } + for (let j = text2.length; j > i2 && text2.endsWith(eol, j); j -= eol.length) { + linesBottom += 1; + } + return { topOffset: linesTop * lineHeight, bottomOffset: linesBottom * lineHeight, linesTop, linesBottom }; + }); + this._maxPrefixTrim = derived(this, (reader) => { + const state = this._state.read(reader); + if (!state) { + return { prefixLeftOffset: 0, prefixTrim: 0 }; + } + const textModel = this._editor.getModel(); + const eol = textModel.getEOL(); + const trimVertically = this._trimVertically.read(reader); + const lines = state.text.split(eol); + const modifiedLines = lines.slice(trimVertically.linesTop, lines.length - trimVertically.linesBottom); + if (trimVertically.linesTop === 0) { + modifiedLines[0] = textModel.getLineContent(state.lineNumber) + modifiedLines[0]; + } + const originalRange = new LineRange(state.lineNumber, state.lineNumber + (trimVertically.linesTop > 0 ? 0 : 1)); + return getPrefixTrim([], originalRange, modifiedLines, this._editor); + }); + this._ghostText = derived((reader) => { + const state = this._state.read(reader); + const prefixTrim = this._maxPrefixTrim.read(reader); + if (!state) { + return void 0; + } + const textModel = this._editor.getModel(); + const eol = textModel.getEOL(); + const modifiedLines = state.text.split(eol); + const inlineDecorations = modifiedLines.map((line, i2) => new InlineDecoration( + new Range(i2 + 1, i2 === 0 ? 1 : prefixTrim.prefixTrim + 1, i2 + 1, line.length + 1), + "modified-background", + 0 + /* InlineDecorationType.Regular */ + )); + return new GhostText(state.lineNumber, [new GhostTextPart(state.column, state.text, false, inlineDecorations)]); + }); + this._display = derived(this, (reader) => !!this._state.read(reader) ? "block" : "none"); + this._editorMaxContentWidthInRange = derived(this, (reader) => { + const state = this._state.read(reader); + if (!state) { + return 0; + } + this._editorObs.versionId.read(reader); + const textModel = this._editor.getModel(); + const eol = textModel.getEOL(); + const textBeforeInsertion = state.text.startsWith(eol) ? "" : textModel.getValueInRange(new Range(state.lineNumber, 1, state.lineNumber, state.column)); + const textAfterInsertion = textModel.getValueInRange(new Range(state.lineNumber, state.column, state.lineNumber, textModel.getLineLength(state.lineNumber) + 1)); + const text2 = textBeforeInsertion + state.text + textAfterInsertion; + const lines = text2.split(eol); + const renderOptions = RenderOptions.fromEditor(this._editor).withSetWidth(false).withScrollBeyondLastColumn(0); + const lineWidths = lines.map((line) => { + const t = textModel.tokenization.tokenizeLinesAt(state.lineNumber, [line])?.[0]; + let tokens; + if (t) { + tokens = TokenArray.fromLineTokens(t).toLineTokens(line, this._languageService.languageIdCodec); + } else { + tokens = LineTokens.createEmpty(line, this._languageService.languageIdCodec); + } + return renderLines(new LineSource([tokens]), renderOptions, [], $("div"), true).minWidthInPx; + }); + return Math.max(...lineWidths); + }); + this.startLineOffset = this._trimVertically.map((v) => v.topOffset); + this.originalLines = this._state.map((s) => s ? new LineRange(s.lineNumber, Math.min(s.lineNumber + 2, this._editor.getModel().getLineCount() + 1)) : void 0); + this._overlayLayout = derived(this, (reader) => { + this._ghostText.read(reader); + const state = this._state.read(reader); + if (!state) { + return null; + } + this._editorObs.observePosition(observableValue(this, new Position(state.lineNumber, state.column)), reader.store).read(reader); + const editorLayout = this._editorObs.layoutInfo.read(reader); + const horizontalScrollOffset = this._editorObs.scrollLeft.read(reader); + const verticalScrollbarWidth = this._editorObs.layoutInfoVerticalScrollbarWidth.read(reader); + const right = editorLayout.contentLeft + this._editorMaxContentWidthInRange.read(reader) - horizontalScrollOffset; + const prefixLeftOffset = this._maxPrefixTrim.read(reader).prefixLeftOffset ?? 0; + const left = editorLayout.contentLeft + prefixLeftOffset - horizontalScrollOffset; + if (right <= left) { + return null; + } + const { topOffset: topTrim, bottomOffset: bottomTrim } = this._trimVertically.read(reader); + const scrollTop = this._editorObs.scrollTop.read(reader); + const height = this._ghostTextView.height.read(reader) - topTrim - bottomTrim; + const top = this._editor.getTopForLineNumber(state.lineNumber) - scrollTop + topTrim; + const bottom = top + height; + const overlay = new Rect(left, top, right, bottom); + return { + overlay, + startsAtContentLeft: prefixLeftOffset === 0, + contentLeft: editorLayout.contentLeft, + minContentWidthRequired: prefixLeftOffset + overlay.width + verticalScrollbarWidth + }; + }).recomputeInitiallyAndOnChange(this._store); + this._modifiedOverlay = n.div({ + style: { pointerEvents: "none" } + }, derived(this, (reader) => { + const overlayLayoutObs = mapOutFalsy(this._overlayLayout).read(reader); + if (!overlayLayoutObs) { + return void 0; + } + const overlayHider = overlayLayoutObs.map((layoutInfo) => Rect.fromLeftTopRightBottom(layoutInfo.contentLeft - BORDER_RADIUS2 - BORDER_WIDTH2, layoutInfo.overlay.top, layoutInfo.contentLeft, layoutInfo.overlay.bottom)).read(reader); + const separatorWidth = this._input.map((i2) => i2?.inDiffEditor ? WIDGET_SEPARATOR_DIFF_EDITOR_WIDTH2 : WIDGET_SEPARATOR_WIDTH2).read(reader); + const overlayRect = overlayLayoutObs.map((l) => l.overlay.withMargin(0, BORDER_WIDTH2, 0, l.startsAtContentLeft ? 0 : BORDER_WIDTH2).intersectHorizontal(new OffsetRange(overlayHider.left, Number.MAX_SAFE_INTEGER))); + const underlayRect = overlayRect.map((rect) => rect.withMargin(separatorWidth, separatorWidth)); + return [ + n.div({ + class: "originalUnderlayInsertion", + style: { + ...underlayRect.read(reader).toStyles(), + borderRadius: BORDER_RADIUS2, + border: `${BORDER_WIDTH2 + separatorWidth}px solid ${asCssVariable(editorBackground)}`, + boxSizing: "border-box" + } + }), + n.div({ + class: "originalOverlayInsertion", + style: { + ...overlayRect.read(reader).toStyles(), + borderRadius: BORDER_RADIUS2, + border: getModifiedBorderColor(this._tabAction).map((bc) => `${BORDER_WIDTH2}px solid ${asCssVariable(bc)}`), + boxSizing: "border-box", + backgroundColor: asCssVariable(modifiedBackgroundColor) + } + }), + n.div({ + class: "originalOverlayHiderInsertion", + style: { + ...overlayHider.toStyles(), + backgroundColor: asCssVariable(editorBackground) + } + }) + ]; + })).keepUpdated(this._store); + this._view = n.div({ + class: "inline-edits-view", + style: { + position: "absolute", + overflow: "visible", + top: "0px", + left: "0px", + display: this._display + } + }, [ + [this._modifiedOverlay] + ]).keepUpdated(this._store); + this._editorObs = observableCodeEditor(this._editor); + this._ghostTextView = this._register(instantiationService.createInstance(GhostTextView, this._editor, { + ghostText: this._ghostText, + minReservedLineCount: constObservable(0), + targetTextModel: this._editorObs.model.map((model) => model ?? void 0), + warning: constObservable(void 0), + handleInlineCompletionShown: constObservable(() => { + }) + }, observableValue(this, { syntaxHighlightingEnabled: true, extraClasses: ["inline-edit"] }), true, true)); + this.isHovered = this._ghostTextView.isHovered; + this._register(this._ghostTextView.onDidClick((e) => { + this._onDidClick.fire(e); + })); + this._register(this._editorObs.createOverlayWidget({ + domNode: this._view.element, + position: constObservable(null), + allowEditorOverflow: false, + minContentWidthInPx: derived(this, (reader) => { + const info = this._overlayLayout.read(reader); + if (info === null) { + return 0; + } + return info.minContentWidthRequired; + }) + })); + } +}; +InlineEditsInsertionView = __decorate125([ + __param119(3, IInstantiationService), + __param119(4, ILanguageService) +], InlineEditsInsertionView); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsLineReplacementView.js +init_dom(); +init_mouseEvent(); +init_event(); +init_lifecycle(); +init_observable(); +init_colorRegistry(); +init_colorUtils(); +init_themeService(); +init_point(); +init_range(); +init_offsetRange(); +init_language(); +init_lineTokens(); +var __decorate126 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param120 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var InlineEditsLineReplacementView = class InlineEditsLineReplacementView2 extends Disposable { + constructor(_editor, _edit, _isInDiffEditor, _tabAction, _languageService, _themeService) { + super(); + this._editor = _editor; + this._edit = _edit; + this._isInDiffEditor = _isInDiffEditor; + this._tabAction = _tabAction; + this._languageService = _languageService; + this._themeService = _themeService; + this._onDidClick = this._register(new Emitter()); + this.onDidClick = this._onDidClick.event; + this._maxPrefixTrim = this._edit.map((e, reader) => e ? getPrefixTrim(e.replacements.flatMap((r) => [r.originalRange, r.modifiedRange]), e.originalRange, e.modifiedLines, this._editor.editor, reader) : void 0); + this._modifiedLineElements = derived(this, (reader) => { + const lines = []; + let requiredWidth = 0; + const prefixTrim = this._maxPrefixTrim.read(reader); + const edit2 = this._edit.read(reader); + if (!edit2 || !prefixTrim) { + return void 0; + } + const maxPrefixTrim = prefixTrim.prefixTrim; + const modifiedBubbles = rangesToBubbleRanges(edit2.replacements.map((r) => r.modifiedRange)).map((r) => new Range(r.startLineNumber, r.startColumn - maxPrefixTrim, r.endLineNumber, r.endColumn - maxPrefixTrim)); + const textModel = this._editor.model.get(); + const startLineNumber = edit2.modifiedRange.startLineNumber; + for (let i2 = 0; i2 < edit2.modifiedRange.length; i2++) { + const line = document.createElement("div"); + const lineNumber = startLineNumber + i2; + const modLine = edit2.modifiedLines[i2].slice(maxPrefixTrim); + const t = textModel.tokenization.tokenizeLinesAt(lineNumber, [modLine])?.[0]; + let tokens; + if (t) { + tokens = TokenArray.fromLineTokens(t).toLineTokens(modLine, this._languageService.languageIdCodec); + } else { + tokens = LineTokens.createEmpty(modLine, this._languageService.languageIdCodec); + } + const decorations = []; + for (const modified of modifiedBubbles.filter((b) => b.startLineNumber === lineNumber)) { + const validatedEndColumn = Math.min(modified.endColumn, modLine.length + 1); + decorations.push(new InlineDecoration( + new Range(1, modified.startColumn, 1, validatedEndColumn), + "inlineCompletions-modified-bubble", + 0 + /* InlineDecorationType.Regular */ + )); + } + const result = renderLines(new LineSource([tokens]), RenderOptions.fromEditor(this._editor.editor).withSetWidth(false).withScrollBeyondLastColumn(0), decorations, line, true); + this._editor.getOption( + 59 + /* EditorOption.fontInfo */ + ).read(reader); + requiredWidth = Math.max(requiredWidth, result.minWidthInPx); + lines.push(line); + } + return { lines, requiredWidth }; + }); + this._layout = derived(this, (reader) => { + const modifiedLines = this._modifiedLineElements.read(reader); + const maxPrefixTrim = this._maxPrefixTrim.read(reader); + const edit2 = this._edit.read(reader); + if (!modifiedLines || !maxPrefixTrim || !edit2) { + return void 0; + } + const { prefixLeftOffset } = maxPrefixTrim; + const { requiredWidth } = modifiedLines; + const originalLineHeights = this._editor.observeLineHeightsForLineRange(edit2.originalRange).read(reader); + const modifiedLineHeights = (() => { + const lineHeights = originalLineHeights.slice(0, edit2.modifiedRange.length); + while (lineHeights.length < edit2.modifiedRange.length) { + lineHeights.push(originalLineHeights[originalLineHeights.length - 1]); + } + return lineHeights; + })(); + const contentLeft = this._editor.layoutInfoContentLeft.read(reader); + const verticalScrollbarWidth = this._editor.layoutInfoVerticalScrollbarWidth.read(reader); + const scrollLeft = this._editor.scrollLeft.read(reader); + const scrollTop = this._editor.scrollTop.read(reader); + const editorLeftOffset = contentLeft - scrollLeft; + const textModel = this._editor.editor.getModel(); + const originalLineWidths = edit2.originalRange.mapToLineArray((line) => this._editor.editor.getOffsetForColumn(line, textModel.getLineMaxColumn(line)) - prefixLeftOffset); + const maxLineWidth = Math.max(...originalLineWidths, requiredWidth); + const startLineNumber = edit2.originalRange.startLineNumber; + const endLineNumber = edit2.originalRange.endLineNumberExclusive - 1; + const topOfOriginalLines = this._editor.editor.getTopForLineNumber(startLineNumber) - scrollTop; + const bottomOfOriginalLines = this._editor.editor.getBottomForLineNumber(endLineNumber) - scrollTop; + const originalLinesOverlay = Rect.fromLeftTopWidthHeight(editorLeftOffset + prefixLeftOffset, topOfOriginalLines, maxLineWidth, bottomOfOriginalLines - topOfOriginalLines); + const modifiedLinesOverlay = Rect.fromLeftTopWidthHeight(originalLinesOverlay.left, originalLinesOverlay.bottom, originalLinesOverlay.width, modifiedLineHeights.reduce((sum2, h2) => sum2 + h2, 0)); + const background = Rect.hull([originalLinesOverlay, modifiedLinesOverlay]); + const lowerBackground = background.intersectVertical(new OffsetRange(originalLinesOverlay.bottom, Number.MAX_SAFE_INTEGER)); + const lowerText = new Rect(lowerBackground.left, lowerBackground.top, lowerBackground.right, lowerBackground.bottom); + return { + originalLinesOverlay, + modifiedLinesOverlay, + background, + lowerBackground, + lowerText, + modifiedLineHeights, + minContentWidthRequired: prefixLeftOffset + maxLineWidth + verticalScrollbarWidth + }; + }); + this._viewZoneInfo = derived((reader) => { + const shouldShowViewZone = this._editor.getOption( + 71 + /* EditorOption.inlineSuggest */ + ).map((o) => o.edits.allowCodeShifting === "always").read(reader); + if (!shouldShowViewZone) { + return void 0; + } + const layout2 = this._layout.read(reader); + const edit2 = this._edit.read(reader); + if (!layout2 || !edit2) { + return void 0; + } + const viewZoneHeight = layout2.lowerBackground.height; + const viewZoneLineNumber = edit2.originalRange.endLineNumberExclusive; + return { height: viewZoneHeight, lineNumber: viewZoneLineNumber }; + }); + this.minEditorScrollHeight = derived(this, (reader) => { + const layout2 = mapOutFalsy(this._layout).read(reader); + if (!layout2 || this._viewZoneInfo.read(reader) !== void 0) { + return 0; + } + return layout2.read(reader).lowerText.bottom + this._editor.editor.getScrollTop(); + }); + this._div = n.div({ + class: "line-replacement" + }, [ + derived(this, (reader) => { + const layout2 = mapOutFalsy(this._layout).read(reader); + const modifiedLineElements = this._modifiedLineElements.read(reader); + if (!layout2 || !modifiedLineElements) { + return []; + } + const layoutProps = layout2.read(reader); + const contentLeft = this._editor.layoutInfoContentLeft.read(reader); + const separatorWidth = this._isInDiffEditor.read(reader) ? 3 : 1; + modifiedLineElements.lines.forEach((l, i2) => { + l.style.width = `${layoutProps.lowerText.width}px`; + l.style.height = `${layoutProps.modifiedLineHeights[i2]}px`; + l.style.position = "relative"; + }); + const modifiedBorderColor = getModifiedBorderColor(this._tabAction).read(reader); + const originalBorderColor = getOriginalBorderColor(this._tabAction).read(reader); + return [ + n.div({ + style: { + position: "absolute", + ...rectToProps((r) => getEditorValidOverlayRect(this._editor).read(r)), + overflow: "hidden", + pointerEvents: "none" + } + }, [ + n.div({ + class: "borderAroundLineReplacement", + style: { + position: "absolute", + ...rectToProps((reader2) => layout2.read(reader2).background.translateX(-contentLeft).withMargin(separatorWidth)), + borderRadius: "4px", + border: `${separatorWidth + 1}px solid ${asCssVariable(editorBackground)}`, + boxSizing: "border-box", + pointerEvents: "none" + } + }), + n.div({ + class: "originalOverlayLineReplacement", + style: { + position: "absolute", + ...rectToProps((reader2) => layout2.read(reader2).background.translateX(-contentLeft)), + borderRadius: "4px", + border: getEditorBlendedColor(originalBorderColor, this._themeService).map((c) => `1px solid ${c.toString()}`), + pointerEvents: "none", + boxSizing: "border-box", + background: asCssVariable(originalBackgroundColor) + } + }), + n.div({ + class: "modifiedOverlayLineReplacement", + style: { + position: "absolute", + ...rectToProps((reader2) => layout2.read(reader2).lowerBackground.translateX(-contentLeft)), + borderRadius: "0 0 4px 4px", + background: asCssVariable(editorBackground), + boxShadow: `${asCssVariable(scrollbarShadow)} 0 6px 6px -6px`, + border: `1px solid ${asCssVariable(modifiedBorderColor)}`, + boxSizing: "border-box", + overflow: "hidden", + cursor: "pointer", + pointerEvents: "auto" + }, + onmousedown: (e) => { + e.preventDefault(); + }, + onclick: (e) => this._onDidClick.fire(new StandardMouseEvent(getWindow(e), e)) + }, [ + n.div({ + style: { + position: "absolute", + top: 0, + left: 0, + width: "100%", + height: "100%", + background: asCssVariable(modifiedChangedLineBackgroundColor) + } + }) + ]), + n.div({ + class: "modifiedLinesLineReplacement", + style: { + position: "absolute", + boxSizing: "border-box", + ...rectToProps((reader2) => layout2.read(reader2).lowerText.translateX(-contentLeft)), + fontFamily: this._editor.getOption( + 58 + /* EditorOption.fontFamily */ + ), + fontSize: this._editor.getOption( + 61 + /* EditorOption.fontSize */ + ), + fontWeight: this._editor.getOption( + 62 + /* EditorOption.fontWeight */ + ), + pointerEvents: "none", + whiteSpace: "nowrap", + borderRadius: "0 0 4px 4px", + overflow: "hidden" + } + }, [...modifiedLineElements.lines]) + ]) + ]; + }) + ]).keepUpdated(this._store); + this.isHovered = this._editor.isTargetHovered((e) => this._isMouseOverWidget(e), this._store); + this._previousViewZoneInfo = void 0; + this._register(toDisposable(() => this._editor.editor.changeViewZones((accessor) => this.removePreviousViewZone(accessor)))); + this._register(autorunDelta(this._viewZoneInfo, ({ lastValue, newValue }) => { + if (lastValue === newValue || lastValue?.height === newValue?.height && lastValue?.lineNumber === newValue?.lineNumber) { + return; + } + this._editor.editor.changeViewZones((changeAccessor) => { + this.removePreviousViewZone(changeAccessor); + if (!newValue) { + return; + } + this.addViewZone(newValue, changeAccessor); + }); + })); + this._register(this._editor.createOverlayWidget({ + domNode: this._div.element, + minContentWidthInPx: derived(this, (reader) => { + return this._layout.read(reader)?.minContentWidthRequired ?? 0; + }), + position: constObservable({ preference: { top: 0, left: 0 } }), + allowEditorOverflow: false + })); + } + _isMouseOverWidget(e) { + const layout2 = this._layout.get(); + if (!layout2 || !(e.event instanceof EditorMouseEvent)) { + return false; + } + return layout2.lowerBackground.containsPoint(new Point(e.event.relativePos.x, e.event.relativePos.y)); + } + removePreviousViewZone(changeAccessor) { + if (!this._previousViewZoneInfo) { + return; + } + changeAccessor.removeZone(this._previousViewZoneInfo.id); + const cursorLineNumber = this._editor.cursorLineNumber.get(); + if (cursorLineNumber !== null && cursorLineNumber >= this._previousViewZoneInfo.lineNumber) { + this._editor.editor.setScrollTop(this._editor.scrollTop.get() - this._previousViewZoneInfo.height); + } + this._previousViewZoneInfo = void 0; + } + addViewZone(viewZoneInfo, changeAccessor) { + const activeViewZone = changeAccessor.addZone({ + afterLineNumber: viewZoneInfo.lineNumber - 1, + heightInPx: viewZoneInfo.height, + // move computation to layout? + domNode: $("div") + }); + this._previousViewZoneInfo = { height: viewZoneInfo.height, lineNumber: viewZoneInfo.lineNumber, id: activeViewZone }; + const cursorLineNumber = this._editor.cursorLineNumber.get(); + if (cursorLineNumber !== null && cursorLineNumber >= viewZoneInfo.lineNumber) { + this._editor.editor.setScrollTop(this._editor.scrollTop.get() + viewZoneInfo.height); + } + } +}; +InlineEditsLineReplacementView = __decorate126([ + __param120(4, ILanguageService), + __param120(5, IThemeService) +], InlineEditsLineReplacementView); +function rangesToBubbleRanges(ranges) { + const result = []; + while (ranges.length) { + let range2 = ranges.shift(); + if (range2.startLineNumber !== range2.endLineNumber) { + ranges.push(new Range(range2.startLineNumber + 1, 1, range2.endLineNumber, range2.endColumn)); + range2 = new Range(range2.startLineNumber, range2.startColumn, range2.startLineNumber, Number.MAX_SAFE_INTEGER); + } + result.push(range2); + } + return result; +} + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsSideBySideView.js +init_dom(); +init_mouseEvent(); +init_color(); +init_event(); +init_lifecycle(); +init_observable(); +init_instantiation(); +init_colorRegistry(); +init_colorUtils(); +init_themeService(); +init_observableCodeEditor(); +init_offsetRange(); +init_position(); +init_range(); +var __decorate127 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param121 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var HORIZONTAL_PADDING2 = 0; +var VERTICAL_PADDING2 = 0; +var ENABLE_OVERFLOW = false; +var BORDER_WIDTH3 = 1; +var WIDGET_SEPARATOR_WIDTH3 = 1; +var WIDGET_SEPARATOR_DIFF_EDITOR_WIDTH3 = 3; +var BORDER_RADIUS3 = 4; +var ORIGINAL_END_PADDING = 20; +var MODIFIED_END_PADDING = 12; +var InlineEditsSideBySideView = class InlineEditsSideBySideView2 extends Disposable { + // This is an approximation and should be improved by using the real parameters used bellow + static fitsInsideViewport(editor2, textModel, edit2, reader) { + const editorObs = observableCodeEditor(editor2); + const editorWidth = editorObs.layoutInfoWidth.read(reader); + const editorContentLeft = editorObs.layoutInfoContentLeft.read(reader); + const editorVerticalScrollbar = editor2.getLayoutInfo().verticalScrollbarWidth; + const minimapWidth = editorObs.layoutInfoMinimap.read(reader).minimapLeft !== 0 ? editorObs.layoutInfoMinimap.read(reader).minimapWidth : 0; + const maxOriginalContent = maxContentWidthInRange( + editorObs, + edit2.displayRange, + void 0 + /* do not reconsider on each layout info change */ + ); + const maxModifiedContent = edit2.lineEdit.newLines.reduce((max, line) => Math.max(max, getContentRenderWidth(line, editor2, textModel)), 0); + const originalPadding = ORIGINAL_END_PADDING; + const modifiedPadding = MODIFIED_END_PADDING + 2 * BORDER_WIDTH3; + return maxOriginalContent + maxModifiedContent + originalPadding + modifiedPadding < editorWidth - editorContentLeft - editorVerticalScrollbar - minimapWidth; + } + constructor(_editor, _edit, _previewTextModel, _uiState, _tabAction, _instantiationService, _themeService) { + super(); + this._editor = _editor; + this._edit = _edit; + this._previewTextModel = _previewTextModel; + this._uiState = _uiState; + this._tabAction = _tabAction; + this._instantiationService = _instantiationService; + this._themeService = _themeService; + this._editorObs = observableCodeEditor(this._editor); + this._onDidClick = this._register(new Emitter()); + this.onDidClick = this._onDidClick.event; + this._display = derived(this, (reader) => !!this._uiState.read(reader) ? "block" : "none"); + this.previewRef = n.ref(); + const separatorWidthObs = this._uiState.map((s) => s?.isInDiffEditor ? WIDGET_SEPARATOR_DIFF_EDITOR_WIDTH3 : WIDGET_SEPARATOR_WIDTH3); + this._editorContainer = n.div({ + class: ["editorContainer"], + style: { position: "absolute", overflow: "hidden", cursor: "pointer" }, + onmousedown: (e) => { + e.preventDefault(); + }, + onclick: (e) => { + this._onDidClick.fire(new StandardMouseEvent(getWindow(e), e)); + } + }, [ + n.div({ class: "preview", style: { pointerEvents: "none" }, ref: this.previewRef }) + ]).keepUpdated(this._store); + this.isHovered = this._editorContainer.didMouseMoveDuringHover; + this.previewEditor = this._register(this._instantiationService.createInstance(EmbeddedCodeEditorWidget, this.previewRef.element, { + glyphMargin: false, + lineNumbers: "off", + minimap: { enabled: false }, + guides: { + indentation: false, + bracketPairs: false, + bracketPairsHorizontal: false, + highlightActiveIndentation: false + }, + rulers: [], + padding: { top: 0, bottom: 0 }, + folding: false, + selectOnLineNumbers: false, + selectionHighlight: false, + columnSelection: false, + overviewRulerBorder: false, + overviewRulerLanes: 0, + lineDecorationsWidth: 0, + lineNumbersMinChars: 0, + revealHorizontalRightPadding: 0, + bracketPairColorization: { enabled: true, independentColorPoolPerBracketType: false }, + scrollBeyondLastLine: false, + scrollbar: { + vertical: "hidden", + horizontal: "hidden", + handleMouseWheel: false + }, + readOnly: true, + wordWrap: "off", + wordWrapOverride1: "off", + wordWrapOverride2: "off" + }, { + contextKeyValues: { + [InlineCompletionContextKeys.inInlineEditsPreviewEditor.key]: true + }, + contributions: [] + }, this._editor)); + this._previewEditorObs = observableCodeEditor(this.previewEditor); + this._activeViewZones = []; + this._updatePreviewEditor = derived(this, (reader) => { + this._editorContainer.readEffect(reader); + this._previewEditorObs.model.read(reader); + this._display.read(reader); + if (this._nonOverflowView) { + this._nonOverflowView.element.style.display = this._display.read(reader); + } + const uiState = this._uiState.read(reader); + const edit2 = this._edit.read(reader); + if (!uiState || !edit2) { + return; + } + const range2 = edit2.originalLineRange; + const hiddenAreas = []; + if (range2.startLineNumber > 1) { + hiddenAreas.push(new Range(1, 1, range2.startLineNumber - 1, 1)); + } + if (range2.startLineNumber + uiState.newTextLineCount < this._previewTextModel.getLineCount() + 1) { + hiddenAreas.push(new Range(range2.startLineNumber + uiState.newTextLineCount, 1, this._previewTextModel.getLineCount() + 1, 1)); + } + this.previewEditor.setHiddenAreas(hiddenAreas, void 0, true); + const previousViewZones = [...this._activeViewZones]; + this._activeViewZones = []; + const reducedLinesCount = range2.endLineNumberExclusive - range2.startLineNumber - uiState.newTextLineCount; + this.previewEditor.changeViewZones((changeAccessor) => { + previousViewZones.forEach((id) => changeAccessor.removeZone(id)); + if (reducedLinesCount > 0) { + this._activeViewZones.push(changeAccessor.addZone({ + afterLineNumber: range2.startLineNumber + uiState.newTextLineCount - 1, + heightInLines: reducedLinesCount, + showInHiddenAreas: true, + domNode: $("div.diagonal-fill.inline-edits-view-zone") + })); + } + }); + }); + this._previewEditorWidth = derived(this, (reader) => { + const edit2 = this._edit.read(reader); + if (!edit2) { + return 0; + } + this._updatePreviewEditor.read(reader); + return maxContentWidthInRange(this._previewEditorObs, edit2.modifiedLineRange, reader); + }); + this._cursorPosIfTouchesEdit = derived(this, (reader) => { + const cursorPos = this._editorObs.cursorPosition.read(reader); + const edit2 = this._edit.read(reader); + if (!edit2 || !cursorPos) { + return void 0; + } + return edit2.modifiedLineRange.contains(cursorPos.lineNumber) ? cursorPos : void 0; + }); + this._originalStartPosition = derived(this, (reader) => { + const inlineEdit = this._edit.read(reader); + return inlineEdit ? new Position(inlineEdit.originalLineRange.startLineNumber, 1) : null; + }); + this._originalEndPosition = derived(this, (reader) => { + const inlineEdit = this._edit.read(reader); + return inlineEdit ? new Position(inlineEdit.originalLineRange.endLineNumberExclusive, 1) : null; + }); + this._originalVerticalStartPosition = this._editorObs.observePosition(this._originalStartPosition, this._store).map((p) => p?.y); + this._originalVerticalEndPosition = this._editorObs.observePosition(this._originalEndPosition, this._store).map((p) => p?.y); + this._originalDisplayRange = this._edit.map((e) => e?.displayRange); + this._editorMaxContentWidthInRange = derived(this, (reader) => { + const originalDisplayRange = this._originalDisplayRange.read(reader); + if (!originalDisplayRange) { + return constObservable(0); + } + this._editorObs.versionId.read(reader); + return derivedObservableWithCache(this, (reader2, lastValue) => { + const maxWidth = maxContentWidthInRange(this._editorObs, originalDisplayRange, reader2); + return Math.max(maxWidth, lastValue ?? 0); + }); + }).map((v, r) => v.read(r)); + this._previewEditorLayoutInfo = derived(this, (reader) => { + const inlineEdit = this._edit.read(reader); + if (!inlineEdit) { + return null; + } + const state = this._uiState.read(reader); + if (!state) { + return null; + } + const range2 = inlineEdit.originalLineRange; + const horizontalScrollOffset = this._editorObs.scrollLeft.read(reader); + const editorContentMaxWidthInRange = this._editorMaxContentWidthInRange.read(reader); + const editorLayout = this._editorObs.layoutInfo.read(reader); + const previewContentWidth = this._previewEditorWidth.read(reader); + const editorContentAreaWidth = editorLayout.contentWidth - editorLayout.verticalScrollbarWidth; + const editorBoundingClientRect = this._editor.getContainerDomNode().getBoundingClientRect(); + const clientContentAreaRight = editorLayout.contentLeft + editorLayout.contentWidth + editorBoundingClientRect.left; + const remainingWidthRightOfContent = getWindow(this._editor.getContainerDomNode()).innerWidth - clientContentAreaRight; + const remainingWidthRightOfEditor = getWindow(this._editor.getContainerDomNode()).innerWidth - editorBoundingClientRect.right; + const desiredMinimumWidth = Math.min(editorLayout.contentWidth * 0.3, previewContentWidth, 100); + const IN_EDITOR_DISPLACEMENT = 0; + const maximumAvailableWidth = IN_EDITOR_DISPLACEMENT + remainingWidthRightOfContent; + const cursorPos = this._cursorPosIfTouchesEdit.read(reader); + const maxPreviewEditorLeft = Math.max( + // We're starting from the content area right and moving it left by IN_EDITOR_DISPLACEMENT and also by an amount to ensure some minimum desired width + editorContentAreaWidth + horizontalScrollOffset - IN_EDITOR_DISPLACEMENT - Math.max(0, desiredMinimumWidth - maximumAvailableWidth), + // But we don't want that the moving left ends up covering the cursor, so this will push it to the right again + Math.min(cursorPos ? getOffsetForPos(this._editorObs, cursorPos, reader) + 50 : 0, editorContentAreaWidth + horizontalScrollOffset) + ); + const previewEditorLeftInTextArea = Math.min(editorContentMaxWidthInRange + ORIGINAL_END_PADDING, maxPreviewEditorLeft); + const maxContentWidth = editorContentMaxWidthInRange + ORIGINAL_END_PADDING + previewContentWidth + 70; + const dist = maxPreviewEditorLeft - previewEditorLeftInTextArea; + let desiredPreviewEditorScrollLeft; + let codeRight; + if (previewEditorLeftInTextArea > horizontalScrollOffset) { + desiredPreviewEditorScrollLeft = 0; + codeRight = editorLayout.contentLeft + previewEditorLeftInTextArea - horizontalScrollOffset; + } else { + desiredPreviewEditorScrollLeft = horizontalScrollOffset - previewEditorLeftInTextArea; + codeRight = editorLayout.contentLeft; + } + const selectionTop = this._originalVerticalStartPosition.read(reader) ?? this._editor.getTopForLineNumber(range2.startLineNumber) - this._editorObs.scrollTop.read(reader); + const selectionBottom = this._originalVerticalEndPosition.read(reader) ?? this._editor.getBottomForLineNumber(range2.endLineNumberExclusive - 1) - this._editorObs.scrollTop.read(reader); + const codeLeft = editorLayout.contentLeft - horizontalScrollOffset; + let codeRect = Rect.fromLeftTopRightBottom(codeLeft, selectionTop, codeRight, selectionBottom); + const isInsertion2 = codeRect.height === 0; + if (!isInsertion2) { + codeRect = codeRect.withMargin(VERTICAL_PADDING2, HORIZONTAL_PADDING2); + } + const previewLineHeights = this._previewEditorObs.observeLineHeightsForLineRange(inlineEdit.modifiedLineRange).read(reader); + const editHeight = previewLineHeights.reduce((acc, h2) => acc + h2, 0); + const codeHeight = selectionBottom - selectionTop; + const previewEditorHeight = Math.max(codeHeight, editHeight); + const clipped = dist === 0; + const codeEditDist = 0; + const previewEditorWidth = Math.min(previewContentWidth + MODIFIED_END_PADDING, remainingWidthRightOfEditor + editorLayout.width - editorLayout.contentLeft - codeEditDist); + let editRect = Rect.fromLeftTopWidthHeight(codeRect.right + codeEditDist, selectionTop, previewEditorWidth, previewEditorHeight); + if (!isInsertion2) { + editRect = editRect.withMargin(VERTICAL_PADDING2, HORIZONTAL_PADDING2).translateX(HORIZONTAL_PADDING2 + BORDER_WIDTH3); + } else { + editRect = editRect.withMargin(VERTICAL_PADDING2, HORIZONTAL_PADDING2).translateY(VERTICAL_PADDING2); + } + return { + codeRect, + editRect, + codeScrollLeft: horizontalScrollOffset, + contentLeft: editorLayout.contentLeft, + isInsertion: isInsertion2, + maxContentWidth, + shouldShowShadow: clipped, + desiredPreviewEditorScrollLeft, + previewEditorWidth + }; + }); + this._stickyScrollController = StickyScrollController2.get(this._editorObs.editor); + this._stickyScrollHeight = this._stickyScrollController ? observableFromEvent(this._stickyScrollController.onDidChangeStickyScrollHeight, () => this._stickyScrollController.stickyScrollWidgetHeight) : constObservable(0); + this._shouldOverflow = derived(this, (reader) => { + if (!ENABLE_OVERFLOW) { + return false; + } + const range2 = this._edit.read(reader)?.originalLineRange; + if (!range2) { + return false; + } + const stickyScrollHeight = this._stickyScrollHeight.read(reader); + const top = this._editor.getTopForLineNumber(range2.startLineNumber) - this._editorObs.scrollTop.read(reader); + if (top <= stickyScrollHeight) { + return false; + } + const bottom = this._editor.getTopForLineNumber(range2.endLineNumberExclusive) - this._editorObs.scrollTop.read(reader); + if (bottom >= this._editorObs.layoutInfo.read(reader).height) { + return false; + } + return true; + }); + this._originalBackgroundColor = observableFromEvent(this, this._themeService.onDidColorThemeChange, () => { + return this._themeService.getColorTheme().getColor(originalBackgroundColor) ?? Color.transparent; + }); + this._backgroundSvg = n.svg({ + transform: "translate(-0.5 -0.5)", + style: { overflow: "visible", pointerEvents: "none", position: "absolute" } + }, [ + n.svgElem("path", { + class: "rightOfModifiedBackgroundCoverUp", + d: derived(this, (reader) => { + const layoutInfo = this._previewEditorLayoutInfo.read(reader); + if (!layoutInfo) { + return void 0; + } + const originalBackgroundColor2 = this._originalBackgroundColor.read(reader); + if (originalBackgroundColor2.isTransparent()) { + return void 0; + } + return new PathBuilder().moveTo(layoutInfo.codeRect.getRightTop()).lineTo(layoutInfo.codeRect.getRightTop().deltaX(1e3)).lineTo(layoutInfo.codeRect.getRightBottom().deltaX(1e3)).lineTo(layoutInfo.codeRect.getRightBottom()).build(); + }), + style: { + fill: asCssVariableWithDefault(editorBackground, "transparent") + } + }) + ]).keepUpdated(this._store); + this._originalOverlay = n.div({ + style: { pointerEvents: "none", display: this._previewEditorLayoutInfo.map((layoutInfo) => layoutInfo?.isInsertion ? "none" : "block") } + }, derived(this, (reader) => { + const layoutInfoObs = mapOutFalsy(this._previewEditorLayoutInfo).read(reader); + if (!layoutInfoObs) { + return void 0; + } + const separatorWidth = separatorWidthObs.read(reader); + const borderStyling = getOriginalBorderColor(this._tabAction).map((bc) => `${BORDER_WIDTH3}px solid ${asCssVariable(bc)}`); + const borderStylingSeparator = `${BORDER_WIDTH3 + separatorWidth}px solid ${asCssVariable(editorBackground)}`; + const hasBorderLeft = layoutInfoObs.read(reader).codeScrollLeft !== 0; + const isModifiedLower = layoutInfoObs.map((layoutInfo) => layoutInfo.codeRect.bottom < layoutInfo.editRect.bottom); + const transitionRectSize = BORDER_RADIUS3 * 2 + BORDER_WIDTH3 * 2; + const overlayHider = layoutInfoObs.map((layoutInfo) => Rect.fromLeftTopRightBottom(layoutInfo.contentLeft - BORDER_RADIUS3 - BORDER_WIDTH3, layoutInfo.codeRect.top, layoutInfo.contentLeft, layoutInfo.codeRect.bottom + transitionRectSize)).read(reader); + const intersectionLine = new OffsetRange(overlayHider.left, Number.MAX_SAFE_INTEGER); + const overlayRect = layoutInfoObs.map((layoutInfo) => layoutInfo.codeRect.intersectHorizontal(intersectionLine)); + const separatorRect = overlayRect.map((overlayRect2) => overlayRect2.withMargin(separatorWidth, 0, separatorWidth, separatorWidth).intersectHorizontal(intersectionLine)); + const transitionRect = overlayRect.map((overlayRect2) => Rect.fromLeftTopWidthHeight(overlayRect2.right - transitionRectSize + BORDER_WIDTH3, overlayRect2.bottom - BORDER_WIDTH3, transitionRectSize, transitionRectSize).intersectHorizontal(intersectionLine)); + return [ + n.div({ + class: "originalSeparatorSideBySide", + style: { + ...separatorRect.read(reader).toStyles(), + boxSizing: "border-box", + borderRadius: `${BORDER_RADIUS3}px 0 0 ${BORDER_RADIUS3}px`, + borderTop: borderStylingSeparator, + borderBottom: borderStylingSeparator, + borderLeft: hasBorderLeft ? "none" : borderStylingSeparator + } + }), + n.div({ + class: "originalOverlaySideBySide", + style: { + ...overlayRect.read(reader).toStyles(), + boxSizing: "border-box", + borderRadius: `${BORDER_RADIUS3}px 0 0 ${BORDER_RADIUS3}px`, + borderTop: borderStyling, + borderBottom: borderStyling, + borderLeft: hasBorderLeft ? "none" : borderStyling, + backgroundColor: asCssVariable(originalBackgroundColor) + } + }), + n.div({ + class: "originalCornerCutoutSideBySide", + style: { + pointerEvents: "none", + display: isModifiedLower.map((isLower2) => isLower2 ? "block" : "none"), + ...transitionRect.read(reader).toStyles() + } + }, [ + n.div({ + class: "originalCornerCutoutBackground", + style: { + position: "absolute", + top: "0px", + left: "0px", + width: "100%", + height: "100%", + backgroundColor: getEditorBlendedColor(originalBackgroundColor, this._themeService).map((c) => c.toString()) + } + }), + n.div({ + class: "originalCornerCutoutBorder", + style: { + position: "absolute", + top: "0px", + left: "0px", + width: "100%", + height: "100%", + boxSizing: "border-box", + borderTop: borderStyling, + borderRight: borderStyling, + borderRadius: `0 100% 0 0`, + backgroundColor: asCssVariable(editorBackground) + } + }) + ]), + n.div({ + class: "originalOverlaySideBySideHider", + style: { + ...overlayHider.toStyles(), + backgroundColor: asCssVariable(editorBackground) + } + }) + ]; + })).keepUpdated(this._store); + this._modifiedOverlay = n.div({ + style: { pointerEvents: "none" } + }, derived(this, (reader) => { + const layoutInfoObs = mapOutFalsy(this._previewEditorLayoutInfo).read(reader); + if (!layoutInfoObs) { + return void 0; + } + const isModifiedLower = layoutInfoObs.map((layoutInfo) => layoutInfo.codeRect.bottom < layoutInfo.editRect.bottom); + const separatorWidth = separatorWidthObs.read(reader); + const borderRadius = isModifiedLower.map((isLower2) => `0 ${BORDER_RADIUS3}px ${BORDER_RADIUS3}px ${isLower2 ? BORDER_RADIUS3 : 0}px`); + const borderStyling = getEditorBlendedColor(getModifiedBorderColor(this._tabAction), this._themeService).map((c) => `1px solid ${c.toString()}`); + const borderStylingSeparator = `${BORDER_WIDTH3 + separatorWidth}px solid ${asCssVariable(editorBackground)}`; + const overlayRect = layoutInfoObs.map((layoutInfo) => layoutInfo.editRect.withMargin(0, BORDER_WIDTH3)); + const separatorRect = overlayRect.map((overlayRect2) => overlayRect2.withMargin(separatorWidth, separatorWidth, separatorWidth, 0)); + const insertionRect = derived(this, (reader2) => { + const overlay = overlayRect.read(reader2); + const layoutinfo = layoutInfoObs.read(reader2); + if (!layoutinfo.isInsertion || layoutinfo.contentLeft >= overlay.left) { + return Rect.fromLeftTopWidthHeight(overlay.left, overlay.top, 0, 0); + } + return new Rect(layoutinfo.contentLeft, overlay.top, overlay.left, overlay.top + BORDER_WIDTH3 * 2); + }); + return [ + n.div({ + class: "modifiedInsertionSideBySide", + style: { + ...insertionRect.read(reader).toStyles(), + backgroundColor: getModifiedBorderColor(this._tabAction).map((c) => asCssVariable(c)) + } + }), + n.div({ + class: "modifiedSeparatorSideBySide", + style: { + ...separatorRect.read(reader).toStyles(), + borderRadius, + borderTop: borderStylingSeparator, + borderBottom: borderStylingSeparator, + borderRight: borderStylingSeparator, + boxSizing: "border-box" + } + }), + n.div({ + class: "modifiedOverlaySideBySide", + style: { + ...overlayRect.read(reader).toStyles(), + borderRadius, + border: borderStyling, + boxSizing: "border-box", + backgroundColor: asCssVariable(modifiedBackgroundColor) + } + }) + ]; + })).keepUpdated(this._store); + this._nonOverflowView = n.div({ + class: "inline-edits-view", + style: { + position: "absolute", + overflow: "visible", + top: "0px", + left: "0px", + display: this._display + } + }, [ + this._backgroundSvg, + derived(this, (reader) => this._shouldOverflow.read(reader) ? [] : [this._editorContainer, this._originalOverlay, this._modifiedOverlay]) + ]).keepUpdated(this._store); + this._register(this._editorObs.createOverlayWidget({ + domNode: this._nonOverflowView.element, + position: constObservable(null), + allowEditorOverflow: false, + minContentWidthInPx: derived(this, (reader) => { + const x = this._previewEditorLayoutInfo.read(reader)?.maxContentWidth; + if (x === void 0) { + return 0; + } + return x; + }) + })); + this.previewEditor.setModel(this._previewTextModel); + this._register(autorun((reader) => { + const layoutInfo = this._previewEditorLayoutInfo.read(reader); + if (!layoutInfo) { + return; + } + const editorRect = layoutInfo.editRect.withMargin(-VERTICAL_PADDING2, -HORIZONTAL_PADDING2); + this.previewEditor.layout({ + height: editorRect.height, + width: layoutInfo.previewEditorWidth + 15 + /* Make sure editor does not scroll horizontally */ + }); + this._editorContainer.element.style.top = `${editorRect.top}px`; + this._editorContainer.element.style.left = `${editorRect.left}px`; + this._editorContainer.element.style.width = `${layoutInfo.previewEditorWidth + HORIZONTAL_PADDING2}px`; + })); + this._register(autorun((reader) => { + const layoutInfo = this._previewEditorLayoutInfo.read(reader); + if (!layoutInfo) { + return; + } + this._previewEditorObs.editor.setScrollLeft(layoutInfo.desiredPreviewEditorScrollLeft); + })); + this._updatePreviewEditor.recomputeInitiallyAndOnChange(this._store); + } +}; +InlineEditsSideBySideView = __decorate127([ + __param121(5, IInstantiationService), + __param121(6, IThemeService) +], InlineEditsSideBySideView); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsWordReplacementView.js +init_dom(); +init_mouseEvent(); +init_event(); +init_lifecycle(); +init_observable(); +init_colorRegistry(); +init_colorUtils(); +init_point(); +init_offsetRange(); +init_language(); +init_lineTokens(); +var __decorate128 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param122 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var BORDER_WIDTH4 = 1; +var InlineEditsWordReplacementView = class InlineEditsWordReplacementView2 extends Disposable { + static { + this.MAX_LENGTH = 100; + } + constructor(_editor, _edit, _tabAction, _languageService) { + super(); + this._editor = _editor; + this._edit = _edit; + this._tabAction = _tabAction; + this._languageService = _languageService; + this._onDidClick = this._register(new Emitter()); + this.onDidClick = this._onDidClick.event; + this._start = this._editor.observePosition(constObservable(this._edit.range.getStartPosition()), this._store); + this._end = this._editor.observePosition(constObservable(this._edit.range.getEndPosition()), this._store); + this._line = document.createElement("div"); + this._hoverableElement = observableValue(this, null); + this.isHovered = this._hoverableElement.map((e, reader) => e?.didMouseMoveDuringHover.read(reader) ?? false); + this._renderTextEffect = derived(this, (_reader) => { + const tm = this._editor.model.get(); + const origLine = tm.getLineContent(this._edit.range.startLineNumber); + const edit2 = StringReplacement.replace(new OffsetRange(this._edit.range.startColumn - 1, this._edit.range.endColumn - 1), this._edit.text); + const lineToTokenize = edit2.replace(origLine); + const t = tm.tokenization.tokenizeLinesAt(this._edit.range.startLineNumber, [lineToTokenize])?.[0]; + let tokens; + if (t) { + tokens = TokenArray.fromLineTokens(t).slice(edit2.getRangeAfterReplace()).toLineTokens(this._edit.text, this._languageService.languageIdCodec); + } else { + tokens = LineTokens.createEmpty(this._edit.text, this._languageService.languageIdCodec); + } + const res = renderLines(new LineSource([tokens]), RenderOptions.fromEditor(this._editor.editor).withSetWidth(false).withScrollBeyondLastColumn(0), [], this._line, true); + this._line.style.width = `${res.minWidthInPx}px`; + }); + const modifiedLineHeight = this._editor.observeLineHeightForPosition(this._edit.range.getStartPosition()); + this._layout = derived(this, (reader) => { + this._renderTextEffect.read(reader); + const widgetStart = this._start.read(reader); + const widgetEnd = this._end.read(reader); + if (!widgetStart || !widgetEnd || widgetStart.x > widgetEnd.x || widgetStart.y > widgetEnd.y) { + return void 0; + } + const lineHeight = modifiedLineHeight.read(reader); + const scrollLeft = this._editor.scrollLeft.read(reader); + const w = this._editor.getOption( + 59 + /* EditorOption.fontInfo */ + ).read(reader).typicalHalfwidthCharacterWidth; + const modifiedLeftOffset = 3 * w; + const modifiedTopOffset = 4; + const modifiedOffset = new Point(modifiedLeftOffset, modifiedTopOffset); + const originalLine = Rect.fromPoints(widgetStart, widgetEnd).withHeight(lineHeight).translateX(-scrollLeft); + const modifiedLine = Rect.fromPointSize(originalLine.getLeftBottom().add(modifiedOffset), new Point(this._edit.text.length * w, originalLine.height)); + const lowerBackground = modifiedLine.withLeft(originalLine.left); + return { + originalLine, + modifiedLine, + lowerBackground, + lineHeight + }; + }); + this.minEditorScrollHeight = derived(this, (reader) => { + const layout2 = mapOutFalsy(this._layout).read(reader); + if (!layout2) { + return 0; + } + return layout2.read(reader).modifiedLine.bottom + BORDER_WIDTH4 + this._editor.editor.getScrollTop(); + }); + this._root = n.div({ + class: "word-replacement" + }, [ + derived(this, (reader) => { + const layout2 = mapOutFalsy(this._layout).read(reader); + if (!layout2) { + return []; + } + const originalBorderColor = getOriginalBorderColor(this._tabAction).map((c) => asCssVariable(c)).read(reader); + const modifiedBorderColor = getModifiedBorderColor(this._tabAction).map((c) => asCssVariable(c)).read(reader); + return [ + n.div({ + style: { + position: "absolute", + ...rectToProps((r) => getEditorValidOverlayRect(this._editor).read(r)), + overflow: "hidden", + pointerEvents: "none" + } + }, [ + n.div({ + style: { + position: "absolute", + ...rectToProps((reader2) => layout2.read(reader2).lowerBackground.withMargin(BORDER_WIDTH4, 2 * BORDER_WIDTH4, BORDER_WIDTH4, 0)), + background: asCssVariable(editorBackground), + //boxShadow: `${asCssVariable(scrollbarShadow)} 0 6px 6px -6px`, + cursor: "pointer", + pointerEvents: "auto" + }, + onmousedown: (e) => { + e.preventDefault(); + }, + onmouseup: (e) => this._onDidClick.fire(new StandardMouseEvent(getWindow(e), e)), + obsRef: (elem) => { + this._hoverableElement.set(elem, void 0); + } + }), + n.div({ + style: { + position: "absolute", + ...rectToProps((reader2) => layout2.read(reader2).modifiedLine.withMargin(BORDER_WIDTH4, 2 * BORDER_WIDTH4)), + fontFamily: this._editor.getOption( + 58 + /* EditorOption.fontFamily */ + ), + fontSize: this._editor.getOption( + 61 + /* EditorOption.fontSize */ + ), + fontWeight: this._editor.getOption( + 62 + /* EditorOption.fontWeight */ + ), + pointerEvents: "none", + boxSizing: "border-box", + borderRadius: "4px", + border: `${BORDER_WIDTH4}px solid ${modifiedBorderColor}`, + background: asCssVariable(modifiedChangedTextOverlayColor), + display: "flex", + justifyContent: "center", + alignItems: "center", + outline: `2px solid ${asCssVariable(editorBackground)}` + } + }, [this._line]), + n.div({ + style: { + position: "absolute", + ...rectToProps((reader2) => layout2.read(reader2).originalLine.withMargin(BORDER_WIDTH4)), + boxSizing: "border-box", + borderRadius: "4px", + border: `${BORDER_WIDTH4}px solid ${originalBorderColor}`, + background: asCssVariable(originalChangedTextOverlayColor), + pointerEvents: "none" + } + }, []), + n.svg({ + width: 11, + height: 14, + viewBox: "0 0 11 14", + fill: "none", + style: { + position: "absolute", + left: layout2.map((l) => l.modifiedLine.left - 16), + top: layout2.map((l) => l.modifiedLine.top + Math.round((l.lineHeight - 14 - 5) / 2)) + } + }, [ + n.svgElem("path", { + d: "M1 0C1 2.98966 1 5.92087 1 8.49952C1 9.60409 1.89543 10.5 3 10.5H10.5", + stroke: asCssVariable(editorHoverForeground) + }), + n.svgElem("path", { + d: "M6 7.5L9.99999 10.49998L6 13.5", + stroke: asCssVariable(editorHoverForeground) + }) + ]) + ]) + ]; + }) + ]).keepUpdated(this._store); + this._register(this._editor.createOverlayWidget({ + domNode: this._root.element, + minContentWidthInPx: constObservable(0), + position: constObservable({ preference: { top: 0, left: 0 } }), + allowEditorOverflow: false + })); + } +}; +InlineEditsWordReplacementView = __decorate128([ + __param122(3, ILanguageService) +], InlineEditsWordReplacementView); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/originalEditorInlineDiffView.js +init_event(); +init_lifecycle(); +init_observable(); +init_observableCodeEditor(); +init_offsetRange(); +init_range(); +init_model2(); +init_textModel(); +var OriginalEditorInlineDiffView = class extends Disposable { + constructor(_originalEditor, _state, _modifiedTextModel) { + super(); + this._originalEditor = _originalEditor; + this._state = _state; + this._modifiedTextModel = _modifiedTextModel; + this._onDidClick = this._register(new Emitter()); + this.onDidClick = this._onDidClick.event; + this.isHovered = observableCodeEditor(this._originalEditor).isTargetHovered((p) => p.target.type === 6 && p.target.detail.injectedText?.options.attachedData instanceof InlineEditAttachedData && p.target.detail.injectedText.options.attachedData.owner === this, this._store); + this._tokenizationFinished = modelTokenizationFinished(this._modifiedTextModel); + this._decorations = derived(this, (reader) => { + const diff = this._state.read(reader); + if (!diff) { + return void 0; + } + const modified = diff.modifiedText; + const showInline = diff.mode === "insertionInline"; + const hasOneInnerChange = diff.diff.length === 1 && diff.diff[0].innerChanges?.length === 1; + const showEmptyDecorations = true; + const originalDecorations = []; + const modifiedDecorations = []; + const diffLineAddDecorationBackground2 = ModelDecorationOptions.register({ + className: "inlineCompletions-line-insert", + description: "line-insert", + isWholeLine: true, + marginClassName: "gutter-insert" + }); + const diffLineDeleteDecorationBackground2 = ModelDecorationOptions.register({ + className: "inlineCompletions-line-delete", + description: "line-delete", + isWholeLine: true, + marginClassName: "gutter-delete" + }); + const diffWholeLineDeleteDecoration2 = ModelDecorationOptions.register({ + className: "inlineCompletions-char-delete", + description: "char-delete", + isWholeLine: false, + zIndex: 1 + // be on top of diff background decoration + }); + const diffWholeLineAddDecoration2 = ModelDecorationOptions.register({ + className: "inlineCompletions-char-insert", + description: "char-insert", + isWholeLine: true + }); + const diffAddDecoration2 = ModelDecorationOptions.register({ + className: "inlineCompletions-char-insert", + description: "char-insert", + shouldFillLineOnLineBreak: true + }); + const diffAddDecorationEmpty2 = ModelDecorationOptions.register({ + className: "inlineCompletions-char-insert diff-range-empty", + description: "char-insert diff-range-empty" + }); + const NESOriginalBackground = ModelDecorationOptions.register({ + className: "inlineCompletions-original-lines", + description: "inlineCompletions-original-lines", + isWholeLine: false, + shouldFillLineOnLineBreak: true + }); + const showFullLineDecorations = diff.mode !== "sideBySide" && diff.mode !== "deletion" && diff.mode !== "insertionInline" && diff.mode !== "lineReplacement"; + const hideEmptyInnerDecorations = diff.mode === "lineReplacement"; + for (const m of diff.diff) { + if (showFullLineDecorations) { + if (!m.original.isEmpty) { + originalDecorations.push({ + range: m.original.toInclusiveRange(), + options: diffLineDeleteDecorationBackground2 + }); + } + if (!m.modified.isEmpty) { + modifiedDecorations.push({ + range: m.modified.toInclusiveRange(), + options: diffLineAddDecorationBackground2 + }); + } + } + if (m.modified.isEmpty || m.original.isEmpty) { + if (!m.original.isEmpty) { + originalDecorations.push({ range: m.original.toInclusiveRange(), options: diffWholeLineDeleteDecoration2 }); + } + if (!m.modified.isEmpty) { + modifiedDecorations.push({ range: m.modified.toInclusiveRange(), options: diffWholeLineAddDecoration2 }); + } + } else { + const useInlineDiff = showInline && allowsTrueInlineDiffRendering2(m); + for (const i2 of m.innerChanges || []) { + if (m.original.contains(i2.originalRange.startLineNumber) && !(hideEmptyInnerDecorations && i2.originalRange.isEmpty())) { + const replacedText = this._originalEditor.getModel()?.getValueInRange( + i2.originalRange, + 1 + /* EndOfLinePreference.LF */ + ); + originalDecorations.push({ + range: i2.originalRange, + options: { + description: "char-delete", + shouldFillLineOnLineBreak: false, + className: classNames("inlineCompletions-char-delete", i2.originalRange.isSingleLine() && diff.mode === "insertionInline" && "single-line-inline", i2.originalRange.isEmpty() && "empty", (i2.originalRange.isEmpty() && hasOneInnerChange || diff.mode === "deletion" && replacedText === "\n") && showEmptyDecorations && !useInlineDiff && "diff-range-empty"), + inlineClassName: useInlineDiff ? classNames("strike-through", "inlineCompletions") : null, + zIndex: 1 + } + }); + } + if (m.modified.contains(i2.modifiedRange.startLineNumber)) { + modifiedDecorations.push({ + range: i2.modifiedRange, + options: i2.modifiedRange.isEmpty() && showEmptyDecorations && !useInlineDiff && hasOneInnerChange ? diffAddDecorationEmpty2 : diffAddDecoration2 + }); + } + if (useInlineDiff) { + const insertedText = modified.getValueOfRange(i2.modifiedRange); + const textSegments = insertedText.length > 3 ? [ + { text: insertedText.slice(0, 1), extraClasses: ["start"], offsetRange: new OffsetRange(i2.modifiedRange.startColumn - 1, i2.modifiedRange.startColumn) }, + { text: insertedText.slice(1, -1), extraClasses: [], offsetRange: new OffsetRange(i2.modifiedRange.startColumn, i2.modifiedRange.endColumn - 2) }, + { text: insertedText.slice(-1), extraClasses: ["end"], offsetRange: new OffsetRange(i2.modifiedRange.endColumn - 2, i2.modifiedRange.endColumn - 1) } + ] : [ + { text: insertedText, extraClasses: ["start", "end"], offsetRange: new OffsetRange(i2.modifiedRange.startColumn - 1, i2.modifiedRange.endColumn) } + ]; + this._tokenizationFinished.read(reader); + const lineTokens = this._modifiedTextModel.tokenization.getLineTokens(i2.modifiedRange.startLineNumber); + for (const { text: text2, extraClasses, offsetRange } of textSegments) { + originalDecorations.push({ + range: Range.fromPositions(i2.originalRange.getEndPosition()), + options: { + description: "inserted-text", + before: { + tokens: lineTokens.getTokensInRange(offsetRange), + content: text2, + inlineClassName: classNames( + "inlineCompletions-char-insert", + i2.modifiedRange.isSingleLine() && diff.mode === "insertionInline" && "single-line-inline", + ...extraClasses + // include extraClasses for additional styling if provided + ), + cursorStops: InjectedTextCursorStops.None, + attachedData: new InlineEditAttachedData(this) + }, + zIndex: 2, + showIfCollapsed: true + } + }); + } + } + } + } + } + if (diff.isInDiffEditor) { + for (const m of diff.diff) { + if (!m.original.isEmpty) { + originalDecorations.push({ + range: m.original.toExclusiveRange(), + options: NESOriginalBackground + }); + } + } + } + return { originalDecorations, modifiedDecorations }; + }); + this._register(observableCodeEditor(this._originalEditor).setDecorations(this._decorations.map((d) => d?.originalDecorations ?? []))); + const modifiedCodeEditor = this._state.map((s) => s?.modifiedCodeEditor); + this._register(autorunWithStore((reader, store) => { + const e = modifiedCodeEditor.read(reader); + if (e) { + store.add(observableCodeEditor(e).setDecorations(this._decorations.map((d) => d?.modifiedDecorations ?? []))); + } + })); + this._register(this._originalEditor.onMouseUp((e) => { + if (e.target.type !== 6) { + return; + } + const a = e.target.detail.injectedText?.options.attachedData; + if (a instanceof InlineEditAttachedData && a.owner === this) { + this._onDidClick.fire(e.event); + } + })); + } +}; +var InlineEditAttachedData = class { + constructor(owner) { + this.owner = owner; + } +}; +function allowsTrueInlineDiffRendering2(mapping) { + if (!mapping.innerChanges) { + return false; + } + return mapping.innerChanges.every((c) => rangeIsSingleLine(c.modifiedRange) && rangeIsSingleLine(c.originalRange)); +} +var i = 0; +function modelTokenizationFinished(model) { + return observableFromEvent(model.onDidChangeTokens, () => i++); +} + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsView.js +var __decorate129 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param123 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var InlineEditsView_1; +var InlineEditsView = InlineEditsView_1 = class InlineEditsView2 extends Disposable { + constructor(_editor, _host, _model, _ghostTextIndicator, _focusIsInMenu, _instantiationService) { + super(); + this._editor = _editor; + this._host = _host; + this._model = _model; + this._ghostTextIndicator = _ghostTextIndicator; + this._focusIsInMenu = _focusIsInMenu; + this._instantiationService = _instantiationService; + this._editorObs = observableCodeEditor(this._editor); + this._tabAction = derived((reader) => this._model.read(reader)?.tabAction.read(reader) ?? InlineEditTabAction.Inactive); + this._constructorDone = observableValue(this, false); + this._uiState = derived(this, (reader) => { + const model = this._model.read(reader); + if (!model || !this._constructorDone.read(reader)) { + return void 0; + } + const inlineEdit = model.inlineEdit; + let mappings = RangeMapping.fromEdit(inlineEdit.edit); + let newText = inlineEdit.edit.apply(inlineEdit.originalText); + let diff = lineRangeMappingFromRangeMappings(mappings, inlineEdit.originalText, new StringText(newText)); + let state = this.determineRenderState(model, reader, diff, new StringText(newText)); + if (!state) { + onUnexpectedError(new Error(`unable to determine view: tried to render ${this._previousView?.view}`)); + return void 0; + } + if (state.kind === InlineCompletionViewKind.SideBySide) { + const indentationAdjustmentEdit = createReindentEdit(newText, inlineEdit.modifiedLineRange, textModel.getOptions().tabSize); + newText = indentationAdjustmentEdit.applyToString(newText); + mappings = applyEditToModifiedRangeMappings(mappings, indentationAdjustmentEdit); + diff = lineRangeMappingFromRangeMappings(mappings, inlineEdit.originalText, new StringText(newText)); + } + this._previewTextModel.setLanguage(this._editor.getModel().getLanguageId()); + const previousNewText = this._previewTextModel.getValue(); + if (previousNewText !== newText) { + this._previewTextModel.setValue(newText); + } + if (model.showCollapsed.read(reader) && !this._indicator.read(reader)?.isHoverVisible.read(reader)) { + state = { kind: InlineCompletionViewKind.Collapsed, viewData: state.viewData }; + } + model.handleInlineEditShown(state.kind, state.viewData); + return { + state, + diff, + edit: inlineEdit, + newText, + newTextLineCount: inlineEdit.modifiedLineRange.length, + isInDiffEditor: model.isInDiffEditor + }; + }); + this._previewTextModel = this._register(this._instantiationService.createInstance(TextModel, "", this._editor.getModel().getLanguageId(), { ...TextModel.DEFAULT_CREATION_OPTIONS, bracketPairColorizationOptions: { enabled: true, independentColorPoolPerBracketType: false } }, null)); + this._indicatorCyclicDependencyCircuitBreaker = observableValue(this, false); + this._indicator = derived(this, (reader) => { + if (!this._indicatorCyclicDependencyCircuitBreaker.read(reader)) { + return void 0; + } + const indicatorDisplayRange = derivedOpts({ owner: this, equalsFn: equalsIfDefined(itemEquals()) }, (reader2) => { + const ghostTextIndicator = this._ghostTextIndicator.read(reader2); + if (ghostTextIndicator) { + return ghostTextIndicator.lineRange; + } + const state = this._uiState.read(reader2); + if (!state) { + return void 0; + } + if (state.state?.kind === "custom") { + const range2 = state.state.displayLocation?.range; + if (!range2) { + throw new BugIndicatingError("custom view should have a range"); + } + return new LineRange(range2.startLineNumber, range2.endLineNumber); + } + if (state.state?.kind === "insertionMultiLine") { + return this._insertion.originalLines.read(reader2); + } + return state.edit.displayRange; + }); + const modelWithGhostTextSupport = derived(this, (reader2) => { + const model = this._model.read(reader2); + if (model) { + return model; + } + const ghostTextIndicator = this._ghostTextIndicator.read(reader2); + if (ghostTextIndicator) { + return ghostTextIndicator.model; + } + return model; + }); + return reader.store.add(this._instantiationService.createInstance(InlineEditsGutterIndicator, this._editorObs, indicatorDisplayRange, this._gutterIndicatorOffset, modelWithGhostTextSupport, this._inlineEditsIsHovered, this._focusIsInMenu)); + }); + this._inlineEditsIsHovered = derived(this, (reader) => { + return this._sideBySide.isHovered.read(reader) || this._wordReplacementViews.read(reader).some((v) => v.isHovered.read(reader)) || this._deletion.isHovered.read(reader) || this._inlineDiffView.isHovered.read(reader) || this._lineReplacementView.isHovered.read(reader) || this._insertion.isHovered.read(reader) || this._customView.isHovered.read(reader); + }); + this._gutterIndicatorOffset = derived(this, (reader) => { + if (this._uiState.read(reader)?.state?.kind === "insertionMultiLine") { + return this._insertion.startLineOffset.read(reader); + } + const ghostTextIndicator = this._ghostTextIndicator.read(reader); + if (ghostTextIndicator) { + return getGhostTextTopOffset(ghostTextIndicator, this._editor); + } + return 0; + }); + this._sideBySide = this._register(this._instantiationService.createInstance(InlineEditsSideBySideView, this._editor, this._model.map((m) => m?.inlineEdit), this._previewTextModel, this._uiState.map((s) => s && s.state?.kind === InlineCompletionViewKind.SideBySide ? { + newTextLineCount: s.newTextLineCount, + isInDiffEditor: s.isInDiffEditor + } : void 0), this._tabAction)); + this._deletion = this._register(this._instantiationService.createInstance(InlineEditsDeletionView, this._editor, this._model.map((m) => m?.inlineEdit), this._uiState.map((s) => s && s.state?.kind === InlineCompletionViewKind.Deletion ? { + originalRange: s.state.originalRange, + deletions: s.state.deletions, + inDiffEditor: s.isInDiffEditor + } : void 0), this._tabAction)); + this._insertion = this._register(this._instantiationService.createInstance(InlineEditsInsertionView, this._editor, this._uiState.map((s) => s && s.state?.kind === InlineCompletionViewKind.InsertionMultiLine ? { + lineNumber: s.state.lineNumber, + startColumn: s.state.column, + text: s.state.text, + inDiffEditor: s.isInDiffEditor + } : void 0), this._tabAction)); + this._inlineDiffViewState = derived(this, (reader) => { + const e = this._uiState.read(reader); + if (!e || !e.state) { + return void 0; + } + if (e.state.kind === "wordReplacements" || e.state.kind === "insertionMultiLine" || e.state.kind === "collapsed" || e.state.kind === "custom") { + return void 0; + } + return { + modifiedText: new StringText(e.newText), + diff: e.diff, + mode: e.state.kind, + modifiedCodeEditor: this._sideBySide.previewEditor, + isInDiffEditor: e.isInDiffEditor + }; + }); + this._inlineCollapsedView = this._register(this._instantiationService.createInstance(InlineEditsCollapsedView, this._editor, this._model.map((m, reader) => this._uiState.read(reader)?.state?.kind === "collapsed" ? m?.inlineEdit : void 0))); + this._customView = this._register(this._instantiationService.createInstance(InlineEditsCustomView, this._editor, this._model.map((m, reader) => this._uiState.read(reader)?.state?.kind === "custom" ? m?.displayLocation : void 0), this._tabAction)); + this._inlineDiffView = this._register(new OriginalEditorInlineDiffView(this._editor, this._inlineDiffViewState, this._previewTextModel)); + this._wordReplacementViews = mapObservableArrayCached(this, this._uiState.map((s) => s?.state?.kind === "wordReplacements" ? s.state.replacements : []), (e, store) => { + return store.add(this._instantiationService.createInstance(InlineEditsWordReplacementView, this._editorObs, e, this._tabAction)); + }); + this._lineReplacementView = this._register(this._instantiationService.createInstance(InlineEditsLineReplacementView, this._editorObs, this._uiState.map((s) => s?.state?.kind === InlineCompletionViewKind.LineReplacement ? { + originalRange: s.state.originalRange, + modifiedRange: s.state.modifiedRange, + modifiedLines: s.state.modifiedLines, + replacements: s.state.replacements + } : void 0), this._uiState.map((s) => s?.isInDiffEditor ?? false), this._tabAction)); + this._useCodeShifting = this._editorObs.getOption( + 71 + /* EditorOption.inlineSuggest */ + ).map((s) => s.edits.allowCodeShifting); + this._renderSideBySide = this._editorObs.getOption( + 71 + /* EditorOption.inlineSuggest */ + ).map((s) => s.edits.renderSideBySide); + this._register(autorunWithStore((reader, store) => { + const model = this._model.read(reader); + if (!model) { + return; + } + store.add(Event.any(this._sideBySide.onDidClick, this._deletion.onDidClick, this._lineReplacementView.onDidClick, this._insertion.onDidClick, ...this._wordReplacementViews.read(reader).map((w) => w.onDidClick), this._inlineDiffView.onDidClick, this._customView.onDidClick)((e) => { + if (this._viewHasBeenShownLongerThan(350)) { + e.preventDefault(); + model.accept(); + } + })); + })); + this._indicator.recomputeInitiallyAndOnChange(this._store); + this._wordReplacementViews.recomputeInitiallyAndOnChange(this._store); + this._indicatorCyclicDependencyCircuitBreaker.set(true, void 0); + this._register(this._instantiationService.createInstance(InlineEditsOnboardingExperience, this._host, this._model, this._indicator, this._inlineCollapsedView)); + const minEditorScrollHeight = derived(this, (reader) => { + return Math.max(...this._wordReplacementViews.read(reader).map((v) => v.minEditorScrollHeight.read(reader)), this._lineReplacementView.minEditorScrollHeight.read(reader), this._customView.minEditorScrollHeight.read(reader)); + }).recomputeInitiallyAndOnChange(this._store); + const textModel = this._editor.getModel(); + let viewZoneId; + this._register(autorun((reader) => { + const minScrollHeight = minEditorScrollHeight.read(reader); + this._editor.changeViewZones((accessor) => { + const scrollHeight = this._editor.getScrollHeight(); + const viewZoneHeight = minScrollHeight - scrollHeight + 1; + if (viewZoneHeight !== 0 && viewZoneId) { + accessor.removeZone(viewZoneId); + viewZoneId = void 0; + } + if (viewZoneHeight <= 0) { + return; + } + viewZoneId = accessor.addZone({ + afterLineNumber: textModel.getLineCount(), + heightInPx: viewZoneHeight, + domNode: $("div.minScrollHeightViewZone") + }); + }); + })); + this._constructorDone.set(true, void 0); + } + getCacheId(model) { + return model.inlineEdit.inlineCompletion.identity.id; + } + determineView(model, reader, diff, newText) { + const inlineEdit = model.inlineEdit; + const canUseCache = this._previousView?.id === this.getCacheId(model) && !model.displayLocation?.jumpToEdit; + const reconsiderViewEditorWidthChange = this._previousView?.editorWidth !== this._editorObs.layoutInfoWidth.read(reader) && (this._previousView?.view === InlineCompletionViewKind.SideBySide || this._previousView?.view === InlineCompletionViewKind.LineReplacement); + if (canUseCache && !reconsiderViewEditorWidthChange) { + return this._previousView.view; + } + if (model.inlineEdit.inlineCompletion instanceof InlineEditItem && model.inlineEdit.inlineCompletion.uri) { + return InlineCompletionViewKind.Custom; + } + if (model.displayLocation && !model.inlineEdit.inlineCompletion.identity.jumpedTo.read(reader)) { + return InlineCompletionViewKind.Custom; + } + const numOriginalLines = inlineEdit.originalLineRange.length; + const numModifiedLines = inlineEdit.modifiedLineRange.length; + const inner = diff.flatMap((d) => d.innerChanges ?? []); + const isSingleInnerEdit = inner.length === 1; + if (!model.isInDiffEditor) { + if (isSingleInnerEdit && this._useCodeShifting.read(reader) !== "never" && isSingleLineInsertion(diff)) { + if (isSingleLineInsertionAfterPosition(diff, inlineEdit.cursorPosition)) { + return InlineCompletionViewKind.InsertionInline; + } + return InlineCompletionViewKind.LineReplacement; + } + if (isDeletion2(inner, inlineEdit, newText)) { + return InlineCompletionViewKind.Deletion; + } + if (isSingleMultiLineInsertion(diff) && this._useCodeShifting.read(reader) === "always") { + return InlineCompletionViewKind.InsertionMultiLine; + } + const allInnerChangesNotTooLong = inner.every((m) => TextLength.ofRange(m.originalRange).columnCount < InlineEditsWordReplacementView.MAX_LENGTH && TextLength.ofRange(m.modifiedRange).columnCount < InlineEditsWordReplacementView.MAX_LENGTH); + if (allInnerChangesNotTooLong && isSingleInnerEdit && numOriginalLines === 1 && numModifiedLines === 1) { + const modifiedText = inner.map((m) => newText.getValueOfRange(m.modifiedRange)); + const originalText = inner.map((m) => model.inlineEdit.originalText.getValueOfRange(m.originalRange)); + if (!modifiedText.some((v) => v.includes(" ")) && !originalText.some((v) => v.includes(" "))) { + if (!inner.some((m) => m.originalRange.isEmpty()) || !growEditsUntilWhitespace(inner.map((m) => new TextReplacement(m.originalRange, "")), inlineEdit.originalText).some((e) => e.range.isEmpty() && TextLength.ofRange(e.range).columnCount < InlineEditsWordReplacementView.MAX_LENGTH)) { + return InlineCompletionViewKind.WordReplacements; + } + } + } + } + if (numOriginalLines > 0 && numModifiedLines > 0) { + if (numOriginalLines === 1 && numModifiedLines === 1 && !model.isInDiffEditor) { + return InlineCompletionViewKind.LineReplacement; + } + if (this._renderSideBySide.read(reader) !== "never" && InlineEditsSideBySideView.fitsInsideViewport(this._editor, this._previewTextModel, inlineEdit, reader)) { + return InlineCompletionViewKind.SideBySide; + } + return InlineCompletionViewKind.LineReplacement; + } + if (model.isInDiffEditor) { + if (isDeletion2(inner, inlineEdit, newText)) { + return InlineCompletionViewKind.Deletion; + } + if (isSingleMultiLineInsertion(diff) && this._useCodeShifting.read(reader) === "always") { + return InlineCompletionViewKind.InsertionMultiLine; + } + } + return InlineCompletionViewKind.SideBySide; + } + determineRenderState(model, reader, diff, newText) { + const inlineEdit = model.inlineEdit; + let view = this.determineView(model, reader, diff, newText); + if (this._willRenderAboveCursor(reader, inlineEdit, view)) { + switch (view) { + case InlineCompletionViewKind.LineReplacement: + case InlineCompletionViewKind.WordReplacements: + view = InlineCompletionViewKind.SideBySide; + break; + } + } + this._previousView = { id: this.getCacheId(model), view, editorWidth: this._editor.getLayoutInfo().width, timestamp: Date.now() }; + const inner = diff.flatMap((d) => d.innerChanges ?? []); + const textModel = this._editor.getModel(); + const stringChanges = inner.map((m) => ({ + originalRange: m.originalRange, + modifiedRange: m.modifiedRange, + original: textModel.getValueInRange(m.originalRange), + modified: newText.getValueOfRange(m.modifiedRange) + })); + const cursorPosition = inlineEdit.cursorPosition; + const startsWithEOL = stringChanges.length === 0 ? false : stringChanges[0].modified.startsWith(textModel.getEOL()); + const viewData = { + cursorColumnDistance: inlineEdit.edit.replacements.length === 0 ? 0 : inlineEdit.edit.replacements[0].range.getStartPosition().column - cursorPosition.column, + cursorLineDistance: inlineEdit.lineEdit.lineRange.startLineNumber - cursorPosition.lineNumber + (startsWithEOL && inlineEdit.lineEdit.lineRange.startLineNumber >= cursorPosition.lineNumber ? 1 : 0), + lineCountOriginal: inlineEdit.lineEdit.lineRange.length, + lineCountModified: inlineEdit.lineEdit.newLines.length, + characterCountOriginal: stringChanges.reduce((acc, r) => acc + r.original.length, 0), + characterCountModified: stringChanges.reduce((acc, r) => acc + r.modified.length, 0), + disjointReplacements: stringChanges.length, + sameShapeReplacements: stringChanges.every((r) => r.original === stringChanges[0].original && r.modified === stringChanges[0].modified) + }; + switch (view) { + case InlineCompletionViewKind.InsertionInline: + return { kind: InlineCompletionViewKind.InsertionInline, viewData }; + case InlineCompletionViewKind.SideBySide: + return { kind: InlineCompletionViewKind.SideBySide, viewData }; + case InlineCompletionViewKind.Collapsed: + return { kind: InlineCompletionViewKind.Collapsed, viewData }; + case InlineCompletionViewKind.Custom: + return { kind: InlineCompletionViewKind.Custom, displayLocation: model.displayLocation, viewData }; + } + if (view === InlineCompletionViewKind.Deletion) { + return { + kind: InlineCompletionViewKind.Deletion, + originalRange: inlineEdit.originalLineRange, + deletions: inner.map((m) => m.originalRange), + viewData + }; + } + if (view === InlineCompletionViewKind.InsertionMultiLine) { + const change = inner[0]; + return { + kind: InlineCompletionViewKind.InsertionMultiLine, + lineNumber: change.originalRange.startLineNumber, + column: change.originalRange.startColumn, + text: newText.getValueOfRange(change.modifiedRange), + viewData + }; + } + const replacements = stringChanges.map((m) => new TextReplacement(m.originalRange, m.modified)); + if (replacements.length === 0) { + return void 0; + } + if (view === InlineCompletionViewKind.WordReplacements) { + let grownEdits = growEditsToEntireWord(replacements, inlineEdit.originalText); + if (grownEdits.some((e) => e.range.isEmpty())) { + grownEdits = growEditsUntilWhitespace(replacements, inlineEdit.originalText); + } + return { + kind: InlineCompletionViewKind.WordReplacements, + replacements: grownEdits, + viewData + }; + } + if (view === InlineCompletionViewKind.LineReplacement) { + return { + kind: InlineCompletionViewKind.LineReplacement, + originalRange: inlineEdit.originalLineRange, + modifiedRange: inlineEdit.modifiedLineRange, + modifiedLines: inlineEdit.modifiedLineRange.mapToLineArray((line) => newText.getLineAt(line)), + replacements: inner.map((m) => ({ originalRange: m.originalRange, modifiedRange: m.modifiedRange })), + viewData + }; + } + return void 0; + } + _willRenderAboveCursor(reader, inlineEdit, view) { + const useCodeShifting = this._useCodeShifting.read(reader); + if (useCodeShifting === "always") { + return false; + } + for (const cursorPosition of inlineEdit.multiCursorPositions) { + if (view === InlineCompletionViewKind.WordReplacements && cursorPosition.lineNumber === inlineEdit.originalLineRange.startLineNumber + 1) { + return true; + } + if (view === InlineCompletionViewKind.LineReplacement && cursorPosition.lineNumber >= inlineEdit.originalLineRange.endLineNumberExclusive && cursorPosition.lineNumber < inlineEdit.modifiedLineRange.endLineNumberExclusive + inlineEdit.modifiedLineRange.length) { + return true; + } + } + return false; + } + _viewHasBeenShownLongerThan(durationMs) { + const viewCreationTime = this._previousView?.timestamp; + if (!viewCreationTime) { + throw new BugIndicatingError("viewHasBeenShownLongThan called before a view has been shown"); + } + const currentTime = Date.now(); + return currentTime - viewCreationTime >= durationMs; + } +}; +InlineEditsView = InlineEditsView_1 = __decorate129([ + __param123(5, IInstantiationService) +], InlineEditsView); +function isSingleLineInsertion(diff) { + return diff.every((m) => m.innerChanges.every((r) => isWordInsertion(r))); + function isWordInsertion(r) { + if (!r.originalRange.isEmpty()) { + return false; + } + const isInsertionWithinLine = r.modifiedRange.startLineNumber === r.modifiedRange.endLineNumber; + if (!isInsertionWithinLine) { + return false; + } + return true; + } +} +function isSingleLineInsertionAfterPosition(diff, position) { + if (!position) { + return false; + } + if (!isSingleLineInsertion(diff)) { + return false; + } + const pos = position; + return diff.every((m) => m.innerChanges.every((r) => isStableWordInsertion(r))); + function isStableWordInsertion(r) { + const insertPosition = r.originalRange.getStartPosition(); + if (pos.isBeforeOrEqual(insertPosition)) { + return true; + } + if (insertPosition.lineNumber < pos.lineNumber) { + return true; + } + return false; + } +} +function isSingleMultiLineInsertion(diff) { + const inner = diff.flatMap((d) => d.innerChanges ?? []); + if (inner.length !== 1) { + return false; + } + const change = inner[0]; + if (!change.originalRange.isEmpty()) { + return false; + } + if (change.modifiedRange.startLineNumber === change.modifiedRange.endLineNumber) { + return false; + } + return true; +} +function isDeletion2(inner, inlineEdit, newText) { + const innerValues = inner.map((m) => ({ original: inlineEdit.originalText.getValueOfRange(m.originalRange), modified: newText.getValueOfRange(m.modifiedRange) })); + return innerValues.every(({ original, modified }) => modified.trim() === "" && original.length > 0 && (original.length > modified.length || original.trim() !== "")); +} +function growEditsToEntireWord(replacements, originalText) { + return _growEdits(replacements, originalText, (char) => /^[a-zA-Z]$/.test(char)); +} +function growEditsUntilWhitespace(replacements, originalText) { + return _growEdits(replacements, originalText, (char) => !/^\s$/.test(char)); +} +function _growEdits(replacements, originalText, fn) { + const result = []; + replacements.sort((a, b) => Range.compareRangesUsingStarts(a.range, b.range)); + for (const edit2 of replacements) { + let startIndex = edit2.range.startColumn - 1; + let endIndex = edit2.range.endColumn - 2; + let prefix = ""; + let suffix = ""; + const startLineContent = originalText.getLineAt(edit2.range.startLineNumber); + const endLineContent = originalText.getLineAt(edit2.range.endLineNumber); + if (isIncluded(startLineContent[startIndex])) { + while (isIncluded(startLineContent[startIndex - 1])) { + prefix = startLineContent[startIndex - 1] + prefix; + startIndex--; + } + } + if (isIncluded(endLineContent[endIndex]) || endIndex < startIndex) { + while (isIncluded(endLineContent[endIndex + 1])) { + suffix += endLineContent[endIndex + 1]; + endIndex++; + } + } + let newEdit = new TextReplacement(new Range(edit2.range.startLineNumber, startIndex + 1, edit2.range.endLineNumber, endIndex + 2), prefix + edit2.text + suffix); + if (result.length > 0 && Range.areIntersectingOrTouching(result[result.length - 1].range, newEdit.range)) { + newEdit = TextReplacement.joinReplacements([result.pop(), newEdit], originalText); + } + result.push(newEdit); + } + function isIncluded(c) { + if (c === void 0) { + return false; + } + return fn(c); + } + return result; +} +function getGhostTextTopOffset(ghostTextIndicator, editor2) { + const replacements = ghostTextIndicator.model.inlineEdit.edit.replacements; + if (replacements.length !== 1) { + return 0; + } + const textModel = editor2.getModel(); + if (!textModel) { + return 0; + } + const EOL = textModel.getEOL(); + const replacement = replacements[0]; + if (replacement.range.isEmpty() && replacement.text.startsWith(EOL)) { + const lineHeight = editor2.getLineHeightForPosition(replacement.range.getStartPosition()); + return countPrefixRepeats(replacement.text, EOL) * lineHeight; + } + return 0; +} +function countPrefixRepeats(str, prefix) { + if (!prefix.length) { + return 0; + } + let count = 0; + let i2 = 0; + while (str.startsWith(prefix, i2)) { + count++; + i2 += prefix.length; + } + return count; +} + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViewProducer.js +var __decorate130 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param124 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var InlineEditsViewAndDiffProducer = class InlineEditsViewAndDiffProducer2 extends Disposable { + static { + this.hot = createHotClass(this); + } + constructor(_editor, _edit, _model, _focusIsInMenu, instantiationService) { + super(); + this._editor = _editor; + this._edit = _edit; + this._model = _model; + this._focusIsInMenu = _focusIsInMenu; + this._inlineEdit = derived(this, (reader) => { + const model = this._model.read(reader); + if (!model) { + return void 0; + } + const inlineEdit = this._edit.read(reader); + if (!inlineEdit) { + return void 0; + } + const textModel = this._editor.getModel(); + if (!textModel) { + return void 0; + } + const editOffset = model.inlineEditState.read(void 0)?.inlineCompletion.updatedEdit; + if (!editOffset) { + return void 0; + } + const edits = editOffset.replacements.map((e) => { + const innerEditRange = Range.fromPositions(textModel.getPositionAt(e.replaceRange.start), textModel.getPositionAt(e.replaceRange.endExclusive)); + return new TextReplacement(innerEditRange, e.newText); + }); + const diffEdits = new TextEdit(edits); + const text2 = new TextModelText(textModel); + return new InlineEditWithChanges(text2, diffEdits, model.primaryPosition.read(void 0), model.allPositions.read(void 0), inlineEdit.commands, inlineEdit.inlineCompletion); + }); + this._inlineEditModel = derived(this, (reader) => { + const model = this._model.read(reader); + if (!model) { + return void 0; + } + const edit2 = this._inlineEdit.read(reader); + if (!edit2) { + return void 0; + } + const tabAction = derived(this, (reader2) => { + if (this._editorObs.isFocused.read(reader2)) { + if (model.tabShouldJumpToInlineEdit.read(reader2)) { + return InlineEditTabAction.Jump; + } + if (model.tabShouldAcceptInlineEdit.read(reader2)) { + return InlineEditTabAction.Accept; + } + } + return InlineEditTabAction.Inactive; + }); + return new InlineEditModel(model, edit2, tabAction); + }); + this._inlineEditHost = derived(this, (reader) => { + const model = this._model.read(reader); + if (!model) { + return void 0; + } + return new InlineEditHost(model); + }); + this._ghostTextIndicator = derived(this, (reader) => { + const model = this._model.read(reader); + if (!model) { + return void 0; + } + const state = model.inlineCompletionState.read(reader); + if (!state) { + return void 0; + } + const inlineCompletion = state.inlineCompletion; + if (!inlineCompletion) { + return void 0; + } + if (!inlineCompletion.showInlineEditMenu) { + return void 0; + } + const lineRange = LineRange.ofLength(state.primaryGhostText.lineNumber, 1); + return new GhostTextIndicator(this._editor, model, lineRange, inlineCompletion); + }); + this._editorObs = observableCodeEditor(this._editor); + this._register(instantiationService.createInstance(InlineEditsView, this._editor, this._inlineEditHost, this._inlineEditModel, this._ghostTextIndicator, this._focusIsInMenu)); + } +}; +InlineEditsViewAndDiffProducer = __decorate130([ + __param124(4, IInstantiationService) +], InlineEditsViewAndDiffProducer); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineCompletionsView.js +var __decorate131 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param125 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var InlineCompletionsView = class InlineCompletionsView2 extends Disposable { + constructor(_editor, _model, _focusIsInMenu, _instantiationService) { + super(); + this._editor = _editor; + this._model = _model; + this._focusIsInMenu = _focusIsInMenu; + this._instantiationService = _instantiationService; + this._ghostTexts = derived(this, (reader) => { + const model = this._model.read(reader); + return model?.ghostTexts.read(reader) ?? []; + }); + this._stablizedGhostTexts = convertItemsToStableObservables(this._ghostTexts, this._store); + this._editorObs = observableCodeEditor(this._editor); + this._ghostTextWidgets = mapObservableArrayCached(this, this._stablizedGhostTexts, (ghostText, store) => derivedDisposable((reader) => this._instantiationService.createInstance(GhostTextView.hot.read(reader), this._editor, { + ghostText, + warning: this._model.map((m, reader2) => { + const warning = m?.warning?.read(reader2); + return warning ? { icon: warning.icon } : void 0; + }), + minReservedLineCount: constObservable(0), + targetTextModel: this._model.map((v) => v?.textModel), + handleInlineCompletionShown: this._model.map((model, reader2) => { + const inlineCompletion = model?.inlineCompletionState.read(reader2)?.inlineCompletion; + if (inlineCompletion) { + return (viewData) => model.handleInlineSuggestionShown(inlineCompletion, InlineCompletionViewKind.GhostText, viewData); + } + return () => { + }; + }) + }, this._editorObs.getOption( + 71 + /* EditorOption.inlineSuggest */ + ).map((v) => ({ syntaxHighlightingEnabled: v.syntaxHighlightingEnabled })), false, false)).recomputeInitiallyAndOnChange(store)).recomputeInitiallyAndOnChange(this._store); + this._inlineEdit = derived(this, (reader) => this._model.read(reader)?.inlineEditState.read(reader)?.inlineEdit); + this._everHadInlineEdit = derivedObservableWithCache(this, (reader, last) => last || !!this._inlineEdit.read(reader) || !!this._model.read(reader)?.inlineCompletionState.read(reader)?.inlineCompletion?.showInlineEditMenu); + this._inlineEditWidget = derivedDisposable((reader) => { + if (!this._everHadInlineEdit.read(reader)) { + return void 0; + } + return this._instantiationService.createInstance(InlineEditsViewAndDiffProducer.hot.read(reader), this._editor, this._inlineEdit, this._model, this._focusIsInMenu); + }).recomputeInitiallyAndOnChange(this._store); + this._fontFamily = this._editorObs.getOption( + 71 + /* EditorOption.inlineSuggest */ + ).map((val) => val.fontFamily); + this._register(createStyleSheetFromObservable(derived((reader) => { + const fontFamily = this._fontFamily.read(reader); + return ` +.monaco-editor .ghost-text-decoration, +.monaco-editor .ghost-text-decoration-preview, +.monaco-editor .ghost-text { + font-family: ${fontFamily}; +}`; + }))); + this._register(new InlineCompletionsHintsWidget(this._editor, this._model, this._instantiationService)); + } + shouldShowHoverAtViewZone(viewZoneId) { + return this._ghostTextWidgets.get()[0]?.get().ownsViewZone(viewZoneId) ?? false; + } +}; +InlineCompletionsView = __decorate131([ + __param125(3, IInstantiationService) +], InlineCompletionsView); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController.js +var __decorate132 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param126 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var InlineCompletionsController_1; +var InlineCompletionsController = class InlineCompletionsController2 extends Disposable { + static { + InlineCompletionsController_1 = this; + } + static { + this._instances = /* @__PURE__ */ new Set(); + } + static { + this.hot = createHotClass(this); + } + static { + this.ID = "editor.contrib.inlineCompletionsController"; + } + /** + * Find the controller in the focused editor or in the outer editor (if applicable) + */ + static getInFocusedEditorOrParent(accessor) { + const outerEditor = getOuterEditor(accessor); + if (!outerEditor) { + return null; + } + return InlineCompletionsController_1.get(outerEditor); + } + static get(editor2) { + return hotClassGetOriginalInstance(editor2.getContribution(InlineCompletionsController_1.ID)); + } + constructor(editor2, _instantiationService, _contextKeyService, _configurationService, _commandService, _debounceService, _languageFeaturesService, _accessibilitySignalService, _keybindingService, _accessibilityService) { + super(); + this.editor = editor2; + this._instantiationService = _instantiationService; + this._contextKeyService = _contextKeyService; + this._configurationService = _configurationService; + this._commandService = _commandService; + this._debounceService = _debounceService; + this._languageFeaturesService = _languageFeaturesService; + this._accessibilitySignalService = _accessibilitySignalService; + this._keybindingService = _keybindingService; + this._accessibilityService = _accessibilityService; + this._editorObs = observableCodeEditor(this.editor); + this._positions = derived(this, (reader) => this._editorObs.selections.read(reader)?.map((s) => s.getEndPosition()) ?? [new Position(1, 1)]); + this._suggestWidgetAdapter = this._register(new ObservableSuggestWidgetAdapter(this._editorObs, (item) => this.model.get()?.handleSuggestAccepted(item), () => this.model.get()?.selectedInlineCompletion.get()?.getSingleTextEdit())); + this._enabledInConfig = observableFromEvent(this, this.editor.onDidChangeConfiguration, () => this.editor.getOption( + 71 + /* EditorOption.inlineSuggest */ + ).enabled); + this._isScreenReaderEnabled = observableFromEvent(this, this._accessibilityService.onDidChangeScreenReaderOptimized, () => this._accessibilityService.isScreenReaderOptimized()); + this._editorDictationInProgress = observableFromEvent(this, this._contextKeyService.onDidChangeContext, () => this._contextKeyService.getContext(this.editor.getDomNode()).getValue("editorDictation.inProgress") === true); + this._enabled = derived(this, (reader) => this._enabledInConfig.read(reader) && (!this._isScreenReaderEnabled.read(reader) || !this._editorDictationInProgress.read(reader))); + this._debounceValue = this._debounceService.for(this._languageFeaturesService.inlineCompletionsProvider, "InlineCompletionsDebounce", { min: 50, max: 50 }); + this._focusIsInMenu = observableValue(this, false); + this._focusIsInEditorOrMenu = derived(this, (reader) => { + const editorHasFocus = this._editorObs.isFocused.read(reader); + const menuHasFocus = this._focusIsInMenu.read(reader); + return editorHasFocus || menuHasFocus; + }); + this._cursorIsInIndentation = derived(this, (reader) => { + const cursorPos = this._editorObs.cursorPosition.read(reader); + if (cursorPos === null) { + return false; + } + const model = this._editorObs.model.read(reader); + if (!model) { + return false; + } + this._editorObs.versionId.read(reader); + const indentMaxColumn = model.getLineIndentColumn(cursorPos.lineNumber); + return cursorPos.column <= indentMaxColumn; + }); + this.model = derivedDisposable(this, (reader) => { + if (this._editorObs.isReadonly.read(reader)) { + return void 0; + } + const textModel = this._editorObs.model.read(reader); + if (!textModel) { + return void 0; + } + const model = this._instantiationService.createInstance(InlineCompletionsModel, textModel, this._suggestWidgetAdapter.selectedItem, this._editorObs.versionId, this._positions, this._debounceValue, this._enabled, this.editor); + return model; + }).recomputeInitiallyAndOnChange(this._store); + this._playAccessibilitySignal = observableSignal(this); + this._hideInlineEditOnSelectionChange = this._editorObs.getOption( + 71 + /* EditorOption.inlineSuggest */ + ).map((val) => true); + this._view = this._register(this._instantiationService.createInstance(InlineCompletionsView, this.editor, this.model, this._focusIsInMenu)); + InlineCompletionsController_1._instances.add(this); + this._register(toDisposable(() => InlineCompletionsController_1._instances.delete(this))); + this._register(autorun((reader) => { + const model = this.model.read(reader); + if (!model) { + return; + } + const state = model.state.read(reader); + if (!state) { + return; + } + if (!this._focusIsInEditorOrMenu.read(void 0)) { + return; + } + const nextEditUri = state.kind === "inlineEdit" ? state.nextEditUri : void 0; + for (const ctrl of InlineCompletionsController_1._instances) { + if (ctrl === this) { + continue; + } else if (nextEditUri && isEqual(nextEditUri, ctrl.editor.getModel()?.uri)) { + ctrl.model.read(void 0)?.trigger(); + } else { + ctrl.reject(); + } + } + })); + this._register(autorun((reader) => { + const model = this.model.read(reader); + const uri = this.editor.getModel()?.uri; + if (!model || !uri) { + return; + } + reader.store.add(model.onDidAccept(() => { + for (const ctrl of InlineCompletionsController_1._instances) { + if (ctrl === this) { + continue; + } + const state = ctrl.model.read(void 0)?.state.read(void 0); + if (state?.kind === "inlineEdit" && isEqual(state.nextEditUri, uri)) { + ctrl.model.read(void 0)?.stop("automatic"); + } + } + })); + })); + this._register(runOnChange(this._editorObs.onDidType, (_value, _changes) => { + if (this._enabled.get()) { + this.model.get()?.trigger(); + } + })); + this._register(runOnChange(this._editorObs.onDidPaste, (_value, _changes) => { + if (this._enabled.get()) { + this.model.get()?.trigger(); + } + })); + const triggerCommands = /* @__PURE__ */ new Set([ + CoreEditingCommands.Tab.id, + CoreEditingCommands.DeleteLeft.id, + CoreEditingCommands.DeleteRight.id, + inlineSuggestCommitId, + "acceptSelectedSuggestion", + InsertLineAfterAction.ID, + InsertLineBeforeAction.ID, + FIND_IDS.NextMatchFindAction, + ...TriggerInlineEditCommandsRegistry.getRegisteredCommands() + ]); + this._register(this._commandService.onDidExecuteCommand((e) => { + if (triggerCommands.has(e.commandId) && editor2.hasTextFocus() && this._enabled.get()) { + let noDelay = false; + if (e.commandId === inlineSuggestCommitId) { + noDelay = true; + } + this._editorObs.forceUpdate((tx) => { + this.model.get()?.trigger(tx, { noDelay }); + }); + } + })); + this._register(runOnChange(this._editorObs.selections, (_value, _, changes) => { + if (changes.some((e) => e.reason === 3 || e.source === "api")) { + if (!this._hideInlineEditOnSelectionChange.get() && this.model.get()?.state.get()?.kind === "inlineEdit") { + return; + } + const m = this.model.get(); + if (!m) { + return; + } + if (m.state.get()?.kind === "ghostText") { + this.model.get()?.stop(); + } + } + })); + this._register(autorun((reader) => { + const isFocused = this._focusIsInEditorOrMenu.read(reader); + const model = this.model.read(void 0); + if (isFocused) { + const state = model?.state.read(void 0); + if (!state || state.kind !== "inlineEdit" || !state.nextEditUri) { + transaction((tx) => { + for (const ctrl of InlineCompletionsController_1._instances) { + if (ctrl !== this) { + ctrl.model.read(void 0)?.stop("automatic", tx); + } + } + }); + } + return; + } + if (this._contextKeyService.getContextKeyValue("accessibleViewIsShown") || this._configurationService.getValue("editor.inlineSuggest.keepOnBlur") || editor2.getOption( + 71 + /* EditorOption.inlineSuggest */ + ).keepOnBlur || InlineSuggestionHintsContentWidget.dropDownVisible) { + return; + } + if (!model) { + return; + } + if (model.state.read(void 0)?.inlineCompletion?.isFromExplicitRequest && model.inlineEditAvailable.read(void 0)) { + return; + } + transaction((tx) => { + model.stop("automatic", tx); + }); + })); + this._register(autorun((reader) => { + const state = this.model.read(reader)?.inlineCompletionState.read(reader); + if (state?.suggestItem) { + if (state.primaryGhostText.lineCount >= 2) { + this._suggestWidgetAdapter.forceRenderingAbove(); + } + } else { + this._suggestWidgetAdapter.stopForceRenderingAbove(); + } + })); + this._register(toDisposable(() => { + this._suggestWidgetAdapter.stopForceRenderingAbove(); + })); + const currentInlineCompletionBySemanticId = derivedObservableWithCache(this, (reader, last) => { + const model = this.model.read(reader); + const state = model?.state.read(reader); + if (this._suggestWidgetAdapter.selectedItem.get()) { + return last; + } + return state?.inlineCompletion?.semanticId; + }); + this._register(runOnChangeWithStore(derived((reader) => { + this._playAccessibilitySignal.read(reader); + currentInlineCompletionBySemanticId.read(reader); + return {}; + }), async (_value, _, _deltas, store) => { + let model = this.model.get(); + let state = model?.state.get(); + if (!state || !model) { + return; + } + await timeout(50, cancelOnDispose(store)); + await waitForState(this._suggestWidgetAdapter.selectedItem, isUndefined, () => false, cancelOnDispose(store)); + model = this.model.get(); + state = model?.state.get(); + if (!state || !model) { + return; + } + const lineText = state.kind === "ghostText" ? model.textModel.getLineContent(state.primaryGhostText.lineNumber) : ""; + this._accessibilitySignalService.playSignal(state.kind === "ghostText" ? AccessibilitySignal.inlineSuggestion : AccessibilitySignal.nextEditSuggestion); + if (this.editor.getOption( + 12 + /* EditorOption.screenReaderAnnounceInlineSuggestion */ + )) { + if (state.kind === "ghostText") { + this._provideScreenReaderUpdate(state.primaryGhostText.renderForScreenReader(lineText)); + } else { + this._provideScreenReaderUpdate(""); + } + } + })); + this._register(this._configurationService.onDidChangeConfiguration((e) => { + if (e.affectsConfiguration("accessibility.verbosity.inlineCompletions")) { + this.editor.updateOptions({ inlineCompletionsAccessibilityVerbose: this._configurationService.getValue("accessibility.verbosity.inlineCompletions") }); + } + })); + this.editor.updateOptions({ inlineCompletionsAccessibilityVerbose: this._configurationService.getValue("accessibility.verbosity.inlineCompletions") }); + const contextKeySvcObs = new ObservableContextKeyService(this._contextKeyService); + this._register(contextKeySvcObs.bind(InlineCompletionContextKeys.cursorInIndentation, this._cursorIsInIndentation)); + this._register(contextKeySvcObs.bind(InlineCompletionContextKeys.hasSelection, (reader) => !this._editorObs.cursorSelection.read(reader)?.isEmpty())); + this._register(contextKeySvcObs.bind(InlineCompletionContextKeys.cursorAtInlineEdit, this.model.map((m, reader) => m?.inlineEditState?.read(reader)?.cursorAtInlineEdit.read(reader)))); + this._register(contextKeySvcObs.bind(InlineCompletionContextKeys.tabShouldAcceptInlineEdit, this.model.map((m, r) => !!m?.tabShouldAcceptInlineEdit.read(r)))); + this._register(contextKeySvcObs.bind(InlineCompletionContextKeys.tabShouldJumpToInlineEdit, this.model.map((m, r) => !!m?.tabShouldJumpToInlineEdit.read(r)))); + this._register(contextKeySvcObs.bind(InlineCompletionContextKeys.inlineEditVisible, (reader) => this.model.read(reader)?.inlineEditState.read(reader) !== void 0)); + this._register(contextKeySvcObs.bind(InlineCompletionContextKeys.inlineSuggestionHasIndentation, (reader) => this.model.read(reader)?.getIndentationInfo(reader)?.startsWithIndentation)); + this._register(contextKeySvcObs.bind(InlineCompletionContextKeys.inlineSuggestionHasIndentationLessThanTabSize, (reader) => this.model.read(reader)?.getIndentationInfo(reader)?.startsWithIndentationLessThanTabSize)); + this._register(contextKeySvcObs.bind(InlineCompletionContextKeys.suppressSuggestions, (reader) => { + const model = this.model.read(reader); + const state = model?.inlineCompletionState.read(reader); + return state?.primaryGhostText && state?.inlineCompletion ? state.inlineCompletion.source.inlineSuggestions.suppressSuggestions : void 0; + })); + this._register(contextKeySvcObs.bind(InlineCompletionContextKeys.inlineSuggestionVisible, (reader) => { + const model = this.model.read(reader); + const state = model?.inlineCompletionState.read(reader); + return !!state?.inlineCompletion && state?.primaryGhostText !== void 0 && !state?.primaryGhostText.isEmpty(); + })); + const firstGhostTextPos = derived(this, (reader) => { + const model = this.model.read(reader); + const state = model?.inlineCompletionState.read(reader); + const primaryGhostText = state?.primaryGhostText; + if (!primaryGhostText || primaryGhostText.isEmpty()) { + return void 0; + } + const firstPartPos = new Position(primaryGhostText.lineNumber, primaryGhostText.parts[0].column); + return firstPartPos; + }); + this._register(contextKeySvcObs.bind(InlineCompletionContextKeys.cursorBeforeGhostText, (reader) => { + const firstPartPos = firstGhostTextPos.read(reader); + if (!firstPartPos) { + return false; + } + const cursorPos = this._editorObs.cursorPosition.read(reader); + if (!cursorPos) { + return false; + } + return firstPartPos.equals(cursorPos); + })); + this._register(this._instantiationService.createInstance(TextModelChangeRecorder, this.editor)); + } + playAccessibilitySignal(tx) { + this._playAccessibilitySignal.trigger(tx); + } + _provideScreenReaderUpdate(content) { + const accessibleViewShowing = this._contextKeyService.getContextKeyValue("accessibleViewIsShown"); + const accessibleViewKeybinding = this._keybindingService.lookupKeybinding("editor.action.accessibleView"); + let hint; + if (!accessibleViewShowing && accessibleViewKeybinding && this.editor.getOption( + 169 + /* EditorOption.inlineCompletionsAccessibilityVerbose */ + )) { + hint = localize(1204, "Inspect this in the accessible view ({0})", accessibleViewKeybinding.getAriaLabel()); + } + alert(hint ? content + ", " + hint : content); + } + shouldShowHoverAt(range2) { + const ghostText = this.model.get()?.primaryGhostText.get(); + if (!ghostText) { + return false; + } + return ghostText.parts.some((p) => range2.containsPosition(new Position(ghostText.lineNumber, p.column))); + } + shouldShowHoverAtViewZone(viewZoneId) { + return this._view.shouldShowHoverAtViewZone(viewZoneId); + } + reject() { + transaction((tx) => { + const m = this.model.get(); + if (m) { + m.stop("explicitCancel", tx); + if (this._focusIsInEditorOrMenu.get()) { + for (const ctrl of InlineCompletionsController_1._instances) { + if (ctrl !== this) { + ctrl.model.get()?.stop("automatic", tx); + } + } + } + } + }); + } + jump() { + const m = this.model.get(); + if (m) { + m.jump(); + } + } +}; +InlineCompletionsController = InlineCompletionsController_1 = __decorate132([ + __param126(1, IInstantiationService), + __param126(2, IContextKeyService), + __param126(3, IConfigurationService), + __param126(4, ICommandService), + __param126(5, ILanguageFeatureDebounceService), + __param126(6, ILanguageFeaturesService), + __param126(7, IAccessibilitySignalService), + __param126(8, IKeybindingService), + __param126(9, IAccessibilityService) +], InlineCompletionsController); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/inlineCompletions/browser/controller/commands.js +var ShowNextInlineSuggestionAction = class _ShowNextInlineSuggestionAction extends EditorAction { + static { + this.ID = showNextInlineSuggestionActionId; + } + constructor() { + super({ + id: _ShowNextInlineSuggestionAction.ID, + label: localize2(1183, "Show Next Inline Suggestion"), + precondition: ContextKeyExpr.and(EditorContextKeys.writable, InlineCompletionContextKeys.inlineSuggestionVisible), + kbOpts: { + weight: 100, + primary: 512 | 94 + } + }); + } + async run(accessor, editor2) { + const controller = InlineCompletionsController.get(editor2); + controller?.model.get()?.next(); + } +}; +var ShowPreviousInlineSuggestionAction = class _ShowPreviousInlineSuggestionAction extends EditorAction { + static { + this.ID = showPreviousInlineSuggestionActionId; + } + constructor() { + super({ + id: _ShowPreviousInlineSuggestionAction.ID, + label: localize2(1184, "Show Previous Inline Suggestion"), + precondition: ContextKeyExpr.and(EditorContextKeys.writable, InlineCompletionContextKeys.inlineSuggestionVisible), + kbOpts: { + weight: 100, + primary: 512 | 92 + } + }); + } + async run(accessor, editor2) { + const controller = InlineCompletionsController.get(editor2); + controller?.model.get()?.previous(); + } +}; +var providerIdSchemaUri = "vscode://schemas/inlineCompletionProviderIdArgs"; +function inlineCompletionProviderGetMatcher(provider) { + const result = []; + if (provider.providerId) { + result.push(provider.providerId.toStringWithoutVersion()); + result.push(provider.providerId.extensionId + ":*"); + } + return result; +} +var argsValidator = vUnion(vObj({ + showNoResultNotification: vOptionalProp(vBoolean()), + providerId: vOptionalProp(vWithJsonSchemaRef(providerIdSchemaUri, vString())), + explicit: vOptionalProp(vBoolean()) +}), vUndefined()); +var TriggerInlineSuggestionAction = class extends EditorAction { + constructor() { + super({ + id: "editor.action.inlineSuggest.trigger", + label: localize2(1185, "Trigger Inline Suggestion"), + precondition: EditorContextKeys.writable, + metadata: { + description: localize(1172, "Triggers an inline suggestion in the editor."), + args: [{ + name: "args", + description: localize(1173, "Options for triggering inline suggestions."), + isOptional: true, + schema: argsValidator.getJSONSchema() + }] + } + }); + } + async run(accessor, editor2, args) { + const notificationService = accessor.get(INotificationService); + const languageFeaturesService = accessor.get(ILanguageFeaturesService); + const controller = InlineCompletionsController.get(editor2); + const validatedArgs = argsValidator.validateOrThrow(args); + const provider = validatedArgs?.providerId ? languageFeaturesService.inlineCompletionsProvider.all(editor2.getModel()).find((p) => inlineCompletionProviderGetMatcher(p).some((m) => m === validatedArgs.providerId)) : void 0; + await asyncTransaction(async (tx) => { + await controller?.model.get()?.trigger(tx, { + provider, + explicit: validatedArgs?.explicit ?? true + }); + controller?.playAccessibilitySignal(tx); + }); + if (validatedArgs?.showNoResultNotification) { + if (!controller?.model.get()?.state.get()) { + notificationService.notify({ + severity: Severity2.Info, + message: localize(1174, "No inline suggestion is available.") + }); + } + } + } +}; +var AcceptNextWordOfInlineCompletion = class extends EditorAction { + constructor() { + super({ + id: "editor.action.inlineSuggest.acceptNextWord", + label: localize2(1186, "Accept Next Word Of Inline Suggestion"), + precondition: ContextKeyExpr.and(EditorContextKeys.writable, InlineCompletionContextKeys.inlineSuggestionVisible), + kbOpts: { + weight: 100 + 1, + primary: 2048 | 17, + kbExpr: ContextKeyExpr.and(EditorContextKeys.writable, InlineCompletionContextKeys.inlineSuggestionVisible, InlineCompletionContextKeys.cursorBeforeGhostText, CONTEXT_ACCESSIBILITY_MODE_ENABLED.negate()) + }, + menuOpts: [{ + menuId: MenuId.InlineSuggestionToolbar, + title: localize(1175, "Accept Word"), + group: "primary", + order: 2 + }] + }); + } + async run(accessor, editor2) { + const controller = InlineCompletionsController.get(editor2); + await controller?.model.get()?.acceptNextWord(); + } +}; +var AcceptNextLineOfInlineCompletion = class extends EditorAction { + constructor() { + super({ + id: "editor.action.inlineSuggest.acceptNextLine", + label: localize2(1187, "Accept Next Line Of Inline Suggestion"), + precondition: ContextKeyExpr.and(EditorContextKeys.writable, InlineCompletionContextKeys.inlineSuggestionVisible), + kbOpts: { + weight: 100 + 1 + }, + menuOpts: [{ + menuId: MenuId.InlineSuggestionToolbar, + title: localize(1176, "Accept Line"), + group: "secondary", + order: 2 + }] + }); + } + async run(accessor, editor2) { + const controller = InlineCompletionsController.get(editor2); + await controller?.model.get()?.acceptNextLine(); + } +}; +var AcceptInlineCompletion = class extends EditorAction { + constructor() { + super({ + id: inlineSuggestCommitId, + label: localize2(1188, "Accept Inline Suggestion"), + precondition: ContextKeyExpr.or(InlineCompletionContextKeys.inlineSuggestionVisible, InlineCompletionContextKeys.inlineEditVisible), + menuOpts: [{ + menuId: MenuId.InlineSuggestionToolbar, + title: localize(1177, "Accept"), + group: "primary", + order: 2 + }, { + menuId: MenuId.InlineEditsActions, + title: localize(1178, "Accept"), + group: "primary", + order: 2 + }], + kbOpts: [ + { + primary: 2, + weight: 200, + kbExpr: ContextKeyExpr.or(ContextKeyExpr.and(InlineCompletionContextKeys.inlineSuggestionVisible, EditorContextKeys.tabMovesFocus.toNegated(), Context.Visible.toNegated(), EditorContextKeys.hoverFocused.toNegated(), InlineCompletionContextKeys.hasSelection.toNegated(), InlineCompletionContextKeys.inlineSuggestionHasIndentationLessThanTabSize), ContextKeyExpr.and(InlineCompletionContextKeys.inlineEditVisible, EditorContextKeys.tabMovesFocus.toNegated(), Context.Visible.toNegated(), EditorContextKeys.hoverFocused.toNegated(), InlineCompletionContextKeys.tabShouldAcceptInlineEdit)) + } + ] + }); + } + async run(accessor, editor2) { + const controller = InlineCompletionsController.getInFocusedEditorOrParent(accessor); + if (controller) { + controller.model.get()?.accept(controller.editor); + controller.editor.focus(); + } + } +}; +KeybindingsRegistry.registerKeybindingRule({ + id: inlineSuggestCommitId, + weight: 202, + // greater than jump + primary: 2, + when: ContextKeyExpr.and(InlineCompletionContextKeys.inInlineEditsPreviewEditor) +}); +var JumpToNextInlineEdit = class extends EditorAction { + constructor() { + super({ + id: jumpToNextInlineEditId, + label: localize2(1189, "Jump to next inline edit"), + precondition: InlineCompletionContextKeys.inlineEditVisible, + menuOpts: [{ + menuId: MenuId.InlineEditsActions, + title: localize(1179, "Jump"), + group: "primary", + order: 1, + when: InlineCompletionContextKeys.cursorAtInlineEdit.toNegated() + }], + kbOpts: { + primary: 2, + weight: 201, + kbExpr: ContextKeyExpr.and(InlineCompletionContextKeys.inlineEditVisible, EditorContextKeys.tabMovesFocus.toNegated(), Context.Visible.toNegated(), EditorContextKeys.hoverFocused.toNegated(), InlineCompletionContextKeys.tabShouldJumpToInlineEdit) + } + }); + } + async run(accessor, editor2) { + const controller = InlineCompletionsController.get(editor2); + if (controller) { + controller.jump(); + } + } +}; +var HideInlineCompletion = class _HideInlineCompletion extends EditorAction { + static { + this.ID = hideInlineCompletionId; + } + constructor() { + super({ + id: _HideInlineCompletion.ID, + label: localize2(1190, "Hide Inline Suggestion"), + precondition: ContextKeyExpr.or(InlineCompletionContextKeys.inlineSuggestionVisible, InlineCompletionContextKeys.inlineEditVisible), + kbOpts: { + weight: 100 + 90, + // same as hiding the suggest widget + primary: 9 + }, + menuOpts: [{ + menuId: MenuId.InlineEditsActions, + title: localize(1180, "Reject"), + group: "primary", + order: 3 + }] + }); + } + async run(accessor, editor2) { + const controller = InlineCompletionsController.getInFocusedEditorOrParent(accessor); + transaction((tx) => { + controller?.model.get()?.stop("explicitCancel", tx); + }); + controller?.editor.focus(); + } +}; +var ToggleInlineCompletionShowCollapsed = class _ToggleInlineCompletionShowCollapsed extends EditorAction { + static { + this.ID = toggleShowCollapsedId; + } + constructor() { + super({ + id: _ToggleInlineCompletionShowCollapsed.ID, + label: localize2(1191, "Toggle Inline Suggestions Show Collapsed"), + precondition: ContextKeyExpr.true() + }); + } + async run(accessor, editor2) { + const configurationService = accessor.get(IConfigurationService); + const showCollapsed = configurationService.getValue("editor.inlineSuggest.edits.showCollapsed"); + configurationService.updateValue("editor.inlineSuggest.edits.showCollapsed", !showCollapsed); + } +}; +KeybindingsRegistry.registerKeybindingRule({ + id: HideInlineCompletion.ID, + weight: -1, + // very weak + primary: 9, + secondary: [ + 1024 | 9 + /* KeyCode.Escape */ + ], + when: ContextKeyExpr.and(InlineCompletionContextKeys.inInlineEditsPreviewEditor) +}); +var ToggleAlwaysShowInlineSuggestionToolbar = class _ToggleAlwaysShowInlineSuggestionToolbar extends Action2 { + static { + this.ID = "editor.action.inlineSuggest.toggleAlwaysShowToolbar"; + } + constructor() { + super({ + id: _ToggleAlwaysShowInlineSuggestionToolbar.ID, + title: localize(1181, "Always Show Toolbar"), + f1: false, + precondition: void 0, + menu: [{ + id: MenuId.InlineSuggestionToolbar, + group: "secondary", + order: 10 + }], + toggled: ContextKeyExpr.equals("config.editor.inlineSuggest.showToolbar", "always") + }); + } + async run(accessor) { + const configService = accessor.get(IConfigurationService); + const currentValue = configService.getValue("editor.inlineSuggest.showToolbar"); + const newValue = currentValue === "always" ? "onHover" : "always"; + configService.updateValue("editor.inlineSuggest.showToolbar", newValue); + } +}; +var DevExtractReproSample = class extends EditorAction { + constructor() { + super({ + id: "editor.action.inlineSuggest.dev.extractRepro", + label: localize(1182, "Developer: Extract Inline Suggest State"), + alias: "Developer: Inline Suggest Extract Repro", + precondition: ContextKeyExpr.or(InlineCompletionContextKeys.inlineEditVisible, InlineCompletionContextKeys.inlineSuggestionVisible) + }); + } + async run(accessor, editor2) { + const clipboardService = accessor.get(IClipboardService); + const controller = InlineCompletionsController.get(editor2); + const m = controller?.model.get(); + if (!m) { + return; + } + const repro = m.extractReproSample(); + const inlineCompletionLines = splitLines(JSON.stringify({ inlineCompletion: repro.inlineCompletion }, null, 4)); + const json = inlineCompletionLines.map((l) => "// " + l).join("\n"); + const reproStr = `${repro.documentValue} + +// +${json} +// +`; + await clipboardService.writeText(reproStr); + return { reproCase: reproStr }; + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/hoverParticipant.js +init_dom(); +init_htmlContent(); +init_lifecycle(); +init_observable(); +init_range(); +init_nls(); +init_instantiation(); +init_telemetry(); +var __decorate133 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param127 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var InlineCompletionsHover = class { + constructor(owner, range2, controller) { + this.owner = owner; + this.range = range2; + this.controller = controller; + } + isValidForHoverAnchor(anchor) { + return anchor.type === 1 && this.range.startColumn <= anchor.range.startColumn && this.range.endColumn >= anchor.range.endColumn; + } +}; +var InlineCompletionsHoverParticipant = class InlineCompletionsHoverParticipant2 { + constructor(_editor, accessibilityService, _instantiationService, _telemetryService, _markdownRendererService) { + this._editor = _editor; + this.accessibilityService = accessibilityService; + this._instantiationService = _instantiationService; + this._telemetryService = _telemetryService; + this._markdownRendererService = _markdownRendererService; + this.hoverOrdinal = 4; + } + suggestHoverAnchor(mouseEvent) { + const controller = InlineCompletionsController.get(this._editor); + if (!controller) { + return null; + } + const target = mouseEvent.target; + if (target.type === 8) { + const viewZoneData = target.detail; + if (controller.shouldShowHoverAtViewZone(viewZoneData.viewZoneId)) { + return new HoverForeignElementAnchor(1e3, this, Range.fromPositions(this._editor.getModel().validatePosition(viewZoneData.positionBefore || viewZoneData.position)), mouseEvent.event.posx, mouseEvent.event.posy, false); + } + } + if (target.type === 7) { + if (controller.shouldShowHoverAt(target.range)) { + return new HoverForeignElementAnchor(1e3, this, target.range, mouseEvent.event.posx, mouseEvent.event.posy, false); + } + } + if (target.type === 6) { + const mightBeForeignElement = target.detail.mightBeForeignElement; + if (mightBeForeignElement && controller.shouldShowHoverAt(target.range)) { + return new HoverForeignElementAnchor(1e3, this, target.range, mouseEvent.event.posx, mouseEvent.event.posy, false); + } + } + if (target.type === 9 && target.element) { + const ctx = GhostTextView.getWarningWidgetContext(target.element); + if (ctx && controller.shouldShowHoverAt(ctx.range)) { + return new HoverForeignElementAnchor(1e3, this, ctx.range, mouseEvent.event.posx, mouseEvent.event.posy, false); + } + } + return null; + } + computeSync(anchor, lineDecorations) { + if (this._editor.getOption( + 71 + /* EditorOption.inlineSuggest */ + ).showToolbar !== "onHover") { + return []; + } + const controller = InlineCompletionsController.get(this._editor); + if (controller && controller.shouldShowHoverAt(anchor.range)) { + return [new InlineCompletionsHover(this, anchor.range, controller)]; + } + return []; + } + renderHoverParts(context, hoverParts) { + const disposables = new DisposableStore(); + const part = hoverParts[0]; + this._telemetryService.publicLog2("inlineCompletionHover.shown"); + if (this.accessibilityService.isScreenReaderOptimized() && !this._editor.getOption( + 12 + /* EditorOption.screenReaderAnnounceInlineSuggestion */ + )) { + disposables.add(this.renderScreenReaderText(context, part)); + } + const model = part.controller.model.get(); + const widgetNode = document.createElement("div"); + context.fragment.appendChild(widgetNode); + disposables.add(autorunWithStore((reader, store) => { + const w = store.add(this._instantiationService.createInstance(InlineSuggestionHintsContentWidget.hot.read(reader), this._editor, false, constObservable(null), model.selectedInlineCompletionIndex, model.inlineCompletionsCount, model.activeCommands, model.warning, () => { + context.onContentsChanged(); + })); + widgetNode.replaceChildren(w.getDomNode()); + })); + model.triggerExplicitly(); + const renderedHoverPart = { + hoverPart: part, + hoverElement: widgetNode, + dispose() { + disposables.dispose(); + } + }; + return new RenderedHoverParts([renderedHoverPart]); + } + getAccessibleContent(hoverPart) { + return localize(1205, "There are inline completions here"); + } + renderScreenReaderText(context, part) { + const disposables = new DisposableStore(); + const $23 = $; + const markdownHoverElement = $23("div.hover-row.markdown-hover"); + const hoverContentsElement = append(markdownHoverElement, $23("div.hover-contents", { ["aria-live"]: "assertive" })); + const render = (code) => { + const inlineSuggestionAvailable = localize(1206, "Suggestion:"); + const renderedContents = disposables.add(this._markdownRendererService.render(new MarkdownString().appendText(inlineSuggestionAvailable).appendCodeblock("text", code), { + context: this._editor, + asyncRenderCallback: () => { + hoverContentsElement.className = "hover-contents code-hover-contents"; + context.onContentsChanged(); + } + })); + hoverContentsElement.replaceChildren(renderedContents.element); + }; + disposables.add(autorun((reader) => { + const ghostText = part.controller.model.read(reader)?.primaryGhostText.read(reader); + if (ghostText) { + const lineText = this._editor.getModel().getLineContent(ghostText.lineNumber); + render(ghostText.renderForScreenReader(lineText)); + } else { + reset(hoverContentsElement); + } + })); + context.fragment.appendChild(markdownHoverElement); + return disposables; + } +}; +InlineCompletionsHoverParticipant = __decorate133([ + __param127(1, IAccessibilityService), + __param127(2, IInstantiationService), + __param127(3, ITelemetryService), + __param127(4, IMarkdownRendererService) +], InlineCompletionsHoverParticipant); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/inlineCompletions/browser/inlineCompletionsAccessibleView.js +var InlineCompletionsAccessibleView = class { +}; + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/inlineCompletions/browser/inlineCompletions.contribution.js +registerEditorContribution( + InlineCompletionsController.ID, + wrapInHotClass1(InlineCompletionsController.hot), + 3 + /* EditorContributionInstantiation.Eventually */ +); +registerEditorAction(TriggerInlineSuggestionAction); +registerEditorAction(ShowNextInlineSuggestionAction); +registerEditorAction(ShowPreviousInlineSuggestionAction); +registerEditorAction(AcceptNextWordOfInlineCompletion); +registerEditorAction(AcceptNextLineOfInlineCompletion); +registerEditorAction(AcceptInlineCompletion); +registerEditorAction(ToggleInlineCompletionShowCollapsed); +registerEditorAction(HideInlineCompletion); +registerEditorAction(JumpToNextInlineEdit); +registerAction2(ToggleAlwaysShowInlineSuggestionToolbar); +registerEditorAction(DevExtractReproSample); +registerAction2(SnoozeInlineCompletion); +registerAction2(CancelSnoozeInlineCompletion); +HoverParticipantRegistry.register(InlineCompletionsHoverParticipant); +AccessibleViewRegistry.register(new InlineCompletionsAccessibleView()); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/gotoSymbol/browser/link/goToDefinitionAtPosition.js +init_async(); +init_errors(); +init_htmlContent(); +init_lifecycle(); +init_editorState(); +init_editorExtensions(); +init_range(); +init_language(); +init_resolverService(); +init_nls(); +init_contextkey(); +init_languageFeatures(); +init_textModel(); +var __decorate134 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param128 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var GotoDefinitionAtPositionEditorContribution_1; +var GotoDefinitionAtPositionEditorContribution = class GotoDefinitionAtPositionEditorContribution2 { + static { + GotoDefinitionAtPositionEditorContribution_1 = this; + } + static { + this.ID = "editor.contrib.gotodefinitionatposition"; + } + static { + this.MAX_SOURCE_PREVIEW_LINES = 8; + } + constructor(editor2, textModelResolverService, languageService, languageFeaturesService) { + this.textModelResolverService = textModelResolverService; + this.languageService = languageService; + this.languageFeaturesService = languageFeaturesService; + this.toUnhook = new DisposableStore(); + this.toUnhookForKeyboard = new DisposableStore(); + this.currentWordAtPosition = null; + this.previousPromise = null; + this.editor = editor2; + this.linkDecorations = this.editor.createDecorationsCollection(); + const linkGesture = new ClickLinkGesture(editor2); + this.toUnhook.add(linkGesture); + this.toUnhook.add(linkGesture.onMouseMoveOrRelevantKeyDown(([mouseEvent, keyboardEvent]) => { + this.startFindDefinitionFromMouse(mouseEvent, keyboardEvent ?? void 0); + })); + this.toUnhook.add(linkGesture.onExecute((mouseEvent) => { + if (this.isEnabled(mouseEvent)) { + this.gotoDefinition(mouseEvent.target.position, mouseEvent.hasSideBySideModifier).catch((error) => { + onUnexpectedError(error); + }).finally(() => { + this.removeLinkDecorations(); + }); + } + })); + this.toUnhook.add(linkGesture.onCancel(() => { + this.removeLinkDecorations(); + this.currentWordAtPosition = null; + })); + } + static get(editor2) { + return editor2.getContribution(GotoDefinitionAtPositionEditorContribution_1.ID); + } + async startFindDefinitionFromCursor(position) { + await this.startFindDefinition(position); + this.toUnhookForKeyboard.add(this.editor.onDidChangeCursorPosition(() => { + this.currentWordAtPosition = null; + this.removeLinkDecorations(); + this.toUnhookForKeyboard.clear(); + })); + this.toUnhookForKeyboard.add(this.editor.onKeyDown((e) => { + if (e) { + this.currentWordAtPosition = null; + this.removeLinkDecorations(); + this.toUnhookForKeyboard.clear(); + } + })); + } + startFindDefinitionFromMouse(mouseEvent, withKey) { + if (mouseEvent.target.type === 9 && this.linkDecorations.length > 0) { + return; + } + if (!this.editor.hasModel() || !this.isEnabled(mouseEvent, withKey)) { + this.currentWordAtPosition = null; + this.removeLinkDecorations(); + return; + } + const position = mouseEvent.target.position; + this.startFindDefinition(position); + } + async startFindDefinition(position) { + this.toUnhookForKeyboard.clear(); + const word = position ? this.editor.getModel()?.getWordAtPosition(position) : null; + if (!word) { + this.currentWordAtPosition = null; + this.removeLinkDecorations(); + return; + } + if (this.currentWordAtPosition && this.currentWordAtPosition.startColumn === word.startColumn && this.currentWordAtPosition.endColumn === word.endColumn && this.currentWordAtPosition.word === word.word) { + return; + } + this.currentWordAtPosition = word; + const state = new EditorState( + this.editor, + 4 | 1 | 2 | 8 + /* CodeEditorStateFlag.Scroll */ + ); + if (this.previousPromise) { + this.previousPromise.cancel(); + this.previousPromise = null; + } + this.previousPromise = createCancelablePromise((token) => this.findDefinition(position, token)); + let results; + try { + results = await this.previousPromise; + } catch (error) { + onUnexpectedError(error); + return; + } + if (!results || !results.length || !state.validate(this.editor)) { + this.removeLinkDecorations(); + return; + } + const linkRange = results[0].originSelectionRange ? Range.lift(results[0].originSelectionRange) : new Range(position.lineNumber, word.startColumn, position.lineNumber, word.endColumn); + if (results.length > 1) { + let combinedRange = linkRange; + for (const { originSelectionRange } of results) { + if (originSelectionRange) { + combinedRange = Range.plusRange(combinedRange, originSelectionRange); + } + } + this.addDecoration(combinedRange, new MarkdownString().appendText(localize(1077, "Click to show {0} definitions.", results.length))); + } else { + const result = results[0]; + if (!result.uri) { + return; + } + return this.textModelResolverService.createModelReference(result.uri).then((ref) => { + if (!ref.object || !ref.object.textEditorModel) { + ref.dispose(); + return; + } + const { object: { textEditorModel } } = ref; + const { startLineNumber } = result.range; + if (startLineNumber < 1 || startLineNumber > textEditorModel.getLineCount()) { + ref.dispose(); + return; + } + const previewValue = this.getPreviewValue(textEditorModel, startLineNumber, result); + const languageId = this.languageService.guessLanguageIdByFilepathOrFirstLine(textEditorModel.uri); + this.addDecoration(linkRange, previewValue ? new MarkdownString().appendCodeblock(languageId ? languageId : "", previewValue) : void 0); + ref.dispose(); + }); + } + } + getPreviewValue(textEditorModel, startLineNumber, result) { + let rangeToUse = result.range; + const numberOfLinesInRange = rangeToUse.endLineNumber - rangeToUse.startLineNumber; + if (numberOfLinesInRange >= GotoDefinitionAtPositionEditorContribution_1.MAX_SOURCE_PREVIEW_LINES) { + rangeToUse = this.getPreviewRangeBasedOnIndentation(textEditorModel, startLineNumber); + } + rangeToUse = textEditorModel.validateRange(rangeToUse); + const previewValue = this.stripIndentationFromPreviewRange(textEditorModel, startLineNumber, rangeToUse); + return previewValue; + } + stripIndentationFromPreviewRange(textEditorModel, startLineNumber, previewRange) { + const startIndent = textEditorModel.getLineFirstNonWhitespaceColumn(startLineNumber); + let minIndent = startIndent; + for (let endLineNumber = startLineNumber + 1; endLineNumber < previewRange.endLineNumber; endLineNumber++) { + const endIndent = textEditorModel.getLineFirstNonWhitespaceColumn(endLineNumber); + minIndent = Math.min(minIndent, endIndent); + } + const previewValue = textEditorModel.getValueInRange(previewRange).replace(new RegExp(`^\\s{${minIndent - 1}}`, "gm"), "").trim(); + return previewValue; + } + getPreviewRangeBasedOnIndentation(textEditorModel, startLineNumber) { + const startIndent = textEditorModel.getLineFirstNonWhitespaceColumn(startLineNumber); + const maxLineNumber = Math.min(textEditorModel.getLineCount(), startLineNumber + GotoDefinitionAtPositionEditorContribution_1.MAX_SOURCE_PREVIEW_LINES); + let endLineNumber = startLineNumber + 1; + for (; endLineNumber < maxLineNumber; endLineNumber++) { + const endIndent = textEditorModel.getLineFirstNonWhitespaceColumn(endLineNumber); + if (startIndent === endIndent) { + break; + } + } + return new Range(startLineNumber, 1, endLineNumber + 1, 1); + } + addDecoration(range2, hoverMessage) { + const newDecorations = { + range: range2, + options: { + description: "goto-definition-link", + inlineClassName: "goto-definition-link", + hoverMessage + } + }; + this.linkDecorations.set([newDecorations]); + } + removeLinkDecorations() { + this.linkDecorations.clear(); + } + isEnabled(mouseEvent, withKey) { + return this.editor.hasModel() && mouseEvent.isLeftClick && mouseEvent.isNoneOrSingleMouseDown && mouseEvent.target.type === 6 && !(mouseEvent.target.detail.injectedText?.options instanceof ModelDecorationInjectedTextOptions) && (mouseEvent.hasTriggerModifier || (withKey ? withKey.keyCodeIsTriggerKey : false)) && this.languageFeaturesService.definitionProvider.has(this.editor.getModel()); + } + findDefinition(position, token) { + const model = this.editor.getModel(); + if (!model) { + return Promise.resolve(null); + } + return getDefinitionsAtPosition(this.languageFeaturesService.definitionProvider, model, position, false, token); + } + async gotoDefinition(position, openToSide) { + this.editor.setPosition(position); + return this.editor.invokeWithinContext((accessor) => { + const canPeek = !openToSide && this.editor.getOption( + 101 + /* EditorOption.definitionLinkOpensInPeek */ + ) && !this.isInPeekEditor(accessor); + const action = new DefinitionAction({ openToSide, openInPeek: canPeek, muteMessage: true }, { title: { value: "", original: "" }, id: "", precondition: void 0 }); + return action.run(accessor); + }); + } + isInPeekEditor(accessor) { + const contextKeyService = accessor.get(IContextKeyService); + return PeekContext.inPeekEditor.getValue(contextKeyService); + } + dispose() { + this.toUnhook.dispose(); + this.toUnhookForKeyboard.dispose(); + } +}; +GotoDefinitionAtPositionEditorContribution = GotoDefinitionAtPositionEditorContribution_1 = __decorate134([ + __param128(1, ITextModelService), + __param128(2, ILanguageService), + __param128(3, ILanguageFeaturesService) +], GotoDefinitionAtPositionEditorContribution); +registerEditorContribution( + GotoDefinitionAtPositionEditorContribution.ID, + GotoDefinitionAtPositionEditorContribution, + 2 + /* EditorContributionInstantiation.BeforeFirstInteraction */ +); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/gpu/browser/gpuActions.js +init_dom(); +init_buffer(); +init_uri(); +init_nls(); +init_configuration(); +init_contextkey(); +init_instantiation(); +init_log(); +init_editorExtensions(); +var DebugEditorGpuRendererAction = class extends EditorAction { + constructor() { + super({ + id: "editor.action.debugEditorGpuRenderer", + label: localize2(1101, "Developer: Debug Editor GPU Renderer"), + // TODO: Why doesn't `ContextKeyExpr.equals('config:editor.experimentalGpuAcceleration', 'on')` work? + precondition: ContextKeyExpr.true() + }); + } + async run(accessor, editor2) { + const instantiationService = accessor.get(IInstantiationService); + const quickInputService = accessor.get(IQuickInputService); + const choice = await quickInputService.pick([ + { + label: localize(1098, "Log Texture Atlas Stats"), + id: "logTextureAtlasStats" + }, + { + label: localize(1099, "Save Texture Atlas"), + id: "saveTextureAtlas" + }, + { + label: localize(1100, "Draw Glyph"), + id: "drawGlyph" + } + ], { canPickMany: false }); + if (!choice) { + return; + } + switch (choice.id) { + case "logTextureAtlasStats": + instantiationService.invokeFunction((accessor2) => { + const logService = accessor2.get(ILogService); + const atlas = ViewGpuContext.atlas; + if (!ViewGpuContext.atlas) { + logService.error("No texture atlas found"); + return; + } + const stats = atlas.getStats(); + logService.info(["Texture atlas stats", ...stats].join("\n\n")); + }); + break; + case "saveTextureAtlas": + instantiationService.invokeFunction(async (accessor2) => { + const workspaceContextService = accessor2.get(IWorkspaceContextService); + const fileService = accessor2.get(IFileService); + const folders = workspaceContextService.getWorkspace().folders; + if (folders.length > 0) { + const atlas = ViewGpuContext.atlas; + const promises = []; + for (const [layerIndex, page] of atlas.pages.entries()) { + promises.push(...[ + fileService.writeFile(URI.joinPath(folders[0].uri, `textureAtlasPage${layerIndex}_actual.png`), VSBuffer.wrap(new Uint8Array(await (await page.source.convertToBlob()).arrayBuffer()))), + fileService.writeFile(URI.joinPath(folders[0].uri, `textureAtlasPage${layerIndex}_usage.png`), VSBuffer.wrap(new Uint8Array(await (await page.getUsagePreview()).arrayBuffer()))) + ]); + } + await Promise.all(promises); + } + }); + break; + case "drawGlyph": + instantiationService.invokeFunction(async (accessor2) => { + const configurationService = accessor2.get(IConfigurationService); + const fileService = accessor2.get(IFileService); + const quickInputService2 = accessor2.get(IQuickInputService); + const workspaceContextService = accessor2.get(IWorkspaceContextService); + const folders = workspaceContextService.getWorkspace().folders; + if (folders.length === 0) { + return; + } + const atlas = ViewGpuContext.atlas; + const fontFamily = configurationService.getValue("editor.fontFamily"); + const fontSize = configurationService.getValue("editor.fontSize"); + const rasterizer = new GlyphRasterizer(fontSize, fontFamily, getActiveWindow().devicePixelRatio, ViewGpuContext.decorationStyleCache); + let chars = await quickInputService2.input({ + prompt: "Enter a character to draw (prefix with 0x for code point))" + }); + if (!chars) { + return; + } + const codePoint = chars.match(/0x(?[0-9a-f]+)/i)?.groups?.codePoint; + if (codePoint !== void 0) { + chars = String.fromCodePoint(parseInt(codePoint, 16)); + } + const tokenMetadata = 0; + const charMetadata = 0; + const rasterizedGlyph = atlas.getGlyph(rasterizer, chars, tokenMetadata, charMetadata, 0); + if (!rasterizedGlyph) { + return; + } + const imageData = atlas.pages[rasterizedGlyph.pageIndex].source.getContext("2d")?.getImageData(rasterizedGlyph.x, rasterizedGlyph.y, rasterizedGlyph.w, rasterizedGlyph.h); + if (!imageData) { + return; + } + const canvas = new OffscreenCanvas(imageData.width, imageData.height); + const ctx = ensureNonNullable(canvas.getContext("2d")); + ctx.putImageData(imageData, 0, 0); + const blob = await canvas.convertToBlob({ type: "image/png" }); + const resource = URI.joinPath(folders[0].uri, `glyph_${chars}_${tokenMetadata}_${fontSize}px_${fontFamily.replaceAll(/[,\\\/\.'\s]/g, "_")}.png`); + await fileService.writeFile(resource, VSBuffer.wrap(new Uint8Array(await blob.arrayBuffer()))); + }); + break; + } + } +}; +registerEditorAction(DebugEditorGpuRendererAction); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/hover/browser/hoverActions.js +init_keyCodes(); +init_editorExtensions(); +init_range(); +init_editorContextKeys(); +init_languages(); +init_nls(); +var HoverFocusBehavior; +(function(HoverFocusBehavior2) { + HoverFocusBehavior2["NoAutoFocus"] = "noAutoFocus"; + HoverFocusBehavior2["FocusIfVisible"] = "focusIfVisible"; + HoverFocusBehavior2["AutoFocusImmediately"] = "autoFocusImmediately"; +})(HoverFocusBehavior || (HoverFocusBehavior = {})); +var ShowOrFocusHoverAction = class extends EditorAction { + constructor() { + super({ + id: SHOW_OR_FOCUS_HOVER_ACTION_ID, + label: localize2(1107, "Show or Focus Hover"), + metadata: { + description: localize2(1108, "Show or focus the editor hover which shows documentation, references, and other content for a symbol at the current cursor position."), + args: [{ + name: "args", + schema: { + type: "object", + properties: { + "focus": { + description: "Controls if and when the hover should take focus upon being triggered by this action.", + enum: [HoverFocusBehavior.NoAutoFocus, HoverFocusBehavior.FocusIfVisible, HoverFocusBehavior.AutoFocusImmediately], + enumDescriptions: [ + localize(1104, "The hover will not automatically take focus."), + localize(1105, "The hover will take focus only if it is already visible."), + localize(1106, "The hover will automatically take focus when it appears.") + ], + default: HoverFocusBehavior.FocusIfVisible + } + } + } + }] + }, + precondition: void 0, + kbOpts: { + kbExpr: EditorContextKeys.editorTextFocus, + primary: KeyChord( + 2048 | 41, + 2048 | 39 + /* KeyCode.KeyI */ + ), + weight: 100 + /* KeybindingWeight.EditorContrib */ + } + }); + } + run(accessor, editor2, args) { + if (!editor2.hasModel()) { + return; + } + const controller = ContentHoverController.get(editor2); + if (!controller) { + return; + } + const focusArgument = args?.focus; + let focusOption = HoverFocusBehavior.FocusIfVisible; + if (Object.values(HoverFocusBehavior).includes(focusArgument)) { + focusOption = focusArgument; + } else if (typeof focusArgument === "boolean" && focusArgument) { + focusOption = HoverFocusBehavior.AutoFocusImmediately; + } + const showContentHover = (focus) => { + const position = editor2.getPosition(); + const range2 = new Range(position.lineNumber, position.column, position.lineNumber, position.column); + controller.showContentHover(range2, 1, 2, focus); + }; + const accessibilitySupportEnabled = editor2.getOption( + 2 + /* EditorOption.accessibilitySupport */ + ) === 2; + if (controller.isHoverVisible) { + if (focusOption !== HoverFocusBehavior.NoAutoFocus) { + controller.focus(); + } else { + showContentHover(accessibilitySupportEnabled); + } + } else { + showContentHover(accessibilitySupportEnabled || focusOption === HoverFocusBehavior.AutoFocusImmediately); + } + } +}; +var ShowDefinitionPreviewHoverAction = class extends EditorAction { + constructor() { + super({ + id: SHOW_DEFINITION_PREVIEW_HOVER_ACTION_ID, + label: localize2(1109, "Show Definition Preview Hover"), + precondition: void 0, + metadata: { + description: localize2(1110, "Show the definition preview hover in the editor.") + } + }); + } + run(accessor, editor2) { + const controller = ContentHoverController.get(editor2); + if (!controller) { + return; + } + const position = editor2.getPosition(); + if (!position) { + return; + } + const range2 = new Range(position.lineNumber, position.column, position.lineNumber, position.column); + const goto = GotoDefinitionAtPositionEditorContribution.get(editor2); + if (!goto) { + return; + } + const promise = goto.startFindDefinitionFromCursor(position); + promise.then(() => { + controller.showContentHover(range2, 1, 2, true); + }); + } +}; +var HideContentHoverAction = class extends EditorAction { + constructor() { + super({ + id: HIDE_HOVER_ACTION_ID, + label: localize2(1111, "Hide Hover"), + alias: "Hide Content Hover", + precondition: void 0 + }); + } + run(accessor, editor2) { + ContentHoverController.get(editor2)?.hideContentHover(); + } +}; +var ScrollUpHoverAction = class extends EditorAction { + constructor() { + super({ + id: SCROLL_UP_HOVER_ACTION_ID, + label: localize2(1112, "Scroll Up Hover"), + precondition: EditorContextKeys.hoverFocused, + kbOpts: { + kbExpr: EditorContextKeys.hoverFocused, + primary: 16, + weight: 100 + /* KeybindingWeight.EditorContrib */ + }, + metadata: { + description: localize2(1113, "Scroll up the editor hover.") + } + }); + } + run(accessor, editor2) { + const controller = ContentHoverController.get(editor2); + if (!controller) { + return; + } + controller.scrollUp(); + } +}; +var ScrollDownHoverAction = class extends EditorAction { + constructor() { + super({ + id: SCROLL_DOWN_HOVER_ACTION_ID, + label: localize2(1114, "Scroll Down Hover"), + precondition: EditorContextKeys.hoverFocused, + kbOpts: { + kbExpr: EditorContextKeys.hoverFocused, + primary: 18, + weight: 100 + /* KeybindingWeight.EditorContrib */ + }, + metadata: { + description: localize2(1115, "Scroll down the editor hover.") + } + }); + } + run(accessor, editor2) { + const controller = ContentHoverController.get(editor2); + if (!controller) { + return; + } + controller.scrollDown(); + } +}; +var ScrollLeftHoverAction = class extends EditorAction { + constructor() { + super({ + id: SCROLL_LEFT_HOVER_ACTION_ID, + label: localize2(1116, "Scroll Left Hover"), + precondition: EditorContextKeys.hoverFocused, + kbOpts: { + kbExpr: EditorContextKeys.hoverFocused, + primary: 15, + weight: 100 + /* KeybindingWeight.EditorContrib */ + }, + metadata: { + description: localize2(1117, "Scroll left the editor hover.") + } + }); + } + run(accessor, editor2) { + const controller = ContentHoverController.get(editor2); + if (!controller) { + return; + } + controller.scrollLeft(); + } +}; +var ScrollRightHoverAction = class extends EditorAction { + constructor() { + super({ + id: SCROLL_RIGHT_HOVER_ACTION_ID, + label: localize2(1118, "Scroll Right Hover"), + precondition: EditorContextKeys.hoverFocused, + kbOpts: { + kbExpr: EditorContextKeys.hoverFocused, + primary: 17, + weight: 100 + /* KeybindingWeight.EditorContrib */ + }, + metadata: { + description: localize2(1119, "Scroll right the editor hover.") + } + }); + } + run(accessor, editor2) { + const controller = ContentHoverController.get(editor2); + if (!controller) { + return; + } + controller.scrollRight(); + } +}; +var PageUpHoverAction = class extends EditorAction { + constructor() { + super({ + id: PAGE_UP_HOVER_ACTION_ID, + label: localize2(1120, "Page Up Hover"), + precondition: EditorContextKeys.hoverFocused, + kbOpts: { + kbExpr: EditorContextKeys.hoverFocused, + primary: 11, + secondary: [ + 512 | 16 + /* KeyCode.UpArrow */ + ], + weight: 100 + /* KeybindingWeight.EditorContrib */ + }, + metadata: { + description: localize2(1121, "Page up the editor hover.") + } + }); + } + run(accessor, editor2) { + const controller = ContentHoverController.get(editor2); + if (!controller) { + return; + } + controller.pageUp(); + } +}; +var PageDownHoverAction = class extends EditorAction { + constructor() { + super({ + id: PAGE_DOWN_HOVER_ACTION_ID, + label: localize2(1122, "Page Down Hover"), + precondition: EditorContextKeys.hoverFocused, + kbOpts: { + kbExpr: EditorContextKeys.hoverFocused, + primary: 12, + secondary: [ + 512 | 18 + /* KeyCode.DownArrow */ + ], + weight: 100 + /* KeybindingWeight.EditorContrib */ + }, + metadata: { + description: localize2(1123, "Page down the editor hover.") + } + }); + } + run(accessor, editor2) { + const controller = ContentHoverController.get(editor2); + if (!controller) { + return; + } + controller.pageDown(); + } +}; +var GoToTopHoverAction = class extends EditorAction { + constructor() { + super({ + id: GO_TO_TOP_HOVER_ACTION_ID, + label: localize2(1124, "Go To Top Hover"), + precondition: EditorContextKeys.hoverFocused, + kbOpts: { + kbExpr: EditorContextKeys.hoverFocused, + primary: 14, + secondary: [ + 2048 | 16 + /* KeyCode.UpArrow */ + ], + weight: 100 + /* KeybindingWeight.EditorContrib */ + }, + metadata: { + description: localize2(1125, "Go to the top of the editor hover.") + } + }); + } + run(accessor, editor2) { + const controller = ContentHoverController.get(editor2); + if (!controller) { + return; + } + controller.goToTop(); + } +}; +var GoToBottomHoverAction = class extends EditorAction { + constructor() { + super({ + id: GO_TO_BOTTOM_HOVER_ACTION_ID, + label: localize2(1126, "Go To Bottom Hover"), + precondition: EditorContextKeys.hoverFocused, + kbOpts: { + kbExpr: EditorContextKeys.hoverFocused, + primary: 13, + secondary: [ + 2048 | 18 + /* KeyCode.DownArrow */ + ], + weight: 100 + /* KeybindingWeight.EditorContrib */ + }, + metadata: { + description: localize2(1127, "Go to the bottom of the editor hover.") + } + }); + } + run(accessor, editor2) { + const controller = ContentHoverController.get(editor2); + if (!controller) { + return; + } + controller.goToBottom(); + } +}; +var IncreaseHoverVerbosityLevel = class extends EditorAction { + constructor() { + super({ + id: INCREASE_HOVER_VERBOSITY_ACTION_ID, + label: INCREASE_HOVER_VERBOSITY_ACTION_LABEL, + alias: "Increase Hover Verbosity Level", + precondition: EditorContextKeys.hoverVisible + }); + } + run(accessor, editor2, args) { + const hoverController = ContentHoverController.get(editor2); + if (!hoverController) { + return; + } + const index = args?.index !== void 0 ? args.index : hoverController.focusedHoverPartIndex(); + hoverController.updateHoverVerbosityLevel(HoverVerbosityAction.Increase, index, args?.focus); + } +}; +var DecreaseHoverVerbosityLevel = class extends EditorAction { + constructor() { + super({ + id: DECREASE_HOVER_VERBOSITY_ACTION_ID, + label: DECREASE_HOVER_VERBOSITY_ACTION_LABEL, + alias: "Decrease Hover Verbosity Level", + precondition: EditorContextKeys.hoverVisible + }); + } + run(accessor, editor2, args) { + const hoverController = ContentHoverController.get(editor2); + if (!hoverController) { + return; + } + const index = args?.index !== void 0 ? args.index : hoverController.focusedHoverPartIndex(); + ContentHoverController.get(editor2)?.updateHoverVerbosityLevel(HoverVerbosityAction.Decrease, index, args?.focus); + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/hover/browser/hoverContribution.js +init_editorExtensions(); +init_colorRegistry(); +init_themeService(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/hover/browser/glyphHoverController.js +init_lifecycle(); +init_instantiation(); +init_async(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/hover/browser/glyphHoverWidget.js +init_dom(); +init_lifecycle(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/hover/browser/glyphHoverComputer.js +init_arrays(); +init_htmlContent(); +init_model2(); +var GlyphHoverComputer = class { + constructor(_editor) { + this._editor = _editor; + } + computeSync(opts) { + const toHoverMessage = (contents) => { + return { + value: contents + }; + }; + const lineDecorations = this._editor.getLineDecorations(opts.lineNumber); + const result = []; + const isLineHover = opts.laneOrLine === "lineNo"; + if (!lineDecorations) { + return result; + } + for (const d of lineDecorations) { + const lane = d.options.glyphMargin?.position ?? GlyphMarginLane.Center; + if (!isLineHover && lane !== opts.laneOrLine) { + continue; + } + const hoverMessage = isLineHover ? d.options.lineNumberHoverMessage : d.options.glyphMarginHoverMessage; + if (!hoverMessage || isEmptyMarkdownString(hoverMessage)) { + continue; + } + result.push(...asArray(hoverMessage).map(toHoverMessage)); + } + return result; + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/hover/browser/glyphHoverWidget.js +var __decorate135 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param129 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var GlyphHoverWidget_1; +var $15 = $; +var GlyphHoverWidget = class GlyphHoverWidget2 extends Disposable { + static { + GlyphHoverWidget_1 = this; + } + static { + this.ID = "editor.contrib.modesGlyphHoverWidget"; + } + constructor(editor2, _markdownRendererService) { + super(); + this._markdownRendererService = _markdownRendererService; + this.allowEditorOverflow = true; + this._renderDisposeables = this._register(new DisposableStore()); + this._editor = editor2; + this._isVisible = false; + this._messages = []; + this._hover = this._register(new HoverWidget(true)); + this._hover.containerDomNode.classList.toggle("hidden", !this._isVisible); + this._hoverOperation = this._register(new HoverOperation(this._editor, new GlyphHoverComputer(this._editor))); + this._register(this._hoverOperation.onResult((result) => this._withResult(result))); + this._register(this._editor.onDidChangeModelDecorations(() => this._onModelDecorationsChanged())); + this._register(this._editor.onDidChangeConfiguration((e) => { + if (e.hasChanged( + 59 + /* EditorOption.fontInfo */ + )) { + this._updateFont(); + } + })); + this._register(addStandardDisposableListener(this._hover.containerDomNode, "mouseleave", (e) => { + this._onMouseLeave(e); + })); + this._editor.addOverlayWidget(this); + } + dispose() { + this._hoverComputerOptions = void 0; + this._editor.removeOverlayWidget(this); + super.dispose(); + } + getId() { + return GlyphHoverWidget_1.ID; + } + getDomNode() { + return this._hover.containerDomNode; + } + getPosition() { + return null; + } + _updateFont() { + const codeClasses = Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")); + codeClasses.forEach((node) => this._editor.applyFontInfo(node)); + } + _onModelDecorationsChanged() { + if (this._isVisible && this._hoverComputerOptions) { + this._hoverOperation.cancel(); + this._hoverOperation.start(0, this._hoverComputerOptions); + } + } + showsOrWillShow(mouseEvent) { + const target = mouseEvent.target; + if (target.type === 2 && target.detail.glyphMarginLane) { + this._startShowingAt(target.position.lineNumber, target.detail.glyphMarginLane); + return true; + } + if (target.type === 3) { + this._startShowingAt(target.position.lineNumber, "lineNo"); + return true; + } + return false; + } + _startShowingAt(lineNumber, laneOrLine) { + if (this._hoverComputerOptions && this._hoverComputerOptions.lineNumber === lineNumber && this._hoverComputerOptions.laneOrLine === laneOrLine) { + return; + } + this._hoverOperation.cancel(); + this.hide(); + this._hoverComputerOptions = { lineNumber, laneOrLine }; + this._hoverOperation.start(0, this._hoverComputerOptions); + } + hide() { + this._hoverComputerOptions = void 0; + this._hoverOperation.cancel(); + if (!this._isVisible) { + return; + } + this._isVisible = false; + this._hover.containerDomNode.classList.toggle("hidden", !this._isVisible); + } + _withResult(result) { + this._messages = result.value; + if (this._messages.length > 0) { + this._renderMessages(result.options.lineNumber, result.options.laneOrLine, this._messages); + } else { + this.hide(); + } + } + _renderMessages(lineNumber, laneOrLine, messages) { + this._renderDisposeables.clear(); + const fragment = document.createDocumentFragment(); + for (const msg of messages) { + const markdownHoverElement = $15("div.hover-row.markdown-hover"); + const hoverContentsElement = append(markdownHoverElement, $15("div.hover-contents")); + const renderedContents = this._renderDisposeables.add(this._markdownRendererService.render(msg.value, { context: this._editor })); + hoverContentsElement.appendChild(renderedContents.element); + fragment.appendChild(markdownHoverElement); + } + this._updateContents(fragment); + this._showAt(lineNumber, laneOrLine); + } + _updateContents(node) { + this._hover.contentsDomNode.textContent = ""; + this._hover.contentsDomNode.appendChild(node); + this._updateFont(); + } + _showAt(lineNumber, laneOrLine) { + if (!this._isVisible) { + this._isVisible = true; + this._hover.containerDomNode.classList.toggle("hidden", !this._isVisible); + } + const editorLayout = this._editor.getLayoutInfo(); + const topForLineNumber = this._editor.getTopForLineNumber(lineNumber); + const editorScrollTop = this._editor.getScrollTop(); + const lineHeight = this._editor.getOption( + 75 + /* EditorOption.lineHeight */ + ); + const nodeHeight = this._hover.containerDomNode.clientHeight; + const top = topForLineNumber - editorScrollTop - (nodeHeight - lineHeight) / 2; + const left = editorLayout.glyphMarginLeft + editorLayout.glyphMarginWidth + (laneOrLine === "lineNo" ? editorLayout.lineNumbersWidth : 0); + const editorHeight = editorLayout.height; + const maxTop = editorHeight - nodeHeight; + const constrainedTop = Math.max(0, Math.min(Math.round(top), maxTop)); + const fixedOverflowWidgets = this._editor.getOption( + 51 + /* EditorOption.fixedOverflowWidgets */ + ); + if (fixedOverflowWidgets) { + const editorDomNode = this._editor.getDomNode(); + if (editorDomNode) { + const editorRect = getDomNodePagePosition(editorDomNode); + this._hover.containerDomNode.style.position = "fixed"; + this._hover.containerDomNode.style.left = `${editorRect.left + left}px`; + this._hover.containerDomNode.style.top = `${editorRect.top + constrainedTop}px`; + } + } else { + this._hover.containerDomNode.style.position = "absolute"; + this._hover.containerDomNode.style.left = `${left}px`; + this._hover.containerDomNode.style.top = `${constrainedTop}px`; + } + this._hover.containerDomNode.style.zIndex = "11"; + } + _onMouseLeave(e) { + const editorDomNode = this._editor.getDomNode(); + const isMousePositionOutsideOfEditor = !editorDomNode || !isMousePositionWithinElement(editorDomNode, e.x, e.y); + if (isMousePositionOutsideOfEditor) { + this.hide(); + } + } +}; +GlyphHoverWidget = GlyphHoverWidget_1 = __decorate135([ + __param129(1, IMarkdownRendererService) +], GlyphHoverWidget); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/hover/browser/glyphHoverController.js +var __decorate136 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param130 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var _sticky3 = false; +var GlyphHoverController = class GlyphHoverController2 extends Disposable { + static { + this.ID = "editor.contrib.marginHover"; + } + constructor(_editor, _instantiationService) { + super(); + this._editor = _editor; + this._instantiationService = _instantiationService; + this.shouldKeepOpenOnEditorMouseMoveOrLeave = false; + this._listenersStore = new DisposableStore(); + this._hoverState = { + mouseDown: false + }; + this._reactToEditorMouseMoveRunner = this._register(new RunOnceScheduler(() => this._reactToEditorMouseMove(this._mouseMoveEvent), 0)); + this._hookListeners(); + this._register(this._editor.onDidChangeConfiguration((e) => { + if (e.hasChanged( + 69 + /* EditorOption.hover */ + )) { + this._unhookListeners(); + this._hookListeners(); + } + })); + } + _hookListeners() { + const hoverOpts = this._editor.getOption( + 69 + /* EditorOption.hover */ + ); + this._hoverSettings = { + enabled: hoverOpts.enabled, + sticky: hoverOpts.sticky, + hidingDelay: hoverOpts.hidingDelay + }; + if (hoverOpts.enabled) { + this._listenersStore.add(this._editor.onMouseDown((e) => this._onEditorMouseDown(e))); + this._listenersStore.add(this._editor.onMouseUp(() => this._onEditorMouseUp())); + this._listenersStore.add(this._editor.onMouseMove((e) => this._onEditorMouseMove(e))); + this._listenersStore.add(this._editor.onKeyDown((e) => this._onKeyDown(e))); + } else { + this._listenersStore.add(this._editor.onMouseMove((e) => this._onEditorMouseMove(e))); + this._listenersStore.add(this._editor.onKeyDown((e) => this._onKeyDown(e))); + } + this._listenersStore.add(this._editor.onMouseLeave((e) => this._onEditorMouseLeave(e))); + this._listenersStore.add(this._editor.onDidChangeModel(() => { + this._cancelScheduler(); + this.hideGlyphHover(); + })); + this._listenersStore.add(this._editor.onDidChangeModelContent(() => this._cancelScheduler())); + this._listenersStore.add(this._editor.onDidScrollChange((e) => this._onEditorScrollChanged(e))); + } + _unhookListeners() { + this._listenersStore.clear(); + } + _cancelScheduler() { + this._mouseMoveEvent = void 0; + this._reactToEditorMouseMoveRunner.cancel(); + } + _onEditorScrollChanged(e) { + if (e.scrollTopChanged || e.scrollLeftChanged) { + this.hideGlyphHover(); + } + } + _onEditorMouseDown(mouseEvent) { + this._hoverState.mouseDown = true; + const shouldNotHideCurrentHoverWidget = this._isMouseOnGlyphHoverWidget(mouseEvent); + if (shouldNotHideCurrentHoverWidget) { + return; + } + this.hideGlyphHover(); + } + _isMouseOnGlyphHoverWidget(mouseEvent) { + const glyphHoverWidgetNode = this._glyphWidget?.getDomNode(); + if (glyphHoverWidgetNode) { + return isMousePositionWithinElement(glyphHoverWidgetNode, mouseEvent.event.posx, mouseEvent.event.posy); + } + return false; + } + _onEditorMouseUp() { + this._hoverState.mouseDown = false; + } + _onEditorMouseLeave(mouseEvent) { + if (this.shouldKeepOpenOnEditorMouseMoveOrLeave) { + return; + } + this._cancelScheduler(); + const shouldNotHideCurrentHoverWidget = this._isMouseOnGlyphHoverWidget(mouseEvent); + if (shouldNotHideCurrentHoverWidget) { + return; + } + if (_sticky3) { + return; + } + this.hideGlyphHover(); + } + _shouldNotRecomputeCurrentHoverWidget(mouseEvent) { + const isHoverSticky = this._hoverSettings.sticky; + const isMouseOnGlyphHoverWidget = this._isMouseOnGlyphHoverWidget(mouseEvent); + return isHoverSticky && isMouseOnGlyphHoverWidget; + } + _onEditorMouseMove(mouseEvent) { + if (this.shouldKeepOpenOnEditorMouseMoveOrLeave) { + return; + } + this._mouseMoveEvent = mouseEvent; + const shouldNotRecomputeCurrentHoverWidget = this._shouldNotRecomputeCurrentHoverWidget(mouseEvent); + if (shouldNotRecomputeCurrentHoverWidget) { + this._reactToEditorMouseMoveRunner.cancel(); + return; + } + this._reactToEditorMouseMove(mouseEvent); + } + _reactToEditorMouseMove(mouseEvent) { + if (!mouseEvent) { + return; + } + const glyphWidgetShowsOrWillShow = this._tryShowHoverWidget(mouseEvent); + if (glyphWidgetShowsOrWillShow) { + return; + } + if (_sticky3) { + return; + } + this.hideGlyphHover(); + } + _tryShowHoverWidget(mouseEvent) { + const glyphWidget = this._getOrCreateGlyphWidget(); + return glyphWidget.showsOrWillShow(mouseEvent); + } + _onKeyDown(e) { + if (!this._editor.hasModel()) { + return; + } + if (e.keyCode === 5 || e.keyCode === 6 || e.keyCode === 57 || e.keyCode === 4) { + return; + } + this.hideGlyphHover(); + } + hideGlyphHover() { + if (_sticky3) { + return; + } + this._glyphWidget?.hide(); + } + _getOrCreateGlyphWidget() { + if (!this._glyphWidget) { + this._glyphWidget = this._instantiationService.createInstance(GlyphHoverWidget, this._editor); + } + return this._glyphWidget; + } + dispose() { + super.dispose(); + this._unhookListeners(); + this._listenersStore.dispose(); + this._glyphWidget?.dispose(); + } +}; +GlyphHoverController = __decorate136([ + __param130(1, IInstantiationService) +], GlyphHoverController); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/hover/browser/hoverAccessibleViews.js +var HoverAccessibleView = class { +}; +var HoverAccessibilityHelp = class { +}; +var ExtHoverAccessibleView = class { +}; + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/hover/browser/hoverContribution.js +registerEditorContribution( + ContentHoverController.ID, + ContentHoverController, + 2 + /* EditorContributionInstantiation.BeforeFirstInteraction */ +); +registerEditorContribution( + GlyphHoverController.ID, + GlyphHoverController, + 2 + /* EditorContributionInstantiation.BeforeFirstInteraction */ +); +registerEditorAction(ShowOrFocusHoverAction); +registerEditorAction(ShowDefinitionPreviewHoverAction); +registerEditorAction(HideContentHoverAction); +registerEditorAction(ScrollUpHoverAction); +registerEditorAction(ScrollDownHoverAction); +registerEditorAction(ScrollLeftHoverAction); +registerEditorAction(ScrollRightHoverAction); +registerEditorAction(PageUpHoverAction); +registerEditorAction(PageDownHoverAction); +registerEditorAction(GoToTopHoverAction); +registerEditorAction(GoToBottomHoverAction); +registerEditorAction(IncreaseHoverVerbosityLevel); +registerEditorAction(DecreaseHoverVerbosityLevel); +HoverParticipantRegistry.register(MarkdownHoverParticipant); +HoverParticipantRegistry.register(MarkerHoverParticipant); +registerThemingParticipant((theme, collector) => { + const hoverBorder = theme.getColor(editorHoverBorder); + if (hoverBorder) { + collector.addRule(`.monaco-editor .monaco-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${hoverBorder.transparent(0.5)}; }`); + collector.addRule(`.monaco-editor .monaco-hover hr { border-top: 1px solid ${hoverBorder.transparent(0.5)}; }`); + collector.addRule(`.monaco-editor .monaco-hover hr { border-bottom: 0px solid ${hoverBorder.transparent(0.5)}; }`); + } +}); +AccessibleViewRegistry.register(new HoverAccessibleView()); +AccessibleViewRegistry.register(new HoverAccessibilityHelp()); +AccessibleViewRegistry.register(new ExtHoverAccessibleView()); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/indentation/browser/indentation.js +init_lifecycle(); +init_strings(); +init_nls(); +init_editorExtensions(); +init_range(); +init_editorContextKeys(); +init_languageConfigurationRegistry(); +init_model(); +init_lineTokens(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/indentation/common/indentation.js +init_strings(); +init_indentation(); +init_selection(); +function getReindentEditOperations(model, languageConfigurationService, startLineNumber, endLineNumber) { + if (model.getLineCount() === 1 && model.getLineMaxColumn(1) === 1) { + return []; + } + const indentationRulesSupport = languageConfigurationService.getLanguageConfiguration(model.getLanguageId()).indentRulesSupport; + if (!indentationRulesSupport) { + return []; + } + const processedIndentRulesSupport = new ProcessedIndentRulesSupport(model, indentationRulesSupport, languageConfigurationService); + endLineNumber = Math.min(endLineNumber, model.getLineCount()); + while (startLineNumber <= endLineNumber) { + if (!processedIndentRulesSupport.shouldIgnore(startLineNumber)) { + break; + } + startLineNumber++; + } + if (startLineNumber > endLineNumber - 1) { + return []; + } + const { tabSize, indentSize, insertSpaces } = model.getOptions(); + const shiftIndent2 = (indentation, count) => { + count = count || 1; + return ShiftCommand.shiftIndent(indentation, indentation.length + count, tabSize, indentSize, insertSpaces); + }; + const unshiftIndent2 = (indentation, count) => { + count = count || 1; + return ShiftCommand.unshiftIndent(indentation, indentation.length + count, tabSize, indentSize, insertSpaces); + }; + const indentEdits = []; + const currentLineText = model.getLineContent(startLineNumber); + let globalIndent = getLeadingWhitespace(currentLineText); + let idealIndentForNextLine = globalIndent; + if (processedIndentRulesSupport.shouldIncrease(startLineNumber)) { + idealIndentForNextLine = shiftIndent2(idealIndentForNextLine); + globalIndent = shiftIndent2(globalIndent); + } else if (processedIndentRulesSupport.shouldIndentNextLine(startLineNumber)) { + idealIndentForNextLine = shiftIndent2(idealIndentForNextLine); + } + startLineNumber++; + for (let lineNumber = startLineNumber; lineNumber <= endLineNumber; lineNumber++) { + if (doesLineStartWithString(model, lineNumber)) { + continue; + } + const text2 = model.getLineContent(lineNumber); + const oldIndentation = getLeadingWhitespace(text2); + const currentIdealIndent = idealIndentForNextLine; + if (processedIndentRulesSupport.shouldDecrease(lineNumber, currentIdealIndent)) { + idealIndentForNextLine = unshiftIndent2(idealIndentForNextLine); + globalIndent = unshiftIndent2(globalIndent); + } + if (oldIndentation !== idealIndentForNextLine) { + indentEdits.push(EditOperation.replaceMove(new Selection(lineNumber, 1, lineNumber, oldIndentation.length + 1), normalizeIndentation(idealIndentForNextLine, indentSize, insertSpaces))); + } + if (processedIndentRulesSupport.shouldIgnore(lineNumber)) { + continue; + } else if (processedIndentRulesSupport.shouldIncrease(lineNumber, currentIdealIndent)) { + globalIndent = shiftIndent2(globalIndent); + idealIndentForNextLine = globalIndent; + } else if (processedIndentRulesSupport.shouldIndentNextLine(lineNumber, currentIdealIndent)) { + idealIndentForNextLine = shiftIndent2(idealIndentForNextLine); + } else { + idealIndentForNextLine = globalIndent; + } + } + return indentEdits; +} +function doesLineStartWithString(model, lineNumber) { + if (!model.tokenization.isCheapToTokenize(lineNumber)) { + return false; + } + const lineTokens = model.tokenization.getLineTokens(lineNumber); + return lineTokens.getStandardTokenType(0) === 2; +} + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/indentation/browser/indentation.js +var __decorate137 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param131 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var IndentationToSpacesAction = class _IndentationToSpacesAction extends EditorAction { + static { + this.ID = "editor.action.indentationToSpaces"; + } + constructor() { + super({ + id: _IndentationToSpacesAction.ID, + label: localize2(1148, "Convert Indentation to Spaces"), + precondition: EditorContextKeys.writable, + metadata: { + description: localize2(1149, "Convert the tab indentation to spaces.") + } + }); + } + run(accessor, editor2) { + const model = editor2.getModel(); + if (!model) { + return; + } + const modelOpts = model.getOptions(); + const selection = editor2.getSelection(); + if (!selection) { + return; + } + const command = new IndentationToSpacesCommand(selection, modelOpts.tabSize); + editor2.pushUndoStop(); + editor2.executeCommands(this.id, [command]); + editor2.pushUndoStop(); + model.updateOptions({ + insertSpaces: true + }); + } +}; +var IndentationToTabsAction = class _IndentationToTabsAction extends EditorAction { + static { + this.ID = "editor.action.indentationToTabs"; + } + constructor() { + super({ + id: _IndentationToTabsAction.ID, + label: localize2(1150, "Convert Indentation to Tabs"), + precondition: EditorContextKeys.writable, + metadata: { + description: localize2(1151, "Convert the spaces indentation to tabs.") + } + }); + } + run(accessor, editor2) { + const model = editor2.getModel(); + if (!model) { + return; + } + const modelOpts = model.getOptions(); + const selection = editor2.getSelection(); + if (!selection) { + return; + } + const command = new IndentationToTabsCommand(selection, modelOpts.tabSize); + editor2.pushUndoStop(); + editor2.executeCommands(this.id, [command]); + editor2.pushUndoStop(); + model.updateOptions({ + insertSpaces: false + }); + } +}; +var ChangeIndentationSizeAction = class extends EditorAction { + constructor(insertSpaces, displaySizeOnly, opts) { + super(opts); + this.insertSpaces = insertSpaces; + this.displaySizeOnly = displaySizeOnly; + } + run(accessor, editor2) { + const quickInputService = accessor.get(IQuickInputService); + const modelService = accessor.get(IModelService); + const model = editor2.getModel(); + if (!model) { + return; + } + const creationOpts = modelService.getCreationOptions(model.getLanguageId(), model.uri, model.isForSimpleWidget); + const modelOpts = model.getOptions(); + const picks = [1, 2, 3, 4, 5, 6, 7, 8].map((n2) => ({ + id: n2.toString(), + label: n2.toString(), + // add description for tabSize value set in the configuration + description: n2 === creationOpts.tabSize && n2 === modelOpts.tabSize ? localize(1144, "Configured Tab Size") : n2 === creationOpts.tabSize ? localize(1145, "Default Tab Size") : n2 === modelOpts.tabSize ? localize(1146, "Current Tab Size") : void 0 + })); + const autoFocusIndex = Math.min(model.getOptions().tabSize - 1, 7); + setTimeout( + () => { + quickInputService.pick(picks, { placeHolder: localize(1147, "Select Tab Size for Current File"), activeItem: picks[autoFocusIndex] }).then((pick) => { + if (pick) { + if (model && !model.isDisposed()) { + const pickedVal = parseInt(pick.label, 10); + if (this.displaySizeOnly) { + model.updateOptions({ + tabSize: pickedVal + }); + } else { + model.updateOptions({ + tabSize: pickedVal, + indentSize: pickedVal, + insertSpaces: this.insertSpaces + }); + } + } + } + }); + }, + 50 + /* quick input is sensitive to being opened so soon after another */ + ); + } +}; +var IndentUsingTabs = class _IndentUsingTabs extends ChangeIndentationSizeAction { + static { + this.ID = "editor.action.indentUsingTabs"; + } + constructor() { + super(false, false, { + id: _IndentUsingTabs.ID, + label: localize2(1152, "Indent Using Tabs"), + precondition: void 0, + metadata: { + description: localize2(1153, "Use indentation with tabs.") + } + }); + } +}; +var IndentUsingSpaces = class _IndentUsingSpaces extends ChangeIndentationSizeAction { + static { + this.ID = "editor.action.indentUsingSpaces"; + } + constructor() { + super(true, false, { + id: _IndentUsingSpaces.ID, + label: localize2(1154, "Indent Using Spaces"), + precondition: void 0, + metadata: { + description: localize2(1155, "Use indentation with spaces.") + } + }); + } +}; +var ChangeTabDisplaySize = class _ChangeTabDisplaySize extends ChangeIndentationSizeAction { + static { + this.ID = "editor.action.changeTabDisplaySize"; + } + constructor() { + super(true, true, { + id: _ChangeTabDisplaySize.ID, + label: localize2(1156, "Change Tab Display Size"), + precondition: void 0, + metadata: { + description: localize2(1157, "Change the space size equivalent of the tab.") + } + }); + } +}; +var DetectIndentation = class _DetectIndentation extends EditorAction { + static { + this.ID = "editor.action.detectIndentation"; + } + constructor() { + super({ + id: _DetectIndentation.ID, + label: localize2(1158, "Detect Indentation from Content"), + precondition: void 0, + metadata: { + description: localize2(1159, "Detect the indentation from content.") + } + }); + } + run(accessor, editor2) { + const modelService = accessor.get(IModelService); + const model = editor2.getModel(); + if (!model) { + return; + } + const creationOpts = modelService.getCreationOptions(model.getLanguageId(), model.uri, model.isForSimpleWidget); + model.detectIndentation(creationOpts.insertSpaces, creationOpts.tabSize); + } +}; +var ReindentLinesAction = class extends EditorAction { + constructor() { + super({ + id: "editor.action.reindentlines", + label: localize2(1160, "Reindent Lines"), + precondition: EditorContextKeys.writable, + metadata: { + description: localize2(1161, "Reindent the lines of the editor.") + }, + canTriggerInlineEdits: true + }); + } + run(accessor, editor2) { + const languageConfigurationService = accessor.get(ILanguageConfigurationService); + const model = editor2.getModel(); + if (!model) { + return; + } + const edits = getReindentEditOperations(model, languageConfigurationService, 1, model.getLineCount()); + if (edits.length > 0) { + editor2.pushUndoStop(); + editor2.executeEdits(this.id, edits); + editor2.pushUndoStop(); + } + } +}; +var ReindentSelectedLinesAction = class extends EditorAction { + constructor() { + super({ + id: "editor.action.reindentselectedlines", + label: localize2(1162, "Reindent Selected Lines"), + precondition: EditorContextKeys.writable, + metadata: { + description: localize2(1163, "Reindent the selected lines of the editor.") + }, + canTriggerInlineEdits: true + }); + } + run(accessor, editor2) { + const languageConfigurationService = accessor.get(ILanguageConfigurationService); + const model = editor2.getModel(); + if (!model) { + return; + } + const selections = editor2.getSelections(); + if (selections === null) { + return; + } + const edits = []; + for (const selection of selections) { + let startLineNumber = selection.startLineNumber; + let endLineNumber = selection.endLineNumber; + if (startLineNumber !== endLineNumber && selection.endColumn === 1) { + endLineNumber--; + } + if (startLineNumber === 1) { + if (startLineNumber === endLineNumber) { + continue; + } + } else { + startLineNumber--; + } + const editOperations = getReindentEditOperations(model, languageConfigurationService, startLineNumber, endLineNumber); + edits.push(...editOperations); + } + if (edits.length > 0) { + editor2.pushUndoStop(); + editor2.executeEdits(this.id, edits); + editor2.pushUndoStop(); + } + } +}; +var AutoIndentOnPasteCommand = class { + constructor(edits, initialSelection) { + this._initialSelection = initialSelection; + this._edits = []; + this._selectionId = null; + for (const edit2 of edits) { + if (edit2.range && typeof edit2.text === "string") { + this._edits.push(edit2); + } + } + } + getEditOperations(model, builder) { + for (const edit2 of this._edits) { + builder.addEditOperation(Range.lift(edit2.range), edit2.text); + } + let selectionIsSet = false; + if (Array.isArray(this._edits) && this._edits.length === 1 && this._initialSelection.isEmpty()) { + if (this._edits[0].range.startColumn === this._initialSelection.endColumn && this._edits[0].range.startLineNumber === this._initialSelection.endLineNumber) { + selectionIsSet = true; + this._selectionId = builder.trackSelection(this._initialSelection, true); + } else if (this._edits[0].range.endColumn === this._initialSelection.startColumn && this._edits[0].range.endLineNumber === this._initialSelection.startLineNumber) { + selectionIsSet = true; + this._selectionId = builder.trackSelection(this._initialSelection, false); + } + } + if (!selectionIsSet) { + this._selectionId = builder.trackSelection(this._initialSelection); + } + } + computeCursorState(model, helper) { + return helper.getTrackedSelection(this._selectionId); + } +}; +var AutoIndentOnPaste = class AutoIndentOnPaste2 { + static { + this.ID = "editor.contrib.autoIndentOnPaste"; + } + constructor(editor2, _languageConfigurationService) { + this.editor = editor2; + this._languageConfigurationService = _languageConfigurationService; + this.callOnDispose = new DisposableStore(); + this.callOnModel = new DisposableStore(); + this.callOnDispose.add(editor2.onDidChangeConfiguration(() => this.update())); + this.callOnDispose.add(editor2.onDidChangeModel(() => this.update())); + this.callOnDispose.add(editor2.onDidChangeModelLanguage(() => this.update())); + } + update() { + this.callOnModel.clear(); + if (!this.editor.getOption( + 17 + /* EditorOption.autoIndentOnPaste */ + ) || this.editor.getOption( + 16 + /* EditorOption.autoIndent */ + ) < 4) { + return; + } + if (!this.editor.hasModel()) { + return; + } + this.callOnModel.add(this.editor.onDidPaste(({ range: range2 }) => { + this.trigger(range2); + })); + } + trigger(range2) { + const selections = this.editor.getSelections(); + if (selections === null || selections.length > 1) { + return; + } + const model = this.editor.getModel(); + if (!model) { + return; + } + const containsOnlyWhitespace = this.rangeContainsOnlyWhitespaceCharacters(model, range2); + if (containsOnlyWhitespace) { + return; + } + if (!this.editor.getOption( + 18 + /* EditorOption.autoIndentOnPasteWithinString */ + ) && isStartOrEndInString(model, range2)) { + return; + } + if (!model.tokenization.isCheapToTokenize(range2.getStartPosition().lineNumber)) { + return; + } + const autoIndent = this.editor.getOption( + 16 + /* EditorOption.autoIndent */ + ); + const { tabSize, indentSize, insertSpaces } = model.getOptions(); + const textEdits = []; + const indentConverter = { + shiftIndent: (indentation) => { + return ShiftCommand.shiftIndent(indentation, indentation.length + 1, tabSize, indentSize, insertSpaces); + }, + unshiftIndent: (indentation) => { + return ShiftCommand.unshiftIndent(indentation, indentation.length + 1, tabSize, indentSize, insertSpaces); + } + }; + let startLineNumber = range2.startLineNumber; + let firstLineText = model.getLineContent(startLineNumber); + if (!/\S/.test(firstLineText.substring(0, range2.startColumn - 1))) { + const indentOfFirstLine = getGoodIndentForLine(autoIndent, model, model.getLanguageId(), startLineNumber, indentConverter, this._languageConfigurationService); + if (indentOfFirstLine !== null) { + const oldIndentation = getLeadingWhitespace(firstLineText); + const newSpaceCnt = getSpaceCnt(indentOfFirstLine, tabSize); + const oldSpaceCnt = getSpaceCnt(oldIndentation, tabSize); + if (newSpaceCnt !== oldSpaceCnt) { + const newIndent = generateIndent(newSpaceCnt, tabSize, insertSpaces); + textEdits.push({ + range: new Range(startLineNumber, 1, startLineNumber, oldIndentation.length + 1), + text: newIndent + }); + firstLineText = newIndent + firstLineText.substring(oldIndentation.length); + } else { + const indentMetadata = getIndentMetadata(model, startLineNumber, this._languageConfigurationService); + if (indentMetadata === 0 || indentMetadata === 8) { + return; + } + } + } + } + const firstLineNumber = startLineNumber; + while (startLineNumber < range2.endLineNumber) { + if (!/\S/.test(model.getLineContent(startLineNumber + 1))) { + startLineNumber++; + continue; + } + break; + } + if (startLineNumber !== range2.endLineNumber) { + const virtualModel = { + tokenization: { + getLineTokens: (lineNumber) => { + return model.tokenization.getLineTokens(lineNumber); + }, + getLanguageId: () => { + return model.getLanguageId(); + }, + getLanguageIdAtPosition: (lineNumber, column) => { + return model.getLanguageIdAtPosition(lineNumber, column); + } + }, + getLineContent: (lineNumber) => { + if (lineNumber === firstLineNumber) { + return firstLineText; + } else { + return model.getLineContent(lineNumber); + } + } + }; + const indentOfSecondLine = getGoodIndentForLine(autoIndent, virtualModel, model.getLanguageId(), startLineNumber + 1, indentConverter, this._languageConfigurationService); + if (indentOfSecondLine !== null) { + const newSpaceCntOfSecondLine = getSpaceCnt(indentOfSecondLine, tabSize); + const oldSpaceCntOfSecondLine = getSpaceCnt(getLeadingWhitespace(model.getLineContent(startLineNumber + 1)), tabSize); + if (newSpaceCntOfSecondLine !== oldSpaceCntOfSecondLine) { + const spaceCntOffset = newSpaceCntOfSecondLine - oldSpaceCntOfSecondLine; + for (let i2 = startLineNumber + 1; i2 <= range2.endLineNumber; i2++) { + const lineContent = model.getLineContent(i2); + const originalIndent = getLeadingWhitespace(lineContent); + const originalSpacesCnt = getSpaceCnt(originalIndent, tabSize); + const newSpacesCnt = originalSpacesCnt + spaceCntOffset; + const newIndent = generateIndent(newSpacesCnt, tabSize, insertSpaces); + if (newIndent !== originalIndent) { + textEdits.push({ + range: new Range(i2, 1, i2, originalIndent.length + 1), + text: newIndent + }); + } + } + } + } + } + if (textEdits.length > 0) { + this.editor.pushUndoStop(); + const cmd = new AutoIndentOnPasteCommand(textEdits, this.editor.getSelection()); + this.editor.executeCommand("autoIndentOnPaste", cmd); + this.editor.pushUndoStop(); + } + } + rangeContainsOnlyWhitespaceCharacters(model, range2) { + const lineContainsOnlyWhitespace = (content) => { + return content.trim().length === 0; + }; + let containsOnlyWhitespace = true; + if (range2.startLineNumber === range2.endLineNumber) { + const lineContent = model.getLineContent(range2.startLineNumber); + const linePart = lineContent.substring(range2.startColumn - 1, range2.endColumn - 1); + containsOnlyWhitespace = lineContainsOnlyWhitespace(linePart); + } else { + for (let i2 = range2.startLineNumber; i2 <= range2.endLineNumber; i2++) { + const lineContent = model.getLineContent(i2); + if (i2 === range2.startLineNumber) { + const linePart = lineContent.substring(range2.startColumn - 1); + containsOnlyWhitespace = lineContainsOnlyWhitespace(linePart); + } else if (i2 === range2.endLineNumber) { + const linePart = lineContent.substring(0, range2.endColumn - 1); + containsOnlyWhitespace = lineContainsOnlyWhitespace(linePart); + } else { + containsOnlyWhitespace = model.getLineFirstNonWhitespaceColumn(i2) === 0; + } + if (!containsOnlyWhitespace) { + break; + } + } + } + return containsOnlyWhitespace; + } + dispose() { + this.callOnDispose.dispose(); + this.callOnModel.dispose(); + } +}; +AutoIndentOnPaste = __decorate137([ + __param131(1, ILanguageConfigurationService) +], AutoIndentOnPaste); +function isStartOrEndInString(model, range2) { + const isPositionInString = (position) => { + const tokenType = getStandardTokenTypeAtPosition(model, position); + return tokenType === 2; + }; + return isPositionInString(range2.getStartPosition()) || isPositionInString(range2.getEndPosition()); +} +function getIndentationEditOperations(model, builder, tabSize, tabsToSpaces) { + if (model.getLineCount() === 1 && model.getLineMaxColumn(1) === 1) { + return; + } + let spaces2 = ""; + for (let i2 = 0; i2 < tabSize; i2++) { + spaces2 += " "; + } + const spacesRegExp = new RegExp(spaces2, "gi"); + for (let lineNumber = 1, lineCount = model.getLineCount(); lineNumber <= lineCount; lineNumber++) { + let lastIndentationColumn = model.getLineFirstNonWhitespaceColumn(lineNumber); + if (lastIndentationColumn === 0) { + lastIndentationColumn = model.getLineMaxColumn(lineNumber); + } + if (lastIndentationColumn === 1) { + continue; + } + const originalIndentationRange = new Range(lineNumber, 1, lineNumber, lastIndentationColumn); + const originalIndentation = model.getValueInRange(originalIndentationRange); + const newIndentation = tabsToSpaces ? originalIndentation.replace(/\t/ig, spaces2) : originalIndentation.replace(spacesRegExp, " "); + builder.addEditOperation(originalIndentationRange, newIndentation); + } +} +var IndentationToSpacesCommand = class { + constructor(selection, tabSize) { + this.selection = selection; + this.tabSize = tabSize; + this.selectionId = null; + } + getEditOperations(model, builder) { + this.selectionId = builder.trackSelection(this.selection); + getIndentationEditOperations(model, builder, this.tabSize, true); + } + computeCursorState(model, helper) { + return helper.getTrackedSelection(this.selectionId); + } +}; +var IndentationToTabsCommand = class { + constructor(selection, tabSize) { + this.selection = selection; + this.tabSize = tabSize; + this.selectionId = null; + } + getEditOperations(model, builder) { + this.selectionId = builder.trackSelection(this.selection); + getIndentationEditOperations(model, builder, this.tabSize, false); + } + computeCursorState(model, helper) { + return helper.getTrackedSelection(this.selectionId); + } +}; +registerEditorContribution( + AutoIndentOnPaste.ID, + AutoIndentOnPaste, + 2 + /* EditorContributionInstantiation.BeforeFirstInteraction */ +); +registerEditorAction(IndentationToSpacesAction); +registerEditorAction(IndentationToTabsAction); +registerEditorAction(IndentUsingTabs); +registerEditorAction(IndentUsingSpaces); +registerEditorAction(ChangeTabDisplaySize); +registerEditorAction(DetectIndentation); +registerEditorAction(ReindentLinesAction); +registerEditorAction(ReindentSelectedLinesAction); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/inlayHints/browser/inlayHintsContribution.js +init_editorExtensions(); +registerEditorContribution( + InlayHintsController.ID, + InlayHintsController, + 1 + /* EditorContributionInstantiation.AfterFirstRender */ +); +HoverParticipantRegistry.register(InlayHintsHover); + +// node_modules/monaco-editor-core/esm/vs/editor/editor.all.js +var import_inPlaceReplace = __toESM(require_inPlaceReplace()); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/insertFinalNewLine/browser/insertFinalNewLine.js +init_editorExtensions(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/insertFinalNewLine/browser/insertFinalNewLineCommand.js +init_strings(); +init_position(); +var InsertFinalNewLineCommand = class { + constructor(selection) { + this._selection = selection; + this._selectionId = null; + } + getEditOperations(model, builder) { + const op = insertFinalNewLine(model); + if (op) { + builder.addEditOperation(op.range, op.text); + } + this._selectionId = builder.trackSelection(this._selection); + } + computeCursorState(model, helper) { + return helper.getTrackedSelection(this._selectionId); + } +}; +function insertFinalNewLine(model) { + const lineCount = model.getLineCount(); + const lastLine = model.getLineContent(lineCount); + const lastLineIsEmptyOrWhitespace = lastNonWhitespaceIndex(lastLine) === -1; + if (!lineCount || lastLineIsEmptyOrWhitespace) { + return; + } + return EditOperation.insert(new Position(lineCount, model.getLineMaxColumn(lineCount)), model.getEOL()); +} + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/insertFinalNewLine/browser/insertFinalNewLine.js +init_editorContextKeys(); +init_nls(); +var InsertFinalNewLineAction = class _InsertFinalNewLineAction extends EditorAction { + static { + this.ID = "editor.action.insertFinalNewLine"; + } + constructor() { + super({ + id: _InsertFinalNewLineAction.ID, + label: localize2(1242, "Insert Final New Line"), + precondition: EditorContextKeys.writable + }); + } + run(_accessor, editor2, args) { + const selection = editor2.getSelection(); + if (selection === null) { + return; + } + const command = new InsertFinalNewLineCommand(selection); + editor2.pushUndoStop(); + editor2.executeCommands(this.id, [command]); + editor2.pushUndoStop(); + } +}; +registerEditorAction(InsertFinalNewLineAction); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/lineSelection/browser/lineSelection.js +init_editorExtensions(); +init_editorContextKeys(); +init_nls(); +var ExpandLineSelectionAction = class extends EditorAction { + constructor() { + super({ + id: "expandLineSelection", + label: localize2(1243, "Expand Line Selection"), + precondition: void 0, + kbOpts: { + weight: 0, + kbExpr: EditorContextKeys.textInputFocus, + primary: 2048 | 42 + /* KeyCode.KeyL */ + } + }); + } + run(_accessor, editor2, args) { + args = args || {}; + if (!editor2.hasModel()) { + return; + } + const viewModel = editor2._getViewModel(); + viewModel.model.pushStackElement(); + viewModel.setCursorStates(args.source, 3, CursorMoveCommands.expandLineSelection(viewModel, viewModel.getCursorStates())); + viewModel.revealAllCursors(args.source, true); + } +}; +registerEditorAction(ExpandLineSelectionAction); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/linkedEditing/browser/linkedEditing.js +init_arrays(); +init_async(); +init_cancellation(); +init_color(); +init_errors(); +init_event(); +init_lifecycle(); +init_strings(); +init_uri(); +init_editorExtensions(); +init_codeEditorService(); +init_position(); +init_range(); +init_editorContextKeys(); +init_textModel(); +init_languageConfigurationRegistry(); +init_nls(); +init_contextkey(); +init_languageFeatures(); +init_colorRegistry(); +init_languageFeatureDebounce(); +init_stopwatch(); +var __decorate138 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param132 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var LinkedEditingContribution_1; +var CONTEXT_ONTYPE_RENAME_INPUT_VISIBLE = new RawContextKey("LinkedEditingInputVisible", false); +var DECORATION_CLASS_NAME2 = "linked-editing-decoration"; +var LinkedEditingContribution = class LinkedEditingContribution2 extends Disposable { + static { + LinkedEditingContribution_1 = this; + } + static { + this.ID = "editor.contrib.linkedEditing"; + } + static { + this.DECORATION = ModelDecorationOptions.register({ + description: "linked-editing", + stickiness: 0, + className: DECORATION_CLASS_NAME2 + }); + } + static get(editor2) { + return editor2.getContribution(LinkedEditingContribution_1.ID); + } + constructor(editor2, contextKeyService, languageFeaturesService, languageConfigurationService, languageFeatureDebounceService) { + super(); + this.languageConfigurationService = languageConfigurationService; + this._syncRangesToken = 0; + this._localToDispose = this._register(new DisposableStore()); + this._editor = editor2; + this._providers = languageFeaturesService.linkedEditingRangeProvider; + this._enabled = false; + this._visibleContextKey = CONTEXT_ONTYPE_RENAME_INPUT_VISIBLE.bindTo(contextKeyService); + this._debounceInformation = languageFeatureDebounceService.for(this._providers, "Linked Editing", { max: 200 }); + this._currentDecorations = this._editor.createDecorationsCollection(); + this._languageWordPattern = null; + this._currentWordPattern = null; + this._ignoreChangeEvent = false; + this._localToDispose = this._register(new DisposableStore()); + this._rangeUpdateTriggerPromise = null; + this._rangeSyncTriggerPromise = null; + this._currentRequestCts = null; + this._currentRequestPosition = null; + this._currentRequestModelVersion = null; + this._register(this._editor.onDidChangeModel(() => this.reinitialize(true))); + this._register(this._editor.onDidChangeConfiguration((e) => { + if (e.hasChanged( + 78 + /* EditorOption.linkedEditing */ + ) || e.hasChanged( + 106 + /* EditorOption.renameOnType */ + )) { + this.reinitialize(false); + } + })); + this._register(this._providers.onDidChange(() => this.reinitialize(false))); + this._register(this._editor.onDidChangeModelLanguage(() => this.reinitialize(true))); + this.reinitialize(true); + } + reinitialize(forceRefresh) { + const model = this._editor.getModel(); + const isEnabled = model !== null && (this._editor.getOption( + 78 + /* EditorOption.linkedEditing */ + ) || this._editor.getOption( + 106 + /* EditorOption.renameOnType */ + )) && this._providers.has(model); + if (isEnabled === this._enabled && !forceRefresh) { + return; + } + this._enabled = isEnabled; + this.clearRanges(); + this._localToDispose.clear(); + if (!isEnabled || model === null) { + return; + } + this._localToDispose.add(Event.runAndSubscribe(model.onDidChangeLanguageConfiguration, () => { + this._languageWordPattern = this.languageConfigurationService.getLanguageConfiguration(model.getLanguageId()).getWordDefinition(); + })); + const rangeUpdateScheduler = new Delayer(this._debounceInformation.get(model)); + const triggerRangeUpdate = () => { + this._rangeUpdateTriggerPromise = rangeUpdateScheduler.trigger(() => this.updateRanges(), this._debounceDuration ?? this._debounceInformation.get(model)); + }; + const rangeSyncScheduler = new Delayer(0); + const triggerRangeSync = (token) => { + this._rangeSyncTriggerPromise = rangeSyncScheduler.trigger(() => this._syncRanges(token)); + }; + this._localToDispose.add(this._editor.onDidChangeCursorPosition(() => { + triggerRangeUpdate(); + })); + this._localToDispose.add(this._editor.onDidChangeModelContent((e) => { + if (!this._ignoreChangeEvent) { + if (this._currentDecorations.length > 0) { + const referenceRange = this._currentDecorations.getRange(0); + if (referenceRange && e.changes.every((c) => referenceRange.intersectRanges(c.range))) { + triggerRangeSync(this._syncRangesToken); + return; + } + } + } + triggerRangeUpdate(); + })); + this._localToDispose.add({ + dispose: () => { + rangeUpdateScheduler.dispose(); + rangeSyncScheduler.dispose(); + } + }); + this.updateRanges(); + } + _syncRanges(token) { + if (!this._editor.hasModel() || token !== this._syncRangesToken || this._currentDecorations.length === 0) { + return; + } + const model = this._editor.getModel(); + const referenceRange = this._currentDecorations.getRange(0); + if (!referenceRange || referenceRange.startLineNumber !== referenceRange.endLineNumber) { + return this.clearRanges(); + } + const referenceValue = model.getValueInRange(referenceRange); + if (this._currentWordPattern) { + const match2 = referenceValue.match(this._currentWordPattern); + const matchLength = match2 ? match2[0].length : 0; + if (matchLength !== referenceValue.length) { + return this.clearRanges(); + } + } + const edits = []; + for (let i2 = 1, len = this._currentDecorations.length; i2 < len; i2++) { + const mirrorRange = this._currentDecorations.getRange(i2); + if (!mirrorRange) { + continue; + } + if (mirrorRange.startLineNumber !== mirrorRange.endLineNumber) { + edits.push({ + range: mirrorRange, + text: referenceValue + }); + } else { + let oldValue = model.getValueInRange(mirrorRange); + let newValue = referenceValue; + let rangeStartColumn = mirrorRange.startColumn; + let rangeEndColumn = mirrorRange.endColumn; + const commonPrefixLength2 = commonPrefixLength(oldValue, newValue); + rangeStartColumn += commonPrefixLength2; + oldValue = oldValue.substr(commonPrefixLength2); + newValue = newValue.substr(commonPrefixLength2); + const commonSuffixLength2 = commonSuffixLength(oldValue, newValue); + rangeEndColumn -= commonSuffixLength2; + oldValue = oldValue.substr(0, oldValue.length - commonSuffixLength2); + newValue = newValue.substr(0, newValue.length - commonSuffixLength2); + if (rangeStartColumn !== rangeEndColumn || newValue.length !== 0) { + edits.push({ + range: new Range(mirrorRange.startLineNumber, rangeStartColumn, mirrorRange.endLineNumber, rangeEndColumn), + text: newValue + }); + } + } + } + if (edits.length === 0) { + return; + } + try { + this._editor.popUndoStop(); + this._ignoreChangeEvent = true; + const prevEditOperationType = this._editor._getViewModel().getPrevEditOperationType(); + this._editor.executeEdits("linkedEditing", edits); + this._editor._getViewModel().setPrevEditOperationType(prevEditOperationType); + } finally { + this._ignoreChangeEvent = false; + } + } + dispose() { + this.clearRanges(); + super.dispose(); + } + clearRanges() { + this._visibleContextKey.set(false); + this._currentDecorations.clear(); + if (this._currentRequestCts) { + this._currentRequestCts.cancel(); + this._currentRequestCts = null; + this._currentRequestPosition = null; + } + } + async updateRanges(force = false) { + if (!this._editor.hasModel()) { + this.clearRanges(); + return; + } + const position = this._editor.getPosition(); + if (!this._enabled && !force || this._editor.getSelections().length > 1) { + this.clearRanges(); + return; + } + const model = this._editor.getModel(); + const modelVersionId = model.getVersionId(); + if (this._currentRequestPosition && this._currentRequestModelVersion === modelVersionId) { + if (position.equals(this._currentRequestPosition)) { + return; + } + if (this._currentDecorations.length > 0) { + const range2 = this._currentDecorations.getRange(0); + if (range2 && range2.containsPosition(position)) { + return; + } + } + } + if (!this._currentRequestPosition?.equals(position)) { + const currentRange = this._currentDecorations.getRange(0); + if (!currentRange?.containsPosition(position)) { + this.clearRanges(); + } + } + this._currentRequestPosition = position; + this._currentRequestModelVersion = modelVersionId; + const currentRequestCts = this._currentRequestCts = new CancellationTokenSource(); + try { + const sw = new StopWatch(false); + const response = await getLinkedEditingRanges(this._providers, model, position, currentRequestCts.token); + this._debounceInformation.update(model, sw.elapsed()); + if (currentRequestCts !== this._currentRequestCts) { + return; + } + this._currentRequestCts = null; + if (modelVersionId !== model.getVersionId()) { + return; + } + let ranges = []; + if (response?.ranges) { + ranges = response.ranges; + } + this._currentWordPattern = response?.wordPattern || this._languageWordPattern; + let foundReferenceRange = false; + for (let i2 = 0, len = ranges.length; i2 < len; i2++) { + if (Range.containsPosition(ranges[i2], position)) { + foundReferenceRange = true; + if (i2 !== 0) { + const referenceRange = ranges[i2]; + ranges.splice(i2, 1); + ranges.unshift(referenceRange); + } + break; + } + } + if (!foundReferenceRange) { + this.clearRanges(); + return; + } + const decorations = ranges.map((range2) => ({ range: range2, options: LinkedEditingContribution_1.DECORATION })); + this._visibleContextKey.set(true); + this._currentDecorations.set(decorations); + this._syncRangesToken++; + } catch (err) { + if (!isCancellationError(err)) { + onUnexpectedError(err); + } + if (this._currentRequestCts === currentRequestCts || !this._currentRequestCts) { + this.clearRanges(); + } + } + } +}; +LinkedEditingContribution = LinkedEditingContribution_1 = __decorate138([ + __param132(1, IContextKeyService), + __param132(2, ILanguageFeaturesService), + __param132(3, ILanguageConfigurationService), + __param132(4, ILanguageFeatureDebounceService) +], LinkedEditingContribution); +var LinkedEditingAction = class extends EditorAction { + constructor() { + super({ + id: "editor.action.linkedEditing", + label: localize2(1276, "Start Linked Editing"), + precondition: ContextKeyExpr.and(EditorContextKeys.writable, EditorContextKeys.hasRenameProvider), + kbOpts: { + kbExpr: EditorContextKeys.editorTextFocus, + primary: 2048 | 1024 | 60, + weight: 100 + /* KeybindingWeight.EditorContrib */ + } + }); + } + runCommand(accessor, args) { + const editorService = accessor.get(ICodeEditorService); + const [uri, pos] = Array.isArray(args) && args || [void 0, void 0]; + if (URI.isUri(uri) && Position.isIPosition(pos)) { + return editorService.openCodeEditor({ resource: uri }, editorService.getActiveCodeEditor()).then((editor2) => { + if (!editor2) { + return; + } + editor2.setPosition(pos); + editor2.invokeWithinContext((accessor2) => { + this.reportTelemetry(accessor2, editor2); + return this.run(accessor2, editor2); + }); + }, onUnexpectedError); + } + return super.runCommand(accessor, args); + } + run(_accessor, editor2) { + const controller = LinkedEditingContribution.get(editor2); + if (controller) { + return Promise.resolve(controller.updateRanges(true)); + } + return Promise.resolve(); + } +}; +var LinkedEditingCommand = EditorCommand.bindToContribution(LinkedEditingContribution.get); +registerEditorCommand(new LinkedEditingCommand({ + id: "cancelLinkedEditingInput", + precondition: CONTEXT_ONTYPE_RENAME_INPUT_VISIBLE, + handler: (x) => x.clearRanges(), + kbOpts: { + kbExpr: EditorContextKeys.editorTextFocus, + weight: 100 + 99, + primary: 9, + secondary: [ + 1024 | 9 + /* KeyCode.Escape */ + ] + } +})); +function getLinkedEditingRanges(providers, model, position, token) { + const orderedByScore = providers.ordered(model); + return first(orderedByScore.map((provider) => async () => { + try { + return await provider.provideLinkedEditingRanges(model, position, token); + } catch (e) { + onUnexpectedExternalError(e); + return void 0; + } + }), (result) => !!result && isNonEmptyArray(result?.ranges)); +} +var editorLinkedEditingBackground = registerColor("editor.linkedEditingBackground", { dark: Color.fromHex("#f00").transparent(0.3), light: Color.fromHex("#f00").transparent(0.3), hcDark: Color.fromHex("#f00").transparent(0.3), hcLight: Color.white }, localize(1275, "Background color when the editor auto renames on type.")); +registerModelAndPositionCommand("_executeLinkedEditingProvider", (_accessor, model, position) => { + const { linkedEditingRangeProvider } = _accessor.get(ILanguageFeaturesService); + return getLinkedEditingRanges(linkedEditingRangeProvider, model, position, CancellationToken.None); +}); +registerEditorContribution( + LinkedEditingContribution.ID, + LinkedEditingContribution, + 1 + /* EditorContributionInstantiation.AfterFirstRender */ +); +registerEditorAction(LinkedEditingAction); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/links/browser/links.js +init_async(); +init_cancellation(); +init_errors(); +init_htmlContent(); +init_lifecycle(); +init_network(); +init_platform(); +init_resources(); +init_stopwatch(); +init_uri(); +init_editorExtensions(); +init_textModel(); +init_languageFeatureDebounce(); +init_languageFeatures(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/links/browser/getLinks.js +init_arrays(); +init_cancellation(); +init_errors(); +init_lifecycle(); +init_types(); +init_uri(); +init_range(); +init_model(); +init_commands(); +init_languageFeatures(); +var Link = class { + constructor(link2, provider) { + this._link = link2; + this._provider = provider; + } + toJSON() { + return { + range: this.range, + url: this.url, + tooltip: this.tooltip + }; + } + get range() { + return this._link.range; + } + get url() { + return this._link.url; + } + get tooltip() { + return this._link.tooltip; + } + async resolve(token) { + if (this._link.url) { + return this._link.url; + } + if (typeof this._provider.resolveLink === "function") { + return Promise.resolve(this._provider.resolveLink(this._link, token)).then((value) => { + this._link = value || this._link; + if (this._link.url) { + return this.resolve(token); + } + return Promise.reject(new Error("missing")); + }); + } + return Promise.reject(new Error("missing")); + } +}; +var LinksList = class _LinksList { + static { + this.Empty = new _LinksList([]); + } + constructor(tuples) { + this._disposables = new DisposableStore(); + let links = []; + for (const [list2, provider] of tuples) { + const newLinks = list2.links.map((link2) => new Link(link2, provider)); + links = _LinksList._union(links, newLinks); + if (isDisposable(list2)) { + this._disposables ??= new DisposableStore(); + this._disposables.add(list2); + } + } + this.links = links; + } + dispose() { + this._disposables?.dispose(); + this.links.length = 0; + } + static _union(oldLinks, newLinks) { + const result = []; + let oldIndex; + let oldLen; + let newIndex; + let newLen; + for (oldIndex = 0, newIndex = 0, oldLen = oldLinks.length, newLen = newLinks.length; oldIndex < oldLen && newIndex < newLen; ) { + const oldLink = oldLinks[oldIndex]; + const newLink = newLinks[newIndex]; + if (Range.areIntersectingOrTouching(oldLink.range, newLink.range)) { + oldIndex++; + continue; + } + const comparisonResult = Range.compareRangesUsingStarts(oldLink.range, newLink.range); + if (comparisonResult < 0) { + result.push(oldLink); + oldIndex++; + } else { + result.push(newLink); + newIndex++; + } + } + for (; oldIndex < oldLen; oldIndex++) { + result.push(oldLinks[oldIndex]); + } + for (; newIndex < newLen; newIndex++) { + result.push(newLinks[newIndex]); + } + return result; + } +}; +async function getLinks(providers, model, token) { + const lists = []; + const promises = providers.ordered(model).reverse().map(async (provider, i2) => { + try { + const result = await provider.provideLinks(model, token); + if (result) { + lists[i2] = [result, provider]; + } + } catch (err) { + onUnexpectedExternalError(err); + } + }); + await Promise.all(promises); + let res = new LinksList(coalesce(lists)); + if (token.isCancellationRequested) { + res.dispose(); + res = LinksList.Empty; + } + return res; +} +CommandsRegistry.registerCommand("_executeLinkProvider", async (accessor, ...args) => { + let [uri, resolveCount] = args; + assertType(uri instanceof URI); + if (typeof resolveCount !== "number") { + resolveCount = 0; + } + const { linkProvider } = accessor.get(ILanguageFeaturesService); + const model = accessor.get(IModelService).getModel(uri); + if (!model) { + return []; + } + const list2 = await getLinks(linkProvider, model, CancellationToken.None); + if (!list2) { + return []; + } + for (let i2 = 0; i2 < Math.min(resolveCount, list2.links.length); i2++) { + await list2.links[i2].resolve(CancellationToken.None); + } + const result = list2.links.slice(0); + list2.dispose(); + return result; +}); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/links/browser/links.js +init_nls(); +var __decorate139 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param133 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var LinkDetector_1; +var LinkDetector = class LinkDetector2 extends Disposable { + static { + LinkDetector_1 = this; + } + static { + this.ID = "editor.linkDetector"; + } + static get(editor2) { + return editor2.getContribution(LinkDetector_1.ID); + } + constructor(editor2, openerService, notificationService, languageFeaturesService, languageFeatureDebounceService) { + super(); + this.editor = editor2; + this.openerService = openerService; + this.notificationService = notificationService; + this.languageFeaturesService = languageFeaturesService; + this.providers = this.languageFeaturesService.linkProvider; + this.debounceInformation = languageFeatureDebounceService.for(this.providers, "Links", { min: 1e3, max: 4e3 }); + this.computeLinks = this._register(new RunOnceScheduler(() => this.computeLinksNow(), 1e3)); + this.computePromise = null; + this.activeLinksList = null; + this.currentOccurrences = {}; + this.activeLinkDecorationId = null; + const clickLinkGesture = this._register(new ClickLinkGesture(editor2)); + this._register(clickLinkGesture.onMouseMoveOrRelevantKeyDown(([mouseEvent, keyboardEvent]) => { + this._onEditorMouseMove(mouseEvent, keyboardEvent); + })); + this._register(clickLinkGesture.onExecute((e) => { + this.onEditorMouseUp(e); + })); + this._register(clickLinkGesture.onCancel((e) => { + this.cleanUpActiveLinkDecoration(); + })); + this._register(editor2.onDidChangeConfiguration((e) => { + if (!e.hasChanged( + 79 + /* EditorOption.links */ + )) { + return; + } + this.updateDecorations([]); + this.stop(); + this.computeLinks.schedule(0); + })); + this._register(editor2.onDidChangeModelContent((e) => { + if (!this.editor.hasModel()) { + return; + } + this.computeLinks.schedule(this.debounceInformation.get(this.editor.getModel())); + })); + this._register(editor2.onDidChangeModel((e) => { + this.currentOccurrences = {}; + this.activeLinkDecorationId = null; + this.stop(); + this.computeLinks.schedule(0); + })); + this._register(editor2.onDidChangeModelLanguage((e) => { + this.stop(); + this.computeLinks.schedule(0); + })); + this._register(this.providers.onDidChange((e) => { + this.stop(); + this.computeLinks.schedule(0); + })); + this.computeLinks.schedule(0); + } + async computeLinksNow() { + if (!this.editor.hasModel() || !this.editor.getOption( + 79 + /* EditorOption.links */ + )) { + return; + } + const model = this.editor.getModel(); + if (model.isTooLargeForSyncing()) { + return; + } + if (!this.providers.has(model)) { + return; + } + if (this.activeLinksList) { + this.activeLinksList.dispose(); + this.activeLinksList = null; + } + this.computePromise = createCancelablePromise((token) => getLinks(this.providers, model, token)); + try { + const sw = new StopWatch(false); + this.activeLinksList = await this.computePromise; + this.debounceInformation.update(model, sw.elapsed()); + if (model.isDisposed()) { + return; + } + this.updateDecorations(this.activeLinksList.links); + } catch (err) { + onUnexpectedError(err); + } finally { + this.computePromise = null; + } + } + updateDecorations(links) { + const useMetaKey = this.editor.getOption( + 86 + /* EditorOption.multiCursorModifier */ + ) === "altKey"; + const oldDecorations = []; + const keys = Object.keys(this.currentOccurrences); + for (const decorationId of keys) { + const occurence = this.currentOccurrences[decorationId]; + oldDecorations.push(occurence.decorationId); + } + const newDecorations = []; + if (links) { + for (const link2 of links) { + newDecorations.push(LinkOccurrence.decoration(link2, useMetaKey)); + } + } + this.editor.changeDecorations((changeAccessor) => { + const decorations = changeAccessor.deltaDecorations(oldDecorations, newDecorations); + this.currentOccurrences = {}; + this.activeLinkDecorationId = null; + for (let i2 = 0, len = decorations.length; i2 < len; i2++) { + const occurence = new LinkOccurrence(links[i2], decorations[i2]); + this.currentOccurrences[occurence.decorationId] = occurence; + } + }); + } + _onEditorMouseMove(mouseEvent, withKey) { + const useMetaKey = this.editor.getOption( + 86 + /* EditorOption.multiCursorModifier */ + ) === "altKey"; + if (this.isEnabled(mouseEvent, withKey)) { + this.cleanUpActiveLinkDecoration(); + const occurrence = this.getLinkOccurrence(mouseEvent.target.position); + if (occurrence) { + this.editor.changeDecorations((changeAccessor) => { + occurrence.activate(changeAccessor, useMetaKey); + this.activeLinkDecorationId = occurrence.decorationId; + }); + } + } else { + this.cleanUpActiveLinkDecoration(); + } + } + cleanUpActiveLinkDecoration() { + const useMetaKey = this.editor.getOption( + 86 + /* EditorOption.multiCursorModifier */ + ) === "altKey"; + if (this.activeLinkDecorationId) { + const occurrence = this.currentOccurrences[this.activeLinkDecorationId]; + if (occurrence) { + this.editor.changeDecorations((changeAccessor) => { + occurrence.deactivate(changeAccessor, useMetaKey); + }); + } + this.activeLinkDecorationId = null; + } + } + onEditorMouseUp(mouseEvent) { + if (!this.isEnabled(mouseEvent)) { + return; + } + const occurrence = this.getLinkOccurrence(mouseEvent.target.position); + if (!occurrence) { + return; + } + this.openLinkOccurrence( + occurrence, + mouseEvent.hasSideBySideModifier, + true + /* from user gesture */ + ); + } + openLinkOccurrence(occurrence, openToSide, fromUserGesture = false) { + if (!this.openerService) { + return; + } + const { link: link2 } = occurrence; + link2.resolve(CancellationToken.None).then((uri) => { + if (typeof uri === "string" && this.editor.hasModel()) { + const modelUri = this.editor.getModel().uri; + if (modelUri.scheme === Schemas.file && uri.startsWith(`${Schemas.file}:`)) { + const parsedUri = URI.parse(uri); + if (parsedUri.scheme === Schemas.file) { + const fsPath = originalFSPath(parsedUri); + let relativePath2 = null; + if (fsPath.startsWith("/./") || fsPath.startsWith("\\.\\")) { + relativePath2 = `.${fsPath.substr(1)}`; + } else if (fsPath.startsWith("//./") || fsPath.startsWith("\\\\.\\")) { + relativePath2 = `.${fsPath.substr(2)}`; + } + if (relativePath2) { + uri = joinPath(modelUri, relativePath2); + } + } + } + } + return this.openerService.open(uri, { openToSide, fromUserGesture, allowContributedOpeners: true, allowCommands: true, fromWorkspace: true }); + }, (err) => { + const messageOrError = err instanceof Error ? err.message : err; + if (messageOrError === "invalid") { + this.notificationService.warn(localize(1277, "Failed to open this link because it is not well-formed: {0}", link2.url.toString())); + } else if (messageOrError === "missing") { + this.notificationService.warn(localize(1278, "Failed to open this link because its target is missing.")); + } else { + onUnexpectedError(err); + } + }); + } + getLinkOccurrence(position) { + if (!this.editor.hasModel() || !position) { + return null; + } + const decorations = this.editor.getModel().getDecorationsInRange({ + startLineNumber: position.lineNumber, + startColumn: position.column, + endLineNumber: position.lineNumber, + endColumn: position.column + }, 0, true); + for (const decoration3 of decorations) { + const currentOccurrence = this.currentOccurrences[decoration3.id]; + if (currentOccurrence) { + return currentOccurrence; + } + } + return null; + } + isEnabled(mouseEvent, withKey) { + return Boolean(mouseEvent.target.type === 6 && (mouseEvent.hasTriggerModifier || withKey && withKey.keyCodeIsTriggerKey || mouseEvent.isMiddleClick && mouseEvent.mouseMiddleClickAction === "openLink")); + } + stop() { + this.computeLinks.cancel(); + if (this.activeLinksList) { + this.activeLinksList?.dispose(); + this.activeLinksList = null; + } + if (this.computePromise) { + this.computePromise.cancel(); + this.computePromise = null; + } + } + dispose() { + super.dispose(); + this.stop(); + } +}; +LinkDetector = LinkDetector_1 = __decorate139([ + __param133(1, IOpenerService), + __param133(2, INotificationService), + __param133(3, ILanguageFeaturesService), + __param133(4, ILanguageFeatureDebounceService) +], LinkDetector); +var decoration = { + general: ModelDecorationOptions.register({ + description: "detected-link", + stickiness: 1, + collapseOnReplaceEdit: true, + inlineClassName: "detected-link" + }), + active: ModelDecorationOptions.register({ + description: "detected-link-active", + stickiness: 1, + collapseOnReplaceEdit: true, + inlineClassName: "detected-link-active" + }) +}; +var LinkOccurrence = class _LinkOccurrence { + static decoration(link2, useMetaKey) { + return { + range: link2.range, + options: _LinkOccurrence._getOptions(link2, useMetaKey, false) + }; + } + static _getOptions(link2, useMetaKey, isActive) { + const options2 = { ...isActive ? decoration.active : decoration.general }; + options2.hoverMessage = getHoverMessage(link2, useMetaKey); + return options2; + } + constructor(link2, decorationId) { + this.link = link2; + this.decorationId = decorationId; + } + activate(changeAccessor, useMetaKey) { + changeAccessor.changeDecorationOptions(this.decorationId, _LinkOccurrence._getOptions(this.link, useMetaKey, true)); + } + deactivate(changeAccessor, useMetaKey) { + changeAccessor.changeDecorationOptions(this.decorationId, _LinkOccurrence._getOptions(this.link, useMetaKey, false)); + } +}; +function getHoverMessage(link2, useMetaKey) { + const executeCmd = link2.url && /^command:/i.test(link2.url.toString()); + const label = link2.tooltip ? link2.tooltip : executeCmd ? localize(1279, "Execute command") : localize(1280, "Follow link"); + const kb = useMetaKey ? isMacintosh ? localize(1281, "cmd + click") : localize(1282, "ctrl + click") : isMacintosh ? localize(1283, "option + click") : localize(1284, "alt + click"); + if (link2.url) { + let nativeLabel = ""; + if (/^command:/i.test(link2.url.toString())) { + const match2 = link2.url.toString().match(/^command:([^?#]+)/); + if (match2) { + const commandId = match2[1]; + nativeLabel = localize(1285, "Execute command {0}", commandId); + } + } + const hoverMessage = new MarkdownString("", true).appendLink(link2.url.toString(true).replace(/ /g, "%20"), label, nativeLabel).appendMarkdown(` (${kb})`); + return hoverMessage; + } else { + return new MarkdownString().appendText(`${label} (${kb})`); + } +} +var OpenLinkAction = class extends EditorAction { + constructor() { + super({ + id: "editor.action.openLink", + label: localize2(1286, "Open Link"), + precondition: void 0 + }); + } + run(accessor, editor2) { + const linkDetector = LinkDetector.get(editor2); + if (!linkDetector) { + return; + } + if (!editor2.hasModel()) { + return; + } + const selections = editor2.getSelections(); + for (const sel of selections) { + const link2 = linkDetector.getLinkOccurrence(sel.getEndPosition()); + if (link2) { + linkDetector.openLinkOccurrence(link2, false); + } + } + } +}; +registerEditorContribution( + LinkDetector.ID, + LinkDetector, + 1 + /* EditorContributionInstantiation.AfterFirstRender */ +); +registerEditorAction(OpenLinkAction); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/longLinesHelper/browser/longLinesHelper.js +init_lifecycle(); +init_editorExtensions(); +var LongLinesHelper = class extends Disposable { + static { + this.ID = "editor.contrib.longLinesHelper"; + } + constructor(_editor) { + super(); + this._editor = _editor; + this._register(this._editor.onMouseDown((e) => { + const stopRenderingLineAfter = this._editor.getOption( + 133 + /* EditorOption.stopRenderingLineAfter */ + ); + if (stopRenderingLineAfter >= 0 && e.target.type === 6 && e.target.position.column >= stopRenderingLineAfter) { + this._editor.updateOptions({ + stopRenderingLineAfter: -1 + }); + } + })); + } +}; +registerEditorContribution( + LongLinesHelper.ID, + LongLinesHelper, + 2 + /* EditorContributionInstantiation.BeforeFirstInteraction */ +); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/middleScroll/browser/middleScroll.contribution.js +init_editorExtensions(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/middleScroll/browser/middleScrollController.js +init_dom(); +init_lifecycle(); +init_observable(); +init_observableCodeEditor(); +init_point(); +init_utils5(); +var MiddleScrollController = class extends Disposable { + static { + this.ID = "editor.contrib.middleScroll"; + } + constructor(_editor) { + super(); + this._editor = _editor; + const obsEditor = observableCodeEditor(this._editor); + const scrollOnMiddleClick = obsEditor.getOption( + 171 + /* EditorOption.scrollOnMiddleClick */ + ); + this._register(autorun((reader) => { + if (!scrollOnMiddleClick.read(reader)) { + return; + } + const editorDomNode = obsEditor.domNode.read(reader); + if (!editorDomNode) { + return; + } + const scrollingSession = reader.store.add(disposableObservableValue("scrollingSession", void 0)); + reader.store.add(this._editor.onMouseDown((e) => { + const session = scrollingSession.read(void 0); + if (session) { + scrollingSession.set(void 0, void 0); + return; + } + if (!e.event.middleButton) { + return; + } + e.event.stopPropagation(); + e.event.preventDefault(); + const store = new DisposableStore(); + const initialPos = new Point(e.event.posx, e.event.posy); + const mousePos = observeWindowMousePos(getWindow(editorDomNode), initialPos, store); + const mouseDeltaAfterThreshold = mousePos.map((v) => v.subtract(initialPos).withThreshold(5)); + const editorDomNodeRect = editorDomNode.getBoundingClientRect(); + const initialMousePosInEditor = new Point(initialPos.x - editorDomNodeRect.left, initialPos.y - editorDomNodeRect.top); + scrollingSession.set({ + mouseDeltaAfterThreshold, + initialMousePosInEditor, + didScroll: false, + dispose: () => store.dispose() + }, void 0); + store.add(this._editor.onMouseUp((e2) => { + const session2 = scrollingSession.read(void 0); + if (session2 && session2.didScroll) { + scrollingSession.set(void 0, void 0); + } + })); + store.add(this._editor.onKeyDown((e2) => { + scrollingSession.set(void 0, void 0); + })); + })); + reader.store.add(autorun((reader2) => { + const session = scrollingSession.read(reader2); + if (!session) { + return; + } + let lastTime = Date.now(); + reader2.store.add(autorun((reader3) => { + AnimationFrameScheduler.instance.invalidateOnNextAnimationFrame(reader3); + const curTime = Date.now(); + const frameDurationMs = curTime - lastTime; + lastTime = curTime; + const mouseDelta = session.mouseDeltaAfterThreshold.read(void 0); + const factor2 = frameDurationMs / 32; + const scrollDelta = mouseDelta.scale(factor2); + const scrollPos = new Point(this._editor.getScrollLeft(), this._editor.getScrollTop()); + this._editor.setScrollPosition(toScrollPosition(scrollPos.add(scrollDelta))); + if (!scrollDelta.isZero()) { + session.didScroll = true; + } + })); + const directionAttr = derived((reader3) => { + const delta = session.mouseDeltaAfterThreshold.read(reader3); + let direction = ""; + direction += delta.y < 0 ? "n" : delta.y > 0 ? "s" : ""; + direction += delta.x < 0 ? "w" : delta.x > 0 ? "e" : ""; + return direction; + }); + reader2.store.add(autorun((reader3) => { + editorDomNode.setAttribute("data-scroll-direction", directionAttr.read(reader3)); + })); + })); + const dotDomElem = reader.store.add(n.div({ + class: ["scroll-editor-on-middle-click-dot", scrollingSession.map((session) => session ? "" : "hidden")], + style: { + left: scrollingSession.map((session) => session ? session.initialMousePosInEditor.x : 0), + top: scrollingSession.map((session) => session ? session.initialMousePosInEditor.y : 0) + } + }).toDisposableLiveElement()); + reader.store.add(appendRemoveOnDispose(editorDomNode, dotDomElem.element)); + reader.store.add(autorun((reader2) => { + const session = scrollingSession.read(reader2); + editorDomNode.classList.toggle("scroll-editor-on-middle-click-editor", !!session); + })); + })); + } +}; +function observeWindowMousePos(window2, initialPos, store) { + const val = observableValue("pos", initialPos); + store.add(addDisposableListener(window2, "mousemove", (e) => { + val.set(new Point(e.pageX, e.pageY), void 0); + })); + return val; +} +function toScrollPosition(p) { + return { + scrollLeft: p.x, + scrollTop: p.y + }; +} + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/middleScroll/browser/middleScroll.contribution.js +registerEditorContribution( + MiddleScrollController.ID, + MiddleScrollController, + 2 + /* EditorContributionInstantiation.BeforeFirstInteraction */ +); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/multicursor/browser/multicursor.js +init_async(); +init_keyCodes(); +init_lifecycle(); +init_editorExtensions(); +init_range(); +init_selection(); +init_editorContextKeys(); +init_nls(); +init_actions2(); +init_contextkey(); +init_languageFeatures(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/wordHighlighter/browser/highlightDecorations.js +init_model2(); +init_textModel(); +init_languages(); +init_nls(); +init_colorRegistry(); +init_themeService(); +var wordHighlightBackground = registerColor("editor.wordHighlightBackground", { dark: "#575757B8", light: "#57575740", hcDark: null, hcLight: null }, localize(1563, "Background color of a symbol during read-access, like reading a variable. The color must not be opaque so as not to hide underlying decorations."), true); +registerColor("editor.wordHighlightStrongBackground", { dark: "#004972B8", light: "#0e639c40", hcDark: null, hcLight: null }, localize(1564, "Background color of a symbol during write-access, like writing to a variable. The color must not be opaque so as not to hide underlying decorations."), true); +registerColor("editor.wordHighlightTextBackground", wordHighlightBackground, localize(1565, "Background color of a textual occurrence for a symbol. The color must not be opaque so as not to hide underlying decorations."), true); +var wordHighlightBorder = registerColor("editor.wordHighlightBorder", { light: null, dark: null, hcDark: activeContrastBorder, hcLight: activeContrastBorder }, localize(1566, "Border color of a symbol during read-access, like reading a variable.")); +registerColor("editor.wordHighlightStrongBorder", { light: null, dark: null, hcDark: activeContrastBorder, hcLight: activeContrastBorder }, localize(1567, "Border color of a symbol during write-access, like writing to a variable.")); +registerColor("editor.wordHighlightTextBorder", wordHighlightBorder, localize(1568, "Border color of a textual occurrence for a symbol.")); +var overviewRulerWordHighlightForeground = registerColor("editorOverviewRuler.wordHighlightForeground", "#A0A0A0CC", localize(1569, "Overview ruler marker color for symbol highlights. The color must not be opaque so as not to hide underlying decorations."), true); +var overviewRulerWordHighlightStrongForeground = registerColor("editorOverviewRuler.wordHighlightStrongForeground", "#C0A0C0CC", localize(1570, "Overview ruler marker color for write-access symbol highlights. The color must not be opaque so as not to hide underlying decorations."), true); +var overviewRulerWordHighlightTextForeground = registerColor("editorOverviewRuler.wordHighlightTextForeground", overviewRulerSelectionHighlightForeground, localize(1571, "Overview ruler marker color of a textual occurrence for a symbol. The color must not be opaque so as not to hide underlying decorations."), true); +var _WRITE_OPTIONS = ModelDecorationOptions.register({ + description: "word-highlight-strong", + stickiness: 1, + className: "wordHighlightStrong", + overviewRuler: { + color: themeColorFromId(overviewRulerWordHighlightStrongForeground), + position: OverviewRulerLane.Center + }, + minimap: { + color: themeColorFromId(minimapSelectionOccurrenceHighlight), + position: 1 + /* MinimapPosition.Inline */ + } +}); +var _TEXT_OPTIONS = ModelDecorationOptions.register({ + description: "word-highlight-text", + stickiness: 1, + className: "wordHighlightText", + overviewRuler: { + color: themeColorFromId(overviewRulerWordHighlightTextForeground), + position: OverviewRulerLane.Center + }, + minimap: { + color: themeColorFromId(minimapSelectionOccurrenceHighlight), + position: 1 + /* MinimapPosition.Inline */ + } +}); +var _SELECTION_HIGHLIGHT_OPTIONS = ModelDecorationOptions.register({ + description: "selection-highlight-overview", + stickiness: 1, + className: "selectionHighlight", + overviewRuler: { + color: themeColorFromId(overviewRulerSelectionHighlightForeground), + position: OverviewRulerLane.Center + }, + minimap: { + color: themeColorFromId(minimapSelectionOccurrenceHighlight), + position: 1 + /* MinimapPosition.Inline */ + } +}); +var _SELECTION_HIGHLIGHT_OPTIONS_NO_OVERVIEW = ModelDecorationOptions.register({ + description: "selection-highlight", + stickiness: 1, + className: "selectionHighlight" +}); +var _REGULAR_OPTIONS = ModelDecorationOptions.register({ + description: "word-highlight", + stickiness: 1, + className: "wordHighlight", + overviewRuler: { + color: themeColorFromId(overviewRulerWordHighlightForeground), + position: OverviewRulerLane.Center + }, + minimap: { + color: themeColorFromId(minimapSelectionOccurrenceHighlight), + position: 1 + /* MinimapPosition.Inline */ + } +}); +function getHighlightDecorationOptions(kind) { + if (kind === DocumentHighlightKind.Write) { + return _WRITE_OPTIONS; + } else if (kind === DocumentHighlightKind.Text) { + return _TEXT_OPTIONS; + } else { + return _REGULAR_OPTIONS; + } +} +function getSelectionHighlightDecorationOptions(hasSemanticHighlights) { + return hasSemanticHighlights ? _SELECTION_HIGHLIGHT_OPTIONS_NO_OVERVIEW : _SELECTION_HIGHLIGHT_OPTIONS; +} +registerThemingParticipant((theme, collector) => { + const selectionHighlight = theme.getColor(editorSelectionHighlight); + if (selectionHighlight) { + collector.addRule(`.monaco-editor .selectionHighlight { background-color: ${selectionHighlight.transparent(0.5)}; }`); + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/multicursor/browser/multicursor.js +init_instantiation(); +var __decorate140 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param134 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var SelectionHighlighter_1; +function announceCursorChange(previousCursorState, cursorState) { + const cursorDiff = cursorState.filter((cs) => !previousCursorState.find((pcs) => pcs.equals(cs))); + if (cursorDiff.length >= 1) { + const cursorPositions = cursorDiff.map((cs) => `line ${cs.viewState.position.lineNumber} column ${cs.viewState.position.column}`).join(", "); + const msg = cursorDiff.length === 1 ? localize(1288, "Cursor added: {0}", cursorPositions) : localize(1289, "Cursors added: {0}", cursorPositions); + status(msg); + } +} +var InsertCursorAbove = class extends EditorAction { + constructor() { + super({ + id: "editor.action.insertCursorAbove", + label: localize2(1298, "Add Cursor Above"), + precondition: void 0, + kbOpts: { + kbExpr: EditorContextKeys.editorTextFocus, + primary: 2048 | 512 | 16, + linux: { + primary: 1024 | 512 | 16, + secondary: [ + 2048 | 1024 | 16 + /* KeyCode.UpArrow */ + ] + }, + weight: 100 + /* KeybindingWeight.EditorContrib */ + }, + menuOpts: { + menuId: MenuId.MenubarSelectionMenu, + group: "3_multi", + title: localize(1290, "&&Add Cursor Above"), + order: 2 + } + }); + } + run(accessor, editor2, args) { + if (!editor2.hasModel()) { + return; + } + let useLogicalLine = true; + if (args && args.logicalLine === false) { + useLogicalLine = false; + } + const viewModel = editor2._getViewModel(); + if (viewModel.cursorConfig.readOnly) { + return; + } + viewModel.model.pushStackElement(); + const previousCursorState = viewModel.getCursorStates(); + viewModel.setCursorStates(args.source, 3, CursorMoveCommands.addCursorUp(viewModel, previousCursorState, useLogicalLine)); + viewModel.revealTopMostCursor(args.source); + announceCursorChange(previousCursorState, viewModel.getCursorStates()); + } +}; +var InsertCursorBelow = class extends EditorAction { + constructor() { + super({ + id: "editor.action.insertCursorBelow", + label: localize2(1299, "Add Cursor Below"), + precondition: void 0, + kbOpts: { + kbExpr: EditorContextKeys.editorTextFocus, + primary: 2048 | 512 | 18, + linux: { + primary: 1024 | 512 | 18, + secondary: [ + 2048 | 1024 | 18 + /* KeyCode.DownArrow */ + ] + }, + weight: 100 + /* KeybindingWeight.EditorContrib */ + }, + menuOpts: { + menuId: MenuId.MenubarSelectionMenu, + group: "3_multi", + title: localize(1291, "A&&dd Cursor Below"), + order: 3 + } + }); + } + run(accessor, editor2, args) { + if (!editor2.hasModel()) { + return; + } + let useLogicalLine = true; + if (args && args.logicalLine === false) { + useLogicalLine = false; + } + const viewModel = editor2._getViewModel(); + if (viewModel.cursorConfig.readOnly) { + return; + } + viewModel.model.pushStackElement(); + const previousCursorState = viewModel.getCursorStates(); + viewModel.setCursorStates(args.source, 3, CursorMoveCommands.addCursorDown(viewModel, previousCursorState, useLogicalLine)); + viewModel.revealBottomMostCursor(args.source); + announceCursorChange(previousCursorState, viewModel.getCursorStates()); + } +}; +var InsertCursorAtEndOfEachLineSelected = class extends EditorAction { + constructor() { + super({ + id: "editor.action.insertCursorAtEndOfEachLineSelected", + label: localize2(1300, "Add Cursors to Line Ends"), + precondition: void 0, + kbOpts: { + kbExpr: EditorContextKeys.editorTextFocus, + primary: 1024 | 512 | 39, + weight: 100 + /* KeybindingWeight.EditorContrib */ + }, + menuOpts: { + menuId: MenuId.MenubarSelectionMenu, + group: "3_multi", + title: localize(1292, "Add C&&ursors to Line Ends"), + order: 4 + } + }); + } + getCursorsForSelection(selection, model, result) { + if (selection.isEmpty()) { + return; + } + for (let i2 = selection.startLineNumber; i2 < selection.endLineNumber; i2++) { + const currentLineMaxColumn = model.getLineMaxColumn(i2); + result.push(new Selection(i2, currentLineMaxColumn, i2, currentLineMaxColumn)); + } + if (selection.endColumn > 1) { + result.push(new Selection(selection.endLineNumber, selection.endColumn, selection.endLineNumber, selection.endColumn)); + } + } + run(accessor, editor2) { + if (!editor2.hasModel()) { + return; + } + const model = editor2.getModel(); + const selections = editor2.getSelections(); + const viewModel = editor2._getViewModel(); + const previousCursorState = viewModel.getCursorStates(); + const newSelections = []; + selections.forEach((sel) => this.getCursorsForSelection(sel, model, newSelections)); + if (newSelections.length > 0) { + editor2.setSelections(newSelections); + } + announceCursorChange(previousCursorState, viewModel.getCursorStates()); + } +}; +var InsertCursorAtEndOfLineSelected = class extends EditorAction { + constructor() { + super({ + id: "editor.action.addCursorsToBottom", + label: localize2(1301, "Add Cursors to Bottom"), + precondition: void 0 + }); + } + run(accessor, editor2) { + if (!editor2.hasModel()) { + return; + } + const selections = editor2.getSelections(); + const lineCount = editor2.getModel().getLineCount(); + const newSelections = []; + for (let i2 = selections[0].startLineNumber; i2 <= lineCount; i2++) { + newSelections.push(new Selection(i2, selections[0].startColumn, i2, selections[0].endColumn)); + } + const viewModel = editor2._getViewModel(); + const previousCursorState = viewModel.getCursorStates(); + if (newSelections.length > 0) { + editor2.setSelections(newSelections); + } + announceCursorChange(previousCursorState, viewModel.getCursorStates()); + } +}; +var InsertCursorAtTopOfLineSelected = class extends EditorAction { + constructor() { + super({ + id: "editor.action.addCursorsToTop", + label: localize2(1302, "Add Cursors to Top"), + precondition: void 0 + }); + } + run(accessor, editor2) { + if (!editor2.hasModel()) { + return; + } + const selections = editor2.getSelections(); + const newSelections = []; + for (let i2 = selections[0].startLineNumber; i2 >= 1; i2--) { + newSelections.push(new Selection(i2, selections[0].startColumn, i2, selections[0].endColumn)); + } + const viewModel = editor2._getViewModel(); + const previousCursorState = viewModel.getCursorStates(); + if (newSelections.length > 0) { + editor2.setSelections(newSelections); + } + announceCursorChange(previousCursorState, viewModel.getCursorStates()); + } +}; +var MultiCursorSessionResult = class { + constructor(selections, revealRange, revealScrollType) { + this.selections = selections; + this.revealRange = revealRange; + this.revealScrollType = revealScrollType; + } +}; +var MultiCursorSession = class _MultiCursorSession { + static create(editor2, findController) { + if (!editor2.hasModel()) { + return null; + } + const findState = findController.getState(); + if (!editor2.hasTextFocus() && findState.isRevealed && findState.searchString.length > 0) { + return new _MultiCursorSession(editor2, findController, false, findState.searchString, findState.wholeWord, findState.matchCase, null); + } + let isDisconnectedFromFindController = false; + let wholeWord; + let matchCase; + const selections = editor2.getSelections(); + if (selections.length === 1 && selections[0].isEmpty()) { + isDisconnectedFromFindController = true; + wholeWord = true; + matchCase = true; + } else { + wholeWord = findState.wholeWord; + matchCase = findState.matchCase; + } + const s = editor2.getSelection(); + let searchText; + let currentMatch = null; + if (s.isEmpty()) { + const word = editor2.getConfiguredWordAtPosition(s.getStartPosition()); + if (!word) { + return null; + } + searchText = word.word; + currentMatch = new Selection(s.startLineNumber, word.startColumn, s.startLineNumber, word.endColumn); + } else { + searchText = editor2.getModel().getValueInRange(s).replace(/\r\n/g, "\n"); + } + return new _MultiCursorSession(editor2, findController, isDisconnectedFromFindController, searchText, wholeWord, matchCase, currentMatch); + } + constructor(_editor, findController, isDisconnectedFromFindController, searchText, wholeWord, matchCase, currentMatch) { + this._editor = _editor; + this.findController = findController; + this.isDisconnectedFromFindController = isDisconnectedFromFindController; + this.searchText = searchText; + this.wholeWord = wholeWord; + this.matchCase = matchCase; + this.currentMatch = currentMatch; + } + addSelectionToNextFindMatch() { + if (!this._editor.hasModel()) { + return null; + } + const nextMatch = this._getNextMatch(); + if (!nextMatch) { + return null; + } + const allSelections = this._editor.getSelections(); + return new MultiCursorSessionResult( + allSelections.concat(nextMatch), + nextMatch, + 0 + /* ScrollType.Smooth */ + ); + } + moveSelectionToNextFindMatch() { + if (!this._editor.hasModel()) { + return null; + } + const nextMatch = this._getNextMatch(); + if (!nextMatch) { + return null; + } + const allSelections = this._editor.getSelections(); + return new MultiCursorSessionResult( + allSelections.slice(0, allSelections.length - 1).concat(nextMatch), + nextMatch, + 0 + /* ScrollType.Smooth */ + ); + } + _getNextMatch() { + if (!this._editor.hasModel()) { + return null; + } + if (this.currentMatch) { + const result = this.currentMatch; + this.currentMatch = null; + return result; + } + this.findController.highlightFindOptions(); + const allSelections = this._editor.getSelections(); + const lastAddedSelection = allSelections[allSelections.length - 1]; + const nextMatch = this._editor.getModel().findNextMatch(this.searchText, lastAddedSelection.getEndPosition(), false, this.matchCase, this.wholeWord ? this._editor.getOption( + 148 + /* EditorOption.wordSeparators */ + ) : null, false); + if (!nextMatch) { + return null; + } + return new Selection(nextMatch.range.startLineNumber, nextMatch.range.startColumn, nextMatch.range.endLineNumber, nextMatch.range.endColumn); + } + addSelectionToPreviousFindMatch() { + if (!this._editor.hasModel()) { + return null; + } + const previousMatch = this._getPreviousMatch(); + if (!previousMatch) { + return null; + } + const allSelections = this._editor.getSelections(); + return new MultiCursorSessionResult( + allSelections.concat(previousMatch), + previousMatch, + 0 + /* ScrollType.Smooth */ + ); + } + moveSelectionToPreviousFindMatch() { + if (!this._editor.hasModel()) { + return null; + } + const previousMatch = this._getPreviousMatch(); + if (!previousMatch) { + return null; + } + const allSelections = this._editor.getSelections(); + return new MultiCursorSessionResult( + allSelections.slice(0, allSelections.length - 1).concat(previousMatch), + previousMatch, + 0 + /* ScrollType.Smooth */ + ); + } + _getPreviousMatch() { + if (!this._editor.hasModel()) { + return null; + } + if (this.currentMatch) { + const result = this.currentMatch; + this.currentMatch = null; + return result; + } + this.findController.highlightFindOptions(); + const allSelections = this._editor.getSelections(); + const lastAddedSelection = allSelections[allSelections.length - 1]; + const previousMatch = this._editor.getModel().findPreviousMatch(this.searchText, lastAddedSelection.getStartPosition(), false, this.matchCase, this.wholeWord ? this._editor.getOption( + 148 + /* EditorOption.wordSeparators */ + ) : null, false); + if (!previousMatch) { + return null; + } + return new Selection(previousMatch.range.startLineNumber, previousMatch.range.startColumn, previousMatch.range.endLineNumber, previousMatch.range.endColumn); + } + selectAll(searchScope) { + if (!this._editor.hasModel()) { + return []; + } + this.findController.highlightFindOptions(); + const editorModel = this._editor.getModel(); + if (searchScope) { + return editorModel.findMatches( + this.searchText, + searchScope, + false, + this.matchCase, + this.wholeWord ? this._editor.getOption( + 148 + /* EditorOption.wordSeparators */ + ) : null, + false, + 1073741824 + /* Constants.MAX_SAFE_SMALL_INTEGER */ + ); + } + return editorModel.findMatches( + this.searchText, + true, + false, + this.matchCase, + this.wholeWord ? this._editor.getOption( + 148 + /* EditorOption.wordSeparators */ + ) : null, + false, + 1073741824 + /* Constants.MAX_SAFE_SMALL_INTEGER */ + ); + } +}; +var MultiCursorSelectionController = class _MultiCursorSelectionController extends Disposable { + static { + this.ID = "editor.contrib.multiCursorController"; + } + static get(editor2) { + return editor2.getContribution(_MultiCursorSelectionController.ID); + } + constructor(editor2) { + super(); + this._sessionDispose = this._register(new DisposableStore()); + this._editor = editor2; + this._ignoreSelectionChange = false; + this._session = null; + } + dispose() { + this._endSession(); + super.dispose(); + } + _beginSessionIfNeeded(findController) { + if (!this._session) { + const session = MultiCursorSession.create(this._editor, findController); + if (!session) { + return; + } + this._session = session; + const newState = { searchString: this._session.searchText }; + if (this._session.isDisconnectedFromFindController) { + newState.wholeWordOverride = 1; + newState.matchCaseOverride = 1; + newState.isRegexOverride = 2; + } + findController.getState().change(newState, false); + this._sessionDispose.add(this._editor.onDidChangeCursorSelection((e) => { + if (this._ignoreSelectionChange) { + return; + } + this._endSession(); + })); + this._sessionDispose.add(this._editor.onDidBlurEditorText(() => { + this._endSession(); + })); + this._sessionDispose.add(findController.getState().onFindReplaceStateChange((e) => { + if (e.matchCase || e.wholeWord) { + this._endSession(); + } + })); + } + } + _endSession() { + this._sessionDispose.clear(); + if (this._session && this._session.isDisconnectedFromFindController) { + const newState = { + wholeWordOverride: 0, + matchCaseOverride: 0, + isRegexOverride: 0 + }; + this._session.findController.getState().change(newState, false); + } + this._session = null; + } + _setSelections(selections) { + this._ignoreSelectionChange = true; + this._editor.setSelections(selections); + this._ignoreSelectionChange = false; + } + _expandEmptyToWord(model, selection) { + if (!selection.isEmpty()) { + return selection; + } + const word = this._editor.getConfiguredWordAtPosition(selection.getStartPosition()); + if (!word) { + return selection; + } + return new Selection(selection.startLineNumber, word.startColumn, selection.startLineNumber, word.endColumn); + } + _applySessionResult(result) { + if (!result) { + return; + } + this._setSelections(result.selections); + if (result.revealRange) { + this._editor.revealRangeInCenterIfOutsideViewport(result.revealRange, result.revealScrollType); + } + } + getSession(findController) { + return this._session; + } + addSelectionToNextFindMatch(findController) { + if (!this._editor.hasModel()) { + return; + } + if (!this._session) { + const allSelections = this._editor.getSelections(); + if (allSelections.length > 1) { + const findState = findController.getState(); + const matchCase = findState.matchCase; + const selectionsContainSameText = modelRangesContainSameText(this._editor.getModel(), allSelections, matchCase); + if (!selectionsContainSameText) { + const model = this._editor.getModel(); + const resultingSelections = []; + for (let i2 = 0, len = allSelections.length; i2 < len; i2++) { + resultingSelections[i2] = this._expandEmptyToWord(model, allSelections[i2]); + } + this._editor.setSelections(resultingSelections); + return; + } + } + } + this._beginSessionIfNeeded(findController); + if (this._session) { + this._applySessionResult(this._session.addSelectionToNextFindMatch()); + } + } + addSelectionToPreviousFindMatch(findController) { + this._beginSessionIfNeeded(findController); + if (this._session) { + this._applySessionResult(this._session.addSelectionToPreviousFindMatch()); + } + } + moveSelectionToNextFindMatch(findController) { + this._beginSessionIfNeeded(findController); + if (this._session) { + this._applySessionResult(this._session.moveSelectionToNextFindMatch()); + } + } + moveSelectionToPreviousFindMatch(findController) { + this._beginSessionIfNeeded(findController); + if (this._session) { + this._applySessionResult(this._session.moveSelectionToPreviousFindMatch()); + } + } + selectAll(findController) { + if (!this._editor.hasModel()) { + return; + } + let matches = null; + const findState = findController.getState(); + if (findState.isRevealed && findState.searchString.length > 0 && findState.isRegex) { + const editorModel = this._editor.getModel(); + if (findState.searchScope) { + matches = editorModel.findMatches( + findState.searchString, + findState.searchScope, + findState.isRegex, + findState.matchCase, + findState.wholeWord ? this._editor.getOption( + 148 + /* EditorOption.wordSeparators */ + ) : null, + false, + 1073741824 + /* Constants.MAX_SAFE_SMALL_INTEGER */ + ); + } else { + matches = editorModel.findMatches( + findState.searchString, + true, + findState.isRegex, + findState.matchCase, + findState.wholeWord ? this._editor.getOption( + 148 + /* EditorOption.wordSeparators */ + ) : null, + false, + 1073741824 + /* Constants.MAX_SAFE_SMALL_INTEGER */ + ); + } + } else { + this._beginSessionIfNeeded(findController); + if (!this._session) { + return; + } + matches = this._session.selectAll(findState.searchScope); + } + if (matches.length > 0) { + const editorSelection = this._editor.getSelection(); + for (let i2 = 0, len = matches.length; i2 < len; i2++) { + const match2 = matches[i2]; + const intersection2 = match2.range.intersectRanges(editorSelection); + if (intersection2) { + matches[i2] = matches[0]; + matches[0] = match2; + break; + } + } + this._setSelections(matches.map((m) => new Selection(m.range.startLineNumber, m.range.startColumn, m.range.endLineNumber, m.range.endColumn))); + } + } +}; +var MultiCursorSelectionControllerAction = class extends EditorAction { + run(accessor, editor2) { + const multiCursorController = MultiCursorSelectionController.get(editor2); + if (!multiCursorController) { + return; + } + const viewModel = editor2._getViewModel(); + if (viewModel) { + const previousCursorState = viewModel.getCursorStates(); + const findController = CommonFindController.get(editor2); + if (findController) { + this._run(multiCursorController, findController); + } else { + const newFindController = accessor.get(IInstantiationService).createInstance(CommonFindController, editor2); + this._run(multiCursorController, newFindController); + newFindController.dispose(); + } + announceCursorChange(previousCursorState, viewModel.getCursorStates()); + } + } +}; +var AddSelectionToNextFindMatchAction = class extends MultiCursorSelectionControllerAction { + constructor() { + super({ + id: "editor.action.addSelectionToNextFindMatch", + label: localize2(1303, "Add Selection to Next Find Match"), + precondition: void 0, + kbOpts: { + kbExpr: EditorContextKeys.focus, + primary: 2048 | 34, + weight: 100 + /* KeybindingWeight.EditorContrib */ + }, + menuOpts: { + menuId: MenuId.MenubarSelectionMenu, + group: "3_multi", + title: localize(1293, "Add &&Next Occurrence"), + order: 5 + } + }); + } + _run(multiCursorController, findController) { + multiCursorController.addSelectionToNextFindMatch(findController); + } +}; +var AddSelectionToPreviousFindMatchAction = class extends MultiCursorSelectionControllerAction { + constructor() { + super({ + id: "editor.action.addSelectionToPreviousFindMatch", + label: localize2(1304, "Add Selection to Previous Find Match"), + precondition: void 0, + menuOpts: { + menuId: MenuId.MenubarSelectionMenu, + group: "3_multi", + title: localize(1294, "Add P&&revious Occurrence"), + order: 6 + } + }); + } + _run(multiCursorController, findController) { + multiCursorController.addSelectionToPreviousFindMatch(findController); + } +}; +var MoveSelectionToNextFindMatchAction = class extends MultiCursorSelectionControllerAction { + constructor() { + super({ + id: "editor.action.moveSelectionToNextFindMatch", + label: localize2(1305, "Move Last Selection to Next Find Match"), + precondition: void 0, + kbOpts: { + kbExpr: EditorContextKeys.focus, + primary: KeyChord( + 2048 | 41, + 2048 | 34 + /* KeyCode.KeyD */ + ), + weight: 100 + /* KeybindingWeight.EditorContrib */ + } + }); + } + _run(multiCursorController, findController) { + multiCursorController.moveSelectionToNextFindMatch(findController); + } +}; +var MoveSelectionToPreviousFindMatchAction = class extends MultiCursorSelectionControllerAction { + constructor() { + super({ + id: "editor.action.moveSelectionToPreviousFindMatch", + label: localize2(1306, "Move Last Selection to Previous Find Match"), + precondition: void 0 + }); + } + _run(multiCursorController, findController) { + multiCursorController.moveSelectionToPreviousFindMatch(findController); + } +}; +var SelectHighlightsAction = class extends MultiCursorSelectionControllerAction { + constructor() { + super({ + id: "editor.action.selectHighlights", + label: localize2(1307, "Select All Occurrences of Find Match"), + precondition: void 0, + kbOpts: { + kbExpr: EditorContextKeys.focus, + primary: 2048 | 1024 | 42, + weight: 100 + /* KeybindingWeight.EditorContrib */ + }, + menuOpts: { + menuId: MenuId.MenubarSelectionMenu, + group: "3_multi", + title: localize(1295, "Select All &&Occurrences"), + order: 7 + } + }); + } + _run(multiCursorController, findController) { + multiCursorController.selectAll(findController); + } +}; +var CompatChangeAll = class extends MultiCursorSelectionControllerAction { + constructor() { + super({ + id: "editor.action.changeAll", + label: localize2(1308, "Change All Occurrences"), + precondition: ContextKeyExpr.and(EditorContextKeys.writable, EditorContextKeys.editorTextFocus), + kbOpts: { + kbExpr: EditorContextKeys.editorTextFocus, + primary: 2048 | 60, + weight: 100 + /* KeybindingWeight.EditorContrib */ + }, + contextMenuOpts: { + group: "1_modification", + order: 1.2 + } + }); + } + _run(multiCursorController, findController) { + multiCursorController.selectAll(findController); + } +}; +var SelectionHighlighterState = class { + constructor(_model, _searchText, _matchCase, _wordSeparators, prevState) { + this._model = _model; + this._searchText = _searchText; + this._matchCase = _matchCase; + this._wordSeparators = _wordSeparators; + this._cachedFindMatches = null; + this._modelVersionId = this._model.getVersionId(); + if (prevState && this._model === prevState._model && this._searchText === prevState._searchText && this._matchCase === prevState._matchCase && this._wordSeparators === prevState._wordSeparators && this._modelVersionId === prevState._modelVersionId) { + this._cachedFindMatches = prevState._cachedFindMatches; + } + } + findMatches() { + if (this._cachedFindMatches === null) { + this._cachedFindMatches = this._model.findMatches(this._searchText, true, false, this._matchCase, this._wordSeparators, false).map((m) => m.range); + this._cachedFindMatches.sort(Range.compareRangesUsingStarts); + } + return this._cachedFindMatches; + } +}; +var SelectionHighlighter = class SelectionHighlighter2 extends Disposable { + static { + SelectionHighlighter_1 = this; + } + static { + this.ID = "editor.contrib.selectionHighlighter"; + } + constructor(editor2, _languageFeaturesService) { + super(); + this._languageFeaturesService = _languageFeaturesService; + this.editor = editor2; + this._isEnabled = editor2.getOption( + 122 + /* EditorOption.selectionHighlight */ + ); + this._isEnabledMultiline = editor2.getOption( + 124 + /* EditorOption.selectionHighlightMultiline */ + ); + this._maxLength = editor2.getOption( + 123 + /* EditorOption.selectionHighlightMaxLength */ + ); + this._decorations = editor2.createDecorationsCollection(); + this.updateSoon = this._register(new RunOnceScheduler(() => this._update(), 300)); + this.state = null; + this._register(editor2.onDidChangeConfiguration((e) => { + this._isEnabled = editor2.getOption( + 122 + /* EditorOption.selectionHighlight */ + ); + this._isEnabledMultiline = editor2.getOption( + 124 + /* EditorOption.selectionHighlightMultiline */ + ); + this._maxLength = editor2.getOption( + 123 + /* EditorOption.selectionHighlightMaxLength */ + ); + })); + this._register(editor2.onDidChangeCursorSelection((e) => { + if (!this._isEnabled) { + return; + } + if (e.selection.isEmpty()) { + if (e.reason === 3) { + if (this.state) { + this._setState(null); + } + this.updateSoon.schedule(); + } else { + this._setState(null); + } + } else { + this._update(); + } + })); + this._register(editor2.onDidChangeModel((e) => { + this._setState(null); + })); + this._register(editor2.onDidChangeModelContent((e) => { + if (this._isEnabled) { + this.updateSoon.schedule(); + } + })); + const findController = CommonFindController.get(editor2); + if (findController) { + this._register(findController.getState().onFindReplaceStateChange((e) => { + this._update(); + })); + } + this.updateSoon.schedule(); + } + _update() { + this._setState(SelectionHighlighter_1._createState(this.state, this._isEnabled, this._isEnabledMultiline, this._maxLength, this.editor)); + } + static _createState(oldState, isEnabled, isEnabledMultiline, maxLength, editor2) { + if (!isEnabled) { + return null; + } + if (!editor2.hasModel()) { + return null; + } + if (!isEnabledMultiline) { + const s = editor2.getSelection(); + if (s.startLineNumber !== s.endLineNumber) { + return null; + } + } + const multiCursorController = MultiCursorSelectionController.get(editor2); + if (!multiCursorController) { + return null; + } + const findController = CommonFindController.get(editor2); + if (!findController) { + return null; + } + let r = multiCursorController.getSession(findController); + if (!r) { + const allSelections = editor2.getSelections(); + if (allSelections.length > 1) { + const findState2 = findController.getState(); + const matchCase = findState2.matchCase; + const selectionsContainSameText = modelRangesContainSameText(editor2.getModel(), allSelections, matchCase); + if (!selectionsContainSameText) { + return null; + } + } + r = MultiCursorSession.create(editor2, findController); + } + if (!r) { + return null; + } + if (r.currentMatch) { + return null; + } + if (/^[ \t]+$/.test(r.searchText)) { + return null; + } + if (maxLength > 0 && r.searchText.length > maxLength) { + return null; + } + const findState = findController.getState(); + const caseSensitive = findState.matchCase; + if (findState.isRevealed) { + let findStateSearchString = findState.searchString; + if (!caseSensitive) { + findStateSearchString = findStateSearchString.toLowerCase(); + } + let mySearchString = r.searchText; + if (!caseSensitive) { + mySearchString = mySearchString.toLowerCase(); + } + if (findStateSearchString === mySearchString && r.matchCase === findState.matchCase && r.wholeWord === findState.wholeWord && !findState.isRegex) { + return null; + } + } + return new SelectionHighlighterState(editor2.getModel(), r.searchText, r.matchCase, r.wholeWord ? editor2.getOption( + 148 + /* EditorOption.wordSeparators */ + ) : null, oldState); + } + _setState(newState) { + this.state = newState; + if (!this.state) { + this._decorations.clear(); + return; + } + if (!this.editor.hasModel()) { + return; + } + const model = this.editor.getModel(); + if (model.isTooLargeForTokenization()) { + return; + } + const allMatches = this.state.findMatches(); + const selections = this.editor.getSelections(); + selections.sort(Range.compareRangesUsingStarts); + const matches = []; + for (let i2 = 0, j = 0, len = allMatches.length, lenJ = selections.length; i2 < len; ) { + const match2 = allMatches[i2]; + if (j >= lenJ) { + matches.push(match2); + i2++; + } else { + const cmp3 = Range.compareRangesUsingStarts(match2, selections[j]); + if (cmp3 < 0) { + if (selections[j].isEmpty() || !Range.areIntersecting(match2, selections[j])) { + matches.push(match2); + } + i2++; + } else if (cmp3 > 0) { + j++; + } else { + i2++; + j++; + } + } + } + const occurrenceHighlighting = this.editor.getOption( + 90 + /* EditorOption.occurrencesHighlight */ + ) !== "off"; + const hasSemanticHighlights = this._languageFeaturesService.documentHighlightProvider.has(model) && occurrenceHighlighting; + const decorations = matches.map((r) => { + return { + range: r, + options: getSelectionHighlightDecorationOptions(hasSemanticHighlights) + }; + }); + this._decorations.set(decorations); + } + dispose() { + this._setState(null); + super.dispose(); + } +}; +SelectionHighlighter = SelectionHighlighter_1 = __decorate140([ + __param134(1, ILanguageFeaturesService) +], SelectionHighlighter); +function modelRangesContainSameText(model, ranges, matchCase) { + const selectedText = getValueInRange(model, ranges[0], !matchCase); + for (let i2 = 1, len = ranges.length; i2 < len; i2++) { + const range2 = ranges[i2]; + if (range2.isEmpty()) { + return false; + } + const thisSelectedText = getValueInRange(model, range2, !matchCase); + if (selectedText !== thisSelectedText) { + return false; + } + } + return true; +} +function getValueInRange(model, range2, toLowerCase) { + const text2 = model.getValueInRange(range2); + return toLowerCase ? text2.toLowerCase() : text2; +} +var FocusNextCursor = class extends EditorAction { + constructor() { + super({ + id: "editor.action.focusNextCursor", + label: localize2(1309, "Focus Next Cursor"), + metadata: { + description: localize(1296, "Focuses the next cursor"), + args: [] + }, + precondition: void 0 + }); + } + run(accessor, editor2, args) { + if (!editor2.hasModel()) { + return; + } + const viewModel = editor2._getViewModel(); + if (viewModel.cursorConfig.readOnly) { + return; + } + viewModel.model.pushStackElement(); + const previousCursorState = Array.from(viewModel.getCursorStates()); + const firstCursor = previousCursorState.shift(); + if (!firstCursor) { + return; + } + previousCursorState.push(firstCursor); + viewModel.setCursorStates(args.source, 3, previousCursorState); + viewModel.revealPrimaryCursor(args.source, true); + announceCursorChange(previousCursorState, viewModel.getCursorStates()); + } +}; +var FocusPreviousCursor = class extends EditorAction { + constructor() { + super({ + id: "editor.action.focusPreviousCursor", + label: localize2(1310, "Focus Previous Cursor"), + metadata: { + description: localize(1297, "Focuses the previous cursor"), + args: [] + }, + precondition: void 0 + }); + } + run(accessor, editor2, args) { + if (!editor2.hasModel()) { + return; + } + const viewModel = editor2._getViewModel(); + if (viewModel.cursorConfig.readOnly) { + return; + } + viewModel.model.pushStackElement(); + const previousCursorState = Array.from(viewModel.getCursorStates()); + const firstCursor = previousCursorState.pop(); + if (!firstCursor) { + return; + } + previousCursorState.unshift(firstCursor); + viewModel.setCursorStates(args.source, 3, previousCursorState); + viewModel.revealPrimaryCursor(args.source, true); + announceCursorChange(previousCursorState, viewModel.getCursorStates()); + } +}; +registerEditorContribution( + MultiCursorSelectionController.ID, + MultiCursorSelectionController, + 4 + /* EditorContributionInstantiation.Lazy */ +); +registerEditorContribution( + SelectionHighlighter.ID, + SelectionHighlighter, + 1 + /* EditorContributionInstantiation.AfterFirstRender */ +); +registerEditorAction(InsertCursorAbove); +registerEditorAction(InsertCursorBelow); +registerEditorAction(InsertCursorAtEndOfEachLineSelected); +registerEditorAction(AddSelectionToNextFindMatchAction); +registerEditorAction(AddSelectionToPreviousFindMatchAction); +registerEditorAction(MoveSelectionToNextFindMatchAction); +registerEditorAction(MoveSelectionToPreviousFindMatchAction); +registerEditorAction(SelectHighlightsAction); +registerEditorAction(CompatChangeAll); +registerEditorAction(InsertCursorAtEndOfLineSelected); +registerEditorAction(InsertCursorAtTopOfLineSelected); +registerEditorAction(FocusNextCursor); +registerEditorAction(FocusPreviousCursor); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/parameterHints/browser/parameterHints.js +init_lazy(); +init_lifecycle(); +init_editorExtensions(); +init_editorContextKeys(); +init_languages(); +init_languageFeatures(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/parameterHints/browser/parameterHintsModel.js +init_async(); +init_errors(); +init_event(); +init_lifecycle(); +init_characterClassifier(); +init_languages(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/parameterHints/browser/provideSignatureHelp.js +init_cancellation(); +init_errors(); +init_types(); +init_uri(); +init_position(); +init_languages(); +init_languageFeatures(); +init_resolverService(); +init_commands(); +init_contextkey(); +var Context2 = { + Visible: new RawContextKey("parameterHintsVisible", false), + MultipleSignatures: new RawContextKey("parameterHintsMultipleSignatures", false) +}; +async function provideSignatureHelp(registry, model, position, context, token) { + const supports = registry.ordered(model); + for (const support of supports) { + try { + const result = await support.provideSignatureHelp(model, position, token, context); + if (result) { + return result; + } + } catch (err) { + onUnexpectedExternalError(err); + } + } + return void 0; +} +CommandsRegistry.registerCommand("_executeSignatureHelpProvider", async (accessor, ...args) => { + const [uri, position, triggerCharacter] = args; + assertType(URI.isUri(uri)); + assertType(Position.isIPosition(position)); + assertType(typeof triggerCharacter === "string" || !triggerCharacter); + const languageFeaturesService = accessor.get(ILanguageFeaturesService); + const ref = await accessor.get(ITextModelService).createModelReference(uri); + try { + const result = await provideSignatureHelp(languageFeaturesService.signatureHelpProvider, ref.object.textEditorModel, Position.lift(position), { + triggerKind: SignatureHelpTriggerKind.Invoke, + isRetrigger: false, + triggerCharacter + }, CancellationToken.None); + if (!result) { + return void 0; + } + setTimeout(() => result.dispose(), 0); + return result.value; + } finally { + ref.dispose(); + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/parameterHints/browser/parameterHintsModel.js +var ParameterHintState; +(function(ParameterHintState2) { + ParameterHintState2.Default = { + type: 0 + /* Type.Default */ + }; + class Pending { + constructor(request, previouslyActiveHints) { + this.request = request; + this.previouslyActiveHints = previouslyActiveHints; + this.type = 2; + } + } + ParameterHintState2.Pending = Pending; + class Active { + constructor(hints) { + this.hints = hints; + this.type = 1; + } + } + ParameterHintState2.Active = Active; +})(ParameterHintState || (ParameterHintState = {})); +var ParameterHintsModel = class _ParameterHintsModel extends Disposable { + static { + this.DEFAULT_DELAY = 120; + } + // ms + constructor(editor2, providers, delay = _ParameterHintsModel.DEFAULT_DELAY) { + super(); + this._onChangedHints = this._register(new Emitter()); + this.onChangedHints = this._onChangedHints.event; + this.triggerOnType = false; + this._state = ParameterHintState.Default; + this._pendingTriggers = []; + this._lastSignatureHelpResult = this._register(new MutableDisposable()); + this.triggerChars = new CharacterSet(); + this.retriggerChars = new CharacterSet(); + this.triggerId = 0; + this.editor = editor2; + this.providers = providers; + this.throttledDelayer = new Delayer(delay); + this._register(this.editor.onDidBlurEditorWidget(() => this.cancel())); + this._register(this.editor.onDidChangeConfiguration(() => this.onEditorConfigurationChange())); + this._register(this.editor.onDidChangeModel((e) => this.onModelChanged())); + this._register(this.editor.onDidChangeModelLanguage((_) => this.onModelChanged())); + this._register(this.editor.onDidChangeCursorSelection((e) => this.onCursorChange(e))); + this._register(this.editor.onDidChangeModelContent((e) => this.onModelContentChange())); + this._register(this.providers.onDidChange(this.onModelChanged, this)); + this._register(this.editor.onDidType((text2) => this.onDidType(text2))); + this.onEditorConfigurationChange(); + this.onModelChanged(); + } + get state() { + return this._state; + } + set state(value) { + if (this._state.type === 2) { + this._state.request.cancel(); + } + this._state = value; + } + cancel(silent = false) { + this.state = ParameterHintState.Default; + this.throttledDelayer.cancel(); + if (!silent) { + this._onChangedHints.fire(void 0); + } + } + trigger(context, delay) { + const model = this.editor.getModel(); + if (!model || !this.providers.has(model)) { + return; + } + const triggerId = ++this.triggerId; + this._pendingTriggers.push(context); + this.throttledDelayer.trigger(() => { + return this.doTrigger(triggerId); + }, delay).catch(onUnexpectedError); + } + next() { + if (this.state.type !== 1) { + return; + } + const length = this.state.hints.signatures.length; + const activeSignature = this.state.hints.activeSignature; + const last = activeSignature % length === length - 1; + const cycle = this.editor.getOption( + 98 + /* EditorOption.parameterHints */ + ).cycle; + if ((length < 2 || last) && !cycle) { + this.cancel(); + return; + } + this.updateActiveSignature(last && cycle ? 0 : activeSignature + 1); + } + previous() { + if (this.state.type !== 1) { + return; + } + const length = this.state.hints.signatures.length; + const activeSignature = this.state.hints.activeSignature; + const first2 = activeSignature === 0; + const cycle = this.editor.getOption( + 98 + /* EditorOption.parameterHints */ + ).cycle; + if ((length < 2 || first2) && !cycle) { + this.cancel(); + return; + } + this.updateActiveSignature(first2 && cycle ? length - 1 : activeSignature - 1); + } + updateActiveSignature(activeSignature) { + if (this.state.type !== 1) { + return; + } + this.state = new ParameterHintState.Active({ ...this.state.hints, activeSignature }); + this._onChangedHints.fire(this.state.hints); + } + async doTrigger(triggerId) { + const isRetrigger = this.state.type === 1 || this.state.type === 2; + const activeSignatureHelp = this.getLastActiveHints(); + this.cancel(true); + if (this._pendingTriggers.length === 0) { + return false; + } + const context = this._pendingTriggers.reduce(mergeTriggerContexts); + this._pendingTriggers = []; + const triggerContext = { + triggerKind: context.triggerKind, + triggerCharacter: context.triggerCharacter, + isRetrigger, + activeSignatureHelp + }; + if (!this.editor.hasModel()) { + return false; + } + const model = this.editor.getModel(); + const position = this.editor.getPosition(); + this.state = new ParameterHintState.Pending(createCancelablePromise((token) => provideSignatureHelp(this.providers, model, position, triggerContext, token)), activeSignatureHelp); + try { + const result = await this.state.request; + if (triggerId !== this.triggerId) { + result?.dispose(); + return false; + } + if (!result || !result.value.signatures || result.value.signatures.length === 0) { + result?.dispose(); + this._lastSignatureHelpResult.clear(); + this.cancel(); + return false; + } else { + this.state = new ParameterHintState.Active(result.value); + this._lastSignatureHelpResult.value = result; + this._onChangedHints.fire(this.state.hints); + return true; + } + } catch (error) { + if (triggerId === this.triggerId) { + this.state = ParameterHintState.Default; + } + onUnexpectedError(error); + return false; + } + } + getLastActiveHints() { + switch (this.state.type) { + case 1: + return this.state.hints; + case 2: + return this.state.previouslyActiveHints; + default: + return void 0; + } + } + get isTriggered() { + return this.state.type === 1 || this.state.type === 2 || this.throttledDelayer.isTriggered(); + } + onModelChanged() { + this.cancel(); + this.triggerChars.clear(); + this.retriggerChars.clear(); + const model = this.editor.getModel(); + if (!model) { + return; + } + for (const support of this.providers.ordered(model)) { + for (const ch of support.signatureHelpTriggerCharacters || []) { + if (ch.length) { + const charCode = ch.charCodeAt(0); + this.triggerChars.add(charCode); + this.retriggerChars.add(charCode); + } + } + for (const ch of support.signatureHelpRetriggerCharacters || []) { + if (ch.length) { + this.retriggerChars.add(ch.charCodeAt(0)); + } + } + } + } + onDidType(text2) { + if (!this.triggerOnType) { + return; + } + const lastCharIndex = text2.length - 1; + const triggerCharCode = text2.charCodeAt(lastCharIndex); + if (this.triggerChars.has(triggerCharCode) || this.isTriggered && this.retriggerChars.has(triggerCharCode)) { + this.trigger({ + triggerKind: SignatureHelpTriggerKind.TriggerCharacter, + triggerCharacter: text2.charAt(lastCharIndex) + }); + } + } + onCursorChange(e) { + if (e.source === "mouse") { + this.cancel(); + } else if (this.isTriggered) { + this.trigger({ triggerKind: SignatureHelpTriggerKind.ContentChange }); + } + } + onModelContentChange() { + if (this.isTriggered) { + this.trigger({ triggerKind: SignatureHelpTriggerKind.ContentChange }); + } + } + onEditorConfigurationChange() { + this.triggerOnType = this.editor.getOption( + 98 + /* EditorOption.parameterHints */ + ).enabled; + if (!this.triggerOnType) { + this.cancel(); + } + } + dispose() { + this.cancel(true); + super.dispose(); + } +}; +function mergeTriggerContexts(previous, current) { + switch (current.triggerKind) { + case SignatureHelpTriggerKind.Invoke: + return current; + case SignatureHelpTriggerKind.ContentChange: + return previous; + case SignatureHelpTriggerKind.TriggerCharacter: + default: + return current; + } +} + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/parameterHints/browser/parameterHints.js +init_nls(); +init_contextkey(); +init_instantiation(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.js +init_dom(); +init_codicons(); +init_event(); +init_lifecycle(); +init_strings(); +init_types(); +init_nls(); +init_contextkey(); +init_colorRegistry(); +init_themables(); +var __decorate141 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param135 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var ParameterHintsWidget_1; +var $16 = $; +var parameterHintsNextIcon = registerIcon("parameter-hints-next", Codicon.chevronDown, localize(1312, "Icon for show next parameter hint.")); +var parameterHintsPreviousIcon = registerIcon("parameter-hints-previous", Codicon.chevronUp, localize(1313, "Icon for show previous parameter hint.")); +var ParameterHintsWidget = class ParameterHintsWidget2 extends Disposable { + static { + ParameterHintsWidget_1 = this; + } + static { + this.ID = "editor.widget.parameterHintsWidget"; + } + constructor(editor2, model, contextKeyService, markdownRendererService) { + super(); + this.editor = editor2; + this.model = model; + this.markdownRendererService = markdownRendererService; + this.renderDisposeables = this._register(new DisposableStore()); + this.visible = false; + this.announcedLabel = null; + this.allowEditorOverflow = true; + this.keyVisible = Context2.Visible.bindTo(contextKeyService); + this.keyMultipleSignatures = Context2.MultipleSignatures.bindTo(contextKeyService); + } + createParameterHintDOMNodes() { + const element = $16(".editor-widget.parameter-hints-widget"); + const wrapper = append(element, $16(".phwrapper")); + wrapper.tabIndex = -1; + const controls = append(wrapper, $16(".controls")); + const previous = append(controls, $16(".button" + ThemeIcon.asCSSSelector(parameterHintsPreviousIcon))); + const overloads = append(controls, $16(".overloads")); + const next = append(controls, $16(".button" + ThemeIcon.asCSSSelector(parameterHintsNextIcon))); + this._register(addDisposableListener(previous, "click", (e) => { + EventHelper.stop(e); + this.previous(); + })); + this._register(addDisposableListener(next, "click", (e) => { + EventHelper.stop(e); + this.next(); + })); + const body = $16(".body"); + const scrollbar = new DomScrollableElement(body, { + alwaysConsumeMouseWheel: true + }); + this._register(scrollbar); + wrapper.appendChild(scrollbar.getDomNode()); + const signature = append(body, $16(".signature")); + const docs = append(body, $16(".docs")); + element.style.userSelect = "text"; + this.domNodes = { + element, + signature, + overloads, + docs, + scrollbar + }; + this.editor.addContentWidget(this); + this.hide(); + this._register(this.editor.onDidChangeCursorSelection((e) => { + if (this.visible) { + this.editor.layoutContentWidget(this); + } + })); + const updateFont = () => { + if (!this.domNodes) { + return; + } + const fontInfo = this.editor.getOption( + 59 + /* EditorOption.fontInfo */ + ); + const element2 = this.domNodes.element; + element2.style.fontSize = `${fontInfo.fontSize}px`; + element2.style.lineHeight = `${fontInfo.lineHeight / fontInfo.fontSize}`; + element2.style.setProperty("--vscode-parameterHintsWidget-editorFontFamily", fontInfo.fontFamily); + element2.style.setProperty("--vscode-parameterHintsWidget-editorFontFamilyDefault", EDITOR_FONT_DEFAULTS.fontFamily); + }; + updateFont(); + this._register(Event.chain(this.editor.onDidChangeConfiguration.bind(this.editor), ($23) => $23.filter((e) => e.hasChanged( + 59 + /* EditorOption.fontInfo */ + )))(updateFont)); + this._register(this.editor.onDidLayoutChange((e) => this.updateMaxHeight())); + this.updateMaxHeight(); + } + show() { + if (this.visible) { + return; + } + if (!this.domNodes) { + this.createParameterHintDOMNodes(); + } + this.keyVisible.set(true); + this.visible = true; + setTimeout(() => { + this.domNodes?.element.classList.add("visible"); + }, 100); + this.editor.layoutContentWidget(this); + } + hide() { + this.renderDisposeables.clear(); + if (!this.visible) { + return; + } + this.keyVisible.reset(); + this.visible = false; + this.announcedLabel = null; + this.domNodes?.element.classList.remove("visible"); + this.editor.layoutContentWidget(this); + } + getPosition() { + if (this.visible) { + return { + position: this.editor.getPosition(), + preference: [ + 1, + 2 + /* ContentWidgetPositionPreference.BELOW */ + ] + }; + } + return null; + } + render(hints) { + this.renderDisposeables.clear(); + if (!this.domNodes) { + return; + } + const multiple = hints.signatures.length > 1; + this.domNodes.element.classList.toggle("multiple", multiple); + this.keyMultipleSignatures.set(multiple); + this.domNodes.signature.innerText = ""; + this.domNodes.docs.innerText = ""; + const signature = hints.signatures[hints.activeSignature]; + if (!signature) { + return; + } + const code = append(this.domNodes.signature, $16(".code")); + const hasParameters = signature.parameters.length > 0; + const activeParameterIndex = signature.activeParameter ?? hints.activeParameter; + if (!hasParameters) { + const label = append(code, $16("span")); + label.textContent = signature.label; + } else { + this.renderParameters(code, signature, activeParameterIndex); + } + const activeParameter = signature.parameters[activeParameterIndex]; + if (activeParameter?.documentation) { + const documentation = $16("span.documentation"); + if (typeof activeParameter.documentation === "string") { + documentation.textContent = activeParameter.documentation; + } else { + const renderedContents = this.renderMarkdownDocs(activeParameter.documentation); + documentation.appendChild(renderedContents.element); + } + append(this.domNodes.docs, $16("p", {}, documentation)); + } + if (signature.documentation === void 0) { + } else if (typeof signature.documentation === "string") { + append(this.domNodes.docs, $16("p", {}, signature.documentation)); + } else { + const renderedContents = this.renderMarkdownDocs(signature.documentation); + append(this.domNodes.docs, renderedContents.element); + } + const hasDocs = this.hasDocs(signature, activeParameter); + this.domNodes.signature.classList.toggle("has-docs", hasDocs); + this.domNodes.docs.classList.toggle("empty", !hasDocs); + this.domNodes.overloads.textContent = String(hints.activeSignature + 1).padStart(hints.signatures.length.toString().length, "0") + "/" + hints.signatures.length; + if (activeParameter) { + let labelToAnnounce = ""; + const param = signature.parameters[activeParameterIndex]; + if (Array.isArray(param.label)) { + labelToAnnounce = signature.label.substring(param.label[0], param.label[1]); + } else { + labelToAnnounce = param.label; + } + if (param.documentation) { + labelToAnnounce += typeof param.documentation === "string" ? `, ${param.documentation}` : `, ${param.documentation.value}`; + } + if (signature.documentation) { + labelToAnnounce += typeof signature.documentation === "string" ? `, ${signature.documentation}` : `, ${signature.documentation.value}`; + } + if (this.announcedLabel !== labelToAnnounce) { + alert(localize(1314, "{0}, hint", labelToAnnounce)); + this.announcedLabel = labelToAnnounce; + } + } + this.editor.layoutContentWidget(this); + this.domNodes.scrollbar.scanDomNode(); + } + renderMarkdownDocs(markdown) { + const renderedContents = this.renderDisposeables.add(this.markdownRendererService.render(markdown, { + context: this.editor, + asyncRenderCallback: () => { + this.domNodes?.scrollbar.scanDomNode(); + } + })); + renderedContents.element.classList.add("markdown-docs"); + return renderedContents; + } + hasDocs(signature, activeParameter) { + if (activeParameter && typeof activeParameter.documentation === "string" && assertReturnsDefined(activeParameter.documentation).length > 0) { + return true; + } + if (activeParameter && typeof activeParameter.documentation === "object" && assertReturnsDefined(activeParameter.documentation).value.length > 0) { + return true; + } + if (signature.documentation && typeof signature.documentation === "string" && assertReturnsDefined(signature.documentation).length > 0) { + return true; + } + if (signature.documentation && typeof signature.documentation === "object" && assertReturnsDefined(signature.documentation.value).length > 0) { + return true; + } + return false; + } + renderParameters(parent, signature, activeParameterIndex) { + const [start, end] = this.getParameterLabelOffsets(signature, activeParameterIndex); + const beforeSpan = document.createElement("span"); + beforeSpan.textContent = signature.label.substring(0, start); + const paramSpan = document.createElement("span"); + paramSpan.textContent = signature.label.substring(start, end); + paramSpan.className = "parameter active"; + const afterSpan = document.createElement("span"); + afterSpan.textContent = signature.label.substring(end); + append(parent, beforeSpan, paramSpan, afterSpan); + } + getParameterLabelOffsets(signature, paramIdx) { + const param = signature.parameters[paramIdx]; + if (!param) { + return [0, 0]; + } else if (Array.isArray(param.label)) { + return param.label; + } else if (!param.label.length) { + return [0, 0]; + } else { + const regex = new RegExp(`(\\W|^)${escapeRegExpCharacters(param.label)}(?=\\W|$)`, "g"); + regex.test(signature.label); + const idx = regex.lastIndex - param.label.length; + return idx >= 0 ? [idx, regex.lastIndex] : [0, 0]; + } + } + next() { + this.editor.focus(); + this.model.next(); + } + previous() { + this.editor.focus(); + this.model.previous(); + } + getDomNode() { + if (!this.domNodes) { + this.createParameterHintDOMNodes(); + } + return this.domNodes.element; + } + getId() { + return ParameterHintsWidget_1.ID; + } + updateMaxHeight() { + if (!this.domNodes) { + return; + } + const height = Math.max(this.editor.getLayoutInfo().height / 4, 250); + const maxHeight = `${height}px`; + this.domNodes.element.style.maxHeight = maxHeight; + const wrapper = this.domNodes.element.getElementsByClassName("phwrapper"); + if (wrapper.length) { + wrapper[0].style.maxHeight = maxHeight; + } + } +}; +ParameterHintsWidget = ParameterHintsWidget_1 = __decorate141([ + __param135(2, IContextKeyService), + __param135(3, IMarkdownRendererService) +], ParameterHintsWidget); +registerColor("editorHoverWidget.highlightForeground", listHighlightForeground, localize(1315, "Foreground color of the active item in the parameter hint.")); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/parameterHints/browser/parameterHints.js +var __decorate142 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param136 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var ParameterHintsController_1; +var ParameterHintsController = class ParameterHintsController2 extends Disposable { + static { + ParameterHintsController_1 = this; + } + static { + this.ID = "editor.controller.parameterHints"; + } + static get(editor2) { + return editor2.getContribution(ParameterHintsController_1.ID); + } + constructor(editor2, instantiationService, languageFeaturesService) { + super(); + this.editor = editor2; + this.model = this._register(new ParameterHintsModel(editor2, languageFeaturesService.signatureHelpProvider)); + this._register(this.model.onChangedHints((newParameterHints) => { + if (newParameterHints) { + this.widget.value.show(); + this.widget.value.render(newParameterHints); + } else { + this.widget.rawValue?.hide(); + } + })); + this.widget = new Lazy(() => this._register(instantiationService.createInstance(ParameterHintsWidget, this.editor, this.model))); + } + cancel() { + this.model.cancel(); + } + previous() { + this.widget.rawValue?.previous(); + } + next() { + this.widget.rawValue?.next(); + } + trigger(context) { + this.model.trigger(context, 0); + } +}; +ParameterHintsController = ParameterHintsController_1 = __decorate142([ + __param136(1, IInstantiationService), + __param136(2, ILanguageFeaturesService) +], ParameterHintsController); +var TriggerParameterHintsAction = class extends EditorAction { + constructor() { + super({ + id: "editor.action.triggerParameterHints", + label: localize2(1311, "Trigger Parameter Hints"), + precondition: EditorContextKeys.hasSignatureHelpProvider, + kbOpts: { + kbExpr: EditorContextKeys.editorTextFocus, + primary: 2048 | 1024 | 10, + weight: 100 + /* KeybindingWeight.EditorContrib */ + } + }); + } + run(accessor, editor2) { + const controller = ParameterHintsController.get(editor2); + controller?.trigger({ + triggerKind: SignatureHelpTriggerKind.Invoke + }); + } +}; +registerEditorContribution( + ParameterHintsController.ID, + ParameterHintsController, + 2 + /* EditorContributionInstantiation.BeforeFirstInteraction */ +); +registerEditorAction(TriggerParameterHintsAction); +var weight3 = 100 + 75; +var ParameterHintsCommand = EditorCommand.bindToContribution(ParameterHintsController.get); +registerEditorCommand(new ParameterHintsCommand({ + id: "closeParameterHints", + precondition: Context2.Visible, + handler: (x) => x.cancel(), + kbOpts: { + weight: weight3, + kbExpr: EditorContextKeys.focus, + primary: 9, + secondary: [ + 1024 | 9 + /* KeyCode.Escape */ + ] + } +})); +registerEditorCommand(new ParameterHintsCommand({ + id: "showPrevParameterHint", + precondition: ContextKeyExpr.and(Context2.Visible, Context2.MultipleSignatures), + handler: (x) => x.previous(), + kbOpts: { + weight: weight3, + kbExpr: EditorContextKeys.focus, + primary: 16, + secondary: [ + 512 | 16 + /* KeyCode.UpArrow */ + ], + mac: { primary: 16, secondary: [ + 512 | 16, + 256 | 46 + /* KeyCode.KeyP */ + ] } + } +})); +registerEditorCommand(new ParameterHintsCommand({ + id: "showNextParameterHint", + precondition: ContextKeyExpr.and(Context2.Visible, Context2.MultipleSignatures), + handler: (x) => x.next(), + kbOpts: { + weight: weight3, + kbExpr: EditorContextKeys.focus, + primary: 18, + secondary: [ + 512 | 18 + /* KeyCode.DownArrow */ + ], + mac: { primary: 18, secondary: [ + 512 | 18, + 256 | 44 + /* KeyCode.KeyN */ + ] } + } +})); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/placeholderText/browser/placeholderText.contribution.js +init_editorExtensions(); +init_editorColorRegistry(); +init_nls(); +init_colorUtils(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/placeholderText/browser/placeholderTextContribution.js +init_dom(); +init_equals(); +init_lifecycle(); +init_observable(); +init_observableCodeEditor(); +var PlaceholderTextContribution = class extends Disposable { + static { + this.ID = "editor.contrib.placeholderText"; + } + constructor(_editor) { + super(); + this._editor = _editor; + this._editorObs = observableCodeEditor(this._editor); + this._placeholderText = this._editorObs.getOption( + 100 + /* EditorOption.placeholder */ + ); + this._state = derivedOpts({ owner: this, equalsFn: structuralEquals }, (reader) => { + const p = this._placeholderText.read(reader); + if (!p) { + return void 0; + } + if (!this._editorObs.valueIsEmpty.read(reader)) { + return void 0; + } + return { placeholder: p }; + }); + this._shouldViewBeAlive = isOrWasTrue(this, (reader) => this._state.read(reader)?.placeholder !== void 0); + this._view = derived((reader) => { + if (!this._shouldViewBeAlive.read(reader)) { + return; + } + const element = h("div.editorPlaceholder"); + reader.store.add(autorun((reader2) => { + const data = this._state.read(reader2); + const shouldBeVisibile = data?.placeholder !== void 0; + element.root.style.display = shouldBeVisibile ? "block" : "none"; + element.root.innerText = data?.placeholder ?? ""; + })); + reader.store.add(autorun((reader2) => { + const info = this._editorObs.layoutInfo.read(reader2); + element.root.style.left = `${info.contentLeft}px`; + element.root.style.width = info.contentWidth - info.verticalScrollbarWidth + "px"; + element.root.style.top = `${this._editor.getTopForLineNumber(0)}px`; + })); + reader.store.add(autorun((reader2) => { + element.root.style.fontFamily = this._editorObs.getOption( + 58 + /* EditorOption.fontFamily */ + ).read(reader2); + element.root.style.fontSize = this._editorObs.getOption( + 61 + /* EditorOption.fontSize */ + ).read(reader2) + "px"; + element.root.style.lineHeight = this._editorObs.getOption( + 75 + /* EditorOption.lineHeight */ + ).read(reader2) + "px"; + })); + reader.store.add(this._editorObs.createOverlayWidget({ + allowEditorOverflow: false, + minContentWidthInPx: constObservable(0), + position: constObservable(null), + domNode: element.root + })); + }); + this._view.recomputeInitiallyAndOnChange(this._store); + } +}; +function isOrWasTrue(owner, fn) { + return derivedObservableWithCache(owner, (reader, lastValue) => { + if (lastValue === true) { + return true; + } + return fn(reader); + }); +} + +// node_modules/monaco-editor-core/esm/vs/platform/observable/common/wrapInReloadableClass.js +init_observable(); +init_instantiation(); +var __decorate143 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param137 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var BaseClass2 = class { + constructor(instantiationService) { + this.instantiationService = instantiationService; + } + init(...params) { + } +}; +function createWrapper2(getClass, B) { + return class ReloadableWrapper extends B { + constructor() { + super(...arguments); + this._autorun = void 0; + } + init(...params) { + this._autorun = autorunWithStore((reader, store) => { + const clazz = readHotReloadableExport(getClass(), reader); + store.add(this.instantiationService.createInstance(clazz, ...params)); + }); + } + dispose() { + this._autorun?.dispose(); + } + }; +} +function wrapInReloadableClass1(getClass) { + return !isHotReloadEnabled() ? getClass() : createWrapper2(getClass, BaseClass13); +} +var BaseClass13 = class BaseClass14 extends BaseClass2 { + constructor(param1, i2) { + super(i2); + this.init(param1); + } +}; +BaseClass13 = __decorate143([ + __param137(1, IInstantiationService) +], BaseClass13); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/placeholderText/browser/placeholderText.contribution.js +registerEditorContribution( + PlaceholderTextContribution.ID, + wrapInReloadableClass1(() => PlaceholderTextContribution), + 0 + /* EditorContributionInstantiation.Eager */ +); +registerColor("editor.placeholder.foreground", ghostTextForeground, localize(1334, "Foreground color of the placeholder text in the editor.")); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/rename/browser/rename.js +init_async(); +init_cancellation(); +init_errors(); +init_htmlContent(); +init_lifecycle(); +init_types(); +init_uri(); +init_nls(); +init_actions2(); +init_configurationRegistry(); +init_contextkey(); +init_instantiation(); +init_log(); +init_platform2(); +init_editorExtensions(); +init_codeEditorService(); +init_position(); +init_range(); +init_editorContextKeys(); +init_languages(); +init_languageFeatures(); + +// node_modules/monaco-editor-core/esm/vs/editor/common/services/textResourceConfiguration.js +init_instantiation(); +var ITextResourceConfigurationService = createDecorator("textResourceConfigurationService"); +var ITextResourcePropertiesService = createDecorator("textResourcePropertiesService"); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/rename/browser/rename.js +init_textModelEditSource(); +init_editorState(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/rename/browser/renameWidget.js +init_dom(); +init_keyboardEvent(); +init_iconLabels2(); +init_arrays(); +init_async(); +init_cancellation(); +init_codicons(); +init_event(); +init_lifecycle(); +init_stopwatch(); +init_types(); +init_position(); +init_range(); +init_languages(); +init_nls(); +init_contextkey(); +init_log(); +init_colorRegistry(); +init_themeService(); +var __decorate144 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param138 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var _sticky4 = false; +var CONTEXT_RENAME_INPUT_VISIBLE = new RawContextKey("renameInputVisible", false, localize(1391, "Whether the rename input widget is visible")); +var CONTEXT_RENAME_INPUT_FOCUSED = new RawContextKey("renameInputFocused", false, localize(1392, "Whether the rename input widget is focused")); +var RenameWidget = class RenameWidget2 { + constructor(_editor, _acceptKeybindings, _themeService, _keybindingService, contextKeyService, _logService) { + this._editor = _editor; + this._acceptKeybindings = _acceptKeybindings; + this._themeService = _themeService; + this._keybindingService = _keybindingService; + this._logService = _logService; + this.allowEditorOverflow = true; + this._disposables = new DisposableStore(); + this._visibleContextKey = CONTEXT_RENAME_INPUT_VISIBLE.bindTo(contextKeyService); + this._isEditingRenameCandidate = false; + this._nRenameSuggestionsInvocations = 0; + this._hadAutomaticRenameSuggestionsInvocation = false; + this._candidates = /* @__PURE__ */ new Set(); + this._beforeFirstInputFieldEditSW = new StopWatch(); + this._inputWithButton = new InputWithButton(); + this._disposables.add(this._inputWithButton); + this._editor.addContentWidget(this); + this._disposables.add(this._editor.onDidChangeConfiguration((e) => { + if (e.hasChanged( + 59 + /* EditorOption.fontInfo */ + )) { + this._updateFont(); + } + })); + this._disposables.add(_themeService.onDidColorThemeChange(this._updateStyles, this)); + } + dispose() { + this._disposables.dispose(); + this._editor.removeContentWidget(this); + } + getId() { + return "__renameInputWidget"; + } + getDomNode() { + if (!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 RenameCandidateListView(this._domNode, { + fontInfo: this._editor.getOption( + 59 + /* EditorOption.fontInfo */ + ), + onFocusChange: (newSymbolName) => { + this._inputWithButton.input.value = newSymbolName; + this._isEditingRenameCandidate = false; + }, + onSelectionChange: () => { + this._isEditingRenameCandidate = false; + this.acceptInput(false); + } + })); + this._disposables.add(this._inputWithButton.onDidInputChange(() => { + if (this._renameCandidateListView?.focusedCandidate !== void 0) { + this._isEditingRenameCandidate = true; + } + this._timeBeforeFirstInputFieldEdit ??= this._beforeFirstInputFieldEditSW.elapsed(); + if (this._renameCandidateProvidersCts?.token.isCancellationRequested === false) { + this._renameCandidateProvidersCts.cancel(); + } + this._renameCandidateListView?.clearFocus(); + })); + this._label = document.createElement("div"); + this._label.className = "rename-label"; + this._domNode.appendChild(this._label); + this._updateFont(); + this._updateStyles(this._themeService.getColorTheme()); + } + return this._domNode; + } + _updateStyles(theme) { + if (!this._domNode) { + return; + } + const widgetShadowColor = theme.getColor(widgetShadow); + const widgetBorderColor = theme.getColor(widgetBorder); + this._domNode.style.backgroundColor = String(theme.getColor(editorWidgetBackground) ?? ""); + this._domNode.style.boxShadow = widgetShadowColor ? ` 0 0 8px 2px ${widgetShadowColor}` : ""; + this._domNode.style.border = widgetBorderColor ? `1px solid ${widgetBorderColor}` : ""; + this._domNode.style.color = String(theme.getColor(inputForeground) ?? ""); + const border = theme.getColor(inputBorder); + this._inputWithButton.domNode.style.backgroundColor = String(theme.getColor(inputBackground) ?? ""); + this._inputWithButton.input.style.backgroundColor = String(theme.getColor(inputBackground) ?? ""); + this._inputWithButton.domNode.style.borderWidth = border ? "1px" : "0px"; + this._inputWithButton.domNode.style.borderStyle = border ? "solid" : "none"; + this._inputWithButton.domNode.style.borderColor = border?.toString() ?? "none"; + } + _updateFont() { + if (this._domNode === void 0) { + return; + } + assertType(this._label !== void 0, "RenameWidget#_updateFont: _label must not be undefined given _domNode is defined"); + this._editor.applyFontInfo(this._inputWithButton.input); + const fontInfo = this._editor.getOption( + 59 + /* EditorOption.fontInfo */ + ); + this._label.style.fontSize = `${this._computeLabelFontSize(fontInfo.fontSize)}px`; + } + _computeLabelFontSize(editorFontSize) { + return editorFontSize * 0.8; + } + getPosition() { + if (!this._visible) { + return null; + } + if (!this._editor.hasModel() || // @ulugbekna: shouldn't happen + !this._editor.getDomNode()) { + return null; + } + const bodyBox = getClientArea(this.getDomNode().ownerDocument.body); + const editorBox = getDomNodePagePosition(this._editor.getDomNode()); + const cursorBoxTop = this._getTopForPosition(); + this._nPxAvailableAbove = cursorBoxTop + editorBox.top; + this._nPxAvailableBelow = bodyBox.height - this._nPxAvailableAbove; + const lineHeight = this._editor.getOption( + 75 + /* EditorOption.lineHeight */ + ); + const { totalHeight: candidateViewHeight } = RenameCandidateView.getLayoutInfo({ lineHeight }); + const positionPreference = this._nPxAvailableBelow > candidateViewHeight * 6 ? [ + 2, + 1 + /* ContentWidgetPositionPreference.ABOVE */ + ] : [ + 1, + 2 + /* ContentWidgetPositionPreference.BELOW */ + ]; + return { + position: this._position, + preference: positionPreference + }; + } + beforeRender() { + const [accept, preview] = this._acceptKeybindings; + this._label.innerText = localize(1393, "{0} to Rename, {1} to Preview", this._keybindingService.lookupKeybinding(accept)?.getLabel(), this._keybindingService.lookupKeybinding(preview)?.getLabel()); + this._domNode.style.minWidth = `200px`; + return null; + } + afterRender(position) { + if (position === null) { + this.cancelInput(true, "afterRender (because position is null)"); + return; + } + if (!this._editor.hasModel() || // shouldn't happen + !this._editor.getDomNode()) { + return; + } + assertType(this._renameCandidateListView); + assertType(this._nPxAvailableAbove !== void 0); + assertType(this._nPxAvailableBelow !== void 0); + const inputBoxHeight = getTotalHeight(this._inputWithButton.domNode); + const labelHeight = getTotalHeight(this._label); + let totalHeightAvailable; + if (position === 2) { + totalHeightAvailable = this._nPxAvailableBelow; + } else { + totalHeightAvailable = this._nPxAvailableAbove; + } + this._renameCandidateListView.layout({ + height: totalHeightAvailable - labelHeight - inputBoxHeight, + width: getTotalWidth(this._inputWithButton.domNode) + }); + } + acceptInput(wantsPreview) { + this._trace(`invoking acceptInput`); + this._currentAcceptInput?.(wantsPreview); + } + cancelInput(focusEditor, caller) { + this._currentCancelInput?.(focusEditor); + } + focusNextRenameSuggestion() { + if (!this._renameCandidateListView?.focusNext()) { + this._inputWithButton.input.value = this._currentName; + } + } + focusPreviousRenameSuggestion() { + if (!this._renameCandidateListView?.focusPrevious()) { + this._inputWithButton.input.value = this._currentName; + } + } + /** + * @param requestRenameCandidates is `undefined` when there are no rename suggestion providers + */ + getInput(where, currentName, supportPreview, requestRenameCandidates, cts) { + const { start: selectionStart, end: selectionEnd } = this._getSelection(where, currentName); + this._renameCts = cts; + const disposeOnDone = new DisposableStore(); + this._nRenameSuggestionsInvocations = 0; + this._hadAutomaticRenameSuggestionsInvocation = false; + if (requestRenameCandidates === void 0) { + this._inputWithButton.button.style.display = "none"; + } else { + this._inputWithButton.button.style.display = "flex"; + this._requestRenameCandidatesOnce = requestRenameCandidates; + this._requestRenameCandidates(currentName, false); + disposeOnDone.add(addDisposableListener(this._inputWithButton.button, "click", () => this._requestRenameCandidates(currentName, true))); + disposeOnDone.add(addDisposableListener(this._inputWithButton.button, EventType.KEY_DOWN, (e) => { + const keyEvent = new StandardKeyboardEvent(e); + if (keyEvent.equals( + 3 + /* KeyCode.Enter */ + ) || keyEvent.equals( + 10 + /* KeyCode.Space */ + )) { + keyEvent.stopPropagation(); + keyEvent.preventDefault(); + this._requestRenameCandidates(currentName, true); + } + })); + } + this._isEditingRenameCandidate = false; + this._domNode.classList.toggle("preview", supportPreview); + this._position = new Position(where.startLineNumber, where.startColumn); + this._currentName = currentName; + this._inputWithButton.input.value = currentName; + this._inputWithButton.input.setAttribute("selectionStart", selectionStart.toString()); + this._inputWithButton.input.setAttribute("selectionEnd", selectionEnd.toString()); + this._inputWithButton.input.size = Math.max((where.endColumn - where.startColumn) * 1.1, 20); + this._beforeFirstInputFieldEditSW.reset(); + disposeOnDone.add(toDisposable(() => { + this._renameCts = void 0; + cts.dispose(true); + })); + disposeOnDone.add(toDisposable(() => { + if (this._renameCandidateProvidersCts !== void 0) { + this._renameCandidateProvidersCts.dispose(true); + this._renameCandidateProvidersCts = void 0; + } + })); + disposeOnDone.add(toDisposable(() => this._candidates.clear())); + const inputResult = new DeferredPromise(); + inputResult.p.finally(() => { + disposeOnDone.dispose(); + this._hide(); + }); + this._currentCancelInput = (focusEditor) => { + this._trace("invoking _currentCancelInput"); + this._currentAcceptInput = void 0; + this._currentCancelInput = void 0; + this._renameCandidateListView?.clearCandidates(); + inputResult.complete(focusEditor); + return true; + }; + this._currentAcceptInput = (wantsPreview) => { + this._trace("invoking _currentAcceptInput"); + assertType(this._renameCandidateListView !== void 0); + const nRenameSuggestions = this._renameCandidateListView.nCandidates; + let newName; + let source; + const focusedCandidate = this._renameCandidateListView.focusedCandidate; + if (focusedCandidate !== void 0) { + this._trace("using new name from renameSuggestion"); + newName = focusedCandidate; + source = { k: "renameSuggestion" }; + } else { + this._trace("using new name from inputField"); + newName = this._inputWithButton.input.value; + source = this._isEditingRenameCandidate ? { k: "userEditedRenameSuggestion" } : { k: "inputField" }; + } + if (newName === currentName || newName.trim().length === 0) { + this.cancelInput(true, "_currentAcceptInput (because newName === value || newName.trim().length === 0)"); + return; + } + this._currentAcceptInput = void 0; + this._currentCancelInput = void 0; + this._renameCandidateListView.clearCandidates(); + inputResult.complete({ + newName, + wantsPreview: supportPreview && wantsPreview, + stats: { + source, + nRenameSuggestions, + timeBeforeFirstInputFieldEdit: this._timeBeforeFirstInputFieldEdit, + nRenameSuggestionsInvocations: this._nRenameSuggestionsInvocations, + hadAutomaticRenameSuggestionsInvocation: this._hadAutomaticRenameSuggestionsInvocation + } + }); + }; + disposeOnDone.add(cts.token.onCancellationRequested(() => this.cancelInput(true, "cts.token.onCancellationRequested"))); + if (!_sticky4) { + disposeOnDone.add(this._editor.onDidBlurEditorWidget(() => this.cancelInput(!this._domNode?.ownerDocument.hasFocus(), "editor.onDidBlurEditorWidget"))); + } + this._show(); + return inputResult.p; + } + _requestRenameCandidates(currentName, isManuallyTriggered) { + if (this._requestRenameCandidatesOnce === void 0) { + return; + } + if (this._renameCandidateProvidersCts !== void 0) { + this._renameCandidateProvidersCts.dispose(true); + } + assertType(this._renameCts); + if (this._inputWithButton.buttonState !== "stop") { + this._renameCandidateProvidersCts = new CancellationTokenSource(); + const triggerKind = isManuallyTriggered ? NewSymbolNameTriggerKind.Invoke : NewSymbolNameTriggerKind.Automatic; + const candidates = this._requestRenameCandidatesOnce(triggerKind, this._renameCandidateProvidersCts.token); + if (candidates.length === 0) { + this._inputWithButton.setSparkleButton(); + return; + } + if (!isManuallyTriggered) { + this._hadAutomaticRenameSuggestionsInvocation = true; + } + this._nRenameSuggestionsInvocations += 1; + this._inputWithButton.setStopButton(); + this._updateRenameCandidates(candidates, currentName, this._renameCts.token); + } + } + /** + * This allows selecting only part of the symbol name in the input field based on the selection in the editor + */ + _getSelection(where, currentName) { + assertType(this._editor.hasModel()); + const selection = this._editor.getSelection(); + let start = 0; + let end = currentName.length; + if (!Range.isEmpty(selection) && !Range.spansMultipleLines(selection) && Range.containsRange(where, selection)) { + start = Math.max(0, selection.startColumn - where.startColumn); + end = Math.min(where.endColumn, selection.endColumn) - where.startColumn; + } + return { start, end }; + } + _show() { + this._trace("invoking _show"); + this._editor.revealLineInCenterIfOutsideViewport( + this._position.lineNumber, + 0 + /* ScrollType.Smooth */ + ); + this._visible = true; + this._visibleContextKey.set(true); + 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(candidates, currentName, token) { + const trace = (...args) => this._trace("_updateRenameCandidates", ...args); + trace("start"); + const namesListResults = await raceCancellation(Promise.allSettled(candidates), token); + this._inputWithButton.setSparkleButton(); + if (namesListResults === void 0) { + trace("returning early - received updateRenameCandidates results - undefined"); + return; + } + const newNames = namesListResults.flatMap((namesListResult) => namesListResult.status === "fulfilled" && isDefined(namesListResult.value) ? namesListResult.value : []); + trace(`received updateRenameCandidates results - total (unfiltered) ${newNames.length} candidates.`); + const distinctNames = distinct(newNames, (v) => v.newSymbolName); + trace(`distinct candidates - ${distinctNames.length} candidates.`); + const validDistinctNames = distinctNames.filter(({ newSymbolName }) => newSymbolName.trim().length > 0 && newSymbolName !== this._inputWithButton.input.value && newSymbolName !== currentName && !this._candidates.has(newSymbolName)); + trace(`valid distinct candidates - ${newNames.length} candidates.`); + validDistinctNames.forEach((n2) => this._candidates.add(n2.newSymbolName)); + if (validDistinctNames.length < 1) { + trace("returning early - no valid distinct candidates"); + return; + } + trace("setting candidates"); + this._renameCandidateListView.setCandidates(validDistinctNames); + trace("asking editor to re-layout"); + this._editor.layoutContentWidget(this); + } + _hide() { + this._trace("invoked _hide"); + this._visible = false; + this._visibleContextKey.reset(); + this._editor.layoutContentWidget(this); + } + _getTopForPosition() { + const visibleRanges = this._editor.getVisibleRanges(); + let firstLineInViewport; + if (visibleRanges.length > 0) { + firstLineInViewport = visibleRanges[0].startLineNumber; + } else { + this._logService.warn("RenameWidget#_getTopForPosition: this should not happen - visibleRanges is empty"); + firstLineInViewport = Math.max(1, this._position.lineNumber - 5); + } + return this._editor.getTopForLineNumber(this._position.lineNumber) - this._editor.getTopForLineNumber(firstLineInViewport); + } + _trace(...args) { + this._logService.trace("RenameWidget", ...args); + } +}; +RenameWidget = __decorate144([ + __param138(2, IThemeService), + __param138(3, IKeybindingService), + __param138(4, IContextKeyService), + __param138(5, ILogService) +], RenameWidget); +var RenameCandidateListView = class _RenameCandidateListView { + // FIXME@ulugbekna: rewrite using event emitters + constructor(parent, opts) { + this._disposables = new DisposableStore(); + this._availableHeight = 0; + this._minimumWidth = 0; + this._lineHeight = opts.fontInfo.lineHeight; + this._typicalHalfwidthCharacterWidth = opts.fontInfo.typicalHalfwidthCharacterWidth; + this._listContainer = document.createElement("div"); + this._listContainer.className = "rename-box rename-candidate-list-container"; + parent.appendChild(this._listContainer); + this._listWidget = _RenameCandidateListView._createListWidget(this._listContainer, this._candidateViewHeight, opts.fontInfo); + this._disposables.add(this._listWidget.onDidChangeFocus((e) => { + if (e.elements.length === 1) { + opts.onFocusChange(e.elements[0].newSymbolName); + } + }, this._disposables)); + this._disposables.add(this._listWidget.onDidChangeSelection((e) => { + if (e.elements.length === 1) { + opts.onSelectionChange(); + } + }, this._disposables)); + this._disposables.add(this._listWidget.onDidBlur((e) => { + this._listWidget.setFocus([]); + })); + this._listWidget.style(getListStyles({ + listInactiveFocusForeground: quickInputListFocusForeground, + listInactiveFocusBackground: quickInputListFocusBackground + })); + } + dispose() { + this._listWidget.dispose(); + this._disposables.dispose(); + } + // height - max height allowed by parent element + layout({ height, width: width2 }) { + this._availableHeight = height; + this._minimumWidth = width2; + } + setCandidates(candidates) { + this._listWidget.splice(0, 0, candidates); + const height = this._pickListHeight(this._listWidget.length); + const width2 = this._pickListWidth(candidates); + this._listWidget.layout(height, width2); + this._listContainer.style.height = `${height}px`; + this._listContainer.style.width = `${width2}px`; + status(localize(1394, "Received {0} rename suggestions", candidates.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 selectedElement = this._listWidget.getSelectedElements()[0]; + if (selectedElement !== void 0) { + return selectedElement.newSymbolName; + } + const focusedElement = this._listWidget.getFocusedElements()[0]; + if (focusedElement !== void 0) { + return focusedElement.newSymbolName; + } + return; + } + focusNext() { + if (this._listWidget.length === 0) { + return false; + } + const focusedIxs = this._listWidget.getFocus(); + if (focusedIxs.length === 0) { + this._listWidget.focusFirst(); + this._listWidget.reveal(0); + return true; + } else { + if (focusedIxs[0] === this._listWidget.length - 1) { + this._listWidget.setFocus([]); + this._listWidget.reveal(0); + return false; + } else { + this._listWidget.focusNext(); + const focused = this._listWidget.getFocus()[0]; + this._listWidget.reveal(focused); + return true; + } + } + } + /** + * @returns true if focus is moved to previous element + */ + focusPrevious() { + if (this._listWidget.length === 0) { + return false; + } + const focusedIxs = this._listWidget.getFocus(); + if (focusedIxs.length === 0) { + this._listWidget.focusLast(); + const focused = this._listWidget.getFocus()[0]; + this._listWidget.reveal(focused); + return true; + } else { + if (focusedIxs[0] === 0) { + this._listWidget.setFocus([]); + return false; + } else { + this._listWidget.focusPrevious(); + const focused = this._listWidget.getFocus()[0]; + this._listWidget.reveal(focused); + return true; + } + } + } + clearFocus() { + this._listWidget.setFocus([]); + } + get _candidateViewHeight() { + const { totalHeight } = RenameCandidateView.getLayoutInfo({ lineHeight: this._lineHeight }); + return totalHeight; + } + _pickListHeight(nCandidates) { + const heightToFitAllCandidates = this._candidateViewHeight * nCandidates; + const MAX_N_CANDIDATES = 7; + const height = Math.min(heightToFitAllCandidates, this._availableHeight, this._candidateViewHeight * MAX_N_CANDIDATES); + return height; + } + _pickListWidth(candidates) { + const longestCandidateWidth = Math.ceil(Math.max(...candidates.map((c) => c.newSymbolName.length)) * this._typicalHalfwidthCharacterWidth); + const width2 = Math.max( + this._minimumWidth, + 4 + 16 + 5 + longestCandidateWidth + 10 + /* (possibly visible) scrollbar width */ + // TODO@ulugbekna: approximate calc - clean this up + ); + return width2; + } + static _createListWidget(container, candidateViewHeight, fontInfo) { + const virtualDelegate = new class { + getTemplateId(element) { + return "candidate"; + } + getHeight(element) { + return candidateViewHeight; + } + }(); + const renderer = new class { + constructor() { + this.templateId = "candidate"; + } + renderTemplate(container2) { + return new RenameCandidateView(container2, fontInfo); + } + renderElement(candidate, index, templateData) { + templateData.populate(candidate); + } + disposeTemplate(templateData) { + templateData.dispose(); + } + }(); + return new List("NewSymbolNameCandidates", container, virtualDelegate, [renderer], { + keyboardSupport: false, + // @ulugbekna: because we handle keyboard events through proper commands & keybinding service, see `rename.ts` + mouseSupport: true, + multipleSelectionSupport: false + }); + } +}; +var InputWithButton = class { + constructor() { + this._buttonHoverContent = ""; + this._onDidInputChange = new Emitter(); + this.onDidInputChange = this._onDidInputChange.event; + this._disposables = new DisposableStore(); + } + get domNode() { + if (!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", localize(1395, "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 = localize(1396, "Generate New Name Suggestions"); + this._buttonCancelHoverText = localize(1397, "Cancel"); + this._buttonHoverContent = this._buttonGenHoverText; + this._disposables.add(getBaseLayerHoverDelegate().setupDelayedHover(this._buttonNode, () => ({ + content: this._buttonHoverContent, + style: 1 + }))); + this._domNode.appendChild(this._buttonNode); + this._disposables.add(addDisposableListener(this.input, EventType.INPUT, () => this._onDidInputChange.fire())); + this._disposables.add(addDisposableListener(this.input, EventType.KEY_DOWN, (e) => { + const keyEvent = new StandardKeyboardEvent(e); + if (keyEvent.keyCode === 15 || keyEvent.keyCode === 17) { + this._onDidInputChange.fire(); + } + })); + this._disposables.add(addDisposableListener(this.input, EventType.CLICK, () => this._onDidInputChange.fire())); + this._disposables.add(addDisposableListener(this.input, EventType.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(addDisposableListener(this.input, EventType.BLUR, () => { + this.domNode.style.outline = "none"; + })); + } + return this._domNode; + } + get input() { + assertType(this._inputNode); + return this._inputNode; + } + get button() { + assertType(this._buttonNode); + return this._buttonNode; + } + get buttonState() { + return this._buttonState; + } + setSparkleButton() { + this._buttonState = "sparkle"; + this._sparkleIcon ??= renderIcon(Codicon.sparkle); + clearNode(this.button); + this.button.appendChild(this._sparkleIcon); + this.button.setAttribute("aria-label", "Generating new name suggestions"); + this._buttonHoverContent = this._buttonGenHoverText; + this.input.focus(); + } + setStopButton() { + this._buttonState = "stop"; + this._stopIcon ??= renderIcon(Codicon.stopCircle); + clearNode(this.button); + this.button.appendChild(this._stopIcon); + this.button.setAttribute("aria-label", "Cancel generating new name suggestions"); + this._buttonHoverContent = this._buttonCancelHoverText; + this.input.focus(); + } + dispose() { + this._disposables.dispose(); + } +}; +var RenameCandidateView = class _RenameCandidateView { + static { + this._PADDING = 2; + } + constructor(parent, fontInfo) { + 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 = `${fontInfo.lineHeight}px`; + this._domNode.style.padding = `${_RenameCandidateView._PADDING}px`; + const iconContainer = document.createElement("div"); + iconContainer.style.display = `flex`; + iconContainer.style.alignItems = `center`; + iconContainer.style.width = iconContainer.style.height = `${fontInfo.lineHeight * 0.8}px`; + this._domNode.appendChild(iconContainer); + this._icon = renderIcon(Codicon.sparkle); + this._icon.style.display = `none`; + iconContainer.appendChild(this._icon); + this._label = document.createElement("div"); + applyFontInfo(this._label, fontInfo); + this._domNode.appendChild(this._label); + parent.appendChild(this._domNode); + } + populate(value) { + this._updateIcon(value); + this._updateLabel(value); + } + _updateIcon(value) { + const isAIGenerated = !!value.tags?.includes(NewSymbolNameTag.AIGenerated); + this._icon.style.display = isAIGenerated ? "inherit" : "none"; + } + _updateLabel(value) { + this._label.innerText = value.newSymbolName; + } + static getLayoutInfo({ lineHeight }) { + const totalHeight = lineHeight + _RenameCandidateView._PADDING * 2; + return { totalHeight }; + } + dispose() { + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/rename/browser/rename.js +var __decorate145 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param139 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var RenameController_1; +var RenameSkeleton = class { + constructor(model, position, registry) { + this.model = model; + this.position = position; + this._providerRenameIdx = 0; + this._providers = registry.ordered(model); + } + hasProvider() { + return this._providers.length > 0; + } + async resolveRenameLocation(token) { + const rejects = []; + for (this._providerRenameIdx = 0; this._providerRenameIdx < this._providers.length; this._providerRenameIdx++) { + const provider = this._providers[this._providerRenameIdx]; + if (!provider.resolveRenameLocation) { + break; + } + const res = await provider.resolveRenameLocation(this.model, this.position, token); + if (!res) { + continue; + } + if (res.rejectReason) { + rejects.push(res.rejectReason); + continue; + } + return res; + } + this._providerRenameIdx = 0; + const word = this.model.getWordAtPosition(this.position); + if (!word) { + return { + range: Range.fromPositions(this.position), + text: "", + rejectReason: rejects.length > 0 ? rejects.join("\n") : void 0 + }; + } + return { + range: new Range(this.position.lineNumber, word.startColumn, this.position.lineNumber, word.endColumn), + text: word.word, + rejectReason: rejects.length > 0 ? rejects.join("\n") : void 0 + }; + } + async provideRenameEdits(newName, token) { + return this._provideRenameEdits(newName, this._providerRenameIdx, [], token); + } + async _provideRenameEdits(newName, i2, rejects, token) { + const provider = this._providers[i2]; + if (!provider) { + return { + edits: [], + rejectReason: rejects.join("\n") + }; + } + const result = await provider.provideRenameEdits(this.model, this.position, newName, token); + if (!result) { + return this._provideRenameEdits(newName, i2 + 1, rejects.concat(localize(1380, "No result.")), token); + } else if (result.rejectReason) { + return this._provideRenameEdits(newName, i2 + 1, rejects.concat(result.rejectReason), token); + } + return result; + } +}; +async function rename(registry, model, position, newName) { + const skeleton = new RenameSkeleton(model, position, registry); + const loc = await skeleton.resolveRenameLocation(CancellationToken.None); + if (loc?.rejectReason) { + return { edits: [], rejectReason: loc.rejectReason }; + } + return skeleton.provideRenameEdits(newName, CancellationToken.None); +} +var RenameController = class RenameController2 { + static { + RenameController_1 = this; + } + static { + this.ID = "editor.contrib.renameController"; + } + static get(editor2) { + return editor2.getContribution(RenameController_1.ID); + } + constructor(editor2, _instaService, _notificationService, _bulkEditService, _progressService, _logService, _configService, _languageFeaturesService) { + this.editor = editor2; + this._instaService = _instaService; + this._notificationService = _notificationService; + this._bulkEditService = _bulkEditService; + this._progressService = _progressService; + this._logService = _logService; + this._configService = _configService; + this._languageFeaturesService = _languageFeaturesService; + this._disposableStore = new DisposableStore(); + this._cts = new CancellationTokenSource(); + this._renameWidget = this._disposableStore.add(this._instaService.createInstance(RenameWidget, this.editor, ["acceptRenameInput", "acceptRenameInputWithPreview"])); + } + dispose() { + this._disposableStore.dispose(); + this._cts.dispose(true); + } + async run() { + const trace = this._logService.trace.bind(this._logService, "[rename]"); + this._cts.dispose(true); + this._cts = new CancellationTokenSource(); + if (!this.editor.hasModel()) { + trace("editor has no model"); + return void 0; + } + const position = this.editor.getPosition(); + const skeleton = new RenameSkeleton(this.editor.getModel(), position, this._languageFeaturesService.renameProvider); + if (!skeleton.hasProvider()) { + trace("skeleton has no provider"); + return void 0; + } + const cts1 = new EditorStateCancellationTokenSource(this.editor, 4 | 1, void 0, this._cts.token); + let loc; + try { + trace("resolving rename location"); + const resolveLocationOperation = skeleton.resolveRenameLocation(cts1.token); + this._progressService.showWhile(resolveLocationOperation, 250); + loc = await resolveLocationOperation; + trace("resolved rename location"); + } catch (e) { + if (e instanceof CancellationError) { + trace("resolve rename location cancelled", JSON.stringify(e, null, " ")); + } else { + trace("resolve rename location failed", e instanceof Error ? e : JSON.stringify(e, null, " ")); + if (typeof e === "string" || isMarkdownString(e)) { + MessageController.get(this.editor)?.showMessage(e || localize(1381, "An unknown error occurred while resolving rename location"), position); + } + } + return void 0; + } finally { + cts1.dispose(); + } + if (!loc) { + trace("returning early - no loc"); + return void 0; + } + if (loc.rejectReason) { + trace(`returning early - rejected with reason: ${loc.rejectReason}`, loc.rejectReason); + MessageController.get(this.editor)?.showMessage(loc.rejectReason, position); + return void 0; + } + if (cts1.token.isCancellationRequested) { + trace("returning early - cts1 cancelled"); + return void 0; + } + const cts2 = new EditorStateCancellationTokenSource(this.editor, 4 | 1, loc.range, this._cts.token); + const model = this.editor.getModel(); + const newSymbolNamesProviders = this._languageFeaturesService.newSymbolNamesProvider.all(model); + const resolvedNewSymbolnamesProviders = await Promise.all(newSymbolNamesProviders.map(async (p) => [p, await p.supportsAutomaticNewSymbolNamesTriggerKind ?? false])); + const requestRenameSuggestions = (triggerKind, cts) => { + let providers = resolvedNewSymbolnamesProviders.slice(); + if (triggerKind === NewSymbolNameTriggerKind.Automatic) { + providers = providers.filter(([_, supportsAutomatic]) => supportsAutomatic); + } + return providers.map(([p]) => p.provideNewSymbolNames(model, loc.range, triggerKind, cts)); + }; + trace("creating rename input field and awaiting its result"); + const supportPreview = this._bulkEditService.hasPreviewHandler() && this._configService.getValue(this.editor.getModel().uri, "editor.rename.enablePreview"); + const inputFieldResult = await this._renameWidget.getInput(loc.range, loc.text, supportPreview, newSymbolNamesProviders.length > 0 ? requestRenameSuggestions : void 0, cts2); + trace("received response from rename input field"); + if (typeof inputFieldResult === "boolean") { + trace(`returning early - rename input field response - ${inputFieldResult}`); + if (inputFieldResult) { + this.editor.focus(); + } + cts2.dispose(); + return void 0; + } + this.editor.focus(); + trace("requesting rename edits"); + const renameOperation = raceCancellation(skeleton.provideRenameEdits(inputFieldResult.newName, cts2.token), cts2.token).then(async (renameResult) => { + if (!renameResult) { + trace("returning early - no rename edits result"); + return; + } + if (!this.editor.hasModel()) { + trace("returning early - no model after rename edits are provided"); + return; + } + if (renameResult.rejectReason) { + trace(`returning early - rejected with reason: ${renameResult.rejectReason}`); + this._notificationService.info(renameResult.rejectReason); + return; + } + this.editor.setSelection(Range.fromPositions(this.editor.getSelection().getPosition())); + trace("applying edits"); + this._bulkEditService.apply(renameResult, { + editor: this.editor, + showPreview: inputFieldResult.wantsPreview, + label: localize(1382, "Renaming '{0}' to '{1}'", loc?.text, inputFieldResult.newName), + code: "undoredo.rename", + quotableLabel: localize(1383, "Renaming {0} to {1}", loc?.text, inputFieldResult.newName), + respectAutoSaveConfig: true, + reason: EditSources.rename() + }).then((result) => { + trace("edits applied"); + if (result.ariaSummary) { + alert(localize(1384, "Successfully renamed '{0}' to '{1}'. Summary: {2}", loc.text, inputFieldResult.newName, result.ariaSummary)); + } + }).catch((err) => { + trace(`error when applying edits ${JSON.stringify(err, null, " ")}`); + this._notificationService.error(localize(1385, "Rename failed to apply edits")); + this._logService.error(err); + }); + }, (err) => { + trace("error when providing rename edits", JSON.stringify(err, null, " ")); + this._notificationService.error(localize(1386, "Rename failed to compute edits")); + this._logService.error(err); + }).finally(() => { + cts2.dispose(); + }); + trace("returning rename operation"); + this._progressService.showWhile(renameOperation, 250); + return renameOperation; + } + acceptRenameInput(wantsPreview) { + this._renameWidget.acceptInput(wantsPreview); + } + cancelRenameInput() { + this._renameWidget.cancelInput(true, "cancelRenameInput command"); + } + focusNextRenameSuggestion() { + this._renameWidget.focusNextRenameSuggestion(); + } + focusPreviousRenameSuggestion() { + this._renameWidget.focusPreviousRenameSuggestion(); + } +}; +RenameController = RenameController_1 = __decorate145([ + __param139(1, IInstantiationService), + __param139(2, INotificationService), + __param139(3, IBulkEditService), + __param139(4, IEditorProgressService), + __param139(5, ILogService), + __param139(6, ITextResourceConfigurationService), + __param139(7, ILanguageFeaturesService) +], RenameController); +var RenameAction = class extends EditorAction { + constructor() { + super({ + id: "editor.action.rename", + label: localize2(1388, "Rename Symbol"), + precondition: ContextKeyExpr.and(EditorContextKeys.writable, EditorContextKeys.hasRenameProvider), + kbOpts: { + kbExpr: EditorContextKeys.editorTextFocus, + primary: 60, + weight: 100 + /* KeybindingWeight.EditorContrib */ + }, + contextMenuOpts: { + group: "1_modification", + order: 1.1 + }, + canTriggerInlineEdits: true + }); + } + runCommand(accessor, args) { + const editorService = accessor.get(ICodeEditorService); + const [uri, pos] = Array.isArray(args) && args || [void 0, void 0]; + if (URI.isUri(uri) && Position.isIPosition(pos)) { + return editorService.openCodeEditor({ resource: uri }, editorService.getActiveCodeEditor()).then((editor2) => { + if (!editor2) { + return; + } + editor2.setPosition(pos); + editor2.invokeWithinContext((accessor2) => { + this.reportTelemetry(accessor2, editor2); + return this.run(accessor2, editor2); + }); + }, onUnexpectedError); + } + return super.runCommand(accessor, args); + } + run(accessor, editor2) { + const logService = accessor.get(ILogService); + const controller = RenameController.get(editor2); + if (controller) { + logService.trace("[RenameAction] got controller, running..."); + return controller.run(); + } + logService.trace("[RenameAction] returning early - controller missing"); + return Promise.resolve(); + } +}; +registerEditorContribution( + RenameController.ID, + RenameController, + 4 + /* EditorContributionInstantiation.Lazy */ +); +registerEditorAction(RenameAction); +var RenameCommand = EditorCommand.bindToContribution(RenameController.get); +registerEditorCommand(new RenameCommand({ + id: "acceptRenameInput", + precondition: CONTEXT_RENAME_INPUT_VISIBLE, + handler: (x) => x.acceptRenameInput(false), + kbOpts: { + weight: 100 + 99, + kbExpr: ContextKeyExpr.and(EditorContextKeys.focus, ContextKeyExpr.not("isComposing")), + primary: 3 + /* KeyCode.Enter */ + } +})); +registerEditorCommand(new RenameCommand({ + id: "acceptRenameInputWithPreview", + precondition: ContextKeyExpr.and(CONTEXT_RENAME_INPUT_VISIBLE, ContextKeyExpr.has("config.editor.rename.enablePreview")), + handler: (x) => x.acceptRenameInput(true), + kbOpts: { + weight: 100 + 99, + kbExpr: ContextKeyExpr.and(EditorContextKeys.focus, ContextKeyExpr.not("isComposing")), + primary: 2048 + 3 + /* KeyCode.Enter */ + } +})); +registerEditorCommand(new RenameCommand({ + id: "cancelRenameInput", + precondition: CONTEXT_RENAME_INPUT_VISIBLE, + handler: (x) => x.cancelRenameInput(), + kbOpts: { + weight: 100 + 99, + kbExpr: EditorContextKeys.focus, + primary: 9, + secondary: [ + 1024 | 9 + /* KeyCode.Escape */ + ] + } +})); +registerAction2(class FocusNextRenameSuggestion extends Action2 { + constructor() { + super({ + id: "focusNextRenameSuggestion", + title: { + ...localize2(1389, "Focus Next Rename Suggestion") + }, + precondition: CONTEXT_RENAME_INPUT_VISIBLE, + keybinding: [ + { + primary: 18, + weight: 100 + 99 + } + ] + }); + } + run(accessor) { + const currentEditor = accessor.get(ICodeEditorService).getFocusedCodeEditor(); + if (!currentEditor) { + return; + } + const controller = RenameController.get(currentEditor); + if (!controller) { + return; + } + controller.focusNextRenameSuggestion(); + } +}); +registerAction2(class FocusPreviousRenameSuggestion extends Action2 { + constructor() { + super({ + id: "focusPreviousRenameSuggestion", + title: { + ...localize2(1390, "Focus Previous Rename Suggestion") + }, + precondition: CONTEXT_RENAME_INPUT_VISIBLE, + keybinding: [ + { + primary: 16, + weight: 100 + 99 + } + ] + }); + } + run(accessor) { + const currentEditor = accessor.get(ICodeEditorService).getFocusedCodeEditor(); + if (!currentEditor) { + return; + } + const controller = RenameController.get(currentEditor); + if (!controller) { + return; + } + controller.focusPreviousRenameSuggestion(); + } +}); +registerModelAndPositionCommand("_executeDocumentRenameProvider", function(accessor, model, position, ...args) { + const [newName] = args; + assertType(typeof newName === "string"); + const { renameProvider } = accessor.get(ILanguageFeaturesService); + return rename(renameProvider, model, position, newName); +}); +registerModelAndPositionCommand("_executePrepareRename", async function(accessor, model, position) { + const { renameProvider } = accessor.get(ILanguageFeaturesService); + const skeleton = new RenameSkeleton(model, position, renameProvider); + const loc = await skeleton.resolveRenameLocation(CancellationToken.None); + if (loc?.rejectReason) { + throw new Error(loc.rejectReason); + } + return loc; +}); +Registry.as(Extensions4.Configuration).registerConfiguration({ + id: "editor", + properties: { + "editor.rename.enablePreview": { + scope: 6, + description: localize(1387, "Enable/disable the ability to preview changes before renaming"), + default: true, + type: "boolean" + } + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/sectionHeaders/browser/sectionHeaders.js +init_async(); +init_lifecycle(); +init_editorExtensions(); +init_languageConfigurationRegistry(); +init_textModel(); +init_editorWorker(); +var __decorate146 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param140 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var SectionHeaderDetector = class SectionHeaderDetector2 extends Disposable { + static { + this.ID = "editor.sectionHeaderDetector"; + } + constructor(editor2, languageConfigurationService, editorWorkerService) { + super(); + this.editor = editor2; + this.languageConfigurationService = languageConfigurationService; + this.editorWorkerService = editorWorkerService; + this.decorations = this.editor.createDecorationsCollection(); + this.options = this.createOptions(editor2.getOption( + 81 + /* EditorOption.minimap */ + )); + this.computePromise = null; + this.currentOccurrences = {}; + this._register(editor2.onDidChangeModel((e) => { + this.currentOccurrences = {}; + this.options = this.createOptions(editor2.getOption( + 81 + /* EditorOption.minimap */ + )); + this.stop(); + this.computeSectionHeaders.schedule(0); + })); + this._register(editor2.onDidChangeModelLanguage((e) => { + this.currentOccurrences = {}; + this.options = this.createOptions(editor2.getOption( + 81 + /* EditorOption.minimap */ + )); + this.stop(); + this.computeSectionHeaders.schedule(0); + })); + this._register(languageConfigurationService.onDidChange((e) => { + const editorLanguageId = this.editor.getModel()?.getLanguageId(); + if (editorLanguageId && e.affects(editorLanguageId)) { + this.currentOccurrences = {}; + this.options = this.createOptions(editor2.getOption( + 81 + /* EditorOption.minimap */ + )); + this.stop(); + this.computeSectionHeaders.schedule(0); + } + })); + this._register(editor2.onDidChangeConfiguration((e) => { + if (this.options && !e.hasChanged( + 81 + /* EditorOption.minimap */ + )) { + return; + } + this.options = this.createOptions(editor2.getOption( + 81 + /* EditorOption.minimap */ + )); + this.updateDecorations([]); + this.stop(); + this.computeSectionHeaders.schedule(0); + })); + this._register(this.editor.onDidChangeModelContent((e) => { + this.computeSectionHeaders.schedule(); + })); + this._register(editor2.onDidChangeModelTokens((e) => { + if (!this.computeSectionHeaders.isScheduled()) { + this.computeSectionHeaders.schedule(1e3); + } + })); + this.computeSectionHeaders = this._register(new RunOnceScheduler(() => { + this.findSectionHeaders(); + }, 250)); + this.computeSectionHeaders.schedule(0); + } + createOptions(minimap) { + if (!minimap || !this.editor.hasModel()) { + return void 0; + } + const languageId = this.editor.getModel().getLanguageId(); + if (!languageId) { + return void 0; + } + const commentsConfiguration = this.languageConfigurationService.getLanguageConfiguration(languageId).comments; + const foldingRules = this.languageConfigurationService.getLanguageConfiguration(languageId).foldingRules; + if (!commentsConfiguration && !foldingRules?.markers) { + return void 0; + } + return { + foldingRules, + markSectionHeaderRegex: minimap.markSectionHeaderRegex, + findMarkSectionHeaders: minimap.showMarkSectionHeaders, + findRegionSectionHeaders: minimap.showRegionSectionHeaders + }; + } + findSectionHeaders() { + if (!this.editor.hasModel() || !this.options?.findMarkSectionHeaders && !this.options?.findRegionSectionHeaders) { + return; + } + const model = this.editor.getModel(); + if (model.isDisposed() || model.isTooLargeForSyncing()) { + return; + } + const modelVersionId = model.getVersionId(); + this.editorWorkerService.findSectionHeaders(model.uri, this.options).then((sectionHeaders) => { + if (model.isDisposed() || model.getVersionId() !== modelVersionId) { + return; + } + this.updateDecorations(sectionHeaders); + }); + } + updateDecorations(sectionHeaders) { + const model = this.editor.getModel(); + if (model) { + sectionHeaders = sectionHeaders.filter((sectionHeader) => { + if (!sectionHeader.shouldBeInComments) { + return true; + } + const validRange = model.validateRange(sectionHeader.range); + const tokens = model.tokenization.getLineTokens(validRange.startLineNumber); + const idx = tokens.findTokenIndexAtOffset(validRange.startColumn - 1); + const tokenType = tokens.getStandardTokenType(idx); + const languageId = tokens.getLanguageId(idx); + return languageId === model.getLanguageId() && tokenType === 1; + }); + } + const oldDecorations = Object.values(this.currentOccurrences).map((occurrence) => occurrence.decorationId); + const newDecorations = sectionHeaders.map((sectionHeader) => decoration2(sectionHeader)); + this.editor.changeDecorations((changeAccessor) => { + const decorations = changeAccessor.deltaDecorations(oldDecorations, newDecorations); + this.currentOccurrences = {}; + for (let i2 = 0, len = decorations.length; i2 < len; i2++) { + const occurrence = { sectionHeader: sectionHeaders[i2], decorationId: decorations[i2] }; + this.currentOccurrences[occurrence.decorationId] = occurrence; + } + }); + } + stop() { + this.computeSectionHeaders.cancel(); + if (this.computePromise) { + this.computePromise.cancel(); + this.computePromise = null; + } + } + dispose() { + super.dispose(); + this.stop(); + this.decorations.clear(); + } +}; +SectionHeaderDetector = __decorate146([ + __param140(1, ILanguageConfigurationService), + __param140(2, IEditorWorkerService) +], SectionHeaderDetector); +function decoration2(sectionHeader) { + return { + range: sectionHeader.range, + options: ModelDecorationOptions.createDynamic({ + description: "section-header", + stickiness: 3, + collapseOnReplaceEdit: true, + minimap: { + color: void 0, + position: 1, + sectionHeaderStyle: sectionHeader.hasSeparatorLine ? 2 : 1, + sectionHeaderText: sectionHeader.text + } + }) + }; +} +registerEditorContribution( + SectionHeaderDetector.ID, + SectionHeaderDetector, + 1 + /* EditorContributionInstantiation.AfterFirstRender */ +); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/semanticTokens/browser/documentSemanticTokens.js +init_async(); +init_cancellation(); +init_errors(); +init_lifecycle(); +init_map(); +init_stopwatch(); +init_configuration(); +init_themeService(); +init_languageFeatureDebounce(); +init_languageFeatures(); +init_model(); + +// node_modules/monaco-editor-core/esm/vs/editor/common/services/semanticTokensProviderStyling.js +init_encodedTokenAttributes(); +init_themeService(); +init_log(); + +// node_modules/monaco-editor-core/esm/vs/editor/common/tokens/sparseMultilineTokens.js +init_position(); +init_range(); +init_eolCounter(); + +// node_modules/monaco-editor-core/esm/vs/editor/common/tokens/common.js +var RateLimiter = class { + constructor(timesPerSecond = 5) { + this.timesPerSecond = timesPerSecond; + this._lastRun = 0; + this._minimumTimeBetweenRuns = 1e3 / timesPerSecond; + } + runIfNotLimited(callback) { + const now = Date.now(); + if (now - this._lastRun >= this._minimumTimeBetweenRuns) { + this._lastRun = now; + callback(); + } + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/common/tokens/sparseMultilineTokens.js +var SparseMultilineTokens = class _SparseMultilineTokens { + static create(startLineNumber, tokens) { + return new _SparseMultilineTokens(startLineNumber, new SparseMultilineTokensStorage(tokens)); + } + /** + * (Inclusive) start line number for these tokens. + */ + get startLineNumber() { + return this._startLineNumber; + } + /** + * (Inclusive) end line number for these tokens. + */ + get endLineNumber() { + return this._endLineNumber; + } + constructor(startLineNumber, tokens) { + this._startLineNumber = startLineNumber; + this._tokens = tokens; + this._endLineNumber = this._startLineNumber + this._tokens.getMaxDeltaLine(); + } + toString() { + return this._tokens.toString(this._startLineNumber); + } + _updateEndLineNumber() { + this._endLineNumber = this._startLineNumber + this._tokens.getMaxDeltaLine(); + } + isEmpty() { + return this._tokens.isEmpty(); + } + getLineTokens(lineNumber) { + if (this._startLineNumber <= lineNumber && lineNumber <= this._endLineNumber) { + return this._tokens.getLineTokens(lineNumber - this._startLineNumber); + } + return null; + } + getRange() { + const deltaRange = this._tokens.getRange(); + if (!deltaRange) { + return deltaRange; + } + return new Range(this._startLineNumber + deltaRange.startLineNumber, deltaRange.startColumn, this._startLineNumber + deltaRange.endLineNumber, deltaRange.endColumn); + } + removeTokens(range2) { + const startLineIndex = range2.startLineNumber - this._startLineNumber; + const endLineIndex = range2.endLineNumber - this._startLineNumber; + this._startLineNumber += this._tokens.removeTokens(startLineIndex, range2.startColumn - 1, endLineIndex, range2.endColumn - 1); + this._updateEndLineNumber(); + } + split(range2) { + const startLineIndex = range2.startLineNumber - this._startLineNumber; + const endLineIndex = range2.endLineNumber - this._startLineNumber; + const [a, b, bDeltaLine] = this._tokens.split(startLineIndex, range2.startColumn - 1, endLineIndex, range2.endColumn - 1); + return [new _SparseMultilineTokens(this._startLineNumber, a), new _SparseMultilineTokens(this._startLineNumber + bDeltaLine, b)]; + } + applyEdit(range2, text2) { + const [eolCount, firstLineLength, lastLineLength] = countEOL(text2); + this.acceptEdit( + range2, + eolCount, + firstLineLength, + lastLineLength, + text2.length > 0 ? text2.charCodeAt(0) : 0 + /* CharCode.Null */ + ); + } + acceptEdit(range2, eolCount, firstLineLength, lastLineLength, firstCharCode) { + this._acceptDeleteRange(range2); + this._acceptInsertText(new Position(range2.startLineNumber, range2.startColumn), eolCount, firstLineLength, lastLineLength, firstCharCode); + this._updateEndLineNumber(); + } + _acceptDeleteRange(range2) { + if (range2.startLineNumber === range2.endLineNumber && range2.startColumn === range2.endColumn) { + return; + } + const firstLineIndex = range2.startLineNumber - this._startLineNumber; + const lastLineIndex = range2.endLineNumber - this._startLineNumber; + if (lastLineIndex < 0) { + const deletedLinesCount = lastLineIndex - firstLineIndex; + this._startLineNumber -= deletedLinesCount; + return; + } + const tokenMaxDeltaLine = this._tokens.getMaxDeltaLine(); + if (firstLineIndex >= tokenMaxDeltaLine + 1) { + return; + } + if (firstLineIndex < 0 && lastLineIndex >= tokenMaxDeltaLine + 1) { + this._startLineNumber = 0; + this._tokens.clear(); + return; + } + if (firstLineIndex < 0) { + const deletedBefore = -firstLineIndex; + this._startLineNumber -= deletedBefore; + this._tokens.acceptDeleteRange(range2.startColumn - 1, 0, 0, lastLineIndex, range2.endColumn - 1); + } else { + this._tokens.acceptDeleteRange(0, firstLineIndex, range2.startColumn - 1, lastLineIndex, range2.endColumn - 1); + } + } + _acceptInsertText(position, eolCount, firstLineLength, lastLineLength, firstCharCode) { + if (eolCount === 0 && firstLineLength === 0) { + return; + } + const lineIndex = position.lineNumber - this._startLineNumber; + if (lineIndex < 0) { + this._startLineNumber += eolCount; + return; + } + const tokenMaxDeltaLine = this._tokens.getMaxDeltaLine(); + if (lineIndex >= tokenMaxDeltaLine + 1) { + return; + } + this._tokens.acceptInsertText(lineIndex, position.column - 1, eolCount, firstLineLength, lastLineLength, firstCharCode); + } + reportIfInvalid(model) { + this._tokens.reportIfInvalid(model, this._startLineNumber); + } +}; +var SparseMultilineTokensStorage = class _SparseMultilineTokensStorage { + constructor(tokens) { + this._tokens = tokens; + this._tokenCount = tokens.length / 4; + } + toString(startLineNumber) { + const pieces = []; + for (let i2 = 0; i2 < this._tokenCount; i2++) { + pieces.push(`(${this._getDeltaLine(i2) + startLineNumber},${this._getStartCharacter(i2)}-${this._getEndCharacter(i2)})`); + } + return `[${pieces.join(",")}]`; + } + getMaxDeltaLine() { + const tokenCount = this._getTokenCount(); + if (tokenCount === 0) { + return -1; + } + return this._getDeltaLine(tokenCount - 1); + } + getRange() { + const tokenCount = this._getTokenCount(); + if (tokenCount === 0) { + return null; + } + const startChar = this._getStartCharacter(0); + const maxDeltaLine = this._getDeltaLine(tokenCount - 1); + const endChar = this._getEndCharacter(tokenCount - 1); + return new Range(0, startChar + 1, maxDeltaLine, endChar + 1); + } + _getTokenCount() { + return this._tokenCount; + } + _getDeltaLine(tokenIndex) { + return this._tokens[4 * tokenIndex]; + } + _getStartCharacter(tokenIndex) { + return this._tokens[4 * tokenIndex + 1]; + } + _getEndCharacter(tokenIndex) { + return this._tokens[4 * tokenIndex + 2]; + } + isEmpty() { + return this._getTokenCount() === 0; + } + getLineTokens(deltaLine) { + let low = 0; + let high = this._getTokenCount() - 1; + while (low < high) { + const mid = low + Math.floor((high - low) / 2); + const midDeltaLine = this._getDeltaLine(mid); + if (midDeltaLine < deltaLine) { + low = mid + 1; + } else if (midDeltaLine > deltaLine) { + high = mid - 1; + } else { + let min = mid; + while (min > low && this._getDeltaLine(min - 1) === deltaLine) { + min--; + } + let max = mid; + while (max < high && this._getDeltaLine(max + 1) === deltaLine) { + max++; + } + return new SparseLineTokens(this._tokens.subarray(4 * min, 4 * max + 4)); + } + } + if (this._getDeltaLine(low) === deltaLine) { + return new SparseLineTokens(this._tokens.subarray(4 * low, 4 * low + 4)); + } + return null; + } + clear() { + this._tokenCount = 0; + } + removeTokens(startDeltaLine, startChar, endDeltaLine, endChar) { + const tokens = this._tokens; + const tokenCount = this._tokenCount; + let newTokenCount = 0; + let hasDeletedTokens = false; + let firstDeltaLine = 0; + for (let i2 = 0; i2 < tokenCount; i2++) { + const srcOffset = 4 * i2; + const tokenDeltaLine = tokens[srcOffset]; + const tokenStartCharacter = tokens[srcOffset + 1]; + const tokenEndCharacter = tokens[srcOffset + 2]; + const tokenMetadata = tokens[srcOffset + 3]; + if ((tokenDeltaLine > startDeltaLine || tokenDeltaLine === startDeltaLine && tokenEndCharacter >= startChar) && (tokenDeltaLine < endDeltaLine || tokenDeltaLine === endDeltaLine && tokenStartCharacter <= endChar)) { + hasDeletedTokens = true; + } else { + if (newTokenCount === 0) { + firstDeltaLine = tokenDeltaLine; + } + if (hasDeletedTokens) { + const destOffset = 4 * newTokenCount; + tokens[destOffset] = tokenDeltaLine - firstDeltaLine; + tokens[destOffset + 1] = tokenStartCharacter; + tokens[destOffset + 2] = tokenEndCharacter; + tokens[destOffset + 3] = tokenMetadata; + } else if (firstDeltaLine !== 0) { + tokens[srcOffset] = tokenDeltaLine - firstDeltaLine; + } + newTokenCount++; + } + } + this._tokenCount = newTokenCount; + return firstDeltaLine; + } + split(startDeltaLine, startChar, endDeltaLine, endChar) { + const tokens = this._tokens; + const tokenCount = this._tokenCount; + const aTokens = []; + const bTokens = []; + let destTokens = aTokens; + let destOffset = 0; + let destFirstDeltaLine = 0; + for (let i2 = 0; i2 < tokenCount; i2++) { + const srcOffset = 4 * i2; + const tokenDeltaLine = tokens[srcOffset]; + const tokenStartCharacter = tokens[srcOffset + 1]; + const tokenEndCharacter = tokens[srcOffset + 2]; + const tokenMetadata = tokens[srcOffset + 3]; + if (tokenDeltaLine > startDeltaLine || tokenDeltaLine === startDeltaLine && tokenEndCharacter >= startChar) { + if (tokenDeltaLine < endDeltaLine || tokenDeltaLine === endDeltaLine && tokenStartCharacter <= endChar) { + continue; + } else { + if (destTokens !== bTokens) { + destTokens = bTokens; + destOffset = 0; + destFirstDeltaLine = tokenDeltaLine; + } + } + } + destTokens[destOffset++] = tokenDeltaLine - destFirstDeltaLine; + destTokens[destOffset++] = tokenStartCharacter; + destTokens[destOffset++] = tokenEndCharacter; + destTokens[destOffset++] = tokenMetadata; + } + return [new _SparseMultilineTokensStorage(new Uint32Array(aTokens)), new _SparseMultilineTokensStorage(new Uint32Array(bTokens)), destFirstDeltaLine]; + } + acceptDeleteRange(horizontalShiftForFirstLineTokens, startDeltaLine, startCharacter, endDeltaLine, endCharacter) { + const tokens = this._tokens; + const tokenCount = this._tokenCount; + const deletedLineCount = endDeltaLine - startDeltaLine; + let newTokenCount = 0; + let hasDeletedTokens = false; + for (let i2 = 0; i2 < tokenCount; i2++) { + const srcOffset = 4 * i2; + let tokenDeltaLine = tokens[srcOffset]; + let tokenStartCharacter = tokens[srcOffset + 1]; + let tokenEndCharacter = tokens[srcOffset + 2]; + const tokenMetadata = tokens[srcOffset + 3]; + if (tokenDeltaLine < startDeltaLine || tokenDeltaLine === startDeltaLine && tokenEndCharacter <= startCharacter) { + newTokenCount++; + continue; + } else if (tokenDeltaLine === startDeltaLine && tokenStartCharacter < startCharacter) { + if (tokenDeltaLine === endDeltaLine && tokenEndCharacter > endCharacter) { + tokenEndCharacter -= endCharacter - startCharacter; + } else { + tokenEndCharacter = startCharacter; + } + } else if (tokenDeltaLine === startDeltaLine && tokenStartCharacter === startCharacter) { + if (tokenDeltaLine === endDeltaLine && tokenEndCharacter > endCharacter) { + tokenEndCharacter -= endCharacter - startCharacter; + } else { + hasDeletedTokens = true; + continue; + } + } else if (tokenDeltaLine < endDeltaLine || tokenDeltaLine === endDeltaLine && tokenStartCharacter < endCharacter) { + if (tokenDeltaLine === endDeltaLine && tokenEndCharacter > endCharacter) { + tokenDeltaLine = startDeltaLine; + tokenStartCharacter = startCharacter; + tokenEndCharacter = tokenStartCharacter + (tokenEndCharacter - endCharacter); + } else { + hasDeletedTokens = true; + continue; + } + } else if (tokenDeltaLine > endDeltaLine) { + if (deletedLineCount === 0 && !hasDeletedTokens) { + newTokenCount = tokenCount; + break; + } + tokenDeltaLine -= deletedLineCount; + } else if (tokenDeltaLine === endDeltaLine && tokenStartCharacter >= endCharacter) { + if (horizontalShiftForFirstLineTokens && tokenDeltaLine === 0) { + tokenStartCharacter += horizontalShiftForFirstLineTokens; + tokenEndCharacter += horizontalShiftForFirstLineTokens; + } + tokenDeltaLine -= deletedLineCount; + tokenStartCharacter -= endCharacter - startCharacter; + tokenEndCharacter -= endCharacter - startCharacter; + } else { + throw new Error(`Not possible!`); + } + const destOffset = 4 * newTokenCount; + tokens[destOffset] = tokenDeltaLine; + tokens[destOffset + 1] = tokenStartCharacter; + tokens[destOffset + 2] = tokenEndCharacter; + tokens[destOffset + 3] = tokenMetadata; + newTokenCount++; + } + this._tokenCount = newTokenCount; + } + acceptInsertText(deltaLine, character, eolCount, firstLineLength, lastLineLength, firstCharCode) { + const isInsertingPreciselyOneWordCharacter = eolCount === 0 && firstLineLength === 1 && (firstCharCode >= 48 && firstCharCode <= 57 || firstCharCode >= 65 && firstCharCode <= 90 || firstCharCode >= 97 && firstCharCode <= 122); + const tokens = this._tokens; + const tokenCount = this._tokenCount; + for (let i2 = 0; i2 < tokenCount; i2++) { + const offset = 4 * i2; + let tokenDeltaLine = tokens[offset]; + let tokenStartCharacter = tokens[offset + 1]; + let tokenEndCharacter = tokens[offset + 2]; + if (tokenDeltaLine < deltaLine || tokenDeltaLine === deltaLine && tokenEndCharacter < character) { + continue; + } else if (tokenDeltaLine === deltaLine && tokenEndCharacter === character) { + if (isInsertingPreciselyOneWordCharacter) { + tokenEndCharacter += 1; + } else { + continue; + } + } else if (tokenDeltaLine === deltaLine && tokenStartCharacter < character && character < tokenEndCharacter) { + if (eolCount === 0) { + tokenEndCharacter += firstLineLength; + } else { + tokenEndCharacter = character; + } + } else { + if (tokenDeltaLine === deltaLine && tokenStartCharacter === character) { + if (isInsertingPreciselyOneWordCharacter) { + continue; + } + } + if (tokenDeltaLine === deltaLine) { + tokenDeltaLine += eolCount; + if (eolCount === 0) { + tokenStartCharacter += firstLineLength; + tokenEndCharacter += firstLineLength; + } else { + const tokenLength = tokenEndCharacter - tokenStartCharacter; + tokenStartCharacter = lastLineLength + (tokenStartCharacter - character); + tokenEndCharacter = tokenStartCharacter + tokenLength; + } + } else { + tokenDeltaLine += eolCount; + } + } + tokens[offset] = tokenDeltaLine; + tokens[offset + 1] = tokenStartCharacter; + tokens[offset + 2] = tokenEndCharacter; + } + } + static { + this._rateLimiter = new RateLimiter(10 / 60); + } + // limit to 10 times per minute + reportIfInvalid(model, startLineNumber) { + for (let i2 = 0; i2 < this._tokenCount; i2++) { + const lineNumber = this._getDeltaLine(i2) + startLineNumber; + if (lineNumber < 1) { + _SparseMultilineTokensStorage._rateLimiter.runIfNotLimited(() => { + console.error("Invalid Semantic Tokens Data From Extension: lineNumber < 1"); + }); + } else if (lineNumber > model.getLineCount()) { + _SparseMultilineTokensStorage._rateLimiter.runIfNotLimited(() => { + console.error("Invalid Semantic Tokens Data From Extension: lineNumber > model.getLineCount()"); + }); + } else if (this._getEndCharacter(i2) > model.getLineLength(lineNumber)) { + _SparseMultilineTokensStorage._rateLimiter.runIfNotLimited(() => { + console.error("Invalid Semantic Tokens Data From Extension: end character > model.getLineLength(lineNumber)"); + }); + } + } + } +}; +var SparseLineTokens = class { + constructor(tokens) { + this._tokens = tokens; + } + getCount() { + return this._tokens.length / 4; + } + getStartCharacter(tokenIndex) { + return this._tokens[4 * tokenIndex + 1]; + } + getEndCharacter(tokenIndex) { + return this._tokens[4 * tokenIndex + 2]; + } + getMetadata(tokenIndex) { + return this._tokens[4 * tokenIndex + 3]; + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/common/services/semanticTokensProviderStyling.js +init_language(); +var __decorate147 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param141 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var ENABLE_TRACE = false; +var SemanticTokensProviderStyling = class SemanticTokensProviderStyling2 { + constructor(_legend, _themeService, _languageService, _logService) { + this._legend = _legend; + this._themeService = _themeService; + this._languageService = _languageService; + this._logService = _logService; + this._hasWarnedOverlappingTokens = false; + this._hasWarnedInvalidLengthTokens = false; + this._hasWarnedInvalidEditStart = false; + this._hashTable = new HashTable(); + } + getMetadata(tokenTypeIndex, tokenModifierSet, languageId) { + const encodedLanguageId = this._languageService.languageIdCodec.encodeLanguageId(languageId); + const entry = this._hashTable.get(tokenTypeIndex, tokenModifierSet, encodedLanguageId); + let metadata; + if (entry) { + metadata = entry.metadata; + if (ENABLE_TRACE && this._logService.getLevel() === LogLevel.Trace) { + this._logService.trace(`SemanticTokensProviderStyling [CACHED] ${tokenTypeIndex} / ${tokenModifierSet}: foreground ${TokenMetadata.getForeground(metadata)}, fontStyle ${TokenMetadata.getFontStyle(metadata).toString(2)}`); + } + } else { + let tokenType = this._legend.tokenTypes[tokenTypeIndex]; + const tokenModifiers = []; + if (tokenType) { + let modifierSet = tokenModifierSet; + for (let modifierIndex = 0; modifierSet > 0 && modifierIndex < this._legend.tokenModifiers.length; modifierIndex++) { + if (modifierSet & 1) { + tokenModifiers.push(this._legend.tokenModifiers[modifierIndex]); + } + modifierSet = modifierSet >> 1; + } + if (ENABLE_TRACE && modifierSet > 0 && this._logService.getLevel() === LogLevel.Trace) { + this._logService.trace(`SemanticTokensProviderStyling: unknown token modifier index: ${tokenModifierSet.toString(2)} for legend: ${JSON.stringify(this._legend.tokenModifiers)}`); + tokenModifiers.push("not-in-legend"); + } + const tokenStyle = this._themeService.getColorTheme().getTokenStyleMetadata(tokenType, tokenModifiers, languageId); + if (typeof tokenStyle === "undefined") { + metadata = 2147483647; + } else { + metadata = 0; + if (typeof tokenStyle.italic !== "undefined") { + const italicBit = (tokenStyle.italic ? 1 : 0) << 11; + metadata |= italicBit | 1; + } + if (typeof tokenStyle.bold !== "undefined") { + const boldBit = (tokenStyle.bold ? 2 : 0) << 11; + metadata |= boldBit | 2; + } + if (typeof tokenStyle.underline !== "undefined") { + const underlineBit = (tokenStyle.underline ? 4 : 0) << 11; + metadata |= underlineBit | 4; + } + if (typeof tokenStyle.strikethrough !== "undefined") { + const strikethroughBit = (tokenStyle.strikethrough ? 8 : 0) << 11; + metadata |= strikethroughBit | 8; + } + if (tokenStyle.foreground) { + const foregroundBits = tokenStyle.foreground << 15; + metadata |= foregroundBits | 16; + } + if (metadata === 0) { + metadata = 2147483647; + } + } + } else { + if (ENABLE_TRACE && this._logService.getLevel() === LogLevel.Trace) { + this._logService.trace(`SemanticTokensProviderStyling: unknown token type index: ${tokenTypeIndex} for legend: ${JSON.stringify(this._legend.tokenTypes)}`); + } + metadata = 2147483647; + tokenType = "not-in-legend"; + } + this._hashTable.add(tokenTypeIndex, tokenModifierSet, encodedLanguageId, metadata); + if (ENABLE_TRACE && this._logService.getLevel() === LogLevel.Trace) { + this._logService.trace(`SemanticTokensProviderStyling ${tokenTypeIndex} (${tokenType}) / ${tokenModifierSet} (${tokenModifiers.join(" ")}): foreground ${TokenMetadata.getForeground(metadata)}, fontStyle ${TokenMetadata.getFontStyle(metadata).toString(2)}`); + } + } + return metadata; + } + warnOverlappingSemanticTokens(lineNumber, startColumn) { + if (!this._hasWarnedOverlappingTokens) { + this._hasWarnedOverlappingTokens = true; + this._logService.warn(`Overlapping semantic tokens detected at lineNumber ${lineNumber}, column ${startColumn}`); + } + } + warnInvalidLengthSemanticTokens(lineNumber, startColumn) { + if (!this._hasWarnedInvalidLengthTokens) { + this._hasWarnedInvalidLengthTokens = true; + this._logService.warn(`Semantic token with invalid length detected at lineNumber ${lineNumber}, column ${startColumn}`); + } + } + warnInvalidEditStart(previousResultId, resultId, editIndex, editStart, maxExpectedStart) { + if (!this._hasWarnedInvalidEditStart) { + this._hasWarnedInvalidEditStart = true; + this._logService.warn(`Invalid semantic tokens edit detected (previousResultId: ${previousResultId}, resultId: ${resultId}) at edit #${editIndex}: The provided start offset ${editStart} is outside the previous data (length ${maxExpectedStart}).`); + } + } +}; +SemanticTokensProviderStyling = __decorate147([ + __param141(1, IThemeService), + __param141(2, ILanguageService), + __param141(3, ILogService) +], SemanticTokensProviderStyling); +function toMultilineTokens2(tokens, styling, languageId) { + const srcData = tokens.data; + const tokenCount = tokens.data.length / 5 | 0; + const tokensPerArea = Math.max( + Math.ceil( + tokenCount / 1024 + /* SemanticColoringConstants.DesiredMaxAreas */ + ), + 400 + /* SemanticColoringConstants.DesiredTokensPerArea */ + ); + const result = []; + let tokenIndex = 0; + let lastLineNumber = 1; + let lastStartCharacter = 0; + while (tokenIndex < tokenCount) { + const tokenStartIndex = tokenIndex; + let tokenEndIndex = Math.min(tokenStartIndex + tokensPerArea, tokenCount); + if (tokenEndIndex < tokenCount) { + let smallTokenEndIndex = tokenEndIndex; + while (smallTokenEndIndex - 1 > tokenStartIndex && srcData[5 * smallTokenEndIndex] === 0) { + smallTokenEndIndex--; + } + if (smallTokenEndIndex - 1 === tokenStartIndex) { + let bigTokenEndIndex = tokenEndIndex; + while (bigTokenEndIndex + 1 < tokenCount && srcData[5 * bigTokenEndIndex] === 0) { + bigTokenEndIndex++; + } + tokenEndIndex = bigTokenEndIndex; + } else { + tokenEndIndex = smallTokenEndIndex; + } + } + let destData = new Uint32Array((tokenEndIndex - tokenStartIndex) * 4); + let destOffset = 0; + let areaLine = 0; + let prevLineNumber = 0; + let prevEndCharacter = 0; + while (tokenIndex < tokenEndIndex) { + const srcOffset = 5 * tokenIndex; + const deltaLine = srcData[srcOffset]; + const deltaCharacter = srcData[srcOffset + 1]; + const lineNumber = lastLineNumber + deltaLine | 0; + const startCharacter = deltaLine === 0 ? lastStartCharacter + deltaCharacter | 0 : deltaCharacter; + const length = srcData[srcOffset + 2]; + const endCharacter = startCharacter + length | 0; + const tokenTypeIndex = srcData[srcOffset + 3]; + const tokenModifierSet = srcData[srcOffset + 4]; + if (endCharacter <= startCharacter) { + styling.warnInvalidLengthSemanticTokens(lineNumber, startCharacter + 1); + } else if (prevLineNumber === lineNumber && prevEndCharacter > startCharacter) { + styling.warnOverlappingSemanticTokens(lineNumber, startCharacter + 1); + } else { + const metadata = styling.getMetadata(tokenTypeIndex, tokenModifierSet, languageId); + if (metadata !== 2147483647) { + if (areaLine === 0) { + areaLine = lineNumber; + } + destData[destOffset] = lineNumber - areaLine; + destData[destOffset + 1] = startCharacter; + destData[destOffset + 2] = endCharacter; + destData[destOffset + 3] = metadata; + destOffset += 4; + prevLineNumber = lineNumber; + prevEndCharacter = endCharacter; + } + } + lastLineNumber = lineNumber; + lastStartCharacter = startCharacter; + tokenIndex++; + } + if (destOffset !== destData.length) { + destData = destData.subarray(0, destOffset); + } + const tokens2 = SparseMultilineTokens.create(areaLine, destData); + result.push(tokens2); + } + return result; +} +var HashTableEntry = class { + constructor(tokenTypeIndex, tokenModifierSet, languageId, metadata) { + this.tokenTypeIndex = tokenTypeIndex; + this.tokenModifierSet = tokenModifierSet; + this.languageId = languageId; + this.metadata = metadata; + this.next = null; + } +}; +var HashTable = class _HashTable { + static { + this._SIZES = [3, 7, 13, 31, 61, 127, 251, 509, 1021, 2039, 4093, 8191, 16381, 32749, 65521, 131071, 262139, 524287, 1048573, 2097143]; + } + constructor() { + this._elementsCount = 0; + this._currentLengthIndex = 0; + this._currentLength = _HashTable._SIZES[this._currentLengthIndex]; + this._growCount = Math.round(this._currentLengthIndex + 1 < _HashTable._SIZES.length ? 2 / 3 * this._currentLength : 0); + this._elements = []; + _HashTable._nullOutEntries(this._elements, this._currentLength); + } + static _nullOutEntries(entries2, length) { + for (let i2 = 0; i2 < length; i2++) { + entries2[i2] = null; + } + } + _hash2(n1, n2) { + return (n1 << 5) - n1 + n2 | 0; + } + _hashFunc(tokenTypeIndex, tokenModifierSet, languageId) { + return this._hash2(this._hash2(tokenTypeIndex, tokenModifierSet), languageId) % this._currentLength; + } + get(tokenTypeIndex, tokenModifierSet, languageId) { + const hash2 = this._hashFunc(tokenTypeIndex, tokenModifierSet, languageId); + let p = this._elements[hash2]; + while (p) { + if (p.tokenTypeIndex === tokenTypeIndex && p.tokenModifierSet === tokenModifierSet && p.languageId === languageId) { + return p; + } + p = p.next; + } + return null; + } + add(tokenTypeIndex, tokenModifierSet, languageId, metadata) { + this._elementsCount++; + if (this._growCount !== 0 && this._elementsCount >= this._growCount) { + const oldElements = this._elements; + this._currentLengthIndex++; + this._currentLength = _HashTable._SIZES[this._currentLengthIndex]; + this._growCount = Math.round(this._currentLengthIndex + 1 < _HashTable._SIZES.length ? 2 / 3 * this._currentLength : 0); + this._elements = []; + _HashTable._nullOutEntries(this._elements, this._currentLength); + for (const first2 of oldElements) { + let p = first2; + while (p) { + const oldNext = p.next; + p.next = null; + this._add(p); + p = oldNext; + } + } + } + this._add(new HashTableEntry(tokenTypeIndex, tokenModifierSet, languageId, metadata)); + } + _add(element) { + const hash2 = this._hashFunc(element.tokenTypeIndex, element.tokenModifierSet, element.languageId); + element.next = this._elements[hash2]; + this._elements[hash2] = element; + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/common/services/semanticTokensStyling.js +init_instantiation(); +var ISemanticTokensStylingService = createDecorator("semanticTokensStylingService"); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/semanticTokens/common/getSemanticTokens.js +init_cancellation(); +init_errors(); +init_uri(); +init_model(); +init_commands(); +init_types(); + +// node_modules/monaco-editor-core/esm/vs/editor/common/services/semanticTokensDto.js +init_buffer(); +init_platform(); +function reverseEndianness(arr) { + for (let i2 = 0, len = arr.length; i2 < len; i2 += 4) { + const b0 = arr[i2 + 0]; + const b1 = arr[i2 + 1]; + const b2 = arr[i2 + 2]; + const b3 = arr[i2 + 3]; + arr[i2 + 0] = b3; + arr[i2 + 1] = b2; + arr[i2 + 2] = b1; + arr[i2 + 3] = b0; + } +} +function toLittleEndianBuffer(arr) { + const uint8Arr = new Uint8Array(arr.buffer, arr.byteOffset, arr.length * 4); + if (!isLittleEndian()) { + reverseEndianness(uint8Arr); + } + return VSBuffer.wrap(uint8Arr); +} +function encodeSemanticTokensDto(semanticTokens) { + const dest = new Uint32Array(encodeSemanticTokensDtoSize(semanticTokens)); + let offset = 0; + dest[offset++] = semanticTokens.id; + if (semanticTokens.type === "full") { + dest[offset++] = 1; + dest[offset++] = semanticTokens.data.length; + dest.set(semanticTokens.data, offset); + offset += semanticTokens.data.length; + } else { + dest[offset++] = 2; + dest[offset++] = semanticTokens.deltas.length; + for (const delta of semanticTokens.deltas) { + dest[offset++] = delta.start; + dest[offset++] = delta.deleteCount; + if (delta.data) { + dest[offset++] = delta.data.length; + dest.set(delta.data, offset); + offset += delta.data.length; + } else { + dest[offset++] = 0; + } + } + } + return toLittleEndianBuffer(dest); +} +function encodeSemanticTokensDtoSize(semanticTokens) { + let result = 0; + result += 1 + 1; + if (semanticTokens.type === "full") { + result += 1 + semanticTokens.data.length; + } else { + result += 1; + result += (1 + 1 + 1) * semanticTokens.deltas.length; + for (const delta of semanticTokens.deltas) { + if (delta.data) { + result += delta.data.length; + } + } + } + return result; +} + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/semanticTokens/common/getSemanticTokens.js +init_range(); +init_languageFeatures(); +function isSemanticTokens(v) { + return v && !!v.data; +} +function isSemanticTokensEdits(v) { + return v && Array.isArray(v.edits); +} +var DocumentSemanticTokensResult = class { + constructor(provider, tokens, error) { + this.provider = provider; + this.tokens = tokens; + this.error = error; + } +}; +function hasDocumentSemanticTokensProvider(registry, model) { + return registry.has(model); +} +function getDocumentSemanticTokensProviders(registry, model) { + const groups = registry.orderedGroups(model); + return groups.length > 0 ? groups[0] : []; +} +async function getDocumentSemanticTokens(registry, model, lastProvider, lastResultId, token) { + const providers = getDocumentSemanticTokensProviders(registry, model); + const results = await Promise.all(providers.map(async (provider) => { + let result; + let error = null; + try { + result = await provider.provideDocumentSemanticTokens(model, provider === lastProvider ? lastResultId : null, token); + } catch (err) { + error = err; + result = null; + } + if (!result || !isSemanticTokens(result) && !isSemanticTokensEdits(result)) { + result = null; + } + return new DocumentSemanticTokensResult(provider, result, error); + })); + for (const result of results) { + if (result.error) { + throw result.error; + } + if (result.tokens) { + return result; + } + } + if (results.length > 0) { + return results[0]; + } + return null; +} +function _getDocumentSemanticTokensProviderHighestGroup(registry, model) { + const result = registry.orderedGroups(model); + return result.length > 0 ? result[0] : null; +} +var DocumentRangeSemanticTokensResult = class { + constructor(provider, tokens) { + this.provider = provider; + this.tokens = tokens; + } +}; +function hasDocumentRangeSemanticTokensProvider(providers, model) { + return providers.has(model); +} +function getDocumentRangeSemanticTokensProviders(providers, model) { + const groups = providers.orderedGroups(model); + return groups.length > 0 ? groups[0] : []; +} +async function getDocumentRangeSemanticTokens(registry, model, range2, token) { + const providers = getDocumentRangeSemanticTokensProviders(registry, model); + const results = await Promise.all(providers.map(async (provider) => { + let result; + try { + result = await provider.provideDocumentRangeSemanticTokens(model, range2, token); + } catch (err) { + onUnexpectedExternalError(err); + result = null; + } + if (!result || !isSemanticTokens(result)) { + result = null; + } + return new DocumentRangeSemanticTokensResult(provider, result); + })); + for (const result of results) { + if (result.tokens) { + return result; + } + } + if (results.length > 0) { + return results[0]; + } + return null; +} +CommandsRegistry.registerCommand("_provideDocumentSemanticTokensLegend", async (accessor, ...args) => { + const [uri] = args; + assertType(uri instanceof URI); + const model = accessor.get(IModelService).getModel(uri); + if (!model) { + return void 0; + } + const { documentSemanticTokensProvider } = accessor.get(ILanguageFeaturesService); + const providers = _getDocumentSemanticTokensProviderHighestGroup(documentSemanticTokensProvider, model); + if (!providers) { + return accessor.get(ICommandService).executeCommand("_provideDocumentRangeSemanticTokensLegend", uri); + } + return providers[0].getLegend(); +}); +CommandsRegistry.registerCommand("_provideDocumentSemanticTokens", async (accessor, ...args) => { + const [uri] = args; + assertType(uri instanceof URI); + const model = accessor.get(IModelService).getModel(uri); + if (!model) { + return void 0; + } + const { documentSemanticTokensProvider } = accessor.get(ILanguageFeaturesService); + if (!hasDocumentSemanticTokensProvider(documentSemanticTokensProvider, model)) { + return accessor.get(ICommandService).executeCommand("_provideDocumentRangeSemanticTokens", uri, model.getFullModelRange()); + } + const r = await getDocumentSemanticTokens(documentSemanticTokensProvider, model, null, null, CancellationToken.None); + if (!r) { + return void 0; + } + const { provider, tokens } = r; + if (!tokens || !isSemanticTokens(tokens)) { + return void 0; + } + const buff = encodeSemanticTokensDto({ + id: 0, + type: "full", + data: tokens.data + }); + if (tokens.resultId) { + provider.releaseDocumentSemanticTokens(tokens.resultId); + } + return buff; +}); +CommandsRegistry.registerCommand("_provideDocumentRangeSemanticTokensLegend", async (accessor, ...args) => { + const [uri, range2] = args; + assertType(uri instanceof URI); + const model = accessor.get(IModelService).getModel(uri); + if (!model) { + return void 0; + } + const { documentRangeSemanticTokensProvider } = accessor.get(ILanguageFeaturesService); + const providers = getDocumentRangeSemanticTokensProviders(documentRangeSemanticTokensProvider, model); + if (providers.length === 0) { + return void 0; + } + if (providers.length === 1) { + return providers[0].getLegend(); + } + if (!range2 || !Range.isIRange(range2)) { + console.warn(`provideDocumentRangeSemanticTokensLegend might be out-of-sync with provideDocumentRangeSemanticTokens unless a range argument is passed in`); + return providers[0].getLegend(); + } + const result = await getDocumentRangeSemanticTokens(documentRangeSemanticTokensProvider, model, Range.lift(range2), CancellationToken.None); + if (!result) { + return void 0; + } + return result.provider.getLegend(); +}); +CommandsRegistry.registerCommand("_provideDocumentRangeSemanticTokens", async (accessor, ...args) => { + const [uri, range2] = args; + assertType(uri instanceof URI); + assertType(Range.isIRange(range2)); + const model = accessor.get(IModelService).getModel(uri); + if (!model) { + return void 0; + } + const { documentRangeSemanticTokensProvider } = accessor.get(ILanguageFeaturesService); + const result = await getDocumentRangeSemanticTokens(documentRangeSemanticTokensProvider, model, Range.lift(range2), CancellationToken.None); + if (!result || !result.tokens) { + return void 0; + } + return encodeSemanticTokensDto({ + id: 0, + type: "full", + data: result.tokens.data + }); +}); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/semanticTokens/common/semanticTokensConfig.js +var SEMANTIC_HIGHLIGHTING_SETTING_ID = "editor.semanticHighlighting"; +function isSemanticColoringEnabled(model, themeService, configurationService) { + const setting = configurationService.getValue(SEMANTIC_HIGHLIGHTING_SETTING_ID, { overrideIdentifier: model.getLanguageId(), resource: model.uri })?.enabled; + if (typeof setting === "boolean") { + return setting; + } + return themeService.getColorTheme().semanticHighlighting; +} + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/semanticTokens/browser/documentSemanticTokens.js +var __decorate148 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param142 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var ModelSemanticColoring_1; +var DocumentSemanticTokensFeature = class DocumentSemanticTokensFeature2 extends Disposable { + constructor(semanticTokensStylingService, modelService, themeService, configurationService, languageFeatureDebounceService, languageFeaturesService) { + super(); + this._watchers = new ResourceMap(); + const register4 = (model) => { + this._watchers.get(model.uri)?.dispose(); + this._watchers.set(model.uri, new ModelSemanticColoring(model, semanticTokensStylingService, themeService, languageFeatureDebounceService, languageFeaturesService)); + }; + const deregister = (model, modelSemanticColoring) => { + modelSemanticColoring.dispose(); + this._watchers.delete(model.uri); + }; + const handleSettingOrThemeChange = () => { + for (const model of modelService.getModels()) { + const curr = this._watchers.get(model.uri); + if (isSemanticColoringEnabled(model, themeService, configurationService)) { + if (!curr) { + register4(model); + } + } else { + if (curr) { + deregister(model, curr); + } + } + } + }; + modelService.getModels().forEach((model) => { + if (isSemanticColoringEnabled(model, themeService, configurationService)) { + register4(model); + } + }); + this._register(modelService.onModelAdded((model) => { + if (isSemanticColoringEnabled(model, themeService, configurationService)) { + register4(model); + } + })); + this._register(modelService.onModelRemoved((model) => { + const curr = this._watchers.get(model.uri); + if (curr) { + deregister(model, curr); + } + })); + this._register(configurationService.onDidChangeConfiguration((e) => { + if (e.affectsConfiguration(SEMANTIC_HIGHLIGHTING_SETTING_ID)) { + handleSettingOrThemeChange(); + } + })); + this._register(themeService.onDidColorThemeChange(handleSettingOrThemeChange)); + } + dispose() { + dispose(this._watchers.values()); + this._watchers.clear(); + super.dispose(); + } +}; +DocumentSemanticTokensFeature = __decorate148([ + __param142(0, ISemanticTokensStylingService), + __param142(1, IModelService), + __param142(2, IThemeService), + __param142(3, IConfigurationService), + __param142(4, ILanguageFeatureDebounceService), + __param142(5, ILanguageFeaturesService) +], DocumentSemanticTokensFeature); +var ModelSemanticColoring = class ModelSemanticColoring2 extends Disposable { + static { + ModelSemanticColoring_1 = this; + } + static { + this.REQUEST_MIN_DELAY = 300; + } + static { + this.REQUEST_MAX_DELAY = 2e3; + } + constructor(model, _semanticTokensStylingService, themeService, languageFeatureDebounceService, languageFeaturesService) { + super(); + this._semanticTokensStylingService = _semanticTokensStylingService; + this._isDisposed = false; + this._model = model; + this._provider = languageFeaturesService.documentSemanticTokensProvider; + this._debounceInformation = languageFeatureDebounceService.for(this._provider, "DocumentSemanticTokens", { min: ModelSemanticColoring_1.REQUEST_MIN_DELAY, max: ModelSemanticColoring_1.REQUEST_MAX_DELAY }); + this._fetchDocumentSemanticTokens = this._register(new RunOnceScheduler(() => this._fetchDocumentSemanticTokensNow(), ModelSemanticColoring_1.REQUEST_MIN_DELAY)); + this._currentDocumentResponse = null; + this._currentDocumentRequestCancellationTokenSource = null; + this._documentProvidersChangeListeners = []; + this._providersChangedDuringRequest = false; + this._register(this._model.onDidChangeContent(() => { + if (!this._fetchDocumentSemanticTokens.isScheduled()) { + this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model)); + } + })); + this._register(this._model.onDidChangeAttached(() => { + if (!this._fetchDocumentSemanticTokens.isScheduled()) { + this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model)); + } + })); + this._register(this._model.onDidChangeLanguage(() => { + if (this._currentDocumentResponse) { + this._currentDocumentResponse.dispose(); + this._currentDocumentResponse = null; + } + if (this._currentDocumentRequestCancellationTokenSource) { + this._currentDocumentRequestCancellationTokenSource.cancel(); + this._currentDocumentRequestCancellationTokenSource = null; + } + this._setDocumentSemanticTokens(null, null, null, []); + this._fetchDocumentSemanticTokens.schedule(0); + })); + const bindDocumentChangeListeners = () => { + dispose(this._documentProvidersChangeListeners); + this._documentProvidersChangeListeners = []; + for (const provider of this._provider.all(model)) { + if (typeof provider.onDidChange === "function") { + this._documentProvidersChangeListeners.push(provider.onDidChange(() => { + if (this._currentDocumentRequestCancellationTokenSource) { + this._providersChangedDuringRequest = true; + return; + } + this._fetchDocumentSemanticTokens.schedule(0); + })); + } + } + }; + bindDocumentChangeListeners(); + this._register(this._provider.onDidChange(() => { + bindDocumentChangeListeners(); + this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model)); + })); + this._register(themeService.onDidColorThemeChange((_) => { + this._setDocumentSemanticTokens(null, null, null, []); + this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model)); + })); + this._fetchDocumentSemanticTokens.schedule(0); + } + dispose() { + if (this._currentDocumentResponse) { + this._currentDocumentResponse.dispose(); + this._currentDocumentResponse = null; + } + if (this._currentDocumentRequestCancellationTokenSource) { + this._currentDocumentRequestCancellationTokenSource.cancel(); + this._currentDocumentRequestCancellationTokenSource = null; + } + dispose(this._documentProvidersChangeListeners); + this._documentProvidersChangeListeners = []; + this._setDocumentSemanticTokens(null, null, null, []); + this._isDisposed = true; + super.dispose(); + } + _fetchDocumentSemanticTokensNow() { + if (this._currentDocumentRequestCancellationTokenSource) { + return; + } + if (!hasDocumentSemanticTokensProvider(this._provider, this._model)) { + if (this._currentDocumentResponse) { + this._model.tokenization.setSemanticTokens(null, false); + } + return; + } + if (!this._model.isAttachedToEditor()) { + return; + } + const cancellationTokenSource = new CancellationTokenSource(); + const lastProvider = this._currentDocumentResponse ? this._currentDocumentResponse.provider : null; + const lastResultId = this._currentDocumentResponse ? this._currentDocumentResponse.resultId || null : null; + const request = getDocumentSemanticTokens(this._provider, this._model, lastProvider, lastResultId, cancellationTokenSource.token); + this._currentDocumentRequestCancellationTokenSource = cancellationTokenSource; + this._providersChangedDuringRequest = false; + const pendingChanges = []; + const contentChangeListener = this._model.onDidChangeContent((e) => { + pendingChanges.push(e); + }); + const sw = new StopWatch(false); + request.then((res) => { + this._debounceInformation.update(this._model, sw.elapsed()); + this._currentDocumentRequestCancellationTokenSource = null; + contentChangeListener.dispose(); + if (!res) { + this._setDocumentSemanticTokens(null, null, null, pendingChanges); + } else { + const { provider, tokens } = res; + const styling = this._semanticTokensStylingService.getStyling(provider); + this._setDocumentSemanticTokens(provider, tokens || null, styling, pendingChanges); + } + }, (err) => { + const isExpectedError = err && (isCancellationError(err) || typeof err.message === "string" && err.message.indexOf("busy") !== -1); + if (!isExpectedError) { + onUnexpectedError(err); + } + this._currentDocumentRequestCancellationTokenSource = null; + contentChangeListener.dispose(); + if (pendingChanges.length > 0 || this._providersChangedDuringRequest) { + if (!this._fetchDocumentSemanticTokens.isScheduled()) { + this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model)); + } + } + }); + } + static _copy(src, srcOffset, dest, destOffset, length) { + length = Math.min(length, dest.length - destOffset, src.length - srcOffset); + for (let i2 = 0; i2 < length; i2++) { + dest[destOffset + i2] = src[srcOffset + i2]; + } + } + _setDocumentSemanticTokens(provider, tokens, styling, pendingChanges) { + const currentResponse = this._currentDocumentResponse; + const rescheduleIfNeeded = () => { + if ((pendingChanges.length > 0 || this._providersChangedDuringRequest) && !this._fetchDocumentSemanticTokens.isScheduled()) { + this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model)); + } + }; + if (this._currentDocumentResponse) { + this._currentDocumentResponse.dispose(); + this._currentDocumentResponse = null; + } + if (this._isDisposed) { + if (provider && tokens) { + provider.releaseDocumentSemanticTokens(tokens.resultId); + } + return; + } + if (!provider || !styling) { + this._model.tokenization.setSemanticTokens(null, false); + return; + } + if (!tokens) { + this._model.tokenization.setSemanticTokens(null, true); + rescheduleIfNeeded(); + return; + } + if (isSemanticTokensEdits(tokens)) { + if (!currentResponse) { + this._model.tokenization.setSemanticTokens(null, true); + return; + } + if (tokens.edits.length === 0) { + tokens = { + resultId: tokens.resultId, + data: currentResponse.data + }; + } else { + let deltaLength = 0; + for (const edit2 of tokens.edits) { + deltaLength += (edit2.data ? edit2.data.length : 0) - edit2.deleteCount; + } + const srcData = currentResponse.data; + const destData = new Uint32Array(srcData.length + deltaLength); + let srcLastStart = srcData.length; + let destLastStart = destData.length; + for (let i2 = tokens.edits.length - 1; i2 >= 0; i2--) { + const edit2 = tokens.edits[i2]; + if (edit2.start > srcData.length) { + styling.warnInvalidEditStart(currentResponse.resultId, tokens.resultId, i2, edit2.start, srcData.length); + this._model.tokenization.setSemanticTokens(null, true); + return; + } + const copyCount = srcLastStart - (edit2.start + edit2.deleteCount); + if (copyCount > 0) { + ModelSemanticColoring_1._copy(srcData, srcLastStart - copyCount, destData, destLastStart - copyCount, copyCount); + destLastStart -= copyCount; + } + if (edit2.data) { + ModelSemanticColoring_1._copy(edit2.data, 0, destData, destLastStart - edit2.data.length, edit2.data.length); + destLastStart -= edit2.data.length; + } + srcLastStart = edit2.start; + } + if (srcLastStart > 0) { + ModelSemanticColoring_1._copy(srcData, 0, destData, 0, srcLastStart); + } + tokens = { + resultId: tokens.resultId, + data: destData + }; + } + } + if (isSemanticTokens(tokens)) { + this._currentDocumentResponse = new SemanticTokensResponse(provider, tokens.resultId, tokens.data); + const result = toMultilineTokens2(tokens, styling, this._model.getLanguageId()); + if (pendingChanges.length > 0) { + for (const change of pendingChanges) { + for (const area of result) { + for (const singleChange of change.changes) { + area.applyEdit(singleChange.range, singleChange.text); + } + } + } + } + this._model.tokenization.setSemanticTokens(result, true); + } else { + this._model.tokenization.setSemanticTokens(null, true); + } + rescheduleIfNeeded(); + } +}; +ModelSemanticColoring = ModelSemanticColoring_1 = __decorate148([ + __param142(1, ISemanticTokensStylingService), + __param142(2, IThemeService), + __param142(3, ILanguageFeatureDebounceService), + __param142(4, ILanguageFeaturesService) +], ModelSemanticColoring); +var SemanticTokensResponse = class { + constructor(provider, resultId, data) { + this.provider = provider; + this.resultId = resultId; + this.data = data; + } + dispose() { + this.provider.releaseDocumentSemanticTokens(this.resultId); + } +}; +registerEditorFeature(DocumentSemanticTokensFeature); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/semanticTokens/browser/viewportSemanticTokens.js +init_async(); +init_lifecycle(); +init_editorExtensions(); +init_configuration(); +init_themeService(); +init_languageFeatureDebounce(); +init_stopwatch(); +init_languageFeatures(); +var __decorate149 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param143 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var ViewportSemanticTokensContribution = class ViewportSemanticTokensContribution2 extends Disposable { + static { + this.ID = "editor.contrib.viewportSemanticTokens"; + } + constructor(editor2, _semanticTokensStylingService, _themeService, _configurationService, languageFeatureDebounceService, languageFeaturesService) { + super(); + this._semanticTokensStylingService = _semanticTokensStylingService; + this._themeService = _themeService; + this._configurationService = _configurationService; + this._editor = editor2; + this._provider = languageFeaturesService.documentRangeSemanticTokensProvider; + this._debounceInformation = languageFeatureDebounceService.for(this._provider, "DocumentRangeSemanticTokens", { min: 100, max: 500 }); + this._tokenizeViewport = this._register(new RunOnceScheduler(() => this._tokenizeViewportNow(), 100)); + this._outstandingRequests = []; + this._rangeProvidersChangeListeners = []; + const scheduleTokenizeViewport = () => { + if (this._editor.hasModel()) { + this._tokenizeViewport.schedule(this._debounceInformation.get(this._editor.getModel())); + } + }; + const bindRangeProvidersChangeListeners = () => { + this._cleanupProviderListeners(); + if (this._editor.hasModel()) { + const model = this._editor.getModel(); + for (const provider of this._provider.all(model)) { + const disposable = provider.onDidChange?.(() => { + this._cancelAll(); + scheduleTokenizeViewport(); + }); + if (disposable) { + this._rangeProvidersChangeListeners.push(disposable); + } + } + } + }; + this._register(this._editor.onDidScrollChange(() => { + scheduleTokenizeViewport(); + })); + this._register(this._editor.onDidChangeModel(() => { + bindRangeProvidersChangeListeners(); + this._cancelAll(); + scheduleTokenizeViewport(); + })); + this._register(this._editor.onDidChangeModelLanguage(() => { + bindRangeProvidersChangeListeners(); + this._cancelAll(); + scheduleTokenizeViewport(); + })); + this._register(this._editor.onDidChangeModelContent((e) => { + this._cancelAll(); + scheduleTokenizeViewport(); + })); + bindRangeProvidersChangeListeners(); + this._register(this._provider.onDidChange(() => { + bindRangeProvidersChangeListeners(); + this._cancelAll(); + scheduleTokenizeViewport(); + })); + this._register(this._configurationService.onDidChangeConfiguration((e) => { + if (e.affectsConfiguration(SEMANTIC_HIGHLIGHTING_SETTING_ID)) { + this._cancelAll(); + scheduleTokenizeViewport(); + } + })); + this._register(this._themeService.onDidColorThemeChange(() => { + this._cancelAll(); + scheduleTokenizeViewport(); + })); + scheduleTokenizeViewport(); + } + dispose() { + this._cleanupProviderListeners(); + super.dispose(); + } + _cleanupProviderListeners() { + dispose(this._rangeProvidersChangeListeners); + this._rangeProvidersChangeListeners = []; + } + _cancelAll() { + for (const request of this._outstandingRequests) { + request.cancel(); + } + this._outstandingRequests = []; + } + _removeOutstandingRequest(req) { + for (let i2 = 0, len = this._outstandingRequests.length; i2 < len; i2++) { + if (this._outstandingRequests[i2] === req) { + this._outstandingRequests.splice(i2, 1); + return; + } + } + } + _tokenizeViewportNow() { + if (!this._editor.hasModel()) { + return; + } + const model = this._editor.getModel(); + if (model.tokenization.hasCompleteSemanticTokens()) { + return; + } + if (!isSemanticColoringEnabled(model, this._themeService, this._configurationService)) { + if (model.tokenization.hasSomeSemanticTokens()) { + model.tokenization.setSemanticTokens(null, false); + } + return; + } + if (!hasDocumentRangeSemanticTokensProvider(this._provider, model)) { + if (model.tokenization.hasSomeSemanticTokens()) { + model.tokenization.setSemanticTokens(null, false); + } + return; + } + const visibleRanges = this._editor.getVisibleRangesPlusViewportAboveBelow(); + this._outstandingRequests = this._outstandingRequests.concat(visibleRanges.map((range2) => this._requestRange(model, range2))); + } + _requestRange(model, range2) { + const requestVersionId = model.getVersionId(); + const request = createCancelablePromise((token) => Promise.resolve(getDocumentRangeSemanticTokens(this._provider, model, range2, token))); + const sw = new StopWatch(false); + request.then((r) => { + this._debounceInformation.update(model, sw.elapsed()); + if (!r || !r.tokens || model.isDisposed() || model.getVersionId() !== requestVersionId) { + return; + } + const { provider, tokens: result } = r; + const styling = this._semanticTokensStylingService.getStyling(provider); + model.tokenization.setPartialSemanticTokens(range2, toMultilineTokens2(result, styling, model.getLanguageId())); + }).then(() => this._removeOutstandingRequest(request), () => this._removeOutstandingRequest(request)); + return request; + } +}; +ViewportSemanticTokensContribution = __decorate149([ + __param143(1, ISemanticTokensStylingService), + __param143(2, IThemeService), + __param143(3, IConfigurationService), + __param143(4, ILanguageFeatureDebounceService), + __param143(5, ILanguageFeaturesService) +], ViewportSemanticTokensContribution); +registerEditorContribution( + ViewportSemanticTokensContribution.ID, + ViewportSemanticTokensContribution, + 1 + /* EditorContributionInstantiation.AfterFirstRender */ +); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/smartSelect/browser/smartSelect.js +init_arrays(); +init_cancellation(); +init_errors(); +init_editorExtensions(); +init_position(); +init_range(); +init_selection(); +init_editorContextKeys(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/smartSelect/browser/wordSelections.js +init_strings(); +init_range(); +var WordSelectionRangeProvider = class { + constructor(selectSubwords = true) { + this.selectSubwords = selectSubwords; + } + provideSelectionRanges(model, positions) { + const result = []; + for (const position of positions) { + const bucket = []; + result.push(bucket); + if (this.selectSubwords) { + this._addInWordRanges(bucket, model, position); + } + this._addWordRanges(bucket, model, position); + this._addWhitespaceLine(bucket, model, position); + bucket.push({ range: model.getFullModelRange() }); + } + return result; + } + _addInWordRanges(bucket, model, pos) { + const obj = model.getWordAtPosition(pos); + if (!obj) { + return; + } + const { word, startColumn } = obj; + const offset = pos.column - startColumn; + let start = offset; + let end = offset; + let lastCh = 0; + for (; start >= 0; start--) { + const ch = word.charCodeAt(start); + if (start !== offset && (ch === 95 || ch === 45)) { + break; + } else if (isLowerAsciiLetter(ch) && isUpperAsciiLetter(lastCh)) { + break; + } + lastCh = ch; + } + start += 1; + for (; end < word.length; end++) { + const ch = word.charCodeAt(end); + if (isUpperAsciiLetter(ch) && isLowerAsciiLetter(lastCh)) { + break; + } else if (ch === 95 || ch === 45) { + break; + } + lastCh = ch; + } + if (start < end) { + bucket.push({ range: new Range(pos.lineNumber, startColumn + start, pos.lineNumber, startColumn + end) }); + } + } + _addWordRanges(bucket, model, pos) { + const word = model.getWordAtPosition(pos); + if (word) { + bucket.push({ range: new Range(pos.lineNumber, word.startColumn, pos.lineNumber, word.endColumn) }); + } + } + _addWhitespaceLine(bucket, model, pos) { + if (model.getLineLength(pos.lineNumber) > 0 && model.getLineFirstNonWhitespaceColumn(pos.lineNumber) === 0 && model.getLineLastNonWhitespaceColumn(pos.lineNumber) === 0) { + bucket.push({ range: new Range(pos.lineNumber, 1, pos.lineNumber, model.getLineMaxColumn(pos.lineNumber)) }); + } + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/smartSelect/browser/smartSelect.js +init_nls(); +init_actions2(); +init_commands(); +init_languageFeatures(); +init_resolverService(); +init_types(); +init_uri(); +var __decorate150 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param144 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var SmartSelectController_1; +var SelectionRanges = class _SelectionRanges { + constructor(index, ranges) { + this.index = index; + this.ranges = ranges; + } + mov(fwd) { + const index = this.index + (fwd ? 1 : -1); + if (index < 0 || index >= this.ranges.length) { + return this; + } + const res = new _SelectionRanges(index, this.ranges); + if (res.ranges[index].equalsRange(this.ranges[this.index])) { + return res.mov(fwd); + } + return res; + } +}; +var SmartSelectController = class SmartSelectController2 { + static { + SmartSelectController_1 = this; + } + static { + this.ID = "editor.contrib.smartSelectController"; + } + static get(editor2) { + return editor2.getContribution(SmartSelectController_1.ID); + } + constructor(_editor, _languageFeaturesService) { + this._editor = _editor; + this._languageFeaturesService = _languageFeaturesService; + this._ignoreSelection = false; + } + dispose() { + this._selectionListener?.dispose(); + } + async run(forward) { + if (!this._editor.hasModel()) { + return; + } + const selections = this._editor.getSelections(); + const model = this._editor.getModel(); + if (!this._state) { + await provideSelectionRanges(this._languageFeaturesService.selectionRangeProvider, model, selections.map((s) => s.getPosition()), this._editor.getOption( + 129 + /* EditorOption.smartSelect */ + ), CancellationToken.None).then((ranges) => { + if (!isNonEmptyArray(ranges) || ranges.length !== selections.length) { + return; + } + if (!this._editor.hasModel() || !equals(this._editor.getSelections(), selections, (a, b) => a.equalsSelection(b))) { + return; + } + for (let i2 = 0; i2 < ranges.length; i2++) { + ranges[i2] = ranges[i2].filter((range2) => { + return range2.containsPosition(selections[i2].getStartPosition()) && range2.containsPosition(selections[i2].getEndPosition()); + }); + ranges[i2].unshift(selections[i2]); + } + this._state = ranges.map((ranges2) => new SelectionRanges(0, ranges2)); + this._selectionListener?.dispose(); + this._selectionListener = this._editor.onDidChangeCursorPosition(() => { + if (!this._ignoreSelection) { + this._selectionListener?.dispose(); + this._state = void 0; + } + }); + }); + } + if (!this._state) { + return; + } + this._state = this._state.map((state) => state.mov(forward)); + const newSelections = this._state.map((state) => Selection.fromPositions(state.ranges[state.index].getStartPosition(), state.ranges[state.index].getEndPosition())); + this._ignoreSelection = true; + try { + this._editor.setSelections(newSelections); + } finally { + this._ignoreSelection = false; + } + } +}; +SmartSelectController = SmartSelectController_1 = __decorate150([ + __param144(1, ILanguageFeaturesService) +], SmartSelectController); +var AbstractSmartSelect = class extends EditorAction { + constructor(forward, opts) { + super(opts); + this._forward = forward; + } + async run(_accessor, editor2) { + const controller = SmartSelectController.get(editor2); + if (controller) { + await controller.run(this._forward); + } + } +}; +var GrowSelectionAction = class extends AbstractSmartSelect { + constructor() { + super(true, { + id: "editor.action.smartSelect.expand", + label: localize2(1400, "Expand Selection"), + precondition: void 0, + kbOpts: { + kbExpr: EditorContextKeys.editorTextFocus, + primary: 1024 | 512 | 17, + mac: { + primary: 2048 | 256 | 1024 | 17, + secondary: [ + 256 | 1024 | 17 + /* KeyCode.RightArrow */ + ] + }, + weight: 100 + /* KeybindingWeight.EditorContrib */ + }, + menuOpts: { + menuId: MenuId.MenubarSelectionMenu, + group: "1_basic", + title: localize(1398, "&&Expand Selection"), + order: 2 + } + }); + } +}; +CommandsRegistry.registerCommandAlias("editor.action.smartSelect.grow", "editor.action.smartSelect.expand"); +var ShrinkSelectionAction = class extends AbstractSmartSelect { + constructor() { + super(false, { + id: "editor.action.smartSelect.shrink", + label: localize2(1401, "Shrink Selection"), + precondition: void 0, + kbOpts: { + kbExpr: EditorContextKeys.editorTextFocus, + primary: 1024 | 512 | 15, + mac: { + primary: 2048 | 256 | 1024 | 15, + secondary: [ + 256 | 1024 | 15 + /* KeyCode.LeftArrow */ + ] + }, + weight: 100 + /* KeybindingWeight.EditorContrib */ + }, + menuOpts: { + menuId: MenuId.MenubarSelectionMenu, + group: "1_basic", + title: localize(1399, "&&Shrink Selection"), + order: 3 + } + }); + } +}; +registerEditorContribution( + SmartSelectController.ID, + SmartSelectController, + 4 + /* EditorContributionInstantiation.Lazy */ +); +registerEditorAction(GrowSelectionAction); +registerEditorAction(ShrinkSelectionAction); +async function provideSelectionRanges(registry, model, positions, options2, token) { + const providers = registry.all(model).concat(new WordSelectionRangeProvider(options2.selectSubwords)); + if (providers.length === 1) { + providers.unshift(new BracketSelectionRangeProvider()); + } + const work = []; + const allRawRanges = []; + for (const provider of providers) { + work.push(Promise.resolve(provider.provideSelectionRanges(model, positions, token)).then((allProviderRanges) => { + if (isNonEmptyArray(allProviderRanges) && allProviderRanges.length === positions.length) { + for (let i2 = 0; i2 < positions.length; i2++) { + if (!allRawRanges[i2]) { + allRawRanges[i2] = []; + } + for (const oneProviderRanges of allProviderRanges[i2]) { + if (Range.isIRange(oneProviderRanges.range) && Range.containsPosition(oneProviderRanges.range, positions[i2])) { + allRawRanges[i2].push(Range.lift(oneProviderRanges.range)); + } + } + } + } + }, onUnexpectedExternalError)); + } + await Promise.all(work); + return allRawRanges.map((oneRawRanges) => { + if (oneRawRanges.length === 0) { + return []; + } + oneRawRanges.sort((a, b) => { + if (Position.isBefore(a.getStartPosition(), b.getStartPosition())) { + return 1; + } else if (Position.isBefore(b.getStartPosition(), a.getStartPosition())) { + return -1; + } else if (Position.isBefore(a.getEndPosition(), b.getEndPosition())) { + return -1; + } else if (Position.isBefore(b.getEndPosition(), a.getEndPosition())) { + return 1; + } else { + return 0; + } + }); + const oneRanges = []; + let last; + for (const range2 of oneRawRanges) { + if (!last || Range.containsRange(range2, last) && !Range.equalsRange(range2, last)) { + oneRanges.push(range2); + last = range2; + } + } + if (!options2.selectLeadingAndTrailingWhitespace) { + return oneRanges; + } + const oneRangesWithTrivia = [oneRanges[0]]; + for (let i2 = 1; i2 < oneRanges.length; i2++) { + const prev = oneRanges[i2 - 1]; + const cur = oneRanges[i2]; + if (cur.startLineNumber !== prev.startLineNumber || cur.endLineNumber !== prev.endLineNumber) { + const rangeNoWhitespace = new Range(prev.startLineNumber, model.getLineFirstNonWhitespaceColumn(prev.startLineNumber), prev.endLineNumber, model.getLineLastNonWhitespaceColumn(prev.endLineNumber)); + if (rangeNoWhitespace.containsRange(prev) && !rangeNoWhitespace.equalsRange(prev) && cur.containsRange(rangeNoWhitespace) && !cur.equalsRange(rangeNoWhitespace)) { + oneRangesWithTrivia.push(rangeNoWhitespace); + } + const rangeFull = new Range(prev.startLineNumber, 1, prev.endLineNumber, model.getLineMaxColumn(prev.endLineNumber)); + if (rangeFull.containsRange(prev) && !rangeFull.equalsRange(rangeNoWhitespace) && cur.containsRange(rangeFull) && !cur.equalsRange(rangeFull)) { + oneRangesWithTrivia.push(rangeFull); + } + } + oneRangesWithTrivia.push(cur); + } + return oneRangesWithTrivia; + }); +} +CommandsRegistry.registerCommand("_executeSelectionRangeProvider", async function(accessor, ...args) { + const [resource, positions] = args; + assertType(URI.isUri(resource)); + assertType(isArrayOf(positions, (p) => Position.isIPosition(p))); + const registry = accessor.get(ILanguageFeaturesService).selectionRangeProvider; + const reference = await accessor.get(ITextModelService).createModelReference(resource); + try { + return provideSelectionRanges(registry, reference.object.textEditorModel, positions.map(Position.lift), { selectLeadingAndTrailingWhitespace: true, selectSubwords: true }, CancellationToken.None); + } finally { + reference.dispose(); + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollContribution.js +init_editorExtensions(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollActions.js +init_editorExtensions(); +init_nls(); + +// node_modules/monaco-editor-core/esm/vs/platform/action/common/actionCommonCategories.js +init_nls(); +var Categories = Object.freeze({ + View: localize2(1638, "View"), + Help: localize2(1639, "Help"), + Test: localize2(1640, "Test"), + File: localize2(1641, "File"), + Preferences: localize2(1642, "Preferences"), + Developer: localize2(1643, "Developer") +}); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollActions.js +init_actions2(); +init_configuration(); +init_contextkey(); +init_editorContextKeys(); +var ToggleStickyScroll = class extends EditorAction2 { + constructor() { + super({ + id: "editor.action.toggleStickyScroll", + title: { + ...localize2(1448, "Toggle Editor Sticky Scroll"), + mnemonicTitle: localize(1444, "&&Toggle Editor Sticky Scroll") + }, + metadata: { + description: localize2(1449, "Toggle/enable the editor sticky scroll which shows the nested scopes at the top of the viewport") + }, + category: Categories.View, + toggled: { + condition: ContextKeyExpr.equals("config.editor.stickyScroll.enabled", true), + title: localize(1445, "Sticky Scroll"), + mnemonicTitle: localize(1446, "&&Sticky Scroll") + }, + menu: [ + { id: MenuId.CommandPalette }, + { id: MenuId.MenubarAppearanceMenu, group: "4_editor", order: 3 }, + { id: MenuId.StickyScrollContext } + ] + }); + } + async runEditorCommand(accessor, editor2) { + const configurationService = accessor.get(IConfigurationService); + const newValue = !configurationService.getValue("editor.stickyScroll.enabled"); + const isFocused = StickyScrollController2.get(editor2)?.isFocused(); + configurationService.updateValue("editor.stickyScroll.enabled", newValue); + if (isFocused) { + editor2.focus(); + } + } +}; +var weight4 = 100; +var FocusStickyScroll = class extends EditorAction2 { + constructor() { + super({ + id: "editor.action.focusStickyScroll", + title: { + ...localize2(1450, "Focus Editor Sticky Scroll"), + mnemonicTitle: localize(1447, "&&Focus Editor Sticky Scroll") + }, + precondition: ContextKeyExpr.and(ContextKeyExpr.has("config.editor.stickyScroll.enabled"), EditorContextKeys.stickyScrollVisible), + menu: [ + { id: MenuId.CommandPalette } + ] + }); + } + runEditorCommand(_accessor, editor2) { + StickyScrollController2.get(editor2)?.focus(); + } +}; +var SelectNextStickyScrollLine = class extends EditorAction2 { + constructor() { + super({ + id: "editor.action.selectNextStickyScrollLine", + title: localize2(1451, "Select the next editor sticky scroll line"), + precondition: EditorContextKeys.stickyScrollFocused.isEqualTo(true), + keybinding: { + weight: weight4, + primary: 18 + /* KeyCode.DownArrow */ + } + }); + } + runEditorCommand(_accessor, editor2) { + StickyScrollController2.get(editor2)?.focusNext(); + } +}; +var SelectPreviousStickyScrollLine = class extends EditorAction2 { + constructor() { + super({ + id: "editor.action.selectPreviousStickyScrollLine", + title: localize2(1452, "Select the previous sticky scroll line"), + precondition: EditorContextKeys.stickyScrollFocused.isEqualTo(true), + keybinding: { + weight: weight4, + primary: 16 + /* KeyCode.UpArrow */ + } + }); + } + runEditorCommand(_accessor, editor2) { + StickyScrollController2.get(editor2)?.focusPrevious(); + } +}; +var GoToStickyScrollLine = class extends EditorAction2 { + constructor() { + super({ + id: "editor.action.goToFocusedStickyScrollLine", + title: localize2(1453, "Go to the focused sticky scroll line"), + precondition: EditorContextKeys.stickyScrollFocused.isEqualTo(true), + keybinding: { + weight: weight4, + primary: 3 + /* KeyCode.Enter */ + } + }); + } + runEditorCommand(_accessor, editor2) { + StickyScrollController2.get(editor2)?.goToFocused(); + } +}; +var SelectEditor = class extends EditorAction2 { + constructor() { + super({ + id: "editor.action.selectEditor", + title: localize2(1454, "Select Editor"), + precondition: EditorContextKeys.stickyScrollFocused.isEqualTo(true), + keybinding: { + weight: weight4, + primary: 9 + /* KeyCode.Escape */ + } + }); + } + runEditorCommand(_accessor, editor2) { + StickyScrollController2.get(editor2)?.selectEditor(); + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollContribution.js +init_actions2(); +registerEditorContribution( + StickyScrollController2.ID, + StickyScrollController2, + 1 + /* EditorContributionInstantiation.AfterFirstRender */ +); +registerAction2(ToggleStickyScroll); +registerAction2(FocusStickyScroll); +registerAction2(SelectPreviousStickyScrollLine); +registerAction2(SelectNextStickyScrollLine); +registerAction2(GoToStickyScrollLine); +registerAction2(SelectEditor); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/suggest/browser/suggestInlineCompletions.js +init_cancellation(); +init_filters(); +init_iterator(); +init_lifecycle(); +init_codeEditorService(); +init_range(); +init_languageFeatures(); +var __decorate151 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param145 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var SuggestInlineCompletion = class { + constructor(range2, insertText, filterText, additionalTextEdits, command, gutterMenuLinkAction, completion) { + this.range = range2; + this.insertText = insertText; + this.filterText = filterText; + this.additionalTextEdits = additionalTextEdits; + this.command = command; + this.gutterMenuLinkAction = gutterMenuLinkAction; + this.completion = completion; + } +}; +var InlineCompletionResults = class InlineCompletionResults2 extends RefCountedDisposable { + constructor(model, line, word, completionModel, completions, _suggestMemoryService) { + super(completions.disposable); + this.model = model; + this.line = line; + this.word = word; + this.completionModel = completionModel; + this._suggestMemoryService = _suggestMemoryService; + } + canBeReused(model, line, word) { + return this.model === model && this.line === line && this.word.word.length > 0 && this.word.startColumn === word.startColumn && this.word.endColumn < word.endColumn && this.completionModel.getIncompleteProvider().size === 0; + } + get items() { + const result = []; + const { items } = this.completionModel; + const selectedIndex = this._suggestMemoryService.select(this.model, { lineNumber: this.line, column: this.word.endColumn + this.completionModel.lineContext.characterCountDelta }, items); + const first2 = Iterable.slice(items, selectedIndex); + const second = Iterable.slice(items, 0, selectedIndex); + let resolveCount = 5; + for (const item of Iterable.concat(first2, second)) { + if (item.score === FuzzyScore.Default) { + continue; + } + const range2 = new Range( + item.editStart.lineNumber, + item.editStart.column, + item.editInsertEnd.lineNumber, + item.editInsertEnd.column + this.completionModel.lineContext.characterCountDelta + // end PLUS character delta + ); + const insertText = item.completion.insertTextRules && item.completion.insertTextRules & 4 ? { snippet: item.completion.insertText } : item.completion.insertText; + result.push(new SuggestInlineCompletion(range2, insertText, item.filterTextLow ?? item.labelLow, item.completion.additionalTextEdits, item.completion.command, item.completion.action, item)); + if (resolveCount-- >= 0) { + item.resolve(CancellationToken.None); + } + } + return result; + } +}; +InlineCompletionResults = __decorate151([ + __param145(5, ISuggestMemoryService) +], InlineCompletionResults); +var SuggestInlineCompletions = class SuggestInlineCompletions2 extends Disposable { + constructor(_languageFeatureService, _clipboardService, _suggestMemoryService, _editorService) { + super(); + this._languageFeatureService = _languageFeatureService; + this._clipboardService = _clipboardService; + this._suggestMemoryService = _suggestMemoryService; + this._editorService = _editorService; + this._store.add(_languageFeatureService.inlineCompletionsProvider.register("*", this)); + } + async provideInlineCompletions(model, position, context, token) { + if (context.selectedSuggestionInfo) { + return; + } + let editor2; + for (const candidate of this._editorService.listCodeEditors()) { + if (candidate.getModel() === model) { + editor2 = candidate; + break; + } + } + if (!editor2) { + return; + } + const config = editor2.getOption( + 102 + /* EditorOption.quickSuggestions */ + ); + if (QuickSuggestionsOptions.isAllOff(config)) { + return; + } + model.tokenization.tokenizeIfCheap(position.lineNumber); + const lineTokens = model.tokenization.getLineTokens(position.lineNumber); + const tokenType = lineTokens.getStandardTokenType(lineTokens.findTokenIndexAtOffset(Math.max(position.column - 1 - 1, 0))); + if (QuickSuggestionsOptions.valueFor(config, tokenType) !== "inline") { + return void 0; + } + let wordInfo = model.getWordAtPosition(position); + let triggerCharacterInfo; + if (!wordInfo?.word) { + triggerCharacterInfo = this._getTriggerCharacterInfo(model, position); + } + if (!wordInfo?.word && !triggerCharacterInfo) { + return; + } + if (!wordInfo) { + wordInfo = model.getWordUntilPosition(position); + } + if (wordInfo.endColumn !== position.column) { + return; + } + let result; + const leadingLineContents = model.getValueInRange(new Range(position.lineNumber, 1, position.lineNumber, position.column)); + if (!triggerCharacterInfo && this._lastResult?.canBeReused(model, position.lineNumber, wordInfo)) { + const newLineContext = new LineContext(leadingLineContents, position.column - this._lastResult.word.endColumn); + this._lastResult.completionModel.lineContext = newLineContext; + this._lastResult.acquire(); + result = this._lastResult; + } else { + const completions = await provideSuggestionItems(this._languageFeatureService.completionProvider, model, position, new CompletionOptions(void 0, SuggestModel.createSuggestFilter(editor2).itemKind, triggerCharacterInfo?.providers), triggerCharacterInfo && { triggerKind: 1, triggerCharacter: triggerCharacterInfo.ch }, token); + let clipboardText; + if (completions.needsClipboard) { + clipboardText = await this._clipboardService.readText(); + } + const completionModel = new CompletionModel(completions.items, position.column, new LineContext(leadingLineContents, 0), WordDistance.None, editor2.getOption( + 134 + /* EditorOption.suggest */ + ), editor2.getOption( + 128 + /* EditorOption.snippetSuggestions */ + ), { boostFullMatch: false, firstMatchCanBeWeak: false }, clipboardText); + result = new InlineCompletionResults(model, position.lineNumber, wordInfo, completionModel, completions, this._suggestMemoryService); + } + this._lastResult = result; + return result; + } + handleItemDidShow(_completions, item) { + item.completion.resolve(CancellationToken.None); + } + disposeInlineCompletions(result) { + result.release(); + } + _getTriggerCharacterInfo(model, position) { + const ch = model.getValueInRange(Range.fromPositions({ lineNumber: position.lineNumber, column: position.column - 1 }, position)); + const providers = /* @__PURE__ */ new Set(); + for (const provider of this._languageFeatureService.completionProvider.all(model)) { + if (provider.triggerCharacters?.includes(ch)) { + providers.add(provider); + } + } + if (providers.size === 0) { + return void 0; + } + return { providers, ch }; + } +}; +SuggestInlineCompletions = __decorate151([ + __param145(0, ILanguageFeaturesService), + __param145(1, IClipboardService), + __param145(2, ISuggestMemoryService), + __param145(3, ICodeEditorService) +], SuggestInlineCompletions); +registerEditorFeature(SuggestInlineCompletions); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/tokenization/browser/tokenization.js +init_stopwatch(); +init_editorExtensions(); +init_nls(); +var ForceRetokenizeAction = class extends EditorAction { + constructor() { + super({ + id: "editor.action.forceRetokenize", + label: localize2(1532, "Developer: Force Retokenize"), + precondition: void 0 + }); + } + run(accessor, editor2) { + if (!editor2.hasModel()) { + return; + } + const model = editor2.getModel(); + model.tokenization.resetTokenization(); + const sw = new StopWatch(); + model.tokenization.forceTokenization(model.getLineCount()); + sw.stop(); + console.log(`tokenization took ${sw.elapsed()}`); + } +}; +registerEditorAction(ForceRetokenizeAction); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/toggleTabFocusMode/browser/toggleTabFocusMode.js +init_nls(); +init_actions2(); +var ToggleTabFocusModeAction = class _ToggleTabFocusModeAction extends Action2 { + static { + this.ID = "editor.action.toggleTabFocusMode"; + } + constructor() { + super({ + id: _ToggleTabFocusModeAction.ID, + title: localize2(1530, "Toggle Tab Key Moves Focus"), + precondition: void 0, + keybinding: { + primary: 2048 | 43, + mac: { + primary: 256 | 1024 | 43 + /* KeyCode.KeyM */ + }, + weight: 100 + /* KeybindingWeight.EditorContrib */ + }, + metadata: { + description: localize2(1531, "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: true + }); + } + run() { + const oldValue = TabFocus.getTabFocusMode(); + const newValue = !oldValue; + TabFocus.setTabFocusMode(newValue); + if (newValue) { + alert(localize(1528, "Pressing Tab will now move focus to the next focusable element")); + } else { + alert(localize(1529, "Pressing Tab will now insert the tab character")); + } + } +}; +registerAction2(ToggleTabFocusModeAction); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.js +init_async(); +init_codicons(); +init_htmlContent(); +init_lifecycle(); +init_platform(); +init_strings(); +init_editorExtensions(); +init_textModel(); + +// node_modules/monaco-editor-core/esm/vs/editor/common/services/unicodeTextModelHighlighter.js +init_range(); +init_textModelSearch(); +init_strings(); +init_assert(); +init_wordHelper(); +var UnicodeTextModelHighlighter = class { + static computeUnicodeHighlights(model, options2, range2) { + const startLine = range2 ? range2.startLineNumber : 1; + const endLine = range2 ? range2.endLineNumber : model.getLineCount(); + const codePointHighlighter = new CodePointHighlighter(options2); + const candidates = codePointHighlighter.getCandidateCodePoints(); + let regex; + if (candidates === "allNonBasicAscii") { + regex = new RegExp("[^\\t\\n\\r\\x20-\\x7E]", "g"); + } else { + regex = new RegExp(`${buildRegExpCharClassExpr(Array.from(candidates))}`, "g"); + } + const searcher = new Searcher(null, regex); + const ranges = []; + let hasMore = false; + let m; + let ambiguousCharacterCount = 0; + let invisibleCharacterCount = 0; + let nonBasicAsciiCharacterCount = 0; + forLoop: for (let lineNumber = startLine, lineCount = endLine; lineNumber <= lineCount; lineNumber++) { + const lineContent = model.getLineContent(lineNumber); + const lineLength = lineContent.length; + searcher.reset(0); + do { + m = searcher.next(lineContent); + if (m) { + let startIndex = m.index; + let endIndex = m.index + m[0].length; + if (startIndex > 0) { + const charCodeBefore = lineContent.charCodeAt(startIndex - 1); + if (isHighSurrogate(charCodeBefore)) { + startIndex--; + } + } + if (endIndex + 1 < lineLength) { + const charCodeBefore = lineContent.charCodeAt(endIndex - 1); + if (isHighSurrogate(charCodeBefore)) { + endIndex++; + } + } + const str = lineContent.substring(startIndex, endIndex); + let word = getWordAtText(startIndex + 1, DEFAULT_WORD_REGEXP, lineContent, 0); + if (word && word.endColumn <= startIndex + 1) { + word = null; + } + const highlightReason = codePointHighlighter.shouldHighlightNonBasicASCII(str, word ? word.word : null); + if (highlightReason !== 0) { + if (highlightReason === 3) { + ambiguousCharacterCount++; + } else if (highlightReason === 2) { + invisibleCharacterCount++; + } else if (highlightReason === 1) { + nonBasicAsciiCharacterCount++; + } else { + assertNever(highlightReason); + } + const MAX_RESULT_LENGTH = 1e3; + if (ranges.length >= MAX_RESULT_LENGTH) { + hasMore = true; + break forLoop; + } + ranges.push(new Range(lineNumber, startIndex + 1, lineNumber, endIndex + 1)); + } + } + } while (m); + } + return { + ranges, + hasMore, + ambiguousCharacterCount, + invisibleCharacterCount, + nonBasicAsciiCharacterCount + }; + } + static computeUnicodeHighlightReason(char, options2) { + const codePointHighlighter = new CodePointHighlighter(options2); + const reason = codePointHighlighter.shouldHighlightNonBasicASCII(char, null); + switch (reason) { + case 0: + return null; + case 2: + return { + kind: 1 + /* UnicodeHighlighterReasonKind.Invisible */ + }; + case 3: { + const codePoint = char.codePointAt(0); + const primaryConfusable = codePointHighlighter.ambiguousCharacters.getPrimaryConfusable(codePoint); + const notAmbiguousInLocales = AmbiguousCharacters.getLocales().filter((l) => !AmbiguousCharacters.getInstance(/* @__PURE__ */ new Set([...options2.allowedLocales, l])).isAmbiguous(codePoint)); + return { kind: 0, confusableWith: String.fromCodePoint(primaryConfusable), notAmbiguousInLocales }; + } + case 1: + return { + kind: 2 + /* UnicodeHighlighterReasonKind.NonBasicAscii */ + }; + } + } +}; +function buildRegExpCharClassExpr(codePoints, flags) { + const src = `[${escapeRegExpCharacters(codePoints.map((i2) => String.fromCodePoint(i2)).join(""))}]`; + return src; +} +var CodePointHighlighter = class { + constructor(options2) { + this.options = options2; + this.allowedCodePoints = new Set(options2.allowedCodePoints); + this.ambiguousCharacters = AmbiguousCharacters.getInstance(new Set(options2.allowedLocales)); + } + getCandidateCodePoints() { + if (this.options.nonBasicASCII) { + return "allNonBasicAscii"; + } + const set = /* @__PURE__ */ new Set(); + if (this.options.invisibleCharacters) { + for (const cp of InvisibleCharacters.codePoints) { + if (!isAllowedInvisibleCharacter(String.fromCodePoint(cp))) { + set.add(cp); + } + } + } + if (this.options.ambiguousCharacters) { + for (const cp of this.ambiguousCharacters.getConfusableCodePoints()) { + set.add(cp); + } + } + for (const cp of this.allowedCodePoints) { + set.delete(cp); + } + return set; + } + shouldHighlightNonBasicASCII(character, wordContext) { + const codePoint = character.codePointAt(0); + if (this.allowedCodePoints.has(codePoint)) { + return 0; + } + if (this.options.nonBasicASCII) { + return 1; + } + let hasBasicASCIICharacters = false; + let hasNonConfusableNonBasicAsciiCharacter = false; + if (wordContext) { + for (const char of wordContext) { + const codePoint2 = char.codePointAt(0); + const isBasicASCII2 = isBasicASCII(char); + hasBasicASCIICharacters = hasBasicASCIICharacters || isBasicASCII2; + if (!isBasicASCII2 && !this.ambiguousCharacters.isAmbiguous(codePoint2) && !InvisibleCharacters.isInvisibleCharacter(codePoint2)) { + hasNonConfusableNonBasicAsciiCharacter = true; + } + } + } + if ( + /* Don't allow mixing weird looking characters with ASCII */ + !hasBasicASCIICharacters && /* Is there an obviously weird looking character? */ + hasNonConfusableNonBasicAsciiCharacter + ) { + return 0; + } + if (this.options.invisibleCharacters) { + if (!isAllowedInvisibleCharacter(character) && InvisibleCharacters.isInvisibleCharacter(codePoint)) { + return 2; + } + } + if (this.options.ambiguousCharacters) { + if (this.ambiguousCharacters.isAmbiguous(codePoint)) { + return 3; + } + } + return 0; + } +}; +function isAllowedInvisibleCharacter(character) { + return character === " " || character === "\n" || character === " "; +} + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.js +init_editorWorker(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/unicodeHighlighter/browser/bannerController.js +init_nls(); +init_dom(); +init_actions(); +init_lifecycle(); +init_instantiation(); + +// node_modules/monaco-editor-core/esm/vs/platform/opener/browser/link.js +init_dom(); +init_keyboardEvent(); +init_event(); +init_lifecycle(); +var __decorate152 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param146 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var Link2 = class Link3 extends Disposable { + get enabled() { + return this._enabled; + } + set enabled(enabled) { + if (enabled) { + 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 = false; + } else { + 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 = true; + } + this._enabled = enabled; + } + constructor(container, _link, options2 = {}, _hoverService, openerService) { + super(); + this._link = _link; + this._hoverService = _hoverService; + this._enabled = true; + this.el = append(container, $("a.monaco-link", { + tabIndex: _link.tabIndex ?? 0, + href: _link.href + }, _link.label)); + this.hoverDelegate = options2.hoverDelegate ?? getDefaultHoverDelegate("mouse"); + this.setTooltip(_link.title); + this.el.setAttribute("role", "button"); + const onClickEmitter = this._register(new DomEmitter(this.el, "click")); + const onKeyPress = this._register(new DomEmitter(this.el, "keypress")); + const onEnterPress = Event.chain(onKeyPress.event, ($23) => $23.map((e) => new StandardKeyboardEvent(e)).filter( + (e) => e.keyCode === 3 + /* KeyCode.Enter */ + )); + const onTap = this._register(new DomEmitter(this.el, EventType2.Tap)).event; + this._register(Gesture.addTarget(this.el)); + const onOpen = Event.any(onClickEmitter.event, onEnterPress, onTap); + this._register(onOpen((e) => { + if (!this.enabled) { + return; + } + EventHelper.stop(e, true); + if (options2?.opener) { + options2.opener(this._link.href); + } else { + openerService.open(this._link.href, { allowCommands: true }); + } + })); + this.enabled = true; + } + setTooltip(title) { + if (!this.hover && title) { + this.hover = this._register(this._hoverService.setupManagedHover(this.hoverDelegate, this.el, title)); + } else if (this.hover) { + this.hover.update(title); + } + } +}; +Link2 = __decorate152([ + __param146(3, IHoverService), + __param146(4, IOpenerService) +], Link2); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/unicodeHighlighter/browser/bannerController.js +init_themables(); +var __decorate153 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param147 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var BANNER_ELEMENT_HEIGHT = 26; +var BannerController = class BannerController2 extends Disposable { + constructor(_editor, instantiationService) { + super(); + this._editor = _editor; + this.instantiationService = instantiationService; + this.banner = this._register(this.instantiationService.createInstance(Banner)); + } + hide() { + this._editor.setBanner(null, 0); + this.banner.clear(); + } + show(item) { + this.banner.show({ + ...item, + onClose: () => { + this.hide(); + item.onClose?.(); + } + }); + this._editor.setBanner(this.banner.element, BANNER_ELEMENT_HEIGHT); + } +}; +BannerController = __decorate153([ + __param147(1, IInstantiationService) +], BannerController); +var Banner = class Banner2 extends Disposable { + constructor(instantiationService, markdownRendererService) { + super(); + this.instantiationService = instantiationService; + this.markdownRendererService = markdownRendererService; + this.element = $("div.editor-banner"); + this.element.tabIndex = 0; + } + getAriaLabel(item) { + if (item.ariaLabel) { + return item.ariaLabel; + } + if (typeof item.message === "string") { + return item.message; + } + return void 0; + } + getBannerMessage(message) { + if (typeof message === "string") { + const element = $("span"); + element.innerText = message; + return element; + } + return this.markdownRendererService.render(message).element; + } + clear() { + clearNode(this.element); + } + show(item) { + clearNode(this.element); + const ariaLabel = this.getAriaLabel(item); + if (ariaLabel) { + this.element.setAttribute("aria-label", ariaLabel); + } + const iconContainer = append(this.element, $("div.icon-container")); + iconContainer.setAttribute("aria-hidden", "true"); + if (item.icon) { + iconContainer.appendChild($(`div${ThemeIcon.asCSSSelector(item.icon)}`)); + } + const messageContainer = append(this.element, $("div.message-container")); + messageContainer.setAttribute("aria-hidden", "true"); + messageContainer.appendChild(this.getBannerMessage(item.message)); + this.messageActionsContainer = append(this.element, $("div.message-actions-container")); + if (item.actions) { + for (const action of item.actions) { + this._register(this.instantiationService.createInstance(Link2, this.messageActionsContainer, { ...action, tabIndex: -1 }, {})); + } + } + const actionBarContainer = append(this.element, $("div.action-container")); + this.actionBar = this._register(new ActionBar(actionBarContainer)); + this.actionBar.push(this._register(new Action("banner.close", localize(1533, "Close Banner"), ThemeIcon.asClassName(widgetClose), true, () => { + if (typeof item.onClose === "function") { + item.onClose(); + } + })), { icon: true, label: false }); + this.actionBar.setFocusable(false); + } +}; +Banner = __decorate153([ + __param147(0, IInstantiationService), + __param147(1, IMarkdownRendererService) +], Banner); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.js +init_nls(); +init_configuration(); +init_instantiation(); + +// node_modules/monaco-editor-core/esm/vs/platform/workspace/common/workspaceTrust.js +init_instantiation(); +var IWorkspaceTrustManagementService = createDecorator("workspaceTrustManagementService"); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.js +init_actions2(); +init_date(); +var __decorate154 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param148 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var warningIcon = registerIcon("extensions-warning-message", Codicon.warning, localize(1534, "Icon shown with a warning message in the extensions editor.")); +var UnicodeHighlighter = class UnicodeHighlighter2 extends Disposable { + static { + this.ID = "editor.contrib.unicodeHighlighter"; + } + constructor(_editor, _editorWorkerService, _workspaceTrustService, instantiationService) { + super(); + this._editor = _editor; + this._editorWorkerService = _editorWorkerService; + this._workspaceTrustService = _workspaceTrustService; + this._highlighter = null; + this._bannerClosed = false; + this._updateState = (state) => { + if (state && state.hasMore) { + if (this._bannerClosed) { + return; + } + const max = Math.max(state.ambiguousCharacterCount, state.nonBasicAsciiCharacterCount, state.invisibleCharacterCount); + let data; + if (state.nonBasicAsciiCharacterCount >= max) { + data = { + message: localize(1535, "This document contains many non-basic ASCII unicode characters"), + command: new DisableHighlightingOfNonBasicAsciiCharactersAction() + }; + } else if (state.ambiguousCharacterCount >= max) { + data = { + message: localize(1536, "This document contains many ambiguous unicode characters"), + command: new DisableHighlightingOfAmbiguousCharactersAction() + }; + } else if (state.invisibleCharacterCount >= max) { + data = { + message: localize(1537, "This document contains many invisible unicode characters"), + command: new DisableHighlightingOfInvisibleCharactersAction() + }; + } else { + throw new Error("Unreachable"); + } + this._bannerController.show({ + id: "unicodeHighlightBanner", + message: data.message, + icon: warningIcon, + actions: [ + { + label: data.command.shortLabel, + href: `command:${data.command.desc.id}` + } + ], + onClose: () => { + this._bannerClosed = true; + } + }); + } else { + this._bannerController.hide(); + } + }; + this._bannerController = this._register(instantiationService.createInstance(BannerController, _editor)); + this._register(this._editor.onDidChangeModel(() => { + this._bannerClosed = false; + this._updateHighlighter(); + })); + this._options = _editor.getOption( + 142 + /* EditorOption.unicodeHighlighting */ + ); + this._register(_workspaceTrustService.onDidChangeTrust((e) => { + this._updateHighlighter(); + })); + this._register(_editor.onDidChangeConfiguration((e) => { + if (e.hasChanged( + 142 + /* EditorOption.unicodeHighlighting */ + )) { + this._options = _editor.getOption( + 142 + /* EditorOption.unicodeHighlighting */ + ); + this._updateHighlighter(); + } + })); + this._updateHighlighter(); + } + dispose() { + if (this._highlighter) { + this._highlighter.dispose(); + this._highlighter = null; + } + super.dispose(); + } + _updateHighlighter() { + this._updateState(null); + if (this._highlighter) { + this._highlighter.dispose(); + this._highlighter = null; + } + if (!this._editor.hasModel()) { + return; + } + const options2 = resolveOptions2(this._workspaceTrustService.isWorkspaceTrusted(), this._options); + if ([ + options2.nonBasicASCII, + options2.ambiguousCharacters, + options2.invisibleCharacters + ].every((option2) => option2 === false)) { + return; + } + const highlightOptions = { + nonBasicASCII: options2.nonBasicASCII, + ambiguousCharacters: options2.ambiguousCharacters, + invisibleCharacters: options2.invisibleCharacters, + includeComments: options2.includeComments, + includeStrings: options2.includeStrings, + allowedCodePoints: Object.keys(options2.allowedCharacters).map((c) => c.codePointAt(0)), + allowedLocales: Object.keys(options2.allowedLocales).map((locale) => { + if (locale === "_os") { + const osLocale = safeIntl.NumberFormat().value.resolvedOptions().locale; + return osLocale; + } else if (locale === "_vscode") { + return language; + } + return locale; + }) + }; + if (this._editorWorkerService.canComputeUnicodeHighlights(this._editor.getModel().uri)) { + this._highlighter = new DocumentUnicodeHighlighter(this._editor, highlightOptions, this._updateState, this._editorWorkerService); + } else { + this._highlighter = new ViewportUnicodeHighlighter(this._editor, highlightOptions, this._updateState); + } + } + getDecorationInfo(decoration3) { + if (this._highlighter) { + return this._highlighter.getDecorationInfo(decoration3); + } + return null; + } +}; +UnicodeHighlighter = __decorate154([ + __param148(1, IEditorWorkerService), + __param148(2, IWorkspaceTrustManagementService), + __param148(3, IInstantiationService) +], UnicodeHighlighter); +function resolveOptions2(trusted, options2) { + return { + nonBasicASCII: options2.nonBasicASCII === inUntrustedWorkspace ? !trusted : options2.nonBasicASCII, + ambiguousCharacters: options2.ambiguousCharacters, + invisibleCharacters: options2.invisibleCharacters, + includeComments: options2.includeComments === inUntrustedWorkspace ? !trusted : options2.includeComments, + includeStrings: options2.includeStrings === inUntrustedWorkspace ? !trusted : options2.includeStrings, + allowedCharacters: options2.allowedCharacters, + allowedLocales: options2.allowedLocales + }; +} +var DocumentUnicodeHighlighter = class DocumentUnicodeHighlighter2 extends Disposable { + constructor(_editor, _options, _updateState, _editorWorkerService) { + super(); + this._editor = _editor; + this._options = _options; + this._updateState = _updateState; + this._editorWorkerService = _editorWorkerService; + this._model = this._editor.getModel(); + this._decorations = this._editor.createDecorationsCollection(); + this._updateSoon = this._register(new RunOnceScheduler(() => 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 modelVersionId = this._model.getVersionId(); + this._editorWorkerService.computedUnicodeHighlights(this._model.uri, this._options).then((info) => { + if (this._model.isDisposed()) { + return; + } + if (this._model.getVersionId() !== modelVersionId) { + return; + } + this._updateState(info); + const decorations = []; + if (!info.hasMore) { + for (const range2 of info.ranges) { + decorations.push({ + range: range2, + options: Decorations.instance.getDecorationFromOptions(this._options) + }); + } + } + this._decorations.set(decorations); + }); + } + getDecorationInfo(decoration3) { + if (!this._decorations.has(decoration3)) { + return null; + } + const model = this._editor.getModel(); + if (!isModelDecorationVisible(model, decoration3)) { + return null; + } + const text2 = model.getValueInRange(decoration3.range); + return { + reason: computeReason(text2, this._options), + inComment: isModelDecorationInComment(model, decoration3), + inString: isModelDecorationInString(model, decoration3) + }; + } +}; +DocumentUnicodeHighlighter = __decorate154([ + __param148(3, IEditorWorkerService) +], DocumentUnicodeHighlighter); +var ViewportUnicodeHighlighter = class extends Disposable { + constructor(_editor, _options, _updateState) { + super(); + this._editor = _editor; + this._options = _options; + this._updateState = _updateState; + this._model = this._editor.getModel(); + this._decorations = this._editor.createDecorationsCollection(); + this._updateSoon = this._register(new RunOnceScheduler(() => 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 ranges = this._editor.getVisibleRanges(); + const decorations = []; + const totalResult = { + ranges: [], + ambiguousCharacterCount: 0, + invisibleCharacterCount: 0, + nonBasicAsciiCharacterCount: 0, + hasMore: false + }; + for (const range2 of ranges) { + const result = UnicodeTextModelHighlighter.computeUnicodeHighlights(this._model, this._options, range2); + for (const r of result.ranges) { + totalResult.ranges.push(r); + } + totalResult.ambiguousCharacterCount += totalResult.ambiguousCharacterCount; + totalResult.invisibleCharacterCount += totalResult.invisibleCharacterCount; + totalResult.nonBasicAsciiCharacterCount += totalResult.nonBasicAsciiCharacterCount; + totalResult.hasMore = totalResult.hasMore || result.hasMore; + } + if (!totalResult.hasMore) { + for (const range2 of totalResult.ranges) { + decorations.push({ range: range2, options: Decorations.instance.getDecorationFromOptions(this._options) }); + } + } + this._updateState(totalResult); + this._decorations.set(decorations); + } + getDecorationInfo(decoration3) { + if (!this._decorations.has(decoration3)) { + return null; + } + const model = this._editor.getModel(); + const text2 = model.getValueInRange(decoration3.range); + if (!isModelDecorationVisible(model, decoration3)) { + return null; + } + return { + reason: computeReason(text2, this._options), + inComment: isModelDecorationInComment(model, decoration3), + inString: isModelDecorationInString(model, decoration3) + }; + } +}; +var configureUnicodeHighlightOptionsStr = localize(1538, "Configure Unicode Highlight Options"); +var UnicodeHighlighterHoverParticipant = class UnicodeHighlighterHoverParticipant2 { + constructor(_editor, _markdownRendererService) { + this._editor = _editor; + this._markdownRendererService = _markdownRendererService; + this.hoverOrdinal = 5; + } + computeSync(anchor, lineDecorations) { + if (!this._editor.hasModel() || anchor.type !== 1) { + return []; + } + const model = this._editor.getModel(); + const unicodeHighlighter = this._editor.getContribution(UnicodeHighlighter.ID); + if (!unicodeHighlighter) { + return []; + } + const result = []; + const existedReason = /* @__PURE__ */ new Set(); + let index = 300; + for (const d of lineDecorations) { + const highlightInfo = unicodeHighlighter.getDecorationInfo(d); + if (!highlightInfo) { + continue; + } + const char = model.getValueInRange(d.range); + const codePoint = char.codePointAt(0); + const codePointStr = formatCodePointMarkdown(codePoint); + let reason; + switch (highlightInfo.reason.kind) { + case 0: { + if (isBasicASCII(highlightInfo.reason.confusableWith)) { + reason = localize(1539, "The character {0} could be confused with the ASCII character {1}, which is more common in source code.", codePointStr, formatCodePointMarkdown(highlightInfo.reason.confusableWith.codePointAt(0))); + } else { + reason = localize(1540, "The character {0} could be confused with the character {1}, which is more common in source code.", codePointStr, formatCodePointMarkdown(highlightInfo.reason.confusableWith.codePointAt(0))); + } + break; + } + case 1: + reason = localize(1541, "The character {0} is invisible.", codePointStr); + break; + case 2: + reason = localize(1542, "The character {0} is not a basic ASCII character.", codePointStr); + break; + } + if (existedReason.has(reason)) { + continue; + } + existedReason.add(reason); + const adjustSettingsArgs = { + codePoint, + reason: highlightInfo.reason, + inComment: highlightInfo.inComment, + inString: highlightInfo.inString + }; + const adjustSettings = localize(1543, "Adjust settings"); + const uri = createCommandUri(ShowExcludeOptions.ID, adjustSettingsArgs); + const markdown = new MarkdownString("", true).appendMarkdown(reason).appendText(" ").appendLink(uri, adjustSettings, configureUnicodeHighlightOptionsStr); + result.push(new MarkdownHover(this, d.range, [markdown], false, index++)); + } + return result; + } + renderHoverParts(context, hoverParts) { + return renderMarkdownHovers(context, hoverParts, this._editor, this._markdownRendererService); + } + getAccessibleContent(hoverPart) { + return hoverPart.contents.map((c) => c.value).join("\n"); + } +}; +UnicodeHighlighterHoverParticipant = __decorate154([ + __param148(1, IMarkdownRendererService) +], UnicodeHighlighterHoverParticipant); +function codePointToHex(codePoint) { + return `U+${codePoint.toString(16).padStart(4, "0")}`; +} +function formatCodePointMarkdown(codePoint) { + let value = `\`${codePointToHex(codePoint)}\``; + if (!InvisibleCharacters.isInvisibleCharacter(codePoint)) { + value += ` "${`${renderCodePointAsInlineCode(codePoint)}`}"`; + } + return value; +} +function renderCodePointAsInlineCode(codePoint) { + if (codePoint === 96) { + return "`` ` ``"; + } + return "`" + String.fromCodePoint(codePoint) + "`"; +} +function computeReason(char, options2) { + return UnicodeTextModelHighlighter.computeUnicodeHighlightReason(char, options2); +} +var Decorations = class _Decorations { + constructor() { + this.map = /* @__PURE__ */ new Map(); + } + static { + this.instance = new _Decorations(); + } + getDecorationFromOptions(options2) { + return this.getDecoration(!options2.includeComments, !options2.includeStrings); + } + getDecoration(hideInComments, hideInStrings) { + const key = `${hideInComments}${hideInStrings}`; + let options2 = this.map.get(key); + if (!options2) { + options2 = ModelDecorationOptions.createDynamic({ + description: "unicode-highlight", + stickiness: 1, + className: "unicode-highlight", + showIfCollapsed: true, + overviewRuler: null, + minimap: null, + hideInCommentTokens: hideInComments, + hideInStringTokens: hideInStrings + }); + this.map.set(key, options2); + } + return options2; + } +}; +var DisableHighlightingInCommentsAction = class extends EditorAction { + constructor() { + super({ + id: DisableHighlightingOfAmbiguousCharactersAction.ID, + label: localize2(1552, "Disable highlighting of characters in comments"), + precondition: void 0 + }); + this.shortLabel = localize(1544, "Disable Highlight In Comments"); + } + async run(accessor, editor2, args) { + const configurationService = accessor.get(IConfigurationService); + if (configurationService) { + this.runAction(configurationService); + } + } + async runAction(configurationService) { + await configurationService.updateValue( + unicodeHighlightConfigKeys.includeComments, + false, + 2 + /* ConfigurationTarget.USER */ + ); + } +}; +var DisableHighlightingInStringsAction = class extends EditorAction { + constructor() { + super({ + id: DisableHighlightingOfAmbiguousCharactersAction.ID, + label: localize2(1553, "Disable highlighting of characters in strings"), + precondition: void 0 + }); + this.shortLabel = localize(1545, "Disable Highlight In Strings"); + } + async run(accessor, editor2, args) { + const configurationService = accessor.get(IConfigurationService); + if (configurationService) { + this.runAction(configurationService); + } + } + async runAction(configurationService) { + await configurationService.updateValue( + unicodeHighlightConfigKeys.includeStrings, + false, + 2 + /* ConfigurationTarget.USER */ + ); + } +}; +var DisableHighlightingOfAmbiguousCharactersAction = class _DisableHighlightingOfAmbiguousCharactersAction extends Action2 { + static { + this.ID = "editor.action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters"; + } + constructor() { + super({ + id: _DisableHighlightingOfAmbiguousCharactersAction.ID, + title: localize2(1554, "Disable highlighting of ambiguous characters"), + precondition: void 0, + f1: false + }); + this.shortLabel = localize(1546, "Disable Ambiguous Highlight"); + } + async run(accessor, editor2, args) { + const configurationService = accessor.get(IConfigurationService); + if (configurationService) { + this.runAction(configurationService); + } + } + async runAction(configurationService) { + await configurationService.updateValue( + unicodeHighlightConfigKeys.ambiguousCharacters, + false, + 2 + /* ConfigurationTarget.USER */ + ); + } +}; +var DisableHighlightingOfInvisibleCharactersAction = class _DisableHighlightingOfInvisibleCharactersAction extends Action2 { + static { + this.ID = "editor.action.unicodeHighlight.disableHighlightingOfInvisibleCharacters"; + } + constructor() { + super({ + id: _DisableHighlightingOfInvisibleCharactersAction.ID, + title: localize2(1555, "Disable highlighting of invisible characters"), + precondition: void 0, + f1: false + }); + this.shortLabel = localize(1547, "Disable Invisible Highlight"); + } + async run(accessor, editor2, args) { + const configurationService = accessor.get(IConfigurationService); + if (configurationService) { + this.runAction(configurationService); + } + } + async runAction(configurationService) { + await configurationService.updateValue( + unicodeHighlightConfigKeys.invisibleCharacters, + false, + 2 + /* ConfigurationTarget.USER */ + ); + } +}; +var DisableHighlightingOfNonBasicAsciiCharactersAction = class _DisableHighlightingOfNonBasicAsciiCharactersAction extends Action2 { + static { + this.ID = "editor.action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters"; + } + constructor() { + super({ + id: _DisableHighlightingOfNonBasicAsciiCharactersAction.ID, + title: localize2(1556, "Disable highlighting of non basic ASCII characters"), + precondition: void 0, + f1: false + }); + this.shortLabel = localize(1548, "Disable Non ASCII Highlight"); + } + async run(accessor, editor2, args) { + const configurationService = accessor.get(IConfigurationService); + if (configurationService) { + this.runAction(configurationService); + } + } + async runAction(configurationService) { + await configurationService.updateValue( + unicodeHighlightConfigKeys.nonBasicASCII, + false, + 2 + /* ConfigurationTarget.USER */ + ); + } +}; +var ShowExcludeOptions = class _ShowExcludeOptions extends Action2 { + static { + this.ID = "editor.action.unicodeHighlight.showExcludeOptions"; + } + constructor() { + super({ + id: _ShowExcludeOptions.ID, + title: localize2(1557, "Show Exclude Options"), + precondition: void 0, + f1: false + }); + } + async run(accessor, args) { + const { codePoint, reason, inString, inComment } = args; + const char = String.fromCodePoint(codePoint); + const quickPickService = accessor.get(IQuickInputService); + const configurationService = accessor.get(IConfigurationService); + function getExcludeCharFromBeingHighlightedLabel(codePoint2) { + if (InvisibleCharacters.isInvisibleCharacter(codePoint2)) { + return localize(1549, "Exclude {0} (invisible character) from being highlighted", codePointToHex(codePoint2)); + } + return localize(1550, "Exclude {0} from being highlighted", `${codePointToHex(codePoint2)} "${char}"`); + } + const options2 = []; + if (reason.kind === 0) { + for (const locale of reason.notAmbiguousInLocales) { + options2.push({ + label: localize(1551, 'Allow unicode characters that are more common in the language "{0}".', locale), + run: async () => { + excludeLocaleFromBeingHighlighted(configurationService, [locale]); + } + }); + } + } + options2.push({ + label: getExcludeCharFromBeingHighlightedLabel(codePoint), + run: () => excludeCharFromBeingHighlighted(configurationService, [codePoint]) + }); + if (inComment) { + const action = new DisableHighlightingInCommentsAction(); + options2.push({ label: action.label, run: async () => action.runAction(configurationService) }); + } else if (inString) { + const action = new DisableHighlightingInStringsAction(); + options2.push({ label: action.label, run: async () => action.runAction(configurationService) }); + } + function getTitle(options3) { + return typeof options3.desc.title === "string" ? options3.desc.title : options3.desc.title.value; + } + if (reason.kind === 0) { + const action = new DisableHighlightingOfAmbiguousCharactersAction(); + options2.push({ label: getTitle(action), run: async () => action.runAction(configurationService) }); + } else if (reason.kind === 1) { + const action = new DisableHighlightingOfInvisibleCharactersAction(); + options2.push({ label: getTitle(action), run: async () => action.runAction(configurationService) }); + } else if (reason.kind === 2) { + const action = new DisableHighlightingOfNonBasicAsciiCharactersAction(); + options2.push({ label: getTitle(action), run: async () => action.runAction(configurationService) }); + } else { + expectNever(reason); + } + const result = await quickPickService.pick(options2, { title: configureUnicodeHighlightOptionsStr }); + if (result) { + await result.run(); + } + } +}; +async function excludeCharFromBeingHighlighted(configurationService, charCodes) { + const existingValue = configurationService.getValue(unicodeHighlightConfigKeys.allowedCharacters); + let value; + if (typeof existingValue === "object" && existingValue) { + value = existingValue; + } else { + value = {}; + } + for (const charCode of charCodes) { + value[String.fromCodePoint(charCode)] = true; + } + await configurationService.updateValue( + unicodeHighlightConfigKeys.allowedCharacters, + value, + 2 + /* ConfigurationTarget.USER */ + ); +} +async function excludeLocaleFromBeingHighlighted(configurationService, locales) { + const existingValue = configurationService.inspect(unicodeHighlightConfigKeys.allowedLocales).user?.value; + let value; + if (typeof existingValue === "object" && existingValue) { + value = Object.assign({}, existingValue); + } else { + value = {}; + } + for (const locale of locales) { + value[locale] = true; + } + await configurationService.updateValue( + unicodeHighlightConfigKeys.allowedLocales, + value, + 2 + /* ConfigurationTarget.USER */ + ); +} +function expectNever(value) { + throw new Error(`Unexpected value: ${value}`); +} +registerAction2(DisableHighlightingOfAmbiguousCharactersAction); +registerAction2(DisableHighlightingOfInvisibleCharactersAction); +registerAction2(DisableHighlightingOfNonBasicAsciiCharactersAction); +registerAction2(ShowExcludeOptions); +registerEditorContribution( + UnicodeHighlighter.ID, + UnicodeHighlighter, + 1 + /* EditorContributionInstantiation.AfterFirstRender */ +); +HoverParticipantRegistry.register(UnicodeHighlighterHoverParticipant); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/unusualLineTerminators/browser/unusualLineTerminators.js +init_lifecycle(); +init_resources(); +init_editorExtensions(); +init_codeEditorService(); +init_nls(); + +// node_modules/monaco-editor-core/esm/vs/platform/dialogs/common/dialogs.js +init_instantiation(); +var IDialogService = createDecorator("dialogService"); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/unusualLineTerminators/browser/unusualLineTerminators.js +var __decorate155 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param149 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var ignoreUnusualLineTerminators = "ignoreUnusualLineTerminators"; +function writeIgnoreState(codeEditorService, model, state) { + codeEditorService.setModelProperty(model.uri, ignoreUnusualLineTerminators, state); +} +function readIgnoreState(codeEditorService, model) { + return codeEditorService.getModelProperty(model.uri, ignoreUnusualLineTerminators); +} +var UnusualLineTerminatorsDetector = class UnusualLineTerminatorsDetector2 extends Disposable { + static { + this.ID = "editor.contrib.unusualLineTerminatorsDetector"; + } + constructor(_editor, _dialogService, _codeEditorService) { + super(); + this._editor = _editor; + this._dialogService = _dialogService; + this._codeEditorService = _codeEditorService; + this._isPresentingDialog = false; + this._config = this._editor.getOption( + 143 + /* EditorOption.unusualLineTerminators */ + ); + this._register(this._editor.onDidChangeConfiguration((e) => { + if (e.hasChanged( + 143 + /* EditorOption.unusualLineTerminators */ + )) { + this._config = this._editor.getOption( + 143 + /* EditorOption.unusualLineTerminators */ + ); + this._checkForUnusualLineTerminators(); + } + })); + this._register(this._editor.onDidChangeModel(() => { + this._checkForUnusualLineTerminators(); + })); + this._register(this._editor.onDidChangeModelContent((e) => { + if (e.isUndoing) { + return; + } + this._checkForUnusualLineTerminators(); + })); + this._checkForUnusualLineTerminators(); + } + async _checkForUnusualLineTerminators() { + if (this._config === "off") { + return; + } + if (!this._editor.hasModel()) { + return; + } + const model = this._editor.getModel(); + if (!model.mightContainUnusualLineTerminators()) { + return; + } + const ignoreState = readIgnoreState(this._codeEditorService, model); + if (ignoreState === true) { + return; + } + if (this._editor.getOption( + 104 + /* EditorOption.readOnly */ + )) { + return; + } + if (this._config === "auto") { + model.removeUnusualLineTerminators(this._editor.getSelections()); + return; + } + if (this._isPresentingDialog) { + return; + } + let result; + try { + this._isPresentingDialog = true; + result = await this._dialogService.confirm({ + title: localize(1558, "Unusual Line Terminators"), + message: localize(1559, "Detected unusual line terminators"), + detail: localize(1560, "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`.", basename2(model.uri)), + primaryButton: localize(1561, "&&Remove Unusual Line Terminators"), + cancelButton: localize(1562, "Ignore") + }); + } finally { + this._isPresentingDialog = false; + } + if (!result.confirmed) { + writeIgnoreState(this._codeEditorService, model, true); + return; + } + model.removeUnusualLineTerminators(this._editor.getSelections()); + } +}; +UnusualLineTerminatorsDetector = __decorate155([ + __param149(1, IDialogService), + __param149(2, ICodeEditorService) +], UnusualLineTerminatorsDetector); +registerEditorContribution( + UnusualLineTerminatorsDetector.ID, + UnusualLineTerminatorsDetector, + 1 + /* EditorContributionInstantiation.AfterFirstRender */ +); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/wordHighlighter/browser/wordHighlighter.js +init_nls(); +init_async(); +init_cancellation(); +init_errors(); +init_lifecycle(); +init_map(); +init_network(); +init_resources(); +init_configuration(); +init_contextkey(); +init_log(); +init_editorExtensions(); +init_codeEditorService(); +init_range(); +init_editorContextKeys(); + +// node_modules/monaco-editor-core/esm/vs/base/common/glob.js +init_async(); +init_extpath(); +init_map(); +init_path(); +init_platform(); +init_strings(); +var GLOBSTAR = "**"; +var GLOB_SPLIT = "/"; +var PATH_REGEX = "[/\\\\]"; +var NO_PATH_REGEX = "[^/\\\\]"; +var ALL_FORWARD_SLASHES = /\//g; +function starsToRegExp(starCount, isLastPattern) { + switch (starCount) { + case 0: + return ""; + case 1: + return `${NO_PATH_REGEX}*?`; + // 1 star matches any number of characters except path separator (/ and \) - non greedy (?) + default: + return `(?:${PATH_REGEX}|${NO_PATH_REGEX}+${PATH_REGEX}${isLastPattern ? `|${PATH_REGEX}${NO_PATH_REGEX}+` : ""})*?`; + } +} +function splitGlobAware(pattern, splitChar) { + if (!pattern) { + return []; + } + const segments = []; + let inBraces = false; + let inBrackets = false; + let curVal = ""; + for (const char of pattern) { + switch (char) { + case splitChar: + if (!inBraces && !inBrackets) { + segments.push(curVal); + curVal = ""; + continue; + } + break; + case "{": + inBraces = true; + break; + case "}": + inBraces = false; + break; + case "[": + inBrackets = true; + break; + case "]": + inBrackets = false; + break; + } + curVal += char; + } + if (curVal) { + segments.push(curVal); + } + return segments; +} +function parseRegExp(pattern) { + if (!pattern) { + return ""; + } + let regEx = ""; + const segments = splitGlobAware(pattern, GLOB_SPLIT); + if (segments.every((segment) => segment === GLOBSTAR)) { + regEx = ".*"; + } else { + let previousSegmentWasGlobStar = false; + segments.forEach((segment, index) => { + if (segment === GLOBSTAR) { + if (previousSegmentWasGlobStar) { + return; + } + regEx += starsToRegExp(2, index === segments.length - 1); + } else { + let inBraces = false; + let braceVal = ""; + let inBrackets = false; + let bracketVal = ""; + for (const char of segment) { + if (char !== "}" && inBraces) { + braceVal += char; + continue; + } + if (inBrackets && (char !== "]" || !bracketVal)) { + let res; + if (char === "-") { + res = char; + } else if ((char === "^" || char === "!") && !bracketVal) { + res = "^"; + } else if (char === GLOB_SPLIT) { + res = ""; + } else { + res = escapeRegExpCharacters(char); + } + bracketVal += res; + continue; + } + switch (char) { + case "{": + inBraces = true; + continue; + case "[": + inBrackets = true; + continue; + case "}": { + const choices = splitGlobAware(braceVal, ","); + const braceRegExp = `(?:${choices.map((choice) => parseRegExp(choice)).join("|")})`; + regEx += braceRegExp; + inBraces = false; + braceVal = ""; + break; + } + case "]": { + regEx += "[" + bracketVal + "]"; + inBrackets = false; + bracketVal = ""; + break; + } + case "?": + regEx += NO_PATH_REGEX; + continue; + case "*": + regEx += starsToRegExp(1); + continue; + default: + regEx += escapeRegExpCharacters(char); + } + } + if (index < segments.length - 1 && // more segments to come after this + (segments[index + 1] !== GLOBSTAR || // next segment is not **, or... + index + 2 < segments.length)) { + regEx += PATH_REGEX; + } + } + previousSegmentWasGlobStar = segment === GLOBSTAR; + }); + } + return regEx; +} +var T1 = /^\*\*\/\*\.[\w\.-]+$/; +var T2 = /^\*\*\/([\w\.-]+)\/?$/; +var T3 = /^{\*\*\/\*?[\w\.-]+\/?(,\*\*\/\*?[\w\.-]+\/?)*}$/; +var T3_2 = /^{\*\*\/\*?[\w\.-]+(\/(\*\*)?)?(,\*\*\/\*?[\w\.-]+(\/(\*\*)?)?)*}$/; +var T4 = /^\*\*((\/[\w\.-]+)+)\/?$/; +var T5 = /^([\w\.-]+(\/[\w\.-]+)*)\/?$/; +var CACHE = new LRUCache(1e4); +var FALSE = function() { + return false; +}; +var NULL = function() { + return null; +}; +function parsePattern(arg1, options2) { + if (!arg1) { + return NULL; + } + let pattern; + if (typeof arg1 !== "string") { + pattern = arg1.pattern; + } else { + pattern = arg1; + } + pattern = pattern.trim(); + const ignoreCase = options2.ignoreCase ?? false; + const internalOptions = { + ...options2, + equals: ignoreCase ? equalsIgnoreCase : (a, b) => a === b, + endsWith: ignoreCase ? endsWithIgnoreCase : (str, candidate) => str.endsWith(candidate), + // TODO: the '!isLinux' part below is to keep current behavior unchanged, but it should probably be removed + // in favor of passing correct options from the caller. + isEqualOrParent: (base, candidate) => isEqualOrParent(base, candidate, !isLinux || ignoreCase) + }; + const patternKey = `${ignoreCase ? pattern.toLowerCase() : pattern}_${!!options2.trimForExclusions}_${ignoreCase}`; + let parsedPattern = CACHE.get(patternKey); + if (parsedPattern) { + return wrapRelativePattern(parsedPattern, arg1, internalOptions); + } + let match2; + if (T1.test(pattern)) { + parsedPattern = trivia1(pattern.substring(4), pattern, internalOptions); + } else if (match2 = T2.exec(trimForExclusions(pattern, internalOptions))) { + parsedPattern = trivia2(match2[1], pattern, internalOptions); + } else if ((options2.trimForExclusions ? T3_2 : T3).test(pattern)) { + parsedPattern = trivia3(pattern, internalOptions); + } else if (match2 = T4.exec(trimForExclusions(pattern, internalOptions))) { + parsedPattern = trivia4and5(match2[1].substring(1), pattern, true, internalOptions); + } else if (match2 = T5.exec(trimForExclusions(pattern, internalOptions))) { + parsedPattern = trivia4and5(match2[1], pattern, false, internalOptions); + } else { + parsedPattern = toRegExp(pattern, internalOptions); + } + CACHE.set(patternKey, parsedPattern); + return wrapRelativePattern(parsedPattern, arg1, internalOptions); +} +function wrapRelativePattern(parsedPattern, arg2, options2) { + if (typeof arg2 === "string") { + return parsedPattern; + } + const wrappedPattern = function(path, basename3) { + if (!options2.isEqualOrParent(path, arg2.base)) { + return null; + } + return parsedPattern(ltrim(path.substring(arg2.base.length), sep), basename3); + }; + wrappedPattern.allBasenames = parsedPattern.allBasenames; + wrappedPattern.allPaths = parsedPattern.allPaths; + wrappedPattern.basenames = parsedPattern.basenames; + wrappedPattern.patterns = parsedPattern.patterns; + return wrappedPattern; +} +function trimForExclusions(pattern, options2) { + return options2.trimForExclusions && pattern.endsWith("/**") ? pattern.substring(0, pattern.length - 2) : pattern; +} +function trivia1(base, pattern, options2) { + return function(path, basename3) { + return typeof path === "string" && options2.endsWith(path, base) ? pattern : null; + }; +} +function trivia2(base, pattern, options2) { + const slashBase = `/${base}`; + const backslashBase = `\\${base}`; + const parsedPattern = function(path, basename3) { + if (typeof path !== "string") { + return null; + } + if (basename3) { + return options2.equals(basename3, base) ? pattern : null; + } + return options2.equals(path, base) || options2.endsWith(path, slashBase) || options2.endsWith(path, backslashBase) ? pattern : null; + }; + const basenames = [base]; + parsedPattern.basenames = basenames; + parsedPattern.patterns = [pattern]; + parsedPattern.allBasenames = basenames; + return parsedPattern; +} +function trivia3(pattern, options2) { + const parsedPatterns = aggregateBasenameMatches(pattern.slice(1, -1).split(",").map((pattern2) => parsePattern(pattern2, options2)).filter((pattern2) => pattern2 !== NULL), pattern); + const patternsLength = parsedPatterns.length; + if (!patternsLength) { + return NULL; + } + if (patternsLength === 1) { + return parsedPatterns[0]; + } + const parsedPattern = function(path, basename3) { + for (let i2 = 0, n2 = parsedPatterns.length; i2 < n2; i2++) { + if (parsedPatterns[i2](path, basename3)) { + return pattern; + } + } + return null; + }; + const withBasenames = parsedPatterns.find((pattern2) => !!pattern2.allBasenames); + if (withBasenames) { + parsedPattern.allBasenames = withBasenames.allBasenames; + } + const allPaths = parsedPatterns.reduce((all, current) => current.allPaths ? all.concat(current.allPaths) : all, []); + if (allPaths.length) { + parsedPattern.allPaths = allPaths; + } + return parsedPattern; +} +function trivia4and5(targetPath, pattern, matchPathEnds, options2) { + const usingPosixSep = sep === posix.sep; + const nativePath = usingPosixSep ? targetPath : targetPath.replace(ALL_FORWARD_SLASHES, sep); + const nativePathEnd = sep + nativePath; + const targetPathEnd = posix.sep + targetPath; + let parsedPattern; + if (matchPathEnds) { + parsedPattern = function(path, basename3) { + return typeof path === "string" && (options2.equals(path, nativePath) || options2.endsWith(path, nativePathEnd) || !usingPosixSep && (options2.equals(path, targetPath) || options2.endsWith(path, targetPathEnd))) ? pattern : null; + }; + } else { + parsedPattern = function(path, basename3) { + return typeof path === "string" && (options2.equals(path, nativePath) || !usingPosixSep && options2.equals(path, targetPath)) ? pattern : null; + }; + } + parsedPattern.allPaths = [(matchPathEnds ? "*/" : "./") + targetPath]; + return parsedPattern; +} +function toRegExp(pattern, options2) { + try { + const regExp = new RegExp(`^${parseRegExp(pattern)}$`, options2.ignoreCase ? "i" : void 0); + return function(path) { + regExp.lastIndex = 0; + return typeof path === "string" && regExp.test(path) ? pattern : null; + }; + } catch { + return NULL; + } +} +function match(arg1, path, options2) { + if (!arg1 || typeof path !== "string") { + return false; + } + return parse3(arg1, options2)(path); +} +function parse3(arg1, options2 = {}) { + if (!arg1) { + return FALSE; + } + if (typeof arg1 === "string" || isRelativePattern(arg1)) { + const parsedPattern = parsePattern(arg1, options2); + if (parsedPattern === NULL) { + return FALSE; + } + const resultPattern = function(path, basename3) { + return !!parsedPattern(path, basename3); + }; + if (parsedPattern.allBasenames) { + resultPattern.allBasenames = parsedPattern.allBasenames; + } + if (parsedPattern.allPaths) { + resultPattern.allPaths = parsedPattern.allPaths; + } + return resultPattern; + } + return parsedExpression(arg1, options2); +} +function isRelativePattern(obj) { + const rp = obj; + if (!rp) { + return false; + } + return typeof rp.base === "string" && typeof rp.pattern === "string"; +} +function parsedExpression(expression, options2) { + const parsedPatterns = aggregateBasenameMatches(Object.getOwnPropertyNames(expression).map((pattern) => parseExpressionPattern(pattern, expression[pattern], options2)).filter((pattern) => pattern !== NULL)); + const patternsLength = parsedPatterns.length; + if (!patternsLength) { + return NULL; + } + if (!parsedPatterns.some((parsedPattern) => !!parsedPattern.requiresSiblings)) { + if (patternsLength === 1) { + return parsedPatterns[0]; + } + const resultExpression2 = function(path, basename3) { + let resultPromises = void 0; + for (let i2 = 0, n2 = parsedPatterns.length; i2 < n2; i2++) { + const result = parsedPatterns[i2](path, basename3); + if (typeof result === "string") { + return result; + } + if (isThenable(result)) { + if (!resultPromises) { + resultPromises = []; + } + resultPromises.push(result); + } + } + if (resultPromises) { + return (async () => { + for (const resultPromise of resultPromises) { + const result = await resultPromise; + if (typeof result === "string") { + return result; + } + } + return null; + })(); + } + return null; + }; + const withBasenames2 = parsedPatterns.find((pattern) => !!pattern.allBasenames); + if (withBasenames2) { + resultExpression2.allBasenames = withBasenames2.allBasenames; + } + const allPaths2 = parsedPatterns.reduce((all, current) => current.allPaths ? all.concat(current.allPaths) : all, []); + if (allPaths2.length) { + resultExpression2.allPaths = allPaths2; + } + return resultExpression2; + } + const resultExpression = function(path, base, hasSibling) { + let name = void 0; + let resultPromises = void 0; + for (let i2 = 0, n2 = parsedPatterns.length; i2 < n2; i2++) { + const parsedPattern = parsedPatterns[i2]; + if (parsedPattern.requiresSiblings && hasSibling) { + if (!base) { + base = basename(path); + } + if (!name) { + name = base.substring(0, base.length - extname(path).length); + } + } + const result = parsedPattern(path, base, name, hasSibling); + if (typeof result === "string") { + return result; + } + if (isThenable(result)) { + if (!resultPromises) { + resultPromises = []; + } + resultPromises.push(result); + } + } + if (resultPromises) { + return (async () => { + for (const resultPromise of resultPromises) { + const result = await resultPromise; + if (typeof result === "string") { + return result; + } + } + return null; + })(); + } + return null; + }; + const withBasenames = parsedPatterns.find((pattern) => !!pattern.allBasenames); + if (withBasenames) { + resultExpression.allBasenames = withBasenames.allBasenames; + } + const allPaths = parsedPatterns.reduce((all, current) => current.allPaths ? all.concat(current.allPaths) : all, []); + if (allPaths.length) { + resultExpression.allPaths = allPaths; + } + return resultExpression; +} +function parseExpressionPattern(pattern, value, options2) { + if (value === false) { + return NULL; + } + const parsedPattern = parsePattern(pattern, options2); + if (parsedPattern === NULL) { + return NULL; + } + if (typeof value === "boolean") { + return parsedPattern; + } + if (value) { + const when = value.when; + if (typeof when === "string") { + const result = (path, basename3, name, hasSibling) => { + if (!hasSibling || !parsedPattern(path, basename3)) { + return null; + } + const clausePattern = when.replace("$(basename)", () => name); + const matched = hasSibling(clausePattern); + return isThenable(matched) ? matched.then((match2) => match2 ? pattern : null) : matched ? pattern : null; + }; + result.requiresSiblings = true; + return result; + } + } + return parsedPattern; +} +function aggregateBasenameMatches(parsedPatterns, result) { + const basenamePatterns = parsedPatterns.filter((parsedPattern) => !!parsedPattern.basenames); + if (basenamePatterns.length < 2) { + return parsedPatterns; + } + const basenames = basenamePatterns.reduce((all, current) => { + const basenames2 = current.basenames; + return basenames2 ? all.concat(basenames2) : all; + }, []); + let patterns; + if (result) { + patterns = []; + for (let i2 = 0, n2 = basenames.length; i2 < n2; i2++) { + patterns.push(result); + } + } else { + patterns = basenamePatterns.reduce((all, current) => { + const patterns2 = current.patterns; + return patterns2 ? all.concat(patterns2) : all; + }, []); + } + const aggregate = function(path, basename3) { + if (typeof path !== "string") { + return null; + } + if (!basename3) { + let i2; + for (i2 = path.length; i2 > 0; i2--) { + const ch = path.charCodeAt(i2 - 1); + if (ch === 47 || ch === 92) { + break; + } + } + basename3 = path.substring(i2); + } + const index = basenames.indexOf(basename3); + return index !== -1 ? patterns[index] : null; + }; + aggregate.basenames = basenames; + aggregate.patterns = patterns; + aggregate.allBasenames = basenames; + const aggregatedPatterns = parsedPatterns.filter((parsedPattern) => !parsedPattern.basenames); + aggregatedPatterns.push(aggregate); + return aggregatedPatterns; +} + +// node_modules/monaco-editor-core/esm/vs/editor/common/languageSelector.js +init_path(); +function score2(selector, candidateUri, candidateLanguage, candidateIsSynchronized, candidateNotebookUri, candidateNotebookType) { + if (Array.isArray(selector)) { + let ret = 0; + for (const filter of selector) { + const value = score2(filter, candidateUri, candidateLanguage, candidateIsSynchronized, candidateNotebookUri, candidateNotebookType); + if (value === 10) { + return value; + } + if (value > ret) { + ret = value; + } + } + return ret; + } else if (typeof selector === "string") { + if (!candidateIsSynchronized) { + return 0; + } + if (selector === "*") { + return 5; + } else if (selector === candidateLanguage) { + return 10; + } else { + return 0; + } + } else if (selector) { + const { language: language2, pattern, scheme, hasAccessToAllModels, notebookType } = selector; + if (!candidateIsSynchronized && !hasAccessToAllModels) { + return 0; + } + if (notebookType && candidateNotebookUri) { + candidateUri = candidateNotebookUri; + } + let ret = 0; + if (scheme) { + if (scheme === candidateUri.scheme) { + ret = 10; + } else if (scheme === "*") { + ret = 5; + } else { + return 0; + } + } + if (language2) { + if (language2 === candidateLanguage) { + ret = 10; + } else if (language2 === "*") { + ret = Math.max(ret, 5); + } else { + return 0; + } + } + if (notebookType) { + if (notebookType === candidateNotebookType) { + ret = 10; + } else if (notebookType === "*" && candidateNotebookType !== void 0) { + ret = Math.max(ret, 5); + } else { + return 0; + } + } + if (pattern) { + let normalizedPattern; + if (typeof pattern === "string") { + normalizedPattern = pattern; + } else { + normalizedPattern = { ...pattern, base: normalize(pattern.base) }; + } + if (normalizedPattern === candidateUri.fsPath || match(normalizedPattern, candidateUri.fsPath)) { + ret = 10; + } else { + return 0; + } + } + return ret; + } else { + return 0; + } +} + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/wordHighlighter/browser/wordHighlighter.js +init_model2(); +init_languageFeatures(); +init_resolverService(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/wordHighlighter/browser/textualHighlightProvider.js +init_wordHelper(); +init_languageFeatures(); +init_languages(); +init_lifecycle(); +init_map(); +var __decorate156 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param150 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var TextualDocumentHighlightProvider = class { + constructor() { + this.selector = { language: "*" }; + } + provideDocumentHighlights(model, position, token) { + const result = []; + const word = model.getWordAtPosition({ + lineNumber: position.lineNumber, + column: position.column + }); + if (!word) { + return Promise.resolve(result); + } + if (model.isDisposed()) { + return; + } + const matches = model.findMatches(word.word, true, false, true, USUAL_WORD_SEPARATORS, false); + return matches.map((m) => ({ + range: m.range, + kind: DocumentHighlightKind.Text + })); + } + provideMultiDocumentHighlights(primaryModel, position, otherModels, token) { + const result = new ResourceMap(); + const word = primaryModel.getWordAtPosition({ + lineNumber: position.lineNumber, + column: position.column + }); + if (!word) { + return Promise.resolve(result); + } + for (const model of [primaryModel, ...otherModels]) { + if (model.isDisposed()) { + continue; + } + const matches = model.findMatches(word.word, true, false, true, USUAL_WORD_SEPARATORS, false); + const highlights = matches.map((m) => ({ + range: m.range, + kind: DocumentHighlightKind.Text + })); + if (highlights) { + result.set(model.uri, highlights); + } + } + return result; + } +}; +var TextualMultiDocumentHighlightFeature = class TextualMultiDocumentHighlightFeature2 extends Disposable { + constructor(languageFeaturesService) { + super(); + this._register(languageFeaturesService.documentHighlightProvider.register("*", new TextualDocumentHighlightProvider())); + this._register(languageFeaturesService.multiDocumentHighlightProvider.register("*", new TextualDocumentHighlightProvider())); + } +}; +TextualMultiDocumentHighlightFeature = __decorate156([ + __param150(0, ILanguageFeaturesService) +], TextualMultiDocumentHighlightFeature); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/wordHighlighter/browser/wordHighlighter.js +var __decorate157 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param151 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var WordHighlighter_1; +var WordHighlighterContribution_1; +var ctxHasWordHighlights = new RawContextKey("hasWordHighlights", false); +function getOccurrencesAtPosition(registry, model, position, token) { + const orderedByScore = registry.ordered(model); + return first(orderedByScore.map((provider) => () => { + return Promise.resolve(provider.provideDocumentHighlights(model, position, token)).then(void 0, onUnexpectedExternalError); + }), (result) => result !== void 0 && result !== null).then((result) => { + if (result) { + const map = new ResourceMap(); + map.set(model.uri, result); + return map; + } + return new ResourceMap(); + }); +} +function getOccurrencesAcrossMultipleModels(registry, model, position, token, otherModels) { + const orderedByScore = registry.ordered(model); + return first(orderedByScore.map((provider) => () => { + const filteredModels = otherModels.filter((otherModel) => { + return shouldSynchronizeModel(otherModel); + }).filter((otherModel) => { + return score2(provider.selector, otherModel.uri, otherModel.getLanguageId(), true, void 0, void 0) > 0; + }); + return Promise.resolve(provider.provideMultiDocumentHighlights(model, position, filteredModels, token)).then(void 0, onUnexpectedExternalError); + }), (result) => result !== void 0 && result !== null); +} +var OccurenceAtPositionRequest = class { + constructor(_model, _selection, _wordSeparators) { + this._model = _model; + this._selection = _selection; + this._wordSeparators = _wordSeparators; + this._wordRange = this._getCurrentWordRange(_model, _selection); + this._result = null; + } + get result() { + if (!this._result) { + this._result = createCancelablePromise((token) => this._compute(this._model, this._selection, this._wordSeparators, token)); + } + return this._result; + } + _getCurrentWordRange(model, selection) { + const word = model.getWordAtPosition(selection.getPosition()); + if (word) { + return new Range(selection.startLineNumber, word.startColumn, selection.startLineNumber, word.endColumn); + } + return null; + } + cancel() { + this.result.cancel(); + } +}; +var SemanticOccurenceAtPositionRequest = class extends OccurenceAtPositionRequest { + constructor(model, selection, wordSeparators2, providers) { + super(model, selection, wordSeparators2); + this._providers = providers; + } + _compute(model, selection, wordSeparators2, token) { + return getOccurrencesAtPosition(this._providers, model, selection.getPosition(), token).then((value) => { + if (!value) { + return new ResourceMap(); + } + return value; + }); + } +}; +var MultiModelOccurenceRequest = class extends OccurenceAtPositionRequest { + constructor(model, selection, wordSeparators2, providers, otherModels) { + super(model, selection, wordSeparators2); + this._providers = providers; + this._otherModels = otherModels; + } + _compute(model, selection, wordSeparators2, token) { + return getOccurrencesAcrossMultipleModels(this._providers, model, selection.getPosition(), token, this._otherModels).then((value) => { + if (!value) { + return new ResourceMap(); + } + return value; + }); + } +}; +function computeOccurencesAtPosition(registry, model, selection, wordSeparators2) { + return new SemanticOccurenceAtPositionRequest(model, selection, wordSeparators2, registry); +} +function computeOccurencesMultiModel(registry, model, selection, wordSeparators2, otherModels) { + return new MultiModelOccurenceRequest(model, selection, wordSeparators2, registry, otherModels); +} +registerModelAndPositionCommand("_executeDocumentHighlights", async (accessor, model, position) => { + const languageFeaturesService = accessor.get(ILanguageFeaturesService); + const map = await getOccurrencesAtPosition(languageFeaturesService.documentHighlightProvider, model, position, CancellationToken.None); + return map?.get(model.uri); +}); +var WordHighlighter = class WordHighlighter2 { + static { + WordHighlighter_1 = this; + } + static { + this.storedDecorationIDs = new ResourceMap(); + } + static { + this.query = null; + } + constructor(editor2, providers, multiProviders, contextKeyService, textModelService, codeEditorService, configurationService, logService) { + this.toUnhook = new DisposableStore(); + this.workerRequestTokenId = 0; + this.workerRequestCompleted = false; + this.workerRequestValue = new ResourceMap(); + this.lastCursorPositionChangeTime = 0; + this.renderDecorationsTimer = void 0; + this.runDelayer = this.toUnhook.add(new Delayer(50)); + this.editor = editor2; + this.providers = providers; + this.multiDocumentProviders = multiProviders; + this.codeEditorService = codeEditorService; + this.textModelService = textModelService; + this.configurationService = configurationService; + this.logService = logService; + this._hasWordHighlights = ctxHasWordHighlights.bindTo(contextKeyService); + this._ignorePositionChangeEvent = false; + this.occurrencesHighlightEnablement = this.editor.getOption( + 90 + /* EditorOption.occurrencesHighlight */ + ); + this.occurrencesHighlightDelay = this.configurationService.getValue("editor.occurrencesHighlightDelay"); + this.model = this.editor.getModel(); + this.toUnhook.add(editor2.onDidChangeCursorPosition((e) => { + if (this._ignorePositionChangeEvent) { + return; + } + if (this.occurrencesHighlightEnablement === "off") { + return; + } + this.runDelayer.trigger(() => { + this._onPositionChanged(e); + }); + })); + this.toUnhook.add(editor2.onDidFocusEditorText((e) => { + if (this.occurrencesHighlightEnablement === "off") { + return; + } + if (!this.workerRequest) { + this.runDelayer.trigger(() => { + this._run(); + }); + } + })); + this.toUnhook.add(editor2.onDidChangeModelContent((e) => { + if (!matchesScheme(this.model.uri, "output")) { + this._stopAll(); + } + })); + this.toUnhook.add(editor2.onDidChangeModel((e) => { + if (!e.newModelUrl && e.oldModelUrl) { + this._stopSingular(); + } else if (WordHighlighter_1.query) { + this._run(); + } + })); + this.toUnhook.add(editor2.onDidChangeConfiguration((e) => { + const newEnablement = this.editor.getOption( + 90 + /* EditorOption.occurrencesHighlight */ + ); + if (this.occurrencesHighlightEnablement !== newEnablement) { + this.occurrencesHighlightEnablement = newEnablement; + switch (newEnablement) { + case "off": + this._stopAll(); + break; + case "singleFile": + this._stopAll(WordHighlighter_1.query?.modelInfo?.modelURI); + break; + case "multiFile": + if (WordHighlighter_1.query) { + this._run(true); + } + break; + default: + console.warn("Unknown occurrencesHighlight setting value:", newEnablement); + break; + } + } + })); + this.toUnhook.add(this.configurationService.onDidChangeConfiguration((e) => { + if (e.affectsConfiguration("editor.occurrencesHighlightDelay")) { + const newDelay = configurationService.getValue("editor.occurrencesHighlightDelay"); + if (this.occurrencesHighlightDelay !== newDelay) { + this.occurrencesHighlightDelay = newDelay; + } + } + })); + this.toUnhook.add(editor2.onDidBlurEditorWidget(() => { + const activeEditor = this.codeEditorService.getFocusedCodeEditor(); + if (!activeEditor) { + this._stopAll(); + } else if (activeEditor.getModel()?.uri.scheme === Schemas.vscodeNotebookCell && this.editor.getModel()?.uri.scheme !== Schemas.vscodeNotebookCell) { + this._stopAll(); + } + })); + this.decorations = this.editor.createDecorationsCollection(); + this.workerRequestTokenId = 0; + this.workerRequest = null; + this.workerRequestCompleted = false; + this.lastCursorPositionChangeTime = 0; + this.renderDecorationsTimer = void 0; + if (WordHighlighter_1.query) { + this._run(); + } + } + hasDecorations() { + return this.decorations.length > 0; + } + restore(delay) { + if (this.occurrencesHighlightEnablement === "off") { + return; + } + this.runDelayer.cancel(); + this.runDelayer.trigger(() => { + this._run(false, delay); + }); + } + stop() { + if (this.occurrencesHighlightEnablement === "off") { + return; + } + this._stopAll(); + } + _getSortedHighlights() { + return this.decorations.getRanges().sort(Range.compareRangesUsingStarts); + } + moveNext() { + const highlights = this._getSortedHighlights(); + const index = highlights.findIndex((range2) => range2.containsPosition(this.editor.getPosition())); + const newIndex = (index + 1) % highlights.length; + const dest = highlights[newIndex]; + try { + this._ignorePositionChangeEvent = true; + this.editor.setPosition(dest.getStartPosition()); + this.editor.revealRangeInCenterIfOutsideViewport(dest); + const word = this._getWord(); + if (word) { + const lineContent = this.editor.getModel().getLineContent(dest.startLineNumber); + alert(`${lineContent}, ${newIndex + 1} of ${highlights.length} for '${word.word}'`); + } + } finally { + this._ignorePositionChangeEvent = false; + } + } + moveBack() { + const highlights = this._getSortedHighlights(); + const index = highlights.findIndex((range2) => range2.containsPosition(this.editor.getPosition())); + const newIndex = (index - 1 + highlights.length) % highlights.length; + const dest = highlights[newIndex]; + try { + this._ignorePositionChangeEvent = true; + this.editor.setPosition(dest.getStartPosition()); + this.editor.revealRangeInCenterIfOutsideViewport(dest); + const word = this._getWord(); + if (word) { + const lineContent = this.editor.getModel().getLineContent(dest.startLineNumber); + alert(`${lineContent}, ${newIndex + 1} of ${highlights.length} for '${word.word}'`); + } + } finally { + this._ignorePositionChangeEvent = false; + } + } + _removeSingleDecorations() { + if (!this.editor.hasModel()) { + return; + } + const currentDecorationIDs = WordHighlighter_1.storedDecorationIDs.get(this.editor.getModel().uri); + if (!currentDecorationIDs) { + return; + } + this.editor.removeDecorations(currentDecorationIDs); + WordHighlighter_1.storedDecorationIDs.delete(this.editor.getModel().uri); + if (this.decorations.length > 0) { + this.decorations.clear(); + this._hasWordHighlights.set(false); + } + } + _removeAllDecorations(preservedModel) { + const currentEditors = this.codeEditorService.listCodeEditors(); + const deleteURI = []; + for (const editor2 of currentEditors) { + if (!editor2.hasModel() || isEqual(editor2.getModel().uri, preservedModel)) { + continue; + } + const currentDecorationIDs = WordHighlighter_1.storedDecorationIDs.get(editor2.getModel().uri); + if (!currentDecorationIDs) { + continue; + } + editor2.removeDecorations(currentDecorationIDs); + deleteURI.push(editor2.getModel().uri); + const editorHighlighterContrib = WordHighlighterContribution.get(editor2); + if (!editorHighlighterContrib?.wordHighlighter) { + continue; + } + if (editorHighlighterContrib.wordHighlighter.decorations.length > 0) { + editorHighlighterContrib.wordHighlighter.decorations.clear(); + editorHighlighterContrib.wordHighlighter.workerRequest = null; + editorHighlighterContrib.wordHighlighter._hasWordHighlights.set(false); + } + } + for (const uri of deleteURI) { + WordHighlighter_1.storedDecorationIDs.delete(uri); + } + } + _stopSingular() { + this._removeSingleDecorations(); + if (this.editor.hasTextFocus()) { + if (this.editor.getModel()?.uri.scheme !== Schemas.vscodeNotebookCell && WordHighlighter_1.query?.modelInfo?.modelURI.scheme !== Schemas.vscodeNotebookCell) { + WordHighlighter_1.query = null; + this._run(); + } else { + if (WordHighlighter_1.query?.modelInfo) { + WordHighlighter_1.query.modelInfo = null; + } + } + } + if (this.renderDecorationsTimer !== void 0) { + clearTimeout(this.renderDecorationsTimer); + this.renderDecorationsTimer = void 0; + } + if (this.workerRequest !== null) { + this.workerRequest.cancel(); + this.workerRequest = null; + } + if (!this.workerRequestCompleted) { + this.workerRequestTokenId++; + this.workerRequestCompleted = true; + } + } + _stopAll(preservedModel) { + this._removeAllDecorations(preservedModel); + if (this.renderDecorationsTimer !== void 0) { + clearTimeout(this.renderDecorationsTimer); + this.renderDecorationsTimer = void 0; + } + if (this.workerRequest !== null) { + this.workerRequest.cancel(); + this.workerRequest = null; + } + if (!this.workerRequestCompleted) { + this.workerRequestTokenId++; + this.workerRequestCompleted = true; + } + } + _onPositionChanged(e) { + if (this.occurrencesHighlightEnablement === "off") { + this._stopAll(); + return; + } + if (e.source !== "api" && e.reason !== 3) { + this._stopAll(); + return; + } + this._run(); + } + _getWord() { + const editorSelection = this.editor.getSelection(); + const lineNumber = editorSelection.startLineNumber; + const startColumn = editorSelection.startColumn; + if (this.model.isDisposed()) { + return null; + } + return this.model.getWordAtPosition({ + lineNumber, + column: startColumn + }); + } + getOtherModelsToHighlight(model) { + if (!model) { + return []; + } + const isNotebookEditor = model.uri.scheme === Schemas.vscodeNotebookCell; + if (isNotebookEditor) { + const currentModels2 = []; + const currentEditors2 = this.codeEditorService.listCodeEditors(); + for (const editor2 of currentEditors2) { + const tempModel = editor2.getModel(); + if (tempModel && tempModel !== model && tempModel.uri.scheme === Schemas.vscodeNotebookCell) { + currentModels2.push(tempModel); + } + } + return currentModels2; + } + const currentModels = []; + const currentEditors = this.codeEditorService.listCodeEditors(); + for (const editor2 of currentEditors) { + if (!isDiffEditor(editor2)) { + continue; + } + const diffModel = editor2.getModel(); + if (!diffModel) { + continue; + } + if (model === diffModel.modified) { + currentModels.push(diffModel.modified); + } + } + if (currentModels.length) { + return currentModels; + } + if (this.occurrencesHighlightEnablement === "singleFile") { + return []; + } + for (const editor2 of currentEditors) { + const tempModel = editor2.getModel(); + const isValidModel = tempModel && tempModel !== model; + if (isValidModel) { + currentModels.push(tempModel); + } + } + return currentModels; + } + async _run(multiFileConfigChange, delay) { + const hasTextFocus = this.editor.hasTextFocus(); + if (!hasTextFocus) { + if (!WordHighlighter_1.query) { + this._stopAll(); + return; + } + } else { + const editorSelection = this.editor.getSelection(); + if (!editorSelection || editorSelection.startLineNumber !== editorSelection.endLineNumber) { + WordHighlighter_1.query = null; + this._stopAll(); + return; + } + const startColumn = editorSelection.startColumn; + const endColumn = editorSelection.endColumn; + const word = this._getWord(); + if (!word || word.startColumn > startColumn || word.endColumn < endColumn) { + WordHighlighter_1.query = null; + this._stopAll(); + return; + } + WordHighlighter_1.query = { + modelInfo: { + modelURI: this.model.uri, + selection: editorSelection + } + }; + } + this.lastCursorPositionChangeTime = (/* @__PURE__ */ new Date()).getTime(); + if (isEqual(this.editor.getModel().uri, WordHighlighter_1.query.modelInfo?.modelURI)) { + if (!multiFileConfigChange) { + const currentModelDecorationRanges = this.decorations.getRanges(); + for (const storedRange of currentModelDecorationRanges) { + if (storedRange.containsPosition(this.editor.getPosition())) { + return; + } + } + } + this._stopAll(multiFileConfigChange ? this.model.uri : void 0); + const myRequestId = ++this.workerRequestTokenId; + this.workerRequestCompleted = false; + const otherModelsToHighlight = this.getOtherModelsToHighlight(this.editor.getModel()); + if (!WordHighlighter_1.query || !WordHighlighter_1.query.modelInfo) { + return; + } + const queryModelRef = await this.textModelService.createModelReference(WordHighlighter_1.query.modelInfo.modelURI); + try { + this.workerRequest = this.computeWithModel(queryModelRef.object.textEditorModel, WordHighlighter_1.query.modelInfo.selection, otherModelsToHighlight); + this.workerRequest?.result.then((data) => { + if (myRequestId === this.workerRequestTokenId) { + this.workerRequestCompleted = true; + this.workerRequestValue = data || []; + this._beginRenderDecorations(delay ?? this.occurrencesHighlightDelay); + } + }, onUnexpectedError); + } catch (e) { + this.logService.error("Unexpected error during occurrence request. Log: ", e); + } finally { + queryModelRef.dispose(); + } + } else if (this.model.uri.scheme === Schemas.vscodeNotebookCell) { + const myRequestId = ++this.workerRequestTokenId; + this.workerRequestCompleted = false; + if (!WordHighlighter_1.query || !WordHighlighter_1.query.modelInfo) { + return; + } + const queryModelRef = await this.textModelService.createModelReference(WordHighlighter_1.query.modelInfo.modelURI); + try { + this.workerRequest = this.computeWithModel(queryModelRef.object.textEditorModel, WordHighlighter_1.query.modelInfo.selection, [this.model]); + this.workerRequest?.result.then((data) => { + if (myRequestId === this.workerRequestTokenId) { + this.workerRequestCompleted = true; + this.workerRequestValue = data || []; + this._beginRenderDecorations(delay ?? this.occurrencesHighlightDelay); + } + }, onUnexpectedError); + } catch (e) { + this.logService.error("Unexpected error during occurrence request. Log: ", e); + } finally { + queryModelRef.dispose(); + } + } + } + computeWithModel(model, selection, otherModels) { + if (!otherModels.length) { + return computeOccurencesAtPosition(this.providers, model, selection, this.editor.getOption( + 148 + /* EditorOption.wordSeparators */ + )); + } else { + return computeOccurencesMultiModel(this.multiDocumentProviders, model, selection, this.editor.getOption( + 148 + /* EditorOption.wordSeparators */ + ), otherModels); + } + } + _beginRenderDecorations(delay) { + const currentTime = (/* @__PURE__ */ new Date()).getTime(); + const minimumRenderTime = this.lastCursorPositionChangeTime + delay; + if (currentTime >= minimumRenderTime) { + this.renderDecorationsTimer = void 0; + this.renderDecorations(); + } else { + this.renderDecorationsTimer = setTimeout(() => { + this.renderDecorations(); + }, minimumRenderTime - currentTime); + } + } + renderDecorations() { + this.renderDecorationsTimer = void 0; + const currentEditors = this.codeEditorService.listCodeEditors(); + for (const editor2 of currentEditors) { + const editorHighlighterContrib = WordHighlighterContribution.get(editor2); + if (!editorHighlighterContrib) { + continue; + } + const newDecorations = []; + const uri = editor2.getModel()?.uri; + if (uri && this.workerRequestValue.has(uri)) { + const oldDecorationIDs = WordHighlighter_1.storedDecorationIDs.get(uri); + const newDocumentHighlights = this.workerRequestValue.get(uri); + if (newDocumentHighlights) { + for (const highlight of newDocumentHighlights) { + if (!highlight.range) { + continue; + } + newDecorations.push({ + range: highlight.range, + options: getHighlightDecorationOptions(highlight.kind) + }); + } + } + let newDecorationIDs = []; + editor2.changeDecorations((changeAccessor) => { + newDecorationIDs = changeAccessor.deltaDecorations(oldDecorationIDs ?? [], newDecorations); + }); + WordHighlighter_1.storedDecorationIDs = WordHighlighter_1.storedDecorationIDs.set(uri, newDecorationIDs); + if (newDecorations.length > 0) { + editorHighlighterContrib.wordHighlighter?.decorations.set(newDecorations); + editorHighlighterContrib.wordHighlighter?._hasWordHighlights.set(true); + } + } + } + this.workerRequest = null; + } + dispose() { + this._stopSingular(); + this.toUnhook.dispose(); + } +}; +WordHighlighter = WordHighlighter_1 = __decorate157([ + __param151(4, ITextModelService), + __param151(5, ICodeEditorService), + __param151(6, IConfigurationService), + __param151(7, ILogService) +], WordHighlighter); +var WordHighlighterContribution = class WordHighlighterContribution2 extends Disposable { + static { + WordHighlighterContribution_1 = this; + } + static { + this.ID = "editor.contrib.wordHighlighter"; + } + static get(editor2) { + return editor2.getContribution(WordHighlighterContribution_1.ID); + } + constructor(editor2, contextKeyService, languageFeaturesService, codeEditorService, textModelService, configurationService, logService) { + super(); + this._wordHighlighter = null; + const createWordHighlighterIfPossible = () => { + if (editor2.hasModel() && !editor2.getModel().isTooLargeForTokenization() && editor2.getModel().uri.scheme !== Schemas.accessibleView) { + this._wordHighlighter = new WordHighlighter(editor2, languageFeaturesService.documentHighlightProvider, languageFeaturesService.multiDocumentHighlightProvider, contextKeyService, textModelService, codeEditorService, configurationService, logService); + } + }; + this._register(editor2.onDidChangeModel((e) => { + if (this._wordHighlighter) { + if (!e.newModelUrl && e.oldModelUrl?.scheme !== Schemas.vscodeNotebookCell) { + this.wordHighlighter?.stop(); + } + this._wordHighlighter.dispose(); + this._wordHighlighter = null; + } + createWordHighlighterIfPossible(); + })); + createWordHighlighterIfPossible(); + } + get wordHighlighter() { + return this._wordHighlighter; + } + saveViewState() { + if (this._wordHighlighter && this._wordHighlighter.hasDecorations()) { + return true; + } + return false; + } + moveNext() { + this._wordHighlighter?.moveNext(); + } + moveBack() { + this._wordHighlighter?.moveBack(); + } + restoreViewState(state) { + if (this._wordHighlighter && state) { + this._wordHighlighter.restore(250); + } + } + dispose() { + if (this._wordHighlighter) { + this._wordHighlighter.dispose(); + this._wordHighlighter = null; + } + super.dispose(); + } +}; +WordHighlighterContribution = WordHighlighterContribution_1 = __decorate157([ + __param151(1, IContextKeyService), + __param151(2, ILanguageFeaturesService), + __param151(3, ICodeEditorService), + __param151(4, ITextModelService), + __param151(5, IConfigurationService), + __param151(6, ILogService) +], WordHighlighterContribution); +var WordHighlightNavigationAction = class extends EditorAction { + constructor(next, opts) { + super(opts); + this._isNext = next; + } + run(accessor, editor2) { + const controller = WordHighlighterContribution.get(editor2); + if (!controller) { + return; + } + if (this._isNext) { + controller.moveNext(); + } else { + controller.moveBack(); + } + } +}; +var NextWordHighlightAction = class extends WordHighlightNavigationAction { + constructor() { + super(true, { + id: "editor.action.wordHighlight.next", + label: localize2(1572, "Go to Next Symbol Highlight"), + precondition: ctxHasWordHighlights, + kbOpts: { + kbExpr: EditorContextKeys.editorTextFocus, + primary: 65, + weight: 100 + /* KeybindingWeight.EditorContrib */ + } + }); + } +}; +var PrevWordHighlightAction = class extends WordHighlightNavigationAction { + constructor() { + super(false, { + id: "editor.action.wordHighlight.prev", + label: localize2(1573, "Go to Previous Symbol Highlight"), + precondition: ctxHasWordHighlights, + kbOpts: { + kbExpr: EditorContextKeys.editorTextFocus, + primary: 1024 | 65, + weight: 100 + /* KeybindingWeight.EditorContrib */ + } + }); + } +}; +var TriggerWordHighlightAction = class extends EditorAction { + constructor() { + super({ + id: "editor.action.wordHighlight.trigger", + label: localize2(1574, "Trigger Symbol Highlight"), + precondition: void 0, + kbOpts: { + kbExpr: EditorContextKeys.editorTextFocus, + primary: 0, + weight: 100 + /* KeybindingWeight.EditorContrib */ + } + }); + } + run(accessor, editor2, args) { + const controller = WordHighlighterContribution.get(editor2); + if (!controller) { + return; + } + controller.restoreViewState(true); + } +}; +registerEditorContribution( + WordHighlighterContribution.ID, + WordHighlighterContribution, + 0 + /* EditorContributionInstantiation.Eager */ +); +registerEditorAction(NextWordHighlightAction); +registerEditorAction(PrevWordHighlightAction); +registerEditorAction(TriggerWordHighlightAction); +registerEditorFeature(TextualMultiDocumentHighlightFeature); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/wordOperations/browser/wordOperations.js +init_nls(); +init_contextkey(); +init_editorExtensions(); +init_position(); +init_range(); +init_selection(); +init_wordCharacterClassifier(); +init_editorContextKeys(); +init_languageConfigurationRegistry(); +var MoveWordCommand = class extends EditorCommand { + constructor(opts) { + super(opts); + this._inSelectionMode = opts.inSelectionMode; + this._wordNavigationType = opts.wordNavigationType; + } + runEditorCommand(accessor, editor2, args) { + if (!editor2.hasModel()) { + return; + } + const wordSeparators2 = getMapForWordSeparators(editor2.getOption( + 148 + /* EditorOption.wordSeparators */ + ), editor2.getOption( + 147 + /* EditorOption.wordSegmenterLocales */ + )); + const model = editor2.getModel(); + const selections = editor2.getSelections(); + const hasMulticursor = selections.length > 1; + const result = selections.map((sel) => { + const inPosition = new Position(sel.positionLineNumber, sel.positionColumn); + const outPosition = this._move(wordSeparators2, model, inPosition, this._wordNavigationType, hasMulticursor); + return this._moveTo(sel, outPosition, this._inSelectionMode); + }); + model.pushStackElement(); + editor2._getViewModel().setCursorStates("moveWordCommand", 3, result.map((r) => CursorState.fromModelSelection(r))); + if (result.length === 1) { + const pos = new Position(result[0].positionLineNumber, result[0].positionColumn); + editor2.revealPosition( + pos, + 0 + /* ScrollType.Smooth */ + ); + } + } + _moveTo(from, to, inSelectionMode) { + if (inSelectionMode) { + return new Selection(from.selectionStartLineNumber, from.selectionStartColumn, to.lineNumber, to.column); + } else { + return new Selection(to.lineNumber, to.column, to.lineNumber, to.column); + } + } +}; +var WordLeftCommand = class extends MoveWordCommand { + _move(wordSeparators2, model, position, wordNavigationType, hasMulticursor) { + return WordOperations.moveWordLeft(wordSeparators2, model, position, wordNavigationType, hasMulticursor); + } +}; +var WordRightCommand = class extends MoveWordCommand { + _move(wordSeparators2, model, position, wordNavigationType, hasMulticursor) { + return WordOperations.moveWordRight(wordSeparators2, model, position, wordNavigationType); + } +}; +var CursorWordStartLeft = class extends WordLeftCommand { + constructor() { + super({ + inSelectionMode: false, + wordNavigationType: 0, + id: "cursorWordStartLeft", + precondition: void 0 + }); + } +}; +var CursorWordEndLeft = class extends WordLeftCommand { + constructor() { + super({ + inSelectionMode: false, + wordNavigationType: 2, + id: "cursorWordEndLeft", + precondition: void 0 + }); + } +}; +var CursorWordLeft = class extends WordLeftCommand { + constructor() { + super({ + inSelectionMode: false, + wordNavigationType: 1, + id: "cursorWordLeft", + precondition: void 0, + kbOpts: { + kbExpr: ContextKeyExpr.and(EditorContextKeys.textInputFocus, ContextKeyExpr.and(CONTEXT_ACCESSIBILITY_MODE_ENABLED, IsWindowsContext)?.negate()), + primary: 2048 | 15, + mac: { + primary: 512 | 15 + /* KeyCode.LeftArrow */ + }, + weight: 100 + /* KeybindingWeight.EditorContrib */ + } + }); + } +}; +var CursorWordStartLeftSelect = class extends WordLeftCommand { + constructor() { + super({ + inSelectionMode: true, + wordNavigationType: 0, + id: "cursorWordStartLeftSelect", + precondition: void 0 + }); + } +}; +var CursorWordEndLeftSelect = class extends WordLeftCommand { + constructor() { + super({ + inSelectionMode: true, + wordNavigationType: 2, + id: "cursorWordEndLeftSelect", + precondition: void 0 + }); + } +}; +var CursorWordLeftSelect = class extends WordLeftCommand { + constructor() { + super({ + inSelectionMode: true, + wordNavigationType: 1, + id: "cursorWordLeftSelect", + precondition: void 0, + kbOpts: { + kbExpr: ContextKeyExpr.and(EditorContextKeys.textInputFocus, ContextKeyExpr.and(CONTEXT_ACCESSIBILITY_MODE_ENABLED, IsWindowsContext)?.negate()), + primary: 2048 | 1024 | 15, + mac: { + primary: 512 | 1024 | 15 + /* KeyCode.LeftArrow */ + }, + weight: 100 + /* KeybindingWeight.EditorContrib */ + } + }); + } +}; +var CursorWordAccessibilityLeft = class extends WordLeftCommand { + constructor() { + super({ + inSelectionMode: false, + wordNavigationType: 3, + id: "cursorWordAccessibilityLeft", + precondition: void 0 + }); + } + _move(wordCharacterClassifier, model, position, wordNavigationType, hasMulticursor) { + return super._move(getMapForWordSeparators(EditorOptions.wordSeparators.defaultValue, wordCharacterClassifier.intlSegmenterLocales), model, position, wordNavigationType, hasMulticursor); + } +}; +var CursorWordAccessibilityLeftSelect = class extends WordLeftCommand { + constructor() { + super({ + inSelectionMode: true, + wordNavigationType: 3, + id: "cursorWordAccessibilityLeftSelect", + precondition: void 0 + }); + } + _move(wordCharacterClassifier, model, position, wordNavigationType, hasMulticursor) { + return super._move(getMapForWordSeparators(EditorOptions.wordSeparators.defaultValue, wordCharacterClassifier.intlSegmenterLocales), model, position, wordNavigationType, hasMulticursor); + } +}; +var CursorWordStartRight = class extends WordRightCommand { + constructor() { + super({ + inSelectionMode: false, + wordNavigationType: 0, + id: "cursorWordStartRight", + precondition: void 0 + }); + } +}; +var CursorWordEndRight = class extends WordRightCommand { + constructor() { + super({ + inSelectionMode: false, + wordNavigationType: 2, + id: "cursorWordEndRight", + precondition: void 0, + kbOpts: { + kbExpr: ContextKeyExpr.and(EditorContextKeys.textInputFocus, ContextKeyExpr.and(CONTEXT_ACCESSIBILITY_MODE_ENABLED, IsWindowsContext)?.negate()), + primary: 2048 | 17, + mac: { + primary: 512 | 17 + /* KeyCode.RightArrow */ + }, + weight: 100 + /* KeybindingWeight.EditorContrib */ + } + }); + } +}; +var CursorWordRight = class extends WordRightCommand { + constructor() { + super({ + inSelectionMode: false, + wordNavigationType: 2, + id: "cursorWordRight", + precondition: void 0 + }); + } +}; +var CursorWordStartRightSelect = class extends WordRightCommand { + constructor() { + super({ + inSelectionMode: true, + wordNavigationType: 0, + id: "cursorWordStartRightSelect", + precondition: void 0 + }); + } +}; +var CursorWordEndRightSelect = class extends WordRightCommand { + constructor() { + super({ + inSelectionMode: true, + wordNavigationType: 2, + id: "cursorWordEndRightSelect", + precondition: void 0, + kbOpts: { + kbExpr: ContextKeyExpr.and(EditorContextKeys.textInputFocus, ContextKeyExpr.and(CONTEXT_ACCESSIBILITY_MODE_ENABLED, IsWindowsContext)?.negate()), + primary: 2048 | 1024 | 17, + mac: { + primary: 512 | 1024 | 17 + /* KeyCode.RightArrow */ + }, + weight: 100 + /* KeybindingWeight.EditorContrib */ + } + }); + } +}; +var CursorWordRightSelect = class extends WordRightCommand { + constructor() { + super({ + inSelectionMode: true, + wordNavigationType: 2, + id: "cursorWordRightSelect", + precondition: void 0 + }); + } +}; +var CursorWordAccessibilityRight = class extends WordRightCommand { + constructor() { + super({ + inSelectionMode: false, + wordNavigationType: 3, + id: "cursorWordAccessibilityRight", + precondition: void 0 + }); + } + _move(wordCharacterClassifier, model, position, wordNavigationType, hasMulticursor) { + return super._move(getMapForWordSeparators(EditorOptions.wordSeparators.defaultValue, wordCharacterClassifier.intlSegmenterLocales), model, position, wordNavigationType, hasMulticursor); + } +}; +var CursorWordAccessibilityRightSelect = class extends WordRightCommand { + constructor() { + super({ + inSelectionMode: true, + wordNavigationType: 3, + id: "cursorWordAccessibilityRightSelect", + precondition: void 0 + }); + } + _move(wordCharacterClassifier, model, position, wordNavigationType, hasMulticursor) { + return super._move(getMapForWordSeparators(EditorOptions.wordSeparators.defaultValue, wordCharacterClassifier.intlSegmenterLocales), model, position, wordNavigationType, hasMulticursor); + } +}; +var DeleteWordCommand = class extends EditorCommand { + constructor(opts) { + super({ canTriggerInlineEdits: true, ...opts }); + this._whitespaceHeuristics = opts.whitespaceHeuristics; + this._wordNavigationType = opts.wordNavigationType; + } + runEditorCommand(accessor, editor2, args) { + const languageConfigurationService = accessor?.get(ILanguageConfigurationService); + if (!editor2.hasModel() || !languageConfigurationService) { + return; + } + const wordSeparators2 = getMapForWordSeparators(editor2.getOption( + 148 + /* EditorOption.wordSeparators */ + ), editor2.getOption( + 147 + /* EditorOption.wordSegmenterLocales */ + )); + const model = editor2.getModel(); + const selections = editor2.getSelections(); + const autoClosingBrackets = editor2.getOption( + 10 + /* EditorOption.autoClosingBrackets */ + ); + const autoClosingQuotes = editor2.getOption( + 15 + /* EditorOption.autoClosingQuotes */ + ); + const autoClosingPairs = languageConfigurationService.getLanguageConfiguration(model.getLanguageId()).getAutoClosingPairs(); + const viewModel = editor2._getViewModel(); + const commands = selections.map((sel) => { + const deleteRange = this._delete({ + wordSeparators: wordSeparators2, + model, + selection: sel, + whitespaceHeuristics: this._whitespaceHeuristics, + autoClosingDelete: editor2.getOption( + 13 + /* EditorOption.autoClosingDelete */ + ), + autoClosingBrackets, + autoClosingQuotes, + autoClosingPairs, + autoClosedCharacters: viewModel.getCursorAutoClosedCharacters() + }, this._wordNavigationType); + return new ReplaceCommand(deleteRange, ""); + }); + editor2.pushUndoStop(); + editor2.executeCommands(this.id, commands); + editor2.pushUndoStop(); + } +}; +var DeleteWordLeftCommand = class extends DeleteWordCommand { + _delete(ctx, wordNavigationType) { + const r = WordOperations.deleteWordLeft(ctx, wordNavigationType); + if (r) { + return r; + } + return new Range(1, 1, 1, 1); + } +}; +var DeleteWordRightCommand = class extends DeleteWordCommand { + _delete(ctx, wordNavigationType) { + const r = WordOperations.deleteWordRight(ctx, wordNavigationType); + if (r) { + return r; + } + const lineCount = ctx.model.getLineCount(); + const maxColumn = ctx.model.getLineMaxColumn(lineCount); + return new Range(lineCount, maxColumn, lineCount, maxColumn); + } +}; +var DeleteWordStartLeft = class extends DeleteWordLeftCommand { + constructor() { + super({ + whitespaceHeuristics: false, + wordNavigationType: 0, + id: "deleteWordStartLeft", + precondition: EditorContextKeys.writable + }); + } +}; +var DeleteWordEndLeft = class extends DeleteWordLeftCommand { + constructor() { + super({ + whitespaceHeuristics: false, + wordNavigationType: 2, + id: "deleteWordEndLeft", + precondition: EditorContextKeys.writable + }); + } +}; +var DeleteWordLeft = class extends DeleteWordLeftCommand { + constructor() { + super({ + whitespaceHeuristics: true, + wordNavigationType: 0, + id: "deleteWordLeft", + precondition: EditorContextKeys.writable, + kbOpts: { + kbExpr: EditorContextKeys.textInputFocus, + primary: 2048 | 1, + mac: { + primary: 512 | 1 + /* KeyCode.Backspace */ + }, + weight: 100 + /* KeybindingWeight.EditorContrib */ + } + }); + } +}; +var DeleteWordStartRight = class extends DeleteWordRightCommand { + constructor() { + super({ + whitespaceHeuristics: false, + wordNavigationType: 0, + id: "deleteWordStartRight", + precondition: EditorContextKeys.writable + }); + } +}; +var DeleteWordEndRight = class extends DeleteWordRightCommand { + constructor() { + super({ + whitespaceHeuristics: false, + wordNavigationType: 2, + id: "deleteWordEndRight", + precondition: EditorContextKeys.writable + }); + } +}; +var DeleteWordRight = class extends DeleteWordRightCommand { + constructor() { + super({ + whitespaceHeuristics: true, + wordNavigationType: 2, + id: "deleteWordRight", + precondition: EditorContextKeys.writable, + kbOpts: { + kbExpr: EditorContextKeys.textInputFocus, + primary: 2048 | 20, + mac: { + primary: 512 | 20 + /* KeyCode.Delete */ + }, + weight: 100 + /* KeybindingWeight.EditorContrib */ + } + }); + } +}; +var DeleteInsideWord = class extends EditorAction { + constructor() { + super({ + id: "deleteInsideWord", + precondition: EditorContextKeys.writable, + label: localize2(1575, "Delete Word") + }); + } + run(accessor, editor2, args) { + if (!editor2.hasModel()) { + return; + } + const wordSeparators2 = getMapForWordSeparators(editor2.getOption( + 148 + /* EditorOption.wordSeparators */ + ), editor2.getOption( + 147 + /* EditorOption.wordSegmenterLocales */ + )); + const model = editor2.getModel(); + const selections = editor2.getSelections(); + const commands = selections.map((sel) => { + const deleteRange = WordOperations.deleteInsideWord(wordSeparators2, model, sel); + return new ReplaceCommand(deleteRange, ""); + }); + editor2.pushUndoStop(); + editor2.executeCommands(this.id, commands); + editor2.pushUndoStop(); + } +}; +registerEditorCommand(new CursorWordStartLeft()); +registerEditorCommand(new CursorWordEndLeft()); +registerEditorCommand(new CursorWordLeft()); +registerEditorCommand(new CursorWordStartLeftSelect()); +registerEditorCommand(new CursorWordEndLeftSelect()); +registerEditorCommand(new CursorWordLeftSelect()); +registerEditorCommand(new CursorWordStartRight()); +registerEditorCommand(new CursorWordEndRight()); +registerEditorCommand(new CursorWordRight()); +registerEditorCommand(new CursorWordStartRightSelect()); +registerEditorCommand(new CursorWordEndRightSelect()); +registerEditorCommand(new CursorWordRightSelect()); +registerEditorCommand(new CursorWordAccessibilityLeft()); +registerEditorCommand(new CursorWordAccessibilityLeftSelect()); +registerEditorCommand(new CursorWordAccessibilityRight()); +registerEditorCommand(new CursorWordAccessibilityRightSelect()); +registerEditorCommand(new DeleteWordStartLeft()); +registerEditorCommand(new DeleteWordEndLeft()); +registerEditorCommand(new DeleteWordLeft()); +registerEditorCommand(new DeleteWordStartRight()); +registerEditorCommand(new DeleteWordEndRight()); +registerEditorCommand(new DeleteWordRight()); +registerEditorAction(DeleteInsideWord); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/wordPartOperations/browser/wordPartOperations.js +init_editorExtensions(); +init_range(); +init_editorContextKeys(); +init_commands(); +var DeleteWordPartLeft = class extends DeleteWordCommand { + constructor() { + super({ + whitespaceHeuristics: true, + wordNavigationType: 0, + id: "deleteWordPartLeft", + precondition: EditorContextKeys.writable, + kbOpts: { + kbExpr: EditorContextKeys.textInputFocus, + primary: 0, + mac: { + primary: 256 | 512 | 1 + /* KeyCode.Backspace */ + }, + weight: 100 + /* KeybindingWeight.EditorContrib */ + } + }); + } + _delete(ctx, wordNavigationType) { + const r = WordPartOperations.deleteWordPartLeft(ctx); + if (r) { + return r; + } + return new Range(1, 1, 1, 1); + } +}; +var DeleteWordPartRight = class extends DeleteWordCommand { + constructor() { + super({ + whitespaceHeuristics: true, + wordNavigationType: 2, + id: "deleteWordPartRight", + precondition: EditorContextKeys.writable, + kbOpts: { + kbExpr: EditorContextKeys.textInputFocus, + primary: 0, + mac: { + primary: 256 | 512 | 20 + /* KeyCode.Delete */ + }, + weight: 100 + /* KeybindingWeight.EditorContrib */ + } + }); + } + _delete(ctx, wordNavigationType) { + const r = WordPartOperations.deleteWordPartRight(ctx); + if (r) { + return r; + } + const lineCount = ctx.model.getLineCount(); + const maxColumn = ctx.model.getLineMaxColumn(lineCount); + return new Range(lineCount, maxColumn, lineCount, maxColumn); + } +}; +var WordPartLeftCommand = class extends MoveWordCommand { + _move(wordSeparators2, model, position, wordNavigationType, hasMulticursor) { + return WordPartOperations.moveWordPartLeft(wordSeparators2, model, position, hasMulticursor); + } +}; +var CursorWordPartLeft = class extends WordPartLeftCommand { + constructor() { + super({ + inSelectionMode: false, + wordNavigationType: 0, + id: "cursorWordPartLeft", + precondition: void 0, + kbOpts: { + kbExpr: EditorContextKeys.textInputFocus, + primary: 0, + mac: { + primary: 256 | 512 | 15 + /* KeyCode.LeftArrow */ + }, + weight: 100 + /* KeybindingWeight.EditorContrib */ + } + }); + } +}; +CommandsRegistry.registerCommandAlias("cursorWordPartStartLeft", "cursorWordPartLeft"); +var CursorWordPartLeftSelect = class extends WordPartLeftCommand { + constructor() { + super({ + inSelectionMode: true, + wordNavigationType: 0, + id: "cursorWordPartLeftSelect", + precondition: void 0, + kbOpts: { + kbExpr: EditorContextKeys.textInputFocus, + primary: 0, + mac: { + primary: 256 | 512 | 1024 | 15 + /* KeyCode.LeftArrow */ + }, + weight: 100 + /* KeybindingWeight.EditorContrib */ + } + }); + } +}; +CommandsRegistry.registerCommandAlias("cursorWordPartStartLeftSelect", "cursorWordPartLeftSelect"); +var WordPartRightCommand = class extends MoveWordCommand { + _move(wordSeparators2, model, position, wordNavigationType, hasMulticursor) { + return WordPartOperations.moveWordPartRight(wordSeparators2, model, position); + } +}; +var CursorWordPartRight = class extends WordPartRightCommand { + constructor() { + super({ + inSelectionMode: false, + wordNavigationType: 2, + id: "cursorWordPartRight", + precondition: void 0, + kbOpts: { + kbExpr: EditorContextKeys.textInputFocus, + primary: 0, + mac: { + primary: 256 | 512 | 17 + /* KeyCode.RightArrow */ + }, + weight: 100 + /* KeybindingWeight.EditorContrib */ + } + }); + } +}; +var CursorWordPartRightSelect = class extends WordPartRightCommand { + constructor() { + super({ + inSelectionMode: true, + wordNavigationType: 2, + id: "cursorWordPartRightSelect", + precondition: void 0, + kbOpts: { + kbExpr: EditorContextKeys.textInputFocus, + primary: 0, + mac: { + primary: 256 | 512 | 1024 | 17 + /* KeyCode.RightArrow */ + }, + weight: 100 + /* KeybindingWeight.EditorContrib */ + } + }); + } +}; +registerEditorCommand(new DeleteWordPartLeft()); +registerEditorCommand(new DeleteWordPartRight()); +registerEditorCommand(new CursorWordPartLeft()); +registerEditorCommand(new CursorWordPartLeftSelect()); +registerEditorCommand(new CursorWordPartRight()); +registerEditorCommand(new CursorWordPartRightSelect()); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/readOnlyMessage/browser/contribution.js +init_htmlContent(); +init_lifecycle(); +init_editorExtensions(); +init_nls(); +var ReadOnlyMessageController = class extends Disposable { + static { + this.ID = "editor.contrib.readOnlyMessageController"; + } + constructor(editor2) { + super(); + this.editor = editor2; + this._register(this.editor.onDidAttemptReadOnlyEdit(() => this._onDidAttemptReadOnlyEdit())); + } + _onDidAttemptReadOnlyEdit() { + const messageController = MessageController.get(this.editor); + if (messageController && this.editor.hasModel()) { + let message = this.editor.getOptions().get( + 105 + /* EditorOption.readOnlyMessage */ + ); + if (!message) { + if (this.editor.isSimpleWidget) { + message = new MarkdownString(localize(1378, "Cannot edit in read-only input")); + } else { + message = new MarkdownString(localize(1379, "Cannot edit in read-only editor")); + } + } + messageController.showMessage(message, this.editor.getPosition()); + } + } +}; +registerEditorContribution( + ReadOnlyMessageController.ID, + ReadOnlyMessageController, + 2 + /* EditorContributionInstantiation.BeforeFirstInteraction */ +); + +// node_modules/monaco-editor-core/esm/vs/editor/editor.all.js +var import_contribution2 = __toESM(require_contribution()); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/floatingMenu/browser/floatingMenu.contribution.js +init_editorExtensions(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/floatingMenu/browser/floatingMenu.js +init_dom(); +init_lifecycle(); +init_observable(); +init_actions2(); +init_instantiation(); +init_observableCodeEditor(); +var __decorate158 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param152 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var FloatingEditorToolbar = class FloatingEditorToolbar2 extends Disposable { + static { + this.ID = "editor.contrib.floatingToolbar"; + } + constructor(editor2, instantiationService, keybindingService, menuService) { + super(); + const editorObs = this._register(observableCodeEditor(editor2)); + const menu = this._register(menuService.createMenu(MenuId.EditorContent, editor2.contextKeyService)); + const menuIsEmptyObs = observableFromEvent(this, menu.onDidChange, () => menu.getActions().length === 0); + this._register(autorun((reader) => { + const menuIsEmpty = menuIsEmptyObs.read(reader); + if (menuIsEmpty) { + return; + } + const container = h("div.floating-menu-overlay-widget"); + container.root.style.height = "28px"; + const toolbar = instantiationService.createInstance(MenuWorkbenchToolBar, container.root, MenuId.EditorContent, { + actionViewItemProvider: (action, options2) => { + if (!(action instanceof MenuItemAction)) { + return void 0; + } + const keybinding = keybindingService.lookupKeybinding(action.id); + if (!keybinding) { + return void 0; + } + return instantiationService.createInstance(class extends MenuEntryActionViewItem { + updateLabel() { + if (this.options.label && this.label) { + this.label.textContent = `${this._commandAction.label} (${keybinding.getLabel()})`; + } + } + }, action, { ...options2, keybindingNotRenderedWithLabel: true }); + }, + hiddenItemStrategy: 0, + menuOptions: { + shouldForwardArgs: true + }, + telemetrySource: "editor.overlayToolbar", + toolbarOptions: { + primaryGroup: () => true, + useSeparatorsInPrimaryActions: true + } + }); + reader.store.add(toolbar); + reader.store.add(autorun((reader2) => { + const model = editorObs.model.read(reader2); + toolbar.context = model?.uri; + })); + reader.store.add(editorObs.createOverlayWidget({ + allowEditorOverflow: false, + domNode: container.root, + minContentWidthInPx: constObservable(0), + position: constObservable({ + preference: 1 + /* OverlayWidgetPositionPreference.BOTTOM_RIGHT_CORNER */ + }) + })); + })); + } +}; +FloatingEditorToolbar = __decorate158([ + __param152(1, IInstantiationService), + __param152(2, IKeybindingService), + __param152(3, IMenuService) +], FloatingEditorToolbar); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/floatingMenu/browser/floatingMenu.contribution.js +registerEditorContribution( + FloatingEditorToolbar.ID, + FloatingEditorToolbar, + 1 + /* EditorContributionInstantiation.AfterFirstRender */ +); + +// node_modules/monaco-editor-core/esm/vs/editor/editor.all.js +init_standaloneStrings(); + +// node_modules/monaco-editor-core/esm/vs/editor/standalone/browser/iPadShowKeyboard/iPadShowKeyboard.js +init_dom(); +init_lifecycle(); +init_editorExtensions(); +init_platform(); +var IPadShowKeyboard = class extends Disposable { + static { + this.ID = "editor.contrib.iPadShowKeyboard"; + } + constructor(editor2) { + super(); + this.editor = editor2; + this.widget = null; + if (isIOS) { + this._register(editor2.onDidChangeConfiguration(() => this.update())); + this.update(); + } + } + update() { + const shouldHaveWidget = !this.editor.getOption( + 104 + /* EditorOption.readOnly */ + ); + if (!this.widget && shouldHaveWidget) { + this.widget = new ShowKeyboardWidget(this.editor); + } else if (this.widget && !shouldHaveWidget) { + this.widget.dispose(); + this.widget = null; + } + } + dispose() { + super.dispose(); + if (this.widget) { + this.widget.dispose(); + this.widget = null; + } + } +}; +var ShowKeyboardWidget = class _ShowKeyboardWidget extends Disposable { + static { + this.ID = "editor.contrib.ShowKeyboardWidget"; + } + constructor(editor2) { + super(); + this.editor = editor2; + this._domNode = document.createElement("textarea"); + this._domNode.className = "iPadShowKeyboard"; + this._register(addDisposableListener(this._domNode, "touchstart", (e) => { + this.editor.focus(); + })); + this._register(addDisposableListener(this._domNode, "focus", (e) => { + this.editor.focus(); + })); + this.editor.addOverlayWidget(this); + } + dispose() { + this.editor.removeOverlayWidget(this); + super.dispose(); + } + // ----- IOverlayWidget API + getId() { + return _ShowKeyboardWidget.ID; + } + getDomNode() { + return this._domNode; + } + getPosition() { + return { + preference: 1 + /* OverlayWidgetPositionPreference.BOTTOM_RIGHT_CORNER */ + }; + } +}; +registerEditorContribution( + IPadShowKeyboard.ID, + IPadShowKeyboard, + 3 + /* EditorContributionInstantiation.Eventually */ +); + +// node_modules/monaco-editor-core/esm/vs/editor/editor.main.js +var import_inspectTokens = __toESM(require_inspectTokens()); + +// node_modules/monaco-editor-core/esm/vs/editor/standalone/browser/quickAccess/standaloneHelpQuickAccess.js +init_platform2(); + +// node_modules/monaco-editor-core/esm/vs/platform/quickinput/common/quickAccess.js +init_arrays(); +init_lifecycle(); +init_platform2(); +var DefaultQuickAccessFilterValue; +(function(DefaultQuickAccessFilterValue2) { + DefaultQuickAccessFilterValue2[DefaultQuickAccessFilterValue2["PRESERVE"] = 0] = "PRESERVE"; + DefaultQuickAccessFilterValue2[DefaultQuickAccessFilterValue2["LAST"] = 1] = "LAST"; +})(DefaultQuickAccessFilterValue || (DefaultQuickAccessFilterValue = {})); +var Extensions10 = { + Quickaccess: "workbench.contributions.quickaccess" +}; +var QuickAccessRegistry = class { + constructor() { + this.providers = []; + this.defaultProvider = void 0; + } + registerQuickAccessProvider(provider) { + if (provider.prefix.length === 0) { + this.defaultProvider = provider; + } else { + this.providers.push(provider); + } + this.providers.sort((providerA, providerB) => providerB.prefix.length - providerA.prefix.length); + return toDisposable(() => { + this.providers.splice(this.providers.indexOf(provider), 1); + if (this.defaultProvider === provider) { + this.defaultProvider = void 0; + } + }); + } + getQuickAccessProviders() { + return coalesce([this.defaultProvider, ...this.providers]); + } + getQuickAccessProvider(prefix) { + const result = prefix ? this.providers.find((provider) => prefix.startsWith(provider.prefix)) || void 0 : void 0; + return result || this.defaultProvider; + } +}; +Registry.add(Extensions10.Quickaccess, new QuickAccessRegistry()); + +// node_modules/monaco-editor-core/esm/vs/editor/standalone/browser/quickAccess/standaloneHelpQuickAccess.js +init_standaloneStrings(); + +// node_modules/monaco-editor-core/esm/vs/platform/quickinput/browser/helpQuickAccess.js +init_nls(); +init_platform2(); +init_lifecycle(); +var __decorate159 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param153 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var HelpQuickAccessProvider_1; +var HelpQuickAccessProvider = class HelpQuickAccessProvider2 { + static { + HelpQuickAccessProvider_1 = this; + } + static { + this.PREFIX = "?"; + } + constructor(quickInputService, keybindingService) { + this.quickInputService = quickInputService; + this.keybindingService = keybindingService; + this.registry = Registry.as(Extensions10.Quickaccess); + } + provide(picker) { + const disposables = new DisposableStore(); + disposables.add(picker.onDidAccept(() => { + const [item] = picker.selectedItems; + if (item) { + this.quickInputService.quickAccess.show(item.prefix, { preserveValue: true }); + } + })); + disposables.add(picker.onDidChangeValue((value) => { + const providerDescriptor = this.registry.getQuickAccessProvider(value.substr(HelpQuickAccessProvider_1.PREFIX.length)); + if (providerDescriptor && providerDescriptor.prefix && providerDescriptor.prefix !== HelpQuickAccessProvider_1.PREFIX) { + this.quickInputService.quickAccess.show(providerDescriptor.prefix, { preserveValue: true }); + } + })); + picker.items = this.getQuickAccessProviders().filter((p) => p.prefix !== HelpQuickAccessProvider_1.PREFIX); + return disposables; + } + getQuickAccessProviders() { + const providers = this.registry.getQuickAccessProviders().sort((providerA, providerB) => providerA.prefix.localeCompare(providerB.prefix)).flatMap((provider) => this.createPicks(provider)); + return providers; + } + createPicks(provider) { + return provider.helpEntries.map((helpEntry) => { + const prefix = helpEntry.prefix || provider.prefix; + const label = prefix || "\u2026"; + return { + prefix, + label, + keybinding: helpEntry.commandId ? this.keybindingService.lookupKeybinding(helpEntry.commandId) : void 0, + ariaLabel: localize(1747, "{0}, {1}", label, helpEntry.description), + description: helpEntry.description + }; + }); + } +}; +HelpQuickAccessProvider = HelpQuickAccessProvider_1 = __decorate159([ + __param153(0, IQuickInputService), + __param153(1, IKeybindingService) +], HelpQuickAccessProvider); + +// node_modules/monaco-editor-core/esm/vs/editor/standalone/browser/quickAccess/standaloneHelpQuickAccess.js +Registry.as(Extensions10.Quickaccess).registerQuickAccessProvider({ + ctor: HelpQuickAccessProvider, + prefix: "", + helpEntries: [{ description: QuickHelpNLS.helpQuickAccessActionLabel }] +}); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/quickAccess/browser/gotoLineQuickAccess.js +init_codicons(); +init_lifecycle(); +init_nls(); +init_inputColors(); +init_colorUtils(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/quickAccess/browser/editorNavigationQuickAccess.js +init_functional(); +init_lifecycle(); +init_model2(); +init_editorColorRegistry(); +init_themeService(); +var AbstractEditorNavigationQuickAccessProvider = class { + constructor(options2) { + this.options = options2; + this.rangeHighlightDecorationId = void 0; + } + //#region Provider methods + provide(picker, token, runOptions) { + const disposables = new DisposableStore(); + picker.canAcceptInBackground = !!this.options?.canAcceptInBackground; + picker.matchOnLabel = picker.matchOnDescription = picker.matchOnDetail = picker.sortByLabel = false; + const pickerDisposable = disposables.add(new MutableDisposable()); + pickerDisposable.value = this.doProvide(picker, token, runOptions); + disposables.add(this.onDidActiveTextEditorControlChange(() => { + pickerDisposable.value = void 0; + pickerDisposable.value = this.doProvide(picker, token); + })); + return disposables; + } + doProvide(picker, token, runOptions) { + const disposables = new DisposableStore(); + const editor2 = this.activeTextEditorControl; + if (editor2 && this.canProvideWithTextEditor(editor2)) { + const context = { editor: editor2 }; + const codeEditor = getCodeEditor(editor2); + if (codeEditor) { + let lastKnownEditorViewState = editor2.saveViewState() ?? void 0; + disposables.add(codeEditor.onDidChangeCursorPosition(() => { + lastKnownEditorViewState = editor2.saveViewState() ?? void 0; + })); + context.restoreViewState = () => { + if (lastKnownEditorViewState && editor2 === this.activeTextEditorControl) { + editor2.restoreViewState(lastKnownEditorViewState); + } + }; + disposables.add(createSingleCallFunction(token.onCancellationRequested)(() => context.restoreViewState?.())); + } + disposables.add(toDisposable(() => this.clearDecorations(editor2))); + disposables.add(this.provideWithTextEditor(context, picker, token, runOptions)); + } else { + disposables.add(this.provideWithoutTextEditor(picker, token)); + } + return disposables; + } + /** + * Subclasses to implement if they can operate on the text editor. + */ + canProvideWithTextEditor(editor2) { + return true; + } + gotoLocation({ editor: editor2 }, options2) { + editor2.setSelection( + options2.range, + "code.jump" + /* TextEditorSelectionSource.JUMP */ + ); + editor2.revealRangeInCenter( + options2.range, + 0 + /* ScrollType.Smooth */ + ); + if (!options2.preserveFocus) { + editor2.focus(); + } + const model = editor2.getModel(); + if (model && "getLineContent" in model) { + status(`${model.getLineContent(options2.range.startLineNumber)}`); + } + } + getModel(editor2) { + return isDiffEditor(editor2) ? editor2.getModel()?.modified : editor2.getModel(); + } + addDecorations(editor2, range2) { + editor2.changeDecorations((changeAccessor) => { + const deleteDecorations = []; + if (this.rangeHighlightDecorationId) { + deleteDecorations.push(this.rangeHighlightDecorationId.overviewRulerDecorationId); + deleteDecorations.push(this.rangeHighlightDecorationId.rangeHighlightId); + this.rangeHighlightDecorationId = void 0; + } + const newDecorations = [ + // highlight the entire line on the range + { + range: range2, + options: { + description: "quick-access-range-highlight", + className: "rangeHighlight", + isWholeLine: true + } + }, + // also add overview ruler highlight + { + range: range2, + options: { + description: "quick-access-range-highlight-overview", + overviewRuler: { + color: themeColorFromId(overviewRulerRangeHighlight), + position: OverviewRulerLane.Full + } + } + } + ]; + const [rangeHighlightId, overviewRulerDecorationId] = changeAccessor.deltaDecorations(deleteDecorations, newDecorations); + this.rangeHighlightDecorationId = { rangeHighlightId, overviewRulerDecorationId }; + }); + } + clearDecorations(editor2) { + const rangeHighlightDecorationId = this.rangeHighlightDecorationId; + if (rangeHighlightDecorationId) { + editor2.changeDecorations((changeAccessor) => { + changeAccessor.deltaDecorations([ + rangeHighlightDecorationId.overviewRulerDecorationId, + rangeHighlightDecorationId.rangeHighlightId + ], []); + }); + this.rangeHighlightDecorationId = void 0; + } + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/quickAccess/browser/gotoLineQuickAccess.js +var AbstractGotoLineQuickAccessProvider = class _AbstractGotoLineQuickAccessProvider extends AbstractEditorNavigationQuickAccessProvider { + static { + this.PREFIX = ":"; + } + static { + this.ZERO_BASED_OFFSET_STORAGE_KEY = "gotoLine.useZeroBasedOffset"; + } + constructor() { + super({ canAcceptInBackground: true }); + } + get useZeroBasedOffset() { + return this.storageService.getBoolean(_AbstractGotoLineQuickAccessProvider.ZERO_BASED_OFFSET_STORAGE_KEY, -1, false); + } + set useZeroBasedOffset(value) { + this.storageService.store( + _AbstractGotoLineQuickAccessProvider.ZERO_BASED_OFFSET_STORAGE_KEY, + value, + -1, + 0 + /* StorageTarget.USER */ + ); + } + provideWithoutTextEditor(picker) { + const label = localize(1335, "Open a text editor first to go to a line."); + picker.items = [{ label }]; + picker.ariaLabel = label; + return Disposable.None; + } + provideWithTextEditor(context, picker, token) { + const editor2 = context.editor; + const disposables = new DisposableStore(); + disposables.add(picker.onDidAccept((event) => { + const [item] = picker.selectedItems; + if (item) { + if (!item.lineNumber) { + return; + } + this.gotoLocation(context, { range: this.toRange(item.lineNumber, item.column), keyMods: picker.keyMods, preserveFocus: event.inBackground }); + if (!event.inBackground) { + picker.hide(); + } + } + })); + const updatePickerAndEditor = () => { + const inputText = picker.value.trim().substring(_AbstractGotoLineQuickAccessProvider.PREFIX.length); + const { inOffsetMode, lineNumber, column, label } = this.parsePosition(editor2, inputText); + toggle.visible = !!inOffsetMode; + picker.items = [{ + lineNumber, + column, + label + }]; + picker.ariaLabel = label; + if (!lineNumber) { + this.clearDecorations(editor2); + return; + } + const range2 = this.toRange(lineNumber, column); + editor2.revealRangeInCenter( + range2, + 0 + /* ScrollType.Smooth */ + ); + this.addDecorations(editor2, range2); + }; + const toggle = new Toggle({ + title: localize(1336, "Use Zero-Based Offset"), + icon: Codicon.indexZero, + isChecked: this.useZeroBasedOffset, + inputActiveOptionBorder: asCssVariable(inputActiveOptionBorder), + inputActiveOptionForeground: asCssVariable(inputActiveOptionForeground), + inputActiveOptionBackground: asCssVariable(inputActiveOptionBackground) + }); + disposables.add(toggle.onChange(() => { + this.useZeroBasedOffset = !this.useZeroBasedOffset; + updatePickerAndEditor(); + })); + picker.toggles = [toggle]; + updatePickerAndEditor(); + disposables.add(picker.onDidChangeValue(() => updatePickerAndEditor())); + const codeEditor = getCodeEditor(editor2); + if (codeEditor) { + const options2 = codeEditor.getOptions(); + const lineNumbers = options2.get( + 76 + /* EditorOption.lineNumbers */ + ); + if (lineNumbers.renderType === 2) { + codeEditor.updateOptions({ lineNumbers: "on" }); + disposables.add(toDisposable(() => codeEditor.updateOptions({ lineNumbers: "relative" }))); + } + } + return disposables; + } + toRange(lineNumber = 1, column = 1) { + return { + startLineNumber: lineNumber, + startColumn: column, + endLineNumber: lineNumber, + endColumn: column + }; + } + parsePosition(editor2, value) { + const model = this.getModel(editor2); + if (!model) { + return { + label: localize(1337, "Open a text editor first to go to a line.") + }; + } + if (value.startsWith(":")) { + let offset = parseInt(value.substring(1), 10); + const maxOffset = model.getValueLength(); + if (isNaN(offset)) { + return { + inOffsetMode: true, + label: this.useZeroBasedOffset ? localize(1338, "Type a character position to go to (from 0 to {0}).", maxOffset - 1) : localize(1339, "Type a character position to go to (from 1 to {0}).", maxOffset) + }; + } else { + const reverse = offset < 0; + if (!this.useZeroBasedOffset) { + offset -= Math.sign(offset); + } + if (reverse) { + offset += maxOffset; + } + const pos = model.getPositionAt(offset); + return { + ...pos, + inOffsetMode: true, + label: localize(1340, "Press 'Enter' to go to line {0} at column {1}.", pos.lineNumber, pos.column) + }; + } + } else { + const parts = value.split(/,|:|#/); + const maxLine = model.getLineCount(); + let lineNumber = parseInt(parts[0]?.trim(), 10); + if (parts.length < 1 || isNaN(lineNumber)) { + return { + label: localize(1341, "Type a line number to go to (from 1 to {0}).", maxLine) + }; + } + lineNumber = lineNumber >= 0 ? lineNumber : maxLine + 1 + lineNumber; + lineNumber = Math.min(Math.max(1, lineNumber), maxLine); + const maxColumn = model.getLineMaxColumn(lineNumber); + let column = parseInt(parts[1]?.trim(), 10); + if (parts.length < 2 || isNaN(column)) { + return { + lineNumber, + column: 1, + label: parts.length < 2 ? localize(1342, "Press 'Enter' to go to line {0} or enter : to add a column number.", lineNumber) : localize(1343, "Press 'Enter' to go to line {0} or enter a column number (from 1 to {1}).", lineNumber, maxColumn) + }; + } + column = column >= 0 ? column : maxColumn + column; + column = Math.min(Math.max(1, column), maxColumn); + return { + lineNumber, + column, + label: localize(1344, "Press 'Enter' to go to line {0} at column {1}.", lineNumber, column) + }; + } + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/standalone/browser/quickAccess/standaloneGotoLineQuickAccess.js +init_platform2(); +init_codeEditorService(); +init_standaloneStrings(); +init_event(); +init_editorExtensions(); +init_editorContextKeys(); +var __decorate160 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param154 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var StandaloneGotoLineQuickAccessProvider = class StandaloneGotoLineQuickAccessProvider2 extends AbstractGotoLineQuickAccessProvider { + constructor(editorService, storageService) { + super(); + this.editorService = editorService; + this.storageService = storageService; + this.onDidActiveTextEditorControlChange = Event.None; + } + get activeTextEditorControl() { + return this.editorService.getFocusedCodeEditor() ?? void 0; + } +}; +StandaloneGotoLineQuickAccessProvider = __decorate160([ + __param154(0, ICodeEditorService), + __param154(1, IStorageService) +], StandaloneGotoLineQuickAccessProvider); +var GotoLineAction = class _GotoLineAction extends EditorAction { + static { + this.ID = "editor.action.gotoLine"; + } + constructor() { + super({ + id: _GotoLineAction.ID, + label: GoToLineNLS.gotoLineActionLabel, + alias: "Go to Line/Column...", + precondition: void 0, + kbOpts: { + kbExpr: EditorContextKeys.focus, + primary: 2048 | 37, + mac: { + primary: 256 | 37 + /* KeyCode.KeyG */ + }, + weight: 100 + /* KeybindingWeight.EditorContrib */ + } + }); + } + run(accessor) { + accessor.get(IQuickInputService).quickAccess.show(StandaloneGotoLineQuickAccessProvider.PREFIX); + } +}; +registerEditorAction(GotoLineAction); +Registry.as(Extensions10.Quickaccess).registerQuickAccessProvider({ + ctor: StandaloneGotoLineQuickAccessProvider, + prefix: StandaloneGotoLineQuickAccessProvider.PREFIX, + helpEntries: [{ description: GoToLineNLS.gotoLineActionLabel, commandId: GotoLineAction.ID }] +}); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/quickAccess/browser/gotoSymbolQuickAccess.js +init_async(); +init_cancellation(); +init_codicons(); +init_themables(); + +// node_modules/monaco-editor-core/esm/vs/base/common/fuzzyScorer.js +init_filters(); +init_path(); +init_platform(); +var NO_SCORE2 = [void 0, []]; +function scoreFuzzy2(target, query, patternStart = 0, wordStart = 0) { + const preparedQuery = query; + if (preparedQuery.values && preparedQuery.values.length > 1) { + return doScoreFuzzy2Multiple(target, preparedQuery.values, patternStart, wordStart); + } + return doScoreFuzzy2Single(target, query, patternStart, wordStart); +} +function doScoreFuzzy2Multiple(target, query, patternStart, wordStart) { + let totalScore = 0; + const totalMatches = []; + for (const queryPiece of query) { + const [score3, matches] = doScoreFuzzy2Single(target, queryPiece, patternStart, wordStart); + if (typeof score3 !== "number") { + return NO_SCORE2; + } + totalScore += score3; + totalMatches.push(...matches); + } + return [totalScore, normalizeMatches(totalMatches)]; +} +function doScoreFuzzy2Single(target, query, patternStart, wordStart) { + const score3 = fuzzyScore(query.original, query.originalLowercase, patternStart, target, target.toLowerCase(), wordStart, { firstMatchCanBeWeak: true, boostFullMatch: true }); + if (!score3) { + return NO_SCORE2; + } + return [score3[0], createMatches(score3)]; +} +var NO_ITEM_SCORE = Object.freeze({ score: 0 }); +function normalizeMatches(matches) { + const sortedMatches = matches.sort((matchA, matchB) => { + return matchA.start - matchB.start; + }); + const normalizedMatches = []; + let currentMatch = void 0; + for (const match2 of sortedMatches) { + if (!currentMatch || !matchOverlaps(currentMatch, match2)) { + currentMatch = match2; + normalizedMatches.push(match2); + } else { + currentMatch.start = Math.min(currentMatch.start, match2.start); + currentMatch.end = Math.max(currentMatch.end, match2.end); + } + } + return normalizedMatches; +} +function matchOverlaps(matchA, matchB) { + if (matchA.end < matchB.start) { + return false; + } + if (matchB.end < matchA.start) { + return false; + } + return true; +} +function queryExpectsExactMatch(query) { + return query.startsWith('"') && query.endsWith('"'); +} +var MULTIPLE_QUERY_VALUES_SEPARATOR = " "; +function prepareQuery(original) { + if (typeof original !== "string") { + original = ""; + } + const originalLowercase = original.toLowerCase(); + const { pathNormalized, normalized, normalizedLowercase } = normalizeQuery(original); + const containsPathSeparator = pathNormalized.indexOf(sep) >= 0; + const expectExactMatch = queryExpectsExactMatch(original); + let values = void 0; + const originalSplit = original.split(MULTIPLE_QUERY_VALUES_SEPARATOR); + if (originalSplit.length > 1) { + for (const originalPiece of originalSplit) { + const expectExactMatchPiece = queryExpectsExactMatch(originalPiece); + const { pathNormalized: pathNormalizedPiece, normalized: normalizedPiece, normalizedLowercase: normalizedLowercasePiece } = normalizeQuery(originalPiece); + if (normalizedPiece) { + if (!values) { + values = []; + } + values.push({ + original: originalPiece, + originalLowercase: originalPiece.toLowerCase(), + pathNormalized: pathNormalizedPiece, + normalized: normalizedPiece, + normalizedLowercase: normalizedLowercasePiece, + expectContiguousMatch: expectExactMatchPiece + }); + } + } + } + return { original, originalLowercase, pathNormalized, normalized, normalizedLowercase, values, containsPathSeparator, expectContiguousMatch: expectExactMatch }; +} +function normalizeQuery(original) { + let pathNormalized; + if (isWindows) { + pathNormalized = original.replace(/\//g, sep); + } else { + pathNormalized = original.replace(/\\/g, sep); + } + const normalized = pathNormalized.replace(/[\*\u2026\s"]/g, ""); + return { + pathNormalized, + normalized, + normalizedLowercase: normalized.toLowerCase() + }; +} +function pieceToQuery(arg1) { + if (Array.isArray(arg1)) { + return prepareQuery(arg1.map((piece) => piece.original).join(MULTIPLE_QUERY_VALUES_SEPARATOR)); + } + return prepareQuery(arg1.original); +} + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/quickAccess/browser/gotoSymbolQuickAccess.js +init_lifecycle(); +init_strings(); +init_range(); +init_languages(); +init_outlineModel(); +init_nls(); +init_languageFeatures(); +init_arraysFind(); +var __decorate161 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param155 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var AbstractGotoSymbolQuickAccessProvider_1; +var AbstractGotoSymbolQuickAccessProvider = class AbstractGotoSymbolQuickAccessProvider2 extends AbstractEditorNavigationQuickAccessProvider { + static { + AbstractGotoSymbolQuickAccessProvider_1 = this; + } + static { + this.PREFIX = "@"; + } + static { + this.SCOPE_PREFIX = ":"; + } + static { + this.PREFIX_BY_CATEGORY = `${this.PREFIX}${this.SCOPE_PREFIX}`; + } + constructor(_languageFeaturesService, _outlineModelService, options2 = /* @__PURE__ */ Object.create(null)) { + super(options2); + this._languageFeaturesService = _languageFeaturesService; + this._outlineModelService = _outlineModelService; + this.options = options2; + this.options.canAcceptInBackground = true; + } + provideWithoutTextEditor(picker) { + this.provideLabelPick(picker, localize(1345, "To go to a symbol, first open a text editor with symbol information.")); + return Disposable.None; + } + provideWithTextEditor(context, picker, token, runOptions) { + const editor2 = context.editor; + const model = this.getModel(editor2); + if (!model) { + return Disposable.None; + } + if (this._languageFeaturesService.documentSymbolProvider.has(model)) { + return this.doProvideWithEditorSymbols(context, model, picker, token, runOptions); + } + return this.doProvideWithoutEditorSymbols(context, model, picker, token); + } + doProvideWithoutEditorSymbols(context, model, picker, token) { + const disposables = new DisposableStore(); + this.provideLabelPick(picker, localize(1346, "The active text editor does not provide symbol information.")); + (async () => { + const result = await this.waitForLanguageSymbolRegistry(model, disposables); + if (!result || token.isCancellationRequested) { + return; + } + disposables.add(this.doProvideWithEditorSymbols(context, model, picker, token)); + })(); + return disposables; + } + provideLabelPick(picker, label) { + picker.items = [{ + label, + index: 0, + kind: 14 + /* SymbolKind.String */ + }]; + picker.ariaLabel = label; + } + async waitForLanguageSymbolRegistry(model, disposables) { + if (this._languageFeaturesService.documentSymbolProvider.has(model)) { + return true; + } + const symbolProviderRegistryPromise = new DeferredPromise(); + const symbolProviderListener = disposables.add(this._languageFeaturesService.documentSymbolProvider.onDidChange(() => { + if (this._languageFeaturesService.documentSymbolProvider.has(model)) { + symbolProviderListener.dispose(); + symbolProviderRegistryPromise.complete(true); + } + })); + disposables.add(toDisposable(() => symbolProviderRegistryPromise.complete(false))); + return symbolProviderRegistryPromise.p; + } + doProvideWithEditorSymbols(context, model, picker, token, runOptions) { + const editor2 = context.editor; + const disposables = new DisposableStore(); + disposables.add(picker.onDidAccept((event) => { + const [item] = picker.selectedItems; + if (item && item.range) { + this.gotoLocation(context, { range: item.range.selection, keyMods: picker.keyMods, preserveFocus: event.inBackground }); + runOptions?.handleAccept?.(item, event.inBackground); + if (!event.inBackground) { + picker.hide(); + } + } + })); + disposables.add(picker.onDidTriggerItemButton(({ item }) => { + if (item && item.range) { + this.gotoLocation(context, { range: item.range.selection, keyMods: picker.keyMods, forceSideBySide: true }); + picker.hide(); + } + })); + const symbolsPromise = this.getDocumentSymbols(model, token); + const picksCts = disposables.add(new MutableDisposable()); + const updatePickerItems = async (positionToEnclose) => { + picksCts?.value?.cancel(); + picker.busy = false; + picksCts.value = new CancellationTokenSource(); + picker.busy = true; + try { + const query = prepareQuery(picker.value.substr(AbstractGotoSymbolQuickAccessProvider_1.PREFIX.length).trim()); + const items = await this.doGetSymbolPicks(symbolsPromise, query, void 0, picksCts.value.token, model); + if (token.isCancellationRequested) { + return; + } + if (items.length > 0) { + picker.items = items; + if (positionToEnclose && query.original.length === 0) { + const candidate = findLast(items, (item) => Boolean(item.type !== "separator" && item.range && Range.containsPosition(item.range.decoration, positionToEnclose))); + if (candidate) { + picker.activeItems = [candidate]; + } + } + } else { + if (query.original.length > 0) { + this.provideLabelPick(picker, localize(1347, "No matching editor symbols")); + } else { + this.provideLabelPick(picker, localize(1348, "No editor symbols")); + } + } + } finally { + if (!token.isCancellationRequested) { + picker.busy = false; + } + } + }; + disposables.add(picker.onDidChangeValue(() => updatePickerItems(void 0))); + updatePickerItems(editor2.getSelection()?.getPosition()); + disposables.add(picker.onDidChangeActive(() => { + const [item] = picker.activeItems; + if (item && item.range) { + editor2.revealRangeInCenter( + item.range.selection, + 0 + /* ScrollType.Smooth */ + ); + this.addDecorations(editor2, item.range.decoration); + } + })); + return disposables; + } + async doGetSymbolPicks(symbolsPromise, query, options2, token, model) { + const symbols = await symbolsPromise; + if (token.isCancellationRequested) { + return []; + } + const filterBySymbolKind = query.original.indexOf(AbstractGotoSymbolQuickAccessProvider_1.SCOPE_PREFIX) === 0; + const filterPos = filterBySymbolKind ? 1 : 0; + let symbolQuery; + let containerQuery; + if (query.values && query.values.length > 1) { + symbolQuery = pieceToQuery(query.values[0]); + containerQuery = pieceToQuery(query.values.slice(1)); + } else { + symbolQuery = query; + } + let buttons; + const openSideBySideDirection = this.options?.openSideBySideDirection?.(); + if (openSideBySideDirection) { + buttons = [{ + iconClass: openSideBySideDirection === "right" ? ThemeIcon.asClassName(Codicon.splitHorizontal) : ThemeIcon.asClassName(Codicon.splitVertical), + tooltip: openSideBySideDirection === "right" ? localize(1349, "Open to the Side") : localize(1350, "Open to the Bottom") + }]; + } + const filteredSymbolPicks = []; + for (let index = 0; index < symbols.length; index++) { + const symbol = symbols[index]; + const symbolLabel = trim(symbol.name); + const symbolLabelWithIcon = `$(${SymbolKinds.toIcon(symbol.kind).id}) ${symbolLabel}`; + const symbolLabelIconOffset = symbolLabelWithIcon.length - symbolLabel.length; + let containerLabel = symbol.containerName; + if (options2?.extraContainerLabel) { + if (containerLabel) { + containerLabel = `${options2.extraContainerLabel} \u2022 ${containerLabel}`; + } else { + containerLabel = options2.extraContainerLabel; + } + } + let symbolScore = void 0; + let symbolMatches = void 0; + let containerScore = void 0; + let containerMatches = void 0; + if (query.original.length > filterPos) { + let skipContainerQuery = false; + if (symbolQuery !== query) { + [symbolScore, symbolMatches] = scoreFuzzy2(symbolLabelWithIcon, { + ...query, + values: void 0 + /* disable multi-query support */ + }, filterPos, symbolLabelIconOffset); + if (typeof symbolScore === "number") { + skipContainerQuery = true; + } + } + if (typeof symbolScore !== "number") { + [symbolScore, symbolMatches] = scoreFuzzy2(symbolLabelWithIcon, symbolQuery, filterPos, symbolLabelIconOffset); + if (typeof symbolScore !== "number") { + continue; + } + } + if (!skipContainerQuery && containerQuery) { + if (containerLabel && containerQuery.original.length > 0) { + [containerScore, containerMatches] = scoreFuzzy2(containerLabel, containerQuery); + } + if (typeof containerScore !== "number") { + continue; + } + if (typeof symbolScore === "number") { + symbolScore += containerScore; + } + } + } + const deprecated = symbol.tags && symbol.tags.indexOf( + 1 + /* SymbolTag.Deprecated */ + ) >= 0; + filteredSymbolPicks.push({ + index, + kind: symbol.kind, + score: symbolScore, + label: symbolLabelWithIcon, + ariaLabel: getAriaLabelForSymbol(symbol.name, symbol.kind), + description: containerLabel, + highlights: deprecated ? void 0 : { + label: symbolMatches, + description: containerMatches + }, + range: { + selection: Range.collapseToStart(symbol.selectionRange), + decoration: symbol.range + }, + uri: model.uri, + symbolName: symbolLabel, + strikethrough: deprecated, + buttons + }); + } + const sortedFilteredSymbolPicks = filteredSymbolPicks.sort((symbolA, symbolB) => filterBySymbolKind ? this.compareByKindAndScore(symbolA, symbolB) : this.compareByScore(symbolA, symbolB)); + let symbolPicks = []; + if (filterBySymbolKind) { + let updateLastSeparatorLabel = function() { + if (lastSeparator && typeof lastSymbolKind === "number" && lastSymbolKindCounter > 0) { + lastSeparator.label = format(NLS_SYMBOL_KIND_CACHE[lastSymbolKind] || FALLBACK_NLS_SYMBOL_KIND, lastSymbolKindCounter); + } + }; + let lastSymbolKind = void 0; + let lastSeparator = void 0; + let lastSymbolKindCounter = 0; + for (const symbolPick of sortedFilteredSymbolPicks) { + if (lastSymbolKind !== symbolPick.kind) { + updateLastSeparatorLabel(); + lastSymbolKind = symbolPick.kind; + lastSymbolKindCounter = 1; + lastSeparator = { type: "separator" }; + symbolPicks.push(lastSeparator); + } else { + lastSymbolKindCounter++; + } + symbolPicks.push(symbolPick); + } + updateLastSeparatorLabel(); + } else if (sortedFilteredSymbolPicks.length > 0) { + symbolPicks = [ + { label: localize(1351, "symbols ({0})", filteredSymbolPicks.length), type: "separator" }, + ...sortedFilteredSymbolPicks + ]; + } + return symbolPicks; + } + compareByScore(symbolA, symbolB) { + if (typeof symbolA.score !== "number" && typeof symbolB.score === "number") { + return 1; + } else if (typeof symbolA.score === "number" && typeof symbolB.score !== "number") { + return -1; + } + if (typeof symbolA.score === "number" && typeof symbolB.score === "number") { + if (symbolA.score > symbolB.score) { + return -1; + } else if (symbolA.score < symbolB.score) { + return 1; + } + } + if (symbolA.index < symbolB.index) { + return -1; + } else if (symbolA.index > symbolB.index) { + return 1; + } + return 0; + } + compareByKindAndScore(symbolA, symbolB) { + const kindA = NLS_SYMBOL_KIND_CACHE[symbolA.kind] || FALLBACK_NLS_SYMBOL_KIND; + const kindB = NLS_SYMBOL_KIND_CACHE[symbolB.kind] || FALLBACK_NLS_SYMBOL_KIND; + const result = kindA.localeCompare(kindB); + if (result === 0) { + return this.compareByScore(symbolA, symbolB); + } + return result; + } + async getDocumentSymbols(document2, token) { + const model = await this._outlineModelService.getOrCreate(document2, token); + return token.isCancellationRequested ? [] : model.asListOfDocumentSymbols(); + } +}; +AbstractGotoSymbolQuickAccessProvider = AbstractGotoSymbolQuickAccessProvider_1 = __decorate161([ + __param155(0, ILanguageFeaturesService), + __param155(1, IOutlineModelService) +], AbstractGotoSymbolQuickAccessProvider); +var FALLBACK_NLS_SYMBOL_KIND = localize(1352, "properties ({0})"); +var NLS_SYMBOL_KIND_CACHE = { + [ + 5 + /* SymbolKind.Method */ + ]: localize(1353, "methods ({0})"), + [ + 11 + /* SymbolKind.Function */ + ]: localize(1354, "functions ({0})"), + [ + 8 + /* SymbolKind.Constructor */ + ]: localize(1355, "constructors ({0})"), + [ + 12 + /* SymbolKind.Variable */ + ]: localize(1356, "variables ({0})"), + [ + 4 + /* SymbolKind.Class */ + ]: localize(1357, "classes ({0})"), + [ + 22 + /* SymbolKind.Struct */ + ]: localize(1358, "structs ({0})"), + [ + 23 + /* SymbolKind.Event */ + ]: localize(1359, "events ({0})"), + [ + 24 + /* SymbolKind.Operator */ + ]: localize(1360, "operators ({0})"), + [ + 10 + /* SymbolKind.Interface */ + ]: localize(1361, "interfaces ({0})"), + [ + 2 + /* SymbolKind.Namespace */ + ]: localize(1362, "namespaces ({0})"), + [ + 3 + /* SymbolKind.Package */ + ]: localize(1363, "packages ({0})"), + [ + 25 + /* SymbolKind.TypeParameter */ + ]: localize(1364, "type parameters ({0})"), + [ + 1 + /* SymbolKind.Module */ + ]: localize(1365, "modules ({0})"), + [ + 6 + /* SymbolKind.Property */ + ]: localize(1366, "properties ({0})"), + [ + 9 + /* SymbolKind.Enum */ + ]: localize(1367, "enumerations ({0})"), + [ + 21 + /* SymbolKind.EnumMember */ + ]: localize(1368, "enumeration members ({0})"), + [ + 14 + /* SymbolKind.String */ + ]: localize(1369, "strings ({0})"), + [ + 0 + /* SymbolKind.File */ + ]: localize(1370, "files ({0})"), + [ + 17 + /* SymbolKind.Array */ + ]: localize(1371, "arrays ({0})"), + [ + 15 + /* SymbolKind.Number */ + ]: localize(1372, "numbers ({0})"), + [ + 16 + /* SymbolKind.Boolean */ + ]: localize(1373, "booleans ({0})"), + [ + 18 + /* SymbolKind.Object */ + ]: localize(1374, "objects ({0})"), + [ + 19 + /* SymbolKind.Key */ + ]: localize(1375, "keys ({0})"), + [ + 7 + /* SymbolKind.Field */ + ]: localize(1376, "fields ({0})"), + [ + 13 + /* SymbolKind.Constant */ + ]: localize(1377, "constants ({0})") +}; + +// node_modules/monaco-editor-core/esm/vs/editor/standalone/browser/quickAccess/standaloneGotoSymbolQuickAccess.js +init_platform2(); +init_codeEditorService(); +init_standaloneStrings(); +init_event(); +init_editorExtensions(); +init_editorContextKeys(); +init_outlineModel(); +init_languageFeatures(); +var __decorate162 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param156 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var StandaloneGotoSymbolQuickAccessProvider = class StandaloneGotoSymbolQuickAccessProvider2 extends AbstractGotoSymbolQuickAccessProvider { + constructor(editorService, languageFeaturesService, outlineModelService) { + super(languageFeaturesService, outlineModelService); + this.editorService = editorService; + this.onDidActiveTextEditorControlChange = Event.None; + } + get activeTextEditorControl() { + return this.editorService.getFocusedCodeEditor() ?? void 0; + } +}; +StandaloneGotoSymbolQuickAccessProvider = __decorate162([ + __param156(0, ICodeEditorService), + __param156(1, ILanguageFeaturesService), + __param156(2, IOutlineModelService) +], StandaloneGotoSymbolQuickAccessProvider); +var GotoSymbolAction = class _GotoSymbolAction extends EditorAction { + static { + this.ID = "editor.action.quickOutline"; + } + constructor() { + super({ + id: _GotoSymbolAction.ID, + label: QuickOutlineNLS.quickOutlineActionLabel, + alias: "Go to Symbol...", + precondition: EditorContextKeys.hasDocumentSymbolProvider, + kbOpts: { + kbExpr: EditorContextKeys.focus, + primary: 2048 | 1024 | 45, + weight: 100 + /* KeybindingWeight.EditorContrib */ + }, + contextMenuOpts: { + group: "navigation", + order: 3 + } + }); + } + run(accessor) { + accessor.get(IQuickInputService).quickAccess.show(AbstractGotoSymbolQuickAccessProvider.PREFIX, { itemActivation: ItemActivation.NONE }); + } +}; +registerEditorAction(GotoSymbolAction); +Registry.as(Extensions10.Quickaccess).registerQuickAccessProvider({ + ctor: StandaloneGotoSymbolQuickAccessProvider, + prefix: AbstractGotoSymbolQuickAccessProvider.PREFIX, + helpEntries: [ + { description: QuickOutlineNLS.quickOutlineActionLabel, prefix: AbstractGotoSymbolQuickAccessProvider.PREFIX, commandId: GotoSymbolAction.ID }, + { description: QuickOutlineNLS.quickOutlineByCategoryActionLabel, prefix: AbstractGotoSymbolQuickAccessProvider.PREFIX_BY_CATEGORY } + ] +}); + +// node_modules/monaco-editor-core/esm/vs/editor/standalone/browser/quickAccess/standaloneCommandsQuickAccess.js +init_platform2(); +init_standaloneStrings(); +init_codeEditorService(); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/quickAccess/browser/commandsQuickAccess.js +init_iconLabels(); + +// node_modules/monaco-editor-core/esm/vs/platform/quickinput/browser/commandsQuickAccess.js +init_errors(); +init_filters(); +init_functional(); +init_lifecycle(); +init_map(); + +// node_modules/monaco-editor-core/esm/vs/base/common/tfIdf.js +function countMapFrom(values) { + const map = /* @__PURE__ */ new Map(); + for (const value of values) { + map.set(value, (map.get(value) ?? 0) + 1); + } + return map; +} +var TfIdfCalculator = class _TfIdfCalculator { + constructor() { + this.chunkCount = 0; + this.chunkOccurrences = /* @__PURE__ */ new Map(); + this.documents = /* @__PURE__ */ new Map(); + } + calculateScores(query, token) { + const embedding = this.computeEmbedding(query); + const idfCache = /* @__PURE__ */ new Map(); + const scores = []; + for (const [key, doc] of this.documents) { + if (token.isCancellationRequested) { + return []; + } + for (const chunk of doc.chunks) { + const score3 = this.computeSimilarityScore(chunk, embedding, idfCache); + if (score3 > 0) { + scores.push({ key, score: score3 }); + } + } + } + return scores; + } + /** + * Count how many times each term (word) appears in a string. + */ + static termFrequencies(input) { + return countMapFrom(_TfIdfCalculator.splitTerms(input)); + } + /** + * Break a string into terms (words). + */ + static *splitTerms(input) { + const normalize3 = (word) => word.toLowerCase(); + for (const [word] of input.matchAll(/\b\p{Letter}[\p{Letter}\d]{2,}\b/gu)) { + yield normalize3(word); + const camelParts = word.replace(/([a-z])([A-Z])/g, "$1 $2").split(/\s+/g); + if (camelParts.length > 1) { + for (const part of camelParts) { + if (part.length > 2 && /\p{Letter}{3,}/gu.test(part)) { + yield normalize3(part); + } + } + } + } + } + updateDocuments(documents) { + for (const { key } of documents) { + this.deleteDocument(key); + } + for (const doc of documents) { + const chunks = []; + for (const text2 of doc.textChunks) { + const tf = _TfIdfCalculator.termFrequencies(text2); + for (const term of tf.keys()) { + this.chunkOccurrences.set(term, (this.chunkOccurrences.get(term) ?? 0) + 1); + } + chunks.push({ text: text2, tf }); + } + this.chunkCount += chunks.length; + this.documents.set(doc.key, { chunks }); + } + return this; + } + deleteDocument(key) { + const doc = this.documents.get(key); + if (!doc) { + return; + } + this.documents.delete(key); + this.chunkCount -= doc.chunks.length; + for (const chunk of doc.chunks) { + for (const term of chunk.tf.keys()) { + const currentOccurrences = this.chunkOccurrences.get(term); + if (typeof currentOccurrences === "number") { + const newOccurrences = currentOccurrences - 1; + if (newOccurrences <= 0) { + this.chunkOccurrences.delete(term); + } else { + this.chunkOccurrences.set(term, newOccurrences); + } + } + } + } + } + computeSimilarityScore(chunk, queryEmbedding, idfCache) { + let sum2 = 0; + for (const [term, termTfidf] of Object.entries(queryEmbedding)) { + const chunkTf = chunk.tf.get(term); + if (!chunkTf) { + continue; + } + let chunkIdf = idfCache.get(term); + if (typeof chunkIdf !== "number") { + chunkIdf = this.computeIdf(term); + idfCache.set(term, chunkIdf); + } + const chunkTfidf = chunkTf * chunkIdf; + sum2 += chunkTfidf * termTfidf; + } + return sum2; + } + computeEmbedding(input) { + const tf = _TfIdfCalculator.termFrequencies(input); + return this.computeTfidf(tf); + } + computeIdf(term) { + const chunkOccurrences = this.chunkOccurrences.get(term) ?? 0; + return chunkOccurrences > 0 ? Math.log((this.chunkCount + 1) / chunkOccurrences) : 0; + } + computeTfidf(termFrequencies) { + const embedding = /* @__PURE__ */ Object.create(null); + for (const [word, occurrences] of termFrequencies) { + const idf = this.computeIdf(word); + if (idf > 0) { + embedding[word] = occurrences * idf; + } + } + return embedding; + } +}; +function normalizeTfIdfScores(scores) { + const result = scores.slice(0); + result.sort((a, b) => b.score - a.score); + const max = result[0]?.score ?? 0; + if (max > 0) { + for (const score3 of result) { + score3.score /= max; + } + } + return result; +} + +// node_modules/monaco-editor-core/esm/vs/platform/quickinput/browser/commandsQuickAccess.js +init_nls(); +init_commands(); +init_configuration(); +init_instantiation(); +init_log(); + +// node_modules/monaco-editor-core/esm/vs/platform/quickinput/browser/pickerQuickAccess.js +init_async(); +init_cancellation(); +init_lifecycle(); +init_types(); +var TriggerAction; +(function(TriggerAction2) { + TriggerAction2[TriggerAction2["NO_ACTION"] = 0] = "NO_ACTION"; + TriggerAction2[TriggerAction2["CLOSE_PICKER"] = 1] = "CLOSE_PICKER"; + TriggerAction2[TriggerAction2["REFRESH_PICKER"] = 2] = "REFRESH_PICKER"; + TriggerAction2[TriggerAction2["REMOVE_ITEM"] = 3] = "REMOVE_ITEM"; +})(TriggerAction || (TriggerAction = {})); +function isPicksWithActive(obj) { + const candidate = obj; + return Array.isArray(candidate.items); +} +function isFastAndSlowPicks(obj) { + const candidate = obj; + return !!candidate.picks && candidate.additionalPicks instanceof Promise; +} +var PickerQuickAccessProvider = class extends Disposable { + constructor(prefix, options2) { + super(); + this.prefix = prefix; + this.options = options2; + } + provide(picker, token, runOptions) { + const disposables = new DisposableStore(); + picker.canAcceptInBackground = !!this.options?.canAcceptInBackground; + picker.matchOnLabel = picker.matchOnDescription = picker.matchOnDetail = picker.sortByLabel = false; + let picksCts = void 0; + const picksDisposable = disposables.add(new MutableDisposable()); + const updatePickerItems = async () => { + picksCts?.dispose(true); + picker.busy = false; + const picksDisposables = picksDisposable.value = new DisposableStore(); + picksCts = picksDisposables.add(new CancellationTokenSource(token)); + const picksToken = picksCts.token; + let picksFilter = picker.value.substring(this.prefix.length); + if (!this.options?.shouldSkipTrimPickFilter) { + picksFilter = picksFilter.trim(); + } + const providedPicks = this._getPicks(picksFilter, picksDisposables, picksToken, runOptions); + const applyPicks = (picks, skipEmpty) => { + let items; + let activeItem = void 0; + if (isPicksWithActive(picks)) { + items = picks.items; + activeItem = picks.active; + } else { + items = picks; + } + if (items.length === 0) { + if (skipEmpty) { + return false; + } + if ((picksFilter.length > 0 || picker.hideInput) && this.options?.noResultsPick) { + if (isFunction(this.options.noResultsPick)) { + items = [this.options.noResultsPick(picksFilter)]; + } else { + items = [this.options.noResultsPick]; + } + } + } + picker.items = items; + if (activeItem) { + picker.activeItems = [activeItem]; + } + return true; + }; + const applyFastAndSlowPicks = async (fastAndSlowPicks) => { + let fastPicksApplied = false; + let slowPicksApplied = false; + await Promise.all([ + // Fast Picks: if `mergeDelay` is configured, in order to reduce + // amount of flicker, we race against the slow picks over some delay + // and then set the fast picks. + // If the slow picks are faster, we reduce the flicker by only + // setting the items once. + (async () => { + if (typeof fastAndSlowPicks.mergeDelay === "number") { + await timeout(fastAndSlowPicks.mergeDelay); + if (picksToken.isCancellationRequested) { + return; + } + } + if (!slowPicksApplied) { + fastPicksApplied = applyPicks( + fastAndSlowPicks.picks, + true + /* skip over empty to reduce flicker */ + ); + } + })(), + // Slow Picks: we await the slow picks and then set them at + // once together with the fast picks, but only if we actually + // have additional results. + (async () => { + picker.busy = true; + try { + const awaitedAdditionalPicks = await fastAndSlowPicks.additionalPicks; + if (picksToken.isCancellationRequested) { + return; + } + let picks; + let activePick = void 0; + if (isPicksWithActive(fastAndSlowPicks.picks)) { + picks = fastAndSlowPicks.picks.items; + activePick = fastAndSlowPicks.picks.active; + } else { + picks = fastAndSlowPicks.picks; + } + let additionalPicks; + let additionalActivePick = void 0; + if (isPicksWithActive(awaitedAdditionalPicks)) { + additionalPicks = awaitedAdditionalPicks.items; + additionalActivePick = awaitedAdditionalPicks.active; + } else { + additionalPicks = awaitedAdditionalPicks; + } + if (additionalPicks.length > 0 || !fastPicksApplied) { + let fallbackActivePick = void 0; + if (!activePick && !additionalActivePick) { + const fallbackActivePickCandidate = picker.activeItems[0]; + if (fallbackActivePickCandidate && picks.indexOf(fallbackActivePickCandidate) !== -1) { + fallbackActivePick = fallbackActivePickCandidate; + } + } + applyPicks({ + items: [...picks, ...additionalPicks], + active: activePick || additionalActivePick || fallbackActivePick + }); + } + } finally { + if (!picksToken.isCancellationRequested) { + picker.busy = false; + } + slowPicksApplied = true; + } + })() + ]); + }; + if (providedPicks === null) { + } else if (isFastAndSlowPicks(providedPicks)) { + await applyFastAndSlowPicks(providedPicks); + } else if (!(providedPicks instanceof Promise)) { + applyPicks(providedPicks); + } else { + picker.busy = true; + try { + const awaitedPicks = await providedPicks; + if (picksToken.isCancellationRequested) { + return; + } + if (isFastAndSlowPicks(awaitedPicks)) { + await applyFastAndSlowPicks(awaitedPicks); + } else { + applyPicks(awaitedPicks); + } + } finally { + if (!picksToken.isCancellationRequested) { + picker.busy = false; + } + } + } + }; + disposables.add(picker.onDidChangeValue(() => updatePickerItems())); + updatePickerItems(); + disposables.add(picker.onDidAccept((event) => { + if (runOptions?.handleAccept) { + if (!event.inBackground) { + picker.hide(); + } + runOptions.handleAccept?.(picker.activeItems[0], event.inBackground); + return; + } + const [item] = picker.selectedItems; + if (typeof item?.accept === "function") { + if (!event.inBackground) { + picker.hide(); + } + item.accept(picker.keyMods, event); + } + })); + const buttonTrigger = async (button, item) => { + if (typeof item.trigger !== "function") { + return; + } + const buttonIndex = item.buttons?.indexOf(button) ?? -1; + if (buttonIndex >= 0) { + const result = item.trigger(buttonIndex, picker.keyMods); + const action = typeof result === "number" ? result : await result; + if (token.isCancellationRequested) { + return; + } + switch (action) { + case TriggerAction.NO_ACTION: + break; + case TriggerAction.CLOSE_PICKER: + picker.hide(); + break; + case TriggerAction.REFRESH_PICKER: + updatePickerItems(); + break; + case TriggerAction.REMOVE_ITEM: { + const index = picker.items.indexOf(item); + if (index !== -1) { + const items = picker.items.slice(); + const removed = items.splice(index, 1); + const activeItems = picker.activeItems.filter((activeItem) => activeItem !== removed[0]); + const keepScrollPositionBefore = picker.keepScrollPosition; + picker.keepScrollPosition = true; + picker.items = items; + if (activeItems) { + picker.activeItems = activeItems; + } + picker.keepScrollPosition = keepScrollPositionBefore; + } + break; + } + } + } + }; + disposables.add(picker.onDidTriggerItemButton(({ button, item }) => buttonTrigger(button, item))); + disposables.add(picker.onDidTriggerSeparatorButton(({ button, separator: separator2 }) => buttonTrigger(button, separator2))); + return disposables; + } +}; + +// node_modules/monaco-editor-core/esm/vs/platform/quickinput/browser/commandsQuickAccess.js +init_telemetry(); + +// node_modules/monaco-editor-core/esm/vs/base/common/normalization.js +init_map(); +var nfcCache = new LRUCache(1e4); +var nfdCache = new LRUCache(1e4); +function normalizeNFD(str) { + return normalize2(str, "NFD", nfdCache); +} +var nonAsciiCharactersPattern = /[^\u0000-\u0080]/; +function normalize2(str, form, normalizedCache) { + if (!str) { + return str; + } + const cached = normalizedCache.get(str); + if (cached) { + return cached; + } + let res; + if (nonAsciiCharactersPattern.test(str)) { + res = str.normalize(form); + } else { + res = str; + } + normalizedCache.set(str, res); + return res; +} +var removeAccents = /* @__PURE__ */ (function() { + const regex = /[\u0300-\u036f]/g; + return function(str) { + return normalizeNFD(str).replace(regex, ""); + }; +})(); + +// node_modules/monaco-editor-core/esm/vs/platform/quickinput/browser/commandsQuickAccess.js +var __decorate163 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param157 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var AbstractCommandsQuickAccessProvider_1; +var CommandsHistory_1; +var AbstractCommandsQuickAccessProvider = class AbstractCommandsQuickAccessProvider2 extends PickerQuickAccessProvider { + static { + AbstractCommandsQuickAccessProvider_1 = this; + } + static { + this.PREFIX = ">"; + } + static { + this.TFIDF_THRESHOLD = 0.5; + } + static { + this.TFIDF_MAX_RESULTS = 5; + } + static { + this.WORD_FILTER = or(matchesPrefix, matchesWords, matchesContiguousSubString); + } + constructor(options2, instantiationService, keybindingService, commandService, telemetryService, dialogService) { + super(AbstractCommandsQuickAccessProvider_1.PREFIX, options2); + this.keybindingService = keybindingService; + this.commandService = commandService; + this.telemetryService = telemetryService; + this.dialogService = dialogService; + this.commandsHistory = this._register(instantiationService.createInstance(CommandsHistory)); + this.options = options2; + } + async _getPicks(filter, _disposables, token, runOptions) { + const allCommandPicks = await this.getCommandPicks(token); + if (token.isCancellationRequested) { + return []; + } + const runTfidf = createSingleCallFunction(() => { + const tfidf = new TfIdfCalculator(); + tfidf.updateDocuments(allCommandPicks.map((commandPick) => ({ + key: commandPick.commandId, + textChunks: [this.getTfIdfChunk(commandPick)] + }))); + const result = tfidf.calculateScores(filter, token); + return normalizeTfIdfScores(result).filter((score3) => score3.score > AbstractCommandsQuickAccessProvider_1.TFIDF_THRESHOLD).slice(0, AbstractCommandsQuickAccessProvider_1.TFIDF_MAX_RESULTS); + }); + const noAccentsFilter = this.normalizeForFiltering(filter); + const filteredCommandPicks = []; + for (const commandPick of allCommandPicks) { + commandPick.labelNoAccents ??= this.normalizeForFiltering(commandPick.label); + const labelHighlights = AbstractCommandsQuickAccessProvider_1.WORD_FILTER(noAccentsFilter, commandPick.labelNoAccents) ?? void 0; + let aliasHighlights; + if (commandPick.commandAlias) { + commandPick.aliasNoAccents ??= this.normalizeForFiltering(commandPick.commandAlias); + aliasHighlights = AbstractCommandsQuickAccessProvider_1.WORD_FILTER(noAccentsFilter, commandPick.aliasNoAccents) ?? void 0; + } + if (labelHighlights || aliasHighlights) { + commandPick.highlights = { + label: labelHighlights, + detail: this.options.showAlias ? aliasHighlights : void 0 + }; + filteredCommandPicks.push(commandPick); + } else if (filter === commandPick.commandId) { + filteredCommandPicks.push(commandPick); + } else if (filter.length >= 3) { + const tfidf = runTfidf(); + if (token.isCancellationRequested) { + return []; + } + const tfidfScore = tfidf.find((score3) => score3.key === commandPick.commandId); + if (tfidfScore) { + commandPick.tfIdfScore = tfidfScore.score; + filteredCommandPicks.push(commandPick); + } + } + } + const mapLabelToCommand = /* @__PURE__ */ new Map(); + for (const commandPick of filteredCommandPicks) { + const existingCommandForLabel = mapLabelToCommand.get(commandPick.label); + if (existingCommandForLabel) { + commandPick.description = commandPick.commandId; + existingCommandForLabel.description = existingCommandForLabel.commandId; + } else { + mapLabelToCommand.set(commandPick.label, commandPick); + } + } + filteredCommandPicks.sort((commandPickA, commandPickB) => { + if (commandPickA.tfIdfScore && commandPickB.tfIdfScore) { + if (commandPickA.tfIdfScore === commandPickB.tfIdfScore) { + return commandPickA.label.localeCompare(commandPickB.label); + } + return commandPickB.tfIdfScore - commandPickA.tfIdfScore; + } else if (commandPickA.tfIdfScore) { + return 1; + } else if (commandPickB.tfIdfScore) { + return -1; + } + const commandACounter = this.commandsHistory.peek(commandPickA.commandId); + const commandBCounter = this.commandsHistory.peek(commandPickB.commandId); + if (commandACounter && commandBCounter) { + return commandACounter > commandBCounter ? -1 : 1; + } + if (commandACounter) { + return -1; + } + if (commandBCounter) { + return 1; + } + if (this.options.suggestedCommandIds) { + const commandASuggestion = this.options.suggestedCommandIds.has(commandPickA.commandId); + const commandBSuggestion = this.options.suggestedCommandIds.has(commandPickB.commandId); + if (commandASuggestion && commandBSuggestion) { + return 0; + } + if (commandASuggestion) { + return -1; + } + if (commandBSuggestion) { + return 1; + } + } + const isDeveloperA = commandPickA.commandCategory === Categories.Developer.value; + const isDeveloperB = commandPickB.commandCategory === Categories.Developer.value; + if (isDeveloperA && !isDeveloperB) { + return 1; + } + if (!isDeveloperA && isDeveloperB) { + return -1; + } + return commandPickA.label.localeCompare(commandPickB.label); + }); + const commandPicks = []; + let addOtherSeparator = false; + let addSuggestedSeparator = true; + let addCommonlyUsedSeparator = !!this.options.suggestedCommandIds; + for (let i2 = 0; i2 < filteredCommandPicks.length; i2++) { + const commandPick = filteredCommandPicks[i2]; + if (i2 === 0 && this.commandsHistory.peek(commandPick.commandId)) { + commandPicks.push({ type: "separator", label: localize(1740, "recently used") }); + addOtherSeparator = true; + } + if (addSuggestedSeparator && commandPick.tfIdfScore !== void 0) { + commandPicks.push({ type: "separator", label: localize(1741, "similar commands") }); + addSuggestedSeparator = false; + } + if (addCommonlyUsedSeparator && commandPick.tfIdfScore === void 0 && !this.commandsHistory.peek(commandPick.commandId) && this.options.suggestedCommandIds?.has(commandPick.commandId)) { + commandPicks.push({ type: "separator", label: localize(1742, "commonly used") }); + addOtherSeparator = true; + addCommonlyUsedSeparator = false; + } + if (addOtherSeparator && commandPick.tfIdfScore === void 0 && !this.commandsHistory.peek(commandPick.commandId) && !this.options.suggestedCommandIds?.has(commandPick.commandId)) { + commandPicks.push({ type: "separator", label: localize(1743, "other commands") }); + addOtherSeparator = false; + } + commandPicks.push(this.toCommandPick(commandPick, runOptions)); + } + if (!this.hasAdditionalCommandPicks(filter, token)) { + return commandPicks; + } + return { + picks: commandPicks, + additionalPicks: (async () => { + const additionalCommandPicks = await this.getAdditionalCommandPicks(allCommandPicks, filteredCommandPicks, filter, token); + if (token.isCancellationRequested) { + return []; + } + const commandPicks2 = additionalCommandPicks.map((commandPick) => this.toCommandPick(commandPick, runOptions)); + if (addSuggestedSeparator && commandPicks2[0]?.type !== "separator") { + commandPicks2.unshift({ type: "separator", label: localize(1744, "similar commands") }); + } + return commandPicks2; + })() + }; + } + toCommandPick(commandPick, runOptions) { + if (commandPick.type === "separator") { + return commandPick; + } + const keybinding = this.keybindingService.lookupKeybinding(commandPick.commandId); + const ariaLabel = keybinding ? localize(1745, "{0}, {1}", commandPick.label, keybinding.getAriaLabel()) : commandPick.label; + return { + ...commandPick, + ariaLabel, + detail: this.options.showAlias && commandPick.commandAlias !== commandPick.label ? commandPick.commandAlias : void 0, + keybinding, + accept: async () => { + this.commandsHistory.push(commandPick.commandId); + this.telemetryService.publicLog2("workbenchActionExecuted", { + id: commandPick.commandId, + from: runOptions?.from ?? "quick open" + }); + try { + commandPick.args?.length ? await this.commandService.executeCommand(commandPick.commandId, ...commandPick.args) : await this.commandService.executeCommand(commandPick.commandId); + } catch (error) { + if (!isCancellationError(error)) { + this.dialogService.error(localize(1746, "Command '{0}' resulted in an error", commandPick.label), toErrorMessage(error)); + } + } + } + }; + } + // TF-IDF string to be indexed + getTfIdfChunk({ label, commandAlias, commandDescription }) { + let chunk = label; + if (commandAlias && commandAlias !== label) { + chunk += ` - ${commandAlias}`; + } + if (commandDescription && commandDescription.value !== label) { + chunk += ` - ${commandDescription.value === commandDescription.original ? commandDescription.value : `${commandDescription.value} (${commandDescription.original})`}`; + } + return chunk; + } + /** + * Normalizes a string for filtering by removing accents, but only if + * the result has the same length, otherwise returns the original string. + */ + normalizeForFiltering(value) { + const withoutAccents = removeAccents(value); + if (withoutAccents.length !== value.length) { + this.telemetryService.publicLog2("QuickAccess:FilterLengthMismatch", { + originalLength: value.length, + normalizedLength: withoutAccents.length + }); + return value; + } else { + return withoutAccents; + } + } +}; +AbstractCommandsQuickAccessProvider = AbstractCommandsQuickAccessProvider_1 = __decorate163([ + __param157(1, IInstantiationService), + __param157(2, IKeybindingService), + __param157(3, ICommandService), + __param157(4, ITelemetryService), + __param157(5, IDialogService) +], AbstractCommandsQuickAccessProvider); +var CommandsHistory = class CommandsHistory2 extends Disposable { + static { + CommandsHistory_1 = this; + } + static { + this.DEFAULT_COMMANDS_HISTORY_LENGTH = 50; + } + static { + this.PREF_KEY_CACHE = "commandPalette.mru.cache"; + } + static { + this.PREF_KEY_COUNTER = "commandPalette.mru.counter"; + } + static { + this.counter = 1; + } + static { + this.hasChanges = false; + } + constructor(storageService, configurationService, logService) { + super(); + this.storageService = { + get: (key, _scope, defaultValue) => localStorage.getItem("monaco:" + key) ?? defaultValue, + getNumber: (key, _scope, defaultValue) => Number(localStorage.getItem("monaco:" + key) ?? defaultValue) || defaultValue, + store: (key, value) => localStorage.setItem("monaco:" + key, String(value)), + onWillSaveState: (callback) => { + window.addEventListener("beforeunload", () => { + callback({ reason: WillSaveStateReason.SHUTDOWN }); + }); + } + }; + this.configurationService = configurationService; + this.logService = logService; + 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) => { + if (e.reason === WillSaveStateReason.SHUTDOWN) { + this.saveState(); + } + })); + } + updateConfiguration(e) { + if (e && !e.affectsConfiguration("workbench.commandPalette.history")) { + return; + } + this.configuredCommandsHistoryLength = CommandsHistory_1.getConfiguredCommandHistoryLength(this.configurationService); + if (CommandsHistory_1.cache && CommandsHistory_1.cache.limit !== this.configuredCommandsHistoryLength) { + CommandsHistory_1.cache.limit = this.configuredCommandsHistoryLength; + CommandsHistory_1.hasChanges = true; + } + } + load() { + const raw = this.storageService.get( + CommandsHistory_1.PREF_KEY_CACHE, + 0 + /* StorageScope.PROFILE */ + ); + let serializedCache; + if (raw) { + try { + serializedCache = JSON.parse(raw); + } catch (error) { + this.logService.error(`[CommandsHistory] invalid data: ${error}`); + } + } + const cache = CommandsHistory_1.cache = new LRUCache(this.configuredCommandsHistoryLength, 1); + if (serializedCache) { + let entries2; + if (serializedCache.usesLRU) { + entries2 = serializedCache.entries; + } else { + entries2 = serializedCache.entries.sort((a, b) => a.value - b.value); + } + entries2.forEach((entry) => cache.set(entry.key, entry.value)); + } + CommandsHistory_1.counter = this.storageService.getNumber(CommandsHistory_1.PREF_KEY_COUNTER, 0, CommandsHistory_1.counter); + } + push(commandId) { + if (!CommandsHistory_1.cache) { + return; + } + CommandsHistory_1.cache.set(commandId, CommandsHistory_1.counter++); + CommandsHistory_1.hasChanges = true; + } + peek(commandId) { + return CommandsHistory_1.cache?.peek(commandId); + } + saveState() { + if (!CommandsHistory_1.cache) { + return; + } + if (!CommandsHistory_1.hasChanges) { + return; + } + const serializedCache = { usesLRU: true, entries: [] }; + CommandsHistory_1.cache.forEach((value, key) => serializedCache.entries.push({ key, value })); + this.storageService.store( + CommandsHistory_1.PREF_KEY_CACHE, + JSON.stringify(serializedCache), + 0, + 0 + /* StorageTarget.USER */ + ); + this.storageService.store( + CommandsHistory_1.PREF_KEY_COUNTER, + CommandsHistory_1.counter, + 0, + 0 + /* StorageTarget.USER */ + ); + CommandsHistory_1.hasChanges = false; + } + static getConfiguredCommandHistoryLength(configurationService) { + const config = configurationService.getValue(); + const configuredCommandHistoryLength = config.workbench?.commandPalette?.history; + if (typeof configuredCommandHistoryLength === "number") { + return configuredCommandHistoryLength; + } + return CommandsHistory_1.DEFAULT_COMMANDS_HISTORY_LENGTH; + } +}; +CommandsHistory = CommandsHistory_1 = __decorate163([ + __param157(0, IStorageService), + __param157(1, IConfigurationService), + __param157(2, ILogService) +], CommandsHistory); + +// node_modules/monaco-editor-core/esm/vs/editor/contrib/quickAccess/browser/commandsQuickAccess.js +var AbstractEditorCommandsQuickAccessProvider = class extends AbstractCommandsQuickAccessProvider { + constructor(options2, instantiationService, keybindingService, commandService, telemetryService, dialogService) { + super(options2, instantiationService, keybindingService, commandService, telemetryService, dialogService); + } + getCodeEditorCommandPicks() { + const activeTextEditorControl = this.activeTextEditorControl; + if (!activeTextEditorControl) { + return []; + } + const editorCommandPicks = []; + for (const editorAction of activeTextEditorControl.getSupportedActions()) { + let commandDescription; + if (editorAction.metadata?.description) { + if (isLocalizedString(editorAction.metadata.description)) { + commandDescription = editorAction.metadata.description; + } else { + commandDescription = { original: editorAction.metadata.description, value: editorAction.metadata.description }; + } + } + editorCommandPicks.push({ + commandId: editorAction.id, + commandAlias: editorAction.alias, + commandDescription, + label: stripIcons(editorAction.label) || editorAction.id + }); + } + return editorCommandPicks; + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/standalone/browser/quickAccess/standaloneCommandsQuickAccess.js +init_instantiation(); +init_commands(); +init_telemetry(); +init_editorExtensions(); +init_editorContextKeys(); +var __decorate164 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param158 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var StandaloneCommandsQuickAccessProvider = class StandaloneCommandsQuickAccessProvider2 extends AbstractEditorCommandsQuickAccessProvider { + get activeTextEditorControl() { + return this.codeEditorService.getFocusedCodeEditor() ?? void 0; + } + constructor(instantiationService, codeEditorService, keybindingService, commandService, telemetryService, dialogService) { + super({ showAlias: false }, instantiationService, keybindingService, commandService, telemetryService, dialogService); + this.codeEditorService = codeEditorService; + } + async getCommandPicks() { + return this.getCodeEditorCommandPicks(); + } + hasAdditionalCommandPicks() { + return false; + } + async getAdditionalCommandPicks() { + return []; + } +}; +StandaloneCommandsQuickAccessProvider = __decorate164([ + __param158(0, IInstantiationService), + __param158(1, ICodeEditorService), + __param158(2, IKeybindingService), + __param158(3, ICommandService), + __param158(4, ITelemetryService), + __param158(5, IDialogService) +], StandaloneCommandsQuickAccessProvider); +var GotoLineAction2 = class _GotoLineAction extends EditorAction { + static { + this.ID = "editor.action.quickCommand"; + } + constructor() { + super({ + id: _GotoLineAction.ID, + label: QuickCommandNLS.quickCommandActionLabel, + alias: "Command Palette", + precondition: void 0, + kbOpts: { + kbExpr: EditorContextKeys.focus, + primary: 59, + weight: 100 + /* KeybindingWeight.EditorContrib */ + }, + contextMenuOpts: { + group: "z_commands", + order: 1 + } + }); + } + run(accessor) { + accessor.get(IQuickInputService).quickAccess.show(StandaloneCommandsQuickAccessProvider.PREFIX); + } +}; +registerEditorAction(GotoLineAction2); +Registry.as(Extensions10.Quickaccess).registerQuickAccessProvider({ + ctor: StandaloneCommandsQuickAccessProvider, + prefix: StandaloneCommandsQuickAccessProvider.PREFIX, + helpEntries: [{ description: QuickCommandNLS.quickCommandHelp, commandId: GotoLineAction2.ID }] +}); + +// node_modules/monaco-editor-core/esm/vs/editor/standalone/browser/referenceSearch/standaloneReferenceSearch.js +init_editorExtensions(); +init_codeEditorService(); +init_configuration(); +init_contextkey(); +init_instantiation(); +var __decorate165 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param159 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var StandaloneReferencesController = class StandaloneReferencesController2 extends ReferencesController { + constructor(editor2, contextKeyService, editorService, notificationService, instantiationService, storageService, configurationService) { + super(true, editor2, contextKeyService, editorService, notificationService, instantiationService, storageService, configurationService); + } +}; +StandaloneReferencesController = __decorate165([ + __param159(1, IContextKeyService), + __param159(2, ICodeEditorService), + __param159(3, INotificationService), + __param159(4, IInstantiationService), + __param159(5, IStorageService), + __param159(6, IConfigurationService) +], StandaloneReferencesController); +registerEditorContribution( + ReferencesController.ID, + StandaloneReferencesController, + 4 + /* EditorContributionInstantiation.Lazy */ +); + +// node_modules/monaco-editor-core/esm/vs/editor/standalone/browser/toggleHighContrast/toggleHighContrast.js +init_editorExtensions(); +init_standaloneTheme(); +init_standaloneStrings(); +init_theme(); + +// node_modules/monaco-editor-core/esm/vs/editor/standalone/browser/standaloneThemeService.js +init_dom(); +init_browser(); +init_color(); +init_event(); +init_languages(); +init_encodedTokenAttributes(); + +// node_modules/monaco-editor-core/esm/vs/editor/common/languages/supports/tokenization.js +init_color(); +var ParsedTokenThemeRule = class { + constructor(token, index, fontStyle, foreground2, background) { + this._parsedThemeRuleBrand = void 0; + this.token = token; + this.index = index; + this.fontStyle = fontStyle; + this.foreground = foreground2; + this.background = background; + } +}; +function parseTokenTheme(source) { + if (!source || !Array.isArray(source)) { + return []; + } + const result = []; + let resultLen = 0; + for (let i2 = 0, len = source.length; i2 < len; i2++) { + const entry = source[i2]; + let fontStyle = -1; + if (typeof entry.fontStyle === "string") { + fontStyle = 0; + const segments = entry.fontStyle.split(" "); + for (let j = 0, lenJ = segments.length; j < lenJ; j++) { + const segment = segments[j]; + switch (segment) { + case "italic": + fontStyle = fontStyle | 1; + break; + case "bold": + fontStyle = fontStyle | 2; + break; + case "underline": + fontStyle = fontStyle | 4; + break; + case "strikethrough": + fontStyle = fontStyle | 8; + break; + } + } + } + let foreground2 = null; + if (typeof entry.foreground === "string") { + foreground2 = entry.foreground; + } + let background = null; + if (typeof entry.background === "string") { + background = entry.background; + } + result[resultLen++] = new ParsedTokenThemeRule(entry.token || "", i2, fontStyle, foreground2, background); + } + return result; +} +function resolveParsedTokenThemeRules(parsedThemeRules, customTokenColors) { + parsedThemeRules.sort((a, b) => { + const r = strcmp(a.token, b.token); + if (r !== 0) { + return r; + } + return a.index - b.index; + }); + let defaultFontStyle = 0; + let defaultForeground = "000000"; + let defaultBackground = "ffffff"; + while (parsedThemeRules.length >= 1 && parsedThemeRules[0].token === "") { + const incomingDefaults = parsedThemeRules.shift(); + if (incomingDefaults.fontStyle !== -1) { + defaultFontStyle = incomingDefaults.fontStyle; + } + if (incomingDefaults.foreground !== null) { + defaultForeground = incomingDefaults.foreground; + } + if (incomingDefaults.background !== null) { + defaultBackground = incomingDefaults.background; + } + } + const colorMap = new ColorMap(); + for (const color of customTokenColors) { + colorMap.getId(color); + } + const foregroundColorId = colorMap.getId(defaultForeground); + const backgroundColorId = colorMap.getId(defaultBackground); + const defaults = new ThemeTrieElementRule(defaultFontStyle, foregroundColorId, backgroundColorId); + const root = new ThemeTrieElement(defaults); + for (let i2 = 0, len = parsedThemeRules.length; i2 < len; i2++) { + const rule = parsedThemeRules[i2]; + root.insert(rule.token, rule.fontStyle, colorMap.getId(rule.foreground), colorMap.getId(rule.background)); + } + return new TokenTheme(colorMap, root); +} +var colorRegExp = /^#?([0-9A-Fa-f]{6})([0-9A-Fa-f]{2})?$/; +var ColorMap = class { + constructor() { + this._lastColorId = 0; + this._id2color = []; + this._color2id = /* @__PURE__ */ new Map(); + } + getId(color) { + if (color === null) { + return 0; + } + const match2 = color.match(colorRegExp); + if (!match2) { + throw new Error("Illegal value for token color: " + color); + } + color = match2[1].toUpperCase(); + let value = this._color2id.get(color); + if (value) { + return value; + } + value = ++this._lastColorId; + this._color2id.set(color, value); + this._id2color[value] = Color.fromHex("#" + color); + return value; + } + getColorMap() { + return this._id2color.slice(0); + } +}; +var TokenTheme = class { + static createFromRawTokenTheme(source, customTokenColors) { + return this.createFromParsedTokenTheme(parseTokenTheme(source), customTokenColors); + } + static createFromParsedTokenTheme(source, customTokenColors) { + return resolveParsedTokenThemeRules(source, customTokenColors); + } + constructor(colorMap, root) { + this._colorMap = colorMap; + this._root = root; + this._cache = /* @__PURE__ */ new Map(); + } + getColorMap() { + return this._colorMap.getColorMap(); + } + _match(token) { + return this._root.match(token); + } + match(languageId, token) { + let result = this._cache.get(token); + if (typeof result === "undefined") { + const rule = this._match(token); + const standardToken = toStandardTokenType(token); + result = (rule.metadata | standardToken << 8) >>> 0; + this._cache.set(token, result); + } + return (result | languageId << 0) >>> 0; + } +}; +var STANDARD_TOKEN_TYPE_REGEXP = /\b(comment|string|regex|regexp)\b/; +function toStandardTokenType(tokenType) { + const m = tokenType.match(STANDARD_TOKEN_TYPE_REGEXP); + if (!m) { + return 0; + } + switch (m[1]) { + case "comment": + return 1; + case "string": + return 2; + case "regex": + return 3; + case "regexp": + return 3; + } + throw new Error("Unexpected match for standard token type!"); +} +function strcmp(a, b) { + if (a < b) { + return -1; + } + if (a > b) { + return 1; + } + return 0; +} +var ThemeTrieElementRule = class _ThemeTrieElementRule { + constructor(fontStyle, foreground2, background) { + this._themeTrieElementRuleBrand = void 0; + this._fontStyle = fontStyle; + this._foreground = foreground2; + this._background = background; + this.metadata = (this._fontStyle << 11 | this._foreground << 15 | this._background << 24) >>> 0; + } + clone() { + return new _ThemeTrieElementRule(this._fontStyle, this._foreground, this._background); + } + acceptOverwrite(fontStyle, foreground2, background) { + if (fontStyle !== -1) { + this._fontStyle = fontStyle; + } + if (foreground2 !== 0) { + this._foreground = foreground2; + } + if (background !== 0) { + this._background = background; + } + this.metadata = (this._fontStyle << 11 | this._foreground << 15 | this._background << 24) >>> 0; + } +}; +var ThemeTrieElement = class _ThemeTrieElement { + constructor(mainRule) { + this._themeTrieElementBrand = void 0; + this._mainRule = mainRule; + this._children = /* @__PURE__ */ new Map(); + } + match(token) { + if (token === "") { + return this._mainRule; + } + const dotIndex = token.indexOf("."); + let head; + let tail2; + if (dotIndex === -1) { + head = token; + tail2 = ""; + } else { + head = token.substring(0, dotIndex); + tail2 = token.substring(dotIndex + 1); + } + const child = this._children.get(head); + if (typeof child !== "undefined") { + return child.match(tail2); + } + return this._mainRule; + } + insert(token, fontStyle, foreground2, background) { + if (token === "") { + this._mainRule.acceptOverwrite(fontStyle, foreground2, background); + return; + } + const dotIndex = token.indexOf("."); + let head; + let tail2; + if (dotIndex === -1) { + head = token; + tail2 = ""; + } else { + head = token.substring(0, dotIndex); + tail2 = token.substring(dotIndex + 1); + } + let child = this._children.get(head); + if (typeof child === "undefined") { + child = new _ThemeTrieElement(this._mainRule.clone()); + this._children.set(head, child); + } + child.insert(tail2, fontStyle, foreground2, background); + } +}; +function generateTokensCSSForColorMap(colorMap) { + const rules = []; + for (let i2 = 1, len = colorMap.length; i2 < len; i2++) { + const color = colorMap[i2]; + rules[i2] = `.mtk${i2} { color: ${color}; }`; + } + rules.push(".mtki { font-style: italic; }"); + rules.push(".mtkb { font-weight: bold; }"); + rules.push(".mtku { text-decoration: underline; text-underline-position: under; }"); + rules.push(".mtks { text-decoration: line-through; }"); + rules.push(".mtks.mtku { text-decoration: underline line-through; text-underline-position: under; }"); + return rules.join("\n"); +} + +// node_modules/monaco-editor-core/esm/vs/editor/standalone/common/themes.js +init_editorColorRegistry(); +init_colorRegistry(); +var vs = { + base: "vs", + inherit: false, + rules: [ + { token: "", foreground: "000000", background: "fffffe" }, + { token: "invalid", foreground: "cd3131" }, + { token: "emphasis", fontStyle: "italic" }, + { token: "strong", fontStyle: "bold" }, + { token: "variable", foreground: "001188" }, + { token: "variable.predefined", foreground: "4864AA" }, + { token: "constant", foreground: "dd0000" }, + { token: "comment", foreground: "008000" }, + { token: "number", foreground: "098658" }, + { token: "number.hex", foreground: "3030c0" }, + { token: "regexp", foreground: "800000" }, + { token: "annotation", foreground: "808080" }, + { token: "type", foreground: "008080" }, + { token: "delimiter", foreground: "000000" }, + { token: "delimiter.html", foreground: "383838" }, + { token: "delimiter.xml", foreground: "0000FF" }, + { token: "tag", foreground: "800000" }, + { token: "tag.id.pug", foreground: "4F76AC" }, + { token: "tag.class.pug", foreground: "4F76AC" }, + { token: "meta.scss", foreground: "800000" }, + { token: "metatag", foreground: "e00000" }, + { token: "metatag.content.html", foreground: "FF0000" }, + { token: "metatag.html", foreground: "808080" }, + { token: "metatag.xml", foreground: "808080" }, + { token: "metatag.php", fontStyle: "bold" }, + { token: "key", foreground: "863B00" }, + { token: "string.key.json", foreground: "A31515" }, + { token: "string.value.json", foreground: "0451A5" }, + { token: "attribute.name", foreground: "FF0000" }, + { token: "attribute.value", foreground: "0451A5" }, + { token: "attribute.value.number", foreground: "098658" }, + { token: "attribute.value.unit", foreground: "098658" }, + { token: "attribute.value.html", foreground: "0000FF" }, + { token: "attribute.value.xml", foreground: "0000FF" }, + { token: "string", foreground: "A31515" }, + { token: "string.html", foreground: "0000FF" }, + { token: "string.sql", foreground: "FF0000" }, + { token: "string.yaml", foreground: "0451A5" }, + { token: "keyword", foreground: "0000FF" }, + { token: "keyword.json", foreground: "0451A5" }, + { token: "keyword.flow", foreground: "AF00DB" }, + { token: "keyword.flow.scss", foreground: "0000FF" }, + { token: "operator.scss", foreground: "666666" }, + { token: "operator.sql", foreground: "778899" }, + { token: "operator.swift", foreground: "666666" }, + { token: "predefined.sql", foreground: "C700C7" } + ], + colors: { + [editorBackground]: "#FFFFFE", + [editorForeground]: "#000000", + [editorInactiveSelection]: "#E5EBF1", + [editorIndentGuide1]: "#D3D3D3", + [editorActiveIndentGuide1]: "#939393", + [editorSelectionHighlight]: "#ADD6FF4D" + } +}; +var vs_dark = { + base: "vs-dark", + inherit: false, + rules: [ + { token: "", foreground: "D4D4D4", background: "1E1E1E" }, + { token: "invalid", foreground: "f44747" }, + { token: "emphasis", fontStyle: "italic" }, + { token: "strong", fontStyle: "bold" }, + { token: "variable", foreground: "74B0DF" }, + { token: "variable.predefined", foreground: "4864AA" }, + { token: "variable.parameter", foreground: "9CDCFE" }, + { token: "constant", foreground: "569CD6" }, + { token: "comment", foreground: "608B4E" }, + { token: "number", foreground: "B5CEA8" }, + { token: "number.hex", foreground: "5BB498" }, + { token: "regexp", foreground: "B46695" }, + { token: "annotation", foreground: "cc6666" }, + { token: "type", foreground: "3DC9B0" }, + { token: "delimiter", foreground: "DCDCDC" }, + { token: "delimiter.html", foreground: "808080" }, + { token: "delimiter.xml", foreground: "808080" }, + { token: "tag", foreground: "569CD6" }, + { token: "tag.id.pug", foreground: "4F76AC" }, + { token: "tag.class.pug", foreground: "4F76AC" }, + { token: "meta.scss", foreground: "A79873" }, + { token: "meta.tag", foreground: "CE9178" }, + { token: "metatag", foreground: "DD6A6F" }, + { token: "metatag.content.html", foreground: "9CDCFE" }, + { token: "metatag.html", foreground: "569CD6" }, + { token: "metatag.xml", foreground: "569CD6" }, + { token: "metatag.php", fontStyle: "bold" }, + { token: "key", foreground: "9CDCFE" }, + { token: "string.key.json", foreground: "9CDCFE" }, + { token: "string.value.json", foreground: "CE9178" }, + { token: "attribute.name", foreground: "9CDCFE" }, + { token: "attribute.value", foreground: "CE9178" }, + { token: "attribute.value.number.css", foreground: "B5CEA8" }, + { token: "attribute.value.unit.css", foreground: "B5CEA8" }, + { token: "attribute.value.hex.css", foreground: "D4D4D4" }, + { token: "string", foreground: "CE9178" }, + { token: "string.sql", foreground: "FF0000" }, + { token: "keyword", foreground: "569CD6" }, + { token: "keyword.flow", foreground: "C586C0" }, + { token: "keyword.json", foreground: "CE9178" }, + { token: "keyword.flow.scss", foreground: "569CD6" }, + { token: "operator.scss", foreground: "909090" }, + { token: "operator.sql", foreground: "778899" }, + { token: "operator.swift", foreground: "909090" }, + { token: "predefined.sql", foreground: "FF00FF" } + ], + colors: { + [editorBackground]: "#1E1E1E", + [editorForeground]: "#D4D4D4", + [editorInactiveSelection]: "#3A3D41", + [editorIndentGuide1]: "#404040", + [editorActiveIndentGuide1]: "#707070", + [editorSelectionHighlight]: "#ADD6FF26" + } +}; +var hc_black = { + base: "hc-black", + inherit: false, + rules: [ + { token: "", foreground: "FFFFFF", background: "000000" }, + { token: "invalid", foreground: "f44747" }, + { token: "emphasis", fontStyle: "italic" }, + { token: "strong", fontStyle: "bold" }, + { token: "variable", foreground: "1AEBFF" }, + { token: "variable.parameter", foreground: "9CDCFE" }, + { token: "constant", foreground: "569CD6" }, + { token: "comment", foreground: "608B4E" }, + { token: "number", foreground: "FFFFFF" }, + { token: "regexp", foreground: "C0C0C0" }, + { token: "annotation", foreground: "569CD6" }, + { token: "type", foreground: "3DC9B0" }, + { token: "delimiter", foreground: "FFFF00" }, + { token: "delimiter.html", foreground: "FFFF00" }, + { token: "tag", foreground: "569CD6" }, + { token: "tag.id.pug", foreground: "4F76AC" }, + { token: "tag.class.pug", foreground: "4F76AC" }, + { token: "meta", foreground: "D4D4D4" }, + { token: "meta.tag", foreground: "CE9178" }, + { token: "metatag", foreground: "569CD6" }, + { token: "metatag.content.html", foreground: "1AEBFF" }, + { token: "metatag.html", foreground: "569CD6" }, + { token: "metatag.xml", foreground: "569CD6" }, + { token: "metatag.php", fontStyle: "bold" }, + { token: "key", foreground: "9CDCFE" }, + { token: "string.key", foreground: "9CDCFE" }, + { token: "string.value", foreground: "CE9178" }, + { token: "attribute.name", foreground: "569CD6" }, + { token: "attribute.value", foreground: "3FF23F" }, + { token: "string", foreground: "CE9178" }, + { token: "string.sql", foreground: "FF0000" }, + { token: "keyword", foreground: "569CD6" }, + { token: "keyword.flow", foreground: "C586C0" }, + { token: "operator.sql", foreground: "778899" }, + { token: "operator.swift", foreground: "909090" }, + { token: "predefined.sql", foreground: "FF00FF" } + ], + colors: { + [editorBackground]: "#000000", + [editorForeground]: "#FFFFFF", + [editorIndentGuide1]: "#FFFFFF", + [editorActiveIndentGuide1]: "#FFFFFF" + } +}; +var hc_light = { + base: "hc-light", + inherit: false, + rules: [ + { token: "", foreground: "292929", background: "FFFFFF" }, + { token: "invalid", foreground: "B5200D" }, + { token: "emphasis", fontStyle: "italic" }, + { token: "strong", fontStyle: "bold" }, + { token: "variable", foreground: "264F70" }, + { token: "variable.predefined", foreground: "4864AA" }, + { token: "constant", foreground: "dd0000" }, + { token: "comment", foreground: "008000" }, + { token: "number", foreground: "098658" }, + { token: "number.hex", foreground: "3030c0" }, + { token: "regexp", foreground: "800000" }, + { token: "annotation", foreground: "808080" }, + { token: "type", foreground: "008080" }, + { token: "delimiter", foreground: "000000" }, + { token: "delimiter.html", foreground: "383838" }, + { token: "tag", foreground: "800000" }, + { token: "tag.id.pug", foreground: "4F76AC" }, + { token: "tag.class.pug", foreground: "4F76AC" }, + { token: "meta.scss", foreground: "800000" }, + { token: "metatag", foreground: "e00000" }, + { token: "metatag.content.html", foreground: "B5200D" }, + { token: "metatag.html", foreground: "808080" }, + { token: "metatag.xml", foreground: "808080" }, + { token: "metatag.php", fontStyle: "bold" }, + { token: "key", foreground: "863B00" }, + { token: "string.key.json", foreground: "A31515" }, + { token: "string.value.json", foreground: "0451A5" }, + { token: "attribute.name", foreground: "264F78" }, + { token: "attribute.value", foreground: "0451A5" }, + { token: "string", foreground: "A31515" }, + { token: "string.sql", foreground: "B5200D" }, + { token: "keyword", foreground: "0000FF" }, + { token: "keyword.flow", foreground: "AF00DB" }, + { token: "operator.sql", foreground: "778899" }, + { token: "operator.swift", foreground: "666666" }, + { token: "predefined.sql", foreground: "C700C7" } + ], + colors: { + [editorBackground]: "#FFFFFF", + [editorForeground]: "#292929", + [editorIndentGuide1]: "#292929", + [editorActiveIndentGuide1]: "#292929" + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/standalone/browser/standaloneThemeService.js +init_platform2(); +init_colorRegistry(); +init_themeService(); +init_lifecycle(); +init_theme(); + +// node_modules/monaco-editor-core/esm/vs/platform/theme/browser/iconsStyleSheet.js +init_event(); +init_lifecycle(); +init_themables(); +function getIconsStyleSheet(themeService) { + const disposable = new DisposableStore(); + const onDidChangeEmmiter = disposable.add(new Emitter()); + const iconRegistry2 = getIconRegistry(); + disposable.add(iconRegistry2.onDidChange(() => onDidChangeEmmiter.fire())); + if (themeService) { + disposable.add(themeService.onDidProductIconThemeChange(() => onDidChangeEmmiter.fire())); + } + return { + dispose: () => disposable.dispose(), + onDidChange: onDidChangeEmmiter.event, + getCSS() { + const productIconTheme = themeService ? themeService.getProductIconTheme() : new UnthemedProductIconTheme(); + const usedFontIds = {}; + const rules = new Builder(); + const rootAttribs = new Builder(); + for (const contribution of iconRegistry2.getIcons()) { + const definition = productIconTheme.getIcon(contribution); + if (!definition) { + continue; + } + const fontContribution = definition.font; + const fontFamilyVar = inline`--vscode-icon-${className(contribution.id)}-font-family`; + const contentVar = inline`--vscode-icon-${className(contribution.id)}-content`; + if (fontContribution) { + usedFontIds[fontContribution.id] = fontContribution.definition; + rootAttribs.push(inline`${fontFamilyVar}: ${stringValue(fontContribution.id)};`, inline`${contentVar}: ${stringValue(definition.fontCharacter)};`); + rules.push(inline`.codicon-${className(contribution.id)}:before { content: ${stringValue(definition.fontCharacter)}; font-family: ${stringValue(fontContribution.id)}; }`); + } else { + rootAttribs.push(inline`${contentVar}: ${stringValue(definition.fontCharacter)}; ${fontFamilyVar}: 'codicon';`); + rules.push(inline`.codicon-${className(contribution.id)}:before { content: ${stringValue(definition.fontCharacter)}; }`); + } + } + for (const id in usedFontIds) { + const definition = usedFontIds[id]; + const fontWeight = definition.weight ? inline`font-weight: ${identValue(definition.weight)};` : inline``; + const fontStyle = definition.style ? inline`font-style: ${identValue(definition.style)};` : inline``; + const src = new Builder(); + for (const l of definition.src) { + src.push(inline`${asCSSUrl(l.location)} format(${stringValue(l.format)})`); + } + rules.push(inline`@font-face { src: ${src.join(", ")}; font-family: ${stringValue(id)};${fontWeight}${fontStyle} font-display: block; }`); + } + rules.push(inline`:root { ${rootAttribs.join(" ")} }`); + return rules.join("\n"); + } + }; +} +var UnthemedProductIconTheme = class { + getIcon(contribution) { + const iconRegistry2 = getIconRegistry(); + let definition = contribution.defaults; + while (ThemeIcon.isThemeIcon(definition)) { + const c = iconRegistry2.getIcon(definition.id); + if (!c) { + return void 0; + } + definition = c.defaults; + } + return definition; + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/standalone/browser/standaloneThemeService.js +init_window(); +var VS_LIGHT_THEME_NAME = "vs"; +var VS_DARK_THEME_NAME = "vs-dark"; +var HC_BLACK_THEME_NAME = "hc-black"; +var HC_LIGHT_THEME_NAME = "hc-light"; +var colorRegistry2 = Registry.as(Extensions6.ColorContribution); +var themingRegistry2 = Registry.as(Extensions7.ThemingContribution); +var StandaloneTheme = class { + constructor(name, standaloneThemeData) { + this.semanticHighlighting = false; + this.themeData = standaloneThemeData; + const base = standaloneThemeData.base; + if (name.length > 0) { + if (isBuiltinTheme(name)) { + this.id = name; + } else { + this.id = base + " " + name; + } + this.themeName = name; + } else { + this.id = base; + this.themeName = base; + } + this.colors = null; + this.defaultColors = /* @__PURE__ */ Object.create(null); + this._tokenTheme = null; + } + get base() { + return this.themeData.base; + } + notifyBaseUpdated() { + if (this.themeData.inherit) { + this.colors = null; + this._tokenTheme = null; + } + } + getColors() { + if (!this.colors) { + const colors = /* @__PURE__ */ new Map(); + for (const id in this.themeData.colors) { + colors.set(id, Color.fromHex(this.themeData.colors[id])); + } + if (this.themeData.inherit) { + const baseData = getBuiltinRules(this.themeData.base); + for (const id in baseData.colors) { + if (!colors.has(id)) { + colors.set(id, Color.fromHex(baseData.colors[id])); + } + } + } + this.colors = colors; + } + return this.colors; + } + getColor(colorId, useDefault) { + const color = this.getColors().get(colorId); + if (color) { + return color; + } + if (useDefault !== false) { + return this.getDefault(colorId); + } + return void 0; + } + getDefault(colorId) { + let color = this.defaultColors[colorId]; + if (color) { + return color; + } + color = colorRegistry2.resolveDefaultColor(colorId, this); + this.defaultColors[colorId] = color; + return color; + } + defines(colorId) { + return this.getColors().has(colorId); + } + get type() { + switch (this.base) { + case VS_LIGHT_THEME_NAME: + return ColorScheme.LIGHT; + case HC_BLACK_THEME_NAME: + return ColorScheme.HIGH_CONTRAST_DARK; + case HC_LIGHT_THEME_NAME: + return ColorScheme.HIGH_CONTRAST_LIGHT; + default: + return ColorScheme.DARK; + } + } + get tokenTheme() { + if (!this._tokenTheme) { + let rules = []; + let encodedTokensColors = []; + if (this.themeData.inherit) { + const baseData = getBuiltinRules(this.themeData.base); + rules = baseData.rules; + if (baseData.encodedTokensColors) { + encodedTokensColors = baseData.encodedTokensColors; + } + } + const editorForeground2 = this.themeData.colors["editor.foreground"]; + const editorBackground2 = this.themeData.colors["editor.background"]; + if (editorForeground2 || editorBackground2) { + const rule = { token: "" }; + if (editorForeground2) { + rule.foreground = editorForeground2; + } + if (editorBackground2) { + rule.background = editorBackground2; + } + rules.push(rule); + } + rules = rules.concat(this.themeData.rules); + if (this.themeData.encodedTokensColors) { + encodedTokensColors = this.themeData.encodedTokensColors; + } + this._tokenTheme = TokenTheme.createFromRawTokenTheme(rules, encodedTokensColors); + } + return this._tokenTheme; + } + getTokenStyleMetadata(type, modifiers, modelLanguage) { + const style = this.tokenTheme._match([type].concat(modifiers).join(".")); + const metadata = style.metadata; + const foreground2 = TokenMetadata.getForeground(metadata); + const fontStyle = TokenMetadata.getFontStyle(metadata); + return { + foreground: foreground2, + italic: Boolean( + fontStyle & 1 + /* FontStyle.Italic */ + ), + bold: Boolean( + fontStyle & 2 + /* FontStyle.Bold */ + ), + underline: Boolean( + fontStyle & 4 + /* FontStyle.Underline */ + ), + strikethrough: Boolean( + fontStyle & 8 + /* FontStyle.Strikethrough */ + ) + }; + } + get tokenColorMap() { + return []; + } +}; +function isBuiltinTheme(themeName) { + return themeName === VS_LIGHT_THEME_NAME || themeName === VS_DARK_THEME_NAME || themeName === HC_BLACK_THEME_NAME || themeName === HC_LIGHT_THEME_NAME; +} +function getBuiltinRules(builtinTheme) { + switch (builtinTheme) { + case VS_LIGHT_THEME_NAME: + return vs; + case VS_DARK_THEME_NAME: + return vs_dark; + case HC_BLACK_THEME_NAME: + return hc_black; + case HC_LIGHT_THEME_NAME: + return hc_light; + } +} +function newBuiltInTheme(builtinTheme) { + const themeData = getBuiltinRules(builtinTheme); + return new StandaloneTheme(builtinTheme, themeData); +} +var StandaloneThemeService = class extends Disposable { + constructor() { + super(); + this._onColorThemeChange = this._register(new Emitter()); + this.onDidColorThemeChange = this._onColorThemeChange.event; + this._onProductIconThemeChange = this._register(new Emitter()); + this.onDidProductIconThemeChange = this._onProductIconThemeChange.event; + this._environment = /* @__PURE__ */ Object.create(null); + this._builtInProductIconTheme = new UnthemedProductIconTheme(); + this._autoDetectHighContrast = true; + this._knownThemes = /* @__PURE__ */ new Map(); + this._knownThemes.set(VS_LIGHT_THEME_NAME, newBuiltInTheme(VS_LIGHT_THEME_NAME)); + this._knownThemes.set(VS_DARK_THEME_NAME, newBuiltInTheme(VS_DARK_THEME_NAME)); + this._knownThemes.set(HC_BLACK_THEME_NAME, newBuiltInTheme(HC_BLACK_THEME_NAME)); + this._knownThemes.set(HC_LIGHT_THEME_NAME, newBuiltInTheme(HC_LIGHT_THEME_NAME)); + const iconsStyleSheet = this._register(getIconsStyleSheet(this)); + this._codiconCSS = iconsStyleSheet.getCSS(); + this._themeCSS = ""; + this._allCSS = `${this._codiconCSS} +${this._themeCSS}`; + this._globalStyleElement = null; + this._styleElements = []; + this._colorMapOverride = null; + this.setTheme(VS_LIGHT_THEME_NAME); + this._onOSSchemeChanged(); + this._register(iconsStyleSheet.onDidChange(() => { + this._codiconCSS = iconsStyleSheet.getCSS(); + this._updateCSS(); + })); + addMatchMediaChangeListener(mainWindow, "(forced-colors: active)", () => { + this._onOSSchemeChanged(); + }); + } + registerEditorContainer(domNode) { + if (isInShadowDOM(domNode)) { + return this._registerShadowDomContainer(domNode); + } + return this._registerRegularEditorContainer(); + } + _registerRegularEditorContainer() { + if (!this._globalStyleElement) { + this._globalStyleElement = createStyleSheet(void 0, (style) => { + style.className = "monaco-colors"; + style.textContent = this._allCSS; + }); + this._styleElements.push(this._globalStyleElement); + } + return Disposable.None; + } + _registerShadowDomContainer(domNode) { + const styleElement = createStyleSheet(domNode, (style) => { + style.className = "monaco-colors"; + style.textContent = this._allCSS; + }); + this._styleElements.push(styleElement); + return { + dispose: () => { + for (let i2 = 0; i2 < this._styleElements.length; i2++) { + if (this._styleElements[i2] === styleElement) { + this._styleElements.splice(i2, 1); + return; + } + } + } + }; + } + defineTheme(themeName, themeData) { + if (!/^[a-z0-9\-]+$/i.test(themeName)) { + throw new Error("Illegal theme name!"); + } + if (!isBuiltinTheme(themeData.base) && !isBuiltinTheme(themeName)) { + throw new Error("Illegal theme base!"); + } + this._knownThemes.set(themeName, new StandaloneTheme(themeName, themeData)); + if (isBuiltinTheme(themeName)) { + this._knownThemes.forEach((theme) => { + if (theme.base === themeName) { + theme.notifyBaseUpdated(); + } + }); + } + if (this._theme.themeName === themeName) { + this.setTheme(themeName); + } + } + getColorTheme() { + return this._theme; + } + setColorMapOverride(colorMapOverride) { + this._colorMapOverride = colorMapOverride; + this._updateThemeOrColorMap(); + } + setTheme(themeName) { + let theme; + if (this._knownThemes.has(themeName)) { + theme = this._knownThemes.get(themeName); + } else { + theme = this._knownThemes.get(VS_LIGHT_THEME_NAME); + } + this._updateActualTheme(theme); + } + _updateActualTheme(desiredTheme) { + if (!desiredTheme || this._theme === desiredTheme) { + return; + } + this._theme = desiredTheme; + this._updateThemeOrColorMap(); + } + _onOSSchemeChanged() { + if (this._autoDetectHighContrast) { + const wantsHighContrast = mainWindow.matchMedia(`(forced-colors: active)`).matches; + if (wantsHighContrast !== isHighContrast(this._theme.type)) { + let newThemeName; + if (isDark(this._theme.type)) { + newThemeName = wantsHighContrast ? HC_BLACK_THEME_NAME : VS_DARK_THEME_NAME; + } else { + newThemeName = wantsHighContrast ? HC_LIGHT_THEME_NAME : VS_LIGHT_THEME_NAME; + } + this._updateActualTheme(this._knownThemes.get(newThemeName)); + } + } + } + setAutoDetectHighContrast(autoDetectHighContrast) { + this._autoDetectHighContrast = autoDetectHighContrast; + this._onOSSchemeChanged(); + } + _updateThemeOrColorMap() { + const cssRules = []; + const hasRule = {}; + const ruleCollector = { + addRule: (rule) => { + if (!hasRule[rule]) { + cssRules.push(rule); + hasRule[rule] = true; + } + } + }; + themingRegistry2.getThemingParticipants().forEach((p) => p(this._theme, ruleCollector, this._environment)); + const colorVariables = []; + for (const item of colorRegistry2.getColors()) { + const color = this._theme.getColor(item.id, true); + if (color) { + colorVariables.push(`${asCssVariableName(item.id)}: ${color.toString()};`); + } + } + ruleCollector.addRule(`.monaco-editor, .monaco-diff-editor, .monaco-component { ${colorVariables.join("\n")} }`); + const colorMap = this._colorMapOverride || this._theme.tokenTheme.getColorMap(); + ruleCollector.addRule(generateTokensCSSForColorMap(colorMap)); + ruleCollector.addRule(`.monaco-editor, .monaco-diff-editor, .monaco-component { forced-color-adjust: none; }`); + this._themeCSS = cssRules.join("\n"); + this._updateCSS(); + TokenizationRegistry2.setColorMap(colorMap); + this._onColorThemeChange.fire(this._theme); + } + _updateCSS() { + this._allCSS = `${this._codiconCSS} +${this._themeCSS}`; + this._styleElements.forEach((styleElement) => styleElement.textContent = this._allCSS); + } + getFileIconTheme() { + return { + hasFileIcons: false, + hasFolderIcons: false, + hidesExplorerArrows: false + }; + } + getProductIconTheme() { + return this._builtInProductIconTheme; + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/standalone/browser/toggleHighContrast/toggleHighContrast.js +var ToggleHighContrast = class extends EditorAction { + constructor() { + super({ + id: "editor.action.toggleHighContrast", + label: ToggleHighContrastNLS.toggleHighContrast, + alias: "Toggle High Contrast Theme", + precondition: void 0 + }); + this._originalThemeName = null; + } + run(accessor, editor2) { + const standaloneThemeService = accessor.get(IStandaloneThemeService); + const currentTheme = standaloneThemeService.getColorTheme(); + if (isHighContrast(currentTheme.type)) { + standaloneThemeService.setTheme(this._originalThemeName || (isDark(currentTheme.type) ? VS_DARK_THEME_NAME : VS_LIGHT_THEME_NAME)); + this._originalThemeName = null; + } else { + standaloneThemeService.setTheme(isDark(currentTheme.type) ? HC_BLACK_THEME_NAME : HC_LIGHT_THEME_NAME); + this._originalThemeName = currentTheme.themeName; + } + } +}; +registerEditorAction(ToggleHighContrast); + +// node_modules/monaco-editor-core/esm/vs/editor/common/services/editorBaseApi.js +init_cancellation(); +init_event(); +init_keyCodes(); +init_uri(); +init_position(); +init_range(); +init_selection(); +init_languages(); + +// node_modules/monaco-editor-core/esm/vs/editor/common/standalone/standaloneEnums.js +var AccessibilitySupport; +(function(AccessibilitySupport2) { + AccessibilitySupport2[AccessibilitySupport2["Unknown"] = 0] = "Unknown"; + AccessibilitySupport2[AccessibilitySupport2["Disabled"] = 1] = "Disabled"; + AccessibilitySupport2[AccessibilitySupport2["Enabled"] = 2] = "Enabled"; +})(AccessibilitySupport || (AccessibilitySupport = {})); +var CodeActionTriggerType; +(function(CodeActionTriggerType2) { + CodeActionTriggerType2[CodeActionTriggerType2["Invoke"] = 1] = "Invoke"; + CodeActionTriggerType2[CodeActionTriggerType2["Auto"] = 2] = "Auto"; +})(CodeActionTriggerType || (CodeActionTriggerType = {})); +var CompletionItemInsertTextRule; +(function(CompletionItemInsertTextRule2) { + CompletionItemInsertTextRule2[CompletionItemInsertTextRule2["None"] = 0] = "None"; + CompletionItemInsertTextRule2[CompletionItemInsertTextRule2["KeepWhitespace"] = 1] = "KeepWhitespace"; + CompletionItemInsertTextRule2[CompletionItemInsertTextRule2["InsertAsSnippet"] = 4] = "InsertAsSnippet"; +})(CompletionItemInsertTextRule || (CompletionItemInsertTextRule = {})); +var CompletionItemKind; +(function(CompletionItemKind2) { + CompletionItemKind2[CompletionItemKind2["Method"] = 0] = "Method"; + CompletionItemKind2[CompletionItemKind2["Function"] = 1] = "Function"; + CompletionItemKind2[CompletionItemKind2["Constructor"] = 2] = "Constructor"; + CompletionItemKind2[CompletionItemKind2["Field"] = 3] = "Field"; + CompletionItemKind2[CompletionItemKind2["Variable"] = 4] = "Variable"; + CompletionItemKind2[CompletionItemKind2["Class"] = 5] = "Class"; + CompletionItemKind2[CompletionItemKind2["Struct"] = 6] = "Struct"; + CompletionItemKind2[CompletionItemKind2["Interface"] = 7] = "Interface"; + CompletionItemKind2[CompletionItemKind2["Module"] = 8] = "Module"; + CompletionItemKind2[CompletionItemKind2["Property"] = 9] = "Property"; + CompletionItemKind2[CompletionItemKind2["Event"] = 10] = "Event"; + CompletionItemKind2[CompletionItemKind2["Operator"] = 11] = "Operator"; + CompletionItemKind2[CompletionItemKind2["Unit"] = 12] = "Unit"; + CompletionItemKind2[CompletionItemKind2["Value"] = 13] = "Value"; + CompletionItemKind2[CompletionItemKind2["Constant"] = 14] = "Constant"; + CompletionItemKind2[CompletionItemKind2["Enum"] = 15] = "Enum"; + CompletionItemKind2[CompletionItemKind2["EnumMember"] = 16] = "EnumMember"; + CompletionItemKind2[CompletionItemKind2["Keyword"] = 17] = "Keyword"; + CompletionItemKind2[CompletionItemKind2["Text"] = 18] = "Text"; + CompletionItemKind2[CompletionItemKind2["Color"] = 19] = "Color"; + CompletionItemKind2[CompletionItemKind2["File"] = 20] = "File"; + CompletionItemKind2[CompletionItemKind2["Reference"] = 21] = "Reference"; + CompletionItemKind2[CompletionItemKind2["Customcolor"] = 22] = "Customcolor"; + CompletionItemKind2[CompletionItemKind2["Folder"] = 23] = "Folder"; + CompletionItemKind2[CompletionItemKind2["TypeParameter"] = 24] = "TypeParameter"; + CompletionItemKind2[CompletionItemKind2["User"] = 25] = "User"; + CompletionItemKind2[CompletionItemKind2["Issue"] = 26] = "Issue"; + CompletionItemKind2[CompletionItemKind2["Tool"] = 27] = "Tool"; + CompletionItemKind2[CompletionItemKind2["Snippet"] = 28] = "Snippet"; +})(CompletionItemKind || (CompletionItemKind = {})); +var CompletionItemTag; +(function(CompletionItemTag2) { + CompletionItemTag2[CompletionItemTag2["Deprecated"] = 1] = "Deprecated"; +})(CompletionItemTag || (CompletionItemTag = {})); +var CompletionTriggerKind; +(function(CompletionTriggerKind2) { + CompletionTriggerKind2[CompletionTriggerKind2["Invoke"] = 0] = "Invoke"; + CompletionTriggerKind2[CompletionTriggerKind2["TriggerCharacter"] = 1] = "TriggerCharacter"; + CompletionTriggerKind2[CompletionTriggerKind2["TriggerForIncompleteCompletions"] = 2] = "TriggerForIncompleteCompletions"; +})(CompletionTriggerKind || (CompletionTriggerKind = {})); +var ContentWidgetPositionPreference; +(function(ContentWidgetPositionPreference2) { + ContentWidgetPositionPreference2[ContentWidgetPositionPreference2["EXACT"] = 0] = "EXACT"; + ContentWidgetPositionPreference2[ContentWidgetPositionPreference2["ABOVE"] = 1] = "ABOVE"; + ContentWidgetPositionPreference2[ContentWidgetPositionPreference2["BELOW"] = 2] = "BELOW"; +})(ContentWidgetPositionPreference || (ContentWidgetPositionPreference = {})); +var CursorChangeReason; +(function(CursorChangeReason2) { + CursorChangeReason2[CursorChangeReason2["NotSet"] = 0] = "NotSet"; + CursorChangeReason2[CursorChangeReason2["ContentFlush"] = 1] = "ContentFlush"; + CursorChangeReason2[CursorChangeReason2["RecoverFromMarkers"] = 2] = "RecoverFromMarkers"; + CursorChangeReason2[CursorChangeReason2["Explicit"] = 3] = "Explicit"; + CursorChangeReason2[CursorChangeReason2["Paste"] = 4] = "Paste"; + CursorChangeReason2[CursorChangeReason2["Undo"] = 5] = "Undo"; + CursorChangeReason2[CursorChangeReason2["Redo"] = 6] = "Redo"; +})(CursorChangeReason || (CursorChangeReason = {})); +var DefaultEndOfLine; +(function(DefaultEndOfLine2) { + DefaultEndOfLine2[DefaultEndOfLine2["LF"] = 1] = "LF"; + DefaultEndOfLine2[DefaultEndOfLine2["CRLF"] = 2] = "CRLF"; +})(DefaultEndOfLine || (DefaultEndOfLine = {})); +var DocumentHighlightKind2; +(function(DocumentHighlightKind3) { + DocumentHighlightKind3[DocumentHighlightKind3["Text"] = 0] = "Text"; + DocumentHighlightKind3[DocumentHighlightKind3["Read"] = 1] = "Read"; + DocumentHighlightKind3[DocumentHighlightKind3["Write"] = 2] = "Write"; +})(DocumentHighlightKind2 || (DocumentHighlightKind2 = {})); +var EditorAutoIndentStrategy; +(function(EditorAutoIndentStrategy2) { + EditorAutoIndentStrategy2[EditorAutoIndentStrategy2["None"] = 0] = "None"; + EditorAutoIndentStrategy2[EditorAutoIndentStrategy2["Keep"] = 1] = "Keep"; + EditorAutoIndentStrategy2[EditorAutoIndentStrategy2["Brackets"] = 2] = "Brackets"; + EditorAutoIndentStrategy2[EditorAutoIndentStrategy2["Advanced"] = 3] = "Advanced"; + EditorAutoIndentStrategy2[EditorAutoIndentStrategy2["Full"] = 4] = "Full"; +})(EditorAutoIndentStrategy || (EditorAutoIndentStrategy = {})); +var EditorOption; +(function(EditorOption2) { + EditorOption2[EditorOption2["acceptSuggestionOnCommitCharacter"] = 0] = "acceptSuggestionOnCommitCharacter"; + EditorOption2[EditorOption2["acceptSuggestionOnEnter"] = 1] = "acceptSuggestionOnEnter"; + EditorOption2[EditorOption2["accessibilitySupport"] = 2] = "accessibilitySupport"; + EditorOption2[EditorOption2["accessibilityPageSize"] = 3] = "accessibilityPageSize"; + EditorOption2[EditorOption2["allowOverflow"] = 4] = "allowOverflow"; + EditorOption2[EditorOption2["allowVariableLineHeights"] = 5] = "allowVariableLineHeights"; + EditorOption2[EditorOption2["allowVariableFonts"] = 6] = "allowVariableFonts"; + EditorOption2[EditorOption2["allowVariableFontsInAccessibilityMode"] = 7] = "allowVariableFontsInAccessibilityMode"; + EditorOption2[EditorOption2["ariaLabel"] = 8] = "ariaLabel"; + EditorOption2[EditorOption2["ariaRequired"] = 9] = "ariaRequired"; + EditorOption2[EditorOption2["autoClosingBrackets"] = 10] = "autoClosingBrackets"; + EditorOption2[EditorOption2["autoClosingComments"] = 11] = "autoClosingComments"; + EditorOption2[EditorOption2["screenReaderAnnounceInlineSuggestion"] = 12] = "screenReaderAnnounceInlineSuggestion"; + EditorOption2[EditorOption2["autoClosingDelete"] = 13] = "autoClosingDelete"; + EditorOption2[EditorOption2["autoClosingOvertype"] = 14] = "autoClosingOvertype"; + EditorOption2[EditorOption2["autoClosingQuotes"] = 15] = "autoClosingQuotes"; + EditorOption2[EditorOption2["autoIndent"] = 16] = "autoIndent"; + EditorOption2[EditorOption2["autoIndentOnPaste"] = 17] = "autoIndentOnPaste"; + EditorOption2[EditorOption2["autoIndentOnPasteWithinString"] = 18] = "autoIndentOnPasteWithinString"; + EditorOption2[EditorOption2["automaticLayout"] = 19] = "automaticLayout"; + EditorOption2[EditorOption2["autoSurround"] = 20] = "autoSurround"; + EditorOption2[EditorOption2["bracketPairColorization"] = 21] = "bracketPairColorization"; + EditorOption2[EditorOption2["guides"] = 22] = "guides"; + EditorOption2[EditorOption2["codeLens"] = 23] = "codeLens"; + EditorOption2[EditorOption2["codeLensFontFamily"] = 24] = "codeLensFontFamily"; + EditorOption2[EditorOption2["codeLensFontSize"] = 25] = "codeLensFontSize"; + EditorOption2[EditorOption2["colorDecorators"] = 26] = "colorDecorators"; + EditorOption2[EditorOption2["colorDecoratorsLimit"] = 27] = "colorDecoratorsLimit"; + EditorOption2[EditorOption2["columnSelection"] = 28] = "columnSelection"; + EditorOption2[EditorOption2["comments"] = 29] = "comments"; + EditorOption2[EditorOption2["contextmenu"] = 30] = "contextmenu"; + EditorOption2[EditorOption2["copyWithSyntaxHighlighting"] = 31] = "copyWithSyntaxHighlighting"; + EditorOption2[EditorOption2["cursorBlinking"] = 32] = "cursorBlinking"; + EditorOption2[EditorOption2["cursorSmoothCaretAnimation"] = 33] = "cursorSmoothCaretAnimation"; + EditorOption2[EditorOption2["cursorStyle"] = 34] = "cursorStyle"; + EditorOption2[EditorOption2["cursorSurroundingLines"] = 35] = "cursorSurroundingLines"; + EditorOption2[EditorOption2["cursorSurroundingLinesStyle"] = 36] = "cursorSurroundingLinesStyle"; + EditorOption2[EditorOption2["cursorWidth"] = 37] = "cursorWidth"; + EditorOption2[EditorOption2["cursorHeight"] = 38] = "cursorHeight"; + EditorOption2[EditorOption2["disableLayerHinting"] = 39] = "disableLayerHinting"; + EditorOption2[EditorOption2["disableMonospaceOptimizations"] = 40] = "disableMonospaceOptimizations"; + EditorOption2[EditorOption2["domReadOnly"] = 41] = "domReadOnly"; + EditorOption2[EditorOption2["dragAndDrop"] = 42] = "dragAndDrop"; + EditorOption2[EditorOption2["dropIntoEditor"] = 43] = "dropIntoEditor"; + EditorOption2[EditorOption2["editContext"] = 44] = "editContext"; + EditorOption2[EditorOption2["emptySelectionClipboard"] = 45] = "emptySelectionClipboard"; + EditorOption2[EditorOption2["experimentalGpuAcceleration"] = 46] = "experimentalGpuAcceleration"; + EditorOption2[EditorOption2["experimentalWhitespaceRendering"] = 47] = "experimentalWhitespaceRendering"; + EditorOption2[EditorOption2["extraEditorClassName"] = 48] = "extraEditorClassName"; + EditorOption2[EditorOption2["fastScrollSensitivity"] = 49] = "fastScrollSensitivity"; + EditorOption2[EditorOption2["find"] = 50] = "find"; + EditorOption2[EditorOption2["fixedOverflowWidgets"] = 51] = "fixedOverflowWidgets"; + EditorOption2[EditorOption2["folding"] = 52] = "folding"; + EditorOption2[EditorOption2["foldingStrategy"] = 53] = "foldingStrategy"; + EditorOption2[EditorOption2["foldingHighlight"] = 54] = "foldingHighlight"; + EditorOption2[EditorOption2["foldingImportsByDefault"] = 55] = "foldingImportsByDefault"; + EditorOption2[EditorOption2["foldingMaximumRegions"] = 56] = "foldingMaximumRegions"; + EditorOption2[EditorOption2["unfoldOnClickAfterEndOfLine"] = 57] = "unfoldOnClickAfterEndOfLine"; + EditorOption2[EditorOption2["fontFamily"] = 58] = "fontFamily"; + EditorOption2[EditorOption2["fontInfo"] = 59] = "fontInfo"; + EditorOption2[EditorOption2["fontLigatures"] = 60] = "fontLigatures"; + EditorOption2[EditorOption2["fontSize"] = 61] = "fontSize"; + EditorOption2[EditorOption2["fontWeight"] = 62] = "fontWeight"; + EditorOption2[EditorOption2["fontVariations"] = 63] = "fontVariations"; + EditorOption2[EditorOption2["formatOnPaste"] = 64] = "formatOnPaste"; + EditorOption2[EditorOption2["formatOnType"] = 65] = "formatOnType"; + EditorOption2[EditorOption2["glyphMargin"] = 66] = "glyphMargin"; + EditorOption2[EditorOption2["gotoLocation"] = 67] = "gotoLocation"; + EditorOption2[EditorOption2["hideCursorInOverviewRuler"] = 68] = "hideCursorInOverviewRuler"; + EditorOption2[EditorOption2["hover"] = 69] = "hover"; + EditorOption2[EditorOption2["inDiffEditor"] = 70] = "inDiffEditor"; + EditorOption2[EditorOption2["inlineSuggest"] = 71] = "inlineSuggest"; + EditorOption2[EditorOption2["letterSpacing"] = 72] = "letterSpacing"; + EditorOption2[EditorOption2["lightbulb"] = 73] = "lightbulb"; + EditorOption2[EditorOption2["lineDecorationsWidth"] = 74] = "lineDecorationsWidth"; + EditorOption2[EditorOption2["lineHeight"] = 75] = "lineHeight"; + EditorOption2[EditorOption2["lineNumbers"] = 76] = "lineNumbers"; + EditorOption2[EditorOption2["lineNumbersMinChars"] = 77] = "lineNumbersMinChars"; + EditorOption2[EditorOption2["linkedEditing"] = 78] = "linkedEditing"; + EditorOption2[EditorOption2["links"] = 79] = "links"; + EditorOption2[EditorOption2["matchBrackets"] = 80] = "matchBrackets"; + EditorOption2[EditorOption2["minimap"] = 81] = "minimap"; + EditorOption2[EditorOption2["mouseStyle"] = 82] = "mouseStyle"; + EditorOption2[EditorOption2["mouseWheelScrollSensitivity"] = 83] = "mouseWheelScrollSensitivity"; + EditorOption2[EditorOption2["mouseWheelZoom"] = 84] = "mouseWheelZoom"; + EditorOption2[EditorOption2["multiCursorMergeOverlapping"] = 85] = "multiCursorMergeOverlapping"; + EditorOption2[EditorOption2["multiCursorModifier"] = 86] = "multiCursorModifier"; + EditorOption2[EditorOption2["mouseMiddleClickAction"] = 87] = "mouseMiddleClickAction"; + EditorOption2[EditorOption2["multiCursorPaste"] = 88] = "multiCursorPaste"; + EditorOption2[EditorOption2["multiCursorLimit"] = 89] = "multiCursorLimit"; + EditorOption2[EditorOption2["occurrencesHighlight"] = 90] = "occurrencesHighlight"; + EditorOption2[EditorOption2["occurrencesHighlightDelay"] = 91] = "occurrencesHighlightDelay"; + EditorOption2[EditorOption2["overtypeCursorStyle"] = 92] = "overtypeCursorStyle"; + EditorOption2[EditorOption2["overtypeOnPaste"] = 93] = "overtypeOnPaste"; + EditorOption2[EditorOption2["overviewRulerBorder"] = 94] = "overviewRulerBorder"; + EditorOption2[EditorOption2["overviewRulerLanes"] = 95] = "overviewRulerLanes"; + EditorOption2[EditorOption2["padding"] = 96] = "padding"; + EditorOption2[EditorOption2["pasteAs"] = 97] = "pasteAs"; + EditorOption2[EditorOption2["parameterHints"] = 98] = "parameterHints"; + EditorOption2[EditorOption2["peekWidgetDefaultFocus"] = 99] = "peekWidgetDefaultFocus"; + EditorOption2[EditorOption2["placeholder"] = 100] = "placeholder"; + EditorOption2[EditorOption2["definitionLinkOpensInPeek"] = 101] = "definitionLinkOpensInPeek"; + EditorOption2[EditorOption2["quickSuggestions"] = 102] = "quickSuggestions"; + EditorOption2[EditorOption2["quickSuggestionsDelay"] = 103] = "quickSuggestionsDelay"; + EditorOption2[EditorOption2["readOnly"] = 104] = "readOnly"; + EditorOption2[EditorOption2["readOnlyMessage"] = 105] = "readOnlyMessage"; + EditorOption2[EditorOption2["renameOnType"] = 106] = "renameOnType"; + EditorOption2[EditorOption2["renderRichScreenReaderContent"] = 107] = "renderRichScreenReaderContent"; + EditorOption2[EditorOption2["renderControlCharacters"] = 108] = "renderControlCharacters"; + EditorOption2[EditorOption2["renderFinalNewline"] = 109] = "renderFinalNewline"; + EditorOption2[EditorOption2["renderLineHighlight"] = 110] = "renderLineHighlight"; + EditorOption2[EditorOption2["renderLineHighlightOnlyWhenFocus"] = 111] = "renderLineHighlightOnlyWhenFocus"; + EditorOption2[EditorOption2["renderValidationDecorations"] = 112] = "renderValidationDecorations"; + EditorOption2[EditorOption2["renderWhitespace"] = 113] = "renderWhitespace"; + EditorOption2[EditorOption2["revealHorizontalRightPadding"] = 114] = "revealHorizontalRightPadding"; + EditorOption2[EditorOption2["roundedSelection"] = 115] = "roundedSelection"; + EditorOption2[EditorOption2["rulers"] = 116] = "rulers"; + EditorOption2[EditorOption2["scrollbar"] = 117] = "scrollbar"; + EditorOption2[EditorOption2["scrollBeyondLastColumn"] = 118] = "scrollBeyondLastColumn"; + EditorOption2[EditorOption2["scrollBeyondLastLine"] = 119] = "scrollBeyondLastLine"; + EditorOption2[EditorOption2["scrollPredominantAxis"] = 120] = "scrollPredominantAxis"; + EditorOption2[EditorOption2["selectionClipboard"] = 121] = "selectionClipboard"; + EditorOption2[EditorOption2["selectionHighlight"] = 122] = "selectionHighlight"; + EditorOption2[EditorOption2["selectionHighlightMaxLength"] = 123] = "selectionHighlightMaxLength"; + EditorOption2[EditorOption2["selectionHighlightMultiline"] = 124] = "selectionHighlightMultiline"; + EditorOption2[EditorOption2["selectOnLineNumbers"] = 125] = "selectOnLineNumbers"; + EditorOption2[EditorOption2["showFoldingControls"] = 126] = "showFoldingControls"; + EditorOption2[EditorOption2["showUnused"] = 127] = "showUnused"; + EditorOption2[EditorOption2["snippetSuggestions"] = 128] = "snippetSuggestions"; + EditorOption2[EditorOption2["smartSelect"] = 129] = "smartSelect"; + EditorOption2[EditorOption2["smoothScrolling"] = 130] = "smoothScrolling"; + EditorOption2[EditorOption2["stickyScroll"] = 131] = "stickyScroll"; + EditorOption2[EditorOption2["stickyTabStops"] = 132] = "stickyTabStops"; + EditorOption2[EditorOption2["stopRenderingLineAfter"] = 133] = "stopRenderingLineAfter"; + EditorOption2[EditorOption2["suggest"] = 134] = "suggest"; + EditorOption2[EditorOption2["suggestFontSize"] = 135] = "suggestFontSize"; + EditorOption2[EditorOption2["suggestLineHeight"] = 136] = "suggestLineHeight"; + EditorOption2[EditorOption2["suggestOnTriggerCharacters"] = 137] = "suggestOnTriggerCharacters"; + EditorOption2[EditorOption2["suggestSelection"] = 138] = "suggestSelection"; + EditorOption2[EditorOption2["tabCompletion"] = 139] = "tabCompletion"; + EditorOption2[EditorOption2["tabIndex"] = 140] = "tabIndex"; + EditorOption2[EditorOption2["trimWhitespaceOnDelete"] = 141] = "trimWhitespaceOnDelete"; + EditorOption2[EditorOption2["unicodeHighlighting"] = 142] = "unicodeHighlighting"; + EditorOption2[EditorOption2["unusualLineTerminators"] = 143] = "unusualLineTerminators"; + EditorOption2[EditorOption2["useShadowDOM"] = 144] = "useShadowDOM"; + EditorOption2[EditorOption2["useTabStops"] = 145] = "useTabStops"; + EditorOption2[EditorOption2["wordBreak"] = 146] = "wordBreak"; + EditorOption2[EditorOption2["wordSegmenterLocales"] = 147] = "wordSegmenterLocales"; + EditorOption2[EditorOption2["wordSeparators"] = 148] = "wordSeparators"; + EditorOption2[EditorOption2["wordWrap"] = 149] = "wordWrap"; + EditorOption2[EditorOption2["wordWrapBreakAfterCharacters"] = 150] = "wordWrapBreakAfterCharacters"; + EditorOption2[EditorOption2["wordWrapBreakBeforeCharacters"] = 151] = "wordWrapBreakBeforeCharacters"; + EditorOption2[EditorOption2["wordWrapColumn"] = 152] = "wordWrapColumn"; + EditorOption2[EditorOption2["wordWrapOverride1"] = 153] = "wordWrapOverride1"; + EditorOption2[EditorOption2["wordWrapOverride2"] = 154] = "wordWrapOverride2"; + EditorOption2[EditorOption2["wrappingIndent"] = 155] = "wrappingIndent"; + EditorOption2[EditorOption2["wrappingStrategy"] = 156] = "wrappingStrategy"; + EditorOption2[EditorOption2["showDeprecated"] = 157] = "showDeprecated"; + EditorOption2[EditorOption2["inertialScroll"] = 158] = "inertialScroll"; + EditorOption2[EditorOption2["inlayHints"] = 159] = "inlayHints"; + EditorOption2[EditorOption2["wrapOnEscapedLineFeeds"] = 160] = "wrapOnEscapedLineFeeds"; + EditorOption2[EditorOption2["effectiveCursorStyle"] = 161] = "effectiveCursorStyle"; + EditorOption2[EditorOption2["editorClassName"] = 162] = "editorClassName"; + EditorOption2[EditorOption2["pixelRatio"] = 163] = "pixelRatio"; + EditorOption2[EditorOption2["tabFocusMode"] = 164] = "tabFocusMode"; + EditorOption2[EditorOption2["layoutInfo"] = 165] = "layoutInfo"; + EditorOption2[EditorOption2["wrappingInfo"] = 166] = "wrappingInfo"; + EditorOption2[EditorOption2["defaultColorDecorators"] = 167] = "defaultColorDecorators"; + EditorOption2[EditorOption2["colorDecoratorsActivatedOn"] = 168] = "colorDecoratorsActivatedOn"; + EditorOption2[EditorOption2["inlineCompletionsAccessibilityVerbose"] = 169] = "inlineCompletionsAccessibilityVerbose"; + EditorOption2[EditorOption2["effectiveEditContext"] = 170] = "effectiveEditContext"; + EditorOption2[EditorOption2["scrollOnMiddleClick"] = 171] = "scrollOnMiddleClick"; + EditorOption2[EditorOption2["effectiveAllowVariableFonts"] = 172] = "effectiveAllowVariableFonts"; +})(EditorOption || (EditorOption = {})); +var EndOfLinePreference; +(function(EndOfLinePreference2) { + EndOfLinePreference2[EndOfLinePreference2["TextDefined"] = 0] = "TextDefined"; + EndOfLinePreference2[EndOfLinePreference2["LF"] = 1] = "LF"; + EndOfLinePreference2[EndOfLinePreference2["CRLF"] = 2] = "CRLF"; +})(EndOfLinePreference || (EndOfLinePreference = {})); +var EndOfLineSequence; +(function(EndOfLineSequence2) { + EndOfLineSequence2[EndOfLineSequence2["LF"] = 0] = "LF"; + EndOfLineSequence2[EndOfLineSequence2["CRLF"] = 1] = "CRLF"; +})(EndOfLineSequence || (EndOfLineSequence = {})); +var GlyphMarginLane2; +(function(GlyphMarginLane3) { + GlyphMarginLane3[GlyphMarginLane3["Left"] = 1] = "Left"; + GlyphMarginLane3[GlyphMarginLane3["Center"] = 2] = "Center"; + GlyphMarginLane3[GlyphMarginLane3["Right"] = 3] = "Right"; +})(GlyphMarginLane2 || (GlyphMarginLane2 = {})); +var HoverVerbosityAction2; +(function(HoverVerbosityAction3) { + HoverVerbosityAction3[HoverVerbosityAction3["Increase"] = 0] = "Increase"; + HoverVerbosityAction3[HoverVerbosityAction3["Decrease"] = 1] = "Decrease"; +})(HoverVerbosityAction2 || (HoverVerbosityAction2 = {})); +var IndentAction2; +(function(IndentAction3) { + IndentAction3[IndentAction3["None"] = 0] = "None"; + IndentAction3[IndentAction3["Indent"] = 1] = "Indent"; + IndentAction3[IndentAction3["IndentOutdent"] = 2] = "IndentOutdent"; + IndentAction3[IndentAction3["Outdent"] = 3] = "Outdent"; +})(IndentAction2 || (IndentAction2 = {})); +var InjectedTextCursorStops2; +(function(InjectedTextCursorStops3) { + InjectedTextCursorStops3[InjectedTextCursorStops3["Both"] = 0] = "Both"; + InjectedTextCursorStops3[InjectedTextCursorStops3["Right"] = 1] = "Right"; + InjectedTextCursorStops3[InjectedTextCursorStops3["Left"] = 2] = "Left"; + InjectedTextCursorStops3[InjectedTextCursorStops3["None"] = 3] = "None"; +})(InjectedTextCursorStops2 || (InjectedTextCursorStops2 = {})); +var InlayHintKind2; +(function(InlayHintKind3) { + InlayHintKind3[InlayHintKind3["Type"] = 1] = "Type"; + InlayHintKind3[InlayHintKind3["Parameter"] = 2] = "Parameter"; +})(InlayHintKind2 || (InlayHintKind2 = {})); +var InlineCompletionEndOfLifeReasonKind2; +(function(InlineCompletionEndOfLifeReasonKind3) { + InlineCompletionEndOfLifeReasonKind3[InlineCompletionEndOfLifeReasonKind3["Accepted"] = 0] = "Accepted"; + InlineCompletionEndOfLifeReasonKind3[InlineCompletionEndOfLifeReasonKind3["Rejected"] = 1] = "Rejected"; + InlineCompletionEndOfLifeReasonKind3[InlineCompletionEndOfLifeReasonKind3["Ignored"] = 2] = "Ignored"; +})(InlineCompletionEndOfLifeReasonKind2 || (InlineCompletionEndOfLifeReasonKind2 = {})); +var InlineCompletionHintStyle2; +(function(InlineCompletionHintStyle3) { + InlineCompletionHintStyle3[InlineCompletionHintStyle3["Code"] = 1] = "Code"; + InlineCompletionHintStyle3[InlineCompletionHintStyle3["Label"] = 2] = "Label"; +})(InlineCompletionHintStyle2 || (InlineCompletionHintStyle2 = {})); +var InlineCompletionTriggerKind2; +(function(InlineCompletionTriggerKind3) { + InlineCompletionTriggerKind3[InlineCompletionTriggerKind3["Automatic"] = 0] = "Automatic"; + InlineCompletionTriggerKind3[InlineCompletionTriggerKind3["Explicit"] = 1] = "Explicit"; +})(InlineCompletionTriggerKind2 || (InlineCompletionTriggerKind2 = {})); +var KeyCode; +(function(KeyCode3) { + KeyCode3[KeyCode3["DependsOnKbLayout"] = -1] = "DependsOnKbLayout"; + KeyCode3[KeyCode3["Unknown"] = 0] = "Unknown"; + KeyCode3[KeyCode3["Backspace"] = 1] = "Backspace"; + KeyCode3[KeyCode3["Tab"] = 2] = "Tab"; + KeyCode3[KeyCode3["Enter"] = 3] = "Enter"; + KeyCode3[KeyCode3["Shift"] = 4] = "Shift"; + KeyCode3[KeyCode3["Ctrl"] = 5] = "Ctrl"; + KeyCode3[KeyCode3["Alt"] = 6] = "Alt"; + KeyCode3[KeyCode3["PauseBreak"] = 7] = "PauseBreak"; + KeyCode3[KeyCode3["CapsLock"] = 8] = "CapsLock"; + KeyCode3[KeyCode3["Escape"] = 9] = "Escape"; + KeyCode3[KeyCode3["Space"] = 10] = "Space"; + KeyCode3[KeyCode3["PageUp"] = 11] = "PageUp"; + KeyCode3[KeyCode3["PageDown"] = 12] = "PageDown"; + KeyCode3[KeyCode3["End"] = 13] = "End"; + KeyCode3[KeyCode3["Home"] = 14] = "Home"; + KeyCode3[KeyCode3["LeftArrow"] = 15] = "LeftArrow"; + KeyCode3[KeyCode3["UpArrow"] = 16] = "UpArrow"; + KeyCode3[KeyCode3["RightArrow"] = 17] = "RightArrow"; + KeyCode3[KeyCode3["DownArrow"] = 18] = "DownArrow"; + KeyCode3[KeyCode3["Insert"] = 19] = "Insert"; + KeyCode3[KeyCode3["Delete"] = 20] = "Delete"; + KeyCode3[KeyCode3["Digit0"] = 21] = "Digit0"; + KeyCode3[KeyCode3["Digit1"] = 22] = "Digit1"; + KeyCode3[KeyCode3["Digit2"] = 23] = "Digit2"; + KeyCode3[KeyCode3["Digit3"] = 24] = "Digit3"; + KeyCode3[KeyCode3["Digit4"] = 25] = "Digit4"; + KeyCode3[KeyCode3["Digit5"] = 26] = "Digit5"; + KeyCode3[KeyCode3["Digit6"] = 27] = "Digit6"; + KeyCode3[KeyCode3["Digit7"] = 28] = "Digit7"; + KeyCode3[KeyCode3["Digit8"] = 29] = "Digit8"; + KeyCode3[KeyCode3["Digit9"] = 30] = "Digit9"; + KeyCode3[KeyCode3["KeyA"] = 31] = "KeyA"; + KeyCode3[KeyCode3["KeyB"] = 32] = "KeyB"; + KeyCode3[KeyCode3["KeyC"] = 33] = "KeyC"; + KeyCode3[KeyCode3["KeyD"] = 34] = "KeyD"; + KeyCode3[KeyCode3["KeyE"] = 35] = "KeyE"; + KeyCode3[KeyCode3["KeyF"] = 36] = "KeyF"; + KeyCode3[KeyCode3["KeyG"] = 37] = "KeyG"; + KeyCode3[KeyCode3["KeyH"] = 38] = "KeyH"; + KeyCode3[KeyCode3["KeyI"] = 39] = "KeyI"; + KeyCode3[KeyCode3["KeyJ"] = 40] = "KeyJ"; + KeyCode3[KeyCode3["KeyK"] = 41] = "KeyK"; + KeyCode3[KeyCode3["KeyL"] = 42] = "KeyL"; + KeyCode3[KeyCode3["KeyM"] = 43] = "KeyM"; + KeyCode3[KeyCode3["KeyN"] = 44] = "KeyN"; + KeyCode3[KeyCode3["KeyO"] = 45] = "KeyO"; + KeyCode3[KeyCode3["KeyP"] = 46] = "KeyP"; + KeyCode3[KeyCode3["KeyQ"] = 47] = "KeyQ"; + KeyCode3[KeyCode3["KeyR"] = 48] = "KeyR"; + KeyCode3[KeyCode3["KeyS"] = 49] = "KeyS"; + KeyCode3[KeyCode3["KeyT"] = 50] = "KeyT"; + KeyCode3[KeyCode3["KeyU"] = 51] = "KeyU"; + KeyCode3[KeyCode3["KeyV"] = 52] = "KeyV"; + KeyCode3[KeyCode3["KeyW"] = 53] = "KeyW"; + KeyCode3[KeyCode3["KeyX"] = 54] = "KeyX"; + KeyCode3[KeyCode3["KeyY"] = 55] = "KeyY"; + KeyCode3[KeyCode3["KeyZ"] = 56] = "KeyZ"; + KeyCode3[KeyCode3["Meta"] = 57] = "Meta"; + KeyCode3[KeyCode3["ContextMenu"] = 58] = "ContextMenu"; + KeyCode3[KeyCode3["F1"] = 59] = "F1"; + KeyCode3[KeyCode3["F2"] = 60] = "F2"; + KeyCode3[KeyCode3["F3"] = 61] = "F3"; + KeyCode3[KeyCode3["F4"] = 62] = "F4"; + KeyCode3[KeyCode3["F5"] = 63] = "F5"; + KeyCode3[KeyCode3["F6"] = 64] = "F6"; + KeyCode3[KeyCode3["F7"] = 65] = "F7"; + KeyCode3[KeyCode3["F8"] = 66] = "F8"; + KeyCode3[KeyCode3["F9"] = 67] = "F9"; + KeyCode3[KeyCode3["F10"] = 68] = "F10"; + KeyCode3[KeyCode3["F11"] = 69] = "F11"; + KeyCode3[KeyCode3["F12"] = 70] = "F12"; + KeyCode3[KeyCode3["F13"] = 71] = "F13"; + KeyCode3[KeyCode3["F14"] = 72] = "F14"; + KeyCode3[KeyCode3["F15"] = 73] = "F15"; + KeyCode3[KeyCode3["F16"] = 74] = "F16"; + KeyCode3[KeyCode3["F17"] = 75] = "F17"; + KeyCode3[KeyCode3["F18"] = 76] = "F18"; + KeyCode3[KeyCode3["F19"] = 77] = "F19"; + KeyCode3[KeyCode3["F20"] = 78] = "F20"; + KeyCode3[KeyCode3["F21"] = 79] = "F21"; + KeyCode3[KeyCode3["F22"] = 80] = "F22"; + KeyCode3[KeyCode3["F23"] = 81] = "F23"; + KeyCode3[KeyCode3["F24"] = 82] = "F24"; + KeyCode3[KeyCode3["NumLock"] = 83] = "NumLock"; + KeyCode3[KeyCode3["ScrollLock"] = 84] = "ScrollLock"; + KeyCode3[KeyCode3["Semicolon"] = 85] = "Semicolon"; + KeyCode3[KeyCode3["Equal"] = 86] = "Equal"; + KeyCode3[KeyCode3["Comma"] = 87] = "Comma"; + KeyCode3[KeyCode3["Minus"] = 88] = "Minus"; + KeyCode3[KeyCode3["Period"] = 89] = "Period"; + KeyCode3[KeyCode3["Slash"] = 90] = "Slash"; + KeyCode3[KeyCode3["Backquote"] = 91] = "Backquote"; + KeyCode3[KeyCode3["BracketLeft"] = 92] = "BracketLeft"; + KeyCode3[KeyCode3["Backslash"] = 93] = "Backslash"; + KeyCode3[KeyCode3["BracketRight"] = 94] = "BracketRight"; + KeyCode3[KeyCode3["Quote"] = 95] = "Quote"; + KeyCode3[KeyCode3["OEM_8"] = 96] = "OEM_8"; + KeyCode3[KeyCode3["IntlBackslash"] = 97] = "IntlBackslash"; + KeyCode3[KeyCode3["Numpad0"] = 98] = "Numpad0"; + KeyCode3[KeyCode3["Numpad1"] = 99] = "Numpad1"; + KeyCode3[KeyCode3["Numpad2"] = 100] = "Numpad2"; + KeyCode3[KeyCode3["Numpad3"] = 101] = "Numpad3"; + KeyCode3[KeyCode3["Numpad4"] = 102] = "Numpad4"; + KeyCode3[KeyCode3["Numpad5"] = 103] = "Numpad5"; + KeyCode3[KeyCode3["Numpad6"] = 104] = "Numpad6"; + KeyCode3[KeyCode3["Numpad7"] = 105] = "Numpad7"; + KeyCode3[KeyCode3["Numpad8"] = 106] = "Numpad8"; + KeyCode3[KeyCode3["Numpad9"] = 107] = "Numpad9"; + KeyCode3[KeyCode3["NumpadMultiply"] = 108] = "NumpadMultiply"; + KeyCode3[KeyCode3["NumpadAdd"] = 109] = "NumpadAdd"; + KeyCode3[KeyCode3["NUMPAD_SEPARATOR"] = 110] = "NUMPAD_SEPARATOR"; + KeyCode3[KeyCode3["NumpadSubtract"] = 111] = "NumpadSubtract"; + KeyCode3[KeyCode3["NumpadDecimal"] = 112] = "NumpadDecimal"; + KeyCode3[KeyCode3["NumpadDivide"] = 113] = "NumpadDivide"; + KeyCode3[KeyCode3["KEY_IN_COMPOSITION"] = 114] = "KEY_IN_COMPOSITION"; + KeyCode3[KeyCode3["ABNT_C1"] = 115] = "ABNT_C1"; + KeyCode3[KeyCode3["ABNT_C2"] = 116] = "ABNT_C2"; + KeyCode3[KeyCode3["AudioVolumeMute"] = 117] = "AudioVolumeMute"; + KeyCode3[KeyCode3["AudioVolumeUp"] = 118] = "AudioVolumeUp"; + KeyCode3[KeyCode3["AudioVolumeDown"] = 119] = "AudioVolumeDown"; + KeyCode3[KeyCode3["BrowserSearch"] = 120] = "BrowserSearch"; + KeyCode3[KeyCode3["BrowserHome"] = 121] = "BrowserHome"; + KeyCode3[KeyCode3["BrowserBack"] = 122] = "BrowserBack"; + KeyCode3[KeyCode3["BrowserForward"] = 123] = "BrowserForward"; + KeyCode3[KeyCode3["MediaTrackNext"] = 124] = "MediaTrackNext"; + KeyCode3[KeyCode3["MediaTrackPrevious"] = 125] = "MediaTrackPrevious"; + KeyCode3[KeyCode3["MediaStop"] = 126] = "MediaStop"; + KeyCode3[KeyCode3["MediaPlayPause"] = 127] = "MediaPlayPause"; + KeyCode3[KeyCode3["LaunchMediaPlayer"] = 128] = "LaunchMediaPlayer"; + KeyCode3[KeyCode3["LaunchMail"] = 129] = "LaunchMail"; + KeyCode3[KeyCode3["LaunchApp2"] = 130] = "LaunchApp2"; + KeyCode3[KeyCode3["Clear"] = 131] = "Clear"; + KeyCode3[KeyCode3["MAX_VALUE"] = 132] = "MAX_VALUE"; +})(KeyCode || (KeyCode = {})); +var MarkerSeverity2; +(function(MarkerSeverity4) { + MarkerSeverity4[MarkerSeverity4["Hint"] = 1] = "Hint"; + MarkerSeverity4[MarkerSeverity4["Info"] = 2] = "Info"; + MarkerSeverity4[MarkerSeverity4["Warning"] = 4] = "Warning"; + MarkerSeverity4[MarkerSeverity4["Error"] = 8] = "Error"; +})(MarkerSeverity2 || (MarkerSeverity2 = {})); +var MarkerTag; +(function(MarkerTag3) { + MarkerTag3[MarkerTag3["Unnecessary"] = 1] = "Unnecessary"; + MarkerTag3[MarkerTag3["Deprecated"] = 2] = "Deprecated"; +})(MarkerTag || (MarkerTag = {})); +var MinimapPosition; +(function(MinimapPosition2) { + MinimapPosition2[MinimapPosition2["Inline"] = 1] = "Inline"; + MinimapPosition2[MinimapPosition2["Gutter"] = 2] = "Gutter"; +})(MinimapPosition || (MinimapPosition = {})); +var MinimapSectionHeaderStyle; +(function(MinimapSectionHeaderStyle2) { + MinimapSectionHeaderStyle2[MinimapSectionHeaderStyle2["Normal"] = 1] = "Normal"; + MinimapSectionHeaderStyle2[MinimapSectionHeaderStyle2["Underlined"] = 2] = "Underlined"; +})(MinimapSectionHeaderStyle || (MinimapSectionHeaderStyle = {})); +var MouseTargetType; +(function(MouseTargetType2) { + MouseTargetType2[MouseTargetType2["UNKNOWN"] = 0] = "UNKNOWN"; + MouseTargetType2[MouseTargetType2["TEXTAREA"] = 1] = "TEXTAREA"; + MouseTargetType2[MouseTargetType2["GUTTER_GLYPH_MARGIN"] = 2] = "GUTTER_GLYPH_MARGIN"; + MouseTargetType2[MouseTargetType2["GUTTER_LINE_NUMBERS"] = 3] = "GUTTER_LINE_NUMBERS"; + MouseTargetType2[MouseTargetType2["GUTTER_LINE_DECORATIONS"] = 4] = "GUTTER_LINE_DECORATIONS"; + MouseTargetType2[MouseTargetType2["GUTTER_VIEW_ZONE"] = 5] = "GUTTER_VIEW_ZONE"; + MouseTargetType2[MouseTargetType2["CONTENT_TEXT"] = 6] = "CONTENT_TEXT"; + MouseTargetType2[MouseTargetType2["CONTENT_EMPTY"] = 7] = "CONTENT_EMPTY"; + MouseTargetType2[MouseTargetType2["CONTENT_VIEW_ZONE"] = 8] = "CONTENT_VIEW_ZONE"; + MouseTargetType2[MouseTargetType2["CONTENT_WIDGET"] = 9] = "CONTENT_WIDGET"; + MouseTargetType2[MouseTargetType2["OVERVIEW_RULER"] = 10] = "OVERVIEW_RULER"; + MouseTargetType2[MouseTargetType2["SCROLLBAR"] = 11] = "SCROLLBAR"; + MouseTargetType2[MouseTargetType2["OVERLAY_WIDGET"] = 12] = "OVERLAY_WIDGET"; + MouseTargetType2[MouseTargetType2["OUTSIDE_EDITOR"] = 13] = "OUTSIDE_EDITOR"; +})(MouseTargetType || (MouseTargetType = {})); +var NewSymbolNameTag2; +(function(NewSymbolNameTag3) { + NewSymbolNameTag3[NewSymbolNameTag3["AIGenerated"] = 1] = "AIGenerated"; +})(NewSymbolNameTag2 || (NewSymbolNameTag2 = {})); +var NewSymbolNameTriggerKind2; +(function(NewSymbolNameTriggerKind3) { + NewSymbolNameTriggerKind3[NewSymbolNameTriggerKind3["Invoke"] = 0] = "Invoke"; + NewSymbolNameTriggerKind3[NewSymbolNameTriggerKind3["Automatic"] = 1] = "Automatic"; +})(NewSymbolNameTriggerKind2 || (NewSymbolNameTriggerKind2 = {})); +var OverlayWidgetPositionPreference; +(function(OverlayWidgetPositionPreference2) { + OverlayWidgetPositionPreference2[OverlayWidgetPositionPreference2["TOP_RIGHT_CORNER"] = 0] = "TOP_RIGHT_CORNER"; + OverlayWidgetPositionPreference2[OverlayWidgetPositionPreference2["BOTTOM_RIGHT_CORNER"] = 1] = "BOTTOM_RIGHT_CORNER"; + OverlayWidgetPositionPreference2[OverlayWidgetPositionPreference2["TOP_CENTER"] = 2] = "TOP_CENTER"; +})(OverlayWidgetPositionPreference || (OverlayWidgetPositionPreference = {})); +var OverviewRulerLane2; +(function(OverviewRulerLane3) { + OverviewRulerLane3[OverviewRulerLane3["Left"] = 1] = "Left"; + OverviewRulerLane3[OverviewRulerLane3["Center"] = 2] = "Center"; + OverviewRulerLane3[OverviewRulerLane3["Right"] = 4] = "Right"; + OverviewRulerLane3[OverviewRulerLane3["Full"] = 7] = "Full"; +})(OverviewRulerLane2 || (OverviewRulerLane2 = {})); +var PartialAcceptTriggerKind; +(function(PartialAcceptTriggerKind2) { + PartialAcceptTriggerKind2[PartialAcceptTriggerKind2["Word"] = 0] = "Word"; + PartialAcceptTriggerKind2[PartialAcceptTriggerKind2["Line"] = 1] = "Line"; + PartialAcceptTriggerKind2[PartialAcceptTriggerKind2["Suggest"] = 2] = "Suggest"; +})(PartialAcceptTriggerKind || (PartialAcceptTriggerKind = {})); +var PositionAffinity; +(function(PositionAffinity2) { + PositionAffinity2[PositionAffinity2["Left"] = 0] = "Left"; + PositionAffinity2[PositionAffinity2["Right"] = 1] = "Right"; + PositionAffinity2[PositionAffinity2["None"] = 2] = "None"; + PositionAffinity2[PositionAffinity2["LeftOfInjectedText"] = 3] = "LeftOfInjectedText"; + PositionAffinity2[PositionAffinity2["RightOfInjectedText"] = 4] = "RightOfInjectedText"; +})(PositionAffinity || (PositionAffinity = {})); +var RenderLineNumbersType; +(function(RenderLineNumbersType2) { + RenderLineNumbersType2[RenderLineNumbersType2["Off"] = 0] = "Off"; + RenderLineNumbersType2[RenderLineNumbersType2["On"] = 1] = "On"; + RenderLineNumbersType2[RenderLineNumbersType2["Relative"] = 2] = "Relative"; + RenderLineNumbersType2[RenderLineNumbersType2["Interval"] = 3] = "Interval"; + RenderLineNumbersType2[RenderLineNumbersType2["Custom"] = 4] = "Custom"; +})(RenderLineNumbersType || (RenderLineNumbersType = {})); +var RenderMinimap; +(function(RenderMinimap2) { + RenderMinimap2[RenderMinimap2["None"] = 0] = "None"; + RenderMinimap2[RenderMinimap2["Text"] = 1] = "Text"; + RenderMinimap2[RenderMinimap2["Blocks"] = 2] = "Blocks"; +})(RenderMinimap || (RenderMinimap = {})); +var ScrollType; +(function(ScrollType2) { + ScrollType2[ScrollType2["Smooth"] = 0] = "Smooth"; + ScrollType2[ScrollType2["Immediate"] = 1] = "Immediate"; +})(ScrollType || (ScrollType = {})); +var ScrollbarVisibility; +(function(ScrollbarVisibility2) { + ScrollbarVisibility2[ScrollbarVisibility2["Auto"] = 1] = "Auto"; + ScrollbarVisibility2[ScrollbarVisibility2["Hidden"] = 2] = "Hidden"; + ScrollbarVisibility2[ScrollbarVisibility2["Visible"] = 3] = "Visible"; +})(ScrollbarVisibility || (ScrollbarVisibility = {})); +var SelectionDirection; +(function(SelectionDirection3) { + SelectionDirection3[SelectionDirection3["LTR"] = 0] = "LTR"; + SelectionDirection3[SelectionDirection3["RTL"] = 1] = "RTL"; +})(SelectionDirection || (SelectionDirection = {})); +var ShowLightbulbIconMode2; +(function(ShowLightbulbIconMode3) { + ShowLightbulbIconMode3["Off"] = "off"; + ShowLightbulbIconMode3["OnCode"] = "onCode"; + ShowLightbulbIconMode3["On"] = "on"; +})(ShowLightbulbIconMode2 || (ShowLightbulbIconMode2 = {})); +var SignatureHelpTriggerKind2; +(function(SignatureHelpTriggerKind3) { + SignatureHelpTriggerKind3[SignatureHelpTriggerKind3["Invoke"] = 1] = "Invoke"; + SignatureHelpTriggerKind3[SignatureHelpTriggerKind3["TriggerCharacter"] = 2] = "TriggerCharacter"; + SignatureHelpTriggerKind3[SignatureHelpTriggerKind3["ContentChange"] = 3] = "ContentChange"; +})(SignatureHelpTriggerKind2 || (SignatureHelpTriggerKind2 = {})); +var SymbolKind; +(function(SymbolKind2) { + SymbolKind2[SymbolKind2["File"] = 0] = "File"; + SymbolKind2[SymbolKind2["Module"] = 1] = "Module"; + SymbolKind2[SymbolKind2["Namespace"] = 2] = "Namespace"; + SymbolKind2[SymbolKind2["Package"] = 3] = "Package"; + SymbolKind2[SymbolKind2["Class"] = 4] = "Class"; + SymbolKind2[SymbolKind2["Method"] = 5] = "Method"; + SymbolKind2[SymbolKind2["Property"] = 6] = "Property"; + SymbolKind2[SymbolKind2["Field"] = 7] = "Field"; + SymbolKind2[SymbolKind2["Constructor"] = 8] = "Constructor"; + SymbolKind2[SymbolKind2["Enum"] = 9] = "Enum"; + SymbolKind2[SymbolKind2["Interface"] = 10] = "Interface"; + SymbolKind2[SymbolKind2["Function"] = 11] = "Function"; + SymbolKind2[SymbolKind2["Variable"] = 12] = "Variable"; + SymbolKind2[SymbolKind2["Constant"] = 13] = "Constant"; + SymbolKind2[SymbolKind2["String"] = 14] = "String"; + SymbolKind2[SymbolKind2["Number"] = 15] = "Number"; + SymbolKind2[SymbolKind2["Boolean"] = 16] = "Boolean"; + SymbolKind2[SymbolKind2["Array"] = 17] = "Array"; + SymbolKind2[SymbolKind2["Object"] = 18] = "Object"; + SymbolKind2[SymbolKind2["Key"] = 19] = "Key"; + SymbolKind2[SymbolKind2["Null"] = 20] = "Null"; + SymbolKind2[SymbolKind2["EnumMember"] = 21] = "EnumMember"; + SymbolKind2[SymbolKind2["Struct"] = 22] = "Struct"; + SymbolKind2[SymbolKind2["Event"] = 23] = "Event"; + SymbolKind2[SymbolKind2["Operator"] = 24] = "Operator"; + SymbolKind2[SymbolKind2["TypeParameter"] = 25] = "TypeParameter"; +})(SymbolKind || (SymbolKind = {})); +var SymbolTag; +(function(SymbolTag2) { + SymbolTag2[SymbolTag2["Deprecated"] = 1] = "Deprecated"; +})(SymbolTag || (SymbolTag = {})); +var TextDirection2; +(function(TextDirection3) { + TextDirection3[TextDirection3["LTR"] = 0] = "LTR"; + TextDirection3[TextDirection3["RTL"] = 1] = "RTL"; +})(TextDirection2 || (TextDirection2 = {})); +var TextEditorCursorBlinkingStyle; +(function(TextEditorCursorBlinkingStyle2) { + TextEditorCursorBlinkingStyle2[TextEditorCursorBlinkingStyle2["Hidden"] = 0] = "Hidden"; + TextEditorCursorBlinkingStyle2[TextEditorCursorBlinkingStyle2["Blink"] = 1] = "Blink"; + TextEditorCursorBlinkingStyle2[TextEditorCursorBlinkingStyle2["Smooth"] = 2] = "Smooth"; + TextEditorCursorBlinkingStyle2[TextEditorCursorBlinkingStyle2["Phase"] = 3] = "Phase"; + TextEditorCursorBlinkingStyle2[TextEditorCursorBlinkingStyle2["Expand"] = 4] = "Expand"; + TextEditorCursorBlinkingStyle2[TextEditorCursorBlinkingStyle2["Solid"] = 5] = "Solid"; +})(TextEditorCursorBlinkingStyle || (TextEditorCursorBlinkingStyle = {})); +var TextEditorCursorStyle2; +(function(TextEditorCursorStyle3) { + TextEditorCursorStyle3[TextEditorCursorStyle3["Line"] = 1] = "Line"; + TextEditorCursorStyle3[TextEditorCursorStyle3["Block"] = 2] = "Block"; + TextEditorCursorStyle3[TextEditorCursorStyle3["Underline"] = 3] = "Underline"; + TextEditorCursorStyle3[TextEditorCursorStyle3["LineThin"] = 4] = "LineThin"; + TextEditorCursorStyle3[TextEditorCursorStyle3["BlockOutline"] = 5] = "BlockOutline"; + TextEditorCursorStyle3[TextEditorCursorStyle3["UnderlineThin"] = 6] = "UnderlineThin"; +})(TextEditorCursorStyle2 || (TextEditorCursorStyle2 = {})); +var TrackedRangeStickiness; +(function(TrackedRangeStickiness2) { + TrackedRangeStickiness2[TrackedRangeStickiness2["AlwaysGrowsWhenTypingAtEdges"] = 0] = "AlwaysGrowsWhenTypingAtEdges"; + TrackedRangeStickiness2[TrackedRangeStickiness2["NeverGrowsWhenTypingAtEdges"] = 1] = "NeverGrowsWhenTypingAtEdges"; + TrackedRangeStickiness2[TrackedRangeStickiness2["GrowsOnlyWhenTypingBefore"] = 2] = "GrowsOnlyWhenTypingBefore"; + TrackedRangeStickiness2[TrackedRangeStickiness2["GrowsOnlyWhenTypingAfter"] = 3] = "GrowsOnlyWhenTypingAfter"; +})(TrackedRangeStickiness || (TrackedRangeStickiness = {})); +var WrappingIndent; +(function(WrappingIndent2) { + WrappingIndent2[WrappingIndent2["None"] = 0] = "None"; + WrappingIndent2[WrappingIndent2["Same"] = 1] = "Same"; + WrappingIndent2[WrappingIndent2["Indent"] = 2] = "Indent"; + WrappingIndent2[WrappingIndent2["DeepIndent"] = 3] = "DeepIndent"; +})(WrappingIndent || (WrappingIndent = {})); + +// node_modules/monaco-editor-core/esm/vs/editor/common/services/editorBaseApi.js +var KeyMod = class { + static { + this.CtrlCmd = 2048; + } + static { + this.Shift = 1024; + } + static { + this.Alt = 512; + } + static { + this.WinCtrl = 256; + } + static chord(firstPart, secondPart) { + return KeyChord(firstPart, secondPart); + } +}; +function createMonacoBaseAPI() { + return { + editor: void 0, + // undefined override expected here + languages: void 0, + // undefined override expected here + CancellationTokenSource, + Emitter, + KeyCode, + KeyMod, + Position, + Range, + Selection, + SelectionDirection, + MarkerSeverity: MarkerSeverity2, + MarkerTag, + Uri: URI, + Token + }; +} + +// node_modules/monaco-editor-core/esm/vs/editor/standalone/browser/standaloneEditor.js +init_window(); +init_lifecycle(); +init_strings(); +init_uri(); +init_editorExtensions(); +init_codeEditorService(); + +// node_modules/monaco-editor-core/esm/vs/editor/browser/services/editorWorkerService.js +init_async(); +init_lifecycle(); + +// node_modules/monaco-editor-core/esm/vs/base/common/worker/webWorker.js +init_errors(); +init_event(); +init_lifecycle(); +init_platform(); +init_strings(); +var DEFAULT_CHANNEL = "default"; +var INITIALIZE = "$initialize"; +var webWorkerWarningLogged = false; +function logOnceWebWorkerWarning(err) { + if (!isWeb) { + return; + } + if (!webWorkerWarningLogged) { + webWorkerWarningLogged = true; + console.warn("Could not create web worker(s). Falling back to loading web worker code in main thread, which might cause UI freezes. Please see https://github.com/microsoft/monaco-editor#faq"); + } + console.warn(err.message); +} +var RequestMessage = class { + constructor(vsWorker, req, channel, method, args) { + this.vsWorker = vsWorker; + this.req = req; + this.channel = channel; + this.method = method; + this.args = args; + this.type = 0; + } +}; +var ReplyMessage = class { + constructor(vsWorker, seq, res, err) { + this.vsWorker = vsWorker; + this.seq = seq; + this.res = res; + this.err = err; + this.type = 1; + } +}; +var SubscribeEventMessage = class { + constructor(vsWorker, req, channel, eventName, arg) { + this.vsWorker = vsWorker; + this.req = req; + this.channel = channel; + this.eventName = eventName; + this.arg = arg; + this.type = 2; + } +}; +var EventMessage = class { + constructor(vsWorker, req, event) { + this.vsWorker = vsWorker; + this.req = req; + this.event = event; + this.type = 3; + } +}; +var UnsubscribeEventMessage = class { + constructor(vsWorker, req) { + this.vsWorker = vsWorker; + this.req = req; + this.type = 4; + } +}; +var WebWorkerProtocol = class { + constructor(handler) { + this._workerId = -1; + this._handler = handler; + this._lastSentReq = 0; + this._pendingReplies = /* @__PURE__ */ Object.create(null); + this._pendingEmitters = /* @__PURE__ */ new Map(); + this._pendingEvents = /* @__PURE__ */ new Map(); + } + setWorkerId(workerId) { + this._workerId = workerId; + } + async sendMessage(channel, method, args) { + const req = String(++this._lastSentReq); + return new Promise((resolve3, reject) => { + this._pendingReplies[req] = { + resolve: resolve3, + reject + }; + this._send(new RequestMessage(this._workerId, req, channel, method, args)); + }); + } + listen(channel, eventName, arg) { + let req = null; + const emitter = new Emitter({ + onWillAddFirstListener: () => { + req = String(++this._lastSentReq); + this._pendingEmitters.set(req, emitter); + this._send(new SubscribeEventMessage(this._workerId, req, channel, eventName, arg)); + }, + onDidRemoveLastListener: () => { + this._pendingEmitters.delete(req); + this._send(new UnsubscribeEventMessage(this._workerId, req)); + req = null; + } + }); + return emitter.event; + } + handleMessage(message) { + if (!message || !message.vsWorker) { + return; + } + if (this._workerId !== -1 && message.vsWorker !== this._workerId) { + return; + } + this._handleMessage(message); + } + createProxyToRemoteChannel(channel, sendMessageBarrier) { + const handler = { + get: (target, name) => { + if (typeof name === "string" && !target[name]) { + if (propertyIsDynamicEvent(name)) { + target[name] = (arg) => { + return this.listen(channel, name, arg); + }; + } else if (propertyIsEvent(name)) { + target[name] = this.listen(channel, name, void 0); + } else if (name.charCodeAt(0) === 36) { + target[name] = async (...myArgs) => { + await sendMessageBarrier?.(); + return this.sendMessage(channel, name, myArgs); + }; + } + } + return target[name]; + } + }; + return new Proxy(/* @__PURE__ */ Object.create(null), handler); + } + _handleMessage(msg) { + switch (msg.type) { + case 1: + return this._handleReplyMessage(msg); + case 0: + return this._handleRequestMessage(msg); + case 2: + return this._handleSubscribeEventMessage(msg); + case 3: + return this._handleEventMessage(msg); + case 4: + return this._handleUnsubscribeEventMessage(msg); + } + } + _handleReplyMessage(replyMessage) { + if (!this._pendingReplies[replyMessage.seq]) { + console.warn("Got reply to unknown seq"); + return; + } + const reply = this._pendingReplies[replyMessage.seq]; + delete this._pendingReplies[replyMessage.seq]; + if (replyMessage.err) { + let err = replyMessage.err; + if (replyMessage.err.$isError) { + const newErr = new Error(); + newErr.name = replyMessage.err.name; + newErr.message = replyMessage.err.message; + newErr.stack = replyMessage.err.stack; + err = newErr; + } + reply.reject(err); + return; + } + reply.resolve(replyMessage.res); + } + _handleRequestMessage(requestMessage) { + const req = requestMessage.req; + const result = this._handler.handleMessage(requestMessage.channel, requestMessage.method, requestMessage.args); + result.then((r) => { + this._send(new ReplyMessage(this._workerId, req, r, void 0)); + }, (e) => { + if (e.detail instanceof Error) { + e.detail = transformErrorForSerialization(e.detail); + } + this._send(new ReplyMessage(this._workerId, req, void 0, transformErrorForSerialization(e))); + }); + } + _handleSubscribeEventMessage(msg) { + const req = msg.req; + const disposable = this._handler.handleEvent(msg.channel, msg.eventName, msg.arg)((event) => { + this._send(new EventMessage(this._workerId, req, event)); + }); + this._pendingEvents.set(req, disposable); + } + _handleEventMessage(msg) { + if (!this._pendingEmitters.has(msg.req)) { + console.warn("Got event for unknown req"); + return; + } + this._pendingEmitters.get(msg.req).fire(msg.event); + } + _handleUnsubscribeEventMessage(msg) { + if (!this._pendingEvents.has(msg.req)) { + console.warn("Got unsubscribe for unknown req"); + return; + } + this._pendingEvents.get(msg.req).dispose(); + this._pendingEvents.delete(msg.req); + } + _send(msg) { + const transfer = []; + if (msg.type === 0) { + for (let i2 = 0; i2 < msg.args.length; i2++) { + const arg = msg.args[i2]; + if (arg instanceof ArrayBuffer) { + transfer.push(arg); + } + } + } else if (msg.type === 1) { + if (msg.res instanceof ArrayBuffer) { + transfer.push(msg.res); + } + } + this._handler.sendMessage(msg, transfer); + } +}; +var WebWorkerClient = class extends Disposable { + constructor(worker) { + super(); + this._localChannels = /* @__PURE__ */ new Map(); + this._worker = this._register(worker); + this._register(this._worker.onMessage((msg) => { + this._protocol.handleMessage(msg); + })); + this._register(this._worker.onError((err) => { + logOnceWebWorkerWarning(err); + onUnexpectedError(err); + })); + this._protocol = new WebWorkerProtocol({ + sendMessage: (msg, transfer) => { + this._worker.postMessage(msg, transfer); + }, + handleMessage: (channel, method, args) => { + return this._handleMessage(channel, method, args); + }, + handleEvent: (channel, eventName, arg) => { + return this._handleEvent(channel, eventName, arg); + } + }); + this._protocol.setWorkerId(this._worker.getId()); + this._onModuleLoaded = this._protocol.sendMessage(DEFAULT_CHANNEL, INITIALIZE, [ + this._worker.getId() + ]).then(() => { + }); + this.proxy = this._protocol.createProxyToRemoteChannel(DEFAULT_CHANNEL, async () => { + await this._onModuleLoaded; + }); + this._onModuleLoaded.catch((e) => { + this._onError("Worker failed to load ", e); + }); + } + _handleMessage(channelName, method, args) { + const channel = this._localChannels.get(channelName); + if (!channel) { + return Promise.reject(new Error(`Missing channel ${channelName} on main thread`)); + } + const fn = channel[method]; + if (typeof fn !== "function") { + return Promise.reject(new Error(`Missing method ${method} on main thread channel ${channelName}`)); + } + try { + return Promise.resolve(fn.apply(channel, args)); + } catch (e) { + return Promise.reject(e); + } + } + _handleEvent(channelName, eventName, arg) { + const channel = this._localChannels.get(channelName); + if (!channel) { + throw new Error(`Missing channel ${channelName} on main thread`); + } + if (propertyIsDynamicEvent(eventName)) { + const fn = channel[eventName]; + if (typeof fn !== "function") { + throw new Error(`Missing dynamic event ${eventName} on main thread channel ${channelName}.`); + } + const event = fn.call(channel, arg); + if (typeof event !== "function") { + throw new Error(`Missing dynamic event ${eventName} on main thread channel ${channelName}.`); + } + return event; + } + if (propertyIsEvent(eventName)) { + const event = channel[eventName]; + if (typeof event !== "function") { + throw new Error(`Missing event ${eventName} on main thread channel ${channelName}.`); + } + return event; + } + throw new Error(`Malformed event name ${eventName}`); + } + setChannel(channel, handler) { + this._localChannels.set(channel, handler); + } + _onError(message, error) { + console.error(message); + console.info(error); + } +}; +function propertyIsEvent(name) { + return name[0] === "o" && name[1] === "n" && isUpperAsciiLetter(name.charCodeAt(2)); +} +function propertyIsDynamicEvent(name) { + return /^onDynamic/.test(name) && isUpperAsciiLetter(name.charCodeAt(9)); +} + +// node_modules/monaco-editor-core/esm/vs/base/browser/webWorkerFactory.js +init_errors(); +init_network(); +init_uri(); +init_lifecycle(); +init_arrays(); +init_nls(); +init_event(); +init_browser(); +var ttPolicy5; +if (typeof self === "object" && self.constructor && self.constructor.name === "DedicatedWorkerGlobalScope" && globalThis.workerttPolicy !== void 0) { + ttPolicy5 = globalThis.workerttPolicy; +} else { + ttPolicy5 = createTrustedTypesPolicy("defaultWorkerFactory", { createScriptURL: (value) => value }); +} +function getWorker(descriptor, id) { + const label = descriptor.label || "anonymous" + id; + const monacoEnvironment2 = getMonacoEnvironment(); + if (monacoEnvironment2) { + if (typeof monacoEnvironment2.getWorker === "function") { + return monacoEnvironment2.getWorker("workerMain.js", label); + } + if (typeof monacoEnvironment2.getWorkerUrl === "function") { + const workerUrl = monacoEnvironment2.getWorkerUrl("workerMain.js", label); + return new Worker(ttPolicy5 ? ttPolicy5.createScriptURL(workerUrl) : workerUrl, { name: label, type: "module" }); + } + } + const esmWorkerLocation = descriptor.esmModuleLocation; + if (esmWorkerLocation) { + const workerUrl = getWorkerBootstrapUrl(label, esmWorkerLocation.toString(true)); + const worker = new Worker(ttPolicy5 ? ttPolicy5.createScriptURL(workerUrl) : workerUrl, { name: label, type: "module" }); + return whenESMWorkerReady(worker); + } + throw new Error(`You must define a function MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker`); +} +function getWorkerBootstrapUrl(label, workerScriptUrl) { + if (/^((http:)|(https:)|(file:))/.test(workerScriptUrl) && workerScriptUrl.substring(0, globalThis.origin.length) !== globalThis.origin) { + } else { + const start = workerScriptUrl.lastIndexOf("?"); + const end = workerScriptUrl.lastIndexOf("#", start); + const params = start > 0 ? new URLSearchParams(workerScriptUrl.substring(start + 1, ~end ? end : void 0)) : new URLSearchParams(); + COI.addSearchParam(params, true, true); + const search2 = params.toString(); + if (!search2) { + workerScriptUrl = `${workerScriptUrl}#${label}`; + } else { + workerScriptUrl = `${workerScriptUrl}?${params.toString()}#${label}`; + } + } + const blob = new Blob([coalesce([ + `/*${label}*/`, + `globalThis._VSCODE_NLS_MESSAGES = ${JSON.stringify(getNLSMessages())};`, + `globalThis._VSCODE_NLS_LANGUAGE = ${JSON.stringify(getNLSLanguage())};`, + `globalThis._VSCODE_FILE_ROOT = ${JSON.stringify(globalThis._VSCODE_FILE_ROOT)};`, + `const ttPolicy = globalThis.trustedTypes?.createPolicy('defaultWorkerFactory', { createScriptURL: value => value });`, + `globalThis.workerttPolicy = ttPolicy;`, + `await import(ttPolicy?.createScriptURL(${JSON.stringify(workerScriptUrl)}) ?? ${JSON.stringify(workerScriptUrl)});`, + `globalThis.postMessage({ type: 'vscode-worker-ready' });`, + `/*${label}*/` + ]).join("")], { type: "application/javascript" }); + return URL.createObjectURL(blob); +} +function whenESMWorkerReady(worker) { + return new Promise((resolve3, reject) => { + worker.onmessage = function(e) { + if (e.data.type === "vscode-worker-ready") { + worker.onmessage = null; + resolve3(worker); + } + }; + worker.onerror = reject; + }); +} +function isPromiseLike(obj) { + return !!obj && typeof obj.then === "function"; +} +var WebWorker = class _WebWorker extends Disposable { + static { + this.LAST_WORKER_ID = 0; + } + constructor(descriptorOrWorker) { + super(); + this._onMessage = this._register(new Emitter()); + this.onMessage = this._onMessage.event; + this._onError = this._register(new Emitter()); + this.onError = this._onError.event; + this.id = ++_WebWorker.LAST_WORKER_ID; + const workerOrPromise = descriptorOrWorker instanceof Worker ? descriptorOrWorker : "then" in descriptorOrWorker ? descriptorOrWorker : getWorker(descriptorOrWorker, this.id); + if (isPromiseLike(workerOrPromise)) { + this.worker = workerOrPromise; + } else { + this.worker = Promise.resolve(workerOrPromise); + } + this.postMessage("-please-ignore-", []); + const errorHandler2 = (ev) => { + this._onError.fire(ev); + }; + this.worker.then((w) => { + w.onmessage = (ev) => { + this._onMessage.fire(ev.data); + }; + w.onmessageerror = (ev) => { + this._onError.fire(ev); + }; + if (typeof w.addEventListener === "function") { + w.addEventListener("error", errorHandler2); + } + }); + this._register(toDisposable(() => { + this.worker?.then((w) => { + w.onmessage = null; + w.onmessageerror = null; + w.removeEventListener("error", errorHandler2); + w.terminate(); + }); + this.worker = null; + })); + } + getId() { + return this.id; + } + postMessage(message, transfer) { + this.worker?.then((w) => { + try { + w.postMessage(message, transfer); + } catch (err) { + onUnexpectedError(err); + onUnexpectedError(new Error(`FAILED to post message to worker`, { cause: err })); + } + }); + } +}; +var WebWorkerDescriptor = class { + constructor(esmModuleLocation, label) { + this.esmModuleLocation = esmModuleLocation; + this.label = label; + } +}; +function createWebWorker(arg0, arg1) { + const workerDescriptorOrWorker = URI.isUri(arg0) ? new WebWorkerDescriptor(arg0, arg1) : arg0; + return new WebWorkerClient(new WebWorker(workerDescriptorOrWorker)); +} + +// node_modules/monaco-editor-core/esm/vs/editor/browser/services/editorWorkerService.js +init_range(); +init_languageConfigurationRegistry(); + +// node_modules/monaco-editor-core/esm/vs/editor/common/services/editorWebWorker.js +init_range(); + +// node_modules/monaco-editor-core/esm/vs/editor/common/languages/linkComputer.js +init_characterClassifier(); +var Uint8Matrix = class { + constructor(rows, cols, defaultValue) { + const data = new Uint8Array(rows * cols); + for (let i2 = 0, len = rows * cols; i2 < len; i2++) { + data[i2] = defaultValue; + } + this._data = data; + this.rows = rows; + this.cols = cols; + } + get(row, col) { + return this._data[row * this.cols + col]; + } + set(row, col, value) { + this._data[row * this.cols + col] = value; + } +}; +var StateMachine = class { + constructor(edges) { + let maxCharCode = 0; + let maxState = 0; + for (let i2 = 0, len = edges.length; i2 < len; i2++) { + const [from, chCode, to] = edges[i2]; + if (chCode > maxCharCode) { + maxCharCode = chCode; + } + if (from > maxState) { + maxState = from; + } + if (to > maxState) { + maxState = to; + } + } + maxCharCode++; + maxState++; + const states = new Uint8Matrix( + maxState, + maxCharCode, + 0 + /* State.Invalid */ + ); + for (let i2 = 0, len = edges.length; i2 < len; i2++) { + const [from, chCode, to] = edges[i2]; + states.set(from, chCode, to); + } + this._states = states; + this._maxCharCode = maxCharCode; + } + nextState(currentState, chCode) { + if (chCode < 0 || chCode >= this._maxCharCode) { + return 0; + } + return this._states.get(currentState, chCode); + } +}; +var _stateMachine = null; +function getStateMachine() { + if (_stateMachine === null) { + _stateMachine = new StateMachine([ + [ + 1, + 104, + 2 + /* State.H */ + ], + [ + 1, + 72, + 2 + /* State.H */ + ], + [ + 1, + 102, + 6 + /* State.F */ + ], + [ + 1, + 70, + 6 + /* State.F */ + ], + [ + 2, + 116, + 3 + /* State.HT */ + ], + [ + 2, + 84, + 3 + /* State.HT */ + ], + [ + 3, + 116, + 4 + /* State.HTT */ + ], + [ + 3, + 84, + 4 + /* State.HTT */ + ], + [ + 4, + 112, + 5 + /* State.HTTP */ + ], + [ + 4, + 80, + 5 + /* State.HTTP */ + ], + [ + 5, + 115, + 9 + /* State.BeforeColon */ + ], + [ + 5, + 83, + 9 + /* State.BeforeColon */ + ], + [ + 5, + 58, + 10 + /* State.AfterColon */ + ], + [ + 6, + 105, + 7 + /* State.FI */ + ], + [ + 6, + 73, + 7 + /* State.FI */ + ], + [ + 7, + 108, + 8 + /* State.FIL */ + ], + [ + 7, + 76, + 8 + /* State.FIL */ + ], + [ + 8, + 101, + 9 + /* State.BeforeColon */ + ], + [ + 8, + 69, + 9 + /* State.BeforeColon */ + ], + [ + 9, + 58, + 10 + /* State.AfterColon */ + ], + [ + 10, + 47, + 11 + /* State.AlmostThere */ + ], + [ + 11, + 47, + 12 + /* State.End */ + ] + ]); + } + return _stateMachine; +} +var _classifier = null; +function getClassifier() { + if (_classifier === null) { + _classifier = new CharacterClassifier( + 0 + /* CharacterClass.None */ + ); + const FORCE_TERMINATION_CHARACTERS = ` <>'"\u3001\u3002\uFF61\uFF64\uFF0C\uFF0E\uFF1A\uFF1B\u2018\u3008\u300C\u300E\u3014\uFF08\uFF3B\uFF5B\uFF62\uFF63\uFF5D\uFF3D\uFF09\u3015\u300F\u300D\u3009\u2019\uFF40\uFF5E\u2026|`; + for (let i2 = 0; i2 < FORCE_TERMINATION_CHARACTERS.length; i2++) { + _classifier.set( + FORCE_TERMINATION_CHARACTERS.charCodeAt(i2), + 1 + /* CharacterClass.ForceTermination */ + ); + } + const CANNOT_END_WITH_CHARACTERS = ".,;:"; + for (let i2 = 0; i2 < CANNOT_END_WITH_CHARACTERS.length; i2++) { + _classifier.set( + CANNOT_END_WITH_CHARACTERS.charCodeAt(i2), + 2 + /* CharacterClass.CannotEndIn */ + ); + } + } + return _classifier; +} +var LinkComputer = class _LinkComputer { + static _createLink(classifier, line, lineNumber, linkBeginIndex, linkEndIndex) { + let lastIncludedCharIndex = linkEndIndex - 1; + do { + const chCode = line.charCodeAt(lastIncludedCharIndex); + const chClass = classifier.get(chCode); + if (chClass !== 2) { + break; + } + lastIncludedCharIndex--; + } while (lastIncludedCharIndex > linkBeginIndex); + if (linkBeginIndex > 0) { + const charCodeBeforeLink = line.charCodeAt(linkBeginIndex - 1); + const lastCharCodeInLink = line.charCodeAt(lastIncludedCharIndex); + if (charCodeBeforeLink === 40 && lastCharCodeInLink === 41 || charCodeBeforeLink === 91 && lastCharCodeInLink === 93 || charCodeBeforeLink === 123 && lastCharCodeInLink === 125) { + lastIncludedCharIndex--; + } + } + return { + range: { + startLineNumber: lineNumber, + startColumn: linkBeginIndex + 1, + endLineNumber: lineNumber, + endColumn: lastIncludedCharIndex + 2 + }, + url: line.substring(linkBeginIndex, lastIncludedCharIndex + 1) + }; + } + static computeLinks(model, stateMachine = getStateMachine()) { + const classifier = getClassifier(); + const result = []; + for (let i2 = 1, lineCount = model.getLineCount(); i2 <= lineCount; i2++) { + const line = model.getLineContent(i2); + const len = line.length; + let j = 0; + let linkBeginIndex = 0; + let linkBeginChCode = 0; + let state = 1; + let hasOpenParens = false; + let hasOpenSquareBracket = false; + let inSquareBrackets = false; + let hasOpenCurlyBracket = false; + while (j < len) { + let resetStateMachine = false; + const chCode = line.charCodeAt(j); + if (state === 13) { + let chClass; + switch (chCode) { + case 40: + hasOpenParens = true; + chClass = 0; + break; + case 41: + chClass = hasOpenParens ? 0 : 1; + break; + case 91: + inSquareBrackets = true; + hasOpenSquareBracket = true; + chClass = 0; + break; + case 93: + inSquareBrackets = false; + chClass = hasOpenSquareBracket ? 0 : 1; + break; + case 123: + hasOpenCurlyBracket = true; + chClass = 0; + break; + case 125: + chClass = hasOpenCurlyBracket ? 0 : 1; + break; + // The following three rules make it that ' or " or ` are allowed inside links + // only if the link is wrapped by some other quote character + case 39: + case 34: + case 96: + if (linkBeginChCode === chCode) { + chClass = 1; + } else if (linkBeginChCode === 39 || linkBeginChCode === 34 || linkBeginChCode === 96) { + chClass = 0; + } else { + chClass = 1; + } + break; + case 42: + chClass = linkBeginChCode === 42 ? 1 : 0; + break; + case 32: + chClass = inSquareBrackets ? 0 : 1; + break; + default: + chClass = classifier.get(chCode); + } + if (chClass === 1) { + result.push(_LinkComputer._createLink(classifier, line, i2, linkBeginIndex, j)); + resetStateMachine = true; + } + } else if (state === 12) { + let chClass; + if (chCode === 91) { + hasOpenSquareBracket = true; + chClass = 0; + } else { + chClass = classifier.get(chCode); + } + if (chClass === 1) { + resetStateMachine = true; + } else { + state = 13; + } + } else { + state = stateMachine.nextState(state, chCode); + if (state === 0) { + resetStateMachine = true; + } + } + if (resetStateMachine) { + state = 1; + hasOpenParens = false; + hasOpenSquareBracket = false; + hasOpenCurlyBracket = false; + linkBeginIndex = j + 1; + linkBeginChCode = chCode; + } + j++; + } + if (state === 13) { + result.push(_LinkComputer._createLink(classifier, line, i2, linkBeginIndex, len)); + } + } + return result; + } +}; +function computeLinks(model) { + if (!model || typeof model.getLineCount !== "function" || typeof model.getLineContent !== "function") { + return []; + } + return LinkComputer.computeLinks(model); +} + +// node_modules/monaco-editor-core/esm/vs/editor/common/languages/supports/inplaceReplaceSupport.js +var BasicInplaceReplace = class _BasicInplaceReplace { + constructor() { + this._defaultValueSet = [ + ["true", "false"], + ["True", "False"], + ["Private", "Public", "Friend", "ReadOnly", "Partial", "Protected", "WriteOnly"], + ["public", "protected", "private"] + ]; + } + static { + this.INSTANCE = new _BasicInplaceReplace(); + } + navigateValueSet(range1, text1, range2, text2, up) { + if (range1 && text1) { + const result = this.doNavigateValueSet(text1, up); + if (result) { + return { + range: range1, + value: result + }; + } + } + if (range2 && text2) { + const result = this.doNavigateValueSet(text2, up); + if (result) { + return { + range: range2, + value: result + }; + } + } + return null; + } + doNavigateValueSet(text2, up) { + const numberResult = this.numberReplace(text2, up); + if (numberResult !== null) { + return numberResult; + } + return this.textReplace(text2, up); + } + numberReplace(value, up) { + const precision = Math.pow(10, value.length - (value.lastIndexOf(".") + 1)); + let n1 = Number(value); + const n2 = parseFloat(value); + if (!isNaN(n1) && !isNaN(n2) && n1 === n2) { + if (n1 === 0 && !up) { + return null; + } else { + n1 = Math.floor(n1 * precision); + n1 += up ? precision : -precision; + return String(n1 / precision); + } + } + return null; + } + textReplace(value, up) { + return this.valueSetsReplace(this._defaultValueSet, value, up); + } + valueSetsReplace(valueSets, value, up) { + let result = null; + for (let i2 = 0, len = valueSets.length; result === null && i2 < len; i2++) { + result = this.valueSetReplace(valueSets[i2], value, up); + } + return result; + } + valueSetReplace(valueSet, value, up) { + let idx = valueSet.indexOf(value); + if (idx >= 0) { + idx += up ? 1 : -1; + if (idx < 0) { + idx = valueSet.length - 1; + } else { + idx %= valueSet.length; + } + return valueSet[idx]; + } + return null; + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/common/services/editorWebWorker.js +init_stopwatch(); + +// node_modules/monaco-editor-core/esm/vs/editor/common/languages/defaultDocumentColorsComputer.js +init_color(); +function _parseCaptureGroups(captureGroups) { + const values = []; + for (const captureGroup of captureGroups) { + const parsedNumber = Number(captureGroup); + if (parsedNumber || parsedNumber === 0 && captureGroup.replace(/\s/g, "") !== "") { + values.push(parsedNumber); + } + } + return values; +} +function _toIColor(r, g, b, a) { + return { + red: r / 255, + blue: b / 255, + green: g / 255, + alpha: a + }; +} +function _findRange(model, match2) { + const index = match2.index; + const length = match2[0].length; + if (index === void 0) { + return; + } + const startPosition = model.positionAt(index); + const range2 = { + startLineNumber: startPosition.lineNumber, + startColumn: startPosition.column, + endLineNumber: startPosition.lineNumber, + endColumn: startPosition.column + length + }; + return range2; +} +function _findHexColorInformation(range2, hexValue) { + if (!range2) { + return; + } + const parsedHexColor = Color.Format.CSS.parseHex(hexValue); + if (!parsedHexColor) { + return; + } + return { + range: range2, + color: _toIColor(parsedHexColor.rgba.r, parsedHexColor.rgba.g, parsedHexColor.rgba.b, parsedHexColor.rgba.a) + }; +} +function _findRGBColorInformation(range2, matches, isAlpha) { + if (!range2 || matches.length !== 1) { + return; + } + const match2 = matches[0]; + const captureGroups = match2.values(); + const parsedRegex = _parseCaptureGroups(captureGroups); + return { + range: range2, + color: _toIColor(parsedRegex[0], parsedRegex[1], parsedRegex[2], isAlpha ? parsedRegex[3] : 1) + }; +} +function _findHSLColorInformation(range2, matches, isAlpha) { + if (!range2 || matches.length !== 1) { + return; + } + const match2 = matches[0]; + const captureGroups = match2.values(); + const parsedRegex = _parseCaptureGroups(captureGroups); + const colorEquivalent = new Color(new HSLA(parsedRegex[0], parsedRegex[1] / 100, parsedRegex[2] / 100, isAlpha ? parsedRegex[3] : 1)); + return { + range: range2, + color: _toIColor(colorEquivalent.rgba.r, colorEquivalent.rgba.g, colorEquivalent.rgba.b, colorEquivalent.rgba.a) + }; +} +function _findMatches(model, regex) { + if (typeof model === "string") { + return [...model.matchAll(regex)]; + } else { + return model.findMatches(regex); + } +} +function computeColors(model) { + const result = []; + const initialValidationRegex = /\b(rgb|rgba|hsl|hsla)(\([0-9\s,.\%]*\))|^(#)([A-Fa-f0-9]{3})\b|^(#)([A-Fa-f0-9]{4})\b|^(#)([A-Fa-f0-9]{6})\b|^(#)([A-Fa-f0-9]{8})\b|(?<=['"\s])(#)([A-Fa-f0-9]{3})\b|(?<=['"\s])(#)([A-Fa-f0-9]{4})\b|(?<=['"\s])(#)([A-Fa-f0-9]{6})\b|(?<=['"\s])(#)([A-Fa-f0-9]{8})\b/gm; + const initialValidationMatches = _findMatches(model, initialValidationRegex); + if (initialValidationMatches.length > 0) { + for (const initialMatch of initialValidationMatches) { + const initialCaptureGroups = initialMatch.filter((captureGroup) => captureGroup !== void 0); + const colorScheme = initialCaptureGroups[1]; + const colorParameters = initialCaptureGroups[2]; + if (!colorParameters) { + continue; + } + let colorInformation; + if (colorScheme === "rgb") { + const regexParameters = /^\(\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*\)$/gm; + colorInformation = _findRGBColorInformation(_findRange(model, initialMatch), _findMatches(colorParameters, regexParameters), false); + } else if (colorScheme === "rgba") { + const regexParameters = /^\(\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(0[.][0-9]+|[.][0-9]+|[01][.]|[01])\s*\)$/gm; + colorInformation = _findRGBColorInformation(_findRange(model, initialMatch), _findMatches(colorParameters, regexParameters), true); + } else if (colorScheme === "hsl") { + const regexParameters = /^\(\s*((?:360(?:\.0+)?|(?:36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])(?:\.\d+)?))\s*[\s,]\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*[\s,]\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*\)$/gm; + colorInformation = _findHSLColorInformation(_findRange(model, initialMatch), _findMatches(colorParameters, regexParameters), false); + } else if (colorScheme === "hsla") { + const regexParameters = /^\(\s*((?:360(?:\.0+)?|(?:36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])(?:\.\d+)?))\s*[\s,]\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*[\s,]\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*[\s,]\s*(0[.][0-9]+|[.][0-9]+|[01][.]0*|[01])\s*\)$/gm; + colorInformation = _findHSLColorInformation(_findRange(model, initialMatch), _findMatches(colorParameters, regexParameters), true); + } else if (colorScheme === "#") { + colorInformation = _findHexColorInformation(_findRange(model, initialMatch), colorScheme + colorParameters); + } + if (colorInformation) { + result.push(colorInformation); + } + } + } + return result; +} +function computeDefaultDocumentColors(model) { + if (!model || typeof model.getValue !== "function" || typeof model.positionAt !== "function") { + return []; + } + return computeColors(model); +} + +// node_modules/monaco-editor-core/esm/vs/editor/common/services/findSectionHeaders.js +init_textModelSearch(); +init_strings(); +var trimDashesRegex = /^-+|-+$/g; +var CHUNK_SIZE = 100; +var MAX_SECTION_LINES = 5; +function findSectionHeaders(model, options2) { + let headers = []; + if (options2.findRegionSectionHeaders && options2.foldingRules?.markers) { + const regionHeaders = collectRegionHeaders(model, options2); + headers = headers.concat(regionHeaders); + } + if (options2.findMarkSectionHeaders) { + const markHeaders = collectMarkHeaders(model, options2); + headers = headers.concat(markHeaders); + } + return headers; +} +function collectRegionHeaders(model, options2) { + const regionHeaders = []; + const endLineNumber = model.getLineCount(); + for (let lineNumber = 1; lineNumber <= endLineNumber; lineNumber++) { + const lineContent = model.getLineContent(lineNumber); + const match2 = lineContent.match(options2.foldingRules.markers.start); + if (match2) { + const range2 = { startLineNumber: lineNumber, startColumn: match2[0].length + 1, endLineNumber: lineNumber, endColumn: lineContent.length + 1 }; + if (range2.endColumn > range2.startColumn) { + const sectionHeader = { + range: range2, + ...getHeaderText(lineContent.substring(match2[0].length)), + shouldBeInComments: false + }; + if (sectionHeader.text || sectionHeader.hasSeparatorLine) { + regionHeaders.push(sectionHeader); + } + } + } + } + return regionHeaders; +} +function collectMarkHeaders(model, options2) { + const markHeaders = []; + const endLineNumber = model.getLineCount(); + if (!options2.markSectionHeaderRegex || options2.markSectionHeaderRegex.trim() === "") { + return markHeaders; + } + const multiline = isMultilineRegexSource(options2.markSectionHeaderRegex); + const regex = new RegExp(options2.markSectionHeaderRegex, `gdm${multiline ? "s" : ""}`); + if (regExpLeadsToEndlessLoop(regex)) { + return markHeaders; + } + for (let startLine = 1; startLine <= endLineNumber; startLine += CHUNK_SIZE - MAX_SECTION_LINES) { + const endLine = Math.min(startLine + CHUNK_SIZE - 1, endLineNumber); + const lines = []; + for (let i2 = startLine; i2 <= endLine; i2++) { + lines.push(model.getLineContent(i2)); + } + const text2 = lines.join("\n"); + regex.lastIndex = 0; + let match2; + while ((match2 = regex.exec(text2)) !== null) { + const precedingText = text2.substring(0, match2.index); + const lineOffset = (precedingText.match(/\n/g) || []).length; + const lineNumber = startLine + lineOffset; + const matchLines = match2[0].split("\n"); + const matchHeight = matchLines.length; + const matchEndLine = lineNumber + matchHeight - 1; + const lineStartIndex = precedingText.lastIndexOf("\n") + 1; + const startColumn = match2.index - lineStartIndex + 1; + const lastMatchLine = matchLines[matchLines.length - 1]; + const endColumn = matchHeight === 1 ? startColumn + match2[0].length : lastMatchLine.length + 1; + const range2 = { + startLineNumber: lineNumber, + startColumn, + endLineNumber: matchEndLine, + endColumn + }; + const text22 = (match2.groups ?? {})["label"] ?? ""; + const hasSeparatorLine = ((match2.groups ?? {})["separator"] ?? "") !== ""; + const sectionHeader = { + range: range2, + text: text22, + hasSeparatorLine, + shouldBeInComments: true + }; + if (sectionHeader.text || sectionHeader.hasSeparatorLine) { + if (markHeaders.length === 0 || markHeaders[markHeaders.length - 1].range.endLineNumber < sectionHeader.range.startLineNumber) { + markHeaders.push(sectionHeader); + } + } + regex.lastIndex = match2.index + match2[0].length; + } + } + return markHeaders; +} +function getHeaderText(text2) { + text2 = text2.trim(); + const hasSeparatorLine = text2.startsWith("-"); + text2 = text2.replace(trimDashesRegex, ""); + return { text: text2, hasSeparatorLine }; +} + +// node_modules/monaco-editor-core/esm/vs/editor/common/services/textModelSync/textModelSync.impl.js +init_async(); +init_lifecycle(); +init_uri(); +init_position(); +init_range(); +init_wordHelper(); + +// node_modules/monaco-editor-core/esm/vs/editor/common/model/mirrorTextModel.js +init_strings(); +init_position(); +var MirrorTextModel = class { + constructor(uri, lines, eol, versionId) { + this._uri = uri; + this._lines = lines; + this._eol = eol; + this._versionId = versionId; + this._lineStarts = null; + this._cachedTextValue = null; + } + dispose() { + this._lines.length = 0; + } + get version() { + return this._versionId; + } + getText() { + if (this._cachedTextValue === null) { + this._cachedTextValue = this._lines.join(this._eol); + } + return this._cachedTextValue; + } + onEvents(e) { + if (e.eol && e.eol !== this._eol) { + this._eol = e.eol; + this._lineStarts = null; + } + const changes = e.changes; + for (const change of changes) { + this._acceptDeleteRange(change.range); + this._acceptInsertText(new Position(change.range.startLineNumber, change.range.startColumn), change.text); + } + this._versionId = e.versionId; + this._cachedTextValue = null; + } + _ensureLineStarts() { + if (!this._lineStarts) { + const eolLength = this._eol.length; + const linesLength = this._lines.length; + const lineStartValues = new Uint32Array(linesLength); + for (let i2 = 0; i2 < linesLength; i2++) { + lineStartValues[i2] = this._lines[i2].length + eolLength; + } + this._lineStarts = new PrefixSumComputer(lineStartValues); + } + } + /** + * All changes to a line's text go through this method + */ + _setLineText(lineIndex, newValue) { + this._lines[lineIndex] = newValue; + if (this._lineStarts) { + this._lineStarts.setValue(lineIndex, this._lines[lineIndex].length + this._eol.length); + } + } + _acceptDeleteRange(range2) { + if (range2.startLineNumber === range2.endLineNumber) { + if (range2.startColumn === range2.endColumn) { + return; + } + this._setLineText(range2.startLineNumber - 1, this._lines[range2.startLineNumber - 1].substring(0, range2.startColumn - 1) + this._lines[range2.startLineNumber - 1].substring(range2.endColumn - 1)); + return; + } + this._setLineText(range2.startLineNumber - 1, this._lines[range2.startLineNumber - 1].substring(0, range2.startColumn - 1) + this._lines[range2.endLineNumber - 1].substring(range2.endColumn - 1)); + this._lines.splice(range2.startLineNumber, range2.endLineNumber - range2.startLineNumber); + if (this._lineStarts) { + this._lineStarts.removeValues(range2.startLineNumber, range2.endLineNumber - range2.startLineNumber); + } + } + _acceptInsertText(position, insertText) { + if (insertText.length === 0) { + return; + } + const insertLines = splitLines(insertText); + if (insertLines.length === 1) { + this._setLineText(position.lineNumber - 1, this._lines[position.lineNumber - 1].substring(0, position.column - 1) + insertLines[0] + this._lines[position.lineNumber - 1].substring(position.column - 1)); + return; + } + insertLines[insertLines.length - 1] += this._lines[position.lineNumber - 1].substring(position.column - 1); + this._setLineText(position.lineNumber - 1, this._lines[position.lineNumber - 1].substring(0, position.column - 1) + insertLines[0]); + const newLengths = new Uint32Array(insertLines.length - 1); + for (let i2 = 1; i2 < insertLines.length; i2++) { + this._lines.splice(position.lineNumber + i2 - 1, 0, insertLines[i2]); + newLengths[i2 - 1] = insertLines[i2].length + this._eol.length; + } + if (this._lineStarts) { + this._lineStarts.insertValues(position.lineNumber, newLengths); + } + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/common/services/textModelSync/textModelSync.impl.js +var STOP_SYNC_MODEL_DELTA_TIME_MS = 60 * 1e3; +var WorkerTextModelSyncClient = class extends Disposable { + constructor(proxy, modelService, keepIdleModels = false) { + super(); + this._syncedModels = /* @__PURE__ */ Object.create(null); + this._syncedModelsLastUsedTime = /* @__PURE__ */ Object.create(null); + this._proxy = proxy; + this._modelService = modelService; + if (!keepIdleModels) { + const timer = new IntervalTimer(); + timer.cancelAndSet(() => this._checkStopModelSync(), Math.round(STOP_SYNC_MODEL_DELTA_TIME_MS / 2)); + this._register(timer); + } + } + dispose() { + for (const modelUrl in this._syncedModels) { + dispose(this._syncedModels[modelUrl]); + } + this._syncedModels = /* @__PURE__ */ Object.create(null); + this._syncedModelsLastUsedTime = /* @__PURE__ */ Object.create(null); + super.dispose(); + } + ensureSyncedResources(resources, forceLargeModels = false) { + for (const resource of resources) { + const resourceStr = resource.toString(); + if (!this._syncedModels[resourceStr]) { + this._beginModelSync(resource, forceLargeModels); + } + if (this._syncedModels[resourceStr]) { + this._syncedModelsLastUsedTime[resourceStr] = (/* @__PURE__ */ new Date()).getTime(); + } + } + } + _checkStopModelSync() { + const currentTime = (/* @__PURE__ */ new Date()).getTime(); + const toRemove = []; + for (const modelUrl in this._syncedModelsLastUsedTime) { + const elapsedTime = currentTime - this._syncedModelsLastUsedTime[modelUrl]; + if (elapsedTime > STOP_SYNC_MODEL_DELTA_TIME_MS) { + toRemove.push(modelUrl); + } + } + for (const e of toRemove) { + this._stopModelSync(e); + } + } + _beginModelSync(resource, forceLargeModels) { + const model = this._modelService.getModel(resource); + if (!model) { + return; + } + if (!forceLargeModels && model.isTooLargeForSyncing()) { + return; + } + const modelUrl = resource.toString(); + this._proxy.$acceptNewModel({ + url: model.uri.toString(), + lines: model.getLinesContent(), + EOL: model.getEOL(), + versionId: model.getVersionId() + }); + const toDispose = new DisposableStore(); + toDispose.add(model.onDidChangeContent((e) => { + this._proxy.$acceptModelChanged(modelUrl.toString(), e); + })); + toDispose.add(model.onWillDispose(() => { + this._stopModelSync(modelUrl); + })); + toDispose.add(toDisposable(() => { + this._proxy.$acceptRemovedModel(modelUrl); + })); + this._syncedModels[modelUrl] = toDispose; + } + _stopModelSync(modelUrl) { + const toDispose = this._syncedModels[modelUrl]; + delete this._syncedModels[modelUrl]; + delete this._syncedModelsLastUsedTime[modelUrl]; + dispose(toDispose); + } +}; +var WorkerTextModelSyncServer = class { + constructor() { + this._models = /* @__PURE__ */ Object.create(null); + } + getModel(uri) { + return this._models[uri]; + } + getModels() { + const all = []; + Object.keys(this._models).forEach((key) => all.push(this._models[key])); + return all; + } + $acceptNewModel(data) { + this._models[data.url] = new MirrorModel(URI.parse(data.url), data.lines, data.EOL, data.versionId); + } + $acceptModelChanged(uri, e) { + if (!this._models[uri]) { + return; + } + const model = this._models[uri]; + model.onEvents(e); + } + $acceptRemovedModel(uri) { + if (!this._models[uri]) { + return; + } + delete this._models[uri]; + } +}; +var MirrorModel = class extends MirrorTextModel { + get uri() { + return this._uri; + } + get eol() { + return this._eol; + } + getValue() { + return this.getText(); + } + findMatches(regex) { + const matches = []; + for (let i2 = 0; i2 < this._lines.length; i2++) { + const line = this._lines[i2]; + const offsetToAdd = this.offsetAt(new Position(i2 + 1, 1)); + const iteratorOverMatches = line.matchAll(regex); + for (const match2 of iteratorOverMatches) { + if (match2.index || match2.index === 0) { + match2.index = match2.index + offsetToAdd; + } + matches.push(match2); + } + } + return matches; + } + getLinesContent() { + return this._lines.slice(0); + } + getLineCount() { + return this._lines.length; + } + getLineContent(lineNumber) { + return this._lines[lineNumber - 1]; + } + getWordAtPosition(position, wordDefinition) { + const wordAtText = getWordAtText(position.column, ensureValidWordDefinition(wordDefinition), this._lines[position.lineNumber - 1], 0); + if (wordAtText) { + return new Range(position.lineNumber, wordAtText.startColumn, position.lineNumber, wordAtText.endColumn); + } + return null; + } + words(wordDefinition) { + const lines = this._lines; + const wordenize = this._wordenize.bind(this); + let lineNumber = 0; + let lineText = ""; + let wordRangesIdx = 0; + let wordRanges = []; + return { + *[Symbol.iterator]() { + while (true) { + if (wordRangesIdx < wordRanges.length) { + const value = lineText.substring(wordRanges[wordRangesIdx].start, wordRanges[wordRangesIdx].end); + wordRangesIdx += 1; + yield value; + } else { + if (lineNumber < lines.length) { + lineText = lines[lineNumber]; + wordRanges = wordenize(lineText, wordDefinition); + wordRangesIdx = 0; + lineNumber += 1; + } else { + break; + } + } + } + } + }; + } + getLineWords(lineNumber, wordDefinition) { + const content = this._lines[lineNumber - 1]; + const ranges = this._wordenize(content, wordDefinition); + const words = []; + for (const range2 of ranges) { + words.push({ + word: content.substring(range2.start, range2.end), + startColumn: range2.start + 1, + endColumn: range2.end + 1 + }); + } + return words; + } + _wordenize(content, wordDefinition) { + const result = []; + let match2; + wordDefinition.lastIndex = 0; + while (match2 = wordDefinition.exec(content)) { + if (match2[0].length === 0) { + break; + } + result.push({ start: match2.index, end: match2.index + match2[0].length }); + } + return result; + } + getValueInRange(range2) { + range2 = this._validateRange(range2); + if (range2.startLineNumber === range2.endLineNumber) { + return this._lines[range2.startLineNumber - 1].substring(range2.startColumn - 1, range2.endColumn - 1); + } + const lineEnding = this._eol; + const startLineIndex = range2.startLineNumber - 1; + const endLineIndex = range2.endLineNumber - 1; + const resultLines = []; + resultLines.push(this._lines[startLineIndex].substring(range2.startColumn - 1)); + for (let i2 = startLineIndex + 1; i2 < endLineIndex; i2++) { + resultLines.push(this._lines[i2]); + } + resultLines.push(this._lines[endLineIndex].substring(0, range2.endColumn - 1)); + return resultLines.join(lineEnding); + } + offsetAt(position) { + position = this._validatePosition(position); + this._ensureLineStarts(); + return this._lineStarts.getPrefixSum(position.lineNumber - 2) + (position.column - 1); + } + positionAt(offset) { + offset = Math.floor(offset); + offset = Math.max(0, offset); + this._ensureLineStarts(); + const out = this._lineStarts.getIndexOf(offset); + const lineLength = this._lines[out.index].length; + return { + lineNumber: 1 + out.index, + column: 1 + Math.min(out.remainder, lineLength) + }; + } + _validateRange(range2) { + const start = this._validatePosition({ lineNumber: range2.startLineNumber, column: range2.startColumn }); + const end = this._validatePosition({ lineNumber: range2.endLineNumber, column: range2.endColumn }); + if (start.lineNumber !== range2.startLineNumber || start.column !== range2.startColumn || end.lineNumber !== range2.endLineNumber || end.column !== range2.endColumn) { + return { + startLineNumber: start.lineNumber, + startColumn: start.column, + endLineNumber: end.lineNumber, + endColumn: end.column + }; + } + return range2; + } + _validatePosition(position) { + if (!Position.isIPosition(position)) { + throw new Error("bad position"); + } + let { lineNumber, column } = position; + let hasChanged = false; + if (lineNumber < 1) { + lineNumber = 1; + column = 1; + hasChanged = true; + } else if (lineNumber > this._lines.length) { + lineNumber = this._lines.length; + column = this._lines[lineNumber - 1].length + 1; + hasChanged = true; + } else { + const maxCharacter = this._lines[lineNumber - 1].length + 1; + if (column < 1) { + column = 1; + hasChanged = true; + } else if (column > maxCharacter) { + column = maxCharacter; + hasChanged = true; + } + } + if (!hasChanged) { + return position; + } else { + return { lineNumber, column }; + } + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/common/services/editorWebWorker.js +var EditorWorker = class _EditorWorker { + constructor(_foreignModule = null) { + this._foreignModule = _foreignModule; + this._requestHandlerBrand = void 0; + this._workerTextModelSyncServer = new WorkerTextModelSyncServer(); + } + dispose() { + } + async $ping() { + return "pong"; + } + _getModel(uri) { + return this._workerTextModelSyncServer.getModel(uri); + } + getModels() { + return this._workerTextModelSyncServer.getModels(); + } + $acceptNewModel(data) { + this._workerTextModelSyncServer.$acceptNewModel(data); + } + $acceptModelChanged(uri, e) { + this._workerTextModelSyncServer.$acceptModelChanged(uri, e); + } + $acceptRemovedModel(uri) { + this._workerTextModelSyncServer.$acceptRemovedModel(uri); + } + async $computeUnicodeHighlights(url, options2, range2) { + const model = this._getModel(url); + if (!model) { + return { ranges: [], hasMore: false, ambiguousCharacterCount: 0, invisibleCharacterCount: 0, nonBasicAsciiCharacterCount: 0 }; + } + return UnicodeTextModelHighlighter.computeUnicodeHighlights(model, options2, range2); + } + async $findSectionHeaders(url, options2) { + const model = this._getModel(url); + if (!model) { + return []; + } + return findSectionHeaders(model, options2); + } + // ---- BEGIN diff -------------------------------------------------------------------------- + async $computeDiff(originalUrl, modifiedUrl, options2, algorithm) { + const original = this._getModel(originalUrl); + const modified = this._getModel(modifiedUrl); + if (!original || !modified) { + return null; + } + const result = _EditorWorker.computeDiff(original, modified, options2, algorithm); + return result; + } + static computeDiff(originalTextModel, modifiedTextModel, options2, algorithm) { + const diffAlgorithm = algorithm === "advanced" ? linesDiffComputers.getDefault() : linesDiffComputers.getLegacy(); + const originalLines = originalTextModel.getLinesContent(); + const modifiedLines = modifiedTextModel.getLinesContent(); + const result = diffAlgorithm.computeDiff(originalLines, modifiedLines, options2); + const identical = result.changes.length > 0 ? false : this._modelsAreIdentical(originalTextModel, modifiedTextModel); + function getLineChanges(changes) { + return changes.map((m) => [m.original.startLineNumber, m.original.endLineNumberExclusive, m.modified.startLineNumber, m.modified.endLineNumberExclusive, m.innerChanges?.map((m2) => [ + m2.originalRange.startLineNumber, + m2.originalRange.startColumn, + m2.originalRange.endLineNumber, + m2.originalRange.endColumn, + m2.modifiedRange.startLineNumber, + m2.modifiedRange.startColumn, + m2.modifiedRange.endLineNumber, + m2.modifiedRange.endColumn + ])]); + } + return { + identical, + quitEarly: result.hitTimeout, + changes: getLineChanges(result.changes), + moves: result.moves.map((m) => [ + m.lineRangeMapping.original.startLineNumber, + m.lineRangeMapping.original.endLineNumberExclusive, + m.lineRangeMapping.modified.startLineNumber, + m.lineRangeMapping.modified.endLineNumberExclusive, + getLineChanges(m.changes) + ]) + }; + } + static _modelsAreIdentical(original, modified) { + const originalLineCount = original.getLineCount(); + const modifiedLineCount = modified.getLineCount(); + if (originalLineCount !== modifiedLineCount) { + return false; + } + for (let line = 1; line <= originalLineCount; line++) { + const originalLine = original.getLineContent(line); + const modifiedLine = modified.getLineContent(line); + if (originalLine !== modifiedLine) { + return false; + } + } + return true; + } + static { + this._diffLimit = 1e5; + } + async $computeMoreMinimalEdits(modelUrl, edits, pretty) { + const model = this._getModel(modelUrl); + if (!model) { + return edits; + } + const result = []; + let lastEol = void 0; + edits = edits.slice(0).sort((a, b) => { + if (a.range && b.range) { + return Range.compareRangesUsingStarts(a.range, b.range); + } + const aRng = a.range ? 0 : 1; + const bRng = b.range ? 0 : 1; + return aRng - bRng; + }); + let writeIndex = 0; + for (let readIndex = 1; readIndex < edits.length; readIndex++) { + if (Range.getEndPosition(edits[writeIndex].range).equals(Range.getStartPosition(edits[readIndex].range))) { + edits[writeIndex].range = Range.fromPositions(Range.getStartPosition(edits[writeIndex].range), Range.getEndPosition(edits[readIndex].range)); + edits[writeIndex].text += edits[readIndex].text; + } else { + writeIndex++; + edits[writeIndex] = edits[readIndex]; + } + } + edits.length = writeIndex + 1; + for (let { range: range2, text: text2, eol } of edits) { + if (typeof eol === "number") { + lastEol = eol; + } + if (Range.isEmpty(range2) && !text2) { + continue; + } + const original = model.getValueInRange(range2); + text2 = text2.replace(/\r\n|\n|\r/g, model.eol); + if (original === text2) { + continue; + } + if (Math.max(text2.length, original.length) > _EditorWorker._diffLimit) { + result.push({ range: range2, text: text2 }); + continue; + } + const changes = stringDiff(original, text2, pretty); + const editOffset = model.offsetAt(Range.lift(range2).getStartPosition()); + for (const change of changes) { + const start = model.positionAt(editOffset + change.originalStart); + const end = model.positionAt(editOffset + change.originalStart + change.originalLength); + const newEdit = { + text: text2.substr(change.modifiedStart, change.modifiedLength), + range: { startLineNumber: start.lineNumber, startColumn: start.column, endLineNumber: end.lineNumber, endColumn: end.column } + }; + if (model.getValueInRange(newEdit.range) !== newEdit.text) { + result.push(newEdit); + } + } + } + if (typeof lastEol === "number") { + result.push({ eol: lastEol, text: "", range: { startLineNumber: 0, startColumn: 0, endLineNumber: 0, endColumn: 0 } }); + } + return result; + } + // ---- END minimal edits --------------------------------------------------------------- + async $computeLinks(modelUrl) { + const model = this._getModel(modelUrl); + if (!model) { + return null; + } + return computeLinks(model); + } + // --- BEGIN default document colors ----------------------------------------------------------- + async $computeDefaultDocumentColors(modelUrl) { + const model = this._getModel(modelUrl); + if (!model) { + return null; + } + return computeDefaultDocumentColors(model); + } + static { + this._suggestionsLimit = 1e4; + } + async $textualSuggest(modelUrls, leadingWord, wordDef, wordDefFlags) { + const sw = new StopWatch(); + const wordDefRegExp = new RegExp(wordDef, wordDefFlags); + const seen = /* @__PURE__ */ new Set(); + outer: for (const url of modelUrls) { + const model = this._getModel(url); + if (!model) { + continue; + } + for (const word of model.words(wordDefRegExp)) { + if (word === leadingWord || !isNaN(Number(word))) { + continue; + } + seen.add(word); + if (seen.size > _EditorWorker._suggestionsLimit) { + break outer; + } + } + } + return { words: Array.from(seen), duration: sw.elapsed() }; + } + // ---- END suggest -------------------------------------------------------------------------- + //#region -- word ranges -- + async $computeWordRanges(modelUrl, range2, wordDef, wordDefFlags) { + const model = this._getModel(modelUrl); + if (!model) { + return /* @__PURE__ */ Object.create(null); + } + const wordDefRegExp = new RegExp(wordDef, wordDefFlags); + const result = /* @__PURE__ */ Object.create(null); + for (let line = range2.startLineNumber; line < range2.endLineNumber; line++) { + const words = model.getLineWords(line, wordDefRegExp); + for (const word of words) { + if (!isNaN(Number(word.word))) { + continue; + } + let array2 = result[word.word]; + if (!array2) { + array2 = []; + result[word.word] = array2; + } + array2.push({ + startLineNumber: line, + startColumn: word.startColumn, + endLineNumber: line, + endColumn: word.endColumn + }); + } + } + return result; + } + //#endregion + async $navigateValueSet(modelUrl, range2, up, wordDef, wordDefFlags) { + const model = this._getModel(modelUrl); + if (!model) { + return null; + } + const wordDefRegExp = new RegExp(wordDef, wordDefFlags); + if (range2.startColumn === range2.endColumn) { + range2 = { + startLineNumber: range2.startLineNumber, + startColumn: range2.startColumn, + endLineNumber: range2.endLineNumber, + endColumn: range2.endColumn + 1 + }; + } + const selectionText = model.getValueInRange(range2); + const wordRange = model.getWordAtPosition({ lineNumber: range2.startLineNumber, column: range2.startColumn }, wordDefRegExp); + if (!wordRange) { + return null; + } + const word = model.getValueInRange(wordRange); + const result = BasicInplaceReplace.INSTANCE.navigateValueSet(range2, selectionText, wordRange, word, up); + return result; + } + // ---- BEGIN foreign module support -------------------------------------------------------------------------- + // foreign method request + $fmr(method, args) { + if (!this._foreignModule || typeof this._foreignModule[method] !== "function") { + return Promise.reject(new Error("Missing requestHandler or method: " + method)); + } + try { + return Promise.resolve(this._foreignModule[method].apply(this._foreignModule, args)); + } catch (e) { + return Promise.reject(e); + } + } +}; +if (typeof importScripts === "function") { + globalThis.monaco = createMonacoBaseAPI(); +} + +// node_modules/monaco-editor-core/esm/vs/editor/browser/services/editorWorkerService.js +init_model(); +init_arrays(); +init_log(); +init_stopwatch(); +init_errors(); +init_languageFeatures(); +init_lineRange(); +init_window(); +init_dom(); + +// node_modules/monaco-editor-core/esm/vs/editor/common/services/editorWorkerHost.js +var EditorWorkerHost = class _EditorWorkerHost { + static { + this.CHANNEL_NAME = "editorWorkerHost"; + } + static getChannel(workerServer) { + return workerServer.getChannel(_EditorWorkerHost.CHANNEL_NAME); + } + static setChannel(workerClient, obj) { + workerClient.setChannel(_EditorWorkerHost.CHANNEL_NAME, obj); + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/browser/services/editorWorkerService.js +var __decorate166 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param160 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var STOP_WORKER_DELTA_TIME_MS = 5 * 60 * 1e3; +function canSyncModel(modelService, resource) { + const model = modelService.getModel(resource); + if (!model) { + return false; + } + if (model.isTooLargeForSyncing()) { + return false; + } + return true; +} +var EditorWorkerService = class EditorWorkerService2 extends Disposable { + constructor(workerDescriptor, modelService, configurationService, logService, _languageConfigurationService, languageFeaturesService) { + super(); + this._languageConfigurationService = _languageConfigurationService; + this._modelService = modelService; + this._workerManager = this._register(new WorkerManager(workerDescriptor, this._modelService)); + this._logService = logService; + this._register(languageFeaturesService.linkProvider.register({ language: "*", hasAccessToAllModels: true }, { + provideLinks: async (model, token) => { + if (!canSyncModel(this._modelService, model.uri)) { + return Promise.resolve({ links: [] }); + } + const worker = await this._workerWithResources([model.uri]); + const links = await worker.$computeLinks(model.uri.toString()); + return links && { links }; + } + })); + this._register(languageFeaturesService.completionProvider.register("*", new WordBasedCompletionItemProvider(this._workerManager, configurationService, this._modelService, this._languageConfigurationService, this._logService))); + } + dispose() { + super.dispose(); + } + canComputeUnicodeHighlights(uri) { + return canSyncModel(this._modelService, uri); + } + async computedUnicodeHighlights(uri, options2, range2) { + const worker = await this._workerWithResources([uri]); + return worker.$computeUnicodeHighlights(uri.toString(), options2, range2); + } + async computeDiff(original, modified, options2, algorithm) { + const worker = await this._workerWithResources( + [original, modified], + /* forceLargeModels */ + true + ); + const result = await worker.$computeDiff(original.toString(), modified.toString(), options2, algorithm); + if (!result) { + return null; + } + const diff = { + identical: result.identical, + quitEarly: result.quitEarly, + changes: toLineRangeMappings(result.changes), + moves: result.moves.map((m) => new MovedText(new LineRangeMapping(new LineRange(m[0], m[1]), new LineRange(m[2], m[3])), toLineRangeMappings(m[4]))) + }; + return diff; + function toLineRangeMappings(changes) { + return changes.map((c) => new DetailedLineRangeMapping(new LineRange(c[0], c[1]), new LineRange(c[2], c[3]), c[4]?.map((c2) => new RangeMapping(new Range(c2[0], c2[1], c2[2], c2[3]), new Range(c2[4], c2[5], c2[6], c2[7]))))); + } + } + async computeMoreMinimalEdits(resource, edits, pretty = false) { + if (isNonEmptyArray(edits)) { + if (!canSyncModel(this._modelService, resource)) { + return Promise.resolve(edits); + } + const sw = StopWatch.create(); + const result = this._workerWithResources([resource]).then((worker) => worker.$computeMoreMinimalEdits(resource.toString(), edits, pretty)); + result.finally(() => this._logService.trace("FORMAT#computeMoreMinimalEdits", resource.toString(true), sw.elapsed())); + return Promise.race([result, timeout(1e3).then(() => edits)]); + } else { + return Promise.resolve(void 0); + } + } + canNavigateValueSet(resource) { + return canSyncModel(this._modelService, resource); + } + async navigateValueSet(resource, range2, up) { + const model = this._modelService.getModel(resource); + if (!model) { + return null; + } + const wordDefRegExp = this._languageConfigurationService.getLanguageConfiguration(model.getLanguageId()).getWordDefinition(); + const wordDef = wordDefRegExp.source; + const wordDefFlags = wordDefRegExp.flags; + const worker = await this._workerWithResources([resource]); + return worker.$navigateValueSet(resource.toString(), range2, up, wordDef, wordDefFlags); + } + canComputeWordRanges(resource) { + return canSyncModel(this._modelService, resource); + } + async computeWordRanges(resource, range2) { + const model = this._modelService.getModel(resource); + if (!model) { + return Promise.resolve(null); + } + const wordDefRegExp = this._languageConfigurationService.getLanguageConfiguration(model.getLanguageId()).getWordDefinition(); + const wordDef = wordDefRegExp.source; + const wordDefFlags = wordDefRegExp.flags; + const worker = await this._workerWithResources([resource]); + return worker.$computeWordRanges(resource.toString(), range2, wordDef, wordDefFlags); + } + async findSectionHeaders(uri, options2) { + const worker = await this._workerWithResources([uri]); + return worker.$findSectionHeaders(uri.toString(), options2); + } + async computeDefaultDocumentColors(uri) { + const worker = await this._workerWithResources([uri]); + return worker.$computeDefaultDocumentColors(uri.toString()); + } + async _workerWithResources(resources, forceLargeModels = false) { + const worker = await this._workerManager.withWorker(); + return await worker.workerWithSyncedResources(resources, forceLargeModels); + } +}; +EditorWorkerService = __decorate166([ + __param160(1, IModelService), + __param160(2, ITextResourceConfigurationService), + __param160(3, ILogService), + __param160(4, ILanguageConfigurationService), + __param160(5, ILanguageFeaturesService) +], EditorWorkerService); +var WordBasedCompletionItemProvider = class { + constructor(workerManager, configurationService, modelService, languageConfigurationService, logService) { + this.languageConfigurationService = languageConfigurationService; + this.logService = logService; + this._debugDisplayName = "wordbasedCompletions"; + this._workerManager = workerManager; + this._configurationService = configurationService; + this._modelService = modelService; + } + async provideCompletionItems(model, position) { + const config = this._configurationService.getValue(model.uri, position, "editor"); + if (config.wordBasedSuggestions === "off") { + return void 0; + } + const models = []; + if (config.wordBasedSuggestions === "currentDocument") { + if (canSyncModel(this._modelService, model.uri)) { + models.push(model.uri); + } + } else { + for (const candidate of this._modelService.getModels()) { + if (!canSyncModel(this._modelService, candidate.uri)) { + continue; + } + if (candidate === model) { + models.unshift(candidate.uri); + } else if (config.wordBasedSuggestions === "allDocuments" || candidate.getLanguageId() === model.getLanguageId()) { + models.push(candidate.uri); + } + } + } + if (models.length === 0) { + return void 0; + } + const wordDefRegExp = this.languageConfigurationService.getLanguageConfiguration(model.getLanguageId()).getWordDefinition(); + const word = model.getWordAtPosition(position); + const replace = !word ? Range.fromPositions(position) : new Range(position.lineNumber, word.startColumn, position.lineNumber, word.endColumn); + const insert = replace.setEndPosition(position.lineNumber, position.column); + this.logService.trace("[WordBasedCompletionItemProvider]", `word: "${word?.word || ""}", wordDef: "${wordDefRegExp}", replace: [${replace.toString()}], insert: [${insert.toString()}]`); + const client = await this._workerManager.withWorker(); + const data = await client.textualSuggest(models, word?.word, wordDefRegExp); + if (!data) { + return void 0; + } + return { + duration: data.duration, + suggestions: data.words.map((word2) => { + return { + kind: 18, + label: word2, + insertText: word2, + range: { insert, replace } + }; + }) + }; + } +}; +var WorkerManager = class WorkerManager2 extends Disposable { + constructor(_workerDescriptor, modelService) { + super(); + this._workerDescriptor = _workerDescriptor; + this._modelService = modelService; + this._editorWorkerClient = null; + this._lastWorkerUsedTime = (/* @__PURE__ */ new Date()).getTime(); + const stopWorkerInterval = this._register(new WindowIntervalTimer()); + stopWorkerInterval.cancelAndSet(() => this._checkStopIdleWorker(), Math.round(STOP_WORKER_DELTA_TIME_MS / 2), mainWindow); + this._register(this._modelService.onModelRemoved((_) => this._checkStopEmptyWorker())); + } + dispose() { + if (this._editorWorkerClient) { + this._editorWorkerClient.dispose(); + this._editorWorkerClient = null; + } + super.dispose(); + } + /** + * Check if the model service has no more models and stop the worker if that is the case. + */ + _checkStopEmptyWorker() { + if (!this._editorWorkerClient) { + return; + } + const models = this._modelService.getModels(); + if (models.length === 0) { + this._editorWorkerClient.dispose(); + this._editorWorkerClient = null; + } + } + /** + * Check if the worker has been idle for a while and then stop it. + */ + _checkStopIdleWorker() { + if (!this._editorWorkerClient) { + return; + } + const timeSinceLastWorkerUsedTime = (/* @__PURE__ */ new Date()).getTime() - this._lastWorkerUsedTime; + if (timeSinceLastWorkerUsedTime > STOP_WORKER_DELTA_TIME_MS) { + this._editorWorkerClient.dispose(); + this._editorWorkerClient = null; + } + } + withWorker() { + this._lastWorkerUsedTime = (/* @__PURE__ */ new Date()).getTime(); + if (!this._editorWorkerClient) { + this._editorWorkerClient = new EditorWorkerClient(this._workerDescriptor, false, this._modelService); + } + return Promise.resolve(this._editorWorkerClient); + } +}; +WorkerManager = __decorate166([ + __param160(1, IModelService) +], WorkerManager); +var SynchronousWorkerClient = class { + constructor(instance) { + this._instance = instance; + this.proxy = this._instance; + } + dispose() { + this._instance.dispose(); + } + setChannel(channel, handler) { + throw new Error(`Not supported`); + } +}; +var EditorWorkerClient = class EditorWorkerClient2 extends Disposable { + constructor(_workerDescriptorOrWorker, keepIdleModels, modelService) { + super(); + this._workerDescriptorOrWorker = _workerDescriptorOrWorker; + this._disposed = false; + this._modelService = modelService; + this._keepIdleModels = keepIdleModels; + this._worker = null; + this._modelManager = null; + } + // foreign host request + fhr(method, args) { + throw new Error(`Not implemented!`); + } + _getOrCreateWorker() { + if (!this._worker) { + try { + this._worker = this._register(createWebWorker(this._workerDescriptorOrWorker)); + EditorWorkerHost.setChannel(this._worker, this._createEditorWorkerHost()); + } catch (err) { + logOnceWebWorkerWarning(err); + this._worker = this._createFallbackLocalWorker(); + } + } + return this._worker; + } + async _getProxy() { + try { + const proxy = this._getOrCreateWorker().proxy; + await proxy.$ping(); + return proxy; + } catch (err) { + logOnceWebWorkerWarning(err); + this._worker = this._createFallbackLocalWorker(); + return this._worker.proxy; + } + } + _createFallbackLocalWorker() { + return new SynchronousWorkerClient(new EditorWorker(null)); + } + _createEditorWorkerHost() { + return { + $fhr: (method, args) => this.fhr(method, args) + }; + } + _getOrCreateModelManager(proxy) { + if (!this._modelManager) { + this._modelManager = this._register(new WorkerTextModelSyncClient(proxy, this._modelService, this._keepIdleModels)); + } + return this._modelManager; + } + async workerWithSyncedResources(resources, forceLargeModels = false) { + if (this._disposed) { + return Promise.reject(canceled()); + } + const proxy = await this._getProxy(); + this._getOrCreateModelManager(proxy).ensureSyncedResources(resources, forceLargeModels); + return proxy; + } + async textualSuggest(resources, leadingWord, wordDefRegExp) { + const proxy = await this.workerWithSyncedResources(resources); + const wordDef = wordDefRegExp.source; + const wordDefFlags = wordDefRegExp.flags; + return proxy.$textualSuggest(resources.map((r) => r.toString()), leadingWord, wordDef, wordDefFlags); + } + dispose() { + super.dispose(); + this._disposed = true; + } +}; +EditorWorkerClient = __decorate166([ + __param160(2, IModelService) +], EditorWorkerClient); + +// node_modules/monaco-editor-core/esm/vs/editor/standalone/browser/standaloneWebWorker.js +function createWebWorker2(modelService, opts) { + return new MonacoWebWorkerImpl(modelService, opts); +} +var MonacoWebWorkerImpl = class extends EditorWorkerClient { + constructor(modelService, opts) { + super(opts.worker, opts.keepIdleModels || false, modelService); + this._foreignModuleHost = opts.host || null; + this._foreignProxy = this._getProxy().then((proxy) => { + return new Proxy({}, { + get(target, prop, receiver) { + if (prop === "then") { + return void 0; + } + if (typeof prop !== "string") { + throw new Error(`Not supported`); + } + return (...args) => { + return proxy.$fmr(prop, args); + }; + } + }); + }); + } + // foreign host request + fhr(method, args) { + if (!this._foreignModuleHost || typeof this._foreignModuleHost[method] !== "function") { + return Promise.reject(new Error("Missing method " + method + " or missing main thread foreign host.")); + } + try { + return Promise.resolve(this._foreignModuleHost[method].apply(this._foreignModuleHost, args)); + } catch (e) { + return Promise.reject(e); + } + } + getProxy() { + return this._foreignProxy; + } + withSyncedResources(resources) { + return this.workerWithSyncedResources(resources).then((_) => this.getProxy()); + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/standalone/browser/standaloneEditor.js +init_languages(); +init_language(); +init_modesRegistry(); +init_nullTokenize(); +init_model2(); +init_model(); + +// node_modules/monaco-editor-core/esm/vs/editor/standalone/browser/colorizer.js +init_strings(); +init_languages(); +init_lineTokens(); + +// node_modules/monaco-editor-core/esm/vs/editor/standalone/common/monarch/monarchLexer.js +init_lifecycle(); +init_languages(); +init_nullTokenize(); + +// node_modules/monaco-editor-core/esm/vs/editor/standalone/common/monarch/monarchCommon.js +init_strings(); +function isFuzzyActionArr(what) { + return Array.isArray(what); +} +function isFuzzyAction(what) { + return !isFuzzyActionArr(what); +} +function isString2(what) { + return typeof what === "string"; +} +function isIAction(what) { + return !isString2(what); +} +function empty(s) { + return s ? false : true; +} +function fixCase(lexer2, str) { + return lexer2.ignoreCase && str ? str.toLowerCase() : str; +} +function sanitize(s) { + return s.replace(/[&<>'"_]/g, "-"); +} +function log(lexer2, msg) { + console.log(`${lexer2.languageId}: ${msg}`); +} +function createError(lexer2, msg) { + return new Error(`${lexer2.languageId}: ${msg}`); +} +function substituteMatches(lexer2, str, id, matches, state) { + const re = /\$((\$)|(#)|(\d\d?)|[sS](\d\d?)|@(\w+))/g; + let stateMatches = null; + return str.replace(re, function(full, sub, dollar, hash2, n2, s, attr, ofs, total) { + if (!empty(dollar)) { + return "$"; + } + if (!empty(hash2)) { + return fixCase(lexer2, id); + } + if (!empty(n2) && n2 < matches.length) { + return fixCase(lexer2, matches[n2]); + } + if (!empty(attr) && lexer2 && typeof lexer2[attr] === "string") { + return lexer2[attr]; + } + if (stateMatches === null) { + stateMatches = state.split("."); + stateMatches.unshift(state); + } + if (!empty(s) && s < stateMatches.length) { + return fixCase(lexer2, stateMatches[s]); + } + return ""; + }); +} +function substituteMatchesRe(lexer2, str, state) { + const re = /\$[sS](\d\d?)/g; + let stateMatches = null; + return str.replace(re, function(full, s) { + if (stateMatches === null) { + stateMatches = state.split("."); + stateMatches.unshift(state); + } + if (!empty(s) && s < stateMatches.length) { + return escapeRegExpCharacters(fixCase(lexer2, stateMatches[s])); + } + return ""; + }); +} +function findRules(lexer2, inState) { + let state = inState; + while (state && state.length > 0) { + const rules = lexer2.tokenizer[state]; + if (rules) { + return rules; + } + const idx = state.lastIndexOf("."); + if (idx < 0) { + state = null; + } else { + state = state.substr(0, idx); + } + } + return null; +} +function stateExists(lexer2, inState) { + let state = inState; + while (state && state.length > 0) { + const exist = lexer2.stateNames[state]; + if (exist) { + return true; + } + const idx = state.lastIndexOf("."); + if (idx < 0) { + state = null; + } else { + state = state.substr(0, idx); + } + } + return false; +} + +// node_modules/monaco-editor-core/esm/vs/editor/standalone/common/monarch/monarchLexer.js +init_configuration(); +var __decorate167 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param161 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var MonarchTokenizer_1; +var CACHE_STACK_DEPTH = 5; +var MonarchStackElementFactory = class _MonarchStackElementFactory { + static { + this._INSTANCE = new _MonarchStackElementFactory(CACHE_STACK_DEPTH); + } + static create(parent, state) { + return this._INSTANCE.create(parent, state); + } + constructor(maxCacheDepth) { + this._maxCacheDepth = maxCacheDepth; + this._entries = /* @__PURE__ */ Object.create(null); + } + create(parent, state) { + if (parent !== null && parent.depth >= this._maxCacheDepth) { + return new MonarchStackElement(parent, state); + } + let stackElementId = MonarchStackElement.getStackElementId(parent); + if (stackElementId.length > 0) { + stackElementId += "|"; + } + stackElementId += state; + let result = this._entries[stackElementId]; + if (result) { + return result; + } + result = new MonarchStackElement(parent, state); + this._entries[stackElementId] = result; + return result; + } +}; +var MonarchStackElement = class _MonarchStackElement { + constructor(parent, state) { + this.parent = parent; + this.state = state; + this.depth = (this.parent ? this.parent.depth : 0) + 1; + } + static getStackElementId(element) { + let result = ""; + while (element !== null) { + if (result.length > 0) { + result += "|"; + } + result += element.state; + element = element.parent; + } + return result; + } + static _equals(a, b) { + while (a !== null && b !== null) { + if (a === b) { + return true; + } + if (a.state !== b.state) { + return false; + } + a = a.parent; + b = b.parent; + } + if (a === null && b === null) { + return true; + } + return false; + } + equals(other) { + return _MonarchStackElement._equals(this, other); + } + push(state) { + return MonarchStackElementFactory.create(this, state); + } + pop() { + return this.parent; + } + popall() { + let result = this; + while (result.parent) { + result = result.parent; + } + return result; + } + switchTo(state) { + return MonarchStackElementFactory.create(this.parent, state); + } +}; +var EmbeddedLanguageData = class _EmbeddedLanguageData { + constructor(languageId, state) { + this.languageId = languageId; + this.state = state; + } + equals(other) { + return this.languageId === other.languageId && this.state.equals(other.state); + } + clone() { + const stateClone = this.state.clone(); + if (stateClone === this.state) { + return this; + } + return new _EmbeddedLanguageData(this.languageId, this.state); + } +}; +var MonarchLineStateFactory = class _MonarchLineStateFactory { + static { + this._INSTANCE = new _MonarchLineStateFactory(CACHE_STACK_DEPTH); + } + static create(stack, embeddedLanguageData) { + return this._INSTANCE.create(stack, embeddedLanguageData); + } + constructor(maxCacheDepth) { + this._maxCacheDepth = maxCacheDepth; + this._entries = /* @__PURE__ */ Object.create(null); + } + create(stack, embeddedLanguageData) { + if (embeddedLanguageData !== null) { + return new MonarchLineState(stack, embeddedLanguageData); + } + if (stack !== null && stack.depth >= this._maxCacheDepth) { + return new MonarchLineState(stack, embeddedLanguageData); + } + const stackElementId = MonarchStackElement.getStackElementId(stack); + let result = this._entries[stackElementId]; + if (result) { + return result; + } + result = new MonarchLineState(stack, null); + this._entries[stackElementId] = result; + return result; + } +}; +var MonarchLineState = class _MonarchLineState { + constructor(stack, embeddedLanguageData) { + this.stack = stack; + this.embeddedLanguageData = embeddedLanguageData; + } + clone() { + const embeddedlanguageDataClone = this.embeddedLanguageData ? this.embeddedLanguageData.clone() : null; + if (embeddedlanguageDataClone === this.embeddedLanguageData) { + return this; + } + return MonarchLineStateFactory.create(this.stack, this.embeddedLanguageData); + } + equals(other) { + if (!(other instanceof _MonarchLineState)) { + return false; + } + if (!this.stack.equals(other.stack)) { + return false; + } + if (this.embeddedLanguageData === null && other.embeddedLanguageData === null) { + return true; + } + if (this.embeddedLanguageData === null || other.embeddedLanguageData === null) { + return false; + } + return this.embeddedLanguageData.equals(other.embeddedLanguageData); + } +}; +var MonarchClassicTokensCollector = class { + constructor() { + this._tokens = []; + this._languageId = null; + this._lastTokenType = null; + this._lastTokenLanguage = null; + } + enterLanguage(languageId) { + this._languageId = languageId; + } + emit(startOffset, type) { + if (this._lastTokenType === type && this._lastTokenLanguage === this._languageId) { + return; + } + this._lastTokenType = type; + this._lastTokenLanguage = this._languageId; + this._tokens.push(new Token(startOffset, type, this._languageId)); + } + nestedLanguageTokenize(embeddedLanguageLine, hasEOL, embeddedLanguageData, offsetDelta) { + const nestedLanguageId = embeddedLanguageData.languageId; + const embeddedModeState = embeddedLanguageData.state; + const nestedLanguageTokenizationSupport = TokenizationRegistry2.get(nestedLanguageId); + if (!nestedLanguageTokenizationSupport) { + this.enterLanguage(nestedLanguageId); + this.emit(offsetDelta, ""); + return embeddedModeState; + } + const nestedResult = nestedLanguageTokenizationSupport.tokenize(embeddedLanguageLine, hasEOL, embeddedModeState); + if (offsetDelta !== 0) { + for (const token of nestedResult.tokens) { + this._tokens.push(new Token(token.offset + offsetDelta, token.type, token.language)); + } + } else { + this._tokens = this._tokens.concat(nestedResult.tokens); + } + this._lastTokenType = null; + this._lastTokenLanguage = null; + this._languageId = null; + return nestedResult.endState; + } + finalize(endState) { + return new TokenizationResult(this._tokens, endState); + } +}; +var MonarchModernTokensCollector = class _MonarchModernTokensCollector { + constructor(languageService, theme) { + this._languageService = languageService; + this._theme = theme; + this._prependTokens = null; + this._tokens = []; + this._currentLanguageId = 0; + this._lastTokenMetadata = 0; + } + enterLanguage(languageId) { + this._currentLanguageId = this._languageService.languageIdCodec.encodeLanguageId(languageId); + } + emit(startOffset, type) { + const metadata = this._theme.match(this._currentLanguageId, type) | 1024; + if (this._lastTokenMetadata === metadata) { + return; + } + this._lastTokenMetadata = metadata; + this._tokens.push(startOffset); + this._tokens.push(metadata); + } + static _merge(a, b, c) { + const aLen = a !== null ? a.length : 0; + const bLen = b.length; + const cLen = c !== null ? c.length : 0; + if (aLen === 0 && bLen === 0 && cLen === 0) { + return new Uint32Array(0); + } + if (aLen === 0 && bLen === 0) { + return c; + } + if (bLen === 0 && cLen === 0) { + return a; + } + const result = new Uint32Array(aLen + bLen + cLen); + if (a !== null) { + result.set(a); + } + for (let i2 = 0; i2 < bLen; i2++) { + result[aLen + i2] = b[i2]; + } + if (c !== null) { + result.set(c, aLen + bLen); + } + return result; + } + nestedLanguageTokenize(embeddedLanguageLine, hasEOL, embeddedLanguageData, offsetDelta) { + const nestedLanguageId = embeddedLanguageData.languageId; + const embeddedModeState = embeddedLanguageData.state; + const nestedLanguageTokenizationSupport = TokenizationRegistry2.get(nestedLanguageId); + if (!nestedLanguageTokenizationSupport) { + this.enterLanguage(nestedLanguageId); + this.emit(offsetDelta, ""); + return embeddedModeState; + } + const nestedResult = nestedLanguageTokenizationSupport.tokenizeEncoded(embeddedLanguageLine, hasEOL, embeddedModeState); + if (offsetDelta !== 0) { + for (let i2 = 0, len = nestedResult.tokens.length; i2 < len; i2 += 2) { + nestedResult.tokens[i2] += offsetDelta; + } + } + this._prependTokens = _MonarchModernTokensCollector._merge(this._prependTokens, this._tokens, nestedResult.tokens); + this._tokens = []; + this._currentLanguageId = 0; + this._lastTokenMetadata = 0; + return nestedResult.endState; + } + finalize(endState) { + return new EncodedTokenizationResult(_MonarchModernTokensCollector._merge(this._prependTokens, this._tokens, null), endState); + } +}; +var MonarchTokenizer = MonarchTokenizer_1 = class MonarchTokenizer2 extends Disposable { + constructor(languageService, standaloneThemeService, languageId, lexer2, _configurationService) { + super(); + this._configurationService = _configurationService; + this._languageService = languageService; + this._standaloneThemeService = standaloneThemeService; + this._languageId = languageId; + this._lexer = lexer2; + this._embeddedLanguages = /* @__PURE__ */ Object.create(null); + this.embeddedLoaded = Promise.resolve(void 0); + let emitting = false; + this._register(TokenizationRegistry2.onDidChange((e) => { + if (emitting) { + return; + } + let isOneOfMyEmbeddedModes = false; + for (let i2 = 0, len = e.changedLanguages.length; i2 < len; i2++) { + const language2 = e.changedLanguages[i2]; + if (this._embeddedLanguages[language2]) { + isOneOfMyEmbeddedModes = true; + break; + } + } + if (isOneOfMyEmbeddedModes) { + emitting = true; + TokenizationRegistry2.handleChange([this._languageId]); + emitting = false; + } + })); + this._maxTokenizationLineLength = this._configurationService.getValue("editor.maxTokenizationLineLength", { + overrideIdentifier: this._languageId + }); + this._register(this._configurationService.onDidChangeConfiguration((e) => { + if (e.affectsConfiguration("editor.maxTokenizationLineLength")) { + this._maxTokenizationLineLength = this._configurationService.getValue("editor.maxTokenizationLineLength", { + overrideIdentifier: this._languageId + }); + } + })); + } + getLoadStatus() { + const promises = []; + for (const nestedLanguageId in this._embeddedLanguages) { + const tokenizationSupport = TokenizationRegistry2.get(nestedLanguageId); + if (tokenizationSupport) { + if (tokenizationSupport instanceof MonarchTokenizer_1) { + const nestedModeStatus = tokenizationSupport.getLoadStatus(); + if (nestedModeStatus.loaded === false) { + promises.push(nestedModeStatus.promise); + } + } + continue; + } + if (!TokenizationRegistry2.isResolved(nestedLanguageId)) { + promises.push(TokenizationRegistry2.getOrCreate(nestedLanguageId)); + } + } + if (promises.length === 0) { + return { + loaded: true + }; + } + return { + loaded: false, + promise: Promise.all(promises).then((_) => void 0) + }; + } + getInitialState() { + const rootState = MonarchStackElementFactory.create(null, this._lexer.start); + return MonarchLineStateFactory.create(rootState, null); + } + tokenize(line, hasEOL, lineState) { + if (line.length >= this._maxTokenizationLineLength) { + return nullTokenize(this._languageId, lineState); + } + const tokensCollector = new MonarchClassicTokensCollector(); + const endLineState = this._tokenize(line, hasEOL, lineState, tokensCollector); + return tokensCollector.finalize(endLineState); + } + tokenizeEncoded(line, hasEOL, lineState) { + if (line.length >= this._maxTokenizationLineLength) { + return nullTokenizeEncoded(this._languageService.languageIdCodec.encodeLanguageId(this._languageId), lineState); + } + const tokensCollector = new MonarchModernTokensCollector(this._languageService, this._standaloneThemeService.getColorTheme().tokenTheme); + const endLineState = this._tokenize(line, hasEOL, lineState, tokensCollector); + return tokensCollector.finalize(endLineState); + } + _tokenize(line, hasEOL, lineState, collector) { + if (lineState.embeddedLanguageData) { + return this._nestedTokenize(line, hasEOL, lineState, 0, collector); + } else { + return this._myTokenize(line, hasEOL, lineState, 0, collector); + } + } + _findLeavingNestedLanguageOffset(line, state) { + let rules = this._lexer.tokenizer[state.stack.state]; + if (!rules) { + rules = findRules(this._lexer, state.stack.state); + if (!rules) { + throw createError(this._lexer, "tokenizer state is not defined: " + state.stack.state); + } + } + let popOffset = -1; + let hasEmbeddedPopRule = false; + for (const rule of rules) { + if (!isIAction(rule.action) || !(rule.action.nextEmbedded === "@pop" || rule.action.hasEmbeddedEndInCases)) { + continue; + } + hasEmbeddedPopRule = true; + let regex = rule.resolveRegex(state.stack.state); + const regexSource = regex.source; + if (regexSource.substr(0, 4) === "^(?:" && regexSource.substr(regexSource.length - 1, 1) === ")") { + const flags = (regex.ignoreCase ? "i" : "") + (regex.unicode ? "u" : ""); + regex = new RegExp(regexSource.substr(4, regexSource.length - 5), flags); + } + const result = line.search(regex); + if (result === -1 || result !== 0 && rule.matchOnlyAtLineStart) { + continue; + } + if (popOffset === -1 || result < popOffset) { + popOffset = result; + } + } + if (!hasEmbeddedPopRule) { + throw createError(this._lexer, 'no rule containing nextEmbedded: "@pop" in tokenizer embedded state: ' + state.stack.state); + } + return popOffset; + } + _nestedTokenize(line, hasEOL, lineState, offsetDelta, tokensCollector) { + const popOffset = this._findLeavingNestedLanguageOffset(line, lineState); + if (popOffset === -1) { + const nestedEndState = tokensCollector.nestedLanguageTokenize(line, hasEOL, lineState.embeddedLanguageData, offsetDelta); + return MonarchLineStateFactory.create(lineState.stack, new EmbeddedLanguageData(lineState.embeddedLanguageData.languageId, nestedEndState)); + } + const nestedLanguageLine = line.substring(0, popOffset); + if (nestedLanguageLine.length > 0) { + tokensCollector.nestedLanguageTokenize(nestedLanguageLine, false, lineState.embeddedLanguageData, offsetDelta); + } + const restOfTheLine = line.substring(popOffset); + return this._myTokenize(restOfTheLine, hasEOL, lineState, offsetDelta + popOffset, tokensCollector); + } + _safeRuleName(rule) { + if (rule) { + return rule.name; + } + return "(unknown)"; + } + _myTokenize(lineWithoutLF, hasEOL, lineState, offsetDelta, tokensCollector) { + tokensCollector.enterLanguage(this._languageId); + const lineWithoutLFLength = lineWithoutLF.length; + const line = hasEOL && this._lexer.includeLF ? lineWithoutLF + "\n" : lineWithoutLF; + const lineLength = line.length; + let embeddedLanguageData = lineState.embeddedLanguageData; + let stack = lineState.stack; + let pos = 0; + let groupMatching = null; + let forceEvaluation = true; + while (forceEvaluation || pos < lineLength) { + const pos0 = pos; + const stackLen0 = stack.depth; + const groupLen0 = groupMatching ? groupMatching.groups.length : 0; + const state = stack.state; + let matches = null; + let matched = null; + let action = null; + let rule = null; + let enteringEmbeddedLanguage = null; + if (groupMatching) { + matches = groupMatching.matches; + const groupEntry = groupMatching.groups.shift(); + matched = groupEntry.matched; + action = groupEntry.action; + rule = groupMatching.rule; + if (groupMatching.groups.length === 0) { + groupMatching = null; + } + } else { + if (!forceEvaluation && pos >= lineLength) { + break; + } + forceEvaluation = false; + let rules = this._lexer.tokenizer[state]; + if (!rules) { + rules = findRules(this._lexer, state); + if (!rules) { + throw createError(this._lexer, "tokenizer state is not defined: " + state); + } + } + const restOfLine = line.substr(pos); + for (const rule2 of rules) { + if (pos === 0 || !rule2.matchOnlyAtLineStart) { + matches = restOfLine.match(rule2.resolveRegex(state)); + if (matches) { + matched = matches[0]; + action = rule2.action; + break; + } + } + } + } + if (!matches) { + matches = [""]; + matched = ""; + } + if (!action) { + if (pos < lineLength) { + matches = [line.charAt(pos)]; + matched = matches[0]; + } + action = this._lexer.defaultToken; + } + if (matched === null) { + break; + } + pos += matched.length; + while (isFuzzyAction(action) && isIAction(action) && action.test) { + action = action.test(matched, matches, state, pos === lineLength); + } + let result = null; + if (typeof action === "string" || Array.isArray(action)) { + result = action; + } else if (action.group) { + result = action.group; + } else if (action.token !== null && action.token !== void 0) { + if (action.tokenSubst) { + result = substituteMatches(this._lexer, action.token, matched, matches, state); + } else { + result = action.token; + } + if (action.nextEmbedded) { + if (action.nextEmbedded === "@pop") { + if (!embeddedLanguageData) { + throw createError(this._lexer, "cannot pop embedded language if not inside one"); + } + embeddedLanguageData = null; + } else if (embeddedLanguageData) { + throw createError(this._lexer, "cannot enter embedded language from within an embedded language"); + } else { + enteringEmbeddedLanguage = substituteMatches(this._lexer, action.nextEmbedded, matched, matches, state); + } + } + if (action.goBack) { + pos = Math.max(0, pos - action.goBack); + } + if (action.switchTo && typeof action.switchTo === "string") { + let nextState = substituteMatches(this._lexer, action.switchTo, matched, matches, state); + if (nextState[0] === "@") { + nextState = nextState.substr(1); + } + if (!findRules(this._lexer, nextState)) { + throw createError(this._lexer, "trying to switch to a state '" + nextState + "' that is undefined in rule: " + this._safeRuleName(rule)); + } else { + stack = stack.switchTo(nextState); + } + } else if (action.transform && typeof action.transform === "function") { + throw createError(this._lexer, "action.transform not supported"); + } else if (action.next) { + if (action.next === "@push") { + if (stack.depth >= this._lexer.maxStack) { + throw createError(this._lexer, "maximum tokenizer stack size reached: [" + stack.state + "," + stack.parent.state + ",...]"); + } else { + stack = stack.push(state); + } + } else if (action.next === "@pop") { + if (stack.depth <= 1) { + throw createError(this._lexer, "trying to pop an empty stack in rule: " + this._safeRuleName(rule)); + } else { + stack = stack.pop(); + } + } else if (action.next === "@popall") { + stack = stack.popall(); + } else { + let nextState = substituteMatches(this._lexer, action.next, matched, matches, state); + if (nextState[0] === "@") { + nextState = nextState.substr(1); + } + if (!findRules(this._lexer, nextState)) { + throw createError(this._lexer, "trying to set a next state '" + nextState + "' that is undefined in rule: " + this._safeRuleName(rule)); + } else { + stack = stack.push(nextState); + } + } + } + if (action.log && typeof action.log === "string") { + log(this._lexer, this._lexer.languageId + ": " + substituteMatches(this._lexer, action.log, matched, matches, state)); + } + } + if (result === null) { + throw createError(this._lexer, "lexer rule has no well-defined action in rule: " + this._safeRuleName(rule)); + } + const computeNewStateForEmbeddedLanguage = (enteringEmbeddedLanguage2) => { + const languageId = this._languageService.getLanguageIdByLanguageName(enteringEmbeddedLanguage2) || this._languageService.getLanguageIdByMimeType(enteringEmbeddedLanguage2) || enteringEmbeddedLanguage2; + const embeddedLanguageData2 = this._getNestedEmbeddedLanguageData(languageId); + if (pos < lineLength) { + const restOfLine = lineWithoutLF.substr(pos); + return this._nestedTokenize(restOfLine, hasEOL, MonarchLineStateFactory.create(stack, embeddedLanguageData2), offsetDelta + pos, tokensCollector); + } else { + return MonarchLineStateFactory.create(stack, embeddedLanguageData2); + } + }; + if (Array.isArray(result)) { + if (groupMatching && groupMatching.groups.length > 0) { + throw createError(this._lexer, "groups cannot be nested: " + this._safeRuleName(rule)); + } + if (matches.length !== result.length + 1) { + throw createError(this._lexer, "matched number of groups does not match the number of actions in rule: " + this._safeRuleName(rule)); + } + let totalLen = 0; + for (let i2 = 1; i2 < matches.length; i2++) { + totalLen += matches[i2].length; + } + if (totalLen !== matched.length) { + throw createError(this._lexer, "with groups, all characters should be matched in consecutive groups in rule: " + this._safeRuleName(rule)); + } + groupMatching = { + rule, + matches, + groups: [] + }; + for (let i2 = 0; i2 < result.length; i2++) { + groupMatching.groups[i2] = { + action: result[i2], + matched: matches[i2 + 1] + }; + } + pos -= matched.length; + continue; + } else { + if (result === "@rematch") { + pos -= matched.length; + matched = ""; + matches = null; + result = ""; + if (enteringEmbeddedLanguage !== null) { + return computeNewStateForEmbeddedLanguage(enteringEmbeddedLanguage); + } + } + if (matched.length === 0) { + if (lineLength === 0 || stackLen0 !== stack.depth || state !== stack.state || (!groupMatching ? 0 : groupMatching.groups.length) !== groupLen0) { + continue; + } else { + throw createError(this._lexer, "no progress in tokenizer in rule: " + this._safeRuleName(rule)); + } + } + let tokenType = null; + if (isString2(result) && result.indexOf("@brackets") === 0) { + const rest = result.substr("@brackets".length); + const bracket = findBracket(this._lexer, matched); + if (!bracket) { + throw createError(this._lexer, "@brackets token returned but no bracket defined as: " + matched); + } + tokenType = sanitize(bracket.token + rest); + } else { + const token = result === "" ? "" : result + this._lexer.tokenPostfix; + tokenType = sanitize(token); + } + if (pos0 < lineWithoutLFLength) { + tokensCollector.emit(pos0 + offsetDelta, tokenType); + } + } + if (enteringEmbeddedLanguage !== null) { + return computeNewStateForEmbeddedLanguage(enteringEmbeddedLanguage); + } + } + return MonarchLineStateFactory.create(stack, embeddedLanguageData); + } + _getNestedEmbeddedLanguageData(languageId) { + if (!this._languageService.isRegisteredLanguageId(languageId)) { + return new EmbeddedLanguageData(languageId, NullState); + } + if (languageId !== this._languageId) { + this._languageService.requestBasicLanguageFeatures(languageId); + TokenizationRegistry2.getOrCreate(languageId); + this._embeddedLanguages[languageId] = true; + } + const tokenizationSupport = TokenizationRegistry2.get(languageId); + if (tokenizationSupport) { + return new EmbeddedLanguageData(languageId, tokenizationSupport.getInitialState()); + } + return new EmbeddedLanguageData(languageId, NullState); + } +}; +MonarchTokenizer = MonarchTokenizer_1 = __decorate167([ + __param161(4, IConfigurationService) +], MonarchTokenizer); +function findBracket(lexer2, matched) { + if (!matched) { + return null; + } + matched = fixCase(lexer2, matched); + const brackets = lexer2.brackets; + for (const bracket of brackets) { + if (bracket.open === matched) { + return { + token: bracket.token, + bracketType: 1 + /* monarchCommon.MonarchBracket.Open */ + }; + } else if (bracket.close === matched) { + return { + token: bracket.token, + bracketType: -1 + /* monarchCommon.MonarchBracket.Close */ + }; + } + } + return null; +} + +// node_modules/monaco-editor-core/esm/vs/editor/standalone/browser/colorizer.js +var ttPolicy6 = createTrustedTypesPolicy("standaloneColorizer", { createHTML: (value) => value }); +var Colorizer = class { + static colorizeElement(themeService, languageService, domNode, options2) { + options2 = options2 || {}; + const theme = options2.theme || "vs"; + const mimeType = options2.mimeType || domNode.getAttribute("lang") || domNode.getAttribute("data-lang"); + if (!mimeType) { + console.error("Mode not detected"); + return Promise.resolve(); + } + const languageId = languageService.getLanguageIdByMimeType(mimeType) || mimeType; + themeService.setTheme(theme); + const text2 = domNode.firstChild ? domNode.firstChild.nodeValue : ""; + domNode.className += " " + theme; + const render = (str) => { + const trustedhtml = ttPolicy6?.createHTML(str) ?? str; + domNode.innerHTML = trustedhtml; + }; + return this.colorize(languageService, text2 || "", languageId, options2).then(render, (err) => console.error(err)); + } + static async colorize(languageService, text2, languageId, options2) { + const languageIdCodec = languageService.languageIdCodec; + let tabSize = 4; + if (options2 && typeof options2.tabSize === "number") { + tabSize = options2.tabSize; + } + if (startsWithUTF8BOM(text2)) { + text2 = text2.substr(1); + } + const lines = splitLines(text2); + if (!languageService.isRegisteredLanguageId(languageId)) { + return _fakeColorize(lines, tabSize, languageIdCodec); + } + const tokenizationSupport = await TokenizationRegistry2.getOrCreate(languageId); + if (tokenizationSupport) { + return _colorize(lines, tabSize, tokenizationSupport, languageIdCodec); + } + return _fakeColorize(lines, tabSize, languageIdCodec); + } + static colorizeLine(line, mightContainNonBasicASCII, mightContainRTL, tokens, tabSize = 4) { + const isBasicASCII2 = ViewLineRenderingData.isBasicASCII(line, mightContainNonBasicASCII); + const containsRTL2 = ViewLineRenderingData.containsRTL(line, isBasicASCII2, mightContainRTL); + const renderResult = renderViewLine2(new RenderLineInput(false, true, line, false, isBasicASCII2, containsRTL2, 0, tokens, [], tabSize, 0, 0, 0, 0, -1, "none", false, false, null, null, 0)); + return renderResult.html; + } + static colorizeModelLine(model, lineNumber, tabSize = 4) { + const content = model.getLineContent(lineNumber); + model.tokenization.forceTokenization(lineNumber); + const tokens = model.tokenization.getLineTokens(lineNumber); + const inflatedTokens = tokens.inflate(); + return this.colorizeLine(content, model.mightContainNonBasicASCII(), model.mightContainRTL(), inflatedTokens, tabSize); + } +}; +function _colorize(lines, tabSize, tokenizationSupport, languageIdCodec) { + return new Promise((c, e) => { + const execute = () => { + const result = _actualColorize(lines, tabSize, tokenizationSupport, languageIdCodec); + if (tokenizationSupport instanceof MonarchTokenizer) { + const status2 = tokenizationSupport.getLoadStatus(); + if (status2.loaded === false) { + status2.promise.then(execute, e); + return; + } + } + c(result); + }; + execute(); + }); +} +function _fakeColorize(lines, tabSize, languageIdCodec) { + let html3 = []; + const defaultMetadata = (0 << 11 | 1 << 15 | 2 << 24) >>> 0; + const tokens = new Uint32Array(2); + tokens[0] = 0; + tokens[1] = defaultMetadata; + for (let i2 = 0, length = lines.length; i2 < length; i2++) { + const line = lines[i2]; + tokens[0] = line.length; + const lineTokens = new LineTokens(tokens, line, languageIdCodec); + const isBasicASCII2 = ViewLineRenderingData.isBasicASCII( + line, + /* check for basic ASCII */ + true + ); + const containsRTL2 = ViewLineRenderingData.containsRTL( + line, + isBasicASCII2, + /* check for RTL */ + true + ); + const renderResult = renderViewLine2(new RenderLineInput(false, true, line, false, isBasicASCII2, containsRTL2, 0, lineTokens, [], tabSize, 0, 0, 0, 0, -1, "none", false, false, null, null, 0)); + html3 = html3.concat(renderResult.html); + html3.push("
    "); + } + return html3.join(""); +} +function _actualColorize(lines, tabSize, tokenizationSupport, languageIdCodec) { + let html3 = []; + let state = tokenizationSupport.getInitialState(); + for (let i2 = 0, length = lines.length; i2 < length; i2++) { + const line = lines[i2]; + const tokenizeResult = tokenizationSupport.tokenizeEncoded(line, true, state); + LineTokens.convertToEndOffset(tokenizeResult.tokens, line.length); + const lineTokens = new LineTokens(tokenizeResult.tokens, line, languageIdCodec); + const isBasicASCII2 = ViewLineRenderingData.isBasicASCII( + line, + /* check for basic ASCII */ + true + ); + const containsRTL2 = ViewLineRenderingData.containsRTL( + line, + isBasicASCII2, + /* check for RTL */ + true + ); + const renderResult = renderViewLine2(new RenderLineInput(false, true, line, false, isBasicASCII2, containsRTL2, 0, lineTokens.inflate(), [], tabSize, 0, 0, 0, 0, -1, "none", false, false, null, null, 0)); + html3 = html3.concat(renderResult.html); + html3.push("
    "); + state = tokenizeResult.endState; + } + return html3.join(""); +} + +// node_modules/monaco-editor-core/esm/vs/editor/standalone/browser/standaloneCodeEditor.js +init_lifecycle(); +init_codeEditorService(); + +// node_modules/monaco-editor-core/esm/vs/editor/standalone/browser/standaloneCodeEditorService.js +init_dom(); +init_network(); + +// node_modules/monaco-editor-core/esm/vs/editor/browser/services/abstractCodeEditorService.js +init_event(); +init_lifecycle(); +init_linkedList(); +init_themeService(); +var __decorate168 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param162 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var AbstractCodeEditorService = class AbstractCodeEditorService2 extends Disposable { + constructor(_themeService) { + super(); + this._themeService = _themeService; + this._onWillCreateCodeEditor = this._register(new Emitter()); + this._onCodeEditorAdd = this._register(new Emitter()); + this.onCodeEditorAdd = this._onCodeEditorAdd.event; + this._onCodeEditorRemove = this._register(new Emitter()); + this.onCodeEditorRemove = this._onCodeEditorRemove.event; + this._onWillCreateDiffEditor = this._register(new Emitter()); + this._onDiffEditorAdd = this._register(new Emitter()); + this.onDiffEditorAdd = this._onDiffEditorAdd.event; + this._onDiffEditorRemove = this._register(new Emitter()); + this.onDiffEditorRemove = this._onDiffEditorRemove.event; + this._decorationOptionProviders = /* @__PURE__ */ new Map(); + this._codeEditorOpenHandlers = new LinkedList(); + this._modelProperties = /* @__PURE__ */ new Map(); + this._codeEditors = /* @__PURE__ */ Object.create(null); + this._diffEditors = /* @__PURE__ */ Object.create(null); + this._globalStyleSheet = null; + } + willCreateCodeEditor() { + this._onWillCreateCodeEditor.fire(); + } + addCodeEditor(editor2) { + this._codeEditors[editor2.getId()] = editor2; + this._onCodeEditorAdd.fire(editor2); + } + removeCodeEditor(editor2) { + if (delete this._codeEditors[editor2.getId()]) { + this._onCodeEditorRemove.fire(editor2); + } + } + listCodeEditors() { + return Object.keys(this._codeEditors).map((id) => this._codeEditors[id]); + } + willCreateDiffEditor() { + this._onWillCreateDiffEditor.fire(); + } + addDiffEditor(editor2) { + this._diffEditors[editor2.getId()] = editor2; + this._onDiffEditorAdd.fire(editor2); + } + removeDiffEditor(editor2) { + if (delete this._diffEditors[editor2.getId()]) { + this._onDiffEditorRemove.fire(editor2); + } + } + listDiffEditors() { + return Object.keys(this._diffEditors).map((id) => this._diffEditors[id]); + } + getFocusedCodeEditor() { + let editorWithWidgetFocus = null; + const editors = this.listCodeEditors(); + for (const editor2 of editors) { + if (editor2.hasTextFocus()) { + return editor2; + } + if (editor2.hasWidgetFocus()) { + editorWithWidgetFocus = editor2; + } + } + return editorWithWidgetFocus; + } + removeDecorationType(key) { + const provider = this._decorationOptionProviders.get(key); + if (provider) { + provider.refCount--; + if (provider.refCount <= 0) { + this._decorationOptionProviders.delete(key); + provider.dispose(); + this.listCodeEditors().forEach((ed) => ed.removeDecorationsByType(key)); + } + } + } + setModelProperty(resource, key, value) { + const key1 = resource.toString(); + let dest; + if (this._modelProperties.has(key1)) { + dest = this._modelProperties.get(key1); + } else { + dest = /* @__PURE__ */ new Map(); + this._modelProperties.set(key1, dest); + } + dest.set(key, value); + } + getModelProperty(resource, key) { + const key1 = resource.toString(); + if (this._modelProperties.has(key1)) { + const innerMap = this._modelProperties.get(key1); + return innerMap.get(key); + } + return void 0; + } + async openCodeEditor(input, source, sideBySide) { + for (const handler of this._codeEditorOpenHandlers) { + const candidate = await handler(input, source, sideBySide); + if (candidate !== null) { + return candidate; + } + } + return null; + } + registerCodeEditorOpenHandler(handler) { + const rm = this._codeEditorOpenHandlers.unshift(handler); + return toDisposable(rm); + } +}; +AbstractCodeEditorService = __decorate168([ + __param162(0, IThemeService) +], AbstractCodeEditorService); + +// node_modules/monaco-editor-core/esm/vs/editor/standalone/browser/standaloneCodeEditorService.js +init_codeEditorService(); +init_contextkey(); +init_extensions(); +init_themeService(); +var __decorate169 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param163 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var StandaloneCodeEditorService = class StandaloneCodeEditorService2 extends AbstractCodeEditorService { + constructor(contextKeyService, themeService) { + super(themeService); + this._register(this.onCodeEditorAdd(() => this._checkContextKey())); + this._register(this.onCodeEditorRemove(() => this._checkContextKey())); + this._editorIsOpen = contextKeyService.createKey("editorIsOpen", false); + this._activeCodeEditor = null; + this._register(this.registerCodeEditorOpenHandler(async (input, source, sideBySide) => { + if (!source) { + return null; + } + return this.doOpenEditor(source, input); + })); + } + _checkContextKey() { + let hasCodeEditor = false; + for (const editor2 of this.listCodeEditors()) { + if (!editor2.isSimpleWidget) { + hasCodeEditor = true; + break; + } + } + this._editorIsOpen.set(hasCodeEditor); + } + setActiveCodeEditor(activeCodeEditor) { + this._activeCodeEditor = activeCodeEditor; + } + getActiveCodeEditor() { + return this._activeCodeEditor; + } + doOpenEditor(editor2, input) { + const model = this.findModel(editor2, input.resource); + if (!model) { + if (input.resource) { + const schema = input.resource.scheme; + if (schema === Schemas.http || schema === Schemas.https) { + windowOpenNoOpener(input.resource.toString()); + return editor2; + } + } + return null; + } + const selection = input.options ? input.options.selection : null; + if (selection) { + if (typeof selection.endLineNumber === "number" && typeof selection.endColumn === "number") { + editor2.setSelection(selection); + editor2.revealRangeInCenter( + selection, + 1 + /* ScrollType.Immediate */ + ); + } else { + const pos = { + lineNumber: selection.startLineNumber, + column: selection.startColumn + }; + editor2.setPosition(pos); + editor2.revealPositionInCenter( + pos, + 1 + /* ScrollType.Immediate */ + ); + } + } + return editor2; + } + findModel(editor2, resource) { + const model = editor2.getModel(); + if (model && model.uri.toString() !== resource.toString()) { + return null; + } + return model; + } +}; +StandaloneCodeEditorService = __decorate169([ + __param163(0, IContextKeyService), + __param163(1, IThemeService) +], StandaloneCodeEditorService); +registerSingleton( + ICodeEditorService, + StandaloneCodeEditorService, + 0 + /* InstantiationType.Eager */ +); + +// node_modules/monaco-editor-core/esm/vs/editor/standalone/browser/standaloneLayoutService.js +init_dom(); +init_window(); +init_arrays(); +init_event(); +init_codeEditorService(); +init_extensions(); +var __decorate170 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param164 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var StandaloneLayoutService = class StandaloneLayoutService2 { + get mainContainer() { + return this._codeEditorService.listCodeEditors().at(0)?.getContainerDomNode() ?? mainWindow.document.body; + } + get activeContainer() { + const activeCodeEditor = this._codeEditorService.getFocusedCodeEditor() ?? this._codeEditorService.getActiveCodeEditor(); + return activeCodeEditor?.getContainerDomNode() ?? this.mainContainer; + } + get mainContainerDimension() { + return getClientArea(this.mainContainer); + } + get activeContainerDimension() { + return getClientArea(this.activeContainer); + } + get containers() { + return coalesce(this._codeEditorService.listCodeEditors().map((codeEditor) => codeEditor.getContainerDomNode())); + } + getContainer() { + return this.activeContainer; + } + whenContainerStylesLoaded() { + return void 0; + } + focus() { + this._codeEditorService.getFocusedCodeEditor()?.focus(); + } + constructor(_codeEditorService) { + this._codeEditorService = _codeEditorService; + this.onDidLayoutMainContainer = Event.None; + this.onDidLayoutActiveContainer = Event.None; + this.onDidLayoutContainer = Event.None; + this.onDidChangeActiveContainer = Event.None; + this.onDidAddContainer = Event.None; + this.mainContainerOffset = { top: 0, quickPickTop: 0 }; + this.activeContainerOffset = { top: 0, quickPickTop: 0 }; + } +}; +StandaloneLayoutService = __decorate170([ + __param164(0, ICodeEditorService) +], StandaloneLayoutService); +var EditorScopedLayoutService = class EditorScopedLayoutService2 extends StandaloneLayoutService { + get mainContainer() { + return this._container; + } + constructor(_container, codeEditorService) { + super(codeEditorService); + this._container = _container; + } +}; +EditorScopedLayoutService = __decorate170([ + __param164(1, ICodeEditorService) +], EditorScopedLayoutService); +registerSingleton( + ILayoutService, + StandaloneLayoutService, + 1 + /* InstantiationType.Delayed */ +); + +// node_modules/monaco-editor-core/esm/vs/platform/undoRedo/common/undoRedoService.js +init_errors(); +init_lifecycle(); +init_network(); +init_nls(); +init_extensions(); +init_undoRedo(); +var __decorate171 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param165 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var DEBUG2 = false; +function getResourceLabel(resource) { + return resource.scheme === Schemas.file ? resource.fsPath : resource.path; +} +var stackElementCounter = 0; +var ResourceStackElement = class { + constructor(actual, resourceLabel, strResource, groupId, groupOrder, sourceId, sourceOrder) { + this.id = ++stackElementCounter; + this.type = 0; + this.actual = actual; + this.label = actual.label; + this.confirmBeforeUndo = actual.confirmBeforeUndo || false; + this.resourceLabel = resourceLabel; + this.strResource = strResource; + this.resourceLabels = [this.resourceLabel]; + this.strResources = [this.strResource]; + this.groupId = groupId; + this.groupOrder = groupOrder; + this.sourceId = sourceId; + this.sourceOrder = sourceOrder; + this.isValid = true; + } + setValid(isValid2) { + this.isValid = isValid2; + } + toString() { + return `[id:${this.id}] [group:${this.groupId}] [${this.isValid ? " VALID" : "INVALID"}] ${this.actual.constructor.name} - ${this.actual}`; + } +}; +var ResourceReasonPair = class { + constructor(resourceLabel, reason) { + this.resourceLabel = resourceLabel; + this.reason = reason; + } +}; +var RemovedResources = class { + constructor() { + this.elements = /* @__PURE__ */ new Map(); + } + createMessage() { + const externalRemoval = []; + const noParallelUniverses = []; + for (const [, element] of this.elements) { + const dest = element.reason === 0 ? externalRemoval : noParallelUniverses; + dest.push(element.resourceLabel); + } + const messages = []; + if (externalRemoval.length > 0) { + messages.push(localize(2030, "The following files have been closed and modified on disk: {0}.", externalRemoval.join(", "))); + } + if (noParallelUniverses.length > 0) { + messages.push(localize(2031, "The following files have been modified in an incompatible way: {0}.", noParallelUniverses.join(", "))); + } + return messages.join("\n"); + } + get size() { + return this.elements.size; + } + has(strResource) { + return this.elements.has(strResource); + } + set(strResource, value) { + this.elements.set(strResource, value); + } + delete(strResource) { + return this.elements.delete(strResource); + } +}; +var WorkspaceStackElement = class { + constructor(actual, resourceLabels, strResources, groupId, groupOrder, sourceId, sourceOrder) { + this.id = ++stackElementCounter; + this.type = 1; + this.actual = actual; + this.label = actual.label; + this.confirmBeforeUndo = actual.confirmBeforeUndo || false; + this.resourceLabels = resourceLabels; + this.strResources = strResources; + this.groupId = groupId; + this.groupOrder = groupOrder; + this.sourceId = sourceId; + this.sourceOrder = sourceOrder; + this.removedResources = null; + this.invalidatedResources = null; + } + canSplit() { + return typeof this.actual.split === "function"; + } + removeResource(resourceLabel, strResource, reason) { + if (!this.removedResources) { + this.removedResources = new RemovedResources(); + } + if (!this.removedResources.has(strResource)) { + this.removedResources.set(strResource, new ResourceReasonPair(resourceLabel, reason)); + } + } + setValid(resourceLabel, strResource, isValid2) { + if (isValid2) { + if (this.invalidatedResources) { + this.invalidatedResources.delete(strResource); + if (this.invalidatedResources.size === 0) { + this.invalidatedResources = null; + } + } + } else { + if (!this.invalidatedResources) { + this.invalidatedResources = new RemovedResources(); + } + if (!this.invalidatedResources.has(strResource)) { + this.invalidatedResources.set(strResource, new ResourceReasonPair( + resourceLabel, + 0 + /* RemovedResourceReason.ExternalRemoval */ + )); + } + } + } + toString() { + return `[id:${this.id}] [group:${this.groupId}] [${this.invalidatedResources ? "INVALID" : " VALID"}] ${this.actual.constructor.name} - ${this.actual}`; + } +}; +var ResourceEditStack = class { + constructor(resourceLabel, strResource) { + this.resourceLabel = resourceLabel; + this.strResource = strResource; + this._past = []; + this._future = []; + this.locked = false; + this.versionId = 1; + } + dispose() { + for (const element of this._past) { + if (element.type === 1) { + element.removeResource( + this.resourceLabel, + this.strResource, + 0 + /* RemovedResourceReason.ExternalRemoval */ + ); + } + } + for (const element of this._future) { + if (element.type === 1) { + element.removeResource( + this.resourceLabel, + this.strResource, + 0 + /* RemovedResourceReason.ExternalRemoval */ + ); + } + } + this.versionId++; + } + toString() { + const result = []; + result.push(`* ${this.strResource}:`); + for (let i2 = 0; i2 < this._past.length; i2++) { + result.push(` * [UNDO] ${this._past[i2]}`); + } + for (let i2 = this._future.length - 1; i2 >= 0; i2--) { + result.push(` * [REDO] ${this._future[i2]}`); + } + return result.join("\n"); + } + flushAllElements() { + this._past = []; + this._future = []; + this.versionId++; + } + _setElementValidFlag(element, isValid2) { + if (element.type === 1) { + element.setValid(this.resourceLabel, this.strResource, isValid2); + } else { + element.setValid(isValid2); + } + } + setElementsValidFlag(isValid2, filter) { + for (const element of this._past) { + if (filter(element.actual)) { + this._setElementValidFlag(element, isValid2); + } + } + for (const element of this._future) { + if (filter(element.actual)) { + this._setElementValidFlag(element, isValid2); + } + } + } + pushElement(element) { + for (const futureElement of this._future) { + if (futureElement.type === 1) { + futureElement.removeResource( + this.resourceLabel, + this.strResource, + 1 + /* RemovedResourceReason.NoParallelUniverses */ + ); + } + } + this._future = []; + this._past.push(element); + this.versionId++; + } + createSnapshot(resource) { + const elements = []; + for (let i2 = 0, len = this._past.length; i2 < len; i2++) { + elements.push(this._past[i2].id); + } + for (let i2 = this._future.length - 1; i2 >= 0; i2--) { + elements.push(this._future[i2].id); + } + return new ResourceEditStackSnapshot(resource, elements); + } + restoreSnapshot(snapshot) { + const snapshotLength = snapshot.elements.length; + let isOK = true; + let snapshotIndex = 0; + let removePastAfter = -1; + for (let i2 = 0, len = this._past.length; i2 < len; i2++, snapshotIndex++) { + const element = this._past[i2]; + if (isOK && (snapshotIndex >= snapshotLength || element.id !== snapshot.elements[snapshotIndex])) { + isOK = false; + removePastAfter = 0; + } + if (!isOK && element.type === 1) { + element.removeResource( + this.resourceLabel, + this.strResource, + 0 + /* RemovedResourceReason.ExternalRemoval */ + ); + } + } + let removeFutureBefore = -1; + for (let i2 = this._future.length - 1; i2 >= 0; i2--, snapshotIndex++) { + const element = this._future[i2]; + if (isOK && (snapshotIndex >= snapshotLength || element.id !== snapshot.elements[snapshotIndex])) { + isOK = false; + removeFutureBefore = i2; + } + if (!isOK && element.type === 1) { + element.removeResource( + this.resourceLabel, + this.strResource, + 0 + /* RemovedResourceReason.ExternalRemoval */ + ); + } + } + if (removePastAfter !== -1) { + this._past = this._past.slice(0, removePastAfter); + } + if (removeFutureBefore !== -1) { + this._future = this._future.slice(removeFutureBefore + 1); + } + this.versionId++; + } + getElements() { + const past = []; + const future = []; + for (const element of this._past) { + past.push(element.actual); + } + for (const element of this._future) { + future.push(element.actual); + } + return { past, future }; + } + getClosestPastElement() { + if (this._past.length === 0) { + return null; + } + return this._past[this._past.length - 1]; + } + getSecondClosestPastElement() { + if (this._past.length < 2) { + return null; + } + return this._past[this._past.length - 2]; + } + getClosestFutureElement() { + if (this._future.length === 0) { + return null; + } + return this._future[this._future.length - 1]; + } + hasPastElements() { + return this._past.length > 0; + } + hasFutureElements() { + return this._future.length > 0; + } + splitPastWorkspaceElement(toRemove, individualMap) { + for (let j = this._past.length - 1; j >= 0; j--) { + if (this._past[j] === toRemove) { + if (individualMap.has(this.strResource)) { + this._past[j] = individualMap.get(this.strResource); + } else { + this._past.splice(j, 1); + } + break; + } + } + this.versionId++; + } + splitFutureWorkspaceElement(toRemove, individualMap) { + for (let j = this._future.length - 1; j >= 0; j--) { + if (this._future[j] === toRemove) { + if (individualMap.has(this.strResource)) { + this._future[j] = individualMap.get(this.strResource); + } else { + this._future.splice(j, 1); + } + break; + } + } + this.versionId++; + } + moveBackward(element) { + this._past.pop(); + this._future.push(element); + this.versionId++; + } + moveForward(element) { + this._future.pop(); + this._past.push(element); + this.versionId++; + } +}; +var EditStackSnapshot = class { + constructor(editStacks) { + this.editStacks = editStacks; + this._versionIds = []; + for (let i2 = 0, len = this.editStacks.length; i2 < len; i2++) { + this._versionIds[i2] = this.editStacks[i2].versionId; + } + } + isValid() { + for (let i2 = 0, len = this.editStacks.length; i2 < len; i2++) { + if (this._versionIds[i2] !== this.editStacks[i2].versionId) { + return false; + } + } + return true; + } +}; +var missingEditStack = new ResourceEditStack("", ""); +missingEditStack.locked = true; +var UndoRedoService = class UndoRedoService2 { + constructor(_dialogService, _notificationService) { + this._dialogService = _dialogService; + this._notificationService = _notificationService; + this._editStacks = /* @__PURE__ */ new Map(); + this._uriComparisonKeyComputers = []; + } + getUriComparisonKey(resource) { + for (const uriComparisonKeyComputer of this._uriComparisonKeyComputers) { + if (uriComparisonKeyComputer[0] === resource.scheme) { + return uriComparisonKeyComputer[1].getComparisonKey(resource); + } + } + return resource.toString(); + } + _print(label) { + console.log(`------------------------------------`); + console.log(`AFTER ${label}: `); + const str = []; + for (const element of this._editStacks) { + str.push(element[1].toString()); + } + console.log(str.join("\n")); + } + pushElement(element, group = UndoRedoGroup.None, source = UndoRedoSource.None) { + if (element.type === 0) { + const resourceLabel = getResourceLabel(element.resource); + const strResource = this.getUriComparisonKey(element.resource); + this._pushElement(new ResourceStackElement(element, resourceLabel, strResource, group.id, group.nextOrder(), source.id, source.nextOrder())); + } else { + const seen = /* @__PURE__ */ new Set(); + const resourceLabels = []; + const strResources = []; + for (const resource of element.resources) { + const resourceLabel = getResourceLabel(resource); + const strResource = this.getUriComparisonKey(resource); + if (seen.has(strResource)) { + continue; + } + seen.add(strResource); + resourceLabels.push(resourceLabel); + strResources.push(strResource); + } + if (resourceLabels.length === 1) { + this._pushElement(new ResourceStackElement(element, resourceLabels[0], strResources[0], group.id, group.nextOrder(), source.id, source.nextOrder())); + } else { + this._pushElement(new WorkspaceStackElement(element, resourceLabels, strResources, group.id, group.nextOrder(), source.id, source.nextOrder())); + } + } + if (DEBUG2) { + this._print("pushElement"); + } + } + _pushElement(element) { + for (let i2 = 0, len = element.strResources.length; i2 < len; i2++) { + const resourceLabel = element.resourceLabels[i2]; + const strResource = element.strResources[i2]; + let editStack; + if (this._editStacks.has(strResource)) { + editStack = this._editStacks.get(strResource); + } else { + editStack = new ResourceEditStack(resourceLabel, strResource); + this._editStacks.set(strResource, editStack); + } + editStack.pushElement(element); + } + } + getLastElement(resource) { + const strResource = this.getUriComparisonKey(resource); + if (this._editStacks.has(strResource)) { + const editStack = this._editStacks.get(strResource); + if (editStack.hasFutureElements()) { + return null; + } + const closestPastElement = editStack.getClosestPastElement(); + return closestPastElement ? closestPastElement.actual : null; + } + return null; + } + _splitPastWorkspaceElement(toRemove, ignoreResources) { + const individualArr = toRemove.actual.split(); + const individualMap = /* @__PURE__ */ new Map(); + for (const _element of individualArr) { + const resourceLabel = getResourceLabel(_element.resource); + const strResource = this.getUriComparisonKey(_element.resource); + const element = new ResourceStackElement(_element, resourceLabel, strResource, 0, 0, 0, 0); + individualMap.set(element.strResource, element); + } + for (const strResource of toRemove.strResources) { + if (ignoreResources && ignoreResources.has(strResource)) { + continue; + } + const editStack = this._editStacks.get(strResource); + editStack.splitPastWorkspaceElement(toRemove, individualMap); + } + } + _splitFutureWorkspaceElement(toRemove, ignoreResources) { + const individualArr = toRemove.actual.split(); + const individualMap = /* @__PURE__ */ new Map(); + for (const _element of individualArr) { + const resourceLabel = getResourceLabel(_element.resource); + const strResource = this.getUriComparisonKey(_element.resource); + const element = new ResourceStackElement(_element, resourceLabel, strResource, 0, 0, 0, 0); + individualMap.set(element.strResource, element); + } + for (const strResource of toRemove.strResources) { + if (ignoreResources && ignoreResources.has(strResource)) { + continue; + } + const editStack = this._editStacks.get(strResource); + editStack.splitFutureWorkspaceElement(toRemove, individualMap); + } + } + removeElements(resource) { + const strResource = typeof resource === "string" ? resource : this.getUriComparisonKey(resource); + if (this._editStacks.has(strResource)) { + const editStack = this._editStacks.get(strResource); + editStack.dispose(); + this._editStacks.delete(strResource); + } + if (DEBUG2) { + this._print("removeElements"); + } + } + setElementsValidFlag(resource, isValid2, filter) { + const strResource = this.getUriComparisonKey(resource); + if (this._editStacks.has(strResource)) { + const editStack = this._editStacks.get(strResource); + editStack.setElementsValidFlag(isValid2, filter); + } + if (DEBUG2) { + this._print("setElementsValidFlag"); + } + } + createSnapshot(resource) { + const strResource = this.getUriComparisonKey(resource); + if (this._editStacks.has(strResource)) { + const editStack = this._editStacks.get(strResource); + return editStack.createSnapshot(resource); + } + return new ResourceEditStackSnapshot(resource, []); + } + restoreSnapshot(snapshot) { + const strResource = this.getUriComparisonKey(snapshot.resource); + if (this._editStacks.has(strResource)) { + const editStack = this._editStacks.get(strResource); + editStack.restoreSnapshot(snapshot); + if (!editStack.hasPastElements() && !editStack.hasFutureElements()) { + editStack.dispose(); + this._editStacks.delete(strResource); + } + } + if (DEBUG2) { + this._print("restoreSnapshot"); + } + } + getElements(resource) { + const strResource = this.getUriComparisonKey(resource); + if (this._editStacks.has(strResource)) { + const editStack = this._editStacks.get(strResource); + return editStack.getElements(); + } + return { past: [], future: [] }; + } + _findClosestUndoElementWithSource(sourceId) { + if (!sourceId) { + return [null, null]; + } + let matchedElement = null; + let matchedStrResource = null; + for (const [strResource, editStack] of this._editStacks) { + const candidate = editStack.getClosestPastElement(); + if (!candidate) { + continue; + } + if (candidate.sourceId === sourceId) { + if (!matchedElement || candidate.sourceOrder > matchedElement.sourceOrder) { + matchedElement = candidate; + matchedStrResource = strResource; + } + } + } + return [matchedElement, matchedStrResource]; + } + canUndo(resourceOrSource) { + if (resourceOrSource instanceof UndoRedoSource) { + const [, matchedStrResource] = this._findClosestUndoElementWithSource(resourceOrSource.id); + return matchedStrResource ? true : false; + } + const strResource = this.getUriComparisonKey(resourceOrSource); + if (this._editStacks.has(strResource)) { + const editStack = this._editStacks.get(strResource); + return editStack.hasPastElements(); + } + return false; + } + _onError(err, element) { + onUnexpectedError(err); + for (const strResource of element.strResources) { + this.removeElements(strResource); + } + this._notificationService.error(err); + } + _acquireLocks(editStackSnapshot) { + for (const editStack of editStackSnapshot.editStacks) { + if (editStack.locked) { + throw new Error("Cannot acquire edit stack lock"); + } + } + for (const editStack of editStackSnapshot.editStacks) { + editStack.locked = true; + } + return () => { + for (const editStack of editStackSnapshot.editStacks) { + editStack.locked = false; + } + }; + } + _safeInvokeWithLocks(element, invoke, editStackSnapshot, cleanup, continuation) { + const releaseLocks = this._acquireLocks(editStackSnapshot); + let result; + try { + result = invoke(); + } catch (err) { + releaseLocks(); + cleanup.dispose(); + return this._onError(err, element); + } + if (result) { + return result.then(() => { + releaseLocks(); + cleanup.dispose(); + return continuation(); + }, (err) => { + releaseLocks(); + cleanup.dispose(); + return this._onError(err, element); + }); + } else { + releaseLocks(); + cleanup.dispose(); + return continuation(); + } + } + async _invokeWorkspacePrepare(element) { + if (typeof element.actual.prepareUndoRedo === "undefined") { + return Disposable.None; + } + const result = element.actual.prepareUndoRedo(); + if (typeof result === "undefined") { + return Disposable.None; + } + return result; + } + _invokeResourcePrepare(element, callback) { + if (element.actual.type !== 1 || typeof element.actual.prepareUndoRedo === "undefined") { + return callback(Disposable.None); + } + const r = element.actual.prepareUndoRedo(); + if (!r) { + return callback(Disposable.None); + } + if (isDisposable(r)) { + return callback(r); + } + return r.then((disposable) => { + return callback(disposable); + }); + } + _getAffectedEditStacks(element) { + const affectedEditStacks = []; + for (const strResource of element.strResources) { + affectedEditStacks.push(this._editStacks.get(strResource) || missingEditStack); + } + return new EditStackSnapshot(affectedEditStacks); + } + _tryToSplitAndUndo(strResource, element, ignoreResources, message) { + if (element.canSplit()) { + this._splitPastWorkspaceElement(element, ignoreResources); + this._notificationService.warn(message); + return new WorkspaceVerificationError(this._undo(strResource, 0, true)); + } else { + for (const strResource2 of element.strResources) { + this.removeElements(strResource2); + } + this._notificationService.warn(message); + return new WorkspaceVerificationError(); + } + } + _checkWorkspaceUndo(strResource, element, editStackSnapshot, checkInvalidatedResources) { + if (element.removedResources) { + return this._tryToSplitAndUndo(strResource, element, element.removedResources, localize(2032, "Could not undo '{0}' across all files. {1}", element.label, element.removedResources.createMessage())); + } + if (checkInvalidatedResources && element.invalidatedResources) { + return this._tryToSplitAndUndo(strResource, element, element.invalidatedResources, localize(2033, "Could not undo '{0}' across all files. {1}", element.label, element.invalidatedResources.createMessage())); + } + const cannotUndoDueToResources = []; + for (const editStack of editStackSnapshot.editStacks) { + if (editStack.getClosestPastElement() !== element) { + cannotUndoDueToResources.push(editStack.resourceLabel); + } + } + if (cannotUndoDueToResources.length > 0) { + return this._tryToSplitAndUndo(strResource, element, null, localize(2034, "Could not undo '{0}' across all files because changes were made to {1}", element.label, cannotUndoDueToResources.join(", "))); + } + const cannotLockDueToResources = []; + for (const editStack of editStackSnapshot.editStacks) { + if (editStack.locked) { + cannotLockDueToResources.push(editStack.resourceLabel); + } + } + if (cannotLockDueToResources.length > 0) { + return this._tryToSplitAndUndo(strResource, element, null, localize(2035, "Could not undo '{0}' across all files because there is already an undo or redo operation running on {1}", element.label, cannotLockDueToResources.join(", "))); + } + if (!editStackSnapshot.isValid()) { + return this._tryToSplitAndUndo(strResource, element, null, localize(2036, "Could not undo '{0}' across all files because an undo or redo operation occurred in the meantime", element.label)); + } + return null; + } + _workspaceUndo(strResource, element, undoConfirmed) { + const affectedEditStacks = this._getAffectedEditStacks(element); + const verificationError = this._checkWorkspaceUndo( + strResource, + element, + affectedEditStacks, + /*invalidated resources will be checked after the prepare call*/ + false + ); + if (verificationError) { + return verificationError.returnValue; + } + return this._confirmAndExecuteWorkspaceUndo(strResource, element, affectedEditStacks, undoConfirmed); + } + _isPartOfUndoGroup(element) { + if (!element.groupId) { + return false; + } + for (const [, editStack] of this._editStacks) { + const pastElement = editStack.getClosestPastElement(); + if (!pastElement) { + continue; + } + if (pastElement === element) { + const secondPastElement = editStack.getSecondClosestPastElement(); + if (secondPastElement && secondPastElement.groupId === element.groupId) { + return true; + } + } + if (pastElement.groupId === element.groupId) { + return true; + } + } + return false; + } + async _confirmAndExecuteWorkspaceUndo(strResource, element, editStackSnapshot, undoConfirmed) { + if (element.canSplit() && !this._isPartOfUndoGroup(element)) { + let UndoChoice; + (function(UndoChoice2) { + UndoChoice2[UndoChoice2["All"] = 0] = "All"; + UndoChoice2[UndoChoice2["This"] = 1] = "This"; + UndoChoice2[UndoChoice2["Cancel"] = 2] = "Cancel"; + })(UndoChoice || (UndoChoice = {})); + const { result } = await this._dialogService.prompt({ + type: severity_default.Info, + message: localize(2037, "Would you like to undo '{0}' across all files?", element.label), + buttons: [ + { + label: localize(2038, "&&Undo in {0} Files", editStackSnapshot.editStacks.length), + run: () => UndoChoice.All + }, + { + label: localize(2039, "Undo this &&File"), + run: () => UndoChoice.This + } + ], + cancelButton: { + run: () => UndoChoice.Cancel + } + }); + if (result === UndoChoice.Cancel) { + return; + } + if (result === UndoChoice.This) { + this._splitPastWorkspaceElement(element, null); + return this._undo(strResource, 0, true); + } + const verificationError1 = this._checkWorkspaceUndo( + strResource, + element, + editStackSnapshot, + /*invalidated resources will be checked after the prepare call*/ + false + ); + if (verificationError1) { + return verificationError1.returnValue; + } + undoConfirmed = true; + } + let cleanup; + try { + cleanup = await this._invokeWorkspacePrepare(element); + } catch (err) { + return this._onError(err, element); + } + const verificationError2 = this._checkWorkspaceUndo( + strResource, + element, + editStackSnapshot, + /*now also check that there are no more invalidated resources*/ + true + ); + if (verificationError2) { + cleanup.dispose(); + return verificationError2.returnValue; + } + for (const editStack of editStackSnapshot.editStacks) { + editStack.moveBackward(element); + } + return this._safeInvokeWithLocks(element, () => element.actual.undo(), editStackSnapshot, cleanup, () => this._continueUndoInGroup(element.groupId, undoConfirmed)); + } + _resourceUndo(editStack, element, undoConfirmed) { + if (!element.isValid) { + editStack.flushAllElements(); + return; + } + if (editStack.locked) { + const message = localize(2040, "Could not undo '{0}' because there is already an undo or redo operation running.", element.label); + this._notificationService.warn(message); + return; + } + return this._invokeResourcePrepare(element, (cleanup) => { + editStack.moveBackward(element); + return this._safeInvokeWithLocks(element, () => element.actual.undo(), new EditStackSnapshot([editStack]), cleanup, () => this._continueUndoInGroup(element.groupId, undoConfirmed)); + }); + } + _findClosestUndoElementInGroup(groupId) { + if (!groupId) { + return [null, null]; + } + let matchedElement = null; + let matchedStrResource = null; + for (const [strResource, editStack] of this._editStacks) { + const candidate = editStack.getClosestPastElement(); + if (!candidate) { + continue; + } + if (candidate.groupId === groupId) { + if (!matchedElement || candidate.groupOrder > matchedElement.groupOrder) { + matchedElement = candidate; + matchedStrResource = strResource; + } + } + } + return [matchedElement, matchedStrResource]; + } + _continueUndoInGroup(groupId, undoConfirmed) { + if (!groupId) { + return; + } + const [, matchedStrResource] = this._findClosestUndoElementInGroup(groupId); + if (matchedStrResource) { + return this._undo(matchedStrResource, 0, undoConfirmed); + } + } + undo(resourceOrSource) { + if (resourceOrSource instanceof UndoRedoSource) { + const [, matchedStrResource] = this._findClosestUndoElementWithSource(resourceOrSource.id); + return matchedStrResource ? this._undo(matchedStrResource, resourceOrSource.id, false) : void 0; + } + if (typeof resourceOrSource === "string") { + return this._undo(resourceOrSource, 0, false); + } + return this._undo(this.getUriComparisonKey(resourceOrSource), 0, false); + } + _undo(strResource, sourceId = 0, undoConfirmed) { + if (!this._editStacks.has(strResource)) { + return; + } + const editStack = this._editStacks.get(strResource); + const element = editStack.getClosestPastElement(); + if (!element) { + return; + } + if (element.groupId) { + const [matchedElement, matchedStrResource] = this._findClosestUndoElementInGroup(element.groupId); + if (element !== matchedElement && matchedStrResource) { + return this._undo(matchedStrResource, sourceId, undoConfirmed); + } + } + const shouldPromptForConfirmation = element.sourceId !== sourceId || element.confirmBeforeUndo; + if (shouldPromptForConfirmation && !undoConfirmed) { + return this._confirmAndContinueUndo(strResource, sourceId, element); + } + try { + if (element.type === 1) { + return this._workspaceUndo(strResource, element, undoConfirmed); + } else { + return this._resourceUndo(editStack, element, undoConfirmed); + } + } finally { + if (DEBUG2) { + this._print("undo"); + } + } + } + async _confirmAndContinueUndo(strResource, sourceId, element) { + const result = await this._dialogService.confirm({ + message: localize(2041, "Would you like to undo '{0}'?", element.label), + primaryButton: localize(2042, "&&Yes"), + cancelButton: localize(2043, "No") + }); + if (!result.confirmed) { + return; + } + return this._undo(strResource, sourceId, true); + } + _findClosestRedoElementWithSource(sourceId) { + if (!sourceId) { + return [null, null]; + } + let matchedElement = null; + let matchedStrResource = null; + for (const [strResource, editStack] of this._editStacks) { + const candidate = editStack.getClosestFutureElement(); + if (!candidate) { + continue; + } + if (candidate.sourceId === sourceId) { + if (!matchedElement || candidate.sourceOrder < matchedElement.sourceOrder) { + matchedElement = candidate; + matchedStrResource = strResource; + } + } + } + return [matchedElement, matchedStrResource]; + } + canRedo(resourceOrSource) { + if (resourceOrSource instanceof UndoRedoSource) { + const [, matchedStrResource] = this._findClosestRedoElementWithSource(resourceOrSource.id); + return matchedStrResource ? true : false; + } + const strResource = this.getUriComparisonKey(resourceOrSource); + if (this._editStacks.has(strResource)) { + const editStack = this._editStacks.get(strResource); + return editStack.hasFutureElements(); + } + return false; + } + _tryToSplitAndRedo(strResource, element, ignoreResources, message) { + if (element.canSplit()) { + this._splitFutureWorkspaceElement(element, ignoreResources); + this._notificationService.warn(message); + return new WorkspaceVerificationError(this._redo(strResource)); + } else { + for (const strResource2 of element.strResources) { + this.removeElements(strResource2); + } + this._notificationService.warn(message); + return new WorkspaceVerificationError(); + } + } + _checkWorkspaceRedo(strResource, element, editStackSnapshot, checkInvalidatedResources) { + if (element.removedResources) { + return this._tryToSplitAndRedo(strResource, element, element.removedResources, localize(2044, "Could not redo '{0}' across all files. {1}", element.label, element.removedResources.createMessage())); + } + if (checkInvalidatedResources && element.invalidatedResources) { + return this._tryToSplitAndRedo(strResource, element, element.invalidatedResources, localize(2045, "Could not redo '{0}' across all files. {1}", element.label, element.invalidatedResources.createMessage())); + } + const cannotRedoDueToResources = []; + for (const editStack of editStackSnapshot.editStacks) { + if (editStack.getClosestFutureElement() !== element) { + cannotRedoDueToResources.push(editStack.resourceLabel); + } + } + if (cannotRedoDueToResources.length > 0) { + return this._tryToSplitAndRedo(strResource, element, null, localize(2046, "Could not redo '{0}' across all files because changes were made to {1}", element.label, cannotRedoDueToResources.join(", "))); + } + const cannotLockDueToResources = []; + for (const editStack of editStackSnapshot.editStacks) { + if (editStack.locked) { + cannotLockDueToResources.push(editStack.resourceLabel); + } + } + if (cannotLockDueToResources.length > 0) { + return this._tryToSplitAndRedo(strResource, element, null, localize(2047, "Could not redo '{0}' across all files because there is already an undo or redo operation running on {1}", element.label, cannotLockDueToResources.join(", "))); + } + if (!editStackSnapshot.isValid()) { + return this._tryToSplitAndRedo(strResource, element, null, localize(2048, "Could not redo '{0}' across all files because an undo or redo operation occurred in the meantime", element.label)); + } + return null; + } + _workspaceRedo(strResource, element) { + const affectedEditStacks = this._getAffectedEditStacks(element); + const verificationError = this._checkWorkspaceRedo( + strResource, + element, + affectedEditStacks, + /*invalidated resources will be checked after the prepare call*/ + false + ); + if (verificationError) { + return verificationError.returnValue; + } + return this._executeWorkspaceRedo(strResource, element, affectedEditStacks); + } + async _executeWorkspaceRedo(strResource, element, editStackSnapshot) { + let cleanup; + try { + cleanup = await this._invokeWorkspacePrepare(element); + } catch (err) { + return this._onError(err, element); + } + const verificationError = this._checkWorkspaceRedo( + strResource, + element, + editStackSnapshot, + /*now also check that there are no more invalidated resources*/ + true + ); + if (verificationError) { + cleanup.dispose(); + return verificationError.returnValue; + } + for (const editStack of editStackSnapshot.editStacks) { + editStack.moveForward(element); + } + return this._safeInvokeWithLocks(element, () => element.actual.redo(), editStackSnapshot, cleanup, () => this._continueRedoInGroup(element.groupId)); + } + _resourceRedo(editStack, element) { + if (!element.isValid) { + editStack.flushAllElements(); + return; + } + if (editStack.locked) { + const message = localize(2049, "Could not redo '{0}' because there is already an undo or redo operation running.", element.label); + this._notificationService.warn(message); + return; + } + return this._invokeResourcePrepare(element, (cleanup) => { + editStack.moveForward(element); + return this._safeInvokeWithLocks(element, () => element.actual.redo(), new EditStackSnapshot([editStack]), cleanup, () => this._continueRedoInGroup(element.groupId)); + }); + } + _findClosestRedoElementInGroup(groupId) { + if (!groupId) { + return [null, null]; + } + let matchedElement = null; + let matchedStrResource = null; + for (const [strResource, editStack] of this._editStacks) { + const candidate = editStack.getClosestFutureElement(); + if (!candidate) { + continue; + } + if (candidate.groupId === groupId) { + if (!matchedElement || candidate.groupOrder < matchedElement.groupOrder) { + matchedElement = candidate; + matchedStrResource = strResource; + } + } + } + return [matchedElement, matchedStrResource]; + } + _continueRedoInGroup(groupId) { + if (!groupId) { + return; + } + const [, matchedStrResource] = this._findClosestRedoElementInGroup(groupId); + if (matchedStrResource) { + return this._redo(matchedStrResource); + } + } + redo(resourceOrSource) { + if (resourceOrSource instanceof UndoRedoSource) { + const [, matchedStrResource] = this._findClosestRedoElementWithSource(resourceOrSource.id); + return matchedStrResource ? this._redo(matchedStrResource) : void 0; + } + if (typeof resourceOrSource === "string") { + return this._redo(resourceOrSource); + } + return this._redo(this.getUriComparisonKey(resourceOrSource)); + } + _redo(strResource) { + if (!this._editStacks.has(strResource)) { + return; + } + const editStack = this._editStacks.get(strResource); + const element = editStack.getClosestFutureElement(); + if (!element) { + return; + } + if (element.groupId) { + const [matchedElement, matchedStrResource] = this._findClosestRedoElementInGroup(element.groupId); + if (element !== matchedElement && matchedStrResource) { + return this._redo(matchedStrResource); + } + } + try { + if (element.type === 1) { + return this._workspaceRedo(strResource, element); + } else { + return this._resourceRedo(editStack, element); + } + } finally { + if (DEBUG2) { + this._print("redo"); + } + } + } +}; +UndoRedoService = __decorate171([ + __param165(0, IDialogService), + __param165(1, INotificationService) +], UndoRedoService); +var WorkspaceVerificationError = class { + constructor(returnValue) { + this.returnValue = returnValue; + } +}; +registerSingleton( + IUndoRedoService, + UndoRedoService, + 1 + /* InstantiationType.Delayed */ +); + +// node_modules/monaco-editor-core/esm/vs/editor/standalone/browser/standaloneServices.js +init_languageFeatureDebounce(); + +// node_modules/monaco-editor-core/esm/vs/editor/common/services/semanticTokensStylingService.js +init_lifecycle(); +init_language(); +init_themeService(); +init_log(); +init_extensions(); +var __decorate172 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param166 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var SemanticTokensStylingService = class SemanticTokensStylingService2 extends Disposable { + constructor(_themeService, _logService, _languageService) { + super(); + this._themeService = _themeService; + this._logService = _logService; + this._languageService = _languageService; + this._caches = /* @__PURE__ */ new WeakMap(); + this._register(this._themeService.onDidColorThemeChange(() => { + this._caches = /* @__PURE__ */ new WeakMap(); + })); + } + getStyling(provider) { + if (!this._caches.has(provider)) { + this._caches.set(provider, new SemanticTokensProviderStyling(provider.getLegend(), this._themeService, this._languageService, this._logService)); + } + return this._caches.get(provider); + } +}; +SemanticTokensStylingService = __decorate172([ + __param166(0, IThemeService), + __param166(1, ILogService), + __param166(2, ILanguageService) +], SemanticTokensStylingService); +registerSingleton( + ISemanticTokensStylingService, + SemanticTokensStylingService, + 1 + /* InstantiationType.Delayed */ +); + +// node_modules/monaco-editor-core/esm/vs/editor/common/languageFeatureRegistry.js +init_event(); +init_lifecycle(); +init_model2(); +function isExclusive(selector) { + if (typeof selector === "string") { + return false; + } else if (Array.isArray(selector)) { + return selector.every(isExclusive); + } else { + return !!selector.exclusive; + } +} +var MatchCandidate = class { + constructor(uri, languageId, notebookUri, notebookType, recursive) { + this.uri = uri; + this.languageId = languageId; + this.notebookUri = notebookUri; + this.notebookType = notebookType; + this.recursive = recursive; + } + equals(other) { + return this.notebookType === other.notebookType && this.languageId === other.languageId && this.uri.toString() === other.uri.toString() && this.notebookUri?.toString() === other.notebookUri?.toString() && this.recursive === other.recursive; + } +}; +var LanguageFeatureRegistry = class _LanguageFeatureRegistry { + get onDidChange() { + return this._onDidChange.event; + } + constructor(_notebookInfoResolver) { + this._notebookInfoResolver = _notebookInfoResolver; + this._clock = 0; + this._entries = []; + this._onDidChange = new Emitter(); + } + register(selector, provider) { + let entry = { + selector, + provider, + _score: -1, + _time: this._clock++ + }; + this._entries.push(entry); + this._lastCandidate = void 0; + this._onDidChange.fire(this._entries.length); + return toDisposable(() => { + if (entry) { + const idx = this._entries.indexOf(entry); + if (idx >= 0) { + this._entries.splice(idx, 1); + this._lastCandidate = void 0; + this._onDidChange.fire(this._entries.length); + entry = void 0; + } + } + }); + } + has(model) { + return this.all(model).length > 0; + } + all(model) { + if (!model) { + return []; + } + this._updateScores(model, false); + const result = []; + for (const entry of this._entries) { + if (entry._score > 0) { + result.push(entry.provider); + } + } + return result; + } + ordered(model, recursive = false) { + const result = []; + this._orderedForEach(model, recursive, (entry) => result.push(entry.provider)); + return result; + } + orderedGroups(model) { + const result = []; + let lastBucket; + let lastBucketScore; + this._orderedForEach(model, false, (entry) => { + if (lastBucket && lastBucketScore === entry._score) { + lastBucket.push(entry.provider); + } else { + lastBucketScore = entry._score; + lastBucket = [entry.provider]; + result.push(lastBucket); + } + }); + return result; + } + _orderedForEach(model, recursive, callback) { + this._updateScores(model, recursive); + for (const entry of this._entries) { + if (entry._score > 0) { + callback(entry); + } + } + } + _updateScores(model, recursive) { + const notebookInfo = this._notebookInfoResolver?.(model.uri); + const candidate = notebookInfo ? new MatchCandidate(model.uri, model.getLanguageId(), notebookInfo.uri, notebookInfo.type, recursive) : new MatchCandidate(model.uri, model.getLanguageId(), void 0, void 0, recursive); + if (this._lastCandidate?.equals(candidate)) { + return; + } + this._lastCandidate = candidate; + for (const entry of this._entries) { + entry._score = score2(entry.selector, candidate.uri, candidate.languageId, shouldSynchronizeModel(model), candidate.notebookUri, candidate.notebookType); + if (isExclusive(entry.selector) && entry._score > 0) { + if (recursive) { + entry._score = 0; + } else { + for (const entry2 of this._entries) { + entry2._score = 0; + } + entry._score = 1e3; + break; + } + } + } + this._entries.sort(_LanguageFeatureRegistry._compareByScoreAndTime); + } + static _compareByScoreAndTime(a, b) { + if (a._score < b._score) { + return 1; + } else if (a._score > b._score) { + return -1; + } + if (isBuiltinSelector(a.selector) && !isBuiltinSelector(b.selector)) { + return 1; + } else if (!isBuiltinSelector(a.selector) && isBuiltinSelector(b.selector)) { + return -1; + } + if (a._time < b._time) { + return 1; + } else if (a._time > b._time) { + return -1; + } else { + return 0; + } + } +}; +function isBuiltinSelector(selector) { + if (typeof selector === "string") { + return false; + } + if (Array.isArray(selector)) { + return selector.some(isBuiltinSelector); + } + return Boolean(selector.isBuiltin); +} + +// node_modules/monaco-editor-core/esm/vs/editor/common/services/languageFeaturesService.js +init_languageFeatures(); +init_extensions(); +var LanguageFeaturesService = class { + constructor() { + this.referenceProvider = new LanguageFeatureRegistry(this._score.bind(this)); + this.renameProvider = new LanguageFeatureRegistry(this._score.bind(this)); + this.newSymbolNamesProvider = new LanguageFeatureRegistry(this._score.bind(this)); + this.codeActionProvider = new LanguageFeatureRegistry(this._score.bind(this)); + this.definitionProvider = new LanguageFeatureRegistry(this._score.bind(this)); + this.typeDefinitionProvider = new LanguageFeatureRegistry(this._score.bind(this)); + this.declarationProvider = new LanguageFeatureRegistry(this._score.bind(this)); + this.implementationProvider = new LanguageFeatureRegistry(this._score.bind(this)); + this.documentSymbolProvider = new LanguageFeatureRegistry(this._score.bind(this)); + this.inlayHintsProvider = new LanguageFeatureRegistry(this._score.bind(this)); + this.colorProvider = new LanguageFeatureRegistry(this._score.bind(this)); + this.codeLensProvider = new LanguageFeatureRegistry(this._score.bind(this)); + this.documentFormattingEditProvider = new LanguageFeatureRegistry(this._score.bind(this)); + this.documentRangeFormattingEditProvider = new LanguageFeatureRegistry(this._score.bind(this)); + this.onTypeFormattingEditProvider = new LanguageFeatureRegistry(this._score.bind(this)); + this.signatureHelpProvider = new LanguageFeatureRegistry(this._score.bind(this)); + this.hoverProvider = new LanguageFeatureRegistry(this._score.bind(this)); + this.documentHighlightProvider = new LanguageFeatureRegistry(this._score.bind(this)); + this.multiDocumentHighlightProvider = new LanguageFeatureRegistry(this._score.bind(this)); + this.selectionRangeProvider = new LanguageFeatureRegistry(this._score.bind(this)); + this.foldingRangeProvider = new LanguageFeatureRegistry(this._score.bind(this)); + this.linkProvider = new LanguageFeatureRegistry(this._score.bind(this)); + this.inlineCompletionsProvider = new LanguageFeatureRegistry(this._score.bind(this)); + this.completionProvider = new LanguageFeatureRegistry(this._score.bind(this)); + this.linkedEditingRangeProvider = new LanguageFeatureRegistry(this._score.bind(this)); + this.documentRangeSemanticTokensProvider = new LanguageFeatureRegistry(this._score.bind(this)); + this.documentSemanticTokensProvider = new LanguageFeatureRegistry(this._score.bind(this)); + this.documentDropEditProvider = new LanguageFeatureRegistry(this._score.bind(this)); + this.documentPasteEditProvider = new LanguageFeatureRegistry(this._score.bind(this)); + } + _score(uri) { + return this._notebookTypeResolver?.(uri); + } +}; +registerSingleton( + ILanguageFeaturesService, + LanguageFeaturesService, + 1 + /* InstantiationType.Delayed */ +); + +// node_modules/monaco-editor-core/esm/vs/platform/hover/browser/hoverService.js +init_extensions(); +init_themeService(); +init_colorRegistry(); +init_instantiation(); + +// node_modules/monaco-editor-core/esm/vs/platform/hover/browser/hoverWidget.js +init_lifecycle(); +init_event(); +init_dom(); +init_configuration(); +init_htmlContent(); +init_nls(); +init_platform(); +init_async(); +init_types(); +var __decorate173 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param167 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var $17 = $; +var HoverWidget2 = class HoverWidget3 extends Widget { + get _targetWindow() { + return getWindow(this._target.targetElements[0]); + } + get _targetDocumentElement() { + return getWindow(this._target.targetElements[0]).document.documentElement; + } + get isDisposed() { + return this._isDisposed; + } + get isMouseIn() { + return this._lockMouseTracker.isMouseIn; + } + get domNode() { + return this._hover.containerDomNode; + } + get onDispose() { + return this._onDispose.event; + } + get onRequestLayout() { + return this._onRequestLayout.event; + } + get anchor() { + return this._hoverPosition === 2 ? 0 : 1; + } + get x() { + return this._x; + } + get y() { + return this._y; + } + /** + * Whether the hover is "locked" by holding the alt/option key. When locked, the hover will not + * hide and can be hovered regardless of whether the `hideOnHover` hover option is set. + */ + get isLocked() { + return this._isLocked; + } + set isLocked(value) { + if (this._isLocked === value) { + return; + } + this._isLocked = value; + this._hoverContainer.classList.toggle("locked", this._isLocked); + } + constructor(options2, _keybindingService, _configurationService, _markdownRenderer, _accessibilityService) { + super(); + this._keybindingService = _keybindingService; + this._configurationService = _configurationService; + this._markdownRenderer = _markdownRenderer; + this._accessibilityService = _accessibilityService; + this._messageListeners = new DisposableStore(); + this._isDisposed = false; + this._forcePosition = false; + this._x = 0; + this._y = 0; + this._isLocked = false; + this._enableFocusTraps = false; + this._addedFocusTrap = false; + this._maxHeightRatioRelativeToWindow = 0.5; + this._onDispose = this._register(new Emitter()); + this._onRequestLayout = this._register(new Emitter()); + this._linkHandler = options2.linkHandler; + this._target = "targetElements" in options2.target ? options2.target : new ElementHoverTarget(options2.target); + if (options2.style) { + switch (options2.style) { + case 1: { + options2.appearance ??= {}; + options2.appearance.compact ??= true; + options2.appearance.showPointer ??= true; + break; + } + case 2: { + options2.appearance ??= {}; + options2.appearance.compact ??= true; + break; + } + } + } + this._hoverPointer = options2.appearance?.showPointer ? $17("div.workbench-hover-pointer") : void 0; + this._hover = this._register(new HoverWidget(!options2.appearance?.skipFadeInAnimation)); + this._hover.containerDomNode.classList.add("workbench-hover"); + if (options2.appearance?.compact) { + this._hover.containerDomNode.classList.add("workbench-hover", "compact"); + } + if (options2.additionalClasses) { + this._hover.containerDomNode.classList.add(...options2.additionalClasses); + } + if (options2.position?.forcePosition) { + this._forcePosition = true; + } + if (options2.trapFocus) { + this._enableFocusTraps = true; + } + const maxHeightRatio = options2.appearance?.maxHeightRatio; + if (maxHeightRatio !== void 0 && maxHeightRatio > 0 && maxHeightRatio <= 1) { + this._maxHeightRatioRelativeToWindow = maxHeightRatio; + } + this._hoverPosition = options2.position?.hoverPosition === void 0 ? 3 : isNumber(options2.position.hoverPosition) ? options2.position.hoverPosition : 2; + this.onmousedown(this._hover.containerDomNode, (e) => e.stopPropagation()); + this.onkeydown(this._hover.containerDomNode, (e) => { + if (e.equals( + 9 + /* KeyCode.Escape */ + )) { + this.dispose(); + } + }); + this._register(addDisposableListener(this._targetWindow, "blur", () => this.dispose())); + const rowElement = $17("div.hover-row.markdown-hover"); + const contentsElement = $17("div.hover-contents"); + if (typeof options2.content === "string") { + contentsElement.textContent = options2.content; + contentsElement.style.whiteSpace = "pre-wrap"; + } else if (isHTMLElement(options2.content)) { + contentsElement.appendChild(options2.content); + contentsElement.classList.add("html-hover-contents"); + } else { + const markdown = options2.content; + const { element } = this._register(this._markdownRenderer.render(markdown, { + actionHandler: this._linkHandler, + asyncRenderCallback: () => { + contentsElement.classList.add("code-hover-contents"); + this.layout(); + this._onRequestLayout.fire(); + } + })); + contentsElement.appendChild(element); + } + rowElement.appendChild(contentsElement); + this._hover.contentsDomNode.appendChild(rowElement); + if (options2.actions && options2.actions.length > 0) { + const statusBarElement = $17("div.hover-row.status-bar"); + const actionsElement = $17("div.actions"); + options2.actions.forEach((action) => { + const keybinding = this._keybindingService.lookupKeybinding(action.commandId); + const keybindingLabel = keybinding ? keybinding.getLabel() : null; + this._register(HoverAction.render(actionsElement, { + label: action.label, + commandId: action.commandId, + run: (e) => { + action.run(e); + this.dispose(); + }, + iconClass: action.iconClass + }, keybindingLabel)); + }); + statusBarElement.appendChild(actionsElement); + this._hover.containerDomNode.appendChild(statusBarElement); + } + this._hoverContainer = $17("div.workbench-hover-container"); + if (this._hoverPointer) { + this._hoverContainer.appendChild(this._hoverPointer); + } + this._hoverContainer.appendChild(this._hover.containerDomNode); + let hideOnHover; + if (options2.actions && options2.actions.length > 0) { + hideOnHover = false; + } else { + if (options2.persistence?.hideOnHover === void 0) { + hideOnHover = typeof options2.content === "string" || isMarkdownString(options2.content) && !options2.content.value.includes("](") && !options2.content.value.includes(""); + } else { + hideOnHover = options2.persistence.hideOnHover; + } + } + if (options2.appearance?.showHoverHint) { + const statusBarElement = $17("div.hover-row.status-bar"); + const infoElement = $17("div.info"); + infoElement.textContent = localize(1699, "Hold {0} key to mouse over", isMacintosh ? "Option" : "Alt"); + statusBarElement.appendChild(infoElement); + this._hover.containerDomNode.appendChild(statusBarElement); + } + const mouseTrackerTargets = [...this._target.targetElements]; + if (!hideOnHover) { + mouseTrackerTargets.push(this._hoverContainer); + } + const mouseTracker = this._register(new CompositeMouseTracker(mouseTrackerTargets)); + this._register(mouseTracker.onMouseOut(() => { + if (!this._isLocked) { + this.dispose(); + } + })); + if (hideOnHover) { + const mouseTracker2Targets = [...this._target.targetElements, this._hoverContainer]; + this._lockMouseTracker = this._register(new CompositeMouseTracker(mouseTracker2Targets)); + this._register(this._lockMouseTracker.onMouseOut(() => { + if (!this._isLocked) { + this.dispose(); + } + })); + } else { + this._lockMouseTracker = mouseTracker; + } + } + addFocusTrap() { + if (!this._enableFocusTraps || this._addedFocusTrap) { + return; + } + this._addedFocusTrap = true; + const firstContainerFocusElement = this._hover.containerDomNode; + const lastContainerFocusElement = this.findLastFocusableChild(this._hover.containerDomNode); + if (lastContainerFocusElement) { + const beforeContainerFocusElement = prepend(this._hoverContainer, $17("div")); + const afterContainerFocusElement = append(this._hoverContainer, $17("div")); + beforeContainerFocusElement.tabIndex = 0; + afterContainerFocusElement.tabIndex = 0; + this._register(addDisposableListener(afterContainerFocusElement, "focus", (e) => { + firstContainerFocusElement.focus(); + e.preventDefault(); + })); + this._register(addDisposableListener(beforeContainerFocusElement, "focus", (e) => { + lastContainerFocusElement.focus(); + e.preventDefault(); + })); + } + } + findLastFocusableChild(root) { + if (root.hasChildNodes()) { + for (let i2 = 0; i2 < root.childNodes.length; i2++) { + const node = root.childNodes.item(root.childNodes.length - i2 - 1); + if (node.nodeType === node.ELEMENT_NODE) { + const parsedNode = node; + if (typeof parsedNode.tabIndex === "number" && parsedNode.tabIndex >= 0) { + return parsedNode; + } + } + const recursivelyFoundElement = this.findLastFocusableChild(node); + if (recursivelyFoundElement) { + return recursivelyFoundElement; + } + } + } + return void 0; + } + render(container) { + container.appendChild(this._hoverContainer); + const hoverFocused = this._hoverContainer.contains(this._hoverContainer.ownerDocument.activeElement); + const accessibleViewHint = hoverFocused && getHoverAccessibleViewHint(this._configurationService.getValue("accessibility.verbosity.hover") === true && this._accessibilityService.isScreenReaderOptimized(), this._keybindingService.lookupKeybinding("editor.action.accessibleView")?.getAriaLabel()); + if (accessibleViewHint) { + status(accessibleViewHint); + } + this.layout(); + this.addFocusTrap(); + } + layout() { + this._hover.containerDomNode.classList.remove("right-aligned"); + this._hover.contentsDomNode.style.maxHeight = ""; + const getZoomAccountedBoundingClientRect = (e) => { + const zoom = getDomNodeZoomLevel(e); + const boundingRect = e.getBoundingClientRect(); + return { + top: boundingRect.top * zoom, + bottom: boundingRect.bottom * zoom, + right: boundingRect.right * zoom, + left: boundingRect.left * zoom + }; + }; + const targetBounds = this._target.targetElements.map((e) => getZoomAccountedBoundingClientRect(e)); + const { top, right, bottom, left } = targetBounds[0]; + const width2 = right - left; + const height = bottom - top; + const targetRect = { + top, + right, + bottom, + left, + width: width2, + height, + center: { + x: left + width2 / 2, + y: top + height / 2 + } + }; + this.adjustHorizontalHoverPosition(targetRect); + this.adjustVerticalHoverPosition(targetRect); + this.adjustHoverMaxHeight(targetRect); + this._hoverContainer.style.padding = ""; + this._hoverContainer.style.margin = ""; + if (this._hoverPointer) { + switch (this._hoverPosition) { + case 1: + targetRect.left += 3; + targetRect.right += 3; + this._hoverContainer.style.paddingLeft = `${3}px`; + this._hoverContainer.style.marginLeft = `${-3}px`; + break; + case 0: + targetRect.left -= 3; + targetRect.right -= 3; + this._hoverContainer.style.paddingRight = `${3}px`; + this._hoverContainer.style.marginRight = `${-3}px`; + break; + case 2: + targetRect.top += 3; + targetRect.bottom += 3; + this._hoverContainer.style.paddingTop = `${3}px`; + this._hoverContainer.style.marginTop = `${-3}px`; + break; + case 3: + targetRect.top -= 3; + targetRect.bottom -= 3; + this._hoverContainer.style.paddingBottom = `${3}px`; + this._hoverContainer.style.marginBottom = `${-3}px`; + break; + } + targetRect.center.x = targetRect.left + width2 / 2; + targetRect.center.y = targetRect.top + height / 2; + } + this.computeXCordinate(targetRect); + this.computeYCordinate(targetRect); + if (this._hoverPointer) { + this._hoverPointer.classList.remove("top"); + this._hoverPointer.classList.remove("left"); + this._hoverPointer.classList.remove("right"); + this._hoverPointer.classList.remove("bottom"); + this.setHoverPointerPosition(targetRect); + } + this._hover.onContentsChanged(); + } + computeXCordinate(target) { + const hoverWidth = this._hover.containerDomNode.clientWidth + 2; + if (this._target.x !== void 0) { + this._x = this._target.x; + } else if (this._hoverPosition === 1) { + this._x = target.right; + } else if (this._hoverPosition === 0) { + this._x = target.left - hoverWidth; + } else { + if (this._hoverPointer) { + this._x = target.center.x - this._hover.containerDomNode.clientWidth / 2; + } else { + this._x = target.left; + } + if (this._x + hoverWidth >= this._targetDocumentElement.clientWidth) { + this._hover.containerDomNode.classList.add("right-aligned"); + this._x = Math.max(this._targetDocumentElement.clientWidth - hoverWidth - 2, this._targetDocumentElement.clientLeft); + } + } + if (this._x < this._targetDocumentElement.clientLeft) { + this._x = target.left + 2; + } + } + computeYCordinate(target) { + if (this._target.y !== void 0) { + this._y = this._target.y; + } else if (this._hoverPosition === 3) { + this._y = target.top; + } else if (this._hoverPosition === 2) { + this._y = target.bottom - 2; + } else { + if (this._hoverPointer) { + this._y = target.center.y + this._hover.containerDomNode.clientHeight / 2; + } else { + this._y = target.bottom; + } + } + if (this._y > this._targetWindow.innerHeight) { + this._y = target.bottom; + } + } + adjustHorizontalHoverPosition(target) { + if (this._target.x !== void 0) { + return; + } + const hoverPointerOffset = this._hoverPointer ? 3 : 0; + if (this._forcePosition) { + const padding = hoverPointerOffset + 2; + if (this._hoverPosition === 1) { + this._hover.containerDomNode.style.maxWidth = `${this._targetDocumentElement.clientWidth - target.right - padding}px`; + } else if (this._hoverPosition === 0) { + this._hover.containerDomNode.style.maxWidth = `${target.left - padding}px`; + } + return; + } + if (this._hoverPosition === 1) { + const roomOnRight = this._targetDocumentElement.clientWidth - target.right; + if (roomOnRight < this._hover.containerDomNode.clientWidth + hoverPointerOffset) { + const roomOnLeft = target.left; + if (roomOnLeft >= this._hover.containerDomNode.clientWidth + hoverPointerOffset) { + this._hoverPosition = 0; + } else { + this._hoverPosition = 2; + } + } + } else if (this._hoverPosition === 0) { + const roomOnLeft = target.left; + if (roomOnLeft < this._hover.containerDomNode.clientWidth + hoverPointerOffset) { + const roomOnRight = this._targetDocumentElement.clientWidth - target.right; + if (roomOnRight >= this._hover.containerDomNode.clientWidth + hoverPointerOffset) { + this._hoverPosition = 1; + } else { + this._hoverPosition = 2; + } + } + if (target.left - this._hover.containerDomNode.clientWidth - hoverPointerOffset <= this._targetDocumentElement.clientLeft) { + this._hoverPosition = 1; + } + } + } + adjustVerticalHoverPosition(target) { + if (this._target.y !== void 0 || this._forcePosition) { + return; + } + const hoverPointerOffset = this._hoverPointer ? 3 : 0; + if (this._hoverPosition === 3) { + if (target.top - this._hover.containerDomNode.clientHeight - hoverPointerOffset < 0) { + this._hoverPosition = 2; + } + } else if (this._hoverPosition === 2) { + if (target.bottom + this._hover.containerDomNode.offsetHeight + hoverPointerOffset > this._targetWindow.innerHeight) { + this._hoverPosition = 3; + } + } + } + adjustHoverMaxHeight(target) { + let maxHeight = this._targetWindow.innerHeight * this._maxHeightRatioRelativeToWindow; + if (this._forcePosition) { + const padding = (this._hoverPointer ? 3 : 0) + 2; + if (this._hoverPosition === 3) { + maxHeight = Math.min(maxHeight, target.top - padding); + } else if (this._hoverPosition === 2) { + maxHeight = Math.min(maxHeight, this._targetWindow.innerHeight - target.bottom - padding); + } + } + this._hover.containerDomNode.style.maxHeight = `${maxHeight}px`; + if (this._hover.contentsDomNode.clientHeight < this._hover.contentsDomNode.scrollHeight) { + const extraRightPadding = `${this._hover.scrollbar.options.verticalScrollbarSize}px`; + if (this._hover.contentsDomNode.style.paddingRight !== extraRightPadding) { + this._hover.contentsDomNode.style.paddingRight = extraRightPadding; + } + } + } + setHoverPointerPosition(target) { + if (!this._hoverPointer) { + return; + } + switch (this._hoverPosition) { + case 0: + case 1: { + this._hoverPointer.classList.add(this._hoverPosition === 0 ? "right" : "left"); + const hoverHeight = this._hover.containerDomNode.clientHeight; + if (hoverHeight > target.height) { + this._hoverPointer.style.top = `${target.center.y - (this._y - hoverHeight) - 3}px`; + } else { + this._hoverPointer.style.top = `${Math.round(hoverHeight / 2) - 3}px`; + } + break; + } + case 3: + case 2: { + this._hoverPointer.classList.add(this._hoverPosition === 3 ? "bottom" : "top"); + const hoverWidth = this._hover.containerDomNode.clientWidth; + let pointerLeftPosition = Math.round(hoverWidth / 2) - 3; + const pointerX = this._x + pointerLeftPosition; + if (pointerX < target.left || pointerX > target.right) { + pointerLeftPosition = target.center.x - this._x - 3; + } + this._hoverPointer.style.left = `${pointerLeftPosition}px`; + break; + } + } + } + focus() { + this._hover.containerDomNode.focus(); + } + dispose() { + if (!this._isDisposed) { + this._onDispose.fire(); + this._target.dispose?.(); + this._hoverContainer.remove(); + this._messageListeners.dispose(); + super.dispose(); + } + this._isDisposed = true; + } +}; +HoverWidget2 = __decorate173([ + __param167(1, IKeybindingService), + __param167(2, IConfigurationService), + __param167(3, IMarkdownRendererService), + __param167(4, IAccessibilityService) +], HoverWidget2); +var CompositeMouseTracker = class extends Widget { + get onMouseOut() { + return this._onMouseOut.event; + } + get isMouseIn() { + return this._isMouseIn; + } + /** + * @param _elements The target elements to track mouse in/out events on. + * @param _eventDebounceDelay The delay in ms to debounce the event firing. This is used to + * allow a short period for the mouse to move into the hover or a nearby target element. For + * example hovering a scroll bar will not hide the hover immediately. + */ + constructor(_elements, _eventDebounceDelay = 200) { + super(); + this._elements = _elements; + this._eventDebounceDelay = _eventDebounceDelay; + this._isMouseIn = true; + this._mouseTimer = this._register(new MutableDisposable()); + this._onMouseOut = this._register(new Emitter()); + for (const element of this._elements) { + this.onmouseover(element, () => this._onTargetMouseOver()); + this.onmouseleave(element, () => this._onTargetMouseLeave()); + } + } + _onTargetMouseOver() { + this._isMouseIn = true; + this._mouseTimer.clear(); + } + _onTargetMouseLeave() { + this._isMouseIn = false; + this._mouseTimer.value = new TimeoutTimer(() => this._fireIfMouseOutside(), this._eventDebounceDelay); + } + _fireIfMouseOutside() { + if (!this._isMouseIn) { + this._onMouseOut.fire(); + } + } +}; +var ElementHoverTarget = class { + constructor(_element) { + this._element = _element; + this.targetElements = [this._element]; + } + dispose() { + } +}; + +// node_modules/monaco-editor-core/esm/vs/platform/hover/browser/hoverService.js +init_lifecycle(); +init_dom(); +init_keyboardEvent(); +init_window(); + +// node_modules/monaco-editor-core/esm/vs/base/browser/ui/contextview/contextview.js +init_canIUse(); +init_dom(); +init_lifecycle(); +init_platform(); +function isAnchor(obj) { + const anchor = obj; + return !!anchor && typeof anchor.x === "number" && typeof anchor.y === "number"; +} +var LayoutAnchorMode; +(function(LayoutAnchorMode2) { + LayoutAnchorMode2[LayoutAnchorMode2["AVOID"] = 0] = "AVOID"; + LayoutAnchorMode2[LayoutAnchorMode2["ALIGN"] = 1] = "ALIGN"; +})(LayoutAnchorMode || (LayoutAnchorMode = {})); +function layout(viewportSize, viewSize, anchor) { + const layoutAfterAnchorBoundary = anchor.mode === LayoutAnchorMode.ALIGN ? anchor.offset : anchor.offset + anchor.size; + const layoutBeforeAnchorBoundary = anchor.mode === LayoutAnchorMode.ALIGN ? anchor.offset + anchor.size : anchor.offset; + if (anchor.position === 0) { + if (viewSize <= viewportSize - layoutAfterAnchorBoundary) { + return layoutAfterAnchorBoundary; + } + if (viewSize <= layoutBeforeAnchorBoundary) { + return layoutBeforeAnchorBoundary - viewSize; + } + return Math.max(viewportSize - viewSize, 0); + } else { + if (viewSize <= layoutBeforeAnchorBoundary) { + return layoutBeforeAnchorBoundary - viewSize; + } + if (viewSize <= viewportSize - layoutAfterAnchorBoundary) { + return layoutAfterAnchorBoundary; + } + return 0; + } +} +var ContextView = class _ContextView extends Disposable { + static { + this.BUBBLE_UP_EVENTS = ["click", "keydown", "focus", "blur"]; + } + static { + this.BUBBLE_DOWN_EVENTS = ["click"]; + } + constructor(container, domPosition) { + super(); + this.container = null; + this.useFixedPosition = false; + this.useShadowDOM = false; + this.delegate = null; + this.toDisposeOnClean = Disposable.None; + this.toDisposeOnSetContainer = Disposable.None; + this.shadowRoot = null; + this.shadowRootHostElement = null; + this.view = $(".context-view"); + hide(this.view); + this.setContainer(container, domPosition); + this._register(toDisposable(() => this.setContainer( + null, + 1 + /* ContextViewDOMPosition.ABSOLUTE */ + ))); + } + setContainer(container, domPosition) { + this.useFixedPosition = domPosition !== 1; + const usedShadowDOM = this.useShadowDOM; + this.useShadowDOM = domPosition === 3; + if (container === this.container && usedShadowDOM === this.useShadowDOM) { + return; + } + if (this.container) { + this.toDisposeOnSetContainer.dispose(); + this.view.remove(); + if (this.shadowRoot) { + this.shadowRoot = null; + this.shadowRootHostElement?.remove(); + this.shadowRootHostElement = null; + } + this.container = null; + } + if (container) { + this.container = container; + if (this.useShadowDOM) { + this.shadowRootHostElement = $(".shadow-root-host"); + this.container.appendChild(this.shadowRootHostElement); + this.shadowRoot = this.shadowRootHostElement.attachShadow({ mode: "open" }); + const style = document.createElement("style"); + style.textContent = SHADOW_ROOT_CSS; + this.shadowRoot.appendChild(style); + this.shadowRoot.appendChild(this.view); + this.shadowRoot.appendChild($("slot")); + } else { + this.container.appendChild(this.view); + } + const toDisposeOnSetContainer = new DisposableStore(); + _ContextView.BUBBLE_UP_EVENTS.forEach((event) => { + toDisposeOnSetContainer.add(addStandardDisposableListener(this.container, event, (e) => { + this.onDOMEvent(e, false); + })); + }); + _ContextView.BUBBLE_DOWN_EVENTS.forEach((event) => { + toDisposeOnSetContainer.add(addStandardDisposableListener(this.container, event, (e) => { + this.onDOMEvent(e, true); + }, true)); + }); + this.toDisposeOnSetContainer = toDisposeOnSetContainer; + } + } + show(delegate) { + if (this.isVisible()) { + this.hide(); + } + clearNode(this.view); + this.view.className = "context-view monaco-component"; + this.view.style.top = "0px"; + this.view.style.left = "0px"; + this.view.style.zIndex = `${2575 + (delegate.layer ?? 0)}`; + this.view.style.position = this.useFixedPosition ? "fixed" : "absolute"; + show(this.view); + this.toDisposeOnClean = delegate.render(this.view) || Disposable.None; + this.delegate = delegate; + this.doLayout(); + this.delegate.focus?.(); + } + getViewElement() { + return this.view; + } + layout() { + if (!this.isVisible()) { + return; + } + if (this.delegate.canRelayout === false && !(isIOS && BrowserFeatures.pointerEvents)) { + this.hide(); + return; + } + this.delegate?.layout?.(); + this.doLayout(); + } + doLayout() { + if (!this.isVisible()) { + return; + } + const anchor = this.delegate.getAnchor(); + let around; + if (isHTMLElement(anchor)) { + const elementPosition = getDomNodePagePosition(anchor); + const zoom = getDomNodeZoomLevel(anchor); + around = { + top: elementPosition.top * zoom, + left: elementPosition.left * zoom, + width: elementPosition.width * zoom, + height: elementPosition.height * zoom + }; + } else if (isAnchor(anchor)) { + around = { + top: anchor.y, + left: anchor.x, + width: anchor.width || 1, + height: anchor.height || 2 + }; + } else { + around = { + top: anchor.posy, + left: anchor.posx, + // We are about to position the context view where the mouse + // cursor is. To prevent the view being exactly under the mouse + // when showing and thus potentially triggering an action within, + // we treat the mouse location like a small sized block element. + width: 2, + height: 2 + }; + } + const viewSizeWidth = getTotalWidth(this.view); + const viewSizeHeight = getTotalHeight(this.view); + const anchorPosition = this.delegate.anchorPosition ?? 0; + const anchorAlignment = this.delegate.anchorAlignment ?? 0; + const anchorAxisAlignment = this.delegate.anchorAxisAlignment ?? 0; + let top; + let left; + const activeWindow = getActiveWindow(); + if (anchorAxisAlignment === 0) { + const verticalAnchor = { + offset: around.top - activeWindow.pageYOffset, + size: around.height, + position: anchorPosition === 0 ? 0 : 1 + /* LayoutAnchorPosition.After */ + }; + const horizontalAnchor = { offset: around.left, size: around.width, position: anchorAlignment === 0 ? 0 : 1, mode: LayoutAnchorMode.ALIGN }; + top = layout(activeWindow.innerHeight, viewSizeHeight, verticalAnchor) + activeWindow.pageYOffset; + if (Range2.intersects({ start: top, end: top + viewSizeHeight }, { start: verticalAnchor.offset, end: verticalAnchor.offset + verticalAnchor.size })) { + horizontalAnchor.mode = LayoutAnchorMode.AVOID; + } + left = layout(activeWindow.innerWidth, viewSizeWidth, horizontalAnchor); + } else { + const horizontalAnchor = { + offset: around.left, + size: around.width, + position: anchorAlignment === 0 ? 0 : 1 + /* LayoutAnchorPosition.After */ + }; + const verticalAnchor = { offset: around.top, size: around.height, position: anchorPosition === 0 ? 0 : 1, mode: LayoutAnchorMode.ALIGN }; + left = layout(activeWindow.innerWidth, viewSizeWidth, horizontalAnchor); + if (Range2.intersects({ start: left, end: left + viewSizeWidth }, { start: horizontalAnchor.offset, end: horizontalAnchor.offset + horizontalAnchor.size })) { + verticalAnchor.mode = LayoutAnchorMode.AVOID; + } + top = layout(activeWindow.innerHeight, viewSizeHeight, verticalAnchor) + activeWindow.pageYOffset; + } + this.view.classList.remove("top", "bottom", "left", "right"); + this.view.classList.add(anchorPosition === 0 ? "bottom" : "top"); + this.view.classList.add(anchorAlignment === 0 ? "left" : "right"); + this.view.classList.toggle("fixed", this.useFixedPosition); + const containerPosition = getDomNodePagePosition(this.container); + const containerScrollTop = this.container.scrollTop || 0; + const containerScrollLeft = this.container.scrollLeft || 0; + this.view.style.top = `${top - (this.useFixedPosition ? getDomNodePagePosition(this.view).top : containerPosition.top) + containerScrollTop}px`; + this.view.style.left = `${left - (this.useFixedPosition ? getDomNodePagePosition(this.view).left : containerPosition.left) + containerScrollLeft}px`; + this.view.style.width = "initial"; + } + hide(data) { + const delegate = this.delegate; + this.delegate = null; + if (delegate?.onHide) { + delegate.onHide(data); + } + this.toDisposeOnClean.dispose(); + hide(this.view); + } + isVisible() { + return !!this.delegate; + } + onDOMEvent(e, onCapture) { + if (this.delegate) { + if (this.delegate.onDOMEvent) { + this.delegate.onDOMEvent(e, getWindow(e).document.activeElement); + } else if (onCapture && !isAncestor(e.target, this.container)) { + this.hide(); + } + } + } + dispose() { + this.hide(); + super.dispose(); + } +}; +var SHADOW_ROOT_CSS = ( + /* css */ + ` + :host { + all: initial; /* 1st rule so subsequent properties are reset. */ + } + + .codicon[class*='codicon-'] { + font: normal normal normal 16px/1 codicon; + display: inline-block; + text-decoration: none; + text-rendering: auto; + text-align: center; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + user-select: none; + -webkit-user-select: none; + -ms-user-select: none; + } + + :host { + font-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "HelveticaNeue-Light", system-ui, "Ubuntu", "Droid Sans", sans-serif; + } + + :host-context(.mac) { font-family: -apple-system, BlinkMacSystemFont, sans-serif; } + :host-context(.mac:lang(zh-Hans)) { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", sans-serif; } + :host-context(.mac:lang(zh-Hant)) { font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", sans-serif; } + :host-context(.mac:lang(ja)) { font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic Pro", sans-serif; } + :host-context(.mac:lang(ko)) { font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Nanum Gothic", "AppleGothic", sans-serif; } + + :host-context(.windows) { font-family: "Segoe WPC", "Segoe UI", sans-serif; } + :host-context(.windows:lang(zh-Hans)) { font-family: "Segoe WPC", "Segoe UI", "Microsoft YaHei", sans-serif; } + :host-context(.windows:lang(zh-Hant)) { font-family: "Segoe WPC", "Segoe UI", "Microsoft Jhenghei", sans-serif; } + :host-context(.windows:lang(ja)) { font-family: "Segoe WPC", "Segoe UI", "Yu Gothic UI", "Meiryo UI", sans-serif; } + :host-context(.windows:lang(ko)) { font-family: "Segoe WPC", "Segoe UI", "Malgun Gothic", "Dotom", sans-serif; } + + :host-context(.linux) { font-family: system-ui, "Ubuntu", "Droid Sans", sans-serif; } + :host-context(.linux:lang(zh-Hans)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans SC", "Source Han Sans CN", "Source Han Sans", sans-serif; } + :host-context(.linux:lang(zh-Hant)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans TC", "Source Han Sans TW", "Source Han Sans", sans-serif; } + :host-context(.linux:lang(ja)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans J", "Source Han Sans JP", "Source Han Sans", sans-serif; } + :host-context(.linux:lang(ko)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans K", "Source Han Sans JR", "Source Han Sans", "UnDotum", "FBaekmuk Gulim", sans-serif; } +` +); + +// node_modules/monaco-editor-core/esm/vs/platform/contextview/browser/contextViewService.js +init_lifecycle(); +init_dom(); +var __decorate174 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param168 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var ContextViewHandler = class ContextViewHandler2 extends Disposable { + constructor(layoutService) { + super(); + this.layoutService = layoutService; + this.contextView = this._register(new ContextView( + this.layoutService.mainContainer, + 1 + /* ContextViewDOMPosition.ABSOLUTE */ + )); + this.layout(); + this._register(layoutService.onDidLayoutContainer(() => this.layout())); + } + // ContextView + showContextView(delegate, container, shadowRoot) { + let domPosition; + if (container) { + if (container === this.layoutService.getContainer(getWindow(container))) { + domPosition = 1; + } else if (shadowRoot) { + domPosition = 3; + } else { + domPosition = 2; + } + } else { + domPosition = 1; + } + this.contextView.setContainer(container ?? this.layoutService.activeContainer, domPosition); + this.contextView.show(delegate); + const openContextView = { + close: () => { + if (this.openContextView === openContextView) { + this.hideContextView(); + } + } + }; + this.openContextView = openContextView; + return openContextView; + } + layout() { + this.contextView.layout(); + } + hideContextView(data) { + this.contextView.hide(data); + this.openContextView = void 0; + } +}; +ContextViewHandler = __decorate174([ + __param168(0, ILayoutService) +], ContextViewHandler); +var ContextViewService = class extends ContextViewHandler { + getContextViewElement() { + return this.contextView.getViewElement(); + } +}; + +// node_modules/monaco-editor-core/esm/vs/base/browser/ui/hover/hover.js +function isManagedHoverTooltipMarkdownString(obj) { + const candidate = obj; + return typeof candidate === "object" && "markdown" in candidate && "markdownNotSupportedFallback" in candidate; +} + +// node_modules/monaco-editor-core/esm/vs/platform/hover/browser/updatableHoverWidget.js +init_dom(); +init_cancellation(); +init_htmlContent(); +init_types(); +init_nls(); +var ManagedHoverWidget = class { + constructor(hoverDelegate, target, fadeInAnimation) { + this.hoverDelegate = hoverDelegate; + this.target = target; + this.fadeInAnimation = fadeInAnimation; + } + async update(content, focus, options2) { + if (this._cancellationTokenSource) { + this._cancellationTokenSource.dispose(true); + this._cancellationTokenSource = void 0; + } + if (this.isDisposed) { + return; + } + let resolvedContent; + if (isString(content) || isHTMLElement(content) || content === void 0) { + resolvedContent = content; + } else { + this._cancellationTokenSource = new CancellationTokenSource(); + const token = this._cancellationTokenSource.token; + let managedContent; + if (isManagedHoverTooltipMarkdownString(content)) { + if (isFunction(content.markdown)) { + managedContent = content.markdown(token).then((resolvedContent2) => resolvedContent2 ?? content.markdownNotSupportedFallback); + } else { + managedContent = content.markdown ?? content.markdownNotSupportedFallback; + } + } else { + managedContent = content.element(token); + } + if (managedContent instanceof Promise) { + if (!this._hoverWidget) { + this.show(localize(1700, "Loading..."), focus, options2); + } + resolvedContent = await managedContent; + } else { + resolvedContent = managedContent; + } + if (this.isDisposed || token.isCancellationRequested) { + return; + } + } + this.show(resolvedContent, focus, options2); + } + show(content, focus, options2) { + const oldHoverWidget = this._hoverWidget; + if (this.hasContent(content)) { + const hoverOptions = { + content, + target: this.target, + actions: options2?.actions, + linkHandler: options2?.linkHandler, + trapFocus: options2?.trapFocus, + appearance: { + showPointer: this.hoverDelegate.placement === "element", + skipFadeInAnimation: !this.fadeInAnimation || !!oldHoverWidget, + // do not fade in if the hover is already showing + showHoverHint: options2?.appearance?.showHoverHint + }, + position: { + hoverPosition: 2 + } + }; + this._hoverWidget = this.hoverDelegate.showHover(hoverOptions, focus); + } + oldHoverWidget?.dispose(); + } + hasContent(content) { + if (!content) { + return false; + } + if (isMarkdownString(content)) { + return !!content.value; + } + return true; + } + get isDisposed() { + return this._hoverWidget?.isDisposed; + } + dispose() { + this._hoverWidget?.dispose(); + this._cancellationTokenSource?.dispose(true); + this._cancellationTokenSource = void 0; + } +}; + +// node_modules/monaco-editor-core/esm/vs/platform/hover/browser/hoverService.js +init_async(); +init_configuration(); +init_types(); +init_keyCodes(); +init_keybindingsRegistry(); +init_iconLabels(); +var __decorate175 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param169 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var HoverService = class HoverService2 extends Disposable { + constructor(_instantiationService, _configurationService, contextMenuService, _keybindingService, _layoutService, _accessibilityService) { + super(); + this._instantiationService = _instantiationService; + this._configurationService = _configurationService; + this._keybindingService = _keybindingService; + this._layoutService = _layoutService; + this._accessibilityService = _accessibilityService; + this._currentDelayedHoverWasShown = false; + this._delayedHovers = /* @__PURE__ */ new Map(); + this._managedHovers = /* @__PURE__ */ new Map(); + this._register(contextMenuService.onDidShowContextMenu(() => this.hideHover())); + this._contextViewHandler = this._register(new ContextViewHandler(this._layoutService)); + this._register(KeybindingsRegistry.registerCommandAndKeybindingRule({ + id: "workbench.action.showHover", + weight: 0, + primary: KeyChord( + 2048 | 41, + 2048 | 39 + /* KeyCode.KeyI */ + ), + handler: () => { + this._showAndFocusHoverForActiveElement(); + } + })); + } + showInstantHover(options2, focus, skipLastFocusedUpdate, dontShow) { + const hover = this._createHover(options2, skipLastFocusedUpdate); + if (!hover) { + return void 0; + } + this._showHover(hover, options2, focus); + return hover; + } + showDelayedHover(options2, lifecycleOptions) { + if (options2.id === void 0) { + options2.id = getHoverIdFromContent(options2.content); + } + if (!this._currentDelayedHover || this._currentDelayedHoverWasShown) { + if (this._currentHover?.isLocked) { + return void 0; + } + if (getHoverOptionsIdentity(this._currentHoverOptions) === getHoverOptionsIdentity(options2)) { + return this._currentHover; + } + if (this._currentHover && !this._currentHover.isDisposed && this._currentDelayedHoverGroupId !== void 0 && this._currentDelayedHoverGroupId === lifecycleOptions?.groupId) { + return this.showInstantHover({ + ...options2, + appearance: { + ...options2.appearance, + skipFadeInAnimation: true + } + }); + } + } else if (this._currentDelayedHover && getHoverOptionsIdentity(this._currentHoverOptions) === getHoverOptionsIdentity(options2)) { + return this._currentDelayedHover; + } + const hover = this._createHover(options2, void 0); + if (!hover) { + this._currentDelayedHover = void 0; + this._currentDelayedHoverWasShown = false; + this._currentDelayedHoverGroupId = void 0; + return void 0; + } + this._currentDelayedHover = hover; + this._currentDelayedHoverWasShown = false; + this._currentDelayedHoverGroupId = lifecycleOptions?.groupId; + timeout(this._configurationService.getValue("workbench.hover.delay")).then(() => { + if (hover && !hover.isDisposed) { + this._currentDelayedHoverWasShown = true; + this._showHover(hover, options2); + } + }); + return hover; + } + setupDelayedHover(target, options2, lifecycleOptions) { + const resolveHoverOptions = () => ({ + ...typeof options2 === "function" ? options2() : options2, + target + }); + return this._setupDelayedHover(target, resolveHoverOptions, lifecycleOptions); + } + setupDelayedHoverAtMouse(target, options2, lifecycleOptions) { + const resolveHoverOptions = (e) => ({ + ...typeof options2 === "function" ? options2() : options2, + target: { + targetElements: [target], + x: e !== void 0 ? e.x + 10 : void 0 + } + }); + return this._setupDelayedHover(target, resolveHoverOptions, lifecycleOptions); + } + _setupDelayedHover(target, resolveHoverOptions, lifecycleOptions) { + const store = new DisposableStore(); + store.add(addDisposableListener(target, EventType.MOUSE_OVER, (e) => { + this.showDelayedHover(resolveHoverOptions(e), { + groupId: lifecycleOptions?.groupId + }); + })); + if (lifecycleOptions?.setupKeyboardEvents) { + store.add(addDisposableListener(target, EventType.KEY_DOWN, (e) => { + const evt = new StandardKeyboardEvent(e); + if (evt.equals( + 10 + /* KeyCode.Space */ + ) || evt.equals( + 3 + /* KeyCode.Enter */ + )) { + this.showInstantHover(resolveHoverOptions(), true); + } + })); + } + this._delayedHovers.set(target, { show: (focus) => { + this.showInstantHover(resolveHoverOptions(), focus); + } }); + store.add(toDisposable(() => this._delayedHovers.delete(target))); + return store; + } + _createHover(options2, skipLastFocusedUpdate) { + this._currentDelayedHover = void 0; + if (options2.content === "") { + return void 0; + } + if (this._currentHover?.isLocked) { + return void 0; + } + if (options2.id === void 0) { + options2.id = getHoverIdFromContent(options2.content); + } + if (getHoverOptionsIdentity(this._currentHoverOptions) === getHoverOptionsIdentity(options2)) { + return void 0; + } + this._currentHoverOptions = options2; + this._lastHoverOptions = options2; + const trapFocus = options2.trapFocus || this._accessibilityService.isScreenReaderOptimized(); + const activeElement = getActiveElement(); + if (!skipLastFocusedUpdate) { + if (trapFocus && activeElement) { + if (!activeElement.classList.contains("monaco-hover")) { + this._lastFocusedElementBeforeOpen = activeElement; + } + } else { + this._lastFocusedElementBeforeOpen = void 0; + } + } + const hoverDisposables = new DisposableStore(); + const hover = this._instantiationService.createInstance(HoverWidget2, options2); + if (options2.persistence?.sticky) { + hover.isLocked = true; + } + if (options2.position?.hoverPosition && !isNumber(options2.position.hoverPosition)) { + options2.target = { + targetElements: isHTMLElement(options2.target) ? [options2.target] : options2.target.targetElements, + x: options2.position.hoverPosition.x + 10 + }; + } + hover.onDispose(() => { + const hoverWasFocused = this._currentHover?.domNode && isAncestorOfActiveElement(this._currentHover.domNode); + if (hoverWasFocused) { + this._lastFocusedElementBeforeOpen?.focus(); + } + if (getHoverOptionsIdentity(this._currentHoverOptions) === getHoverOptionsIdentity(options2)) { + this.doHideHover(); + } + hoverDisposables.dispose(); + }, void 0, hoverDisposables); + if (!options2.container) { + const targetElement = isHTMLElement(options2.target) ? options2.target : options2.target.targetElements[0]; + options2.container = this._layoutService.getContainer(getWindow(targetElement)); + } + hover.onRequestLayout(() => this._contextViewHandler.layout(), void 0, hoverDisposables); + if (options2.persistence?.sticky) { + hoverDisposables.add(addDisposableListener(getWindow(options2.container).document, EventType.MOUSE_DOWN, (e) => { + if (!isAncestor(e.target, hover.domNode)) { + this.doHideHover(); + } + })); + } else { + if ("targetElements" in options2.target) { + for (const element of options2.target.targetElements) { + hoverDisposables.add(addDisposableListener(element, EventType.CLICK, () => this.hideHover())); + } + } else { + hoverDisposables.add(addDisposableListener(options2.target, EventType.CLICK, () => this.hideHover())); + } + const focusedElement = getActiveElement(); + if (focusedElement) { + const focusedElementDocument = getWindow(focusedElement).document; + hoverDisposables.add(addDisposableListener(focusedElement, EventType.KEY_DOWN, (e) => this._keyDown(e, hover, !!options2.persistence?.hideOnKeyDown))); + hoverDisposables.add(addDisposableListener(focusedElementDocument, EventType.KEY_DOWN, (e) => this._keyDown(e, hover, !!options2.persistence?.hideOnKeyDown))); + hoverDisposables.add(addDisposableListener(focusedElement, EventType.KEY_UP, (e) => this._keyUp(e, hover))); + hoverDisposables.add(addDisposableListener(focusedElementDocument, EventType.KEY_UP, (e) => this._keyUp(e, hover))); + } + } + if ("IntersectionObserver" in mainWindow) { + const observer = new IntersectionObserver((e) => this._intersectionChange(e, hover), { threshold: 0 }); + const firstTargetElement = "targetElements" in options2.target ? options2.target.targetElements[0] : options2.target; + observer.observe(firstTargetElement); + hoverDisposables.add(toDisposable(() => observer.disconnect())); + } + this._currentHover = hover; + return hover; + } + _showHover(hover, options2, focus) { + this._contextViewHandler.showContextView(new HoverContextViewDelegate(hover, focus), options2.container); + } + hideHover(force) { + if (!force && this._currentHover?.isLocked || !this._currentHoverOptions) { + return; + } + this.doHideHover(); + } + doHideHover() { + this._currentHover = void 0; + this._currentHoverOptions = void 0; + this._contextViewHandler.hideContextView(); + } + _intersectionChange(entries2, hover) { + const entry = entries2[entries2.length - 1]; + if (!entry.isIntersecting) { + hover.dispose(); + } + } + showAndFocusLastHover() { + if (!this._lastHoverOptions) { + return; + } + this.showInstantHover(this._lastHoverOptions, true, true); + } + _showAndFocusHoverForActiveElement() { + let activeElement = getActiveElement(); + while (activeElement) { + const hover = this._delayedHovers.get(activeElement) ?? this._managedHovers.get(activeElement); + if (hover) { + hover.show(true); + return; + } + activeElement = activeElement.parentElement; + } + } + _keyDown(e, hover, hideOnKeyDown) { + if (e.key === "Alt") { + hover.isLocked = true; + return; + } + const event = new StandardKeyboardEvent(e); + const keybinding = this._keybindingService.resolveKeyboardEvent(event); + if (keybinding.getSingleModifierDispatchChords().some((value) => !!value) || this._keybindingService.softDispatch(event, event.target).kind !== 0) { + return; + } + if (hideOnKeyDown && (!this._currentHoverOptions?.trapFocus || e.key !== "Tab")) { + this.hideHover(); + this._lastFocusedElementBeforeOpen?.focus(); + } + } + _keyUp(e, hover) { + if (e.key === "Alt") { + hover.isLocked = false; + if (!hover.isMouseIn) { + this.hideHover(); + this._lastFocusedElementBeforeOpen?.focus(); + } + } + } + // TODO: Investigate performance of this function. There seems to be a lot of content created + // and thrown away on start up + setupManagedHover(hoverDelegate, targetElement, content, options2) { + if (hoverDelegate.showNativeHover) { + return setupNativeHover(targetElement, content); + } + targetElement.setAttribute("custom-hover", "true"); + if (targetElement.title !== "") { + console.warn("HTML element already has a title attribute, which will conflict with the custom hover. Please remove the title attribute."); + console.trace("Stack trace:", targetElement.title); + targetElement.title = ""; + } + let hoverPreparation; + let hoverWidget; + const hideHover = (disposeWidget, disposePreparation) => { + const hadHover = hoverWidget !== void 0; + if (disposeWidget) { + hoverWidget?.dispose(); + hoverWidget = void 0; + } + if (disposePreparation) { + hoverPreparation?.dispose(); + hoverPreparation = void 0; + } + if (hadHover) { + hoverDelegate.onDidHideHover?.(); + hoverWidget = void 0; + } + }; + const triggerShowHover = (delay, focus, target, trapFocus) => { + return new TimeoutTimer(async () => { + if (!hoverWidget || hoverWidget.isDisposed) { + hoverWidget = new ManagedHoverWidget(hoverDelegate, target || targetElement, delay > 0); + await hoverWidget.update(typeof content === "function" ? content() : content, focus, { ...options2, trapFocus }); + } + }, delay); + }; + const store = new DisposableStore(); + let isMouseDown = false; + store.add(addDisposableListener(targetElement, EventType.MOUSE_DOWN, () => { + isMouseDown = true; + hideHover(true, true); + }, true)); + store.add(addDisposableListener(targetElement, EventType.MOUSE_UP, () => { + isMouseDown = false; + }, true)); + store.add(addDisposableListener(targetElement, EventType.MOUSE_LEAVE, (e) => { + isMouseDown = false; + hideHover(false, e.fromElement === targetElement); + }, true)); + store.add(addDisposableListener(targetElement, EventType.MOUSE_OVER, (e) => { + if (hoverPreparation) { + return; + } + const mouseOverStore = new DisposableStore(); + const target = { + targetElements: [targetElement], + dispose: () => { + } + }; + if (hoverDelegate.placement === void 0 || hoverDelegate.placement === "mouse") { + const onMouseMove = (e2) => { + target.x = e2.x + 10; + if (!eventIsRelatedToTarget(e2, targetElement)) { + hideHover(true, true); + } + }; + mouseOverStore.add(addDisposableListener(targetElement, EventType.MOUSE_MOVE, onMouseMove, true)); + } + hoverPreparation = mouseOverStore; + if (!eventIsRelatedToTarget(e, targetElement)) { + return; + } + mouseOverStore.add(triggerShowHover(typeof hoverDelegate.delay === "function" ? hoverDelegate.delay(content) : hoverDelegate.delay, false, target)); + }, true)); + const onFocus = (e) => { + if (isMouseDown || hoverPreparation) { + return; + } + if (!eventIsRelatedToTarget(e, targetElement)) { + return; + } + const target = { + targetElements: [targetElement], + dispose: () => { + } + }; + const toDispose = new DisposableStore(); + const onBlur = () => hideHover(true, true); + toDispose.add(addDisposableListener(targetElement, EventType.BLUR, onBlur, true)); + toDispose.add(triggerShowHover(typeof hoverDelegate.delay === "function" ? hoverDelegate.delay(content) : hoverDelegate.delay, false, target)); + hoverPreparation = toDispose; + }; + if (!isEditableElement(targetElement)) { + store.add(addDisposableListener(targetElement, EventType.FOCUS, onFocus, true)); + } + const hover = { + show: (focus) => { + hideHover(false, true); + triggerShowHover(0, focus, void 0, focus); + }, + hide: () => { + hideHover(true, true); + }, + update: async (newContent, hoverOptions) => { + content = newContent; + await hoverWidget?.update(content, void 0, hoverOptions); + }, + dispose: () => { + this._managedHovers.delete(targetElement); + store.dispose(); + hideHover(true, true); + } + }; + this._managedHovers.set(targetElement, hover); + return hover; + } + showManagedHover(target) { + const hover = this._managedHovers.get(target); + if (hover) { + hover.show(true); + } + } + dispose() { + this._managedHovers.forEach((hover) => hover.dispose()); + super.dispose(); + } +}; +HoverService = __decorate175([ + __param169(0, IInstantiationService), + __param169(1, IConfigurationService), + __param169(2, IContextMenuService), + __param169(3, IKeybindingService), + __param169(4, ILayoutService), + __param169(5, IAccessibilityService) +], HoverService); +function getHoverOptionsIdentity(options2) { + if (options2 === void 0) { + return void 0; + } + return options2?.id ?? options2; +} +function getHoverIdFromContent(content) { + if (isHTMLElement(content)) { + return void 0; + } + if (typeof content === "string") { + return content.toString(); + } + return content.value; +} +function getStringContent(contentOrFactory) { + const content = typeof contentOrFactory === "function" ? contentOrFactory() : contentOrFactory; + if (isString(content)) { + return stripIcons(content); + } + if (isManagedHoverTooltipMarkdownString(content)) { + return content.markdownNotSupportedFallback; + } + return void 0; +} +function setupNativeHover(targetElement, content) { + function updateTitle(title) { + if (title) { + targetElement.setAttribute("title", title); + } else { + targetElement.removeAttribute("title"); + } + } + updateTitle(getStringContent(content)); + return { + update: (content2) => updateTitle(getStringContent(content2)), + show: () => { + }, + hide: () => { + }, + dispose: () => updateTitle(void 0) + }; +} +var HoverContextViewDelegate = class { + get anchorPosition() { + return this._hover.anchor; + } + constructor(_hover, _focus = false) { + this._hover = _hover; + this._focus = _focus; + this.layer = 1; + } + render(container) { + this._hover.render(container); + if (this._focus) { + this._hover.focus(); + } + return this._hover; + } + getAnchor() { + return { + x: this._hover.x, + y: this._hover.y + }; + } + layout() { + this._hover.layout(); + } +}; +function eventIsRelatedToTarget(event, target) { + return isHTMLElement(event.target) && getHoverTargetElement(event.target, target) === target; +} +function getHoverTargetElement(element, stopElement) { + stopElement = stopElement ?? getWindow(element).document.body; + while (!element.hasAttribute("custom-hover") && element !== stopElement) { + element = element.parentElement; + } + return element; +} +registerSingleton( + IHoverService, + HoverService, + 1 + /* InstantiationType.Delayed */ +); +registerThemingParticipant((theme, collector) => { + const hoverBorder = theme.getColor(editorHoverBorder); + if (hoverBorder) { + collector.addRule(`.monaco-hover.workbench-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${hoverBorder.transparent(0.5)}; }`); + collector.addRule(`.monaco-hover.workbench-hover hr { border-top: 1px solid ${hoverBorder.transparent(0.5)}; }`); + } +}); + +// node_modules/monaco-editor-core/esm/vs/editor/standalone/browser/standaloneServices.js +init_strings(); +init_dom(); +init_keyboardEvent(); +init_event(); +init_keybindings(); +init_lifecycle(); +init_platform(); +init_uri(); +init_position(); +init_range(); +init_model(); +init_resolverService(); +init_commands(); +init_configuration(); + +// node_modules/monaco-editor-core/esm/vs/platform/configuration/common/configurationModels.js +init_arrays(); +init_map(); +init_objects(); +init_types(); +init_uri(); +init_configuration(); +init_configurationRegistry(); +init_platform2(); +function freeze2(data) { + return Object.isFrozen(data) ? data : deepFreeze(data); +} +var ConfigurationModel = class _ConfigurationModel { + static createEmptyModel(logService) { + return new _ConfigurationModel({}, [], [], void 0, logService); + } + constructor(_contents, _keys, _overrides, raw, logService) { + this._contents = _contents; + this._keys = _keys; + this._overrides = _overrides; + this.raw = raw; + this.logService = logService; + this.overrideConfigurations = /* @__PURE__ */ new Map(); + } + get rawConfiguration() { + if (!this._rawConfiguration) { + if (this.raw) { + const rawConfigurationModels = (Array.isArray(this.raw) ? this.raw : [this.raw]).map((raw) => { + if (raw instanceof _ConfigurationModel) { + return raw; + } + const parser2 = new ConfigurationModelParser("", this.logService); + parser2.parseRaw(raw); + return parser2.configurationModel; + }); + this._rawConfiguration = rawConfigurationModels.reduce((previous, current) => current === previous ? current : previous.merge(current), rawConfigurationModels[0]); + } else { + this._rawConfiguration = this; + } + } + return this._rawConfiguration; + } + get contents() { + return this._contents; + } + get overrides() { + return this._overrides; + } + get keys() { + return this._keys; + } + isEmpty() { + return this._keys.length === 0 && Object.keys(this._contents).length === 0 && this._overrides.length === 0; + } + getValue(section) { + return section ? getConfigurationValue(this.contents, section) : this.contents; + } + inspect(section, overrideIdentifier) { + const that = this; + return { + get value() { + return freeze2(that.rawConfiguration.getValue(section)); + }, + get override() { + return overrideIdentifier ? freeze2(that.rawConfiguration.getOverrideValue(section, overrideIdentifier)) : void 0; + }, + get merged() { + return freeze2(overrideIdentifier ? that.rawConfiguration.override(overrideIdentifier).getValue(section) : that.rawConfiguration.getValue(section)); + }, + get overrides() { + const overrides = []; + for (const { contents, identifiers, keys } of that.rawConfiguration.overrides) { + const value = new _ConfigurationModel(contents, keys, [], void 0, that.logService).getValue(section); + if (value !== void 0) { + overrides.push({ identifiers, value }); + } + } + return overrides.length ? freeze2(overrides) : void 0; + } + }; + } + getOverrideValue(section, overrideIdentifier) { + const overrideContents = this.getContentsForOverrideIdentifer(overrideIdentifier); + return overrideContents ? section ? getConfigurationValue(overrideContents, section) : overrideContents : void 0; + } + override(identifier) { + let overrideConfigurationModel = this.overrideConfigurations.get(identifier); + if (!overrideConfigurationModel) { + overrideConfigurationModel = this.createOverrideConfigurationModel(identifier); + this.overrideConfigurations.set(identifier, overrideConfigurationModel); + } + return overrideConfigurationModel; + } + merge(...others) { + const contents = deepClone(this.contents); + const overrides = deepClone(this.overrides); + const keys = [...this.keys]; + const raws = this.raw ? Array.isArray(this.raw) ? [...this.raw] : [this.raw] : [this]; + for (const other of others) { + raws.push(...other.raw ? Array.isArray(other.raw) ? other.raw : [other.raw] : [other]); + if (other.isEmpty()) { + continue; + } + this.mergeContents(contents, other.contents); + for (const otherOverride of other.overrides) { + const [override] = overrides.filter((o) => equals(o.identifiers, otherOverride.identifiers)); + if (override) { + this.mergeContents(override.contents, otherOverride.contents); + override.keys.push(...otherOverride.keys); + override.keys = distinct(override.keys); + } else { + overrides.push(deepClone(otherOverride)); + } + } + for (const key of other.keys) { + if (keys.indexOf(key) === -1) { + keys.push(key); + } + } + } + return new _ConfigurationModel(contents, keys, overrides, !raws.length || raws.every((raw) => raw instanceof _ConfigurationModel) ? void 0 : raws, this.logService); + } + createOverrideConfigurationModel(identifier) { + const overrideContents = this.getContentsForOverrideIdentifer(identifier); + if (!overrideContents || typeof overrideContents !== "object" || !Object.keys(overrideContents).length) { + return this; + } + const contents = {}; + for (const key of distinct([...Object.keys(this.contents), ...Object.keys(overrideContents)])) { + let contentsForKey = this.contents[key]; + const overrideContentsForKey = overrideContents[key]; + if (overrideContentsForKey) { + if (typeof contentsForKey === "object" && typeof overrideContentsForKey === "object") { + contentsForKey = deepClone(contentsForKey); + this.mergeContents(contentsForKey, overrideContentsForKey); + } else { + contentsForKey = overrideContentsForKey; + } + } + contents[key] = contentsForKey; + } + return new _ConfigurationModel(contents, this.keys, this.overrides, void 0, this.logService); + } + mergeContents(source, target) { + for (const key of Object.keys(target)) { + if (key in source) { + if (isObject(source[key]) && isObject(target[key])) { + this.mergeContents(source[key], target[key]); + continue; + } + } + source[key] = deepClone(target[key]); + } + } + getContentsForOverrideIdentifer(identifier) { + let contentsForIdentifierOnly = null; + let contents = null; + const mergeContents = (contentsToMerge) => { + if (contentsToMerge) { + if (contents) { + this.mergeContents(contents, contentsToMerge); + } else { + contents = deepClone(contentsToMerge); + } + } + }; + for (const override of this.overrides) { + if (override.identifiers.length === 1 && override.identifiers[0] === identifier) { + contentsForIdentifierOnly = override.contents; + } else if (override.identifiers.includes(identifier)) { + mergeContents(override.contents); + } + } + mergeContents(contentsForIdentifierOnly); + return contents; + } + toJSON() { + return { + contents: this.contents, + overrides: this.overrides, + keys: this.keys + }; + } + setValue(key, value) { + this.updateValue(key, value, false); + } + removeValue(key) { + const index = this.keys.indexOf(key); + if (index === -1) { + return; + } + this.keys.splice(index, 1); + removeFromValueTree(this.contents, key); + if (OVERRIDE_PROPERTY_REGEX.test(key)) { + this.overrides.splice(this.overrides.findIndex((o) => equals(o.identifiers, overrideIdentifiersFromKey(key))), 1); + } + } + updateValue(key, value, add) { + addToValueTree(this.contents, key, value, (e) => this.logService.error(e)); + add = add || this.keys.indexOf(key) === -1; + if (add) { + this.keys.push(key); + } + if (OVERRIDE_PROPERTY_REGEX.test(key)) { + const identifiers = overrideIdentifiersFromKey(key); + const override = { + identifiers, + keys: Object.keys(this.contents[key]), + contents: toValuesTree(this.contents[key], (message) => this.logService.error(message)) + }; + const index = this.overrides.findIndex((o) => equals(o.identifiers, identifiers)); + if (index !== -1) { + this.overrides[index] = override; + } else { + this.overrides.push(override); + } + } + } +}; +var ConfigurationModelParser = class { + constructor(_name, logService) { + this._name = _name; + this.logService = logService; + this._raw = null; + this._configurationModel = null; + this._restrictedConfigurations = []; + } + get configurationModel() { + return this._configurationModel || ConfigurationModel.createEmptyModel(this.logService); + } + parseRaw(raw, options2) { + this._raw = raw; + const { contents, keys, overrides, restricted, hasExcludedProperties } = this.doParseRaw(raw, options2); + this._configurationModel = new ConfigurationModel(contents, keys, overrides, hasExcludedProperties ? [raw] : void 0, this.logService); + this._restrictedConfigurations = restricted || []; + } + doParseRaw(raw, options2) { + const registry = Registry.as(Extensions4.Configuration); + const configurationProperties = registry.getConfigurationProperties(); + const excludedConfigurationProperties = registry.getExcludedConfigurationProperties(); + const filtered = this.filter(raw, configurationProperties, excludedConfigurationProperties, true, options2); + raw = filtered.raw; + const contents = toValuesTree(raw, (message) => this.logService.error(`Conflict in settings file ${this._name}: ${message}`)); + const keys = Object.keys(raw); + const overrides = this.toOverrides(raw, (message) => this.logService.error(`Conflict in settings file ${this._name}: ${message}`)); + return { contents, keys, overrides, restricted: filtered.restricted, hasExcludedProperties: filtered.hasExcludedProperties }; + } + filter(properties, configurationProperties, excludedConfigurationProperties, filterOverriddenProperties, options2) { + let hasExcludedProperties = false; + if (!options2?.scopes && !options2?.skipRestricted && !options2?.skipUnregistered && !options2?.exclude?.length) { + return { raw: properties, restricted: [], hasExcludedProperties }; + } + const raw = {}; + const restricted = []; + for (const key in properties) { + if (OVERRIDE_PROPERTY_REGEX.test(key) && filterOverriddenProperties) { + const result = this.filter(properties[key], configurationProperties, excludedConfigurationProperties, false, options2); + raw[key] = result.raw; + hasExcludedProperties = hasExcludedProperties || result.hasExcludedProperties; + restricted.push(...result.restricted); + } else { + const propertySchema = configurationProperties[key]; + if (propertySchema?.restricted) { + restricted.push(key); + } + if (this.shouldInclude(key, propertySchema, excludedConfigurationProperties, options2)) { + raw[key] = properties[key]; + } else { + hasExcludedProperties = true; + } + } + } + return { raw, restricted, hasExcludedProperties }; + } + shouldInclude(key, propertySchema, excludedConfigurationProperties, options2) { + if (options2.exclude?.includes(key)) { + return false; + } + if (options2.include?.includes(key)) { + return true; + } + if (options2.skipRestricted && propertySchema?.restricted) { + return false; + } + if (options2.skipUnregistered && !propertySchema) { + return false; + } + const schema = propertySchema ?? excludedConfigurationProperties[key]; + const scope = schema ? typeof schema.scope !== "undefined" ? schema.scope : 4 : void 0; + if (scope === void 0 || options2.scopes === void 0) { + return true; + } + return options2.scopes.includes(scope); + } + toOverrides(raw, conflictReporter) { + const overrides = []; + for (const key of Object.keys(raw)) { + if (OVERRIDE_PROPERTY_REGEX.test(key)) { + const overrideRaw = {}; + for (const keyInOverrideRaw in raw[key]) { + overrideRaw[keyInOverrideRaw] = raw[key][keyInOverrideRaw]; + } + overrides.push({ + identifiers: overrideIdentifiersFromKey(key), + keys: Object.keys(overrideRaw), + contents: toValuesTree(overrideRaw, conflictReporter) + }); + } + } + return overrides; + } +}; +var ConfigurationInspectValue = class { + constructor(key, overrides, _value, overrideIdentifiers, defaultConfiguration, policyConfiguration, applicationConfiguration, userConfiguration, localUserConfiguration, remoteUserConfiguration, workspaceConfiguration, folderConfigurationModel, memoryConfigurationModel) { + this.key = key; + this.overrides = overrides; + this._value = _value; + this.overrideIdentifiers = overrideIdentifiers; + this.defaultConfiguration = defaultConfiguration; + this.policyConfiguration = policyConfiguration; + this.applicationConfiguration = applicationConfiguration; + this.userConfiguration = userConfiguration; + this.localUserConfiguration = localUserConfiguration; + this.remoteUserConfiguration = remoteUserConfiguration; + this.workspaceConfiguration = workspaceConfiguration; + this.folderConfigurationModel = folderConfigurationModel; + this.memoryConfigurationModel = memoryConfigurationModel; + } + toInspectValue(inspectValue) { + return inspectValue?.value !== void 0 || inspectValue?.override !== void 0 || inspectValue?.overrides !== void 0 ? inspectValue : void 0; + } + get userInspectValue() { + if (!this._userInspectValue) { + this._userInspectValue = this.userConfiguration.inspect(this.key, this.overrides.overrideIdentifier); + } + return this._userInspectValue; + } + get user() { + return this.toInspectValue(this.userInspectValue); + } +}; +var Configuration = class _Configuration { + constructor(_defaultConfiguration, _policyConfiguration, _applicationConfiguration, _localUserConfiguration, _remoteUserConfiguration, _workspaceConfiguration, _folderConfigurations, _memoryConfiguration, _memoryConfigurationByResource, logService) { + this._defaultConfiguration = _defaultConfiguration; + this._policyConfiguration = _policyConfiguration; + this._applicationConfiguration = _applicationConfiguration; + this._localUserConfiguration = _localUserConfiguration; + this._remoteUserConfiguration = _remoteUserConfiguration; + this._workspaceConfiguration = _workspaceConfiguration; + this._folderConfigurations = _folderConfigurations; + this._memoryConfiguration = _memoryConfiguration; + this._memoryConfigurationByResource = _memoryConfigurationByResource; + this.logService = logService; + this._workspaceConsolidatedConfiguration = null; + this._foldersConsolidatedConfigurations = new ResourceMap(); + this._userConfiguration = null; + } + getValue(section, overrides, workspace) { + const consolidateConfigurationModel = this.getConsolidatedConfigurationModel(section, overrides, workspace); + return consolidateConfigurationModel.getValue(section); + } + updateValue(key, value, overrides = {}) { + let memoryConfiguration; + if (overrides.resource) { + memoryConfiguration = this._memoryConfigurationByResource.get(overrides.resource); + if (!memoryConfiguration) { + memoryConfiguration = ConfigurationModel.createEmptyModel(this.logService); + this._memoryConfigurationByResource.set(overrides.resource, memoryConfiguration); + } + } else { + memoryConfiguration = this._memoryConfiguration; + } + if (value === void 0) { + memoryConfiguration.removeValue(key); + } else { + memoryConfiguration.setValue(key, value); + } + if (!overrides.resource) { + this._workspaceConsolidatedConfiguration = null; + } + } + inspect(key, overrides, workspace) { + const consolidateConfigurationModel = this.getConsolidatedConfigurationModel(key, overrides, workspace); + const folderConfigurationModel = this.getFolderConfigurationModelForResource(overrides.resource, workspace); + const memoryConfigurationModel = overrides.resource ? this._memoryConfigurationByResource.get(overrides.resource) || this._memoryConfiguration : this._memoryConfiguration; + const overrideIdentifiers = /* @__PURE__ */ new Set(); + for (const override of consolidateConfigurationModel.overrides) { + for (const overrideIdentifier of override.identifiers) { + if (consolidateConfigurationModel.getOverrideValue(key, overrideIdentifier) !== void 0) { + overrideIdentifiers.add(overrideIdentifier); + } + } + } + return new ConfigurationInspectValue(key, overrides, consolidateConfigurationModel.getValue(key), overrideIdentifiers.size ? [...overrideIdentifiers] : void 0, this._defaultConfiguration, this._policyConfiguration.isEmpty() ? void 0 : this._policyConfiguration, this.applicationConfiguration.isEmpty() ? void 0 : this.applicationConfiguration, this.userConfiguration, this.localUserConfiguration, this.remoteUserConfiguration, workspace ? this._workspaceConfiguration : void 0, folderConfigurationModel ? folderConfigurationModel : void 0, memoryConfigurationModel); + } + get applicationConfiguration() { + return this._applicationConfiguration; + } + get userConfiguration() { + if (!this._userConfiguration) { + if (this._remoteUserConfiguration.isEmpty()) { + this._userConfiguration = this._localUserConfiguration; + } else { + const merged = this._localUserConfiguration.merge(this._remoteUserConfiguration); + this._userConfiguration = new ConfigurationModel(merged.contents, merged.keys, merged.overrides, void 0, this.logService); + } + } + return this._userConfiguration; + } + get localUserConfiguration() { + return this._localUserConfiguration; + } + get remoteUserConfiguration() { + return this._remoteUserConfiguration; + } + getConsolidatedConfigurationModel(section, overrides, workspace) { + let configurationModel = this.getConsolidatedConfigurationModelForResource(overrides, workspace); + if (overrides.overrideIdentifier) { + configurationModel = configurationModel.override(overrides.overrideIdentifier); + } + if (!this._policyConfiguration.isEmpty() && this._policyConfiguration.getValue(section) !== void 0) { + configurationModel = configurationModel.merge(); + for (const key of this._policyConfiguration.keys) { + configurationModel.setValue(key, this._policyConfiguration.getValue(key)); + } + } + return configurationModel; + } + getConsolidatedConfigurationModelForResource({ resource }, workspace) { + let consolidateConfiguration = this.getWorkspaceConsolidatedConfiguration(); + if (workspace && resource) { + const root = workspace.getFolder(resource); + if (root) { + consolidateConfiguration = this.getFolderConsolidatedConfiguration(root.uri) || consolidateConfiguration; + } + const memoryConfigurationForResource = this._memoryConfigurationByResource.get(resource); + if (memoryConfigurationForResource) { + consolidateConfiguration = consolidateConfiguration.merge(memoryConfigurationForResource); + } + } + return consolidateConfiguration; + } + getWorkspaceConsolidatedConfiguration() { + if (!this._workspaceConsolidatedConfiguration) { + this._workspaceConsolidatedConfiguration = this._defaultConfiguration.merge(this.applicationConfiguration, this.userConfiguration, this._workspaceConfiguration, this._memoryConfiguration); + } + return this._workspaceConsolidatedConfiguration; + } + getFolderConsolidatedConfiguration(folder) { + let folderConsolidatedConfiguration = this._foldersConsolidatedConfigurations.get(folder); + if (!folderConsolidatedConfiguration) { + const workspaceConsolidateConfiguration = this.getWorkspaceConsolidatedConfiguration(); + const folderConfiguration = this._folderConfigurations.get(folder); + if (folderConfiguration) { + folderConsolidatedConfiguration = workspaceConsolidateConfiguration.merge(folderConfiguration); + this._foldersConsolidatedConfigurations.set(folder, folderConsolidatedConfiguration); + } else { + folderConsolidatedConfiguration = workspaceConsolidateConfiguration; + } + } + return folderConsolidatedConfiguration; + } + getFolderConfigurationModelForResource(resource, workspace) { + if (workspace && resource) { + const root = workspace.getFolder(resource); + if (root) { + return this._folderConfigurations.get(root.uri); + } + } + return void 0; + } + toData() { + return { + defaults: { + contents: this._defaultConfiguration.contents, + overrides: this._defaultConfiguration.overrides, + keys: this._defaultConfiguration.keys + }, + policy: { + contents: this._policyConfiguration.contents, + overrides: this._policyConfiguration.overrides, + keys: this._policyConfiguration.keys + }, + application: { + contents: this.applicationConfiguration.contents, + overrides: this.applicationConfiguration.overrides, + keys: this.applicationConfiguration.keys, + raw: Array.isArray(this.applicationConfiguration.raw) ? void 0 : this.applicationConfiguration.raw + }, + userLocal: { + contents: this.localUserConfiguration.contents, + overrides: this.localUserConfiguration.overrides, + keys: this.localUserConfiguration.keys, + raw: Array.isArray(this.localUserConfiguration.raw) ? void 0 : this.localUserConfiguration.raw + }, + userRemote: { + contents: this.remoteUserConfiguration.contents, + overrides: this.remoteUserConfiguration.overrides, + keys: this.remoteUserConfiguration.keys, + raw: Array.isArray(this.remoteUserConfiguration.raw) ? void 0 : this.remoteUserConfiguration.raw + }, + workspace: { + contents: this._workspaceConfiguration.contents, + overrides: this._workspaceConfiguration.overrides, + keys: this._workspaceConfiguration.keys + }, + folders: [...this._folderConfigurations.keys()].reduce((result, folder) => { + const { contents, overrides, keys } = this._folderConfigurations.get(folder); + result.push([folder, { contents, overrides, keys }]); + return result; + }, []) + }; + } + static parse(data, logService) { + const defaultConfiguration = this.parseConfigurationModel(data.defaults, logService); + const policyConfiguration = this.parseConfigurationModel(data.policy, logService); + const applicationConfiguration = this.parseConfigurationModel(data.application, logService); + const userLocalConfiguration = this.parseConfigurationModel(data.userLocal, logService); + const userRemoteConfiguration = this.parseConfigurationModel(data.userRemote, logService); + const workspaceConfiguration = this.parseConfigurationModel(data.workspace, logService); + const folders = data.folders.reduce((result, value) => { + result.set(URI.revive(value[0]), this.parseConfigurationModel(value[1], logService)); + return result; + }, new ResourceMap()); + return new _Configuration(defaultConfiguration, policyConfiguration, applicationConfiguration, userLocalConfiguration, userRemoteConfiguration, workspaceConfiguration, folders, ConfigurationModel.createEmptyModel(logService), new ResourceMap(), logService); + } + static parseConfigurationModel(model, logService) { + return new ConfigurationModel(model.contents, model.keys, model.overrides, model.raw, logService); + } +}; +var ConfigurationChangeEvent = class { + constructor(change, previous, currentConfiguraiton, currentWorkspace, logService) { + this.change = change; + this.previous = previous; + this.currentConfiguraiton = currentConfiguraiton; + this.currentWorkspace = currentWorkspace; + this.logService = logService; + this._marker = "\n"; + this._markerCode1 = this._marker.charCodeAt(0); + this._markerCode2 = ".".charCodeAt(0); + this.affectedKeys = /* @__PURE__ */ new Set(); + this._previousConfiguration = void 0; + for (const key of change.keys) { + this.affectedKeys.add(key); + } + for (const [, keys] of change.overrides) { + for (const key of keys) { + this.affectedKeys.add(key); + } + } + this._affectsConfigStr = this._marker; + for (const key of this.affectedKeys) { + this._affectsConfigStr += key + this._marker; + } + } + get previousConfiguration() { + if (!this._previousConfiguration && this.previous) { + this._previousConfiguration = Configuration.parse(this.previous.data, this.logService); + } + return this._previousConfiguration; + } + affectsConfiguration(section, overrides) { + const needle = this._marker + section; + const idx = this._affectsConfigStr.indexOf(needle); + if (idx < 0) { + return false; + } + const pos = idx + needle.length; + if (pos >= this._affectsConfigStr.length) { + return false; + } + const code = this._affectsConfigStr.charCodeAt(pos); + if (code !== this._markerCode1 && code !== this._markerCode2) { + return false; + } + if (overrides) { + const value1 = this.previousConfiguration ? this.previousConfiguration.getValue(section, overrides, this.previous?.workspace) : void 0; + const value2 = this.currentConfiguraiton.getValue(section, overrides, this.currentWorkspace); + return !equals2(value1, value2); + } + return true; + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/standalone/browser/standaloneServices.js +init_contextkey(); +init_instantiation(); + +// node_modules/monaco-editor-core/esm/vs/platform/keybinding/common/abstractKeybindingService.js +init_async(); +init_errors(); +init_event(); +init_lifecycle(); +init_nls(); + +// node_modules/monaco-editor-core/esm/vs/platform/keybinding/common/keybindingResolver.js +init_contextkey(); +var NoMatchingKb = { + kind: 0 + /* ResultKind.NoMatchingKb */ +}; +var MoreChordsNeeded = { + kind: 1 + /* ResultKind.MoreChordsNeeded */ +}; +function KbFound(commandId, commandArgs, isBubble) { + return { kind: 2, commandId, commandArgs, isBubble }; +} +var KeybindingResolver = class _KeybindingResolver { + constructor(defaultKeybindings, overrides, log2) { + this._log = log2; + this._defaultKeybindings = defaultKeybindings; + this._defaultBoundCommands = /* @__PURE__ */ new Map(); + for (const defaultKeybinding of defaultKeybindings) { + const command = defaultKeybinding.command; + if (command && command.charAt(0) !== "-") { + this._defaultBoundCommands.set(command, true); + } + } + this._map = /* @__PURE__ */ new Map(); + this._lookupMap = /* @__PURE__ */ new Map(); + this._keybindings = _KeybindingResolver.handleRemovals([].concat(defaultKeybindings).concat(overrides)); + for (let i2 = 0, len = this._keybindings.length; i2 < len; i2++) { + const k = this._keybindings[i2]; + if (k.chords.length === 0) { + continue; + } + const when = k.when?.substituteConstants(); + if (when && when.type === 0) { + continue; + } + this._addKeyPress(k.chords[0], k); + } + } + static _isTargetedForRemoval(defaultKb, keypress, when) { + if (keypress) { + for (let i2 = 0; i2 < keypress.length; i2++) { + if (keypress[i2] !== defaultKb.chords[i2]) { + return false; + } + } + } + if (when && when.type !== 1) { + if (!defaultKb.when) { + return false; + } + if (!expressionsAreEqualWithConstantSubstitution(when, defaultKb.when)) { + return false; + } + } + return true; + } + /** + * Looks for rules containing "-commandId" and removes them. + */ + static handleRemovals(rules) { + const removals = /* @__PURE__ */ new Map(); + for (let i2 = 0, len = rules.length; i2 < len; i2++) { + const rule = rules[i2]; + if (rule.command && rule.command.charAt(0) === "-") { + const command = rule.command.substring(1); + if (!removals.has(command)) { + removals.set(command, [rule]); + } else { + removals.get(command).push(rule); + } + } + } + if (removals.size === 0) { + return rules; + } + const result = []; + for (let i2 = 0, len = rules.length; i2 < len; i2++) { + const rule = rules[i2]; + if (!rule.command || rule.command.length === 0) { + result.push(rule); + continue; + } + if (rule.command.charAt(0) === "-") { + continue; + } + const commandRemovals = removals.get(rule.command); + if (!commandRemovals || !rule.isDefault) { + result.push(rule); + continue; + } + let isRemoved = false; + for (const commandRemoval of commandRemovals) { + const when = commandRemoval.when; + if (this._isTargetedForRemoval(rule, commandRemoval.chords, when)) { + isRemoved = true; + break; + } + } + if (!isRemoved) { + result.push(rule); + continue; + } + } + return result; + } + _addKeyPress(keypress, item) { + const conflicts = this._map.get(keypress); + if (typeof conflicts === "undefined") { + this._map.set(keypress, [item]); + this._addToLookupMap(item); + return; + } + for (let i2 = conflicts.length - 1; i2 >= 0; i2--) { + const conflict = conflicts[i2]; + if (conflict.command === item.command) { + continue; + } + let isShorterKbPrefix = true; + for (let i3 = 1; i3 < conflict.chords.length && i3 < item.chords.length; i3++) { + if (conflict.chords[i3] !== item.chords[i3]) { + isShorterKbPrefix = false; + break; + } + } + if (!isShorterKbPrefix) { + continue; + } + if (_KeybindingResolver.whenIsEntirelyIncluded(conflict.when, item.when)) { + this._removeFromLookupMap(conflict); + } + } + conflicts.push(item); + this._addToLookupMap(item); + } + _addToLookupMap(item) { + if (!item.command) { + return; + } + let arr = this._lookupMap.get(item.command); + if (typeof arr === "undefined") { + arr = [item]; + this._lookupMap.set(item.command, arr); + } else { + arr.push(item); + } + } + _removeFromLookupMap(item) { + if (!item.command) { + return; + } + const arr = this._lookupMap.get(item.command); + if (typeof arr === "undefined") { + return; + } + for (let i2 = 0, len = arr.length; i2 < len; i2++) { + if (arr[i2] === item) { + arr.splice(i2, 1); + return; + } + } + } + /** + * Returns true if it is provable `a` implies `b`. + */ + static whenIsEntirelyIncluded(a, b) { + if (!b || b.type === 1) { + return true; + } + if (!a || a.type === 1) { + return false; + } + return implies(a, b); + } + getKeybindings() { + return this._keybindings; + } + lookupPrimaryKeybinding(commandId, context, enforceContextCheck = false) { + const items = this._lookupMap.get(commandId); + if (typeof items === "undefined" || items.length === 0) { + return null; + } + if (items.length === 1 && !enforceContextCheck) { + return items[0]; + } + for (let i2 = items.length - 1; i2 >= 0; i2--) { + const item = items[i2]; + if (context.contextMatchesRules(item.when)) { + return item; + } + } + if (enforceContextCheck) { + return null; + } + return items[items.length - 1]; + } + /** + * Looks up a keybinding trigged as a result of pressing a sequence of chords - `[...currentChords, keypress]` + * + * Example: resolving 3 chords pressed sequentially - `cmd+k cmd+p cmd+i`: + * `currentChords = [ 'cmd+k' , 'cmd+p' ]` and `keypress = `cmd+i` - last pressed chord + */ + resolve(context, currentChords, keypress) { + const pressedChords = [...currentChords, keypress]; + this._log(`| Resolving ${pressedChords}`); + const kbCandidates = this._map.get(pressedChords[0]); + if (kbCandidates === void 0) { + this._log(`\\ No keybinding entries.`); + return NoMatchingKb; + } + let lookupMap = null; + if (pressedChords.length < 2) { + lookupMap = kbCandidates; + } else { + lookupMap = []; + for (let i2 = 0, len = kbCandidates.length; i2 < len; i2++) { + const candidate = kbCandidates[i2]; + if (pressedChords.length > candidate.chords.length) { + continue; + } + let prefixMatches = true; + for (let i3 = 1; i3 < pressedChords.length; i3++) { + if (candidate.chords[i3] !== pressedChords[i3]) { + prefixMatches = false; + break; + } + } + if (prefixMatches) { + lookupMap.push(candidate); + } + } + } + const result = this._findCommand(context, lookupMap); + if (!result) { + this._log(`\\ From ${lookupMap.length} keybinding entries, no when clauses matched the context.`); + return NoMatchingKb; + } + if (pressedChords.length < result.chords.length) { + this._log(`\\ From ${lookupMap.length} keybinding entries, awaiting ${result.chords.length - pressedChords.length} more chord(s), when: ${printWhenExplanation(result.when)}, source: ${printSourceExplanation(result)}.`); + return MoreChordsNeeded; + } + this._log(`\\ From ${lookupMap.length} keybinding entries, matched ${result.command}, when: ${printWhenExplanation(result.when)}, source: ${printSourceExplanation(result)}.`); + return KbFound(result.command, result.commandArgs, result.bubble); + } + _findCommand(context, matches) { + for (let i2 = matches.length - 1; i2 >= 0; i2--) { + const k = matches[i2]; + if (!_KeybindingResolver._contextMatchesRules(context, k.when)) { + continue; + } + return k; + } + return null; + } + static _contextMatchesRules(context, rules) { + if (!rules) { + return true; + } + return rules.evaluate(context); + } +}; +function printWhenExplanation(when) { + if (!when) { + return `no when condition`; + } + return `${when.serialize()}`; +} +function printSourceExplanation(kb) { + return kb.extensionId ? kb.isBuiltinExtension ? `built-in extension ${kb.extensionId}` : `user extension ${kb.extensionId}` : kb.isDefault ? `built-in` : `user`; +} + +// node_modules/monaco-editor-core/esm/vs/platform/keybinding/common/abstractKeybindingService.js +var HIGH_FREQ_COMMANDS = /^(cursor|delete|undo|redo|tab|editor\.action\.clipboard)/; +var AbstractKeybindingService = class extends Disposable { + get onDidUpdateKeybindings() { + return this._onDidUpdateKeybindings ? this._onDidUpdateKeybindings.event : Event.None; + } + get inChordMode() { + return this._currentChords.length > 0; + } + constructor(_contextKeyService, _commandService, _telemetryService, _notificationService, _logService) { + super(); + this._contextKeyService = _contextKeyService; + this._commandService = _commandService; + this._telemetryService = _telemetryService; + this._notificationService = _notificationService; + this._logService = _logService; + this._onDidUpdateKeybindings = this._register(new Emitter()); + this._currentChords = []; + this._currentChordChecker = new IntervalTimer(); + this._currentChordStatusMessage = null; + this._ignoreSingleModifiers = KeybindingModifierSet.EMPTY; + this._currentSingleModifier = null; + this._currentSingleModifierClearTimeout = new TimeoutTimer(); + this._currentlyDispatchingCommandId = null; + this._logging = false; + } + dispose() { + super.dispose(); + } + _log(str) { + if (this._logging) { + this._logService.info(`[KeybindingService]: ${str}`); + } + } + getKeybindings() { + return this._getResolver().getKeybindings(); + } + lookupKeybinding(commandId, context, enforceContextCheck = false) { + const result = this._getResolver().lookupPrimaryKeybinding(commandId, context || this._contextKeyService, enforceContextCheck); + if (!result) { + return void 0; + } + return result.resolvedKeybinding; + } + dispatchEvent(e, target) { + return this._dispatch(e, target); + } + // TODO@ulugbekna: update namings to align with `_doDispatch` + // TODO@ulugbekna: this fn doesn't seem to take into account single-modifier keybindings, eg `shift shift` + softDispatch(e, target) { + this._log(`/ Soft dispatching keyboard event`); + const keybinding = this.resolveKeyboardEvent(e); + if (keybinding.hasMultipleChords()) { + console.warn("keyboard event should not be mapped to multiple chords"); + return NoMatchingKb; + } + const [firstChord] = keybinding.getDispatchChords(); + if (firstChord === null) { + this._log(`\\ Keyboard event cannot be dispatched`); + return NoMatchingKb; + } + const contextValue = this._contextKeyService.getContext(target); + const currentChords = this._currentChords.map((({ keypress }) => keypress)); + return this._getResolver().resolve(contextValue, currentChords, firstChord); + } + _scheduleLeaveChordMode() { + const chordLastInteractedTime = Date.now(); + this._currentChordChecker.cancelAndSet(() => { + if (!this._documentHasFocus()) { + this._leaveChordMode(); + return; + } + if (Date.now() - chordLastInteractedTime > 5e3) { + this._leaveChordMode(); + } + }, 500); + } + _expectAnotherChord(firstChord, keypressLabel) { + this._currentChords.push({ keypress: firstChord, label: keypressLabel }); + switch (this._currentChords.length) { + case 0: + throw illegalState("impossible"); + case 1: + this._currentChordStatusMessage = this._notificationService.status(localize(1701, "({0}) was pressed. Waiting for second key of chord...", keypressLabel)); + break; + default: { + const fullKeypressLabel = this._currentChords.map(({ label }) => label).join(", "); + this._currentChordStatusMessage = this._notificationService.status(localize(1702, "({0}) was pressed. Waiting for next key of chord...", fullKeypressLabel)); + } + } + this._scheduleLeaveChordMode(); + if (IME.enabled) { + IME.disable(); + } + } + _leaveChordMode() { + if (this._currentChordStatusMessage) { + this._currentChordStatusMessage.close(); + this._currentChordStatusMessage = null; + } + this._currentChordChecker.cancel(); + this._currentChords = []; + IME.enable(); + } + _dispatch(e, target) { + return this._doDispatch( + this.resolveKeyboardEvent(e), + target, + /*isSingleModiferChord*/ + false + ); + } + _singleModifierDispatch(e, target) { + const keybinding = this.resolveKeyboardEvent(e); + const [singleModifier] = keybinding.getSingleModifierDispatchChords(); + if (singleModifier) { + if (this._ignoreSingleModifiers.has(singleModifier)) { + this._log(`+ Ignoring single modifier ${singleModifier} due to it being pressed together with other keys.`); + this._ignoreSingleModifiers = KeybindingModifierSet.EMPTY; + this._currentSingleModifierClearTimeout.cancel(); + this._currentSingleModifier = null; + return false; + } + this._ignoreSingleModifiers = KeybindingModifierSet.EMPTY; + if (this._currentSingleModifier === null) { + this._log(`+ Storing single modifier for possible chord ${singleModifier}.`); + this._currentSingleModifier = singleModifier; + this._currentSingleModifierClearTimeout.cancelAndSet(() => { + this._log(`+ Clearing single modifier due to 300ms elapsed.`); + this._currentSingleModifier = null; + }, 300); + return false; + } + if (singleModifier === this._currentSingleModifier) { + this._log(`/ Dispatching single modifier chord ${singleModifier} ${singleModifier}`); + this._currentSingleModifierClearTimeout.cancel(); + this._currentSingleModifier = null; + return this._doDispatch( + keybinding, + target, + /*isSingleModiferChord*/ + true + ); + } + this._log(`+ Clearing single modifier due to modifier mismatch: ${this._currentSingleModifier} ${singleModifier}`); + this._currentSingleModifierClearTimeout.cancel(); + this._currentSingleModifier = null; + return false; + } + const [firstChord] = keybinding.getChords(); + this._ignoreSingleModifiers = new KeybindingModifierSet(firstChord); + if (this._currentSingleModifier !== null) { + this._log(`+ Clearing single modifier due to other key up.`); + } + this._currentSingleModifierClearTimeout.cancel(); + this._currentSingleModifier = null; + return false; + } + _doDispatch(userKeypress, target, isSingleModiferChord = false) { + let shouldPreventDefault = false; + if (userKeypress.hasMultipleChords()) { + console.warn("Unexpected keyboard event mapped to multiple chords"); + return false; + } + let userPressedChord = null; + let currentChords = null; + if (isSingleModiferChord) { + const [dispatchKeyname] = userKeypress.getSingleModifierDispatchChords(); + userPressedChord = dispatchKeyname; + currentChords = dispatchKeyname ? [dispatchKeyname] : []; + } else { + [userPressedChord] = userKeypress.getDispatchChords(); + currentChords = this._currentChords.map(({ keypress }) => keypress); + } + if (userPressedChord === null) { + this._log(`\\ Keyboard event cannot be dispatched in keydown phase.`); + return shouldPreventDefault; + } + const contextValue = this._contextKeyService.getContext(target); + const keypressLabel = userKeypress.getLabel(); + const resolveResult = this._getResolver().resolve(contextValue, currentChords, userPressedChord); + switch (resolveResult.kind) { + case 0: { + this._logService.trace("KeybindingService#dispatch", keypressLabel, `[ No matching keybinding ]`); + if (this.inChordMode) { + const currentChordsLabel = this._currentChords.map(({ label }) => label).join(", "); + this._log(`+ Leaving multi-chord mode: Nothing bound to "${currentChordsLabel}, ${keypressLabel}".`); + this._notificationService.status(localize(1703, "The key combination ({0}, {1}) is not a command.", currentChordsLabel, keypressLabel), { + hideAfter: 10 * 1e3 + /* 10s */ + }); + this._leaveChordMode(); + shouldPreventDefault = true; + } + return shouldPreventDefault; + } + case 1: { + this._logService.trace("KeybindingService#dispatch", keypressLabel, `[ Several keybindings match - more chords needed ]`); + shouldPreventDefault = true; + this._expectAnotherChord(userPressedChord, keypressLabel); + this._log(this._currentChords.length === 1 ? `+ Entering multi-chord mode...` : `+ Continuing multi-chord mode...`); + return shouldPreventDefault; + } + case 2: { + this._logService.trace("KeybindingService#dispatch", keypressLabel, `[ Will dispatch command ${resolveResult.commandId} ]`); + if (resolveResult.commandId === null || resolveResult.commandId === "") { + if (this.inChordMode) { + const currentChordsLabel = this._currentChords.map(({ label }) => label).join(", "); + this._log(`+ Leaving chord mode: Nothing bound to "${currentChordsLabel}, ${keypressLabel}".`); + this._notificationService.status(localize(1704, "The key combination ({0}, {1}) is not a command.", currentChordsLabel, keypressLabel), { + hideAfter: 10 * 1e3 + /* 10s */ + }); + this._leaveChordMode(); + shouldPreventDefault = true; + } + } else { + if (this.inChordMode) { + this._leaveChordMode(); + } + if (!resolveResult.isBubble) { + shouldPreventDefault = true; + } + this._log(`+ Invoking command ${resolveResult.commandId}.`); + this._currentlyDispatchingCommandId = resolveResult.commandId; + try { + if (typeof resolveResult.commandArgs === "undefined") { + this._commandService.executeCommand(resolveResult.commandId).then(void 0, (err) => this._notificationService.warn(err)); + } else { + this._commandService.executeCommand(resolveResult.commandId, resolveResult.commandArgs).then(void 0, (err) => this._notificationService.warn(err)); + } + } finally { + this._currentlyDispatchingCommandId = null; + } + if (!HIGH_FREQ_COMMANDS.test(resolveResult.commandId)) { + this._telemetryService.publicLog2("workbenchActionExecuted", { id: resolveResult.commandId, from: "keybinding", detail: userKeypress.getUserSettingsLabel() ?? void 0 }); + } + } + return shouldPreventDefault; + } + } + } + mightProducePrintableCharacter(event) { + if (event.ctrlKey || event.metaKey) { + return false; + } + if (event.keyCode >= 31 && event.keyCode <= 56 || event.keyCode >= 21 && event.keyCode <= 30) { + return true; + } + return false; + } +}; +var KeybindingModifierSet = class _KeybindingModifierSet { + static { + this.EMPTY = new _KeybindingModifierSet(null); + } + constructor(source) { + this._ctrlKey = source ? source.ctrlKey : false; + this._shiftKey = source ? source.shiftKey : false; + this._altKey = source ? source.altKey : false; + this._metaKey = source ? source.metaKey : false; + } + has(modifier) { + switch (modifier) { + case "ctrl": + return this._ctrlKey; + case "shift": + return this._shiftKey; + case "alt": + return this._altKey; + case "meta": + return this._metaKey; + } + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/standalone/browser/standaloneServices.js +init_keybindingsRegistry(); + +// node_modules/monaco-editor-core/esm/vs/platform/keybinding/common/resolvedKeybindingItem.js +var ResolvedKeybindingItem = class { + constructor(resolvedKeybinding, command, commandArgs, when, isDefault, extensionId, isBuiltinExtension) { + this._resolvedKeybindingItemBrand = void 0; + this.resolvedKeybinding = resolvedKeybinding; + this.chords = resolvedKeybinding ? toEmptyArrayIfContainsNull(resolvedKeybinding.getDispatchChords()) : []; + if (resolvedKeybinding && this.chords.length === 0) { + this.chords = toEmptyArrayIfContainsNull(resolvedKeybinding.getSingleModifierDispatchChords()); + } + this.bubble = command ? command.charCodeAt(0) === 94 : false; + this.command = this.bubble ? command.substr(1) : command; + this.commandArgs = commandArgs; + this.when = when; + this.isDefault = isDefault; + this.extensionId = extensionId; + this.isBuiltinExtension = isBuiltinExtension; + } +}; +function toEmptyArrayIfContainsNull(arr) { + const result = []; + for (let i2 = 0, len = arr.length; i2 < len; i2++) { + const element = arr[i2]; + if (!element) { + return []; + } + result.push(element); + } + return result; +} + +// node_modules/monaco-editor-core/esm/vs/platform/keybinding/common/usLayoutResolvedKeybinding.js +init_keyCodes(); +init_keybindings(); + +// node_modules/monaco-editor-core/esm/vs/platform/keybinding/common/baseResolvedKeybinding.js +init_errors(); +init_keybindings(); +var BaseResolvedKeybinding = class extends ResolvedKeybinding { + constructor(os, chords) { + super(); + if (chords.length === 0) { + throw illegalArgument(`chords`); + } + this._os = os; + this._chords = chords; + } + getLabel() { + return UILabelProvider.toLabel(this._os, this._chords, (keybinding) => this._getLabel(keybinding)); + } + getAriaLabel() { + return AriaLabelProvider.toLabel(this._os, this._chords, (keybinding) => this._getAriaLabel(keybinding)); + } + getElectronAccelerator() { + if (this._chords.length > 1) { + return null; + } + if (this._chords[0].isDuplicateModifierCase()) { + return null; + } + return ElectronAcceleratorLabelProvider.toLabel(this._os, this._chords, (keybinding) => this._getElectronAccelerator(keybinding)); + } + getUserSettingsLabel() { + return UserSettingsLabelProvider.toLabel(this._os, this._chords, (keybinding) => this._getUserSettingsLabel(keybinding)); + } + hasMultipleChords() { + return this._chords.length > 1; + } + getChords() { + return this._chords.map((keybinding) => this._getChord(keybinding)); + } + _getChord(keybinding) { + return new ResolvedChord(keybinding.ctrlKey, keybinding.shiftKey, keybinding.altKey, keybinding.metaKey, this._getLabel(keybinding), this._getAriaLabel(keybinding)); + } + getDispatchChords() { + return this._chords.map((keybinding) => this._getChordDispatch(keybinding)); + } + getSingleModifierDispatchChords() { + return this._chords.map((keybinding) => this._getSingleModifierChordDispatch(keybinding)); + } +}; + +// node_modules/monaco-editor-core/esm/vs/platform/keybinding/common/usLayoutResolvedKeybinding.js +var USLayoutResolvedKeybinding = class _USLayoutResolvedKeybinding extends BaseResolvedKeybinding { + constructor(chords, os) { + super(os, chords); + } + _keyCodeToUILabel(keyCode) { + if (this._os === 2) { + switch (keyCode) { + case 15: + return "\u2190"; + case 16: + return "\u2191"; + case 17: + return "\u2192"; + case 18: + return "\u2193"; + } + } + return KeyCodeUtils.toString(keyCode); + } + _getLabel(chord) { + if (chord.isDuplicateModifierCase()) { + return ""; + } + return this._keyCodeToUILabel(chord.keyCode); + } + _getAriaLabel(chord) { + if (chord.isDuplicateModifierCase()) { + return ""; + } + return KeyCodeUtils.toString(chord.keyCode); + } + _getElectronAccelerator(chord) { + return KeyCodeUtils.toElectronAccelerator(chord.keyCode); + } + _getUserSettingsLabel(chord) { + if (chord.isDuplicateModifierCase()) { + return ""; + } + const result = KeyCodeUtils.toUserSettingsUS(chord.keyCode); + return result ? result.toLowerCase() : result; + } + _getChordDispatch(chord) { + return _USLayoutResolvedKeybinding.getDispatchStr(chord); + } + static getDispatchStr(chord) { + if (chord.isModifierKey()) { + return null; + } + let result = ""; + if (chord.ctrlKey) { + result += "ctrl+"; + } + if (chord.shiftKey) { + result += "shift+"; + } + if (chord.altKey) { + result += "alt+"; + } + if (chord.metaKey) { + result += "meta+"; + } + result += KeyCodeUtils.toString(chord.keyCode); + return result; + } + _getSingleModifierChordDispatch(keybinding) { + if (keybinding.keyCode === 5 && !keybinding.shiftKey && !keybinding.altKey && !keybinding.metaKey) { + return "ctrl"; + } + if (keybinding.keyCode === 4 && !keybinding.ctrlKey && !keybinding.altKey && !keybinding.metaKey) { + return "shift"; + } + if (keybinding.keyCode === 6 && !keybinding.ctrlKey && !keybinding.shiftKey && !keybinding.metaKey) { + return "alt"; + } + if (keybinding.keyCode === 57 && !keybinding.ctrlKey && !keybinding.shiftKey && !keybinding.altKey) { + return "meta"; + } + return null; + } + /** + * *NOTE*: Check return value for `KeyCode.Unknown`. + */ + static _scanCodeToKeyCode(scanCode) { + const immutableKeyCode = IMMUTABLE_CODE_TO_KEY_CODE[scanCode]; + if (immutableKeyCode !== -1) { + return immutableKeyCode; + } + switch (scanCode) { + case 10: + return 31; + case 11: + return 32; + case 12: + return 33; + case 13: + return 34; + case 14: + return 35; + case 15: + return 36; + case 16: + return 37; + case 17: + return 38; + case 18: + return 39; + case 19: + return 40; + case 20: + return 41; + case 21: + return 42; + case 22: + return 43; + case 23: + return 44; + case 24: + return 45; + case 25: + return 46; + case 26: + return 47; + case 27: + return 48; + case 28: + return 49; + case 29: + return 50; + case 30: + return 51; + case 31: + return 52; + case 32: + return 53; + case 33: + return 54; + case 34: + return 55; + case 35: + return 56; + case 36: + return 22; + case 37: + return 23; + case 38: + return 24; + case 39: + return 25; + case 40: + return 26; + case 41: + return 27; + case 42: + return 28; + case 43: + return 29; + case 44: + return 30; + case 45: + return 21; + case 51: + return 88; + case 52: + return 86; + case 53: + return 92; + case 54: + return 94; + case 55: + return 93; + case 56: + return 0; + // missing + case 57: + return 85; + case 58: + return 95; + case 59: + return 91; + case 60: + return 87; + case 61: + return 89; + case 62: + return 90; + case 106: + return 97; + } + return 0; + } + static _toKeyCodeChord(chord) { + if (!chord) { + return null; + } + if (chord instanceof KeyCodeChord) { + return chord; + } + const keyCode = this._scanCodeToKeyCode(chord.scanCode); + if (keyCode === 0) { + return null; + } + return new KeyCodeChord(chord.ctrlKey, chord.shiftKey, chord.altKey, chord.metaKey, keyCode); + } + static resolveKeybinding(keybinding, os) { + const chords = toEmptyArrayIfContainsNull(keybinding.chords.map((chord) => this._toKeyCodeChord(chord))); + if (chords.length > 0) { + return [new _USLayoutResolvedKeybinding(chords, os)]; + } + return []; + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/standalone/browser/standaloneServices.js +init_telemetry(); +init_standaloneStrings(); +init_resources(); +init_codeEditorService(); +init_log(); + +// node_modules/monaco-editor-core/esm/vs/editor/common/services/languageService.js +init_event(); +init_lifecycle(); + +// node_modules/monaco-editor-core/esm/vs/editor/common/services/languagesRegistry.js +init_event(); +init_lifecycle(); +init_strings(); + +// node_modules/monaco-editor-core/esm/vs/editor/common/services/languagesAssociations.js +init_mime(); +init_network(); +init_path(); +init_resources(); +init_strings(); +init_modesRegistry(); +var registeredAssociations = []; +var nonUserRegisteredAssociations = []; +var userRegisteredAssociations = []; +function registerPlatformLanguageAssociation(association, warnOnOverwrite = false) { + _registerLanguageAssociation(association, false, warnOnOverwrite); +} +function _registerLanguageAssociation(association, userConfigured, warnOnOverwrite) { + const associationItem = toLanguageAssociationItem(association, userConfigured); + registeredAssociations.push(associationItem); + if (!associationItem.userConfigured) { + nonUserRegisteredAssociations.push(associationItem); + } else { + userRegisteredAssociations.push(associationItem); + } + if (warnOnOverwrite && !associationItem.userConfigured) { + registeredAssociations.forEach((a) => { + if (a.mime === associationItem.mime || a.userConfigured) { + return; + } + if (associationItem.extension && a.extension === associationItem.extension) { + console.warn(`Overwriting extension <<${associationItem.extension}>> to now point to mime <<${associationItem.mime}>>`); + } + if (associationItem.filename && a.filename === associationItem.filename) { + console.warn(`Overwriting filename <<${associationItem.filename}>> to now point to mime <<${associationItem.mime}>>`); + } + if (associationItem.filepattern && a.filepattern === associationItem.filepattern) { + console.warn(`Overwriting filepattern <<${associationItem.filepattern}>> to now point to mime <<${associationItem.mime}>>`); + } + if (associationItem.firstline && a.firstline === associationItem.firstline) { + console.warn(`Overwriting firstline <<${associationItem.firstline}>> to now point to mime <<${associationItem.mime}>>`); + } + }); + } +} +function toLanguageAssociationItem(association, userConfigured) { + return { + id: association.id, + mime: association.mime, + filename: association.filename, + extension: association.extension, + filepattern: association.filepattern, + firstline: association.firstline, + userConfigured, + filenameLowercase: association.filename ? association.filename.toLowerCase() : void 0, + extensionLowercase: association.extension ? association.extension.toLowerCase() : void 0, + filepatternLowercase: association.filepattern ? parse3(association.filepattern.toLowerCase()) : void 0, + filepatternOnPath: association.filepattern ? association.filepattern.indexOf(posix.sep) >= 0 : false + }; +} +function clearPlatformLanguageAssociations() { + registeredAssociations = registeredAssociations.filter((a) => a.userConfigured); + nonUserRegisteredAssociations = []; +} +function getLanguageIds(resource, firstLine) { + return getAssociations(resource, firstLine).map((item) => item.id); +} +function getAssociations(resource, firstLine) { + let path; + if (resource) { + switch (resource.scheme) { + case Schemas.file: + path = resource.fsPath; + break; + case Schemas.data: { + const metadata = DataUri.parseMetaData(resource); + path = metadata.get(DataUri.META_DATA_LABEL); + break; + } + case Schemas.vscodeNotebookCell: + path = void 0; + break; + default: + path = resource.path; + } + } + if (!path) { + return [{ id: "unknown", mime: Mimes.unknown }]; + } + path = path.toLowerCase(); + const filename = basename(path); + const configuredLanguage = getAssociationByPath(path, filename, userRegisteredAssociations); + if (configuredLanguage) { + return [configuredLanguage, { id: PLAINTEXT_LANGUAGE_ID, mime: Mimes.text }]; + } + const registeredLanguage = getAssociationByPath(path, filename, nonUserRegisteredAssociations); + if (registeredLanguage) { + return [registeredLanguage, { id: PLAINTEXT_LANGUAGE_ID, mime: Mimes.text }]; + } + if (firstLine) { + const firstlineLanguage = getAssociationByFirstline(firstLine); + if (firstlineLanguage) { + return [firstlineLanguage, { id: PLAINTEXT_LANGUAGE_ID, mime: Mimes.text }]; + } + } + return [{ id: "unknown", mime: Mimes.unknown }]; +} +function getAssociationByPath(path, filename, associations) { + let filenameMatch = void 0; + let patternMatch = void 0; + let extensionMatch = void 0; + for (let i2 = associations.length - 1; i2 >= 0; i2--) { + const association = associations[i2]; + if (filename === association.filenameLowercase) { + filenameMatch = association; + break; + } + if (association.filepattern) { + if (!patternMatch || association.filepattern.length > patternMatch.filepattern.length) { + const target = association.filepatternOnPath ? path : filename; + if (association.filepatternLowercase?.(target)) { + patternMatch = association; + } + } + } + if (association.extension) { + if (!extensionMatch || association.extension.length > extensionMatch.extension.length) { + if (filename.endsWith(association.extensionLowercase)) { + extensionMatch = association; + } + } + } + } + if (filenameMatch) { + return filenameMatch; + } + if (patternMatch) { + return patternMatch; + } + if (extensionMatch) { + return extensionMatch; + } + return void 0; +} +function getAssociationByFirstline(firstLine) { + if (startsWithUTF8BOM(firstLine)) { + firstLine = firstLine.substr(1); + } + if (firstLine.length > 0) { + for (let i2 = registeredAssociations.length - 1; i2 >= 0; i2--) { + const association = registeredAssociations[i2]; + if (!association.firstline) { + continue; + } + const matches = firstLine.match(association.firstline); + if (matches && matches.length > 0) { + return association; + } + } + } + return void 0; +} + +// node_modules/monaco-editor-core/esm/vs/editor/common/services/languagesRegistry.js +init_modesRegistry(); +init_configurationRegistry(); +init_platform2(); +var hasOwnProperty2 = Object.prototype.hasOwnProperty; +var NULL_LANGUAGE_ID = "vs.editor.nullLanguage"; +var LanguageIdCodec = class { + constructor() { + this._languageIdToLanguage = []; + this._languageToLanguageId = /* @__PURE__ */ new Map(); + this._register( + NULL_LANGUAGE_ID, + 0 + /* LanguageId.Null */ + ); + this._register( + PLAINTEXT_LANGUAGE_ID, + 1 + /* LanguageId.PlainText */ + ); + this._nextLanguageId = 2; + } + _register(language2, languageId) { + this._languageIdToLanguage[languageId] = language2; + this._languageToLanguageId.set(language2, languageId); + } + register(language2) { + if (this._languageToLanguageId.has(language2)) { + return; + } + const languageId = this._nextLanguageId++; + this._register(language2, languageId); + } + encodeLanguageId(languageId) { + return this._languageToLanguageId.get(languageId) || 0; + } + decodeLanguageId(languageId) { + return this._languageIdToLanguage[languageId] || NULL_LANGUAGE_ID; + } +}; +var LanguagesRegistry = class _LanguagesRegistry extends Disposable { + static { + this.instanceCount = 0; + } + constructor(useModesRegistry = true, warnOnOverwrite = false) { + super(); + this._onDidChange = this._register(new Emitter()); + this.onDidChange = this._onDidChange.event; + _LanguagesRegistry.instanceCount++; + this._warnOnOverwrite = warnOnOverwrite; + this.languageIdCodec = new LanguageIdCodec(); + this._dynamicLanguages = []; + this._languages = {}; + this._mimeTypesMap = {}; + this._nameMap = {}; + this._lowercaseNameMap = {}; + if (useModesRegistry) { + this._initializeFromRegistry(); + this._register(ModesRegistry.onDidChangeLanguages((m) => { + this._initializeFromRegistry(); + })); + } + } + dispose() { + _LanguagesRegistry.instanceCount--; + super.dispose(); + } + _initializeFromRegistry() { + this._languages = {}; + this._mimeTypesMap = {}; + this._nameMap = {}; + this._lowercaseNameMap = {}; + clearPlatformLanguageAssociations(); + const desc = [].concat(ModesRegistry.getLanguages()).concat(this._dynamicLanguages); + this._registerLanguages(desc); + } + _registerLanguages(desc) { + for (const d of desc) { + this._registerLanguage(d); + } + this._mimeTypesMap = {}; + this._nameMap = {}; + this._lowercaseNameMap = {}; + Object.keys(this._languages).forEach((langId) => { + const language2 = this._languages[langId]; + if (language2.name) { + this._nameMap[language2.name] = language2.identifier; + } + language2.aliases.forEach((alias) => { + this._lowercaseNameMap[alias.toLowerCase()] = language2.identifier; + }); + language2.mimetypes.forEach((mimetype) => { + this._mimeTypesMap[mimetype] = language2.identifier; + }); + }); + Registry.as(Extensions4.Configuration).registerOverrideIdentifiers(this.getRegisteredLanguageIds()); + this._onDidChange.fire(); + } + _registerLanguage(lang) { + const langId = lang.id; + let resolvedLanguage; + if (hasOwnProperty2.call(this._languages, langId)) { + resolvedLanguage = this._languages[langId]; + } else { + this.languageIdCodec.register(langId); + resolvedLanguage = { + identifier: langId, + name: null, + mimetypes: [], + aliases: [], + extensions: [], + filenames: [], + configurationFiles: [], + icons: [] + }; + this._languages[langId] = resolvedLanguage; + } + this._mergeLanguage(resolvedLanguage, lang); + } + _mergeLanguage(resolvedLanguage, lang) { + const langId = lang.id; + let primaryMime = null; + if (Array.isArray(lang.mimetypes) && lang.mimetypes.length > 0) { + resolvedLanguage.mimetypes.push(...lang.mimetypes); + primaryMime = lang.mimetypes[0]; + } + if (!primaryMime) { + primaryMime = `text/x-${langId}`; + resolvedLanguage.mimetypes.push(primaryMime); + } + if (Array.isArray(lang.extensions)) { + if (lang.configuration) { + resolvedLanguage.extensions = lang.extensions.concat(resolvedLanguage.extensions); + } else { + resolvedLanguage.extensions = resolvedLanguage.extensions.concat(lang.extensions); + } + for (const extension of lang.extensions) { + registerPlatformLanguageAssociation({ id: langId, mime: primaryMime, extension }, this._warnOnOverwrite); + } + } + if (Array.isArray(lang.filenames)) { + for (const filename of lang.filenames) { + registerPlatformLanguageAssociation({ id: langId, mime: primaryMime, filename }, this._warnOnOverwrite); + resolvedLanguage.filenames.push(filename); + } + } + if (Array.isArray(lang.filenamePatterns)) { + for (const filenamePattern of lang.filenamePatterns) { + registerPlatformLanguageAssociation({ id: langId, mime: primaryMime, filepattern: filenamePattern }, this._warnOnOverwrite); + } + } + if (typeof lang.firstLine === "string" && lang.firstLine.length > 0) { + let firstLineRegexStr = lang.firstLine; + if (firstLineRegexStr.charAt(0) !== "^") { + firstLineRegexStr = "^" + firstLineRegexStr; + } + try { + const firstLineRegex = new RegExp(firstLineRegexStr); + if (!regExpLeadsToEndlessLoop(firstLineRegex)) { + registerPlatformLanguageAssociation({ id: langId, mime: primaryMime, firstline: firstLineRegex }, this._warnOnOverwrite); + } + } catch (err) { + console.warn(`[${lang.id}]: Invalid regular expression \`${firstLineRegexStr}\`: `, err); + } + } + resolvedLanguage.aliases.push(langId); + let langAliases = null; + if (typeof lang.aliases !== "undefined" && Array.isArray(lang.aliases)) { + if (lang.aliases.length === 0) { + langAliases = [null]; + } else { + langAliases = lang.aliases; + } + } + if (langAliases !== null) { + for (const langAlias of langAliases) { + if (!langAlias || langAlias.length === 0) { + continue; + } + resolvedLanguage.aliases.push(langAlias); + } + } + const containsAliases = langAliases !== null && langAliases.length > 0; + if (containsAliases && langAliases[0] === null) { + } else { + const bestName = (containsAliases ? langAliases[0] : null) || langId; + if (containsAliases || !resolvedLanguage.name) { + resolvedLanguage.name = bestName; + } + } + if (lang.configuration) { + resolvedLanguage.configurationFiles.push(lang.configuration); + } + if (lang.icon) { + resolvedLanguage.icons.push(lang.icon); + } + } + isRegisteredLanguageId(languageId) { + if (!languageId) { + return false; + } + return hasOwnProperty2.call(this._languages, languageId); + } + getRegisteredLanguageIds() { + return Object.keys(this._languages); + } + getLanguageIdByLanguageName(languageName) { + const languageNameLower = languageName.toLowerCase(); + if (!hasOwnProperty2.call(this._lowercaseNameMap, languageNameLower)) { + return null; + } + return this._lowercaseNameMap[languageNameLower]; + } + getLanguageIdByMimeType(mimeType) { + if (!mimeType) { + return null; + } + if (hasOwnProperty2.call(this._mimeTypesMap, mimeType)) { + return this._mimeTypesMap[mimeType]; + } + return null; + } + guessLanguageIdByFilepathOrFirstLine(resource, firstLine) { + if (!resource && !firstLine) { + return []; + } + return getLanguageIds(resource, firstLine); + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/common/services/languageService.js +init_languages(); +init_modesRegistry(); +init_observable(); +var LanguageService = class _LanguageService extends Disposable { + static { + this.instanceCount = 0; + } + constructor(warnOnOverwrite = false) { + super(); + this._onDidRequestBasicLanguageFeatures = this._register(new Emitter()); + this.onDidRequestBasicLanguageFeatures = this._onDidRequestBasicLanguageFeatures.event; + this._onDidRequestRichLanguageFeatures = this._register(new Emitter()); + this.onDidRequestRichLanguageFeatures = this._onDidRequestRichLanguageFeatures.event; + this._onDidChange = this._register(new Emitter({ + leakWarningThreshold: 200 + /* https://github.com/microsoft/vscode/issues/119968 */ + })); + this.onDidChange = this._onDidChange.event; + this._requestedBasicLanguages = /* @__PURE__ */ new Set(); + this._requestedRichLanguages = /* @__PURE__ */ new Set(); + _LanguageService.instanceCount++; + this._registry = this._register(new LanguagesRegistry(true, warnOnOverwrite)); + this.languageIdCodec = this._registry.languageIdCodec; + this._register(this._registry.onDidChange(() => this._onDidChange.fire())); + } + dispose() { + _LanguageService.instanceCount--; + super.dispose(); + } + isRegisteredLanguageId(languageId) { + return this._registry.isRegisteredLanguageId(languageId); + } + getLanguageIdByLanguageName(languageName) { + return this._registry.getLanguageIdByLanguageName(languageName); + } + getLanguageIdByMimeType(mimeType) { + return this._registry.getLanguageIdByMimeType(mimeType); + } + guessLanguageIdByFilepathOrFirstLine(resource, firstLine) { + const languageIds = this._registry.guessLanguageIdByFilepathOrFirstLine(resource, firstLine); + return languageIds.at(0) ?? null; + } + createById(languageId) { + return new LanguageSelection(this.onDidChange, () => { + return this._createAndGetLanguageIdentifier(languageId); + }); + } + createByFilepathOrFirstLine(resource, firstLine) { + return new LanguageSelection(this.onDidChange, () => { + const languageId = this.guessLanguageIdByFilepathOrFirstLine(resource, firstLine); + return this._createAndGetLanguageIdentifier(languageId); + }); + } + _createAndGetLanguageIdentifier(languageId) { + if (!languageId || !this.isRegisteredLanguageId(languageId)) { + languageId = PLAINTEXT_LANGUAGE_ID; + } + return languageId; + } + requestBasicLanguageFeatures(languageId) { + if (!this._requestedBasicLanguages.has(languageId)) { + this._requestedBasicLanguages.add(languageId); + this._onDidRequestBasicLanguageFeatures.fire(languageId); + } + } + requestRichLanguageFeatures(languageId) { + if (!this._requestedRichLanguages.has(languageId)) { + this._requestedRichLanguages.add(languageId); + this.requestBasicLanguageFeatures(languageId); + TokenizationRegistry2.getOrCreate(languageId); + this._onDidRequestRichLanguageFeatures.fire(languageId); + } + } +}; +var LanguageSelection = class { + constructor(onDidChangeLanguages, selector) { + this._value = observableFromEvent(this, onDidChangeLanguages, () => selector()); + this.onDidChange = Event.fromObservable(this._value); + } + get languageId() { + return this._value.get(); + } +}; + +// node_modules/monaco-editor-core/esm/vs/platform/contextview/browser/contextMenuService.js +init_dom(); +init_actions(); +init_event(); +init_lifecycle(); +init_actions2(); +init_contextkey(); +init_telemetry(); + +// node_modules/monaco-editor-core/esm/vs/platform/contextview/browser/contextMenuHandler.js +init_dom(); +init_mouseEvent(); + +// node_modules/monaco-editor-core/esm/vs/base/browser/ui/menu/menu.js +init_browser(); +init_dom(); +init_keyboardEvent(); +init_mouseEvent(); +init_actions(); +init_async(); +init_codicons(); +init_codiconsUtil(); +init_themables(); +init_iconLabels(); +init_lifecycle(); +init_platform(); +init_strings(); +var MENU_MNEMONIC_REGEX = /\(&([^\s&])\)|(^|[^&])&([^\s&])/; +var MENU_ESCAPED_MNEMONIC_REGEX = /(&)?(&)([^\s&])/g; +var HorizontalDirection; +(function(HorizontalDirection2) { + HorizontalDirection2[HorizontalDirection2["Right"] = 0] = "Right"; + HorizontalDirection2[HorizontalDirection2["Left"] = 1] = "Left"; +})(HorizontalDirection || (HorizontalDirection = {})); +var VerticalDirection; +(function(VerticalDirection2) { + VerticalDirection2[VerticalDirection2["Above"] = 0] = "Above"; + VerticalDirection2[VerticalDirection2["Below"] = 1] = "Below"; +})(VerticalDirection || (VerticalDirection = {})); +var Menu = class _Menu extends ActionBar { + constructor(container, actions, options2, menuStyles) { + container.classList.add("monaco-menu-container"); + container.setAttribute("role", "presentation"); + const menuElement = document.createElement("div"); + menuElement.classList.add("monaco-menu"); + menuElement.setAttribute("role", "presentation"); + super(menuElement, { + orientation: 1, + actionViewItemProvider: (action) => this.doGetActionViewItem(action, options2, parentData), + context: options2.context, + actionRunner: options2.actionRunner, + ariaLabel: options2.ariaLabel, + ariaRole: "menu", + focusOnlyEnabledItems: true, + triggerKeys: { keys: [3, ...isMacintosh || isLinux ? [ + 10 + /* KeyCode.Space */ + ] : []], keyDown: true } + }); + this.menuStyles = menuStyles; + this.menuElement = menuElement; + this.actionsList.tabIndex = 0; + this.initializeOrUpdateStyleSheet(container, menuStyles); + this._register(Gesture.addTarget(menuElement)); + this._register(addDisposableListener(menuElement, EventType.KEY_DOWN, (e) => { + const event = new StandardKeyboardEvent(e); + if (event.equals( + 2 + /* KeyCode.Tab */ + )) { + e.preventDefault(); + } + })); + if (options2.enableMnemonics) { + this._register(addDisposableListener(menuElement, EventType.KEY_DOWN, (e) => { + const key = e.key.toLocaleLowerCase(); + if (this.mnemonics.has(key)) { + EventHelper.stop(e, true); + const actions2 = this.mnemonics.get(key); + if (actions2.length === 1) { + if (actions2[0] instanceof SubmenuMenuActionViewItem && actions2[0].container) { + this.focusItemByElement(actions2[0].container); + } + actions2[0].onClick(e); + } + if (actions2.length > 1) { + const action = actions2.shift(); + if (action && action.container) { + this.focusItemByElement(action.container); + actions2.push(action); + } + this.mnemonics.set(key, actions2); + } + } + })); + } + if (isLinux) { + this._register(addDisposableListener(menuElement, EventType.KEY_DOWN, (e) => { + const event = new StandardKeyboardEvent(e); + if (event.equals( + 14 + /* KeyCode.Home */ + ) || event.equals( + 11 + /* KeyCode.PageUp */ + )) { + this.focusedItem = this.viewItems.length - 1; + this.focusNext(); + EventHelper.stop(e, true); + } else if (event.equals( + 13 + /* KeyCode.End */ + ) || event.equals( + 12 + /* KeyCode.PageDown */ + )) { + this.focusedItem = 0; + this.focusPrevious(); + EventHelper.stop(e, true); + } + })); + } + this._register(addDisposableListener(this.domNode, EventType.MOUSE_OUT, (e) => { + const relatedTarget = e.relatedTarget; + if (!isAncestor(relatedTarget, this.domNode)) { + this.focusedItem = void 0; + this.updateFocus(); + e.stopPropagation(); + } + })); + this._register(addDisposableListener(this.actionsList, EventType.MOUSE_OVER, (e) => { + let target = e.target; + if (!target || !isAncestor(target, this.actionsList) || target === this.actionsList) { + return; + } + while (target.parentElement !== this.actionsList && target.parentElement !== null) { + target = target.parentElement; + } + if (target.classList.contains("action-item")) { + const lastFocusedItem = this.focusedItem; + this.setFocusedItem(target); + if (lastFocusedItem !== this.focusedItem) { + this.updateFocus(); + } + } + })); + this._register(Gesture.addTarget(this.actionsList)); + this._register(addDisposableListener(this.actionsList, EventType2.Tap, (e) => { + let target = e.initialTarget; + if (!target || !isAncestor(target, this.actionsList) || target === this.actionsList) { + return; + } + while (target.parentElement !== this.actionsList && target.parentElement !== null) { + target = target.parentElement; + } + if (target.classList.contains("action-item")) { + const lastFocusedItem = this.focusedItem; + this.setFocusedItem(target); + if (lastFocusedItem !== this.focusedItem) { + this.updateFocus(); + } + } + })); + const parentData = { + parent: this + }; + this.mnemonics = /* @__PURE__ */ new Map(); + this.scrollableElement = this._register(new DomScrollableElement(menuElement, { + alwaysConsumeMouseWheel: true, + horizontal: 2, + vertical: 3, + verticalScrollbarSize: 7, + handleMouseWheel: true, + useShadows: true + })); + const scrollElement = this.scrollableElement.getDomNode(); + scrollElement.style.position = ""; + this.styleScrollElement(scrollElement, menuStyles); + this._register(addDisposableListener(menuElement, EventType2.Change, (e) => { + EventHelper.stop(e, true); + const scrollTop = this.scrollableElement.getScrollPosition().scrollTop; + this.scrollableElement.setScrollPosition({ scrollTop: scrollTop - e.translationY }); + })); + this._register(addDisposableListener(scrollElement, EventType.MOUSE_UP, (e) => { + e.preventDefault(); + })); + const window2 = getWindow(container); + menuElement.style.maxHeight = `${Math.max(10, window2.innerHeight - container.getBoundingClientRect().top - 35)}px`; + actions = actions.filter((a, idx) => { + if (options2.submenuIds?.has(a.id)) { + console.warn(`Found submenu cycle: ${a.id}`); + return false; + } + if (a instanceof Separator) { + if (idx === actions.length - 1 || idx === 0) { + return false; + } + const prevAction = actions[idx - 1]; + if (prevAction instanceof Separator) { + return false; + } + } + return true; + }); + this.push(actions, { icon: true, label: true, isMenu: true }); + container.appendChild(this.scrollableElement.getDomNode()); + this.scrollableElement.scanDomNode(); + this.viewItems.filter((item) => !(item instanceof MenuSeparatorActionViewItem)).forEach((item, index, array2) => { + item.updatePositionInSet(index + 1, array2.length); + }); + } + initializeOrUpdateStyleSheet(container, style) { + if (!this.styleSheet) { + if (isInShadowDOM(container)) { + this.styleSheet = createStyleSheet(container); + } else { + if (!_Menu.globalStyleSheet) { + _Menu.globalStyleSheet = createStyleSheet(); + } + this.styleSheet = _Menu.globalStyleSheet; + } + } + this.styleSheet.textContent = getMenuWidgetCSS(style, isInShadowDOM(container)); + } + styleScrollElement(scrollElement, style) { + const fgColor = style.foregroundColor ?? ""; + const bgColor = style.backgroundColor ?? ""; + const border = style.borderColor ? `1px solid ${style.borderColor}` : ""; + const borderRadius = "5px"; + const shadow = style.shadowColor ? `0 2px 8px ${style.shadowColor}` : ""; + scrollElement.style.outline = border; + scrollElement.style.borderRadius = borderRadius; + scrollElement.style.color = fgColor; + scrollElement.style.backgroundColor = bgColor; + scrollElement.style.boxShadow = shadow; + } + getContainer() { + return this.scrollableElement.getDomNode(); + } + get onScroll() { + return this.scrollableElement.onScroll; + } + focusItemByElement(element) { + const lastFocusedItem = this.focusedItem; + this.setFocusedItem(element); + if (lastFocusedItem !== this.focusedItem) { + this.updateFocus(); + } + } + setFocusedItem(element) { + for (let i2 = 0; i2 < this.actionsList.children.length; i2++) { + const elem = this.actionsList.children[i2]; + if (element === elem) { + this.focusedItem = i2; + break; + } + } + } + updateFocus(fromRight) { + super.updateFocus(fromRight, true, true); + if (typeof this.focusedItem !== "undefined") { + this.scrollableElement.setScrollPosition({ + scrollTop: Math.round(this.menuElement.scrollTop) + }); + } + } + doGetActionViewItem(action, options2, parentData) { + if (action instanceof Separator) { + return new MenuSeparatorActionViewItem(options2.context, action, { icon: true }, this.menuStyles); + } else if (action instanceof SubmenuAction) { + const menuActionViewItem = new SubmenuMenuActionViewItem(action, action.actions, parentData, { ...options2, submenuIds: /* @__PURE__ */ new Set([...options2.submenuIds || [], action.id]) }, this.menuStyles); + if (options2.enableMnemonics) { + const mnemonic = menuActionViewItem.getMnemonic(); + if (mnemonic && menuActionViewItem.isEnabled()) { + let actionViewItems = []; + if (this.mnemonics.has(mnemonic)) { + actionViewItems = this.mnemonics.get(mnemonic); + } + actionViewItems.push(menuActionViewItem); + this.mnemonics.set(mnemonic, actionViewItems); + } + } + return menuActionViewItem; + } else { + const keybindingLabel = options2.getKeyBinding?.(action)?.getLabel(); + const menuItemOptions = { + enableMnemonics: options2.enableMnemonics, + useEventAsContext: options2.useEventAsContext, + keybinding: keybindingLabel + }; + const menuActionViewItem = new BaseMenuActionViewItem(options2.context, action, menuItemOptions, this.menuStyles); + if (options2.enableMnemonics) { + const mnemonic = menuActionViewItem.getMnemonic(); + if (mnemonic && menuActionViewItem.isEnabled()) { + let actionViewItems = []; + if (this.mnemonics.has(mnemonic)) { + actionViewItems = this.mnemonics.get(mnemonic); + } + actionViewItems.push(menuActionViewItem); + this.mnemonics.set(mnemonic, actionViewItems); + } + } + return menuActionViewItem; + } + } +}; +var BaseMenuActionViewItem = class extends BaseActionViewItem { + constructor(ctx, action, options2, menuStyle) { + options2 = { + ...options2, + isMenu: true, + icon: options2.icon !== void 0 ? options2.icon : false, + label: options2.label !== void 0 ? options2.label : true + }; + super(action, action, options2); + this.menuStyle = menuStyle; + this.options = options2; + this.cssClass = ""; + if (this.options.label && options2.enableMnemonics) { + const label = this.action.label; + if (label) { + const matches = MENU_MNEMONIC_REGEX.exec(label); + if (matches) { + this.mnemonic = (!!matches[1] ? matches[1] : matches[3]).toLocaleLowerCase(); + } + } + } + this.runOnceToEnableMouseUp = new RunOnceScheduler(() => { + if (!this.element) { + return; + } + this._register(addDisposableListener(this.element, EventType.MOUSE_UP, (e) => { + EventHelper.stop(e, true); + if (isFirefox) { + const mouseEvent = new StandardMouseEvent(getWindow(this.element), e); + if (mouseEvent.rightButton) { + return; + } + this.onClick(e); + } else { + setTimeout(() => { + this.onClick(e); + }, 0); + } + })); + this._register(addDisposableListener(this.element, EventType.CONTEXT_MENU, (e) => { + EventHelper.stop(e, true); + })); + }, 100); + this._register(this.runOnceToEnableMouseUp); + } + render(container) { + super.render(container); + if (!this.element) { + return; + } + this.container = container; + this.item = append(this.element, $("a.action-menu-item")); + if (this._action.id === Separator.ID) { + this.item.setAttribute("role", "presentation"); + } else { + this.item.setAttribute("role", "menuitem"); + if (this.mnemonic) { + this.item.setAttribute("aria-keyshortcuts", `${this.mnemonic}`); + } + } + this.check = append(this.item, $("span.menu-item-check" + ThemeIcon.asCSSSelector(Codicon.menuSelection))); + this.check.setAttribute("role", "none"); + this.label = append(this.item, $("span.action-label")); + if (this.options.label && this.options.keybinding) { + append(this.item, $("span.keybinding")).textContent = this.options.keybinding; + } + this.runOnceToEnableMouseUp.schedule(); + this.updateClass(); + this.updateLabel(); + this.updateTooltip(); + this.updateEnabled(); + this.updateChecked(); + this.applyStyle(); + } + blur() { + super.blur(); + this.applyStyle(); + } + focus() { + super.focus(); + this.item?.focus(); + this.applyStyle(); + } + updatePositionInSet(pos, setSize) { + if (this.item) { + this.item.setAttribute("aria-posinset", `${pos}`); + this.item.setAttribute("aria-setsize", `${setSize}`); + } + } + updateLabel() { + if (!this.label) { + return; + } + if (this.options.label) { + clearNode(this.label); + let label = stripIcons(this.action.label); + if (label) { + const cleanLabel = cleanMnemonic(label); + if (!this.options.enableMnemonics) { + label = cleanLabel; + } + this.label.setAttribute("aria-label", cleanLabel.replace(/&&/g, "&")); + const matches = MENU_MNEMONIC_REGEX.exec(label); + if (matches) { + label = escape(label); + MENU_ESCAPED_MNEMONIC_REGEX.lastIndex = 0; + let escMatch = MENU_ESCAPED_MNEMONIC_REGEX.exec(label); + while (escMatch && escMatch[1]) { + escMatch = MENU_ESCAPED_MNEMONIC_REGEX.exec(label); + } + const replaceDoubleEscapes = (str) => str.replace(/&&/g, "&"); + if (escMatch) { + this.label.append(ltrim(replaceDoubleEscapes(label.substr(0, escMatch.index)), " "), $("u", { "aria-hidden": "true" }, escMatch[3]), rtrim(replaceDoubleEscapes(label.substr(escMatch.index + escMatch[0].length)), " ")); + } else { + this.label.textContent = replaceDoubleEscapes(label).trim(); + } + this.item?.setAttribute("aria-keyshortcuts", (!!matches[1] ? matches[1] : matches[3]).toLocaleLowerCase()); + } else { + this.label.textContent = label.replace(/&&/g, "&").trim(); + } + } + } + } + updateTooltip() { + } + updateClass() { + if (this.cssClass && this.item) { + this.item.classList.remove(...this.cssClass.split(" ")); + } + if (this.options.icon && this.label) { + this.cssClass = this.action.class || ""; + this.label.classList.add("icon"); + if (this.cssClass) { + this.label.classList.add(...this.cssClass.split(" ")); + } + this.updateEnabled(); + } else if (this.label) { + this.label.classList.remove("icon"); + } + } + updateEnabled() { + if (this.action.enabled) { + if (this.element) { + this.element.classList.remove("disabled"); + this.element.removeAttribute("aria-disabled"); + } + if (this.item) { + this.item.classList.remove("disabled"); + this.item.removeAttribute("aria-disabled"); + this.item.tabIndex = 0; + } + } else { + if (this.element) { + this.element.classList.add("disabled"); + this.element.setAttribute("aria-disabled", "true"); + } + if (this.item) { + this.item.classList.add("disabled"); + this.item.setAttribute("aria-disabled", "true"); + } + } + } + updateChecked() { + if (!this.item) { + return; + } + const checked = this.action.checked; + this.item.classList.toggle("checked", !!checked); + if (checked !== void 0) { + this.item.setAttribute("role", "menuitemcheckbox"); + this.item.setAttribute("aria-checked", checked ? "true" : "false"); + } else { + this.item.setAttribute("role", "menuitem"); + this.item.setAttribute("aria-checked", ""); + } + } + getMnemonic() { + return this.mnemonic; + } + applyStyle() { + const isSelected = this.element && this.element.classList.contains("focused"); + const fgColor = isSelected && this.menuStyle.selectionForegroundColor ? this.menuStyle.selectionForegroundColor : this.menuStyle.foregroundColor; + const bgColor = isSelected && this.menuStyle.selectionBackgroundColor ? this.menuStyle.selectionBackgroundColor : void 0; + const outline = isSelected && this.menuStyle.selectionBorderColor ? `1px solid ${this.menuStyle.selectionBorderColor}` : ""; + const outlineOffset = isSelected && this.menuStyle.selectionBorderColor ? `-1px` : ""; + if (this.item) { + this.item.style.color = fgColor ?? ""; + this.item.style.backgroundColor = bgColor ?? ""; + this.item.style.outline = outline; + this.item.style.outlineOffset = outlineOffset; + } + if (this.check) { + this.check.style.color = fgColor ?? ""; + } + } +}; +var SubmenuMenuActionViewItem = class extends BaseMenuActionViewItem { + constructor(action, submenuActions, parentData, submenuOptions, menuStyles) { + super(action, action, submenuOptions, menuStyles); + this.submenuActions = submenuActions; + this.parentData = parentData; + this.submenuOptions = submenuOptions; + this.mysubmenu = null; + this.submenuDisposables = this._register(new DisposableStore()); + this.mouseOver = false; + this.expandDirection = submenuOptions && submenuOptions.expandDirection !== void 0 ? submenuOptions.expandDirection : { horizontal: HorizontalDirection.Right, vertical: VerticalDirection.Below }; + this.showScheduler = new RunOnceScheduler(() => { + if (this.mouseOver) { + this.cleanupExistingSubmenu(false); + this.createSubmenu(false); + } + }, 250); + this.hideScheduler = new RunOnceScheduler(() => { + if (this.element && (!isAncestor(getActiveElement(), this.element) && this.parentData.submenu === this.mysubmenu)) { + this.parentData.parent.focus(false); + this.cleanupExistingSubmenu(true); + } + }, 750); + } + render(container) { + super.render(container); + if (!this.element) { + return; + } + if (this.item) { + this.item.classList.add("monaco-submenu-item"); + this.item.tabIndex = 0; + this.item.setAttribute("aria-haspopup", "true"); + this.updateAriaExpanded("false"); + this.submenuIndicator = append(this.item, $("span.submenu-indicator" + ThemeIcon.asCSSSelector(Codicon.menuSubmenu))); + this.submenuIndicator.setAttribute("aria-hidden", "true"); + } + this._register(addDisposableListener(this.element, EventType.KEY_UP, (e) => { + const event = new StandardKeyboardEvent(e); + if (event.equals( + 17 + /* KeyCode.RightArrow */ + ) || event.equals( + 3 + /* KeyCode.Enter */ + )) { + EventHelper.stop(e, true); + this.createSubmenu(true); + } + })); + this._register(addDisposableListener(this.element, EventType.KEY_DOWN, (e) => { + const event = new StandardKeyboardEvent(e); + if (getActiveElement() === this.item) { + if (event.equals( + 17 + /* KeyCode.RightArrow */ + ) || event.equals( + 3 + /* KeyCode.Enter */ + )) { + EventHelper.stop(e, true); + } + } + })); + this._register(addDisposableListener(this.element, EventType.MOUSE_OVER, (e) => { + if (!this.mouseOver) { + this.mouseOver = true; + this.showScheduler.schedule(); + } + })); + this._register(addDisposableListener(this.element, EventType.MOUSE_LEAVE, (e) => { + this.mouseOver = false; + })); + this._register(addDisposableListener(this.element, EventType.FOCUS_OUT, (e) => { + if (this.element && !isAncestor(getActiveElement(), this.element)) { + this.hideScheduler.schedule(); + } + })); + this._register(this.parentData.parent.onScroll(() => { + if (this.parentData.submenu === this.mysubmenu) { + this.parentData.parent.focus(false); + this.cleanupExistingSubmenu(true); + } + })); + } + updateEnabled() { + } + onClick(e) { + EventHelper.stop(e, true); + this.cleanupExistingSubmenu(false); + this.createSubmenu(true); + } + cleanupExistingSubmenu(force) { + if (this.parentData.submenu && (force || this.parentData.submenu !== this.mysubmenu)) { + try { + this.parentData.submenu.dispose(); + } catch { + } + this.parentData.submenu = void 0; + this.updateAriaExpanded("false"); + if (this.submenuContainer) { + this.submenuDisposables.clear(); + this.submenuContainer = void 0; + } + } + } + calculateSubmenuMenuLayout(windowDimensions, submenu, entry, expandDirection) { + const ret = { top: 0, left: 0 }; + ret.left = layout(windowDimensions.width, submenu.width, { position: expandDirection.horizontal === HorizontalDirection.Right ? 0 : 1, offset: entry.left, size: entry.width }); + if (ret.left >= entry.left && ret.left < entry.left + entry.width) { + if (entry.left + 10 + submenu.width <= windowDimensions.width) { + ret.left = entry.left + 10; + } + entry.top += 10; + entry.height = 0; + } + ret.top = layout(windowDimensions.height, submenu.height, { position: 0, offset: entry.top, size: 0 }); + if (ret.top + submenu.height === entry.top && ret.top + entry.height + submenu.height <= windowDimensions.height) { + ret.top += entry.height; + } + return ret; + } + createSubmenu(selectFirstItem = true) { + if (!this.element) { + return; + } + if (!this.parentData.submenu) { + this.updateAriaExpanded("true"); + this.submenuContainer = append(this.element, $("div.monaco-submenu")); + this.submenuContainer.classList.add("menubar-menu-items-holder", "context-view"); + const computedStyles = getWindow(this.parentData.parent.domNode).getComputedStyle(this.parentData.parent.domNode); + const paddingTop = parseFloat(computedStyles.paddingTop || "0") || 0; + this.submenuContainer.style.position = "fixed"; + this.submenuContainer.style.top = "0"; + this.submenuContainer.style.left = "0"; + this.submenuContainer.style.zIndex = "1"; + this.parentData.submenu = new Menu(this.submenuContainer, this.submenuActions.length ? this.submenuActions : [new EmptySubmenuAction()], this.submenuOptions, this.menuStyle); + const entryBox = this.element.getBoundingClientRect(); + const entryBoxUpdated = { + top: entryBox.top - paddingTop, + left: entryBox.left, + height: entryBox.height + 2 * paddingTop, + width: entryBox.width + }; + const viewBox = this.submenuContainer.getBoundingClientRect(); + const window2 = getWindow(this.element); + const { top, left } = this.calculateSubmenuMenuLayout(new Dimension(window2.innerWidth, window2.innerHeight), Dimension.lift(viewBox), entryBoxUpdated, this.expandDirection); + this.submenuContainer.style.left = `${left - viewBox.left}px`; + this.submenuContainer.style.top = `${top - viewBox.top}px`; + this.submenuDisposables.add(addDisposableListener(this.submenuContainer, EventType.KEY_UP, (e) => { + const event = new StandardKeyboardEvent(e); + if (event.equals( + 15 + /* KeyCode.LeftArrow */ + )) { + EventHelper.stop(e, true); + this.parentData.parent.focus(); + this.cleanupExistingSubmenu(true); + } + })); + this.submenuDisposables.add(addDisposableListener(this.submenuContainer, EventType.KEY_DOWN, (e) => { + const event = new StandardKeyboardEvent(e); + if (event.equals( + 15 + /* KeyCode.LeftArrow */ + )) { + EventHelper.stop(e, true); + } + })); + this.submenuDisposables.add(this.parentData.submenu.onDidCancel(() => { + this.parentData.parent.focus(); + this.cleanupExistingSubmenu(true); + })); + this.parentData.submenu.focus(selectFirstItem); + this.mysubmenu = this.parentData.submenu; + } else { + this.parentData.submenu.focus(false); + } + } + updateAriaExpanded(value) { + if (this.item) { + this.item?.setAttribute("aria-expanded", value); + } + } + applyStyle() { + super.applyStyle(); + const isSelected = this.element && this.element.classList.contains("focused"); + const fgColor = isSelected && this.menuStyle.selectionForegroundColor ? this.menuStyle.selectionForegroundColor : this.menuStyle.foregroundColor; + if (this.submenuIndicator) { + this.submenuIndicator.style.color = fgColor ?? ""; + } + } + dispose() { + super.dispose(); + this.hideScheduler.dispose(); + if (this.mysubmenu) { + this.mysubmenu.dispose(); + this.mysubmenu = null; + } + if (this.submenuContainer) { + this.submenuContainer = void 0; + } + } +}; +var MenuSeparatorActionViewItem = class extends ActionViewItem { + constructor(context, action, options2, menuStyles) { + super(context, action, options2); + this.menuStyles = menuStyles; + } + render(container) { + super.render(container); + if (this.label) { + this.label.style.borderBottomColor = this.menuStyles.separatorColor ? `${this.menuStyles.separatorColor}` : ""; + } + } +}; +function cleanMnemonic(label) { + const regex = MENU_MNEMONIC_REGEX; + const matches = regex.exec(label); + if (!matches) { + return label; + } + const mnemonicInText = !matches[1]; + return label.replace(regex, mnemonicInText ? "$2$3" : "").trim(); +} +function formatRule(c) { + const fontCharacter = getCodiconFontCharacters()[c.id]; + return `.codicon-${c.id}:before { content: '\\${fontCharacter.toString(16)}'; }`; +} +function getMenuWidgetCSS(style, isForShadowDom) { + let result = ( + /* css */ + ` +.monaco-menu { + font-size: 13px; + border-radius: 5px; + min-width: 160px; +} + +${formatRule(Codicon.menuSelection)} +${formatRule(Codicon.menuSubmenu)} + +.monaco-menu .monaco-action-bar { + text-align: right; + overflow: hidden; + white-space: nowrap; +} + +.monaco-menu .monaco-action-bar .actions-container { + display: flex; + margin: 0 auto; + padding: 0; + width: 100%; + justify-content: flex-end; +} + +.monaco-menu .monaco-action-bar.vertical .actions-container { + display: inline-block; +} + +.monaco-menu .monaco-action-bar.reverse .actions-container { + flex-direction: row-reverse; +} + +.monaco-menu .monaco-action-bar .action-item { + cursor: pointer; + display: inline-block; + transition: transform 50ms ease; + position: relative; /* DO NOT REMOVE - this is the key to preventing the ghosting icon bug in Chrome 42 */ +} + +.monaco-menu .monaco-action-bar .action-item.disabled { + cursor: default; +} + +.monaco-menu .monaco-action-bar .action-item .icon, +.monaco-menu .monaco-action-bar .action-item .codicon { + display: inline-block; +} + +.monaco-menu .monaco-action-bar .action-item .codicon { + display: flex; + align-items: center; +} + +.monaco-menu .monaco-action-bar .action-label { + font-size: 11px; + margin-right: 4px; +} + +.monaco-menu .monaco-action-bar .action-item.disabled .action-label, +.monaco-menu .monaco-action-bar .action-item.disabled .action-label:hover { + color: var(--vscode-disabledForeground); +} + +/* Vertical actions */ + +.monaco-menu .monaco-action-bar.vertical { + text-align: left; +} + +.monaco-menu .monaco-action-bar.vertical .action-item { + display: block; +} + +.monaco-menu .monaco-action-bar.vertical .action-label.separator { + display: block; + border-bottom: 1px solid var(--vscode-menu-separatorBackground); + padding-top: 1px; + padding: 30px; +} + +.monaco-menu .secondary-actions .monaco-action-bar .action-label { + margin-left: 6px; +} + +/* Action Items */ +.monaco-menu .monaco-action-bar .action-item.select-container { + overflow: hidden; /* somehow the dropdown overflows its container, we prevent it here to not push */ + flex: 1; + max-width: 170px; + min-width: 60px; + display: flex; + align-items: center; + justify-content: center; + margin-right: 10px; +} + +.monaco-menu .monaco-action-bar.vertical { + margin-left: 0; + overflow: visible; +} + +.monaco-menu .monaco-action-bar.vertical .actions-container { + display: block; +} + +.monaco-menu .monaco-action-bar.vertical .action-item { + padding: 0; + transform: none; + display: flex; +} + +.monaco-menu .monaco-action-bar.vertical .action-item.active { + transform: none; +} + +.monaco-menu .monaco-action-bar.vertical .action-menu-item { + flex: 1 1 auto; + display: flex; + height: 2em; + align-items: center; + position: relative; + margin: 0 4px; + border-radius: 4px; +} + +.monaco-menu .monaco-action-bar.vertical .action-menu-item:hover .keybinding, +.monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .keybinding { + opacity: unset; +} + +.monaco-menu .monaco-action-bar.vertical .action-label { + flex: 1 1 auto; + text-decoration: none; + padding: 0 1em; + background: none; + font-size: 12px; + line-height: 1; +} + +.monaco-menu .monaco-action-bar.vertical .keybinding, +.monaco-menu .monaco-action-bar.vertical .submenu-indicator { + display: inline-block; + flex: 2 1 auto; + padding: 0 1em; + text-align: right; + font-size: 12px; + line-height: 1; + opacity: 0.7; +} + +.monaco-menu .monaco-action-bar.vertical .submenu-indicator { + height: 100%; +} + +.monaco-menu .monaco-action-bar.vertical .submenu-indicator.codicon { + font-size: 16px !important; + display: flex; + align-items: center; +} + +.monaco-menu .monaco-action-bar.vertical .submenu-indicator.codicon::before { + margin-left: auto; + margin-right: -20px; +} + +.monaco-menu .monaco-action-bar.vertical .action-item.disabled .keybinding, +.monaco-menu .monaco-action-bar.vertical .action-item.disabled .submenu-indicator { + opacity: 0.4; +} + +.monaco-menu .monaco-action-bar.vertical .action-label:not(.separator) { + display: inline-block; + box-sizing: border-box; + margin: 0; +} + +.monaco-menu .monaco-action-bar.vertical .action-item { + position: static; + overflow: visible; +} + +.monaco-menu .monaco-action-bar.vertical .action-item .monaco-submenu { + position: absolute; +} + +.monaco-menu .monaco-action-bar.vertical .action-label.separator { + width: 100%; + height: 0px !important; + opacity: 1; +} + +.monaco-menu .monaco-action-bar.vertical .action-label.separator.text { + padding: 0.7em 1em 0.1em 1em; + font-weight: bold; + opacity: 1; +} + +.monaco-menu .monaco-action-bar.vertical .action-label:hover { + color: inherit; +} + +.monaco-menu .monaco-action-bar.vertical .menu-item-check { + position: absolute; + visibility: hidden; + width: 1em; + height: 100%; +} + +.monaco-menu .monaco-action-bar.vertical .action-menu-item.checked .menu-item-check { + visibility: visible; + display: flex; + align-items: center; + justify-content: center; +} + +/* Context Menu */ + +.context-view.monaco-menu-container { + outline: 0; + border: none; + animation: fadeIn 0.083s linear; + -webkit-app-region: no-drag; +} + +.context-view.monaco-menu-container :focus, +.context-view.monaco-menu-container .monaco-action-bar.vertical:focus, +.context-view.monaco-menu-container .monaco-action-bar.vertical :focus { + outline: 0; +} + +.hc-black .context-view.monaco-menu-container, +.hc-light .context-view.monaco-menu-container, +:host-context(.hc-black) .context-view.monaco-menu-container, +:host-context(.hc-light) .context-view.monaco-menu-container { + box-shadow: none; +} + +.hc-black .monaco-menu .monaco-action-bar.vertical .action-item.focused, +.hc-light .monaco-menu .monaco-action-bar.vertical .action-item.focused, +:host-context(.hc-black) .monaco-menu .monaco-action-bar.vertical .action-item.focused, +:host-context(.hc-light) .monaco-menu .monaco-action-bar.vertical .action-item.focused { + background: none; +} + +/* Vertical Action Bar Styles */ + +.monaco-menu .monaco-action-bar.vertical { + padding: 4px 0; +} + +.monaco-menu .monaco-action-bar.vertical .action-menu-item { + height: 2em; +} + +.monaco-menu .monaco-action-bar.vertical .action-label:not(.separator), +.monaco-menu .monaco-action-bar.vertical .keybinding { + font-size: inherit; + padding: 0 2em; + max-height: 100%; +} + +.monaco-menu .monaco-action-bar.vertical .menu-item-check { + font-size: inherit; + width: 2em; +} + +.monaco-menu .monaco-action-bar.vertical .action-label.separator { + font-size: inherit; + margin: 5px 0 !important; + padding: 0; + border-radius: 0; +} + +.linux .monaco-menu .monaco-action-bar.vertical .action-label.separator, +:host-context(.linux) .monaco-menu .monaco-action-bar.vertical .action-label.separator { + margin-left: 0; + margin-right: 0; +} + +.monaco-menu .monaco-action-bar.vertical .submenu-indicator { + font-size: 60%; + padding: 0 1.8em; +} + +.linux .monaco-menu .monaco-action-bar.vertical .submenu-indicator, +:host-context(.linux) .monaco-menu .monaco-action-bar.vertical .submenu-indicator { + height: 100%; + mask-size: 10px 10px; + -webkit-mask-size: 10px 10px; +} + +.monaco-menu .action-item { + cursor: default; +}` + ); + if (isForShadowDom) { + result += ` + /* Arrows */ + .monaco-scrollable-element > .scrollbar > .scra { + cursor: pointer; + font-size: 11px !important; + } + + .monaco-scrollable-element > .visible { + opacity: 1; + + /* Background rule added for IE9 - to allow clicks on dom node */ + background:rgba(0,0,0,0); + + transition: opacity 100ms linear; + } + .monaco-scrollable-element > .invisible { + opacity: 0; + pointer-events: none; + } + .monaco-scrollable-element > .invisible.fade { + transition: opacity 800ms linear; + } + + /* Scrollable Content Inset Shadow */ + .monaco-scrollable-element > .shadow { + position: absolute; + display: none; + } + .monaco-scrollable-element > .shadow.top { + display: block; + top: 0; + left: 3px; + height: 3px; + width: 100%; + } + .monaco-scrollable-element > .shadow.left { + display: block; + top: 3px; + left: 0; + height: 100%; + width: 3px; + } + .monaco-scrollable-element > .shadow.top-left-corner { + display: block; + top: 0; + left: 0; + height: 3px; + width: 3px; + } + /* Fix for https://github.com/microsoft/vscode/issues/103170 */ + .monaco-menu .action-item .monaco-submenu { + z-index: 1; + } + `; + const scrollbarShadowColor = style.scrollbarShadow; + if (scrollbarShadowColor) { + result += ` + .monaco-scrollable-element > .shadow.top { + box-shadow: ${scrollbarShadowColor} 0 6px 6px -6px inset; + } + + .monaco-scrollable-element > .shadow.left { + box-shadow: ${scrollbarShadowColor} 6px 0 6px -6px inset; + } + + .monaco-scrollable-element > .shadow.top.left { + box-shadow: ${scrollbarShadowColor} 6px 6px 6px -6px inset; + } + `; + } + const scrollbarSliderBackgroundColor = style.scrollbarSliderBackground; + if (scrollbarSliderBackgroundColor) { + result += ` + .monaco-scrollable-element > .scrollbar > .slider { + background: ${scrollbarSliderBackgroundColor}; + } + `; + } + const scrollbarSliderHoverBackgroundColor = style.scrollbarSliderHoverBackground; + if (scrollbarSliderHoverBackgroundColor) { + result += ` + .monaco-scrollable-element > .scrollbar > .slider:hover { + background: ${scrollbarSliderHoverBackgroundColor}; + } + `; + } + const scrollbarSliderActiveBackgroundColor = style.scrollbarSliderActiveBackground; + if (scrollbarSliderActiveBackgroundColor) { + result += ` + .monaco-scrollable-element > .scrollbar > .slider.active { + background: ${scrollbarSliderActiveBackgroundColor}; + } + `; + } + } + return result; +} + +// node_modules/monaco-editor-core/esm/vs/platform/contextview/browser/contextMenuHandler.js +init_actions(); +init_errors(); +init_lifecycle(); +var ContextMenuHandler = class { + constructor(contextViewService, telemetryService, notificationService, keybindingService) { + this.contextViewService = contextViewService; + this.telemetryService = telemetryService; + this.notificationService = notificationService; + this.keybindingService = keybindingService; + this.focusToReturn = null; + this.lastContainer = null; + this.block = null; + this.blockDisposable = null; + this.options = { blockMouse: true }; + } + configure(options2) { + this.options = options2; + } + showContextMenu(delegate) { + const actions = delegate.getActions(); + if (!actions.length) { + return; + } + this.focusToReturn = getActiveElement(); + let menu; + const shadowRootElement = isHTMLElement(delegate.domForShadowRoot) ? delegate.domForShadowRoot : void 0; + this.contextViewService.showContextView({ + getAnchor: () => delegate.getAnchor(), + canRelayout: false, + anchorAlignment: delegate.anchorAlignment, + anchorAxisAlignment: delegate.anchorAxisAlignment, + layer: delegate.layer, + render: (container) => { + this.lastContainer = container; + const className2 = delegate.getMenuClassName ? delegate.getMenuClassName() : ""; + if (className2) { + container.className += " " + className2; + } + if (this.options.blockMouse) { + this.block = container.appendChild($(".context-view-block")); + this.block.style.position = "fixed"; + this.block.style.cursor = "initial"; + this.block.style.left = "0"; + this.block.style.top = "0"; + this.block.style.width = "100%"; + this.block.style.height = "100%"; + this.block.style.zIndex = "-1"; + this.blockDisposable?.dispose(); + this.blockDisposable = addDisposableListener(this.block, EventType.MOUSE_DOWN, (e) => e.stopPropagation()); + } + const menuDisposables = new DisposableStore(); + const actionRunner = delegate.actionRunner || menuDisposables.add(new ActionRunner()); + actionRunner.onWillRun((evt) => this.onActionRun(evt, !delegate.skipTelemetry), this, menuDisposables); + actionRunner.onDidRun(this.onDidActionRun, this, menuDisposables); + menu = new Menu(container, actions, { + actionViewItemProvider: delegate.getActionViewItem, + context: delegate.getActionsContext ? delegate.getActionsContext() : null, + actionRunner, + getKeyBinding: delegate.getKeyBinding ? delegate.getKeyBinding : (action) => this.keybindingService.lookupKeybinding(action.id) + }, defaultMenuStyles); + menu.onDidCancel(() => this.contextViewService.hideContextView(true), null, menuDisposables); + menu.onDidBlur(() => this.contextViewService.hideContextView(true), null, menuDisposables); + const targetWindow = getWindow(container); + menuDisposables.add(addDisposableListener(targetWindow, EventType.BLUR, () => this.contextViewService.hideContextView(true))); + menuDisposables.add(addDisposableListener(targetWindow, EventType.MOUSE_DOWN, (e) => { + if (e.defaultPrevented) { + return; + } + const event = new StandardMouseEvent(targetWindow, e); + let element = event.target; + if (event.rightButton) { + return; + } + while (element) { + if (element === container) { + return; + } + element = element.parentElement; + } + this.contextViewService.hideContextView(true); + })); + return combinedDisposable(menuDisposables, menu); + }, + focus: () => { + menu?.focus(!!delegate.autoSelectFirstItem); + }, + onHide: (didCancel) => { + delegate.onHide?.(!!didCancel); + if (this.block) { + this.block.remove(); + this.block = null; + } + this.blockDisposable?.dispose(); + this.blockDisposable = null; + if (!!this.lastContainer && (getActiveElement() === this.lastContainer || isAncestor(getActiveElement(), this.lastContainer))) { + this.focusToReturn?.focus(); + } + this.lastContainer = null; + } + }, shadowRootElement, !!shadowRootElement); + } + onActionRun(e, logTelemetry) { + if (logTelemetry) { + this.telemetryService.publicLog2("workbenchActionExecuted", { id: e.action.id, from: "contextMenu" }); + } + this.contextViewService.hideContextView(false); + } + onDidActionRun(e) { + if (e.error && !isCancellationError(e.error)) { + this.notificationService.error(e.error); + } + } +}; + +// node_modules/monaco-editor-core/esm/vs/platform/contextview/browser/contextMenuService.js +var __decorate176 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param170 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var ContextMenuService = class ContextMenuService2 extends Disposable { + get contextMenuHandler() { + if (!this._contextMenuHandler) { + this._contextMenuHandler = new ContextMenuHandler(this.contextViewService, this.telemetryService, this.notificationService, this.keybindingService); + } + return this._contextMenuHandler; + } + constructor(telemetryService, notificationService, contextViewService, keybindingService, menuService, contextKeyService) { + super(); + this.telemetryService = telemetryService; + this.notificationService = notificationService; + this.contextViewService = contextViewService; + this.keybindingService = keybindingService; + this.menuService = menuService; + this.contextKeyService = contextKeyService; + this._contextMenuHandler = void 0; + this._onDidShowContextMenu = this._store.add(new Emitter()); + this.onDidShowContextMenu = this._onDidShowContextMenu.event; + this._onDidHideContextMenu = this._store.add(new Emitter()); + this.onDidHideContextMenu = this._onDidHideContextMenu.event; + } + configure(options2) { + this.contextMenuHandler.configure(options2); + } + // ContextMenu + showContextMenu(delegate) { + delegate = ContextMenuMenuDelegate.transform(delegate, this.menuService, this.contextKeyService); + this.contextMenuHandler.showContextMenu({ + ...delegate, + onHide: (didCancel) => { + delegate.onHide?.(didCancel); + this._onDidHideContextMenu.fire(); + } + }); + ModifierKeyEmitter.getInstance().resetKeyStatus(); + this._onDidShowContextMenu.fire(); + } +}; +ContextMenuService = __decorate176([ + __param170(0, ITelemetryService), + __param170(1, INotificationService), + __param170(2, IContextViewService), + __param170(3, IKeybindingService), + __param170(4, IMenuService), + __param170(5, IContextKeyService) +], ContextMenuService); +var ContextMenuMenuDelegate; +(function(ContextMenuMenuDelegate2) { + function is(thing) { + return thing && thing.menuId instanceof MenuId; + } + function transform(delegate, menuService, globalContextKeyService) { + if (!is(delegate)) { + return delegate; + } + const { menuId, menuActionOptions, contextKeyService } = delegate; + return { + ...delegate, + getActions: () => { + let target = []; + if (menuId) { + const menu = menuService.getMenuActions(menuId, contextKeyService ?? globalContextKeyService, menuActionOptions); + target = getFlatContextMenuActions(menu); + } + if (!delegate.getActions) { + return target; + } else { + return Separator.join(delegate.getActions(), target); + } + } + }; + } + ContextMenuMenuDelegate2.transform = transform; +})(ContextMenuMenuDelegate || (ContextMenuMenuDelegate = {})); + +// node_modules/monaco-editor-core/esm/vs/editor/standalone/browser/standaloneServices.js +init_extensions(); + +// node_modules/monaco-editor-core/esm/vs/editor/browser/services/openerService.js +init_dom(); +init_window(); +init_cancellation(); +init_linkedList(); +init_map(); +init_network(); +init_resources(); +init_uri(); +init_codeEditorService(); +init_commands(); + +// node_modules/monaco-editor-core/esm/vs/platform/editor/common/editor.js +var EditorOpenSource; +(function(EditorOpenSource2) { + EditorOpenSource2[EditorOpenSource2["API"] = 0] = "API"; + EditorOpenSource2[EditorOpenSource2["USER"] = 1] = "USER"; +})(EditorOpenSource || (EditorOpenSource = {})); + +// node_modules/monaco-editor-core/esm/vs/editor/browser/services/openerService.js +var __decorate177 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param171 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var CommandOpener = class CommandOpener2 { + constructor(_commandService) { + this._commandService = _commandService; + } + async open(target, options2) { + if (!matchesScheme(target, Schemas.command)) { + return false; + } + if (!options2?.allowCommands) { + return true; + } + if (typeof target === "string") { + target = URI.parse(target); + } + if (Array.isArray(options2.allowCommands)) { + if (!options2.allowCommands.includes(target.path)) { + return true; + } + } + let args = []; + try { + args = parse2(decodeURIComponent(target.query)); + } catch { + try { + args = parse2(target.query); + } catch { + } + } + if (!Array.isArray(args)) { + args = [args]; + } + await this._commandService.executeCommand(target.path, ...args); + return true; + } +}; +CommandOpener = __decorate177([ + __param171(0, ICommandService) +], CommandOpener); +var EditorOpener = class EditorOpener2 { + constructor(_editorService) { + this._editorService = _editorService; + } + async open(target, options2) { + if (typeof target === "string") { + target = URI.parse(target); + } + const { selection, uri } = extractSelection(target); + target = uri; + if (target.scheme === Schemas.file) { + target = normalizePath(target); + } + await this._editorService.openCodeEditor({ + resource: target, + options: { + selection, + source: options2?.fromUserGesture ? EditorOpenSource.USER : EditorOpenSource.API, + ...options2?.editorOptions + } + }, this._editorService.getFocusedCodeEditor(), options2?.openToSide); + return true; + } +}; +EditorOpener = __decorate177([ + __param171(0, ICodeEditorService) +], EditorOpener); +var OpenerService = class OpenerService2 { + constructor(editorService, commandService) { + this._openers = new LinkedList(); + this._validators = new LinkedList(); + this._resolvers = new LinkedList(); + this._resolvedUriTargets = new ResourceMap((uri) => uri.with({ path: null, fragment: null, query: null }).toString()); + this._externalOpeners = new LinkedList(); + this._defaultExternalOpener = { + openExternal: async (href) => { + if (matchesSomeScheme(href, Schemas.http, Schemas.https)) { + windowOpenNoOpener(href); + } else { + mainWindow.location.href = href; + } + return true; + } + }; + this._openers.push({ + open: async (target, options2) => { + if (options2?.openExternal || matchesSomeScheme(target, Schemas.mailto, Schemas.http, Schemas.https, Schemas.vsls)) { + await this._doOpenExternal(target, options2); + return true; + } + return false; + } + }); + this._openers.push(new CommandOpener(commandService)); + this._openers.push(new EditorOpener(editorService)); + } + registerOpener(opener) { + const remove = this._openers.unshift(opener); + return { dispose: remove }; + } + async open(target, options2) { + if (!options2?.skipValidation) { + const targetURI = typeof target === "string" ? URI.parse(target) : target; + const validationTarget = this._resolvedUriTargets.get(targetURI) ?? target; + for (const validator of this._validators) { + if (!await validator.shouldOpen(validationTarget, options2)) { + return false; + } + } + } + for (const opener of this._openers) { + const handled = await opener.open(target, options2); + if (handled) { + return true; + } + } + return false; + } + async resolveExternalUri(resource, options2) { + for (const resolver of this._resolvers) { + try { + const result = await resolver.resolveExternalUri(resource, options2); + if (result) { + if (!this._resolvedUriTargets.has(result.resolved)) { + this._resolvedUriTargets.set(result.resolved, resource); + } + return result; + } + } catch { + } + } + throw new Error("Could not resolve external URI: " + resource.toString()); + } + async _doOpenExternal(resource, options2) { + const uri = typeof resource === "string" ? URI.parse(resource) : resource; + let externalUri; + try { + externalUri = (await this.resolveExternalUri(uri, options2)).resolved; + } catch { + externalUri = uri; + } + let href; + if (typeof resource === "string" && uri.toString() === externalUri.toString()) { + href = resource; + } else { + href = encodeURI(externalUri.toString(true)); + } + if (options2?.allowContributedOpeners) { + const preferredOpenerId = typeof options2?.allowContributedOpeners === "string" ? options2?.allowContributedOpeners : void 0; + for (const opener of this._externalOpeners) { + const didOpen = await opener.openExternal(href, { + sourceUri: uri, + preferredOpenerId + }, CancellationToken.None); + if (didOpen) { + return true; + } + } + } + return this._defaultExternalOpener.openExternal(href, { sourceUri: uri }, CancellationToken.None); + } + dispose() { + this._validators.clear(); + } +}; +OpenerService = __decorate177([ + __param171(0, ICodeEditorService), + __param171(1, ICommandService) +], OpenerService); + +// node_modules/monaco-editor-core/esm/vs/editor/standalone/browser/standaloneServices.js +init_editorWorker(); +init_language(); + +// node_modules/monaco-editor-core/esm/vs/editor/common/services/markerDecorationsService.js +init_lifecycle(); +init_model2(); +init_themeService(); +init_editorColorRegistry(); +init_model(); +init_range(); +init_network(); +init_event(); +init_colorRegistry(); +init_map(); +init_collections(); +init_iterator(); +var __decorate178 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param172 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var MarkerDecorationsService = class MarkerDecorationsService2 extends Disposable { + constructor(modelService, _markerService) { + super(); + this._markerService = _markerService; + this._onDidChangeMarker = this._register(new Emitter()); + this._suppressedRanges = new ResourceMap(); + this._markerDecorations = new ResourceMap(); + modelService.getModels().forEach((model) => this._onModelAdded(model)); + this._register(modelService.onModelAdded(this._onModelAdded, this)); + this._register(modelService.onModelRemoved(this._onModelRemoved, this)); + this._register(this._markerService.onMarkerChanged(this._handleMarkerChange, this)); + } + dispose() { + super.dispose(); + this._markerDecorations.forEach((value) => value.dispose()); + this._markerDecorations.clear(); + } + getMarker(uri, decoration3) { + const markerDecorations = this._markerDecorations.get(uri); + return markerDecorations ? markerDecorations.getMarker(decoration3) || null : null; + } + _handleMarkerChange(changedResources) { + changedResources.forEach((resource) => { + const markerDecorations = this._markerDecorations.get(resource); + if (markerDecorations) { + this._updateDecorations(markerDecorations); + } + }); + } + _onModelAdded(model) { + const markerDecorations = new MarkerDecorations(model); + this._markerDecorations.set(model.uri, markerDecorations); + this._updateDecorations(markerDecorations); + } + _onModelRemoved(model) { + const markerDecorations = this._markerDecorations.get(model.uri); + if (markerDecorations) { + markerDecorations.dispose(); + this._markerDecorations.delete(model.uri); + } + if (model.uri.scheme === Schemas.inMemory || model.uri.scheme === Schemas.internal || model.uri.scheme === Schemas.vscode) { + this._markerService?.read({ resource: model.uri }).map((marker) => marker.owner).forEach((owner) => this._markerService.remove(owner, [model.uri])); + } + } + _updateDecorations(markerDecorations) { + let markers = this._markerService.read({ resource: markerDecorations.model.uri, take: 500 }); + const suppressedRanges = this._suppressedRanges.get(markerDecorations.model.uri); + if (suppressedRanges) { + markers = markers.filter((marker) => { + return !Iterable.some(suppressedRanges, (candidate) => Range.areIntersectingOrTouching(candidate, marker)); + }); + } + if (markerDecorations.update(markers)) { + this._onDidChangeMarker.fire(markerDecorations.model); + } + } +}; +MarkerDecorationsService = __decorate178([ + __param172(0, IModelService), + __param172(1, IMarkerService) +], MarkerDecorationsService); +var MarkerDecorations = class extends Disposable { + constructor(model) { + super(); + this.model = model; + this._map = new BidirectionalMap(); + this._register(toDisposable(() => { + this.model.deltaDecorations([...this._map.values()], []); + this._map.clear(); + })); + } + update(markers) { + const { added, removed } = diffSets(new Set(this._map.keys()), new Set(markers)); + if (added.length === 0 && removed.length === 0) { + return false; + } + const oldIds = removed.map((marker) => this._map.get(marker)); + const newDecorations = added.map((marker) => { + return { + range: this._createDecorationRange(this.model, marker), + options: this._createDecorationOption(marker) + }; + }); + const ids = this.model.deltaDecorations(oldIds, newDecorations); + for (const removedMarker of removed) { + this._map.delete(removedMarker); + } + for (let index = 0; index < ids.length; index++) { + this._map.set(added[index], ids[index]); + } + return true; + } + getMarker(decoration3) { + return this._map.getKey(decoration3.id); + } + _createDecorationRange(model, rawMarker) { + let ret = Range.lift(rawMarker); + if (rawMarker.severity === MarkerSeverity.Hint && !this._hasMarkerTag( + rawMarker, + 1 + /* MarkerTag.Unnecessary */ + ) && !this._hasMarkerTag( + rawMarker, + 2 + /* MarkerTag.Deprecated */ + )) { + ret = ret.setEndPosition(ret.startLineNumber, ret.startColumn + 2); + } + ret = model.validateRange(ret); + if (ret.isEmpty()) { + const maxColumn = model.getLineLastNonWhitespaceColumn(ret.startLineNumber) || model.getLineMaxColumn(ret.startLineNumber); + if (maxColumn === 1 || ret.endColumn >= maxColumn) { + return ret; + } + const word = model.getWordAtPosition(ret.getStartPosition()); + if (word) { + ret = new Range(ret.startLineNumber, word.startColumn, ret.endLineNumber, word.endColumn); + } + } else if (rawMarker.endColumn === Number.MAX_VALUE && rawMarker.startColumn === 1 && ret.startLineNumber === ret.endLineNumber) { + const minColumn = model.getLineFirstNonWhitespaceColumn(rawMarker.startLineNumber); + if (minColumn < ret.endColumn) { + ret = new Range(ret.startLineNumber, minColumn, ret.endLineNumber, ret.endColumn); + rawMarker.startColumn = minColumn; + } + } + return ret; + } + _createDecorationOption(marker) { + let className2; + let color = void 0; + let zIndex; + let inlineClassName = void 0; + let minimap; + switch (marker.severity) { + case MarkerSeverity.Hint: + if (this._hasMarkerTag( + marker, + 2 + /* MarkerTag.Deprecated */ + )) { + className2 = void 0; + } else if (this._hasMarkerTag( + marker, + 1 + /* MarkerTag.Unnecessary */ + )) { + className2 = "squiggly-unnecessary"; + } else { + className2 = "squiggly-hint"; + } + zIndex = 0; + break; + case MarkerSeverity.Info: + className2 = "squiggly-info"; + color = themeColorFromId(overviewRulerInfo); + zIndex = 10; + minimap = { + color: themeColorFromId(minimapInfo), + position: 1 + /* MinimapPosition.Inline */ + }; + break; + case MarkerSeverity.Warning: + className2 = "squiggly-warning"; + color = themeColorFromId(overviewRulerWarning); + zIndex = 20; + minimap = { + color: themeColorFromId(minimapWarning), + position: 1 + /* MinimapPosition.Inline */ + }; + break; + case MarkerSeverity.Error: + default: + className2 = "squiggly-error"; + color = themeColorFromId(overviewRulerError); + zIndex = 30; + minimap = { + color: themeColorFromId(minimapError), + position: 1 + /* MinimapPosition.Inline */ + }; + break; + } + if (marker.tags) { + if (marker.tags.indexOf( + 1 + /* MarkerTag.Unnecessary */ + ) !== -1) { + inlineClassName = "squiggly-inline-unnecessary"; + } + if (marker.tags.indexOf( + 2 + /* MarkerTag.Deprecated */ + ) !== -1) { + inlineClassName = "squiggly-inline-deprecated"; + } + } + return { + description: "marker-decoration", + stickiness: 1, + className: className2, + showIfCollapsed: true, + overviewRuler: { + color, + position: OverviewRulerLane.Right + }, + minimap, + zIndex, + inlineClassName + }; + } + _hasMarkerTag(marker, tag2) { + if (marker.tags) { + return marker.tags.indexOf(tag2) >= 0; + } + return false; + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/common/services/modelService.js +init_event(); +init_hash(); +init_lifecycle(); +init_network(); +init_objects(); +init_platform(); +init_configuration(); +init_instantiation(); +init_undoRedo(); +init_textModelDefaults(); +init_modesRegistry(); +init_editStack(); +init_textModel(); +var __decorate179 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param173 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var ModelService_1; +function MODEL_ID2(resource) { + return resource.toString(); +} +var ModelData2 = class { + constructor(model, onWillDispose, onDidChangeLanguage) { + this.model = model; + this._modelEventListeners = new DisposableStore(); + this.model = model; + this._modelEventListeners.add(model.onWillDispose(() => onWillDispose(model))); + this._modelEventListeners.add(model.onDidChangeLanguage((e) => onDidChangeLanguage(model, e))); + } + dispose() { + this._modelEventListeners.dispose(); + } +}; +var DEFAULT_EOL = isLinux || isMacintosh ? 1 : 2; +var DisposedModelInfo = class { + constructor(uri, initialUndoRedoSnapshot, time, sharesUndoRedoStack, heapSize, sha1, versionId, alternativeVersionId) { + this.uri = uri; + this.initialUndoRedoSnapshot = initialUndoRedoSnapshot; + this.time = time; + this.sharesUndoRedoStack = sharesUndoRedoStack; + this.heapSize = heapSize; + this.sha1 = sha1; + this.versionId = versionId; + this.alternativeVersionId = alternativeVersionId; + } +}; +var ModelService = class ModelService2 extends Disposable { + static { + ModelService_1 = this; + } + static { + this.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK = 20 * 1024 * 1024; + } + constructor(_configurationService, _resourcePropertiesService, _undoRedoService, _instantiationService) { + super(); + this._configurationService = _configurationService; + this._resourcePropertiesService = _resourcePropertiesService; + this._undoRedoService = _undoRedoService; + this._instantiationService = _instantiationService; + this._onModelAdded = this._register(new Emitter()); + this.onModelAdded = this._onModelAdded.event; + this._onModelRemoved = this._register(new Emitter()); + this.onModelRemoved = this._onModelRemoved.event; + this._onModelModeChanged = this._register(new Emitter()); + this.onModelLanguageChanged = this._onModelModeChanged.event; + this._modelCreationOptionsByLanguageAndResource = /* @__PURE__ */ Object.create(null); + this._models = {}; + this._disposedModels = /* @__PURE__ */ new Map(); + this._disposedModelsHeapSize = 0; + this._register(this._configurationService.onDidChangeConfiguration((e) => this._updateModelOptions(e))); + this._updateModelOptions(void 0); + } + static _readModelOptions(config, isForSimpleWidget) { + let tabSize = EDITOR_MODEL_DEFAULTS.tabSize; + if (config.editor && typeof config.editor.tabSize !== "undefined") { + tabSize = clampedInt(config.editor.tabSize, EDITOR_MODEL_DEFAULTS.tabSize, 1, 100); + } + let indentSize = "tabSize"; + if (config.editor && typeof config.editor.indentSize !== "undefined" && config.editor.indentSize !== "tabSize") { + indentSize = clampedInt(config.editor.indentSize, "tabSize", 1, 100); + } + let insertSpaces = EDITOR_MODEL_DEFAULTS.insertSpaces; + if (config.editor && typeof config.editor.insertSpaces !== "undefined") { + insertSpaces = config.editor.insertSpaces === "false" ? false : Boolean(config.editor.insertSpaces); + } + let newDefaultEOL = DEFAULT_EOL; + const eol = config.eol; + if (eol === "\r\n") { + newDefaultEOL = 2; + } else if (eol === "\n") { + newDefaultEOL = 1; + } + let trimAutoWhitespace = EDITOR_MODEL_DEFAULTS.trimAutoWhitespace; + if (config.editor && typeof config.editor.trimAutoWhitespace !== "undefined") { + trimAutoWhitespace = config.editor.trimAutoWhitespace === "false" ? false : Boolean(config.editor.trimAutoWhitespace); + } + let detectIndentation = EDITOR_MODEL_DEFAULTS.detectIndentation; + if (config.editor && typeof config.editor.detectIndentation !== "undefined") { + detectIndentation = config.editor.detectIndentation === "false" ? false : Boolean(config.editor.detectIndentation); + } + let largeFileOptimizations = EDITOR_MODEL_DEFAULTS.largeFileOptimizations; + if (config.editor && typeof config.editor.largeFileOptimizations !== "undefined") { + largeFileOptimizations = config.editor.largeFileOptimizations === "false" ? false : Boolean(config.editor.largeFileOptimizations); + } + let bracketPairColorizationOptions = EDITOR_MODEL_DEFAULTS.bracketPairColorizationOptions; + if (config.editor?.bracketPairColorization && typeof config.editor.bracketPairColorization === "object") { + const bpConfig = config.editor.bracketPairColorization; + bracketPairColorizationOptions = { + enabled: !!bpConfig.enabled, + independentColorPoolPerBracketType: !!bpConfig.independentColorPoolPerBracketType + }; + } + return { + isForSimpleWidget, + tabSize, + indentSize, + insertSpaces, + detectIndentation, + defaultEOL: newDefaultEOL, + trimAutoWhitespace, + largeFileOptimizations, + bracketPairColorizationOptions + }; + } + _getEOL(resource, language2) { + if (resource) { + return this._resourcePropertiesService.getEOL(resource, language2); + } + const eol = this._configurationService.getValue("files.eol", { overrideIdentifier: language2 }); + if (eol && typeof eol === "string" && eol !== "auto") { + return eol; + } + return OS === 3 || OS === 2 ? "\n" : "\r\n"; + } + _shouldRestoreUndoStack() { + const result = this._configurationService.getValue("files.restoreUndoStack"); + if (typeof result === "boolean") { + return result; + } + return true; + } + getCreationOptions(languageIdOrSelection, resource, isForSimpleWidget) { + const language2 = typeof languageIdOrSelection === "string" ? languageIdOrSelection : languageIdOrSelection.languageId; + let creationOptions = this._modelCreationOptionsByLanguageAndResource[language2 + resource]; + if (!creationOptions) { + const editor2 = this._configurationService.getValue("editor", { overrideIdentifier: language2, resource }); + const eol = this._getEOL(resource, language2); + creationOptions = ModelService_1._readModelOptions({ editor: editor2, eol }, isForSimpleWidget); + this._modelCreationOptionsByLanguageAndResource[language2 + resource] = creationOptions; + } + return creationOptions; + } + _updateModelOptions(e) { + const oldOptionsByLanguageAndResource = this._modelCreationOptionsByLanguageAndResource; + this._modelCreationOptionsByLanguageAndResource = /* @__PURE__ */ Object.create(null); + const keys = Object.keys(this._models); + for (let i2 = 0, len = keys.length; i2 < len; i2++) { + const modelId = keys[i2]; + const modelData = this._models[modelId]; + const language2 = modelData.model.getLanguageId(); + const uri = modelData.model.uri; + if (e && !e.affectsConfiguration("editor", { overrideIdentifier: language2, resource: uri }) && !e.affectsConfiguration("files.eol", { overrideIdentifier: language2, resource: uri })) { + continue; + } + const oldOptions = oldOptionsByLanguageAndResource[language2 + uri]; + const newOptions = this.getCreationOptions(language2, uri, modelData.model.isForSimpleWidget); + ModelService_1._setModelOptionsForModel(modelData.model, newOptions, oldOptions); + } + } + static _setModelOptionsForModel(model, newOptions, currentOptions) { + if (currentOptions && currentOptions.defaultEOL !== newOptions.defaultEOL && model.getLineCount() === 1) { + model.setEOL( + newOptions.defaultEOL === 1 ? 0 : 1 + /* EndOfLineSequence.CRLF */ + ); + } + if (currentOptions && currentOptions.detectIndentation === newOptions.detectIndentation && currentOptions.insertSpaces === newOptions.insertSpaces && currentOptions.tabSize === newOptions.tabSize && currentOptions.indentSize === newOptions.indentSize && currentOptions.trimAutoWhitespace === newOptions.trimAutoWhitespace && equals2(currentOptions.bracketPairColorizationOptions, newOptions.bracketPairColorizationOptions)) { + return; + } + if (newOptions.detectIndentation) { + model.detectIndentation(newOptions.insertSpaces, newOptions.tabSize); + model.updateOptions({ + trimAutoWhitespace: newOptions.trimAutoWhitespace, + bracketColorizationOptions: newOptions.bracketPairColorizationOptions + }); + } else { + model.updateOptions({ + insertSpaces: newOptions.insertSpaces, + tabSize: newOptions.tabSize, + indentSize: newOptions.indentSize, + trimAutoWhitespace: newOptions.trimAutoWhitespace, + bracketColorizationOptions: newOptions.bracketPairColorizationOptions + }); + } + } + // --- begin IModelService + _insertDisposedModel(disposedModelData) { + this._disposedModels.set(MODEL_ID2(disposedModelData.uri), disposedModelData); + this._disposedModelsHeapSize += disposedModelData.heapSize; + } + _removeDisposedModel(resource) { + const disposedModelData = this._disposedModels.get(MODEL_ID2(resource)); + if (disposedModelData) { + this._disposedModelsHeapSize -= disposedModelData.heapSize; + } + this._disposedModels.delete(MODEL_ID2(resource)); + return disposedModelData; + } + _ensureDisposedModelsHeapSize(maxModelsHeapSize) { + if (this._disposedModelsHeapSize > maxModelsHeapSize) { + const disposedModels = []; + this._disposedModels.forEach((entry) => { + if (!entry.sharesUndoRedoStack) { + disposedModels.push(entry); + } + }); + disposedModels.sort((a, b) => a.time - b.time); + while (disposedModels.length > 0 && this._disposedModelsHeapSize > maxModelsHeapSize) { + const disposedModel = disposedModels.shift(); + this._removeDisposedModel(disposedModel.uri); + if (disposedModel.initialUndoRedoSnapshot !== null) { + this._undoRedoService.restoreSnapshot(disposedModel.initialUndoRedoSnapshot); + } + } + } + } + _createModelData(value, languageIdOrSelection, resource, isForSimpleWidget) { + const options2 = this.getCreationOptions(languageIdOrSelection, resource, isForSimpleWidget); + const model = this._instantiationService.createInstance(TextModel, value, languageIdOrSelection, options2, resource); + if (resource && this._disposedModels.has(MODEL_ID2(resource))) { + const disposedModelData = this._removeDisposedModel(resource); + const elements = this._undoRedoService.getElements(resource); + const sha1Computer = this._getSHA1Computer(); + const sha1IsEqual = sha1Computer.canComputeSHA1(model) ? sha1Computer.computeSHA1(model) === disposedModelData.sha1 : false; + if (sha1IsEqual || disposedModelData.sharesUndoRedoStack) { + for (const element of elements.past) { + if (isEditStackElement(element) && element.matchesResource(resource)) { + element.setModel(model); + } + } + for (const element of elements.future) { + if (isEditStackElement(element) && element.matchesResource(resource)) { + element.setModel(model); + } + } + this._undoRedoService.setElementsValidFlag(resource, true, (element) => isEditStackElement(element) && element.matchesResource(resource)); + if (sha1IsEqual) { + model._overwriteVersionId(disposedModelData.versionId); + model._overwriteAlternativeVersionId(disposedModelData.alternativeVersionId); + model._overwriteInitialUndoRedoSnapshot(disposedModelData.initialUndoRedoSnapshot); + } + } else { + if (disposedModelData.initialUndoRedoSnapshot !== null) { + this._undoRedoService.restoreSnapshot(disposedModelData.initialUndoRedoSnapshot); + } + } + } + const modelId = MODEL_ID2(model.uri); + if (this._models[modelId]) { + throw new Error("ModelService: Cannot add model because it already exists!"); + } + const modelData = new ModelData2(model, (model2) => this._onWillDispose(model2), (model2, e) => this._onDidChangeLanguage(model2, e)); + this._models[modelId] = modelData; + return modelData; + } + createModel(value, languageSelection, resource, isForSimpleWidget = false) { + let modelData; + if (languageSelection) { + modelData = this._createModelData(value, languageSelection, resource, isForSimpleWidget); + } else { + modelData = this._createModelData(value, PLAINTEXT_LANGUAGE_ID, resource, isForSimpleWidget); + } + this._onModelAdded.fire(modelData.model); + return modelData.model; + } + getModels() { + const ret = []; + const keys = Object.keys(this._models); + for (let i2 = 0, len = keys.length; i2 < len; i2++) { + const modelId = keys[i2]; + ret.push(this._models[modelId].model); + } + return ret; + } + getModel(resource) { + const modelId = MODEL_ID2(resource); + const modelData = this._models[modelId]; + if (!modelData) { + return null; + } + return modelData.model; + } + // --- end IModelService + _schemaShouldMaintainUndoRedoElements(resource) { + return resource.scheme === Schemas.file || resource.scheme === Schemas.vscodeRemote || resource.scheme === Schemas.vscodeUserData || resource.scheme === Schemas.vscodeNotebookCell || resource.scheme === "fake-fs"; + } + _onWillDispose(model) { + const modelId = MODEL_ID2(model.uri); + const modelData = this._models[modelId]; + const sharesUndoRedoStack = this._undoRedoService.getUriComparisonKey(model.uri) !== model.uri.toString(); + let maintainUndoRedoStack = false; + let heapSize = 0; + if (sharesUndoRedoStack || this._shouldRestoreUndoStack() && this._schemaShouldMaintainUndoRedoElements(model.uri)) { + const elements = this._undoRedoService.getElements(model.uri); + if (elements.past.length > 0 || elements.future.length > 0) { + for (const element of elements.past) { + if (isEditStackElement(element) && element.matchesResource(model.uri)) { + maintainUndoRedoStack = true; + heapSize += element.heapSize(model.uri); + element.setModel(model.uri); + } + } + for (const element of elements.future) { + if (isEditStackElement(element) && element.matchesResource(model.uri)) { + maintainUndoRedoStack = true; + heapSize += element.heapSize(model.uri); + element.setModel(model.uri); + } + } + } + } + const maxMemory = ModelService_1.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK; + const sha1Computer = this._getSHA1Computer(); + if (!maintainUndoRedoStack) { + if (!sharesUndoRedoStack) { + const initialUndoRedoSnapshot = modelData.model.getInitialUndoRedoSnapshot(); + if (initialUndoRedoSnapshot !== null) { + this._undoRedoService.restoreSnapshot(initialUndoRedoSnapshot); + } + } + } else if (!sharesUndoRedoStack && (heapSize > maxMemory || !sha1Computer.canComputeSHA1(model))) { + const initialUndoRedoSnapshot = modelData.model.getInitialUndoRedoSnapshot(); + if (initialUndoRedoSnapshot !== null) { + this._undoRedoService.restoreSnapshot(initialUndoRedoSnapshot); + } + } else { + this._ensureDisposedModelsHeapSize(maxMemory - heapSize); + this._undoRedoService.setElementsValidFlag(model.uri, false, (element) => isEditStackElement(element) && element.matchesResource(model.uri)); + this._insertDisposedModel(new DisposedModelInfo(model.uri, modelData.model.getInitialUndoRedoSnapshot(), Date.now(), sharesUndoRedoStack, heapSize, sha1Computer.computeSHA1(model), model.getVersionId(), model.getAlternativeVersionId())); + } + delete this._models[modelId]; + modelData.dispose(); + delete this._modelCreationOptionsByLanguageAndResource[model.getLanguageId() + model.uri]; + this._onModelRemoved.fire(model); + } + _onDidChangeLanguage(model, e) { + const oldLanguageId = e.oldLanguage; + const newLanguageId = model.getLanguageId(); + const oldOptions = this.getCreationOptions(oldLanguageId, model.uri, model.isForSimpleWidget); + const newOptions = this.getCreationOptions(newLanguageId, model.uri, model.isForSimpleWidget); + ModelService_1._setModelOptionsForModel(model, newOptions, oldOptions); + this._onModelModeChanged.fire({ model, oldLanguageId }); + } + _getSHA1Computer() { + return new DefaultModelSHA1Computer(); + } +}; +ModelService = ModelService_1 = __decorate179([ + __param173(0, IConfigurationService), + __param173(1, ITextResourcePropertiesService), + __param173(2, IUndoRedoService), + __param173(3, IInstantiationService) +], ModelService); +var DefaultModelSHA1Computer = class _DefaultModelSHA1Computer { + static { + this.MAX_MODEL_SIZE = 10 * 1024 * 1024; + } + // takes 200ms to compute a sha1 on a 10MB model on a new machine + canComputeSHA1(model) { + return model.getValueLength() <= _DefaultModelSHA1Computer.MAX_MODEL_SIZE; + } + computeSHA1(model) { + const shaComputer = new StringSHA1(); + const snapshot = model.createSnapshot(); + let text2; + while (text2 = snapshot.read()) { + shaComputer.update(text2); + } + return shaComputer.digest(); + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/standalone/browser/quickInput/standaloneQuickInputService.js +init_event(); +init_editorExtensions(); +init_themeService(); +init_cancellation(); +init_instantiation(); +init_contextkey(); +init_codeEditorService(); + +// node_modules/monaco-editor-core/esm/vs/platform/quickinput/browser/quickInputService.js +init_cancellation(); +init_event(); +init_contextkey(); +init_instantiation(); + +// node_modules/monaco-editor-core/esm/vs/platform/quickinput/browser/quickAccess.js +init_async(); +init_cancellation(); +init_event(); +init_lifecycle(); +init_instantiation(); +init_platform2(); +var __decorate180 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param174 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var QuickAccessController = class QuickAccessController2 extends Disposable { + constructor(quickInputService, instantiationService) { + super(); + this.quickInputService = quickInputService; + this.instantiationService = instantiationService; + this.registry = Registry.as(Extensions10.Quickaccess); + this.mapProviderToDescriptor = /* @__PURE__ */ new Map(); + this.lastAcceptedPickerValues = /* @__PURE__ */ new Map(); + this.visibleQuickAccess = void 0; + this._register(toDisposable(() => { + for (const provider of this.mapProviderToDescriptor.values()) { + if (isDisposable(provider)) { + provider.dispose(); + } + } + this.visibleQuickAccess?.picker.dispose(); + })); + } + show(value = "", options2) { + this.doShowOrPick(value, false, options2); + } + doShowOrPick(value, pick, options2) { + const [provider, descriptor] = this.getOrInstantiateProvider(value, options2?.enabledProviderPrefixes); + const visibleQuickAccess = this.visibleQuickAccess; + const visibleDescriptor = visibleQuickAccess?.descriptor; + if (visibleQuickAccess && descriptor && visibleDescriptor === descriptor) { + if (value !== descriptor.prefix && !options2?.preserveValue) { + visibleQuickAccess.picker.value = value; + } + this.adjustValueSelection(visibleQuickAccess.picker, descriptor, options2); + return; + } + if (descriptor && !options2?.preserveValue) { + let newValue = void 0; + if (visibleQuickAccess && visibleDescriptor && visibleDescriptor !== descriptor) { + const newValueCandidateWithoutPrefix = visibleQuickAccess.value.substr(visibleDescriptor.prefix.length); + if (newValueCandidateWithoutPrefix) { + newValue = `${descriptor.prefix}${newValueCandidateWithoutPrefix}`; + } + } + if (!newValue) { + const defaultFilterValue = provider?.defaultFilterValue; + if (defaultFilterValue === DefaultQuickAccessFilterValue.LAST) { + newValue = this.lastAcceptedPickerValues.get(descriptor); + } else if (typeof defaultFilterValue === "string") { + newValue = `${descriptor.prefix}${defaultFilterValue}`; + } + } + if (typeof newValue === "string") { + value = newValue; + } + } + const visibleSelection = visibleQuickAccess?.picker?.valueSelection; + const visibleValue = visibleQuickAccess?.picker?.value; + const disposables = new DisposableStore(); + const picker = disposables.add(this.quickInputService.createQuickPick({ useSeparators: true })); + picker.value = value; + this.adjustValueSelection(picker, descriptor, options2); + picker.placeholder = options2?.placeholder ?? descriptor?.placeholder; + picker.quickNavigate = options2?.quickNavigateConfiguration; + picker.hideInput = !!picker.quickNavigate && !visibleQuickAccess; + if (typeof options2?.itemActivation === "number" || options2?.quickNavigateConfiguration) { + picker.itemActivation = options2?.itemActivation ?? ItemActivation.SECOND; + } + picker.contextKey = descriptor?.contextKey; + picker.filterValue = (value2) => value2.substring(descriptor ? descriptor.prefix.length : 0); + let pickPromise = void 0; + if (pick) { + pickPromise = new DeferredPromise(); + disposables.add(Event.once(picker.onWillAccept)((e) => { + e.veto(); + picker.hide(); + })); + } + disposables.add(this.registerPickerListeners(picker, provider, descriptor, value, options2)); + const cts = disposables.add(new CancellationTokenSource()); + if (provider) { + disposables.add(provider.provide(picker, cts.token, options2?.providerOptions)); + } + Event.once(picker.onDidHide)(() => { + if (picker.selectedItems.length === 0) { + cts.cancel(); + } + disposables.dispose(); + pickPromise?.complete(picker.selectedItems.slice(0)); + }); + picker.show(); + if (visibleSelection && visibleValue === value) { + picker.valueSelection = visibleSelection; + } + if (pick) { + return pickPromise?.p; + } + } + adjustValueSelection(picker, descriptor, options2) { + let valueSelection; + if (options2?.preserveValue) { + valueSelection = [picker.value.length, picker.value.length]; + } else { + valueSelection = [descriptor?.prefix.length ?? 0, picker.value.length]; + } + picker.valueSelection = valueSelection; + } + registerPickerListeners(picker, provider, descriptor, value, options2) { + const disposables = new DisposableStore(); + const visibleQuickAccess = this.visibleQuickAccess = { picker, descriptor, value }; + disposables.add(toDisposable(() => { + if (visibleQuickAccess === this.visibleQuickAccess) { + this.visibleQuickAccess = void 0; + } + })); + disposables.add(picker.onDidChangeValue((value2) => { + const [providerForValue] = this.getOrInstantiateProvider(value2, options2?.enabledProviderPrefixes); + if (providerForValue !== provider) { + this.show(value2, { + enabledProviderPrefixes: options2?.enabledProviderPrefixes, + // do not rewrite value from user typing! + preserveValue: true, + // persist the value of the providerOptions from the original showing + providerOptions: options2?.providerOptions + }); + } else { + visibleQuickAccess.value = value2; + } + })); + if (descriptor) { + disposables.add(picker.onDidAccept(() => { + this.lastAcceptedPickerValues.set(descriptor, picker.value); + })); + } + return disposables; + } + getOrInstantiateProvider(value, enabledProviderPrefixes) { + const providerDescriptor = this.registry.getQuickAccessProvider(value); + if (!providerDescriptor || enabledProviderPrefixes && !enabledProviderPrefixes?.includes(providerDescriptor.prefix)) { + return [void 0, void 0]; + } + let provider = this.mapProviderToDescriptor.get(providerDescriptor); + if (!provider) { + provider = this.instantiationService.createInstance(providerDescriptor.ctor); + this.mapProviderToDescriptor.set(providerDescriptor, provider); + } + return [provider, providerDescriptor]; + } +}; +QuickAccessController = __decorate180([ + __param174(0, IQuickInputService), + __param174(1, IInstantiationService) +], QuickAccessController); + +// node_modules/monaco-editor-core/esm/vs/platform/quickinput/browser/quickInputService.js +init_colorRegistry(); +init_themeService(); + +// node_modules/monaco-editor-core/esm/vs/platform/quickinput/browser/quickInput.js +init_dom(); +init_keyboardEvent(); +init_arrays(); +init_async(); +init_codicons(); +init_event(); +init_lifecycle(); +init_platform(); +init_themables(); +init_nls(); + +// node_modules/monaco-editor-core/esm/vs/platform/quickinput/browser/quickInputUtils.js +init_dom(); +init_event(); +init_keyboardEvent(); +init_iconLabels2(); + +// node_modules/monaco-editor-core/esm/vs/base/common/linkedText.js +var __decorate181 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var LinkedText = class { + constructor(nodes) { + this.nodes = nodes; + } + toString() { + return this.nodes.map((node) => typeof node === "string" ? node : node.label).join(""); + } +}; +__decorate181([ + memoize +], LinkedText.prototype, "toString", null); +var LINK_REGEX = /\[([^\]]+)\]\(((?:https?:\/\/|command:|file:)[^\)\s]+)(?: (["'])(.+?)(\3))?\)/gi; +function parseLinkedText(text2) { + const result = []; + let index = 0; + let match2; + while (match2 = LINK_REGEX.exec(text2)) { + if (match2.index - index > 0) { + result.push(text2.substring(index, match2.index)); + } + const [, label, href, , title] = match2; + if (title) { + result.push({ label, href, title }); + } else { + result.push({ label, href }); + } + index = match2.index + match2[0].length; + } + if (index < text2.length) { + result.push(text2.substring(index)); + } + return new LinkedText(result); +} + +// node_modules/monaco-editor-core/esm/vs/platform/quickinput/browser/quickInputUtils.js +init_nls(); +var iconPathToClass = {}; +var iconClassGenerator = new IdGenerator("quick-input-button-icon-"); +function getIconClass(iconPath) { + if (!iconPath) { + return void 0; + } + let iconClass; + const key = iconPath.dark.toString(); + if (iconPathToClass[key]) { + iconClass = iconPathToClass[key]; + } else { + iconClass = iconClassGenerator.nextId(); + createCSSRule(`.${iconClass}, .hc-light .${iconClass}`, `background-image: ${asCSSUrl(iconPath.light || iconPath.dark)}`); + createCSSRule(`.vs-dark .${iconClass}, .hc-black .${iconClass}`, `background-image: ${asCSSUrl(iconPath.dark)}`); + iconPathToClass[key] = iconClass; + } + return iconClass; +} +function quickInputButtonToAction(button, id, run) { + let cssClasses = button.iconClass || getIconClass(button.iconPath); + if (button.alwaysVisible) { + cssClasses = cssClasses ? `${cssClasses} always-visible` : "always-visible"; + } + return { + id, + label: "", + tooltip: button.tooltip || "", + class: cssClasses, + enabled: true, + run + }; +} +function renderQuickInputDescription(description, container, actionHandler) { + reset(container); + const parsed = parseLinkedText(description); + let tabIndex = 0; + for (const node of parsed.nodes) { + if (typeof node === "string") { + container.append(...renderLabelWithIcons(node)); + } else { + let title = node.title; + if (!title && node.href.startsWith("command:")) { + title = localize(1771, "Click to execute command '{0}'", node.href.substring("command:".length)); + } else if (!title) { + title = node.href; + } + const anchor = $("a", { href: node.href, title, tabIndex: tabIndex++ }, node.label); + anchor.style.textDecoration = "underline"; + const handleOpen = (e) => { + if (isEventLike(e)) { + EventHelper.stop(e, true); + } + actionHandler.callback(node.href); + }; + const onClick = actionHandler.disposables.add(new DomEmitter(anchor, EventType.CLICK)).event; + const onKeydown = actionHandler.disposables.add(new DomEmitter(anchor, EventType.KEY_DOWN)).event; + const onSpaceOrEnter = Event.chain(onKeydown, ($23) => $23.filter((e) => { + const event = new StandardKeyboardEvent(e); + return event.equals( + 10 + /* KeyCode.Space */ + ) || event.equals( + 3 + /* KeyCode.Enter */ + ); + })); + actionHandler.disposables.add(Gesture.addTarget(anchor)); + const onTap = actionHandler.disposables.add(new DomEmitter(anchor, EventType2.Tap)).event; + Event.any(onClick, onTap, onSpaceOrEnter)(handleOpen, null, actionHandler.disposables); + container.appendChild(anchor); + } + } +} + +// node_modules/monaco-editor-core/esm/vs/platform/quickinput/browser/quickInput.js +init_configuration(); +init_contextkey(); +init_observable(); +var __decorate182 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param175 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var inQuickInputContextKeyValue = "inQuickInput"; +var InQuickInputContextKey = new RawContextKey(inQuickInputContextKeyValue, false, localize(1748, "Whether keyboard focus is inside the quick input control")); +var inQuickInputContext = ContextKeyExpr.has(inQuickInputContextKeyValue); +var quickInputAlignmentContextKeyValue = "quickInputAlignment"; +var QuickInputAlignmentContextKey = new RawContextKey(quickInputAlignmentContextKeyValue, "top", localize(1749, "The alignment of the quick input")); +var quickInputTypeContextKeyValue = "quickInputType"; +var QuickInputTypeContextKey = new RawContextKey(quickInputTypeContextKeyValue, void 0, localize(1750, "The type of the currently visible quick input")); +var endOfQuickInputBoxContextKeyValue = "cursorAtEndOfQuickInputBox"; +var EndOfQuickInputBoxContextKey = new RawContextKey(endOfQuickInputBoxContextKeyValue, false, localize(1751, "Whether the cursor in the quick input is at the end of the input box")); +var endOfQuickInputBoxContext = ContextKeyExpr.has(endOfQuickInputBoxContextKeyValue); +var backButton = { + iconClass: ThemeIcon.asClassName(Codicon.quickInputBack), + tooltip: localize(1752, "Back"), + handle: -1 + // TODO +}; +var QuickInput = class _QuickInput extends Disposable { + static { + this.noPromptMessage = localize(1753, "Press 'Enter' to confirm your input or 'Escape' to cancel"); + } + constructor(ui) { + super(); + this.ui = ui; + this._visible = observableValue("visible", false); + this._widgetUpdated = false; + this._enabled = true; + this._busy = false; + this._ignoreFocusOut = false; + this._leftButtons = []; + this._rightButtons = []; + this._inlineButtons = []; + this.buttonsUpdated = false; + this._toggles = []; + this.togglesUpdated = false; + this.noValidationMessage = _QuickInput.noPromptMessage; + this._severity = severity_default.Ignore; + this.onDidTriggerButtonEmitter = this._register(new Emitter()); + this.onDidHideEmitter = this._register(new Emitter()); + this.onWillHideEmitter = this._register(new Emitter()); + this.onDisposeEmitter = this._register(new Emitter()); + this.visibleDisposables = this._register(new DisposableStore()); + this.onDidHide = this.onDidHideEmitter.event; + } + get visible() { + return this._visible.get(); + } + get title() { + return this._title; + } + set title(title) { + this._title = title; + this.update(); + } + get description() { + return this._description; + } + set description(description) { + this._description = description; + this.update(); + } + get step() { + return this._steps; + } + set step(step) { + this._steps = step; + this.update(); + } + get totalSteps() { + return this._totalSteps; + } + set totalSteps(totalSteps) { + this._totalSteps = totalSteps; + this.update(); + } + get enabled() { + return this._enabled; + } + set enabled(enabled) { + this._enabled = enabled; + this.update(); + } + get contextKey() { + return this._contextKey; + } + set contextKey(contextKey) { + this._contextKey = contextKey; + this.update(); + } + get busy() { + return this._busy; + } + set busy(busy) { + this._busy = busy; + this.update(); + } + get ignoreFocusOut() { + return this._ignoreFocusOut; + } + set ignoreFocusOut(ignoreFocusOut) { + const shouldUpdate = this._ignoreFocusOut !== ignoreFocusOut && !isIOS; + this._ignoreFocusOut = ignoreFocusOut && !isIOS; + if (shouldUpdate) { + this.update(); + } + } + get titleButtons() { + return this._leftButtons.length ? [...this._leftButtons, this._rightButtons] : this._rightButtons; + } + get buttons() { + return [ + ...this._leftButtons, + ...this._rightButtons, + ...this._inlineButtons + ]; + } + set buttons(buttons) { + this._leftButtons = buttons.filter((b) => b === backButton); + this._rightButtons = buttons.filter((b) => b !== backButton && b.location !== QuickInputButtonLocation.Inline); + this._inlineButtons = buttons.filter((b) => b.location === QuickInputButtonLocation.Inline); + this.buttonsUpdated = true; + this.update(); + } + get toggles() { + return this._toggles; + } + set toggles(toggles) { + this._toggles = toggles ?? []; + this.togglesUpdated = true; + this.update(); + } + get validationMessage() { + return this._validationMessage; + } + set validationMessage(validationMessage) { + this._validationMessage = validationMessage; + this.update(); + } + get severity() { + return this._severity; + } + set severity(severity) { + this._severity = severity; + this.update(); + } + show() { + if (this.visible) { + return; + } + this.visibleDisposables.add(this.ui.onDidTriggerButton((button) => { + if (this.buttons.indexOf(button) !== -1) { + this.onDidTriggerButtonEmitter.fire(button); + } + })); + this.ui.show(this); + this._visible.set(true, void 0); + this._lastValidationMessage = void 0; + this._lastSeverity = void 0; + if (this.buttons.length) { + this.buttonsUpdated = true; + } + if (this.toggles.length) { + this.togglesUpdated = true; + } + this.update(); + } + hide() { + if (!this.visible) { + return; + } + this.ui.hide(); + } + didHide(reason = QuickInputHideReason.Other) { + this._visible.set(false, void 0); + this.visibleDisposables.clear(); + this.onDidHideEmitter.fire({ reason }); + } + willHide(reason = QuickInputHideReason.Other) { + this.onWillHideEmitter.fire({ reason }); + } + update() { + if (!this.visible) { + return; + } + const title = this.getTitle(); + if (title && this.ui.title.textContent !== title) { + this.ui.title.textContent = title; + } else if (!title && this.ui.title.innerHTML !== " ") { + this.ui.title.innerText = "\xA0"; + } + const description = this.getDescription(); + if (this.ui.description1.textContent !== description) { + this.ui.description1.textContent = description; + } + if (this.ui.description2.textContent !== description) { + this.ui.description2.textContent = description; + } + if (this._widgetUpdated) { + this._widgetUpdated = false; + if (this._widget) { + reset(this.ui.widget, this._widget); + } else { + reset(this.ui.widget); + } + } + if (this.busy && !this.busyDelay) { + this.busyDelay = new TimeoutTimer(); + this.busyDelay.setIfNotSet(() => { + if (this.visible) { + this.ui.progressBar.infinite(); + this.ui.progressBar.getContainer().removeAttribute("aria-hidden"); + } + }, 800); + } + if (!this.busy && this.busyDelay) { + this.ui.progressBar.stop(); + this.ui.progressBar.getContainer().setAttribute("aria-hidden", "true"); + this.busyDelay.cancel(); + this.busyDelay = void 0; + } + if (this.buttonsUpdated) { + this.buttonsUpdated = false; + this.ui.leftActionBar.clear(); + const leftButtons = this._leftButtons.map((button, index) => quickInputButtonToAction(button, `id-${index}`, async () => this.onDidTriggerButtonEmitter.fire(button))); + this.ui.leftActionBar.push(leftButtons, { icon: true, label: false }); + this.ui.rightActionBar.clear(); + const rightButtons = this._rightButtons.map((button, index) => quickInputButtonToAction(button, `id-${index}`, async () => this.onDidTriggerButtonEmitter.fire(button))); + this.ui.rightActionBar.push(rightButtons, { icon: true, label: false }); + this.ui.inlineActionBar.clear(); + const inlineButtons = this._inlineButtons.map((button, index) => quickInputButtonToAction(button, `id-${index}`, async () => this.onDidTriggerButtonEmitter.fire(button))); + this.ui.inlineActionBar.push(inlineButtons, { icon: true, label: false }); + } + if (this.togglesUpdated) { + this.togglesUpdated = false; + const concreteToggles = this.toggles?.filter((opts) => opts instanceof Toggle) ?? []; + this.ui.inputBox.toggles = concreteToggles; + const toggleOffset = concreteToggles.length * 22; + this.ui.countContainer.style.right = toggleOffset > 0 ? `${4 + toggleOffset}px` : "4px"; + this.ui.visibleCountContainer.style.right = toggleOffset > 0 ? `${4 + toggleOffset}px` : "4px"; + } + this.ui.ignoreFocusOut = this.ignoreFocusOut; + this.ui.setEnabled(this.enabled); + this.ui.setContextKey(this.contextKey); + const validationMessage = this.validationMessage || this.noValidationMessage; + if (this._lastValidationMessage !== validationMessage) { + this._lastValidationMessage = validationMessage; + reset(this.ui.message); + if (validationMessage) { + renderQuickInputDescription(validationMessage, this.ui.message, { + callback: (content) => { + this.ui.linkOpenerDelegate(content); + }, + disposables: this.visibleDisposables + }); + } + } + if (this._lastSeverity !== this.severity) { + this._lastSeverity = this.severity; + this.showMessageDecoration(this.severity); + } + } + getTitle() { + if (this.title && this.step) { + return `${this.title} (${this.getSteps()})`; + } + if (this.title) { + return this.title; + } + if (this.step) { + return this.getSteps(); + } + return ""; + } + getDescription() { + return this.description || ""; + } + getSteps() { + if (this.step && this.totalSteps) { + return localize(1754, "{0}/{1}", this.step, this.totalSteps); + } + if (this.step) { + return String(this.step); + } + return ""; + } + showMessageDecoration(severity) { + this.ui.inputBox.showDecoration(severity); + if (severity !== severity_default.Ignore) { + const styles = this.ui.inputBox.stylesForType(severity); + this.ui.message.style.color = styles.foreground ? `${styles.foreground}` : ""; + this.ui.message.style.backgroundColor = styles.background ? `${styles.background}` : ""; + this.ui.message.style.border = styles.border ? `1px solid ${styles.border}` : ""; + this.ui.message.style.marginBottom = "-2px"; + } else { + this.ui.message.style.color = ""; + this.ui.message.style.backgroundColor = ""; + this.ui.message.style.border = ""; + this.ui.message.style.marginBottom = ""; + } + } + dispose() { + this.hide(); + this.onDisposeEmitter.fire(); + super.dispose(); + } +}; +var QuickPick = class _QuickPick extends QuickInput { + static { + this.DEFAULT_ARIA_LABEL = localize(1755, "Type to narrow down results."); + } + constructor(ui) { + super(ui); + this._value = ""; + this.onDidChangeValueEmitter = this._register(new Emitter()); + this.onWillAcceptEmitter = this._register(new Emitter()); + this.onDidAcceptEmitter = this._register(new Emitter()); + this.onDidCustomEmitter = this._register(new Emitter()); + this._items = []; + this.itemsUpdated = false; + this._canSelectMany = false; + this._canAcceptInBackground = false; + this._matchOnDescription = false; + this._matchOnDetail = false; + this._matchOnLabel = true; + this._matchOnLabelMode = "fuzzy"; + this._sortByLabel = true; + this._keepScrollPosition = false; + this._itemActivation = ItemActivation.FIRST; + this._activeItems = []; + this.activeItemsUpdated = false; + this.activeItemsToConfirm = []; + this.onDidChangeActiveEmitter = this._register(new Emitter()); + this._selectedItems = []; + this.selectedItemsUpdated = false; + this.selectedItemsToConfirm = []; + this.onDidChangeSelectionEmitter = this._register(new Emitter()); + this.onDidTriggerItemButtonEmitter = this._register(new Emitter()); + this.onDidTriggerSeparatorButtonEmitter = this._register(new Emitter()); + this.valueSelectionUpdated = true; + this._ok = "default"; + this._customButton = false; + this._focusEventBufferer = new EventBufferer(); + this.type = "quickPick"; + this.filterValue = (value) => value; + this.onDidChangeValue = this.onDidChangeValueEmitter.event; + this.onWillAccept = this.onWillAcceptEmitter.event; + this.onDidAccept = this.onDidAcceptEmitter.event; + this.onDidChangeActive = this.onDidChangeActiveEmitter.event; + this.onDidChangeSelection = this.onDidChangeSelectionEmitter.event; + this.onDidTriggerItemButton = this.onDidTriggerItemButtonEmitter.event; + this.onDidTriggerSeparatorButton = this.onDidTriggerSeparatorButtonEmitter.event; + this.noValidationMessage = void 0; + } + get quickNavigate() { + return this._quickNavigate; + } + set quickNavigate(quickNavigate) { + this._quickNavigate = quickNavigate; + this.update(); + } + get value() { + return this._value; + } + set value(value) { + this.doSetValue(value); + } + doSetValue(value, skipUpdate) { + if (this._value !== value) { + this._value = value; + if (!skipUpdate) { + this.update(); + } + if (this.visible) { + const didFilter = this.ui.list.filter(this.filterValue(this._value)); + if (didFilter) { + this.trySelectFirst(); + } + } + this.onDidChangeValueEmitter.fire(this._value); + } + } + set ariaLabel(ariaLabel) { + this._ariaLabel = ariaLabel; + this.update(); + } + get ariaLabel() { + return this._ariaLabel; + } + get placeholder() { + return this._placeholder; + } + set placeholder(placeholder) { + this._placeholder = placeholder; + this.update(); + } + get prompt() { + return this.noValidationMessage; + } + set prompt(prompt) { + this.noValidationMessage = prompt; + this.update(); + } + get items() { + return this._items; + } + get scrollTop() { + return this.ui.list.scrollTop; + } + set scrollTop(scrollTop) { + this.ui.list.scrollTop = scrollTop; + } + set items(items) { + this._items = items; + this.itemsUpdated = true; + this.update(); + } + get canSelectMany() { + return this._canSelectMany; + } + set canSelectMany(canSelectMany) { + this._canSelectMany = canSelectMany; + this.update(); + } + get canAcceptInBackground() { + return this._canAcceptInBackground; + } + set canAcceptInBackground(canAcceptInBackground) { + this._canAcceptInBackground = canAcceptInBackground; + } + get matchOnDescription() { + return this._matchOnDescription; + } + set matchOnDescription(matchOnDescription) { + this._matchOnDescription = matchOnDescription; + this.update(); + } + get matchOnDetail() { + return this._matchOnDetail; + } + set matchOnDetail(matchOnDetail) { + this._matchOnDetail = matchOnDetail; + this.update(); + } + get matchOnLabel() { + return this._matchOnLabel; + } + set matchOnLabel(matchOnLabel) { + this._matchOnLabel = matchOnLabel; + this.update(); + } + get matchOnLabelMode() { + return this._matchOnLabelMode; + } + set matchOnLabelMode(matchOnLabelMode) { + this._matchOnLabelMode = matchOnLabelMode; + this.update(); + } + get sortByLabel() { + return this._sortByLabel; + } + set sortByLabel(sortByLabel) { + this._sortByLabel = sortByLabel; + this.update(); + } + get keepScrollPosition() { + return this._keepScrollPosition; + } + set keepScrollPosition(keepScrollPosition) { + this._keepScrollPosition = keepScrollPosition; + } + get itemActivation() { + return this._itemActivation; + } + set itemActivation(itemActivation) { + this._itemActivation = itemActivation; + } + get activeItems() { + return this._activeItems; + } + set activeItems(activeItems) { + this._activeItems = activeItems; + this.activeItemsUpdated = true; + this.update(); + } + get selectedItems() { + return this._selectedItems; + } + set selectedItems(selectedItems) { + this._selectedItems = selectedItems; + this.selectedItemsUpdated = true; + this.update(); + } + get keyMods() { + if (this._quickNavigate) { + return NO_KEY_MODS; + } + return this.ui.keyMods; + } + get valueSelection() { + const selection = this.ui.inputBox.getSelection(); + if (!selection) { + return void 0; + } + return [selection.start, selection.end]; + } + set valueSelection(valueSelection) { + this._valueSelection = valueSelection; + this.valueSelectionUpdated = true; + this.update(); + } + get customButton() { + return this._customButton; + } + set customButton(showCustomButton) { + this._customButton = showCustomButton; + this.update(); + } + get customLabel() { + return this._customButtonLabel; + } + set customLabel(label) { + this._customButtonLabel = label; + this.update(); + } + get customHover() { + return this._customButtonHover; + } + set customHover(hover) { + this._customButtonHover = hover; + this.update(); + } + get ok() { + return this._ok; + } + set ok(showOkButton) { + this._ok = showOkButton; + this.update(); + } + get okLabel() { + return this._okLabel ?? localize(1756, "OK"); + } + set okLabel(okLabel) { + this._okLabel = okLabel; + this.update(); + } + get hideInput() { + return !!this._hideInput; + } + set hideInput(hideInput) { + this._hideInput = hideInput; + this.update(); + } + trySelectFirst() { + if (!this.canSelectMany) { + this.ui.list.focus(QuickPickFocus.First); + } + } + show() { + if (!this.visible) { + this.visibleDisposables.add(this.ui.inputBox.onDidChange((value) => { + this.doSetValue( + value, + true + /* skip update since this originates from the UI */ + ); + })); + this.visibleDisposables.add(this.ui.onDidAccept(() => { + if (this.canSelectMany) { + if (!this.ui.list.getCheckedElements().length) { + this._selectedItems = []; + this.onDidChangeSelectionEmitter.fire(this.selectedItems); + } + } else if (this.activeItems[0]) { + this._selectedItems = [this.activeItems[0]]; + this.onDidChangeSelectionEmitter.fire(this.selectedItems); + } + this.handleAccept(false); + })); + this.visibleDisposables.add(this.ui.onDidCustom(() => { + this.onDidCustomEmitter.fire(); + })); + this.visibleDisposables.add(this._focusEventBufferer.wrapEvent( + this.ui.list.onDidChangeFocus, + // Only fire the last event + (_, e) => e + )((focusedItems) => { + if (this.activeItemsUpdated) { + return; + } + if (this.activeItemsToConfirm !== this._activeItems && equals(focusedItems, this._activeItems, (a, b) => a === b)) { + return; + } + this._activeItems = focusedItems; + this.onDidChangeActiveEmitter.fire(focusedItems); + })); + this.visibleDisposables.add(this.ui.list.onDidChangeSelection(({ items: selectedItems, event }) => { + if (this.canSelectMany && !selectedItems.some((i2) => i2.pickable === false)) { + if (selectedItems.length) { + this.ui.list.setSelectedElements([]); + } + return; + } + if (this.selectedItemsToConfirm !== this._selectedItems && equals(selectedItems, this._selectedItems, (a, b) => a === b)) { + return; + } + this._selectedItems = selectedItems; + this.onDidChangeSelectionEmitter.fire(selectedItems); + if (selectedItems.length) { + this.handleAccept( + isMouseEvent(event) && event.button === 1 + /* mouse middle click */ + ); + } + })); + this.visibleDisposables.add(this.ui.list.onChangedCheckedElements((checkedItems) => { + if (!this.canSelectMany || !this.visible) { + return; + } + if (this.selectedItemsToConfirm !== this._selectedItems && equals(checkedItems, this._selectedItems, (a, b) => a === b)) { + return; + } + this._selectedItems = checkedItems; + this.onDidChangeSelectionEmitter.fire(checkedItems); + })); + this.visibleDisposables.add(this.ui.list.onButtonTriggered((event) => this.onDidTriggerItemButtonEmitter.fire(event))); + this.visibleDisposables.add(this.ui.list.onSeparatorButtonTriggered((event) => this.onDidTriggerSeparatorButtonEmitter.fire(event))); + this.visibleDisposables.add(this.registerQuickNavigation()); + this.valueSelectionUpdated = true; + } + super.show(); + } + handleAccept(inBackground) { + let veto = false; + this.onWillAcceptEmitter.fire({ veto: () => veto = true }); + if (!veto) { + this.onDidAcceptEmitter.fire({ inBackground }); + } + } + registerQuickNavigation() { + return addDisposableListener(this.ui.container, EventType.KEY_UP, (e) => { + if (this.canSelectMany || !this._quickNavigate) { + return; + } + const keyboardEvent = new StandardKeyboardEvent(e); + const keyCode = keyboardEvent.keyCode; + const quickNavKeys = this._quickNavigate.keybindings; + const wasTriggerKeyPressed = quickNavKeys.some((k) => { + const chords = k.getChords(); + if (chords.length > 1) { + return false; + } + if (chords[0].shiftKey && keyCode === 4) { + if (keyboardEvent.ctrlKey || keyboardEvent.altKey || keyboardEvent.metaKey) { + return false; + } + return true; + } + if (chords[0].altKey && keyCode === 6) { + return true; + } + if (chords[0].ctrlKey && keyCode === 5) { + return true; + } + if (chords[0].metaKey && keyCode === 57) { + return true; + } + return false; + }); + if (wasTriggerKeyPressed) { + if (this.activeItems[0]) { + this._selectedItems = [this.activeItems[0]]; + this.onDidChangeSelectionEmitter.fire(this.selectedItems); + this.handleAccept(false); + } + this._quickNavigate = void 0; + } + }); + } + update() { + if (!this.visible) { + return; + } + const scrollTopBefore = this.keepScrollPosition ? this.scrollTop : 0; + const hasDescription = !!this.description; + const visibilities = { + title: !!this.title || !!this.step || !!this.titleButtons.length, + description: hasDescription, + checkAll: this.canSelectMany && !this._hideCheckAll, + checkBox: this.canSelectMany, + inputBox: !this._hideInput, + progressBar: !this._hideInput || hasDescription, + visibleCount: true, + count: this.canSelectMany && !this._hideCountBadge, + ok: this.ok === "default" ? this.canSelectMany : this.ok, + list: true, + message: !!this.validationMessage || !!this.prompt, + customButton: this.customButton + }; + this.ui.setVisibilities(visibilities); + super.update(); + if (this.ui.inputBox.value !== this.value) { + this.ui.inputBox.value = this.value; + } + if (this.valueSelectionUpdated) { + this.valueSelectionUpdated = false; + this.ui.inputBox.select(this._valueSelection && { start: this._valueSelection[0], end: this._valueSelection[1] }); + } + if (this.ui.inputBox.placeholder !== (this.placeholder || "")) { + this.ui.inputBox.placeholder = this.placeholder || ""; + } + let ariaLabel = this.ariaLabel; + if (!ariaLabel && visibilities.inputBox) { + ariaLabel = this.placeholder; + if (this.title) { + ariaLabel = ariaLabel ? `${ariaLabel} - ${this.title}` : this.title; + } + if (!ariaLabel) { + ariaLabel = _QuickPick.DEFAULT_ARIA_LABEL; + } + } + if (this.ui.list.ariaLabel !== ariaLabel) { + this.ui.list.ariaLabel = ariaLabel ?? null; + } + if (this.ui.inputBox.ariaLabel !== ariaLabel) { + this.ui.inputBox.ariaLabel = ariaLabel ?? "input"; + } + this.ui.list.matchOnDescription = this.matchOnDescription; + this.ui.list.matchOnDetail = this.matchOnDetail; + this.ui.list.matchOnLabel = this.matchOnLabel; + this.ui.list.matchOnLabelMode = this.matchOnLabelMode; + this.ui.list.sortByLabel = this.sortByLabel; + if (this.itemsUpdated) { + this.itemsUpdated = false; + this._focusEventBufferer.bufferEvents(() => { + this.ui.list.setElements(this.items); + this.ui.list.shouldLoop = !this.canSelectMany; + this.ui.list.filter(this.filterValue(this.ui.inputBox.value)); + switch (this._itemActivation) { + case ItemActivation.NONE: + this._itemActivation = ItemActivation.FIRST; + break; + case ItemActivation.SECOND: + this.ui.list.focus(QuickPickFocus.Second); + this._itemActivation = ItemActivation.FIRST; + break; + case ItemActivation.LAST: + this.ui.list.focus(QuickPickFocus.Last); + this._itemActivation = ItemActivation.FIRST; + break; + default: + this.trySelectFirst(); + break; + } + }); + } + if (this.ui.container.classList.contains("show-checkboxes") !== !!this.canSelectMany) { + if (this.canSelectMany) { + this.ui.list.clearFocus(); + } else { + this.trySelectFirst(); + } + } + if (this.activeItemsUpdated) { + this.activeItemsUpdated = false; + this.activeItemsToConfirm = this._activeItems; + this.ui.list.setFocusedElements(this.activeItems); + if (this.activeItemsToConfirm === this._activeItems) { + this.activeItemsToConfirm = null; + } + } + if (this.selectedItemsUpdated) { + this.selectedItemsUpdated = false; + this.selectedItemsToConfirm = this._selectedItems; + if (this.canSelectMany) { + this.ui.list.setCheckedElements(this.selectedItems); + } else { + this.ui.list.setSelectedElements(this.selectedItems); + } + if (this.selectedItemsToConfirm === this._selectedItems) { + this.selectedItemsToConfirm = null; + } + } + this.ui.ok.label = this.okLabel || ""; + this.ui.customButton.label = this.customLabel || ""; + this.ui.customButton.element.title = this.customHover || ""; + if (!visibilities.inputBox) { + this.ui.list.domFocus(); + if (this.canSelectMany) { + this.ui.list.focus(QuickPickFocus.First); + } + } + if (this.keepScrollPosition) { + this.scrollTop = scrollTopBefore; + } + } + focus(focus) { + this.ui.list.focus(focus); + if (this.canSelectMany) { + this.ui.list.domFocus(); + } + } + accept(inBackground) { + if (inBackground && !this._canAcceptInBackground) { + return; + } + if (this.activeItems[0] && !this._canSelectMany) { + this._selectedItems = [this.activeItems[0]]; + this.onDidChangeSelectionEmitter.fire(this.selectedItems); + } + this.handleAccept(inBackground ?? false); + } +}; +var InputBox2 = class extends QuickInput { + constructor() { + super(...arguments); + this._value = ""; + this.valueSelectionUpdated = true; + this._password = false; + this.onDidValueChangeEmitter = this._register(new Emitter()); + this.onDidAcceptEmitter = this._register(new Emitter()); + this.type = "inputBox"; + this.onDidChangeValue = this.onDidValueChangeEmitter.event; + this.onDidAccept = this.onDidAcceptEmitter.event; + } + get value() { + return this._value; + } + set value(value) { + this._value = value || ""; + this.update(); + } + get valueSelection() { + const selection = this.ui.inputBox.getSelection(); + if (!selection) { + return void 0; + } + return [selection.start, selection.end]; + } + set valueSelection(valueSelection) { + this._valueSelection = valueSelection; + this.valueSelectionUpdated = true; + this.update(); + } + get placeholder() { + return this._placeholder; + } + set placeholder(placeholder) { + this._placeholder = placeholder; + this.update(); + } + get ariaLabel() { + return this._ariaLabel; + } + set ariaLabel(ariaLabel) { + this._ariaLabel = ariaLabel; + this.update(); + } + get password() { + return this._password; + } + set password(password) { + this._password = password; + this.update(); + } + get prompt() { + return this._prompt; + } + set prompt(prompt) { + this._prompt = prompt; + this.noValidationMessage = prompt ? localize(1757, "{0} (Press 'Enter' to confirm or 'Escape' to cancel)", prompt) : QuickInput.noPromptMessage; + this.update(); + } + show() { + if (!this.visible) { + this.visibleDisposables.add(this.ui.inputBox.onDidChange((value) => { + if (value === this.value) { + return; + } + this._value = value; + this.onDidValueChangeEmitter.fire(value); + })); + this.visibleDisposables.add(this.ui.onDidAccept(() => this.onDidAcceptEmitter.fire())); + this.valueSelectionUpdated = true; + } + super.show(); + } + accept() { + this.onDidAcceptEmitter.fire(); + } + update() { + if (!this.visible) { + return; + } + this.ui.container.classList.remove("hidden-input"); + const visibilities = { + title: !!this.title || !!this.step || !!this.titleButtons.length, + description: !!this.description || !!this.step, + inputBox: true, + message: true, + progressBar: true + }; + this.ui.setVisibilities(visibilities); + super.update(); + if (this.ui.inputBox.value !== this.value) { + this.ui.inputBox.value = this.value; + } + if (this.valueSelectionUpdated) { + this.valueSelectionUpdated = false; + this.ui.inputBox.select(this._valueSelection && { start: this._valueSelection[0], end: this._valueSelection[1] }); + } + if (this.ui.inputBox.placeholder !== (this.placeholder || "")) { + this.ui.inputBox.placeholder = this.placeholder || ""; + } + if (this.ui.inputBox.password !== this.password) { + this.ui.inputBox.password = this.password; + } + let ariaLabel = this.ariaLabel; + if (!ariaLabel && visibilities.inputBox) { + ariaLabel = this.placeholder ? this.title ? `${this.placeholder} - ${this.title}` : this.placeholder : this.title ? this.title : "input"; + } + if (this.ui.inputBox.ariaLabel !== ariaLabel) { + this.ui.inputBox.ariaLabel = ariaLabel || "input"; + } + } +}; +var QuickInputHoverDelegate = class QuickInputHoverDelegate2 extends WorkbenchHoverDelegate { + constructor(configurationService, hoverService) { + super("mouse", void 0, (options2) => this.getOverrideOptions(options2), configurationService, hoverService); + } + getOverrideOptions(options2) { + const showHoverHint = (isHTMLElement(options2.content) ? options2.content.textContent ?? "" : typeof options2.content === "string" ? options2.content : options2.content.value).includes("\n"); + return { + persistence: { + hideOnKeyDown: false + }, + appearance: { + showHoverHint, + skipFadeInAnimation: true + } + }; + } +}; +QuickInputHoverDelegate = __decorate182([ + __param175(0, IConfigurationService), + __param175(1, IHoverService) +], QuickInputHoverDelegate); + +// node_modules/monaco-editor-core/esm/vs/platform/quickinput/browser/quickInputController.js +init_dom(); + +// node_modules/monaco-editor-core/esm/vs/base/browser/ui/progressbar/progressbar.js +init_dom(); +init_async(); +init_lifecycle(); +var CSS_DONE = "done"; +var CSS_ACTIVE = "active"; +var CSS_INFINITE = "infinite"; +var CSS_INFINITE_LONG_RUNNING = "infinite-long-running"; +var CSS_DISCRETE = "discrete"; +var ProgressBar = class _ProgressBar extends Disposable { + static { + this.LONG_RUNNING_INFINITE_THRESHOLD = 1e4; + } + constructor(container, options2) { + super(); + this.progressSignal = this._register(new MutableDisposable()); + this.workedVal = 0; + this.showDelayedScheduler = this._register(new RunOnceScheduler(() => show(this.element), 0)); + this.longRunningScheduler = this._register(new RunOnceScheduler(() => this.infiniteLongRunning(), _ProgressBar.LONG_RUNNING_INFINITE_THRESHOLD)); + this.create(container, options2); + } + create(container, options2) { + this.element = document.createElement("div"); + this.element.classList.add("monaco-progress-container"); + this.element.setAttribute("role", "progressbar"); + this.element.setAttribute("aria-valuemin", "0"); + container.appendChild(this.element); + this.bit = document.createElement("div"); + this.bit.classList.add("progress-bit"); + this.bit.style.backgroundColor = options2?.progressBarBackground || "#0E70C0"; + this.element.appendChild(this.bit); + } + off() { + this.bit.style.width = "inherit"; + this.bit.style.opacity = "1"; + this.element.classList.remove(CSS_ACTIVE, CSS_INFINITE, CSS_INFINITE_LONG_RUNNING, CSS_DISCRETE); + this.workedVal = 0; + this.totalWork = void 0; + this.longRunningScheduler.cancel(); + this.progressSignal.clear(); + } + /** + * Stops the progressbar from showing any progress instantly without fading out. + */ + stop() { + return this.doDone(false); + } + doDone(delayed) { + this.element.classList.add(CSS_DONE); + if (!this.element.classList.contains(CSS_INFINITE)) { + this.bit.style.width = "inherit"; + if (delayed) { + setTimeout(() => this.off(), 200); + } else { + this.off(); + } + } else { + this.bit.style.opacity = "0"; + if (delayed) { + setTimeout(() => this.off(), 200); + } else { + this.off(); + } + } + return this; + } + /** + * Use this mode to indicate progress that has no total number of work units. + */ + infinite() { + this.bit.style.width = "2%"; + this.bit.style.opacity = "1"; + this.element.classList.remove(CSS_DISCRETE, CSS_DONE, CSS_INFINITE_LONG_RUNNING); + this.element.classList.add(CSS_ACTIVE, CSS_INFINITE); + this.longRunningScheduler.schedule(); + return this; + } + infiniteLongRunning() { + this.element.classList.add(CSS_INFINITE_LONG_RUNNING); + } + getContainer() { + return this.element; + } +}; + +// node_modules/monaco-editor-core/esm/vs/platform/quickinput/browser/quickInputController.js +init_cancellation(); +init_event(); +init_lifecycle(); +init_types(); +init_nls(); + +// node_modules/monaco-editor-core/esm/vs/platform/quickinput/browser/quickInputBox.js +init_dom(); +init_lifecycle(); +var $18 = $; +var QuickInputBox = class extends Disposable { + constructor(parent, inputBoxStyles, toggleStyles) { + super(); + this.parent = parent; + this.onDidChange = (handler) => { + return this.findInput.onDidChange(handler); + }; + this.container = append(this.parent, $18(".quick-input-box")); + this.findInput = this._register(new FindInput(this.container, void 0, { label: "", inputBoxStyles, toggleStyles })); + const input = this.findInput.inputBox.inputElement; + input.role = "textbox"; + input.ariaHasPopup = "menu"; + input.ariaAutoComplete = "list"; + } + get onKeyDown() { + return this.findInput.onKeyDown; + } + get value() { + return this.findInput.getValue(); + } + set value(value) { + this.findInput.setValue(value); + } + select(range2 = null) { + this.findInput.inputBox.select(range2); + } + getSelection() { + return this.findInput.inputBox.getSelection(); + } + isSelectionAtEnd() { + return this.findInput.inputBox.isSelectionAtEnd(); + } + get placeholder() { + return this.findInput.inputBox.inputElement.getAttribute("placeholder") || ""; + } + set placeholder(placeholder) { + this.findInput.inputBox.setPlaceHolder(placeholder); + } + get password() { + return this.findInput.inputBox.inputElement.type === "password"; + } + set password(password) { + this.findInput.inputBox.inputElement.type = password ? "password" : "text"; + } + set enabled(enabled) { + this.findInput.inputBox.inputElement.toggleAttribute("readonly", !enabled); + } + set toggles(toggles) { + this.findInput.setAdditionalToggles(toggles); + } + get ariaLabel() { + return this.findInput.inputBox.inputElement.getAttribute("aria-label") || ""; + } + set ariaLabel(ariaLabel) { + this.findInput.inputBox.inputElement.setAttribute("aria-label", ariaLabel); + } + hasFocus() { + return this.findInput.inputBox.hasFocus(); + } + setAttribute(name, value) { + this.findInput.inputBox.inputElement.setAttribute(name, value); + } + removeAttribute(name) { + this.findInput.inputBox.inputElement.removeAttribute(name); + } + showDecoration(decoration3) { + if (decoration3 === severity_default.Ignore) { + this.findInput.clearMessage(); + } else { + this.findInput.showMessage({ type: decoration3 === severity_default.Info ? 1 : decoration3 === severity_default.Warning ? 2 : 3, content: "" }); + } + } + stylesForType(decoration3) { + return this.findInput.inputBox.stylesForType( + decoration3 === severity_default.Info ? 1 : decoration3 === severity_default.Warning ? 2 : 3 + /* MessageType.ERROR */ + ); + } + setFocus() { + this.findInput.focus(); + } + layout() { + this.findInput.inputBox.layout(); + } +}; + +// node_modules/monaco-editor-core/esm/vs/platform/quickinput/browser/quickInputController.js +init_window(); +init_instantiation(); + +// node_modules/monaco-editor-core/esm/vs/platform/quickinput/browser/quickInputList.js +init_dom(); +init_keyboardEvent(); +init_arrays(); +init_async(); + +// node_modules/monaco-editor-core/esm/vs/base/common/comparers.js +init_date(); +init_lazy(); +var intlFileNameCollatorBaseNumeric = new Lazy(() => { + const collator = safeIntl.Collator(void 0, { numeric: true, sensitivity: "base" }).value; + return { + collator, + collatorIsNumeric: collator.resolvedOptions().numeric + }; +}); +var intlFileNameCollatorNumeric = new Lazy(() => { + const collator = safeIntl.Collator(void 0, { numeric: true }).value; + return { + collator + }; +}); +var intlFileNameCollatorNumericCaseInsensitive = new Lazy(() => { + const collator = safeIntl.Collator(void 0, { numeric: true, sensitivity: "accent" }).value; + return { + collator + }; +}); +function compareFileNames(one, other, caseSensitive = false) { + const a = one || ""; + const b = other || ""; + const result = intlFileNameCollatorBaseNumeric.value.collator.compare(a, b); + if (intlFileNameCollatorBaseNumeric.value.collatorIsNumeric && result === 0 && a !== b) { + return a < b ? -1 : 1; + } + return result; +} +function compareAnything(one, other, lookFor) { + const elementAName = one.toLowerCase(); + const elementBName = other.toLowerCase(); + const prefixCompare = compareByPrefix(one, other, lookFor); + if (prefixCompare) { + return prefixCompare; + } + const elementASuffixMatch = elementAName.endsWith(lookFor); + const elementBSuffixMatch = elementBName.endsWith(lookFor); + if (elementASuffixMatch !== elementBSuffixMatch) { + return elementASuffixMatch ? -1 : 1; + } + const r = compareFileNames(elementAName, elementBName); + if (r !== 0) { + return r; + } + return elementAName.localeCompare(elementBName); +} +function compareByPrefix(one, other, lookFor) { + const elementAName = one.toLowerCase(); + const elementBName = other.toLowerCase(); + const elementAPrefixMatch = elementAName.startsWith(lookFor); + const elementBPrefixMatch = elementBName.startsWith(lookFor); + if (elementAPrefixMatch !== elementBPrefixMatch) { + return elementAPrefixMatch ? -1 : 1; + } else if (elementAPrefixMatch && elementBPrefixMatch) { + if (elementAName.length < elementBName.length) { + return -1; + } + if (elementAName.length > elementBName.length) { + return 1; + } + } + return 0; +} + +// node_modules/monaco-editor-core/esm/vs/platform/quickinput/browser/quickInputList.js +init_errors(); +init_event(); +init_iconLabels(); +init_lazy(); +init_lifecycle(); +init_observable(); +init_platform(); +init_strings(); +init_uri(); +init_nls(); +init_instantiation(); +init_theme(); +init_themeService(); +var __decorate183 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param176 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var QuickPickItemElementRenderer_1; +var $19 = $; +var BaseQuickPickItemElement = class { + constructor(index, hasCheckbox, mainItem) { + this.index = index; + this.hasCheckbox = hasCheckbox; + this._hidden = false; + this._init = new Lazy(() => { + const saneLabel = mainItem.label ?? ""; + const saneSortLabel = parseLabelWithIcons(saneLabel).text.trim(); + const saneAriaLabel = mainItem.ariaLabel || [saneLabel, this.saneDescription, this.saneDetail].map((s) => getCodiconAriaLabel(s)).filter((s) => !!s).join(", "); + return { + saneLabel, + saneSortLabel, + saneAriaLabel + }; + }); + this._saneDescription = mainItem.description; + this._saneTooltip = mainItem.tooltip; + } + // #region Lazy Getters + get saneLabel() { + return this._init.value.saneLabel; + } + get saneSortLabel() { + return this._init.value.saneSortLabel; + } + get saneAriaLabel() { + return this._init.value.saneAriaLabel; + } + get element() { + return this._element; + } + set element(value) { + this._element = value; + } + get hidden() { + return this._hidden; + } + set hidden(value) { + this._hidden = value; + } + get saneDescription() { + return this._saneDescription; + } + set saneDescription(value) { + this._saneDescription = value; + } + get saneDetail() { + return this._saneDetail; + } + set saneDetail(value) { + this._saneDetail = value; + } + get saneTooltip() { + return this._saneTooltip; + } + set saneTooltip(value) { + this._saneTooltip = value; + } + get labelHighlights() { + return this._labelHighlights; + } + set labelHighlights(value) { + this._labelHighlights = value; + } + get descriptionHighlights() { + return this._descriptionHighlights; + } + set descriptionHighlights(value) { + this._descriptionHighlights = value; + } + get detailHighlights() { + return this._detailHighlights; + } + set detailHighlights(value) { + this._detailHighlights = value; + } +}; +var QuickPickItemElement = class extends BaseQuickPickItemElement { + constructor(index, childIndex, hasCheckbox, fireButtonTriggered, _onChecked, item, _separator) { + super(index, hasCheckbox, item); + this.childIndex = childIndex; + this.fireButtonTriggered = fireButtonTriggered; + this._onChecked = _onChecked; + this.item = item; + this._separator = _separator; + this._checked = item.picked; + this.onChecked = hasCheckbox ? Event.map(Event.filter(this._onChecked.event, (e) => e.element === this), (e) => e.checked) : Event.None; + this._saneDetail = item.detail; + this._labelHighlights = item.highlights?.label; + this._descriptionHighlights = item.highlights?.description; + this._detailHighlights = item.highlights?.detail; + } + get separator() { + return this._separator; + } + set separator(value) { + this._separator = value; + } + get checked() { + return this._checked; + } + set checked(value) { + if (value !== this._checked) { + this._checked = value; + this._onChecked.fire({ element: this, checked: value }); + } + } + get checkboxDisabled() { + return !!this.item.disabled; + } +}; +var QuickPickSeparatorFocusReason; +(function(QuickPickSeparatorFocusReason2) { + QuickPickSeparatorFocusReason2[QuickPickSeparatorFocusReason2["NONE"] = 0] = "NONE"; + QuickPickSeparatorFocusReason2[QuickPickSeparatorFocusReason2["MOUSE_HOVER"] = 1] = "MOUSE_HOVER"; + QuickPickSeparatorFocusReason2[QuickPickSeparatorFocusReason2["ACTIVE_ITEM"] = 2] = "ACTIVE_ITEM"; +})(QuickPickSeparatorFocusReason || (QuickPickSeparatorFocusReason = {})); +var QuickPickSeparatorElement = class extends BaseQuickPickItemElement { + constructor(index, fireSeparatorButtonTriggered, separator2) { + super(index, false, separator2); + this.fireSeparatorButtonTriggered = fireSeparatorButtonTriggered; + this.separator = separator2; + this.children = new Array(); + this.focusInsideSeparator = QuickPickSeparatorFocusReason.NONE; + } +}; +var QuickInputItemDelegate = class { + getHeight(element) { + if (element instanceof QuickPickSeparatorElement) { + return 30; + } + return element.saneDetail ? 44 : 22; + } + getTemplateId(element) { + if (element instanceof QuickPickItemElement) { + return QuickPickItemElementRenderer.ID; + } else { + return QuickPickSeparatorElementRenderer.ID; + } + } +}; +var QuickInputAccessibilityProvider = class { + getWidgetAriaLabel() { + return localize(1770, "Quick Input"); + } + getAriaLabel(element) { + return element.separator?.label ? `${element.saneAriaLabel}, ${element.separator.label}` : element.saneAriaLabel; + } + getWidgetRole() { + return "listbox"; + } + getRole(element) { + return element.hasCheckbox ? "checkbox" : "option"; + } + isChecked(element) { + if (!element.hasCheckbox || !(element instanceof QuickPickItemElement)) { + return void 0; + } + return { + get value() { + return element.checked; + }, + onDidChange: (e) => element.onChecked(() => e()) + }; + } +}; +var BaseQuickInputListRenderer = class { + constructor(hoverDelegate) { + this.hoverDelegate = hoverDelegate; + } + // TODO: only do the common stuff here and have a subclass handle their specific stuff + renderTemplate(container) { + const data = /* @__PURE__ */ Object.create(null); + data.toDisposeElement = new DisposableStore(); + data.toDisposeTemplate = new DisposableStore(); + data.entry = append(container, $19(".quick-input-list-entry")); + const label = append(data.entry, $19("label.quick-input-list-label")); + data.outerLabel = label; + data.checkbox = data.toDisposeTemplate.add(new MutableDisposable()); + data.toDisposeTemplate.add(addStandardDisposableListener(label, EventType.CLICK, (e) => { + if (data.checkbox.value && !e.defaultPrevented && data.checkbox.value.enabled) { + const checked = !data.checkbox.value.checked; + data.checkbox.value.checked = checked; + data.element.checked = checked; + } + })); + const rows = append(label, $19(".quick-input-list-rows")); + const row1 = append(rows, $19(".quick-input-list-row")); + const row2 = append(rows, $19(".quick-input-list-row")); + data.label = new IconLabel(row1, { supportHighlights: true, supportDescriptionHighlights: true, supportIcons: true, hoverDelegate: this.hoverDelegate }); + data.toDisposeTemplate.add(data.label); + data.icon = prepend(data.label.element, $19(".quick-input-list-icon")); + const keybindingContainer = append(row1, $19(".quick-input-list-entry-keybinding")); + data.keybinding = new KeybindingLabel(keybindingContainer, OS); + data.toDisposeTemplate.add(data.keybinding); + const detailContainer = append(row2, $19(".quick-input-list-label-meta")); + data.detail = new IconLabel(detailContainer, { supportHighlights: true, supportIcons: true, hoverDelegate: this.hoverDelegate }); + data.toDisposeTemplate.add(data.detail); + data.separator = append(data.entry, $19(".quick-input-list-separator")); + data.actionBar = new ActionBar(data.entry, this.hoverDelegate ? { hoverDelegate: this.hoverDelegate } : void 0); + data.actionBar.domNode.classList.add("quick-input-list-entry-action-bar"); + data.toDisposeTemplate.add(data.actionBar); + return data; + } + disposeTemplate(data) { + data.toDisposeElement.dispose(); + data.toDisposeTemplate.dispose(); + } + disposeElement(_element, _index, data) { + data.toDisposeElement.clear(); + data.actionBar.clear(); + } +}; +var QuickPickItemElementRenderer = class QuickPickItemElementRenderer2 extends BaseQuickInputListRenderer { + static { + QuickPickItemElementRenderer_1 = this; + } + static { + this.ID = "quickpickitem"; + } + constructor(hoverDelegate, themeService) { + super(hoverDelegate); + this.themeService = themeService; + this._itemsWithSeparatorsFrequency = /* @__PURE__ */ new Map(); + } + get templateId() { + return QuickPickItemElementRenderer_1.ID; + } + ensureCheckbox(element, data) { + if (!element.hasCheckbox) { + data.checkbox.value?.domNode.remove(); + data.checkbox.clear(); + return; + } + let checkbox = data.checkbox.value; + if (!checkbox) { + checkbox = new Checkbox(element.saneLabel, element.checked, { ...defaultCheckboxStyles, size: 15 }); + data.checkbox.value = checkbox; + data.outerLabel.prepend(checkbox.domNode); + } else { + checkbox.setTitle(element.saneLabel); + } + if (element.checkboxDisabled) { + checkbox.disable(); + } else { + checkbox.enable(); + } + checkbox.checked = element.checked; + data.toDisposeElement.add(element.onChecked((checked) => checkbox.checked = checked)); + data.toDisposeElement.add(checkbox.onChange(() => element.checked = checkbox.checked)); + } + renderElement(node, index, data) { + const element = node.element; + data.element = element; + element.element = data.entry ?? void 0; + const mainItem = element.item; + element.element.classList.toggle("not-pickable", element.item.pickable === false); + this.ensureCheckbox(element, data); + const { labelHighlights, descriptionHighlights, detailHighlights } = element; + if (mainItem.iconPath) { + const icon = isDark(this.themeService.getColorTheme().type) ? mainItem.iconPath.dark : mainItem.iconPath.light ?? mainItem.iconPath.dark; + const iconUrl = URI.revive(icon); + data.icon.className = "quick-input-list-icon"; + data.icon.style.backgroundImage = asCSSUrl(iconUrl); + } else { + data.icon.style.backgroundImage = ""; + data.icon.className = mainItem.iconClass ? `quick-input-list-icon ${mainItem.iconClass}` : ""; + } + let descriptionTitle; + if (!element.saneTooltip && element.saneDescription) { + descriptionTitle = { + markdown: { + value: escape(element.saneDescription), + supportThemeIcons: true + }, + markdownNotSupportedFallback: element.saneDescription + }; + } + const options2 = { + matches: labelHighlights || [], + // If we have a tooltip, we want that to be shown and not any other hover + descriptionTitle, + descriptionMatches: descriptionHighlights || [], + labelEscapeNewLines: true + }; + options2.extraClasses = mainItem.iconClasses; + options2.italic = mainItem.italic; + options2.strikethrough = mainItem.strikethrough; + data.entry.classList.remove("quick-input-list-separator-as-item"); + data.label.setLabel(element.saneLabel, element.saneDescription, options2); + data.keybinding.set(mainItem.keybinding); + if (element.saneDetail) { + let title; + if (!element.saneTooltip) { + title = { + markdown: { + value: escape(element.saneDetail), + supportThemeIcons: true + }, + markdownNotSupportedFallback: element.saneDetail + }; + } + data.detail.element.style.display = ""; + data.detail.setLabel(element.saneDetail, void 0, { + matches: detailHighlights, + title, + labelEscapeNewLines: true + }); + } else { + data.detail.element.style.display = "none"; + } + if (element.separator?.label) { + data.separator.textContent = element.separator.label; + data.separator.style.display = ""; + this.addItemWithSeparator(element); + } else { + data.separator.style.display = "none"; + } + data.entry.classList.toggle("quick-input-list-separator-border", !!element.separator && element.childIndex !== 0); + const buttons = mainItem.buttons; + if (buttons && buttons.length) { + data.actionBar.push(buttons.map((button, index2) => quickInputButtonToAction(button, `id-${index2}`, () => element.fireButtonTriggered({ button, item: element.item }))), { icon: true, label: false }); + data.entry.classList.add("has-actions"); + } else { + data.entry.classList.remove("has-actions"); + } + } + disposeElement(element, _index, data) { + this.removeItemWithSeparator(element.element); + super.disposeElement(element, _index, data); + } + isItemWithSeparatorVisible(item) { + return this._itemsWithSeparatorsFrequency.has(item); + } + addItemWithSeparator(item) { + this._itemsWithSeparatorsFrequency.set(item, (this._itemsWithSeparatorsFrequency.get(item) || 0) + 1); + } + removeItemWithSeparator(item) { + const frequency = this._itemsWithSeparatorsFrequency.get(item) || 0; + if (frequency > 1) { + this._itemsWithSeparatorsFrequency.set(item, frequency - 1); + } else { + this._itemsWithSeparatorsFrequency.delete(item); + } + } +}; +QuickPickItemElementRenderer = QuickPickItemElementRenderer_1 = __decorate183([ + __param176(1, IThemeService) +], QuickPickItemElementRenderer); +var QuickPickSeparatorElementRenderer = class _QuickPickSeparatorElementRenderer extends BaseQuickInputListRenderer { + constructor() { + super(...arguments); + this._visibleSeparatorsFrequency = /* @__PURE__ */ new Map(); + } + static { + this.ID = "quickpickseparator"; + } + get templateId() { + return _QuickPickSeparatorElementRenderer.ID; + } + get visibleSeparators() { + return [...this._visibleSeparatorsFrequency.keys()]; + } + isSeparatorVisible(separator2) { + return this._visibleSeparatorsFrequency.has(separator2); + } + renderElement(node, index, data) { + const element = node.element; + data.element = element; + element.element = data.entry ?? void 0; + element.element.classList.toggle("focus-inside", !!element.focusInsideSeparator); + const mainItem = element.separator; + const { labelHighlights, descriptionHighlights } = element; + data.icon.style.backgroundImage = ""; + data.icon.className = ""; + let descriptionTitle; + if (!element.saneTooltip && element.saneDescription) { + descriptionTitle = { + markdown: { + value: escape(element.saneDescription), + supportThemeIcons: true + }, + markdownNotSupportedFallback: element.saneDescription + }; + } + const options2 = { + matches: labelHighlights || [], + // If we have a tooltip, we want that to be shown and not any other hover + descriptionTitle, + descriptionMatches: descriptionHighlights || [], + labelEscapeNewLines: true + }; + data.entry.classList.add("quick-input-list-separator-as-item"); + data.label.setLabel(element.saneLabel, element.saneDescription, options2); + data.separator.style.display = "none"; + data.entry.classList.add("quick-input-list-separator-border"); + const buttons = mainItem.buttons; + if (buttons && buttons.length) { + data.actionBar.push(buttons.map((button, index2) => quickInputButtonToAction(button, `id-${index2}`, () => element.fireSeparatorButtonTriggered({ button, separator: element.separator }))), { icon: true, label: false }); + data.entry.classList.add("has-actions"); + } else { + data.entry.classList.remove("has-actions"); + } + this.addSeparator(element); + } + disposeElement(element, _index, data) { + this.removeSeparator(element.element); + if (!this.isSeparatorVisible(element.element)) { + element.element.element?.classList.remove("focus-inside"); + } + super.disposeElement(element, _index, data); + } + addSeparator(separator2) { + this._visibleSeparatorsFrequency.set(separator2, (this._visibleSeparatorsFrequency.get(separator2) || 0) + 1); + } + removeSeparator(separator2) { + const frequency = this._visibleSeparatorsFrequency.get(separator2) || 0; + if (frequency > 1) { + this._visibleSeparatorsFrequency.set(separator2, frequency - 1); + } else { + this._visibleSeparatorsFrequency.delete(separator2); + } + } +}; +var QuickInputList = class QuickInputList2 extends Disposable { + constructor(parent, hoverDelegate, linkOpenerDelegate, id, instantiationService, accessibilityService) { + super(); + this.parent = parent; + this.hoverDelegate = hoverDelegate; + this.linkOpenerDelegate = linkOpenerDelegate; + this.accessibilityService = accessibilityService; + this._onKeyDown = new Emitter(); + this._onLeave = new Emitter(); + this.onLeave = this._onLeave.event; + this._visibleCountObservable = observableValue("VisibleCount", 0); + this.onChangedVisibleCount = Event.fromObservable(this._visibleCountObservable, this._store); + this._allVisibleCheckedObservable = observableValue("AllVisibleChecked", false); + this.onChangedAllVisibleChecked = Event.fromObservable(this._allVisibleCheckedObservable, this._store); + this._checkedCountObservable = observableValue("CheckedCount", 0); + this.onChangedCheckedCount = Event.fromObservable(this._checkedCountObservable, this._store); + this._checkedElementsObservable = observableValueOpts({ equalsFn: equals }, new Array()); + this.onChangedCheckedElements = Event.fromObservable(this._checkedElementsObservable, this._store); + this._onButtonTriggered = new Emitter(); + this.onButtonTriggered = this._onButtonTriggered.event; + this._onSeparatorButtonTriggered = new Emitter(); + this.onSeparatorButtonTriggered = this._onSeparatorButtonTriggered.event; + this._elementChecked = new Emitter(); + this._elementCheckedEventBufferer = new EventBufferer(); + this._hasCheckboxes = false; + this._inputElements = new Array(); + this._elementTree = new Array(); + this._itemElements = new Array(); + this._elementDisposable = this._register(new DisposableStore()); + this._matchOnDescription = false; + this._matchOnDetail = false; + this._matchOnLabel = true; + this._matchOnLabelMode = "fuzzy"; + this._sortByLabel = true; + this._shouldLoop = true; + this._container = append(this.parent, $19(".quick-input-list")); + this._separatorRenderer = new QuickPickSeparatorElementRenderer(hoverDelegate); + this._itemRenderer = instantiationService.createInstance(QuickPickItemElementRenderer, hoverDelegate); + this._tree = this._register(instantiationService.createInstance(WorkbenchObjectTree, "QuickInput", this._container, new QuickInputItemDelegate(), [this._itemRenderer, this._separatorRenderer], { + filter: { + filter(element) { + return element.hidden ? 0 : element instanceof QuickPickSeparatorElement ? 2 : 1; + } + }, + sorter: { + compare: (element, otherElement) => { + if (!this.sortByLabel || !this._lastQueryString) { + return 0; + } + const normalizedSearchValue = this._lastQueryString.toLowerCase(); + return compareEntries(element, otherElement, normalizedSearchValue); + } + }, + accessibilityProvider: new QuickInputAccessibilityProvider(), + setRowLineHeight: false, + multipleSelectionSupport: false, + hideTwistiesOfChildlessElements: true, + renderIndentGuides: RenderIndentGuides.None, + findWidgetEnabled: false, + indent: 0, + horizontalScrolling: false, + allowNonCollapsibleParents: true, + alwaysConsumeMouseWheel: true + })); + this._tree.getHTMLElement().id = id; + this._registerListeners(); + } + //#region public getters/setters + get onDidChangeFocus() { + return Event.map(this._tree.onDidChangeFocus, (e) => e.elements.filter((e2) => e2 instanceof QuickPickItemElement).map((e2) => e2.item), this._store); + } + get onDidChangeSelection() { + return Event.map(this._tree.onDidChangeSelection, (e) => ({ + items: e.elements.filter((e2) => e2 instanceof QuickPickItemElement).map((e2) => e2.item), + event: e.browserEvent + }), this._store); + } + get displayed() { + return this._container.style.display !== "none"; + } + set displayed(value) { + this._container.style.display = value ? "" : "none"; + } + get scrollTop() { + return this._tree.scrollTop; + } + set scrollTop(scrollTop) { + this._tree.scrollTop = scrollTop; + } + get ariaLabel() { + return this._tree.ariaLabel; + } + set ariaLabel(label) { + this._tree.ariaLabel = label ?? ""; + } + set enabled(value) { + this._tree.getHTMLElement().style.pointerEvents = value ? "" : "none"; + } + get matchOnDescription() { + return this._matchOnDescription; + } + set matchOnDescription(value) { + this._matchOnDescription = value; + } + get matchOnDetail() { + return this._matchOnDetail; + } + set matchOnDetail(value) { + this._matchOnDetail = value; + } + get matchOnLabel() { + return this._matchOnLabel; + } + set matchOnLabel(value) { + this._matchOnLabel = value; + } + get matchOnLabelMode() { + return this._matchOnLabelMode; + } + set matchOnLabelMode(value) { + this._matchOnLabelMode = value; + } + get sortByLabel() { + return this._sortByLabel; + } + set sortByLabel(value) { + this._sortByLabel = value; + } + get shouldLoop() { + return this._shouldLoop; + } + set shouldLoop(value) { + this._shouldLoop = value; + } + //#endregion + //#region register listeners + _registerListeners() { + this._registerOnKeyDown(); + this._registerOnContainerClick(); + this._registerOnMouseMiddleClick(); + this._registerOnTreeModelChanged(); + this._registerOnElementChecked(); + this._registerOnContextMenu(); + this._registerHoverListeners(); + this._registerSelectionChangeListener(); + this._registerSeparatorActionShowingListeners(); + } + _registerOnKeyDown() { + this._register(this._tree.onKeyDown((e) => { + const event = new StandardKeyboardEvent(e); + switch (event.keyCode) { + case 10: + this.toggleCheckbox(); + break; + } + this._onKeyDown.fire(event); + })); + } + _registerOnContainerClick() { + this._register(addDisposableListener(this._container, EventType.CLICK, (e) => { + if (e.x || e.y) { + this._onLeave.fire(); + } + })); + } + _registerOnMouseMiddleClick() { + this._register(addDisposableListener(this._container, EventType.AUXCLICK, (e) => { + if (e.button === 1) { + this._onLeave.fire(); + } + })); + } + _registerOnTreeModelChanged() { + this._register(this._tree.onDidChangeModel(() => { + const visibleCount = this._itemElements.filter((e) => !e.hidden).length; + this._visibleCountObservable.set(visibleCount, void 0); + if (this._hasCheckboxes) { + this._updateCheckedObservables(); + } + })); + } + _registerOnElementChecked() { + this._register(this._elementCheckedEventBufferer.wrapEvent(this._elementChecked.event, (_, e) => e)((_) => this._updateCheckedObservables())); + } + _registerOnContextMenu() { + this._register(this._tree.onContextMenu((e) => { + if (e.element) { + e.browserEvent.preventDefault(); + this._tree.setSelection([e.element]); + } + })); + } + _registerHoverListeners() { + const delayer3 = this._register(new ThrottledDelayer(typeof this.hoverDelegate.delay === "function" ? this.hoverDelegate.delay() : this.hoverDelegate.delay)); + this._register(this._tree.onMouseOver(async (e) => { + if (isHTMLAnchorElement(e.browserEvent.target)) { + delayer3.cancel(); + return; + } + if ( + // anchors are an exception as called out above so we skip them here + !isHTMLAnchorElement(e.browserEvent.relatedTarget) && // check if the mouse is still over the same element + isAncestor(e.browserEvent.relatedTarget, e.element?.element) + ) { + return; + } + try { + await delayer3.trigger(async () => { + if (e.element instanceof QuickPickItemElement) { + this.showHover(e.element); + } + }); + } catch (e2) { + if (!isCancellationError(e2)) { + throw e2; + } + } + })); + this._register(this._tree.onMouseOut((e) => { + if (isAncestor(e.browserEvent.relatedTarget, e.element?.element)) { + return; + } + delayer3.cancel(); + })); + } + /** + * Register's focus change and mouse events so that we can track when items inside of a + * separator's section are focused or hovered so that we can display the separator's actions + */ + _registerSeparatorActionShowingListeners() { + this._register(this._tree.onDidChangeFocus((e) => { + const parent = e.elements[0] ? this._tree.getParentElement(e.elements[0]) : null; + for (const separator2 of this._separatorRenderer.visibleSeparators) { + const value = separator2 === parent; + const currentActive = !!(separator2.focusInsideSeparator & QuickPickSeparatorFocusReason.ACTIVE_ITEM); + if (currentActive !== value) { + if (value) { + separator2.focusInsideSeparator |= QuickPickSeparatorFocusReason.ACTIVE_ITEM; + } else { + separator2.focusInsideSeparator &= ~QuickPickSeparatorFocusReason.ACTIVE_ITEM; + } + this._tree.rerender(separator2); + } + } + })); + this._register(this._tree.onMouseOver((e) => { + const parent = e.element ? this._tree.getParentElement(e.element) : null; + for (const separator2 of this._separatorRenderer.visibleSeparators) { + if (separator2 !== parent) { + continue; + } + const currentMouse = !!(separator2.focusInsideSeparator & QuickPickSeparatorFocusReason.MOUSE_HOVER); + if (!currentMouse) { + separator2.focusInsideSeparator |= QuickPickSeparatorFocusReason.MOUSE_HOVER; + this._tree.rerender(separator2); + } + } + })); + this._register(this._tree.onMouseOut((e) => { + const parent = e.element ? this._tree.getParentElement(e.element) : null; + for (const separator2 of this._separatorRenderer.visibleSeparators) { + if (separator2 !== parent) { + continue; + } + const currentMouse = !!(separator2.focusInsideSeparator & QuickPickSeparatorFocusReason.MOUSE_HOVER); + if (currentMouse) { + separator2.focusInsideSeparator &= ~QuickPickSeparatorFocusReason.MOUSE_HOVER; + this._tree.rerender(separator2); + } + } + })); + } + _registerSelectionChangeListener() { + this._register(this._tree.onDidChangeSelection((e) => { + const elementsWithoutSeparators = e.elements.filter((e2) => e2 instanceof QuickPickItemElement); + if (elementsWithoutSeparators.length !== e.elements.length) { + if (e.elements.length === 1 && e.elements[0] instanceof QuickPickSeparatorElement) { + this._tree.setFocus([e.elements[0].children[0]]); + this._tree.reveal(e.elements[0], 0); + } + this._tree.setSelection(elementsWithoutSeparators); + } + })); + } + //#endregion + //#region public methods + setAllVisibleChecked(checked) { + this._elementCheckedEventBufferer.bufferEvents(() => { + this._itemElements.forEach((element) => { + if (!element.hidden && !element.checkboxDisabled && element.item.pickable !== false) { + element.checked = checked; + } + }); + }); + } + setElements(inputElements) { + this._elementDisposable.clear(); + this._lastQueryString = void 0; + this._inputElements = inputElements; + this._hasCheckboxes = this.parent.classList.contains("show-checkboxes"); + let currentSeparatorElement; + this._itemElements = new Array(); + this._elementTree = inputElements.reduce((result, item, index) => { + let element; + if (item.type === "separator") { + if (!item.buttons) { + return result; + } + currentSeparatorElement = new QuickPickSeparatorElement(index, (e) => this._onSeparatorButtonTriggered.fire(e), item); + element = currentSeparatorElement; + } else { + const previous = index > 0 ? inputElements[index - 1] : void 0; + let separator2; + if (previous && previous.type === "separator" && !previous.buttons) { + separator2 = previous; + } + const qpi = new QuickPickItemElement(index, currentSeparatorElement?.children ? currentSeparatorElement.children.length : index, this._hasCheckboxes && item.pickable !== false, (e) => this._onButtonTriggered.fire(e), this._elementChecked, item, separator2); + this._itemElements.push(qpi); + if (currentSeparatorElement) { + currentSeparatorElement.children.push(qpi); + return result; + } + element = qpi; + } + result.push(element); + return result; + }, new Array()); + this._setElementsToTree(this._elementTree); + if (this.accessibilityService.isScreenReaderOptimized()) { + setTimeout(() => { + const focusedElement = this._tree.getHTMLElement().querySelector(`.monaco-list-row.focused`); + const parent = focusedElement?.parentNode; + if (focusedElement && parent) { + const nextSibling = focusedElement.nextSibling; + focusedElement.remove(); + parent.insertBefore(focusedElement, nextSibling); + } + }, 0); + } + } + setFocusedElements(items) { + const elements = items.map((item) => this._itemElements.find((e) => e.item === item)).filter((e) => !!e).filter((e) => !e.hidden); + this._tree.setFocus(elements); + if (items.length > 0) { + const focused = this._tree.getFocus()[0]; + if (focused) { + this._tree.reveal(focused); + } + } + } + getActiveDescendant() { + return this._tree.getHTMLElement().getAttribute("aria-activedescendant"); + } + setSelectedElements(items) { + const elements = items.map((item) => this._itemElements.find((e) => e.item === item)).filter((e) => !!e); + this._tree.setSelection(elements); + } + getCheckedElements() { + return this._itemElements.filter((e) => e.checked).map((e) => e.item); + } + setCheckedElements(items) { + this._elementCheckedEventBufferer.bufferEvents(() => { + const checked = /* @__PURE__ */ new Set(); + for (const item of items) { + checked.add(item); + } + for (const element of this._itemElements) { + element.checked = checked.has(element.item); + } + }); + } + focus(what) { + if (!this._itemElements.length) { + return; + } + if (what === QuickPickFocus.Second && this._itemElements.length < 2) { + what = QuickPickFocus.First; + } + switch (what) { + case QuickPickFocus.First: + this._tree.scrollTop = 0; + this._tree.focusFirst(void 0, (e) => e.element instanceof QuickPickItemElement); + break; + case QuickPickFocus.Second: { + this._tree.scrollTop = 0; + let isSecondItem = false; + this._tree.focusFirst(void 0, (e) => { + if (!(e.element instanceof QuickPickItemElement)) { + return false; + } + if (isSecondItem) { + return true; + } + isSecondItem = !isSecondItem; + return false; + }); + break; + } + case QuickPickFocus.Last: + this._tree.scrollTop = this._tree.scrollHeight; + this._tree.focusLast(void 0, (e) => e.element instanceof QuickPickItemElement); + break; + case QuickPickFocus.Next: { + const prevFocus = this._tree.getFocus(); + this._tree.focusNext(void 0, this._shouldLoop, void 0, (e) => { + if (!(e.element instanceof QuickPickItemElement)) { + return false; + } + this._tree.reveal(e.element); + return true; + }); + const currentFocus = this._tree.getFocus(); + if (prevFocus.length && prevFocus[0] === currentFocus[0]) { + this._onLeave.fire(); + } + break; + } + case QuickPickFocus.Previous: { + const prevFocus = this._tree.getFocus(); + this._tree.focusPrevious(void 0, this._shouldLoop, void 0, (e) => { + if (!(e.element instanceof QuickPickItemElement)) { + return false; + } + const parent = this._tree.getParentElement(e.element); + if (parent === null || parent.children[0] !== e.element) { + this._tree.reveal(e.element); + } else { + this._tree.reveal(parent); + } + return true; + }); + const currentFocus = this._tree.getFocus(); + if (prevFocus.length && prevFocus[0] === currentFocus[0]) { + this._onLeave.fire(); + } + break; + } + case QuickPickFocus.NextPage: + this._tree.focusNextPage(void 0, (e) => { + if (!(e.element instanceof QuickPickItemElement)) { + return false; + } + this._tree.reveal(e.element); + return true; + }); + break; + case QuickPickFocus.PreviousPage: + this._tree.focusPreviousPage(void 0, (e) => { + if (!(e.element instanceof QuickPickItemElement)) { + return false; + } + const parent = this._tree.getParentElement(e.element); + if (parent === null || parent.children[0] !== e.element) { + this._tree.reveal(e.element); + } else { + this._tree.reveal(parent); + } + return true; + }); + break; + case QuickPickFocus.NextSeparator: { + let foundSeparatorAsItem = false; + const before = this._tree.getFocus()[0]; + this._tree.focusNext(void 0, true, void 0, (e) => { + if (foundSeparatorAsItem) { + return true; + } + if (e.element instanceof QuickPickSeparatorElement) { + foundSeparatorAsItem = true; + if (this._separatorRenderer.isSeparatorVisible(e.element)) { + this._tree.reveal(e.element.children[0]); + } else { + this._tree.reveal(e.element, 0); + } + } else if (e.element instanceof QuickPickItemElement) { + if (e.element.separator) { + if (this._itemRenderer.isItemWithSeparatorVisible(e.element)) { + this._tree.reveal(e.element); + } else { + this._tree.reveal(e.element, 0); + } + return true; + } else if (e.element === this._elementTree[0]) { + this._tree.reveal(e.element, 0); + return true; + } + } + return false; + }); + const after2 = this._tree.getFocus()[0]; + if (before === after2) { + this._tree.scrollTop = this._tree.scrollHeight; + this._tree.focusLast(void 0, (e) => e.element instanceof QuickPickItemElement); + } + break; + } + case QuickPickFocus.PreviousSeparator: { + let focusElement; + let foundSeparator = !!this._tree.getFocus()[0]?.separator; + this._tree.focusPrevious(void 0, true, void 0, (e) => { + if (e.element instanceof QuickPickSeparatorElement) { + if (foundSeparator) { + if (!focusElement) { + if (this._separatorRenderer.isSeparatorVisible(e.element)) { + this._tree.reveal(e.element); + } else { + this._tree.reveal(e.element, 0); + } + focusElement = e.element.children[0]; + } + } else { + foundSeparator = true; + } + } else if (e.element instanceof QuickPickItemElement) { + if (!focusElement) { + if (e.element.separator) { + if (this._itemRenderer.isItemWithSeparatorVisible(e.element)) { + this._tree.reveal(e.element); + } else { + this._tree.reveal(e.element, 0); + } + focusElement = e.element; + } else if (e.element === this._elementTree[0]) { + this._tree.reveal(e.element, 0); + return true; + } + } + } + return false; + }); + if (focusElement) { + this._tree.setFocus([focusElement]); + } + break; + } + } + } + clearFocus() { + this._tree.setFocus([]); + } + domFocus() { + this._tree.domFocus(); + } + layout(maxHeight) { + this._tree.getHTMLElement().style.maxHeight = maxHeight ? `${// Make sure height aligns with list item heights + Math.floor(maxHeight / 44) * 44 + 6}px` : ""; + this._tree.layout(); + } + filter(query) { + this._lastQueryString = query; + if (!(this._sortByLabel || this._matchOnLabel || this._matchOnDescription || this._matchOnDetail)) { + this._tree.layout(); + return false; + } + const queryWithWhitespace = query; + query = query.trim(); + if (!query || !(this.matchOnLabel || this.matchOnDescription || this.matchOnDetail)) { + this._itemElements.forEach((element) => { + element.labelHighlights = void 0; + element.descriptionHighlights = void 0; + element.detailHighlights = void 0; + element.hidden = false; + const previous = element.index && this._inputElements[element.index - 1]; + if (element.item) { + element.separator = previous && previous.type === "separator" && !previous.buttons ? previous : void 0; + } + }); + } else { + let currentSeparator; + this._itemElements.forEach((element) => { + let labelHighlights; + if (this.matchOnLabelMode === "fuzzy") { + labelHighlights = this.matchOnLabel ? matchesFuzzyIconAware(query, parseLabelWithIcons(element.saneLabel)) ?? void 0 : void 0; + } else { + labelHighlights = this.matchOnLabel ? matchesContiguousIconAware(queryWithWhitespace, parseLabelWithIcons(element.saneLabel)) ?? void 0 : void 0; + } + const descriptionHighlights = this.matchOnDescription ? matchesFuzzyIconAware(query, parseLabelWithIcons(element.saneDescription || "")) ?? void 0 : void 0; + const detailHighlights = this.matchOnDetail ? matchesFuzzyIconAware(query, parseLabelWithIcons(element.saneDetail || "")) ?? void 0 : void 0; + if (labelHighlights || descriptionHighlights || detailHighlights) { + element.labelHighlights = labelHighlights; + element.descriptionHighlights = descriptionHighlights; + element.detailHighlights = detailHighlights; + element.hidden = false; + } else { + element.labelHighlights = void 0; + element.descriptionHighlights = void 0; + element.detailHighlights = void 0; + element.hidden = element.item ? !element.item.alwaysShow : true; + } + if (element.item) { + element.separator = void 0; + } else if (element.separator) { + element.hidden = true; + } + if (!this.sortByLabel) { + const previous = element.index && this._inputElements[element.index - 1] || void 0; + if (previous?.type === "separator" && !previous.buttons) { + currentSeparator = previous; + } + if (currentSeparator && !element.hidden) { + element.separator = currentSeparator; + currentSeparator = void 0; + } + } + }); + } + this._setElementsToTree(this._sortByLabel && query ? this._itemElements : this._elementTree); + this._tree.layout(); + return true; + } + toggleCheckbox() { + this._elementCheckedEventBufferer.bufferEvents(() => { + const elements = this._tree.getFocus().filter((e) => e instanceof QuickPickItemElement); + const allChecked = this._allVisibleChecked(elements); + for (const element of elements) { + if (!element.checkboxDisabled) { + element.checked = !allChecked; + } + } + }); + } + style(styles) { + this._tree.style(styles); + } + toggleHover() { + const focused = this._tree.getFocus()[0]; + if (!focused?.saneTooltip || !(focused instanceof QuickPickItemElement)) { + return; + } + if (this._lastHover && !this._lastHover.isDisposed) { + this._lastHover.dispose(); + return; + } + this.showHover(focused); + const store = new DisposableStore(); + store.add(this._tree.onDidChangeFocus((e) => { + if (e.elements[0] instanceof QuickPickItemElement) { + this.showHover(e.elements[0]); + } + })); + if (this._lastHover) { + store.add(this._lastHover); + } + this._elementDisposable.add(store); + } + //#endregion + //#region private methods + _setElementsToTree(elements) { + const treeElements = new Array(); + for (const element of elements) { + if (element instanceof QuickPickSeparatorElement) { + treeElements.push({ + element, + collapsible: false, + collapsed: false, + children: element.children.map((e) => ({ + element: e, + collapsible: false, + collapsed: false + })) + }); + } else { + treeElements.push({ + element, + collapsible: false, + collapsed: false + }); + } + } + this._tree.setChildren(null, treeElements); + } + _allVisibleChecked(elements, whenNoneVisible = true) { + for (let i2 = 0, n2 = elements.length; i2 < n2; i2++) { + const element = elements[i2]; + if (!element.hidden && element.item.pickable !== false) { + if (!element.checked) { + return false; + } else { + whenNoneVisible = true; + } + } + } + return whenNoneVisible; + } + _updateCheckedObservables() { + transaction((tx) => { + this._allVisibleCheckedObservable.set(this._allVisibleChecked(this._itemElements, false), tx); + const checkedCount = this._itemElements.filter((element) => element.checked).length; + this._checkedCountObservable.set(checkedCount, tx); + this._checkedElementsObservable.set(this.getCheckedElements(), tx); + }); + } + /** + * Disposes of the hover and shows a new one for the given index if it has a tooltip. + * @param element The element to show the hover for + */ + showHover(element) { + if (this._lastHover && !this._lastHover.isDisposed) { + this.hoverDelegate.onDidHideHover?.(); + this._lastHover?.dispose(); + } + if (!element.element || !element.saneTooltip) { + return; + } + this._lastHover = this.hoverDelegate.showHover({ + content: element.saneTooltip, + target: element.element, + linkHandler: (url) => { + this.linkOpenerDelegate(url); + }, + appearance: { + showPointer: true + }, + container: this._container, + position: { + hoverPosition: 1 + /* HoverPosition.RIGHT */ + } + }, false); + } +}; +__decorate183([ + memoize +], QuickInputList.prototype, "onDidChangeFocus", null); +__decorate183([ + memoize +], QuickInputList.prototype, "onDidChangeSelection", null); +QuickInputList = __decorate183([ + __param176(4, IInstantiationService), + __param176(5, IAccessibilityService) +], QuickInputList); +function matchesContiguousIconAware(query, target) { + const { text: text2, iconOffsets } = target; + if (!iconOffsets || iconOffsets.length === 0) { + return matchesContiguous(query, text2); + } + const wordToMatchAgainstWithoutIconsTrimmed = ltrim(text2, " "); + const leadingWhitespaceOffset = text2.length - wordToMatchAgainstWithoutIconsTrimmed.length; + const matches = matchesContiguous(query, wordToMatchAgainstWithoutIconsTrimmed); + if (matches) { + for (const match2 of matches) { + const iconOffset = iconOffsets[match2.start + leadingWhitespaceOffset] + leadingWhitespaceOffset; + match2.start += iconOffset; + match2.end += iconOffset; + } + } + return matches; +} +function matchesContiguous(word, wordToMatchAgainst) { + const matchIndex = wordToMatchAgainst.toLowerCase().indexOf(word.toLowerCase()); + if (matchIndex !== -1) { + return [{ start: matchIndex, end: matchIndex + word.length }]; + } + return null; +} +function compareEntries(elementA, elementB, lookFor) { + const labelHighlightsA = elementA.labelHighlights || []; + const labelHighlightsB = elementB.labelHighlights || []; + if (labelHighlightsA.length && !labelHighlightsB.length) { + return -1; + } + if (!labelHighlightsA.length && labelHighlightsB.length) { + return 1; + } + if (labelHighlightsA.length === 0 && labelHighlightsB.length === 0) { + return 0; + } + return compareAnything(elementA.saneSortLabel, elementB.saneSortLabel, lookFor); +} + +// node_modules/monaco-editor-core/esm/vs/platform/quickinput/browser/quickInputController.js +init_contextkey(); + +// node_modules/monaco-editor-core/esm/vs/platform/quickinput/browser/quickInputActions.js +init_platform(); +init_nls(); +init_contextkey(); +init_keybindingsRegistry(); +function registerQuickInputCommandAndKeybindingRule(rule, options2 = {}) { + KeybindingsRegistry.registerCommandAndKeybindingRule({ + weight: 200, + when: inQuickInputContext, + metadata: { description: localize(1758, "Used while in the context of any kind of quick input. If you change one keybinding for this command, you should change all of the other keybindings (modifier variants) of this command as well.") }, + ...rule, + secondary: getSecondary(rule.primary, rule.secondary ?? [], options2) + }); +} +function registerQuickPickCommandAndKeybindingRule(rule, options2 = {}) { + KeybindingsRegistry.registerCommandAndKeybindingRule({ + weight: 200, + when: ContextKeyExpr.and(ContextKeyExpr.or( + // Only things that use Tree widgets + ContextKeyExpr.equals( + quickInputTypeContextKeyValue, + "quickPick" + /* QuickInputType.QuickPick */ + ), + ContextKeyExpr.equals( + quickInputTypeContextKeyValue, + "quickTree" + /* QuickInputType.QuickTree */ + ) + ), inQuickInputContext), + metadata: { description: localize(1759, "Used while in the context of the quick pick. If you change one keybinding for this command, you should change all of the other keybindings (modifier variants) of this command as well.") }, + ...rule, + secondary: getSecondary(rule.primary, rule.secondary ?? [], options2) + }); +} +var ctrlKeyMod3 = isMacintosh ? 256 : 2048; +function getSecondary(primary, secondary, options2 = {}) { + if (options2.withAltMod) { + secondary.push(512 + primary); + } + if (options2.withCtrlMod) { + secondary.push(ctrlKeyMod3 + primary); + if (options2.withAltMod) { + secondary.push(512 + ctrlKeyMod3 + primary); + } + } + if (options2.withCmdMod && isMacintosh) { + secondary.push(2048 + primary); + if (options2.withCtrlMod) { + secondary.push(2048 + 256 + primary); + } + if (options2.withAltMod) { + secondary.push(2048 + 512 + primary); + if (options2.withCtrlMod) { + secondary.push(2048 + 512 + 256 + primary); + } + } + } + return secondary; +} +function focusHandler(focus, focusOnQuickNatigate) { + return (accessor) => { + const currentQuickPick = accessor.get(IQuickInputService).currentQuickInput; + if (!currentQuickPick) { + return; + } + if (focusOnQuickNatigate && currentQuickPick.quickNavigate) { + return currentQuickPick.focus(focusOnQuickNatigate); + } + return currentQuickPick.focus(focus); + }; +} +registerQuickPickCommandAndKeybindingRule({ id: "quickInput.pageNext", primary: 12, handler: focusHandler(QuickPickFocus.NextPage) }, { withAltMod: true, withCtrlMod: true, withCmdMod: true }); +registerQuickPickCommandAndKeybindingRule({ id: "quickInput.pagePrevious", primary: 11, handler: focusHandler(QuickPickFocus.PreviousPage) }, { withAltMod: true, withCtrlMod: true, withCmdMod: true }); +registerQuickPickCommandAndKeybindingRule({ id: "quickInput.first", primary: ctrlKeyMod3 + 14, handler: focusHandler(QuickPickFocus.First) }, { withAltMod: true, withCmdMod: true }); +registerQuickPickCommandAndKeybindingRule({ id: "quickInput.last", primary: ctrlKeyMod3 + 13, handler: focusHandler(QuickPickFocus.Last) }, { withAltMod: true, withCmdMod: true }); +registerQuickPickCommandAndKeybindingRule({ id: "quickInput.next", primary: 18, handler: focusHandler(QuickPickFocus.Next) }, { withCtrlMod: true }); +registerQuickPickCommandAndKeybindingRule({ id: "quickInput.previous", primary: 16, handler: focusHandler(QuickPickFocus.Previous) }, { withCtrlMod: true }); +var nextSeparatorFallbackDesc = localize(1760, "If we're in quick access mode, this will navigate to the next item. If we are not in quick access mode, this will navigate to the next separator."); +var prevSeparatorFallbackDesc = localize(1761, "If we're in quick access mode, this will navigate to the previous item. If we are not in quick access mode, this will navigate to the previous separator."); +if (isMacintosh) { + registerQuickPickCommandAndKeybindingRule({ + id: "quickInput.nextSeparatorWithQuickAccessFallback", + primary: 2048 + 18, + handler: focusHandler(QuickPickFocus.NextSeparator, QuickPickFocus.Next), + metadata: { description: nextSeparatorFallbackDesc } + }); + registerQuickPickCommandAndKeybindingRule({ + id: "quickInput.nextSeparator", + primary: 2048 + 512 + 18, + // Since macOS has the cmd key as the primary modifier, we need to add this additional + // keybinding to capture cmd+ctrl+upArrow + secondary: [ + 2048 + 256 + 18 + /* KeyCode.DownArrow */ + ], + handler: focusHandler(QuickPickFocus.NextSeparator) + }, { withCtrlMod: true }); + registerQuickPickCommandAndKeybindingRule({ + id: "quickInput.previousSeparatorWithQuickAccessFallback", + primary: 2048 + 16, + handler: focusHandler(QuickPickFocus.PreviousSeparator, QuickPickFocus.Previous), + metadata: { description: prevSeparatorFallbackDesc } + }); + registerQuickPickCommandAndKeybindingRule({ + id: "quickInput.previousSeparator", + primary: 2048 + 512 + 16, + // Since macOS has the cmd key as the primary modifier, we need to add this additional + // keybinding to capture cmd+ctrl+upArrow + secondary: [ + 2048 + 256 + 16 + /* KeyCode.UpArrow */ + ], + handler: focusHandler(QuickPickFocus.PreviousSeparator) + }, { withCtrlMod: true }); +} else { + registerQuickPickCommandAndKeybindingRule({ + id: "quickInput.nextSeparatorWithQuickAccessFallback", + primary: 512 + 18, + handler: focusHandler(QuickPickFocus.NextSeparator, QuickPickFocus.Next), + metadata: { description: nextSeparatorFallbackDesc } + }); + registerQuickPickCommandAndKeybindingRule({ + id: "quickInput.nextSeparator", + primary: 2048 + 512 + 18, + handler: focusHandler(QuickPickFocus.NextSeparator) + }); + registerQuickPickCommandAndKeybindingRule({ + id: "quickInput.previousSeparatorWithQuickAccessFallback", + primary: 512 + 16, + handler: focusHandler(QuickPickFocus.PreviousSeparator, QuickPickFocus.Previous), + metadata: { description: prevSeparatorFallbackDesc } + }); + registerQuickPickCommandAndKeybindingRule({ + id: "quickInput.previousSeparator", + primary: 2048 + 512 + 16, + handler: focusHandler(QuickPickFocus.PreviousSeparator) + }); +} +KeybindingsRegistry.registerCommandAndKeybindingRule({ + id: "quickInput.accept", + primary: 3, + weight: 200, + when: ContextKeyExpr.and( + // All other kinds of Quick things handle Accept, except Widget. In other words, Accepting is a detail on the things + // that extend IQuickInput + ContextKeyExpr.notEquals( + quickInputTypeContextKeyValue, + "quickWidget" + /* QuickInputType.QuickWidget */ + ), + inQuickInputContext, + ContextKeyExpr.not("isComposing") + ), + metadata: { description: localize(1762, "Used while in the context of some quick input. If you change one keybinding for this command, you should change all of the other keybindings (modifier variants) of this command as well.") }, + handler: (accessor) => { + const currentQuickPick = accessor.get(IQuickInputService).currentQuickInput; + currentQuickPick?.accept(); + }, + secondary: getSecondary(3, [], { withAltMod: true, withCtrlMod: true, withCmdMod: true }) +}); +registerQuickPickCommandAndKeybindingRule({ + id: "quickInput.acceptInBackground", + // If we are in the quick pick but the input box is not focused or our cursor is at the end of the input box + when: ContextKeyExpr.and(inQuickInputContext, ContextKeyExpr.equals( + quickInputTypeContextKeyValue, + "quickPick" + /* QuickInputType.QuickPick */ + ), ContextKeyExpr.or(InputFocusedContext.negate(), endOfQuickInputBoxContext)), + primary: 17, + // Need a little extra weight to ensure this keybinding is preferred over the default cmd+alt+right arrow keybinding + // https://github.com/microsoft/vscode/blob/1451e4fbbbf074a4355cc537c35b547b80ce1c52/src/vs/workbench/browser/parts/editor/editorActions.ts#L1178-L1195 + weight: 200 + 50, + handler: (accessor) => { + const currentQuickPick = accessor.get(IQuickInputService).currentQuickInput; + currentQuickPick?.accept(true); + } +}, { withAltMod: true, withCtrlMod: true, withCmdMod: true }); +registerQuickInputCommandAndKeybindingRule({ + id: "quickInput.hide", + primary: 9, + handler: (accessor) => { + const currentQuickPick = accessor.get(IQuickInputService).currentQuickInput; + currentQuickPick?.hide(); + } +}, { withAltMod: true, withCtrlMod: true, withCmdMod: true }); +registerQuickPickCommandAndKeybindingRule({ + id: "quickInput.toggleHover", + primary: ctrlKeyMod3 | 10, + handler: (accessor) => { + const quickInputService = accessor.get(IQuickInputService); + quickInputService.toggleHover(); + } +}); +if (isMacintosh) { + registerQuickPickCommandAndKeybindingRule({ id: "quickInput.Next", primary: 256 + 44, handler: focusHandler(QuickPickFocus.Next) }); + registerQuickPickCommandAndKeybindingRule({ id: "quickInput.Previous", primary: 256 + 46, handler: focusHandler(QuickPickFocus.Previous) }); +} + +// node_modules/monaco-editor-core/esm/vs/platform/quickinput/browser/quickInputController.js +init_observable(); +init_mouseEvent(); +init_configuration(); +init_platform(); +init_browser(); + +// node_modules/monaco-editor-core/esm/vs/platform/quickinput/browser/tree/quickInputTreeController.js +init_dom(); +init_event(); +init_lifecycle(); +init_instantiation(); + +// node_modules/monaco-editor-core/esm/vs/platform/quickinput/browser/tree/quickInputTreeRenderer.js +init_dom(); +init_event(); +init_lifecycle(); +init_uri(); +init_theme(); +init_strings(); +init_themeService(); +var __decorate184 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param177 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var QuickInputTreeRenderer_1; +var $20 = $; +var QuickInputTreeRenderer = class QuickInputTreeRenderer2 extends Disposable { + static { + QuickInputTreeRenderer_1 = this; + } + static { + this.ID = "quickInputTreeElement"; + } + constructor(_hoverDelegate, _buttonTriggeredEmitter, onCheckedEvent, _themeService) { + super(); + this._hoverDelegate = _hoverDelegate; + this._buttonTriggeredEmitter = _buttonTriggeredEmitter; + this.onCheckedEvent = onCheckedEvent; + this._themeService = _themeService; + this.templateId = QuickInputTreeRenderer_1.ID; + } + renderTemplate(container) { + const store = new DisposableStore(); + const entry = append(container, $20(".quick-input-tree-entry")); + const checkbox = store.add(new TriStateCheckbox("", false, { ...defaultCheckboxStyles, size: 15 })); + entry.appendChild(checkbox.domNode); + const checkboxLabel = append(entry, $20("label.quick-input-tree-label")); + const rows = append(checkboxLabel, $20(".quick-input-tree-rows")); + const row1 = append(rows, $20(".quick-input-tree-row")); + const icon = prepend(row1, $20(".quick-input-tree-icon")); + const label = store.add(new IconLabel(row1, { + supportHighlights: true, + supportDescriptionHighlights: true, + supportIcons: true, + hoverDelegate: this._hoverDelegate + })); + const actionBar2 = store.add(new ActionBar(entry, this._hoverDelegate ? { hoverDelegate: this._hoverDelegate } : void 0)); + actionBar2.domNode.classList.add("quick-input-tree-entry-action-bar"); + return { + toDisposeTemplate: store, + entry, + checkbox, + icon, + label, + actionBar: actionBar2, + toDisposeElement: new DisposableStore() + }; + } + renderElement(node, index, templateData, _details) { + const store = templateData.toDisposeElement; + const quickTreeItem = node.element; + if (quickTreeItem.pickable === false) { + templateData.checkbox.domNode.style.display = "none"; + } else { + templateData.checkbox.domNode.style.display = ""; + templateData.checkbox.checked = quickTreeItem.checked ?? false; + store.add(Event.filter(this.onCheckedEvent, (e) => e.item === quickTreeItem)((e) => templateData.checkbox.checked = e.checked)); + if (quickTreeItem.disabled) { + templateData.checkbox.disable(); + } + } + if (quickTreeItem.iconPath) { + const icon = isDark(this._themeService.getColorTheme().type) ? quickTreeItem.iconPath.dark : quickTreeItem.iconPath.light ?? quickTreeItem.iconPath.dark; + const iconUrl = URI.revive(icon); + templateData.icon.className = "quick-input-tree-icon"; + templateData.icon.style.backgroundImage = asCSSUrl(iconUrl); + } else { + templateData.icon.style.backgroundImage = ""; + templateData.icon.className = quickTreeItem.iconClass ? `quick-input-tree-icon ${quickTreeItem.iconClass}` : ""; + } + const { labelHighlights: matches, descriptionHighlights: descriptionMatches } = node.filterData || {}; + let descriptionTitle; + if (quickTreeItem.description) { + descriptionTitle = { + markdown: { + value: escape(quickTreeItem.description), + supportThemeIcons: true + }, + markdownNotSupportedFallback: quickTreeItem.description + }; + } + templateData.label.setLabel(quickTreeItem.label, quickTreeItem.description, { + matches, + descriptionMatches, + extraClasses: quickTreeItem.iconClasses, + italic: quickTreeItem.italic, + strikethrough: quickTreeItem.strikethrough, + labelEscapeNewLines: true, + descriptionTitle + }); + const buttons = quickTreeItem.buttons; + if (buttons && buttons.length) { + templateData.actionBar.push(buttons.map((button, index2) => quickInputButtonToAction(button, `tree-${index2}`, () => this._buttonTriggeredEmitter.fire({ item: quickTreeItem, button }))), { icon: true, label: false }); + templateData.entry.classList.add("has-actions"); + } else { + templateData.entry.classList.remove("has-actions"); + } + } + disposeElement(_element, _index, templateData, _details) { + templateData.toDisposeElement.clear(); + templateData.actionBar.clear(); + } + disposeTemplate(templateData) { + templateData.toDisposeElement.dispose(); + templateData.toDisposeTemplate.dispose(); + } +}; +QuickInputTreeRenderer = QuickInputTreeRenderer_1 = __decorate184([ + __param177(3, IThemeService) +], QuickInputTreeRenderer); + +// node_modules/monaco-editor-core/esm/vs/platform/quickinput/browser/tree/quickInputDelegate.js +var QuickInputTreeDelegate = class { + getHeight(_element) { + return 22; + } + getTemplateId(_element) { + return QuickInputTreeRenderer.ID; + } +}; + +// node_modules/monaco-editor-core/esm/vs/platform/quickinput/browser/tree/quickInputTree.js +function getParentNodeState(parentChildren) { + let containsChecks = false; + let containsUnchecks = false; + let containsMixed = false; + for (const element of parentChildren) { + switch (element.element?.checked) { + case "mixed": + containsMixed = true; + break; + case true: + containsChecks = true; + break; + default: + containsUnchecks = true; + break; + } + if (containsChecks && containsUnchecks && containsMixed) { + break; + } + } + const newState = containsUnchecks ? containsMixed ? "mixed" : containsChecks ? "mixed" : false : containsMixed ? "mixed" : containsChecks; + return newState; +} + +// node_modules/monaco-editor-core/esm/vs/platform/quickinput/browser/tree/quickInputTreeAccessibilityProvider.js +init_event(); +init_iconLabels(); +init_nls(); +var QuickTreeAccessibilityProvider = class { + constructor(onCheckedEvent) { + this.onCheckedEvent = onCheckedEvent; + } + getWidgetAriaLabel() { + return localize(1772, "Quick Tree"); + } + getAriaLabel(element) { + return element.ariaLabel || [element.label, element.description].map((s) => getCodiconAriaLabel(s)).filter((s) => !!s).join(", "); + } + getWidgetRole() { + return "tree"; + } + getRole(_element) { + return "checkbox"; + } + isChecked(element) { + return { + get value() { + return element.checked === "mixed" ? "mixed" : !!element.checked; + }, + onDidChange: (e) => Event.filter(this.onCheckedEvent, (e2) => e2.item === element)((_) => e()) + }; + } +}; + +// node_modules/monaco-editor-core/esm/vs/platform/quickinput/browser/tree/quickInputTreeFilter.js +init_iconLabels(); +var QuickInputTreeFilter = class { + constructor() { + this.filterValue = ""; + this.matchOnLabel = true; + this.matchOnDescription = false; + } + filter(element, parentVisibility) { + if (!this.filterValue || !(this.matchOnLabel || this.matchOnDescription)) { + return element.children ? { visibility: 2, data: {} } : { visibility: 1, data: {} }; + } + const labelHighlights = this.matchOnLabel ? matchesFuzzyIconAware(this.filterValue, parseLabelWithIcons(element.label)) ?? void 0 : void 0; + const descriptionHighlights = this.matchOnDescription ? matchesFuzzyIconAware(this.filterValue, parseLabelWithIcons(element.description || "")) ?? void 0 : void 0; + const visibility = parentVisibility === 1 ? 1 : labelHighlights || descriptionHighlights ? 1 : element.children ? 2 : 0; + return { + visibility, + data: { + labelHighlights, + descriptionHighlights + } + }; + } +}; + +// node_modules/monaco-editor-core/esm/vs/platform/quickinput/browser/tree/quickInputTreeSorter.js +init_lifecycle(); +var QuickInputTreeSorter = class extends Disposable { + constructor() { + super(...arguments); + this._sortByLabel = true; + } + get sortByLabel() { + return this._sortByLabel; + } + set sortByLabel(value) { + this._sortByLabel = value; + } + compare(a, b) { + if (!this._sortByLabel) { + return 0; + } + if (a.label < b.label) { + return -1; + } else if (a.label > b.label) { + return 1; + } + if (a.description && b.description) { + if (a.description < b.description) { + return -1; + } else if (a.description > b.description) { + return 1; + } + } else if (a.description) { + return -1; + } else if (b.description) { + return 1; + } + return 0; + } +}; + +// node_modules/monaco-editor-core/esm/vs/platform/quickinput/browser/tree/quickInputTreeController.js +var __decorate185 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param178 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var $21 = $; +var QuickInputTreeController = class QuickInputTreeController2 extends Disposable { + constructor(container, hoverDelegate, instantiationService) { + super(); + this.instantiationService = instantiationService; + this._onDidTriggerButton = this._register(new Emitter()); + this._onDidChangeCheckboxState = this._register(new Emitter()); + this.onDidChangeCheckboxState = this._onDidChangeCheckboxState.event; + this._onDidCheckedLeafItemsChange = this._register(new Emitter()); + this._onLeave = new Emitter(); + this.onLeave = this._onLeave.event; + this._onDidAccept = this._register(new Emitter()); + this.onDidAccept = this._onDidAccept.event; + this._container = append(container, $21(".quick-input-tree")); + this._renderer = this._register(this.instantiationService.createInstance(QuickInputTreeRenderer, hoverDelegate, this._onDidTriggerButton, this.onDidChangeCheckboxState)); + this._filter = this.instantiationService.createInstance(QuickInputTreeFilter); + this._sorter = this._register(new QuickInputTreeSorter()); + this._tree = this._register(this.instantiationService.createInstance(WorkbenchObjectTree, "QuickInputTree", this._container, new QuickInputTreeDelegate(), [this._renderer], { + accessibilityProvider: new QuickTreeAccessibilityProvider(this.onDidChangeCheckboxState), + horizontalScrolling: false, + multipleSelectionSupport: false, + findWidgetEnabled: false, + alwaysConsumeMouseWheel: true, + hideTwistiesOfChildlessElements: true, + renderIndentGuides: RenderIndentGuides.None, + expandOnDoubleClick: true, + expandOnlyOnTwistieClick: true, + disableExpandOnSpacebar: true, + sorter: this._sorter, + filter: this._filter + })); + this.registerOnOpenListener(); + } + get tree() { + return this._tree; + } + get displayed() { + return this._container.style.display !== "none"; + } + set displayed(value) { + this._container.style.display = value ? "" : "none"; + } + get sortByLabel() { + return this._sorter.sortByLabel; + } + set sortByLabel(value) { + this._sorter.sortByLabel = value; + this._tree.resort(null, true); + } + getActiveDescendant() { + return this._tree.getHTMLElement().getAttribute("aria-activedescendant"); + } + updateFilterOptions(options2) { + if (options2.matchOnLabel !== void 0) { + this._filter.matchOnLabel = options2.matchOnLabel; + } + if (options2.matchOnDescription !== void 0) { + this._filter.matchOnDescription = options2.matchOnDescription; + } + this._tree.refilter(); + } + layout(maxHeight) { + this._tree.getHTMLElement().style.maxHeight = maxHeight ? `${// Make sure height aligns with list item heights + Math.floor(maxHeight / 44) * 44 + 6}px` : ""; + this._tree.layout(); + } + registerOnOpenListener() { + this._register(this._tree.onDidOpen((e) => { + const item = e.element; + if (!item) { + return; + } + if (item.disabled) { + return; + } + if (item.pickable === false) { + this._tree.setFocus([item]); + this._onDidAccept.fire(); + return; + } + const newState = item.checked !== true; + if ((item.checked ?? false) === newState) { + return; + } + item.checked = newState; + this._tree.rerender(item); + const updateSet = /* @__PURE__ */ new Set(); + const toUpdate = [...this._tree.getNode(item).children]; + while (toUpdate.length) { + const pop = toUpdate.shift(); + if (pop?.element && !updateSet.has(pop.element)) { + updateSet.add(pop.element); + if ((pop.element.checked ?? false) !== item.checked) { + pop.element.checked = item.checked; + this._tree.rerender(pop.element); + } + toUpdate.push(...pop.children); + } + } + let parent = this._tree.getParentElement(item); + while (parent) { + const parentChildren = [...this._tree.getNode(parent).children]; + const newState2 = getParentNodeState(parentChildren); + if ((parent.checked ?? false) !== newState2) { + parent.checked = newState2; + this._tree.rerender(parent); + } + parent = this._tree.getParentElement(parent); + } + this._onDidChangeCheckboxState.fire({ + item, + checked: item.checked ?? false + }); + this._onDidCheckedLeafItemsChange.fire(this.getCheckedLeafItems()); + })); + } + getCheckedLeafItems() { + const lookedAt = /* @__PURE__ */ new Set(); + const toLookAt = [...this._tree.getNode().children]; + const checkedItems = new Array(); + while (toLookAt.length) { + const lookAt = toLookAt.shift(); + if (!lookAt?.element || lookedAt.has(lookAt.element)) { + continue; + } + if (lookAt.element.checked) { + lookedAt.add(lookAt.element); + toLookAt.push(...lookAt.children); + if (!lookAt.element.children) { + checkedItems.push(lookAt.element); + } + } + } + return checkedItems; + } +}; +QuickInputTreeController = __decorate185([ + __param178(2, IInstantiationService) +], QuickInputTreeController); + +// node_modules/monaco-editor-core/esm/vs/platform/quickinput/browser/quickInputController.js +var __decorate186 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param179 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var QuickInputController_1; +var $22 = $; +var VIEWSTATE_STORAGE_KEY = "workbench.quickInput.viewState"; +var QuickInputController = class QuickInputController2 extends Disposable { + static { + QuickInputController_1 = this; + } + static { + this.MAX_WIDTH = 600; + } + // Max total width of quick input widget + get currentQuickInput() { + return this.controller ?? void 0; + } + get container() { + return this._container; + } + constructor(options2, layoutService, instantiationService, contextKeyService, storageService) { + super(); + this.options = options2; + this.layoutService = layoutService; + this.instantiationService = instantiationService; + this.storageService = storageService; + this.enabled = true; + this.onDidAcceptEmitter = this._register(new Emitter()); + this.onDidCustomEmitter = this._register(new Emitter()); + this.onDidTriggerButtonEmitter = this._register(new Emitter()); + this.keyMods = { ctrlCmd: false, alt: false }; + this.controller = null; + this.onShowEmitter = this._register(new Emitter()); + this.onShow = this.onShowEmitter.event; + this.onHideEmitter = this._register(new Emitter()); + this.onHide = this.onHideEmitter.event; + this.inQuickInputContext = InQuickInputContextKey.bindTo(contextKeyService); + this.quickInputTypeContext = QuickInputTypeContextKey.bindTo(contextKeyService); + this.endOfQuickInputBoxContext = EndOfQuickInputBoxContextKey.bindTo(contextKeyService); + this.idPrefix = options2.idPrefix; + this._container = options2.container; + this.styles = options2.styles; + this._register(Event.runAndSubscribe(onDidRegisterWindow, ({ window: window2, disposables }) => this.registerKeyModsListeners(window2, disposables), { window: mainWindow, disposables: this._store })); + this._register(onWillUnregisterWindow((window2) => { + if (this.ui && getWindow(this.ui.container) === window2) { + this.reparentUI(this.layoutService.mainContainer); + this.layout(this.layoutService.mainContainerDimension, this.layoutService.mainContainerOffset.quickPickTop); + } + })); + this.viewState = this.loadViewState(); + } + registerKeyModsListeners(window2, disposables) { + const listener = (e) => { + this.keyMods.ctrlCmd = e.ctrlKey || e.metaKey; + this.keyMods.alt = e.altKey; + }; + for (const event of [EventType.KEY_DOWN, EventType.KEY_UP, EventType.MOUSE_DOWN]) { + disposables.add(addDisposableListener(window2, event, listener, true)); + } + } + getUI(showInActiveContainer) { + if (this.ui) { + if (showInActiveContainer) { + if (getWindow(this._container) !== getWindow(this.layoutService.activeContainer)) { + this.reparentUI(this.layoutService.activeContainer); + this.layout(this.layoutService.activeContainerDimension, this.layoutService.activeContainerOffset.quickPickTop); + } + } + return this.ui; + } + const container = append(this._container, $22(".quick-input-widget.show-file-icons")); + container.tabIndex = -1; + container.style.display = "none"; + const styleSheet = createStyleSheet(container); + const titleBar = append(container, $22(".quick-input-titlebar")); + const leftActionBar = this._register(new ActionBar(titleBar, { hoverDelegate: this.options.hoverDelegate })); + leftActionBar.domNode.classList.add("quick-input-left-action-bar"); + const title = append(titleBar, $22(".quick-input-title")); + const rightActionBar = this._register(new ActionBar(titleBar, { hoverDelegate: this.options.hoverDelegate })); + rightActionBar.domNode.classList.add("quick-input-right-action-bar"); + const headerContainer = append(container, $22(".quick-input-header")); + const checkAll = this._register(new TriStateCheckbox(localize(1763, "Toggle all checkboxes"), false, { ...defaultCheckboxStyles, size: 15 })); + append(headerContainer, checkAll.domNode); + this._register(checkAll.onChange(() => { + const checked = checkAll.checked; + list2.setAllVisibleChecked(checked === true); + })); + this._register(addDisposableListener(checkAll.domNode, EventType.CLICK, (e) => { + if (e.x || e.y) { + inputBox.setFocus(); + } + })); + const description2 = append(headerContainer, $22(".quick-input-description")); + const inputContainer = append(headerContainer, $22(".quick-input-and-message")); + const filterContainer = append(inputContainer, $22(".quick-input-filter")); + const inputBox = this._register(new QuickInputBox(filterContainer, this.styles.inputBox, this.styles.toggle)); + inputBox.setAttribute("aria-describedby", `${this.idPrefix}message`); + const visibleCountContainer = append(filterContainer, $22(".quick-input-visible-count")); + visibleCountContainer.setAttribute("aria-live", "polite"); + visibleCountContainer.setAttribute("aria-atomic", "true"); + const visibleCount = this._register(new CountBadge(visibleCountContainer, { countFormat: localize(1764, "{0} Results") }, this.styles.countBadge)); + const countContainer = append(filterContainer, $22(".quick-input-count")); + countContainer.setAttribute("aria-live", "polite"); + const count = this._register(new CountBadge(countContainer, { countFormat: localize(1765, "{0} Selected") }, this.styles.countBadge)); + const inlineActionBar = this._register(new ActionBar(headerContainer, { hoverDelegate: this.options.hoverDelegate })); + inlineActionBar.domNode.classList.add("quick-input-inline-action-bar"); + const okContainer = append(headerContainer, $22(".quick-input-action")); + const ok2 = this._register(new Button(okContainer, this.styles.button)); + ok2.label = localize(1766, "OK"); + this._register(ok2.onDidClick((e) => { + this.onDidAcceptEmitter.fire(); + })); + const customButtonContainer = append(headerContainer, $22(".quick-input-action")); + const customButton = this._register(new Button(customButtonContainer, { ...this.styles.button, supportIcons: true })); + customButton.label = localize(1767, "Custom"); + this._register(customButton.onDidClick((e) => { + this.onDidCustomEmitter.fire(); + })); + const message = append(inputContainer, $22(`#${this.idPrefix}message.quick-input-message`)); + const progressBar = this._register(new ProgressBar(container, this.styles.progressBar)); + progressBar.getContainer().classList.add("quick-input-progress"); + const widget = append(container, $22(".quick-input-html-widget")); + widget.tabIndex = -1; + const description1 = append(container, $22(".quick-input-description")); + const listId = this.idPrefix + "list"; + const list2 = this._register(this.instantiationService.createInstance(QuickInputList, container, this.options.hoverDelegate, this.options.linkOpenerDelegate, listId)); + inputBox.setAttribute("aria-controls", listId); + this._register(list2.onDidChangeFocus(() => { + if (inputBox.hasFocus()) { + inputBox.setAttribute("aria-activedescendant", list2.getActiveDescendant() ?? ""); + } + })); + this._register(list2.onChangedAllVisibleChecked((checked) => { + checkAll.checked = checked; + })); + this._register(list2.onChangedVisibleCount((c) => { + visibleCount.setCount(c); + })); + this._register(list2.onChangedCheckedCount((c) => { + setTimeout0(() => count.setCount(c)); + })); + this._register(list2.onLeave(() => { + setTimeout(() => { + if (!this.controller) { + return; + } + inputBox.setFocus(); + if (this.controller instanceof QuickPick && this.controller.canSelectMany) { + list2.clearFocus(); + } + }, 0); + })); + const tree = this._register(this.instantiationService.createInstance(QuickInputTreeController, container, this.options.hoverDelegate)); + this._register(tree.tree.onDidChangeFocus(() => { + if (inputBox.hasFocus()) { + inputBox.setAttribute("aria-activedescendant", tree.getActiveDescendant() ?? ""); + } + })); + this._register(tree.onLeave(() => { + setTimeout(() => { + if (!this.controller) { + return; + } + inputBox.setFocus(); + tree.tree.setFocus([]); + }, 0); + })); + this._register(tree.onDidAccept(() => { + this.onDidAcceptEmitter.fire(); + })); + this._register(tree.tree.onDidChangeContentHeight(() => this.updateLayout())); + const focusTracker = trackFocus(container); + this._register(focusTracker); + this._register(addDisposableListener(container, EventType.FOCUS, (e) => { + const ui = this.getUI(); + if (isAncestor(e.relatedTarget, ui.inputContainer)) { + const value = ui.inputBox.isSelectionAtEnd(); + if (this.endOfQuickInputBoxContext.get() !== value) { + this.endOfQuickInputBoxContext.set(value); + } + } + if (isAncestor(e.relatedTarget, ui.container)) { + return; + } + this.inQuickInputContext.set(true); + this.previousFocusElement = isHTMLElement(e.relatedTarget) ? e.relatedTarget : void 0; + }, true)); + this._register(focusTracker.onDidBlur(() => { + if (!this.getUI().ignoreFocusOut && !this.options.ignoreFocusOut()) { + this.hide(QuickInputHideReason.Blur); + } + this.inQuickInputContext.set(false); + this.endOfQuickInputBoxContext.set(false); + this.previousFocusElement = void 0; + })); + this._register(inputBox.onKeyDown((_) => { + const value = this.getUI().inputBox.isSelectionAtEnd(); + if (this.endOfQuickInputBoxContext.get() !== value) { + this.endOfQuickInputBoxContext.set(value); + } + inputBox.removeAttribute("aria-activedescendant"); + })); + this._register(addDisposableListener(container, EventType.FOCUS, (e) => { + inputBox.setFocus(); + })); + this.dndController = this._register(this.instantiationService.createInstance(QuickInputDragAndDropController, this._container, container, [ + { + node: titleBar, + includeChildren: true + }, + { + node: headerContainer, + includeChildren: false + } + ], this.viewState)); + this._register(autorun((reader) => { + const dndViewState = this.dndController?.dndViewState.read(reader); + if (!dndViewState) { + return; + } + if (dndViewState.top !== void 0 && dndViewState.left !== void 0) { + this.viewState = { + ...this.viewState, + top: dndViewState.top, + left: dndViewState.left + }; + } else { + this.viewState = void 0; + } + this.updateLayout(); + if (dndViewState.done) { + this.saveViewState(this.viewState); + } + })); + this.ui = { + container, + styleSheet, + leftActionBar, + titleBar, + title, + description1, + description2, + widget, + rightActionBar, + inlineActionBar, + checkAll, + inputContainer, + filterContainer, + inputBox, + visibleCountContainer, + visibleCount, + countContainer, + count, + okContainer, + ok: ok2, + message, + customButtonContainer, + customButton, + list: list2, + tree, + progressBar, + onDidAccept: this.onDidAcceptEmitter.event, + onDidCustom: this.onDidCustomEmitter.event, + onDidTriggerButton: this.onDidTriggerButtonEmitter.event, + ignoreFocusOut: false, + keyMods: this.keyMods, + show: (controller) => this.show(controller), + hide: () => this.hide(), + setVisibilities: (visibilities) => this.setVisibilities(visibilities), + setEnabled: (enabled) => this.setEnabled(enabled), + setContextKey: (contextKey) => this.options.setContextKey(contextKey), + linkOpenerDelegate: (content) => this.options.linkOpenerDelegate(content) + }; + this.updateStyles(); + return this.ui; + } + reparentUI(container) { + if (this.ui) { + this._container = container; + append(this._container, this.ui.container); + this.dndController?.reparentUI(this._container); + } + } + pick(picks, options2 = {}, token = CancellationToken.None) { + return new Promise((doResolve, reject) => { + let resolve3 = (result) => { + resolve3 = doResolve; + options2.onKeyMods?.(input.keyMods); + doResolve(result); + }; + if (token.isCancellationRequested) { + resolve3(void 0); + return; + } + const input = this.createQuickPick({ useSeparators: true }); + let activeItem; + const disposables = [ + input, + input.onDidAccept(() => { + if (input.canSelectMany) { + resolve3(input.selectedItems.slice()); + input.hide(); + } else { + const result = input.activeItems[0]; + if (result) { + resolve3(result); + input.hide(); + } + } + }), + input.onDidChangeActive((items) => { + const focused = items[0]; + if (focused && options2.onDidFocus) { + options2.onDidFocus(focused); + } + }), + input.onDidChangeSelection((items) => { + if (!input.canSelectMany) { + const result = items[0]; + if (result) { + resolve3(result); + input.hide(); + } + } + }), + input.onDidTriggerItemButton((event) => options2.onDidTriggerItemButton && options2.onDidTriggerItemButton({ + ...event, + removeItem: () => { + const index = input.items.indexOf(event.item); + if (index !== -1) { + const items = input.items.slice(); + const removed = items.splice(index, 1); + const activeItems = input.activeItems.filter((activeItem2) => activeItem2 !== removed[0]); + const keepScrollPositionBefore = input.keepScrollPosition; + input.keepScrollPosition = true; + input.items = items; + if (activeItems) { + input.activeItems = activeItems; + } + input.keepScrollPosition = keepScrollPositionBefore; + } + } + })), + input.onDidTriggerSeparatorButton((event) => options2.onDidTriggerSeparatorButton?.(event)), + input.onDidChangeValue((value) => { + if (activeItem && !value && (input.activeItems.length !== 1 || input.activeItems[0] !== activeItem)) { + input.activeItems = [activeItem]; + } + }), + token.onCancellationRequested(() => { + input.hide(); + }), + input.onDidHide(() => { + dispose(disposables); + resolve3(void 0); + }) + ]; + input.title = options2.title; + if (options2.value) { + input.value = options2.value; + } + input.canSelectMany = !!options2.canPickMany; + input.placeholder = options2.placeHolder; + input.prompt = options2.prompt; + input.ignoreFocusOut = !!options2.ignoreFocusLost; + input.matchOnDescription = !!options2.matchOnDescription; + input.matchOnDetail = !!options2.matchOnDetail; + if (options2.sortByLabel !== void 0) { + input.sortByLabel = options2.sortByLabel; + } + input.matchOnLabel = options2.matchOnLabel === void 0 || options2.matchOnLabel; + input.quickNavigate = options2.quickNavigate; + input.hideInput = !!options2.hideInput; + input.contextKey = options2.contextKey; + input.busy = true; + Promise.all([picks, options2.activeItem]).then(([items, _activeItem]) => { + activeItem = _activeItem; + input.busy = false; + input.items = items; + if (input.canSelectMany) { + input.selectedItems = items.filter((item) => item.type !== "separator" && item.picked); + } + if (activeItem) { + input.activeItems = [activeItem]; + } + }); + input.show(); + Promise.resolve(picks).then(void 0, (err) => { + reject(err); + input.hide(); + }); + }); + } + setValidationOnInput(input, validationResult) { + if (validationResult && isString(validationResult)) { + input.severity = severity_default.Error; + input.validationMessage = validationResult; + } else if (validationResult && !isString(validationResult)) { + input.severity = validationResult.severity; + input.validationMessage = validationResult.content; + } else { + input.severity = severity_default.Ignore; + input.validationMessage = void 0; + } + } + input(options2 = {}, token = CancellationToken.None) { + return new Promise((resolve3) => { + if (token.isCancellationRequested) { + resolve3(void 0); + return; + } + const input = this.createInputBox(); + const validateInput = options2.validateInput || (() => Promise.resolve(void 0)); + const onDidValueChange = Event.debounce(input.onDidChangeValue, (last, cur) => cur, 100); + let validationValue = options2.value || ""; + let validation = Promise.resolve(validateInput(validationValue)); + const disposables = [ + input, + onDidValueChange((value) => { + if (value !== validationValue) { + validation = Promise.resolve(validateInput(value)); + validationValue = value; + } + validation.then((result) => { + if (value === validationValue) { + this.setValidationOnInput(input, result); + } + }); + }), + input.onDidAccept(() => { + const value = input.value; + if (value !== validationValue) { + validation = Promise.resolve(validateInput(value)); + validationValue = value; + } + validation.then((result) => { + if (!result || !isString(result) && result.severity !== severity_default.Error) { + resolve3(value); + input.hide(); + } else if (value === validationValue) { + this.setValidationOnInput(input, result); + } + }); + }), + token.onCancellationRequested(() => { + input.hide(); + }), + input.onDidHide(() => { + dispose(disposables); + resolve3(void 0); + }) + ]; + input.title = options2.title; + input.value = options2.value || ""; + input.valueSelection = options2.valueSelection; + input.prompt = options2.prompt; + input.placeholder = options2.placeHolder; + input.password = !!options2.password; + input.ignoreFocusOut = !!options2.ignoreFocusLost; + input.show(); + }); + } + createQuickPick(options2 = { useSeparators: false }) { + const ui = this.getUI(true); + return new QuickPick(ui); + } + createInputBox() { + const ui = this.getUI(true); + return new InputBox2(ui); + } + show(controller) { + const ui = this.getUI(true); + this.onShowEmitter.fire(); + const oldController = this.controller; + this.controller = controller; + oldController?.didHide(); + this.setEnabled(true); + ui.leftActionBar.clear(); + ui.title.textContent = ""; + ui.description1.textContent = ""; + ui.description2.textContent = ""; + reset(ui.widget); + ui.rightActionBar.clear(); + ui.inlineActionBar.clear(); + ui.checkAll.checked = false; + ui.inputBox.placeholder = ""; + ui.inputBox.password = false; + ui.inputBox.showDecoration(severity_default.Ignore); + ui.visibleCount.setCount(0); + ui.count.setCount(0); + reset(ui.message); + ui.progressBar.stop(); + ui.progressBar.getContainer().setAttribute("aria-hidden", "true"); + ui.list.setElements([]); + ui.list.matchOnDescription = false; + ui.list.matchOnDetail = false; + ui.list.matchOnLabel = true; + ui.list.sortByLabel = true; + ui.tree.updateFilterOptions({ + matchOnDescription: false, + matchOnLabel: true + }); + ui.tree.sortByLabel = true; + ui.ignoreFocusOut = false; + ui.inputBox.toggles = void 0; + const backKeybindingLabel = this.options.backKeybindingLabel(); + backButton.tooltip = backKeybindingLabel ? localize(1768, "Back ({0})", backKeybindingLabel) : localize(1769, "Back"); + ui.container.style.display = ""; + this.updateLayout(); + this.dndController?.layoutContainer(); + ui.inputBox.setFocus(); + this.quickInputTypeContext.set(controller.type); + } + isVisible() { + return !!this.ui && this.ui.container.style.display !== "none"; + } + setVisibilities(visibilities) { + const ui = this.getUI(); + ui.title.style.display = visibilities.title ? "" : "none"; + ui.description1.style.display = visibilities.description && (visibilities.inputBox || visibilities.checkAll) ? "" : "none"; + ui.description2.style.display = visibilities.description && !(visibilities.inputBox || visibilities.checkAll) ? "" : "none"; + ui.checkAll.domNode.style.display = visibilities.checkAll ? "" : "none"; + ui.inputContainer.style.display = visibilities.inputBox ? "" : "none"; + ui.filterContainer.style.display = visibilities.inputBox ? "" : "none"; + ui.visibleCountContainer.style.display = visibilities.visibleCount ? "" : "none"; + ui.countContainer.style.display = visibilities.count ? "" : "none"; + ui.okContainer.style.display = visibilities.ok ? "" : "none"; + ui.customButtonContainer.style.display = visibilities.customButton ? "" : "none"; + ui.message.style.display = visibilities.message ? "" : "none"; + ui.progressBar.getContainer().style.display = visibilities.progressBar ? "" : "none"; + ui.list.displayed = !!visibilities.list; + ui.tree.displayed = !!visibilities.tree; + ui.container.classList.toggle("show-checkboxes", !!visibilities.checkBox); + ui.container.classList.toggle("hidden-input", !visibilities.inputBox && !visibilities.description); + this.updateLayout(); + } + setEnabled(enabled) { + if (enabled !== this.enabled) { + this.enabled = enabled; + const ui = this.getUI(); + for (const item of ui.leftActionBar.viewItems) { + item.action.enabled = enabled; + } + for (const item of ui.rightActionBar.viewItems) { + item.action.enabled = enabled; + } + if (enabled) { + ui.checkAll.enable(); + } else { + ui.checkAll.disable(); + } + ui.inputBox.enabled = enabled; + ui.ok.enabled = enabled; + ui.list.enabled = enabled; + } + } + hide(reason) { + const controller = this.controller; + if (!controller) { + return; + } + controller.willHide(reason); + const container = this.ui?.container; + const focusChanged = container && !isAncestorOfActiveElement(container); + this.controller = null; + this.onHideEmitter.fire(); + if (container) { + container.style.display = "none"; + } + if (!focusChanged) { + let currentElement = this.previousFocusElement; + while (currentElement && !currentElement.offsetParent) { + currentElement = currentElement.parentElement ?? void 0; + } + if (currentElement?.offsetParent) { + currentElement.focus(); + this.previousFocusElement = void 0; + } else { + this.options.returnFocus(); + } + } + controller.didHide(reason); + } + toggleHover() { + if (this.isVisible() && this.controller instanceof QuickPick) { + this.getUI().list.toggleHover(); + } + } + layout(dimension, titleBarOffset) { + this.dimension = dimension; + this.titleBarOffset = titleBarOffset; + this.updateLayout(); + } + updateLayout() { + if (this.ui && this.isVisible()) { + const style = this.ui.container.style; + const width2 = Math.min(this.dimension.width * 0.62, QuickInputController_1.MAX_WIDTH); + style.width = width2 + "px"; + style.top = `${this.viewState?.top ? Math.round(this.dimension.height * this.viewState.top) : this.titleBarOffset}px`; + style.left = `${Math.round(this.dimension.width * (this.viewState?.left ?? 0.5) - width2 / 2)}px`; + this.ui.inputBox.layout(); + this.ui.list.layout(this.dimension && this.dimension.height * 0.4); + this.ui.tree.layout(this.dimension && this.dimension.height * 0.4); + } + } + applyStyles(styles) { + this.styles = styles; + this.updateStyles(); + } + updateStyles() { + if (this.ui) { + const { quickInputTitleBackground: quickInputTitleBackground2, quickInputBackground: quickInputBackground2, quickInputForeground: quickInputForeground2, widgetBorder: widgetBorder2, widgetShadow: widgetShadow2 } = this.styles.widget; + this.ui.titleBar.style.backgroundColor = quickInputTitleBackground2 ?? ""; + this.ui.container.style.backgroundColor = quickInputBackground2 ?? ""; + this.ui.container.style.color = quickInputForeground2 ?? ""; + this.ui.container.style.border = widgetBorder2 ? `1px solid ${widgetBorder2}` : ""; + this.ui.container.style.boxShadow = widgetShadow2 ? `0 0 8px 2px ${widgetShadow2}` : ""; + this.ui.list.style(this.styles.list); + this.ui.tree.tree.style(this.styles.list); + const content = []; + if (this.styles.pickerGroup.pickerGroupBorder) { + content.push(`.quick-input-list .quick-input-list-entry { border-top-color: ${this.styles.pickerGroup.pickerGroupBorder}; }`); + } + if (this.styles.pickerGroup.pickerGroupForeground) { + content.push(`.quick-input-list .quick-input-list-separator { color: ${this.styles.pickerGroup.pickerGroupForeground}; }`); + } + if (this.styles.pickerGroup.pickerGroupForeground) { + content.push(`.quick-input-list .quick-input-list-separator-as-item { color: var(--vscode-descriptionForeground); }`); + } + if (this.styles.keybindingLabel.keybindingLabelBackground || this.styles.keybindingLabel.keybindingLabelBorder || this.styles.keybindingLabel.keybindingLabelBottomBorder || this.styles.keybindingLabel.keybindingLabelShadow || this.styles.keybindingLabel.keybindingLabelForeground) { + content.push(".quick-input-list .monaco-keybinding > .monaco-keybinding-key {"); + if (this.styles.keybindingLabel.keybindingLabelBackground) { + content.push(`background-color: ${this.styles.keybindingLabel.keybindingLabelBackground};`); + } + if (this.styles.keybindingLabel.keybindingLabelBorder) { + content.push(`border-color: ${this.styles.keybindingLabel.keybindingLabelBorder};`); + } + if (this.styles.keybindingLabel.keybindingLabelBottomBorder) { + content.push(`border-bottom-color: ${this.styles.keybindingLabel.keybindingLabelBottomBorder};`); + } + if (this.styles.keybindingLabel.keybindingLabelShadow) { + content.push(`box-shadow: inset 0 -1px 0 ${this.styles.keybindingLabel.keybindingLabelShadow};`); + } + if (this.styles.keybindingLabel.keybindingLabelForeground) { + content.push(`color: ${this.styles.keybindingLabel.keybindingLabelForeground};`); + } + content.push("}"); + } + const newStyles = content.join("\n"); + if (newStyles !== this.ui.styleSheet.textContent) { + this.ui.styleSheet.textContent = newStyles; + } + } + } + loadViewState() { + try { + const data = JSON.parse(this.storageService.get(VIEWSTATE_STORAGE_KEY, -1, "{}")); + if (data.top !== void 0 || data.left !== void 0) { + return data; + } + } catch { + } + return void 0; + } + saveViewState(viewState) { + const isMainWindow = this.layoutService.activeContainer === this.layoutService.mainContainer; + if (!isMainWindow) { + return; + } + if (viewState !== void 0) { + this.storageService.store( + VIEWSTATE_STORAGE_KEY, + JSON.stringify(viewState), + -1, + 1 + /* StorageTarget.MACHINE */ + ); + } else { + this.storageService.remove( + VIEWSTATE_STORAGE_KEY, + -1 + /* StorageScope.APPLICATION */ + ); + } + } +}; +QuickInputController = QuickInputController_1 = __decorate186([ + __param179(1, ILayoutService), + __param179(2, IInstantiationService), + __param179(3, IContextKeyService), + __param179(4, IStorageService) +], QuickInputController); +var QuickInputDragAndDropController = class QuickInputDragAndDropController2 extends Disposable { + constructor(_container, _quickInputContainer, _quickInputDragAreas, initialViewState, _layoutService, contextKeyService, configurationService) { + super(); + this._container = _container; + this._quickInputContainer = _quickInputContainer; + this._quickInputDragAreas = _quickInputDragAreas; + this._layoutService = _layoutService; + this.configurationService = configurationService; + this.dndViewState = observableValue(this, void 0); + this._snapThreshold = 20; + this._snapLineHorizontalRatio = 0.25; + this._quickInputAlignmentContext = QuickInputAlignmentContextKey.bindTo(contextKeyService); + const customWindowControls = getWindowControlsStyle(this.configurationService) === "custom"; + this._controlsOnLeft = customWindowControls && platform === 1; + this._controlsOnRight = customWindowControls && (platform === 3 || platform === 2); + this._registerLayoutListener(); + this.registerMouseListeners(); + this.dndViewState.set({ ...initialViewState, done: true }, void 0); + } + reparentUI(container) { + this._container = container; + } + layoutContainer(dimension = this._layoutService.activeContainerDimension) { + const state = this.dndViewState.get(); + const dragAreaRect = this._quickInputContainer.getBoundingClientRect(); + if (state?.top && state?.left) { + const a = Math.round(state.left * 100) / 100; + const b = dimension.width; + const c = dragAreaRect.width; + const d = a * b - c / 2; + this._layout(state.top * dimension.height, d); + } + } + _registerLayoutListener() { + this._register(Event.filter(this._layoutService.onDidLayoutContainer, (e) => e.container === this._container)((e) => this.layoutContainer(e.dimension))); + } + registerMouseListeners() { + const dragArea = this._quickInputContainer; + this._register(addDisposableGenericMouseUpListener(dragArea, (event) => { + const originEvent = new StandardMouseEvent(getWindow(dragArea), event); + if (originEvent.detail !== 2) { + return; + } + if (!this._quickInputDragAreas.some(({ node, includeChildren }) => includeChildren ? isAncestor(originEvent.target, node) : originEvent.target === node)) { + return; + } + this.dndViewState.set({ top: void 0, left: void 0, done: true }, void 0); + })); + this._register(addDisposableGenericMouseDownListener(dragArea, (e) => { + const activeWindow = getWindow(this._layoutService.activeContainer); + const originEvent = new StandardMouseEvent(activeWindow, e); + if (!this._quickInputDragAreas.some(({ node, includeChildren }) => includeChildren ? isAncestor(originEvent.target, node) : originEvent.target === node)) { + return; + } + const dragAreaRect = this._quickInputContainer.getBoundingClientRect(); + const dragOffsetX = originEvent.browserEvent.clientX - dragAreaRect.left; + const dragOffsetY = originEvent.browserEvent.clientY - dragAreaRect.top; + let isMovingQuickInput = false; + const mouseMoveListener = addDisposableGenericMouseMoveListener(activeWindow, (e2) => { + const mouseMoveEvent = new StandardMouseEvent(activeWindow, e2); + mouseMoveEvent.preventDefault(); + if (!isMovingQuickInput) { + isMovingQuickInput = true; + } + this._layout(e2.clientY - dragOffsetY, e2.clientX - dragOffsetX); + }); + const mouseUpListener = addDisposableGenericMouseUpListener(activeWindow, (e2) => { + if (isMovingQuickInput) { + const state = this.dndViewState.get(); + this.dndViewState.set({ top: state?.top, left: state?.left, done: true }, void 0); + } + mouseMoveListener.dispose(); + mouseUpListener.dispose(); + }); + })); + } + _layout(topCoordinate, leftCoordinate) { + const snapCoordinateYTop = this._getTopSnapValue(); + const snapCoordinateY = this._getCenterYSnapValue(); + const snapCoordinateX = this._getCenterXSnapValue(); + topCoordinate = Math.max(0, Math.min(topCoordinate, this._container.clientHeight - this._quickInputContainer.clientHeight)); + if (topCoordinate < this._layoutService.activeContainerOffset.top) { + if (this._controlsOnLeft) { + leftCoordinate = Math.max(leftCoordinate, 80 / getZoomFactor(getActiveWindow())); + } else if (this._controlsOnRight) { + leftCoordinate = Math.min(leftCoordinate, this._container.clientWidth - this._quickInputContainer.clientWidth - 140 / getZoomFactor(getActiveWindow())); + } + } + const snappingToTop = Math.abs(topCoordinate - snapCoordinateYTop) < this._snapThreshold; + topCoordinate = snappingToTop ? snapCoordinateYTop : topCoordinate; + const snappingToCenter = Math.abs(topCoordinate - snapCoordinateY) < this._snapThreshold; + topCoordinate = snappingToCenter ? snapCoordinateY : topCoordinate; + const top = topCoordinate / this._container.clientHeight; + leftCoordinate = Math.max(0, Math.min(leftCoordinate, this._container.clientWidth - this._quickInputContainer.clientWidth)); + const snappingToCenterX = Math.abs(leftCoordinate - snapCoordinateX) < this._snapThreshold; + leftCoordinate = snappingToCenterX ? snapCoordinateX : leftCoordinate; + const b = this._container.clientWidth; + const c = this._quickInputContainer.clientWidth; + const d = leftCoordinate; + const left = (d + c / 2) / b; + this.dndViewState.set({ top, left, done: false }, void 0); + if (snappingToCenterX) { + if (snappingToTop) { + this._quickInputAlignmentContext.set("top"); + return; + } else if (snappingToCenter) { + this._quickInputAlignmentContext.set("center"); + return; + } + } + this._quickInputAlignmentContext.set(void 0); + } + _getTopSnapValue() { + return this._layoutService.activeContainerOffset.quickPickTop; + } + _getCenterYSnapValue() { + return Math.round(this._container.clientHeight * this._snapLineHorizontalRatio); + } + _getCenterXSnapValue() { + return Math.round(this._container.clientWidth / 2) - Math.round(this._quickInputContainer.clientWidth / 2); + } +}; +QuickInputDragAndDropController = __decorate186([ + __param179(4, ILayoutService), + __param179(5, IContextKeyService), + __param179(6, IConfigurationService) +], QuickInputDragAndDropController); + +// node_modules/monaco-editor-core/esm/vs/platform/quickinput/browser/quickInputService.js +init_configuration(); +init_dom(); +var __decorate187 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param180 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var QuickInputService = class QuickInputService2 extends Themable { + get controller() { + if (!this._controller) { + this._controller = this._register(this.createController()); + } + return this._controller; + } + get hasController() { + return !!this._controller; + } + get currentQuickInput() { + return this.controller.currentQuickInput; + } + get quickAccess() { + if (!this._quickAccess) { + this._quickAccess = this._register(this.instantiationService.createInstance(QuickAccessController)); + } + return this._quickAccess; + } + constructor(instantiationService, contextKeyService, themeService, layoutService, configurationService) { + super(themeService); + this.instantiationService = instantiationService; + this.contextKeyService = contextKeyService; + this.layoutService = layoutService; + this.configurationService = configurationService; + this._onShow = this._register(new Emitter()); + this._onHide = this._register(new Emitter()); + this.contexts = /* @__PURE__ */ new Map(); + } + createController(host = this.layoutService, options2) { + const defaultOptions3 = { + idPrefix: "quickInput_", + container: host.activeContainer, + ignoreFocusOut: () => false, + backKeybindingLabel: () => void 0, + setContextKey: (id) => this.setContextKey(id), + linkOpenerDelegate: (content) => { + this.instantiationService.invokeFunction((accessor) => { + const openerService = accessor.get(IOpenerService); + openerService.open(content, { allowCommands: true, fromUserGesture: true }); + }); + }, + returnFocus: () => host.focus(), + styles: this.computeStyles(), + hoverDelegate: this._register(this.instantiationService.createInstance(QuickInputHoverDelegate)) + }; + const controller = this._register(this.instantiationService.createInstance(QuickInputController, { + ...defaultOptions3, + ...options2 + })); + controller.layout(host.activeContainerDimension, host.activeContainerOffset.quickPickTop); + this._register(host.onDidLayoutActiveContainer((dimension) => { + if (getWindow(host.activeContainer) === getWindow(controller.container)) { + controller.layout(dimension, host.activeContainerOffset.quickPickTop); + } + })); + this._register(host.onDidChangeActiveContainer(() => { + if (controller.isVisible()) { + return; + } + controller.layout(host.activeContainerDimension, host.activeContainerOffset.quickPickTop); + })); + this._register(controller.onShow(() => { + this.resetContextKeys(); + this._onShow.fire(); + })); + this._register(controller.onHide(() => { + this.resetContextKeys(); + this._onHide.fire(); + })); + return controller; + } + setContextKey(id) { + let key; + if (id) { + key = this.contexts.get(id); + if (!key) { + key = new RawContextKey(id, false).bindTo(this.contextKeyService); + this.contexts.set(id, key); + } + } + if (key && key.get()) { + return; + } + this.resetContextKeys(); + key?.set(true); + } + resetContextKeys() { + this.contexts.forEach((context) => { + if (context.get()) { + context.reset(); + } + }); + } + pick(picks, options2, token = CancellationToken.None) { + return this.controller.pick(picks, options2, token); + } + input(options2 = {}, token = CancellationToken.None) { + return this.controller.input(options2, token); + } + createQuickPick(options2 = { useSeparators: false }) { + return this.controller.createQuickPick(options2); + } + createInputBox() { + return this.controller.createInputBox(); + } + toggleHover() { + if (this.hasController) { + this.controller.toggleHover(); + } + } + updateStyles() { + if (this.hasController) { + this.controller.applyStyles(this.computeStyles()); + } + } + computeStyles() { + return { + widget: { + quickInputBackground: asCssVariable(quickInputBackground), + quickInputForeground: asCssVariable(quickInputForeground), + quickInputTitleBackground: asCssVariable(quickInputTitleBackground), + widgetBorder: asCssVariable(widgetBorder), + widgetShadow: asCssVariable(widgetShadow) + }, + inputBox: defaultInputBoxStyles, + toggle: defaultToggleStyles, + countBadge: defaultCountBadgeStyles, + button: defaultButtonStyles, + progressBar: defaultProgressBarStyles, + keybindingLabel: defaultKeybindingLabelStyles, + list: getListStyles({ + listBackground: quickInputBackground, + listFocusBackground: quickInputListFocusBackground, + listFocusForeground: quickInputListFocusForeground, + // Look like focused when inactive. + listInactiveFocusForeground: quickInputListFocusForeground, + listInactiveSelectionIconForeground: quickInputListFocusIconForeground, + listInactiveFocusBackground: quickInputListFocusBackground, + listFocusOutline: activeContrastBorder, + listInactiveFocusOutline: activeContrastBorder, + treeStickyScrollBackground: quickInputBackground + }), + pickerGroup: { + pickerGroupBorder: asCssVariable(pickerGroupBorder), + pickerGroupForeground: asCssVariable(pickerGroupForeground) + } + }; + } +}; +QuickInputService = __decorate187([ + __param180(0, IInstantiationService), + __param180(1, IContextKeyService), + __param180(2, IThemeService), + __param180(3, ILayoutService), + __param180(4, IConfigurationService) +], QuickInputService); + +// node_modules/monaco-editor-core/esm/vs/editor/standalone/browser/quickInput/standaloneQuickInputService.js +init_functional(); +init_configuration(); +var __decorate188 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param181 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var EditorScopedQuickInputService = class EditorScopedQuickInputService2 extends QuickInputService { + constructor(editor2, instantiationService, contextKeyService, themeService, codeEditorService, configurationService) { + super(instantiationService, contextKeyService, themeService, new EditorScopedLayoutService(editor2.getContainerDomNode(), codeEditorService), configurationService); + this.host = void 0; + const contribution = QuickInputEditorContribution.get(editor2); + if (contribution) { + const widget = contribution.widget; + this.host = { + _serviceBrand: void 0, + get mainContainer() { + return widget.getDomNode(); + }, + getContainer() { + return widget.getDomNode(); + }, + whenContainerStylesLoaded() { + return void 0; + }, + get containers() { + return [widget.getDomNode()]; + }, + get activeContainer() { + return widget.getDomNode(); + }, + get mainContainerDimension() { + return editor2.getLayoutInfo(); + }, + get activeContainerDimension() { + return editor2.getLayoutInfo(); + }, + get onDidLayoutMainContainer() { + return editor2.onDidLayoutChange; + }, + get onDidLayoutActiveContainer() { + return editor2.onDidLayoutChange; + }, + get onDidLayoutContainer() { + return Event.map(editor2.onDidLayoutChange, (dimension) => ({ container: widget.getDomNode(), dimension })); + }, + get onDidChangeActiveContainer() { + return Event.None; + }, + get onDidAddContainer() { + return Event.None; + }, + get mainContainerOffset() { + return { top: 0, quickPickTop: 0 }; + }, + get activeContainerOffset() { + return { top: 0, quickPickTop: 0 }; + }, + focus: () => editor2.focus() + }; + } else { + this.host = void 0; + } + } + createController() { + return super.createController(this.host); + } +}; +EditorScopedQuickInputService = __decorate188([ + __param181(1, IInstantiationService), + __param181(2, IContextKeyService), + __param181(3, IThemeService), + __param181(4, ICodeEditorService), + __param181(5, IConfigurationService) +], EditorScopedQuickInputService); +var StandaloneQuickInputService = class StandaloneQuickInputService2 { + get activeService() { + const editor2 = this.codeEditorService.getFocusedCodeEditor(); + if (!editor2) { + throw new Error("Quick input service needs a focused editor to work."); + } + let quickInputService = this.mapEditorToService.get(editor2); + if (!quickInputService) { + const newQuickInputService = quickInputService = this.instantiationService.createInstance(EditorScopedQuickInputService, editor2); + this.mapEditorToService.set(editor2, quickInputService); + createSingleCallFunction(editor2.onDidDispose)(() => { + newQuickInputService.dispose(); + this.mapEditorToService.delete(editor2); + }); + } + return quickInputService; + } + get currentQuickInput() { + return this.activeService.currentQuickInput; + } + get quickAccess() { + return this.activeService.quickAccess; + } + constructor(instantiationService, codeEditorService) { + this.instantiationService = instantiationService; + this.codeEditorService = codeEditorService; + this.mapEditorToService = /* @__PURE__ */ new Map(); + } + pick(picks, options2, token = CancellationToken.None) { + return this.activeService.pick(picks, options2, token); + } + input(options2, token) { + return this.activeService.input(options2, token); + } + createQuickPick(options2 = { useSeparators: false }) { + return this.activeService.createQuickPick(options2); + } + createInputBox() { + return this.activeService.createInputBox(); + } + toggleHover() { + return this.activeService.toggleHover(); + } +}; +StandaloneQuickInputService = __decorate188([ + __param181(0, IInstantiationService), + __param181(1, ICodeEditorService) +], StandaloneQuickInputService); +var QuickInputEditorContribution = class _QuickInputEditorContribution { + static { + this.ID = "editor.controller.quickInput"; + } + static get(editor2) { + return editor2.getContribution(_QuickInputEditorContribution.ID); + } + constructor(editor2) { + this.editor = editor2; + this.widget = new QuickInputEditorWidget(this.editor); + } + dispose() { + this.widget.dispose(); + } +}; +var QuickInputEditorWidget = class _QuickInputEditorWidget { + static { + this.ID = "editor.contrib.quickInputWidget"; + } + constructor(codeEditor) { + this.codeEditor = codeEditor; + this.domNode = document.createElement("div"); + this.codeEditor.addOverlayWidget(this); + } + getId() { + return _QuickInputEditorWidget.ID; + } + getDomNode() { + return this.domNode; + } + getPosition() { + return { preference: { top: 0, left: 0 } }; + } + dispose() { + this.codeEditor.removeOverlayWidget(this); + } +}; +registerEditorContribution( + QuickInputEditorContribution.ID, + QuickInputEditorContribution, + 4 + /* EditorContributionInstantiation.Lazy */ +); + +// node_modules/monaco-editor-core/esm/vs/editor/standalone/browser/standaloneServices.js +init_standaloneTheme(); + +// node_modules/monaco-editor-core/esm/vs/platform/accessibility/browser/accessibilityService.js +init_dom(); +init_window(); +init_event(); +init_lifecycle(); +init_configuration(); +init_contextkey(); +var __decorate189 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param182 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var AccessibilityService = class AccessibilityService2 extends Disposable { + constructor(_contextKeyService, _layoutService, _configurationService) { + super(); + this._contextKeyService = _contextKeyService; + this._layoutService = _layoutService; + this._configurationService = _configurationService; + this._accessibilitySupport = 0; + this._onDidChangeScreenReaderOptimized = new Emitter(); + this._onDidChangeReducedMotion = new Emitter(); + this._onDidChangeLinkUnderline = new Emitter(); + this._accessibilityModeEnabledContext = CONTEXT_ACCESSIBILITY_MODE_ENABLED.bindTo(this._contextKeyService); + const updateContextKey = () => this._accessibilityModeEnabledContext.set(this.isScreenReaderOptimized()); + this._register(this._configurationService.onDidChangeConfiguration((e) => { + if (e.affectsConfiguration("editor.accessibilitySupport")) { + updateContextKey(); + this._onDidChangeScreenReaderOptimized.fire(); + } + if (e.affectsConfiguration("workbench.reduceMotion")) { + this._configMotionReduced = this._configurationService.getValue("workbench.reduceMotion"); + this._onDidChangeReducedMotion.fire(); + } + })); + updateContextKey(); + this._register(this.onDidChangeScreenReaderOptimized(() => updateContextKey())); + const reduceMotionMatcher = mainWindow.matchMedia(`(prefers-reduced-motion: reduce)`); + this._systemMotionReduced = reduceMotionMatcher.matches; + this._configMotionReduced = this._configurationService.getValue("workbench.reduceMotion"); + this._linkUnderlinesEnabled = this._configurationService.getValue("accessibility.underlineLinks"); + this.initReducedMotionListeners(reduceMotionMatcher); + this.initLinkUnderlineListeners(); + } + initReducedMotionListeners(reduceMotionMatcher) { + this._register(addDisposableListener(reduceMotionMatcher, "change", () => { + this._systemMotionReduced = reduceMotionMatcher.matches; + if (this._configMotionReduced === "auto") { + this._onDidChangeReducedMotion.fire(); + } + })); + const updateRootClasses = () => { + const reduce = this.isMotionReduced(); + this._layoutService.mainContainer.classList.toggle("monaco-reduce-motion", reduce); + this._layoutService.mainContainer.classList.toggle("monaco-enable-motion", !reduce); + }; + updateRootClasses(); + this._register(this.onDidChangeReducedMotion(() => updateRootClasses())); + } + initLinkUnderlineListeners() { + this._register(this._configurationService.onDidChangeConfiguration((e) => { + if (e.affectsConfiguration("accessibility.underlineLinks")) { + const linkUnderlinesEnabled = this._configurationService.getValue("accessibility.underlineLinks"); + this._linkUnderlinesEnabled = linkUnderlinesEnabled; + this._onDidChangeLinkUnderline.fire(); + } + })); + const updateLinkUnderlineClasses = () => { + const underlineLinks = this._linkUnderlinesEnabled; + this._layoutService.mainContainer.classList.toggle("underline-links", underlineLinks); + }; + updateLinkUnderlineClasses(); + this._register(this.onDidChangeLinkUnderlines(() => updateLinkUnderlineClasses())); + } + onDidChangeLinkUnderlines(listener) { + return this._onDidChangeLinkUnderline.event(listener); + } + get onDidChangeScreenReaderOptimized() { + return this._onDidChangeScreenReaderOptimized.event; + } + isScreenReaderOptimized() { + const config = this._configurationService.getValue("editor.accessibilitySupport"); + return config === "on" || config === "auto" && this._accessibilitySupport === 2; + } + get onDidChangeReducedMotion() { + return this._onDidChangeReducedMotion.event; + } + isMotionReduced() { + const config = this._configMotionReduced; + return config === "on" || config === "auto" && this._systemMotionReduced; + } + getAccessibilitySupport() { + return this._accessibilitySupport; + } +}; +AccessibilityService = __decorate189([ + __param182(0, IContextKeyService), + __param182(1, ILayoutService), + __param182(2, IConfigurationService) +], AccessibilityService); + +// node_modules/monaco-editor-core/esm/vs/editor/standalone/browser/standaloneServices.js +init_actions2(); + +// node_modules/monaco-editor-core/esm/vs/platform/clipboard/browser/clipboardService.js +init_browser(); +init_dom(); +init_window(); +init_async(); +init_event(); +init_hash(); +init_lifecycle(); +init_uri(); +init_log(); +var __decorate190 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param183 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var BrowserClipboardService_1; +var vscodeResourcesMime = "application/vnd.code.resources"; +var BrowserClipboardService = class BrowserClipboardService2 extends Disposable { + static { + BrowserClipboardService_1 = this; + } + constructor(layoutService, logService) { + super(); + this.layoutService = layoutService; + this.logService = logService; + this.mapTextToType = /* @__PURE__ */ new Map(); + this.findText = ""; + this.resources = []; + this.resourcesStateHash = void 0; + if (isSafari || isWebkitWebView) { + this.installWebKitWriteTextWorkaround(); + } + this._register(Event.runAndSubscribe(onDidRegisterWindow, ({ window: window2, disposables }) => { + disposables.add(addDisposableListener(window2.document, "copy", () => this.clearResourcesState())); + }, { window: mainWindow, disposables: this._store })); + } + triggerPaste() { + this.logService.trace("BrowserClipboardService#triggerPaste"); + return void 0; + } + // In Safari, it has the following note: + // + // "The request to write to the clipboard must be triggered during a user gesture. + // A call to clipboard.write or clipboard.writeText outside the scope of a user + // gesture(such as "click" or "touch" event handlers) will result in the immediate + // rejection of the promise returned by the API call." + // From: https://webkit.org/blog/10855/async-clipboard-api/ + // + // Since extensions run in a web worker, and handle gestures in an asynchronous way, + // they are not classified by Safari as "in response to a user gesture" and will reject. + // + // This function sets up some handlers to work around that behavior. + installWebKitWriteTextWorkaround() { + const handler = () => { + const currentWritePromise = new DeferredPromise(); + if (this.webKitPendingClipboardWritePromise && !this.webKitPendingClipboardWritePromise.isSettled) { + this.webKitPendingClipboardWritePromise.cancel(); + } + this.webKitPendingClipboardWritePromise = currentWritePromise; + getActiveWindow().navigator.clipboard.write([new ClipboardItem({ + "text/plain": currentWritePromise.p + })]).catch(async (err) => { + if (!(err instanceof Error) || err.name !== "NotAllowedError" || !currentWritePromise.isRejected) { + this.logService.error(err); + } + }); + }; + this._register(Event.runAndSubscribe(this.layoutService.onDidAddContainer, ({ container, disposables }) => { + disposables.add(addDisposableListener(container, "click", handler)); + disposables.add(addDisposableListener(container, "keydown", handler)); + }, { container: this.layoutService.mainContainer, disposables: this._store })); + } + async writeText(text2, type) { + this.logService.trace("BrowserClipboardService#writeText called with type:", type, " text.length:", text2.length); + this.clearResourcesState(); + if (type) { + this.mapTextToType.set(type, text2); + this.logService.trace("BrowserClipboardService#writeText"); + return; + } + if (this.webKitPendingClipboardWritePromise) { + return this.webKitPendingClipboardWritePromise.complete(text2); + } + try { + this.logService.trace("before navigator.clipboard.writeText"); + return await getActiveWindow().navigator.clipboard.writeText(text2); + } catch (error) { + console.error(error); + } + this.fallbackWriteText(text2); + } + fallbackWriteText(text2) { + this.logService.trace("BrowserClipboardService#fallbackWriteText"); + const activeDocument = getActiveDocument(); + const activeElement = activeDocument.activeElement; + const textArea = activeDocument.body.appendChild($("textarea", { "aria-hidden": true })); + textArea.style.height = "1px"; + textArea.style.width = "1px"; + textArea.style.position = "absolute"; + textArea.value = text2; + textArea.focus(); + textArea.select(); + activeDocument.execCommand("copy"); + if (isHTMLElement(activeElement)) { + activeElement.focus(); + } + textArea.remove(); + } + async readText(type) { + this.logService.trace("BrowserClipboardService#readText called with type:", type); + if (type) { + const readText = this.mapTextToType.get(type) || ""; + this.logService.trace("BrowserClipboardService#readText text.length:", readText.length); + return readText; + } + try { + const readText = await getActiveWindow().navigator.clipboard.readText(); + this.logService.trace("BrowserClipboardService#readText text.length:", readText.length); + return readText; + } catch (error) { + console.error(error); + } + return ""; + } + async readFindText() { + return this.findText; + } + async writeFindText(text2) { + this.findText = text2; + } + static { + this.MAX_RESOURCE_STATE_SOURCE_LENGTH = 1e3; + } + async readResources() { + try { + const items = await getActiveWindow().navigator.clipboard.read(); + for (const item of items) { + if (item.types.includes(`web ${vscodeResourcesMime}`)) { + const blob = await item.getType(`web ${vscodeResourcesMime}`); + const resources = JSON.parse(await blob.text()).map((x) => URI.from(x)); + return resources; + } + } + } catch (error) { + } + const resourcesStateHash = await this.computeResourcesStateHash(); + if (this.resourcesStateHash !== resourcesStateHash) { + this.clearResourcesState(); + } + return this.resources; + } + async computeResourcesStateHash() { + if (this.resources.length === 0) { + return void 0; + } + const clipboardText = await this.readText(); + return hash(clipboardText.substring(0, BrowserClipboardService_1.MAX_RESOURCE_STATE_SOURCE_LENGTH)); + } + clearInternalState() { + this.clearResourcesState(); + } + clearResourcesState() { + this.resources = []; + this.resourcesStateHash = void 0; + } +}; +BrowserClipboardService = BrowserClipboardService_1 = __decorate190([ + __param183(0, ILayoutService), + __param183(1, ILogService) +], BrowserClipboardService); + +// node_modules/monaco-editor-core/esm/vs/platform/contextkey/browser/contextKeyService.js +init_event(); +init_iterator(); +init_lifecycle(); +init_objects(); +init_uri(); +init_nls(); +init_commands(); +init_configuration(); +init_contextkey(); +init_window(); +init_dom(); +var __decorate191 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param184 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var KEYBINDING_CONTEXT_ATTR = "data-keybinding-context"; +var Context3 = class { + constructor(id, parent) { + this._id = id; + this._parent = parent; + this._value = /* @__PURE__ */ Object.create(null); + this._value["_contextId"] = id; + } + get value() { + return { ...this._value }; + } + setValue(key, value) { + if (this._value[key] !== value) { + this._value[key] = value; + return true; + } + return false; + } + removeValue(key) { + if (key in this._value) { + delete this._value[key]; + return true; + } + return false; + } + getValue(key) { + const ret = this._value[key]; + if (typeof ret === "undefined" && this._parent) { + return this._parent.getValue(key); + } + return ret; + } +}; +var NullContext = class _NullContext extends Context3 { + static { + this.INSTANCE = new _NullContext(); + } + constructor() { + super(-1, null); + } + setValue(key, value) { + return false; + } + removeValue(key) { + return false; + } + getValue(key) { + return void 0; + } +}; +var ConfigAwareContextValuesContainer = class _ConfigAwareContextValuesContainer extends Context3 { + static { + this._keyPrefix = "config."; + } + constructor(id, _configurationService, emitter) { + super(id, null); + this._configurationService = _configurationService; + this._values = TernarySearchTree.forConfigKeys(); + this._listener = this._configurationService.onDidChangeConfiguration((event) => { + if (event.source === 7) { + const allKeys = Array.from(this._values, ([k]) => k); + this._values.clear(); + emitter.fire(new ArrayContextKeyChangeEvent(allKeys)); + } else { + const changedKeys = []; + for (const configKey of event.affectedKeys) { + const contextKey = `config.${configKey}`; + const cachedItems = this._values.findSuperstr(contextKey); + if (cachedItems !== void 0) { + changedKeys.push(...Iterable.map(cachedItems, ([key]) => key)); + this._values.deleteSuperstr(contextKey); + } + if (this._values.has(contextKey)) { + changedKeys.push(contextKey); + this._values.delete(contextKey); + } + } + emitter.fire(new ArrayContextKeyChangeEvent(changedKeys)); + } + }); + } + dispose() { + this._listener.dispose(); + } + getValue(key) { + if (key.indexOf(_ConfigAwareContextValuesContainer._keyPrefix) !== 0) { + return super.getValue(key); + } + if (this._values.has(key)) { + return this._values.get(key); + } + const configKey = key.substr(_ConfigAwareContextValuesContainer._keyPrefix.length); + const configValue = this._configurationService.getValue(configKey); + let value = void 0; + switch (typeof configValue) { + case "number": + case "boolean": + case "string": + value = configValue; + break; + default: + if (Array.isArray(configValue)) { + value = JSON.stringify(configValue); + } else { + value = configValue; + } + } + this._values.set(key, value); + return value; + } + setValue(key, value) { + return super.setValue(key, value); + } + removeValue(key) { + return super.removeValue(key); + } +}; +var ContextKey = class { + constructor(service, key, defaultValue) { + this._service = service; + this._key = key; + this._defaultValue = defaultValue; + this.reset(); + } + set(value) { + this._service.setContext(this._key, value); + } + reset() { + if (typeof this._defaultValue === "undefined") { + this._service.removeContext(this._key); + } else { + this._service.setContext(this._key, this._defaultValue); + } + } + get() { + return this._service.getContextKeyValue(this._key); + } +}; +var SimpleContextKeyChangeEvent = class { + constructor(key) { + this.key = key; + } + affectsSome(keys) { + return keys.has(this.key); + } + allKeysContainedIn(keys) { + return this.affectsSome(keys); + } +}; +var ArrayContextKeyChangeEvent = class { + constructor(keys) { + this.keys = keys; + } + affectsSome(keys) { + for (const key of this.keys) { + if (keys.has(key)) { + return true; + } + } + return false; + } + allKeysContainedIn(keys) { + return this.keys.every((key) => keys.has(key)); + } +}; +var CompositeContextKeyChangeEvent = class { + constructor(events) { + this.events = events; + } + affectsSome(keys) { + for (const e of this.events) { + if (e.affectsSome(keys)) { + return true; + } + } + return false; + } + allKeysContainedIn(keys) { + return this.events.every((evt) => evt.allKeysContainedIn(keys)); + } +}; +function allEventKeysInContext(event, context) { + return event.allKeysContainedIn(new Set(Object.keys(context))); +} +var AbstractContextKeyService = class extends Disposable { + get onDidChangeContext() { + return this._onDidChangeContext.event; + } + constructor(myContextId) { + super(); + this._onDidChangeContext = this._register(new PauseableEmitter({ merge: (input) => new CompositeContextKeyChangeEvent(input) })); + this._isDisposed = false; + this._myContextId = myContextId; + } + createKey(key, defaultValue) { + if (this._isDisposed) { + throw new Error(`AbstractContextKeyService has been disposed`); + } + return new ContextKey(this, key, defaultValue); + } + bufferChangeEvents(callback) { + this._onDidChangeContext.pause(); + try { + callback(); + } finally { + this._onDidChangeContext.resume(); + } + } + createScoped(domNode) { + if (this._isDisposed) { + throw new Error(`AbstractContextKeyService has been disposed`); + } + return new ScopedContextKeyService(this, domNode); + } + contextMatchesRules(rules) { + if (this._isDisposed) { + throw new Error(`AbstractContextKeyService has been disposed`); + } + const context = this.getContextValuesContainer(this._myContextId); + const result = rules ? rules.evaluate(context) : true; + return result; + } + getContextKeyValue(key) { + if (this._isDisposed) { + return void 0; + } + return this.getContextValuesContainer(this._myContextId).getValue(key); + } + setContext(key, value) { + if (this._isDisposed) { + return; + } + const myContext = this.getContextValuesContainer(this._myContextId); + if (!myContext) { + return; + } + if (myContext.setValue(key, value)) { + this._onDidChangeContext.fire(new SimpleContextKeyChangeEvent(key)); + } + } + removeContext(key) { + if (this._isDisposed) { + return; + } + if (this.getContextValuesContainer(this._myContextId).removeValue(key)) { + this._onDidChangeContext.fire(new SimpleContextKeyChangeEvent(key)); + } + } + getContext(target) { + if (this._isDisposed) { + return NullContext.INSTANCE; + } + return this.getContextValuesContainer(findContextAttr(target)); + } + dispose() { + super.dispose(); + this._isDisposed = true; + } +}; +var ContextKeyService = class ContextKeyService2 extends AbstractContextKeyService { + constructor(configurationService) { + super(0); + this._contexts = /* @__PURE__ */ new Map(); + this._lastContextId = 0; + this.inputFocusedContext = InputFocusedContext.bindTo(this); + const myContext = this._register(new ConfigAwareContextValuesContainer(this._myContextId, configurationService, this._onDidChangeContext)); + this._contexts.set(this._myContextId, myContext); + this._register(Event.runAndSubscribe(onDidRegisterWindow, ({ window: window2, disposables }) => { + const onFocusDisposables = disposables.add(new MutableDisposable()); + disposables.add(addDisposableListener(window2, EventType.FOCUS_IN, () => { + onFocusDisposables.value = new DisposableStore(); + this.updateInputContextKeys(window2.document, onFocusDisposables.value); + }, true)); + }, { window: mainWindow, disposables: this._store })); + } + updateInputContextKeys(ownerDocument, disposables) { + function activeElementIsInput() { + return !!ownerDocument.activeElement && isEditableElement(ownerDocument.activeElement); + } + const isInputFocused = activeElementIsInput(); + this.inputFocusedContext.set(isInputFocused); + if (isInputFocused) { + const tracker = disposables.add(trackFocus(ownerDocument.activeElement)); + Event.once(tracker.onDidBlur)(() => { + if (getActiveWindow().document === ownerDocument) { + this.inputFocusedContext.set(activeElementIsInput()); + } + tracker.dispose(); + }, void 0, disposables); + } + } + getContextValuesContainer(contextId) { + if (this._isDisposed) { + return NullContext.INSTANCE; + } + return this._contexts.get(contextId) || NullContext.INSTANCE; + } + createChildContext(parentContextId = this._myContextId) { + if (this._isDisposed) { + throw new Error(`ContextKeyService has been disposed`); + } + const id = ++this._lastContextId; + this._contexts.set(id, new Context3(id, this.getContextValuesContainer(parentContextId))); + return id; + } + disposeContext(contextId) { + if (!this._isDisposed) { + this._contexts.delete(contextId); + } + } +}; +ContextKeyService = __decorate191([ + __param184(0, IConfigurationService) +], ContextKeyService); +var ScopedContextKeyService = class extends AbstractContextKeyService { + constructor(parent, domNode) { + super(parent.createChildContext()); + this._parentChangeListener = this._register(new MutableDisposable()); + this._parent = parent; + this._updateParentChangeListener(); + this._domNode = domNode; + if (this._domNode.hasAttribute(KEYBINDING_CONTEXT_ATTR)) { + let extraInfo = ""; + if (this._domNode.classList) { + extraInfo = Array.from(this._domNode.classList.values()).join(", "); + } + console.error(`Element already has context attribute${extraInfo ? ": " + extraInfo : ""}`); + } + this._domNode.setAttribute(KEYBINDING_CONTEXT_ATTR, String(this._myContextId)); + } + _updateParentChangeListener() { + this._parentChangeListener.value = this._parent.onDidChangeContext((e) => { + const thisContainer = this._parent.getContextValuesContainer(this._myContextId); + const thisContextValues = thisContainer.value; + if (!allEventKeysInContext(e, thisContextValues)) { + this._onDidChangeContext.fire(e); + } + }); + } + dispose() { + if (this._isDisposed) { + return; + } + this._parent.disposeContext(this._myContextId); + this._domNode.removeAttribute(KEYBINDING_CONTEXT_ATTR); + super.dispose(); + } + getContextValuesContainer(contextId) { + if (this._isDisposed) { + return NullContext.INSTANCE; + } + return this._parent.getContextValuesContainer(contextId); + } + createChildContext(parentContextId = this._myContextId) { + if (this._isDisposed) { + throw new Error(`ScopedContextKeyService has been disposed`); + } + return this._parent.createChildContext(parentContextId); + } + disposeContext(contextId) { + if (this._isDisposed) { + return; + } + this._parent.disposeContext(contextId); + } +}; +function findContextAttr(domNode) { + while (domNode) { + if (domNode.hasAttribute(KEYBINDING_CONTEXT_ATTR)) { + const attr = domNode.getAttribute(KEYBINDING_CONTEXT_ATTR); + if (attr) { + return parseInt(attr, 10); + } + return NaN; + } + domNode = domNode.parentElement; + } + return 0; +} +function setContext(accessor, contextKey, contextValue) { + const contextKeyService = accessor.get(IContextKeyService); + contextKeyService.createKey(String(contextKey), stringifyURIs(contextValue)); +} +function stringifyURIs(contextValue) { + return cloneAndChange(contextValue, (obj) => { + if (typeof obj === "object" && obj.$mid === 1) { + return URI.revive(obj).toString(); + } + if (obj instanceof URI) { + return obj.toString(); + } + return void 0; + }); +} +CommandsRegistry.registerCommand("_setContext", setContext); +CommandsRegistry.registerCommand({ + id: "getContextKeyInfo", + handler() { + return [...RawContextKey.all()].sort((a, b) => a.key.localeCompare(b.key)); + }, + metadata: { + description: localize(1674, "A command that returns information about context keys"), + args: [] + } +}); +CommandsRegistry.registerCommand("_generateContextKeyInfo", function() { + const result = []; + const seen = /* @__PURE__ */ new Set(); + for (const info of RawContextKey.all()) { + if (!seen.has(info.key)) { + seen.add(info.key); + result.push(info); + } + } + result.sort((a, b) => a.key.localeCompare(b.key)); + console.log(JSON.stringify(result, void 0, 2)); +}); + +// node_modules/monaco-editor-core/esm/vs/editor/standalone/browser/standaloneServices.js +init_descriptors(); + +// node_modules/monaco-editor-core/esm/vs/platform/instantiation/common/instantiationService.js +init_async(); +init_errors(); +init_lifecycle(); +init_descriptors(); + +// node_modules/monaco-editor-core/esm/vs/platform/instantiation/common/graph.js +var Node3 = class { + constructor(key, data) { + this.key = key; + this.data = data; + this.incoming = /* @__PURE__ */ new Map(); + this.outgoing = /* @__PURE__ */ new Map(); + } +}; +var Graph = class { + constructor(_hashFn) { + this._hashFn = _hashFn; + this._nodes = /* @__PURE__ */ new Map(); + } + roots() { + const ret = []; + for (const node of this._nodes.values()) { + if (node.outgoing.size === 0) { + ret.push(node); + } + } + return ret; + } + insertEdge(from, to) { + const fromNode = this.lookupOrInsertNode(from); + const toNode = this.lookupOrInsertNode(to); + fromNode.outgoing.set(toNode.key, toNode); + toNode.incoming.set(fromNode.key, fromNode); + } + removeNode(data) { + const key = this._hashFn(data); + this._nodes.delete(key); + for (const node of this._nodes.values()) { + node.outgoing.delete(key); + node.incoming.delete(key); + } + } + lookupOrInsertNode(data) { + const key = this._hashFn(data); + let node = this._nodes.get(key); + if (!node) { + node = new Node3(key, data); + this._nodes.set(key, node); + } + return node; + } + isEmpty() { + return this._nodes.size === 0; + } + toString() { + const data = []; + for (const [key, value] of this._nodes) { + data.push(`${key} + (-> incoming)[${[...value.incoming.keys()].join(", ")}] + (outgoing ->)[${[...value.outgoing.keys()].join(",")}] +`); + } + return data.join("\n"); + } + /** + * This is brute force and slow and **only** be used + * to trouble shoot. + */ + findCycleSlow() { + for (const [id, node] of this._nodes) { + const seen = /* @__PURE__ */ new Set([id]); + const res = this._findCycle(node, seen); + if (res) { + return res; + } + } + return void 0; + } + _findCycle(node, seen) { + for (const [id, outgoing] of node.outgoing) { + if (seen.has(id)) { + return [...seen, id].join(" -> "); + } + seen.add(id); + const value = this._findCycle(outgoing, seen); + if (value) { + return value; + } + seen.delete(id); + } + return void 0; + } +}; + +// node_modules/monaco-editor-core/esm/vs/platform/instantiation/common/instantiationService.js +init_instantiation(); +init_linkedList(); +var _enableAllTracing = false; +var CyclicDependencyError = class extends Error { + constructor(graph) { + super("cyclic dependency between services"); + this.message = graph.findCycleSlow() ?? `UNABLE to detect cycle, dumping graph: +${graph.toString()}`; + } +}; +var InstantiationService = class _InstantiationService { + constructor(_services = new ServiceCollection(), _strict = false, _parent, _enableTracing = _enableAllTracing) { + this._services = _services; + this._strict = _strict; + this._parent = _parent; + this._enableTracing = _enableTracing; + this._isDisposed = false; + this._servicesToMaybeDispose = /* @__PURE__ */ new Set(); + this._children = /* @__PURE__ */ new Set(); + this._activeInstantiations = /* @__PURE__ */ new Set(); + this._services.set(IInstantiationService, this); + this._globalGraph = _enableTracing ? _parent?._globalGraph ?? new Graph((e) => e) : void 0; + } + dispose() { + if (!this._isDisposed) { + this._isDisposed = true; + dispose(this._children); + this._children.clear(); + for (const candidate of this._servicesToMaybeDispose) { + if (isDisposable(candidate)) { + candidate.dispose(); + } + } + this._servicesToMaybeDispose.clear(); + } + } + _throwIfDisposed() { + if (this._isDisposed) { + throw new Error("InstantiationService has been disposed"); + } + } + createChild(services, store) { + this._throwIfDisposed(); + const that = this; + const result = new class extends _InstantiationService { + dispose() { + that._children.delete(result); + super.dispose(); + } + }(services, this._strict, this, this._enableTracing); + this._children.add(result); + store?.add(result); + return result; + } + invokeFunction(fn, ...args) { + this._throwIfDisposed(); + const _trace = Trace.traceInvocation(this._enableTracing, fn); + let _done = false; + try { + const accessor = { + get: (id) => { + if (_done) { + throw illegalState("service accessor is only valid during the invocation of its target method"); + } + const result = this._getOrCreateServiceInstance(id, _trace); + if (!result) { + throw new Error(`[invokeFunction] unknown service '${id}'`); + } + return result; + }, + getIfExists: (id) => { + if (_done) { + throw illegalState("service accessor is only valid during the invocation of its target method"); + } + const result = this._getOrCreateServiceInstance(id, _trace); + return result; + } + }; + return fn(accessor, ...args); + } finally { + _done = true; + _trace.stop(); + } + } + createInstance(ctorOrDescriptor, ...rest) { + this._throwIfDisposed(); + let _trace; + let result; + if (ctorOrDescriptor instanceof SyncDescriptor) { + _trace = Trace.traceCreation(this._enableTracing, ctorOrDescriptor.ctor); + result = this._createInstance(ctorOrDescriptor.ctor, ctorOrDescriptor.staticArguments.concat(rest), _trace); + } else { + _trace = Trace.traceCreation(this._enableTracing, ctorOrDescriptor); + result = this._createInstance(ctorOrDescriptor, rest, _trace); + } + _trace.stop(); + return result; + } + _createInstance(ctor, args = [], _trace) { + const serviceDependencies = _util.getServiceDependencies(ctor).sort((a, b) => a.index - b.index); + const serviceArgs = []; + for (const dependency of serviceDependencies) { + const service = this._getOrCreateServiceInstance(dependency.id, _trace); + if (!service) { + this._throwIfStrict(`[createInstance] ${ctor.name} depends on UNKNOWN service ${dependency.id}.`, false); + } + serviceArgs.push(service); + } + const firstServiceArgPos = serviceDependencies.length > 0 ? serviceDependencies[0].index : args.length; + if (args.length !== firstServiceArgPos) { + console.trace(`[createInstance] First service dependency of ${ctor.name} at position ${firstServiceArgPos + 1} conflicts with ${args.length} static arguments`); + const delta = firstServiceArgPos - args.length; + if (delta > 0) { + args = args.concat(new Array(delta)); + } else { + args = args.slice(0, firstServiceArgPos); + } + } + return Reflect.construct(ctor, args.concat(serviceArgs)); + } + _setCreatedServiceInstance(id, instance) { + if (this._services.get(id) instanceof SyncDescriptor) { + this._services.set(id, instance); + } else if (this._parent) { + this._parent._setCreatedServiceInstance(id, instance); + } else { + throw new Error("illegalState - setting UNKNOWN service instance"); + } + } + _getServiceInstanceOrDescriptor(id) { + const instanceOrDesc = this._services.get(id); + if (!instanceOrDesc && this._parent) { + return this._parent._getServiceInstanceOrDescriptor(id); + } else { + return instanceOrDesc; + } + } + _getOrCreateServiceInstance(id, _trace) { + if (this._globalGraph && this._globalGraphImplicitDependency) { + this._globalGraph.insertEdge(this._globalGraphImplicitDependency, String(id)); + } + const thing = this._getServiceInstanceOrDescriptor(id); + if (thing instanceof SyncDescriptor) { + return this._safeCreateAndCacheServiceInstance(id, thing, _trace.branch(id, true)); + } else { + _trace.branch(id, false); + return thing; + } + } + _safeCreateAndCacheServiceInstance(id, desc, _trace) { + if (this._activeInstantiations.has(id)) { + throw new Error(`illegal state - RECURSIVELY instantiating service '${id}'`); + } + this._activeInstantiations.add(id); + try { + return this._createAndCacheServiceInstance(id, desc, _trace); + } finally { + this._activeInstantiations.delete(id); + } + } + _createAndCacheServiceInstance(id, desc, _trace) { + const graph = new Graph((data) => data.id.toString()); + let cycleCount = 0; + const stack = [{ id, desc, _trace }]; + const seen = /* @__PURE__ */ new Set(); + while (stack.length) { + const item = stack.pop(); + if (seen.has(String(item.id))) { + continue; + } + seen.add(String(item.id)); + graph.lookupOrInsertNode(item); + if (cycleCount++ > 1e3) { + throw new CyclicDependencyError(graph); + } + for (const dependency of _util.getServiceDependencies(item.desc.ctor)) { + const instanceOrDesc = this._getServiceInstanceOrDescriptor(dependency.id); + if (!instanceOrDesc) { + this._throwIfStrict(`[createInstance] ${id} depends on ${dependency.id} which is NOT registered.`, true); + } + this._globalGraph?.insertEdge(String(item.id), String(dependency.id)); + if (instanceOrDesc instanceof SyncDescriptor) { + const d = { id: dependency.id, desc: instanceOrDesc, _trace: item._trace.branch(dependency.id, true) }; + graph.insertEdge(item, d); + stack.push(d); + } + } + } + while (true) { + const roots = graph.roots(); + if (roots.length === 0) { + if (!graph.isEmpty()) { + throw new CyclicDependencyError(graph); + } + break; + } + for (const { data } of roots) { + const instanceOrDesc = this._getServiceInstanceOrDescriptor(data.id); + if (instanceOrDesc instanceof SyncDescriptor) { + const instance = this._createServiceInstanceWithOwner(data.id, data.desc.ctor, data.desc.staticArguments, data.desc.supportsDelayedInstantiation, data._trace); + this._setCreatedServiceInstance(data.id, instance); + } + graph.removeNode(data); + } + } + return this._getServiceInstanceOrDescriptor(id); + } + _createServiceInstanceWithOwner(id, ctor, args = [], supportsDelayedInstantiation, _trace) { + if (this._services.get(id) instanceof SyncDescriptor) { + return this._createServiceInstance(id, ctor, args, supportsDelayedInstantiation, _trace, this._servicesToMaybeDispose); + } else if (this._parent) { + return this._parent._createServiceInstanceWithOwner(id, ctor, args, supportsDelayedInstantiation, _trace); + } else { + throw new Error(`illegalState - creating UNKNOWN service instance ${ctor.name}`); + } + } + _createServiceInstance(id, ctor, args = [], supportsDelayedInstantiation, _trace, disposeBucket) { + if (!supportsDelayedInstantiation) { + const result = this._createInstance(ctor, args, _trace); + disposeBucket.add(result); + return result; + } else { + const child = new _InstantiationService(void 0, this._strict, this, this._enableTracing); + child._globalGraphImplicitDependency = String(id); + const earlyListeners = /* @__PURE__ */ new Map(); + const idle = new GlobalIdleValue(() => { + const result = child._createInstance(ctor, args, _trace); + for (const [key, values] of earlyListeners) { + const candidate = result[key]; + if (typeof candidate === "function") { + for (const value of values) { + value.disposable = candidate.apply(result, value.listener); + } + } + } + earlyListeners.clear(); + disposeBucket.add(result); + return result; + }); + return new Proxy(/* @__PURE__ */ Object.create(null), { + get(target, key) { + if (!idle.isInitialized) { + if (typeof key === "string" && (key.startsWith("onDid") || key.startsWith("onWill"))) { + let list2 = earlyListeners.get(key); + if (!list2) { + list2 = new LinkedList(); + earlyListeners.set(key, list2); + } + const event = (callback, thisArg, disposables) => { + if (idle.isInitialized) { + return idle.value[key](callback, thisArg, disposables); + } else { + const entry = { listener: [callback, thisArg, disposables], disposable: void 0 }; + const rm = list2.push(entry); + const result = toDisposable(() => { + rm(); + entry.disposable?.dispose(); + }); + return result; + } + }; + return event; + } + } + if (key in target) { + return target[key]; + } + const obj = idle.value; + let prop = obj[key]; + if (typeof prop !== "function") { + return prop; + } + prop = prop.bind(obj); + target[key] = prop; + return prop; + }, + set(_target, p, value) { + idle.value[p] = value; + return true; + }, + getPrototypeOf(_target) { + return ctor.prototype; + } + }); + } + } + _throwIfStrict(msg, printWarning) { + if (printWarning) { + console.warn(msg); + } + if (this._strict) { + throw new Error(msg); + } + } +}; +var Trace = class _Trace { + static { + this.all = /* @__PURE__ */ new Set(); + } + static { + this._None = new class extends _Trace { + constructor() { + super(0, null); + } + stop() { + } + branch() { + return this; + } + }(); + } + static traceInvocation(_enableTracing, ctor) { + return !_enableTracing ? _Trace._None : new _Trace(2, ctor.name || new Error().stack.split("\n").slice(3, 4).join("\n")); + } + static traceCreation(_enableTracing, ctor) { + return !_enableTracing ? _Trace._None : new _Trace(1, ctor.name); + } + static { + this._totals = 0; + } + constructor(type, name) { + this.type = type; + this.name = name; + this._start = Date.now(); + this._dep = []; + } + branch(id, first2) { + const child = new _Trace(3, id.toString()); + this._dep.push([id, first2, child]); + return child; + } + stop() { + const dur = Date.now() - this._start; + _Trace._totals += dur; + let causedCreation = false; + function printChild(n2, trace) { + const res = []; + const prefix = new Array(n2 + 1).join(" "); + for (const [id, first2, child] of trace._dep) { + if (first2 && child) { + causedCreation = true; + res.push(`${prefix}CREATES -> ${id}`); + const nested = printChild(n2 + 1, child); + if (nested) { + res.push(nested); + } + } else { + res.push(`${prefix}uses -> ${id}`); + } + } + return res.join("\n"); + } + const lines = [ + `${this.type === 1 ? "CREATE" : "CALL"} ${this.name}`, + `${printChild(1, this)}`, + `DONE, took ${dur.toFixed(2)}ms (grand total ${_Trace._totals.toFixed(2)}ms)` + ]; + if (dur > 2 || causedCreation) { + _Trace.all.add(lines.join("\n")); + } + } +}; + +// node_modules/monaco-editor-core/esm/vs/platform/markers/common/markerService.js +init_arrays(); +init_event(); +init_iterator(); +init_map(); +init_network(); +init_uri(); +init_nls(); +var unsupportedSchemas = /* @__PURE__ */ new Set([ + Schemas.inMemory, + Schemas.vscodeSourceControl, + Schemas.walkThrough, + Schemas.walkThroughSnippet, + Schemas.vscodeChatCodeBlock, + Schemas.vscodeTerminal +]); +var DoubleResourceMap = class { + constructor() { + this._byResource = new ResourceMap(); + this._byOwner = /* @__PURE__ */ new Map(); + } + set(resource, owner, value) { + let ownerMap = this._byResource.get(resource); + if (!ownerMap) { + ownerMap = /* @__PURE__ */ new Map(); + this._byResource.set(resource, ownerMap); + } + ownerMap.set(owner, value); + let resourceMap = this._byOwner.get(owner); + if (!resourceMap) { + resourceMap = new ResourceMap(); + this._byOwner.set(owner, resourceMap); + } + resourceMap.set(resource, value); + } + get(resource, owner) { + const ownerMap = this._byResource.get(resource); + return ownerMap?.get(owner); + } + delete(resource, owner) { + let removedA = false; + let removedB = false; + const ownerMap = this._byResource.get(resource); + if (ownerMap) { + removedA = ownerMap.delete(owner); + } + const resourceMap = this._byOwner.get(owner); + if (resourceMap) { + removedB = resourceMap.delete(resource); + } + if (removedA !== removedB) { + throw new Error("illegal state"); + } + return removedA && removedB; + } + values(key) { + if (typeof key === "string") { + return this._byOwner.get(key)?.values() ?? Iterable.empty(); + } + if (URI.isUri(key)) { + return this._byResource.get(key)?.values() ?? Iterable.empty(); + } + return Iterable.map(Iterable.concat(...this._byOwner.values()), (map) => map[1]); + } +}; +var MarkerStats = class { + constructor(service) { + this.errors = 0; + this.infos = 0; + this.warnings = 0; + this.unknowns = 0; + this._data = new ResourceMap(); + this._service = service; + this._subscription = service.onMarkerChanged(this._update, this); + } + dispose() { + this._subscription.dispose(); + } + _update(resources) { + for (const resource of resources) { + const oldStats = this._data.get(resource); + if (oldStats) { + this._substract(oldStats); + } + const newStats = this._resourceStats(resource); + this._add(newStats); + this._data.set(resource, newStats); + } + } + _resourceStats(resource) { + const result = { errors: 0, warnings: 0, infos: 0, unknowns: 0 }; + if (unsupportedSchemas.has(resource.scheme)) { + return result; + } + for (const { severity } of this._service.read({ resource })) { + if (severity === MarkerSeverity.Error) { + result.errors += 1; + } else if (severity === MarkerSeverity.Warning) { + result.warnings += 1; + } else if (severity === MarkerSeverity.Info) { + result.infos += 1; + } else { + result.unknowns += 1; + } + } + return result; + } + _substract(op) { + this.errors -= op.errors; + this.warnings -= op.warnings; + this.infos -= op.infos; + this.unknowns -= op.unknowns; + } + _add(op) { + this.errors += op.errors; + this.warnings += op.warnings; + this.infos += op.infos; + this.unknowns += op.unknowns; + } +}; +var MarkerService = class _MarkerService { + constructor() { + this._onMarkerChanged = new DebounceEmitter({ + delay: 0, + merge: _MarkerService._merge + }); + this.onMarkerChanged = this._onMarkerChanged.event; + this._data = new DoubleResourceMap(); + this._stats = new MarkerStats(this); + this._filteredResources = new ResourceMap(); + } + dispose() { + this._stats.dispose(); + this._onMarkerChanged.dispose(); + } + remove(owner, resources) { + for (const resource of resources || []) { + this.changeOne(owner, resource, []); + } + } + changeOne(owner, resource, markerData) { + if (isFalsyOrEmpty(markerData)) { + const removed = this._data.delete(resource, owner); + if (removed) { + this._onMarkerChanged.fire([resource]); + } + } else { + const markers = []; + for (const data of markerData) { + const marker = _MarkerService._toMarker(owner, resource, data); + if (marker) { + markers.push(marker); + } + } + this._data.set(resource, owner, markers); + this._onMarkerChanged.fire([resource]); + } + } + static _toMarker(owner, resource, data) { + let { code, severity, message, source, startLineNumber, startColumn, endLineNumber, endColumn, relatedInformation, tags, origin } = data; + if (!message) { + return void 0; + } + startLineNumber = startLineNumber > 0 ? startLineNumber : 1; + startColumn = startColumn > 0 ? startColumn : 1; + endLineNumber = endLineNumber >= startLineNumber ? endLineNumber : startLineNumber; + endColumn = endColumn > 0 ? endColumn : startColumn; + return { + resource, + owner, + code, + severity, + message, + source, + startLineNumber, + startColumn, + endLineNumber, + endColumn, + relatedInformation, + tags, + origin + }; + } + changeAll(owner, data) { + const changes = []; + const existing = this._data.values(owner); + if (existing) { + for (const data2 of existing) { + const first2 = Iterable.first(data2); + if (first2) { + changes.push(first2.resource); + this._data.delete(first2.resource, owner); + } + } + } + if (isNonEmptyArray(data)) { + const groups = new ResourceMap(); + for (const { resource, marker: markerData } of data) { + const marker = _MarkerService._toMarker(owner, resource, markerData); + if (!marker) { + continue; + } + const array2 = groups.get(resource); + if (!array2) { + groups.set(resource, [marker]); + changes.push(resource); + } else { + array2.push(marker); + } + } + for (const [resource, value] of groups) { + this._data.set(resource, owner, value); + } + } + if (changes.length > 0) { + this._onMarkerChanged.fire(changes); + } + } + /** + * Creates an information marker for filtered resources + */ + _createFilteredMarker(resource, reasons) { + const message = reasons.length === 1 ? localize(1738, 'Problems are paused because: "{0}"', reasons[0]) : localize(1739, 'Problems are paused because: "{0}" and {1} more', reasons[0], reasons.length - 1); + return { + owner: "markersFilter", + resource, + severity: MarkerSeverity.Info, + message, + startLineNumber: 1, + startColumn: 1, + endLineNumber: 1, + endColumn: 1 + }; + } + read(filter = /* @__PURE__ */ Object.create(null)) { + let { owner, resource, severities, take } = filter; + if (!take || take < 0) { + take = -1; + } + if (owner && resource) { + const reasons = !filter.ignoreResourceFilters ? this._filteredResources.get(resource) : void 0; + if (reasons?.length) { + const infoMarker = this._createFilteredMarker(resource, reasons); + return [infoMarker]; + } + const data = this._data.get(resource, owner); + if (!data) { + return []; + } + const result = []; + for (const marker of data) { + if (take > 0 && result.length === take) { + break; + } + const reasons2 = !filter.ignoreResourceFilters ? this._filteredResources.get(resource) : void 0; + if (reasons2?.length) { + result.push(this._createFilteredMarker(resource, reasons2)); + } else if (_MarkerService._accept(marker, severities)) { + result.push(marker); + } + } + return result; + } else { + const iterable = !owner && !resource ? this._data.values() : this._data.values(resource ?? owner); + const result = []; + const filtered = new ResourceSet(); + for (const markers of iterable) { + for (const data of markers) { + if (filtered.has(data.resource)) { + continue; + } + if (take > 0 && result.length === take) { + break; + } + const reasons = !filter.ignoreResourceFilters ? this._filteredResources.get(data.resource) : void 0; + if (reasons?.length) { + result.push(this._createFilteredMarker(data.resource, reasons)); + filtered.add(data.resource); + } else if (_MarkerService._accept(data, severities)) { + result.push(data); + } + } + } + return result; + } + } + static _accept(marker, severities) { + return severities === void 0 || (severities & marker.severity) === marker.severity; + } + // --- event debounce logic + static _merge(all) { + const set = new ResourceMap(); + for (const array2 of all) { + for (const item of array2) { + set.set(item, true); + } + } + return Array.from(set.keys()); + } +}; + +// node_modules/monaco-editor-core/esm/vs/platform/configuration/common/configurations.js +init_lifecycle(); +init_objects(); +init_configurationRegistry(); +init_platform2(); +var DefaultConfiguration = class extends Disposable { + get configurationModel() { + return this._configurationModel; + } + constructor(logService) { + super(); + this.logService = logService; + this._configurationModel = ConfigurationModel.createEmptyModel(logService); + } + reload() { + this.resetConfigurationModel(); + return this.configurationModel; + } + getConfigurationDefaultOverrides() { + return {}; + } + resetConfigurationModel() { + this._configurationModel = ConfigurationModel.createEmptyModel(this.logService); + const properties = Registry.as(Extensions4.Configuration).getConfigurationProperties(); + this.updateConfigurationModel(Object.keys(properties), properties); + } + updateConfigurationModel(properties, configurationProperties) { + const configurationDefaultsOverrides = this.getConfigurationDefaultOverrides(); + for (const key of properties) { + const defaultOverrideValue = configurationDefaultsOverrides[key]; + const propertySchema = configurationProperties[key]; + if (defaultOverrideValue !== void 0) { + this._configurationModel.setValue(key, defaultOverrideValue); + } else if (propertySchema) { + this._configurationModel.setValue(key, deepClone(propertySchema.default)); + } else { + this._configurationModel.removeValue(key); + } + } + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/standalone/browser/standaloneServices.js +init_languageFeatures(); +init_languageConfigurationRegistry(); + +// node_modules/monaco-editor-core/esm/vs/platform/log/common/logService.js +init_lifecycle(); +init_log(); +var LogService = class extends Disposable { + constructor(primaryLogger, otherLoggers = []) { + super(); + this.logger = new MultiplexLogger([primaryLogger, ...otherLoggers]); + this._register(primaryLogger.onDidChangeLogLevel((level) => this.setLevel(level))); + } + get onDidChangeLogLevel() { + return this.logger.onDidChangeLogLevel; + } + setLevel(level) { + this.logger.setLevel(level); + } + getLevel() { + return this.logger.getLevel(); + } + trace(message, ...args) { + this.logger.trace(message, ...args); + } + debug(message, ...args) { + this.logger.debug(message, ...args); + } + info(message, ...args) { + this.logger.info(message, ...args); + } + warn(message, ...args) { + this.logger.warn(message, ...args); + } + error(message, ...args) { + this.logger.error(message, ...args); + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/standalone/browser/standaloneServices.js +init_errors(); +init_environment(); +init_window(); +init_map(); +init_treeSitterLibraryService(); + +// node_modules/monaco-editor-core/esm/vs/editor/standalone/browser/standaloneTreeSitterLibraryService.js +var StandaloneTreeSitterLibraryService = class { + getParserClass() { + throw new Error("not implemented in StandaloneTreeSitterLibraryService"); + } + supportsLanguage(languageId, reader) { + return false; + } + getLanguage(languageId, ignoreSupportsCheck, reader) { + return void 0; + } + getInjectionQueries(languageId, reader) { + return null; + } + getHighlightingQueries(languageId, reader) { + return null; + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/standalone/browser/standaloneServices.js +var __decorate192 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param185 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var SimpleModel = class { + constructor(model) { + this.disposed = false; + this.model = model; + this._onWillDispose = new Emitter(); + } + get textEditorModel() { + return this.model; + } + dispose() { + this.disposed = true; + this._onWillDispose.fire(); + } +}; +var StandaloneTextModelService = class StandaloneTextModelService2 { + constructor(modelService) { + this.modelService = modelService; + } + createModelReference(resource) { + const model = this.modelService.getModel(resource); + if (!model) { + return Promise.reject(new Error(`Model not found`)); + } + return Promise.resolve(new ImmortalReference(new SimpleModel(model))); + } +}; +StandaloneTextModelService = __decorate192([ + __param185(0, IModelService) +], StandaloneTextModelService); +var StandaloneEditorProgressService = class _StandaloneEditorProgressService { + static { + this.NULL_PROGRESS_RUNNER = { + done: () => { + }, + total: () => { + }, + worked: () => { + } + }; + } + show() { + return _StandaloneEditorProgressService.NULL_PROGRESS_RUNNER; + } + async showWhile(promise, delay) { + await promise; + } +}; +var StandaloneProgressService = class { + withProgress(_options, task, onDidCancel) { + return task({ + report: () => { + } + }); + } +}; +var StandaloneEnvironmentService = class { + constructor() { + this.isExtensionDevelopment = false; + this.isBuilt = false; + } +}; +var StandaloneDialogService = class { + async confirm(confirmation) { + const confirmed = this.doConfirm(confirmation.message, confirmation.detail); + return { + confirmed, + checkboxChecked: false + // unsupported + }; + } + doConfirm(message, detail) { + let messageText = message; + if (detail) { + messageText = messageText + "\n\n" + detail; + } + return mainWindow.confirm(messageText); + } + async prompt(prompt) { + let result = void 0; + const confirmed = this.doConfirm(prompt.message, prompt.detail); + if (confirmed) { + const promptButtons = [...prompt.buttons ?? []]; + if (prompt.cancelButton && typeof prompt.cancelButton !== "string" && typeof prompt.cancelButton !== "boolean") { + promptButtons.push(prompt.cancelButton); + } + result = await promptButtons[0]?.run({ checkboxChecked: false }); + } + return { result }; + } + async error(message, detail) { + await this.prompt({ type: severity_default.Error, message, detail }); + } +}; +var StandaloneNotificationService = class _StandaloneNotificationService { + static { + this.NO_OP = new NoOpNotification(); + } + info(message) { + return this.notify({ severity: severity_default.Info, message }); + } + warn(message) { + return this.notify({ severity: severity_default.Warning, message }); + } + error(error) { + return this.notify({ severity: severity_default.Error, message: error }); + } + notify(notification) { + switch (notification.severity) { + case severity_default.Error: + console.error(notification.message); + break; + case severity_default.Warning: + console.warn(notification.message); + break; + default: + console.log(notification.message); + break; + } + return _StandaloneNotificationService.NO_OP; + } + prompt(severity, message, choices, options2) { + return _StandaloneNotificationService.NO_OP; + } + status(message, options2) { + return { close: () => { + } }; + } +}; +var StandaloneCommandService = class StandaloneCommandService2 { + constructor(instantiationService) { + this._onWillExecuteCommand = new Emitter(); + this._onDidExecuteCommand = new Emitter(); + this.onDidExecuteCommand = this._onDidExecuteCommand.event; + this._instantiationService = instantiationService; + } + executeCommand(id, ...args) { + const command = CommandsRegistry.getCommand(id); + if (!command) { + return Promise.reject(new Error(`command '${id}' not found`)); + } + try { + this._onWillExecuteCommand.fire({ commandId: id, args }); + const result = this._instantiationService.invokeFunction.apply(this._instantiationService, [command.handler, ...args]); + this._onDidExecuteCommand.fire({ commandId: id, args }); + return Promise.resolve(result); + } catch (err) { + return Promise.reject(err); + } + } +}; +StandaloneCommandService = __decorate192([ + __param185(0, IInstantiationService) +], StandaloneCommandService); +var StandaloneKeybindingService = class StandaloneKeybindingService2 extends AbstractKeybindingService { + constructor(contextKeyService, commandService, telemetryService, notificationService, logService, codeEditorService) { + super(contextKeyService, commandService, telemetryService, notificationService, logService); + this._cachedResolver = null; + this._dynamicKeybindings = []; + this._domNodeListeners = []; + const addContainer = (domNode) => { + const disposables = new DisposableStore(); + disposables.add(addDisposableListener(domNode, EventType.KEY_DOWN, (e) => { + const keyEvent = new StandardKeyboardEvent(e); + const shouldPreventDefault = this._dispatch(keyEvent, keyEvent.target); + if (shouldPreventDefault) { + keyEvent.preventDefault(); + keyEvent.stopPropagation(); + } + })); + disposables.add(addDisposableListener(domNode, EventType.KEY_UP, (e) => { + const keyEvent = new StandardKeyboardEvent(e); + const shouldPreventDefault = this._singleModifierDispatch(keyEvent, keyEvent.target); + if (shouldPreventDefault) { + keyEvent.preventDefault(); + } + })); + this._domNodeListeners.push(new DomNodeListeners(domNode, disposables)); + }; + const removeContainer = (domNode) => { + for (let i2 = 0; i2 < this._domNodeListeners.length; i2++) { + const domNodeListeners = this._domNodeListeners[i2]; + if (domNodeListeners.domNode === domNode) { + this._domNodeListeners.splice(i2, 1); + domNodeListeners.dispose(); + } + } + }; + const addCodeEditor = (codeEditor) => { + if (codeEditor.getOption( + 70 + /* EditorOption.inDiffEditor */ + )) { + return; + } + addContainer(codeEditor.getContainerDomNode()); + }; + const removeCodeEditor = (codeEditor) => { + if (codeEditor.getOption( + 70 + /* EditorOption.inDiffEditor */ + )) { + return; + } + removeContainer(codeEditor.getContainerDomNode()); + }; + this._register(codeEditorService.onCodeEditorAdd(addCodeEditor)); + this._register(codeEditorService.onCodeEditorRemove(removeCodeEditor)); + codeEditorService.listCodeEditors().forEach(addCodeEditor); + const addDiffEditor = (diffEditor) => { + addContainer(diffEditor.getContainerDomNode()); + }; + const removeDiffEditor = (diffEditor) => { + removeContainer(diffEditor.getContainerDomNode()); + }; + this._register(codeEditorService.onDiffEditorAdd(addDiffEditor)); + this._register(codeEditorService.onDiffEditorRemove(removeDiffEditor)); + codeEditorService.listDiffEditors().forEach(addDiffEditor); + } + addDynamicKeybinding(command, keybinding, handler, when) { + return combinedDisposable(CommandsRegistry.registerCommand(command, handler), this.addDynamicKeybindings([{ + keybinding, + command, + when + }])); + } + addDynamicKeybindings(rules) { + const entries2 = rules.map((rule) => { + const keybinding = decodeKeybinding(rule.keybinding, OS); + return { + keybinding, + command: rule.command ?? null, + commandArgs: rule.commandArgs, + when: rule.when, + weight1: 1e3, + weight2: 0, + extensionId: null, + isBuiltinExtension: false + }; + }); + this._dynamicKeybindings = this._dynamicKeybindings.concat(entries2); + this.updateResolver(); + return toDisposable(() => { + for (let i2 = 0; i2 < this._dynamicKeybindings.length; i2++) { + if (this._dynamicKeybindings[i2] === entries2[0]) { + this._dynamicKeybindings.splice(i2, entries2.length); + this.updateResolver(); + return; + } + } + }); + } + updateResolver() { + this._cachedResolver = null; + this._onDidUpdateKeybindings.fire(); + } + _getResolver() { + if (!this._cachedResolver) { + const defaults = this._toNormalizedKeybindingItems(KeybindingsRegistry.getDefaultKeybindings(), true); + const overrides = this._toNormalizedKeybindingItems(this._dynamicKeybindings, false); + this._cachedResolver = new KeybindingResolver(defaults, overrides, (str) => this._log(str)); + } + return this._cachedResolver; + } + _documentHasFocus() { + return mainWindow.document.hasFocus(); + } + _toNormalizedKeybindingItems(items, isDefault) { + const result = []; + let resultLen = 0; + for (const item of items) { + const when = item.when || void 0; + const keybinding = item.keybinding; + if (!keybinding) { + result[resultLen++] = new ResolvedKeybindingItem(void 0, item.command, item.commandArgs, when, isDefault, null, false); + } else { + const resolvedKeybindings = USLayoutResolvedKeybinding.resolveKeybinding(keybinding, OS); + for (const resolvedKeybinding of resolvedKeybindings) { + result[resultLen++] = new ResolvedKeybindingItem(resolvedKeybinding, item.command, item.commandArgs, when, isDefault, null, false); + } + } + } + return result; + } + resolveKeyboardEvent(keyboardEvent) { + const chord = new KeyCodeChord(keyboardEvent.ctrlKey, keyboardEvent.shiftKey, keyboardEvent.altKey, keyboardEvent.metaKey, keyboardEvent.keyCode); + return new USLayoutResolvedKeybinding([chord], OS); + } +}; +StandaloneKeybindingService = __decorate192([ + __param185(0, IContextKeyService), + __param185(1, ICommandService), + __param185(2, ITelemetryService), + __param185(3, INotificationService), + __param185(4, ILogService), + __param185(5, ICodeEditorService) +], StandaloneKeybindingService); +var DomNodeListeners = class extends Disposable { + constructor(domNode, disposables) { + super(); + this.domNode = domNode; + this._register(disposables); + } +}; +function isConfigurationOverrides(thing) { + return !!thing && typeof thing === "object" && (!thing.overrideIdentifier || typeof thing.overrideIdentifier === "string") && (!thing.resource || thing.resource instanceof URI); +} +var StandaloneConfigurationService = class StandaloneConfigurationService2 { + constructor(logService) { + this.logService = logService; + this._onDidChangeConfiguration = new Emitter(); + this.onDidChangeConfiguration = this._onDidChangeConfiguration.event; + const defaultConfiguration = new DefaultConfiguration(logService); + this._configuration = new Configuration(defaultConfiguration.reload(), ConfigurationModel.createEmptyModel(logService), ConfigurationModel.createEmptyModel(logService), ConfigurationModel.createEmptyModel(logService), ConfigurationModel.createEmptyModel(logService), ConfigurationModel.createEmptyModel(logService), new ResourceMap(), ConfigurationModel.createEmptyModel(logService), new ResourceMap(), logService); + defaultConfiguration.dispose(); + } + getValue(arg1, arg2) { + const section = typeof arg1 === "string" ? arg1 : void 0; + const overrides = isConfigurationOverrides(arg1) ? arg1 : isConfigurationOverrides(arg2) ? arg2 : {}; + return this._configuration.getValue(section, overrides, void 0); + } + updateValues(values) { + const previous = { data: this._configuration.toData() }; + const changedKeys = []; + for (const entry of values) { + const [key, value] = entry; + if (this.getValue(key) === value) { + continue; + } + this._configuration.updateValue(key, value); + changedKeys.push(key); + } + if (changedKeys.length > 0) { + const configurationChangeEvent = new ConfigurationChangeEvent({ keys: changedKeys, overrides: [] }, previous, this._configuration, void 0, this.logService); + configurationChangeEvent.source = 8; + this._onDidChangeConfiguration.fire(configurationChangeEvent); + } + return Promise.resolve(); + } + updateValue(key, value, arg3, arg4) { + return this.updateValues([[key, value]]); + } + inspect(key, options2 = {}) { + return this._configuration.inspect(key, options2, void 0); + } +}; +StandaloneConfigurationService = __decorate192([ + __param185(0, ILogService) +], StandaloneConfigurationService); +var StandaloneResourceConfigurationService = class StandaloneResourceConfigurationService2 { + constructor(configurationService, modelService, languageService) { + this.configurationService = configurationService; + this.modelService = modelService; + this.languageService = languageService; + this._onDidChangeConfiguration = new Emitter(); + this.configurationService.onDidChangeConfiguration((e) => { + this._onDidChangeConfiguration.fire({ affectedKeys: e.affectedKeys, affectsConfiguration: (resource, configuration) => e.affectsConfiguration(configuration) }); + }); + } + getValue(resource, arg2, arg3) { + const position = Position.isIPosition(arg2) ? arg2 : null; + const section = position ? typeof arg3 === "string" ? arg3 : void 0 : typeof arg2 === "string" ? arg2 : void 0; + const language2 = resource ? this.getLanguage(resource, position) : void 0; + if (typeof section === "undefined") { + return this.configurationService.getValue({ + resource, + overrideIdentifier: language2 + }); + } + return this.configurationService.getValue(section, { + resource, + overrideIdentifier: language2 + }); + } + getLanguage(resource, position) { + const model = this.modelService.getModel(resource); + if (model) { + return position ? model.getLanguageIdAtPosition(position.lineNumber, position.column) : model.getLanguageId(); + } + return this.languageService.guessLanguageIdByFilepathOrFirstLine(resource); + } +}; +StandaloneResourceConfigurationService = __decorate192([ + __param185(0, IConfigurationService), + __param185(1, IModelService), + __param185(2, ILanguageService) +], StandaloneResourceConfigurationService); +var StandaloneResourcePropertiesService = class StandaloneResourcePropertiesService2 { + constructor(configurationService) { + this.configurationService = configurationService; + } + getEOL(resource, language2) { + const eol = this.configurationService.getValue("files.eol", { overrideIdentifier: language2, resource }); + if (eol && typeof eol === "string" && eol !== "auto") { + return eol; + } + return isLinux || isMacintosh ? "\n" : "\r\n"; + } +}; +StandaloneResourcePropertiesService = __decorate192([ + __param185(0, IConfigurationService) +], StandaloneResourcePropertiesService); +var StandaloneTelemetryService = class { + publicLog2() { + } +}; +var StandaloneWorkspaceContextService = class _StandaloneWorkspaceContextService { + static { + this.SCHEME = "inmemory"; + } + constructor() { + const resource = URI.from({ scheme: _StandaloneWorkspaceContextService.SCHEME, authority: "model", path: "/" }); + this.workspace = { id: STANDALONE_EDITOR_WORKSPACE_ID, folders: [new WorkspaceFolder({ uri: resource, name: "", index: 0 })] }; + } + getWorkspace() { + return this.workspace; + } + getWorkspaceFolder(resource) { + return resource && resource.scheme === _StandaloneWorkspaceContextService.SCHEME ? this.workspace.folders[0] : null; + } +}; +function updateConfigurationService(configurationService, source, isDiffEditor2) { + if (!source) { + return; + } + if (!(configurationService instanceof StandaloneConfigurationService)) { + return; + } + const toUpdate = []; + Object.keys(source).forEach((key) => { + if (isEditorConfigurationKey(key)) { + toUpdate.push([`editor.${key}`, source[key]]); + } + if (isDiffEditor2 && isDiffEditorConfigurationKey(key)) { + toUpdate.push([`diffEditor.${key}`, source[key]]); + } + }); + if (toUpdate.length > 0) { + configurationService.updateValues(toUpdate); + } +} +var StandaloneBulkEditService = class StandaloneBulkEditService2 { + constructor(_modelService) { + this._modelService = _modelService; + } + hasPreviewHandler() { + return false; + } + async apply(editsIn, _options) { + const edits = Array.isArray(editsIn) ? editsIn : ResourceEdit.convert(editsIn); + const textEdits = /* @__PURE__ */ new Map(); + for (const edit2 of edits) { + if (!(edit2 instanceof ResourceTextEdit)) { + throw new Error("bad edit - only text edits are supported"); + } + const model = this._modelService.getModel(edit2.resource); + if (!model) { + throw new Error("bad edit - model not found"); + } + if (typeof edit2.versionId === "number" && model.getVersionId() !== edit2.versionId) { + throw new Error("bad state - model changed in the meantime"); + } + let array2 = textEdits.get(model); + if (!array2) { + array2 = []; + textEdits.set(model, array2); + } + array2.push(EditOperation.replaceMove(Range.lift(edit2.textEdit.range), edit2.textEdit.text)); + } + let totalEdits = 0; + let totalFiles = 0; + for (const [model, edits2] of textEdits) { + model.pushStackElement(); + model.pushEditOperations([], edits2, () => []); + model.pushStackElement(); + totalFiles += 1; + totalEdits += edits2.length; + } + return { + ariaSummary: format(StandaloneServicesNLS.bulkEditServiceSummary, totalEdits, totalFiles), + isApplied: totalEdits > 0 + }; + } +}; +StandaloneBulkEditService = __decorate192([ + __param185(0, IModelService) +], StandaloneBulkEditService); +var StandaloneUriLabelService = class { + getUriLabel(resource, options2) { + if (resource.scheme === "file") { + return resource.fsPath; + } + return resource.path; + } + getUriBasenameLabel(resource) { + return basename2(resource); + } +}; +var StandaloneContextViewService = class StandaloneContextViewService2 extends ContextViewService { + constructor(layoutService, _codeEditorService) { + super(layoutService); + this._codeEditorService = _codeEditorService; + } + showContextView(delegate, container, shadowRoot) { + if (!container) { + const codeEditor = this._codeEditorService.getFocusedCodeEditor() || this._codeEditorService.getActiveCodeEditor(); + if (codeEditor) { + container = codeEditor.getContainerDomNode(); + } + } + return super.showContextView(delegate, container, shadowRoot); + } +}; +StandaloneContextViewService = __decorate192([ + __param185(0, ILayoutService), + __param185(1, ICodeEditorService) +], StandaloneContextViewService); +var StandaloneWorkspaceTrustManagementService = class { + constructor() { + this._neverEmitter = new Emitter(); + this.onDidChangeTrust = this._neverEmitter.event; + } + isWorkspaceTrusted() { + return true; + } +}; +var StandaloneLanguageService = class extends LanguageService { + constructor() { + super(); + } +}; +var StandaloneLogService = class extends LogService { + constructor() { + super(new ConsoleLogger()); + } +}; +var StandaloneContextMenuService = class StandaloneContextMenuService2 extends ContextMenuService { + constructor(telemetryService, notificationService, contextViewService, keybindingService, menuService, contextKeyService) { + super(telemetryService, notificationService, contextViewService, keybindingService, menuService, contextKeyService); + this.configure({ blockMouse: false }); + } +}; +StandaloneContextMenuService = __decorate192([ + __param185(0, ITelemetryService), + __param185(1, INotificationService), + __param185(2, IContextViewService), + __param185(3, IKeybindingService), + __param185(4, IMenuService), + __param185(5, IContextKeyService) +], StandaloneContextMenuService); +var standaloneEditorWorkerDescriptor = { + esmModuleLocation: void 0, + label: "editorWorkerService" +}; +var StandaloneEditorWorkerService = class StandaloneEditorWorkerService2 extends EditorWorkerService { + constructor(modelService, configurationService, logService, languageConfigurationService, languageFeaturesService) { + super(standaloneEditorWorkerDescriptor, modelService, configurationService, logService, languageConfigurationService, languageFeaturesService); + } +}; +StandaloneEditorWorkerService = __decorate192([ + __param185(0, IModelService), + __param185(1, ITextResourceConfigurationService), + __param185(2, ILogService), + __param185(3, ILanguageConfigurationService), + __param185(4, ILanguageFeaturesService) +], StandaloneEditorWorkerService); +var StandaloneAccessbilitySignalService = class { + async playSignal(cue, options2) { + } +}; +registerSingleton( + ILogService, + StandaloneLogService, + 0 + /* InstantiationType.Eager */ +); +registerSingleton( + IConfigurationService, + StandaloneConfigurationService, + 0 + /* InstantiationType.Eager */ +); +registerSingleton( + ITextResourceConfigurationService, + StandaloneResourceConfigurationService, + 0 + /* InstantiationType.Eager */ +); +registerSingleton( + ITextResourcePropertiesService, + StandaloneResourcePropertiesService, + 0 + /* InstantiationType.Eager */ +); +registerSingleton( + IWorkspaceContextService, + StandaloneWorkspaceContextService, + 0 + /* InstantiationType.Eager */ +); +registerSingleton( + ILabelService, + StandaloneUriLabelService, + 0 + /* InstantiationType.Eager */ +); +registerSingleton( + ITelemetryService, + StandaloneTelemetryService, + 0 + /* InstantiationType.Eager */ +); +registerSingleton( + IDialogService, + StandaloneDialogService, + 0 + /* InstantiationType.Eager */ +); +registerSingleton( + IEnvironmentService, + StandaloneEnvironmentService, + 0 + /* InstantiationType.Eager */ +); +registerSingleton( + INotificationService, + StandaloneNotificationService, + 0 + /* InstantiationType.Eager */ +); +registerSingleton( + IMarkerService, + MarkerService, + 0 + /* InstantiationType.Eager */ +); +registerSingleton( + ILanguageService, + StandaloneLanguageService, + 0 + /* InstantiationType.Eager */ +); +registerSingleton( + IStandaloneThemeService, + StandaloneThemeService, + 0 + /* InstantiationType.Eager */ +); +registerSingleton( + IModelService, + ModelService, + 0 + /* InstantiationType.Eager */ +); +registerSingleton( + IMarkerDecorationsService, + MarkerDecorationsService, + 0 + /* InstantiationType.Eager */ +); +registerSingleton( + IContextKeyService, + ContextKeyService, + 0 + /* InstantiationType.Eager */ +); +registerSingleton( + IProgressService, + StandaloneProgressService, + 0 + /* InstantiationType.Eager */ +); +registerSingleton( + IEditorProgressService, + StandaloneEditorProgressService, + 0 + /* InstantiationType.Eager */ +); +registerSingleton( + IStorageService, + InMemoryStorageService, + 0 + /* InstantiationType.Eager */ +); +registerSingleton( + IEditorWorkerService, + StandaloneEditorWorkerService, + 0 + /* InstantiationType.Eager */ +); +registerSingleton( + IBulkEditService, + StandaloneBulkEditService, + 0 + /* InstantiationType.Eager */ +); +registerSingleton( + IWorkspaceTrustManagementService, + StandaloneWorkspaceTrustManagementService, + 0 + /* InstantiationType.Eager */ +); +registerSingleton( + ITextModelService, + StandaloneTextModelService, + 0 + /* InstantiationType.Eager */ +); +registerSingleton( + IAccessibilityService, + AccessibilityService, + 0 + /* InstantiationType.Eager */ +); +registerSingleton( + IListService, + ListService, + 0 + /* InstantiationType.Eager */ +); +registerSingleton( + ICommandService, + StandaloneCommandService, + 0 + /* InstantiationType.Eager */ +); +registerSingleton( + IKeybindingService, + StandaloneKeybindingService, + 0 + /* InstantiationType.Eager */ +); +registerSingleton( + IQuickInputService, + StandaloneQuickInputService, + 0 + /* InstantiationType.Eager */ +); +registerSingleton( + IContextViewService, + StandaloneContextViewService, + 0 + /* InstantiationType.Eager */ +); +registerSingleton( + IOpenerService, + OpenerService, + 0 + /* InstantiationType.Eager */ +); +registerSingleton( + IClipboardService, + BrowserClipboardService, + 0 + /* InstantiationType.Eager */ +); +registerSingleton( + IContextMenuService, + StandaloneContextMenuService, + 0 + /* InstantiationType.Eager */ +); +registerSingleton( + IMenuService, + MenuService, + 0 + /* InstantiationType.Eager */ +); +registerSingleton( + IAccessibilitySignalService, + StandaloneAccessbilitySignalService, + 0 + /* InstantiationType.Eager */ +); +registerSingleton( + ITreeSitterLibraryService, + StandaloneTreeSitterLibraryService, + 0 + /* InstantiationType.Eager */ +); +registerSingleton( + ILoggerService, + NullLoggerService, + 0 + /* InstantiationType.Eager */ +); +registerSingleton( + IDataChannelService, + NullDataChannelService, + 0 + /* InstantiationType.Eager */ +); +var StandaloneServices; +(function(StandaloneServices2) { + const serviceCollection = new ServiceCollection(); + for (const [id, descriptor] of getSingletonServiceDescriptors()) { + serviceCollection.set(id, descriptor); + } + const instantiationService = new InstantiationService(serviceCollection, true); + serviceCollection.set(IInstantiationService, instantiationService); + function get(serviceId) { + if (!initialized) { + initialize2({}); + } + const r = serviceCollection.get(serviceId); + if (!r) { + throw new Error("Missing service " + serviceId); + } + if (r instanceof SyncDescriptor) { + return instantiationService.invokeFunction((accessor) => accessor.get(serviceId)); + } else { + return r; + } + } + StandaloneServices2.get = get; + let initialized = false; + const onDidInitialize = new Emitter(); + function initialize2(overrides) { + if (initialized) { + return instantiationService; + } + initialized = true; + for (const [id, descriptor] of getSingletonServiceDescriptors()) { + if (!serviceCollection.get(id)) { + serviceCollection.set(id, descriptor); + } + } + for (const serviceId in overrides) { + if (overrides.hasOwnProperty(serviceId)) { + const serviceIdentifier = createDecorator(serviceId); + const r = serviceCollection.get(serviceIdentifier); + if (r instanceof SyncDescriptor) { + serviceCollection.set(serviceIdentifier, overrides[serviceId]); + } + } + } + const editorFeatures2 = getEditorFeatures(); + for (const feature of editorFeatures2) { + try { + instantiationService.createInstance(feature); + } catch (err) { + onUnexpectedError(err); + } + } + onDidInitialize.fire(); + return instantiationService; + } + StandaloneServices2.initialize = initialize2; + function withServices(callback) { + if (initialized) { + return callback(); + } + const disposable = new DisposableStore(); + const listener = disposable.add(onDidInitialize.event(() => { + listener.dispose(); + disposable.add(callback()); + })); + return disposable; + } + StandaloneServices2.withServices = withServices; +})(StandaloneServices || (StandaloneServices = {})); + +// node_modules/monaco-editor-core/esm/vs/editor/standalone/browser/standaloneCodeEditor.js +init_standaloneTheme(); +init_actions2(); +init_commands(); +init_configuration(); +init_contextkey(); +init_instantiation(); +init_themeService(); +init_standaloneStrings(); +init_model(); +init_language(); +init_modesRegistry(); +init_languageConfigurationRegistry(); +init_languageFeatures(); +init_window(); + +// node_modules/monaco-editor-core/esm/vs/editor/browser/widget/markdownRenderer/browser/editorMarkdownCodeBlockRenderer.js +init_dom(); +init_configuration(); +init_language(); +init_modesRegistry(); +var __decorate193 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param186 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var EditorMarkdownCodeBlockRenderer_1; +var EditorMarkdownCodeBlockRenderer = class EditorMarkdownCodeBlockRenderer2 { + static { + EditorMarkdownCodeBlockRenderer_1 = this; + } + static { + this._ttpTokenizer = createTrustedTypesPolicy("tokenizeToString", { + createHTML(html3) { + return html3; + } + }); + } + constructor(_configurationService, _languageService) { + this._configurationService = _configurationService; + this._languageService = _languageService; + } + async renderCodeBlock(languageAlias, value, options2) { + const editor2 = isCodeEditor(options2.context) ? options2.context : void 0; + let languageId; + if (languageAlias) { + languageId = this._languageService.getLanguageIdByLanguageName(languageAlias); + } else if (editor2) { + languageId = editor2.getModel()?.getLanguageId(); + } + if (!languageId) { + languageId = PLAINTEXT_LANGUAGE_ID; + } + const html3 = await tokenizeToString(this._languageService, value, languageId); + const content = EditorMarkdownCodeBlockRenderer_1._ttpTokenizer ? EditorMarkdownCodeBlockRenderer_1._ttpTokenizer.createHTML(html3) ?? html3 : html3; + const root = document.createElement("span"); + root.innerHTML = content; + const codeElement = root.querySelector(".monaco-tokenized-source"); + if (!isHTMLElement(codeElement)) { + return document.createElement("span"); + } + applyFontInfo(codeElement, this.getFontInfo(editor2)); + return root; + } + getFontInfo(editor2) { + if (editor2) { + return editor2.getOption( + 59 + /* EditorOption.fontInfo */ + ); + } else { + return createBareFontInfoFromRawSettings({ + fontFamily: this._configurationService.getValue("editor").fontFamily + }, 1); + } + } +}; +EditorMarkdownCodeBlockRenderer = EditorMarkdownCodeBlockRenderer_1 = __decorate193([ + __param186(0, IConfigurationService), + __param186(1, ILanguageService) +], EditorMarkdownCodeBlockRenderer); + +// node_modules/monaco-editor-core/esm/vs/editor/standalone/browser/standaloneCodeEditor.js +var __decorate194 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param187 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var LAST_GENERATED_COMMAND_ID = 0; +var ariaDomNodeCreated = false; +function createAriaDomNode(parent) { + if (!parent) { + if (ariaDomNodeCreated) { + return; + } + ariaDomNodeCreated = true; + } + setARIAContainer(parent || mainWindow.document.body); +} +var StandaloneCodeEditor = class StandaloneCodeEditor2 extends CodeEditorWidget { + constructor(domElement, _options, instantiationService, codeEditorService, commandService, contextKeyService, hoverService, keybindingService, themeService, notificationService, accessibilityService, languageConfigurationService, languageFeaturesService, markdownRendererService) { + const options2 = { ..._options }; + options2.ariaLabel = options2.ariaLabel || StandaloneCodeEditorNLS.editorViewAccessibleLabel; + super(domElement, options2, {}, instantiationService, codeEditorService, commandService, contextKeyService, themeService, notificationService, accessibilityService, languageConfigurationService, languageFeaturesService); + if (keybindingService instanceof StandaloneKeybindingService) { + this._standaloneKeybindingService = keybindingService; + } else { + this._standaloneKeybindingService = null; + } + createAriaDomNode(options2.ariaContainerElement); + setHoverDelegateFactory((placement, enableInstantHover) => instantiationService.createInstance(WorkbenchHoverDelegate, placement, { instantHover: enableInstantHover }, {})); + setBaseLayerHoverDelegate(hoverService); + markdownRendererService.setDefaultCodeBlockRenderer(instantiationService.createInstance(EditorMarkdownCodeBlockRenderer)); + } + addCommand(keybinding, handler, context) { + if (!this._standaloneKeybindingService) { + console.warn("Cannot add command because the editor is configured with an unrecognized KeybindingService"); + return null; + } + const commandId = "DYNAMIC_" + ++LAST_GENERATED_COMMAND_ID; + const whenExpression = ContextKeyExpr.deserialize(context); + this._standaloneKeybindingService.addDynamicKeybinding(commandId, keybinding, handler, whenExpression); + return commandId; + } + createContextKey(key, defaultValue) { + return this._contextKeyService.createKey(key, defaultValue); + } + addAction(_descriptor) { + if (typeof _descriptor.id !== "string" || typeof _descriptor.label !== "string" || typeof _descriptor.run !== "function") { + throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!"); + } + if (!this._standaloneKeybindingService) { + console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"); + return Disposable.None; + } + const id = _descriptor.id; + const label = _descriptor.label; + const precondition = ContextKeyExpr.and(ContextKeyExpr.equals("editorId", this.getId()), ContextKeyExpr.deserialize(_descriptor.precondition)); + const keybindings = _descriptor.keybindings; + const keybindingsWhen = ContextKeyExpr.and(precondition, ContextKeyExpr.deserialize(_descriptor.keybindingContext)); + const contextMenuGroupId = _descriptor.contextMenuGroupId || null; + const contextMenuOrder = _descriptor.contextMenuOrder || 0; + const run = (_accessor, ...args) => { + return Promise.resolve(_descriptor.run(this, ...args)); + }; + const toDispose = new DisposableStore(); + const uniqueId = this.getId() + ":" + id; + toDispose.add(CommandsRegistry.registerCommand(uniqueId, run)); + if (contextMenuGroupId) { + const menuItem = { + command: { + id: uniqueId, + title: label + }, + when: precondition, + group: contextMenuGroupId, + order: contextMenuOrder + }; + toDispose.add(MenuRegistry.appendMenuItem(MenuId.EditorContext, menuItem)); + } + if (Array.isArray(keybindings)) { + for (const kb of keybindings) { + toDispose.add(this._standaloneKeybindingService.addDynamicKeybinding(uniqueId, kb, run, keybindingsWhen)); + } + } + const internalAction = new InternalEditorAction(uniqueId, label, label, void 0, precondition, (...args) => Promise.resolve(_descriptor.run(this, ...args)), this._contextKeyService); + this._actions.set(id, internalAction); + toDispose.add(toDisposable(() => { + this._actions.delete(id); + })); + return toDispose; + } + _triggerCommand(handlerId, payload) { + if (this._codeEditorService instanceof StandaloneCodeEditorService) { + try { + this._codeEditorService.setActiveCodeEditor(this); + super._triggerCommand(handlerId, payload); + } finally { + this._codeEditorService.setActiveCodeEditor(null); + } + } else { + super._triggerCommand(handlerId, payload); + } + } +}; +StandaloneCodeEditor = __decorate194([ + __param187(2, IInstantiationService), + __param187(3, ICodeEditorService), + __param187(4, ICommandService), + __param187(5, IContextKeyService), + __param187(6, IHoverService), + __param187(7, IKeybindingService), + __param187(8, IThemeService), + __param187(9, INotificationService), + __param187(10, IAccessibilityService), + __param187(11, ILanguageConfigurationService), + __param187(12, ILanguageFeaturesService), + __param187(13, IMarkdownRendererService) +], StandaloneCodeEditor); +var StandaloneEditor = class StandaloneEditor2 extends StandaloneCodeEditor { + constructor(domElement, _options, instantiationService, codeEditorService, commandService, contextKeyService, hoverService, keybindingService, themeService, notificationService, configurationService, accessibilityService, modelService, languageService, languageConfigurationService, languageFeaturesService, markdownRendererService) { + const options2 = { ..._options }; + updateConfigurationService(configurationService, options2, false); + const themeDomRegistration = themeService.registerEditorContainer(domElement); + if (typeof options2.theme === "string") { + themeService.setTheme(options2.theme); + } + if (typeof options2.autoDetectHighContrast !== "undefined") { + themeService.setAutoDetectHighContrast(Boolean(options2.autoDetectHighContrast)); + } + const _model = options2.model; + delete options2.model; + super(domElement, options2, instantiationService, codeEditorService, commandService, contextKeyService, hoverService, keybindingService, themeService, notificationService, accessibilityService, languageConfigurationService, languageFeaturesService, markdownRendererService); + this._configurationService = configurationService; + this._standaloneThemeService = themeService; + this._register(themeDomRegistration); + let model; + if (typeof _model === "undefined") { + const languageId = languageService.getLanguageIdByMimeType(options2.language) || options2.language || PLAINTEXT_LANGUAGE_ID; + model = createTextModel(modelService, languageService, options2.value || "", languageId, void 0); + this._ownsModel = true; + } else { + model = _model; + this._ownsModel = false; + } + this._attachModel(model); + if (model) { + const e = { + oldModelUrl: null, + newModelUrl: model.uri + }; + this._onDidChangeModel.fire(e); + } + } + dispose() { + super.dispose(); + } + updateOptions(newOptions) { + updateConfigurationService(this._configurationService, newOptions, false); + if (typeof newOptions.theme === "string") { + this._standaloneThemeService.setTheme(newOptions.theme); + } + if (typeof newOptions.autoDetectHighContrast !== "undefined") { + this._standaloneThemeService.setAutoDetectHighContrast(Boolean(newOptions.autoDetectHighContrast)); + } + super.updateOptions(newOptions); + } + _postDetachModelCleanup(detachedModel) { + super._postDetachModelCleanup(detachedModel); + if (detachedModel && this._ownsModel) { + detachedModel.dispose(); + this._ownsModel = false; + } + } +}; +StandaloneEditor = __decorate194([ + __param187(2, IInstantiationService), + __param187(3, ICodeEditorService), + __param187(4, ICommandService), + __param187(5, IContextKeyService), + __param187(6, IHoverService), + __param187(7, IKeybindingService), + __param187(8, IStandaloneThemeService), + __param187(9, INotificationService), + __param187(10, IConfigurationService), + __param187(11, IAccessibilityService), + __param187(12, IModelService), + __param187(13, ILanguageService), + __param187(14, ILanguageConfigurationService), + __param187(15, ILanguageFeaturesService), + __param187(16, IMarkdownRendererService) +], StandaloneEditor); +var StandaloneDiffEditor2 = class StandaloneDiffEditor22 extends DiffEditorWidget { + constructor(domElement, _options, instantiationService, contextKeyService, codeEditorService, themeService, notificationService, configurationService, contextMenuService, editorProgressService, clipboardService, accessibilitySignalService) { + const options2 = { ..._options }; + updateConfigurationService(configurationService, options2, true); + const themeDomRegistration = themeService.registerEditorContainer(domElement); + if (typeof options2.theme === "string") { + themeService.setTheme(options2.theme); + } + if (typeof options2.autoDetectHighContrast !== "undefined") { + themeService.setAutoDetectHighContrast(Boolean(options2.autoDetectHighContrast)); + } + super(domElement, options2, {}, contextKeyService, instantiationService, codeEditorService, accessibilitySignalService, editorProgressService); + this._configurationService = configurationService; + this._standaloneThemeService = themeService; + this._register(themeDomRegistration); + } + dispose() { + super.dispose(); + } + updateOptions(newOptions) { + updateConfigurationService(this._configurationService, newOptions, true); + if (typeof newOptions.theme === "string") { + this._standaloneThemeService.setTheme(newOptions.theme); + } + if (typeof newOptions.autoDetectHighContrast !== "undefined") { + this._standaloneThemeService.setAutoDetectHighContrast(Boolean(newOptions.autoDetectHighContrast)); + } + super.updateOptions(newOptions); + } + _createInnerEditor(instantiationService, container, options2) { + return instantiationService.createInstance(StandaloneCodeEditor, container, options2); + } + getOriginalEditor() { + return super.getOriginalEditor(); + } + getModifiedEditor() { + return super.getModifiedEditor(); + } + addCommand(keybinding, handler, context) { + return this.getModifiedEditor().addCommand(keybinding, handler, context); + } + createContextKey(key, defaultValue) { + return this.getModifiedEditor().createContextKey(key, defaultValue); + } + addAction(descriptor) { + return this.getModifiedEditor().addAction(descriptor); + } +}; +StandaloneDiffEditor2 = __decorate194([ + __param187(2, IInstantiationService), + __param187(3, IContextKeyService), + __param187(4, ICodeEditorService), + __param187(5, IStandaloneThemeService), + __param187(6, INotificationService), + __param187(7, IConfigurationService), + __param187(8, IContextMenuService), + __param187(9, IEditorProgressService), + __param187(10, IClipboardService), + __param187(11, IAccessibilitySignalService) +], StandaloneDiffEditor2); +function createTextModel(modelService, languageService, value, languageId, uri) { + value = value || ""; + if (!languageId) { + const firstLF = value.indexOf("\n"); + let firstLine = value; + if (firstLF !== -1) { + firstLine = value.substring(0, firstLF); + } + return doCreateModel(modelService, value, languageService.createByFilepathOrFirstLine(uri || null, firstLine), uri); + } + return doCreateModel(modelService, value, languageService.createById(languageId), uri); +} +function doCreateModel(modelService, value, languageSelection, uri) { + return modelService.createModel(value, languageSelection, uri); +} + +// node_modules/monaco-editor-core/esm/vs/editor/standalone/browser/standaloneEditor.js +init_standaloneTheme(); +init_actions2(); +init_commands(); +init_contextkey(); + +// node_modules/monaco-editor-core/esm/vs/editor/browser/widget/multiDiffEditor/multiDiffEditorWidget.js +init_lifecycle(); +init_observable(); +init_instantiation(); + +// node_modules/monaco-editor-core/esm/vs/editor/browser/widget/multiDiffEditor/colors.js +init_nls(); +init_colorRegistry(); +var multiDiffEditorHeaderBackground = registerColor("multiDiffEditor.headerBackground", { dark: "#262626", light: "tab.inactiveBackground", hcDark: "tab.inactiveBackground", hcLight: "tab.inactiveBackground" }, localize(142, "The background color of the diff editor's header")); +var multiDiffEditorBackground = registerColor("multiDiffEditor.background", editorBackground, localize(143, "The background color of the multi file diff editor")); +var multiDiffEditorBorder = registerColor("multiDiffEditor.border", { dark: "sideBarSectionHeader.border", light: "#cccccc", hcDark: "sideBarSectionHeader.border", hcLight: "#cccccc" }, localize(144, "The border color of the multi file diff editor")); + +// node_modules/monaco-editor-core/esm/vs/editor/browser/widget/multiDiffEditor/diffEditorItemTemplate.js +init_dom(); +init_codicons(); +init_lifecycle(); +init_observable(); +init_actions2(); +init_contextkey(); +init_instantiation(); +init_observableCodeEditor(); +var __decorate195 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param188 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var TemplateData = class { + constructor(viewModel, deltaScrollVertical) { + this.viewModel = viewModel; + this.deltaScrollVertical = deltaScrollVertical; + } + getId() { + return this.viewModel; + } +}; +var DiffEditorItemTemplate = class DiffEditorItemTemplate2 extends Disposable { + constructor(_container, _overflowWidgetsDomNode, _workbenchUIElementFactory, _instantiationService, _parentContextKeyService) { + super(); + this._container = _container; + this._overflowWidgetsDomNode = _overflowWidgetsDomNode; + this._workbenchUIElementFactory = _workbenchUIElementFactory; + this._instantiationService = _instantiationService; + this._viewModel = observableValue(this, void 0); + this._collapsed = derived(this, (reader) => this._viewModel.read(reader)?.collapsed.read(reader)); + this._editorContentHeight = observableValue(this, 500); + this.contentHeight = derived(this, (reader) => { + const h2 = this._collapsed.read(reader) ? 0 : this._editorContentHeight.read(reader); + return h2 + this._outerEditorHeight; + }); + this._modifiedContentWidth = observableValue(this, 0); + this._modifiedWidth = observableValue(this, 0); + this._originalContentWidth = observableValue(this, 0); + this._originalWidth = observableValue(this, 0); + this.maxScroll = derived(this, (reader) => { + const scroll1 = this._modifiedContentWidth.read(reader) - this._modifiedWidth.read(reader); + const scroll2 = this._originalContentWidth.read(reader) - this._originalWidth.read(reader); + if (scroll1 > scroll2) { + return { maxScroll: scroll1, width: this._modifiedWidth.read(reader) }; + } else { + return { maxScroll: scroll2, width: this._originalWidth.read(reader) }; + } + }); + this._elements = h("div.multiDiffEntry", [ + h("div.header@header", [ + h("div.header-content", [ + h("div.collapse-button@collapseButton"), + h("div.file-path", [ + // eslint-disable-next-line local/code-no-any-casts, @typescript-eslint/no-explicit-any + h("div.title.modified.show-file-icons@primaryPath", []), + h("div.status.deleted@status", ["R"]), + // eslint-disable-next-line local/code-no-any-casts, @typescript-eslint/no-explicit-any + h("div.title.original.show-file-icons@secondaryPath", []) + ]), + h("div.actions@actions") + ]) + ]), + h("div.editorParent", [ + h("div.editorContainer@editor") + ]) + ]); + this.editor = this._register(this._instantiationService.createInstance(DiffEditorWidget, this._elements.editor, { + overflowWidgetsDomNode: this._overflowWidgetsDomNode, + fixedOverflowWidgets: true + }, {})); + this.isModifedFocused = observableCodeEditor(this.editor.getModifiedEditor()).isFocused; + this.isOriginalFocused = observableCodeEditor(this.editor.getOriginalEditor()).isFocused; + this.isFocused = derived(this, (reader) => this.isModifedFocused.read(reader) || this.isOriginalFocused.read(reader)); + this._resourceLabel = this._workbenchUIElementFactory.createResourceLabel ? this._register(this._workbenchUIElementFactory.createResourceLabel(this._elements.primaryPath)) : void 0; + this._resourceLabel2 = this._workbenchUIElementFactory.createResourceLabel ? this._register(this._workbenchUIElementFactory.createResourceLabel(this._elements.secondaryPath)) : void 0; + this._dataStore = this._register(new DisposableStore()); + this._headerHeight = 40; + this._lastScrollTop = -1; + this._isSettingScrollTop = false; + const btn = new Button(this._elements.collapseButton, {}); + this._register(autorun((reader) => { + btn.element.className = ""; + btn.icon = this._collapsed.read(reader) ? Codicon.chevronRight : Codicon.chevronDown; + })); + this._register(btn.onDidClick(() => { + this._viewModel.get()?.collapsed.set(!this._collapsed.get(), void 0); + })); + this._register(autorun((reader) => { + this._elements.editor.style.display = this._collapsed.read(reader) ? "none" : "block"; + })); + this._register(this.editor.getModifiedEditor().onDidLayoutChange((e) => { + const width2 = this.editor.getModifiedEditor().getLayoutInfo().contentWidth; + this._modifiedWidth.set(width2, void 0); + })); + this._register(this.editor.getOriginalEditor().onDidLayoutChange((e) => { + const width2 = this.editor.getOriginalEditor().getLayoutInfo().contentWidth; + this._originalWidth.set(width2, void 0); + })); + this._register(this.editor.onDidContentSizeChange((e) => { + globalTransaction((tx) => { + this._editorContentHeight.set(e.contentHeight, tx); + this._modifiedContentWidth.set(this.editor.getModifiedEditor().getContentWidth(), tx); + this._originalContentWidth.set(this.editor.getOriginalEditor().getContentWidth(), tx); + }); + })); + this._register(this.editor.getOriginalEditor().onDidScrollChange((e) => { + if (this._isSettingScrollTop) { + return; + } + if (!e.scrollTopChanged || !this._data) { + return; + } + const delta = e.scrollTop - this._lastScrollTop; + this._data.deltaScrollVertical(delta); + })); + this._register(autorun((reader) => { + const isActive = this._viewModel.read(reader)?.isActive.read(reader); + this._elements.root.classList.toggle("active", isActive); + })); + this._container.appendChild(this._elements.root); + this._outerEditorHeight = this._headerHeight; + this._contextKeyService = this._register(_parentContextKeyService.createScoped(this._elements.actions)); + const instantiationService = this._register(this._instantiationService.createChild(new ServiceCollection([IContextKeyService, this._contextKeyService]))); + this._register(instantiationService.createInstance(MenuWorkbenchToolBar, this._elements.actions, MenuId.MultiDiffEditorFileToolbar, { + actionRunner: this._register(new ActionRunnerWithContext(() => this._viewModel.get()?.modifiedUri ?? this._viewModel.get()?.originalUri)), + menuOptions: { + shouldForwardArgs: true + }, + toolbarOptions: { primaryGroup: (g) => g.startsWith("navigation") }, + actionViewItemProvider: (action, options2) => createActionViewItem(instantiationService, action, options2) + })); + } + setScrollLeft(left) { + if (this._modifiedContentWidth.get() - this._modifiedWidth.get() > this._originalContentWidth.get() - this._originalWidth.get()) { + this.editor.getModifiedEditor().setScrollLeft(left); + } else { + this.editor.getOriginalEditor().setScrollLeft(left); + } + } + setData(data) { + this._data = data; + function updateOptions(options2) { + return { + ...options2, + scrollBeyondLastLine: false, + hideUnchangedRegions: { + enabled: true + }, + scrollbar: { + vertical: "hidden", + horizontal: "hidden", + handleMouseWheel: false, + useShadows: false + }, + renderOverviewRuler: false, + fixedOverflowWidgets: true, + overviewRulerBorder: false + }; + } + if (!data) { + globalTransaction((tx) => { + this._viewModel.set(void 0, tx); + this.editor.setDiffModel(null, tx); + this._dataStore.clear(); + }); + return; + } + const value = data.viewModel.documentDiffItem; + globalTransaction((tx) => { + this._resourceLabel?.setUri(data.viewModel.modifiedUri ?? data.viewModel.originalUri, { strikethrough: data.viewModel.modifiedUri === void 0 }); + let isRenamed = false; + let isDeleted = false; + let isAdded = false; + let flag = ""; + if (data.viewModel.modifiedUri && data.viewModel.originalUri && data.viewModel.modifiedUri.path !== data.viewModel.originalUri.path) { + flag = "R"; + isRenamed = true; + } else if (!data.viewModel.modifiedUri) { + flag = "D"; + isDeleted = true; + } else if (!data.viewModel.originalUri) { + flag = "A"; + isAdded = true; + } + this._elements.status.classList.toggle("renamed", isRenamed); + this._elements.status.classList.toggle("deleted", isDeleted); + this._elements.status.classList.toggle("added", isAdded); + this._elements.status.innerText = flag; + this._resourceLabel2?.setUri(isRenamed ? data.viewModel.originalUri : void 0, { strikethrough: true }); + this._dataStore.clear(); + this._viewModel.set(data.viewModel, tx); + this.editor.setDiffModel(data.viewModel.diffEditorViewModelRef, tx); + this.editor.updateOptions(updateOptions(value.options ?? {})); + }); + if (value.onOptionsDidChange) { + this._dataStore.add(value.onOptionsDidChange(() => { + this.editor.updateOptions(updateOptions(value.options ?? {})); + })); + } + data.viewModel.isAlive.recomputeInitiallyAndOnChange(this._dataStore, (value2) => { + if (!value2) { + this.setData(void 0); + } + }); + if (data.viewModel.documentDiffItem.contextKeys) { + for (const [key, value2] of Object.entries(data.viewModel.documentDiffItem.contextKeys)) { + this._contextKeyService.createKey(key, value2); + } + } + } + render(verticalRange, width2, editorScroll, viewPort) { + this._elements.root.style.visibility = "visible"; + this._elements.root.style.top = `${verticalRange.start}px`; + this._elements.root.style.height = `${verticalRange.length}px`; + this._elements.root.style.width = `${width2}px`; + this._elements.root.style.position = "absolute"; + const maxDelta = verticalRange.length - this._headerHeight; + const delta = Math.max(0, Math.min(viewPort.start - verticalRange.start, maxDelta)); + this._elements.header.style.transform = `translateY(${delta}px)`; + globalTransaction((tx) => { + this.editor.layout({ + width: width2 - 2 * 8 - 2 * 1, + height: verticalRange.length - this._outerEditorHeight + }); + }); + try { + this._isSettingScrollTop = true; + this._lastScrollTop = editorScroll; + this.editor.getOriginalEditor().setScrollTop(editorScroll); + } finally { + this._isSettingScrollTop = false; + } + this._elements.header.classList.toggle("shadow", delta > 0 || editorScroll > 0); + this._elements.header.classList.toggle("collapsed", delta === maxDelta); + } + hide() { + this._elements.root.style.top = `-100000px`; + this._elements.root.style.visibility = "hidden"; + } +}; +DiffEditorItemTemplate = __decorate195([ + __param188(3, IInstantiationService), + __param188(4, IContextKeyService) +], DiffEditorItemTemplate); + +// node_modules/monaco-editor-core/esm/vs/editor/browser/widget/multiDiffEditor/multiDiffEditorWidgetImpl.js +init_dom(); +init_arrays(); +init_arraysFind(); +init_errors(); +init_lifecycle(); +init_observable(); +init_nls(); +init_contextkey(); +init_instantiation(); +init_offsetRange(); +init_selection(); +init_editorContextKeys(); +init_utils5(); + +// node_modules/monaco-editor-core/esm/vs/editor/browser/widget/multiDiffEditor/objectPool.js +var ObjectPool = class { + constructor(_create) { + this._create = _create; + this._unused = /* @__PURE__ */ new Set(); + this._used = /* @__PURE__ */ new Set(); + this._itemData = /* @__PURE__ */ new Map(); + } + getUnusedObj(data) { + let obj; + if (this._unused.size === 0) { + obj = this._create(data); + this._itemData.set(obj, data); + } else { + const values = [...this._unused.values()]; + obj = values.find((obj2) => this._itemData.get(obj2).getId() === data.getId()) ?? values[0]; + this._unused.delete(obj); + this._itemData.set(obj, data); + obj.setData(data); + } + this._used.add(obj); + return { + object: obj, + dispose: () => { + this._used.delete(obj); + if (this._unused.size > 5) { + obj.dispose(); + } else { + this._unused.add(obj); + } + } + }; + } + dispose() { + for (const obj of this._used) { + obj.dispose(); + } + for (const obj of this._unused) { + obj.dispose(); + } + this._used.clear(); + this._unused.clear(); + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/browser/widget/multiDiffEditor/multiDiffEditorWidgetImpl.js +var __decorate196 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param189 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var MultiDiffEditorWidgetImpl = class MultiDiffEditorWidgetImpl2 extends Disposable { + constructor(_element, _dimension, _viewModel, _workbenchUIElementFactory, _parentContextKeyService, _parentInstantiationService) { + super(); + this._element = _element; + this._dimension = _dimension; + this._viewModel = _viewModel; + this._workbenchUIElementFactory = _workbenchUIElementFactory; + this._parentContextKeyService = _parentContextKeyService; + this._parentInstantiationService = _parentInstantiationService; + this._scrollableElements = h("div.scrollContent", [ + h("div@content", { + style: { + overflow: "hidden" + } + }), + h("div.monaco-editor@overflowWidgetsDomNode", {}) + ]); + this._scrollable = this._register(new Scrollable({ + forceIntegerValues: false, + scheduleAtNextAnimationFrame: (cb) => scheduleAtNextAnimationFrame(getWindow(this._element), cb), + smoothScrollDuration: 100 + })); + this._scrollableElement = this._register(new SmoothScrollableElement(this._scrollableElements.root, { + vertical: 1, + horizontal: 1, + useShadows: false + }, this._scrollable)); + this._elements = h("div.monaco-component.multiDiffEditor", {}, [ + h("div", {}, [this._scrollableElement.getDomNode()]), + h("div.placeholder@placeholder", {}, [h("div")]) + ]); + this._sizeObserver = this._register(new ObservableElementSizeObserver(this._element, void 0)); + this._objectPool = this._register(new ObjectPool((data) => { + const template = this._instantiationService.createInstance(DiffEditorItemTemplate, this._scrollableElements.content, this._scrollableElements.overflowWidgetsDomNode, this._workbenchUIElementFactory); + template.setData(data); + return template; + })); + this.scrollTop = observableFromEvent(this, this._scrollableElement.onScroll, () => ( + /** @description scrollTop */ + this._scrollableElement.getScrollPosition().scrollTop + )); + this.scrollLeft = observableFromEvent(this, this._scrollableElement.onScroll, () => ( + /** @description scrollLeft */ + this._scrollableElement.getScrollPosition().scrollLeft + )); + this._viewItemsInfo = derived(this, (reader) => { + const vm = this._viewModel.read(reader); + if (!vm) { + return { items: [], getItem: (_d) => { + throw new BugIndicatingError(); + } }; + } + const viewModels = vm.items.read(reader); + const map = /* @__PURE__ */ new Map(); + const items = viewModels.map((d) => { + const item = reader.store.add(new VirtualizedViewItem(d, this._objectPool, this.scrollLeft, (delta) => { + this._scrollableElement.setScrollPosition({ scrollTop: this._scrollableElement.getScrollPosition().scrollTop + delta }); + })); + const data = this._lastDocStates?.[item.getKey()]; + if (data) { + transaction((tx) => { + item.setViewState(data, tx); + }); + } + map.set(d, item); + return item; + }); + return { items, getItem: (d) => map.get(d) }; + }); + this._viewItems = this._viewItemsInfo.map(this, (items) => items.items); + this._spaceBetweenPx = 0; + this._totalHeight = this._viewItems.map(this, (items, reader) => items.reduce((r, i2) => r + i2.contentHeight.read(reader) + this._spaceBetweenPx, 0)); + this.activeControl = derived(this, (reader) => { + const activeDiffItem = this._viewModel.read(reader)?.activeDiffItem.read(reader); + if (!activeDiffItem) { + return void 0; + } + const viewItem = this._viewItemsInfo.read(reader).getItem(activeDiffItem); + return viewItem.template.read(reader)?.editor; + }); + this._contextKeyService = this._register(this._parentContextKeyService.createScoped(this._element)); + this._instantiationService = this._register(this._parentInstantiationService.createChild(new ServiceCollection([IContextKeyService, this._contextKeyService]))); + this._contextKeyService.createKey(EditorContextKeys.inMultiDiffEditor.key, true); + this._lastDocStates = {}; + this._register(autorunWithStore((reader, store) => { + const viewModel = this._viewModel.read(reader); + if (viewModel && viewModel.contextKeys) { + for (const [key, value] of Object.entries(viewModel.contextKeys)) { + const contextKey = this._contextKeyService.createKey(key, void 0); + contextKey.set(value); + store.add(toDisposable(() => contextKey.reset())); + } + } + })); + const ctxAllCollapsed = this._parentContextKeyService.createKey(EditorContextKeys.multiDiffEditorAllCollapsed.key, false); + this._register(autorun((reader) => { + const viewModel = this._viewModel.read(reader); + if (viewModel) { + const allCollapsed = viewModel.items.read(reader).every((item) => item.collapsed.read(reader)); + ctxAllCollapsed.set(allCollapsed); + } + })); + this._register(autorun((reader) => { + const dimension = this._dimension.read(reader); + this._sizeObserver.observe(dimension); + })); + const placeholderMessage = derived((reader) => { + const items = this._viewItems.read(reader); + if (items.length > 0) { + return void 0; + } + const vm = this._viewModel.read(reader); + return !vm || vm.isLoading.read(reader) ? localize(145, "Loading...") : localize(146, "No Changed Files"); + }); + this._register(autorun((reader) => { + const message = placeholderMessage.read(reader); + this._elements.placeholder.innerText = message ?? ""; + this._elements.placeholder.classList.toggle("visible", !!message); + })); + this._scrollableElements.content.style.position = "relative"; + this._register(autorun((reader) => { + const height = this._sizeObserver.height.read(reader); + this._scrollableElements.root.style.height = `${height}px`; + const totalHeight = this._totalHeight.read(reader); + this._scrollableElements.content.style.height = `${totalHeight}px`; + const width2 = this._sizeObserver.width.read(reader); + let scrollWidth = width2; + const viewItems = this._viewItems.read(reader); + const max = findFirstMax(viewItems, compareBy((i2) => i2.maxScroll.read(reader).maxScroll, numberComparator)); + if (max) { + const maxScroll = max.maxScroll.read(reader); + scrollWidth = width2 + maxScroll.maxScroll; + } + this._scrollableElement.setScrollDimensions({ + width: width2, + height, + scrollHeight: totalHeight, + scrollWidth + }); + })); + _element.replaceChildren(this._elements.root); + this._register(toDisposable(() => { + _element.replaceChildren(); + })); + this._register(autorun((reader) => { + const viewModel = this._viewModel.read(reader); + if (!viewModel) { + return; + } + if (!viewModel.isLoading.read(reader)) { + const items = viewModel.items.read(reader); + if (items.length === 0) { + return; + } + const activeDiffItem = viewModel.activeDiffItem.read(reader); + if (activeDiffItem) { + return; + } + this.goToNextChange(); + } + })); + this._register(this._register(autorun((reader) => { + globalTransaction((tx) => { + this.render(reader); + }); + }))); + } + reveal(resource, options2) { + const viewItems = this._viewItems.get(); + const index = viewItems.findIndex((item) => item.viewModel.originalUri?.toString() === resource.original?.toString() && item.viewModel.modifiedUri?.toString() === resource.modified?.toString()); + if (index === -1) { + throw new BugIndicatingError("Resource not found in diff editor"); + } + const viewItem = viewItems[index]; + this._viewModel.get().activeDiffItem.setCache(viewItem.viewModel, void 0); + let scrollTop = 0; + for (let i2 = 0; i2 < index; i2++) { + scrollTop += viewItems[i2].contentHeight.get() + this._spaceBetweenPx; + } + this._scrollableElement.setScrollPosition({ scrollTop }); + const diffEditor = viewItem.template.get()?.editor; + const editor2 = "original" in resource ? diffEditor?.getOriginalEditor() : diffEditor?.getModifiedEditor(); + if (editor2 && options2?.range) { + editor2.revealRangeInCenter(options2.range); + highlightRange(editor2, options2.range); + } + } + goToNextChange() { + this._navigateToChange("next"); + } + _navigateToChange(direction) { + const viewItems = this._viewItems.get(); + if (viewItems.length === 0) { + return; + } + const activeViewModel = this._viewModel.get()?.activeDiffItem.get(); + const currentIndex = activeViewModel ? viewItems.findIndex((v) => v.viewModel === activeViewModel) : -1; + if (currentIndex === -1) { + this._goToFile(0, "first"); + return; + } + const currentItem = viewItems[currentIndex]; + if (currentItem.viewModel.collapsed.get()) { + currentItem.viewModel.collapsed.set(false, void 0); + } + const editor2 = currentItem.template.get()?.editor; + if (editor2?.getDiffComputationResult()?.changes2?.length) { + const pos = editor2.getModifiedEditor().getPosition()?.lineNumber || 1; + const changes = editor2.getDiffComputationResult().changes2; + const hasNext = direction === "next" ? changes.some((c) => c.modified.startLineNumber > pos) : changes.some((c) => c.modified.endLineNumberExclusive <= pos); + if (hasNext) { + editor2.goToDiff(direction); + return; + } + } + const nextIndex = (currentIndex + (direction === "next" ? 1 : -1) + viewItems.length) % viewItems.length; + this._goToFile(nextIndex, direction === "next" ? "first" : "last"); + } + _goToFile(index, position) { + const item = this._viewItems.get()[index]; + if (item.viewModel.collapsed.get()) { + item.viewModel.collapsed.set(false, void 0); + } + this.reveal({ original: item.viewModel.originalUri, modified: item.viewModel.modifiedUri }); + const editor2 = item.template.get()?.editor; + if (editor2?.getDiffComputationResult()?.changes2?.length) { + if (position === "first") { + editor2.revealFirstDiff(); + } else { + const lastChange = editor2.getDiffComputationResult().changes2.at(-1); + const modifiedEditor = editor2.getModifiedEditor(); + modifiedEditor.setPosition({ lineNumber: lastChange.modified.startLineNumber, column: 1 }); + modifiedEditor.revealLineInCenter(lastChange.modified.startLineNumber); + } + } + editor2?.focus(); + } + render(reader) { + const scrollTop = this.scrollTop.read(reader); + let contentScrollOffsetToScrollOffset = 0; + let itemHeightSumBefore = 0; + let itemContentHeightSumBefore = 0; + const viewPortHeight = this._sizeObserver.height.read(reader); + const contentViewPort = OffsetRange.ofStartAndLength(scrollTop, viewPortHeight); + const width2 = this._sizeObserver.width.read(reader); + for (const v of this._viewItems.read(reader)) { + const itemContentHeight = v.contentHeight.read(reader); + const itemHeight = Math.min(itemContentHeight, viewPortHeight); + const itemRange = OffsetRange.ofStartAndLength(itemHeightSumBefore, itemHeight); + const itemContentRange = OffsetRange.ofStartAndLength(itemContentHeightSumBefore, itemContentHeight); + if (itemContentRange.isBefore(contentViewPort)) { + contentScrollOffsetToScrollOffset -= itemContentHeight - itemHeight; + v.hide(); + } else if (itemContentRange.isAfter(contentViewPort)) { + v.hide(); + } else { + const scroll = Math.max(0, Math.min(contentViewPort.start - itemContentRange.start, itemContentHeight - itemHeight)); + contentScrollOffsetToScrollOffset -= scroll; + const viewPort = OffsetRange.ofStartAndLength(scrollTop + contentScrollOffsetToScrollOffset, viewPortHeight); + v.render(itemRange, scroll, width2, viewPort); + } + itemHeightSumBefore += itemHeight + this._spaceBetweenPx; + itemContentHeightSumBefore += itemContentHeight + this._spaceBetweenPx; + } + this._scrollableElements.content.style.transform = `translateY(${-(scrollTop + contentScrollOffsetToScrollOffset)}px)`; + } +}; +MultiDiffEditorWidgetImpl = __decorate196([ + __param189(4, IContextKeyService), + __param189(5, IInstantiationService) +], MultiDiffEditorWidgetImpl); +function highlightRange(targetEditor, range2) { + const modelNow = targetEditor.getModel(); + const decorations = targetEditor.createDecorationsCollection([{ range: range2, options: { description: "symbol-navigate-action-highlight", className: "symbolHighlight" } }]); + setTimeout(() => { + if (targetEditor.getModel() === modelNow) { + decorations.clear(); + } + }, 350); +} +var VirtualizedViewItem = class extends Disposable { + constructor(viewModel, _objectPool, _scrollLeft, _deltaScrollVertical) { + super(); + this.viewModel = viewModel; + this._objectPool = _objectPool; + this._scrollLeft = _scrollLeft; + this._deltaScrollVertical = _deltaScrollVertical; + this._templateRef = this._register(disposableObservableValue(this, void 0)); + this.contentHeight = derived(this, (reader) => this._templateRef.read(reader)?.object.contentHeight?.read(reader) ?? this.viewModel.lastTemplateData.read(reader).contentHeight); + this.maxScroll = derived(this, (reader) => this._templateRef.read(reader)?.object.maxScroll.read(reader) ?? { maxScroll: 0, scrollWidth: 0 }); + this.template = derived(this, (reader) => this._templateRef.read(reader)?.object); + this._isHidden = observableValue(this, false); + this._isFocused = derived(this, (reader) => this.template.read(reader)?.isFocused.read(reader) ?? false); + this.viewModel.setIsFocused(this._isFocused, void 0); + this._register(autorun((reader) => { + const scrollLeft = this._scrollLeft.read(reader); + this._templateRef.read(reader)?.object.setScrollLeft(scrollLeft); + })); + this._register(autorun((reader) => { + const ref = this._templateRef.read(reader); + if (!ref) { + return; + } + const isHidden = this._isHidden.read(reader); + if (!isHidden) { + return; + } + const isFocused = ref.object.isFocused.read(reader); + if (isFocused) { + return; + } + this._clear(); + })); + } + dispose() { + this._clear(); + super.dispose(); + } + toString() { + return `VirtualViewItem(${this.viewModel.documentDiffItem.modified?.uri.toString()})`; + } + getKey() { + return this.viewModel.getKey(); + } + setViewState(viewState, tx) { + this.viewModel.collapsed.set(viewState.collapsed, tx); + this._updateTemplateData(tx); + const data = this.viewModel.lastTemplateData.get(); + const selections = viewState.selections?.map(Selection.liftSelection); + this.viewModel.lastTemplateData.set({ + ...data, + selections + }, tx); + const ref = this._templateRef.get(); + if (ref) { + if (selections) { + ref.object.editor.setSelections(selections); + } + } + } + _updateTemplateData(tx) { + const ref = this._templateRef.get(); + if (!ref) { + return; + } + this.viewModel.lastTemplateData.set({ + contentHeight: ref.object.contentHeight.get(), + selections: ref.object.editor.getSelections() ?? void 0 + }, tx); + } + _clear() { + const ref = this._templateRef.get(); + if (!ref) { + return; + } + transaction((tx) => { + this._updateTemplateData(tx); + ref.object.hide(); + this._templateRef.set(void 0, tx); + }); + } + hide() { + this._isHidden.set(true, void 0); + } + render(verticalSpace, offset, width2, viewPort) { + this._isHidden.set(false, void 0); + let ref = this._templateRef.get(); + if (!ref) { + ref = this._objectPool.getUnusedObj(new TemplateData(this.viewModel, this._deltaScrollVertical)); + this._templateRef.set(ref, void 0); + const selections = this.viewModel.lastTemplateData.get().selections; + if (selections) { + ref.object.editor.setSelections(selections); + } + } + ref.object.render(verticalSpace, width2, offset, viewPort); + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/browser/widget/multiDiffEditor/multiDiffEditorWidget.js +var __decorate197 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param190 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +}; +var MultiDiffEditorWidget = class MultiDiffEditorWidget2 extends Disposable { + constructor(_element, _workbenchUIElementFactory, _instantiationService) { + super(); + this._element = _element; + this._workbenchUIElementFactory = _workbenchUIElementFactory; + this._instantiationService = _instantiationService; + this._dimension = observableValue(this, void 0); + this._viewModel = observableValue(this, void 0); + this._widgetImpl = derived(this, (reader) => { + readHotReloadableExport(DiffEditorItemTemplate, reader); + return reader.store.add(this._instantiationService.createInstance(readHotReloadableExport(MultiDiffEditorWidgetImpl, reader), this._element, this._dimension, this._viewModel, this._workbenchUIElementFactory)); + }); + this._register(recomputeInitiallyAndOnChange(this._widgetImpl)); + } +}; +MultiDiffEditorWidget = __decorate197([ + __param190(2, IInstantiationService) +], MultiDiffEditorWidget); + +// node_modules/monaco-editor-core/esm/vs/editor/standalone/browser/standaloneEditor.js +function create2(domElement, options2, override) { + const instantiationService = StandaloneServices.initialize(override || {}); + return instantiationService.createInstance(StandaloneEditor, domElement, options2); +} +function onDidCreateEditor(listener) { + const codeEditorService = StandaloneServices.get(ICodeEditorService); + return codeEditorService.onCodeEditorAdd((editor2) => { + listener(editor2); + }); +} +function onDidCreateDiffEditor(listener) { + const codeEditorService = StandaloneServices.get(ICodeEditorService); + return codeEditorService.onDiffEditorAdd((editor2) => { + listener(editor2); + }); +} +function getEditors() { + const codeEditorService = StandaloneServices.get(ICodeEditorService); + return codeEditorService.listCodeEditors(); +} +function getDiffEditors() { + const codeEditorService = StandaloneServices.get(ICodeEditorService); + return codeEditorService.listDiffEditors(); +} +function createDiffEditor(domElement, options2, override) { + const instantiationService = StandaloneServices.initialize(override || {}); + return instantiationService.createInstance(StandaloneDiffEditor2, domElement, options2); +} +function createMultiFileDiffEditor(domElement, override) { + const instantiationService = StandaloneServices.initialize(override || {}); + return new MultiDiffEditorWidget(domElement, {}, instantiationService); +} +function addCommand(descriptor) { + if (typeof descriptor.id !== "string" || typeof descriptor.run !== "function") { + throw new Error("Invalid command descriptor, `id` and `run` are required properties!"); + } + return CommandsRegistry.registerCommand(descriptor.id, descriptor.run); +} +function addEditorAction(descriptor) { + if (typeof descriptor.id !== "string" || typeof descriptor.label !== "string" || typeof descriptor.run !== "function") { + throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!"); + } + const precondition = ContextKeyExpr.deserialize(descriptor.precondition); + const run = (accessor, ...args) => { + return EditorCommand.runEditorCommand(accessor, args, precondition, (accessor2, editor2, args2) => Promise.resolve(descriptor.run(editor2, ...args2))); + }; + const toDispose = new DisposableStore(); + toDispose.add(CommandsRegistry.registerCommand(descriptor.id, run)); + if (descriptor.contextMenuGroupId) { + const menuItem = { + command: { + id: descriptor.id, + title: descriptor.label + }, + when: precondition, + group: descriptor.contextMenuGroupId, + order: descriptor.contextMenuOrder || 0 + }; + toDispose.add(MenuRegistry.appendMenuItem(MenuId.EditorContext, menuItem)); + } + if (Array.isArray(descriptor.keybindings)) { + const keybindingService = StandaloneServices.get(IKeybindingService); + if (!(keybindingService instanceof StandaloneKeybindingService)) { + console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"); + } else { + const keybindingsWhen = ContextKeyExpr.and(precondition, ContextKeyExpr.deserialize(descriptor.keybindingContext)); + toDispose.add(keybindingService.addDynamicKeybindings(descriptor.keybindings.map((keybinding) => { + return { + keybinding, + command: descriptor.id, + when: keybindingsWhen + }; + }))); + } + } + return toDispose; +} +function addKeybindingRule(rule) { + return addKeybindingRules([rule]); +} +function addKeybindingRules(rules) { + const keybindingService = StandaloneServices.get(IKeybindingService); + if (!(keybindingService instanceof StandaloneKeybindingService)) { + console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"); + return Disposable.None; + } + return keybindingService.addDynamicKeybindings(rules.map((rule) => { + return { + keybinding: rule.keybinding, + command: rule.command, + commandArgs: rule.commandArgs, + when: ContextKeyExpr.deserialize(rule.when) + }; + })); +} +function createModel(value, language2, uri) { + const languageService = StandaloneServices.get(ILanguageService); + const languageId = languageService.getLanguageIdByMimeType(language2) || language2; + return createTextModel(StandaloneServices.get(IModelService), languageService, value, languageId, uri); +} +function setModelLanguage(model, mimeTypeOrLanguageId) { + const languageService = StandaloneServices.get(ILanguageService); + const languageId = languageService.getLanguageIdByMimeType(mimeTypeOrLanguageId) || mimeTypeOrLanguageId || PLAINTEXT_LANGUAGE_ID; + model.setLanguage(languageService.createById(languageId)); +} +function setModelMarkers(model, owner, markers) { + if (model) { + const markerService = StandaloneServices.get(IMarkerService); + markerService.changeOne(owner, model.uri, markers); + } +} +function removeAllMarkers(owner) { + const markerService = StandaloneServices.get(IMarkerService); + markerService.changeAll(owner, []); +} +function getModelMarkers(filter) { + const markerService = StandaloneServices.get(IMarkerService); + return markerService.read(filter); +} +function onDidChangeMarkers(listener) { + const markerService = StandaloneServices.get(IMarkerService); + return markerService.onMarkerChanged(listener); +} +function getModel(uri) { + const modelService = StandaloneServices.get(IModelService); + return modelService.getModel(uri); +} +function getModels() { + const modelService = StandaloneServices.get(IModelService); + return modelService.getModels(); +} +function onDidCreateModel(listener) { + const modelService = StandaloneServices.get(IModelService); + return modelService.onModelAdded(listener); +} +function onWillDisposeModel(listener) { + const modelService = StandaloneServices.get(IModelService); + return modelService.onModelRemoved(listener); +} +function onDidChangeModelLanguage(listener) { + const modelService = StandaloneServices.get(IModelService); + return modelService.onModelLanguageChanged((e) => { + listener({ + model: e.model, + oldLanguage: e.oldLanguageId + }); + }); +} +function createWebWorker3(opts) { + return createWebWorker2(StandaloneServices.get(IModelService), opts); +} +function colorizeElement(domNode, options2) { + const languageService = StandaloneServices.get(ILanguageService); + const themeService = StandaloneServices.get(IStandaloneThemeService); + return Colorizer.colorizeElement(themeService, languageService, domNode, options2).then(() => { + themeService.registerEditorContainer(domNode); + }); +} +function colorize(text2, languageId, options2) { + const languageService = StandaloneServices.get(ILanguageService); + const themeService = StandaloneServices.get(IStandaloneThemeService); + themeService.registerEditorContainer(mainWindow.document.body); + return Colorizer.colorize(languageService, text2, languageId, options2); +} +function colorizeModelLine(model, lineNumber, tabSize = 4) { + const themeService = StandaloneServices.get(IStandaloneThemeService); + themeService.registerEditorContainer(mainWindow.document.body); + return Colorizer.colorizeModelLine(model, lineNumber, tabSize); +} +function getSafeTokenizationSupport(language2) { + const tokenizationSupport = TokenizationRegistry2.get(language2); + if (tokenizationSupport) { + return tokenizationSupport; + } + return { + getInitialState: () => NullState, + tokenize: (line, hasEOL, state) => nullTokenize(language2, state) + }; +} +function tokenize(text2, languageId) { + TokenizationRegistry2.getOrCreate(languageId); + const tokenizationSupport = getSafeTokenizationSupport(languageId); + const lines = splitLines(text2); + const result = []; + let state = tokenizationSupport.getInitialState(); + for (let i2 = 0, len = lines.length; i2 < len; i2++) { + const line = lines[i2]; + const tokenizationResult = tokenizationSupport.tokenize(line, true, state); + result[i2] = tokenizationResult.tokens; + state = tokenizationResult.endState; + } + return result; +} +function defineTheme(themeName, themeData) { + const standaloneThemeService = StandaloneServices.get(IStandaloneThemeService); + standaloneThemeService.defineTheme(themeName, themeData); +} +function setTheme(themeName) { + const standaloneThemeService = StandaloneServices.get(IStandaloneThemeService); + standaloneThemeService.setTheme(themeName); +} +function remeasureFonts() { + FontMeasurements.clearAllFontInfos(); +} +function registerCommand4(id, handler) { + return CommandsRegistry.registerCommand({ id, handler }); +} +function registerLinkOpener(opener) { + const openerService = StandaloneServices.get(IOpenerService); + return openerService.registerOpener({ + async open(resource) { + if (typeof resource === "string") { + resource = URI.parse(resource); + } + return opener.open(resource); + } + }); +} +function registerEditorOpener(opener) { + const codeEditorService = StandaloneServices.get(ICodeEditorService); + return codeEditorService.registerCodeEditorOpenHandler(async (input, source, sideBySide) => { + if (!source) { + return null; + } + const selection = input.options?.selection; + let selectionOrPosition; + if (selection && typeof selection.endLineNumber === "number" && typeof selection.endColumn === "number") { + selectionOrPosition = selection; + } else if (selection) { + selectionOrPosition = { lineNumber: selection.startLineNumber, column: selection.startColumn }; + } + if (await opener.openCodeEditor(source, input.resource, selectionOrPosition)) { + return source; + } + return null; + }); +} +function createMonacoEditorAPI() { + return { + // methods + // eslint-disable-next-line local/code-no-any-casts + create: create2, + // eslint-disable-next-line local/code-no-any-casts + getEditors, + // eslint-disable-next-line local/code-no-any-casts + getDiffEditors, + // eslint-disable-next-line local/code-no-any-casts + onDidCreateEditor, + // eslint-disable-next-line local/code-no-any-casts + onDidCreateDiffEditor, + // eslint-disable-next-line local/code-no-any-casts + createDiffEditor, + // eslint-disable-next-line local/code-no-any-casts + addCommand, + // eslint-disable-next-line local/code-no-any-casts + addEditorAction, + // eslint-disable-next-line local/code-no-any-casts + addKeybindingRule, + // eslint-disable-next-line local/code-no-any-casts + addKeybindingRules, + // eslint-disable-next-line local/code-no-any-casts + createModel, + // eslint-disable-next-line local/code-no-any-casts + setModelLanguage, + // eslint-disable-next-line local/code-no-any-casts + setModelMarkers, + // eslint-disable-next-line local/code-no-any-casts + getModelMarkers, + removeAllMarkers, + // eslint-disable-next-line local/code-no-any-casts + onDidChangeMarkers, + // eslint-disable-next-line local/code-no-any-casts + getModels, + // eslint-disable-next-line local/code-no-any-casts + getModel, + // eslint-disable-next-line local/code-no-any-casts + onDidCreateModel, + // eslint-disable-next-line local/code-no-any-casts + onWillDisposeModel, + // eslint-disable-next-line local/code-no-any-casts + onDidChangeModelLanguage, + // eslint-disable-next-line local/code-no-any-casts + createWebWorker: createWebWorker3, + // eslint-disable-next-line local/code-no-any-casts + colorizeElement, + // eslint-disable-next-line local/code-no-any-casts + colorize, + // eslint-disable-next-line local/code-no-any-casts + colorizeModelLine, + // eslint-disable-next-line local/code-no-any-casts + tokenize, + // eslint-disable-next-line local/code-no-any-casts + defineTheme, + // eslint-disable-next-line local/code-no-any-casts + setTheme, + remeasureFonts, + registerCommand: registerCommand4, + registerLinkOpener, + // eslint-disable-next-line local/code-no-any-casts + registerEditorOpener, + // enums + AccessibilitySupport, + ContentWidgetPositionPreference, + CursorChangeReason, + DefaultEndOfLine, + EditorAutoIndentStrategy, + EditorOption, + EndOfLinePreference, + EndOfLineSequence, + MinimapPosition, + MinimapSectionHeaderStyle, + MouseTargetType, + OverlayWidgetPositionPreference, + OverviewRulerLane: OverviewRulerLane2, + GlyphMarginLane: GlyphMarginLane2, + RenderLineNumbersType, + RenderMinimap, + ScrollbarVisibility, + ScrollType, + TextEditorCursorBlinkingStyle, + TextEditorCursorStyle: TextEditorCursorStyle2, + TrackedRangeStickiness, + WrappingIndent, + InjectedTextCursorStops: InjectedTextCursorStops2, + PositionAffinity, + ShowLightbulbIconMode: ShowLightbulbIconMode2, + TextDirection: TextDirection2, + // classes + // eslint-disable-next-line local/code-no-any-casts + ConfigurationChangedEvent, + // eslint-disable-next-line local/code-no-any-casts + BareFontInfo, + // eslint-disable-next-line local/code-no-any-casts + FontInfo, + // eslint-disable-next-line local/code-no-any-casts + TextModelResolvedOptions, + // eslint-disable-next-line local/code-no-any-casts + FindMatch, + // eslint-disable-next-line local/code-no-any-casts + ApplyUpdateResult, + // eslint-disable-next-line local/code-no-any-casts + EditorZoom, + // eslint-disable-next-line local/code-no-any-casts + createMultiFileDiffEditor, + // vars + EditorType, + // eslint-disable-next-line local/code-no-any-casts + EditorOptions + }; +} + +// node_modules/monaco-editor-core/esm/vs/editor/standalone/browser/standaloneLanguages.js +init_color(); +init_range(); +init_languages(); +init_language(); +init_languageConfigurationRegistry(); +init_modesRegistry(); +init_languageFeatures(); + +// node_modules/monaco-editor-core/esm/vs/editor/standalone/common/monarch/monarchCompile.js +init_types(); +function isArrayOf2(elemType, obj) { + if (!obj) { + return false; + } + if (!Array.isArray(obj)) { + return false; + } + for (const el of obj) { + if (!elemType(el)) { + return false; + } + } + return true; +} +function bool(prop, defValue) { + if (typeof prop === "boolean") { + return prop; + } + return defValue; +} +function string(prop, defValue) { + if (typeof prop === "string") { + return prop; + } + return defValue; +} +function arrayToHash(array2) { + const result = {}; + for (const e of array2) { + result[e] = true; + } + return result; +} +function createKeywordMatcher(arr, caseInsensitive = false) { + if (caseInsensitive) { + arr = arr.map(function(x) { + return x.toLowerCase(); + }); + } + const hash2 = arrayToHash(arr); + if (caseInsensitive) { + return function(word) { + return hash2[word.toLowerCase()] !== void 0 && hash2.hasOwnProperty(word.toLowerCase()); + }; + } else { + return function(word) { + return hash2[word] !== void 0 && hash2.hasOwnProperty(word); + }; + } +} +function compileRegExp(lexer2, str, handleSn) { + str = str.replace(/@@/g, ``); + let n2 = 0; + let hadExpansion; + do { + hadExpansion = false; + str = str.replace(/@(\w+)/g, function(s, attr) { + hadExpansion = true; + let sub = ""; + if (typeof lexer2[attr] === "string") { + sub = lexer2[attr]; + } else if (lexer2[attr] && lexer2[attr] instanceof RegExp) { + sub = lexer2[attr].source; + } else { + if (lexer2[attr] === void 0) { + throw createError(lexer2, "language definition does not contain attribute '" + attr + "', used at: " + str); + } else { + throw createError(lexer2, "attribute reference '" + attr + "' must be a string, used at: " + str); + } + } + return empty(sub) ? "" : "(?:" + sub + ")"; + }); + n2++; + } while (hadExpansion && n2 < 5); + str = str.replace(/\x01/g, "@"); + const flags = (lexer2.ignoreCase ? "i" : "") + (lexer2.unicode ? "u" : ""); + if (handleSn) { + const match2 = str.match(/\$[sS](\d\d?)/g); + if (match2) { + let lastState = null; + let lastRegEx = null; + return (state) => { + if (lastRegEx && lastState === state) { + return lastRegEx; + } + lastState = state; + lastRegEx = new RegExp(substituteMatchesRe(lexer2, str, state), flags); + return lastRegEx; + }; + } + } + return new RegExp(str, flags); +} +function selectScrutinee(id, matches, state, num) { + if (num < 0) { + return id; + } + if (num < matches.length) { + return matches[num]; + } + if (num >= 100) { + num = num - 100; + const parts = state.split("."); + parts.unshift(state); + if (num < parts.length) { + return parts[num]; + } + } + return null; +} +function createGuard(lexer2, ruleName, tkey, val) { + let scrut = -1; + let oppat = tkey; + let matches = tkey.match(/^\$(([sS]?)(\d\d?)|#)(.*)$/); + if (matches) { + if (matches[3]) { + scrut = parseInt(matches[3]); + if (matches[2]) { + scrut = scrut + 100; + } + } + oppat = matches[4]; + } + let op = "~"; + let pat = oppat; + if (!oppat || oppat.length === 0) { + op = "!="; + pat = ""; + } else if (/^\w*$/.test(pat)) { + op = "=="; + } else { + matches = oppat.match(/^(@|!@|~|!~|==|!=)(.*)$/); + if (matches) { + op = matches[1]; + pat = matches[2]; + } + } + let tester; + if ((op === "~" || op === "!~") && /^(\w|\|)*$/.test(pat)) { + const inWords = createKeywordMatcher(pat.split("|"), lexer2.ignoreCase); + tester = function(s) { + return op === "~" ? inWords(s) : !inWords(s); + }; + } else if (op === "@" || op === "!@") { + const words = lexer2[pat]; + if (!words) { + throw createError(lexer2, "the @ match target '" + pat + "' is not defined, in rule: " + ruleName); + } + if (!isArrayOf2(function(elem) { + return typeof elem === "string"; + }, words)) { + throw createError(lexer2, "the @ match target '" + pat + "' must be an array of strings, in rule: " + ruleName); + } + const inWords = createKeywordMatcher(words, lexer2.ignoreCase); + tester = function(s) { + return op === "@" ? inWords(s) : !inWords(s); + }; + } else if (op === "~" || op === "!~") { + if (pat.indexOf("$") < 0) { + const re = compileRegExp(lexer2, "^" + pat + "$", false); + tester = function(s) { + return op === "~" ? re.test(s) : !re.test(s); + }; + } else { + tester = function(s, id, matches2, state) { + const re = compileRegExp(lexer2, "^" + substituteMatches(lexer2, pat, id, matches2, state) + "$", false); + return re.test(s); + }; + } + } else { + if (pat.indexOf("$") < 0) { + const patx = fixCase(lexer2, pat); + tester = function(s) { + return op === "==" ? s === patx : s !== patx; + }; + } else { + const patx = fixCase(lexer2, pat); + tester = function(s, id, matches2, state, eos) { + const patexp = substituteMatches(lexer2, patx, id, matches2, state); + return op === "==" ? s === patexp : s !== patexp; + }; + } + } + if (scrut === -1) { + return { + name: tkey, + value: val, + test: function(id, matches2, state, eos) { + return tester(id, id, matches2, state, eos); + } + }; + } else { + return { + name: tkey, + value: val, + test: function(id, matches2, state, eos) { + const scrutinee = selectScrutinee(id, matches2, state, scrut); + return tester(!scrutinee ? "" : scrutinee, id, matches2, state, eos); + } + }; + } +} +function compileAction(lexer2, ruleName, action) { + if (!action) { + return { token: "" }; + } else if (typeof action === "string") { + return action; + } else if (action.token || action.token === "") { + if (typeof action.token !== "string") { + throw createError(lexer2, "a 'token' attribute must be of type string, in rule: " + ruleName); + } else { + const newAction = { token: action.token }; + if (action.token.indexOf("$") >= 0) { + newAction.tokenSubst = true; + } + if (typeof action.bracket === "string") { + if (action.bracket === "@open") { + newAction.bracket = 1; + } else if (action.bracket === "@close") { + newAction.bracket = -1; + } else { + throw createError(lexer2, "a 'bracket' attribute must be either '@open' or '@close', in rule: " + ruleName); + } + } + if (action.next) { + if (typeof action.next !== "string") { + throw createError(lexer2, "the next state must be a string value in rule: " + ruleName); + } else { + let next = action.next; + if (!/^(@pop|@push|@popall)$/.test(next)) { + if (next[0] === "@") { + next = next.substr(1); + } + if (next.indexOf("$") < 0) { + if (!stateExists(lexer2, substituteMatches(lexer2, next, "", [], ""))) { + throw createError(lexer2, "the next state '" + action.next + "' is not defined in rule: " + ruleName); + } + } + } + newAction.next = next; + } + } + if (typeof action.goBack === "number") { + newAction.goBack = action.goBack; + } + if (typeof action.switchTo === "string") { + newAction.switchTo = action.switchTo; + } + if (typeof action.log === "string") { + newAction.log = action.log; + } + if (typeof action.nextEmbedded === "string") { + newAction.nextEmbedded = action.nextEmbedded; + lexer2.usesEmbedded = true; + } + return newAction; + } + } else if (Array.isArray(action)) { + const results = []; + for (let i2 = 0, len = action.length; i2 < len; i2++) { + results[i2] = compileAction(lexer2, ruleName, action[i2]); + } + return { group: results }; + } else if (action.cases) { + const cases = []; + let hasEmbeddedEndInCases = false; + for (const tkey in action.cases) { + if (action.cases.hasOwnProperty(tkey)) { + const val = compileAction(lexer2, ruleName, action.cases[tkey]); + if (tkey === "@default" || tkey === "@" || tkey === "") { + cases.push({ test: void 0, value: val, name: tkey }); + } else if (tkey === "@eos") { + cases.push({ test: function(id, matches, state, eos) { + return eos; + }, value: val, name: tkey }); + } else { + cases.push(createGuard(lexer2, ruleName, tkey, val)); + } + if (!hasEmbeddedEndInCases) { + hasEmbeddedEndInCases = !isString(val) && (val.hasEmbeddedEndInCases || ["@pop", "@popall"].includes(val.nextEmbedded || "")); + } + } + } + const def2 = lexer2.defaultToken; + return { + hasEmbeddedEndInCases, + test: function(id, matches, state, eos) { + for (const _case of cases) { + const didmatch = !_case.test || _case.test(id, matches, state, eos); + if (didmatch) { + return _case.value; + } + } + return def2; + } + }; + } else { + throw createError(lexer2, "an action must be a string, an object with a 'token' or 'cases' attribute, or an array of actions; in rule: " + ruleName); + } +} +var Rule = class { + constructor(name) { + this.regex = new RegExp(""); + this.action = { token: "" }; + this.matchOnlyAtLineStart = false; + this.name = ""; + this.name = name; + } + setRegex(lexer2, re) { + let sregex; + if (typeof re === "string") { + sregex = re; + } else if (re instanceof RegExp) { + sregex = re.source; + } else { + throw createError(lexer2, "rules must start with a match string or regular expression: " + this.name); + } + this.matchOnlyAtLineStart = sregex.length > 0 && sregex[0] === "^"; + this.name = this.name + ": " + sregex; + this.regex = compileRegExp(lexer2, "^(?:" + (this.matchOnlyAtLineStart ? sregex.substr(1) : sregex) + ")", true); + } + setAction(lexer2, act) { + this.action = compileAction(lexer2, this.name, act); + } + resolveRegex(state) { + if (this.regex instanceof RegExp) { + return this.regex; + } else { + return this.regex(state); + } + } +}; +function compile(languageId, json) { + if (!json || typeof json !== "object") { + throw new Error("Monarch: expecting a language definition object"); + } + const lexer2 = { + languageId, + includeLF: bool(json.includeLF, false), + noThrow: false, + // raise exceptions during compilation + maxStack: 100, + start: typeof json.start === "string" ? json.start : null, + ignoreCase: bool(json.ignoreCase, false), + unicode: bool(json.unicode, false), + tokenPostfix: string(json.tokenPostfix, "." + languageId), + defaultToken: string(json.defaultToken, "source"), + usesEmbedded: false, + // becomes true if we find a nextEmbedded action + stateNames: {}, + tokenizer: {}, + brackets: [] + }; + const lexerMin = json; + lexerMin.languageId = languageId; + lexerMin.includeLF = lexer2.includeLF; + lexerMin.ignoreCase = lexer2.ignoreCase; + lexerMin.unicode = lexer2.unicode; + lexerMin.noThrow = lexer2.noThrow; + lexerMin.usesEmbedded = lexer2.usesEmbedded; + lexerMin.stateNames = json.tokenizer; + lexerMin.defaultToken = lexer2.defaultToken; + function addRules(state, newrules, rules) { + for (const rule of rules) { + let include = rule.include; + if (include) { + if (typeof include !== "string") { + throw createError(lexer2, "an 'include' attribute must be a string at: " + state); + } + if (include[0] === "@") { + include = include.substr(1); + } + if (!json.tokenizer[include]) { + throw createError(lexer2, "include target '" + include + "' is not defined at: " + state); + } + addRules(state + "." + include, newrules, json.tokenizer[include]); + } else { + const newrule = new Rule(state); + if (Array.isArray(rule) && rule.length >= 1 && rule.length <= 3) { + newrule.setRegex(lexerMin, rule[0]); + if (rule.length >= 3) { + if (typeof rule[1] === "string") { + newrule.setAction(lexerMin, { token: rule[1], next: rule[2] }); + } else if (typeof rule[1] === "object") { + const rule1 = rule[1]; + rule1.next = rule[2]; + newrule.setAction(lexerMin, rule1); + } else { + throw createError(lexer2, "a next state as the last element of a rule can only be given if the action is either an object or a string, at: " + state); + } + } else { + newrule.setAction(lexerMin, rule[1]); + } + } else { + if (!rule.regex) { + throw createError(lexer2, "a rule must either be an array, or an object with a 'regex' or 'include' field at: " + state); + } + if (rule.name) { + if (typeof rule.name === "string") { + newrule.name = rule.name; + } + } + if (rule.matchOnlyAtStart) { + newrule.matchOnlyAtLineStart = bool(rule.matchOnlyAtLineStart, false); + } + newrule.setRegex(lexerMin, rule.regex); + newrule.setAction(lexerMin, rule.action); + } + newrules.push(newrule); + } + } + } + if (!json.tokenizer || typeof json.tokenizer !== "object") { + throw createError(lexer2, "a language definition must define the 'tokenizer' attribute as an object"); + } + lexer2.tokenizer = []; + for (const key in json.tokenizer) { + if (json.tokenizer.hasOwnProperty(key)) { + if (!lexer2.start) { + lexer2.start = key; + } + const rules = json.tokenizer[key]; + lexer2.tokenizer[key] = new Array(); + addRules("tokenizer." + key, lexer2.tokenizer[key], rules); + } + } + lexer2.usesEmbedded = lexerMin.usesEmbedded; + if (json.brackets) { + if (!Array.isArray(json.brackets)) { + throw createError(lexer2, "the 'brackets' attribute must be defined as an array"); + } + } else { + json.brackets = [ + { open: "{", close: "}", token: "delimiter.curly" }, + { open: "[", close: "]", token: "delimiter.square" }, + { open: "(", close: ")", token: "delimiter.parenthesis" }, + { open: "<", close: ">", token: "delimiter.angle" } + ]; + } + const brackets = []; + for (const el of json.brackets) { + let desc = el; + if (desc && Array.isArray(desc) && desc.length === 3) { + desc = { token: desc[2], open: desc[0], close: desc[1] }; + } + if (desc.open === desc.close) { + throw createError(lexer2, "open and close brackets in a 'brackets' attribute must be different: " + desc.open + "\n hint: use the 'bracket' attribute if matching on equal brackets is required."); + } + if (typeof desc.open === "string" && typeof desc.token === "string" && typeof desc.close === "string") { + brackets.push({ + token: desc.token + lexer2.tokenPostfix, + open: fixCase(lexer2, desc.open), + close: fixCase(lexer2, desc.close) + }); + } else { + throw createError(lexer2, "every element in the 'brackets' array must be a '{open,close,token}' object or array"); + } + } + lexer2.brackets = brackets; + lexer2.noThrow = true; + return lexer2; +} + +// node_modules/monaco-editor-core/esm/vs/editor/standalone/browser/standaloneLanguages.js +init_standaloneTheme(); +init_configuration(); +init_textModelEditSource(); +function register3(language2) { + ModesRegistry.registerLanguage(language2); +} +function getLanguages() { + let result = []; + result = result.concat(ModesRegistry.getLanguages()); + return result; +} +function getEncodedLanguageId(languageId) { + const languageService = StandaloneServices.get(ILanguageService); + return languageService.languageIdCodec.encodeLanguageId(languageId); +} +function onLanguage(languageId, callback) { + return StandaloneServices.withServices(() => { + const languageService = StandaloneServices.get(ILanguageService); + const disposable = languageService.onDidRequestRichLanguageFeatures((encounteredLanguageId) => { + if (encounteredLanguageId === languageId) { + disposable.dispose(); + callback(); + } + }); + return disposable; + }); +} +function onLanguageEncountered(languageId, callback) { + return StandaloneServices.withServices(() => { + const languageService = StandaloneServices.get(ILanguageService); + const disposable = languageService.onDidRequestBasicLanguageFeatures((encounteredLanguageId) => { + if (encounteredLanguageId === languageId) { + disposable.dispose(); + callback(); + } + }); + return disposable; + }); +} +function setLanguageConfiguration(languageId, configuration) { + const languageService = StandaloneServices.get(ILanguageService); + if (!languageService.isRegisteredLanguageId(languageId)) { + throw new Error(`Cannot set configuration for unknown language ${languageId}`); + } + const languageConfigurationService = StandaloneServices.get(ILanguageConfigurationService); + return languageConfigurationService.register(languageId, configuration, 100); +} +var EncodedTokenizationSupportAdapter = class { + constructor(languageId, actual) { + this._languageId = languageId; + this._actual = actual; + } + dispose() { + } + getInitialState() { + return this._actual.getInitialState(); + } + tokenize(line, hasEOL, state) { + if (typeof this._actual.tokenize === "function") { + return TokenizationSupportAdapter.adaptTokenize(this._languageId, this._actual, line, state); + } + throw new Error("Not supported!"); + } + tokenizeEncoded(line, hasEOL, state) { + const result = this._actual.tokenizeEncoded(line, state); + return new EncodedTokenizationResult(result.tokens, result.endState); + } +}; +var TokenizationSupportAdapter = class _TokenizationSupportAdapter { + constructor(_languageId, _actual, _languageService, _standaloneThemeService) { + this._languageId = _languageId; + this._actual = _actual; + this._languageService = _languageService; + this._standaloneThemeService = _standaloneThemeService; + } + dispose() { + } + getInitialState() { + return this._actual.getInitialState(); + } + static _toClassicTokens(tokens, language2) { + const result = []; + let previousStartIndex = 0; + for (let i2 = 0, len = tokens.length; i2 < len; i2++) { + const t = tokens[i2]; + let startIndex = t.startIndex; + if (i2 === 0) { + startIndex = 0; + } else if (startIndex < previousStartIndex) { + startIndex = previousStartIndex; + } + result[i2] = new Token(startIndex, t.scopes, language2); + previousStartIndex = startIndex; + } + return result; + } + static adaptTokenize(language2, actual, line, state) { + const actualResult = actual.tokenize(line, state); + const tokens = _TokenizationSupportAdapter._toClassicTokens(actualResult.tokens, language2); + let endState; + if (actualResult.endState.equals(state)) { + endState = state; + } else { + endState = actualResult.endState; + } + return new TokenizationResult(tokens, endState); + } + tokenize(line, hasEOL, state) { + return _TokenizationSupportAdapter.adaptTokenize(this._languageId, this._actual, line, state); + } + _toBinaryTokens(languageIdCodec, tokens) { + const languageId = languageIdCodec.encodeLanguageId(this._languageId); + const tokenTheme = this._standaloneThemeService.getColorTheme().tokenTheme; + const result = []; + let resultLen = 0; + let previousStartIndex = 0; + for (let i2 = 0, len = tokens.length; i2 < len; i2++) { + const t = tokens[i2]; + const metadata = tokenTheme.match(languageId, t.scopes) | 1024; + if (resultLen > 0 && result[resultLen - 1] === metadata) { + continue; + } + let startIndex = t.startIndex; + if (i2 === 0) { + startIndex = 0; + } else if (startIndex < previousStartIndex) { + startIndex = previousStartIndex; + } + result[resultLen++] = startIndex; + result[resultLen++] = metadata; + previousStartIndex = startIndex; + } + const actualResult = new Uint32Array(resultLen); + for (let i2 = 0; i2 < resultLen; i2++) { + actualResult[i2] = result[i2]; + } + return actualResult; + } + tokenizeEncoded(line, hasEOL, state) { + const actualResult = this._actual.tokenize(line, state); + const tokens = this._toBinaryTokens(this._languageService.languageIdCodec, actualResult.tokens); + let endState; + if (actualResult.endState.equals(state)) { + endState = state; + } else { + endState = actualResult.endState; + } + return new EncodedTokenizationResult(tokens, endState); + } +}; +function isATokensProvider(provider) { + return typeof provider.getInitialState === "function"; +} +function isEncodedTokensProvider(provider) { + return "tokenizeEncoded" in provider; +} +function isThenable2(obj) { + return obj && typeof obj.then === "function"; +} +function setColorMap(colorMap) { + const standaloneThemeService = StandaloneServices.get(IStandaloneThemeService); + if (colorMap) { + const result = [null]; + for (let i2 = 1, len = colorMap.length; i2 < len; i2++) { + result[i2] = Color.fromHex(colorMap[i2]); + } + standaloneThemeService.setColorMapOverride(result); + } else { + standaloneThemeService.setColorMapOverride(null); + } +} +function createTokenizationSupportAdapter(languageId, provider) { + if (isEncodedTokensProvider(provider)) { + return new EncodedTokenizationSupportAdapter(languageId, provider); + } else { + return new TokenizationSupportAdapter(languageId, provider, StandaloneServices.get(ILanguageService), StandaloneServices.get(IStandaloneThemeService)); + } +} +function registerTokensProviderFactory(languageId, factory) { + const adaptedFactory = new LazyTokenizationSupport(async () => { + const result = await Promise.resolve(factory.create()); + if (!result) { + return null; + } + if (isATokensProvider(result)) { + return createTokenizationSupportAdapter(languageId, result); + } + return new MonarchTokenizer(StandaloneServices.get(ILanguageService), StandaloneServices.get(IStandaloneThemeService), languageId, compile(languageId, result), StandaloneServices.get(IConfigurationService)); + }); + return TokenizationRegistry2.registerFactory(languageId, adaptedFactory); +} +function setTokensProvider(languageId, provider) { + const languageService = StandaloneServices.get(ILanguageService); + if (!languageService.isRegisteredLanguageId(languageId)) { + throw new Error(`Cannot set tokens provider for unknown language ${languageId}`); + } + if (isThenable2(provider)) { + return registerTokensProviderFactory(languageId, { create: () => provider }); + } + return TokenizationRegistry2.register(languageId, createTokenizationSupportAdapter(languageId, provider)); +} +function setMonarchTokensProvider(languageId, languageDef) { + const create4 = (languageDef2) => { + return new MonarchTokenizer(StandaloneServices.get(ILanguageService), StandaloneServices.get(IStandaloneThemeService), languageId, compile(languageId, languageDef2), StandaloneServices.get(IConfigurationService)); + }; + if (isThenable2(languageDef)) { + return registerTokensProviderFactory(languageId, { create: () => languageDef }); + } + return TokenizationRegistry2.register(languageId, create4(languageDef)); +} +function registerReferenceProvider(languageSelector, provider) { + const languageFeaturesService = StandaloneServices.get(ILanguageFeaturesService); + return languageFeaturesService.referenceProvider.register(languageSelector, provider); +} +function registerRenameProvider(languageSelector, provider) { + const languageFeaturesService = StandaloneServices.get(ILanguageFeaturesService); + return languageFeaturesService.renameProvider.register(languageSelector, provider); +} +function registerNewSymbolNameProvider(languageSelector, provider) { + const languageFeaturesService = StandaloneServices.get(ILanguageFeaturesService); + return languageFeaturesService.newSymbolNamesProvider.register(languageSelector, provider); +} +function registerSignatureHelpProvider(languageSelector, provider) { + const languageFeaturesService = StandaloneServices.get(ILanguageFeaturesService); + return languageFeaturesService.signatureHelpProvider.register(languageSelector, provider); +} +function registerHoverProvider(languageSelector, provider) { + const languageFeaturesService = StandaloneServices.get(ILanguageFeaturesService); + return languageFeaturesService.hoverProvider.register(languageSelector, { + provideHover: async (model, position, token, context) => { + const word = model.getWordAtPosition(position); + return Promise.resolve(provider.provideHover(model, position, token, context)).then((value) => { + if (!value) { + return void 0; + } + if (!value.range && word) { + value.range = new Range(position.lineNumber, word.startColumn, position.lineNumber, word.endColumn); + } + if (!value.range) { + value.range = new Range(position.lineNumber, position.column, position.lineNumber, position.column); + } + return value; + }); + } + }); +} +function registerDocumentSymbolProvider(languageSelector, provider) { + const languageFeaturesService = StandaloneServices.get(ILanguageFeaturesService); + return languageFeaturesService.documentSymbolProvider.register(languageSelector, provider); +} +function registerDocumentHighlightProvider(languageSelector, provider) { + const languageFeaturesService = StandaloneServices.get(ILanguageFeaturesService); + return languageFeaturesService.documentHighlightProvider.register(languageSelector, provider); +} +function registerLinkedEditingRangeProvider(languageSelector, provider) { + const languageFeaturesService = StandaloneServices.get(ILanguageFeaturesService); + return languageFeaturesService.linkedEditingRangeProvider.register(languageSelector, provider); +} +function registerDefinitionProvider(languageSelector, provider) { + const languageFeaturesService = StandaloneServices.get(ILanguageFeaturesService); + return languageFeaturesService.definitionProvider.register(languageSelector, provider); +} +function registerImplementationProvider(languageSelector, provider) { + const languageFeaturesService = StandaloneServices.get(ILanguageFeaturesService); + return languageFeaturesService.implementationProvider.register(languageSelector, provider); +} +function registerTypeDefinitionProvider(languageSelector, provider) { + const languageFeaturesService = StandaloneServices.get(ILanguageFeaturesService); + return languageFeaturesService.typeDefinitionProvider.register(languageSelector, provider); +} +function registerCodeLensProvider(languageSelector, provider) { + const languageFeaturesService = StandaloneServices.get(ILanguageFeaturesService); + return languageFeaturesService.codeLensProvider.register(languageSelector, provider); +} +function registerCodeActionProvider(languageSelector, provider, metadata) { + const languageFeaturesService = StandaloneServices.get(ILanguageFeaturesService); + return languageFeaturesService.codeActionProvider.register(languageSelector, { + providedCodeActionKinds: metadata?.providedCodeActionKinds, + documentation: metadata?.documentation, + provideCodeActions: (model, range2, context, token) => { + const markerService = StandaloneServices.get(IMarkerService); + const markers = markerService.read({ resource: model.uri }).filter((m) => { + return Range.areIntersectingOrTouching(m, range2); + }); + return provider.provideCodeActions(model, range2, { markers, only: context.only, trigger: context.trigger }, token); + }, + resolveCodeAction: provider.resolveCodeAction + }); +} +function registerDocumentFormattingEditProvider(languageSelector, provider) { + const languageFeaturesService = StandaloneServices.get(ILanguageFeaturesService); + return languageFeaturesService.documentFormattingEditProvider.register(languageSelector, provider); +} +function registerDocumentRangeFormattingEditProvider(languageSelector, provider) { + const languageFeaturesService = StandaloneServices.get(ILanguageFeaturesService); + return languageFeaturesService.documentRangeFormattingEditProvider.register(languageSelector, provider); +} +function registerOnTypeFormattingEditProvider(languageSelector, provider) { + const languageFeaturesService = StandaloneServices.get(ILanguageFeaturesService); + return languageFeaturesService.onTypeFormattingEditProvider.register(languageSelector, provider); +} +function registerLinkProvider(languageSelector, provider) { + const languageFeaturesService = StandaloneServices.get(ILanguageFeaturesService); + return languageFeaturesService.linkProvider.register(languageSelector, provider); +} +function registerCompletionItemProvider(languageSelector, provider) { + const languageFeaturesService = StandaloneServices.get(ILanguageFeaturesService); + return languageFeaturesService.completionProvider.register(languageSelector, provider); +} +function registerColorProvider(languageSelector, provider) { + const languageFeaturesService = StandaloneServices.get(ILanguageFeaturesService); + return languageFeaturesService.colorProvider.register(languageSelector, provider); +} +function registerFoldingRangeProvider(languageSelector, provider) { + const languageFeaturesService = StandaloneServices.get(ILanguageFeaturesService); + return languageFeaturesService.foldingRangeProvider.register(languageSelector, provider); +} +function registerDeclarationProvider(languageSelector, provider) { + const languageFeaturesService = StandaloneServices.get(ILanguageFeaturesService); + return languageFeaturesService.declarationProvider.register(languageSelector, provider); +} +function registerSelectionRangeProvider(languageSelector, provider) { + const languageFeaturesService = StandaloneServices.get(ILanguageFeaturesService); + return languageFeaturesService.selectionRangeProvider.register(languageSelector, provider); +} +function registerDocumentSemanticTokensProvider(languageSelector, provider) { + const languageFeaturesService = StandaloneServices.get(ILanguageFeaturesService); + return languageFeaturesService.documentSemanticTokensProvider.register(languageSelector, provider); +} +function registerDocumentRangeSemanticTokensProvider(languageSelector, provider) { + const languageFeaturesService = StandaloneServices.get(ILanguageFeaturesService); + return languageFeaturesService.documentRangeSemanticTokensProvider.register(languageSelector, provider); +} +function registerInlineCompletionsProvider(languageSelector, provider) { + const languageFeaturesService = StandaloneServices.get(ILanguageFeaturesService); + return languageFeaturesService.inlineCompletionsProvider.register(languageSelector, provider); +} +function registerInlayHintsProvider(languageSelector, provider) { + const languageFeaturesService = StandaloneServices.get(ILanguageFeaturesService); + return languageFeaturesService.inlayHintsProvider.register(languageSelector, provider); +} +function createMonacoLanguagesAPI() { + return { + // eslint-disable-next-line local/code-no-any-casts + register: register3, + // eslint-disable-next-line local/code-no-any-casts + getLanguages, + // eslint-disable-next-line local/code-no-any-casts + onLanguage, + // eslint-disable-next-line local/code-no-any-casts + onLanguageEncountered, + // eslint-disable-next-line local/code-no-any-casts + getEncodedLanguageId, + // provider methods + // eslint-disable-next-line local/code-no-any-casts + setLanguageConfiguration, + setColorMap, + // eslint-disable-next-line local/code-no-any-casts + registerTokensProviderFactory, + // eslint-disable-next-line local/code-no-any-casts + setTokensProvider, + // eslint-disable-next-line local/code-no-any-casts + setMonarchTokensProvider, + // eslint-disable-next-line local/code-no-any-casts + registerReferenceProvider, + // eslint-disable-next-line local/code-no-any-casts + registerRenameProvider, + // eslint-disable-next-line local/code-no-any-casts + registerNewSymbolNameProvider, + // eslint-disable-next-line local/code-no-any-casts + registerCompletionItemProvider, + // eslint-disable-next-line local/code-no-any-casts + registerSignatureHelpProvider, + // eslint-disable-next-line local/code-no-any-casts + registerHoverProvider, + // eslint-disable-next-line local/code-no-any-casts + registerDocumentSymbolProvider, + // eslint-disable-next-line local/code-no-any-casts + registerDocumentHighlightProvider, + // eslint-disable-next-line local/code-no-any-casts + registerLinkedEditingRangeProvider, + // eslint-disable-next-line local/code-no-any-casts + registerDefinitionProvider, + // eslint-disable-next-line local/code-no-any-casts + registerImplementationProvider, + // eslint-disable-next-line local/code-no-any-casts + registerTypeDefinitionProvider, + // eslint-disable-next-line local/code-no-any-casts + registerCodeLensProvider, + // eslint-disable-next-line local/code-no-any-casts + registerCodeActionProvider, + // eslint-disable-next-line local/code-no-any-casts + registerDocumentFormattingEditProvider, + // eslint-disable-next-line local/code-no-any-casts + registerDocumentRangeFormattingEditProvider, + // eslint-disable-next-line local/code-no-any-casts + registerOnTypeFormattingEditProvider, + // eslint-disable-next-line local/code-no-any-casts + registerLinkProvider, + // eslint-disable-next-line local/code-no-any-casts + registerColorProvider, + // eslint-disable-next-line local/code-no-any-casts + registerFoldingRangeProvider, + // eslint-disable-next-line local/code-no-any-casts + registerDeclarationProvider, + // eslint-disable-next-line local/code-no-any-casts + registerSelectionRangeProvider, + // eslint-disable-next-line local/code-no-any-casts + registerDocumentSemanticTokensProvider, + // eslint-disable-next-line local/code-no-any-casts + registerDocumentRangeSemanticTokensProvider, + // eslint-disable-next-line local/code-no-any-casts + registerInlineCompletionsProvider, + // eslint-disable-next-line local/code-no-any-casts + registerInlayHintsProvider, + // enums + DocumentHighlightKind: DocumentHighlightKind2, + CompletionItemKind, + CompletionItemTag, + CompletionItemInsertTextRule, + SymbolKind, + SymbolTag, + IndentAction: IndentAction2, + CompletionTriggerKind, + SignatureHelpTriggerKind: SignatureHelpTriggerKind2, + InlayHintKind: InlayHintKind2, + InlineCompletionTriggerKind: InlineCompletionTriggerKind2, + CodeActionTriggerType, + NewSymbolNameTag: NewSymbolNameTag2, + NewSymbolNameTriggerKind: NewSymbolNameTriggerKind2, + PartialAcceptTriggerKind, + HoverVerbosityAction: HoverVerbosityAction2, + InlineCompletionEndOfLifeReasonKind: InlineCompletionEndOfLifeReasonKind2, + InlineCompletionHintStyle: InlineCompletionHintStyle2, + // classes + FoldingRangeKind, + // eslint-disable-next-line local/code-no-any-casts + SelectedSuggestionInfo, + // eslint-disable-next-line local/code-no-any-casts + EditDeltaInfo + }; +} + +// node_modules/monaco-editor-core/esm/vs/editor/editor.api.js +init_browser(); +EditorOptions.wrappingIndent.defaultValue = 0; +EditorOptions.glyphMargin.defaultValue = false; +EditorOptions.autoIndent.defaultValue = 3; +EditorOptions.overviewRulerLanes.defaultValue = 2; +FormattingConflicts.setFormatterSelector((formatter, document2, mode) => Promise.resolve(formatter[0])); +var api = createMonacoBaseAPI(); +api.editor = createMonacoEditorAPI(); +api.languages = createMonacoLanguagesAPI(); +var CancellationTokenSource2 = api.CancellationTokenSource; +var Emitter2 = api.Emitter; +var KeyCode2 = api.KeyCode; +var KeyMod2 = api.KeyMod; +var Position2 = api.Position; +var Range3 = api.Range; +var Selection2 = api.Selection; +var SelectionDirection2 = api.SelectionDirection; +var MarkerSeverity3 = api.MarkerSeverity; +var MarkerTag2 = api.MarkerTag; +var Uri2 = api.Uri; +var Token3 = api.Token; +var editor = api.editor; +var languages = api.languages; +var monacoEnvironment = getMonacoEnvironment(); +var globalWithAMD = globalThis; +if (monacoEnvironment?.globalAPI || typeof globalWithAMD.define === "function" && globalWithAMD.define.amd) { + globalWithAMD.monaco = api; +} +if (typeof globalWithAMD.require !== "undefined" && typeof globalWithAMD.require.config === "function") { + globalWithAMD.require.config({ + ignoreDuplicateModules: [ + "vscode-languageserver-types", + "vscode-languageserver-types/main", + "vscode-languageserver-textdocument", + "vscode-languageserver-textdocument/main", + "vscode-nls", + "vscode-nls/vscode-nls", + "jsonc-parser", + "jsonc-parser/main", + "vscode-uri", + "vscode-uri/index", + "vs/basic-languages/typescript/typescript" + ] + }); +} + +// language-configurations.json +var language_configurations_default = { + sql: { + autoClosingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + { + open: '"', + close: '"', + notIn: [ + "string" + ] + }, + { + open: "N'", + close: "'", + notIn: [ + "string", + "comment" + ] + }, + { + open: "'", + close: "'", + notIn: [ + "string", + "comment" + ] + } + ], + brackets: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ] + ], + comments: { + lineComment: "--", + blockComment: [ + "/*", + "*/" + ] + }, + default: { + comments: { + lineComment: "--", + blockComment: [ + "/*", + "*/" + ] + }, + brackets: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ] + ], + autoClosingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + { + open: '"', + close: '"', + notIn: [ + "string" + ] + }, + { + open: "N'", + close: "'", + notIn: [ + "string", + "comment" + ] + }, + { + open: "'", + close: "'", + notIn: [ + "string", + "comment" + ] + } + ], + surroundingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + '"', + '"' + ], + [ + "'", + "'" + ], + [ + "`", + "`" + ] + ], + folding: { + offSide: true, + markers: { + start: "^\\s*--\\s*#region\\b", + end: "^\\s*--\\s*#endregion\\b" + } + } + }, + folding: { + offSide: true, + markers: { + start: "^\\s*--\\s*#region\\b", + end: "^\\s*--\\s*#endregion\\b" + } + }, + surroundingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + '"', + '"' + ], + [ + "'", + "'" + ], + [ + "`", + "`" + ] + ] + }, + ruby: { + autoClosingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + { + open: '"', + close: '"', + notIn: [ + "string" + ] + }, + { + open: "'", + close: "'", + notIn: [ + "string" + ] + }, + { + open: "`", + close: "`", + notIn: [ + "string" + ] + } + ], + brackets: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ] + ], + comments: { + lineComment: "#", + blockComment: [ + "=begin", + "=end" + ] + }, + default: { + comments: { + lineComment: "#", + blockComment: [ + "=begin", + "=end" + ] + }, + brackets: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ] + ], + autoClosingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + { + open: '"', + close: '"', + notIn: [ + "string" + ] + }, + { + open: "'", + close: "'", + notIn: [ + "string" + ] + }, + { + open: "`", + close: "`", + notIn: [ + "string" + ] + } + ], + surroundingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + '"', + '"' + ], + [ + "'", + "'" + ], + [ + "`", + "`" + ] + ], + indentationRules: { + increaseIndentPattern: `^\\s*((begin|class|(private|protected)\\s+def|def|else|elsif|ensure|for|if|module|rescue|unless|until|when|in|while|case)|([^#]*\\sdo\\b)|([^#]*=\\s*(case|if|unless)))\\b([^#\\{;]|("|'|/).*\\4)*(#.*)?$`, + decreaseIndentPattern: "^\\s*([}\\]]([,)]?\\s*(#|$)|\\.[a-zA-Z_]\\w*\\b)|(end|rescue|ensure|else|elsif)\\b|(in|when)\\s)" + } + }, + indentationRules: { + increaseIndentPattern: `^\\s*((begin|class|(private|protected)\\s+def|def|else|elsif|ensure|for|if|module|rescue|unless|until|when|in|while|case)|([^#]*\\sdo\\b)|([^#]*=\\s*(case|if|unless)))\\b([^#\\{;]|("|'|/).*\\4)*(#.*)?$`, + decreaseIndentPattern: "^\\s*([}\\]]([,)]?\\s*(#|$)|\\.[a-zA-Z_]\\w*\\b)|(end|rescue|ensure|else|elsif)\\b|(in|when)\\s)" + }, + surroundingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + '"', + '"' + ], + [ + "'", + "'" + ], + [ + "`", + "`" + ] + ] + }, + "objective-c": { + autoClosingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + { + open: '"', + close: '"', + notIn: [ + "string" + ] + }, + { + open: "'", + close: "'", + notIn: [ + "string" + ] + } + ], + brackets: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ] + ], + comments: { + lineComment: "//", + blockComment: [ + "/*", + "*/" + ] + }, + default: { + comments: { + lineComment: "//", + blockComment: [ + "/*", + "*/" + ] + }, + brackets: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ] + ], + autoClosingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + { + open: '"', + close: '"', + notIn: [ + "string" + ] + }, + { + open: "'", + close: "'", + notIn: [ + "string" + ] + } + ], + surroundingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + '"', + '"' + ], + [ + "'", + "'" + ] + ], + onEnterRules: [ + { + beforeText: { + pattern: "//.*" + }, + afterText: { + pattern: "^(?!\\s*$).+" + }, + action: { + indent: "none", + appendText: "// " + } + } + ] + }, + onEnterRules: [ + { + beforeText: { + pattern: "//.*" + }, + afterText: { + pattern: "^(?!\\s*$).+" + }, + action: { + indent: "none", + appendText: "// " + } + } + ], + surroundingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + '"', + '"' + ], + [ + "'", + "'" + ] + ] + }, + restructuredtext: { + autoCloseBefore: ":})>`\\n ", + autoClosingPairs: [ + { + open: "(", + close: ")" + }, + { + open: "<", + close: ">" + }, + { + open: "'", + close: "'" + }, + { + open: "`", + close: "`", + notIn: [ + "string" + ] + }, + { + open: '"', + close: '"' + }, + { + open: "[", + close: "]" + } + ], + brackets: [ + [ + "(", + ")" + ], + [ + "<", + ">" + ], + [ + "[", + "]" + ] + ], + comments: { + lineComment: ".." + }, + default: { + comments: { + lineComment: ".." + }, + brackets: [ + [ + "(", + ")" + ], + [ + "<", + ">" + ], + [ + "[", + "]" + ] + ], + surroundingPairs: [ + [ + "(", + ")" + ], + [ + "<", + ">" + ], + [ + "`", + "`" + ], + [ + "*", + "*" + ], + [ + "|", + "|" + ], + [ + "[", + "]" + ] + ], + autoClosingPairs: [ + { + open: "(", + close: ")" + }, + { + open: "<", + close: ">" + }, + { + open: "'", + close: "'" + }, + { + open: "`", + close: "`", + notIn: [ + "string" + ] + }, + { + open: '"', + close: '"' + }, + { + open: "[", + close: "]" + } + ], + autoCloseBefore: ":})>`\\n ", + onEnterRules: [ + { + beforeText: "^\\s*\\.\\. *$|(?" + ], + [ + "`", + "`" + ], + [ + "*", + "*" + ], + [ + "|", + "|" + ], + [ + "[", + "]" + ] + ], + wordPattern: "[\\w-]*\\w[\\w-]*" + }, + hlsl: { + autoClosingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + '"', + '"' + ] + ], + brackets: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ] + ], + comments: { + lineComment: "//", + blockComment: [ + "/*", + "*/" + ] + }, + default: { + comments: { + lineComment: "//", + blockComment: [ + "/*", + "*/" + ] + }, + brackets: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ] + ], + autoClosingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + '"', + '"' + ] + ], + surroundingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + '"', + '"' + ] + ] + }, + surroundingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + '"', + '"' + ] + ] + }, + javascript: { + autoCloseBefore: ";:.,=}])>` \n ", + autoClosingPairs: [ + { + open: "{", + close: "}" + }, + { + open: "[", + close: "]" + }, + { + open: "(", + close: ")" + }, + { + open: "'", + close: "'", + notIn: [ + "string", + "comment" + ] + }, + { + open: '"', + close: '"', + notIn: [ + "string" + ] + }, + { + open: "`", + close: "`", + notIn: [ + "string", + "comment" + ] + }, + { + open: "/**", + close: " */", + notIn: [ + "string" + ] + } + ], + brackets: [ + [ + "${", + "}" + ], + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ] + ], + comments: { + lineComment: "//", + blockComment: [ + "/*", + "*/" + ] + }, + default: { + comments: { + lineComment: "//", + blockComment: [ + "/*", + "*/" + ] + }, + brackets: [ + [ + "${", + "}" + ], + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ] + ], + autoClosingPairs: [ + { + open: "{", + close: "}" + }, + { + open: "[", + close: "]" + }, + { + open: "(", + close: ")" + }, + { + open: "'", + close: "'", + notIn: [ + "string", + "comment" + ] + }, + { + open: '"', + close: '"', + notIn: [ + "string" + ] + }, + { + open: "`", + close: "`", + notIn: [ + "string", + "comment" + ] + }, + { + open: "/**", + close: " */", + notIn: [ + "string" + ] + } + ], + surroundingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + "'", + "'" + ], + [ + '"', + '"' + ], + [ + "`", + "`" + ], + [ + "<", + ">" + ] + ], + autoCloseBefore: ";:.,=}])>` \n ", + folding: { + markers: { + start: "^\\s*//\\s*#?region\\b", + end: "^\\s*//\\s*#?endregion\\b" + } + }, + wordPattern: { + pattern: "(-?\\d*\\.\\d\\w*)|([^\\`\\~\\@\\!\\%\\^\\&\\*\\(\\)\\-\\=\\+\\[\\{\\]\\}\\\\\\|\\;\\:\\'\\\"\\,\\.\\<\\>/\\?\\s]+)" + }, + indentationRules: { + decreaseIndentPattern: { + pattern: "^\\s*[\\}\\]\\)].*$" + }, + increaseIndentPattern: { + pattern: "^.*(\\{[^}]*|\\([^)]*|\\[[^\\]]*)$" + }, + unIndentedLinePattern: { + pattern: "^(\\t|[ ])*[ ]\\*[^/]*\\*/\\s*$|^(\\t|[ ])*[ ]\\*/\\s*$|^(\\t|[ ])*[ ]\\*([ ]([^\\*]|\\*(?!/))*)?$" + }, + indentNextLinePattern: { + pattern: "^((.*=>\\s*)|((.*[^\\w]+|\\s*)((if|while|for)\\s*\\(.*\\)\\s*|else\\s*)))$" + } + }, + onEnterRules: [ + { + beforeText: { + pattern: "^\\s*/\\*\\*(?!/)([^\\*]|\\*(?!/))*$" + }, + afterText: { + pattern: "^\\s*\\*/$" + }, + action: { + indent: "indentOutdent", + appendText: " * " + } + }, + { + beforeText: { + pattern: "^\\s*/\\*\\*(?!/)([^\\*]|\\*(?!/))*$" + }, + action: { + indent: "none", + appendText: " * " + } + }, + { + beforeText: { + pattern: "^(\\t|[ ])*[ ]\\*([ ]([^\\*]|\\*(?!/))*)?$" + }, + previousLineText: { + pattern: "(?=^(\\s*(/\\*\\*|\\*)).*)(?=(?!(\\s*\\*/)))" + }, + action: { + indent: "none", + appendText: "* " + } + }, + { + beforeText: { + pattern: "^(\\t|[ ])*[ ]\\*/\\s*$" + }, + action: { + indent: "none", + removeText: 1 + } + }, + { + beforeText: { + pattern: "^(\\t|[ ])*[ ]\\*[^/]*\\*/\\s*$" + }, + action: { + indent: "none", + removeText: 1 + } + }, + { + beforeText: { + pattern: "^\\s*(\\bcase\\s.+:|\\bdefault:)$" + }, + afterText: { + pattern: "^(?!\\s*(\\bcase\\b|\\bdefault\\b))" + }, + action: { + indent: "indent" + } + }, + { + previousLineText: "^\\s*(((else ?)?if|for|while)\\s*\\(.*\\)\\s*|else\\s*)$", + beforeText: "^\\s+([^{i\\s]|i(?!f\\b))", + action: { + indent: "outdent" + } + }, + { + beforeText: "^.*\\([^\\)]*$", + afterText: "^\\s*\\).*$", + action: { + indent: "indentOutdent", + appendText: " " + } + }, + { + beforeText: "^.*\\{[^\\}]*$", + afterText: "^\\s*\\}.*$", + action: { + indent: "indentOutdent", + appendText: " " + } + }, + { + beforeText: "^.*\\[[^\\]]*$", + afterText: "^\\s*\\].*$", + action: { + indent: "indentOutdent", + appendText: " " + } + }, + { + beforeText: "(?\\s*)|((.*[^\\w]+|\\s*)((if|while|for)\\s*\\(.*\\)\\s*|else\\s*)))$" + } + }, + onEnterRules: [ + { + beforeText: { + pattern: "^\\s*/\\*\\*(?!/)([^\\*]|\\*(?!/))*$" + }, + afterText: { + pattern: "^\\s*\\*/$" + }, + action: { + indent: "indentOutdent", + appendText: " * " + } + }, + { + beforeText: { + pattern: "^\\s*/\\*\\*(?!/)([^\\*]|\\*(?!/))*$" + }, + action: { + indent: "none", + appendText: " * " + } + }, + { + beforeText: { + pattern: "^(\\t|[ ])*[ ]\\*([ ]([^\\*]|\\*(?!/))*)?$" + }, + previousLineText: { + pattern: "(?=^(\\s*(/\\*\\*|\\*)).*)(?=(?!(\\s*\\*/)))" + }, + action: { + indent: "none", + appendText: "* " + } + }, + { + beforeText: { + pattern: "^(\\t|[ ])*[ ]\\*/\\s*$" + }, + action: { + indent: "none", + removeText: 1 + } + }, + { + beforeText: { + pattern: "^(\\t|[ ])*[ ]\\*[^/]*\\*/\\s*$" + }, + action: { + indent: "none", + removeText: 1 + } + }, + { + beforeText: { + pattern: "^\\s*(\\bcase\\s.+:|\\bdefault:)$" + }, + afterText: { + pattern: "^(?!\\s*(\\bcase\\b|\\bdefault\\b))" + }, + action: { + indent: "indent" + } + }, + { + previousLineText: "^\\s*(((else ?)?if|for|while)\\s*\\(.*\\)\\s*|else\\s*)$", + beforeText: "^\\s+([^{i\\s]|i(?!f\\b))", + action: { + indent: "outdent" + } + }, + { + beforeText: "^.*\\([^\\)]*$", + afterText: "^\\s*\\).*$", + action: { + indent: "indentOutdent", + appendText: " " + } + }, + { + beforeText: "^.*\\{[^\\}]*$", + afterText: "^\\s*\\}.*$", + action: { + indent: "indentOutdent", + appendText: " " + } + }, + { + beforeText: "^.*\\[[^\\]]*$", + afterText: "^\\s*\\].*$", + action: { + indent: "indentOutdent", + appendText: " " + } + }, + { + beforeText: "(?" + ] + ], + wordPattern: { + pattern: "(-?\\d*\\.\\d\\w*)|([^\\`\\~\\@\\!\\%\\^\\&\\*\\(\\)\\-\\=\\+\\[\\{\\]\\}\\\\\\|\\;\\:\\'\\\"\\,\\.\\<\\>/\\?\\s]+)" + } + }, + coffeescript: { + autoClosingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + { + open: '"', + close: '"', + notIn: [ + "string" + ] + }, + { + open: "'", + close: "'", + notIn: [ + "string" + ] + } + ], + brackets: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ] + ], + comments: { + lineComment: "#", + blockComment: [ + "###", + "###" + ] + }, + default: { + comments: { + lineComment: "#", + blockComment: [ + "###", + "###" + ] + }, + brackets: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ] + ], + autoClosingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + { + open: '"', + close: '"', + notIn: [ + "string" + ] + }, + { + open: "'", + close: "'", + notIn: [ + "string" + ] + } + ], + surroundingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + '"', + '"' + ], + [ + "'", + "'" + ], + [ + " ", + " " + ] + ], + folding: { + offSide: true, + markers: { + start: "^\\s*#region\\b", + end: "^\\s*#endregion\\b" + } + } + }, + folding: { + offSide: true, + markers: { + start: "^\\s*#region\\b", + end: "^\\s*#endregion\\b" + } + }, + surroundingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + '"', + '"' + ], + [ + "'", + "'" + ], + [ + " ", + " " + ] + ] + }, + groovy: { + autoClosingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + { + open: '"', + close: '"', + notIn: [ + "string" + ] + }, + { + open: "'", + close: "'", + notIn: [ + "string" + ] + } + ], + brackets: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ] + ], + comments: { + lineComment: "//", + blockComment: [ + "/*", + "*/" + ] + }, + default: { + comments: { + lineComment: "//", + blockComment: [ + "/*", + "*/" + ] + }, + brackets: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ] + ], + autoClosingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + { + open: '"', + close: '"', + notIn: [ + "string" + ] + }, + { + open: "'", + close: "'", + notIn: [ + "string" + ] + } + ], + surroundingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + '"', + '"' + ], + [ + "'", + "'" + ] + ], + onEnterRules: [ + { + beforeText: { + pattern: "//.*" + }, + afterText: { + pattern: "^(?!\\s*$).+" + }, + action: { + indent: "none", + appendText: "// " + } + } + ] + }, + onEnterRules: [ + { + beforeText: { + pattern: "//.*" + }, + afterText: { + pattern: "^(?!\\s*$).+" + }, + action: { + indent: "none", + appendText: "// " + } + } + ], + surroundingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + '"', + '"' + ], + [ + "'", + "'" + ] + ] + }, + bat: { + autoClosingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + { + open: '"', + close: '"', + notIn: [ + "string" + ] + } + ], + brackets: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ] + ], + comments: { + lineComment: "@REM" + }, + default: { + comments: { + lineComment: "@REM" + }, + brackets: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ] + ], + autoClosingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + { + open: '"', + close: '"', + notIn: [ + "string" + ] + } + ], + surroundingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + "%", + "%" + ], + [ + '"', + '"' + ] + ], + folding: { + markers: { + start: "^\\s*(::|REM|@REM)\\s*#region", + end: "^\\s*(::|REM|@REM)\\s*#endregion" + } + } + }, + folding: { + markers: { + start: "^\\s*(::|REM|@REM)\\s*#region", + end: "^\\s*(::|REM|@REM)\\s*#endregion" + } + }, + surroundingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + "%", + "%" + ], + [ + '"', + '"' + ] + ] + }, + julia: { + autoClosingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + "`", + "`" + ], + { + open: '"', + close: '"', + notIn: [ + "string", + "comment" + ] + } + ], + brackets: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ] + ], + comments: { + lineComment: "#", + blockComment: [ + "#=", + "=#" + ] + }, + default: { + comments: { + lineComment: "#", + blockComment: [ + "#=", + "=#" + ] + }, + brackets: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ] + ], + autoClosingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + "`", + "`" + ], + { + open: '"', + close: '"', + notIn: [ + "string", + "comment" + ] + } + ], + surroundingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + '"', + '"' + ], + [ + "`", + "`" + ] + ], + folding: { + markers: { + start: "^\\s*#region", + end: "^\\s*#endregion" + } + }, + indentationRules: { + increaseIndentPattern: "^(\\s*|.*=\\s*|.*@\\w*\\s*)[\\w\\s]*(?:[\"'`][^\"'`]*[\"'`])*[\\w\\s]*\\b(if|while|for|function|macro|(mutable\\s+)?struct|abstract\\s+type|primitive\\s+type|let|quote|try|begin|.*\\)\\s*do|else|elseif|catch|finally)\\b(?!(?:.*\\bend\\b[^\\]]*)|(?:[^\\[]*\\].*)$).*$", + decreaseIndentPattern: "^\\s*(end|else|elseif|catch|finally)\\b.*$" + } + }, + folding: { + markers: { + start: "^\\s*#region", + end: "^\\s*#endregion" + } + }, + indentationRules: { + increaseIndentPattern: "^(\\s*|.*=\\s*|.*@\\w*\\s*)[\\w\\s]*(?:[\"'`][^\"'`]*[\"'`])*[\\w\\s]*\\b(if|while|for|function|macro|(mutable\\s+)?struct|abstract\\s+type|primitive\\s+type|let|quote|try|begin|.*\\)\\s*do|else|elseif|catch|finally)\\b(?!(?:.*\\bend\\b[^\\]]*)|(?:[^\\[]*\\].*)$).*$", + decreaseIndentPattern: "^\\s*(end|else|elseif|catch|finally)\\b.*$" + }, + surroundingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + '"', + '"' + ], + [ + "`", + "`" + ] + ] + }, + csharp: { + autoClosingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + { + open: "'", + close: "'", + notIn: [ + "string", + "comment" + ] + }, + { + open: '"', + close: '"', + notIn: [ + "string", + "comment" + ] + } + ], + brackets: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ] + ], + colorizedBracketPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + "<", + ">" + ] + ], + comments: { + lineComment: "//", + blockComment: [ + "/*", + "*/" + ] + }, + default: { + comments: { + lineComment: "//", + blockComment: [ + "/*", + "*/" + ] + }, + brackets: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ] + ], + autoClosingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + { + open: "'", + close: "'", + notIn: [ + "string", + "comment" + ] + }, + { + open: '"', + close: '"', + notIn: [ + "string", + "comment" + ] + } + ], + surroundingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + "<", + ">" + ], + [ + "'", + "'" + ], + [ + '"', + '"' + ] + ], + colorizedBracketPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + "<", + ">" + ] + ], + folding: { + markers: { + start: "^\\s*#region\\b", + end: "^\\s*#endregion\\b" + } + }, + onEnterRules: [ + { + beforeText: { + pattern: "[^/]//[^/].*" + }, + afterText: { + pattern: "^(?!\\s*$).+" + }, + action: { + indent: "none", + appendText: "// " + } + }, + { + beforeText: { + pattern: "^\\s*///" + }, + action: { + indent: "none", + appendText: "/// " + } + } + ] + }, + folding: { + markers: { + start: "^\\s*#region\\b", + end: "^\\s*#endregion\\b" + } + }, + onEnterRules: [ + { + beforeText: { + pattern: "[^/]//[^/].*" + }, + afterText: { + pattern: "^(?!\\s*$).+" + }, + action: { + indent: "none", + appendText: "// " + } + }, + { + beforeText: { + pattern: "^\\s*///" + }, + action: { + indent: "none", + appendText: "/// " + } + } + ], + surroundingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + "<", + ">" + ], + [ + "'", + "'" + ], + [ + '"', + '"' + ] + ] + }, + yaml: { + autoClosingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + '"', + '"' + ], + [ + "'", + "'" + ] + ], + brackets: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ] + ], + comments: { + lineComment: "#" + }, + default: { + comments: { + lineComment: "#" + }, + brackets: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ] + ], + autoClosingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + '"', + '"' + ], + [ + "'", + "'" + ] + ], + surroundingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + '"', + '"' + ], + [ + "'", + "'" + ] + ], + folding: { + offSide: true, + markers: { + start: "^\\s*#\\s*region\\b", + end: "^\\s*#\\s*endregion\\b" + } + }, + indentationRules: { + increaseIndentPattern: `^\\s*.*(:|-) ?(&\\w+)?(\\{[^}"']*|\\([^)"']*)?$`, + decreaseIndentPattern: "^\\s+\\}$" + } + }, + folding: { + offSide: true, + markers: { + start: "^\\s*#\\s*region\\b", + end: "^\\s*#\\s*endregion\\b" + } + }, + indentationRules: { + increaseIndentPattern: `^\\s*.*(:|-) ?(&\\w+)?(\\{[^}"']*|\\([^)"']*)?$`, + decreaseIndentPattern: "^\\s+\\}$" + }, + surroundingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + '"', + '"' + ], + [ + "'", + "'" + ] + ] + }, + markdown: { + autoClosingPairs: [ + { + open: "{", + close: "}" + }, + { + open: "[", + close: "]" + }, + { + open: "(", + close: ")" + }, + { + open: "<", + close: ">", + notIn: [ + "string" + ] + } + ], + brackets: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ] + ], + colorizedBracketPairs: [], + comments: { + blockComment: [ + "" + ] + }, + default: { + comments: { + blockComment: [ + "" + ] + }, + brackets: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ] + ], + colorizedBracketPairs: [], + autoClosingPairs: [ + { + open: "{", + close: "}" + }, + { + open: "[", + close: "]" + }, + { + open: "(", + close: ")" + }, + { + open: "<", + close: ">", + notIn: [ + "string" + ] + } + ], + surroundingPairs: [ + [ + "(", + ")" + ], + [ + "[", + "]" + ], + [ + "`", + "`" + ], + [ + "_", + "_" + ], + [ + "*", + "*" + ], + [ + "{", + "}" + ], + [ + "'", + "'" + ], + [ + '"', + '"' + ], + [ + "<", + ">" + ], + [ + "~", + "~" + ], + [ + "$", + "$" + ] + ], + folding: { + offSide: true, + markers: { + start: "^\\s*", + end: "^\\s*" + } + }, + wordPattern: { + pattern: "(\\p{Alphabetic}|\\p{Number}|\\p{Nonspacing_Mark})(((\\p{Alphabetic}|\\p{Number}|\\p{Nonspacing_Mark})|[_])?(\\p{Alphabetic}|\\p{Number}|\\p{Nonspacing_Mark}))*", + flags: "ug" + } + }, + folding: { + offSide: true, + markers: { + start: "^\\s*", + end: "^\\s*" + } + }, + surroundingPairs: [ + [ + "(", + ")" + ], + [ + "[", + "]" + ], + [ + "`", + "`" + ], + [ + "_", + "_" + ], + [ + "*", + "*" + ], + [ + "{", + "}" + ], + [ + "'", + "'" + ], + [ + '"', + '"' + ], + [ + "<", + ">" + ], + [ + "~", + "~" + ], + [ + "$", + "$" + ] + ], + wordPattern: { + pattern: "(\\p{Alphabetic}|\\p{Number}|\\p{Nonspacing_Mark})(((\\p{Alphabetic}|\\p{Number}|\\p{Nonspacing_Mark})|[_])?(\\p{Alphabetic}|\\p{Number}|\\p{Nonspacing_Mark}))*", + flags: "ug" + } + }, + shellscript: { + autoClosingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + { + open: '"', + close: '"', + notIn: [ + "string" + ] + }, + { + open: "'", + close: "'", + notIn: [ + "string" + ] + }, + { + open: "`", + close: "`", + notIn: [ + "string" + ] + } + ], + brackets: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ] + ], + comments: { + lineComment: "#" + }, + default: { + comments: { + lineComment: "#" + }, + brackets: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ] + ], + autoClosingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + { + open: '"', + close: '"', + notIn: [ + "string" + ] + }, + { + open: "'", + close: "'", + notIn: [ + "string" + ] + }, + { + open: "`", + close: "`", + notIn: [ + "string" + ] + } + ], + surroundingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + '"', + '"' + ], + [ + "'", + "'" + ], + [ + "`", + "`" + ] + ], + folding: { + markers: { + start: "^\\s*#\\s*#?region\\b.*", + end: "^\\s*#\\s*#?endregion\\b.*" + } + } + }, + folding: { + markers: { + start: "^\\s*#\\s*#?region\\b.*", + end: "^\\s*#\\s*#?endregion\\b.*" + } + }, + surroundingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + '"', + '"' + ], + [ + "'", + "'" + ], + [ + "`", + "`" + ] + ] + }, + make: { + autoClosingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + { + open: "'", + close: "'", + notIn: [ + "string", + "comment" + ] + }, + { + open: '"', + close: '"', + notIn: [ + "string", + "comment" + ] + } + ], + brackets: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ] + ], + comments: { + lineComment: { + comment: "#", + noIndent: true + } + }, + default: { + comments: { + lineComment: { + comment: "#", + noIndent: true + } + }, + brackets: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ] + ], + autoClosingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + { + open: "'", + close: "'", + notIn: [ + "string", + "comment" + ] + }, + { + open: '"', + close: '"', + notIn: [ + "string", + "comment" + ] + } + ] + } + }, + swift: { + autoClosingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + { + open: '"', + close: '"', + notIn: [ + "string" + ] + }, + { + open: "'", + close: "'", + notIn: [ + "string" + ] + }, + { + open: "`", + close: "`", + notIn: [ + "string" + ] + } + ], + brackets: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ] + ], + comments: { + lineComment: "//", + blockComment: [ + "/*", + "*/" + ] + }, + default: { + comments: { + lineComment: "//", + blockComment: [ + "/*", + "*/" + ] + }, + brackets: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ] + ], + autoClosingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + { + open: '"', + close: '"', + notIn: [ + "string" + ] + }, + { + open: "'", + close: "'", + notIn: [ + "string" + ] + }, + { + open: "`", + close: "`", + notIn: [ + "string" + ] + } + ], + surroundingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + '"', + '"' + ], + [ + "'", + "'" + ], + [ + "`", + "`" + ] + ], + onEnterRules: [ + { + beforeText: { + pattern: "//.*" + }, + afterText: { + pattern: "^(?!\\s*$).+" + }, + action: { + indent: "none", + appendText: "// " + } + } + ] + }, + onEnterRules: [ + { + beforeText: { + pattern: "//.*" + }, + afterText: { + pattern: "^(?!\\s*$).+" + }, + action: { + indent: "none", + appendText: "// " + } + } + ], + surroundingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + '"', + '"' + ], + [ + "'", + "'" + ], + [ + "`", + "`" + ] + ] + }, + cpp: { + autoClosingPairs: [ + { + open: "[", + close: "]" + }, + { + open: "{", + close: "}" + }, + { + open: "(", + close: ")" + }, + { + open: "'", + close: "'", + notIn: [ + "string", + "comment" + ] + }, + { + open: '"', + close: '"', + notIn: [ + "string" + ] + }, + { + open: "/*", + close: "*/", + notIn: [ + "string", + "comment" + ] + }, + { + open: "/**", + close: " */", + notIn: [ + "string" + ] + } + ], + brackets: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ] + ], + comments: { + lineComment: "//", + blockComment: [ + "/*", + "*/" + ] + }, + default: { + comments: { + lineComment: "//", + blockComment: [ + "/*", + "*/" + ] + }, + brackets: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ] + ], + autoClosingPairs: [ + { + open: "[", + close: "]" + }, + { + open: "{", + close: "}" + }, + { + open: "(", + close: ")" + }, + { + open: "'", + close: "'", + notIn: [ + "string", + "comment" + ] + }, + { + open: '"', + close: '"', + notIn: [ + "string" + ] + }, + { + open: "/*", + close: "*/", + notIn: [ + "string", + "comment" + ] + }, + { + open: "/**", + close: " */", + notIn: [ + "string" + ] + } + ], + surroundingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + '"', + '"' + ], + [ + "'", + "'" + ], + [ + "<", + ">" + ] + ], + wordPattern: "(-?\\d*\\.\\d\\w*)|([^\\`\\~\\!\\@\\#\\%\\^\\&\\*\\(\\)\\-\\=\\+\\[\\{\\]\\}\\\\\\|\\;\\:\\'\\\"\\,\\.\\<\\>\\/\\?\\s]+)", + folding: { + markers: { + start: "^\\s*#pragma\\s+region\\b", + end: "^\\s*#pragma\\s+endregion\\b" + } + }, + indentationRules: { + decreaseIndentPattern: { + pattern: "^\\s*[\\}\\]\\)].*$" + }, + increaseIndentPattern: { + pattern: "^.*(\\{[^}]*|\\([^)]*|\\[[^\\]]*)$" + } + }, + onEnterRules: [ + { + previousLineText: "^\\s*(((else ?)?if|for|while)\\s*\\(.*\\)\\s*|else\\s*)$", + beforeText: "^\\s+([^{i\\s]|i(?!f\\b))", + action: { + indent: "outdent" + } + }, + { + beforeText: { + pattern: "//.*" + }, + afterText: { + pattern: "^(?!\\s*$).+" + }, + action: { + indent: "none", + appendText: "// " + } + } + ] + }, + folding: { + markers: { + start: "^\\s*#pragma\\s+region\\b", + end: "^\\s*#pragma\\s+endregion\\b" + } + }, + indentationRules: { + decreaseIndentPattern: { + pattern: "^\\s*[\\}\\]\\)].*$" + }, + increaseIndentPattern: { + pattern: "^.*(\\{[^}]*|\\([^)]*|\\[[^\\]]*)$" + } + }, + onEnterRules: [ + { + previousLineText: "^\\s*(((else ?)?if|for|while)\\s*\\(.*\\)\\s*|else\\s*)$", + beforeText: "^\\s+([^{i\\s]|i(?!f\\b))", + action: { + indent: "outdent" + } + }, + { + beforeText: { + pattern: "//.*" + }, + afterText: { + pattern: "^(?!\\s*$).+" + }, + action: { + indent: "none", + appendText: "// " + } + } + ], + surroundingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + '"', + '"' + ], + [ + "'", + "'" + ], + [ + "<", + ">" + ] + ], + wordPattern: "(-?\\d*\\.\\d\\w*)|([^\\`\\~\\!\\@\\#\\%\\^\\&\\*\\(\\)\\-\\=\\+\\[\\{\\]\\}\\\\\\|\\;\\:\\'\\\"\\,\\.\\<\\>\\/\\?\\s]+)" + }, + handlebars: { + autoClosingPairs: [ + { + open: "{", + close: "}" + }, + { + open: "[", + close: "]" + }, + { + open: "(", + close: ")" + }, + { + open: "'", + close: "'" + }, + { + open: '"', + close: '"' + } + ], + brackets: [ + [ + "" + ], + [ + "<", + ">" + ], + [ + "{{", + "}}" + ], + [ + "{{{", + "}}}" + ], + [ + "{", + "}" + ], + [ + "(", + ")" + ] + ], + comments: { + blockComment: [ + "{{!--", + "--}}" + ] + }, + default: { + comments: { + blockComment: [ + "{{!--", + "--}}" + ] + }, + brackets: [ + [ + "" + ], + [ + "<", + ">" + ], + [ + "{{", + "}}" + ], + [ + "{{{", + "}}}" + ], + [ + "{", + "}" + ], + [ + "(", + ")" + ] + ], + autoClosingPairs: [ + { + open: "{", + close: "}" + }, + { + open: "[", + close: "]" + }, + { + open: "(", + close: ")" + }, + { + open: "'", + close: "'" + }, + { + open: '"', + close: '"' + } + ], + surroundingPairs: [ + { + open: "'", + close: "'" + }, + { + open: '"', + close: '"' + }, + { + open: "<", + close: ">" + }, + { + open: "{", + close: "}" + } + ], + wordPattern: "(-?\\d*\\.\\d\\w*)|([^\\`\\~\\!\\@\\$\\^\\&\\*\\(\\)\\=\\+\\[\\{\\]\\}\\\\\\|\\;\\:\\'\\\"\\,\\.\\<\\>\\/\\s]+)", + onEnterRules: [ + { + beforeText: { + pattern: "<(?!(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr))([_:\\w][_:\\w-.\\d]*)([^/>]*(?!\\/)>)[^<]*$", + flags: "i" + }, + afterText: { + pattern: "^<\\/([_:\\w][_:\\w-.\\d]*)\\s*>", + flags: "i" + }, + action: { + indent: "indentOutdent" + } + }, + { + beforeText: { + pattern: "<(?!(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr))(\\w[\\w\\d]*)([^/>]*(?!\\/)>)[^<]*$", + flags: "i" + }, + action: { + indent: "indent" + } + } + ] + }, + onEnterRules: [ + { + beforeText: { + pattern: "<(?!(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr))([_:\\w][_:\\w-.\\d]*)([^/>]*(?!\\/)>)[^<]*$", + flags: "i" + }, + afterText: { + pattern: "^<\\/([_:\\w][_:\\w-.\\d]*)\\s*>", + flags: "i" + }, + action: { + indent: "indentOutdent" + } + }, + { + beforeText: { + pattern: "<(?!(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr))(\\w[\\w\\d]*)([^/>]*(?!\\/)>)[^<]*$", + flags: "i" + }, + action: { + indent: "indent" + } + } + ], + surroundingPairs: [ + { + open: "'", + close: "'" + }, + { + open: '"', + close: '"' + }, + { + open: "<", + close: ">" + }, + { + open: "{", + close: "}" + } + ], + wordPattern: "(-?\\d*\\.\\d\\w*)|([^\\`\\~\\!\\@\\$\\^\\&\\*\\(\\)\\=\\+\\[\\{\\]\\}\\\\\\|\\;\\:\\'\\\"\\,\\.\\<\\>\\/\\s]+)" + }, + json: { + autoClosingPairs: [ + { + open: "{", + close: "}", + notIn: [ + "string" + ] + }, + { + open: "[", + close: "]", + notIn: [ + "string" + ] + }, + { + open: "(", + close: ")", + notIn: [ + "string" + ] + }, + { + open: "'", + close: "'", + notIn: [ + "string" + ] + }, + { + open: '"', + close: '"', + notIn: [ + "string", + "comment" + ] + }, + { + open: "`", + close: "`", + notIn: [ + "string", + "comment" + ] + } + ], + brackets: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ] + ], + comments: { + lineComment: "//", + blockComment: [ + "/*", + "*/" + ] + }, + default: { + comments: { + lineComment: "//", + blockComment: [ + "/*", + "*/" + ] + }, + brackets: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ] + ], + autoClosingPairs: [ + { + open: "{", + close: "}", + notIn: [ + "string" + ] + }, + { + open: "[", + close: "]", + notIn: [ + "string" + ] + }, + { + open: "(", + close: ")", + notIn: [ + "string" + ] + }, + { + open: "'", + close: "'", + notIn: [ + "string" + ] + }, + { + open: '"', + close: '"', + notIn: [ + "string", + "comment" + ] + }, + { + open: "`", + close: "`", + notIn: [ + "string", + "comment" + ] + } + ], + indentationRules: { + increaseIndentPattern: '({+(?=((\\\\.|[^"\\\\])*"(\\\\.|[^"\\\\])*")*[^"}]*)$)|(\\[+(?=((\\\\.|[^"\\\\])*"(\\\\.|[^"\\\\])*")*[^"\\]]*)$)', + decreaseIndentPattern: "^\\s*[}\\]],?\\s*$" + }, + onEnterRules: [ + { + beforeText: { + pattern: "//.*" + }, + afterText: { + pattern: "^(?!\\s*$).+" + }, + action: { + indent: "none", + appendText: "// " + } + } + ] + }, + indentationRules: { + increaseIndentPattern: '({+(?=((\\\\.|[^"\\\\])*"(\\\\.|[^"\\\\])*")*[^"}]*)$)|(\\[+(?=((\\\\.|[^"\\\\])*"(\\\\.|[^"\\\\])*")*[^"\\]]*)$)', + decreaseIndentPattern: "^\\s*[}\\]],?\\s*$" + }, + onEnterRules: [ + { + beforeText: { + pattern: "//.*" + }, + afterText: { + pattern: "^(?!\\s*$).+" + }, + action: { + indent: "none", + appendText: "// " + } + } + ] + }, + ini: { + autoClosingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + { + open: '"', + close: '"', + notIn: [ + "string" + ] + }, + { + open: "'", + close: "'", + notIn: [ + "string" + ] + } + ], + brackets: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ] + ], + comments: { + lineComment: ";", + blockComment: [ + ";", + " " + ] + }, + default: { + comments: { + lineComment: ";", + blockComment: [ + ";", + " " + ] + }, + brackets: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ] + ], + autoClosingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + { + open: '"', + close: '"', + notIn: [ + "string" + ] + }, + { + open: "'", + close: "'", + notIn: [ + "string" + ] + } + ], + surroundingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + '"', + '"' + ], + [ + "'", + "'" + ] + ] + }, + surroundingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + '"', + '"' + ], + [ + "'", + "'" + ] + ] + }, + typescript: { + autoCloseBefore: ";:.,=}])>` \n ", + autoClosingPairs: [ + { + open: "{", + close: "}" + }, + { + open: "[", + close: "]" + }, + { + open: "(", + close: ")" + }, + { + open: "'", + close: "'", + notIn: [ + "string", + "comment" + ] + }, + { + open: '"', + close: '"', + notIn: [ + "string" + ] + }, + { + open: "`", + close: "`", + notIn: [ + "string", + "comment" + ] + }, + { + open: "/**", + close: " */", + notIn: [ + "string" + ] + } + ], + brackets: [ + [ + "${", + "}" + ], + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ] + ], + colorizedBracketPairs: [ + [ + "(", + ")" + ], + [ + "[", + "]" + ], + [ + "{", + "}" + ], + [ + "<", + ">" + ] + ], + comments: { + lineComment: "//", + blockComment: [ + "/*", + "*/" + ] + }, + default: { + comments: { + lineComment: "//", + blockComment: [ + "/*", + "*/" + ] + }, + brackets: [ + [ + "${", + "}" + ], + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ] + ], + autoClosingPairs: [ + { + open: "{", + close: "}" + }, + { + open: "[", + close: "]" + }, + { + open: "(", + close: ")" + }, + { + open: "'", + close: "'", + notIn: [ + "string", + "comment" + ] + }, + { + open: '"', + close: '"', + notIn: [ + "string" + ] + }, + { + open: "`", + close: "`", + notIn: [ + "string", + "comment" + ] + }, + { + open: "/**", + close: " */", + notIn: [ + "string" + ] + } + ], + surroundingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + "'", + "'" + ], + [ + '"', + '"' + ], + [ + "`", + "`" + ], + [ + "<", + ">" + ] + ], + colorizedBracketPairs: [ + [ + "(", + ")" + ], + [ + "[", + "]" + ], + [ + "{", + "}" + ], + [ + "<", + ">" + ] + ], + autoCloseBefore: ";:.,=}])>` \n ", + folding: { + markers: { + start: "^\\s*//\\s*#?region\\b", + end: "^\\s*//\\s*#?endregion\\b" + } + }, + wordPattern: { + pattern: "(-?\\d*\\.\\d\\w*)|([^\\`\\@\\~\\!\\%\\^\\&\\*\\(\\)\\-\\=\\+\\[\\{\\]\\}\\\\\\|\\;\\:\\'\\\"\\,\\.\\<\\>/\\?\\s]+)" + }, + indentationRules: { + decreaseIndentPattern: { + pattern: "^\\s*[\\}\\]\\)].*$" + }, + increaseIndentPattern: { + pattern: "^.*(\\{[^}]*|\\([^)]*|\\[[^\\]]*)$" + }, + unIndentedLinePattern: { + pattern: "^(\\t|[ ])*[ ]\\*[^/]*\\*/\\s*$|^(\\t|[ ])*[ ]\\*/\\s*$|^(\\t|[ ])*\\*([ ]([^\\*]|\\*(?!/))*)?$" + }, + indentNextLinePattern: { + pattern: "^((.*=>\\s*)|((.*[^\\w]+|\\s*)((if|while|for)\\s*\\(.*\\)\\s*|else\\s*)))$" + } + }, + onEnterRules: [ + { + beforeText: { + pattern: "^\\s*/\\*\\*(?!/)([^\\*]|\\*(?!/))*$" + }, + afterText: { + pattern: "^\\s*\\*/$" + }, + action: { + indent: "indentOutdent", + appendText: " * " + } + }, + { + beforeText: { + pattern: "^\\s*/\\*\\*(?!/)([^\\*]|\\*(?!/))*$" + }, + action: { + indent: "none", + appendText: " * " + } + }, + { + beforeText: { + pattern: "^(\\t|[ ])*\\*([ ]([^\\*]|\\*(?!/))*)?$" + }, + previousLineText: { + pattern: "(?=^(\\s*(/\\*\\*|\\*)).*)(?=(?!(\\s*\\*/)))" + }, + action: { + indent: "none", + appendText: "* " + } + }, + { + beforeText: { + pattern: "^(\\t|[ ])*[ ]\\*/\\s*$" + }, + action: { + indent: "none", + removeText: 1 + } + }, + { + beforeText: { + pattern: "^(\\t|[ ])*[ ]\\*[^/]*\\*/\\s*$" + }, + action: { + indent: "none", + removeText: 1 + } + }, + { + beforeText: { + pattern: "^\\s*(\\bcase\\s.+:|\\bdefault:)$" + }, + afterText: { + pattern: "^(?!\\s*(\\bcase\\b|\\bdefault\\b))" + }, + action: { + indent: "indent" + } + }, + { + previousLineText: "^\\s*(((else ?)?if|for|while)\\s*\\(.*\\)\\s*|else\\s*)$", + beforeText: "^\\s+([^{i\\s]|i(?!f\\b))", + action: { + indent: "outdent" + } + }, + { + beforeText: "^.*\\([^\\)]*$", + afterText: "^\\s*\\).*$", + action: { + indent: "indentOutdent", + appendText: " " + } + }, + { + beforeText: "^.*\\{[^\\}]*$", + afterText: "^\\s*\\}.*$", + action: { + indent: "indentOutdent", + appendText: " " + } + }, + { + beforeText: "^.*\\[[^\\]]*$", + afterText: "^\\s*\\].*$", + action: { + indent: "indentOutdent", + appendText: " " + } + }, + { + beforeText: "(?\\s*)|((.*[^\\w]+|\\s*)((if|while|for)\\s*\\(.*\\)\\s*|else\\s*)))$" + } + }, + onEnterRules: [ + { + beforeText: { + pattern: "^\\s*/\\*\\*(?!/)([^\\*]|\\*(?!/))*$" + }, + afterText: { + pattern: "^\\s*\\*/$" + }, + action: { + indent: "indentOutdent", + appendText: " * " + } + }, + { + beforeText: { + pattern: "^\\s*/\\*\\*(?!/)([^\\*]|\\*(?!/))*$" + }, + action: { + indent: "none", + appendText: " * " + } + }, + { + beforeText: { + pattern: "^(\\t|[ ])*\\*([ ]([^\\*]|\\*(?!/))*)?$" + }, + previousLineText: { + pattern: "(?=^(\\s*(/\\*\\*|\\*)).*)(?=(?!(\\s*\\*/)))" + }, + action: { + indent: "none", + appendText: "* " + } + }, + { + beforeText: { + pattern: "^(\\t|[ ])*[ ]\\*/\\s*$" + }, + action: { + indent: "none", + removeText: 1 + } + }, + { + beforeText: { + pattern: "^(\\t|[ ])*[ ]\\*[^/]*\\*/\\s*$" + }, + action: { + indent: "none", + removeText: 1 + } + }, + { + beforeText: { + pattern: "^\\s*(\\bcase\\s.+:|\\bdefault:)$" + }, + afterText: { + pattern: "^(?!\\s*(\\bcase\\b|\\bdefault\\b))" + }, + action: { + indent: "indent" + } + }, + { + previousLineText: "^\\s*(((else ?)?if|for|while)\\s*\\(.*\\)\\s*|else\\s*)$", + beforeText: "^\\s+([^{i\\s]|i(?!f\\b))", + action: { + indent: "outdent" + } + }, + { + beforeText: "^.*\\([^\\)]*$", + afterText: "^\\s*\\).*$", + action: { + indent: "indentOutdent", + appendText: " " + } + }, + { + beforeText: "^.*\\{[^\\}]*$", + afterText: "^\\s*\\}.*$", + action: { + indent: "indentOutdent", + appendText: " " + } + }, + { + beforeText: "^.*\\[[^\\]]*$", + afterText: "^\\s*\\].*$", + action: { + indent: "indentOutdent", + appendText: " " + } + }, + { + beforeText: "(?" + ] + ], + wordPattern: { + pattern: "(-?\\d*\\.\\d\\w*)|([^\\`\\@\\~\\!\\%\\^\\&\\*\\(\\)\\-\\=\\+\\[\\{\\]\\}\\\\\\|\\;\\:\\'\\\"\\,\\.\\<\\>/\\?\\s]+)" + } + }, + powershell: { + autoClosingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + { + open: "@'", + close: "\n'@", + notIn: [ + "string", + "comment" + ] + }, + { + open: '@"', + close: '\n"@', + notIn: [ + "string", + "comment" + ] + }, + { + open: '"', + close: '"', + notIn: [ + "string" + ] + }, + { + open: "'", + close: "'", + notIn: [ + "string", + "comment" + ] + }, + [ + "<#", + "#>" + ] + ], + brackets: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ] + ], + comments: { + lineComment: "#", + blockComment: [ + "<#", + "#>" + ] + }, + default: { + comments: { + lineComment: "#", + blockComment: [ + "<#", + "#>" + ] + }, + brackets: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ] + ], + autoClosingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + { + open: "@'", + close: "\n'@", + notIn: [ + "string", + "comment" + ] + }, + { + open: '@"', + close: '\n"@', + notIn: [ + "string", + "comment" + ] + }, + { + open: '"', + close: '"', + notIn: [ + "string" + ] + }, + { + open: "'", + close: "'", + notIn: [ + "string", + "comment" + ] + }, + [ + "<#", + "#>" + ] + ], + surroundingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + '"', + '"' + ], + [ + "'", + "'" + ] + ], + folding: { + markers: { + start: "^\\s*#[rR]egion\\b", + end: "^\\s*#[eE]nd[rR]egion\\b" + } + } + }, + folding: { + markers: { + start: "^\\s*#[rR]egion\\b", + end: "^\\s*#[eE]nd[rR]egion\\b" + } + }, + surroundingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + '"', + '"' + ], + [ + "'", + "'" + ] + ] + }, + vb: { + autoClosingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + { + open: '"', + close: '"', + notIn: [ + "string" + ] + } + ], + brackets: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ] + ], + comments: { + lineComment: "'" + }, + default: { + comments: { + lineComment: "'" + }, + brackets: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ] + ], + autoClosingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + { + open: '"', + close: '"', + notIn: [ + "string" + ] + } + ], + surroundingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + '"', + '"' + ], + [ + "<", + ">" + ] + ], + folding: { + markers: { + start: "^\\s*#Region\\b", + end: "^\\s*#End Region\\b" + } + } + }, + folding: { + markers: { + start: "^\\s*#Region\\b", + end: "^\\s*#End Region\\b" + } + }, + surroundingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + '"', + '"' + ], + [ + "<", + ">" + ] + ] + }, + xml: { + autoClosingPairs: [ + { + open: "{", + close: "}" + }, + { + open: "[", + close: "]" + }, + { + open: "(", + close: ")" + }, + { + open: '"', + close: '"', + notIn: [ + "string" + ] + }, + { + open: "'", + close: "'", + notIn: [ + "string" + ] + }, + { + open: "", + notIn: [ + "comment", + "string" + ] + } + ], + brackets: [ + [ + "" + ], + [ + "<", + ">" + ], + [ + "{", + "}" + ], + [ + "(", + ")" + ] + ], + colorizedBracketPairs: [], + comments: { + blockComment: [ + "" + ] + }, + default: { + comments: { + blockComment: [ + "" + ] + }, + brackets: [ + [ + "" + ], + [ + "<", + ">" + ], + [ + "{", + "}" + ], + [ + "(", + ")" + ] + ], + autoClosingPairs: [ + { + open: "{", + close: "}" + }, + { + open: "[", + close: "]" + }, + { + open: "(", + close: ")" + }, + { + open: '"', + close: '"', + notIn: [ + "string" + ] + }, + { + open: "'", + close: "'", + notIn: [ + "string" + ] + }, + { + open: "", + notIn: [ + "comment", + "string" + ] + } + ], + surroundingPairs: [ + { + open: "'", + close: "'" + }, + { + open: '"', + close: '"' + }, + { + open: "{", + close: "}" + }, + { + open: "[", + close: "]" + }, + { + open: "(", + close: ")" + }, + { + open: "<", + close: ">" + } + ], + colorizedBracketPairs: [], + folding: { + markers: { + start: "^\\s*", + end: "^\\s*" + } + }, + wordPattern: { + pattern: "(-?\\d*\\.\\d\\w*)|([^\\`\\~\\!\\@\\#\\$\\%\\^\\&\\*\\(\\)\\=\\+\\[\\{\\]\\}\\\\\\|\\;\\:\\'\\\"\\,\\.\\<\\>\\/\\?\\s]+)" + } + }, + folding: { + markers: { + start: "^\\s*", + end: "^\\s*" + } + }, + surroundingPairs: [ + { + open: "'", + close: "'" + }, + { + open: '"', + close: '"' + }, + { + open: "{", + close: "}" + }, + { + open: "[", + close: "]" + }, + { + open: "(", + close: ")" + }, + { + open: "<", + close: ">" + } + ], + wordPattern: { + pattern: "(-?\\d*\\.\\d\\w*)|([^\\`\\~\\!\\@\\#\\$\\%\\^\\&\\*\\(\\)\\=\\+\\[\\{\\]\\}\\\\\\|\\;\\:\\'\\\"\\,\\.\\<\\>\\/\\?\\s]+)" + } + }, + lua: { + autoClosingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + { + open: '"', + close: '"', + notIn: [ + "string" + ] + }, + { + open: "'", + close: "'", + notIn: [ + "string" + ] + } + ], + brackets: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ] + ], + comments: { + lineComment: "--", + blockComment: [ + "--[[", + "]]" + ] + }, + default: { + comments: { + lineComment: "--", + blockComment: [ + "--[[", + "]]" + ] + }, + brackets: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ] + ], + autoClosingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + { + open: '"', + close: '"', + notIn: [ + "string" + ] + }, + { + open: "'", + close: "'", + notIn: [ + "string" + ] + } + ], + surroundingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + '"', + '"' + ], + [ + "'", + "'" + ] + ], + indentationRules: { + increaseIndentPattern: "^((?!(\\-\\-)).)*((\\b(else|function|then|do|repeat)\\b((?!\\b(end|until)\\b).)*)|(\\{\\s*))$", + decreaseIndentPattern: "^\\s*((\\b(elseif|else|end|until)\\b)|(\\})|(\\)))" + } + }, + indentationRules: { + increaseIndentPattern: "^((?!(\\-\\-)).)*((\\b(else|function|then|do|repeat)\\b((?!\\b(end|until)\\b).)*)|(\\{\\s*))$", + decreaseIndentPattern: "^\\s*((\\b(elseif|else|end|until)\\b)|(\\})|(\\)))" + }, + surroundingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + '"', + '"' + ], + [ + "'", + "'" + ] + ] + }, + php: { + autoClosingPairs: [ + { + open: "{", + close: "}", + notIn: [ + "string" + ] + }, + { + open: "[", + close: "]", + notIn: [ + "string" + ] + }, + { + open: "(", + close: ")", + notIn: [ + "string" + ] + }, + { + open: "'", + close: "'", + notIn: [ + "string", + "comment" + ] + }, + { + open: '"', + close: '"', + notIn: [ + "string", + "comment" + ] + }, + { + open: "/**", + close: " */", + notIn: [ + "string" + ] + } + ], + brackets: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ] + ], + comments: { + lineComment: "//", + blockComment: [ + "/*", + "*/" + ] + }, + default: { + comments: { + lineComment: "//", + blockComment: [ + "/*", + "*/" + ] + }, + brackets: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ] + ], + autoClosingPairs: [ + { + open: "{", + close: "}", + notIn: [ + "string" + ] + }, + { + open: "[", + close: "]", + notIn: [ + "string" + ] + }, + { + open: "(", + close: ")", + notIn: [ + "string" + ] + }, + { + open: "'", + close: "'", + notIn: [ + "string", + "comment" + ] + }, + { + open: '"', + close: '"', + notIn: [ + "string", + "comment" + ] + }, + { + open: "/**", + close: " */", + notIn: [ + "string" + ] + } + ], + surroundingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + "'", + "'" + ], + [ + '"', + '"' + ], + [ + "`", + "`" + ] + ], + indentationRules: { + increaseIndentPattern: "({(?!.*}).*|\\(|\\[|((else(\\s)?)?if|else|for(each)?|while|switch|case).*:)\\s*((/[/*].*|)?$|\\?>)", + decreaseIndentPattern: "^(.*\\*\\/)?\\s*((\\})|(\\)+[;,])|(\\]\\)*[;,])|\\b(else:)|\\b((end(if|for(each)?|while|switch));))", + unIndentedLinePattern: { + pattern: "^(\\t|[ ])*[ ]\\*[^/]*\\*/\\s*$|^(\\t|[ ])*[ ]\\*/\\s*$|^(\\t|[ ])*\\*([ ]([^\\*]|\\*(?!/))*)?$" + }, + indentNextLinePattern: { + pattern: "^\\s*(((if|else ?if|while|for|foreach)\\s*\\(.*\\)\\s*)|else\\s*)$" + } + }, + folding: { + markers: { + start: "^\\s*(#|//)region\\b", + end: "^\\s*(#|//)endregion\\b" + } + }, + wordPattern: "(-?\\d*\\.\\d\\w*)|([^\\-\\`\\~\\!\\@\\#\\%\\^\\&\\*\\(\\)\\=\\+\\[\\{\\]\\}\\\\\\|\\;\\:\\'\\\"\\,\\.\\<\\>\\/\\?\\s]+)", + onEnterRules: [ + { + beforeText: "^\\s*\\/\\*\\*(?!\\/)([^\\*]|\\*(?!\\/))*$", + afterText: "^\\s*\\*\\/$", + action: { + indent: "indentOutdent", + appendText: " * " + } + }, + { + beforeText: "^\\s*\\/\\*\\*(?!\\/)([^\\*]|\\*(?!\\/))*$", + action: { + indent: "none", + appendText: " * " + } + }, + { + beforeText: "^(\\t|(\\ \\ ))*\\ \\*(\\ ([^\\*]|\\*(?!\\/))*)?$", + action: { + indent: "none", + appendText: "* " + } + }, + { + beforeText: "^(\\t|(\\ \\ ))*\\ \\*\\/\\s*$", + action: { + indent: "none", + removeText: 1 + } + }, + { + beforeText: "^(\\t|(\\ \\ ))*\\ \\*[^/]*\\*\\/\\s*$", + action: { + indent: "none", + removeText: 1 + } + }, + { + previousLineText: "^\\s*(((else ?)?if|for(each)?|while)\\s*\\(.*\\)\\s*|else\\s*)$", + beforeText: "^\\s+([^{i\\s]|i(?!f\\b))", + action: { + indent: "outdent" + } + }, + { + beforeText: { + pattern: "//.*" + }, + afterText: { + pattern: "^(?!\\s*$).+" + }, + action: { + indent: "none", + appendText: "// " + } + } + ] + }, + folding: { + markers: { + start: "^\\s*(#|//)region\\b", + end: "^\\s*(#|//)endregion\\b" + } + }, + indentationRules: { + increaseIndentPattern: "({(?!.*}).*|\\(|\\[|((else(\\s)?)?if|else|for(each)?|while|switch|case).*:)\\s*((/[/*].*|)?$|\\?>)", + decreaseIndentPattern: "^(.*\\*\\/)?\\s*((\\})|(\\)+[;,])|(\\]\\)*[;,])|\\b(else:)|\\b((end(if|for(each)?|while|switch));))", + unIndentedLinePattern: { + pattern: "^(\\t|[ ])*[ ]\\*[^/]*\\*/\\s*$|^(\\t|[ ])*[ ]\\*/\\s*$|^(\\t|[ ])*\\*([ ]([^\\*]|\\*(?!/))*)?$" + }, + indentNextLinePattern: { + pattern: "^\\s*(((if|else ?if|while|for|foreach)\\s*\\(.*\\)\\s*)|else\\s*)$" + } + }, + onEnterRules: [ + { + beforeText: "^\\s*\\/\\*\\*(?!\\/)([^\\*]|\\*(?!\\/))*$", + afterText: "^\\s*\\*\\/$", + action: { + indent: "indentOutdent", + appendText: " * " + } + }, + { + beforeText: "^\\s*\\/\\*\\*(?!\\/)([^\\*]|\\*(?!\\/))*$", + action: { + indent: "none", + appendText: " * " + } + }, + { + beforeText: "^(\\t|(\\ \\ ))*\\ \\*(\\ ([^\\*]|\\*(?!\\/))*)?$", + action: { + indent: "none", + appendText: "* " + } + }, + { + beforeText: "^(\\t|(\\ \\ ))*\\ \\*\\/\\s*$", + action: { + indent: "none", + removeText: 1 + } + }, + { + beforeText: "^(\\t|(\\ \\ ))*\\ \\*[^/]*\\*\\/\\s*$", + action: { + indent: "none", + removeText: 1 + } + }, + { + previousLineText: "^\\s*(((else ?)?if|for(each)?|while)\\s*\\(.*\\)\\s*|else\\s*)$", + beforeText: "^\\s+([^{i\\s]|i(?!f\\b))", + action: { + indent: "outdent" + } + }, + { + beforeText: { + pattern: "//.*" + }, + afterText: { + pattern: "^(?!\\s*$).+" + }, + action: { + indent: "none", + appendText: "// " + } + } + ], + surroundingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + "'", + "'" + ], + [ + '"', + '"' + ], + [ + "`", + "`" + ] + ], + wordPattern: "(-?\\d*\\.\\d\\w*)|([^\\-\\`\\~\\!\\@\\#\\%\\^\\&\\*\\(\\)\\=\\+\\[\\{\\]\\}\\\\\\|\\;\\:\\'\\\"\\,\\.\\<\\>\\/\\?\\s]+)" + }, + html: { + autoClosingPairs: [ + { + open: "{", + close: "}" + }, + { + open: "[", + close: "]" + }, + { + open: "(", + close: ")" + }, + { + open: "'", + close: "'" + }, + { + open: '"', + close: '"' + }, + { + open: "", + notIn: [ + "comment", + "string" + ] + } + ], + brackets: [ + [ + "" + ], + [ + "{", + "}" + ], + [ + "(", + ")" + ] + ], + colorizedBracketPairs: [], + comments: { + blockComment: [ + "" + ] + }, + default: { + comments: { + blockComment: [ + "" + ] + }, + brackets: [ + [ + "" + ], + [ + "{", + "}" + ], + [ + "(", + ")" + ] + ], + autoClosingPairs: [ + { + open: "{", + close: "}" + }, + { + open: "[", + close: "]" + }, + { + open: "(", + close: ")" + }, + { + open: "'", + close: "'" + }, + { + open: '"', + close: '"' + }, + { + open: "", + notIn: [ + "comment", + "string" + ] + } + ], + surroundingPairs: [ + { + open: "'", + close: "'" + }, + { + open: '"', + close: '"' + }, + { + open: "{", + close: "}" + }, + { + open: "[", + close: "]" + }, + { + open: "(", + close: ")" + }, + { + open: "<", + close: ">" + } + ], + colorizedBracketPairs: [], + folding: { + markers: { + start: "^\\s*", + end: "^\\s*" + } + }, + wordPattern: "(-?\\d*\\.\\d\\w*)|([^\\`\\~\\!\\@\\$\\^\\&\\*\\(\\)\\=\\+\\[\\{\\]\\}\\\\\\|\\;\\:\\'\\\"\\,\\.\\<\\>\\/\\s]+)", + onEnterRules: [ + { + beforeText: { + pattern: `<(?!(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr))([_:\\w][_:\\w-.\\d]*)(?:(?:[^'"/>]|"[^"]*"|'[^']*')*?(?!\\/)>)[^<]*$`, + flags: "i" + }, + afterText: { + pattern: "^<\\/([_:\\w][_:\\w-.\\d]*)\\s*>", + flags: "i" + }, + action: { + indent: "indentOutdent" + } + }, + { + beforeText: { + pattern: `<(?!(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr))([_:\\w][_:\\w-.\\d]*)(?:(?:[^'"/>]|"[^"]*"|'[^']*')*?(?!\\/)>)[^<]*$`, + flags: "i" + }, + action: { + indent: "indent" + } + } + ], + indentationRules: { + increaseIndentPattern: `<(?!\\?|(?:area|base|br|col|frame|hr|html|img|input|keygen|link|menuitem|meta|param|source|track|wbr)\\b|[^>]*\\/>)([-_\\.A-Za-z0-9]+)(?=\\s|>)\\b[^>]*>(?!.*<\\/\\1>)|)|\\{[^}"']*$`, + decreaseIndentPattern: "^\\s*(<\\/(?!html)[-_\\.A-Za-z0-9]+\\b[^>]*>|-->|\\})" + } + }, + folding: { + markers: { + start: "^\\s*", + end: "^\\s*" + } + }, + indentationRules: { + increaseIndentPattern: `<(?!\\?|(?:area|base|br|col|frame|hr|html|img|input|keygen|link|menuitem|meta|param|source|track|wbr)\\b|[^>]*\\/>)([-_\\.A-Za-z0-9]+)(?=\\s|>)\\b[^>]*>(?!.*<\\/\\1>)|)|\\{[^}"']*$`, + decreaseIndentPattern: "^\\s*(<\\/(?!html)[-_\\.A-Za-z0-9]+\\b[^>]*>|-->|\\})" + }, + onEnterRules: [ + { + beforeText: { + pattern: `<(?!(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr))([_:\\w][_:\\w-.\\d]*)(?:(?:[^'"/>]|"[^"]*"|'[^']*')*?(?!\\/)>)[^<]*$`, + flags: "i" + }, + afterText: { + pattern: "^<\\/([_:\\w][_:\\w-.\\d]*)\\s*>", + flags: "i" + }, + action: { + indent: "indentOutdent" + } + }, + { + beforeText: { + pattern: `<(?!(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr))([_:\\w][_:\\w-.\\d]*)(?:(?:[^'"/>]|"[^"]*"|'[^']*')*?(?!\\/)>)[^<]*$`, + flags: "i" + }, + action: { + indent: "indent" + } + } + ], + surroundingPairs: [ + { + open: "'", + close: "'" + }, + { + open: '"', + close: '"' + }, + { + open: "{", + close: "}" + }, + { + open: "[", + close: "]" + }, + { + open: "(", + close: ")" + }, + { + open: "<", + close: ">" + } + ], + wordPattern: "(-?\\d*\\.\\d\\w*)|([^\\`\\~\\!\\@\\$\\^\\&\\*\\(\\)\\=\\+\\[\\{\\]\\}\\\\\\|\\;\\:\\'\\\"\\,\\.\\<\\>\\/\\s]+)" + }, + diff: { + brackets: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ] + ], + comments: { + lineComment: "#", + blockComment: [ + "#", + " " + ] + }, + default: { + comments: { + lineComment: "#", + blockComment: [ + "#", + " " + ] + }, + brackets: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ] + ] + } + }, + java: { + autoClosingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + { + open: '"', + close: '"', + notIn: [ + "string" + ] + }, + { + open: "'", + close: "'", + notIn: [ + "string" + ] + }, + { + open: "/**", + close: " */", + notIn: [ + "string" + ] + } + ], + brackets: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ] + ], + comments: { + lineComment: "//", + blockComment: [ + "/*", + "*/" + ] + }, + default: { + comments: { + lineComment: "//", + blockComment: [ + "/*", + "*/" + ] + }, + brackets: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ] + ], + autoClosingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + { + open: '"', + close: '"', + notIn: [ + "string" + ] + }, + { + open: "'", + close: "'", + notIn: [ + "string" + ] + }, + { + open: "/**", + close: " */", + notIn: [ + "string" + ] + } + ], + surroundingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + '"', + '"' + ], + [ + "'", + "'" + ], + [ + "<", + ">" + ] + ], + folding: { + markers: { + start: "^\\s*//\\s*(?:(?:#?region\\b)|(?:))" + } + }, + onEnterRules: [ + { + beforeText: { + pattern: "^\\s*/\\*\\*(?!/)([^\\*]|\\*(?!/))*$" + }, + afterText: { + pattern: "^\\s*\\*/$" + }, + action: { + indent: "indentOutdent", + appendText: " * " + } + }, + { + beforeText: { + pattern: "^\\s*/\\*\\*(?!/)([^\\*]|\\*(?!/))*$" + }, + action: { + indent: "none", + appendText: " * " + } + }, + { + beforeText: { + pattern: "^(\\t|[ ])*[ ]\\*([ ]([^\\*]|\\*(?!/))*)?$" + }, + previousLineText: { + pattern: "(?=^(\\s*(/\\*\\*|\\*)).*)(?=(?!(\\s*\\*/)))" + }, + action: { + indent: "none", + appendText: "* " + } + }, + { + beforeText: { + pattern: "^(\\t|[ ])*[ ]\\*/\\s*$" + }, + action: { + indent: "none", + removeText: 1 + } + }, + { + beforeText: { + pattern: "^(\\t|[ ])*[ ]\\*[^/]*\\*/\\s*$" + }, + action: { + indent: "none", + removeText: 1 + } + }, + { + beforeText: { + pattern: "^\\s*(\\bcase\\s.+:|\\bdefault:)$" + }, + afterText: { + pattern: "^(?!\\s*(\\bcase\\b|\\bdefault\\b))" + }, + action: { + indent: "indent" + } + }, + { + beforeText: { + pattern: "//.*" + }, + afterText: { + pattern: "^(?!\\s*$).+" + }, + action: { + indent: "none", + appendText: "// " + } + } + ] + }, + folding: { + markers: { + start: "^\\s*//\\s*(?:(?:#?region\\b)|(?:))" + } + }, + onEnterRules: [ + { + beforeText: { + pattern: "^\\s*/\\*\\*(?!/)([^\\*]|\\*(?!/))*$" + }, + afterText: { + pattern: "^\\s*\\*/$" + }, + action: { + indent: "indentOutdent", + appendText: " * " + } + }, + { + beforeText: { + pattern: "^\\s*/\\*\\*(?!/)([^\\*]|\\*(?!/))*$" + }, + action: { + indent: "none", + appendText: " * " + } + }, + { + beforeText: { + pattern: "^(\\t|[ ])*[ ]\\*([ ]([^\\*]|\\*(?!/))*)?$" + }, + previousLineText: { + pattern: "(?=^(\\s*(/\\*\\*|\\*)).*)(?=(?!(\\s*\\*/)))" + }, + action: { + indent: "none", + appendText: "* " + } + }, + { + beforeText: { + pattern: "^(\\t|[ ])*[ ]\\*/\\s*$" + }, + action: { + indent: "none", + removeText: 1 + } + }, + { + beforeText: { + pattern: "^(\\t|[ ])*[ ]\\*[^/]*\\*/\\s*$" + }, + action: { + indent: "none", + removeText: 1 + } + }, + { + beforeText: { + pattern: "^\\s*(\\bcase\\s.+:|\\bdefault:)$" + }, + afterText: { + pattern: "^(?!\\s*(\\bcase\\b|\\bdefault\\b))" + }, + action: { + indent: "indent" + } + }, + { + beforeText: { + pattern: "//.*" + }, + afterText: { + pattern: "^(?!\\s*$).+" + }, + action: { + indent: "none", + appendText: "// " + } + } + ], + surroundingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + '"', + '"' + ], + [ + "'", + "'" + ], + [ + "<", + ">" + ] + ] + }, + r: { + autoClosingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + "`", + "`" + ], + { + open: '"', + close: '"', + notIn: [ + "string" + ] + }, + { + open: "'", + close: "'", + notIn: [ + "string", + "comment" + ] + }, + { + open: "%", + close: "%", + notIn: [ + "string", + "comment" + ] + } + ], + brackets: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ] + ], + comments: { + lineComment: "#" + }, + default: { + comments: { + lineComment: "#" + }, + brackets: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ] + ], + autoClosingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + "`", + "`" + ], + { + open: '"', + close: '"', + notIn: [ + "string" + ] + }, + { + open: "'", + close: "'", + notIn: [ + "string", + "comment" + ] + }, + { + open: "%", + close: "%", + notIn: [ + "string", + "comment" + ] + } + ], + surroundingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + "`", + "`" + ], + [ + '"', + '"' + ], + [ + "'", + "'" + ] + ] + }, + surroundingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + "`", + "`" + ], + [ + '"', + '"' + ], + [ + "'", + "'" + ] + ] + }, + fsharp: { + autoClosingPairs: [ + { + open: "{", + close: "}" + }, + { + open: "[", + close: "]" + }, + { + open: "(", + close: ")" + }, + { + open: '"', + close: '"', + notIn: [ + "string" + ] + } + ], + brackets: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ] + ], + comments: { + lineComment: "//", + blockComment: [ + "(*", + "*)" + ] + }, + default: { + comments: { + lineComment: "//", + blockComment: [ + "(*", + "*)" + ] + }, + brackets: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ] + ], + autoClosingPairs: [ + { + open: "{", + close: "}" + }, + { + open: "[", + close: "]" + }, + { + open: "(", + close: ")" + }, + { + open: '"', + close: '"', + notIn: [ + "string" + ] + } + ], + surroundingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + '"', + '"' + ], + [ + "'", + "'" + ] + ], + folding: { + offSide: true, + markers: { + start: "^\\s*//\\s*#region\\b|^\\s*\\(\\*\\s*#region(.*)\\*\\)", + end: "^\\s*//\\s*#endregion\\b|^\\s*\\(\\*\\s*#endregion\\s*\\*\\)" + } + } + }, + folding: { + offSide: true, + markers: { + start: "^\\s*//\\s*#region\\b|^\\s*\\(\\*\\s*#region(.*)\\*\\)", + end: "^\\s*//\\s*#endregion\\b|^\\s*\\(\\*\\s*#endregion\\s*\\*\\)" + } + }, + surroundingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + '"', + '"' + ], + [ + "'", + "'" + ] + ] + }, + pug: { + autoClosingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + { + open: '"', + close: '"', + notIn: [ + "string" + ] + }, + { + open: "'", + close: "'", + notIn: [ + "string" + ] + } + ], + brackets: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ] + ], + comments: { + lineComment: "//-" + }, + default: { + comments: { + lineComment: "//-" + }, + brackets: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ] + ], + autoClosingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + { + open: '"', + close: '"', + notIn: [ + "string" + ] + }, + { + open: "'", + close: "'", + notIn: [ + "string" + ] + } + ], + surroundingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + "'", + "'" + ], + [ + '"', + '"' + ] + ], + folding: { + offSide: true + } + }, + folding: { + offSide: true + }, + surroundingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + "'", + "'" + ], + [ + '"', + '"' + ] + ] + }, + rust: { + autoClosingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + { + open: '"', + close: '"', + notIn: [ + "string" + ] + } + ], + brackets: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ] + ], + comments: { + lineComment: "//", + blockComment: [ + "/*", + "*/" + ] + }, + default: { + comments: { + lineComment: "//", + blockComment: [ + "/*", + "*/" + ] + }, + brackets: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ] + ], + autoClosingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + { + open: '"', + close: '"', + notIn: [ + "string" + ] + } + ], + surroundingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + '"', + '"' + ], + [ + "<", + ">" + ] + ], + indentationRules: { + increaseIndentPattern: `^.*\\{[^}"']*$|^.*\\([^\\)"']*$`, + decreaseIndentPattern: "^\\s*(\\s*\\/[*].*[*]\\/\\s*)*[})]" + }, + folding: { + markers: { + start: "^\\s*//\\s*#?region\\b", + end: "^\\s*//\\s*#?endregion\\b" + } + }, + onEnterRules: [ + { + beforeText: { + pattern: "//.*" + }, + afterText: { + pattern: "^(?!\\s*$).+" + }, + action: { + indent: "none", + appendText: "// " + } + } + ] + }, + folding: { + markers: { + start: "^\\s*//\\s*#?region\\b", + end: "^\\s*//\\s*#?endregion\\b" + } + }, + indentationRules: { + increaseIndentPattern: `^.*\\{[^}"']*$|^.*\\([^\\)"']*$`, + decreaseIndentPattern: "^\\s*(\\s*\\/[*].*[*]\\/\\s*)*[})]" + }, + onEnterRules: [ + { + beforeText: { + pattern: "//.*" + }, + afterText: { + pattern: "^(?!\\s*$).+" + }, + action: { + indent: "none", + appendText: "// " + } + } + ], + surroundingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + '"', + '"' + ], + [ + "<", + ">" + ] + ] + }, + perl: { + autoClosingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + { + open: '"', + close: '"', + notIn: [ + "string" + ] + }, + { + open: "'", + close: "'", + notIn: [ + "string" + ] + }, + { + open: "`", + close: "`", + notIn: [ + "string" + ] + } + ], + brackets: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ] + ], + comments: { + lineComment: "#" + }, + default: { + comments: { + lineComment: "#" + }, + brackets: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ] + ], + autoClosingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + { + open: '"', + close: '"', + notIn: [ + "string" + ] + }, + { + open: "'", + close: "'", + notIn: [ + "string" + ] + }, + { + open: "`", + close: "`", + notIn: [ + "string" + ] + } + ], + surroundingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + '"', + '"' + ], + [ + "'", + "'" + ], + [ + "`", + "`" + ] + ], + folding: { + markers: { + start: "^(?:(?:=pod\\s*$)|(?:\\s*#region\\b))", + end: "^(?:(?:=cut\\s*$)|(?:\\s*#endregion\\b))" + } + } + }, + folding: { + markers: { + start: "^(?:(?:=pod\\s*$)|(?:\\s*#region\\b))", + end: "^(?:(?:=cut\\s*$)|(?:\\s*#endregion\\b))" + } + }, + surroundingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + '"', + '"' + ], + [ + "'", + "'" + ], + [ + "`", + "`" + ] + ] + }, + scss: { + autoClosingPairs: [ + { + open: "{", + close: "}", + notIn: [ + "string", + "comment" + ] + }, + { + open: "[", + close: "]", + notIn: [ + "string", + "comment" + ] + }, + { + open: "(", + close: ")", + notIn: [ + "string", + "comment" + ] + }, + { + open: '"', + close: '"', + notIn: [ + "string", + "comment" + ] + }, + { + open: "'", + close: "'", + notIn: [ + "string", + "comment" + ] + } + ], + brackets: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ] + ], + comments: { + blockComment: [ + "/*", + "*/" + ], + lineComment: "//" + }, + default: { + comments: { + blockComment: [ + "/*", + "*/" + ], + lineComment: "//" + }, + brackets: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ] + ], + autoClosingPairs: [ + { + open: "{", + close: "}", + notIn: [ + "string", + "comment" + ] + }, + { + open: "[", + close: "]", + notIn: [ + "string", + "comment" + ] + }, + { + open: "(", + close: ")", + notIn: [ + "string", + "comment" + ] + }, + { + open: '"', + close: '"', + notIn: [ + "string", + "comment" + ] + }, + { + open: "'", + close: "'", + notIn: [ + "string", + "comment" + ] + } + ], + surroundingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + '"', + '"' + ], + [ + "'", + "'" + ] + ], + folding: { + markers: { + start: "^\\s*\\/\\*\\s*#region\\b\\s*(.*?)\\s*\\*\\/", + end: "^\\s*\\/\\*\\s*#endregion\\b.*\\*\\/" + } + }, + indentationRules: { + increaseIndentPattern: "(^.*\\{[^}]*$)", + decreaseIndentPattern: "^\\s*\\}" + }, + wordPattern: "(#?-?\\d*\\.\\d\\w*%?)|(::?[\\w-]*(?=[^,{;]*[,{]))|(([@$#.!])?[\\w-?]+%?|[@#!$.])", + onEnterRules: [ + { + beforeText: "^[\\s]*///.*$", + action: { + indent: "none", + appendText: "/// " + } + } + ] + }, + folding: { + markers: { + start: "^\\s*\\/\\*\\s*#region\\b\\s*(.*?)\\s*\\*\\/", + end: "^\\s*\\/\\*\\s*#endregion\\b.*\\*\\/" + } + }, + indentationRules: { + increaseIndentPattern: "(^.*\\{[^}]*$)", + decreaseIndentPattern: "^\\s*\\}" + }, + onEnterRules: [ + { + beforeText: "^[\\s]*///.*$", + action: { + indent: "none", + appendText: "/// " + } + } + ], + surroundingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + '"', + '"' + ], + [ + "'", + "'" + ] + ], + wordPattern: "(#?-?\\d*\\.\\d\\w*%?)|(::?[\\w-]*(?=[^,{;]*[,{]))|(([@$#.!])?[\\w-?]+%?|[@#!$.])" + }, + latex: { + autoCloseBefore: ";:.,={}])>\\` \n $", + autoClosingPairs: [ + [ + "\\left(", + "\\right)" + ], + [ + "\\left[", + "\\right]" + ], + [ + "\\left\\{", + "\\right\\}" + ], + [ + "\\bigl(", + "\\bigr)" + ], + [ + "\\bigl[", + "\\bigr]" + ], + [ + "\\bigl\\{", + "\\bigr\\}" + ], + [ + "\\Bigl(", + "\\Bigr)" + ], + [ + "\\Bigl[", + "\\Bigr]" + ], + [ + "\\Bigl\\{", + "\\Bigr\\}" + ], + [ + "\\biggl(", + "\\biggr)" + ], + [ + "\\biggl[", + "\\biggr]" + ], + [ + "\\biggl\\{", + "\\biggr\\}" + ], + [ + "\\Biggl(", + "\\Biggr)" + ], + [ + "\\Biggl[", + "\\Biggr]" + ], + [ + "\\Biggl\\{", + "\\Biggr\\}" + ], + [ + "\\(", + "\\)" + ], + [ + "\\[", + "\\]" + ], + [ + "\\{", + "\\}" + ], + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + "`", + "'" + ] + ], + brackets: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + "[", + ")" + ], + [ + "(", + "]" + ], + [ + "\\left(", + "\\right)" + ], + [ + "\\left(", + "\\right." + ], + [ + "\\left.", + "\\right)" + ], + [ + "\\left[", + "\\right]" + ], + [ + "\\left[", + "\\right." + ], + [ + "\\left.", + "\\right]" + ], + [ + "\\left\\{", + "\\right\\}" + ], + [ + "\\left\\{", + "\\right." + ], + [ + "\\left.", + "\\right\\}" + ], + [ + "\\left<", + "\\right>" + ], + [ + "\\bigl(", + "\\bigr)" + ], + [ + "\\bigl[", + "\\bigr]" + ], + [ + "\\bigl\\{", + "\\bigr\\}" + ], + [ + "\\Bigl(", + "\\Bigr)" + ], + [ + "\\Bigl[", + "\\Bigr]" + ], + [ + "\\Bigl\\{", + "\\Bigr\\}" + ], + [ + "\\biggl(", + "\\biggr)" + ], + [ + "\\biggl[", + "\\biggr]" + ], + [ + "\\biggl\\{", + "\\biggr\\}" + ], + [ + "\\Biggl(", + "\\Biggr)" + ], + [ + "\\Biggl[", + "\\Biggr]" + ], + [ + "\\Biggl\\{", + "\\Biggr\\}" + ], + [ + "\\langle", + "\\rangle" + ], + [ + "\\lvert", + "\\rvert" + ], + [ + "\\lVert", + "\\rVert" + ], + [ + "\\left|", + "\\right|" + ], + [ + "\\left\\vert", + "\\right\\vert" + ], + [ + "\\left\\|", + "\\right\\|" + ], + [ + "\\left\\Vert", + "\\right\\Vert" + ], + [ + "\\left\\langle", + "\\right\\rangle" + ], + [ + "\\left\\lvert", + "\\right\\rvert" + ], + [ + "\\left\\lVert", + "\\right\\rVert" + ], + [ + "\\bigl\\langle", + "\\bigr\\rangle" + ], + [ + "\\bigl|", + "\\bigr|" + ], + [ + "\\bigl\\vert", + "\\bigr\\vert" + ], + [ + "\\bigl\\lvert", + "\\bigr\\rvert" + ], + [ + "\\bigl\\|", + "\\bigr\\|" + ], + [ + "\\bigl\\lVert", + "\\bigr\\rVert" + ], + [ + "\\bigl\\Vert", + "\\bigr\\Vert" + ], + [ + "\\Bigl\\langle", + "\\Bigr\\rangle" + ], + [ + "\\Bigl|", + "\\Bigr|" + ], + [ + "\\Bigl\\lvert", + "\\Bigr\\rvert" + ], + [ + "\\Bigl\\vert", + "\\Bigr\\vert" + ], + [ + "\\Bigl\\|", + "\\Bigr\\|" + ], + [ + "\\Bigl\\lVert", + "\\Bigr\\rVert" + ], + [ + "\\Bigl\\Vert", + "\\Bigr\\Vert" + ], + [ + "\\biggl\\langle", + "\\biggr\\rangle" + ], + [ + "\\biggl|", + "\\biggr|" + ], + [ + "\\biggl\\lvert", + "\\biggr\\rvert" + ], + [ + "\\biggl\\vert", + "\\biggr\\vert" + ], + [ + "\\biggl\\|", + "\\biggr\\|" + ], + [ + "\\biggl\\lVert", + "\\biggr\\rVert" + ], + [ + "\\biggl\\Vert", + "\\biggr\\Vert" + ], + [ + "\\Biggl\\langle", + "\\Biggr\\rangle" + ], + [ + "\\Biggl|", + "\\Biggr|" + ], + [ + "\\Biggl\\lvert", + "\\Biggr\\rvert" + ], + [ + "\\Biggl\\vert", + "\\Biggr\\vert" + ], + [ + "\\Biggl\\|", + "\\Biggr\\|" + ], + [ + "\\Biggl\\lVert", + "\\Biggr\\rVert" + ], + [ + "\\Biggl\\Vert", + "\\Biggr\\Vert" + ] + ], + comments: { + lineComment: "%" + }, + default: { + comments: { + lineComment: "%" + }, + brackets: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + "[", + ")" + ], + [ + "(", + "]" + ], + [ + "\\left(", + "\\right)" + ], + [ + "\\left(", + "\\right." + ], + [ + "\\left.", + "\\right)" + ], + [ + "\\left[", + "\\right]" + ], + [ + "\\left[", + "\\right." + ], + [ + "\\left.", + "\\right]" + ], + [ + "\\left\\{", + "\\right\\}" + ], + [ + "\\left\\{", + "\\right." + ], + [ + "\\left.", + "\\right\\}" + ], + [ + "\\left<", + "\\right>" + ], + [ + "\\bigl(", + "\\bigr)" + ], + [ + "\\bigl[", + "\\bigr]" + ], + [ + "\\bigl\\{", + "\\bigr\\}" + ], + [ + "\\Bigl(", + "\\Bigr)" + ], + [ + "\\Bigl[", + "\\Bigr]" + ], + [ + "\\Bigl\\{", + "\\Bigr\\}" + ], + [ + "\\biggl(", + "\\biggr)" + ], + [ + "\\biggl[", + "\\biggr]" + ], + [ + "\\biggl\\{", + "\\biggr\\}" + ], + [ + "\\Biggl(", + "\\Biggr)" + ], + [ + "\\Biggl[", + "\\Biggr]" + ], + [ + "\\Biggl\\{", + "\\Biggr\\}" + ], + [ + "\\langle", + "\\rangle" + ], + [ + "\\lvert", + "\\rvert" + ], + [ + "\\lVert", + "\\rVert" + ], + [ + "\\left|", + "\\right|" + ], + [ + "\\left\\vert", + "\\right\\vert" + ], + [ + "\\left\\|", + "\\right\\|" + ], + [ + "\\left\\Vert", + "\\right\\Vert" + ], + [ + "\\left\\langle", + "\\right\\rangle" + ], + [ + "\\left\\lvert", + "\\right\\rvert" + ], + [ + "\\left\\lVert", + "\\right\\rVert" + ], + [ + "\\bigl\\langle", + "\\bigr\\rangle" + ], + [ + "\\bigl|", + "\\bigr|" + ], + [ + "\\bigl\\vert", + "\\bigr\\vert" + ], + [ + "\\bigl\\lvert", + "\\bigr\\rvert" + ], + [ + "\\bigl\\|", + "\\bigr\\|" + ], + [ + "\\bigl\\lVert", + "\\bigr\\rVert" + ], + [ + "\\bigl\\Vert", + "\\bigr\\Vert" + ], + [ + "\\Bigl\\langle", + "\\Bigr\\rangle" + ], + [ + "\\Bigl|", + "\\Bigr|" + ], + [ + "\\Bigl\\lvert", + "\\Bigr\\rvert" + ], + [ + "\\Bigl\\vert", + "\\Bigr\\vert" + ], + [ + "\\Bigl\\|", + "\\Bigr\\|" + ], + [ + "\\Bigl\\lVert", + "\\Bigr\\rVert" + ], + [ + "\\Bigl\\Vert", + "\\Bigr\\Vert" + ], + [ + "\\biggl\\langle", + "\\biggr\\rangle" + ], + [ + "\\biggl|", + "\\biggr|" + ], + [ + "\\biggl\\lvert", + "\\biggr\\rvert" + ], + [ + "\\biggl\\vert", + "\\biggr\\vert" + ], + [ + "\\biggl\\|", + "\\biggr\\|" + ], + [ + "\\biggl\\lVert", + "\\biggr\\rVert" + ], + [ + "\\biggl\\Vert", + "\\biggr\\Vert" + ], + [ + "\\Biggl\\langle", + "\\Biggr\\rangle" + ], + [ + "\\Biggl|", + "\\Biggr|" + ], + [ + "\\Biggl\\lvert", + "\\Biggr\\rvert" + ], + [ + "\\Biggl\\vert", + "\\Biggr\\vert" + ], + [ + "\\Biggl\\|", + "\\Biggr\\|" + ], + [ + "\\Biggl\\lVert", + "\\Biggr\\rVert" + ], + [ + "\\Biggl\\Vert", + "\\Biggr\\Vert" + ] + ], + autoClosingPairs: [ + [ + "\\left(", + "\\right)" + ], + [ + "\\left[", + "\\right]" + ], + [ + "\\left\\{", + "\\right\\}" + ], + [ + "\\bigl(", + "\\bigr)" + ], + [ + "\\bigl[", + "\\bigr]" + ], + [ + "\\bigl\\{", + "\\bigr\\}" + ], + [ + "\\Bigl(", + "\\Bigr)" + ], + [ + "\\Bigl[", + "\\Bigr]" + ], + [ + "\\Bigl\\{", + "\\Bigr\\}" + ], + [ + "\\biggl(", + "\\biggr)" + ], + [ + "\\biggl[", + "\\biggr]" + ], + [ + "\\biggl\\{", + "\\biggr\\}" + ], + [ + "\\Biggl(", + "\\Biggr)" + ], + [ + "\\Biggl[", + "\\Biggr]" + ], + [ + "\\Biggl\\{", + "\\Biggr\\}" + ], + [ + "\\(", + "\\)" + ], + [ + "\\[", + "\\]" + ], + [ + "\\{", + "\\}" + ], + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + "`", + "'" + ] + ], + surroundingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + '"', + '"' + ], + [ + "'", + "'" + ], + [ + "`", + "'" + ], + [ + "$", + "$" + ] + ], + indentationRules: { + increaseIndentPattern: "\\\\begin{(?!document)([^}]*)}(?!.*\\\\end{\\1})", + decreaseIndentPattern: "^\\s*\\\\end{(?!document)" + }, + folding: { + markers: { + start: "^\\s*%?\\s*(region|\\\\begingroup)\\b", + end: "^\\s*%?\\s*(endregion|\\\\endgroup)\\b" + } + }, + autoCloseBefore: ";:.,={}])>\\` \n $", + wordPattern: { + pattern: "(\\p{Alphabetic}|\\p{Number}|\\p{Nonspacing_Mark}){1,}", + flags: "u" + } + }, + folding: { + markers: { + start: "^\\s*%?\\s*(region|\\\\begingroup)\\b", + end: "^\\s*%?\\s*(endregion|\\\\endgroup)\\b" + } + }, + indentationRules: { + increaseIndentPattern: "\\\\begin{(?!document)([^}]*)}(?!.*\\\\end{\\1})", + decreaseIndentPattern: "^\\s*\\\\end{(?!document)" + }, + surroundingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + '"', + '"' + ], + [ + "'", + "'" + ], + [ + "`", + "'" + ], + [ + "$", + "$" + ] + ], + wordPattern: { + pattern: "(\\p{Alphabetic}|\\p{Number}|\\p{Nonspacing_Mark}){1,}", + flags: "u" + } + }, + dart: { + autoClosingPairs: [ + { + open: "{", + close: "}" + }, + { + open: "[", + close: "]" + }, + { + open: "(", + close: ")" + }, + { + open: "'", + close: "'", + notIn: [ + "string", + "comment" + ] + }, + { + open: '"', + close: '"', + notIn: [ + "string" + ] + }, + { + open: "`", + close: "`", + notIn: [ + "string", + "comment" + ] + }, + { + open: "/**", + close: " */", + notIn: [ + "string" + ] + } + ], + brackets: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ] + ], + comments: { + lineComment: "//", + blockComment: [ + "/*", + "*/" + ] + }, + default: { + comments: { + lineComment: "//", + blockComment: [ + "/*", + "*/" + ] + }, + brackets: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ] + ], + autoClosingPairs: [ + { + open: "{", + close: "}" + }, + { + open: "[", + close: "]" + }, + { + open: "(", + close: ")" + }, + { + open: "'", + close: "'", + notIn: [ + "string", + "comment" + ] + }, + { + open: '"', + close: '"', + notIn: [ + "string" + ] + }, + { + open: "`", + close: "`", + notIn: [ + "string", + "comment" + ] + }, + { + open: "/**", + close: " */", + notIn: [ + "string" + ] + } + ], + surroundingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + "<", + ">" + ], + [ + "'", + "'" + ], + [ + '"', + '"' + ], + [ + "`", + "`" + ] + ] + }, + surroundingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + "<", + ">" + ], + [ + "'", + "'" + ], + [ + '"', + '"' + ], + [ + "`", + "`" + ] + ] + }, + less: { + autoClosingPairs: [ + { + open: "{", + close: "}", + notIn: [ + "string", + "comment" + ] + }, + { + open: "[", + close: "]", + notIn: [ + "string", + "comment" + ] + }, + { + open: "(", + close: ")", + notIn: [ + "string", + "comment" + ] + }, + { + open: '"', + close: '"', + notIn: [ + "string", + "comment" + ] + }, + { + open: "'", + close: "'", + notIn: [ + "string", + "comment" + ] + } + ], + brackets: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ] + ], + comments: { + blockComment: [ + "/*", + "*/" + ], + lineComment: "//" + }, + default: { + comments: { + blockComment: [ + "/*", + "*/" + ], + lineComment: "//" + }, + brackets: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ] + ], + autoClosingPairs: [ + { + open: "{", + close: "}", + notIn: [ + "string", + "comment" + ] + }, + { + open: "[", + close: "]", + notIn: [ + "string", + "comment" + ] + }, + { + open: "(", + close: ")", + notIn: [ + "string", + "comment" + ] + }, + { + open: '"', + close: '"', + notIn: [ + "string", + "comment" + ] + }, + { + open: "'", + close: "'", + notIn: [ + "string", + "comment" + ] + } + ], + surroundingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + '"', + '"' + ], + [ + "'", + "'" + ] + ], + folding: { + markers: { + start: "^\\s*\\/\\*\\s*#region\\b\\s*(.*?)\\s*\\*\\/", + end: "^\\s*\\/\\*\\s*#endregion\\b.*\\*\\/" + } + }, + indentationRules: { + increaseIndentPattern: "(^.*\\{[^}]*$)", + decreaseIndentPattern: "^\\s*\\}" + }, + wordPattern: "(#?-?\\d*\\.\\d\\w*%?)|(::?[\\w-]+(?=[^,{;]*[,{]))|(([@#.!])?[\\w-?]+%?|[@#!.])", + onEnterRules: [ + { + beforeText: { + pattern: "//.*" + }, + afterText: { + pattern: "^(?!\\s*$).+" + }, + action: { + indent: "none", + appendText: "// " + } + } + ] + }, + folding: { + markers: { + start: "^\\s*\\/\\*\\s*#region\\b\\s*(.*?)\\s*\\*\\/", + end: "^\\s*\\/\\*\\s*#endregion\\b.*\\*\\/" + } + }, + indentationRules: { + increaseIndentPattern: "(^.*\\{[^}]*$)", + decreaseIndentPattern: "^\\s*\\}" + }, + onEnterRules: [ + { + beforeText: { + pattern: "//.*" + }, + afterText: { + pattern: "^(?!\\s*$).+" + }, + action: { + indent: "none", + appendText: "// " + } + } + ], + surroundingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + '"', + '"' + ], + [ + "'", + "'" + ] + ], + wordPattern: "(#?-?\\d*\\.\\d\\w*%?)|(::?[\\w-]+(?=[^,{;]*[,{]))|(([@#.!])?[\\w-?]+%?|[@#!.])" + }, + clojure: { + autoClosingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + { + open: '"', + close: '"', + notIn: [ + "string" + ] + } + ], + brackets: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ] + ], + comments: { + lineComment: ";;" + }, + default: { + comments: { + lineComment: ";;" + }, + brackets: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ] + ], + autoClosingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + { + open: '"', + close: '"', + notIn: [ + "string" + ] + } + ], + surroundingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + '"', + '"' + ] + ], + folding: { + offSide: true + } + }, + folding: { + offSide: true + }, + surroundingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + '"', + '"' + ] + ] + }, + css: { + autoClosingPairs: [ + { + open: "{", + close: "}", + notIn: [ + "string", + "comment" + ] + }, + { + open: "[", + close: "]", + notIn: [ + "string", + "comment" + ] + }, + { + open: "(", + close: ")", + notIn: [ + "string", + "comment" + ] + }, + { + open: '"', + close: '"', + notIn: [ + "string", + "comment" + ] + }, + { + open: "'", + close: "'", + notIn: [ + "string", + "comment" + ] + } + ], + brackets: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ] + ], + comments: { + blockComment: [ + "/*", + "*/" + ] + }, + default: { + comments: { + blockComment: [ + "/*", + "*/" + ] + }, + brackets: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ] + ], + autoClosingPairs: [ + { + open: "{", + close: "}", + notIn: [ + "string", + "comment" + ] + }, + { + open: "[", + close: "]", + notIn: [ + "string", + "comment" + ] + }, + { + open: "(", + close: ")", + notIn: [ + "string", + "comment" + ] + }, + { + open: '"', + close: '"', + notIn: [ + "string", + "comment" + ] + }, + { + open: "'", + close: "'", + notIn: [ + "string", + "comment" + ] + } + ], + surroundingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + '"', + '"' + ], + [ + "'", + "'" + ] + ], + folding: { + markers: { + start: "^\\s*\\/\\*\\s*#region\\b\\s*(.*?)\\s*\\*\\/", + end: "^\\s*\\/\\*\\s*#endregion\\b.*\\*\\/" + } + }, + indentationRules: { + increaseIndentPattern: "(^.*\\{[^}]*$)", + decreaseIndentPattern: "^\\s*\\}" + }, + wordPattern: "(#?-?\\d*\\.\\d\\w*%?)|(::?[\\w-]*(?=[^,{;]*[,{]))|(([@#.!])?[\\w-?]+%?|[@#!.])" + }, + folding: { + markers: { + start: "^\\s*\\/\\*\\s*#region\\b\\s*(.*?)\\s*\\*\\/", + end: "^\\s*\\/\\*\\s*#endregion\\b.*\\*\\/" + } + }, + indentationRules: { + increaseIndentPattern: "(^.*\\{[^}]*$)", + decreaseIndentPattern: "^\\s*\\}" + }, + surroundingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + '"', + '"' + ], + [ + "'", + "'" + ] + ], + wordPattern: "(#?-?\\d*\\.\\d\\w*%?)|(::?[\\w-]*(?=[^,{;]*[,{]))|(([@#.!])?[\\w-?]+%?|[@#!.])" + }, + python: { + autoClosingPairs: [ + { + open: "{", + close: "}" + }, + { + open: "[", + close: "]" + }, + { + open: "(", + close: ")" + }, + { + open: '"', + close: '"', + notIn: [ + "string" + ] + }, + { + open: 'r"', + close: '"', + notIn: [ + "string", + "comment" + ] + }, + { + open: 'R"', + close: '"', + notIn: [ + "string", + "comment" + ] + }, + { + open: 'u"', + close: '"', + notIn: [ + "string", + "comment" + ] + }, + { + open: 'U"', + close: '"', + notIn: [ + "string", + "comment" + ] + }, + { + open: 'f"', + close: '"', + notIn: [ + "string", + "comment" + ] + }, + { + open: 'F"', + close: '"', + notIn: [ + "string", + "comment" + ] + }, + { + open: 'b"', + close: '"', + notIn: [ + "string", + "comment" + ] + }, + { + open: 'B"', + close: '"', + notIn: [ + "string", + "comment" + ] + }, + { + open: "'", + close: "'", + notIn: [ + "string", + "comment" + ] + }, + { + open: "r'", + close: "'", + notIn: [ + "string", + "comment" + ] + }, + { + open: "R'", + close: "'", + notIn: [ + "string", + "comment" + ] + }, + { + open: "u'", + close: "'", + notIn: [ + "string", + "comment" + ] + }, + { + open: "U'", + close: "'", + notIn: [ + "string", + "comment" + ] + }, + { + open: "f'", + close: "'", + notIn: [ + "string", + "comment" + ] + }, + { + open: "F'", + close: "'", + notIn: [ + "string", + "comment" + ] + }, + { + open: "b'", + close: "'", + notIn: [ + "string", + "comment" + ] + }, + { + open: "B'", + close: "'", + notIn: [ + "string", + "comment" + ] + }, + { + open: "`", + close: "`", + notIn: [ + "string" + ] + } + ], + brackets: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ] + ], + comments: { + lineComment: "#", + blockComment: [ + '"""', + '"""' + ] + }, + default: { + comments: { + lineComment: "#", + blockComment: [ + '"""', + '"""' + ] + }, + brackets: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ] + ], + autoClosingPairs: [ + { + open: "{", + close: "}" + }, + { + open: "[", + close: "]" + }, + { + open: "(", + close: ")" + }, + { + open: '"', + close: '"', + notIn: [ + "string" + ] + }, + { + open: 'r"', + close: '"', + notIn: [ + "string", + "comment" + ] + }, + { + open: 'R"', + close: '"', + notIn: [ + "string", + "comment" + ] + }, + { + open: 'u"', + close: '"', + notIn: [ + "string", + "comment" + ] + }, + { + open: 'U"', + close: '"', + notIn: [ + "string", + "comment" + ] + }, + { + open: 'f"', + close: '"', + notIn: [ + "string", + "comment" + ] + }, + { + open: 'F"', + close: '"', + notIn: [ + "string", + "comment" + ] + }, + { + open: 'b"', + close: '"', + notIn: [ + "string", + "comment" + ] + }, + { + open: 'B"', + close: '"', + notIn: [ + "string", + "comment" + ] + }, + { + open: "'", + close: "'", + notIn: [ + "string", + "comment" + ] + }, + { + open: "r'", + close: "'", + notIn: [ + "string", + "comment" + ] + }, + { + open: "R'", + close: "'", + notIn: [ + "string", + "comment" + ] + }, + { + open: "u'", + close: "'", + notIn: [ + "string", + "comment" + ] + }, + { + open: "U'", + close: "'", + notIn: [ + "string", + "comment" + ] + }, + { + open: "f'", + close: "'", + notIn: [ + "string", + "comment" + ] + }, + { + open: "F'", + close: "'", + notIn: [ + "string", + "comment" + ] + }, + { + open: "b'", + close: "'", + notIn: [ + "string", + "comment" + ] + }, + { + open: "B'", + close: "'", + notIn: [ + "string", + "comment" + ] + }, + { + open: "`", + close: "`", + notIn: [ + "string" + ] + } + ], + surroundingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + '"', + '"' + ], + [ + "'", + "'" + ], + [ + "`", + "`" + ] + ], + folding: { + offSide: true, + markers: { + start: "^\\s*#\\s*region\\b", + end: "^\\s*#\\s*endregion\\b" + } + }, + onEnterRules: [ + { + beforeText: "^\\s*(?:def|class|for|if|elif|else|while|try|with|finally|except|async).*?:\\s*$", + action: { + indent: "indent" + } + } + ] + }, + folding: { + offSide: true, + markers: { + start: "^\\s*#\\s*region\\b", + end: "^\\s*#\\s*endregion\\b" + } + }, + onEnterRules: [ + { + beforeText: "^\\s*(?:def|class|for|if|elif|else|while|try|with|finally|except|async).*?:\\s*$", + action: { + indent: "indent" + } + } + ], + surroundingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + '"', + '"' + ], + [ + "'", + "'" + ], + [ + "`", + "`" + ] + ] + }, + go: { + autoClosingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + { + open: "`", + close: "`", + notIn: [ + "string" + ] + }, + { + open: '"', + close: '"', + notIn: [ + "string" + ] + }, + { + open: "'", + close: "'", + notIn: [ + "string", + "comment" + ] + } + ], + brackets: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ] + ], + comments: { + lineComment: "//", + blockComment: [ + "/*", + "*/" + ] + }, + default: { + comments: { + lineComment: "//", + blockComment: [ + "/*", + "*/" + ] + }, + brackets: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ] + ], + autoClosingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + { + open: "`", + close: "`", + notIn: [ + "string" + ] + }, + { + open: '"', + close: '"', + notIn: [ + "string" + ] + }, + { + open: "'", + close: "'", + notIn: [ + "string", + "comment" + ] + } + ], + surroundingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + '"', + '"' + ], + [ + "'", + "'" + ], + [ + "`", + "`" + ] + ], + indentationRules: { + increaseIndentPattern: "^.*(\\bcase\\b.*:|\\bdefault\\b:|(\\b(func|if|else|switch|select|for|struct)\\b.*)?{[^}\"'`]*|\\([^)\"'`]*)$", + decreaseIndentPattern: "^\\s*(\\bcase\\b.*:|\\bdefault\\b:|}[)}]*[),]?|\\)[,]?)$" + }, + folding: { + markers: { + start: "^\\s*//\\s*#?region\\b", + end: "^\\s*//\\s*#?endregion\\b" + } + }, + onEnterRules: [ + { + beforeText: { + pattern: "//.*" + }, + afterText: { + pattern: "^(?!\\s*$).+" + }, + action: { + indent: "none", + appendText: "// " + } + } + ] + }, + folding: { + markers: { + start: "^\\s*//\\s*#?region\\b", + end: "^\\s*//\\s*#?endregion\\b" + } + }, + indentationRules: { + increaseIndentPattern: "^.*(\\bcase\\b.*:|\\bdefault\\b:|(\\b(func|if|else|switch|select|for|struct)\\b.*)?{[^}\"'`]*|\\([^)\"'`]*)$", + decreaseIndentPattern: "^\\s*(\\bcase\\b.*:|\\bdefault\\b:|}[)}]*[),]?|\\)[,]?)$" + }, + onEnterRules: [ + { + beforeText: { + pattern: "//.*" + }, + afterText: { + pattern: "^(?!\\s*$).+" + }, + action: { + indent: "none", + appendText: "// " + } + } + ], + surroundingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + '"', + '"' + ], + [ + "'", + "'" + ], + [ + "`", + "`" + ] + ] + }, + dotenv: { + autoClosingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + '"', + '"' + ], + [ + "'", + "'" + ] + ], + brackets: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ] + ], + comments: { + lineComment: "#" + }, + default: { + comments: { + lineComment: "#" + }, + brackets: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ] + ], + autoClosingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + '"', + '"' + ], + [ + "'", + "'" + ] + ], + surroundingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + '"', + '"' + ], + [ + "'", + "'" + ] + ] + }, + surroundingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + '"', + '"' + ], + [ + "'", + "'" + ] + ] + }, + docker: { + autoClosingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + '"', + '"' + ], + [ + "'", + "'" + ] + ], + brackets: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ] + ], + comments: { + lineComment: "#" + }, + default: { + comments: { + lineComment: "#" + }, + brackets: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ] + ], + autoClosingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + '"', + '"' + ], + [ + "'", + "'" + ] + ], + surroundingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + '"', + '"' + ], + [ + "'", + "'" + ] + ], + indentationRules: { + increaseIndentPattern: `^\\s*.*(:|-) ?(&\\w+)?(\\{[^}"']*|\\([^)"']*)?$`, + decreaseIndentPattern: "^\\s+\\}$" + } + }, + indentationRules: { + increaseIndentPattern: `^\\s*.*(:|-) ?(&\\w+)?(\\{[^}"']*|\\([^)"']*)?$`, + decreaseIndentPattern: "^\\s+\\}$" + }, + surroundingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + '"', + '"' + ], + [ + "'", + "'" + ] + ] + }, + shaderlab: { + autoClosingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + { + open: '"', + close: '"', + notIn: [ + "string" + ] + } + ], + brackets: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ] + ], + comments: { + lineComment: "//", + blockComment: [ + "/*", + "*/" + ] + }, + default: { + comments: { + lineComment: "//", + blockComment: [ + "/*", + "*/" + ] + }, + brackets: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ] + ], + autoClosingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + { + open: '"', + close: '"', + notIn: [ + "string" + ] + } + ], + surroundingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + '"', + '"' + ] + ] + }, + surroundingPairs: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + '"', + '"' + ] + ] + }, + razor: { + autoClosingPairs: [ + { + open: "{", + close: "}" + }, + { + open: "[", + close: "]" + }, + { + open: "(", + close: ")" + }, + { + open: "'", + close: "'" + }, + { + open: '"', + close: '"' + } + ], + brackets: [ + [ + "" + ], + [ + "{", + "}" + ], + [ + "(", + ")" + ] + ], + comments: { + blockComment: [ + "" + ] + }, + default: { + comments: { + blockComment: [ + "" + ] + }, + brackets: [ + [ + "" + ], + [ + "{", + "}" + ], + [ + "(", + ")" + ] + ], + autoClosingPairs: [ + { + open: "{", + close: "}" + }, + { + open: "[", + close: "]" + }, + { + open: "(", + close: ")" + }, + { + open: "'", + close: "'" + }, + { + open: '"', + close: '"' + } + ], + surroundingPairs: [ + { + open: "'", + close: "'" + }, + { + open: '"', + close: '"' + }, + { + open: "<", + close: ">" + } + ] + }, + surroundingPairs: [ + { + open: "'", + close: "'" + }, + { + open: '"', + close: '"' + }, + { + open: "<", + close: ">" + } + ] + }, + prompt: { + autoClosingPairs: [ + { + open: "{", + close: "}" + }, + { + open: "[", + close: "]" + }, + { + open: "(", + close: ")" + }, + { + open: "<", + close: ">", + notIn: [ + "string" + ] + } + ], + brackets: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ] + ], + colorizedBracketPairs: [], + comments: { + blockComment: [ + "" + ] + }, + default: { + comments: { + blockComment: [ + "" + ] + }, + brackets: [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ] + ], + colorizedBracketPairs: [], + autoClosingPairs: [ + { + open: "{", + close: "}" + }, + { + open: "[", + close: "]" + }, + { + open: "(", + close: ")" + }, + { + open: "<", + close: ">", + notIn: [ + "string" + ] + } + ], + surroundingPairs: [ + [ + "(", + ")" + ], + [ + "[", + "]" + ], + [ + "`", + "`" + ], + [ + "_", + "_" + ], + [ + "*", + "*" + ], + [ + "{", + "}" + ], + [ + "'", + "'" + ], + [ + '"', + '"' + ], + [ + "<", + ">" + ], + [ + "~", + "~" + ], + [ + "$", + "$" + ] + ], + folding: { + offSide: true, + markers: { + start: "^\\s*", + end: "^\\s*" + } + }, + wordPattern: { + pattern: "(\\p{Alphabetic}|\\p{Number}|\\p{Nonspacing_Mark})(((\\p{Alphabetic}|\\p{Number}|\\p{Nonspacing_Mark})|[_])?(\\p{Alphabetic}|\\p{Number}|\\p{Nonspacing_Mark}))*", + flags: "ug" + } + }, + folding: { + offSide: true, + markers: { + start: "^\\s*", + end: "^\\s*" + } + }, + surroundingPairs: [ + [ + "(", + ")" + ], + [ + "[", + "]" + ], + [ + "`", + "`" + ], + [ + "_", + "_" + ], + [ + "*", + "*" + ], + [ + "{", + "}" + ], + [ + "'", + "'" + ], + [ + '"', + '"' + ], + [ + "<", + ">" + ], + [ + "~", + "~" + ], + [ + "$", + "$" + ] + ], + wordPattern: { + pattern: "(\\p{Alphabetic}|\\p{Number}|\\p{Nonspacing_Mark})(((\\p{Alphabetic}|\\p{Number}|\\p{Nonspacing_Mark})|[_])?(\\p{Alphabetic}|\\p{Number}|\\p{Nonspacing_Mark}))*", + flags: "ug" + } + } +}; + +// src/editor-core.ts +var defaultEditorOptions = { + automaticLayout: true, + minimap: { enabled: false }, + stickyScroll: { enabled: false }, + scrollBeyondLastLine: false +}; +var { create: create3, createModel: createModel2, getModel: getModel2 } = editor; +Object.assign(editor, { + create: (container, options2) => { + return create3( + container, + { + ...defaultEditorOptions, + ...options2 + } + ); + }, + createModel: (value, language2, uri) => { + uri = normalizeUri(uri); + if (!language2 && uri) { + language2 = MonacoEnvironment.getLanguageIdFromUri?.(uri); + } + if (!uri) { + const extname3 = MonacoEnvironment.getExtnameFromLanguageId?.(language2) ?? "txt"; + const uuid = Math.round((Date.now() + Math.random()) * 1e3).toString(36); + uri = "file:///.inmemory/" + uuid + "." + extname3; + } + return createModel2(value, language2, uri); + }, + getModel: (uri) => { + return getModel2(normalizeUri(uri)); + } +}); +var InputBoxValidationSeverity = /* @__PURE__ */ ((InputBoxValidationSeverity2) => { + InputBoxValidationSeverity2[InputBoxValidationSeverity2["Info"] = 1] = "Info"; + InputBoxValidationSeverity2[InputBoxValidationSeverity2["Warning"] = 2] = "Warning"; + InputBoxValidationSeverity2[InputBoxValidationSeverity2["Error"] = 3] = "Error"; + return InputBoxValidationSeverity2; +})(InputBoxValidationSeverity || {}); +var QuickPickItemKind = /* @__PURE__ */ ((QuickPickItemKind2) => { + QuickPickItemKind2[QuickPickItemKind2["Separator"] = -1] = "Separator"; + QuickPickItemKind2[QuickPickItemKind2["Default"] = 0] = "Default"; + return QuickPickItemKind2; +})(QuickPickItemKind || {}); +function showInputBox(options2 = {}) { + const { placeHolder, title, value, password, ignoreFocusOut, validateInput, prompt } = options2; + const quickInputService = StandaloneServices.get(IQuickInputService); + const box = quickInputService.createInputBox(); + const validateValue = validateInput ? (value2) => { + const p = validateInput(value2); + if (p instanceof Promise) { + box.busy = true; + return p.then((v) => { + box.busy = false; + return v; + }); + } + return p; + } : void 0; + if (title) { + box.title = title; + } + if (value) { + box.value = value; + } + if (placeHolder) { + box.placeholder = placeHolder; + } + if (prompt) { + box.prompt = prompt; + } + if (password) { + box.password = true; + } + if (ignoreFocusOut) { + box.ignoreFocusOut = true; + } + if (validateInput) { + box.onDidChangeValue(async (value2) => { + const validation = value2 ? await validateValue(value2) : ""; + if (validation) { + if (typeof validation === "string") { + box.validationMessage = validation; + box.severity = 3; + } else { + box.validationMessage = validation.message; + box.severity = validation.severity; + } + } else { + box.validationMessage = ""; + box.severity = 0; + } + }); + } + box.show(); + return new Promise((resolve3) => { + box.onDidAccept(async () => { + if (!validateInput || !await validateValue(box.value)) { + resolve3(box.value); + box.dispose(); + } + }); + }); +} +function showQuickPick(items, options2 = {}) { + const { placeHolder, title, ignoreFocusOut, matchOnDescription, matchOnDetail, canPickMany, onDidSelectItem, prompt } = options2; + const quickInputService = StandaloneServices.get(IQuickInputService); + const pick = quickInputService.createQuickPick(); + if (title) { + pick.title = title; + } + if (placeHolder) { + pick.placeholder = placeHolder; + } + if (prompt) { + pick.prompt = prompt; + } + if (ignoreFocusOut) { + pick.ignoreFocusOut = true; + } + if (matchOnDescription) { + pick.matchOnDescription = true; + } + if (matchOnDetail) { + pick.matchOnDetail = true; + } + if (canPickMany) { + pick.canSelectMany = true; + } + if (items instanceof Promise) { + pick.busy = true; + items.then((items2) => { + pick.items = items2.map(convertPickItem); + pick.busy = false; + }); + } else if (Array.isArray(items)) { + pick.items = items.map(convertPickItem); + } + if (onDidSelectItem) { + pick.onDidChangeActive((v) => { + v.forEach((item) => { + onDidSelectItem(convertPickItem(item?.plainMode ? item.label : item)); + }); + }); + } + pick.show(); + return new Promise((resolve3) => { + pick.onDidAccept(() => { + if (canPickMany) { + resolve3(pick.selectedItems.map((item) => item.plainMode ? item.label : item)); + } else { + let selectedItem = pick.selectedItems[0]; + resolve3(selectedItem?.plainMode ? selectedItem.label : selectedItem); + } + pick.dispose(); + }); + }); +} +var languageConfigurationAliases = { + "jsx": "javascript", + "tsx": "typescript" +}; +function convertVscodeLanguageConfiguration(config) { + const { indentationRules, folding, wordPattern, onEnterRules, surroundingPairs, autoClosingPairs } = config; + if (folding?.markers) { + toRegexp(folding.markers, "start", "end"); + } + if (wordPattern) { + toRegexp(config, "wordPattern"); + } + if (indentationRules) { + toRegexp( + indentationRules, + "increaseIndentPattern", + "decreaseIndentPattern", + "indentNextLinePattern", + "unIndentedLinePattern" + ); + } + if (onEnterRules) { + for (const rule of onEnterRules) { + toRegexp(rule, "beforeText", "afterText", "previousLineText"); + if (typeof rule.action?.indent === "string") { + rule.action.indentAction = ["none", "indent", "indentOutdent", "outdent"].indexOf(rule.action.indent); + delete rule.action.indent; + } + } + } + if (autoClosingPairs) { + config.autoClosingPairs = autoClosingPairs.map((v) => Array.isArray(v) ? { open: v[0], close: v[1] } : v); + } + if (surroundingPairs) { + config.surroundingPairs = surroundingPairs.map((v) => Array.isArray(v) ? { open: v[0], close: v[1] } : v); + } + return config; +} +function toRegexp(obj, ...keys) { + for (const key of keys) { + const value = obj[key]; + if (typeof value === "string") { + obj[key] = new RegExp(value); + } else if (typeof value === "object" && value !== null && !(value instanceof RegExp) && typeof value.pattern === "string") { + obj[key] = new RegExp(value.pattern, value.flags); + } + } +} +function normalizeUri(uri) { + if (typeof uri === "string" || uri instanceof URL) { + const url = new URL(uri, "file:///"); + uri = Uri2.from({ + scheme: url.protocol.slice(0, -1), + authority: url.host, + path: decodeURIComponent(url.pathname), + query: url.search.slice(1), + fragment: url.hash.slice(1) + }); + } + return uri; +} +function convertPickItem(item) { + if (typeof item === "string") { + return { type: "item", label: item, plainMode: true }; + } + if (item.kind === -1 /* Separator */) { + return { type: "separator", ...item }; + } + return item; +} +function createEditorWorkerMain() { + const workerUrl = new URL("./editor-worker-main.mjs", import.meta.url); + if (workerUrl.origin !== location.origin) { + return new Worker( + URL.createObjectURL(new Blob([`import "${workerUrl.href}"`], { type: "application/javascript" })), + { type: "module", name: "editor-worker-main" } + ); + } + return new Worker(workerUrl, { type: "module", name: "editor-worker-main" }); +} +export { + CancellationTokenSource2 as CancellationTokenSource, + Emitter2 as Emitter, + InputBoxValidationSeverity, + KeyCode2 as KeyCode, + KeyMod2 as KeyMod, + MarkerSeverity3 as MarkerSeverity, + MarkerTag2 as MarkerTag, + Position2 as Position, + QuickPickItemKind, + Range3 as Range, + Selection2 as Selection, + SelectionDirection2 as SelectionDirection, + Token3 as Token, + Uri2 as Uri, + convertVscodeLanguageConfiguration, + createEditorWorkerMain, + editor, + languageConfigurationAliases, + language_configurations_default as languageConfigurations, + languages, + showInputBox, + showQuickPick +}; +/*! Bundled license information: + +monaco-editor-core/esm/vs/base/browser/dompurify/dompurify.js: + (*! @license DOMPurify 3.2.7 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.7/LICENSE *) +*/ + +export const cssBundle = ".monaco-aria-container{position:absolute;left:-999em}::-ms-clear{display:none}.monaco-editor .editor-widget input{color:inherit}.monaco-editor{position:relative;overflow:visible;-webkit-text-size-adjust:100%;color:var(--vscode-editor-foreground);background-color:var(--vscode-editor-background);overflow-wrap:initial}.monaco-editor-background{background-color:var(--vscode-editor-background)}.monaco-editor .rangeHighlight{background-color:var(--vscode-editor-rangeHighlightBackground);box-sizing:border-box;border:1px solid var(--vscode-editor-rangeHighlightBorder)}.monaco-editor.hc-black .rangeHighlight,.monaco-editor.hc-light .rangeHighlight{border-style:dotted}.monaco-editor .symbolHighlight{background-color:var(--vscode-editor-symbolHighlightBackground);box-sizing:border-box;border:1px solid var(--vscode-editor-symbolHighlightBorder)}.monaco-editor.hc-black .symbolHighlight,.monaco-editor.hc-light .symbolHighlight{border-style:dotted}.monaco-editor .editorCanvas{position:absolute;width:100%;height:100%;z-index:0;pointer-events:none}.monaco-editor .overflow-guard{position:relative;overflow:hidden}.monaco-editor .view-overlays{position:absolute;top:0}.monaco-editor .view-overlays>div,.monaco-editor .margin-view-overlays>div{position:absolute;width:100%}.monaco-editor .squiggly-error{border-bottom:4px double var(--vscode-editorError-border)}.monaco-editor .squiggly-error:before{display:block;content:\"\";width:100%;height:100%;background:var(--vscode-editorError-background)}.monaco-editor .squiggly-warning{border-bottom:4px double var(--vscode-editorWarning-border)}.monaco-editor .squiggly-warning:before{display:block;content:\"\";width:100%;height:100%;background:var(--vscode-editorWarning-background)}.monaco-editor .squiggly-info{border-bottom:4px double var(--vscode-editorInfo-border)}.monaco-editor .squiggly-info:before{display:block;content:\"\";width:100%;height:100%;background:var(--vscode-editorInfo-background)}.monaco-editor .squiggly-hint{border-bottom:2px dotted var(--vscode-editorHint-border)}.monaco-editor.showUnused .squiggly-unnecessary{border-bottom:2px dashed var(--vscode-editorUnnecessaryCode-border)}.monaco-editor.showDeprecated .squiggly-inline-deprecated{text-decoration:line-through;text-decoration-color:var(--vscode-editor-foreground, inherit)}.monaco-scrollable-element>.scrollbar>.scra{cursor:pointer;font-size:11px!important}.monaco-scrollable-element>.visible{opacity:1;background:#0000;transition:opacity .1s linear;z-index:11}.monaco-scrollable-element>.invisible{opacity:0;pointer-events:none}.monaco-scrollable-element>.invisible.fade{transition:opacity .8s linear}.monaco-scrollable-element>.shadow{position:absolute;display:none}.monaco-scrollable-element>.shadow.top{display:block;top:0;left:3px;height:3px;width:100%;box-shadow:var(--vscode-scrollbar-shadow) 0 6px 6px -6px inset}.monaco-scrollable-element>.shadow.left{display:block;top:3px;left:0;height:100%;width:3px;box-shadow:var(--vscode-scrollbar-shadow) 6px 0 6px -6px inset}.monaco-scrollable-element>.shadow.top-left-corner{display:block;top:0;left:0;height:3px;width:3px}.monaco-scrollable-element>.shadow.top.left{box-shadow:var(--vscode-scrollbar-shadow) 6px 0 6px -6px inset}.monaco-scrollable-element>.scrollbar{background:var(--vscode-scrollbar-background)}.monaco-scrollable-element>.scrollbar>.slider{background:var(--vscode-scrollbarSlider-background)}.monaco-scrollable-element>.scrollbar>.slider:hover{background:var(--vscode-scrollbarSlider-hoverBackground)}.monaco-scrollable-element>.scrollbar>.slider.active{background:var(--vscode-scrollbarSlider-activeBackground)}.monaco-editor .blockDecorations-container{position:absolute;top:0;pointer-events:none}.monaco-editor .blockDecorations-block{position:absolute;box-sizing:border-box}.monaco-editor .view-overlays .current-line,.monaco-editor .margin-view-overlays .current-line{display:block;position:absolute;left:0;top:0;box-sizing:border-box;height:100%}.monaco-editor .margin-view-overlays .current-line.current-line-margin.current-line-margin-both{border-right:0}.monaco-editor .lines-content .cdr{position:absolute;height:100%}.monaco-editor .glyph-margin{position:absolute;top:0}.monaco-editor .glyph-margin-widgets .cgmr{position:absolute;display:flex;align-items:center;justify-content:center}.monaco-editor .glyph-margin-widgets .cgmr.codicon-modifier-spin:before{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.monaco-editor .lines-content .core-guide{position:absolute;box-sizing:border-box;height:100%}.monaco-editor .margin-view-overlays .line-numbers{bottom:0;font-variant-numeric:tabular-nums;position:absolute;text-align:right;display:inline-block;vertical-align:middle;box-sizing:border-box;cursor:default}.monaco-editor .relative-current-line-number{text-align:left;display:inline-block;width:100%}.monaco-editor .margin-view-overlays .line-numbers.lh-odd{margin-top:1px}.monaco-editor .line-numbers{color:var(--vscode-editorLineNumber-foreground)}.monaco-editor .line-numbers.active-line-number{color:var(--vscode-editorLineNumber-activeForeground)}.monaco-mouse-cursor-text{cursor:text}.mtkcontrol{color:#fff!important;background:#960000!important}.mtkoverflow{background-color:var(--vscode-button-background, var(--vscode-editor-background));color:var(--vscode-button-foreground, var(--vscode-editor-foreground));border-width:1px;border-style:solid;border-color:var(--vscode-contrastBorder);border-radius:2px;padding:4px;cursor:pointer}.mtkoverflow:hover{background-color:var(--vscode-button-hoverBackground)}.monaco-editor.no-user-select .lines-content,.monaco-editor.no-user-select .view-line,.monaco-editor.no-user-select .view-lines{user-select:none;-webkit-user-select:none}.monaco-editor.mac .lines-content:hover,.monaco-editor.mac .view-line:hover,.monaco-editor.mac .view-lines:hover{user-select:text;-webkit-user-select:text;-ms-user-select:text}.monaco-editor.enable-user-select{user-select:initial;-webkit-user-select:initial}.monaco-editor .view-lines{white-space:nowrap}.monaco-editor .view-line{box-sizing:border-box;position:absolute;width:100%}.monaco-editor .lines-content>.view-lines>.view-line>span{top:0;bottom:0;position:absolute}.monaco-editor .mtkw{color:var(--vscode-editorWhitespace-foreground)!important}.monaco-editor .mtkz{display:inline-block;color:var(--vscode-editorWhitespace-foreground)!important}.monaco-editor .lines-decorations{position:absolute;top:0;background:#fff}.monaco-editor .margin-view-overlays .cldr{position:absolute;height:100%}.monaco-editor .margin{background-color:var(--vscode-editorGutter-background)}.monaco-editor .margin-view-overlays .cmdr{position:absolute;left:0;width:100%;height:100%}.monaco-editor .minimap.slider-mouseover .minimap-slider{opacity:0;transition:opacity .1s linear}.monaco-editor .minimap.slider-mouseover:hover .minimap-slider,.monaco-editor .minimap.slider-mouseover .minimap-slider.active{opacity:1}.monaco-editor .minimap-slider .minimap-slider-horizontal{background:var(--vscode-minimapSlider-background)}.monaco-editor .minimap-slider:hover .minimap-slider-horizontal{background:var(--vscode-minimapSlider-hoverBackground)}.monaco-editor .minimap-slider.active .minimap-slider-horizontal{background:var(--vscode-minimapSlider-activeBackground)}.monaco-editor .minimap-shadow-visible{box-shadow:var(--vscode-scrollbar-shadow) -6px 0 6px -6px inset}.monaco-editor .minimap-shadow-hidden{position:absolute;width:0}.monaco-editor .minimap-shadow-visible{position:absolute;left:-6px;width:6px;pointer-events:none}.monaco-editor.no-minimap-shadow .minimap-shadow-visible{position:absolute;left:-1px;width:1px}.minimap.minimap-autohide-mouseover,.minimap.minimap-autohide-scroll{opacity:0;transition:opacity .5s}.minimap.minimap-autohide-scroll{pointer-events:none}.minimap.minimap-autohide-mouseover:hover,.minimap.minimap-autohide-scroll.active{opacity:1;pointer-events:auto}.monaco-editor .minimap{z-index:5}.monaco-editor .overlayWidgets{position:absolute;top:0;left:0}.monaco-editor .view-ruler{position:absolute;top:0;box-shadow:1px 0 0 0 var(--vscode-editorRuler-foreground) inset}.monaco-editor .scroll-decoration{position:absolute;top:0;left:0;height:6px;box-shadow:var(--vscode-scrollbar-shadow) 0 6px 6px -6px inset}.monaco-editor .lines-content .cslr{position:absolute}.monaco-editor .focused .selected-text{background-color:var(--vscode-editor-selectionBackground)}.monaco-editor .selected-text{background-color:var(--vscode-editor-inactiveSelectionBackground)}.monaco-editor .top-left-radius{border-top-left-radius:3px}.monaco-editor .bottom-left-radius{border-bottom-left-radius:3px}.monaco-editor .top-right-radius{border-top-right-radius:3px}.monaco-editor .bottom-right-radius{border-bottom-right-radius:3px}.monaco-editor.hc-black .top-left-radius{border-top-left-radius:0}.monaco-editor.hc-black .bottom-left-radius{border-bottom-left-radius:0}.monaco-editor.hc-black .top-right-radius{border-top-right-radius:0}.monaco-editor.hc-black .bottom-right-radius{border-bottom-right-radius:0}.monaco-editor.hc-light .top-left-radius{border-top-left-radius:0}.monaco-editor.hc-light .bottom-left-radius{border-bottom-left-radius:0}.monaco-editor.hc-light .top-right-radius{border-top-right-radius:0}.monaco-editor.hc-light .bottom-right-radius{border-bottom-right-radius:0}.monaco-editor .cursors-layer{position:absolute;top:0}.monaco-editor .cursors-layer>.cursor{position:absolute;overflow:hidden;box-sizing:border-box}.monaco-editor .cursors-layer.cursor-smooth-caret-animation>.cursor{transition:all 80ms}.monaco-editor .cursors-layer.cursor-block-outline-style>.cursor{background:transparent!important;border-style:solid;border-width:1px}.monaco-editor .cursors-layer.cursor-underline-style>.cursor{border-bottom-width:2px;border-bottom-style:solid;background:transparent!important}.monaco-editor .cursors-layer.cursor-underline-thin-style>.cursor{border-bottom-width:1px;border-bottom-style:solid;background:transparent!important}@keyframes monaco-cursor-smooth{0%,20%{opacity:1}60%,to{opacity:0}}@keyframes monaco-cursor-phase{0%,20%{opacity:1}90%,to{opacity:0}}@keyframes monaco-cursor-expand{0%,20%{transform:scaleY(1)}80%,to{transform:scaleY(0)}}.cursor-smooth{animation:monaco-cursor-smooth .5s ease-in-out 0s 20 alternate}.cursor-phase{animation:monaco-cursor-phase .5s ease-in-out 0s 20 alternate}.cursor-expand>.cursor{animation:monaco-cursor-expand .5s ease-in-out 0s 20 alternate}.monaco-editor .mwh{position:absolute;color:var(--vscode-editorWhitespace-foreground)!important}.monaco-editor .monaco-decoration-css-rule-extractor{visibility:hidden;pointer-events:none}.monaco-editor .inputarea{min-width:0;min-height:0;margin:0;padding:0;position:absolute;outline:none!important;resize:none;border:none;overflow:hidden;color:transparent;background-color:transparent;z-index:-10}.monaco-editor .inputarea.ime-input{z-index:10;caret-color:var(--vscode-editorCursor-foreground);color:var(--vscode-editor-foreground)}.monaco-editor .native-edit-context{margin:0;padding:0;position:absolute;overflow-y:scroll;scrollbar-width:none;z-index:-10;white-space:pre-wrap}.monaco-editor .ime-text-area{min-width:0;min-height:0;margin:0;padding:0;position:absolute;outline:none!important;resize:none;border:none;overflow:hidden;color:transparent;background-color:transparent;z-index:-10}.monaco-editor .edit-context-composition-none{background-color:transparent;border-bottom:none}.monaco-editor :not(.hc-black,.hc-light) .edit-context-composition-secondary{border-bottom:1px solid var(--vscode-editor-compositionBorder)}.monaco-editor :not(.hc-black,.hc-light) .edit-context-composition-primary{border-bottom:2px solid var(--vscode-editor-compositionBorder)}.monaco-editor :is(.hc-black,.hc-light) .edit-context-composition-secondary{border:1px solid var(--vscode-editor-compositionBorder)}.monaco-editor :is(.hc-black,.hc-light) .edit-context-composition-primary{border:2px solid var(--vscode-editor-compositionBorder)}.monaco-editor .margin-view-overlays .gpu-mark{position:absolute;top:0;bottom:0;left:0;width:100%;display:inline-block;border-left:solid 2px var(--vscode-editorWarning-foreground);opacity:.2;transition:background-color .1s linear}.monaco-editor .margin-view-overlays .gpu-mark:hover{background-color:var(--vscode-editorWarning-foreground)}.monaco-select-box{width:100%;cursor:pointer;border-radius:2px}.monaco-select-box-dropdown-container{font-size:13px;font-weight:400;text-transform:none}.monaco-action-bar .action-item.select-container{cursor:default}.monaco-action-bar .action-item .monaco-select-box{cursor:pointer;min-width:100px;min-height:18px;padding:2px 23px 2px 8px}.mac .monaco-action-bar .action-item .monaco-select-box{font-size:11px;border-radius:3px;min-height:24px}.monaco-list{position:relative;height:100%;width:100%;white-space:nowrap}.monaco-list.mouse-support{user-select:none;-webkit-user-select:none}.monaco-list>.monaco-scrollable-element{height:100%}.monaco-list-rows{position:relative;width:100%;height:100%}.monaco-list.horizontal-scrolling .monaco-list-rows{width:auto;min-width:100%}.monaco-list-row{position:absolute;box-sizing:border-box;overflow:hidden;width:100%}.monaco-list.mouse-support .monaco-list-row{cursor:pointer;touch-action:none}.monaco-list .monaco-scrollable-element>.scrollbar.vertical,.monaco-pane-view>.monaco-split-view2.vertical>.monaco-scrollable-element>.scrollbar.vertical{z-index:14}.monaco-list-row.scrolling{display:none!important}.monaco-list.element-focused,.monaco-list.selection-single,.monaco-list.selection-multiple{outline:0!important}.monaco-list-type-filter-message{position:absolute;box-sizing:border-box;width:100%;height:100%;top:0;left:0;padding:40px 1em 1em;text-align:center;white-space:normal;opacity:.7;pointer-events:none}.monaco-list-type-filter-message:empty{display:none}.monaco-drag-image{display:inline-block;padding:1px 7px;border-radius:10px;font-size:12px;position:absolute;z-index:1000;background-color:var(--vscode-list-activeSelectionBackground);color:var(--vscode-list-activeSelectionForeground);outline:1px solid var(--vscode-list-focusOutline);outline-offset:-1px;max-width:120px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.monaco-select-box-dropdown-padding{--dropdown-padding-top: 1px;--dropdown-padding-bottom: 1px}.hc-black .monaco-select-box-dropdown-padding,.hc-light .monaco-select-box-dropdown-padding{--dropdown-padding-top: 3px;--dropdown-padding-bottom: 4px}.monaco-select-box-dropdown-container{display:none;box-sizing:border-box}.monaco-select-box-dropdown-container>.select-box-details-pane>.select-box-description-markdown *{margin:0}.monaco-select-box-dropdown-container>.select-box-details-pane>.select-box-description-markdown a:focus{outline:1px solid -webkit-focus-ring-color;outline-offset:-1px}.monaco-select-box-dropdown-container>.select-box-details-pane>.select-box-description-markdown code{line-height:15px;font-family:var(--monaco-monospace-font)}.monaco-select-box-dropdown-container.visible{display:flex;flex-direction:column;text-align:left;width:1px;overflow:hidden;border-bottom-left-radius:3px;border-bottom-right-radius:3px}.monaco-select-box-dropdown-container>.select-box-dropdown-list-container{flex:0 0 auto;align-self:flex-start;padding-top:var(--dropdown-padding-top);padding-bottom:var(--dropdown-padding-bottom);padding-left:1px;padding-right:1px;width:100%;overflow:hidden;box-sizing:border-box}.monaco-select-box-dropdown-container>.select-box-details-pane{padding:5px}.hc-black .monaco-select-box-dropdown-container>.select-box-dropdown-list-container{padding-top:var(--dropdown-padding-top);padding-bottom:var(--dropdown-padding-bottom)}.monaco-select-box-dropdown-container>.select-box-dropdown-list-container .monaco-list .monaco-list-row{cursor:pointer}.monaco-select-box-dropdown-container>.select-box-dropdown-list-container .monaco-list .monaco-list-row>.option-text{text-overflow:ellipsis;overflow:hidden;padding-left:3.5px;white-space:nowrap;float:left}.monaco-select-box-dropdown-container>.select-box-dropdown-list-container .monaco-list .monaco-list-row>.option-detail{text-overflow:ellipsis;overflow:hidden;padding-left:3.5px;white-space:nowrap;float:left;opacity:.7}.monaco-select-box-dropdown-container>.select-box-dropdown-list-container .monaco-list .monaco-list-row>.option-decorator-right{text-overflow:ellipsis;overflow:hidden;padding-right:10px;white-space:nowrap;float:right}.monaco-select-box-dropdown-container>.select-box-dropdown-list-container .monaco-list .monaco-list-row>.visually-hidden{position:absolute;left:-10000px;top:auto;width:1px;height:1px;overflow:hidden}.monaco-select-box-dropdown-container>.select-box-dropdown-container-width-control{flex:1 1 auto;align-self:flex-start;opacity:0}.monaco-select-box-dropdown-container>.select-box-dropdown-container-width-control>.width-control-div{overflow:hidden;max-height:0px}.monaco-select-box-dropdown-container>.select-box-dropdown-container-width-control>.width-control-div>.option-text-width-control{padding-left:4px;padding-right:8px;white-space:nowrap}.monaco-action-bar{white-space:nowrap;height:100%}.monaco-action-bar .actions-container{display:flex;margin:0 auto;padding:0;height:100%;width:100%;align-items:center}.monaco-action-bar.vertical .actions-container{display:inline-block}.monaco-action-bar .action-item{display:block;align-items:center;justify-content:center;cursor:pointer;position:relative}.monaco-action-bar .action-item.disabled{cursor:default}.monaco-action-bar .action-item .icon,.monaco-action-bar .action-item .codicon{display:block}.monaco-action-bar .action-item .codicon{display:flex;align-items:center;width:16px;height:16px}.monaco-action-bar .action-label{display:flex;font-size:11px;padding:3px;border-radius:5px}.monaco-action-bar .action-item.disabled .action-label:not(.icon),.monaco-action-bar .action-item.disabled .action-label:not(.icon):before,.monaco-action-bar .action-item.disabled .action-label:not(.icon):hover{color:var(--vscode-disabledForeground)}.monaco-action-bar .action-item.disabled .action-label.icon,.monaco-action-bar .action-item.disabled .action-label.icon:before,.monaco-action-bar .action-item.disabled .action-label.icon:hover{opacity:.6}.monaco-action-bar.vertical{text-align:left}.monaco-action-bar.vertical .action-item{display:block}.monaco-action-bar.vertical .action-label.separator{display:block;border-bottom:1px solid var(--vscode-disabledForeground);padding-top:1px;margin-left:.8em;margin-right:.8em}.monaco-action-bar .action-item .action-label.separator{width:1px;height:16px;margin:5px 4px!important;cursor:default;min-width:1px;padding:0;background-color:var(--vscode-disabledForeground)}.secondary-actions .monaco-action-bar .action-label{margin-left:6px}.monaco-action-bar .action-item.select-container{overflow:hidden;flex:1;max-width:170px;min-width:60px;display:flex;align-items:center;justify-content:center;margin-right:10px}.monaco-action-bar .action-item.action-dropdown-item{display:flex}.monaco-action-bar .action-item.action-dropdown-item>.action-dropdown-item-separator{display:flex;align-items:center;cursor:default}.monaco-action-bar .action-item.action-dropdown-item>.action-dropdown-item-separator>div{width:1px}.monaco-diff-editor .diff-review{position:absolute}.monaco-component.diff-review{user-select:none;-webkit-user-select:none;z-index:99;.diff-review-line-number{text-align:right;display:inline-block;color:var(--vscode-editorLineNumber-foreground)}.diff-review-summary{padding-left:10px}.diff-review-shadow{position:absolute;box-shadow:var(--vscode-scrollbar-shadow) 0 -6px 6px -6px inset}.diff-review-row{white-space:pre}.diff-review-table{display:table;min-width:100%}.diff-review-row{display:table-row;width:100%}.diff-review-spacer{display:inline-block;width:10px;vertical-align:middle}.diff-review-spacer>.codicon{font-size:9px!important}.diff-review-actions{display:inline-block;position:absolute;right:10px;top:2px;z-index:100}.diff-review-actions .action-label{width:16px;height:16px;margin:2px 0}.revertButton{cursor:pointer}.action-label{background:var(--vscode-editorActionList-background)}}:root{--vscode-sash-size: 4px;--vscode-sash-hover-size: 4px}.monaco-sash{position:absolute;z-index:35;touch-action:none}.monaco-sash.disabled{pointer-events:none}.monaco-sash.mac.vertical{cursor:col-resize}.monaco-sash.vertical.minimum{cursor:e-resize}.monaco-sash.vertical.maximum{cursor:w-resize}.monaco-sash.mac.horizontal{cursor:row-resize}.monaco-sash.horizontal.minimum{cursor:s-resize}.monaco-sash.horizontal.maximum{cursor:n-resize}.monaco-sash.disabled{cursor:default!important;pointer-events:none!important}.monaco-sash.vertical{cursor:ew-resize;top:0;width:var(--vscode-sash-size);height:100%}.monaco-sash.horizontal{cursor:ns-resize;left:0;width:100%;height:var(--vscode-sash-size)}.monaco-sash:not(.disabled)>.orthogonal-drag-handle{content:\" \";height:calc(var(--vscode-sash-size) * 2);width:calc(var(--vscode-sash-size) * 2);z-index:100;display:block;cursor:all-scroll;position:absolute}.monaco-sash.horizontal.orthogonal-edge-north:not(.disabled)>.orthogonal-drag-handle.start,.monaco-sash.horizontal.orthogonal-edge-south:not(.disabled)>.orthogonal-drag-handle.end{cursor:nwse-resize}.monaco-sash.horizontal.orthogonal-edge-north:not(.disabled)>.orthogonal-drag-handle.end,.monaco-sash.horizontal.orthogonal-edge-south:not(.disabled)>.orthogonal-drag-handle.start{cursor:nesw-resize}.monaco-sash.vertical>.orthogonal-drag-handle.start{left:calc(var(--vscode-sash-size) * -.5);top:calc(var(--vscode-sash-size) * -1)}.monaco-sash.vertical>.orthogonal-drag-handle.end{left:calc(var(--vscode-sash-size) * -.5);bottom:calc(var(--vscode-sash-size) * -1)}.monaco-sash.horizontal>.orthogonal-drag-handle.start{top:calc(var(--vscode-sash-size) * -.5);left:calc(var(--vscode-sash-size) * -1)}.monaco-sash.horizontal>.orthogonal-drag-handle.end{top:calc(var(--vscode-sash-size) * -.5);right:calc(var(--vscode-sash-size) * -1)}.monaco-sash:before{content:\"\";pointer-events:none;position:absolute;width:100%;height:100%;background:transparent}.monaco-enable-motion .monaco-sash:before{transition:background-color .1s ease-out}.monaco-sash.hover:before,.monaco-sash.active:before{background:var(--vscode-sash-hoverBorder)}.monaco-sash.vertical:before{width:var(--vscode-sash-hover-size);left:calc(50% - (var(--vscode-sash-hover-size) / 2))}.monaco-sash.horizontal:before{height:var(--vscode-sash-hover-size);top:calc(50% - (var(--vscode-sash-hover-size) / 2))}.pointer-events-disabled{pointer-events:none!important}.monaco-sash.debug{background:#0ff}.monaco-sash.debug.disabled{background:#0ff3}.monaco-sash.debug:not(.disabled)>.orthogonal-drag-handle{background:red}.monaco-dropdown{height:100%;padding:0}.monaco-dropdown>.dropdown-label{cursor:pointer;height:100%;display:flex;align-items:center;justify-content:center}.monaco-dropdown>.dropdown-label>.action-label.disabled{cursor:default}.monaco-dropdown-with-primary{display:flex!important;flex-direction:row;border-radius:5px}.monaco-dropdown-with-primary>.action-container>.action-label{margin-right:0}.monaco-dropdown-with-primary>.dropdown-action-container>.monaco-dropdown>.dropdown-label .codicon[class*=codicon-]{font-size:12px;padding-left:0;padding-right:0;line-height:16px;margin-left:-3px}.monaco-dropdown-with-primary>.dropdown-action-container>.monaco-dropdown>.dropdown-label>.action-label{display:block;background-size:16px;background-position:center center;background-repeat:no-repeat}.monaco-toolbar{height:100%}.monaco-toolbar .toolbar-toggle-more{display:inline-block;padding:0}.monaco-toolbar.responsive{.monaco-action-bar>.actions-container>.action-item{flex-shrink:1;min-width:20px}}.monaco-action-bar .action-item.menu-entry .action-label.icon{width:16px;height:16px;background-repeat:no-repeat;background-position:50%;background-size:16px}.monaco-action-bar .action-item.menu-entry.text-only .action-label{color:var(--vscode-descriptionForeground);overflow:hidden;border-radius:2px}.monaco-action-bar .action-item.menu-entry.text-only.use-comma:not(:last-of-type) .action-label:after{content:\", \"}.monaco-action-bar .action-item.menu-entry.text-only+.action-item:not(.text-only)>.monaco-dropdown .action-label{color:var(--vscode-descriptionForeground)}.monaco-dropdown-with-default{display:flex!important;flex-direction:row;border-radius:5px}.monaco-dropdown-with-default>.action-container>.action-label{margin-right:0}.monaco-dropdown-with-default>.action-container.menu-entry>.action-label.icon{width:16px;height:16px;background-repeat:no-repeat;background-position:50%;background-size:16px}.monaco-dropdown-with-default:hover{background-color:var(--vscode-toolbar-hoverBackground)}.monaco-dropdown-with-default>.dropdown-action-container>.monaco-dropdown>.dropdown-label .codicon[class*=codicon-]{font-size:12px;padding-left:0;padding-right:0;line-height:16px;margin-left:-3px}.monaco-dropdown-with-default>.dropdown-action-container>.monaco-dropdown>.dropdown-label>.action-label{display:block;background-size:16px;background-position:center center;background-repeat:no-repeat}.monaco-editor .diff-hidden-lines-widget{width:100%}.monaco-editor .diff-hidden-lines{height:0px;transform:translateY(-10px);font-size:13px;line-height:14px}.monaco-editor .diff-hidden-lines:not(.dragging) .top:hover,.monaco-editor .diff-hidden-lines:not(.dragging) .bottom:hover,.monaco-editor .diff-hidden-lines .top.dragging,.monaco-editor .diff-hidden-lines .bottom.dragging{background-color:var(--vscode-focusBorder)}.monaco-editor .diff-hidden-lines .top,.monaco-editor .diff-hidden-lines .bottom{transition:background-color .1s ease-out;height:4px;background-color:transparent;background-clip:padding-box;border-bottom:2px solid transparent;border-top:4px solid transparent}.monaco-editor.draggingUnchangedRegion.canMoveTop:not(.canMoveBottom) *,.monaco-editor .diff-hidden-lines .top.canMoveTop:not(.canMoveBottom),.monaco-editor .diff-hidden-lines .bottom.canMoveTop:not(.canMoveBottom){cursor:n-resize!important}.monaco-editor.draggingUnchangedRegion:not(.canMoveTop).canMoveBottom *,.monaco-editor .diff-hidden-lines .top:not(.canMoveTop).canMoveBottom,.monaco-editor .diff-hidden-lines .bottom:not(.canMoveTop).canMoveBottom{cursor:s-resize!important}.monaco-editor.draggingUnchangedRegion.canMoveTop.canMoveBottom *,.monaco-editor .diff-hidden-lines .top.canMoveTop.canMoveBottom,.monaco-editor .diff-hidden-lines .bottom.canMoveTop.canMoveBottom{cursor:ns-resize!important}.monaco-editor .diff-hidden-lines .top{transform:translateY(4px)}.monaco-editor .diff-hidden-lines .bottom{transform:translateY(-6px)}.monaco-editor .diff-unchanged-lines{background:var(--vscode-diffEditor-unchangedCodeBackground)}.monaco-editor .noModificationsOverlay{z-index:1;background:var(--vscode-editor-background);display:flex;justify-content:center;align-items:center}.monaco-editor .diff-hidden-lines .center{background:var(--vscode-diffEditor-unchangedRegionBackground);color:var(--vscode-diffEditor-unchangedRegionForeground);overflow:hidden;display:block;text-overflow:ellipsis;white-space:nowrap;height:24px;box-shadow:inset 0 -5px 5px -7px var(--vscode-diffEditor-unchangedRegionShadow),inset 0 5px 5px -7px var(--vscode-diffEditor-unchangedRegionShadow)}.monaco-editor .diff-hidden-lines .center span.codicon{vertical-align:middle}.monaco-editor .diff-hidden-lines .center a:hover .codicon{cursor:pointer;color:var(--vscode-editorLink-activeForeground)!important}.monaco-editor .diff-hidden-lines div.breadcrumb-item{cursor:pointer}.monaco-editor .diff-hidden-lines div.breadcrumb-item:hover{color:var(--vscode-editorLink-activeForeground)}.monaco-editor .movedOriginal,.monaco-editor .movedModified{border:2px solid var(--vscode-diffEditor-move-border)}.monaco-editor .movedOriginal.currentMove,.monaco-editor .movedModified.currentMove{border:2px solid var(--vscode-diffEditor-moveActive-border)}.monaco-diff-editor .moved-blocks-lines path.currentMove{stroke:var(--vscode-diffEditor-moveActive-border)}.monaco-diff-editor .moved-blocks-lines path{pointer-events:visiblestroke}.monaco-diff-editor .moved-blocks-lines .arrow{fill:var(--vscode-diffEditor-move-border)}.monaco-diff-editor .moved-blocks-lines .arrow.currentMove{fill:var(--vscode-diffEditor-moveActive-border)}.monaco-diff-editor .moved-blocks-lines .arrow-rectangle{fill:var(--vscode-editor-background)}.monaco-diff-editor .moved-blocks-lines{position:absolute;pointer-events:none}.monaco-diff-editor .moved-blocks-lines path{fill:none;stroke:var(--vscode-diffEditor-move-border);stroke-width:2}.monaco-editor .char-delete.diff-range-empty{margin-left:-1px;border-left:solid var(--vscode-diffEditor-removedTextBackground) 3px}.monaco-editor .char-insert.diff-range-empty{border-left:solid var(--vscode-diffEditor-insertedTextBackground) 3px}.monaco-editor .fold-unchanged{cursor:pointer}.monaco-diff-editor .diff-moved-code-block{display:flex;justify-content:flex-end;margin-top:-4px}.monaco-diff-editor .diff-moved-code-block .action-bar .action-label.codicon{width:12px;height:12px;font-size:12px}.monaco-diff-editor .diffOverview{z-index:9}.monaco-diff-editor .diffOverview .diffViewport{z-index:10}.monaco-diff-editor.vs .diffOverview{background:#00000008}.monaco-diff-editor.vs-dark .diffOverview{background:#ffffff03}.monaco-scrollable-element.modified-in-monaco-diff-editor.vs .scrollbar,.monaco-scrollable-element.modified-in-monaco-diff-editor.vs-dark .scrollbar{background:#0000}.monaco-scrollable-element.modified-in-monaco-diff-editor.hc-black .scrollbar,.monaco-scrollable-element.modified-in-monaco-diff-editor.hc-light .scrollbar{background:none}.monaco-scrollable-element.modified-in-monaco-diff-editor .slider{z-index:10}.modified-in-monaco-diff-editor .slider.active{background:#ababab66}.modified-in-monaco-diff-editor.hc-black .slider.active,.modified-in-monaco-diff-editor.hc-light .slider.active{background:none}.monaco-editor .insert-sign,.monaco-diff-editor .insert-sign,.monaco-editor .delete-sign,.monaco-diff-editor .delete-sign{font-size:11px!important;opacity:.7!important;display:flex!important;align-items:center}.monaco-editor.hc-black .insert-sign,.monaco-diff-editor.hc-black .insert-sign,.monaco-editor.hc-black .delete-sign,.monaco-diff-editor.hc-black .delete-sign,.monaco-editor.hc-light .insert-sign,.monaco-diff-editor.hc-light .insert-sign,.monaco-editor.hc-light .delete-sign,.monaco-diff-editor.hc-light .delete-sign{opacity:1}.monaco-editor .inline-deleted-margin-view-zone,.monaco-editor .inline-added-margin-view-zone{text-align:right}.monaco-editor .arrow-revert-change{z-index:10;position:absolute}.monaco-editor .arrow-revert-change:hover{cursor:pointer}.monaco-editor .view-zones .view-lines .view-line span{display:inline-block}.monaco-editor .margin-view-zones .lightbulb-glyph:hover{cursor:pointer}.monaco-editor .char-insert,.monaco-diff-editor .char-insert{background-color:var(--vscode-diffEditor-insertedTextBackground)}.monaco-editor .line-insert,.monaco-diff-editor .line-insert{background-color:var(--vscode-diffEditor-insertedLineBackground, var(--vscode-diffEditor-insertedTextBackground))}.monaco-editor .line-insert,.monaco-editor .char-insert{box-sizing:border-box;border:1px solid var(--vscode-diffEditor-insertedTextBorder)}.monaco-editor.hc-black .line-insert,.monaco-editor.hc-light .line-insert,.monaco-editor.hc-black .char-insert,.monaco-editor.hc-light .char-insert{border-style:dashed}.monaco-editor .line-delete,.monaco-editor .char-delete{box-sizing:border-box;border:1px solid var(--vscode-diffEditor-removedTextBorder)}.monaco-editor.hc-black .line-delete,.monaco-editor.hc-light .line-delete,.monaco-editor.hc-black .char-delete,.monaco-editor.hc-light .char-delete{border-style:dashed}.monaco-editor .inline-added-margin-view-zone,.monaco-editor .gutter-insert,.monaco-diff-editor .gutter-insert{background-color:var(--vscode-diffEditorGutter-insertedLineBackground, var(--vscode-diffEditor-insertedLineBackground), var(--vscode-diffEditor-insertedTextBackground))}.monaco-editor .char-delete,.monaco-diff-editor .char-delete,.monaco-editor .inline-deleted-text{background-color:var(--vscode-diffEditor-removedTextBackground)}.monaco-editor .inline-deleted-text{text-decoration:line-through}.monaco-editor .line-delete,.monaco-diff-editor .line-delete{background-color:var(--vscode-diffEditor-removedLineBackground, var(--vscode-diffEditor-removedTextBackground))}.monaco-editor .inline-deleted-margin-view-zone,.monaco-editor .gutter-delete,.monaco-diff-editor .gutter-delete{background-color:var(--vscode-diffEditorGutter-removedLineBackground, var(--vscode-diffEditor-removedLineBackground), var(--vscode-diffEditor-removedTextBackground))}.monaco-diff-editor.side-by-side .editor.modified{box-shadow:-6px 0 5px -5px var(--vscode-scrollbar-shadow);border-left:1px solid var(--vscode-diffEditor-border)}.monaco-diff-editor.side-by-side .editor.original{box-shadow:6px 0 5px -5px var(--vscode-scrollbar-shadow);border-right:1px solid var(--vscode-diffEditor-border)}.monaco-diff-editor .diffViewport{background:var(--vscode-scrollbarSlider-background)}.monaco-diff-editor .diffViewport:hover{background:var(--vscode-scrollbarSlider-hoverBackground)}.monaco-diff-editor .diffViewport:active{background:var(--vscode-scrollbarSlider-activeBackground)}.monaco-editor .diagonal-fill{background-image:linear-gradient(-45deg,var(--vscode-diffEditor-diagonalFill) 12.5%,#0000 12.5%,#0000 50%,var(--vscode-diffEditor-diagonalFill) 50%,var(--vscode-diffEditor-diagonalFill) 62.5%,#0000 62.5%,#0000 100%);background-size:8px 8px}.monaco-diff-editor .gutter{position:relative;overflow:hidden;flex-shrink:0;flex-grow:0;>div{position:absolute}.gutterItem{opacity:0;transition:opacity .7s;&.showAlways{opacity:1;transition:none}&.noTransition{transition:none}}&:hover .gutterItem{opacity:1;transition:opacity .1s ease-in-out}.gutterItem{.background{position:absolute;height:100%;left:50%;width:1px;border-left:2px var(--vscode-menu-separatorBackground) solid}.buttons{position:absolute;width:100%;display:flex;justify-content:center;align-items:center;.monaco-toolbar{height:fit-content;.monaco-action-bar{line-height:1;.actions-container{width:fit-content;border-radius:4px;background:var(--vscode-editorGutter-itemBackground);.action-item{&:hover{background:var(--vscode-toolbar-hoverBackground)}.action-label{color:var(--vscode-editorGutter-itemGlyphForeground);padding:1px 2px}}}}}}}}.monaco-diff-editor .diff-hidden-lines-compact{display:flex;height:11px;.line-left,.line-right{height:1px;border-top:1px solid;border-color:var(--vscode-editorCodeLens-foreground);opacity:.5;margin:auto;width:100%}.line-left{width:20px}.text{color:var(--vscode-editorCodeLens-foreground);text-wrap:nowrap;font-size:11px;line-height:11px;margin:0 4px}}.monaco-editor .line-delete-selectable{user-select:text!important;-webkit-user-select:text!important;z-index:1!important}.line-delete-selectable .view-line{user-select:text!important;-webkit-user-select:text!important}.monaco-editor .selection-anchor{background-color:#007acc;width:2px!important}.monaco-editor .bracket-match{box-sizing:border-box;background-color:var(--vscode-editorBracketMatch-background);border:1px solid var(--vscode-editorBracketMatch-border)}.inline-editor-progress-decoration{display:inline-block;width:1em;height:1em}.inline-progress-widget{display:flex!important;justify-content:center;align-items:center}.inline-progress-widget .icon{font-size:80%!important}.inline-progress-widget:hover .icon{font-size:90%!important;animation:none}.inline-progress-widget:hover .icon:before{content:var(--vscode-icon-x-content);font-family:var(--vscode-icon-x-font-family)}.monaco-editor .monaco-editor-overlaymessage{padding-bottom:8px;z-index:10000}.monaco-editor .monaco-editor-overlaymessage.below{padding-bottom:0;padding-top:8px;z-index:10000}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.monaco-editor .monaco-editor-overlaymessage.fadeIn{animation:fadeIn .15s ease-out}@keyframes fadeOut{0%{opacity:1}to{opacity:0}}.monaco-editor .monaco-editor-overlaymessage.fadeOut{animation:fadeOut .1s ease-out}.monaco-editor .monaco-editor-overlaymessage .message{padding:2px 4px;color:var(--vscode-editorHoverWidget-foreground);background-color:var(--vscode-editorHoverWidget-background);border:1px solid var(--vscode-inputValidation-infoBorder);border-radius:3px}.monaco-editor .monaco-editor-overlaymessage .message p{margin-block:0px}.monaco-editor .monaco-editor-overlaymessage .message a{color:var(--vscode-textLink-foreground)}.monaco-editor .monaco-editor-overlaymessage .message a:hover{color:var(--vscode-textLink-activeForeground)}.monaco-editor.hc-black .monaco-editor-overlaymessage .message,.monaco-editor.hc-light .monaco-editor-overlaymessage .message{border-width:2px}.monaco-editor .monaco-editor-overlaymessage .anchor{width:0!important;height:0!important;border-color:transparent;border-style:solid;z-index:1000;border-width:8px;position:absolute;left:2px}.monaco-editor .monaco-editor-overlaymessage .anchor.top{border-bottom-color:var(--vscode-inputValidation-infoBorder)}.monaco-editor .monaco-editor-overlaymessage .anchor.below{border-top-color:var(--vscode-inputValidation-infoBorder)}.monaco-editor .monaco-editor-overlaymessage:not(.below) .anchor.top,.monaco-editor .monaco-editor-overlaymessage.below .anchor.below{display:none}.monaco-editor .monaco-editor-overlaymessage.below .anchor.top{display:inherit;top:-8px}.monaco-text-button{box-sizing:border-box;display:flex;width:100%;padding:4px;border-radius:2px;text-align:center;cursor:pointer;justify-content:center;align-items:center;border:1px solid var(--vscode-button-border, transparent);line-height:18px}.monaco-text-button:focus{outline-offset:2px!important}.monaco-text-button:hover{text-decoration:none!important}.monaco-button.disabled:focus,.monaco-button.disabled{opacity:.4!important;cursor:default}.monaco-text-button .codicon{margin:0 .2em;color:inherit!important}.monaco-text-button.monaco-text-button-with-short-label{flex-direction:row;flex-wrap:wrap;padding:0 4px;overflow:hidden;height:28px}.monaco-text-button.monaco-text-button-with-short-label>.monaco-button-label{flex-basis:100%}.monaco-text-button.monaco-text-button-with-short-label>.monaco-button-label-short{flex-grow:1;width:0;overflow:hidden}.monaco-text-button.monaco-text-button-with-short-label>.monaco-button-label,.monaco-text-button.monaco-text-button-with-short-label>.monaco-button-label-short{display:flex;justify-content:center;align-items:center;font-weight:400;font-style:inherit;padding:4px 0}.monaco-button-dropdown{display:flex;cursor:pointer}.monaco-button-dropdown.disabled{cursor:default}.monaco-button-dropdown>.monaco-button:focus{outline-offset:-1px!important}.monaco-button-dropdown.disabled>.monaco-button.disabled,.monaco-button-dropdown.disabled>.monaco-button.disabled:focus,.monaco-button-dropdown.disabled>.monaco-button-dropdown-separator{opacity:.4!important}.monaco-button-dropdown>.monaco-button.monaco-text-button{border-right-width:0!important}.monaco-button-dropdown .monaco-button-dropdown-separator{padding:4px 0;cursor:default}.monaco-button-dropdown .monaco-button-dropdown-separator>div{height:100%;width:1px}.monaco-button-dropdown>.monaco-button.monaco-dropdown-button{border:1px solid var(--vscode-button-border, transparent);border-left-width:0!important;border-radius:0 2px 2px 0;display:flex;align-items:center}.monaco-button-dropdown>.monaco-button.monaco-text-button{border-radius:2px 0 0 2px}.monaco-description-button{display:flex;flex-direction:column;align-items:center;margin:4px 5px}.monaco-description-button .monaco-button-description{font-style:italic;font-size:11px;padding:4px 20px}.monaco-description-button .monaco-button-label,.monaco-description-button .monaco-button-description{display:flex;justify-content:center;align-items:center}.monaco-description-button .monaco-button-label>.codicon,.monaco-description-button .monaco-button-description>.codicon{margin:0 .2em;color:inherit!important}.monaco-button.default-colors,.monaco-button-dropdown.default-colors>.monaco-button{color:var(--vscode-button-foreground);background-color:var(--vscode-button-background)}.monaco-button.default-colors:hover,.monaco-button-dropdown.default-colors>.monaco-button:hover{background-color:var(--vscode-button-hoverBackground)}.monaco-button.default-colors.secondary,.monaco-button-dropdown.default-colors>.monaco-button.secondary{color:var(--vscode-button-secondaryForeground);background-color:var(--vscode-button-secondaryBackground)}.monaco-button.default-colors.secondary:hover,.monaco-button-dropdown.default-colors>.monaco-button.secondary:hover{background-color:var(--vscode-button-secondaryHoverBackground)}.monaco-button-dropdown.default-colors .monaco-button-dropdown-separator{background-color:var(--vscode-button-background);border-top:1px solid var(--vscode-button-border);border-bottom:1px solid var(--vscode-button-border)}.monaco-button-dropdown.default-colors .monaco-button.secondary+.monaco-button-dropdown-separator{background-color:var(--vscode-button-secondaryBackground)}.monaco-button-dropdown.default-colors .monaco-button-dropdown-separator>div{background-color:var(--vscode-button-separator)}.action-widget{font-size:13px;min-width:100px;max-width:80vw;z-index:40;display:block;width:100%;border:1px solid var(--vscode-menu-border)!important;border-radius:5px;background-color:var(--vscode-menu-background);color:var(--vscode-menu-foreground);padding:4px;box-shadow:0 2px 8px var(--vscode-widget-shadow)}.context-view-block{position:fixed;cursor:initial;left:0;top:0;width:100%;height:100%;z-index:-1}.context-view-pointerBlock{position:fixed;cursor:initial;left:0;top:0;width:100%;height:100%;z-index:2}.action-widget .monaco-list{user-select:none;-webkit-user-select:none;border:none!important;border-width:0!important}.action-widget .monaco-list:focus:before{outline:0!important}.action-widget .monaco-list .monaco-scrollable-element{overflow:visible}.action-widget .monaco-list .monaco-list-row{padding:0 4px;white-space:nowrap;cursor:pointer;touch-action:none;width:100%;border-radius:3px}.action-widget .monaco-list .monaco-list-row.action.focused:not(.option-disabled){background-color:var(--vscode-list-activeSelectionBackground)!important;color:var(--vscode-list-activeSelectionForeground);outline:1px solid var(--vscode-menu-selectionBorder, transparent);outline-offset:-1px}.action-widget .monaco-list-row.group-header{color:var(--vscode-descriptionForeground)!important;font-weight:600;font-size:13px}.action-widget .monaco-list-row.group-header:not(:first-of-type){margin-top:2px}.action-widget .monaco-scrollable-element .monaco-list-rows .monaco-list-row.separator{border-top:1px solid var(--vscode-editorHoverWidget-border);color:var(--vscode-descriptionForeground);font-size:12px;padding:0;margin:4px 0 0;cursor:default;user-select:none;border-radius:0}.action-widget .monaco-scrollable-element .monaco-list-rows .monaco-list-row.separator.focused{outline:0 solid;background-color:transparent;border-radius:0}.action-widget .monaco-list-row.separator:first-of-type{border-top:none;margin-top:0}.action-widget .monaco-list .group-header,.action-widget .monaco-list .option-disabled,.action-widget .monaco-list .option-disabled:before,.action-widget .monaco-list .option-disabled .focused,.action-widget .monaco-list .option-disabled .focused:before{cursor:default!important;-webkit-touch-callout:none;-webkit-user-select:none;user-select:none;background-color:transparent!important;outline:0 solid!important}.action-widget .monaco-list-row.action{display:flex;gap:4px;align-items:center}.action-widget .monaco-list-row.action.option-disabled,.action-widget .monaco-list:focus .monaco-list-row.focused.action.option-disabled,.action-widget .monaco-list-row.action.option-disabled .codicon,.action-widget .monaco-list:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused).option-disabled{color:var(--vscode-disabledForeground)}.action-widget .monaco-list-row.action:not(.option-disabled) .codicon{color:inherit}.action-widget .monaco-list-row.action .title{flex:1;overflow:hidden;text-overflow:ellipsis}.action-widget .monaco-list-row.action .monaco-keybinding>.monaco-keybinding-key{background-color:var(--vscode-keybindingLabel-background);color:var(--vscode-keybindingLabel-foreground);border-style:solid;border-width:1px;border-radius:3px;border-color:var(--vscode-keybindingLabel-border);border-bottom-color:var(--vscode-keybindingLabel-bottomBorder);box-shadow:inset 0 -1px 0 var(--vscode-widget-shadow)}.action-widget .action-widget-action-bar{background-color:var(--vscode-menu-background);border-top:1px solid var(--vscode-menu-border);margin-top:2px}.action-widget .action-widget-action-bar:before{display:block;content:\"\";width:100%}.action-widget .action-widget-action-bar .actions-container{padding:4px 8px 2px 24px}.action-widget-action-bar .action-label{color:var(--vscode-textLink-activeForeground);font-size:13px;line-height:22px;padding:0;pointer-events:all}.action-widget-action-bar .action-item{margin-right:16px;pointer-events:none}.action-widget-action-bar .action-label:hover{background-color:transparent!important}.monaco-action-bar .actions-container.highlight-toggled .action-label.checked{background:var(--vscode-actionBar-toggledBackground)!important}.action-widget .monaco-list .monaco-list-row .description{opacity:.7;margin-left:.5em}.monaco-keybinding{display:flex;align-items:center;line-height:10px}.monaco-keybinding>.monaco-keybinding-key{display:inline-block;border-style:solid;border-width:1px;border-radius:3px;vertical-align:middle;font-size:11px;padding:3px 5px;margin:0 2px}.monaco-keybinding>.monaco-keybinding-key:first-child{margin-left:0}.monaco-keybinding>.monaco-keybinding-key:last-child{margin-right:0}.monaco-keybinding>.monaco-keybinding-key-separator{display:inline-block}.monaco-keybinding>.monaco-keybinding-key-chord-separator{width:6px}.post-edit-widget{box-shadow:0 0 8px 2px var(--vscode-widget-shadow);border:1px solid var(--vscode-widget-border, transparent);border-radius:4px;color:var(--vscode-button-foreground);background-color:var(--vscode-button-background);overflow:hidden}.post-edit-widget .monaco-button{padding:2px;border:none;border-radius:0}.post-edit-widget .monaco-button:hover{background-color:var(--vscode-button-hoverBackground)!important}.post-edit-widget .monaco-button .codicon{margin:0}@font-face{font-family:codicon;font-display:block;src:url(data:font/ttf;base64,AAEAAAALAIAAAwAwR1NVQiCLJXoAAAE4AAAAVE9TLzI3UEsvAAABjAAAAGBjbWFwdCJY8AAACfwAAB5QZ2x5ZpdPvvsAACxYAAGRYGhlYWRYkqBSAAAA4AAAADZoaGVhAlYDLwAAALwAAAAkaG10eFs1/+YAAAHsAAAIEGxvY2EPPKwaAAAoTAAABAptYXhwAx0BiAAAARgAAAAgbmFtZZP7uU8AAb24AAAB+HBvc3RPbs8TAAG/sAAAHMQAAQAAASwAAAAAASz/+v/+AS4AAQAAAAAAAAAAAAAAAAAAAgQAAQAAAAEAAD/d1LtfDzz1AAsBLAAAAAB8JbCAAAAAAHwlsID/+v/8AS4BLQAAAAgAAgAAAAAAAAABAAACBAF8AA8AAAAAAAIAAAAKAAoAAAD/AAAAAAAAAAEAAAAKADAAPgACREZMVAAObGF0bgAaAAQAAAAAAAAAAQAAAAQAAAAAAAAAAQAAAAFsaWdhAAgAAAABAAAAAQAEAAQAAAABAAgAAQAGAAAAAQAAAAQBKwGQAAUAAAC+ANIAAAAqAL4A0gAAAJAADgBNAAACAAUDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFBmRWQAwOpg8QMBLAAAABsBRwAEAAAAAQAAAAAAAAAAAAAAAAACAAAAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEs//8BLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEs//8BLP//ASz//wEsAAABLAAAASz//wEs//8BLP//ASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEs//8BLP//ASz//wEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASz//AEsAAABLP//ASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABIAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLP//ASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABIAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASAAAAEsAAABLAAAASD/+gEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEgAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABIAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABIAAAASwAAAEsAAABIAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEs//8BLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEs//8BLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEs//8BLAAAASwAAAEsAAABLAAAASz//wEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAASwAAAEsAAABLAAAAAAABQAAAAMAAAAsAAAABAAABaQAAQAAAAAEngADAAEAAAAsAAMACgAABaQABARyAAAAEgAQAAMAAuqI6ozqx+rJ6wnrTuxx8QP//wAA6mDqiuqP6snqzOsL61DxAf//AAAAAAAAAAAAAAAAAAAAAAABABIAYgBmANYA1gFQAdYEGAAAAAMBHAF8AXcA1gFmAckBUwDKAToBqQBXAfkBlAGfAZ4AqgA7AV0AnQDzASgARgHHAI0AGAH0ALUAnwFzAUsBQQFCAd4A7ADBAN4B1QG2AKMBxQGvAPsBvAGwAb4BxAHAAbkA4QG1AcIAAgAFAAYACwAMAA0ADgAPABAAEQATABwAHgAfACAAcABxAHIAcwB2AHcAIwAkACUAJgAoACsAMAAxADIAMwA0ADUANwA4ADkAOgBBAD4AQgBDAEQARQBHAEgATABOAFAAVABoAGoAawBsAHsAfQB/AIIAhgCIAIkAigCLAIwAjgCPAJAAkQCSAJMAlQCWAJgAmQCeAKAApACoAKkArACtAK4ArwCwALEAsgC0ALYAuAC6ALsAvAC9AL4AwADDAMQAxQDGAMsAzADPANoA2wDfAOMA5wDoAOsA7QDuAO8A8AD3APgA+QD6APsA/AD9AQEBGQEdAR4BIAEjASQBJQEmASoBKwEwATIBMwE5ATsBPAE9AT8BRAFFAUgBSgFNAU4BVgCGAVoBWwFcAV4BXwFhAWIBZAFlAWoBawFsAW0BbgFvAXEBcgF0AXYBeQF6AX0AlwF/AYABgQGCAYMBiwGMAY0BjgGPAZMBmQGaAZsBnQGhAaMBpgGnAagBqgGrAbEBsgGzAbQBtwC1AbgBugG9Ab8BwQHDAcsBzAHWAdgB2gHcAd0B3wHgAeEB4gHjAecB6QHqAesB7gE9Ae8B8QHzAfoB+wH8ACUB/gICAgMAuAEfASEBIgB0AHUAhAA/AIUAeAG5AIMAhwCBAG8AKQAqATQApQCrAOkB6AABABkAegEYAUwBhgHGAVgA3AGYAZcBUAGsAVkBaABuAfAASQE2AKYA5AEpAUcBaQAvAVcBTwA8AD0AUQHIAewB5gHkAeUA0QGEAYcBRgCAAf8CAQIAAc4BzwHRAdIB0wHUAc0AEgBmAVIAtwH4AH4A9QEEAQMBAgBaAFkAWAAWAPYA0ADTAG0AfAGJAL8AewAXAOUA5gFVACEAIgEnABUB7QFDARcBBQEGAQwBCQELAQ4BDwESARUBFgEIAQcBygDxAWcAogAHAAgACQAKARQBDQERAB0A6gEvASwAQAAbABoAVgDUANUBkABVAZYBpQD0ATgB2QHbAE0BogDCAfUANgFUAT4BNwF1AGUBGwF+AaQAlwCUAa4BnADZANcA2AH3AfYASgGIAYUAZwDdAS4BLQDiAVEAFADgAJsASwBkAWAAXgBjAQAAWwBfALkBGgG7AGIBeAD+AP8A0gExAKcBCgEQARMAXQBcAGEALgGSAJwAYAGVAFMALQAsAE8BQAHXACcAUgBpAKEAswDOAWMBcAGKAHkBrQFJAPIABACaAXsBoAE1AMcAyQDIAMoBkQHQAM0B8gH9AAABBgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAABisAAAAAAAAAg0AAOpgAADqYAAAAAMAAOphAADqYQAAARwAAOpiAADqYgAAAXwAAOpjAADqYwAAAXcAAOpkAADqZAAAANYAAOplAADqZQAAAWYAAOpmAADqZgAAAckAAOpnAADqZwAAAVMAAOpoAADqaAAAAMoAAOppAADqaQAAAToAAOpqAADqagAAAakAAOprAADqawAAAFcAAOpsAADqbAAAAfkAAOptAADqbQAAAZQAAOpuAADqbgAAAZ8AAOpvAADqbwAAAZ4AAOpwAADqcAAAAKoAAOpxAADqcQAAADsAAOpyAADqcgAAAV0AAOpzAADqcwAAAJ0AAOp0AADqdAAAAPMAAOp1AADqdQAAASgAAOp2AADqdgAAAEYAAOp3AADqdwAAAccAAOp4AADqeAAAAI0AAOp5AADqeQAAABgAAOp6AADqegAAAfQAAOp7AADqewAAALUAAOp8AADqfAAAAJ8AAOp9AADqfQAAAXMAAOp+AADqfgAAAUsAAOp/AADqfwAAAUEAAOqAAADqgAAAAUIAAOqBAADqgQAAAd4AAOqCAADqggAAAOwAAOqDAADqgwAAAMEAAOqEAADqhAAAAN4AAOqFAADqhQAAAdUAAOqGAADqhgAAAbYAAOqHAADqhwAAAKMAAOqIAADqiAAAAcUAAOqKAADqigAAAa8AAOqLAADqiwAAAPsAAOqMAADqjAAAAbwAAOqPAADqjwAAAbAAAOqQAADqkAAAAb4AAOqRAADqkQAAAcQAAOqSAADqkgAAAcAAAOqTAADqkwAAAbkAAOqUAADqlAAAAOEAAOqVAADqlQAAAbUAAOqWAADqlgAAAcIAAOqXAADqlwAAAAIAAOqYAADqmAAAAAUAAOqZAADqmQAAAAYAAOqaAADqmgAAAAsAAOqbAADqmwAAAAwAAOqcAADqnAAAAA0AAOqdAADqnQAAAA4AAOqeAADqngAAAA8AAOqfAADqnwAAABAAAOqgAADqoAAAABEAAOqhAADqoQAAABMAAOqiAADqogAAABwAAOqjAADqowAAAB4AAOqkAADqpAAAAB8AAOqlAADqpQAAACAAAOqmAADqpgAAAHAAAOqnAADqpwAAAHEAAOqoAADqqAAAAHIAAOqpAADqqQAAAHMAAOqqAADqqgAAAHYAAOqrAADqqwAAAHcAAOqsAADqrAAAACMAAOqtAADqrQAAACQAAOquAADqrgAAACUAAOqvAADqrwAAACYAAOqwAADqsAAAACgAAOqxAADqsQAAACsAAOqyAADqsgAAADAAAOqzAADqswAAADEAAOq0AADqtAAAADIAAOq1AADqtQAAADMAAOq2AADqtgAAADQAAOq3AADqtwAAADUAAOq4AADquAAAADcAAOq5AADquQAAADgAAOq6AADqugAAADkAAOq7AADquwAAADoAAOq8AADqvAAAAEEAAOq9AADqvQAAAD4AAOq+AADqvgAAAEIAAOq/AADqvwAAAEMAAOrAAADqwAAAAEQAAOrBAADqwQAAAEUAAOrCAADqwgAAAEcAAOrDAADqwwAAAEgAAOrEAADqxAAAAEwAAOrFAADqxQAAAE4AAOrGAADqxgAAAFAAAOrHAADqxwAAAFQAAOrJAADqyQAAAGgAAOrMAADqzAAAAGoAAOrNAADqzQAAAGsAAOrOAADqzgAAAGwAAOrPAADqzwAAAHsAAOrQAADq0AAAAH0AAOrRAADq0QAAAH8AAOrSAADq0gAAAIIAAOrTAADq0wAAAIYAAOrUAADq1AAAAIgAAOrVAADq1QAAAIkAAOrWAADq1gAAAIoAAOrXAADq1wAAAIsAAOrYAADq2AAAAIwAAOrZAADq2QAAAI4AAOraAADq2gAAAI8AAOrbAADq2wAAAJAAAOrcAADq3AAAAJEAAOrdAADq3QAAAJIAAOreAADq3gAAAJMAAOrfAADq3wAAAJUAAOrgAADq4AAAAJYAAOrhAADq4QAAAJgAAOriAADq4gAAAJkAAOrjAADq4wAAAJ4AAOrkAADq5AAAAKAAAOrlAADq5QAAAKQAAOrmAADq5gAAAKgAAOrnAADq5wAAAKkAAOroAADq6AAAAKwAAOrpAADq6QAAAK0AAOrqAADq6gAAAK4AAOrrAADq6wAAAK8AAOrsAADq7AAAALAAAOrtAADq7QAAALEAAOruAADq7gAAALIAAOrvAADq7wAAALQAAOrwAADq8AAAALYAAOrxAADq8QAAALgAAOryAADq8gAAALoAAOrzAADq8wAAALsAAOr0AADq9AAAALwAAOr1AADq9QAAAL0AAOr2AADq9gAAAL4AAOr3AADq9wAAAMAAAOr4AADq+AAAAMMAAOr5AADq+QAAAMQAAOr6AADq+gAAAMUAAOr7AADq+wAAAMYAAOr8AADq/AAAAMsAAOr9AADq/QAAAMwAAOr+AADq/gAAAM8AAOr/AADq/wAAANoAAOsAAADrAAAAANsAAOsBAADrAQAAAN8AAOsCAADrAgAAAOMAAOsDAADrAwAAAOcAAOsEAADrBAAAAOgAAOsFAADrBQAAAOsAAOsGAADrBgAAAO0AAOsHAADrBwAAAO4AAOsIAADrCAAAAO8AAOsJAADrCQAAAPAAAOsLAADrCwAAAPcAAOsMAADrDAAAAPgAAOsNAADrDQAAAPkAAOsOAADrDgAAAPoAAOsPAADrDwAAAPsAAOsQAADrEAAAAPwAAOsRAADrEQAAAP0AAOsSAADrEgAAAQEAAOsTAADrEwAAARkAAOsUAADrFAAAAR0AAOsVAADrFQAAAR4AAOsWAADrFgAAASAAAOsXAADrFwAAASMAAOsYAADrGAAAASQAAOsZAADrGQAAASUAAOsaAADrGgAAASYAAOsbAADrGwAAASoAAOscAADrHAAAASsAAOsdAADrHQAAATAAAOseAADrHgAAATIAAOsfAADrHwAAATMAAOsgAADrIAAAATkAAOshAADrIQAAATsAAOsiAADrIgAAATwAAOsjAADrIwAAAT0AAOskAADrJAAAAT8AAOslAADrJQAAAUQAAOsmAADrJgAAAUUAAOsnAADrJwAAAUgAAOsoAADrKAAAAUoAAOspAADrKQAAAU0AAOsqAADrKgAAAU4AAOsrAADrKwAAAVYAAOssAADrLAAAAIYAAOstAADrLQAAAVoAAOsuAADrLgAAAVsAAOsvAADrLwAAAVwAAOswAADrMAAAAV4AAOsxAADrMQAAAV8AAOsyAADrMgAAAWEAAOszAADrMwAAAWIAAOs0AADrNAAAAWQAAOs1AADrNQAAAWUAAOs2AADrNgAAAWoAAOs3AADrNwAAAWsAAOs4AADrOAAAAWwAAOs5AADrOQAAAW0AAOs6AADrOgAAAW4AAOs7AADrOwAAAW8AAOs8AADrPAAAAXEAAOs9AADrPQAAAXIAAOs+AADrPgAAAXQAAOs/AADrPwAAAXYAAOtAAADrQAAAAXkAAOtBAADrQQAAAXoAAOtCAADrQgAAAX0AAOtDAADrQwAAAJcAAOtEAADrRAAAAX8AAOtFAADrRQAAAYAAAOtGAADrRgAAAYEAAOtHAADrRwAAAYIAAOtIAADrSAAAAYMAAOtJAADrSQAAAYsAAOtKAADrSgAAAYwAAOtLAADrSwAAAY0AAOtMAADrTAAAAY4AAOtNAADrTQAAAY8AAOtOAADrTgAAAZMAAOtQAADrUAAAAZkAAOtRAADrUQAAAZoAAOtSAADrUgAAAZsAAOtTAADrUwAAAZ0AAOtUAADrVAAAAaEAAOtVAADrVQAAAaMAAOtWAADrVgAAAaYAAOtXAADrVwAAAacAAOtYAADrWAAAAagAAOtZAADrWQAAAaoAAOtaAADrWgAAAasAAOtbAADrWwAAAbEAAOtcAADrXAAAAbIAAOtdAADrXQAAAbMAAOteAADrXgAAAbQAAOtfAADrXwAAAbcAAOtgAADrYAAAALUAAOthAADrYQAAAbgAAOtiAADrYgAAAboAAOtjAADrYwAAAb0AAOtkAADrZAAAAb8AAOtlAADrZQAAAcEAAOtmAADrZgAAAcMAAOtnAADrZwAAAcsAAOtoAADraAAAAcwAAOtpAADraQAAAdYAAOtqAADragAAAdgAAOtrAADrawAAAdoAAOtsAADrbAAAAdwAAOttAADrbQAAAd0AAOtuAADrbgAAAd8AAOtvAADrbwAAAeAAAOtwAADrcAAAAeEAAOtxAADrcQAAAeIAAOtyAADrcgAAAeMAAOtzAADrcwAAAecAAOt0AADrdAAAAekAAOt1AADrdQAAAeoAAOt2AADrdgAAAesAAOt3AADrdwAAAe4AAOt4AADreAAAAT0AAOt5AADreQAAAe8AAOt6AADregAAAfEAAOt7AADrewAAAfMAAOt8AADrfAAAAfoAAOt9AADrfQAAAfsAAOt+AADrfgAAAfwAAOt/AADrfwAAACUAAOuAAADrgAAAAf4AAOuBAADrgQAAAgIAAOuCAADrggAAAgMAAOuDAADrgwAAALgAAOuEAADrhAAAAR8AAOuFAADrhQAAASEAAOuGAADrhgAAASIAAOuHAADrhwAAAHQAAOuIAADriAAAAHUAAOuJAADriQAAAIQAAOuKAADrigAAAD8AAOuLAADriwAAAIUAAOuMAADrjAAAAHgAAOuNAADrjQAAAbkAAOuOAADrjgAAAIMAAOuPAADrjwAAAIcAAOuQAADrkAAAAIEAAOuRAADrkQAAAG8AAOuSAADrkgAAACkAAOuTAADrkwAAACoAAOuUAADrlAAAATQAAOuVAADrlQAAAKUAAOuWAADrlgAAAKsAAOuXAADrlwAAAOkAAOuYAADrmAAAAegAAOuZAADrmQAAAAEAAOuaAADrmgAAABkAAOubAADrmwAAAHoAAOucAADrnAAAARgAAOudAADrnQAAAUwAAOueAADrngAAAYYAAOufAADrnwAAAcYAAOugAADroAAAAVgAAOuhAADroQAAANwAAOuiAADrogAAAZgAAOujAADrowAAAZcAAOukAADrpAAAAVAAAOulAADrpQAAAawAAOumAADrpgAAAVkAAOunAADrpwAAAWgAAOuoAADrqAAAAG4AAOupAADrqQAAAfAAAOuqAADrqgAAAEkAAOurAADrqwAAATYAAOusAADrrAAAAKYAAOutAADrrQAAAOQAAOuuAADrrgAAASkAAOuvAADrrwAAAUcAAOuwAADrsAAAAWkAAOuxAADrsQAAAC8AAOuyAADrsgAAAVcAAOuzAADrswAAAU8AAOu0AADrtAAAADwAAOu1AADrtQAAAD0AAOu2AADrtgAAAFEAAOu3AADrtwAAAcgAAOu4AADruAAAAewAAOu5AADruQAAAeYAAOu6AADrugAAAeQAAOu7AADruwAAAeUAAOu8AADrvAAAANEAAOu9AADrvQAAAYQAAOu+AADrvgAAAYcAAOu/AADrvwAAAUYAAOvAAADrwAAAAIAAAOvBAADrwQAAAf8AAOvCAADrwgAAAgEAAOvDAADrwwAAAgAAAOvEAADrxAAAAc4AAOvFAADrxQAAAc8AAOvGAADrxgAAAdEAAOvHAADrxwAAAdIAAOvIAADryAAAAdMAAOvJAADryQAAAdQAAOvKAADrygAAAc0AAOvLAADrywAAABIAAOvMAADrzAAAAGYAAOvNAADrzQAAAVIAAOvOAADrzgAAALcAAOvPAADrzwAAAfgAAOvQAADr0AAAAH4AAOvRAADr0QAAAPUAAOvSAADr0gAAAQQAAOvTAADr0wAAAQMAAOvUAADr1AAAAQIAAOvVAADr1QAAAFoAAOvWAADr1gAAAFkAAOvXAADr1wAAAFgAAOvYAADr2AAAABYAAOvZAADr2QAAAPYAAOvaAADr2gAAANAAAOvbAADr2wAAANMAAOvcAADr3AAAAG0AAOvdAADr3QAAAHwAAOveAADr3gAAAYkAAOvfAADr3wAAAL8AAOvgAADr4AAAAHsAAOvhAADr4QAAABcAAOviAADr4gAAAOUAAOvjAADr4wAAAOYAAOvkAADr5AAAAVUAAOvlAADr5QAAACEAAOvmAADr5gAAACIAAOvnAADr5wAAAScAAOvoAADr6AAAABUAAOvpAADr6QAAAe0AAOvqAADr6gAAAUMAAOvrAADr6wAAARcAAOvsAADr7AAAAQUAAOvtAADr7QAAAQYAAOvuAADr7gAAAQwAAOvvAADr7wAAAQkAAOvwAADr8AAAAQsAAOvxAADr8QAAAQ4AAOvyAADr8gAAAQ8AAOvzAADr8wAAARIAAOv0AADr9AAAARUAAOv1AADr9QAAARYAAOv2AADr9gAAAQgAAOv3AADr9wAAAQcAAOv4AADr+AAAAcoAAOv5AADr+QAAAPEAAOv6AADr+gAAAWcAAOv7AADr+wAAAKIAAOv8AADr/AAAAAcAAOv9AADr/QAAAAgAAOv+AADr/gAAAAkAAOv/AADr/wAAAAoAAOwAAADsAAAAARQAAOwBAADsAQAAAQ0AAOwCAADsAgAAAREAAOwDAADsAwAAAB0AAOwEAADsBAAAAOoAAOwFAADsBQAAAS8AAOwGAADsBgAAASwAAOwHAADsBwAAAEAAAOwIAADsCAAAABsAAOwJAADsCQAAABoAAOwKAADsCgAAAFYAAOwLAADsCwAAANQAAOwMAADsDAAAANUAAOwNAADsDQAAAZAAAOwOAADsDgAAAFUAAOwPAADsDwAAAZYAAOwQAADsEAAAAaUAAOwRAADsEQAAAPQAAOwSAADsEgAAATgAAOwTAADsEwAAAdkAAOwUAADsFAAAAdsAAOwVAADsFQAAAE0AAOwWAADsFgAAAaIAAOwXAADsFwAAAMIAAOwYAADsGAAAAfUAAOwZAADsGQAAADYAAOwaAADsGgAAAVQAAOwbAADsGwAAAT4AAOwcAADsHAAAATcAAOwdAADsHQAAAXUAAOweAADsHgAAAGUAAOwfAADsHwAAARsAAOwgAADsIAAAAX4AAOwhAADsIQAAAaQAAOwiAADsIgAAAJcAAOwjAADsIwAAAJQAAOwkAADsJAAAAa4AAOwlAADsJQAAAZwAAOwmAADsJgAAANkAAOwnAADsJwAAANcAAOwoAADsKAAAANgAAOwpAADsKQAAAfcAAOwqAADsKgAAAfYAAOwrAADsKwAAAEoAAOwsAADsLAAAAYgAAOwtAADsLQAAAYUAAOwuAADsLgAAAGcAAOwvAADsLwAAAN0AAOwwAADsMAAAAS4AAOwxAADsMQAAAS0AAOwyAADsMgAAAOIAAOwzAADsMwAAAVEAAOw0AADsNAAAABQAAOw1AADsNQAAAOAAAOw2AADsNgAAAJsAAOw3AADsNwAAAEsAAOw4AADsOAAAAGQAAOw5AADsOQAAAWAAAOw6AADsOgAAAF4AAOw7AADsOwAAAGMAAOw8AADsPAAAAQAAAOw9AADsPQAAAFsAAOw+AADsPgAAAF8AAOw/AADsPwAAALkAAOxAAADsQAAAARoAAOxBAADsQQAAAbsAAOxCAADsQgAAAGIAAOxDAADsQwAAAXgAAOxEAADsRAAAAP4AAOxFAADsRQAAAP8AAOxGAADsRgAAANIAAOxHAADsRwAAATEAAOxIAADsSAAAAKcAAOxJAADsSQAAAQoAAOxKAADsSgAAARAAAOxLAADsSwAAARMAAOxMAADsTAAAAF0AAOxNAADsTQAAAFwAAOxOAADsTgAAAGEAAOxPAADsTwAAAC4AAOxQAADsUAAAAZIAAOxRAADsUQAAAJwAAOxSAADsUgAAAGAAAOxTAADsUwAAAZUAAOxUAADsVAAAAFMAAOxVAADsVQAAAC0AAOxWAADsVgAAACwAAOxXAADsVwAAAE8AAOxYAADsWAAAAUAAAOxZAADsWQAAAdcAAOxaAADsWgAAACcAAOxbAADsWwAAAFIAAOxcAADsXAAAAGkAAOxdAADsXQAAAKEAAOxeAADsXgAAALMAAOxfAADsXwAAAM4AAOxgAADsYAAAAWMAAOxhAADsYQAAAXAAAOxiAADsYgAAAYoAAOxjAADsYwAAAHkAAOxkAADsZAAAAa0AAOxlAADsZQAAAUkAAOxmAADsZgAAAPIAAOxnAADsZwAAAAQAAOxoAADsaAAAAJoAAOxpAADsaQAAAXsAAOxqAADsagAAAaAAAOxrAADsawAAATUAAOxsAADsbAAAAMcAAOxtAADsbQAAAMkAAOxuAADsbgAAAMgAAOxvAADsbwAAAMoAAOxwAADscAAAAZEAAOxxAADscQAAAdAAAPEBAADxAQAAAM0AAPECAADxAgAAAfIAAPEDAADxAwAAAf0AAAAAAEoAggCqARABZgGeAeoCNgKCAs4C9gMeA0YDbAOSA7gD3gQmBE4EjgSsBPwFZAWuBgQGbAbIBw4HDgdKB6AH0AhGCOAJTgnKCf4KeAsAC3QMCAyaDQAN2g7ID4gPxg/mEGgQiBCoEMgQ6BGUEcoR+hISElQSehKgEvwTLhNGE24TlBQkFJIVOhWkFdIWPBamFuYXaBfYGCoY0hkmGZAZuBpMGqobnhwOHKwc8B0qHageDB5eHu4fmiB0ISYh8iLGI2QkICToJYImLiZyJtYnGCdCJ1on7igyKOIpbin6KkAqfCquKtYq9CsOKzYrVCuKLAIsrizeLS4tvi4eLnQu4i9UL5wvzDAUMEoweDDKMQwxTjGeMcwybjLcMygzjDPKNBw0XDSYNRg1WDWoNhI2cjaqNxY3zDiaONY5ODlkOcw6EjpeOrI7ejvgPBg8hDzwPVw9tD4uPqo/Ij+MQDhAlkEGQXBB3EJSQo5C3kMWQ1JDfkPsRCJEWESORPxFgkXgRiRGlEd0R+BITEjESYBKHErASyxLYEviTCpMrE0cTahORE7WT0hP2lBGUMJRPFGgUgJSZFMCU3ZTtlRWVNRVWFW+ViZWUlbEVwBXbFfsWD5Y5FkUWWBZvFoSWoZa5ltCW3RbtFv8XGpcvF2eXgheQF5qXsBfLl9aX8pgEGBUYJZhBmGGYe5iSGJyYppizmMsY2ZjsGPiZBBkRGR0ZJ5k6GUcZURljmXCZexmFGaOZxRnmGfwaMxpIml2adhqIGryayxrZmvCbD5sZmy8bQptXm26bfpuNm5cboJuum70b0hv0HAccHpwtnDqcSBxZHG4cg5ygnLgc2xztnQEdGB08nVgddZ2CHZmdqZ3hnf0eHJ4xHkkech6Tnq+eyZ7Wnuee+p8aHzEfR59bn2yffx+Pn58fsJ/Gn+cf8p//oBAgPqBYoGwgjKC4oNyhAqEPIR6hLKFcIW4hhSGmIbOhuaHQIhQiOKJFImgiiCKlIsEi36L3Iw4jJSM4I04jbyOhI8Ej3CP2pAckGqQ4pE+kZqR9JJckuiTYpPglESUspUelYKVvJZ0ltKXCpdql5aYHJmymlabNpucnBicgJzKnRSdVJ22nkaevJ9EoA6gQqB2oV6hoKHSohiiWKKyoxSjXqO8pCikxKUWpYKmEqZSpsKnBKeSqBComKj2qVapqKoyqpaq+KtAq5qr6qyArQStcq3IrhCuaK7qr16v8rB6snqy7rSatP61IrWOtea2LrbktyC3WLe4t+64TrjquVK5cLmMuai5xrnoukS6oLsSu5S8RrycvSy+Fr64vzDAAMBmwOrBSMGqwhLCWMLgwyTDZsP+xEzEvsT2xaDGAMa4xxLHjsgIyGbIsAAAAAQAAAAAARoBGgAMABkAJwAwAAATIg4BFB4BMj4BNC4BBzQ+ATIeARQOASIuARcyNjU0JisBIgYVFBYzNTI2NCYiBhQWlh8zHh4zPjMfHzOiIzxIPCMjPEg8I4McJg4JVgkOJhwPFBQeFBQBBx8zPjMeHjM+Mx9xJDwjIzxIPCMjPCwgGQoNDQoZIF4VHRQUHRUAAAACAAAAAAEaARoADAAjAAA3FA4BIi4BND4BMh4BNyIOAQczPgEzMh4BFRQGBxU+AjQuAbwXJy4nFhYnLicXCRUlFwMUAyQZEh4SIRgVIhQWJ2cXJxYWJy4nFxcnmxQiFRghEh4SGSQDFAMXJSwnFgAAAQAAAAABBwEaABsAABM0JiIGHQEjIgYUFjsBFRQWMjY9ATMyNjQmKwGWBQgGZwQFBQRnBggFZwQGBgRnARAEBQUEZwYIBWcEBQUEZwUIBgABAAAAAAEoARoARQAANyMiJjQ2OwEyNj8BNjQvASYnIgYPAQ4BIyImLwEmND8BPgE7ATIWFAYrASIGDwEGFB8BFhcyNj8BPgEzMhYfARYUDwEOAcwtBAUFBC0FCQI3AgI4BAkFCAJAAxMLCRAFNwUFNgUSCi0EBQUELQUJAjcCAjgECQUIAkADEwsJEAU3BQU2BRITBQgGBQReBAoEYAcBBwXQCw0JCF8JFAleCAoFCAUGBF4ECgRgBwEHBdALDQkIXwkUCV0JCgAAAAAEAAAAAAEaAQcACwAjADMAPQAANyIGHgE7ATI2NCYjJzQ2OwEyFh0BFAYHFRYGJyMiJj0BLgE1NyIGBxUeATsBMjY9ATQmIwcVFBY7ATI2PQF6BAYBBQQ4BAYGBJ8QDM4MEAoJARwThBMbCQocBAUBAQUEzgQGBgTFEQuECxGWBQgGBggFVAwREQwSCQ8DaRMcARsTaQMPCRwGBBIEBgYEEgQGOGgLERELaAAAAQAAAAABGgDPACMAADcmND8BNjIWFA8BMycmNDYyHwEWFA8BBiImND8BIxcWFAYiJxUCAjkCCAYDKMYoAwYIAjkCAjkCCAYDKMYoAwYIAoYDCAI5AgUIAygoAwgFAjkCCAM4AwUIAygoAwgFAwAAAAMAAAAAARoBGgAXACQAMQAANxcWMj8BNjQmIg8BNTQmIgYdAScmIgYUFyIuATQ+ATIeARQOAScUHgEyPgE0LgEiDgFgLwMIAy8CBQgDHwUIBR8DCAU4JDwjIzxIPCMjPJQeMz4zHx8zPjMehi8DAy8DCAUDH1oEBgYEWh8DBQh2IzxIPCMjPEg8I4MfMx4eMz4zHx8zAAAAAwAAAAABGgEaABcAJAAxAAA3JyY0PwE2MhYUDwEzMhYUBisBFxYUBiInFB4BMj4BNC4BIg4BFwYuAj4BMh4BFA4Bhi8DAy8DCAUDH1oEBgYEWh8DBQh2IzxIPCMjPEg8I4MfMx4BHzM+Mx8fM2AvAwgDLwIFCAMfBQgFHwMIBTgkPCMjPEg8IyM8lAEfMz4zHx8zPjMeAAADAAAAAAEaARoAFwAkADEAAD8BNjQvASYiBhQfASMiBhQWOwEHBhQWMjcUDgEiLgE0PgEyHgEHMj4BNC4BIg4BFB4Bpi8DAy8DCAUDH1oEBgYEWh8DBQh2IzxIPCMjPEg8I4MfMx8fMz4zHh4zYC8DCAMvAgUIAx8FCAUfAwgFOCQ8IyM8SDwjIzyUHjM+Mx8fMz4zHgAAAAMAAAAAARoBGgAXACQAMQAAPwE2Mh8BFhQGIi8BFRQGIiY9AQcGIiY0NyIOARQeATI+ATQuAQcmPgEyHgEUDgIuAWAvAwgDLwIFCAMfBQgFHwMIBTgkPCMjPEg8IyM8lAEfMz4zHx8zPjMepi8DAy8DCAUDH1oEBgYEWh8DBQh2IzxIPCMjPEg8I4MfMx8fMz4zHgEfMwAAAQAAAAAA9AEHABcAADc0JiIGHQEnJiIGFB8BFjI/ATY0JiIPAZ8FCAVEAwgGA1QDCANUAwYIA0T9BAYGBLZMAwUIA10DA10DCAUDTAAAAAABAAAAAAEHAPQAFwAANzI2NCYrATc2NCYiDwEGFB8BFjI2NC8B/QQGBgS2TAMFCANdAwNdAwgFA0yNBQgFRAMIBgNUAwgDVAMGCANEAAAAAAEAAAAAAQcA9AAXAAA3IgYeATsBBwYUFjI/ATY0LwEmIgYUHwEvBAYBBQS2TAMFCANdBARdAwgFA0yfBQgFRAMIBgNUAwgDVAMGCANEAAAAAQAAAAAAvADiABcAADcHBiIvASY0NjIfATU0NjIWHQE3NjIWFLkmAggDJQMFCAMVBggFFQMIBoYmAgImAwgFAxVaBAUFBFoVAwUIAAEAAAAAAM8AzwAXAAA3JyY0PwE2MhYUDwEzMhYUBisBFxYUBiJzJQMDJQMIBQMVWgQFBQRaFQMFCHMmAggDJQMFCAMVBggFFQMIBgABAAAAAADPAM8AFwAAPwE2NC8BJiIGFB8BIyIGFBY7AQcGFBYypiYCAiYDCAUDFVoEBQUEWhUDBQhzJgIIAyUDBQgDFQYIBRUDCAYAAQAAAAAAvADiABcAADcnJiIPAQYUFjI/ARUUFjI2PQEXFjI2NLkmAggDJQMFCAMVBggFFQMIBrklAwMlAwgFAxVaBAUFBFoVAwUIAAIAAAAAAQcBEAAXAC8AABMmIgYUHwEjIgYUFjsBBwYUFjI/ATY0Jwc2NCYiDwEGFB8BFjI2NC8BMzI2NCYrAdUDCAUDHrcEBQUEtx4DBQgDLwMDoAMFCAMvAwMvAwgFAx63BAYGBLcBDQMGBwMfBQgGHwIIBgMvAwgCYQIIBgMvAwgCLwMGBwMfBQgGAAAAAAEAAAAAAPQBBwAXAAA3FBYyNj0BFxYyNjQvASYiDwEGFBYyPwGNBQgFRAMIBgNUAwgDVAMGCANELwQFBQS2TAMFCANdBARdAwgFA0wAAAAAAQAAAAAA9AEHACkAADcUFjI/ATYyFhQPAQYiJjQ/ATY0JiIPAQYUFjI/AT4BNTQuASMiBg8BBisFCANWDicbDmMGDwsFZAMGCANjCxYfC2QJChIeEg0YCVYDlgMGA1YOHCcNZAULDwZjAwgFAmQLHxYLYwoYDRIeEQkKVgMAAAACAAAAAAEaARoABwAPAAAlFQcnFScXNRcnFQ8BFRc1ARlBZjqoAV5WGiXooDUlJUsNkAE5JRohSxFhAAADAAAAAAEiARoAGwAmADQAACUnLgEHIyIGDwEGHgI7ATI2PwEXFjsBMj4CByIvATM3FxwBDgEzIzYvATMeARUXFg4CASBLAgoHWAYKAkwCAgUJBTcFCgIMOAUGWAQJBQJrAgJsORQqAgRWRQICTEUCBEwBAQICLOEFCAEHBeEFCQgDBwYhKwMEBwkIAVA0fQEDAwEGB+EBAgLhAQMCAgAABAAAAAABLQEaAAwAFQAeAEgAADcyHgEUDgEiLgE0PgEHFjMyPgE1NC8BIg4BFRQXNyYnMhYUBisBFQYHNSMVFA8BMwYHIwcGFjsBFhcjIi4BPwE2PQEjIiY0NjPYFyYXFyYuJxcXJxESFhEfEQ00Eh4SDVwSDAQFBQQTCQlMCgwbAwEhFwIFBjoFB0YLDwQFLQgTBAUFBKkXJy4mFxcmLicXiQ0RHxEWEhoSHhIVElwNgwUIBUwBAk9YFhIWCgkrBAoKCA0TCVQOEVgFCAUAAAMAAAAAAQkBGgAdACcAMQAAEzIWFAYrARUUHwEWDgErASIuAT8BNj0BIyImNDYzFxUUDwEzJyY9ARcjBwYWOwE+ASfhBAUFBBMILQUEDwuoCw8EBS0IEwQFBQQlCgx4DAogjBcCBQaoBgUCARkFCAVYEQ5UCRMNDRMJVA4RWAUIBRJYFhIWFhIWWKkrBAoBCQQAAAADAAAAAAEaARoAKgAyADsAADc1BiMVFB8BIzc2PQE0PgEzMhc2NyYjIg4BHQEHBhY7ARQWMjYnMzI2LwEHIiY1MxQGIzcUBiImNDYyFvQJCgENsg0BFCMUBQUFCAwLGSsaEgIGBUEWIBYBQgUGAhJeCAsmCwiDIS4hIS4hciYCJQICIiICAksUIhUBCQgCGSsZSi0ECQ8WFg8JBC1MCggIC7wXISEuISEAAAAABgAAAAABGgEaABoAIgAqADAAPABFAAATJiIGFB8BBh0BBwYWOwEUFjI2NTMXFjI2NC8BIiY1MxQGIyc3Nj0BNDcXNxUXJzUyLwE+ATMyFwYHJyIGFzQ2MhYUBiImIwMIBQMqCBICBgVBFiAVKyMDCAUCgQgLJgsIWQ0BA4YgDB8JiA0NIRMKDAYGCg8aPCEuISEuIQEXAgUIAyoREkotBAkPFhYPIgMFCAMDCggICyYiAgJLCguGTiceHyNcDQwOAwYLAQsaFyEhLiEhAAAAAAQAAAAAARoBGgATADAANgA+AAA3Jz4BMzIeAR0BFyc1NC4BIyIGBxcGIi8BIxQGIiY1IyImPwE1NDcnJjQ2Mh8BFhQHJyMUFj4BNycGHQEUDwFiDQ0hExkrGgwfFCMUDxoLtQMIAyMrFSAWQQUGAhIIKwIFCAPzAwNtJgsQCyuGAwEN8g0MDhkrGUoeH0kUIhUMCd0CAiMPFhYPCAUtShIRKgMIBQPzAwgDIwgLAQobhgsLSgICIgADAAAAAAEIARoAFwAfAC8AACUnNTQuASIOAR0BBwYWOwEUFjI2JzMyNgciJjUzFAYjJzc2PQE0PgEyHgEdARQfAQEGEhorMisaEgIGBUEWIBYBQgUGcggLJgsIWQ0BFCMoIxQBDUUtSRorGRkrGkktBAkPFhYPCBoKCAgLJiICAksUIhUVIhRLAgIiAAMAAAAAAOUBBwAYACAAKAAANzQ2OwEyFhUUBgcWFxYVFAcGBwYrASImNTcVMzI2NCYjJzMyNjQmKwFLDAk4HSMIBQ0FCAsKEQ4QQQkMJi0KEhIKLSkMEA8LK/IIDSQcDRwICgkLERcQDgcFDAhJOA8aDyYQFxEAAAMAAAAAARoBBwAdAC0APQAAEyIGHQEUFjsBFjY3HgE7AT4BPQE0JisBIgYHLgEjFxUUBisBIiY9AT4BOwEyFhc1NDY7ATIWHQEUBisBIiYvDBAQDEILEwcHEwtCDBAQDEEMEwcHEwwdEQtCBAYBBQRCCxESEQtCBAYGBEEMEQEHEQyoDBABCwgICwEQDKgMEQsICAsvhAsRBgSoBAYRj4QLEQYEqAQGEQAAAAACAAAAAAD0AQcAEAAeAAA3BiY9ATQ2OwE2Fh0BFAYvATc1LgErASIGHQE3Nh8BRwUKFhBwEBYKBU9LAQsHcAgLRgUFRicDBQayDxYBFhCyBgUDNYUCBwoLCKEvAwMvAAADAAAAAAEaAQcAIABLAFQAADc0NjM2Fh0BFBYXFhQHBgcVJiM2NzY3LgE9ATQmIyImNQc2PQE0NjMyNjQmIyYGHQEUBgcGFBceAR0BFBYzFjY0JiMiJj0BNCYnNjcXIgYUFjI2NCbFBQQQFgQJBQUJAwoJAQEDBQUGCwgEBX0DCwgEBQUEEBYECQUFCQQWEAQFBQQICwYFBQOZFyEhLiEh/QQFARYQJg4KBQIMAgUGAgIEAwcFBQ4RJwgLBQRbBxEnCAsFCAUBFhAmDgoFAgwCBQoPJRAVAQYIBQsIJxEOBQUHMSEvISEvIQAAAAQAAAAAARoBBwAIACQARABuAAA3IgYUFjI2NCYXFhQGIi8BBwYiJjQ/AScmNDYyHwE3NjIWFA8BJzQ2MzYWHQEUFhcWFAcGBxUmIzY3NjcuAT0BNCYjIiYHHgEdARQWMzIWFAYjIiY9ATQmJyY0Nz4BPQE0NjMyFhQGIyIGHQEUBgfhFyEhLiEhBQIFCAMODgMIBQIPDwIFCAMODgMIBQIPKQUEEBYECQUFCQMKCQEBAwUFBgsIBAWFBQYLCAQFBQQQFgQJBQUJBBYQBAUFBAgLBgVxIS8hIS8hRwMIBQMODgMFCAMODwIIBgMODgMGCAIPxQQFARYQJg4KBQIMAgUGAgIEAwcFBQ4RJwgLBWMFDhEnCAsFCAYWECUPCgUCDAIFCg4mEBUFCAULCCcRDgUAAAAABAAAAAABGgEaABkAJAA8AFYAADc1NDY7ATIWHQEzMhYdARQGKwEiJj0BNDYzNxUzNS4BKwEiBhUHFRQWOwEyNj0BBisBFRQGKwEiJj0BIyI3NTQ2OwEyFh0BMzI2PQE0JisBIgYdAR4BM14QDDgMECYPFhYPvA8WFg85SwEFBDgEBkoKCLwICw0QQQYEEgQGQRBRBgQSBAZBDBELCLwICwEQDOEcDBAQDBwWD4QPFhYPhA8WHBwcBAYGBINCCAoKCEIJCgQFBQQKEgoEBQUEChELHQcLCwgcCxEAAAUAAAAAAR4A9gARACMANgBJAFIAADcGFBcWFAYiJy4BNDY3NjIWFDcmIgYUFxYUBwYUFjI3PgE0Jic2NCYiBw4BFhcWMjY0Jy4BNj8BJiIGFBceAQYHBhQWMjc+ASYnByIGFBYyNjQmaBQUAgUIAwwMDAwDCAVoAwgFAhQUAgUIAwwMDJgDBQgDGRISGQMIBQMVDw8VrQMIBQMVDw8VAwUIAxkSEhldCAsLEAsLxBM2EwMIBQIMHyIfDAIFCAsCBQgDEzYTAwgFAgwfIh8gAggGAxlERBkDBggCFjo6Fg0DBggCFjo6FgIIBgMZREQZSgsQCwsQCwAAAwAAAAABGgEaAA8AFwAiAAATIgYdARQWOwEyNj0BNCYjBzQ2OwE2FhUHMxUUBisBLgE9AUsXISEXlhchIRe7FRCWEBbh4RYQlhAWARkhF5YXISEXlhchOBAVARYQE4MQFgEVEIMAAAADAAAAAAEaARoAQABIAFgAACUjNTQnNzY0JiIPASYjNCYiBhUiBycmIgYUHwEGHQEjIgYUFjsBFBcHBhQWMj8BFjI3FxYyNjQvATY1MzI2NCYjJzIWFSM0NjMXFA4BIi4BPQE0NjsBMhYVARAcBRUCBQgDFQkKIS4hCgkVAwgFAhUFHAQFBQQcFSADBgcDIRpCGiEDBwYDIBUcBAUFBHoQFUoVEEsUIygjFAsIcAgLliYKCRUCCAYDFQUXISEXBRUDBggCFQkKJgUIBiEaIQIIBgMhFRUhAwYIAiEaIQYIBXEWEBAVgxQjFBQjFDkHCwsHAAAABwAAAAABGgEsABcAMwA8AEUATgBYAGEAAD8BNjQmIg8BNTQmIgYdAScmIgYUHwEWMhcUBisBIiY9ATQ2MhYXFRQWOwEyNj0BNDYyFhUHMjY0JiIGFBYzMjY0JiIGFBYHMjY0JiIGFBYzMjY0JiIGFBYzNzI2NCYiBhQWnSUDBgcDFgUIBRYDBwYDJQMIfxsUqBQbBQgFARAMqAwRBQgFzggLCxALC1MICwsQCwsdBwsLDwsLUwcLCw8LCwcmCAsLEAsLviYCCAYDFUcEBQUERxUDBggCJgN5FBsbFHAEBgYEcAwQEAxwBAYGBEEKEAsLEAoKEAsLEAo5CxALCxALCxALCxALOQoQCwsQCgAAAAAIAAAAAAEaARoADwAZACEAKgAzADwARQBPAAATIyIGHQEUFjsBMjY9ATQmFxQGKwEiJj0BMyc0NjsBMhYVBzQ2HgEOASImNzQ2HgEUBiImJzQ2MhYOASImNzQ2MhYUBiImNyY2MhYUBiImNeGWFyEhF5YXISEPFhCWEBXh4RUQlhAWvAsQCwEKEAs4CxALCxALOAsQCwEKEAs4CxALCxALOQELEAsLEAsBGSEXlhchIReWFyHOEBUVEIMTEBYWEIMICwEKEAsLCAgLAQoQCwtACAsLEAsLCAgLCxALCwgICwsQCwsIAAAAAwAAAAABBwEJABgAOQBgAAABFhQPATMyFhQGKwEiJj0BNDYyFhcVNzYyBzYWHwEWBg8BFx4BHwE3NhYfARYUDwEOAScmJyYnJjY3FwYHJy4BLwE3ByY/ATYvAS4BDwEOARceARcWNj8BNjQvASYPASInAQQDAzshBAYGBDgEBQUIBQE6AwivDBgFCwQCBRIBAwoIAxwHDgUPCQoGECwRIxQWCAMWFDsDAwgKDQMCCQkBAxQEAwsCCgUFDg8CByYhCx4LBgQEDwMFIQQDAQQDCAM7BQgFBQQ4BAYGBCE7AgIFCgsXCBAGFgUKEgcDBQEEBRAKGwoFDwQOHSAiMxQjB44EBAcKFQ0LAgEEAxkEBhcFBAICBRgNMDsbCgMLBQQMBBADAQYCAAADAAAAAAEHAQkAGAA5AGAAADc0NjsBMhYdARQOASY9AQcGIiY0PwEjIiYnNhYfARYGDwEXHgEfATc2Fh8BFhQPAQ4BJyYnJicmNjcXBjEnLgEvATcHJj8BNi8BLgEPAQ4BFx4BFxY2PwE2NC8BJg8BIie8BQQ4BAYGCAU7AwgFAjshBAVqDBgFCwQCBRIBAwoIAxwHDgUPCQoGECwRIxQWCAMWFDsGCAoNAwIJCQEDFAQDCwIKBQUODwIHJiELHgsGBAQPAwUhBAP9BAYGBDgEBQEGBCE7AgUIAzsFCwUKCxcIEAYWBQoSBwMFAQQFEAobCgUPBA4dICIzFCMHjggHChUNCwIBBAMZBAYXBQQCAgUYDTA7GwoDCwUEDAQQAwEGAgAABAAAAAABBwD0ABMAFgA2AEIAADc2Mh8BFgYPASImLwEjBw4BLgE/ATMnFx4BHQEUBgcjIiY9AQYiJjQ+ARc0JiMmBwYuATY3Nh8BJgcOARQWMzI/ATVLAg4COQEEAwMDBQERPREBBwgDASkxGYoTFQQEAQMGEyEXFSQSCwwRCAMIBAEDDBYVDw8LDAwKDRMD7QYGqAQHAQEEAzExBAQDBwQ+Sh4BFBFIAwUBBQMDCxciFgUFCgsBBQMCBggCCQE7BAIBCxQLDAIaAAAABQAAAAABLQEtAB4APgBwAH0AmQAANxYXBwYuAT0BIyImPQE0NjsBBhQXIyIGHQEUFjsBFTcGDwEOAQ8BDgEdARYXNzY/AT4BNCYvATEuAS8BLgEiJx8BHgEfAR4BMzEyPwI+AT8BMjY0JiMnJi8BJi8BLgErASIGDwEGDwEGDwEOARQWMxcUDgEiLgE0PgEyHgEHNzY0JiIPAScmIgYUHwEHBhQWMj8BFxYyNjQncQEEHwYPChwMEBAMfAICfAQFBQQvuQEBBAEIBQwBAhoWAwQGCwECAgEMBQgCAwECA1gOBQQHAgUBAwICAQIFAgoGDwICAgIPBAQDBQMEAQMBAQEDAQUCBQEEBg4CAgICfxcmLicXFycuJhdHFQMFCAMVFgMHBgMVFQMGBwMWFQMIBQNJCwobBQEKCCQQDIMMEQUKBAYEgwQFN7kBAQwFCAEEAQIBAQIPBAQBBAECAwIBBAEIBQwBAhcFAgIHBhACAgECDwcKAgUDBAMFAgIDBQcOAgICAg4HBQEEAgQBAwQDpBcmFxcmLicXFycXFgMHBgMVFQMGBwMWFQMIBQMVFQMFCAMAAAYAAAAAAS0BLQAeAEwAfgCRAJwAqAAANw8BBi4BPQEjIiY9ATQ2OwEGFBcjIgYdARQWOwEVPwEGDwEOAQ8BDgEdARYfAR4BHwEeATsBMjY/AT4BPwE+ATQmLwExLgEvAS4BIgcnHwEeAR8BHgEzMTI/Aj4BPwEyNjQmIycmLwEmLwEuASsBIgYPAQYPAQYPAQ4BFBYzFxYUDgErASIuATQ/AT4BMhYfASc0JiIOAR4CPgE1NCYiBh0BFBYyNjWSECsGDwocDBAQDHwCAnwEBQUELz57AQEEAQgFDAECBgQFBQgCAwECAQEBAgEEAQgGCwECAgEMBQgCAwECAwFXDgUEBwIFAQMCAgECBQIKBg8BAwMBDwQEAwUDBAEDAQEBAwEFAgUBBAYOAgICAn0CBQkFgwUIBgJCAgkLCQJCSQUHBQIBBAYFAwUIBgYHBl4fJgUBCggkEAyDDBEFCgQGBIMEBTc3ggEBDAUIAQQBAgECAQMCAggFDAECAgEMBQgBBAECAwIBBAEIBQwBAgEYBQICBwYQAgIBAg8HCgIFAwQDBQICAwUHDgICAgIOBwUBBAIEAQMEA90ECggFBQgKBIMFBgYFgwEEBgQFBQUBAwRhBAUFBDgEBgYEAAAAAwAAAAABLQEsADEAXQCIAAABMzIWFAYjBw4BDwIGIzEiJi8BLgEvAiImNDY/ATY/ATY/AT4BOwEyFh8BFh8BFh8BJxUuAS8BLgEiBg8BDgEPAQ4BFBYfAR4BHwEeATsBMjY/AT4BPwE+ATQmLwEjIgYdARQWOwEVFB4BPwEzMjY1JyInJicVFAYrAQc1IyImPQE0NjsBJjQBAgEBAwMBDwYKAgUCAgECAwEFAgcEAxACAgICDgYEAQUCBQEDAQEBAwEEAwUDBAQ1DAUIAgMBAgMCAQQBCAUMAQICAQsGCAEEAQIBAQECAQQBCAYLAQICAZF8DBAQDBwKDwY5WgwRAQcGAwIGBGE+LwQFBQR8AgECAwQDBQIKBw8CAQICEAYHAgIFAwQDAQQCBAEFBw4CAgICDgcFAwICRwQBAggFDAECAgEMBQgCAwECAwIBBAEIBgsBAgIBCwYIAQQBAgMCAUYQDIMMECQICgEFMhAMHAQDAyYEBTc3BQSDBAYECgAAAwAAAAABIwDrAAgAEwAmAAA3JiIPARc3NjQHJiIGFB8BFjI/ARciLwEmNDYyHwE3NjIWFA8BBiPoAwgDXA1dAscDCAUDOAIIAwcrBAM4AwUIAzKGAggGA40DA+gCAl0NXAMIUgMFCAM4AwMGCQM4AwgFAzGGAgUIA4wDAAEAAAAAARAA9AAQAAAlNjIWFA8BBiIvASY0NjIfAQEAAwgFA58DCANBAwYHAzvxAwYIApYDA0EDCAUCPAAAAAAGAAAAAAEaAQcAEQAdAC8AOwBNAFkAABMWFA8BBiIvASY0NjIfATc2MhcjIiY0NjsBMhYUBgcWFA8BBiIvASY0NjIfATc2MhcjIiY0NjsBMhYUBicWFA8BBiIvASY0NjIfATc2MhcjIiY0NjsBMhYUBlsDAyUDCAMSAwUIAwwfAgi4lgQFBQSWBAUFuQMDJQMIAxIDBQgDDB8CCLiWBAUFBJYEBQW5AwMlAwgDEgMFCAMMHwIIuJYEBQUElgQFBQEEAwgCJgMDEwIIBgMMHwMmBQgGBggFhgMIAiYCAhMDCAUDDB8DJgYIBQUIBncCCAMlAwMSAwgFAgweAyUFCAUFCAUAAAEAAAAAAPQAxQARAAA3NjIfATc2MhYUDwEGIi8BJjQ7AwgCTk4CCAYDVAMIA1QDwgMDTk4DBgcDVQICVQMHAAABAAAAAADFAPQAEQAANxYUDwEXFhQGIi8BJjQ/ATYywgMDTk4DBgcDVQICVQMH8QMIAk5OAggGA1QDCANUAwAAAQAAAAAAzwD0ABEAADcGFB8BBwYUFjI/ATY0LwEmImoDA05OAwYHA1UCAlUDB/EDCAJOTgIIBgNUAwgDVAMAAAEAAAAAAPQAzwARAAA3FjI/ARcWMjY0LwEmIg8BBhQ7AwgCTk4CCAYDVAMIA1QDagMDTk4DBgcDVQICVQMHAAAEAAAAAAEaARoAZwB3AIAAiQAAJTI2NCYrATUzMjY0JisBNCYjNTQmIgYdASM1NCYiBh0BIzUuASIGHQEiBhUjIgYUFjsBFSMiBhQWOwEVIyIGFBY7ARQWMxUUFjI2PQEzFRQWMjY9ATMVBhYyNj0BMjY1MzI2NCYrATUHFAYrASImPQE0NjsBMhYVByImNDYyFhQGJyIGFBYyNjQmARAEBQUEHBwEBQUEHBYQBQgFHQUIBRwBBQgFEBYcBAUFBBwcBAUFBBwcBAUFBBwWEAUIBR0FCAUdAQYIBRAWHAQFBQQcEwsIcAgLCwhwCAtLExwcJhwcEwwQEBgQEI0FCAUdBQgFEBYcBAUFBBwcBAUFBBwcBAUFBBwWEAUIBR0FCAUcBggFEBYcBAUFBBwcBAUFBBwcBAUFBBwWEAUIBR0vCAsLCHAICwsIZxwmHBwmHEsQGBAQGBAAAAEAAAAAAP4A/gAhAAA/ATYyHwE3NjIWFA8BFxYUDwEGIi8BBwYiJjQ/AScmND8BMQECBwNYVwMIBQNXVwMCAQIHA1hXAwgFA1dXAwIB+QEDAlhXAwUIA1dXAwYDAQMCWFcDBQgDV1cDBgMBAAIAAAAAAQcBBwAPAB8AADc0NhczNhYHFRYGJyMiJjU3IgYdARQWOwEyNj0BNCYjJhsThBMcAQEcE4QTGy4LERELhAsREQvYExwBARwThBMcARsToBELhAsREQuECxEAAAEAAAAAAPQAoAAMAAA3NDY7ATIWFAYrASImOAYEqAQGBgSoBAaWBAUFCAUFAAAAAAMAAAAAAPQA9AAPAB8ALwAANz4BOwEyFh0BFAYHNTQmIwczMhYdARQGKwEiJj0BNDYXIgYdARQWOwEyNj0BNCYjXwMPCUEYIQsIFhBnXgwQEAxeCxERCwQFBQReBAYGBOEICyEXQgkPA10PFhMQDF4LERELXgwQEgYEXgQFBQReBAYAAAEAAAAAAOIA4QAYAAA3Mh4EFA4EIi4END4ElgoUEA4KBQUKDhAUFBQQDgoFBQoOEBThBQoOEBQUFBAOCgUFCg4QFBQUEA4KBQAAAAABAAAAAAEaARoAGAAAEzIeBBQOBCIuBDQ+BJYSIh0YEQkJERgdIiQiHRgRCQkRGB0iARkJERgdIiQiHRgRCQkRGB0iJCIdGBEJAAAAAgAAAAABGgEaAC0ARgAAEzEuAQc5AQ4CBzEOARQeBDI2NzE+Ajc5ATY0JzEmJzEmJyMxJicxJicXDgMiLgQ0PgQyHgQUBrQPHg8OGRUHBwgIDhUZHR8cDQwVDgQFBQQHBwoBCgwNDlMIGB0iJCIdGBEJCREYHSIkIh0YEQkJAQIEAQUEDhUMDRwgHBkVDggHCAcVGQ4PHg8ODQwKCwcHBK4PGBEJCREYHSIkIh0YEQkJERgdIiQiAAMAAAAAAR4BHgAHAA8AHAAANy4BDgIWFzcHHgE+AiYnPgEeAg4CLgI23xY4NikQDBKsnxY4NikQDMUZREQyEhIyREQyEhLsEgwQKTY4FpKfEgwQKTY4KhkSEjJERDISEjJERAABAAAAAAC8ALwACwAANxQOAS4CPgEzMha7DBUWEQQJEwsQFZYLEwkEERYVDRYAAAACAAAAAAC8ALwACgAXAAA3DgEuAj4BMhYUFzY1NCYjIg4BHgI2pgQKCwgCBAkOCwwGFRALEwkEERYVjAUEAggLCgcLDg8KCxAWDRUWEQQJAAIAAAAAAOEA4QAMABUAADcyPgE0LgEiDgEUHgE3FAYiJjQ2MhaWFCMUFCMoIxQUI0UdKB0dKB1LFCMoIxQUIygjFEsUHR0oHR0AAAAFAAAAAAEaARoADwAYAFoAYwBsAAATIyIGHQEUFjsBMjY9ATQmBxQGIiY0NjIWFyM1NDY7AR4BMzI2NCYjIgYHIyIGHQEjIiY9ATQ2OwEVDgEVFBYyNjU0Jic1MzIWHQEjLgEjIgYUFjMyNjczFRQGJzQ2MhYUBiImNRQGIiY0NjIW6qgUGxsUqBQbG40GCAUFCAZ5eQUEMAMPCQwQEAwJDwMwDBAcDBAQDBwJChAYEAoIeQwROgMPCQwQEAwJDwM6EToFCAUFCAUGCAUFCAYBGRsUqBQbGxSoFBtnBAUFCAYGkC4EBgkKEBgQCggRDC4QDKgMEToDDwkMEBAMCQ8DOhEMLggKEBgQCglnDBBBBAYGCAUFTwQFBQgGBgAAAAAF//8AAAEHARoACwAXACMAQABMAAA3MhYUBisBIiY0NjM3MhYUBisBIiY0NjM3MhYUBisBIiY0NjMnMhYUDwEXFhQGIi8BBwYiJjQ/AScmNDYyHwE3NhcyFhQGKwEiJjQ2M/0EBgYEzgQFBQTOBAYGBM4EBQUEzgQGBgRwBAYGBCYEBgMoKAMGCAMoKAMIBQMoKAMFCAMoKAOaBAYGBHAEBgYESwYHBgYHBjgFCAYGCAU4BQgFBQgFXgUIAygoAwgFAikpAgUIAygoAwgFAikpAiUGCAUFCAYAAAAABAAA//8BLQEaADAAPABaAHgAABM+ATsBMhYXMzIWHQEHBgcnNTQmKwEOASsBIiYnIyIGHQEUFjsBFRQXIyImPQE0NjsBIgYeATsBMjYuASMXNjQmLwEuASIPAQ4BFB4BNj8BFRQWMjY9ARceATYHBhQWHwEeATI/AT4BNC4BBg8BNTQmIgYdAScuAQZfAw8JOAkPAwsLEQUIBAIFBAsDDwk4CQ8DCwQFBQRCAkQLERELJgQGAQUEOAQGAQUELQIBAiUCAwYCJgECAwYFAhYFCAYVAgYFDgICASUCAwYDJQIBAwUGAhUGCAUWAgUGAQYJCgoJEAxWAgUJAmQEBgkKCgkGBLsEBgkFBBAMuwwQBQgFBQgFpAIFAwIlAgEDJQIDBQQDAQIWWgQFBQRaFgIBAywCBQMCJQIBAyUCAwUEAwECFloEBQUEWhYCAQMAAAAABAAAAAABGgEaABsALAA8AEwAADcHFxYUBiIvAQcGIiY0PwEnJjQ2Mh8BNzYyFhQ3FRQGKwEeATsBMj4BPQE0JgcjIiY9ATQ2OwEyFh0BFAYnMzI2PQE0JisBDgEdARQWuSgoAgUIAygoAwgFAygoAwUIAygoAwgFTCEYkQUSCnAVIhQKQZYPFhYPlhAWFqaWCAsLCJYICgrRKCgDCAUCKSkCBQgDKCgDCAUDKCgDBQgbkRggCQoUIhVwChKyFhCWDxYWD5YQFhMLCJYICwEKCJYICwABAAAAAADrAOsAGwAAPwE2NCYiDwEnJiIGFB8BBwYUFjI/ARcWMjY0J6NFAgUIA0REAwgFAkVFAgUIA0REAwgFApZEAwgFAkVFAgUIA0REAwgFAkVFAgUIAwAAAAMAAAAAARoBBwAgAC0ASgAANyIGFRQGKwEiBhQWOwEWFyMiLgE1NDY3PgEyFhcmJy4BFxQOASIuAT4CHgIHMR4BMzEyNj8BNjQmIg8BNTQmIgYdAScmIgYUF5YXIQYEBBIYGBIOAQMSERwQIRgDKjgpBQoKBh1xFicuJxcBFicuJxZbAgMCAgMCJQMGCAIWBQgFFgMIBQP0IRcEBhkjGAoJEBwRGCMCHCYiGgIBERWNFycWFicuJxcBFidDAQICASUDCAYDFjUEBQUENRYDBggDAAAAAwAAAAABGgEHACAALQBKAAA3IgYVFAYrASIGFBY7ARYXIyIuATU0Njc+ATIWFyYnLgEXFA4BIi4BPgIeAicHBhQWMj8BFRQWMjY9ARcWMjY0LwEuASMxIgYHlhchBgQEEhgYEg4BAxIRHBAhGAMqOCkFCgoGHXEWJy4nFwEWJy4nFlslAwUIAxYFCAUWAggGAyUCAwICAwL0IRcEBhkjGAoJEBwRGCMCHCYiGgIBERWNFycWFicuJxcBFicVJQMIBQIWNAQGBgQ0FgIFCAMlAgEBAgACAAAAAAEaAQcAGAAsAAA3IgYVFAYrASIGFBY7ATI2NCYrASImNTQmBz4BMhYXHgEVFA4BKwEiLgE1NDaWFyEGBAQSGBgSjBIZGRIEBAYhYQMqOioDGCEQHBGMERwQIfQhFwQGGSMYGCMZBgMYIS8cJiYcAiMYERwQEBwRGCMAAAgAAAAAARoBGgAPABkAIwAvADsARwBTAF8AABMjIgYdARQWOwEyNj0BNCYHNTQ2OwEVIyImNxQGKwE1MzIWFQczMjY0JisBIgYUFhcjIgYUFjsBMjY0JgcjIgYUFjsBMjY0JjcjIgYUFjsBMjY0JgcjIgYUFjsBPgE0JuqoFBsbFKgUGxvYEAwcHAwQ4REMeXkMEXo4BAUFBDgEBgZhOAQFBQQ4BAYGKTgEBgYEOAQFBSE4BAUFBDgEBgYEOAQFBQQ4BAYGARkbFKgUGxsUqBQb16gMEeEQDAwQ4REMCQUIBgYIBRMFCAUFCAVwBggFBQgGSwYIBQUIBiYFCAYBBQgFAAAABAAAAAABGgEHABcAKwA9AE4AABMjIgYdARQWOwEVFB4BPwEzMjY9ATQmIxcUBisBBzUjIiY9AT4BOwEyFgcVJwcXFhQGIi8BJjQ/ATYyFhQHFxYUDwEGIiY0PwEnJjQ2MhfqqBQbGxQJCg8FOkcUGxsUHREMTj4cDBEBEAyoDBEBhSkpAgUIAy8CAi8DCAUDaAICLwMIBQIpKQIFCAMBBhsTXhQbJAgKAQUyGxReExyNDBA3NxAMXgsREQteVygoAwgFAi8DCAIvAwUIAyICCAMvAgUIAygoAwgFAwAAAAADAAAAAAEQAPUADAAeADAAADceAQ8BDgEuAT8BPgEHHgEPARcWDgEmLwEmND8BPgEXNhYfARYUDwEOAS4BPwEnJja4AwMBSwIHBwMBSwIHYwMBAyAgAwEGBwMmAgImAweNAwcDJgICJgMHBgEDICADAfMCBwOpBAMEBwOpBAMuAggDJCQDCAUBAyoCCAIqAwEDAwEDKgIIAioDAQUIAyQkAwgAAAYAAAAAASwBLAAaADUATwBmAHAAeQAAEzIWFRQWHwEWFxYVFAYiJjU0Ji8BJicmNT4BMzIWFRQWHwEWFxYVFAYiJjU0Jic1JicmNTQ2FzQmIgYVFBcWHwEeARUUFjI2NTQnJic1LgEXMzIWFAYrAQ4BIyIuAT0BNDY7ATIWFQcVFB4BMj4BPQEXFQczMjY0JiMvBAUHCAEKBAgGCAUHCAEKBAgBBTwEBgYIAQoECAUIBgYJCgUHBUYGCAUIBAoBCAcFCAUHBQoJBksJFBsbFA0JNyMcMBsJB60HCrwXJy4mFxMBCgwQEAwBLAUEBgkGAQcGCQ0EBQUEBgkGAQcGCQ0EBQUEBgkGAQcGCQ0EBQUEBgkGAQcGCQ0EBQkEBQUEDQkGBwEGCQYEBQUEDQkGBwEGCWEcJxshKhswHEQGCgoGAkIXJxYWJxdCEy8KERcRAAQAAAAAARoBGgAQABwALAA8AAAlFRQGKwEeATsBMj4BPQE0JgcyPgEmKwEiBhQWMzcyFh0BFAYrASImPQE0NjMXNCYrAQ4BHQEUFjsBMjY1AQchGJEFEgpwFSIUCl0EBQEGBF4EBQUEehAWFhCWDxYWD6kLCJYICgoIlggL75EYIAkKFCIVcAoSSwYIBQUIBnoWD5YQFhYQlg8WJQgLAQoIlggLCwgAAAQAAAAAARoBGgAeAC0APQBPAAATIyIGHQEjIgYdARQWOwEVFBY7ATI2PQEzMjY9ATQmByImPQEmNjsBFSMiBh0BFxQGKwEGJj0BNDYXMzYWFRcUBicjNTQmKwE1NDYXMzIWFf1eCxFUDBAQDBwQDF4MEBwMEBDaBAUBBgRUHAwQgwUEXgQFBQReBAU5BgQcEAwvBQReBAYBGRAMCRELhAsRCQwQEAwvEAyDDBDOBQSEBAUTEAxnHAQFAQYEgwQGAQEGBDgEBgFBDBAvBAYBBQQAAAAAAgAAAAABGgEaAA0AFwAAEyIOAR4CPgE1NC4CBzUyHgIUDgKWKEIeDzhOSiwUJTAaFiofEhIfKgEZLEpOOBAfQigaMCUU9OERHyosKh8SAAAKAAAAAAEsARoADwATACQAKAA4ADwAQABQAFQAbQAAEyMiBh0BFBY7ATI2PQE0Jgc1Mx0BIyIGHQEUFhczPgE9ATQmIwc1MxU3MzIWHQEUBisBIiY9ATQ2FzM1IzUVMzUHIyIGHQEUFjsBMjY9ATQmBzUzFTc2Mh8BFhQPAQYiJjQ/ASMiJj4BOwEnJjRLJQgLCwglCAsLLSUlCAsLCCUICwsIJSWpJQgLCwglCAsLCCUlJc4lCAsLCCUICwstJVcDCAIdAgIdAggGAww0BAYBBQQ0DAMBGQsIJQgLCwgmBws4JiYlDAcmBwsBAQsHJgcLOCYmSwsHXggLCwheBwtwJTkmJl4LCCUICwsIJQgLOCUliQMDHAIIAxwDBgcDDAYIBQwDCAAAAAQAAAAAARoBBwAWACkANgBEAAA3NDY7ATYWHQEUBisBBwYuAT0BIyImNTciBgcVHgE7ARU3MzI2JzU2JiMHNCYrASIGFBY7ATI2BzQmKwEiBhQWOwEyNjUTGxSoFBsbFEc6BQ8KCRQbLwwQAQEQDBw+TgwRAQERDAkFBIQEBQUEhAQFJQYEXgQFBQReBAXYExsBHBNeFBsyBQEKCCQbFHoRC14MEDc3EAxeCxEvBAUFCAUFNAQFBQgGBgQABQAA//8BLAEsADEAUABqAIgAtAAANyY0Nj8BNj8BNj8BPgE7ATIWHwEWHwEWHwEyFhQGIwcOAQ8CBiMxIiYvAS4BLwIiFxYdARQGKwEVFAcGIi8BIyImPQE0NjsBFx4BOwEyNwc0JisBIgYdARQWOwEyHwE1NDY7ATI2PQExJyMiJj0BNDY7ASY0NyMiBh0BFBYzFRQWMj8BNQc1NyYvARUuAS8BLgEiBg8BDgEPAQ4BFBYfAR4BHwEeATsBMjY/AT4BPwE+ATSqAQIBDwUFAQUCBQEDAQEBAwEEAwUDBAQPAQMDAQ8GCgIGAQIBAgMBBQIIAwMRAWoEEAwJBgIFAyMiCxERC1ABAwwHAQcGDQYEXgQFBQQmBAMVBQQTBAXOEggLCwhyAgJyEBYWEAoOBi058wEBDAUIAgMBAgMCAQQBCAUMAQICAQsGCAEEAQIBAQECAQQBCAYLAQL6AQQDAQQCBAEFBw4CAgICDgcFAwICBQMEAwUCCgcPAgECAhAGBwICBW8HCDgMEB0GAgEDIxAMOAwQAwcJBQ4EBQUEOAQGAhYPBAUGBDgJCwhLCAsFCQUWEEsQFSYICwQpGTM4OwEBBAECCAUMAQICAQwFCAEEAQIDAgEEAQgGCwECAgELBggBBAECAwADAAAAAAEaAQcAKAA9AFYAACUmKwE1NCYrASIGHQEUFjMVFB4BPwEVFBY7ARceATI+AT0BMzI2PQE0DwE1IyImPQE0NjsBMhYdASMiBh0BFxQGKwEiBh0BJy4BKwEiJj0BNDY7ATIWFQERCAwJFhCWDxYWDwoOBi0RCyIjAQMEBQMJDBCaNBMHCwsHlggLQgsRhAYEEwQFFgEDAiYEBQUEXgQGoAk4DxYWD14PFhMHCwIFIQkLESICAQIEAxwRCzkLKCUlDAdeCAsLCDgRCx0cBAUFBA8VAgEFBDkEBQUEAAcAAAAAARoBBwAQABwAPQBNAFkAaQB2AAA3IiY1NDYzNhYUBiMiBhUUBhc1NCYiBh0BFBYyNhc3MzI2NCYrASIPATU0JisBIiY1NCYiBhUUFjsBFRQWMjc0JiIGFRQGIyIGFBYzMjY9ATQuAQYdAQYWMjY1NCYHIgYUFjMyFhUGFjI2JzQmKwEiBhQWOwEyNhwEBRsUBAUFBAwQBgYGCAUFCAZDOiIEBQUEJgMDOwYEEgwRBQgFGxQJCw61BQgFEQwEBQUEFBsFCAUBBggFGxQEBQUEDBEBBggFSwUEXgQFBQReBAXOBgQTGwEGCAURCwQGLxMEBgYEEwQFBYIyBQgGAzQtBAYQDAQFBQQUGyQIC2YEBQUEDBAGCAUbORMEBQEGBBMEBQU9ExwBBQgFEQsEBgYpBAUFCAUFAAACAAAAAAEaAQcAJwAwAAA3BhUxFwcGLgE9ASMiJj0BNDY7ATYWHQEmJzU0JisBIgYHFR4BOwEVNxQGIiY0NjIWmAIBLgUPCgkUGxsUqBQbCAoRDKgMEAEBEAwcuyEuISEuIVoHCAooBQEKCCQbFF4TGwEcE1wJB0wLERELXgwQNyQXISEuISEAAgAAAAABGgEHABYAKQAANzQ2OwE2Fh0BFAYrAQcGLgE9ASMiJjU3IgYdARQWOwEVNzMyNj0BNCYjExsUqBQbGxRHOgUPCgkUGy8MEBAMHD5ODBERDNgTGwEcE14UGzIFAQoIJBsUehELXgwQNzcQDF4LEQAFAAD//wEtARoADgAWADcAQABSAAA3JyYvASYOAR8BFh8BNjcnJi8BFxYfASciDgEUHgEzMjcmJwYjIi4BPgIyHgEVFAcWFzY1NC4BFyIGHgEyNjQmFwcGIi8BJjQ2Mh8BNzYyFhQHzBMKEiQHEAYEEwkTJQkQNg0HEiQNBxIlJDwjIzwkDg0EAgoLHzMfAR4zPjMfAgkIAyM8OhghASAvISEHIQMHAxMDBggCDBsCCAYDeSQTCRMEBhAHJBIKFBAJCwcNJBIHDSSoIzxIPCMDCAkCHzM+Mx4eMx8LCgIEDQ4kPCOpIC8hIS8gMCEDAxMCCAYDDBoDBggCAAAEAAD//wEsARoADwAXADcAQAAANyI1JyYvASYOAR8BFh8BNicmLwEXFh8BByIuAT4CMh4BFRQHFhc2NTQuASIOARQeATMyNyYnBhcyNjQmIg4BFs0BEwoSJAcQBgQTCRMlCSYNBxIkDQcSJR8zHwEeMz4zHwIJCAMjPEg8IyM8JA4NBAIKUxchIS8gASF4ASQTCRMEBhAHJBIKFBAUBw0kEgcNJEwfMz4zHh4zHwsKAgQNDiQ8IyM8SDwjAwgJAiUhLyAgLyEAAAQAAAAAARoBGgAPABcAJAAxAAA3Jg4BHwEWHwEWPgEvASYvARcWHwEnJicHND4BMh4BFA4BIi4BNyIOAR4CMj4BNC4BeQcQBgQTCRMkCA8GBBMJEywkDQcSJA0HcCM8SDwjIzxIPCODHzMfAR4zPjMfHzPMBAYQByQTCRMEBg8IJBMJAhIHDSQSBw0BJDwjIzxIPCMjPJQeMz4zHx8zPjMeAAAABP//AAABKwEdAD0ARwBUAGAAACU0IyYnNjU0LgEGFxYXBgcGBwYjIicHFRYXFhcWFxYXJicmJyY9AT4BNzU2NyY1NDc2NzYfATc2FxYXFhUUJyYOARQWMjY3NhcOAS4CPgIeAgYnMjY0JisBIgYUFjMBDQEMDQEPMA8DAQULChUODREUDAEFDA8QBAUEBSEfGREQAREMAgEFDRAjJhEDAxEmIxANkQgwDwwqEwIDiRErLCALCyAsKyELCycGCQkGSwUJCQW5AQcEBgcVEwUQFg0IBAYMEwYGAlAEBQcECgoHBgUPDBAOByMKGQUEBwQMEx4RFAMFEwMDEwUDFBEeDjMIBRMoDhQUFtIQCwshKywgCwsgLCsdCAwICAwIAAAABP////8BLQEeAEEASwBYAHQAADcmJyM1NxYzMjc2Nxc2NyYnJjYeARUUBxYXNjU0JyYnJg8BJyYHBgcGFRQXByMOAR0BFBceAR8BFhcWFxYXJicmLwE+ARYHDgEiJjQXIg4BFB4BMj4BNC4BFxYUBiIvAQcGIiY0PwEnJjQ2Mh8BNzYyFhQPAU8LCwEBDBQhEgYEAwwOCAIDDzAPAg4MBA0QIyYRAwMRJiMQDQUDAQ4PAwIHBwsGBwwNGh0KBRANEAgwDwMCEyoMoBcnFxcnLiYXFyYLAwUIAxUWAwcGAxUVAwYHAxYVAwgFAxU+BQZQAgUTBggFCAQKERcQBRQUCwYEBgwPHhETBAQSAwMSBAQTER4TDBAHGQ8XBgUDCQYIBAUGBgsEDhEEBrILBRAXExQOJz4XJy4mFxcmLicXagMIBQMVFQMFCAMVFgMHBgMVFQMGBwMWAAAF/////wEtAR4AQQBLAFgAeACZAAA3JicjNTcWMzI3NjcXNjcmJyY2HgEVFAcWFzY1NCcmJyYPAScmBwYHBhUUFwcjDgEdARQXHgEfARYXFhcWFyYnJi8BPgEWBw4BIiY0FyIOARQeATI+ATQuARcOASIvARUUBiImPQE0NjsBMhYUBisBFx4BNjc2MhYUNxQGKwEiJjQ2OwEnJiIGBwYiJjQ3PgEyHwE1NDYyFgcVTwsLAQEMFCESBgQDDA4IAgMPMA8CDgwEDRAjJhEDAxEmIxANBQMBDg8DAgcHCwYHDA0aHQoFEA0QCDAPAwITKgygFycXFycuJhcXJhAIFRcKBgUIBQUEHAQGBgQJAwcQDgUDCAUFBgQcBAUFBAkDBw8OBgMHBgMIFRcKBgUIBgE+BQZQAgUTBggFCAQKERcQBRQUCwYEBgwPHhETBAQSAwMSBAQTER4TDBAHGQ8XBgUDCQYIBAUGBgsEDhEEBrILBRAXExQOJz4XJy4mFxcmLicXeAgIBQICBAYGBBwEBQUIBgEDAQYGAgUIMwQFBQgFAgMFBgMGCAIJCAUDAwQGBgQcAAAABgAAAAABJgEOAC4APABLAGMAbwB7AAAlJicmJyYnNjU0JyYnJiIHBgcGFRQXBgcGBwYPARUUFxYXFhcWMjc2NzY3Nj0BNCc0NzYeARQGIyImJyY1Jz4BFxYVMRQHDgEjIiY0FwYHBiInJic1NxcWMzI/ATMXFjMyPwEXBzQmIgYdARQWPgE1NzQmIgYdARQWPgE1ASUECAkKBQMBDgcKH1YfCgcOAQMFCgoHBAEBBhMXHCFDIhwWFAYBhwUILxIPGBMRAgFYCi8IBQECEhIYD7cTFB43HRUSAQENIRsPBAQEDxsgDgEBcgcKBwcKBzwHCgcHCgeCCgkKAwwGBgcbDQgEGRkECA0bBgcGDAMKCQoDIgECCg4PCgsLCg8OCgICIAJQDQYJBRMoEBUUBgUNCgUJBg0GBRQVECiKCgcJCQcKTwEBDxIGBhIPAQEqBQcHBRkFBwEHBRgFBwcFGQUHAQcFAAAFAAAAAAErAR0APwBJAFgAawCIAAAlMDUjJic2NTQuAQYXFhcGBwYHBiMiJwcVFhcWFxYXFhcmJyYnJj0BPgE/ATY3JjU0NzY3Nh8BNzYXFhcWFRQHJyYOARQWMjY3NhcyFx4BBgcGIicuATY3NjciBgcOARYXHgEyNjc+ASYnLgEXIg8BJyYiBhQfAQcGFBYyPwEXFjI2NC8BNzY0JgENAQwNAQ8wDwMBBQsKFQ0OERQMAQUMDxEDBQQFIR8ZERABEQwBAQEFDRAjJhEDAxEmIxANA44IMA8MKhMCA00bEw0JCQ0TNhMNCQkNExsRHwwQCwsQDB8iHwwQCwsQDB8KBgQREQQLCQUQEAUJCwQREQQLCQUQEAUJuQEHBAYHFRMFEBYNCAQGDBQFBgJQBAUHBAoKBwYFDwwQDgcjChkFBAcEDBMeERMEBRMDAxMFBBMRHg4LPggFEygOFBQWVBQMIiIMFBQMIiIMFBIMDBAsKxEMDAwMESssEAwMKwQREQQJCwQREQQLCQUQEAUJCwQREQQLCQAAAAAF//8AAAEuASwAFgAsAIAAjgCbAAATNDY7ATIWDwEzMhYUBisBIiY/ASMiJgcjNzYmKwEiBhQWOwEHBhY7ATI2NCYXIycjFSMGBwYiJyYnIzU3FjMyNzUGIyImND4BFxYXNjsBNjc2MzUiDwEnJgcGBwYVFBcHIw4BHQEUFx4BHwEWFxYXFjI3Njc2PwE+ATc2PQE0JicHMSIGHQEUFjI2PQE0JiMiBh0BFBYyNj0BNCbYBQRCBQYENzAEBQUEQgYFAzgwBAUcGyIEBgUvBAYGBBoiAwUGLwMGBlECARkBCwskRiQLCwEBDBQMDAoOFQwPMAgCAQUGHgEBBhIeDgMDESYjEA0FAwINDwMCBwcLBgcMDSlSKQ0MBwYLBwcCAw8NWQYICAwICEgGCAgMCAgBIwMGCgVPBQgGCwRPBnYpBAsGBwYpBAsFCAYFBWAGBQ8PBQZQAgUDHgUOJxQFCAIEAgICBhwPAwMSBAQTER4TDBAHGQ8XBgUDCQYIBAUGBhERBgYEBQgGCQMFBhcPGQchCAYcBggIBhwGCAgGHAYICAYcBggAAAAABP////8BLQEeAEEASwBYAGkAADcmJyM1NxYzMjc2Nxc2NyYnJjYeARUUBxYXNjU0JyYnJg8BJyYHBgcGFRQXByMOAR0BFBceAR8BFhcWFxYXJicmLwE+ARYHDgEiJjQXIg4BFB4BMj4BNC4BFwcGIi8BJjQ2Mh8BNzYyHgFPCwsBAQwUIRIGBAMMDggCAw8wDwIODAQNECMmEQMDESYjEA0FAwEODwMCBwcLBgcMDRodCgUQDRAIMA8DAhMqDKAXJxcXJy4mFxcmFTgDCAMSAwUIAwwxAwgFAT4FBlACBRMGCAUIBAoRFxAFFBQLBgQGDA8eERMEBBIDAxIEBBMRHhMMEAcZDxcGBQMJBggEBQYGCwQOEQQGsgsFEBcTFA4nPhcnLiYXFyYuJxc/OAMDEgMIBQINMgMGBwAAAAb//wAAASwBHgALADQAPgBjAGsAggAANxUUBiImPQE0NjIWFxUUBw4BDwEnNScGIyIvATc2Jg8BJzY3Nh8BNzYXFhcWFRQHHwEeARUnNC4BBhceATI2FxYUBiIvAQcGIicmJyYvAS4BJyY9ATQ2PwImNTQ3JyY0NjIfAQYVFBYzMjcXJxUUBiImPQEnBiMiJwcVFxYXFjI/AYMIDAgIDAipAwIHBwQhAQwUDAw5AQMPGAcXDQ4mEQMDESYjEA0FAwINDzgPMA8DAhMqDCMCBQgDFA0pUikNDAcGCwcHAgMPDQIDBQkQAgUIAxcCDBUKCHUbCAwIKRAXFAwBAQsLJEYkA3UcBggIBhwGCAgGGAUFBAgGAyI5AgUDOQcWEQMBFgUCBBIEBBIEBBQQHhMMEAEGGQ9eFBMGERYUEw2cAwgFAxQGEhIFBwQFCAYIBAUFGA8ZBgEQDBMXEA8DCAUCMggKFA0CdRsBBggIBh0pCQUCUAEFBQ8PAQAIAAAAAAEmAQ4ADABJAFcAZgBzAH8AiACOAAA3IgYdARQWPgE9ATQmNzIXOQEmLwEmJzY1NCcmJyYiBwYHBhUUFwYHBgcGDwEVFBcWFxYXFjsBJiciJyYnNTcXFjMyPwEzFxYXNicUBw4BIyImND4BFxYVFyYnJjUxNDc2HgEUBiMiFyIOARQeATI+ATQuAQc0NjIWHQEUBiImNRciJjQ2MhYUBjcwMScWF3gFBwcKBwdnFhMFAgEEAwEOBwofVh8LBg4BAwUKCgcEAQEGExccISIFBQIbHRQSAQEOIBsPBAQECQ4WPAECEhIYDxIvCAUdCAIBBQgvEg8YEzESHhISHiQeEhIeGAQEBAQEBAYDBAQGBAQmBwIFewcFGQUHAQcFGAUHIQsMBQEMBQUIGw4HBBkZBAcOGwYHBgwDCgkKAyICAQoODwoLCQkKBgpPAQEPEgYGCwUQNAYFFBUQKBMFCQYNKQoUBgUNBgkFEygQEhIeJB4SEh4kHhIeAgQEAjACBAQCIAUGBAQGBXURBQwABQAAAAABLAEdAAwAGAAhAF0AZwAANyIOARQeATI+ATQuAQc0NjIWHQEUBiImNRciJjQ2MhYUBic1NxYzMjc2Nxc2NyYnJjYeARUUBxYXNjU0JyYnJg8BJyYHBgcGFRQXBgcVDgEHFRYXFhcWFyYnJicmJzc+ARYHDgEiJjTYFycXFycuJhcXJiEGCAUFCAYKBQcHCQcHpAEMFCESBgQDCw4HAgMPMA8CDgwEDRAjJhEDAxEmIxANBQECDBEBARASGR8hCwUREQ0FBwgwDwMCEyoMqRcnLiYXFyYuJxcvBAUFBCYDBgYDMQcKBwcKByZQAgYTBggEBwUKERYQBRMVCgYEBgwOHhEUAwUTAwMTBQMUER4TDAQHBAUYCiUIDRAMDwQPEQQHBgSmCwUQFhQUDigAAAAGAAAAAAEtAR0ADAAZAEYAYQBsAHYAADcyFh0BFAYiJj0BNDYzMhYdARQGIiY9ATQ2JzYXFhcWFRQHFh8BHgEXFRQGBwYHBiInJicuASc1PgE3NTY3JjU0NzY3Nh8BFQYHBiMiJwcVFhcWFxYyNzY3Njc1JwYjIicmJyYGBwYUFjI2NzY3JgYXHgEyNjQmdQYICAwICEgGCAgMCAgYESYjEA0FAQEBDBEBGBIXGR48HRkWExgBAREMAgEFDRAjJhEDBAYSIRQMAQUNEREXJhcREA4FAQwUIRIGGwgwCAcMKhMCA0cYDwMCEyoMD4MJBhwFCQkFHAYJCQYcBQkJBRwGCYcTBQMUER4TDAQHBAUZCiMGFwwNCAkJBw0LGAYlChgFBAcEDBMeERQDBRMDUQgGEwYCUAQGBwQGBgQHBgRQAgYTBkkIBQsIKA4UFBYOAhAWFBQOKBMAAAMAAAAAAPQBGgAQACAAMAAANxUuAT0BND4BOwEyFhcjIgYXIyImPQE0NjsBMhYdARQGNzQmKwEiBh0BFBY7ATI2NTgIChQiFTgKEQVYGCGWXRAWFg9eEBYWAwsIXQgLCwhdCAvOkQUSCnAVIhQKCCLSFg+WEBYWEJYPFrsICwsIlggKCggAAAAEAAAAAAEaARoADAAZADEAQwAANzIeARQOAS4DPgE3Ig4BFB4BMj4BNC4BNyIGBzY7ATYzMh4BFRQHFRQHPgE1NC4BBzc2NCYiDwEnJiIGFB8BFjI3ehcnFhYnLicWARcnFxwwGxswOC8cHC8cGCsODA0DFx4XJxcTAxMVHC9lQgIFCAM7EAMIBQIYAwcDzhYnLicXARYnLicWExwvODAbGzA4Lxw4FRMDExcnFx4XAw0MDisYHC8cx0IDCAUDOxEDBgcDGAICAAQAAAAAARoA9AALABsAJQAvAAA3DgEeATsBMjY0Ji8BNDY7ATIWHQEUBisBIiY1NzU0JisBIgYdAxQWOwEyNj0BxQQGAQUEJQQGBgTXGxSoFBsbFKgUG/QRDKgMEBAMqAwRcQEFCAUFCAUBVBMcHBNeExwcE1UJDBAQDAkTQgwQEAxCAAIAAAAAAQgBCAARABgAADc0PgEfAR4BBisBIg8BDgEmNTcnFTc+ATNLCg4GlgcBCwhKCQYuBhAMqZYuBRAJ9AcLAQRxBRAMCDwHAQsIS3G8PQcHAAEAAAAAAM8AlwAMAAA3NDY7ATIWFAYrASImXgUEXgQFBQReBAWNBAUFCAYGAAAAAAUAAAAAAQcBCwASADAARABVAGUAADcUDwEOASIuAjQ2PwE2Mh4BFQciJy4BND4CHwEyHgIOAScjJg4CFBYXHgEOATcWMjc+ATUnNCYOARcVFAYHDgEWByInIy4BPgIeAQcUDgIHNSIHMQ4BHgI+ATU0LgLTAiwDBwgHBgMEBDkCBQUDawQDCwsLFx4QBgIDAgEBBgQEDBcRCAgIAgECBVUDBgMLCwEHBwUBCAgCAQInIhwBHBoNMUM/JgERHyoWHBgYFQsoODQgDxoiygQCOQQEAwUICAcDLAICBQNrAwsbHhsXCwEBAgMEBQUBAQkQFRYVCAIFBgMCAgMKHA8LBAQBBgQICxUIAgUGOxITP0MxDRo5IhYqHxEBzxAQNDgoCxUwHBMiGg8AAwAAAAAA9AEaABAAHQAsAAATIg4BHQEUHgEyPgE9ATQuAQcyHgEUDgEiLgE0PgEXIi4BPQEWNxY3FRQOASOWGisZGSs0KxkZKxoWIhMTIiwiExMiFhYiEyMoKCMTIhYBGQwVDqgOFQwMFQ6oDhUMEgkODA0JCQ0MDgnhCA4GjBQCAhSMBg4JAAb/////AQcBBwA8AEQASwBWAHQAfQAANzIWFTM3NjIWFA8BFTMyFhQGKwEUBxcWFAYiLwEOASImJwcGIiY0PwEmNSMiJjQ2OwE1JyY0NjIfATM0NgcVFBYyNj0BJyIGFTM0JhcUFRQGDwEnPgE3JzIfAR4BFAYPASYnNz4BNCYvASYiBh0BIgc1ND4BBwYHJic1NDY3SxAVBhADCAUDEAoEBQYDCgQUAwYHAxEHFxgXBxEDCAUDFAQKBAUFBAoQAwUIAxAFFhYWIBUlCAsmC44IBjUIBwkCVAcHlgcHBwdTBQpZAgMDApYCBwUJCggNKAUEBAUKCJYWEBADBQgDEBgGBwYKChQDCAUDEAkKCgkQAwUIAxQKCgYHBhgQAwgFAxAQFjgmDxYWDyYlCwgICygCAwcOAx4HAwoHywNUBA0QDQMvCQQyAQUFBAFVAQYEQQRFCA0HbAUGAwIXCA8DAAAE/////wEJAQkAGABUAFsAYwAANwcmJzc2NC8BJgYdASIHNTQ+AR8BHgEGDwEVMzIWFAYrARQHFxYUBiIvAQ4BIiYnBwYiJjQ/ASY1IyImNDY7ATUnJjQ2Mh8BMzQ2MhYVMzc2MhYUDwEzNCYiBhUXIxUUFjI2NfhTBQpZBQWWBQkJCg0UCZYJBwcJdQoEBQUECgQUAwUIAxEHFxgXBxEDBwYDFAQKBAUFBAoQAwUIAxAGFSAWBRADCAUDWyYLEAs5SxUgFn0uCQQyAwoDVQIFBkEERQsPBAVUBhMTBhoYBQgGCgoUAwgFAxAJCgoJEAMFCAMUCgoGCAUYEAMIBQIQDxYWEBECBQgDAgcLCwgSJg8WFg8AAAAABP////8BCQEJABgAVABbAGMAADcHJic3NjQvASYGHQEiBzU0PgEfAR4BBg8BFTMyFhQGKwEUBxcWFAYiLwEOASImJwcGIiY0PwEmNSMiJjQ2OwE1JyY0NjIfATM0NjIWFTM3NjIWFA8BMzQmIgYVFyMVFBYyNjX4UwUKWQUFlgUJCQoNFAmWCQcHCXUKBAUFBAoEFAMFCAMRBxcYFwcRAwcGAxQECgQFBQQKEAMFCAMQBhUgFgUQAwgFA1smCxALOUsVIBZ9LgkEMgMKA1UCBQZBBEULDwQFVAYTEwYaGAUIBgoKFAMIBQMQCQoKCRADBQgDFAoKBggFGBADCAUCEA8WFhARAgUIAwIHCwsIEiYPFhYPAAAAAAQAAAAAAOIA4gAMABUAIgAuAAA3Ig4BFB4BMj4BNC4BByImNDYyFhQGJyMiBhQWOwEyNjQmIxUjIgYUFjsBPgE0JpYUIxQUIygjFBQjFBchIS4hIQQmBAUFBCYEBQUEJgQFBQQmBAUF4RQjKCMUFCMoIxSDIS4hIS4hXgYIBQUIBTgFCAYBBQgFAAAAAwAAAAAA4gDiAAwAGQAlAAA3Ig4BFB4BMj4BNC4BFyMiJj4BOwEyHgEGIzUjIiY+ATsBNh4BBpYUIxQUIygjFBQjCDgEBgEFBDgEBQEGBDgEBgEFBDgEBQEG4RQjKCMUFCMoIxRwBQgFBQgGOQUIBQEGCAUAAAAAAgAAAAAA6gDiAAUAHQAANxcHIyc/ASMiBg8BBhQfAR4BOwEyNj8BNjQvAS4BtiEhQCEhQEAFCQMgAwMgAwkFQAUJAyADAyADCc44ODg4EwUEOQQKBDkEBQUEOQQKBDkEBQAAAAEAAAAAAOoA4gAXAAA3Bw4BKwEiJi8BJjQ/AT4BOwEyFh8BFhTnIAMJBUAFCQMgAwMgAwkFQAUJAyADjTkEBQUEOQQKBDkEBQUEOQQKAAAAAgAAAAAA7QDhAAwADwAANyMiJj8BNjIfARYGIyczJ+KYBQYDTAIMAkwDBgWIeDxLCQWDBQWDBQkTZwAAAQAAAAAA7QDhAAwAADcnJiIPAQYWOwEyNifqTAIMAkwDBgWYBQYDWYMFBYMFCQkFAAAAAAIAAAAAAPQA9AARABUAADciLwEmND8BNjIfARYUDwEGIycXNyeWBANUAwNUAwgDVAMDVAMER0dHRzgDVAMIA1QDA1QDCANUA15HR0cAAAAAAQAAAAAA9AD0AA8AADcnJiIPAQYUHwEWMj8BNjTxVAMIA1QDA1QDCANUA51UAwNUAwgDVAMDVAMIAAAAAwAAAAAA4gDiAAwAGAAhAAA3Ig4BFB4BMj4BNC4BBzQ2MhYdARQGIiY1FyImNDYyFhQGlhQjFBQjKCMUFCMdBQgFBQgFCQUHBwoHB+EUIygjFBQjKCMUHAQFBQQ4BAYGBDIHCgcHCgcAAAAABAAAAAABEAEQABgAJwA/AE4AADcmIg8BBhUWFwcGFBYyPwEWMzI2PwE2NCcPAQ4BJjQ/ATYyHwEWFAc3JiIPASYGDwEGFB8BFjI/ATY1Jic3NjQPAQYiLwEmND8BNjMyFhRxBxQGBRMBDScDBgcDJxEVDhkKAgcHDQIOKBwOBAEEAjsCAm4DBwMnEzISAgcHOwcUBgUTAQ0nAz0EAQQBPAICAg8VEhytBwcEFBwVEScDBwYDJw0LCgIHEwcUAg4CGygOBAEBPAEEArADAycOBBICBxMHPAcHBBQcFREnAwd6BAEBPAEEAgIPGigAAAAABQAA//8BLQEaACAAMgBuAHUAfgAANzMHBgcjIiY9ATQ2OwEyFh0BBgcmJzU0JisBIgYdARQWNxYyPwE2NC8BJiIGFB8BBwYUFxQHFxYUBiIvAQ4BIiYnBwYiJjQ/ASY1IyImNDY7ATUnJjQ2Mh8BMzQ2MhYHMzc2MhYUDwEVMzIWFAYjJzM0JiIGFRcjFRQWMjY9AUJSCAUCQxQbGxSoFBsFBAQFEQyoDBAQBQMIAjgDAzgCCAYDMjID4QQUAwUIAxEHFxgXBxEDBwYDFAQKBAUFBAoQAwUIAxAGFSAWAQYQAwgFAxAKBAUFBFUmCxALOUsVIBUmCQQGGxSoFBsbFFYCAwYFUAwREQyoDBAoAwM4AwcDOAMFCAMxMgMIGAoKFAMIBQMQCQoKCRADBQgDFAoKBggFGBADCAUCEA8WFhARAgUIAxAYBQgGOQcLCwgSJg8WFg8mAAADAAAAAAEHAQgACwAZABwAADc0JiIGHQEeATI2NTc0PgEfAR4BDwEGLgE1NycVOAUIBgEFCAUmCQ4GhAcBCIQGDgmWg/0EBgYEzgQFBQTFBwoCBF0GEwZeBAELB19dvAADAAAAAAEHAQcADgAqADQAADcUBg8BIycuATU0NjIWBzcnJiciBh0BMhc1NDYyHwEWFA8BBg8BNz4CJgceATsBMjY/ASNxDgsCPAILDSEvIQGIlgYICxEJCgUHApYFBXYHCQKRBwcBCN0CCgcHBgsBBTVxDxgICgoIGA4YISEXPlQDAREMLgMxBAYBVQMKA0MMBwxRBA0QDZwGCQkGFwAABAAAAAABIwEjABcAJgBQAF8AAAEmIg8BJgYPAQYUHwEWMj8BNjUmJzc2NA8BBiIvASY0PwE2MzIeAQ8BJzc2NCYiDwEnJiIPAQYXFBcHBhQWMj8BFjMyNj8BNjQvATc2NCYiDwIOAS4BPwE2Mh8BFhQHASADCAInFDESAwYGPAcTBwQUAQ0nAz0EAQQCOwICAg8VEhsBWxEYEAMFCAMQBQcTBwQUAQ0nAwYIAicRFQ4ZCgMHBwQQAwYHAw0CDiccAQ4EAQQCOwICASADAycOBBICBxQHOwcHBBQbFhEnAgh6BAEBPAEEAQMPGigwERgRAggGAxAEBwcEFBsWEScCCAYDJwwKCgIHFAcEEAMIBQI2Aw4BGigOBAEBPAEEAQAABf/8AAABGgEsAA4AIAAqADMAQAAANxY+ATU0LgIjIg4BHgE3ND4BMh8BHgEUBg8BBiIuATUXFAYrATY3MzIWJyYnMzIWFAYjFxQGKwEiJjQ2OwEyFkQZLx0NGB8RGSsTCiQNAwQFAjgCAwMCOAIFBAPhBQRsBwVgBAVeAQJYBAUFBAkFBPQEBQUE9AQFhQUTKxoQHxgNHDAyJG0CBAMBHwEFBQQCHgIDBAMaBAUJCgY+CgkGCAWNBAUFCAYGAAAABAAAAAABBwEHAA8AHwAvAD8AABMiBh0BFBY7ATI2PQE0JiMHNDY7ATIWHQEUBisBIiY1NyIGHQEUFjsBMjY9ATQmIwc0NjsBMhYdARQGKwEiJjVGDRMTDRwOExMOKggGHAYJCQYcBgiSDhMTDhwNFBQNKggGHAYICAYcBggBBxQNoA0TEw2gDRQhBggIBqAGCAgGwRQNoA0TEw2gDRQhBggIBqAGCAgGAAAAAAL/////AQcBBwAcAE0AACUUBg8BJic3NjQvASYiBh0BJwc1NDYzMh8BHgEVByIGBzE1NCYiBh0BFBY7ATI2NCYrATc2MhceAgYHBiInJiIGFBceATI+AjQuAgEHCAdiAQNdBQWWAgcFCQoRCwgGlgcIxQ0YCgYHBgUEJgQFBQQTBA4nDgYHAQgGDicOAggFAgkZGhgSCgoSGJYIDQQ3Cgo0AgsDVQEGBFYBAVYMEQRUBA0IEwoJCgQFBQQmAwYFCAYFDQ0HERMRBw0NAwUIAwkKChIZGhgSCgAAAAAEAAD//wEsAPQADAAZACQAVAAANzQ2OwEyFhQGKwEiJhU0NjsBMhYUBisBIiYVNDY7ARUUFyMiJjcVFBY7ATI2NCYrATc2MhceARQGBwYiJyYiBhQXHgEyPgI0LgIiBgcjNTQmIgYTBQT0BAUFBPQEBQUE9AQFBQT0BAUFBHoCfAQFlgUEJgMGBgMTBA4nDgYHBwYOJw4DBwYDCRgaGRIKChMYGhgJAQUIBeoEBgYIBQVHBAYGCAUFRwQGCgQFBSomAwYGBwYFDQ0HERMRBw0NAwUIAwkKChIZGhgSCgoJCgQFBQABAAAAAAEHAQcAMAAANzQuASMiBgczMhYUBiMnIiY9ATQ2HgEdAT4BFzYeARQOASIuASc0NjIWFx4CMj4B9BksGRcnDSUEBgYEOAQFBQgGDywZHzMeHjM8MSACBQcGAQIaKTEsGZYZLBkUEgUIBgEFBDgEBgEFBB0SFQEBHzM+Mx4bLh0EBgUEFycXGSwAAAADAAAAAAEHAQgACwAZABwAADc0NjIWHQEUBiImNSc0LgEPAQ4BHwEWPgE1JzcV9AUIBQUIBSYJDgaEBwEIhAYOCZaD/QQGBgTOBAUFBMUHCgIEXQYTBl4EAQsHX128AAADAAAAAAEaAQcACwAdAC8AADcOAi4CPgEzMhYHIyImPQE0NjsBNh8BFhQPAQYnIgYdARQWOwEyPwE2NC8BJiO8AQwVFhEECRMLEBUVSBAWFhBIEAtPCQlPC1gICwsISAgGTwQETwYIlgwSCQQQFxUMFn8VEJYQFQELTwoaCk8KzgsIlggLBk8ECgRPBgAAAAACAAAAAAEaAQcAEQAjAAA3IyImPQE0NjsBNh8BFhQPAQYnIgYdARQWOwEyPwE2NC8BJiOmSBAWFhBIEAtPCQlPC1gICwsISAgGTwQETwYIJhUQlhAVAQtPChoKTwrOCwiWCAsGTwQKBE8GAAACAAAAAAEJAQkACwAaAAA3JgYdARQWPwE2NC8BND4BHwEeAQYPAQYuATVZBQkJBZYFBbcNFAmWCQcHCZYJFA3zAgUGqAYFAlUDCgNMCw8EBVQGExMGVAUEDwsAAAMAAAAAAQcA9AAlAC4ANwAAJS4CIgYHNTQmIgYdAQYWOwEyNjQmKwE+ATMyHgEXHgE7AT4BNQciDgEWMjY0JgciJjQ2MhYUBgEGAx8xOTIQBQgFAQYESwQFBQQ6Cy8cGCkaAgEFBAEDBXAQFQEWIBYWEAgLCxALC40dLxsbGCkEBgYESwQFBQgGGR8WJxgEBQEGAy8WHxYWHxY4ChALCxAKAAAAAwAAAAAA2AEaAAgAEQAqAAA3IgYUFjI2NCYHIiY0NjIWFAY3Bw4BLwEmNDYyHwE1NDYyFh0BNzYyFhQHlhAVFSAWFhAICwsQCws3OAMIAzgDBggCKQUIBSkCCAYDXhYfFhYfFjgKEAsLEAqFOAIBAzgDCAUCKH8EBQUEfygCBQgDAAAAAwAAAAAA2AEaAAgAEQArAAA3IgYUFjI2NCYHIiY0NjIWFAY3BiIvARUUBiImPQEHBiImND8BNjIfARYUB5YQFhYgFRUQCAsLEAsLNwMIAikFCAUpAggGAzgDCAM4AwNeFh8WFh8WOAoQCwsQCqsDAyh/BAYGBH8oAwYIAjkCAjkCCAMAAwAAAAABBwD0ACUALgA3AAA3PgIyFhc1NDYyFh0BFAYrASImNDY7AS4BIyIOAQcOASsBLgE1FwYWMjY0JiIGFzQ2MhYUBiImJgMfMTkyEAUIBQUESwQFBQQ6Cy8cGCkaAgEFBAEDBUsBFiAWFiAVEgsQCwsQC40dLxsbGCkEBgYESwQFBQgGGR8WJxgEBQEGA1UPFhYfFhYQCAsLEAoKAAIAAAAAAQcBBwAPAB8AADcyFh0BFAYrASImPQE0NjM1IgYdARQWOwEyNj0BNCYj6gQGBgSoBAYGBAwQEAyoDBERDPQGBKgEBgYEqAQGExEMqAwQEAyoDBEAAAAABAAAAAABGgEaAEAASABYAHUAACUjNTQnNzY0JiIPASYjNCYiBhUiBycmIgYUHwEGHQEjIgYUFjsBFBcHBhQWMj8BFjI3FxYyNjQvATY1MzI2NCYjJzIWFSM0NjMXFA4BIi4BPQE0NjsBMhYVDwEXFhQGIi8BBwYiJjQ/AScmNDYyHwE3NjIWFAcBEBwFFQIFCAMVCQohLiEKCRUDCAUCFQUcBAUFBBwVIAMGBwMhGkIaIQMHBgMgFRwEBQUEehAVShUQSxQjKCMUCwhwCAsoFhYDBggDFRUDCAYDFhYDBggCFhUDCAUCliYKCRUCCAYDFQUXISEXBRUDBggCFQkKJgUIBiEaIQIIBgMhFRUhAwYIAiEaIQYIBXEWEBAVgxQjFBQjFDkHCwsHGhUWAwcGAxUVAwYHAxYVAwgFAxUVAwUIAwAAAgAA//8BLQEaACIAUgAAJRQGDwEOASImLwEuATQ+AjIWHwE1NDYyFh0BNz4BMh4CJzM1IyImPQE0NjsBHgEdATM1NCYrASIGHQEUFjsBFSMiBhQWOwE1IzUzFSY+ATczASwBAiUCAwQDASYBAgICBAMEARYFCAYVAQQDBAMBXhOpCAoKCLwICxIWD7wPFhYPJhwEBgYEektLAQUHBQIvAgMCJQIBAQIlAgMEAwMBAQIVWgQFBQRaFQIBAQMDGhMLCIMICwEKCF5eDxYWD4MQFiUGCAUTJRwGCgcDAAMAAAAAARoA9AAbACUANQAANyIGHQEUFjsBMjY9ARcWPgE9ATQuAQ8BNTQmIxc3NhYdARQGLwI0NjsBMhYXFRQGKwEiJjVCFBsbFF0UGyYIEQwMEQgmGxQvMQIFBQIxqBAMXQwQAREMXQwQ9BwTXhMcHBMDGwUCDQloCQ0CBRsDExxIIQIDAmgCAwIhRQwQEAxeDBAQDAAABAAAAAABBwEHAAgAEgAsAEgAADcUBiImNDYyFgcuASIGFBYyNjUnIgYPASMiBh0BHgE7ATI2PQE0JisBJy4BIwc2OwEyHwEWOwEyFh0BFAYrASImPQE0NjsBMjfOIS4hIS4hEgEVIBUVIBU/CA0ECw0QFgEVEJYQFhYQDQsEDQg8AgY0BgIOAgYTCAsLCJYICwsIEwYClhchIS4hIRcQFRUgFRUQcQkHFhYPXhAWFhBeDxYWBwkYBQUcBQsIXQgLCwheBwsFAAADAAAAAADiARoACwAbACsAADciBhQWOwEyNjQmIyciBh0BFBY7ATI2PQE0JiMHNDY7ATYWHQEUBisBLgE1gwQFBQQmBAUFBD0OExMOVA4TEw5iCAZUBggIBlQGCEsFCAYGCAXOEw7EDhMTDsQOEyEGCAEJBsQGCQEIBgAAAwAAAAABBwEHAA8AHwA8AAA3NDYXMzYWBxUWBicjIiY1NyIGHQEUFjsBMjY9ATQmIwcyFh0BMzIWFAYrARUUBiImPQEjIiY0NjsBNTQ2JhsThBMcAQEcE4QTGy4LERELhAsREQtCBAUvBAYGBC8FCAUvBAYGBC8F2BMcAQEcE4QTHAEbE6ARC4QLERELhAsRHAYELwUIBS8EBgYELwUIBS8EBgADAAAAAAEHAQcAEAAgACwAABMzMhYdARYGKwEiJj0BNDYzBxQWOwEyNj0BNCYrASIGFRc2MhYUDwEGIiY0N1SEExsBHBOEExwcExwRC4QLERELhAsRhgMIBQNdAwgFAgEHHBOEExwcE4QTG7ILERELhAsREQsMAgUIA10DBQgDAAMAAAAAAQcBBwAQACAAKQAAEyMiBh0BFBY7ATI2PQE2JiMXFAYrASImPQE0NjsBMhYVBxQGIiY0NjIW2IQTHBwThBMbARwTHBELhAsREQuECxEmIS4hIS4hAQccE4QTHBwThBMbsgsREQuECxERC0IXISEuISEAAAUAAAAAARoBLAASACQANQBTAGEAADc1NC8BJisBIgYdARQWFzM+ATUjNTQ2OwEyHwEWHQEUBisBIiY3FRQOASsBIiYnMzI2PQEXFicUBisBFRQGIiY9ASMiJjQ2OwE1NDYyFh0BMzIWFRcOASsBIiY0NjsBMhYV9Ag3CAxWEBYWEIMQFrwLCFYEAzYDCwiDCAvhFCIVXQsRBX4XIgoIXQYEHAUIBhwEBQUEHAYIBRwEBQEBBQRLBAUFBEsEBUuODAg3CBYQuxAVAQEVELwHCwI3AwSOCAsLcWkUIxQKCSEXhwoJBgQFHQMGBgMdBQgFHAQGBgQcBQReBAUFCAYGBAADAAAAAAEHAQcACwAcACwAADciBhQWOwEyNjQmIyciBh0BFBY7ATI2PQE2JgcjBzQ2OwEyFh0BFAYrASImNWcEBQUEXgQFBQRxExsbE4QTGwEcE4QcEQuECxERC4QLEZ8FCAUFCAVoHBOEExsbE4QTHAEuCxERC4QLERELAAAAAAMAAAAAAQcBBwAQACAAOAAAEyMiBh0BFBY7ATI2PQE2JiMXFAYrASImPQE0NjsBMhYVBxYUDwEGIiY0PwEjIiY0NjsBJyY0NjIX2IQTHBwThBMbARwTHBELhAsREQuECxEoAgImAwcGAxVHBAUFBEcVAwUIAwEHHBOEExwcE4QTG7ILERELhAsREQs7AwgDJQMGBwMWBQgFFgMHBgMAAAAEAAAAAAD0ARoAEQAjAEEATwAANycmKwEiBgcVHgE7ATI2PQE0BxQGKwEiJj0BNDY7ATIfARYVBxQGKwEVFAYiJj0BIyImNDY7ATU0NjIWHQEzMhYVFxQGKwEiJjQ2OwEyFhXsNwgMVhAVAQEVEIMQFhMLCIMICwsIVgQDNgMlBgQcBQgGHAQFBQQcBggFHAQFAQYESwQFBQRLBAXaNwgWD7wPFhYPjgyaCAoKCLwICwM3AwQUBAUcBAYGBBwFCAYcBAUFBBwGBF4EBQUIBgYEAAAAAAYAAAAAARoBBwAPABkAIwAzAD0ARwAAEyMiBh0BFBY7ATI2PQE0JgczMhYdASM1NDYXIyImPQEzFQ4BNyMiBh0BFBY7ATI2PQE0JgczMhYdASM1NDYXIyImPQEzFRQGZzgMEBAMOAwQEEQ4BAZLBTw4BAVLAQWSOAwQEAw4DBAQRDgEBksFPDgEBUsGAQcRDKgMEBAMqAwQEgYEHBwEBrwGBHp6BAbPEQyoDBAQDKgMERMGBFRUBAa8BgQvLwQGAAEAAAAAAQoBCgAlAAA3NDYyFh0BNz4BHgIGDwEGIiY0PwE2NCYiDwEzMhYUBisBIiY1OAYIBTsPJyYdCgoOXwIIBgNeESEvEDtGBAYGBFsFB/0EBgYESDwOCgodJyYPXgIFCANeEC8hEToGCAUHBAAEAAD//gEtARoABwAmADgASgAANxcHJyY0NjIHNTQ2OwEyFh0BNzIXNTQmKwEiBh0BFBY7AT8BIyImNyc3NjQmIg8BBhQfARYyNjQnNyYiDwEGDwEGFj8BNj8BNjQnuSUOJAMFCJAVEJYQFgIICCEXlhchIRcmAQMqEBVbKSkCBQgDLwICLwMIBQKhCx0KWggDBwMOCRwLCFsKCswlDiUDCAWDlhAWFhAmAQMoFyEhF5YXIQYNFTMoKAMIBQMuAwgDLwIFCAMxCgpbCAscCQ4DBwIIWwodCwAFAAAAAAEaASMAIABBAE4AZwCJAAAlFhQHDgEiLwEVFAYiJj0BNDY7ATIWFAYrARceATY3NjI3IgYdAScmIgYHBhQWMjc+ATIfASMiBhQWOwEyNj0BNCYHFBY7ATI+ASYrASIGNyM1NCYiBh0BIyIGFBY7ARUUFjI2PQEzJhcVFAYrASImPQE0NjsBMh8BNSYrASIGBxUeATsBMjY9AQcBEgMDCBUXCwUFCAYGBBwEBQUECQMHDw8FAwcBBAUGChcVCAMFCAMFDhAHAwkEBgYEHAQFBbYFBEsEBQEGBEsEBUsTBQgGHAQFBQQcBggFGgc4CwiDCAsLCFYEAwUGBlYQFQEBFRCDEBYK1QMIAwgIBQICBAYGBBwEBQUIBgEDAQYGAkwGBAMDBQgJAggGAwYFAwIFCAUFBBwEBs8DBgYHBgZkHAQFBQQcBggFHAQGBgQcCAxtCAoKCLwICwMGGAMWD7wPFhYPbQEAAAAABAAAAAABGgEtADEAVABcAIgAABMvASYvASYvAS4BKwEiBg8BBg8BBg8BDgEUFjMfAR4BHwEeATMxMj8CPgE/ATI2NCY3JiIPARcWFzcXBwYPATc2PwEmLwEHBg8BBhY/ATY/ATY0Jw8BJzc2MhYUBycVLgEvAS4BIgYPAQ4BDwEOARQWHwEeAR8BHgE7ATI2PwE+AT8BPgE0JidtAQ4EBAMFAwQBAwEBAQMBBQIFAQQGDgICAgIQAwQHAgUBAwIBAgIFAgoGDwEDA50PKA82CgQEFit4BwowDAMHIQQCAyULBBABBwVADwqUDg4NDysPCRkSdAwFCAIDAQIDAgEEAQgFDAECAgELBggBBAECAQEBAgEEAQgGCwECAgEBAgEEAgIDBQcOAgICAg4HBQEEAgQBAwQDBQICBwYQAgIBAg8HCgIFAwQDCQ4ONgMCBBYreAcDDDAKByEEBAomCg9ABQcBEAQLkw8oDzgPKw8JEhkcBAECCAUMAQICAQwFCAEEAQIDAgEEAQgGCwECAgELBggBBAECAwIBAAAAAAMAAAAAARoBGgAQABgAIQAAASYiDwEGDwEGFj8BNj8BNjQnNjIWFA8BJwcXBwYPATc2NwELDikPkwsEEAEHBUAPCpQORgkZEgkPKw0reAcKMAwDBwELDg6UCg9ABQcBEAQLkw8pAQkSGQkPKw0reAcCDTAKBwAAAAUAAAAAARoBGgAbACQALwA5AEcAADcjIgc1NCYrASIGHQEUFjsBFRQWOwEyNj0BNCYHMzIWFyM1NjMnMzIWHQEjNSY2Fwc1MxUUBisBIiYXFAYHIy4BPQE+AT0BM+pdBQUQDDgMEBAMLxsUXRQbG3FdCQ8DggUFXjgEBksBBgQJSwYEOAQF4REMXQwQCAqEzgEwDBAQDHAMES4UGxsUXRQbEgsIEQFMBgQJCQQGAXlUVAQGBkcMEAEBEAwwAw8JCQAAAAADAAAAAAD0AKkACAARABoAADcUBiImNDYyFhcUBiImNDYyFhcyNjQmIgYUFl4LEAsLEAtLCxALCxALOAgLCxALC5YICwsQCwsICAsLEAsLGwsQCwsQCwAAAwAAAAABGgEsACEALgBLAAAlFRQGKwEiJj0BFhcVHgE7ATI2PQEjNyczNCYrASYnMzIWBTQ+ATIeARQOASIuATcGFjsBFRQWMjY9ATMyNjQmKwE1NCYiBh0BIyIGARkhF5YXIQgKARUQlhAWTAEBTBYQMQUHPRch/ucXJi4nFxcnLiYXJgEGBBwFCAYcBAUFBBwGCAUcBAXhlhchIRc9BwUxEBUVEIMKCRAWCgghIBcmFxcmLicXFycXBAYcBAUFBBwGCAUcBAYGBBwFAAAAAAMAAAAAARABEAAYACIALAAAJTQvASYiDwEGFB8BFjsBFjY0JisBNzY1MQcnJjQ/ARcHIyI3Byc3NjIfARYUARAIOQgXCI0ICCUJC4QEBQUEQHAIwiYCAihGGCoDqVdFVwMHAzgDvAsIOQgIjQgYCCUIAQYIBXAIC4AlAwgDKEYYfVdFVwMDOAMHAAAAAwAAAAAA4QDiABsAKAAxAAA3JiIGFB8BBwYUFjI/ARcWMjY0LwE3NjQmIg8BFTI+ATQuASIOARQeATcyFhQGIiY0NooDCAUDDAwDBQgDDAwDCAUDDAwDBQgDDBQjFBQjKCMUFCMUFyEhLiEhrwMFCAMMDAMIBQMMDAMFCAMMDAMIBQMMWBQjKCMUFCMoIxSDIS4hIS4hAAADAAAAAAEaARoADAAZADYAABMiDgEUHgEyPgE0LgEHIi4BND4BMh4BFA4BNwcXFhQGIi8BBwYiJjQ/AScmNDYyHwE3NjIWFAeWJDwjIzxIPCMjPCQfMx4eMz4zHx8zFykpAgUIAygoAwgFAikpAgUIAygoAwgFAwEZIzxIPCMjPEg8I/MeMz4zHx8zPjMemCgoAwgFAygoAwUIAygoAwgFAygoAwUIAwAEAAD//AEtARoADwAcAHcAiwAAJS4BIyIOAR4CPgE1NCYnBwYrASImNDY7ATIWFCcyFxUjJisBDwEiJyYnJj8BPgEvASY3Njc2Mx8BMjMyNj8BNjc2MhcWHwEeATsBPwEyFxYXFg8BJic3JicPASMiJi8BJiIPAg4BIyIvAQYHHwEWBg8BFhc/AgYHJjQ2MhcGDwExJiMiBhUUFzEBEwwfEBorEwokMjAcDQwPAwRLBAUFBEsEBqcJBwUEBwMgAwQCEwgCBBgFAQQaBAIIEwIEAx0DAgUIAgYBBQ4cDgUBBQEJBQMgAwQCEwgCBAkJCgoGChcFBwwTAgQJEAkEAQQSCwUGFwoGEgQJAgsSBgoXBSsGBQkWHQsJBwMDAggLAZAMDR0vMiQKEysZER8MQgMFCAYGBwkEFAULAQMVGwUDFAQNBRYEBBsVAwELBQUhBQEDAwEFHwUHCwEDFRsEBAcFAwkPDQgCEAwXAgIXBgoMAggNDxAECxwJDxANCAI3CQoLHRYJBAUCAQsIAgMAAAAABAAAAAABGgEaABAALAA8AEwAACUVFAYrAR4BOwEyPgE9ATQmBzI+ASYrATU0JiIGHQEjIgYUFjsBFRQWPgE9ATcyFh0BFAYrASImPQE0NjMXNCYrAQ4BHQEUFjsBMjY1AQchGJEFEgpwFSIUCl0EBQEGBCUGCAUmBAUFBCYFCAZBEBYWEJYPFhYPqQsIlggKCgiWCAvvkRggCQoUIhVwChJLBggFJgQFBQQmBQgGJQQGAQUEJXoWD5YQFhYQlg8WJQgLAQoIlggLCwgAAgAAAAABGgD0AAwAJQAANzIWHQEUBiImPQE0Nhc2Mh8BFhQPAQYiJjQ/ASMiJjQ2OwEnJjQcBAYGCAUFsAIIA0ICAkIDCAUDMaUEBQUEpTED9AYEnwQFBQSfBAYMAgJCAwgCQgMGCAIyBQgGMQMIAAYAAAAAASABJQAeACgALwA5ADwATAAAJTQvASYiDwE1NCYrASIGHQEUFjsBMjY9ATQmKwE3NiczMhYdASM1NDYHNTMVIyImNxUUBisBNTMyFic1FzcHBiIvASY0PwE2Mh8BFhQBIAgyBxcHKBALUQsQEAvGCxAQCwInCPNRBAVjBQVjWgQF2AUEWloEBWMdVTEDBwMxAwMxAwcDMQPZCwgxCAgnAgsQEAvGCxAQC1ELECgIMwUEWloEBc9aYwVVUQQFYwUXHh41MgMDMgIHAzICAjIDBwAAAAYAAAAAAS0BLAAeACgALwA5ADwATAAAJTQvASYiDwE1NCYrASIGHQEUFjsBMjY9ATQmKwE3NiczMhYdASM1JjYHNTMVIyImNxUUBisBNTMyFic1FzcHBiIvASY0PwE2Mh8BFhQBLAg0CBcIKhAMVAwQEAzODBAQDAIpCP1UBAZnAQYFZ14EBeEGBF5eBAZoH1k0AwgCNAMDNAMHAzQC3AwINAgIKQIMEBAMzgwQEAxUDBAqCDYGBF5eBAbYXmcFWFQEBWcGGB8fNzQDAzQDBwM0AgI0AwcAAAMAAAAAARoBGgAkAC4ARgAANxcWMjY0LwEmIgYUHwEOAQ8BFRQeATY/AT4BNxcOARUUFjMyNicOASMiJjU0NjcnFzYzMhcWFxYfAR4BPgEvASYnJicmIyK+SwMIBQL0AwgFAj0MFAcFAwcHAQQGEgwdCgwcEwwVBwMOCQwQCQgVEQcIGhUQDQgGBAEHBwQBBQcKDxMZHxFhTAIFCAP0AgUIAzwJGQ8MAwMFAgMECg0XBx0HFQwUGwwYCAkQDAgOBEkQAQoJDwsNCgQDAgYEDQ8NEgoNAAAAAAMAAAAAAQgA4gAlAC4ANwAANzEOASYnJj8BNjc2NzYyFxYXFh8BFg4BJi8BJicmJyYiBwYHBgc3IgYUFjI2NCYHNDYyFhQGIiY4AQcJAQEBBQcKDxMZPhkTDwoHBQEEBwcBBAYIDRAVNBUQDQgGWhMcHCYcHC8QGBAQGBCKBAMCBQMCDQ8NEgoNDQoSDQ8NBAYCAwQKDQsPCQoKCQ8LDRUcJxsbJxwvDBAQGBAQAAAABgAAAAABGgEaABQAKgA0AD0ASwBXAAATIgYdARQWFxUUFj8BMzI2PQE0JiMHNDY7ATIWFxUUBisBIg8BNTQmIiY1BzQ2MhYUBiImNTciBhQWMjYuAQczMhYVFAcGIicmNTQ2FyMiBhUUFjI2NTQmsgwQCgkLBB8mDBAQDFQFBEsEBQEGBCkEAhMFCAVxFh8WFh8WJggLCxALAQo3XgsRFxU/FRYQal4EBR8yHwUBGRAMJQkPAxQGBQQaEAwlDBAcBAYGBCUEBgIPCAQFBgQcDxYWHxYWDxMLDwsLDwtLEAwfEhAQEh8MEBIGBBYZGRYEBgAAAAYAAAAAAPQBGgARACMAKQA/AEwAWQAAEyIGHQEUFjsBMjY9ATQvASYjBzQ2OwEVFBY7ARUUBisBIiY1NyMiJj0BFxYdARQGIiY9AQYHBi4BNjc2Nz4BFiciBh0BFBYyNj0BNCYHNDYyFh0BFAYiJj0BXhAWFhBwEBYINwgMVgsIOBAMLwsIcAgLkisEBSIDBQgFBwgEBwMCBAsHAwgGTgwQEBgQEBUFCAUFCAYBGRYPvA8WFg+ODAg3CCUICy8MEIQICgoIlgYEK3EDBUgEBgYEOQYEAQIIBwEFCgQBAgIQDCYLERELJgwQHAQFBQQmBAUFBCYAAAAABAAAAAABBwEaACIAKAA9AFIAADcnJisBIgYdARYXFhc1NDYXMxUUFhczFRQGByMHMzI2NzUmByImPQEXByIvAS4BNDY/ATYyFhQPARceAQ4BMyIuATY/AScmNDYyHwEeARQGDwEG/jYJC0QPFggGAwILBzkQDC8LCBwTLxAVAQFBBAY1rwQCJgEBAQEmAwgFAx8fAgECBUkDBQIBAh8fAwYIAiYBAgIBJQPaNwgWD24CBgIEfAgLAS4MEAGDCAoBEhYPjwsEBgQrNbsDJQEEAwQBJgMGCAMeHwIFBgMDBgUCHx4DCAYDJgEEAwQBJQMABQAAAAABBwEaACAAJgA4AEEASwAAEyIGHQEzNTQ2OwEVFBY7ARUUBisBBgczMjY9ATQvASYjFyMiJj0BBzQ2OwEyFh0BFgcnJiIPASY1NzQmIgYUFjI2BxY7ATI3JyYiB3EQFhMLCDgQDC8LCBMCBBkQFgk2CQs8KwQFqRsUSxMbAQg5CBgIOAiDCAwICAwIbgsPSw4LOAMIAwEZFg84OAgLLwwRgwgKCgkWD44MCDcISwYEK4kTHBwTSw4MOQgIOQwORgYICAwICGcICDgDAwAAAAAJAAAAAAEaARoAGwAhAC0APQBOAFYAZABqAIMAADcjNTQvASYrASIGHQEjIgYdARQWOwEyNj0BNCYnFyMiJjUnNDY7ARUUFjsBFSMXFAYrASImPQE0NjsBMhYVByMiBh0BFBYyNj0BMzI2NCYHIzUzHgEUBjcjIgYdARQWOwEyNjQmBzUeARQGNyMiBh0BFBYyNj0BMzI2NCYrATUzMjY0Jv0JCDcIDEMQFgkMEBAMzgwQEGA0KwQFXgsIOBAML5a8BgTOBAUFBM4EBrMSBAYGCAUJDBERDAkJBAYGPgkEBgYECRAWFhAICwtWHAQGBggFCQQGBgQJEwQFBakdDAg3CBYPSxELXgwQEAxeCxFaNQYEHAgLLwwQE3oEBQUEXgMGBgMKBQQ4BAYGBAkQGBAlEwEFCAUlBQQ4BAYWHxY4JgEKEAs4BQQ4BAYGBAkFCAYTBQgFAAAAAAQAAAAAARoBBwALACEAMgBEAAA3IgYdATMyPwEnJiMHMDU+ATsBMh8BMzIWHQEUBisBIiY1NwcGByMVFBY7ATI2PQE0JiMXHgEdARQOASsBIiYnMzI+ATVCDBA5BAMQEAMETAEbEx0MCBQ+ExwcE4MUG3QUCAw5EAyDDBAQDEIIChYnF14LFAaDEh4S9BELCgMQEAMbARIbCRQbFEEUGxsUXhQIAUEMEBAMQgsRHAcUCxwXJxcLCBIeEgAABAAAAAABGgEHAB4AKgA6AFMAADc0NjsBNh8BMzIWHQEUBisBNTMyNj0BNCYrAQcGKwE3FTMyPwEnJisBIgYVIgYdARQWOwEyNj0BNCYjBzQ2OwEeARcVDgEiJj0BBwYiJjQ/ASMiJhMbFCcLCR1QFBsbFEFBDBERDFAdCQtWE0MEAhoaAgQnDBAQFhYQSw8WFhBKBQQ4BAUBAQUIBSgDCAYDKCEEBdgTGwEJHRsUXhMbEhELXgwQHQgvHAIaGQMRTRYPSxAWFhBLDxYvBAYBBQQ4BAUFBCEoAgUIAygFAAAEAAAAAAD0ARoAHwAlADUATgAAEyIGHQEzNTQ2OwEVFBYXMxUUBisBFTMyNj0BNC8BJiMXIyImPQEHIgYdARQWOwEyNj0BNCYjBzQ2OwEeARcVDgEiJj0BBwYiJjQ/ASMiJl4QFhMLCDgQDC8LCCUlEBYINwgMPCsEBYMQFhYQSw8WFhBKBQQ4BAUBAQUIBSgDCAYDKCEEBQEZFg9LSwgLLwwQAYMIChMWD44MCDcISwYEK20WD0sQFhYQSw8WLwQGAQUEOAQFBQQhKAIFCAMoBQAAAAYAAAAAAPQBGgARACMAKQA1AEIATgAANzQ2OwEyHwEWHQEUBisBIiY1NyIGHQEUFjsBMjY9ASMiJj0BFzMnFRQWByIGFBY7ATI2NCYjBzQ2NzMeARQGKwEiJhciBhQWOwEyNjQmIzgWEEMMCDcIFhBwEBYmCAsLCHAICy8MEBwrNAVHBAUFBF4EBQUEZwUEXgQFBQReBAUJBAUFBF4EBQUE9A8WCDcIDI4PFhYPzwsIvAgKCgiEEAwvOTUrBAY4BQgGBggFLwQFAQEFCAUFGAUIBgYIBQAAAAUAAAAAARoBBwALAB8APwBWAFoAADc1NDY7ATIfAQcGIyciBh0BFBY7ATI2PQE0JisBJyYjFxUUFjsBFSMiBhQWOwEVIyIGFBY7ARUjIiY9ATMyPwEXNTMyNjQmJyM1MzI2PQEzMhYdARQGIycVIzUmEAwnBAIaGgIEJxQbGxSoFBsbFFAdCQtABQQKCgQFBQQKCgQFBQQKegwQQwsJHTQKBAUFBAoKBAUJDBERDBwSvBwLEQMZGgJLHBOEExsbE14UGx0JOS8EBRMFCAYSBggFExELVQgdliYFCAUBJQUELxAMXgsRliUlAAAAAwAAAAAA9AEaABEAIwApAAATIgYdARQWOwEyNj0BNC8BJiMHNDY7ARUUFhczFRQGKwEiJjU3IyImPQFeEBYWEHAQFgg3CAxWCwg4EAwvCwhwCAuSKwQFARkWD7wPFhYPjgwINwglCAsvDBABgwgKCgiWBgQrAAAABAAAAAAA/gEhABAAIgA0ADoAADcUFjsBDgErASIuAT0BNDY/ATIfARYdARQGKwEiJj0BNDYzFSIGHQEUFjsBMjY9ASMiJj0BFxQWOwEnLh8VdQUQCVgTHxIJCHILCEMIFA95DhUVDgcLCwd5Bwo8Cw8RBQQ5QlEWHggJEh8TiwoQBCcHRAgKcg8UFA+tDhQRCgetBwsLB2gPCzw8BAVCAAMAAAAAAQwA9AAMABkAJgAANzQ2OwEyFhQGKwEiJhc0NjsBMhYUBisBIiYXNDY7ATIWFAYrASImIQgGzgYICAbOBgglCQWEBQkJBYQFCSYIBjgGCAgGOAYI5gYICAwICEUGCAgMCAhFBggIDAgIAAADAAAAAAEHAPQADQAaACgAADc0NjsBMhYUBisBIiYnFzQ2OwEyFhQGKwEiJhcmNjsBMhYOASsBIiY1JgUEzgQGBgTOBAUBJgUEhAQFBQSEBAUmAQYEOAQGAQUEOAQG6gQGBggFBQRLBAYGCAUFRwQGBggFBQQAAAACAAAAAAD/AQcABwAbAAA3NTMHBhQfAQczFjYvATc2JisBIgYdARQWMjY1S5clAgIll6kFBgQrKwQGBbIEBgYIBYNxMwIHAjMSAQsEPTwECwYEzgQFBQQAAgAAAAAA/gEaAB0ARQAANzY3FhcWHwEWFxYVFAYiJyYnJj8BFx4BPgEnJjc2BzEHBgcGFxYXFjI3PgE0JyYvASYnJjc2JiIGBwYHBhcWDgEmLwEuAZkHCAEHBhIBEAcKJkkVEgcFCQMCBRcWCAYNBgU7BAYDDAcIFxpYGgsMDAcRAhAGCAIBBQsTCBkHCREDAwgIAgoCC/8EAg4QDhoCGg0VECIpExEfGBgGBQsHCxkLHhIPPgcICR4dJRUYGw0iKBoOGgIZDRINBAcEBQwXGSUFCgQDAxQFAQAAAAIAAAAAAPQA9AAQACEAADc2MhYUDwEGIi8BJjQ2Mh8BNzYyFhQPAQYiLwEmNDYyHwHkAggGA1QDCANUAwYIAk5OAggGA1QDCANUAwYIAk6mAwYIAlUCAlUCCAYDTpkDBggCVQICVQIIBgNOAAIAAAAAAPQA9AAQACEAADcGIiY0PwE2Mh8BFhQGIi8BBwYiJjQ/ATYyHwEWFAYiLwFIAggGA1QDCANUAwYIAk5OAggGA1QDCANUAwYIAk6PAgUIA1QDA1QDCAUCTpkCBQgDVAMDVAMIBQJOAAIAAAAAAOIA/gAQACEAADcHBiIvASY0NjIfATc2MhYUBycmIg8BBhQWMj8BFxYyNjTeQQMIA0EDBQgDOzsDCAUDQQMIA0EDBQgDOzsDCAXtQgICQgMIBQM7OwMFCLFCAgJCAwgFAzs7AwUIAAQAAAAAASwBBwAMAB4AQQBNAAAlFA4BIi4BND4BMh4BJx4BDwEGIi8BJjQ2Mh8BNzYyJyIGHQEUFjsBJicjIiY9ATMyPwEzMhYdARYXNTQmKwEnJiMHNTQ2OwEyHwEHBiMBLBcmLicXFycuJhcoAgEDOAMIAxMCBQgDDDEDCL8UGxsUOgUDMgwQQwsJHVAMEQoIGxRQHQkLQxAMJwQCGhoCBFQXJhcXJi4nFxcnDAMHAzgDAxIDCAUCDDEDjRwThBMbCQkRC1UIHRAMAgUHDhQbHQlLHAsRAxkaAgAG/////wEaAQcAHgAqAFUAWQBdAGEAADczMhYdARQGKwEnMzI2PQE2JisBBwYrATU0NhczNhcHMj8BJyYrASIGHQEXFh8BFhQGDwEGIiYvARUUBisBIicGKwEiJj0BNDY7ATIXNjsBMhYdATc2BzM1IxczNSMfATcnmlAUGxsULAg0DBABEQxQHQkLVhsUJwsJFAQCGhoCBCcMEVoHAyICBgYRAwoJAxkLCBMFBAQFEwgLCwgTBQQEBRMICxMHZRMTJRMTLiMRIuEbFF4THBMRC14MEB0ILxMcAQEJQgIaGQMRCxw+AwdTAwoJAggBBgY+NwgLAwMLCHAICwMDCwgNCANucHBwHVMHUwAAAwAAAAABGwEHABIALQA/AAA3FTc+ATM3LgErASIvASYrASIGFyIHIy4BPQE0NjsBNh8BMzIWFx4CDwEOASMnIgYPAQYeATsBMjY/ATYuASMmEQcaEHcDDglCBAIgAwQUDBBfAQFBFBsbFBQMCB0+ERoDDxUECB4HGhBcCxEFHgUEDwuCCxEFHgUEDwvYVx4NDwEICgMgAxG9AQEbE4QTGwEJHRYQAxYfDjMND4MKCTMKEw4KCTQJFA0AAAADAAAAAAEaAQcACwAfADAAADcVMzI/AScmKwEiBgc0NjsBNh8BMzIWHQEUBisBIiY1NxUUFjsBMjY9ATQmKwEHBiMmQwQCGhoCBCcMEBMbFCcLCR1QFBsbFKgUGxMQDKgMEREMUB0JC9gcAhoZAxELExsBCR0bFF4TGxsTVVULERELXgwQHQgABQAAAAABLQD0AB0AJgAvAEMAUwAANzIWHQEzMhYUBisBFRQGIiY9ASMiJjQ2OwE1NDYzFzIWFAYiJjQ2Nx4BFAYiJjQ2NzIeAR0BFA4BKwEGLgE9ATQ+ATMVIgYdARQWOwEyNj0BNCYjZwQGHAQFBQQcBggFHAQGBgQcBQRnCAsLEAsLGwgLCxALCwgUIxQUIxSWFCMUFCMUFyEhF5YXISEXvAYEHAUIBhwEBQUEHAYIBRwEBTgLDwsLDws5AQoQCwsQCzgUIxQ4FSIUARUiFDkUIxQTIRc4GCEhGDgXIQAEAAAAAAEWARoACAARAGEAmgAANyIGFBYyNjQmByImNDYyFhQGFy8BJjY/ATYnJicmIw8BIyImLwEmJyYiBwYPAQ4BIyIjLwEiBwYHBh8BFgYPAQYXFhcWMz8BMzIWHwEWFxYyNzY/AT4BMzIzHwEyNzY3NicHJyYjIgYPAgYiLwEuASsBDwEmJzc+AS8CNjcXFjMyNj8CNjIfAR4BOwE/ARYXBw4BHwIGB5YQFhYgFRUQCAsLEAsLcxgCBAEFGAQCCBMCBAMgAgYJAQUBBQ4cDgUBBgIIBAMDHQMEAhMIAgQaBAEFGAQCCBMCBAMgAwUJAQUBBQ4cDgUBBgIIBQIDHQMEAhMIAgQiFwYFCxIEAQQJEAkEAhMMBwUXCgYSCwIJBBIGChcGBgoSBAEECRAJBAITDAcFFwoGEgsCCQQSBgq8FiAVFSAWOQsQCwsQCw0UAgUNBBQDBRsVAwELBwUfBQEDAwEFIQUFCwEDFRsFAxYFDQQUBAQbFQMBCwcFHwUBAwMBBSEFBQsBAxUbBAQmCAIMCgYXAQEXDBACCA0PEAkcCwQQDw0IAgwKBhcCAhcMEAIIDQ8QCRwLBA8QDQAABwAAAAABBwEaACUALwAzADcAPgBFAE8AABMyFzYyFhUUBzMyFh0BFAYjFRQGKwEuAT0BIiY9ATQ2OwEmNTQ2BxQWOwE1NCYiBhcVMzUrARUzBxUUFjsBNRczMjY9ASM3NCYiBh0BMzI2cRAMCyAWBSsICwsIFhCDEBYHCwsIKgUWAwsIEgsPCzhecV1dSwsIOBM4CAtLJgsQCxMICwEZDAwWDwoJCwglCAtLEBYBFRBLCwglCAsJCg8WJQgLEwgLCy4lJSUTSwgLXl4LCEteCAsLCBMLAAAABQAAAAABBwEaACEAJwA/AEcAUAAAEyIGHQE2NzU0NjsBFRQWOwEVFAYrARQHMzI2PQE0LwEmIxcjIiY9AQcVIyIGHQEeATsBMjY9ATQmKwE1NCYiBhc1NDYyFh0BBzIWFAYiJjQ2cRAWCQoLCDgQDC8LCCUGKxAWCTYJCzwrBAV6CggLAQoIXggLCwgJFh8WEgsQCxMGCAgMCAgBGRYPLQUBJwgLLwwRgwgKCwgWD44MCDcISwYEK20TCwhKCAsLB0wHCxMQFRUjEwgLCwgTKggMCAgMCAAABAAAAAABBwEaACIAKAA9AFIAADcnJisBIgYdARYXFhc1NDYXMxUUFhczFRQGByMHMzI2PQE0ByImNzUXByIvAS4BNDY/ATYyFhQPARceAQ4BMyIuATY/AScmNDYyHwEeARQGDwEG/jYJC0MQFggGAwILCDgQDC8LCBwTLxAVQQQGATSvBAImAQEBASYDCAUDHx8CAQIFSQMFAgECHx8DBggCJgECAgElA9o3CBYPbgIGAgR8CAsBLgwQAYMICgESFg+PCwQGBCs1uwMlAQQDBAEmAwYIAx4fAgUGAwMGBQIfHgMIBgMmAQQDBAElAwAABgAA//8BLAEtACIAKwA0AEsAWACEAAA3PgE3NjcjIgc1PgE1NCYiBhUUFhcVDgEVFBYzMjY3JjUmLwE0NjIWFAYiJhciJjQ2MhYUBjcmNTQ2MhYVBgcmJzY1NCYiBhUUFwYHFyIOARQeATI+ATQuARceAQYjIi8BFRQOASY9AQcGIyImNj8BJy4BPgEfATU0NjIWHQE3Nh4BBg8BXwIMBwMFAhAMEBUbJxsVEBAVGxMPGAUPCQknERcQEBcRHAsRERcQEE0EGyccAQQICQMRFxADCggrFycXFycuJhcXJg4DAgQGAgMSBQgGEgIDBQUCAxMTAwIEBwQSBggFEgQHBAIDE1wICgIKCQlVAxoRFBsbFBEaA3IDGhETHBENGR0GAqEMEBAYEBDeEBcRERcQnwkKExwcEwoJBAIGBwsREQsHBgIECRcnLiYXFyYuJxdfAggIAgoVBAUBBgQVCgIICAIKCwIHBwICChUEBQUEFQoCAgcHAgsAAAcAAP//ASwBLQAiACsANABLAFgAZABtAAA3PgE3NjcjIgc1PgE1NCYiBhUUFhcVDgEVFBYzMjY3JjUmLwE0NjIWFAYiJhciJjQ2MhYUBjcmNTQ2MhYVBgcmJzY1NCYiBhUUFwYHFyIOARQeATI+ATQuAQc0NjIWHQEUBiImNRciJjQ2MhYUBl8CDAcDBQIQDBAVGycbFRAQFRsTDxgFDwkJJxEXEBAXERwLEREXEBBNBBsnHAEECAkDERcQAwoIKxcnFxcnLiYXFyYhBgcGBQgGCgUHBwkHB1wICgIKCQlVAxoRFBsbFBEaA3IDGhETHBENGR0GAqEMEBAYEBDeEBcRERcQnwkKExwcEwoJBAIGBwsREQsHBgIECRcnLiYXFyYuJxcvBAUFBCYEBQUEMQcKBwcKBwAAAAYAAAAAAS0BLAAWADkAQgBLAFgAdgAANyY1NDYyFhUUByYnNjU0JiIGFRQXBg8BFBcOASMiJjUmNjc1LgE1NDYyFhUUBgcVNjsBBgcOAQcWFycyNjQmIgYUFhc0JiIGFBYyNjcUDgEiLgE0PgEyHgEHNCYrATU0JiIGHQEjIgYUFjsBFRQeATY9ATMyNjWtBBsnHAUICQMRFxADCgg8DwUYDxMbARYQEBUbJxsVEAwQAgUDBwwCCQgcDBERFxERKBEXEREXEbsXJi4nFxcnLiYXJQYEHAUIBhwEBQUEHAYIBRwEBbIJChMcHBMKCQQCBgcMEBAMBwYCBF4dGQ0RGxQRGgNyAxoRExwcExEaA1UJCQoCCggCBo0QGBAQGBCyDBAQGBAQMRcmFxcmLicXFycXBAYcBAUFBBwGCAUcBAUBBgQcBQQAAAAEAAAAAAEHAS0AMAA5AEIASwAAJTQmIgYVFBYXDgErASIHNT4BNTQmIgYVBhYXFQ4BFRQWMjY1NCYnPgE7ATI2Nz4BNSc0NjIWFAYiJhcUBiImNDYyFjciJj4BMhYUBgEHHCcbFBADDgo4EAwQFRsnGwEWEBAVGycbFBADDgo4ERoDERXOERcRERcROREXEREXEWcMEQEQFxERxRMcHBMRGQQIDAlVAxoRFBsbFBEaA3IDGhETHBwTEBoDCQwVEQMaETgMEBAYEBDCDBAQGBAQbhAYEBAYEAACAAAAAADYARoAGAAhAAA3NCYnNTQmIgYdAQ4BFBYXFRQWMjY9AT4BByImNDYyFhQG2CEYBQgFGCEhGAUIBRghQhMcHCYcHJYZJQM5BAUFBDkDJTIlAzkEBQUEOQMlFhwmHBwmHAAAAAQAAAAAARoBGgAlAC4AVQBeAAA3FjI2NC8BMzIWHQEOARUUFjI2NTQmJzU0JisBNzY0JiIPAQYUHwEUBiImNDYyFicUBgcVFBY7AScmNDYyHwEWFA8BBiImND8BIyImPQEuATU0NjIWFSM0JiIGFBYyNqsDCAUCFiIMEBAVGycbFRAcEyIWAgUIAyUDA4ERFxERFxGWFhAQDCIWAwYIAyUDAyUDCAYDFiITHBAVGycbEhEXEBAXEb4DBggDFRAMVQQaEBQbGxQQGgRVExwVAwgFAiYDCAKiDBAQFxERnRAaBFUMEBUDCAYDJgIIAyYCBQgDFRwTVQQaEBQbGxQMEREXEREAAwAAAAAA9AEHABcAJAAxAAA3BwYiLwEmNDYyHwE1NDYyFh0BNzYyFhQnMjY9ATQuAQYdARQWFzI2PQE0LgEGHQEUFvFUAwgDVAMGCANEBQgFRAMIBl4EBQUIBQUEBAUFCAUFhl0DA10DCAUDTCAEBgYEIEwDBQhFBgQlBAUBBgQlBAZLBgQlBAUBBgQlBAYABgAAAAABIQEmACUALgA3AEAATQBaAAA3NDYyFhUUBxc2MzIWFAYiJjU0NycGBxUeARUUBiImNTQ2NzUuATciBhQWMjY0JhciBhQWMjY0JgciBhQWMjY0JjcUDgEiLgE0PgEyHgEHFA4BIi4BND4BMh4BURMcEwIVCAsNFBQbEwIUBQYLDRMcEw0LCw0hBgkJDAkJQQYJCQwJCU0GCQkMCQmoJ0JOQicnQk5CJxIiOkQ6IiI6RDoiyw4TEw4GBhUGExsUFA0HBhUEAjIDEgsNFBQNCxIDMgMSGgkMCQkMCTwJDAkJDAk2CQwJCQwJLSdCJydCTkInJ0InIjoiIjpEOiIiOgAEAAAAAAEIARoAJAAwADwASAAANw4BBy4BJz4BLgEOAhYXFQ4BHgEyPgEmJzUWFx4CPgIuASc0PgEeAg4BIyImFxQOAS4CPgEzMhY3Ii4BPgIeARUUBtgRGgMbKgYSFAQcIxsDFRISFQQaJBsEFhEhKwITGhoRBAwXrQoPEQwEBw4JCxE5ChAQDQMHDggMEWcJDgcEDBEPChG8ARQRAhYPBB0kGAEYJB0ETAQdJBgYJB0EMBsBDhQGCBUbGQ8uCQ4HBAwRDwoRnQkOBwQMEQ8KESQJEBANAwcOCAwQAAAAAAYAAAAAARoBGgARABoAMgA7AEQAYQAANzU0JiIGHQEOARUUFjI2NTQmByImNDYyFhQGJzQmIgYVFBYXFQ4BFRQWMjY1NCYnNT4BBxQGIiY0NjIWJyImNDYyFhQGPwEnJjQ2Mh8BNzYyFhQPARcWFAYiLwEHBiImNDf0BggFEBUbJxsVGgsRERcREYUcJxsVEBAVGycbFRAQFhMRFxAQFxEcDBAQFxERexUVAwUIAxUWAwcGAxUVAwYHAxYVAwgFA3AvBAYGBC8EGhAUGxsUEBpGEBcRERcQxBQbGxQQGgRMBBoQFBsbFBAaBEwEGpgMEBAXERGBERcRERcRBxUWAwcGAxUVAwYHAxYVAwgFAxUVAwUIAwAAAAAGAAAAAAEsARoAHAA0AD0ARgBTAHEAADcmND8BNjIWFA8BMzIWHQEmJzU0JisBFxYUBiInBxUeARUUBiImNTQ2NzUuATU0NjIWFRQGByIGFBYyNjQmNzQmIgYUFjI2FxQOASIuATQ+ATIeAQc0JisBNTQmIgYdASMiBhQWOwEVFB4BNj0BMzI2NYYDAyYCCAYDFiITHAoJEAwiFgMGCAJhEBYcJxsVEBAVGyccFhkMEBAXERERERcQEBcRzhcmLicXFycuJhclBgQcBQgGHAQFBQQcBggFHAQF5AIIAyUDBQgDFRwTDQIBCgwQFgIIBQICTAQaEBQbGxQQGgRMBBoQFBsbFBAaYhEXEBAXEYwMEREXERGLFyYXFyYuJxcXJxcEBhwEBQUEHAYIBRwEBQEGBBwFBAAAAAAGAAAAAAEsARoAFwAgACkARgBTAGUAADc0JiIGFRQWFxUOARUUFjI2NTQmJzU+AQcUBiImNDYyFiciJjQ2MhYUBjcmND8BNjIWFA8BMzIWHQEmJzU0JisBFxYUBiInFyIOARQeATI+ATQuARcHBiIvASY0NjIfATc2MhYUB3EcJxsVEBAVGycbFRAQFhMRFxAQFxEcDBAQFxEROQMDJgIIBgMWIhMcCgkQDCIWAwYIAiwXJxcXJy4mFxcmFTgDCAMSAwUIAwwxAwgFAuoUGxsUEBoETAQaEBQbGxQQGgRMBBqYDBAQFxERgREXEREXERYCCAMlAwUIAxUcEw0CAQoMEBYCCAUCFRcnLiYXFyYuJxc/OAMDEgMIBQIMMQMGBwMAAAAABwAAAAABGgEaABcAIAApADMAPABFAE4AADc0JiIGFRQWFxUOARUUFjI2NTQmJzU+AQcUBiImNDYyFiciJjQ2MhYUBhciBhQWMjY0JgcVIiY0NjIWFAYnNDYyFhQGIiY1NDYyFhQGIiZxHCcbFRAQFRsnGxUQEBYTERcQEBcRHAwQEBcREZ0TGxsnGxsUCxERFxERHgsPCwsPCwsPCwsPC+oUGxsUEBoETAQaEBQbGxQQGgRMBBqYDBAQFxERgREXEREXEV0cJxsbJxwBShAXEREXEHkICwsPCwtSCAsLDwsLAAAABAAAAAAA9AEtACIALgBLAG4AABMyHwEWHQEUBisBIiY9ATMVFBY7ATI2PQE0LwEmKwE1Ji8BFzIWFAYrASImNDYzNzIWHQEzMhYUBisBFRQGIiY9ASMiJjQ2OwE1NDYnMh8BHgEUBg8BBiImND8BIyIGHQEUBiImPQE0NjsBJyY0NqEMCDYJFhCDEBYTCwiDCAsDNgMEDQIECCwEBQUESwQFBQQmBAUcBAUFBBwFCAYcBAUFBBwGNQQDJgEBAQEmAwcGAxU0DBAGCAUbFDQVAwYBGQg3CAuPDxYWD5aWBwsLB48DAzcDAQUECLsGBwYGBwaDBQQcBggFHAQGBgQcBQgGHAQFSwMlAgMEAwIlAwYHAxYRCxMEBgYEExMbFgMHBgAAAAQAAAAAARoBGgAhAD0ARwBQAAA3JyYrASIGBxUeATsBJicjIiY9ATQ2OwEyHwEWHQEyFzU0ByM1NCYiBh0BIyIGFBY7ARUUFjI2PQEzMj4BJgcUFjsBNDcjIgYXMjY0JiIGFBbsNwgMVhAVAQEVEGUJB1UICwsIVgQDNgMJCkIcBQgGHAQFBQQcBggFHAQFAQZYBQQvAzIEBYMXISEuISHaNwgWD7wPFggLCwe8CAsDNwMDMQMzDBYcBAUFBBwGCAUcBAYGBBwFCAZoAwYICwZFIS4hIS4hAAUAAAAAARoBGgAlAC4ARgBPAFgAADc1NCYrATc2NCYiDwEGFB8BFjI2NC8BMzIWHQEOARUUFjI2NTQmByImNDYyFhQGJzQmIgYVFBYXFQ4BFRQWMjY1NCYnNT4BJzQ2MhYUBiImFxQGIiY0NjIW9BwTIhYDBggCJgMDJgIIBgMWIgwQEBUbJxsVGgsRERcREYUcJxsVEBAVGycbFRAQFksQFxERFxA4ERcQEBcRcFUTHBUDCAUDJQMIAiYCBQgCFhAMVQQaEBQbGxQQGkYQFxERFxDEFBsbFBAaBEwEGhAUGxsUEBoETAQaEAwRERcREZ0MEBAXEREABQAAAAABBwEaABgAIQAqAEkAWQAANyY0PwE2Mh8BFhQGIi8BFRQGIiY9AQcGIhciBhQWMjY0JgciBhQWMjY0JhcVFAYrASImPQE0NjsBMhYdARQWMjY9ATQ2OwEyFhUHIxQGIiY1IxUUFjsBMjY1YAICJgMIAiYCBQgDFQYHBhUDCCoEBgYIBQUEBAYGCAUFdhwTlhQbBQRLBAYQFxEFBEsEBRI4HCcbOBAMlgsR5AIIAyUDAyUDCAUDFQ8EBQUEDxUDEwUIBQUIBSUGCAUFCAYcORMbGxM5BAUFBAoLERELCgQFBQQKExwcEy8LERELAAAAAAMAAAAAAQcBGgAcADkASQAANyY0PwE+ATMxMhYfARYUBiIvARUUBiImPQEHBiIXFRQGKwEiJj0BNDY7ATIWFRQWPgE1NDY7ATIWFQcjDgEiJicjFRQWOwEyNjVhAwMlAQQCAQQBJgIFCAMVBQgGFQMIpBwTlhQbBQRLBAYQFxEFBEsEBRI5BBohGgM5EAyWCxHkAggDJQIBAQEmAwgFAxVaBAUFBFoVA1Q5ExsbEzkEBQUEDBEBEAwEBQUEChAVFRAvCxERCwAAAwAAAAABBwEaABsAOABIAAA3FzU0NjIWHQE3NjIWFA8BDgEjMSImLwEmNDYyFxUUBisBIiY9ATQ2OwEyFhUUFj4BNTQ2OwEyFhUHIw4BIiYnIxUUFjsBMjY1bhUGCAUVAwgFAiYBBAECBAElAwUInBwTlhQbBQRLBAYQFxEFBEsEBRI5BBohGgM5EAyWCxHMFloEBQUEWhYCBQgDJQIBAQIlAwgFQTkTGxsTOQQFBQQMEQEQDAQFBQQKEBUVEC8LERELAAQAAP//ASIA9AAdACUALgBFAAA3BwYXIyImPQE+ATsBMhYdASc1NCYrASIGHQEUFjM3IiY0NjsBDwEUFjsBNyMiBhcyFg8BBiImPwEjIiY/AT4BOwEyFg8BmAECA00QFgEVEJYQFRILCJYICwsICQQFBQRbBl4FBEkGTwMGzAYFBEgGEgsDDhIFBQEYAQQEOgUGAhBeAQkJFg9eEBYWEBMBEggLCwhdCAs4BQgGExwEBhMFDQsFWgcPCDQIBEsDBAgFKwABAAAAAAENARsAawAANxYVFAcGBxYdARQGIiY9ATYnNzY3Njc2NTQvATYnMQYPASYHJyYjBhcHDgEVFBcWFxYfAQYXFRQGIiY9AQYnJicmLwEmIy4BPgEXFhcWHwEWFxY3NSY3JicmNTQ3Jj8BNhcWFzYXNjc2HwEW/BEWER8FBAcFAgsGFA0QCQsQAgcGEBMGKCcHGQsFBwMICAoIEQ0VBAoBBAgFEQwLCAYHCAQEAQIBBgMHBgMGAgoHDBQBBx8RFxAFCAYECRAUKCgTEAoEBQnmFBorFhEFCg8tBAUFBC0PCg4DBQgOERsWEQgREAMNAQkJAQ8SDwkIFAobEQ4IBQMOCw0uBAUFBBkDAwMIBAoJBAIFBwMBAgUDBwINBAYEBQ0MBhEWKhoUGBUEAgIDDAoKDQMCAgQYAAAAAQAAAAABLAEtAFEAABMiDgEVFB4BFzI2PQEGJyYnMS4BLwEmNzYzMR4BHwEWFxY3NjcmJyY1NDcxJjczMhcWFzYzMhc2NzY7ARYPARYVFAcGBxYdARQWMz4CNTQuAZYpRSgaLh4FBRoPBwMCCAMDCQQCBAYLAwMJDgoKAQgeEBYQBggEBggKDQ8XERQNCggGBAgFARAWDx8KBQUeLhopRQEsKEUpIDoqCgQEGQUMBgcICgMBBgMBAQcEBA8BAQQMCAQNEycXERMUAwQJBQUJBAMTFAERFycSDQQIEykEBAoqOiApRSgAAAUAAAAAAQcBBwAQABcAHgAlACwAABMjIgYdARQWOwEyNj0BNiYjBzQ2OwEVIxciJj0BMxU3FAYrATUzNSM1MzIWFdiEExwcE4QTGwEcE6ARCx05HAsROYMRC1VxcVULEQEHHBOEExwcE4QTGy4LETiEEQtVcRwLEXETOBELAAAAAv/6//8BIQEmAA0AbwAAEyIOAR4CPgE1NC4CEysBLwE9ATQmJz4CNzY1NCYnPgE0Ji8BDgEPAiYHLwEuAScHDgEUFhcOARUUFx4CFw4BFQYiJi8CLgErAQcfARYfAR4BNzM3HQEPASMuAz4DMh4DDgIHkCxIIhE+VlAxFig1CQEDAgEEBQ0WDwMEBwYBAgMBAwQIBAgHHx8HCAQIBAMCAgIBBgcEAw8WDAMEBw8LAwQEAwUDBAIBCAICBgMQCgYGAgIDFSMXCAcVIiksKSIWBggXIxUBJTBRVj4RIkkrHTUoFv77AQMCIgYMBQEIEAoMDQoRBwMHCQkEAQECAgQECAgEBAICAQEECQkHAwcRCg0MChAIAQQIBQMHBgUEAgIBAwcCAgoJCgEBFQICAgcbJSwrJxwQEBwnKywlGwcAAAAKAAAAAAEaARoADAAVAB4AJwAvADgAPgBEAEoAUAAAEyIOARQeATI+ATQuAQciJiczDgEjMScmNjczFhQHIyc0NzMGFBcjJjcyFhcjPgEfATMWFAcjNjQnNyMmJx4BJwYHIz4BBzMWFy4BFzY3Mw4BliQ8IyM8SDwjIzwkCRIFQAUSCSMDAQJGAgJGTQY0AgI0BnAJEgVABRIJNjQHBzQCAisuBgwVIXgMBi4KISsuBgwVIXgMBi4KIQEZIzxIPCMjPEg8I/MeGhofTBEoEhIoEiYTEhImEhKEHxoaHwFKEyYSEiYSEyATBhogEyATGp0gEwYaIBMgExoAAAAEAAAAAAEHASwAIwA/AEsAZAAANxUUBisBIiYnNTQ2OwEyFhQGKwEiBh0BFBY7AT4BPQE0PgEWJzQmIgYdASMiBhQWOwEVFBYyNj0BMzI+ASYrARcjIgYUFjsBMj4BJjcjIgYUFjsBBwYUFjI/ARUUFjI2PQE0JiP0FhCDEBUBFhBCBAUFBEIICwsIgwgLBQgGXgUIBhwEBQUEHAYIBRwEBQEGBBwcSwQFBQRLBAUBBkc4BAUFBCEoAgUIAygFCAYGBLJ6DxYWD7wPFgUIBQsIvAgLAQoIegQFAQYiBAUFBBwGCAUcBAYGBBwFCAZeBgcGBgcGzgUIBigDCAUDKCIEBQUEOQQFAAADAAAAAAD0AS0AIQAnAEoAABMyHwEWHQEUBisBIiY9ATMVFBY7ATI2PQEjIiY9AScmLwEXFBY7AS8BMh8BHgEUBg8BBiImND8BIyIGHQEUBiImPQE0NjsBJyY0NqEMCDcIFhBwEBYTCwhwCAsvDBABAgQIIgUEKzRVBAMmAQEBASYDBwYDFTQMEAYIBRsUNBUDBgEZCDcIDI4PFhYPg4MICwsIgxEMLgIFBAhBBAY1KQMlAgMEAwIlAwYHAxYRCxMEBgYEExMbFgMHBgACAAAAAAEHAS0AJQBIAAATHgEVFAcXFhQGIi8BBiMiLgE1NDczFwYVFB4BMj4BNTQmJzc2NScyHwEeARQGDwEGIiY0PwEjIgYdARQGIiY9ATQ2OwEnJjQ2lhkfEkgDBggCSBgdFycWBQ8DBRIeJB4SGBICAkIEAyYBAQEBJgMHBgMVNAwQBggFGxQ0FQMGAQEILBsdGEcDCAUCSBIWJxcODgUMCxIeEREeEhUhBwMGBS8DJQIDBAMCJQMGBwMWEQsTBAYGBBMTGxYDBwYAAAAAAgAAAAABBwC8AA0AGwAANzMyFhQGKwEiJj4BNzMnMx4BFAYHIyImNDYzNy/OBAYFA9AEBgEEA9DOzgQGBQPQBAUEA9CDBQgFBQcFATkBBQcFAQUIBQEAAAcAAAAAARoBIwAPABMAIwAnADcAOwBTAAA3IyIGHQEUFjsBMjY9ATQmByM1MzcjIgYdARQWOwEyNj0BNCYHIzUzNyMiBh0BFBY7ATI2PQE0JgcjNTMnMzI2NCYrATc2NCYiDwEGFB8BFjI2NCd1HAYICAYcBggIChMTTxwGCAgGHAYICAoTE08cBggIBhwGCAgKExPU3QQFBQTdDAMGCAIdAgIdAggGA84IBp8GCAgGnwYIqJYSCAZ6BQkJBXoGCINxEggGVAYICAZUBghdSzgFCAYMAggGAxwDCAMcAgUIAwAAAAEAAAAAARoBGgAnAAA3MzI2NCYrATU3FxYyPwEXFjI2NC8BJiIPAScmIg8BNS4BIgYdARQWHPQEBQUE6jgfAggDTh4DCAUCJgMHA04fAggDMQEFCAUFEwUIBlA4HwICTh8DBggCJgMDTh8DAzF/BAUFBPQEBQAAAAcAAAAAARoBGgAQABkAIgAsADUAPwBJAAA3FBY7ATI2NCYrATUuASIGFRcUFjI+AS4BBhc0NjIWFAYiJgciJjQ2MhYUBiM3IgYUFjI2NCYXFBYyNjQmIgYVNzQ2MhYUBiImNRMFBPQEBQUE6gEFCAWpFSAVARYgFRILEAsLEAtdEBYWHxYWEAEICwsPCwseFh8WFh8WEwsPCwsPCxwEBQUIBuoEBQUELxAVFSAVARYQCAsLEAsLQxYfFhYfFjgLDwsLDwtdEBYWHxYWEAEHCwsPCwsHAAAAAAYAAAAAARoBGgAPAB8ALwA/AE8AXwAANzMyNj0BNCYrASIGHQEUFjc0NjsBMhYdAQ4BIyciJjUHIyImNzU0NjsBMhYdARQGJw4BHQEUFjM3MjY9ATQmDwEjIiY9ATQ2OwEyFh0BFAYnIgYVFwYWMzcyNj0BNCYj5hwKDQ0KHAoODgUDAhwCAwECAhwCAz0cCg4BDQocCg4OJgIDAwIcAgMDAl4cCg0NChwKDg4mAgMBAQMCHAIDAwITDQrYCg0NCtgKDe8CAwMC2AIDAQICFw0KjQoNDQqNCg2pAQICjQIDAQICjQIDAagNCmcKDg4KZwoNgwMCZwIDAQICZwIDAAAGAAAAAADPAPQACAARABsAJAAuADcAADcUBiImNDYyFjciBhQWMjY0JgciBhQWMjY0JiMzIgYUFjI2NCYHIgYUFjI2NCYjMyIGFBYyNjQmgwsPCwsPCzkICwsPCwtSCAsLDwsLCEwICwsPCwtSCAsLDwsLCEwICwsPCwvhCAsLEAsLCwsQCwsQC0sLEAsLEAsLEAsLEAtLCxALCxALCxALCxALAAcAAAAAARoBGgAjACcAKwBPAFMAVwCBAAABIyIGHQEjNTQmKwEiBh0BFBY7ATI2PQEzFQYWOwEyNj0BNCYHIzUzFyM1MxUjIgYdASM1NCYrASIGHQEUFjsBMjY9ATMVBhY7ATI2PQE0JgcjNTMXIzUzBxQGIyImPQE0JicmNDc+AT0BNDYzMhYUBiMiBh0BFAYHHgEdARQWMzIWAQc5CAslCAYcBggIBhwGCCYBCwg5BwsLixIShDk5OQgLJQgGHAYICAYcBggmAQsIOQcLC4sSEoQ5ObMFBBAVBAoFBQoDFhAEBQUECAsFBgYFCwgEBQEGCggTBQUJCQUcBgkJBgQTBwsLBzkICjgTJjleCwgSBAYICAYcBggIBgUTCAsLCDgICzgTJjhUBAYWECUYCgUDCwMFCQ8vDxYFCAYKCDARDwUFDhonCAsFAAAAAQAAAAABGgEHAB0AADciLwEmJyY0PgEzMhYfATc+ATMyFxYXFhQGDwEGI5YDA2kJBQYQIBYOGgoLCwoaDhkSDgcGCgpoAwQkA2gJDA4gIBQKCgsLCgoNCxMOGxkKaAMAAgAAAAABGgEHAB0AMAAANyIvASYnJjQ+ATMyFh8BNz4BMzIXFhcWFAYPAQYjJyIGFB8BNzY0JiIPAQYiLwEmI5YDA2kJBQYQIBYOGgoLCwoaDhkSDgcGCgpoAwQ9Fh4QYWIOHSwPEQMIAxIPFSQDaAkMDiAgFAoKCwsKCg0LEw4bGQpoA9AeKg9iYQ8qHw8SAgISDwAAAAACAAAAAAEHAQcALwBAAAA3Mh4BFA4BIi4BJy4BIgYVHgIyPgE0LgEHJgYHNTQmIgYdARQWFzcyNjQmKwE+ARc0JiIGHQEUFjsBMjY0JisBlhksGRksMSkaAgEGBwUCIDE8Mx4eMx8ZLA8GCAUFBDgEBgYEJQ0nFwYHBgYEJQQFBQQc9BksMiwZFycXBAUGBB0uGx4zPjMfAQEVEh0EBgYEOAQFAQEFCAUSFC8EBQUEOAQGBggFAAAAAgAAAAABBwEaACEAQAAAEzYyHwEWBxUWBisBIiY9ATQmKwEiBh0BFAYrASImPQE0PwEHBh0BFBY7ATI2PQE0NjsBMhYdARQWOwEyNj0BNCeJBg4GWwkBAREMJQwQBgQSBAYQDCUMEAhoWwMGBCUEBhAMEgwRBQQlBAYDARQFBVYIDGgMEREMLgQGBgQuDBERDGgMCElWAwRoBAYGBC4MEREMLgQGBgRoBAMAAAQAAAAAARAA9AAMACkATQBVAAAlFAYrASImNDY7ATIWJzI2PQEzFRQWMjY9ATQmIgYdASM1NCYiBh0BFBY3NTQ2OwEyFhcUBgcWFxYfARYUBiMiJyYnMSYnJisBFRQGIiY3MzI2NCYrAQEQBgTgBAYGBOEDBuEEBTkFCAUFCAY4BQgFBX4FBCoSGAEOCgcGAwQDBQUEBwQCBAYGCQ4SBggFEyAKDg4KIC8EBQUIBQUrBQQ4OAQFBQSDBAYGBDg4BAYGBIMEBQmDBAYZEQ0UBQkNBw0LAgoFBgQMFQkNOAQFBU8OEw4AAAAFAAAAAAEHARoADAAQABQAOwBEAAA3HgE3MTY3Fw4BIiYnNyM1OwEVIzUnMhYVFAYHFTMXFTMXFQcjFQcjByc1Iyc1Iyc1NzM1NzM1LgE1NDYHFzMVPwEzNSNyCRgNDgsNCRkcGQoVExNLExwICwYESwkKCgoKCTovEC8KCQkJCQpLBAYLQy8JIgc1lo0JCAMDCg0JCwsJIBMTE2cLCAQJAhYJJgoSCTkJNActDDYJEgooBxUDCAUIC7kCKSYDcAADAAAAAAEaARoADwAqAEEAABMiBh0BFBY7ATI2PQE0JiMXKwEOARUHBgcGIicmLwE2JisBNTQ2OwEyFhUHMxUWFx4BMjY/ATY3NTMVFAYrASImNUIUGxsUqBQbGxQdQgIDBAEBAwkwCQMBAQEGBEEQDKgMEeE5AgQGGSQZBgICAjoRDKgMEAEZGxSoFBsbFKgUG4MBBQMGCAYSEgYIBgQFVAwREQxnAwgHDg8PDgQFBgNBDBAQDAAAAQAAAAABBwD0ACEAADcyFh0BFBY7AScmNDYyHwEWFA8BBiImND8BIyImPQE0NjMvBAURC5IxAwYHA0IDA0IDBwYDMZITHAYE9AYEOAwQMgIIBgNCAggDQgIFCAMxHBM4BAYAAAQAAAAAARoBBwAJABMAHwAsAAATMxUjFTMVIyc1NyMVMxUjFTM3NQcVFAYiJj0BNDYyFgc0JiIGHQEUFjI2PQEcLyUlLwn9LyYmLwlLIS4hIS4hEhYgFRUgFQEHE7wSCc4KE7wSCc5UJhchIRcmFyEhFw8WFg8mDxYWDyYAAAAABAAAAAABGgEaAAsAFAAhAC4AADc0JiIGHQEUFjI2NTcUBiImNDYyFiciDgEUHgEyPgE0LgEHJj4BMh4BFA4CLgGfBQgFBQgFBQgMCAgMCA4kPCMjPEg8IyM8lAEfMz4zHx8zPjMenwQGBgQ4BAUFBF4GCAgMCAhOIzxIPCMjPEg8I4MfMx8fMz4zHgEfMwAABQAAAAABGgEaAA8AEwAkACgAUwAANzMyNj0BNCYrASIGHQEUFjc1MxUHMzI2PQE0JisBIgYdARQWMz0BMxUnFzEWFA8BBiImND8BIxUUBisBIiY0NjsBNSMiJjQ2OwEyFh0BMycmNDYyzjkHCwsIOAcLCwc5OTkHCwsIOAcLCwc5dCYDAyYCCAYDFVALCCUEBgYEJSUEBgYEJQgLUBUDBgi8Cwc5BwsLCDgHCxI5OagLBzkHCwsHOQcMEzk5lCYDBwMmAgUIAxUTBwsFCAU5BQgFCwcTFQMIBQAAAAMAAAAAARoBBwAjADIAOAAANzQ2OwE2Fh0BFAYHJi8BPgEnNzQmKwEiBhUXFBY7ARUjIiY1NyYGHQEUHgE2PwEzMjYnBzUXIyIHExYPvA8WDAoCAwgHCgEBCwi8CAsBCghLSw8WkwQMBAUGAhkqBwQESCsYBQPhEBUBFhBwDBIFBAQIAQoIcAgLCwhwCAsTFhAiBQUGcQMFAgIDIQwEED4rBAAACQAAAAABGgEcAA8AHwAxAEMAUwBjAHYAigCTAAATIiMmBwYuATY3NhceAQ4BFxYyPgEnLgEnJg4BFhceAQciLgE3PgE3Nh4BBgcOAQcGIwciJicmNDc+AR4BBwYUFxYGBxcWMjYmJy4BJy4BDgEXHgEXIicuAT4BFxY3Nh4BBgcGNxYzMTI3PgE3Ni4BBgcOAQcOATciMS4BNzY0JyY+ARYXFhQHDgEjJxQGIiY0NjIWrwEBFxcDBwIFBBoaBAUCBUEDCAYBAgcSCwMHBQIDCQ+8AwYBAgcSCwMHBQIDCQ8GAwUSBAUBAgIBBwcFAQICAQUELQIIBQIDCQ8GAggHAQIHElQNDQQFAgYEFxcEBgIFBA0vAwUDAgsSBwIBBwgCBg8JAwI9AQQFAQMDAQUHBwECAgEFBGQLEAsLEAsBBAUFAQUHBwEFBQEHBwQvBAQHAwsSBwIBBwgCBg8NBAcDCxIHAgEHCAIGDwkEXQQEDRoNBAUCBwMMFwsDBwFLAQcIAgYPCQMCBQcDCxIdAgEHBwUBBQUBBQcHAQIZBAEHEgsDBwUCAwkPBgIIRQEHAwsYCwMHAgUEDRoNBAQiCAsLEAsLAAADAAAAAAEaARoACAAqAEwAADcyNjQmIgYUFiczMjY0JisBPgEyHgEVBhYyNjU0LgEiBgc1NCYiBh0BFBYXIyIGFBY7AQ4BIi4BNS4BIgYVFB4BMjY3FRQeATY9ATQmlggLCxALC3I4BAYGBB8PND0zHwEGCAUjPEc8EgUIBQX4OAQGBgQfDzQ9Mx4BBQgFIzxHPBIFCAUFgwsQCwsQCzkFCAUaHx8zHwQFBQQkPCMiHSMEBgYEOAQFSwYIBRoeHjMfBAUFBCQ8IyIdIwQFAQYEOAQGAAMAAAAAARoBGgAIABUAIgAANxQGIiY0NjIWBxQeATI+ATQuASIOARc0PgEyHgEUDgEiLgGpCxALCxALliM8SDwjIzxIPCMTHjM+Mx8fMz4zHpYICwsQCwsIJDwjIzxIPCMjPCQfMx8fMz4zHh4zAAABAAAAAAD+AQcAGwAAEyMiBhQWOwEHIyIGFBY7ATI2NCYrATczMjY0JvRxBAUFBC9IMgQFBQRxBAUFBCtILgQFBQEGBQgFvAUIBgYIBbwFCAUAAAACAAAAAAEaAQwAJgA6AAA3IyImPQEjIiYvASY2PwE2FhceATI2Nz4BHwEeAQ8BDgErARUUBiMnMzU0NjsBNycOASImJwcXMzIWFdiEBAUhAwUBDgEEA04DBwIEExgTBAIHA04DBAEOAQUDIQUEenAGBCMKPgcaIBoHPgojBAYmBQR6BAMzBAYCGwEDBAwODgwEAwEbAgYEMwMEegQFEnoEBSUVDRAQDRUkBgQAAgAAAAABBwEHACgAUQAAEyIGHQEUBgcGFBceAR0BFBYzPgE0JiMiJj0BNCYnPgE9ATQ2MzI2NCYzMhYdARQWFxYUBw4BHQEUBiMuATQ2MzI2PQE0NjcuAT0BNCYjIiY0Nl4QFgQJBQUJBBYQBAUFBAgLBgUFBgsIBAUFbBAWBAkGBgkEFhAEBQUECAsGBQUGCwgEBQUBBxYQJg4KBQIMAgUKDiYQFgEFCAULCCcRDgUFDhEnCAsFCAYWECYOCgUCDAIFCg4mEBYBBQgFCwgnEQ4FBQ4RJwgLBQgGAAMAAAAAAKkA9AAIABEAGgAANyImNDYyFhQGByImNDYyFhQGBxQWMjY0JiIGlggLCxALCwgICwsQCwsbCxALCxALzgsQCwsQC0sLEAsLEAs4CAsLEAsLAAADAAAAAAEaARoACAAwAFEAADcUBiIuATYyFhcUDgErAQ8BBisBFRQPAQYrARUUDwEGKwEiJj0BND8BJic0PgEyHgEHNC4BIg4BFRQXFg8BFTM1NDY7ATU0NjsBNzY7ATI+ATXhCxAKAQsQCzgWJxcZDwYCAhACBAMEGAMEAwMrCAsFXAMBFycuJxYSEh4kHhIFAgVfJQUEHQUEFxEDAx0SHhLOCAsLEAsLERcnFg8DARgEAwQDGAQDAwMLCB0IBlsMDRcnFhYnFxIeEhIeEgwMBQVgHRwEBRwEBhACEh4SAAIAAAAAARoBBwAhAC8AABMyFh0BFBY7AScmNDYyHwEWFA8BBiImND8BIyImPQE0NjMXHQEUFj4BPQEuASIGFRwEBhAMkjIDBggCQgMDQgIIBgMykhQbBQTrBgcFAQUIBQEHBgQ4DBAxAwgFAkIDCAJCAwYIAjIbFDgEBRKpAgMFAQUEqgQEBgMAAAAAAgAAAAABGgD+ACEALwAANzI2PQE0NjsBBwYUFjI/ATY0LwEmIgYUHwEjIgYdARQWMzcdARQWPgE9AS4BIgYVHAQGEAySMgMGCAJCAwNCAggGAzKSFBsFBOsGBwUBBQgFOAYEOAwQMgIIBgNCAggDQgIFCAMxHBM4BAa8qQIDBQEFBKoEBAYDAAIAAAAAARoA/gAMACgAACU1JjYyFhcVFA4BJjUnNSY2NzMnLgE/ATYyHwEeAQ8BBiIuAT8BIyImAQcBBQgFAQUHBuEBBQOnMwIBAgEDBwJEAgECQwMHBgECNKUEBUupAwYEBKoEBQEFA1UBBAUBMgIHAwEDAkMCBwNEAgQHAzQEAAAAAAYAAAAAARoBBwAvADIAOQBGAE0AUAAANzEVFBYyNjUnMzI2NCYrASIGFBY7AQcVFBYyNjUnMxUjIgYUFjsBMjY0JisBNTMHJxcjFyImJzMOARcUBisBIiY0NjsBMhY3IiYnMw4BJzcXvBsnGyEPAwYGA88EBQUEDyEbJxshNC8LERELcQsREQsvNCFoGC8XCQ4DNQMPhAUEcQQFBQRxBAUJCQ4DNQMPIBcYowQTGxsTVQUIBgYIBVEEExsbE1WWERcQEBcRllFBOyYLCAgLQQQGBgcGBj4LCAgLJjs7AAAABgAAAAABLAEaABMAFwApADcAQABSAAA3FxYyPwE+ATQmLwEmIg8BDgEeATcXBycXBycGHgEfARYyPwE2PwE+ATQHJwYUFh8BFjI/ASc0PwEiBhQWMjY0JhcHBiIvASY0NjIfATc2MhYUBy9dBQoFXQUEBAVdBQoFXQUFAQRsXl5ezG5uAwEEBV0FCgUZEhwWBQVxbgIEBV0FCgUKAQFKGCAgLyEhByEDBwMTAwYIAgwbAggGA744AwM4AwgKCQI5AgI5AgkKCEY5ODglQkIFCQkDOAMDDxcFDQMJCWxCBAoJAzgCAgYKBQctIS8hIS8hMSEDAxMCCAYDDBoDBggCAAUAAAAAASwBGgATABcAKQA3AEAAADcXFjI/AT4BNCYvASYiDwEOAR4BNxcHJxcHJwYeAR8BFjI/ATY/AT4BNAcnBhQWHwEWMj8BJzQ3FzI2NCYiBhQWL10FCgVdBQQEBV0FCgVdBQUBBGxeXl7Mbm4DAQQFXQUKBRkSHBYFBXFuAgQFXQUKBQoBAUoXISEvICC+OAMDOAMICgkCOQICOQIJCghGOTg4JUJCBQkJAzgDAw8XBQ0DCQlsQgQKCQM4AgIGCgUHRCEvICAvIQAAAAAEAAAAAAEHARoAFAAYACcANgAANyIvAS4BNDY/ATYyHwEeARQGDwEGJwcXNwcXNxYOAQ8BBiIvAS4BNh8BNxYUBg8BBiIvAS4BNpYFBV0FBAQFXQUKBV0FBAQFXQUFXl5ezG5uAwEEBV0FCgVdBQUBAm5uAwUFXQUKBV0FBQGDAzgDCAoJAjkCAjkCCQoIAzgDhDk4OCVCQgUKCAM4AwM4AwgKKkJCBAoJAzgDAzgDCQoAAAACAAAAAAEaARoADwAaAAATIyIGHQEUFjsBMjY9ATQmBzUzMhYdARYGByPqqBQbGxSoFBsbs58MEAERDJ8BGRsUqBQbGxSoFBvz4REMqAwQAQAAAAACAAAAAAEaARoADwAZAAA3FRQWOwEyNj0BNCYrASIGFyImPQE+ARczFRMbFKgUGxsUqBQbLwwRARAMn+qoFBsbFKgUGxvYEAyoDBEB4AAAAAMAAAAAARoBGgAPABkAIwAAEzMyFh0BFAYrASImPQE0NgcVFBY7ATUjIgYXMjY9ATQmKwEVQqgUGxsUqBQbGwgQDC8vDBDEDBERDC4BGRsUqBQbGxSoFBsvqAwQ4RHQEAyoDBHhAAAABQAAAAABGgEaAAsAFwAjADMARAAANzIWFAYrASImNDY7ATIWFAYrASImPgE7ATIWFAYrASImNDYzNzIWHQEUBisBIiY9ATQ2MxUiBgcVHgE7AT4BJzU2JisBVAQGBgQSBAYGBEsEBQUEEwQGAQUESwQFBQQTBAUFBDgUGxsUqBQbGxQMEAEBEAyoDBEBAREMqPQGCAUFCAYGCAUFCAYGCAUFCAYlGxSoFBsbFKgUGxIRDKgMEQEQDKgMEAAEAAAAAAEaARoADwAZAB0AJwAAEyMiBh0BFBY7ATI2PQE0Jgc1NDY7ARUjIiY3NTMVFxQGKwE1MzIWFeqoFBsbFKgUGxvYEAwJCQwQOHA5EQwJCQwRARkbFKgUGxsUqBQb16gMEeEQO5aWLwwQ4REMAAAAAAMAAAAAARoBGgAZACkANAAANzIWHQE3NjIeAQ8BBiInMScmNDYyHwE1NDY3MhYdARQGKwEiJj0BNDYzFSIGBxUzNTQmKwGWBAUMAwgFAQMcAwgDHAIFCAMMBVgUGxsUqBQbGxQMEAHiEQyo9AYERwwDBQgDHAMDHAMIBQMMRwQGJRsUqBQbGxSoFBsSEQx5eQwQAAAEAAAAAAEaARoADwAWABoAIQAAEyMiBh0BFBY7ATI2PQE0JhcVIzUzMhYHMzUrARUjNTQ2M+qoFBsbFKgUGxsJJgkMEalwcBMlEAwBGRsUqBQbGxSoFBsveZYRhZaWeQwRAAAAAwAAAAABGgEaAA8AFgAgAAA3FRQWOwEyNj0BNCYrASIGNxUjNTQ2OwIyFh0BFAYrARMbFKgUGxsUqBQbloMQDHouDBERDC7qqBQbGxSoFBsbCZZ5DBERDKgMEAADAAAAAAEaARoADwAZACMAABMjIgYdARQWOwEyNj0BNCYXFAYrASImPQEzNSM1NDY7ATIWFeqoFBsbFKgUGxsJEQyoDBDh4RAMqAwRARkbFKgUGxsUqBQb1wwQEAwcE3kMEREMAAAAAAMAAAAAARoBGgAPABYAIAAAEyMiBh0BFBY7ATI2PQE0JgcyFh0BIzUHIyImPQE0NjsB6qgUGxsUqBQbGxQMEYQSLwwQEAwvARkbFKgUGxsUqBQbEhEMeZbhEAyoDBEAAAIAAAAAARoBGgAPABoAACUUBisBIiY9ATQ2OwEyFhUHMzU0JisBJgYHFQEZGxSoFBsbFKgUG/PhEQyoDBABQhQbGxSoFBsbFHl5DBABEQx5AAAAAAMAAAAAARoBGgAZACkAMwAANyYiDwExBhQfARYyNjQvATMyNjQmKwE3NjQnIgYdARQWOwEyNj0BNCYjFTIWFRcUBgcjNa8CCAMcAwMcAwgFAwxHBAYGBEcMA3AUGxsUqBQbGxQMEAERDHm5AgIcAwgDHAIFCAMMBQgFDAMIYxsUqBQbGxSoFBsSEQyoDBAB4gAAAAADAAAAAAEaARoADwAZACMAADcVFBY7ATI2PQE0JisBIgYXIzUzMhYdARQGJzQ2OwEVIyImNRMbFKgUGxsUqBQb12dnDBER0BAMLy8MEOqoFBsbFKgUGxvY4REMqAwQxAwR4RAMAAAAAAIAAAAAARoBGgAPABkAABMyFh0BFAYrASImPQE0NjMXMjYnNTYmKwEV6hQbGxSoFBsbFKgMEQEBEQxnARkbFKgUGxsUqBQb8xAMqAwQ4AAAAwAAAAABGgEaABkAKQAzAAA3NjIfATEWFA8BBiImND8BIyImNDY7AScmNDcyFh0BFAYrASImPQE0NjMVIgYHFxQWOwE1fQIIAxwDAxwDCAUDDEcEBgYERwwDcBQbGxSoFBsbFAwQAQEQDHq5AgIcAwgDHAIFCAMMBQgFDAMIYxsUqBQbGxSoFBsSEQyoDBHiAAAAAAMAAAAAARoBGgAPABkAIwAAEyMiBh0BFBY7ATI2PQE0Jgc1NDY7ARUjIiY3FAYrATUzMhYV6qgUGxsUqBQbG9gQDGdnDBDhEQwuLgwRARkbFKgUGxsUqBQb16gMEeEQDAwQ4REMAAAAAgAAAAABGgEaAA8AGgAAEzIWHQEUBisBIiY9ATQ2Mxc1IyIGBxUeATsB6hQbGxSoFBsbFGdnDBABARAMZwEZGxSoFBsbFKgUG/PhEQyoDBEAAAAAAgAAAAABGgEaAA8AGgAANxUUFjsBMjY9ATQmKwEiBhcjNTQ2FzM2Fh0BExsUqBQbGxSoFBv04RAMqAwQ6qgUGxsUqBQbG7OfDBEBAREMnwAGAAAAAAEaARoADwAfAC8APwBPAF8AABMyFh0BFAYrASImPQE0NjMVIgYdARQWOwEyNj0BNCYjFzIWHQEUBisBIiY9ATQ2MxUiBh0BFBY7ATI2PQE0JiM1MhYdARQGKwEiJj0BNDYzFSIGHQEUFjsBMjY9ATQmI2cMEBAMOAwQEAwEBQUEOAQGBgSWDBAQDDgMEBAMBAUFBDgEBgYEDBAQDDgMEBAMBAUFBDgEBgYEARkQDM4MEBAMzgwQEgYEzgQFBQTOBAaEEAw4DBAQDDgMEBIGBDgEBQUEOAQGqBAMOAwQEAw4DBASBgQ4BAUFBDgEBgAABgAAAAABHAEHAA8AHwAvAD8ATwBfAAA3NDY7ATYWHQEUBisBIiY1NyIGHQEUFjsBMjY9ATQmIxc0NjsBNhYdARQGKwEiJjU3IgYdARQWOwEyNj0BNCYjFy4BDwEOAR8BHgE/AT4BLwE2Fh8BFgYPAQYmNSc0NjMTDQoKCQ4OCQoKDRcCAwMCCgEDAwEqDQoJCg4OCgkKDRcCAwMCCQIDAwJiAxEJCwkJBDcEEQkLCQgDTwIDATcBAgILAQQ4AQLvCg0BDgqyCg0NCrcDArICAwMCsgIDBQoNAQ4KsgoNDQq3AwKyAgMDArICAyIJCAMEAxMJiQkHAwQDEgmFAQICiAIEAQMBAQKJAgQAAAMAAAAAASwBBwAMACsAWQAANyIOARQeATI+ATQuARcHFxYOAS8BBwYuAT8BJy4BNjsBNz4BFh8BMzIWBg8BIiYvATM9ASMvAS4BJzQ+AjIeAhU2NyYnLgIiDgIVMR4BHwEeATsBJifYFycXFycuJhcXJh0XCQEECAQXGAMIBQIJGAMBBQUdCQEIBwIIHQUFAQOnBAQBAxgdBgIMDwIKExgaGBIKCQoBBgYYHyEfGA0CEQ4NAw4KFwUDqRcnLiYXFyYuJxdSER0ECAIDEhIDAggEHREDCQYdBAMDBB0GCQMfBAINCQobAgocEA0ZEwoKEhcNBAINDQ8XDQ0YIBETIgw4CAoJCQAAAAMAAAAAAOsBBwATAB0AOQAANzQ+ATIeARUUBgcGDwEjJyYnLgEXMwcOASsBIiYnNyIOARUUFhcWHwEeATsBMjY/ATY3PgE1NC4BI1QSHiQeEgsJBgIHPgcCBgkLKDQDAQUDHAMFARcXJxYNDAIBDwMPCRwJDwMPAQIMDRYnF7ISHhISHhINGQkGBxgYBwYJGVoMAwQEA8gXJxcRHwwDAjcJCwsJNwIDDB8RFycWAAAABAAAAAABGgEtADAAYQBsAJgAADcfAR4BHwEUFjMxMj8CPgE/ATI2NCYjJyYvASYvAS4BIzEiBg8BBg8BBg8BDgEUFhc0LwEGBwYPAiMvAS4BJz4CNzY3JjU0NwYHDgIVMR4BHwEeATczMjY/ATY3JicHMQ4BByMiJi8BMzc0LwEVLgEvAS4BIgYPAQ4BDwEOARQWHwEeAR8BHgEzMTI2NTc+AT8BPgE0mg4FBAcCBgMCAgECBQIKBw4CAgICDwQEAwUCBQECAgIDAQQDBAIEBg4CAgJCAQQCAwcMAgg5BwIMDwIBChIMBAUDAQcHEBcNAREODQMPCRoJDgIPDQcBATMBBAMZAwUBAzBqAgsGCAEEAQIDAgEDAggFDAECAgEMBQgCAwECAgEDBAIHBgsCAfgFAgIHBhACAgECDwcKAgUDBAMFAgIDBQcOAgICAg4HBQEEAgQBAwQDWQEBAQUGDgkCIBsCChwQDRkTBQIBBQYEBAIDBhggERMiDDgICwEMCDoLDwIDVAMDAQQCDXMBAQQBAggFDAECAgEMBQgBBAECAwIBBAEIBgsBAgIBCwYIAQQBAgMAAAADAAAAAADrAQcAGQAkADkAADcuAiIOAhUxHgEfAR4BOwEyNj8BPgE1NAcxDgEHIyImLwEzNwYPAiMvAS4BJz4DMh4CFQbkBhgfIh8XDQERDg0DDwkaCQ4CDw4QPwEEAxkDBQEDMCIHDAIIOQcCDA8CAQoSGBoYEwoB1A8XDQ0YIBETIgw4CAoMCDoMIhIRhgMDAQQCDUwOCQIgGwIKHBANGRMKChIXDQ8AAAAAAgAAAAABGgEaACQAPQAAEyIGHQEeATsBMjY9ATQ2MhYdARQGKwEiJj0BNDY7ATIWFAYrATc0NjsBMhYdARQGIiY3NQcGIiY0PwEjIiZCDBEBEAyoDBAGCAUbFKgUGxsUPAQGBgQ8YgYEYgQFBQgGAVMCCAYDUksEBgEHEQyoDBAQDDwEBgYEPBQbGxSoFBsFCAYKBAUFBGIEBgYES1IDBggCUwUAAAAAAwAAAAABBwDhABsANwBEAAA3MzIeAQcWBgcjIiY0NjM3FjY0JicjIiY0NjczIzMyFhQGByMiBhQWFzMyFhQGByMiLgE1NDY3MwczMhYUBgcjIiY0NjeyExIeEgEBJRkXBAUEAxUTHBoSFgQFBAMVXhMEBQQDFRMcGhIWBAUEAxUSHhEkGhYTXgQFBANgBAUEA+ESHhIaJgEFBwYBARwmGwEGBwUBBQgFARsmGwEGBwUBER8RGyUCOAYHBQEFCAUBAAAAAAQAAAAAAQcA9AAMABkAJQAxAAA3JjY7ATIWFAYrASImFyMiDgEWOwEyNjQmIwcjIgYUFjsBPgImBzMyFhQGKwEiJjQ2JgEGBJYEBQUElgQF184EBQEGBM4EBQUES4MEBQUEgwQFAQaHqQQFBQSpBAUF6gQGBggFBSoGCAUFCAU4BQgGAQUIBTgFCAYGCAUAAAYAAAAAAQcBGgAWAEEAcgB+AIoAlgAAEx4BHQEUBiImPQEGBwYuATY3Nj8BPgEHJjQ/ATYzMRYXFhQHBg8BDgEHMzIWFAYrASImNTQ3Nj8BPgE0JiIPAQYiFzQ2MzI2NCYiDwE5Ag4BLgE/ATY3NjIeAQcWDgEiJyYvASY+ARYfARYyNjQmIyImNyIGFBY7ATI2NCYjByIGFBY7ATI2NCYjByIGFBY7ATI2NCYjRQMDBAcFBgYDBwICAwgHBQEFGgICCAkKCwcJCQQJAgkEAR4DBQUDKAMFCAYLAgcGBgsFBAMGDwUDBwUGDgQBAgYGAgICAgMIGBABBwcBEBgIAwICAgIGBgIBBA4GBQcDBVMEBgYEcAQGBgRwBAYGBHAEBgYEcAQGBgRwBAYGBAEZAQQCPgMFBQMoBQQBAgYGAQQJBwIDcgIGAwUFAQUGFwcDBQEEBQIFBgUFAw0JBgUBBAQIBAMCA2wEBAUFBgMBAwIDBgMDAgIFDRMHBhMNBQICAwMGAgEDAQMFBgUEvgYIBQUIBksGCAUFCAZLBggFBQgGAAAAAAMAAAAAAQcA9AANABsAJwAANzQ2OwEyFhQGKwEiJicXNDY7ATIWDgErASImNTciBhQWOwEyNjQmIyYFBJYEBQUElgQFAQEFBIMEBgEFBIMEBgoEBQUEzgQGBgTqBAYGCAUFBJYEBgYIBQUEVQYIBQUIBgAAAQAAAAABBwD0ACoAADc0NjsBMhYUBisBFTMeARQGKwEVMzIWFAYrARUzMhYUBisBIiY9ASMiJicmBQTOBAYGBIyMBAYGBIyMBAYGBIyMBAYGBJYEBS8EBQHqBAYGCAUlAQUIBSYFCAYlBQgGBgSfBQQAAAAGAAAAAAEaAP4ACAARABoAJgAzAD8AADcyNjQmIgYUFhcyNjQmIgYUFhcUBiImNDYyFjciBhQWOwEyNjQmIwc0NjsBMhYUBisBIiYXIgYUFjsBMjY0JiMmBwsLDwsLCAcLCw8LCxoLDwsLDwsvBAUFBKkEBQUEsgUEqQQFBQSpBAUJBAUFBKkEBQUE2AsPCwsPC1ULEAsLEAtBCAsLDwsLqwYIBQUIBl4EBQUIBQVHBQgGBggFAAAAAwAAAAABIAEmACMARgBaAAATMhYUBisBIgYdARQWOwEyNj0BNDYyFh0BFAYrASImPQE0NjM3Mh8BFhQPAQYiJj0BBgcGBwYPAQYiJjU0NzY3NjsBNTQ2MxcUBiMiBwYHNjc2NzYzMhYdATcndQQFBQQ/DxUVD5APFQUIBSAWkBYgIBaHAwNaAwNaAwcFGhkTEQwHAwIKBR4XJBISAQUECQUEPx4RBQ0PExQYGAQFREQBEwUIBRUPkA8VFQ8bBAUFBBsWICAWkBcfEgJRAwgDUQIGAycCEAwSDgwFBQYDSCkfDAYmAgU2BAUtGygQDA8JCgYDHT09AAABAAAAAAEHAQcAGAAANyImNTQuASIOARUUBiImNTQ+ATIeARUOAf0EBRorMisaBQgFHjM+Mx8BBY0FBBkrGhorGQQFBQQfMx8fMx8EBQAAAAQAAAAAAQcBGgASACYALwA4AAATMh4BFRQHBgcGIicmJyY1Jj4BFyIOARUUFxYXFjI3Njc2NTQuASMVMhYUBiImNDYXIgYUFjI2NCaWHzMfIhYjChgKIxYhAR8zHxksGR4VIgQKBCIVHhksGREZGSIZGREKDQ0UDQ0BGR40HiQsHx8ICB8fLCQeNB4SGisZHicdHgQEHh0nHhkrGTMZIxgYIxkTDhMODhMOAAAEAAAAAAD0AQcAFQAdAC0ANwAANzU0JiIGHQEiBh0BFBYXMz4BPQE0Jic0NjIWHQEjFxQGKwEiJj0BNDY7ATIWFQcUBiImNDYyFhXOIS4hEBYWEHAQFhZtFSAVSnALCHAICwsIcAgLOAsQCwsQC6klGCEhGCUWEDgQFQEBFRA4EBYlEBYWECVeCAsLCDgICwsIEggLCw8LCwgAAAAEAAAAAAEHARoACAAhADEAOwAANzIWFAYiJjQ2NzIWHQEzMhYHFRYGKwEiJic1PgEXMzU0NgciBh0BFBY7AT4BPQE0JiMnIgYdATM1NCYHlggLCxALCwgXIRMQFgEBFhCWEBUBARUQEyE0CAsLCJYICwsISxAVSxYQgwsPCwsPC5YhFyUWEF4PFhYPXhAWASYXIXALCF4HDAELB14IC14WECUlEBYBAAAEAAAAAAEHAQkAIAAkAD0AQQAAEyYOAh0BFBY7AT4BPQE0NhceAR0BFBY7AT4BPQE0LgEHNTMVNyIjIgcOAR0BIzU0PgIXHgIdASM1NCYXNTMVoRgtIxQLCCYHCxkRDhMLCCYHCxovhSY+AwMWEAkJJhAeJRQYJhcmHR0mAQYCDyArGF4HDAELB14RFgIBFxBbBwwBCwdaHTQgyyYmlg4IFgwlJRQkGwwCAhssGCEiFyKUJiYAAAAAAwAAAAABGgEbABIAGgAoAAAlJyYPAQ4BHQEUFjsBMjY9ATQmBzcXFhcHJzYXIyImPQEXFjI/ARUOAQEDZQgIZQoMFg+8DxYM3WZmCAJwcALMvAgKbAIEAm0BCugvAwMvBRILaBAWFhBoCxIMLy8ECTw8CYgLCFc6AQE6VwgLAAADAAAAAAEaAPQADwAaACgAADcjIgYdARQWOwEyNj0BNCYHMzIWHQEHJzU0NhcjIiY9ARcWMj8BFQ4B9LwPFhYPvA8WFsu8CAtxcArEvAgKbAIEAm0BCvQWEHAQFhYQcBAWEwsIBDw8BAgLlgsIVzoBATpXCAsAAAADAAAAAAEaAQkACAAMABUAABMHBh0BFBY/Ahc1JxcHNTc2Fh0BFF5HBAkFPRNLS6RHPQUJAQIsAwWfBgUDJgImtCatLLUmAwUGnwUAAwAAAAABCQEaAAgADAAVAAA/ATY7ATIWDwIXIycXNyMHBhY7ATIqLAMFnwYFAyYCJrQmrSy1JgMFBp8FzkcECQU9EktLpUc9BQkAAAQAAAAAAQkBGgAVABkAHQAhAAA3Bh8BBwYWOwEyPwE2LwE3NiYrASIHHwEjJz8BMw8BMwcjJwMCLSwDBQafBQMvAwItLAMFBp8FA3ImiiYCI4kjZokjicoFBFlHBQkESwUEWUcFCQRZS0sSOTlwOAAEAAAAAAEaAQkAFQAZAB0AIQAAEzYfATc2Fh0BFA8BBi8BBwYmPQE0Nx8BNScPARU/ARU3NWIFBFlHBQkESwUEWUcFCQRaS0sTODhwOQEFAwItLAMFBp8FAy8DAi0sAwUGnwUDciaKJgIjiSNmiSOJAAAAAAIAAAAAARoA9gAeADgAADcVFAYiJj0BBwYiLwEVFAYiJj0BNDY3Nh8BNzYXHgEXJiIPATU0JiIGHQEnJiIGFB8BFjI/ATY0J6kGCAUxAwkCMQYIBQMDBgQ7OgUGAgRuAwgDFQYHBhUDCAUCJgELASYCAuqWBAUFBH04AwM4fQQFBQSWAwUBAgRDQwQCAQVsAgIWfwQGBgR/FQMFCAMlAgIlAwgCAAAAAAIAAP//ASABLAA8AFsAACUiFQcGFB8BHgEHIwYiLwEmND8BNjQvASYiDwEGIiY0PwE+AS8BJiIPAQYiLgE/ATYyFx4BBzYWHwEeAQcnNjQnMSYiDwEGIiY0PwE2NCcxJiIPAQ4BHwEWMj8BAREBbQEBFgMBAwEDCAQWBwdtCQkBCRoKWwMJBgNbCQEJAQkbCXgDCQYBA3kQKxAJCAINFwkBDwEPIAMDAwkDWQkbEghaAwMDCQNZDwEPARAsD1mYAWoBAwEWAwkDAwMWBxQHawkaCQEJCVkDBggDWgkZCQEJCXYDBggEdg8PCRcNAggIAQ8qEB0DCQMDA1cJEhkKVwMJAwMDVw8rDwEPD1cAAAAAAwAAAAABGgEIABkAKQAxAAAlNC4BDwEOAR0BFBYfARUUFjMyNjcXFj4BNSc2Fh0BFAYvAS4BPQE+ATcXDgEjIiY9AQEZCxEJzgkKCgklIRcTHgU7CRELHwUICAXOAwQBAwN7AxQNDxbqCg4GA0YDDgkeCQ4DDRUXIRYSFAMFDwmyAgYFqQQGAUYBBQMeAwUBbQwPFRAPAAACAAAAAAEHAQcAOABBAAATMh4BFRQGIicGIiY0NjMyFzU0NjIWFxUUMzI2NTQuASIOARQeATMyPwE2HgEGDwEGJwYuAj4BFxUiBhQWMjY0JpYfMx8cKAoNKxoaFRAMBgcFARMLERksMiwZGSwZDAsJBAcDBAMFEBIfMx4BHzMfDBAQGBAQAQcfMx8XIRISIS4hCgEEBQQDMSUVEBksGRksMiwZAwMBAwcHAgEGAQEfMz4zHwFKFiAVFSAWAAMAAAAAAQcA9AANABsAKQAANzQ2OwEyFhQGKwEiJicXNDY7ATIWFAYrASImJxc0NjsBMhYUBisBIiY1JgUEzgQGBgTOBAUBAQUEzgQGBgTOBAUBAQUEzgQGBgTOBAbqBAYGCAUFBEsEBgYIBQUESwQGBggFBQQAAAEAAAAAAPQBBwAhAAA3FAYjBi4BPQEHBiImND8BNjIfARYUBiIvARUUHgEzMhYV9AYEHC8cMQMIBQJCAwgCQgMGCAIyFyYXBAYvBAUBHDAcWTEDBgcDQgMDQgMHBgMxWRcnFwUEAAAAAQAAAAABBwEsACMAABM2Mh8BFhQGIi8BFRQXFjMyFhQGIyInFRQGIiY9AQcGIiY0N4YDCAJCAwYIAjIbGDQEBQUESh0FCAYxAwgFAgEpAwNBAwgFAjJaLxQRBggFJlUEBQUE8DICBQgDAAAAAgAAAAAA9AEaAAwAMAAANzI2PQE0JiIGHQEUFjcVFA4BBxUUBiImPQEuAj0BNDYyFh0BFB4BMj4BPQE0NjIWlhchIS4hIXUXJhgFCAUYJhcGCAUUIygjFAUIBl4hF0sXISEXSxchQQkYKRkDHQQFBQQdAxkpGAkEBgYECRQjFBQjFAkEBgYAAAMAAAAAAPQBGgAMABgAPAAANzI2PQE0JiIGHQEUFic0NjIWHQEWBiImNTcVFA4BBxUUBiImPQEuAj0BNDYyFh0BFB4BMj4BPQE0NjIWlhchIS4hIQ4VIBUBFiAVgxcmGAUIBRgmFwYIBRQjKCMUBQgGXiEXSxchIRdLFyGDEBYWEEsQFRUQCQkYKRkDHQQFBQQdAxkpGAkEBgYECRQjFBQjFAkEBgYAAAQAAAAAAQcBGgAjACsALwA+AAAlJyYrATU0JiIGHQEjIgYdARQWOwEVFBY7ATI2PQEzMj8BNjQnND4BFh0BIxcjNTM3BisBIiY9ATQ2OwEyHwEBBCAIDCcWHxYcDBAQDBwLByYICycLCSADlgsPCyUlJSVAAgSOBAYGBI4EAxm5IAgTDxYWDxMQDCYLEV0ICwsIXQggAwg+BwsBDAcTu10WAwUEJgQFAhoAAAADAAAAAAEaARkAGAAsAFEAACUnJiIPAQ4BHQEUFjMyPwEXFjMyNj0BNCYHJzU0JiIGHQEHNTcVFBYyNj0BFwcUHwEjNzY0JiIPAQYUHwEWMjY0LwEzBwYeATI/ATY0LwEmIgYBDHECBgNwBgcLBwMDa2sDAwcLBwtoBQgFZ2cFCAVoSwIWfBYCBQgDJQMDJQMIBQIWfBYDAQUIAyUDAyUDCAX1IwEBIwEKB74HCwEhIQELB74HCs8gIgQFBQQiIL4gKwQGBgQrIB4EAxUVAwgFAiYDCAImAwYIAxUVAwgGAyYCCAMmAgUABAAAAAABGgEGACEAMQAzAD0AADcmIg8BBh0BFBYyNj0BFxUUHwEWFxYyNzY/ATY9ATc2NCcHFQcGBwYiJyYvATUXFjI3DwE3NjIfAQcGIi8BsAwcDGUEBQgGEgIHCAofSB8KCAcCIQQENAMHCBs8GwgHAzEMHAxuCE0HEAdaWQcSB1n+CAhCAwVNBAUFBDsMRQQCBwgGFBQGCAcCBEUWAwoDMzUCBwUREQUHAjUhCAgXBqMFBTo9BAQ9AAAEAAAAAAEaARoAFwAwAEgAYQAAEyYiDwEGFBYyPwEVFBY+AT0BFxYyNjQnBxYUDwEzMhYUBisBFxYUBiIvASY0PwE2MhcnJiIGFB8BFjI/ATY0JiIPATU0JiIGFTc2Mh8BFhQPAQYiJjQ/ASMiJjQ2OwEnJjSdAwgDJQMGBwMWBQgFFgMHBgN6AwMVNAQGBgQ0FQMFCAMmAgImAwhHFgMHBgMlAwgDJQMGBwMWBQgFVwIIAyYCAiYDCAUDFTQEBQUENBUDARcCAiYDCAUDFTQEBgEFBDQVAwUIAy8DBwMWBQgFFgMHBgMlAwgDJQOSFQMFCAMmAgImAwgFAxU0BAYGBFsDAyUDCAMlAwYHAxYFCAUWAwcAAAAABAAAAAABGgEaAA8AGQAjADUAADcyNj0BNCYrASIGHQEUFjM1MzIWHQEjNTQ2BzUzFRQGKwEiJjcVFA4BKwEiJiczMj4BPQEeAcUTHBwTgxQbGxSDDBC7EBC7EAyDDBDzFicXXgsUBoMSHhIICjgcE4MUGxsUgxMczxEMCQkMEaBnZwwQEGpeFycWCgkRHhKDBhQAAAQAAAAAAPQBGQAdACEAKgAzAAA3FSYjIgYUFjI2PQE0Jg8BDgEdASYjIgYeATI2NzU3BzU3BzIWFAYiJj4BBzIWFAYiJjQ24QkKDxYWHxYNB3gFBQkKEBYBFSAVAXBwcBMICwsQCwEKewgLCxALC8pfBhYgFRUQvQgJAysBCAWEBRYfFhYPajwoJCmlCxALCxALEwsQCgoQCwAAAAMAAAAAAQcBCQASACIAPwAAExYdARQGLwEjIiY9ATQ2OwE3Ng8BBisBIgYdARQWOwEyHwE3NjIfATc2MhYUDwEXFhQGIi8BBwYiJjQ/AScmNKMGDAQ3IAwREQwgNwQHKgIEJAQGBgQkBAIqKAMIAxUVAwgGAxYWAwYIAxUVAwgGAxYWAwEGAwbOBgUENhELOAwQNgQhKQIGBDgEBQMpdAICFhYCBQgDFRUDCAUCFhYCBQgDFRUDCAAEAAAAAAEsARoADAApAGAAbwAANzIeARQOASIuATQ+ARciBh0BIyIGFBY7ARUUFjI2PQEzMjY0JisBNTQmNzIWHQEmJzU2JgcjJgYdATMyFxYXJyIHJgcjJgYdARQWOwEWFyMiJj0BIyImPQE0NjsBNTQ2MwciBh0BFBY7ATU0NjsBNdgXJhcXJi4nFxcnFwQGHAQFBQQcBggFHAQGBgQcBSEMEAgLAQYEXgQFLwwIBAIHCAcCAl4EBQUEFQUHIQwQHAwQEAxUEQtwBAUFBBwQDBypFycuJhcXJi4nFyYFBBwGCAUcBAUFBBwFCAYcBAWWEAxZBwVNBAYBAQYELwgFBgECAgEBBgSDBAULCBAMCRELhAsRCQwQOAUEhAQFZwwQEwAABAAAAAABLAEaACIAKAA1AFEAADciJj0BNDY7ARUUFjsBFRYXNTQvASYrASIGHQEUFjsBJicjNxcjIiY1FyIOARQeATI+ATQuARcjFRQOASY9ASMiJjQ2OwE1NDYyFh0BMzIWFAZeCAsLCDgQDC8JCgg3CAxDEBYWECoHBR5LNCsEBS8XJxcXJy4mFxcmDhwFCAYcBAUFBBwGCAUcBAYGJgoIvAgLLwwQAQECDgwINwgWD7wPFggK3jUGBC8XJy4mFxcmLicXXhwEBQEGBBwFCAYcBAUFBBwGCAUAAAQAAAAAASwBBwALAC4AOwBXAAA3FTMyPwEnJisBIgYHNDY7ATYfATMyFh0BJic1NiYrAQcGKwEVFBY7ARYXIyImNSEUDgEiLgE0PgEyHgEnNCYiBh0BIyIGFBY7ARUUFjI2PQEzMjY0JisBJkMEAhoaAgQnDBATGxQnCwkdUBQbCAsBEQxQHQkLQxAMMgMFOhQbARkXJi4nFxcnLiYXSwUIBhwEBQUEHAYIBRwEBgYEHNgcAhoZAxELExsBCR0bFA4HBQIMEB0IVQsRCQkbExcmFxcmLicXFycPBAUFBBwGCAUcBAUFBBwFCAYAAQAAAAABBwD0ACAAACUVFAYrARcWFAYiLwEmND8BNjIWFA8BMzI2PQE0NjIWFQEHHBOSMQMGBwNCAwNCAwcGAzKTCxEFCAXqOBMcMQMIBQJCAwgCQgMGCAIyEQs4BAYGBAAAAAUAAAAAASwA9AAJAB4AKwA0AD0AADcVJic1NDYyFhUHMzY3Izc2NCYiDwEGFB8BFjI2NCc3FB4BMj4BNC4BIg4BFxQXNyYjIg4BFyInNxYVFA4B9AkKBQgGwUkFB1UxAwUIA0ICAkIDCAUDHxcnLiYXFyYuJxcTDVwSFRIeEkIWElwNER/qMgIBLwQGBgRnCgkyAggGA0ICCANCAgUIAwIXJhcXJi4nFxcnFxUSXA0SHlMNXBIWER8RAAAAAwAAAAABBwEHABIAJAAsAAATIgYdARQWOwEyPwE2PQE0JgcjBzQ2OwEyFh0BIyIGHQEjIiY1FzU0NjsBDwFUExsbE0UUDT8OHBOEHBELhAsRLxQbQgsRcRAMKgM/AQccE4QTGw0/DRRFExwBLgsREQtCGxQvEQsXKgwQBD8AAAAMAAAAAAEsARoAFAAhAC4AQgBWAGIAcwCDAI8AmQCjAK0AABMUBisBIgYdARQGIiY9ATQ2OwEyFgcyNj0BLgEiBh0BFBYXMjY9ATQmIgYdARQWFyMiJj0BNiYiBh0BFBY7ATI2NCY3MzIWHQEUFjI2PQE0JisBIgYUFiMzFjY0JisBIgYUFhcVFAYrASImPQE0NjsBMhYVIzQmKwEmBh0BHgE7ATI2NScjIgYUFjsBMjY0JjcjFTMyNj0BNCYHIxUzMjY9ATQmByMVMzI2PQE0JksFBAoHDAUIBRYPCgQFLwQGAQUIBQUEBAYGCAUFKgoHDAEGCAUWDwoEBQV/CQgLBQgGFhAJBAUFWjgEBgYEOAQFBaQWEF4PFhYPXhAVEgsIXgcMAQsHXggLHEsEBgYESwQFBUcKCgQFBQQKCgQFBQQKCgQFBQEQBAUMBwoEBQUECg8WBX4FBCYEBQUEJgQFSwUEJgQFBQQmBAU4CwgJBAUFBAkQFgUIBvQMBwoEBQUECg8WBQgFAQYIBQUIBV6DEBYWEIMPFhYPBwsBDAeDCAsLCHAFCAYGCAUTJgYEEgQGOCYFBBMEBjklBQQTBAUABwAAAAABGgEaAA8AEwAjADQAPgBIAFIAADciBh0BFBY7ATI2PQE0JiMHNTMVJzQ2OwEyFh0BFAYrASImNTciBh0BFBY7AT4BPQE0JisBFyMVMxY2PQE0JgczMhYdARQGKwEXIxUzMjY9ATQmWQYICAZnBggIBmJelhMNjQ4TEw6NDRMgBggIBo0GCAgGjcwLCwMEBA4LAwQEAwsLCwsDBAT0CAYcBggIBhwGCCYTEyoOExMOxA4TEw7TCQbEBgkBCAbEBgglJQEFAxcDBDgEAxgDBBImBAMXAwUAAAQAAAAAARoA+QAnAEIASwBUAAAlNjc2JyMmBwYHBgcmIgcmJyYnJgcjBhcWFwYVFBcWFxYyNzY3NjU0ByInJicmNTQ3NjcyFxYyNzYzFhcWFRQHBgcGJyIGFBYyNjQmMyIGFBYyNjQmAQQDAQEHBAQGCAkMDhJCEg4MCQgGBAQHAQEDFREPHxpTGx8PEYMhEBgMDREIDwoWERISFQoPCBENDBgQSggMDBAMDEoIDAwQDAzCCAoSEgECAQUFCQUFCQUFAQIBEhIKCBcgKRgVCggIChUYKSB4AwQLDBkTDwgCAQEBAQIIDxMZDAsEA1IRGBERGBERGBERGBEAAAIAAAAAARoBGgAjADwAACUVFAYiJj0BNCYrASIGHQEUFjsBHgEUBisBIiY9ATQ2OwEyFgczMjY0JisBJgYHHQEUFjI2PQEXFjI2NCcBGQUIBRYQlhAVFRBUBAYGBFQXISEXlhchiEcEBQUEXgQEAQUIBXQCCAYD4VQEBgYEVBAWFhCWEBUBBQgFIReWFyEhTwUIBQEFAgNeAwYGA0h0AgUIAwAABAAAAAABLQEaABcAIQA2AEMAABMjIgYHFTY3NTQ2OwEVFxYXMzI2PQE0JhcUBisBNTMyFhUHNjU0LgEiDgEUHgEzMjcXFjI2NC8BBgcGIyImNDYyFhUU/akTGwEJChELSxQEA0MUGxsIEAxLSwwQow0RHyMeEhIeEhYRMAIIBgM/BAUNDxQbGyccARkbFDQDAi8MEdYUBAYbFKgUG9cMEOERDKoRFhIeEhIeJB4RDTADBQgDOwUEChwnGxsUEAAACgAAAAABGgEHAAgAEQAaACMALAA1AEoAXwBtAHUAADc0NjIWFAYiJjciBhQWMjY0Jhc0NjIWFAYuATciBhQWMjY0JiciBhQWPgE0Jgc0NjIWFAYiJhcGFSMVFBYzMjcWFwYjIiY9ATQ2MxcWMzI2PQE0JisBFhUzFRQGIyInBiciBh0BFB4BNj0BNCYjBzMVDgEiJjVxFSAVFSAVJQgLCxALCzARFxERFxEcBAUFCAYGrAwQEBcRERUGCAUFCAYYBSUQDAUGAgQICRQbCwizCAkUGwsHKwUmEQwFBgJsCAshLiELCEpLARUgFeEQFRUgFRUjCxALCxALHAsRERcRARAVBQgGBggFExEXEQEQFxEcBAUFCAYGKwkKLwwQAgkIBBwTLwgLbQQcEy8ICwkKLwwQAgllCwg4GCABIRg4CAsTOBAWFhAAAAYAAAAAAP0BJgALABgAJABPAGEAZwAANyIGFBY7ATI2NCYjBzQ2OwEyFhQGKwEiJhciBhQWOwEyNjQmIyciBh0BIyIGHQEUFjsBMj8BNj0BNCYrATU0JiIGHQEjNTQmIgYdASM1NCYXMhYdASMiBh0BIyImPQE0NjMXBzU0NjNjBAUFBFoEBQUEYwUEWgQFBQRaBAUJBAUFBCQEBQUENgQFCQsQEAtsBAJIAxALCQUIBS0FCAUtBYwEBS0LEGMEBQUEnikFBMsFCAUFCAU/BAUFCAUFKQUIBQUIBcYFBAkQC9gLEANIAgSiCxAJBAUFBAkJBAUFBAkJBAUkBQSZEAstBQTYBAW0KSAEBQAGAAAAAAEaARoADwAdADMAOwBBAEcAADciLwEuAT4BHwEeAQcGIzEHMjMyNzYmLwEmDgEWFzcnJg8BDgEdARQWHwEWPwE+AT0BNCYHJiMnJic1Fyc3Nh8BBxcUDwE1N3ECAi8EAwQHAy8EAwICBxYCAgYCAgMEHAMHBAMEyV0UFF0ICgoIXRQUXQgKCoICAl0GAWhdWQ0NWWZxB2FoigEUAQgHAwIUAgcDBh0FBAcCDAEDBwcCdSQICCQDDgl8CQ4DJAgIJAMOCXwJDsEBJAIHdyw8IgUFIixbBwIleSwAAAUAAAAAARMBGgAYACYALgA6AEMAABMyFh0BFh8BFhQPAQYiLwEmND8BNjc1NDYHNQczNzY0LwEVFAYiJgcUHwEWMj8BFyYiDwEGHgEyPgEnBzcXFg4BLgKNBAUFA0YICF8JFwlDCAhdBgcGBlWmAgMDQAUIBl4BRAMIAkoxAwkEFQsCFiEWAgstDxAFAQsRDAEBGQUEEgIDRggXCV8ICUcJFgldBQIQBAVBE1UDAggDQA4EBgZRAQFHAwNJFwQEGA0eFhYeDQ0SEgYQDAELEAACAAAAAAEaARoADAAeAAATIg4BFB4BMj4BNC4BFwcGIi8BJjQ2Mh8BNzYyFhQHliQ8IyM8SDwjIzwbSwMIAiYDBggCH0UCCAYDARkjPEg8IyM8SDwjZEsDAyUDCAUCH0QDBgcDAAAAAAMAAAAAARoBGgAQAB0AKgAANzYyFhQPAQYiLwEmNDYyHwE3Mh4BFA4BIi4BND4BFyIOARQeATI+ATQuAcgCCAYDSwMIAiYDBggCHxMkPCMjPEg8IyM8JB8zHh4zPjMfHzPCAwYHA0sDAyUDCAUCH5sjPEg8IyM8SDwjEh8zPjMeHjM+Mx8AAAAFAAAAAAEHAQcACAARABoAIwAwAAA3IiY0NjIWFAYnIgYUFj4BNCYXIiY0NjIWFAYnIgYUFjI2NCYHNzY0JiIPAQYUFjI3VBMbGycbGxQLEREXERF4FBsbJxwcEwwQEBcREZupAwYIAqkDBgcDqRsnHBwnG0sRFxEBEBcRzhsnGxsnG0sRFxERFxE2qQIIBgOpAggGAwAAAAQAAP//AS0BGgAMACkAVABdAAA3Mh4BFA4BIi4BND4BFyIGHQEjIgYUFjsBFRQWMjY9ATMyNjQmKwE1NCYnMhYVFAceARcGBy4BKwEiBh0BMxUGFjsBFhcjIiY9ASImPQE0NjcmNTQ2FyIGFBYyNjQm2BcmFxcmLicXFycXBAYcBAUFBBwGCAUcBAYGBBwFTxEZCAsRAgkJAgoGOAgLEwEGBAIFBw4MEAgLEg0IGRIKDg4TDg6pFycuJhcXJi4nFyYFBBwGCAUcBAYGBBwFCAYcBAWWGBINCwIPCwEDBggLCDhLBAYKCBAMOAsIOA4VAgsNEhgTDRQNDRQNAAMAAAAAAM8BGgAfACgARAAANzY1NCYiBhUUFw4BHQEUFjMVFBY7ATI2PQEyNj0BNCYnMhYUBiImNDYXIxUUBisBNTQmIgYdASMiJjc1IzU0NjsBMhYVrwgZIxkIDRILCBAMJQwRBwsSLwkODhMODjkTBgQJBQgGCQQGARMLCDgIC9cLDRIYGBINCwIVDjgICzgMEBAMOAsIOA4VMQ0UDQ0UDYxLBAY5BAUFBDkGBEs4CAsLCAAAAAAFAAAAAAEaAQcADwAbACcANQBDAAATIyIGHQEUFjsBMjY9ATQmByM1MjY9ATMVBhYzJzUzFQYWMxUjNTI2BzU0NjsBFRQWMxUjIiY3FAYrATUyNj0BMzIWFf3hDBAQDOEMEBA7OAgLEwELCHATAQsIOAgLSwUECgoIHAQF9AYEHAgLCQQGAQcRDKgMEBAMqAwRz0sLCF5eCAsTXl4IC0tLC0yoBAZeCAtLBgQEBksLCF4GBAAEAAAAAAEaARoADgAUACYANQAAEyIGHQEUFjsBMjY1NC4BBzUeAhcnNCYHDgIUHgEyPgE3NiYrAjQ2NxUeARczDgEjIi4BnwQFBQRxBAUhOBcYKRoCgwYEHC8bHjQ7Mh8CAQYEZ10qIAEFBGUGNCIZKxkBGQUEcQQFBQQhOCFwXQIaKRhBBAYBAh8yOzQeGy8cBAYiNAZlBAUBICoZKwAAAgAAAAABGgD0ABsALAAANyIPAScmBh0BIwcXMxUUFj8BFxYzMjY9ATQmIxcOAS8BIisBBzUXFj8BNhYV/QUGUzUECEYPD0YHBTVTBgUMEBAMCgEIBFcCAgMrKwQDVgUJ9AIjEgEGBC8KCS8FBQESIwIQDHELEY0FBQElD1cPAQEkAgYEAAAAAAIAAAAAARoBCQAIAC4AACUUBiImNDYyFicWBg8BFTM2NC8BJgYPAg4BHwEPAT8BFxYzNSMVJzc2PwE+ARcBGSEuISEuISgDAQQOHgcIQQocByY1BQIEKDICEDEpAgQESCoDAigCCQRLFyEhLiEhTQMJAggDCBcIQQoEDEgRAgoEKDEQAjIoAxwBSA4BA0sEAQMAAAACAAAAAAEIAQkAFgAmAAA3JgYPAg4BHwEPAT8BFxY2PwI+AS8BPgEfARYGDwEGDwEnNzY3vQocByY1BQIEKDICEDEoBAoCEUcNBApeAwkDQgMBBUoDAQ5IKQQC/goEDEgRAgoEKDEQAjIoBAIFNSYHHAoyBAEDQgMJAycCBClIDgEDAAADAAAAAAEaARoADAAZACYAABMiDgEUHgEyPgE0LgEHIi4BND4BMh4BFA4BNxQPAQYmPQE0Nh8BFpYkPCMjPEg8IyM8JB8zHh4zPjMfHzMUBEIGDQ0GQgQBGSM8SDwjIzxIPCPzHjM+Mx8fMz4zHnAFAiYEBwdGBwcEJgIAAgAAAAAA4gEaACUAMwAANyM1NCYiBh0BIzU0JiIGHQEjIgYdARQWFxUUFjI2PQE+AT0BNCYHFAYiJj0BNDY7ATIWFckNBggFJgUIBg0KDiYcBQgFHCYOBSEuIQMCZgID4S8EBQUELy8EBQUELw4KMxwrAzAEBQUEMAMrHDMKDksXISEXMwIDAwIAAAAFAAAAAAEaAPQAFAAXACoAMgA6AAA3PgEWHwEWBg8BIiYvASMHDgEuAT8BMyc3MhYUBx4BFRQGKwEiJj0BNDYzFxUzMjY0JiMnFTMyNjQmI0sCBwgBOQEEAwMDBQERPREBBwgDASkxGYQTGw0OEiEXLwQFBQQJJhAVFRAmHQsREQvtBAMDBKgEBwEBBAMxMQQEAwcEPkonHCcNBxwRFyEGBKgEBl5LFh8WSzgQGBAAAAgAAAAAARoBBwAQACAAMAA0AEQASABUAGEAABMiBh0BFBY7ATI2PQE0JgcjBzQ2OwEyFh0BFAYrASImNTc0NjsBMhYdARQGKwEiJjU3IxUzBzQ2OwEyFh0BFAYrASImNTcjFTMnIgYUFjsBMjY0JiMHNDY7ATIWFAYrASImQhQbGxSoFBsbFKgcEAyoDBERDKgMEBILCJYICwsIlggLqZaWSwsIOAgLCwg4CAtLODifBAYGBDgEBQUEQgYEOAQFBQQ4BAYBBxwThBMbGxOEExwBLgsREQuECxERC3oICwsIEggLCwcTEjkICwsIJQgLCwglJTgFCAYGCAUvBAYGCAUFAAAAAgAAAAAA4gDiAA8AHwAANyIGHQEUFjsBMjY9ATQmIwc0NjsBMhYdARQGKwEiJjVnBAUFBF4EBQUEehAMXgwQEAxeDBDOBQReBAUFBF4EBQkMEBAMXgwQEAwAAAADAAAAAAEaARoADwAXACIAABMiBh0BFBY7ATI2PQE0JiMHNDY7ATIWFQczFRQGKwEiJic1SxchIReWFyEhF7sVEJYQFuHhFhCWEBUBARkhF5YXISEXlhchOBAWFhATgxAVFRCDAAAAAAEAAAAAARAA/gArAAA3MhYfATc0NjIWHwEzMhYUBisBIi8BBw4BIiYvAQcOASsBIiY0NjsBNz4BM2wDBQErIQUGBQEVIAMGBgQlBgMNIwEFBgUBKxcBBQMmAwYGAx8fAQUD/QQDnG4CBAMDMgUIBgYgcwMEBAOdSQMEBggFYQMDAAAAAAQAAAAAARsBGgA1AEEAdgCDAAA3OgEXMRYXFgcOAgcGBwYrARUzFRYUBw4BBwYHDgEiLgInJj0BND4BPwE2OwEyNzY3NjU3ByYiBwYVFB4BNzYmJzIeAhceARQOAgcGKwEOAgcGHQEjIicxJicmNz4CNzY3NjsBNSM1JjQ3PgE3Njc+AQcuAQcGFhcWMjc2NTToCwcCEwgDAQEEBwQICQMwMD8BAQEDAwUMBw0mDw0NAgIEAwQCAxgqIwQSBQIBKgMGAwUFCAQHAS0TDw0NAgIBAQUIBwICVRALBgMCDwMCEwgDAQEEBwQICQMwMD8BAQEDAwUMBw0HAwgEBwEGAwYDBdgBByENEQ0QDwUHAgEIAgEWBQYJAwYDAQEBBAwHBAhEBQgCAgEBAQYJBAUPegECAwcEBgICAw/gAQQMBwQQMgwIBQMBAQMGBgQGMAEHIQ0RDRAPBQcCAQgCARYFBgkDBgMBARgEAgIDDwMBAgMHBAAAAAQAAAAAARoBGgAIAC4AOwBIAAA3MhYUBiImNDY3MhYVFAcGBzEGBwYVFAYiJjU0NzY3MTY3NjQmIgYVFAYiJjU0NjcyHgEUDgEiLgE0PgEXIg4BFB4BMj4BNC4BlgYICAwICAYSGAYECQcDBAUIBQYECQcCBA0UDQYIBRgSJDwjIzxIPCMjPCQfMx4eMz4zHx8zXggMCAgMCIMYEg4KBwkHBAYJBAUFBA4KBwkHBAYTDQ0KBAYGBBIYOCM8SDwjIzxIPCMSHzM+Mx4eMz4zHwACAAAAAAD0APQAGwA3AAA3MhYdARQHBgcGIiY0Nz4BNwYrASImPQE0NjsCMhYdARQHBgcGIiY0Nz4BNwYrASImPQE0NjsBcAgLCgscAwgFAhMUAwcJEwgLCwgmcAgLCgwcAwcGAxMTBAgJEggLCwgl9AsIEyccIRwDBgcDEycYBAsHJggLCwgTJxwhHAMGBwMTJxgECwcmCAsAAAAEAAAAAAEHALwAFgAtAEQAWwAANzQ2MzcyFhUUBwYHBiImND4BNwYiJjU3NDYzNzIWFRYHBgcGIiY0PgE3BiImNQcyNj0BNCYiBz4CNCYiBwYHBhUUFjMnFAYrASImNTQ3Njc2MhYUDgEHNjIWFakFBBMEBQcGCAMIBQUHAwMHBTgFBBMEBQEIBggDCAUFBwMDBwVnBAUFBwMDBwUFCAMIBgcFBBwFBBMEBQcGCAMIBQUHAwMHBbIEBQEGBBYSDwgCBQgFDAkCBQQTBAUBBgQWEg8IAgUIBQwJAgUELwYEEwQFAgkMBQgFAggPEhYEBgoEBgYEFhIPCAIFCAUMCQIFBAAAAAcAAAAAAQwBGwAcACUAKQBAAFAAZgB2AAA3MDcxNjQmIgYUHwEHBh4BMzY/ATMXFhc+Ai8CNjIWFAYiJjQHNzMXJwYiLwEuATQ2NzYyFhQHDgEUFhceAQc3NjIWFAcOARcWDgEiJyY2FxQGDwEGIiY2NzY1NCYnJjQ2MhceAScmNDYyFx4BBwYiLgE3NiapAQgQGBAIATcCAwUCBgMOVg4CBwIFAwI3GgMIBQUIBRohBCFoAwcCAhASEhADCAUDDg4ODgMBAw0CCAYDEAQNAgIFCAMQBcISEAICCAYBAh4ODgMFCAMQEkoDBggCFQUQAwgFAgINBLABCBgQEBgIAX0EBwMBBSAgBQEBAgcEfRwCBQgFBQhrS0sTAwMBESovKxECBQgDDSQoJA4DCAOMAwYHAxArEgQHBAQYOSQYKhEBAwYHAx4pFCQNAwgFAhErFAMHBgMUORgEBAcEEisAAAAGAAAAAAEaARoAGwArADQAPQBKAGYAADc0LgEiDgEUHgE7ASYnIyIuATQ+Ah4BHQEWFwc2NwYjIiYnLgEGFBceATMnFAYiJjQ2MhYXMjY0JiIGFBYXFA4BIi4BND4BMh4BJzQmIgYdASMiBhQWOwEVFBYyNj0BMzI2NCYrAfQfMz00Hh40HgUDAQEZKxkZKzMrGQoJbwMEBAUKEgcCCAYCChkOEgkLCQkLCTMGCAgMCAh7ER8jHhISHiMfETgFCAYcBAUFBBwGCAUcBAYGBBypHjQeHjQ9Mx8JChkrMysZARorGQEBAz0KCgEICAIBBQgDCgxVBgkJCwkJFAkLCQkLCVkRHxERHyMeEhIeFAQFBQQcBggFHAQFBQQcBQgGAAAKAAAAAAEaAPQADAAVAB8AKAAxADoAQwBMAFwAbAAANzQ2OwEeARQGKwEiJjcyNjQmIgYUFjcUBiImNDYyFhUHMjY0JiIGFBY3FAYiJjQ2MhYHMjY0JiIGFBY3FAYiJjQ2MhYXMjY0JiIGFBYnNDY7ATIWHQEUBisBIiY1NyIGHQEGFjsBMjY9AS4BIzgGBKgEBgYEqAQGBQYICAwICIUJCwkJCwhGBggIDAgIhQgMCAgMCJIGCQkLCQlMCAwICAwIKgYICAwICLoTDsQOExMOxA4TIQYIAQkGxAYJAQgGZwQGAQUIBQVGCAwICAwIDgYICAwICAYOCAwICAwIDgYICAwICDoIDAgIDAgOBggIDAgIFAgMCAgMCFAOExMOeg4TEw6ICAZ6BggIBnoGCAAAAwAAAAAA4QDiAAgAFQAeAAA3MjY0JiIGFBY3FA4BIi4BND4BMh4BBzQmIgYUFjI2lggLCxALC1MUIygjFBQjKCMUEyEuISEuIYMLEAsLEAsTFCMUFCMoIxQUIxQXISEuISEAAAMAAAAAARoBGgAMABkAJgAANzI+ATQuASIOARQeATciDgEUHgEyPgE0LgEHJj4BMh4BFA4CLgGWFCMUFCMoIxQUIxQkPCMjPEg8IyM8lAEfMz4zHx8zPjMeSxQjKCMUFCMoIxTOIzxIPCMjPEg8I4MfMx8fMz4zHgEfMwABAAAAAAD0AQoAJQAANzQmIgYdAScuAQ4CFh8BFjI2NC8BJjQ2Mh8BIyIGFBY7ATI2NfQGCAU7DyYnHQoKDl8CCAYDXhEhLxA7RgQGBgRcBAf9BAYGBEg8DgoKHSYnD14CBQgDXhAvIRE6BggFBwQACgAAAAABIAEmACAALAA4AEwAWABkAHAAfACMAJAAADc1NDY7AScmNDYyHwEWFA8BBiImND8BIyIGHQEUBiImNRczMjY0JisBIgYUFjczMjY0JisBIgYUFjcjIgYdATIXNTMVIxUzMjY9ATQmBzMyNjQmKwEiBhQWBzMyNjQmKwEiBhQWFzMyNjQmKwEiBhQWFzMyNjQmKwEiBhQWNxUUBisBIiY9ATQ2OwEyFgcjFTMSEAsyFAMFCAIkAwMkAggFAxQyBAUFCAWrNgQFBQQ2BAUFBDYEBQUENgQFBVVsBwsJCWxaWgcLC1g2BAUFBDYEBQV6NgQFBQQ2BAUFBDYEBQUENgQFBQQ2BAUFBDYEBQVnCwdsBwsLB2wHCxJsbMIkCxAVAggFAiQDCAIkAwUIAxQFBCQEBQUEGwUIBQUIBUgFCAUFCAU2CghaBV9+EgsHfggKWgUIBQUIBVoFCAUFCAUkBQgFBQgFJAUIBQUIBWx+BwsLB34ICgoIfgABAAAAAAEHAQcAMAAANzQ+ATMyFhcjIgYUFjM3FjY9ATQmIgYdAS4BIyYOARQeATI+ATc0JiIGBw4CIi4BOBksGRcnDSUEBgYDOQQFBQgGDywZHzMeHjM8MR8DBQcGAQIaKTEsGZYZLBkUEgUIBgEBBgQ4BAYGBB0SFAEfMz4zHhsuHQQGBQQXJxcZLAAAAAACAAAAAADhAQcAOABBAAA3Izc2NCYiDwE1NCYOAR0BJyYiBhQfASMiBhQWOwEHBhQWMj8BFRQWMjY9ARcWMjY0LwEzMjY0JiMHFAYiJjQ2MhbYIhgCBQgDFwYIBRgDBwYDGCIEBQUEIhgDBgcDGAUIBhgCCAYDGCIEBQUEegsQCwsQC84YAwgFAxchBAYBBQQhFwMFCAMYBQgFGAMIBQIYIQQGBgQhGAIFCAMYBQgFgwgLCxALCwAABAAAAAABIQEUACoANwBLAF4AADcWFyMiJjQ2OwE1IyImPQE0NjsBMhYdASYnNTQmKwEiBh0BFBY7AR0BIxU3FA4BIi4BND4BMh4BBzQmLwEmIgYUHwEHBhQWMj8BPgE/ATY0JiIPAQ4BFBYfARYyNjQncAMESgQFBQQbJA8VFQ+iDxUJCQsHogcLCwdIEsYWJSwlFhYlLCUWUQECGwIIBQMUFAMFCAIbAgEWFAMFCAIbAgEBAhsCCAUDOwkJBQgFEhUPfg8VFQ86AwE2CAoKCH4HCwkJEhsWJRYWJSwlFhYlKAIDAhsCBQgCFRQDCAUDGwEDJhUCCAUCGwIDBAMBGwMFCAMAAAAAAgAAAAAA9AEQABAAIQAANxYUDwEGIiY0PwEnJjQ2Mh8BNzY0JiIPAQYUHwEWMjY0J5MDA0sCCAYDREQDBggCZUQDBggCSwMDSwIIBgN3AwcDSwMGBwNFRAMHBgMGRAMHBgNLAwcDSwMGBwMAAQAAAAABBwCpAAwAADc0NjsBMhYUBisBIiYTBQThBAYGBOEEBZ8EBgYIBQUAAAAAAwAAAAABBwEHABsALwBDAAATIgYeATsBFSMiBhQWOwEyNjQmKwE1MzI2LgEjBzMVIyIGHQEUFjsBFSMiJj0BPgEXIxUzMjY9ATQmKwEVMzIWHQEUBnoEBgEFBBMTBAYGBDgEBgYEExMEBgEFBGcvLwgLCwgvLxAWARWmLy8QFhYQLy8ICwsBBwYIBbwFCAUFCAW8BQgGJhMLB0sICxMWEEsPFoMTFhBLDxYTCwhKCAsAAAAACgAAAAABLAEsAA0AMQA6AEIAUgBzAIwAoQCrAMsAACU1NCYrAQczMhYdATI2JzU0JiMiBw4BFBYyNzgBOQE2MzIXFh0BJiMiBhQWMzI3FjI2JzIXFQYiJjQ2ByYiBhQWMjcXNTQmKwEiBh0BFBY7ATI2JzIWHQEOASInBiMiJjQ2MzIXNTQnJiMiBzEGIiY+ATc2FwYUFxYyNjIWBgcGIyImND4BFx4BDgEmIjcWNjQmIyIHNTQmIgYdARQWMjY3FjcyFhQGIiY0NjMHNDY7ATIWFAYrASIGHQE3NjIWFA8BBiIvASY0NjIfAQEHIhduE4EQFgcMORMOCggEBgYHAwMJBAQGBggRFBQRCgcDCAUhCQYFEgoKRwYRCgoSBYMLCKgICwsHqQgLkQ0UAQUIAwcJEhQUEgcHBwQDCQQDBwYBBQQIVwYGBQ4HBwYBAwoMEBYUHQsDAQYHBw5mDxYWEAkJBggFBQcFAQkLBwsLDwsLB+ERDCUEBgYEJQQGFgMHBgMlAwgDJQMFCAMVODkXIRMWD0sLlDMODwMCBggFAgMBAwYFAREXEAICBSABDgQGBwaqAQUIBQMWXgcLCwhdCAsLYQ8NNAQFAwMRFhEBBgYCAQIDBggFAgMaBxcIBgYGCAIJGiQZAwoDCAUBBmQBGSMZBhkEBQUEXgQFAwMGQQ4TDg4TDiULEQYIBQYDIhUDBQgDJQMDJQMIBQMVAAAAAAUAAAAAAPQBGgAVAB8AMABKAGoAADc2MzIWFAYjIicOASImPQE0NjIWHQEXFBY+ATQmIgYVBzMyFh0BFAYrASImPQE0NjMXBiInJjQ3NjIWMjY0JyYOARQWMzI3NjQuASc0NjsBMhYUBisBIgYdATc2MhYUDwEGIi8BJjQ2Mh8BvAgKEBYWEAoJAQUHBQUIBQEKEAsLEAuVXQgLCwhdCAsLBzkDDgUGBgUOBggFAwsdFBUQDQoDBQgWEAwmBAUFBCYEBRUDCAUCJgMIAiYCBQgDFfcGGSMYBgMDBQReBAUFBBkkCg4BDRQNDQpQCwhdCAsLCF4HC1cDBgcXCAYGBggCCgMYJBsJAwgFAakLEQYIBQYDIhUDBQgDJQMDJQMIBQMVAAABAAAAAAEHAOsAIAAANxYUDwEzMh4BFRQGIiY1NC4BKwEXFhQGIi8BJjQ/ATYydwMDMVkcMBwGCAUXJxdZMQMGBwNCAwNCAwfoAwgDMRwvHAQGBgQXJhcyAggGA0ICCANCAgAABAAA//4BLAEaADgAWABlAG0AADcUBisBFRQWMzU0NjsBMhYdATMeARQGKwEVFAcGIi8BBwYmPQEiJj0BNDY7AQYHIw4BHQEzNRYyPwEUBisBFTMyFhQGKwEVFAYiJj0BIyImPQE+ATsBMhYVJyIGHQE2OwE1NCYrARUzNSMiBhQW9AYEnwsIBQQmBAVUBAYGBFQGAgUDDAwFCxAWFhBUBgJMCAuWBQkFOAUELy8EBQUELwYIBQkMEQEQDDgMEFQEBgUFQQUEOAkJBAYGVAQFEwgKCQQFBQQJAQUIBQoGAgEDDAwFBQYKFg+8DxYICgEKCJYUAQFTBAUTBggFCQQGBgQJEAxLDBAQDAoGBDABLwQFXRMGCAUAAAUAAAAAAPQBGgAMACUAPQBOAFoAADcyNj0BNCYiBh0BFBYXIi8BJjQ+AR8BNTQ2MhYdATc2MhYUDwEGFzMyFhQGKwEOASImJyMiJjQ2OwE+ATIWBzI2NzY0Jy4BIgYHBhQXHgE3FAYiJj0BNDYyFhWNBAUFCAYGBAQDOAMFCAMoBggFKAMIBQM4AiovBAYGBC8EGiEaAzAEBQUEMAMaIRoqCQ4DAgIDDhIPAwEBAw8SBQgGBggF9AUEEwQFBQQTBAWDAjkCCAUBAygOBAYGBA4oAwYIAjkCOQUIBREVFREFCAUQFhY1CgkECgQJCgoJBAoECQqyBAUFBBMEBQUEAAADAAAAAAD0ARoAKABAAFEAADcmND8BNQcGIiY0PwE2Mh8BFhQGIi8BFRcWFAYiLwEVFAYiJj0BBwYiFzMyFhQGKwEOASImJyMiJjQ2OwE+ATIWBzI2NzY0Jy4BIgYHBhQXHgFOAwM1KAMIBQM4AwcDOAMFCAMoNQMFCAMoBQgGKAMIay8EBgYELwQaIRoDMAQFBQQwAxohGioJDgMCAgMOEg8DAQEDD5kCCAM2HSgDBggCOAMDOAIIBgMoHTYDCAUDKEcEBgYERygDXgUIBREVFREFCAUQFhY1CgkECgQJCgoJBAoECQoABAAAAAABBwEaADUAPgBHAFAAADcUBgcVFBY7ATI2PQEuATU0NjIWFRYGBxUUBisBFR4BFRQGIiY1NDY3NSMiJj0BLgE1PgEyFiciBhQWMjY0JhciBhQWMjY0JjcUBiImNDYyFoMVEBAMOAwQEBUbJxsBFhAbFBMRFRwmHBURExQbEBYBGycbLwsRERcRETYMEBAYEBBSERcQEBcR6hAaBAoMEBAMCgQaEBQbGxQQGgQKExwTBBoQFBsbFBAaBBMcEwoEGhAUGxsJERcRERcRqREXEBAXEYwLEREXEREAAAACAAD//gEtAS0ANgBYAAA3NjcVFAYrARUUFjM1NDY7ATIWHQEzHgEUBisBFRQHBiIvAQcGJj0BIiY9ATQ2OwEHIw4BHQEzNycmIyIGDwEGDwEOARQfAQcVMzcXFjI2PwE2PwE+ATU0J+ELCAYEnwsIBQQmBAVUBAYGBFQGAgUDDAwFCxAWFhBeCVUIC5ZDJAkLCA4EDwMIFAYHBRIYDRkRBg4JAggCBx8ICAiFAgc6BAUTCAoJBAUFBAkBBQgFCgYCAQMMDAUFBgoWD7wPFhIBCgiWoiQICAgfBwIIAgkOBhEZDRgSBQcGFAgDDwQOCAsIAAAAAwAAAAAA9AEaABcALwA/AAA3LgEGFB8BFjI/ATY0JiIPATU0JiIGHQEXMzIWFAYrAQ4BIiYnIyImNDY7AT4BMhYHHgEyNjc2NCcuASIGBwYUWwMIBQM4AwgCOAMFCAMoBQgGOC8EBgYELwQaIRoDMAQFBQQwAxohGkUDDxIOAwICAw4SDwMBuQIBBggCOQICOQIIBgMofwQFBQR/WQUIBREVFREFCAUQFhYiCQoKCQQKBAkKCgkECgAAAAADAAAAAAD0ARoAFwAvAD8AADcGIiY0PwE2Mh8BFhQGIi8BFRQGIiY9ARczMhYUBisBDgEiJicjIiY0NjsBPgEyFgceATI2NzY0Jy4BIgYHBhRbAwgFAzgDCAI4AwUIAygFCAY4LwQGBgQvBBohGgMwBAUFBDADGiEaRQMPEg4DAgIDDhIPAwHRAwYIAjgDAzgCCAYDKH8EBQUEf8EFCAURFRURBQgFEBYWIgkKCgkECgQJCgoJBAoAAgAA//4A9AEaAC8AQgAANzI2PQE0JisBIgYdARQWMxUUFj8BFxYyNzY9ATMyNjQmKwE1NCYrASIGHQEiJj0BNzYyHwE3NjIWFA8BBiIvASY0N+oEBhYQcBAWFhALBQwMAwUCBlQEBgYEVAUEJgQFCAsfAwcDFjEDCAUDOAMHAxwDA0sFBKAPFhYPvA8WCgYFBQwMAwECBgoFCAYJBAUFBAkKCBN3AwMVMQMFCAM4AwMcAwcDAAAAAAIAAP/+APQBGgAvADkAADcyNj0BNCYrASIGHQEUFjMVFBY/ARcWMjc2PQEzMjY0JisBNTQmKwEiBh0BIiY9AjQ2OwEeAR0BI+oEBhYQcBAWFhALBQwMAwUCBlQEBgYEVAUEJgQFCAsLCHAIC5ZLBQSgDxYWD7wPFgoGBQUMDAMBAgYKBQgGCQQFBQQJCggTqQgLAQoIlgAABAAAAAABGgEHAAwAFQAsAD8AADcdARQWMjY9ATQmIgYHFBYyNjQmIgYnMzIWHQEUBisBBwYuAT0BIyImPQE0NhcyNj0BNCYrASIGHQEUFjsBFTeNBgYGBgYGBQgMCAgMCFnODBAQDFo5Bg8KHAwQENoEBgYEzgQFBQQvPtkBMQMFBQMyBAQEXgYJCQsJCYIQDIMMEDIFAQoIJBAMgwwQqAUEgwQGBgSDBAU3NwAAAAAGAAAAAAD+ARoAEwAnAD8ATwBYAGEAADcjIgYdARQXFhcWMjc2NzY9ATQmBxQHBgcGIicmJyY9ATQ2OwEyFhUnMzI2PQE0JisBNTQmIgYdASMiBh0BFBY3NDY7ATIWHQEUBisBIiY1NzQ2MhYUBiImNzQ2MhYUBiIm4ZYMEAQIExtaGxMIBBADAwcQFUoVEAcDBQSWBAWDXgwQEAwmBQgFJgwQEAMFBF4EBQUEXgQFDggMCAgMCDgIDAgIDAiDEAwJBwkQCg4OChAJBwkMECUFBgsGCgoGCwYFCQQGBgQvEAw4DBEJBAUFBAkRDDgMEFQEBgYEOAQFBQQcBggIDAgIBgYICAwICAAKAAAAAAEKAQoACAARAD0ATgBTAFgAXABoAHUAgQAANzYyFhQGIiY0FyYiBhQWMjY0Ny4BJyYGDwEmBg8BBhQfAQYWHwEHDgEfARY2PwEXHgE3FxYyPwE+ASc3PgEnFhcWBg8BBiIvASY0PwE+AQcWDwEvATYXBycXByc3BzY0JiIPAQYUFjI/ARYUDwEGIiY0PwE2Mhc2NCYiDwEGFBYyN50JGRISGRInBAoGBwkHRAINCRgxEgwMGwoPAgIQAgQGAw8EAQQnBAkCCQMFDwcQAggDDwoEBQwSDCUJAgYJDjUCCAM1AwM0DycBAQkIBlwJDBYHKAUXCBADBggCGQMGBwMFAwMKAwcGAwoCCCsDBggCCgMFCAPICRIZEhIZBQQHCgYGCjMJDQIIDBIMBQUJDwMIAhAHDwUDCQIKAygDAQQPAwYEAhACAg8KGwwMEjEeAgkTKA40AwM1AwcDNQ4JggwJCAdrCQEWBlYIFwUxAggGAxkDBwYDOgMIAwkDBQgDCgI3AggGAwoDCAUDAAAABAAAAAABGwEHADQAPgBLAFgAADcuASsBJyYHIyYGHQE2NzU0NjsBMh8BFjsBMhYXIwcWFzMyHgEPAQ4BKwEGBzMyNj8BNi4BBxY2NCYiBhQWMyc0PgEyHgEUDgEiLgE3FB4BMj4BNC4BIg4B8wMaET4dCAwUFBsIChEMFAQDIAIEQgkOA3cHGRVbCw8EBR4FEQsMAwUUEBoHHggEFa4UGxsnHBwTVBcmLicXFycuJhcTER8jHhISHiMfEbsQFh0JAQEcEzQHBSgLEQMgAwoIAQMPDRQJNAkKCQkPDTMOHxaSARwnGxsnHC8XJxcXJy4mFxcmFxEfEREfIx4SEh4AAAQAAAAAARoBBwAMABkAIgBMAAA3Ig4BFB4BMj4BNC4BByIuATQ+ATIeARQOATcUBiImNDYyFjcVFAYrATUzMjY9ATYmKwEHIzI/AScmKwEiBgcVIzU0NjsBNh8BMzIWFVQXJhcXJi4nFxcnFxEfEREfIx4SEh4dGyccHCcblhsULi4MEAERDFATHgQCGhoCBCcMEAESGxQnCwkdUBQbqRcnLiYXFyYuJxeWER8jHhISHiMfEUETHBwnGxtKXhMcExELXgwQEgIaGQMRCxwcExsBCR0bFAAAAAUAAAAAAQcBBwAPAB8AKAA5AEsAADc0NjsBNhYdARYGKwEiJjU3IgYHFR4BOwE+AT0BNCYjBzI2NCYiBhQWNzQuASMiBhQWMzIWFRQWMjY3NC4BIyIGFBYzMh4BFRQWMjYTGxSWExsBHBOWFBsvDBABARAMlgsREQuEBggICwkJRxIeEgQFBQQUGwYIBTghOCEEBQUEHDAcBQgF2BMbARwTlhQbGxSyEQuWDBEBEAyWCxGuCQsICAsJDhIeEgUIBhsUBAUFBCE4IQUIBRwwHAQFBQAABwAAAAABGwEHABAAFAAXABoAHQAhACUAABMiDwEGHwEWMj8BNi8BJgcjBzczDwEzFyczBzczBzcjJzMHIzczQgYDJQMEegMIA3oEAyUDBqgXHCcOMDAeCkQiNjBOUzUOJyxGDioBBwZLBQWWAwOWBQVLBgFKODgTYWFtbWF0ODg4AAAAAgAAAAABLQEJABgAMwAAJQYiLwEVFAYiJj0BBwYiJjQ/ATYyHwEWFAc1NDYfARYVMzQmLwEmDgEdARQeAT8BNQcGJgEpAwcDFQYIBRYCCAYDJgIIAyUD4QkFlgUTCAeWCRQNDRQJWmMFCU4DAxVaBAUFBFoVAwUIAyYCAiYDCA6oBgUCVQMFBw4EVAUEDwuoCw8EBTIWOAIFAAAABQAAAAABBwEHAAYAEQAwAD0ATwAANwYHNTQ2NxcwMQcGBzc+AT0BNyYvASYOAh0BNjc1NDYyHwEeARQGDwEWFzc+ATQnBxQOASIuATQ+ATIeAScmIg8BJyYiBhQfARYyPwE2NCYLCAoJpBACBSAGCCIEB5YHDg0ICgkFBwKWAgMDAjcCAT0HBwNaFycuJhcXJi4nFygDCAMxDAMIBQITAwgCOQKwBQcHCQ4DdwkNDBIEDQcFSQcEVAQBBw0HMwIBMAQFAVUBBAUFAR8JCyMEDQ8GUBcmFxcmLicXFycMAwMxDAIFCAMSAwM4AwcAAAAAAwAAAAABBwEHABIAJAA+AAA3FjMyPwE+ATQmLwEmIg4BHQEUNzYyHwEeARQGDwEGIi4BPQE0FzcVFAYPAQYjIicmJy4BPQE0NjcVFB4BMjdACQsIBpYHBwcHlgcODQgWAgcClgIDAwKWAgUFAn8XCAZfDxEICREMCgkKCQwVGQsuCANVAw0QDQRUAwcNCKgMuwMBVQEEBQUBVAIDBAOoBKANBQcOAzYIAwQNCRgNaQgPA4MNFQ0GAAIAAP//ASwBCQAjAD4AACUUBg8BDgEiJi8BLgE0PgIyFh8BNTQ2MhYdATc+ATIeAhUnBwYmPQE0Nh8BFhUzNCYvASYOAR0BFB4BPwEBLAECJQIDBAMBJgECAgIEBAMBFgUIBhUBBAQDAwFLiAUJCQWWBRMIB5YJFA0NFAl/LwIDAiUCAQECJQIDBAMDAQECFVoEBQUEWhUCAQEDAwJXTQIFBqgGBQJVAwUHDgRUBQQPC6gLDwQFRwADAAAAAAEHAQcAHAApADsAACUUBg8BJic3NjQvASYiBh0BBgc1NDYzMh8BHgEVBxQOASIuATQ+ATIeAScmIg8BJyYiBhQfARYyPwE2NAEHCAc9AQI3BQWWAgYGCQoRCwgGlgcHXRcnLiYXFyYuJxcoAwgDMQwDCAUCEwMIAjkClggNBCIKCh8DCgNVAQYELwECMgwRBFQEDQhCFyYXFyYuJxcXJwwDAzEMAgUIAxIDAzgDBwADAAAAAAEHAQcAHAApAEUAACUUBg8BJic3NjQvASYiBh0BBgc1NDYzMh8BHgEVBxQOASIuATQ+ATIeAQc3NjQmIg8BJyYiBhQfAQcGFBYyPwEXFjI2NCcBBwgHPQECNwUFlgIGBgkKEQsIBpYHB10XJy4mFxcmLicXRxUDBgcDFhUDCAUDFRUDBQgDFRYDBwYDlggNBCIKCh8DCgNVAQYELwECMgwRBFQEDQhCFyYXFyYuJxcXJxcWAwcGAxUVAwYHAxYVAwgFAxUVAwUIAwAABQAAAAABLAEJAB8APgBOAFsAaAAANzQvAQcGJj0BNDYfARYVMzQmLwEmDgEdARQeAT8BND8BNCYrASIGHQEUFwYdARQWOwEyNxY7ATI2PQE0JzY1JzQ2OwEyFh0BFAYrASImNRcjIiY9ATQ2OwEVFAY3FAYrASImPQEzMhYVdAEBGQUJCQWWBRMIB5YJFA0NFAkPA7gQDHELEQgIEQsmCwgICiYMEAcHlgUEcQQFBQRxBAUvJgQFBQQvBVAFBCYEBS8EBUIBBAEPAgUGqAYFAlUDBQcOBFQFBA8LqAsPBAUICQglDBAQDBMKCAgLEwwQBwcQDBMLCAgKEwQGBgQTAwYGA0EFBBMEBRwEBQkEBQUEHAUEAAAAAAUAAAAAARoBGgAZACsALwAzAFoAACUVFA4CKwInJi8BJi8BMzI3Njc2PQEXFgcjIiY9ATQ2OwEyHwEWHQEUBiczNSMXIxUzNxUzMjY9ATQvASYrARUUBisBIiY9ASMiBh0BHgE7ATU0NjsBMhYVARkLFRwPcAUFBQQEBAMDkQoJDAkRBwtLlg8WFg+BEAsVCxZuJiY5S0sTEggLBRYFCBALCCUICyYHDAELBxMLCEsHC7lbDxwVCwEBAwMCBAUDBAkRF30HC5EWEJYPFgsVCw+BEBa8E3FLS0sLCIEHBhUGEwgLCwgTDAeWCAtLCAsLCAAAAAADAAD//wEsARoAPQBIAF4AADc0NjsBMhYXNy4BKwEiBh0BIyImPQE+ATsBFRQWOwEyNj0BMzIfARYdATYyFzU0LwEmKwEiBh0BFBY7ATcjNzMVFAYrASImPQEXFAYPAQYPASIuAjU3Nj8BNjIXHgFeBQReAwUBDgQMB14MEBMHDAELByYQDCUMERkIBh4GBAkFCx4LEJ0PFhYPTAUrEzgGBCUEBrwEBVAKDhcDBgQBBgMLUAkYCAQFegQFBAMOBQcQDFQLB7wHCxwLERELHQYeBggtAQEtEAseCxYPvA8WE+EdBAUFBB2OBgsEUAsDBgEEBgMXDgpQCQkECgAEAAAAAAEaARoAEQAbACUASwAAJScmKwEiBh0BFBY7ATI2PQE0JxUUBisBIiY9AQc1NDY7ATIWHQE3FAYrATU0JisBIgYdASMiJj0BPgE7ARUUFjsBMjY9ATMyHwEWFQEOHgsQnQ8WFg+8DxZwBgQlBAYSBQReBAU5DAcTEAxeDBATBwwBCwcmEAwlDBEZCAYeBvAeCxYPvA8WFg+dECIdBAUFBB3hVAQFBQRUEgcMVQwQEAxUCwe8BwscCxERCx0GHgYIAAAAAAQAAAAAAQcBBwATACgAPQBSAAA3IgYdARQGIiYnNT4BOwEyFhQGIzc0NjsBMhYdARQOASY9ATQmKwEiJgcyFh0BFBY7ATIWDgErASImPQE0NjMeAR0BFAYrASImNDY7ATI2PQE0NkYGCAUIBQEBEw0hBAYGBFUFBCENFAYIBQgGIQQFjQQFCAYhBAYBBQQhDRMF0gQGFA0hBAUFBCEGCAX0CAYhBAUFBCENFAYIBQkEBhQNIQQFAQYEIQYIBYgGBCEGCAUIBRMNIQQGAQUEIQ0TBQgFCAYhBAUAAAAEAAAAAAEHAQcAEwAnADsATwAANxQWOwEyFhQGByMiJj0BPgEyFh0BNDY7ATI2NCYnIyIGHQEeATI2NScyFh0BFBYyNj0BNCYrASIGHgEzNxQGKwEiBhQWOwEyNj0BLgEiBhXOCwgcBAYGBBwQFgEFCAULCBwEBgYEHBAWAQUIBYMICwUIBhYQHAQGAQUELwsIHAQFBQQcEBYBBQgF4QgLBQgFARYQHAQGBgSyCAsFCAUBFhAcBAUFBC8LCBwEBQUEHBAWBggFgwgLBQgGFhAcBAYGBAAAAAAD/////wEHAQcAFAAhAEEAACUnNjU0LgEiDgEUHgEzMjcXFjI2NCciLgE0PgEyHgEUDgEXFhQGIi8BBwYiLwEHBiIvASY0NjIfATc2Mh8BNzYyFwEESBIWJy4nFhYnFx0YSAIIBo0SHhISHiQeEhIePwMFCAMfHgMIAx8eAwgDJQMFCAMfHwIIAx8fAwcDNkcYHRcnFxcnLicWEkgCBQg+ER4kHhISHiQeEWEDCAUDHx8DAx8fAwMlAwgFAx4eAwMeHgMDAAAAAAIAAAAAARoBGgAXACQAACUnPgE1NC4BIg4BFB4BMzI2NxcWMjY0LwEiLgE0PgEyHgEUDgEBF04MDBwvOC8cHC8cEiIOTQMIBQKdFycWFicuJxYWJyNNDiISHC8cHC84LxwNC04CBQgDOxYnLicWFicuJxYAAwAAAAABLQEsACsAVAB7AAATFx4BHwEeARQGDwEOAQ8BFAYiJzEmLwEmLwEmLwEuATQ2PwE+AT8BPgEyFhcnLgEvATQmIgYPAQ4BDwEOARQWHwEeAR8BFBYyNjU3PgE/AT4BNCYvATIXBwYHBgcOARUUHgEzMjY3FhcGFBcHFx4BBiIvAQYjIi4BND4BzAYEDQoUAwMDAxQJDgMHBQUCAgEHAwYCBwcUAwMDAxQJDQMHAQQFBF0OBwoCBQMEAwEEAgoHDgICAgIOBwoCBQMEAwUCCgcOAgICAq4HBwYIBQIBGSESHhIUIgcDBAICAkgCAQYIA0cYHRcnFhYnAScUCg0EBgEEBQQBBwMOCRQCAwECAhcIBQIGAgcBBAUEAQYEDQoUAgMDlwUCCgYPAQICAQ8GCgIFAQMDAwEEAwkHDgICAgIOBgoDBAEDAwMBdAEBAwcDBAMlGRIeEhcTAgEFDAUESAIIBgNIEhYnLicWAAAEAAAAAAEHAQcAHwAsADUAPgAAJQYiLwEmJzY1NC4BIyIGBwYHNTQ+ATIeARUUBxcWFAcnFA4BIi4BND4BMh4BBzcmIyIOARUUNzQnBxYzMj4BAQQDCAI9AwoPEh4SGiUCCgkWJy4nFhJIAwNbFycuJhcXJi4nF4lcEhYRHxGDDVwRFhIeEigDAz0TERIXEh4SIxkDBQIXJxYWJxceF0gCCAMsFyYXFyYuJxcXJz5cDRIeEhUVFhJcDREfAAIAAAAAAQcBGgAWACMAADcOASMiLgE0PgEyHgEVFAYHFxYUBiIvATQuAg4BHgIyPgG8DiISHDAbGzA4LxwMDDsCBQgDKBYnLicXARYnLicWYwwMHC84MBsbMBwSIg46AwgFAooXJxYBFycuJxYWJwACAAAAAAEsAQcAGABEAAA3Mh8BFhQPAQYiJjU/ATMyNjQmKwEvATQ2NzIWFx4BFRQHJzcuASsBIiY1NCYiBhUUBisBIgYUFjsBFSMiLgE1NDY3PgGNAgKWBQWWAgYGARNTBAYGBFMTAQUOHSoDGCECEQEBGBIEBAYhLiEGBAQSGBgSMzMRHBAhGAMqqQFLAwsDSwEFBAM/BgcGPwIEBl4mHAIjGAcICQYRGQYDGCEhFwQGGSMYExAcERgjAhwmAAACAAAAAAEaARwADQAYAAATNh8BFhQPAQYmPwEnJhcHNycXMzIWFAYjFgUF9AUF9AUKAiUlAjgdz88daQQGBgQBFwQDegIMAnoDCAZ3dwaGX2hoXwUIBQAABgAAAAABBwEaAB0ALQA7AEgAVQBiAAAlJy4BByM1NCYrASIGHQEjIgYPARwBHgE7ATI+Aic0NhczNhYHFRYGKwEiJjUHNzMVFBY7ATI2PQEzFycmNjsBMhYUBisBIiYVJjY7ATIWFAYrASImFzQ2NzMyFhQGKwEiJgEGHAEFAxMQDEsMEBMDBAIcAwQC4QIFAgGpBQRLBAYBAQYESwQFNBUMEAxLDBAMFn8BBgQlBAYGBCUEBQEGBCUEBgYEJQQGAQUEJQQGBgQlBAYfSwMEAY0MEBAMjAQDSwIEBAICBATgBAYBAQYEqQQFBQQuOAoLERELCjiyBAUFCAYGRwQFBQgGBiIEBQEGCAUFAAcAAAAAASwBGgAIABEAqQDbAQQBGAEgAAA3FAYiJjQ2MhY3IgYUFjI2NCYXDwIGLwEmDwIUDwErASYvATQrAQcXFh8CFA8BBhQfARYVDwEGDwEGIy8CIg8BBg8BJyYvAS4BIw8CIi8BJi8CND8BNjUxNC8BJjU/ATY/ATY7AR8BMj8BNjM3FzIfARQWMzcnJi8BJj8BNi8BJj8CNh8BMjM/ATY3MzYXMxYVFxQXMzc2HwEWHwEWDwEGHwEWByYnBwYiJyYvASsBBwYHBiIvAQYHFxYUDwEWFzczMhYfATsBNzY3NjIfATE2NycmND8BNj8BJwcGJi8BIwcGBwYvAQcXHgEGDwEXNzYWHwEzNzY3Nh8BNycmNAczFSMiJj0BNDY7ATIWHQEjFRQWJzM0JisBIgbFCxALCxALOAQFBQgFBSgBAgUDBQkBAQECAwUGCAUBAgEBBwMFAwEBAQwDAg0BAQEDBQMCAwIOAgUBAwEFDAwFAQIBAwMCDgIDAgIFBAEBAQ0CAQ0CAQEEBQICAwIOAgUBAwEFDAwFAQMEAg0CBAIBAgQHAgEIBAIEBQMECQEBAQIBBQIGBgMFAgECCQUDAQQCAQIDCAEBBwRJAgMKAwgECQECBgYCAwgEBwMJBAIHBwcHAgQMBAgKAQEGBgIDCAQHAwoDAgcHBzkBAgQCBgcLAQEEAgMDBgcFAgUEAQQCBAIGBwsBAQQCAwMHBgUCBQTHExMXISEXlhch8xUV4RYQlhAVQggLCw8LC00FCAYGCAUZAgYHBAIDAQECCQMCAQEFCgECBAYIBAICAgoCBgEMAgICBAcHAwMBBAEEEAQBAQEBBA8CAwEEAQMDBggEAgICCwIDAgILAgIDAwgGAwMFAQUPBQEBBQ4DAwUCBQUDBAMHAgEHAwQIBwQCAwIJBQEBAQEFCQEBAwIEAgUFAwQDBwECBgQqBQUEAQIFCQoNCAMCAQQFBQYGEgYGBgQECgYKDQgDAgEDBAYGBhIGQwMBBAMCAQYHBQkEAgQCAgMFBQkGAgMEAgEGBwUJBAMDAgIEBAUKaxMhF5YXISEXE4MQFbsQFhYAAAAABwAAAAABBwEaAAoAFQA6AEoAWwBrAHYAADcUDgEuAj4BMhYnMj4BLgIOARQWNwYHFhcVBgcWFxUUBisBIiY3NTQ3Jj0BNDcmPQE0NjsBMhYHFSMUFjsBMjY9ATQmByMmBhUXIyIGHQEUFjsBMjY9ATQmBxc0JisBDgEdARQWOwEyNjUnMj4BLgIOARQW4QMFBgQBAgUHBQkCBQIBBAUGAwYzAQcHAQEHBwERDKgMEQEHBwcHEAyoDBEBzgYEqAQGBgSoBAayqAQGBgSoBAYGBAoGBKgEBgYEqAQGHAIFAgEEBQYDBlQCBQIBBAUGAwY+AwUGBAECBQcFQgsICAslCwgICyUMEBAMJQsICAslCwgICyUMEBAMJQQGBgQlBAYBAQYEQQYEJQQGBgQlBAYBVAQGAQUEJQQGBgSfAwUGBAECBQcFAAAAAAQAAAAAARYBGgAIABEAYQCaAAA3IgYUFjI2NCYHIiY0NjIWFAYXLwEmNj8BNicmJyYjDwEjIiYvASYnJiIHBg8BDgEjIiMvASIHBgcGHwEWBg8BBhcWFxYzPwEzMhYfARYXFjI3Nj8BPgEzMjMfATI3Njc2JwcnJiMiBg8CBiIvAS4BKwEPASYnNz4BLwI2NxcWMzI2PwI2Mh8BHgE7AT8BFhcHDgEfAgYHlhAVFSAWFhAICwsQCwtzGAIEAQUYBAIIEwIEAyACBgkBBQEFDhwOBQEGAggEAwMdAwQCEwgCBBoEAQUYBAIIEwIEAyADBQkBBQEFDhwOBQEGAggFAgMdAwQCEwgCBCIXBgULEgQBBAkQCAUCEwwHBRcKBhILAgkEEgYKFwYGChIEAQUIEAkEAhMMBwUXCgYSCwIJBBIGCrwWIBUVIBY5CxALCxALDRQCBQ0EFAMFGxUDAQsHBR8FAQMDAQUhBQULAQMVGwUDFgUNBBQEBBsVAwELBwUfBQEDAwEFIQUFCwEDFRsEBCYIAgwKBhcBARcMEAIIDQ8QCRwLBBAPDQgCDAoGFwICFwwQAggNDxAJHAsEDxANAAAEAAAAAAEHAP4AGQAjADwARgAANzIWFzMyFhQGByMOASImJyMiJj4BNzM+ATMXIgYUFjI2NCYjNzIWFzMyFhQGByMOASImJyMiJjQ2NzM+ARciBhQWMjY0JiNxDBUDaAQGBQNqAxUZFQMdBAYBBAMfAxUMAQgLCw8LCwhMDBUDHQQGBQMfAxUZFQNoBAUEA2oDFQ0ICwsPCwsIehAMBgcFAQwQEAwFCAUBDBATCw8LCw8LlhAMBQgFAQwQEAwGBwUBDBATCw8LCw8LAAADAAAAAAEtARsAHAAzAFcAABMmBh0BBwYHBgcGBxQeATY3Njc2NxUUFj8BNjQvATEWNj0BFwc1NCYjBwYHBgc2NzY3NjcnIgYdARQWOwEyNic1NiYiBh0BFAYrASImPQE0NjsBMjY0JiPUBQoDDw4YDxMEAwUGAhwhCQgLBFUDBFsEBzw8BgQJCwwZFwUKDBMLDYIUGxsUlhMcAQEGCAURC5YMEBAMSwQFBQQBFwQFBiUBAQUJFBopAwUCAQIbCwMCJQYFBEsDCQMCAQYEHC82GgQGAQIECBESDRAIBAEvHBOWFBsbFDgEBQUEOAwQEAyWCxEFCAYAAAMAAAAAAQcBEAARADAARAAANxQGBxUUBiImPQEuATU0NjIWJw4BDwEiBgcVHgEfARY/AT4BPQE0JiMnLgEvASYiDwE1Nz4BPwEXHgEfARUUBg8BJy4BrQcHBQgFBwcNFA0nDiUUEAQFAQEkISYFBSYhJQYEEBQlDgkDCANXChYpDwYGDykXCSAcIiIcIKQHDAIVBAYGBBUCDAcKDg5YCg4CAgUENCVBExcCAhcTQSU0BAUCAg4KBwMDYCsBAxAKBAQKEAMBKyA4ERQUETgAAAACAAAAAAEaAQcAHAA0AAATMhYUBisBIgYdARQWOwEyFhQGKwEiJj0BNDYXMwc3NjIWFA8BMzIWFAYrARcWFAYiLwEmNLIEBgYEXgsREQteBAYGBF4TGxsTXj84AwgFAih/BAUFBH8oAgUIAzgDAQcGCAURC4QLEQUIBRsThBMcAWk4AwYIAikFCAUpAggGAzgDCAAAAgAAAAABBwEHABwANAAAEyIGHQEUFjsBMj4BJisBIiY9ATQ2OwEyPgEmKwEXJyYiBhQfASMiBhQWOwEHBhQWMj8BNjRUExwcE14EBQEGBF4LERELXgQFAQYEXrA4AwgFAih/BAUFBH8oAgUIAzgDAQccE4QTHAYIBRELhAsRBQgFaTgDBggCKQUIBSkCCAYDOAMIAAMAAAAAARoBGgAMABkAJwAAEyIOARQeATI+ATQuAQciLgE0PgEyHgEUDgE3FhQPAQYiJjQ/ATYyF5YkPCMjPEg8IyM8JB8zHh4zPjMfHzMXAgJeAwgFAl4DCAIBGSM8SDwjIzxIPCPzHjM+Mx8fMz4zHqYDCANdAwUIA14CAgAABQAAAAABBwEHAAgAHAAlADIAPwAANzI2NCYiBhQWFyYiDgEXHgEyNjc2LgEiBw4BIiY3FAYiJjQ2MhYXNC4BIg4BFB4BMj4BJzQ+ATIeARQOASIuAXUGCAgMCAgEAwcGAQMJGhwaCQMBBgcDBxIUEksIDAgIDAhCHzM+Mx4eMz4zH88ZLDIsGRksMiwZmwgMCAgMCCQDBQgDCgwMCgMIBQMICAg6BggIDAgIGR8zHx8zPjMeHjMfGSwZGSwyLBkZLAAAAAMAAAAAARoBGgAxAGcAcAAANzU0JiM1NCYrASIGFRQXByMiBhQWOwEVBhYyNj0BNxY7ARUjIgYdASIGHgE7ATI2NCYHIyImNDY7ATI2PQE0NjsBMjY9ATQmKwEiJjQ2OwEyFh0BFBY7ATIWHQEjIgYUFjsBMhYUBiMnFAYiJj4BMhb0FhAbFDgTHAgVGAQGBgQTAQYIBRUMDhwSEBYQFgEVEKkPFhYPqQgLCwgJBAYLCBwEBQUEJgwQEAw4DBEFBAkIC1QEBgYEZwgLCwhxBQgGAQUIBV4TDxZUFBsbFA4LFQYIBRMEBQUEGBUHJhYQEhYfFhYfFjgKEAsFBB0HCwYEOAQFERcREQxdBAYLBxMGCAULEAvFBAUFCAYGAAAAAAYAAAAAARoBGgAXACoAOgBEAE4AVQAAEzQmIgYdAScmIgYUHwEWMj8BNjQmIg8BNyMiBh0BMzUzFSMVMzI2PQE0JgcjFTMVIxYUBzMyNj0BNCYHFAYiJjQ2MhYVJzQ2MhYUBi4BNTciBhUzNCZLBQgGFQMIBQMlAwgCJgMGCAIWu4MHDBODEhIICwtAcHBMAQFMCAsLGwoQCwsQCl0LDwsLDwtLCAslCwEQBAUFBN0VAwUIAyYCAiYDCAUDFdQMByYmXhMLCF4HDEsTXgUJBQsIXggLSwgLCw8LCwgTCAsLEAsBCgheCwgICwAAAgAAAAABBwEHACoAVgAANx4BNj8BPgE/AT4BNCYvAS4BLwEuASIGDwEOAQ8BDgEeAR8BFh8BFh8BFhcWMjY/AT4BPwE+Ai4BLwEuAS8BLgIOAQ8BDgEPAQ4CHgEfAR4BHwEWZgULCQIGAwsHFAUHBwYUBwsCBwEJCwoBBwILBxQFBwEGBRQHBgIEAgYCZAMKCAEFAgYFDgUFAQIGAw4FBwEFAQcHBwUBBQEHBA8DBQIBBQQPBAcBBQJ0AwEHBRQHCwMGAgkLCQIGAwsHFAUGBgUVBwoDBgIJCwkCBgMFAwQGFAVPAgUFDgUGAgUBBwcHBQEFAQcEDwUEAQIFAw4FBwEFAQUHBwcBBQIGBQ4FAAAEAAAAAAEHAQcAKgBAAGwAgAAANx4BNj8BPgE/AT4BNCYvAS4BLwEuASIGDwEOAQ8BDgEeAR8BFh8BFh8BFi8BNz4BPwEXHgEfAQcOAQ8BJyYvASYXFjI2PwE+AT8BPgIuAS8BLgEvAS4CDgEPAQ4BDwEOAh4BHwEeAR8BFi8BNz4BPwEXHgEfAQcOAQ8BJy4BZgULCQIGAwsHFAUHBwYUBwsCBwEJCwoBBwILBxQFBwEGBRQHBgIEAgYCFxAQDBAEBQUEEQsREAwRAwUGAgYECG8DCggBBQIGBQ4FBQECBgMOBQcBBQEHBwcFAQUBBwQPAwUCAQUEDwQHAQUCDgMDCQ0DAQEDDQkDAwkNAwEBAw10AwEHBRQHCwMGAgkLCQIGAwsHFAUGBgUVBwoDBgIJCwkCBgMFAwQGFAVABQUEEQsQEAwRAwUGAxEMEBAJBgUJiwIFBQ4FBgIFAQcHBwUBBQEHBA8FBAECBQMOBQcBBQEFBwcHAQUCBgUOBTIBAQMNCQMDCQ0DAQEDDQkEBAkNAAAAAAMAAAAAARoBGgAPABkAIwAAEyMiBh0BFBY7ATI2PQE0Jgc1NDY7ARUjIiY3FAYrATUzMhYV6qgUGxsUqBQbG9gQDEtLDBDhEQxLSwwRARkbFKgUGxsUqBQb16gMEeEQDAwQ4REMAAAAAwAAAAABGgEaAA8AGQAjAAA3FRQWOwEyNj0BNCYrASIGFyMiJj0BMxUUBicyFh0BIzU0NjMTGxSoFBsbFKgUG9eoDBDhEQwMEeEQDOqoFBsbFKgUGxvYEAxLSwwQ4REMS0sMEQAAAAADAAAAAAEaARIACABSAKQAADcyFhQGIiY0NjceAR0BFhc2NzY3NhcWFxYVFA4CLgEPAQ4BFh8BFhcWDgInIyIuAjc0NjczNjcjBiIuATc2NzAjJicmJzU+ATc1Mh4BHwMmBw4BBw4BFzEVIycmJy4BKwEOAQceATcHDgErASIOARY2OwE2NxciDgIXFSMiBhUzMjc2NzYnNxYXFTc2NSYvAS4BNz4CHgI+AT0BLgFQAwYGBwYGHAwPBwUFCg0SGhgRDA0FCg0OCwQCAwMFBwINAQEJFhwQfQIDAgEBFxEGAgUnBw8LAQQKHAEKCBEFBB4WBQsIAgECfxATDhMEAQIBAwgIBwsOCAIVIQQKHA8GAQUEEwcKBAUIAjwDCAwGDAkFARgICm4JCQ0DAgIHBgICBAEKAggHAwIJDAsJCAcFAhHOBQgGBggFQgEQCwMHBw4LDgMFDQsSFhEHDAgEAwYBAQIJCwgDERYQHRcLAQEDAwISGwIKCQMKEAoTBAIEBgoIFyMJGQUIBQMBBgkEAhMMBhcHAQwMCAwHARwVCgkCGAMFCAsDAwIDEQUKDQYKCwcDCA4JDwcKCgUFCwsQDAMIFwsHCgMBBQICBQcCDBsAAAIAAAAAASIBGgAcACYAADciLwEHBi4BPwEnJjY/Aj4BFh8CHgEPARcWBicPARcHNxcnNyfgBQRBQQYMCgIMNQgHC0khAw0NAyFJCwcINQwCC1MjUzwOSUkOPFMTAiIiAwIMCEg0CBUBC0IGBQUGQgsBFQg0SAgN9EsMOVInJlE6CwAAAAEAAAAAASIBGgAcAAAlBxcWBiMiLwEHBi4BPwEnJjY/Aj4BFh8CHgEBGjUMAgsIBQRBQQYMCgIMNQgHC0khAw0NAyFJCwekNEgIDQIiIgMCCwlINAgVAQtCBgUFBkILARUAAAACAAAAAAEiARoAHgAqAAAlJi8CLgEGDwIOAR8BBwYeAT8BFxYzMjYvATc2JwcGFRcnJiM1FxYfAQEeAwtJIQMNDQMhSQsHCDUMAgoMBkFBBAUICwIMNQgESgMORQICIgIFTrYLAQtCBgUFBkIKAhUINEgJCwIDIiICDAlJMwgKPAMFTCQBukUEAQoAAAMAAAAAARoBGgAPABwAKgAANyIGHQEUFjsBMjY9ATQmIwc0PgEyHgEUDgEiLgE3Ig4BFB4BMj4BNC4BB3EICwsISwcLCwioIzxIPCMjPEg8I4MfMx4eMz4zHx8zH84LCEoICwsISwcLOCQ8IyM8SDwjIzyVHzM+Mx4eMz4zHwEAAgAAAAABBwEHABgAPQAANzQ2MzIWFx4BPgEnLgEjJgcOARUUFzMuARcyFhQGKwEWFRQGBwYjLgEnJj4BFhceATMyNjU0JicjIiY0NjNeIBoSHAYCBwcCAggmFh8WCw0PIA0PnwQGBgQsEA0LFh8XJAsCAgYIAgccExkhERB+BAUFBMwQGA4KAwIEBwQPEQEQCBYNExAFFCwFCAYPFA0VCBEBEQ8DCAQCAwsNGQ8LEwUGCAUABQAAAAABGgD0AAgAEQAaADAARwAANzI2LgEiBhQWNxQGIiY0NjIWFzI2NCYiBhQWByMiJj0BNDY7ATIWFAYrARUzMhYUBjMjIiY0NjsBNSMiJjQ2OwEyFh0BFAYjXggLAQoQCwtTCxALCxALJQgLCxALC5cJCAsLCAkEBQUECQkEBQXUCgQFBQQKCgQFBQQKBwsLCIMLEAsLEAsTCAsLEAsLGwsQCwsQC0sLCJYICwYIBZYFCAYGCAWWBQgGCwiWCAsAAAIAAAAAAPQBBwAbADcAADcjIiY9ATQ2OwEyFhQGKwEiBh0BFBY7ATIWFAY3NTQmKwEOARQWOwEyFh0BFAYrASIGFBY7ATI2XgoLERELCgQFBQQKAwYGAwoEBQWSEQsKBAUFBAoDBgYDCgQFBQQKCxEmEAyoDBEGCAUGBKgEBgUIBRyoDBEBBQgFBgSoBAYFCAUQAAADAAAAAAEsAPQAFAAkAEMAADcGFBYyPwE2NC8BJiIGFB8BIxUzBzcjIgYdARQWOwEyNj0BNCYXFAYrATUjFxYUBiIvASY0PwE2MhYUDwEzNTMyFh0ByAMFCAMvAwMvAwgFAx5QUB41zhQbGxTOFBsbCBAMZ1EfAwUIAy8DAy8DCAUDH1FnDBBkAggGAy8DCAIvAwYHAx8TH5AcE3ETHBwTcRMcoAsRSx8CCAYDLwMIAi8DBgcDH0sRC3EAAAQAAAAAAQwBAwA6AD4AQgBGAAA3JiIPASM1MwYWHwEWMj8BNjQvASYiDwEjNzY0LwEmIg8BBhQfARYyPwEzFRQWOwEGFh8BFjI/ATY0LwI3HwEHJzcHJzcX+AYPBgkrGQMBBQ8FEAUYBgYOBg8GCVYPBQUZBRAFPgUFGAYPBhwrBQQjAwEFDwUQBRgGBsQZPhh6GA8YCQ8YD2cGBglLBgwFDwUFGAYQBQ8FBQkOBg8GGAYGPgUQBRgGBhxVBAUFDQUOBgYYBRAFQhg+GC8YDhmFDxgPAAAAAAcAAAAAARoBGgAfAD8ASABRAFoAZABtAAATIg4BFRQWMzY3PgE3NjIWHQEUHgEzMjc2NzY1NC4BIxciJj0BNCYjIgcGBw4BIyImNTQ+Ah4BFQYHBgcGIzE3FAYiJjQ2HgE3FAYiJjQ2MhYnFAYiJjQ2MhYXJjYyFhQGIiYvARQGIiY0NjIWliQ8IxkTCQYFDAQGEAoSHhIcFBIJCSM8JC8UGxUQDAoGBwUFBQsOHTM/Mx8BBgcOEBYcCxALCxALEwsQCwsQC4MLEAsLEAtLAQsQCwsQCgESCxALCxALARkgOSQSGgEDAQoBAw4JGBEfERQTHx0gJDwj8xsTGBIYBQIGAwMPCh4xGwEfMx8ZGBwQFDkICwsQCwEKMAgLCxALCzAICwsQCwsICAsLEAsLCBMICwsQCwsAAAQAAAAAAQcBBwAPAB8ALAA4AAATIgYHFR4BFzM+AT0BNCYjBzQ2OwEyFh0BFAYrASImNTc0NhczNhYUBisBIiYXIyIGFBY3MzI2NCZUExsBARsThBMcHBOgEQuECxERC4QLESYFBF4EBQUEXgQFZ14EBQUEXgQFBQEHHBOEExsBARsThBMcLwsREQuECxERC14EBgEBBggFBSsFCAYBBQgFAAAABQAAAAABGgEHAB0AKQA0AEAAUAAAJRUUBisBNTQnMzI2PQE0JisBIgYdASM1NDY7ATIWBzI2NCYrASIGFBYzFzQmKwEyFhczMjYHIyIGFBY7ATI2NCY3FQ4BKwEiJj0BNDY7ATIWARkQDC8BMAQGBgRwBAYSEAxwDBAvBAYGBEsEBQUEVQYESwwTByUEBmdLBAYGBEsEBQUrARAMcAwQEAxwDBHqSwwQCgQFBQRLBAYGBC4uDBERKAYIBQUIBhwEBgsIBT0GCAUFCAYcSwwQEAxLCxERAAAABwAAAAABGgEHAB0AKQA0AEAATABcAGwAACUVFAYrATU0JzMyNj0BNCYrASIGHQEjNTQ2OwEyFgcyNjQmKwEiBhQWMxc0JisBMhYXMzI2ByMiBhQWOwE+ATQmByMiBhQWOwEyNjQmNxUOASsBIiY9ATQ2OwEyFgc0JisBIgYdARQWOwEyNjUBGRAMLwEwBAYGBHAEBhIQDHAMEC8EBgYESwQFBQRVBgRLDBMHJQQGZ0sEBgYESwQFBQRLBAYGBEsEBQUrARAMcAwQEAxwDBETBgRwBAUFBHAEBupLDBAKBAUFBEsEBgYELi4MEREoBggFBQgGHAQGCwgFKwUIBgEFCAUlBggFBQgGL0sMEBAMSwsREQsDBgYDSwQGBgQAAAAAAgAAAAAA9wEaABYAKAAAEz4BOwEyFg8BMzIWDwEGLgE/ASMiJj8BIwczMhYPAQYeATY/ASMiJjdcAgoGUwoLBBImCQcFfAgWDgMYHgcIAohTISQEBgEcAQIDAwF2KgUFAQEMBgcQCTIQB5sKARIMUgwGcnEIBF4CAwIBAZUIBAADAAAAAAEaAP4AHQAzAEoAADcWFA4BIwcVFAYiJj0BJy4CND4CMjMXNzYyHgE3FRQGDwEGLwEuAT0BNDY/ATYfAR4BBy4BLwEmDwEOAR0BHgEfARY/AT4BJzXgAQICAk4GCAUpAgICAQMDBAIrUQIEAwM5Cgh6CgpUCAoKCHoKClQIChIBAwNUAwR5AwQBAwNUAwR5AwQBugIEAwMeIAQFBQQgDwEDAwQDAwERHwECAgNECQ4DLwQEIQMOCUQJDgMvBAQhAw4JAwUBIAICLgEFA0QDBQEgAgIuAQUDRAAAAAMAAAAAARoA2AAZACIAKwAANyIGByMuASMiBhQWMzI2NzMeATMyPgE0LgEHIiY0NjIWFAYXIiY0NjIWFAbYGSUDOwMUDQ8WFg8NFAM7AyUZER8RER+xCAoKEAsLmBQbGyccHNghGA0QFiAVDw0YIRIeJB4SVQsQCwsQCxwcJhwcJhwAAAUAAAAAAQcA4QAUAB0APQBfAGgAADciBzU0JiIGHQEUFj4BNxYzPgE0JgciJjQ2MhYUBhciJjQ2MzIXFhUUBiInMSYjIgYUFjMyNzE2MhYVFAcGJzY3NjMyFh0BFAYmJwYjLgE0NjMyFzU0JyYjIgcxBiImNBciBhQWMjc1JpYKCQUIBQUHBQEJChAWFhAICwsQCwtRDxYWDwYHCwYGBAQECAsLCAQEBAYGCwfRAgUHCw0UBgcDCAkSFBQSCAYHAwQJBAIIBRwJCgoTBAbFBhkEBQUEXgQGAQMDBwEYIxlCDhMODhMOEhgjGQMDCAQFAgIOEw4DAgYEBwQDUgMCAw8OMwQGAQIDARAXEQEFBgMBAwIFCCkGBwYEDgEACAAAAAABBwEHAAwAGAAkADAAPABMAFAAXAAANzIWFAYrASImPgE7AScyFhQGKwEiJj4BOwEyFhQGKwEiJjQ2MzUyFhQGKwEiJjQ2OwEyFhQGKwEiJjQ2MycyFh0BFAYrAS4BPQE+ATMVMzUjFzIWFAYrASImNDYzsgQGBgSDBAYBBQSDOAQFBQRLBAYBBQTOBAYGBF4EBQUEBAYGBHAEBQUEzgQGBgQ4BAUFBBwICwsIcQgLAQoIcXHFBAYGBCUEBgYEJgYIBQUIBTkGCAUFCAYGCAUFCAY4BQgGBggFBQgGBggFcQsIJggLAQoIJggLOSYTBQgGBggFAAAAAwAA//8BLQEaAB4ARgBcAAA3Mh8BHgEUBg8BDgEiLgI0Nj8BIyImNDY7AScmNDYnNh8BHgEdAScmLwI2LwEmDwEGHQEUHwEWMxYfAQYvAS4BPQE0NjcXPgEfATc2HgEGDwEVFAYiJj0BJy4B/QQDJQIBAQIlAgMEAwMBAQIVWgQFBQRaFQMFdxQUXQgKCAQFAQEBB10NDV0GBl0GCAEGBBAQXQgKCggnAQgDPj4DCAMDBDwFCAU8BANeAyYBAwQDAiUCAQEDBAMEARUGCAUWAwcGtAgIJAMOCXQIBAIBZQcCJAUFJAIHfAcCJAIIBgMEBiQDDgl8CQ4DJQMDAhoaAgMHBwIZPAQFBQQ8GQIHAAADAAAAAAEaARoAFAAqADwAADcmDgEWHwEVFBYyNj0BNz4BLgEPATcmDwEOAR0BFBYfARY/AT4BPQE0Ji8BNh8BFh0BFA8BBi8BJic1NjdYBAcDAwQ8BQgFPAQDAwgDPhQUFF0ICgoIXRQUXQgKCgh+DQ1dBwddDQ1dBgEBBs0CAwcHAhk8BAUFBDwZAgcHAwIaXwgIJAMOCXwJDgMkCAgkAw4JfAkOAxMFBSQCB3wHAiQFBSQCB3wHAgAAAAT//wAAASwBBwAUACQANABEAAA3IgYHMz4BMzIWFRQGBxU+ATU0LgEHIyImPQE0NjsBMhYdARQGJyIGHQEUFjsBMjY9ATQmIycmIg8BBhY7ATU0NyM3FzPhGigHFAYdEhchFRAYIBQjMF4MEBAMXgwQEGoEBQUEXgQFBQRyAgwCQQMGBS4BHzEbFvQgGBAVIRcSHQYUBikaFCMU4RAMXgsREQteDBCDBgNeBAUFBF4DBmwEBHEECgoEBVQvAAAAAAIAAAAAARoBGgA7AD8AACUjNTMyNjQmKwE1NCYiBh0BIzU0JiIGHQEjIgYUFjsBFSMOARQWOwEVFBYyNj0BMxUUFjI2PQEzMjY0JiM1MxUBEEJCBAUFBEIFCAVLBggFQgQFBQRCQgQFBQRCBQgGSwUIBUIEBQWjS3FLBQgFQgQFBQRCQgQFBQRCBQgFSwEFCAVCBAUFBEJCBAUFBEIFCAZLSwAABgAAAAABBwEHABwAKABEAE4AWgBjAAATMhYdATMyFhQGKwEVFAYiJj0BIyImNDY7ATU0NhciBhQWOwEyNjQmIwc3NjQmIg8BJyYiBhQfAQcGFBYyPwEXFj4BNCc3MjY0JiIGFBYzByIGFBY7ATI2NCYjBxQGIiY0NjIWVAQGHAQFBQQcBggFHAQFBQQcBWIEBQUESwQGBgSbHwIFCAMfHgMIBgMfHwMGCAMeHwMIBQJXBwsLDwsLCCYEBQUESwQGBgQTCw8LCw8LAQcGBBwFCAYcBAUFBBwGCAUcBAYmBQgGBggFjR8DCAUCHx8CBQgDHx4DCAUCHx8DAQUIAzsKEAsLEAsJBQgGBggFLwgKChALCwAAAwAAAAABGgD0ACUANwBIAAA3NDY7ATIWHQEUBiImPQEjFTMyFhQGKwEiJjQ2OwE1IxUUBiImNRcWFA8BFxYUBiIvASY0PwE2MhcnJiIGFB8BBwYUFjI/ATY0SwUEhAQFBQgGLwoEBQUEJgQFBQQKLwYIBQcCAikpAgUIAy8CAi8DCMgvAwgFAikpAgUIAy8C6gQGBgQSBAYGBAmWBQgGBggFlgkEBgYEKQIIAygoAwgFAi8DCAMuAzEuAwUIAygoAwgFAi8DCAACAAAAAAEaARoAHwBAAAA3ND4BMzIXHgEPARc3NhYXFhUUDgEjIicHDgEuAT8BJjciBhUUFxYPAQYeATY/ATYXFjMyNj0BBwYiLwEmND8BI4MUIxQODQUCAyQYJAMKAgUUIhUKCl4KHRgCC18CSxchAwEEYgYBDA4FYgUFCgoYIB4DCAMlAwMfBs4VIhQFAgoDJBgkAwIFDQ4UIxQDXwoCEyEMYglBIRgICQUEZgYQCgEFYwUCBCEXBR4DAyUDCAMeAAAAAgAAAAAAzwEHAA8ANwAANzQmKwEiBh0BFBY7ATI2NScyFh0BFAYrASImPQEzMjY0JisBNTMyNjQmKwE1MzI2NCYrATU0NjPOEAw4DBAQDDgMEBwEBQUEOAQGHQQFBQQdJgQFBQQmHQQFBQQdBgTqDBERDKgMEREMsgYEqAQGBgQcBQgGHAUIBR0FCAUcBAYABAAAAAAA9AEHABwAKQA1AEEAADciJj0BNCYrASIGHQEUBiImPQE0NhczNhYdARQGBxQGJyMiJjQ2OwEyFjcjIgYUFjsBFjY0JjMjIgYUFjczMjY0JuoEBQsIcAgLBQgGFhBwEBYGhwUEHAQGBgQcBAVCJgQFBQQmBAUFPRwEBQUEHAQGBksFBI0ICwsIjQQFBQSNEBYBARYQjQQFHAQGAQUIBQUFBQgFAQYIBQUIBgEFCAUABgAAAAABGgEHAA8AEwAjACcANwA7AAA3NDY7ATIWHQEUBisBIiY1NzMVIxUiBh0BFBY7ATI2PQE0JiMVIxUzNyIGHQEeATsBMjY9ATQmIxUjFTMTCwjhBwsLB+EICxPh4QgLCwg4CAsLCDg4cAgLAQoIOQcLCwc5OfQICwsIOAgLCwg4ODkLCDgICgoIOQcLEjlLCwg4CAoKCDkHCxI5AAUAAAAAAQcBBwAWAB0AMgBOAGsAADcnJg8BDgEdARQWHwEWMj8BPgE9ATQmDwEnNTcXFSc3Nh4BBg8BFRQGIiY9AScuAT4BHwEjBiY0NjsBMjY9ATQmKwEiJjQ2OwE2Fh0BFAYnNCYrASImPQE0NjsBMjY0JgcjJgYdARQWOwEyNtMuBgZCBQcHBi4DBwNCBgYIC0IuQi5CGQQHAwMEFgYHBgcEBAMHBGgSBAYGBBIEBgYEEgQGBgQSDBERmAYEEgQGBgQSBAYGBBIMEBAMEgQGvw4CAhkCCgYhBgoCEAECGwIJBiEHCjIbECEZDiEUCgIDBwcCCQYEBQUEBQMBBwcEAX4BBggFBgSoBAYFCAUBEQyoDBAJBAUGBKgEBgUIBgEBEQyoDBAFAAAAAAMAAAAAARoBIwAzAEIAWAAANw4BFRQWFxY+ASYnLgE1NDcXBgc3NjQmIg8BBhQfARYyNjQvATI2NxcWMjY0LwEmIgYUHwI2NTQmJyYOARYXHgEUJxc2NwcGFBYyPwE2NC8BJiIGFB8BBkANDRYTAwgFAQMQExWEGB8MAwYIAhwDAxwCCAYDDBMjDyoDCAUC9AMIBQLUDhAXEwMIBQEDEBOXDhIVDAMGCAIcAwMcAggGAwwd3w8mFBouDwMBBggCDSYWIRqEEwIMAwgFAhwDCAMcAwYIAg0ODCsCBQgD9AIFCAOeDhofGi4PAwEGCAINJi14DgoBDAMIBQIcAwgDHAMGCAINAQAAAAIAAAAAAQcBIwAkAEkAABM2Mh8BFhQPAQYiJjQ/AQ4CFRQWFx4BDgEnLgE1ND4BNycmNBc+ARceARUUDgEHFxYUBiIvASY0PwE2MhYUDwE+AjU0JicuAYYDCAIcAwMcAggGAwwZKRgTEAMBBQgDExYdMR4MA00CCAMTFx4xHgwDBggCHAMDHAIIBgMMGSkYExADAQEgAwMcAwgDHAIFCAMMARoqGRYmDQIIBgEDDy4aHjMeAQ0CCDEDAQMPLhoeMx4BDQIIBgMcAwgDHAIFCAMMARoqGRYmDQIIAAAKAAAAAAEaARoADwATABoAHgAiACYALQAxADgAPwAANzQ2OwEyFh0BFAYrASImNRczNSsCFRQWOwE3MzUrAhUzNzM1KwIiBh0BMxcjFTMVIxUzMjY9AjQmKwEVExsUqBQbGxSoFBteS0sTOBAMHBNLSxM4OBNLSxMcDBA4qTk5ORwMEREMHOoUGxsUqBQbGxQcOBwMEEtLS105EQwcEksTOBAMjBwMETkAAAAAAwAAAAABBwEHAAkAGwAtAAA3BiY+ATIWFAYjBy4BPwE2OwE2FgcVFA8BBiIvAQYUHwEWMj8BNjU3NCYrASIHzggLAQoQCwsInQsBDFgLED0PFwELWAsfCzAGBj4FEAVYBQELCD0IBbwBCxALCxALTQsfC1gLARcPPxAKWAsLZgYPBj0GBlcFCD8ICwYAAAAABQAAAAABGgEaAAgAFQAeACsAOAAANxQGIiY0NjIWFxQOASIuATQ+ATIeAQc0JiIGFBYyNjcUDgEiLgE0PgEyHgEHNC4BIg4BFB4BMj4BqQsQCwsQCzgUIygjFBQjKCMUEyEuISEuIUsjPEg8IyM8SDwjEh8zPjMeHjM+Mx+WCAsLEAsLCBQjFBQjKCMUFCMUFyEhLiEhFyQ8IyM8SDwjIzwkHzMfHzM+Mx4eMwAAAAAGAAAAAAEaAQcAEQAdAC8AOwBNAFkAABMWFA8BBiIvASY0NjIfATc2MhcjIiY0NjsBMhYUBgcWFA8BBiIvASY0NjIfATc2MhcjIiY0NjsBMhYUBicWFA8BBiIvASY0NjIfATc2MhcjIiY0NjsBMhYUBlsDAyUDCAMSAwUIAwwfAgi4lgQFBQSWBAUFuQMDJQMIAxIDBQgDDB8CCLiWBAUFBJYEBQW5AwMlAwgDEgMFCAMMHwIIuJYEBQUElgQFBQEEAwgDJQMDEwIIBgMMHwIlBQgGBggFhgMIAiYCAhMDCAUDDB8DJgYHBgYHBncCCAMlAwMSAwgFAgweAyUFCAUFCAUAAAQAAAAAAREBGwA9AEEARQBJAAAlJy4BDwEOARcVBw4BHwEHDgEfARYzMj8BFxYXBwYeATcyPwIVFBYyNj0BFxY3Mj4BLwE3FxYzMj8BPgEnByc3HwEnNx8BJzcXAQ8vAgcEOAMDAkIEAgIFMAQCAhIDBgICMAUBAyQCAgUDBQMvAQUIBjADBQMFAgIzDwECBgICOQMDAs4KJwsaHTodFSYnJ7ZeBAICHAIHAwEiAQgDCxgBCAMmBQEYCgMBPgQHBAEEUAFfBAUFBGFTBQEDBwRXCAEFARwBCAM5FRQVCzsdOgFNE00AAAAEAAAAAAESASMAFwBCAEkAZwAAJScmIg8BDgEdARQWHwEWMj8BPgE9ATQmBx0BDwEGPQEGJyM/ATMWPgE0IiY0Njc1NzIdATYfAQcVIyYOARQWMhYUBjcwFSMHNT8BBw4BHQEUFyMiLwEuAT0BNDY/ATYyHwEeARcuAQcBAFkIEghZCAkJCFkIEghZCAkJTQEFAQUFAQIBAQUHBA0GBQUGAQQEAQIBBQYEBAoGBioBFxcQVAkJCAUHB1kGCAgGWQcPBlkFBwECCQbpNQUFNQUQCWoJEAU1BQU1BRAJagkQnwgBAQMBAggDAggCAQQFCQQNCwQJBAEIAgEBBwIBBAUFAgYNCwgBDgcOfDQFDAlnCwMDNQQOB2oHDgQ1AwM1AwsGBAIDAAAAAAcAAAAAARoBGgAPABkAJABCAEsAVABhAAATIyIGHQEUFjsBMjY9ATQmFxQGByMuAT0BMzUjNTQ2FzM2Fh0BBzU0NjIWFRQGIiY2JiIGHQEUFjI2NDYyFhUUBiImNzQ2MhYUBiImFTQ2MhYUBiImNyY+ARYfARYOASImJ+qoFBsbFKgUGxsJEQyoDBHi4RAMqAwQuxAYEAUIBgEGCAUFCAUGCAUQGBBLBQgGBggFBQgGBggFHQIEBwcBHAIDBgQFAQEZGxSoFBsbFKgUG9cMEAEBEAyMEwkMEQEBEQwJeiUMEREMAwYGBwYGBCUEBQUIBQUEDBAQMgQFBQgGBiIEBgYIBQU5BAcDBANLBAcCAwMAD/////8A8gEsAAQBHAEfATIBOQE/AU4BVAFWAVsBYgFnAWoBdAF7AAATIisBNxc2NQc2PQEjLgEnLgEHMDcxNicOAQcGBwYzNzAHIw4BBxQ3MTYxByYHBgczBgcxBhUHBhUUFwcXIx4DFyYnFBYXBxYfASYfATcGFzMeATMHHgEXJxceARcxFhcjJicuAjcmNzE0JzU2NzUxFj8BNjczNjc+ATcVNjc2PwEGMzcHNhcxMjMHBjEWNzE2FycXFhcyNzE2FxUWFzInMR4BFyYxFRYjFhc1JicUIzEmBhcWNzE0MRcUHwEiJzEmFR4BFTEiFRQWNzMHBhcnFBUxFgc2NAcWBzEGFScGFTEWBzY1MTQ3Ig8BDgEnMTQnJicmNzY3MTY3PgIWFy4BDgEXNzI1FB4BNxU2PwEHBjY/ATY1MSY/AQcwOQEUFhcWNwYuAScWFzEWFyYnFhc3IiMyFiMyFzQiBxcUBwYHNCcxIjY3BwYUPwE2By4BMzI3Jw8CFxYXJxYfAScmJzcHBgc2JzAVMTAzMTIUDwE1NgcwMQc1NDeFBQICDkgDAgIBARsQDSMJBAMBBwgDBgYBAQYDBQUIBQMBAggPDQUDAgQFAQIEAQMBAwMFBQQEAgUDAgIDAQQDCwIBCAUBCAMDBQYGAwYFDQcHBQQUBxwyHAIBAQEHBwIDAwICAgEFBA4CBwwHDQgBAQ8HBQQEBQUCBQUGBgELCgoBAwQFAQgBBQ8aBQMBAQQCBgYDAgECAQECAgEBAQIBAwECAQECAwEDAQIBAgEFBAMEAQMBAQEFBxAmFAISBgkDAgIDBQQSFhIFCRoYDgEBARUfDgUDCQEDBQ8CAQECBFQGAwsSCRsYBgEFCAQEBQgLAwEBBgIDATICAQIDAQUCAgEEAgIEAQMZBQYEBwUaAScBAwQDBQICAQEDAYwBAgYH4AIBAQQCBgIDASsBkAgGBQgQChMmBwYCBAEBAQECAgQCAQECAQMGAQEBAwEPDAkFBwkEDBEIDQUIBgkEAQUJAQQCCQUCAwICAwYPAgUJAwcEAQUCBAUGBQEBAgECCC1AIQYMDwICFg4BAgUFBwQEBgQNAgMGBwMGAwECBAEBAQEBAgECAwQDBQEBAgEDBAUIHhEEBAULCgEUCQIBAwUCAQEEAgYFAgMBBAYBAwYCAQQJBwgDBAUGBgkDBwoIAwQHAgMEAgEBAgUHDQUHAQIOCw8XAQYLAwcMAQoHCAQLGQ4BAhEbCwcBAQIIAgMBDQMCAgIDAykBBAIEAQQGEAsBBQoBAwgKBbsBeQYEAwELBgcBAQQFBAQBAgEFFAECAZkBnwQDBwMXBAIFAgYDGAIPDQ5XAQEDAwEDFQgCBAQAAAYAAAAAARoBGgAOABcAGgAwADcASwAANzIWFRQHFzcnJiIPARc2By4BNTQ3JwcXMzcnFycHFzYzMhYUBiImNTQ3JwcXNzY0LwEHBhQfATcXHgEVFAYiJjU0Njc1BxcWMj8BJ5YICwEUGTIGDwYLFAMHBQUBFRg2Eg8PdTIZEwMCCAsLEAsBFBg/MgUFyjIFBTI/FgUFCxALBQU2MgYPBjE29AsIAgMTGTIFBQwVASMCCQUCAxQYNQ4PJzIaEwELEAsLCAIDExg/MgUQBTIyBRAFMj87AgkFCAsLCAUJAiQ1MgUFMjUAAAAFAAAAAAESASwAWwCwAM4BFQE7AAA3HgEfBB4BFA4BDwEOAQ8CDgEjIiYnJi8CIg8BIg8BDgImJyYvAS4DNjUnNDY3Nj8DJzQ+Ajc+ATUnNDU0PgIzMh4CHQEUHgEfAR4CFRQnMhYfARUPAQYPAQYUFxYfAR4BOwEyPwM0LwIuASciPQI0PgEyFhQGFBczMjY3Jy4CIyIGBxcnIyI9AS4CIg4BFQcfARYyNjUjIi8CNDYHMj4DJi8CLgIiDwEOAhUXFAYUFh8CFhc3Mj4CNzU/ATQ+ATc1ND8BNj8BLwEmLwEmNS8CJiIPAQYiJi8BJiIdAQcOARUXFBcHDgEdATIfARYfARYfARQGBx4DFzI+Az8CNj0BLwMmIyIPAQYiJi8BBwYHBhUHBg8CFBb5BQQBAgEDAwIDAwYEBwYJBQUGBAcECAsEAgEEHQYHDQEBBAIIDAsECQkZAwUCAQMBBwcDAgUHAQEHCgwGCAkBBQsSDQ4SCQMCBQQOBwwIfgIDAQEBBAECBgICAwEEAQYGAQYFDgsBAQIFAwcDAQIDBwQCAQIDAgEBAQMGBAgGAQEFBgIBAgQGAwMBAgEBAgIBAQEBAQMdBAYGAwECAg0KAgQFBgMKAwkEAQIFBBAIAwVDBAkKCAQCBQMFBAECAgEDBQICAgcBBgMDAgUFFAUJBwMFAwIIAgIBAQUGBAMDBwQEBgQBAgUDAggICkADBwgHCQUKAwEFAwQBAwYDAgoDBgQBBAICAQICAQMBAQlbAgcFBgQFBAIHBgUEAQQDBwQGBAMCBggCAQEBAQICBQIDAQIDBAIEAQMFCQgFDQcHAgECBAkCBwoUExIICxcOCwYGDBIOBwwTFwwNBQkJBhIKExYNCo8CAQQEAgUBAQUBBAECBAYDBQMICAQCAQIBAQQBAQIHAgMCBwYCAwEDAwcFBwQHCAkBAQYDBwQDBAMFBwUBAgEBAwUDBOQCAwYHBQISEAQGAwIKAwMEBAwEBwcDAQMBAQMOAgMEAwEIHwMHBQIBAQIDAQECFwYDAwoBAxIHBQMDDQIFBAYDAgcNBAcEBAICBwgTCQ4CBAMECAMEBgQEAgQGBAIVAgUJBgMFAgICAggFDQIEAQYBAwIKAwICBQURCAgFBQcKAAAABAAAAAABKgEaABAAHAAxAEIAADcHBiImNj8BJyY0NhYfARYGFyMiBhQWOwEyNjQmNwcOASsBIi4CPwE+ATsBMh4CBycmKwEOAQ8BBhY7ATI2PwE2gCwDCAUBAyUZAgYIAh8DAUtBBAYGBEEEBgZWIQMaEacKEw4FAiEDGhGnChMOBQIYCQ2nCw8CIQIRDacLDwIhAoUlAgYIAiAeAwgFAQMlAwgXBggFBQgGcakRFQkQFAqpERUJEBQKGgsBDAqpDRQMCqkNAAACAAAAAAEaARoAEAAXAAA3IzUjIgYdARQWOwEyNj0BIzcjFTM1NCaWE10ICwsH4gcLg3Fxgws44QsH4QgLCwdxg3BeBwsAAAAG//8AAAEcARoACAARAB4AJwA0AEUAADcUBiImNDYyFgcUBiImNDYyFhcuAScGJx4BFxYzJjU3FAYiJjQ2MhYXNjc2JicGBxYHBgcWJzAxIz4BFwYPAQ4BByYnJiP2FyEXFyEXphghFxchGDIWIgoREg0xIA4OC2EXIRgYIRcQEwYGCg8GEBEIAwkO0gESRCYJAgEYKQ4ICgYG8xEWFiEWFmURFhYhFhZ0BBoTCAQeKAcCDhIBEBYWIRYWAhcdGTIWEQkfIhAOC3wgIwMKDQgBFRMFAgEAAAAEAAAAAAEaARoADwAfADEAPgAAEyMiBh0BFBY7ATI2PQE0JhcUBisBIiY9ATQ2OwEyFhUPAQYiJjQ/AScmNDYyHwEWFAcXFAYrASImNDY7ATIW6qgUGxsUqBQbGwkRDKgMEBAMqAwRhjkCCAYDMjIDBggCOAMDdAYEXQQGBgRdBAYBGRsUqBQbGxSoFBvXDBAQDKgMEREMZDgDBQgDMjEDCAUDOAMHAzIEBQUIBgYAAAMAAAAAARsBBwAlACgAKwAAEy4BIgYPAScmIg8BBh4BNj8BMxceARcxFjczPgE/ATMXHgE+AS8BFyMnFyPOAQUGBQFDJQMMAy8BAwcHAg0yDQEDAgMDAQEDARlSGQEHCAMBVCJEWBEiAQADBAQDt1oGBnEDBwMDAyAgAgIBAQEBAwJFRQQDAgcEsF8EKQAAAAMAAAAAARoBGgA2AGAAigAAEzIWFx4BFRQGBx4BHQEUBg8BDgErASImJw4BKwEiJi8BLgE9ATQ2Ny4BNTQ2Nz4BMzIWFz4BMwciBh0BFAYrASIGFBY7ATIWFAYrAQ4BHQEUFjMyHwEeATsBMjY9ATQmIzMiBh0BFBY7ATI2PwE2MzI2PQE0JicjIiY0NjsBMjY0JisBIiY9ATQmI7gQGQITGgkJDQ4ZEwIEGRACDBMHBxMMAhAZBAITGQ4NCQkaEwIZEAoSBgYSCkQKDwUEBwwQDwwKBAYGBAsPFBMNBgMEAw4KAwsRDwpECg8RDAIKDwIEAwYNFBUPCwQGBgQKDA8QDAcEBQ8KARkVEAEbEwsTBwcaDwQUHQIFDxIKCAgKEg8FAh0UBA8aBwcTCxMbARAVCQcHCRMOCgQEBRAXEQYIBQEVEAQOEwUNCQsRDKwKDg4KrAwRCwkNBRMOBBAVAQUIBhEXEAUEBAoOAAADAAAAAAEHAPQADQAbACkAADc0NjsBMhYUBisBIiYnFzQ2OwEyFhQGKwEiJicXNDY7ATIWFAYrASImNSYFBM4EBgYEzgQFAQEFBM4EBgYEzgQFAQEFBM4EBgYEzgQG6gQGBggFBQRLBAYGCAUFBEsEBgYIBQUEAAACAAAAAAEaARoACQAjAAAlNTQmKwEVMzI2Bx4BOwEHBh4CMzI2PwE2NzUjIgYPAQYWFwEZEAwcHAwQ/gUQCUAIAgQMEQoGCgIIChB4DBQEHQICBp9eDBCWERQIBywJEw4IBwYYHBqrDgxeCBIHAAAAAwAAAAABGgEaAB8AOwBFAAATIyIHBg8BBhUUFjsBBwYVFBYzMjY/ATY7ATI2PQE0Jg8BMSImNTQ/ATYmKwEiJjU2NTc+ATsBFSMiBgc3FAYrATUzMhYX9JkUDAgFGgEWDywKAhsUBQkDJwIGLQ8WFlUnDBABDQIGBTgHDAEaBA0KcwcIDQRZCwgTEwgKAQEZDQkRUQUGEBYhBwYUGwUFTgUWEF4PFqVOEAwEBC0FBwsIAwNQEAuECAciCAuECwgAAgAAAAABGgEaAAkAIgAANxUUFjsBNSMiBjcuASsBNzYuAiMiBg8BBgcVMzI2PwE2JhMQDBwcDBD+BRAJQAgCBAwRCgYKAggKEHgMFAQdAgKNXgwQlhEUCAcsCRMOCAcGGBwaqw4MXggSAAAAAwAAAAABGgEaACAAKgBFAAA3Izc2NTQmIyIGDwEGKwEiBh0BFBY7ATI3Nj8BNjU0JiMHNTQ2OwEVIyImNwcOASsBNTMyNj8BMhYVFA8BBhY7ATIWFRYH9CwKAhsUBQkDJwIGLQ8WFg+ZFAwIBRoBFg/PDAcTEwcM4RoEDQpzBwgNBCcMEAENAgYEOQcLAQG7IgcGFBsFBU4FFhBeDxYNCRFRBQYQFoReCAuDC19QDwuDCAdOEAwEBC0FBwsIAwMABQAAAAABBwEbAB0APQBdAGkAcQAAEyYGHQEUBiImPQE0JgcOARQWFxUUFjI2PQE+ATQmBw4BHQEUBiImPQE0JicuATU0NjcVFBYyNj0BHgEVFAYXIzU3Ni8BLgErASIGDwEGHwEVIyIGHQEUFjI2PQEuASczFwcGHQEjNTQvARcUBiImPQEzagQIBgcGCAQUGBQRERcRERQYGgMDBgcGAwMOEQoIERcRCAoRiwkIAgEKAQUDJQMFAQkCAgkKBAUbJxwBBTUYBggBEwEHLhEXEDgBGQIGBSIDBgYDIgUGAgciJyEIcQwQEAxxCCEnImMBBAN4BAYGBHgDBAEFGQ8LEwcTCxERCxMHEwsPGR5JEQMEHAMDAwMcBAMRSQUESxQbGxRLBAVwEg8CAktLAgIPsgwQEAxBAAAABQAAAAABEAEsAB0AJAAuADoARwAAASMuASIGFSMmBhQWOwEXHgE7ATI2PwEzMjY0JgczJzIWFSM0NhcOASsBLgEvATMHFRQGIiY9AT4BMhYXFRQGIiY9ATQ2MhYVAQdLARUgFUsEBgYECg8BGxJRExsBDwoEBgYEAXEICyYLTQERC1ALEQEPqGcFCAYBBQgFOQYIBQUIBQEHDxYWEAEGCAW2EhkZErYFCAYBEwsICAvaCw8BDgu1L3EEBQUEcQQFBQRxBAUFBHEEBQUEAAAAAAEAAAAAAOMAzwAOAAA3Ig4BHwEeATY/ATYuASNdBwsCBTEFEhIFMQUCCwfOCQ4GRwgGBghHBg4JAAAAAAEAAAAAAM8A4wAOAAA3Fj4BPQE0LgEPAQ4BFhexBg4JCQ4GRwgGBghOBAIKB3IHCgIEMQUSEgUAAQAAAAAA4wDjAA4AADcGLgE9AT4CHwEeAQYHjgYOCgEJDgZHCAUFCE4EAgoHcgcKAgQxBRISBQABAAAAAADjANAADgAANyIuAT8BPgEWHwEWDgEjXQcLAgUxBRISBTEFAgsHXgkOBkcIBgYIRwYOCQAAAAACAAAAAAEQARAADAASAAA/ASMHJyMXBzM3FzMnBy8BMxcjrVsWTj9JX18WU0JJYx0KTSGYIalnWlqIbF9fjSIOa9UAAAQAAAAAAQcBGgA3ADsAPwBDAAA3IyczFjY9ATQmKwEiBh0BFBYzMQcjDgEdARQWOwEyNj0BLgErATczFyMOAR0BFBY7ATI2NzUuAQcjNTM3MxUjFyM1M/QXNQEICwsIOAgLCwg0FwgLCwc5CAsBCggKNAk1CggLCwc5CAoBAQqeODgTODiDODhxSwELCDkHCwsHOQgLSgEKCDgICwsHOQgLS0sBCgg4CAsLBzkIC0s4qTmoOAAAAAAEAAAAAAEHARoAOAA8AEAARAAANyMHMx4BHQEOASsBIiY9ATQ2MzEnIwYmPQE0NjsBMhYdAQ4BKwEXMzcjBiY9ATQ2OwEyFh0BDgEHJyMVMxczNSM3IxUz9Bc1AQgLAQoIOAgLCwg0FwgLCwc5CAsBCggKNAk1CggLCwc5CAsBCgiWODgTODiDODi8SwEKCDgICwsHOQgLSwELCDkHCwsHOQgLSksBCwg5BwsLBzkICgFMOag4qTkABAAAAAABBwEaADYAPwBIAFEAABMiBhUUFhcVIyIGHQEOARUeATI2NTQmJzU0NjsBMhYdAQ4BFRQWMjYnNiYnNTQmKwE1PgE1NCYHNDYyFhQGIiYHNDYyFhQGIiY3MhYUBiImPgGWExwVESgLDxAWARsnGxUQBANiAwQQFRsnHAEBFhAPCygRFRwvEBgQEBgQQhEXEREXEaALEREXEQEQARkbFBAaBBMPCx8EGhAUGxsUEBoEHwMEBAMfBBoQFBsbFBAaBB8LDxMEGhAUGy8MEREXERGdCxERFxAQKBEXEBAXEQAAAwAAAAABBwEaACoAQgBbAAAlHgEOASsBNTMnIwczFSMiLgE2PwEnLgE+ATsBFSMXMzcjNTMyHgEGDwEXJzcVFBYyNj0BFxYyNjQvASYiDwEGFBYyFwc1NCYiBh0BJyYiBhQfARYyPwE2NCYiBwEDAgICBQNUOyxXLDtUAwUCAgI5OQICAgUDVTwsVyw7VAMFAgICOTmVFQYIBRUDCAYDJgIIAyUDBQhAFQUIBhUDCAUDJQMIAiYDBggCWwEGBgMTJSUTAwYGATIxAgUGAxImJhIDBgUCMTKJFUcEBQUERxUDBQgDJQMDJQMIBasWRwQGBgRHFgIFCAMlAwMlAwgFAgAAAAAIAAAAAAEaARoAFwA7AD8AQwBnAGsAbwCIAAATJiIPAQYUFjI/ARUUFjI2PQEXFjI2NCc3MzIWHQEUBisBIiY9ASMVFAYnIyImPQE0NjsBMhYdATM1JjYHMzUjFzM1IxUzMhYdARQGKwEiJj0BIxUUBisBIiY9ATQ2OwEyFh0BMzUmNgczNSMXMzUjBzcxNjIWFA8BBiIvASY0NjIfATU0NjIWFTYDCAMcAwYIAgwGCAUMAwgFAnw5BwsLBzkICyUIBhwGCAgGHAYIJgELVRISXTk5OQcLCwc5CAslCAYcBggIBhwGCCYBC1USEl05OZYMAwgFAhwDCAMcAwYIAgwGCAUBFwICHQIIBgMMNAQGBgQ0DAMGCAINCwg4CAsLBxMEBgkBCAYcBQkJBQUTCAs5EyU4XgsIOAgLCwgTBQYICAYcBggIBgQSCAs4EyY4PQwCBQgDHAICHAMIBQIMNAQFBQQAAAMAAAAAAS0BGgAIAC0APQAANzIWFAYiJjQ2NzIWHQEUBiImPQE0JiIGHQEzMhYHFRYGKwEiJic1PgEXMzU0NgciBh0BFBY7AT4BPQE0JiOWCAsLEAsLZhchBQgGFh8WExAWAQEWEJYQFQEBFRBxIJEICwsIlggLCwiDCw8LCw8LliEXCQQGBgQJEBYWECUWEF4PFhYPXhAWASYXIXALCF4HDAELB14ICwAAAAAFAAAAAAEHAQkAEgAiAEUAYQBjAAATFh0BFAYvASMiJj0BNDY7ATc2DwEGKwEiBh0BFBY7ATIfATc+AR8BFhcWFAcGDwIGLgE2NzkDNzY3NjQnJi8BMS4BNyYOARYfARYXFhQHBg8BDgEeAT8BNjc2NCcmJwcxowYMBDcgDBERDCA3BAcqAgQkBAYGBCQEAiooAggDBAQDCwsDBAMEAgYFAQMCAwIICAIDAgMBIgMHBQEDBQYGEREGBgUDAQUHAwcIBhUVBgglAQYDBs4GBQQ2EQs4DBA2BCEpAgYEOAQFAymGAwEDBAQGES4RBgQDAgEBBQgCAgMEDiIOBAMCAggqAgEGCAIFBgkaPhsIBgUCCAYBAgcICR9KHwkILQAAAAAEAAAAAAEUARQAOABxAHoAmwAAJScmPwE2Ji8BJi8BLgEPAQYvASYGDwEGDwEOAR8BFg8BBhYfARYfAR4BPwE2HwEWNj8BNj8BPgEnDwIGDwEOASMnJg8BBiYvASYvAS4BNTc2LwEmNj8BNj8BPgEfARY/ATYWHwEWHwEeARUHBh8BFgYHFAYiJjQ2MhY3FAYPAQ4BFAYiJjU0Nj8BPgE1NCYiBhUUBiImNT4BMhYBDwwBAQ4CCAobBAEMBRMJGwMDHwoRAwsBBB8JBQQMAQEOAggKGwQBDAUTCBsEAx8KEQMLAQQfCQUEEgEcCwQKAQYDHQoKGwMGAgsECxwCAw0FBQwCAgMdCwQKAgYDHAoKGwMGAgsECxwCAw0FBQwBAVwIDAgIDAgYBwgHBAMFCAUGCAcEAwsQCwUIBgEVIBZ4GwMDHwoRAwsBBB8JBQQMAQEOAggKGwQBDAUTCBsEAx8KEQMLAQQfCQUEDAEBDgIJCRsEAQ0EEwkSAQoECxwCAw0FBQwBAQMdCwQKAQYDHQoKGwMGAgsECxwDAwIMBQUMAQEDHQsECgEGAx0KChsDBg8GCAgMCAhTCg4IBwUHCQYGBAoOCAcFBwUICwsIBAUFBBAWFgAGAAAAAAEaARoAEwAnAE8AXwBpAHEAADcxHgEHBhQXFgYHIyImJyY0Nz4BFzYWFzEWFAcOASsBLgE3NjQnJjYHNjIWFA8BFzc2MhYUDwEGKwEmLwEHBiImNj8BJwcGIiY0PwE2Fh8BNzIWHQEUBisBIiY9ATQ2MwcVFBY7ATI2PQEnIgYVMzQmI1wEBAEFBQEEBAIDBQEGBgEHdwMHAQYGAQUDAgQEAQUFAQQgAggGAxcIAgIIBgMKAgQBBQIMFAMIBgECFwgBAwgFAgoDCQIMShchIReWFyEhFyUVEJYQFrwQFeEWEKgBBwMRJBEEBwEEAxMqEwQDAQIEBBMqEwMEAgYEESQRAwcKAgUIAxYNAgIFCAIKAwEEEhQDBggCFwwBAwYIAgoDAQQSkCEXlhchIReWFyFLgxAVFRCDORYQEBYAAAACAAAAAAEUARQAOwBMAAATHwEWHwEeAQ8BBh8BFgYPAgYPAQ4BLwEmDwEGJi8CJi8BLgE/ATYvASY2PwI2PwE+AR8BFj8BNhYPAScmIgYUHwEWMj8BNjQmItUBCwEEGwoIAg4BAQwEBQkDHAQBCwMRCh8DAxsJEwUBCwEEGwoIAg4BAQwEBQkDHAQBCwMRCh8DAxsJExE8FgIHBQIcAwcDQQIFBwEFAxwEAQsDEQofAwMbCRMFAQsBBBsKCAIOAQEMBAUJAxwEAQsDEQofAwMbCRMFAQsBBBsKCAIOAQEMBAVNRBYCBQcCHAMDSwMHBAADAAAAAAEUARQAOwBzAIYAABMfARYfAR4BDwEGHwEWBg8CBg8BDgEvASYPAQYmLwImLwEuAT8BNi8BJjY/AjY/AT4BHwEWPwE2Fg8BBg8BDgEfARYPARQWHwEWHwEeAT8BNh8BMjY/ATY/AT4BLwEmPwE0Ji8BJi8BLgEPAQYvASYGFzc2Mh4BDwEOAS8BJjQ2Mh8BN9UBCwEEGwoIAg4BAQwEBQkDHAQBCwMRCh8DAxsJEwUBCwEEGwoIAg4BAQwEBQkDHAQBCwMRCh8DAxsJE2sKBAsdAwEBDAUFDQMCHAsECwIGAxsKCh0DBgEKBAsdAwEBDAUFDQMCHAsECwIGAxsKChwDBhw8AgcFAQJCAwYCHgIEBgMXPAEFAxwEAQsDEQofAwMbCRMFAQsBBBsKCAIOAQEMBAUJAxwEAQsDEQofAwMbCRMFAQsBBBsKCAIOAQEMBAUSHAsECwIGAxsKCh0DBgEKBAsdAwEBDAUFDQMCHAsECwIGAxsKCh0DBgEKBAsdAwEBDAUFDAIDgkQDBAYDTAIBAR4CBwUBF0QAAAMAAAAAASwBGgAMAB4ASgAAMzI+ATQuASIOARQeATc2NCYiDwEnJiIGFB8BFjI/AQcjNTE9ASMiJj0BNDY7AR4BHQEWFzU0JisBIgYdARQWOwEVIyIGFBY7ASYn2BcmFxcmLicXFydDAwYIAjIMAwgFAxIDCAM4iAs5CAoKCLwICwoIFg+8DxYWDyYcBAYGBEYHBRcmLicXFycuJhdqAwcGAzEMAgUIAxIDAzhEJQkKCwiDCAsBCghEBQdQDxYWD4MQFiUGCAUICgAAAAQAAAAAASwBGgAqADcASwBeAAA3FhcjIiY0NjsBNSMiJj0BNDY7ATIWHQEmJzUuASsBDgEdARQWOwEdATEVNxQOASIuATQ+ATIeAQc0Ji8BJiIGFB8BBwYUFjI/AT4BPwE2NCYiDwEOARQWHwEWMjY0J3wFB0YEBgYEHCYPFhYPvA8WCAoBCgi8CAoKCDm7FyYuJxcXJy4mF1QCARwDCAUCFhYCBQgDHAECFhYDBggDHAEBAQEcAwgGAyYLCAUIBiUWEIMPFhYPUAcFRAgLAQoIgwgLCgklLhcmFxcmLicXFycpAQQBHAMFCAMVFgMHBgMcAQQnFgIIBgMcAQQEAwIcAgUIAwAAAAMAAAAAASwBGgAqADcARAAANxYXIyImNDY7ATUjIiY9ATQ2OwEyFh0BJic1LgErAQ4BHQEUFjsBHQExFTcUDgEiLgE0PgEyHgEHNC4BIg4BFB4BMj4BfAUHRgQGBgQcJg8WFg+8DxYICgEKCLwICgoIObsXJi4nFxcnLiYXExEfIx4SEh4jHxEmCwgFCAYlFhCDDxYWD1AHBUQICwEKCIMICwoJJS4XJhcXJi4nFxcnFxIeEhIeIx8RER8AAwAAAAABLAEaACoANwBJAAA3FhcjIiY0NjsBNSMiJj0BNDY7ATIWHQEmJzUuASsBDgEdARQWOwEdATEVNxQOASIuATQ+ATIeAQc0JisBNTQmIgYdARQWOwEyNnwFB0YEBgYEHCYPFhYPvA8WCAoBCgi8CAoKCDm7FyYuJxcXJy4mFy8FBBMFCAYGBBwEBSYLCAUIBiUWEIMPFhYPUAcFRAgLAQoIgwgLCgklLhcmFxcmLicXFycXBAYcBAUFBCYEBQUAAAMAAP/8ASwBGgAqADgASwAANxYXIyImNDY7ATUjIiY9ATQ2OwEyFh0BJic1LgErAQ4BHQEUFjsBBhcxFTcUDgEuAj4BMzIeAgc0Ji8BJiIOAR0BFB4BMj8BPgF8BQdGBAYGBBwmDxYWD7wPFggKAQoIvAgKCgg5AQG7HDAyJAoTKxoQHxgNJgMCOAIFBAICBAUCOAIDJgoJBQgGJRYQgw8WFg9RBwZECAsBCgiDCAsJCiUuGSsTCiQyLx0NGB8RAwQCHwEDBAM+AgQDAR8BBQADAAAAAAEaARoAHwAjADMAABMiBh0BFBY7ARUjIgYUFjsBMjY0JisBNTMyNj0BNCYjBxUjNSc0NjsBHgEdAQ4BKwEiJjU4DxYWDyYcBAYGBKgEBgYEHCYPFhYPOEtLCgi8CAsBCgi8CAoBGRYPgxAWJQYIBQUIBiUWEIMPFs4lJakICwEKCIMICwsIAAQAAAAAASwBBwAMABgAUABqAAA3FAYrASImNDY7ATIWNyMiBhQWOwEyNjQmNxUUBisBFRQGKwEiJicmIgcOASsBIiY9ASMiJj0BNDY7ATU0NjsBNTQ2OwEyFh0BMzIWHQEzMhYnNCYrASIGHQEUFjsBMj4CMh4COwEyNjV6BgMmBAUFBCYDBmclBAYGAyYEBQVHBQQKHRUeDRcHAgwCBxcNHhUdCgQFBQQKHRUsBQQ4BAUsFR0KBAUlEw2iDRISDR4IDwgNDg0IDwgeDROfBAUFCAYGBgYIBQUIBgklBAYYFR4NCwQECw0eFRgGBCUEBQYVHgkEBQUECR4VBQYLDRMTDVYNEwgNBwcNCBMNAAAABAAAAAABBwEZAAUAEQAfACkAABMHFzc1NBUnJiIPAQ4BHwE2NTcWHQEUBzc+AT0BNiYnBzcXBwYiLwEmNLdPKCyMAggDDQMBBKEFDgQENAQEAQUE6BYfGwIIAw0DARJIHyE6B5pqAgMMAwkDlAUG4QkKzgkJGQIIBKUECAGBFRwVAgMMAwkAAAEAAAAAAQcBGgAqAAA3BicmLwEHBiIvASY0PwEnJjQ/ATYyHwE3PgEfAR4BHQEjNQcXNTMVFAYHzAYGAwNgKgIIAw0DAyQkAwMNAwgCKmIECAQyBAU9SUk9BQQnAwMBAlggAgMMAwkDISIDCQMMAwIgWQMBAhkBCARcQTg3LkkECAIAAAYAAAAAARoBGgAcADkAVQBhAGkAcQAAEzIWFxUzMhYUBisBFRQGIiY9ASMiJjQ2OwE1NDYHMhYdATMyFhQGKwEVFAYuAT0BIyImNDY7ATU0NhcyNjQmKwE1NCYiBh0BIyIGHgE7ARUUFjI2PQEnNjIWFA8BBiImND8BBwYUFjI/AzY0JiIPAf0EBQEJBAUFBAkGCAUKBAUFBAoFtwQFCQQGBgQJBQgGCQQFBQQJBqwEBgYECQUIBgkEBgEFBAkGCAU9Ch4VC4YLHRUKfnAGCw4FcA0JBQoOBQkBGQUECQYIBQoEBQUECgUIBgkEBSUGBAkFCAYJBAYBBQQJBggFCQQGqQUIBgkEBQUECQYIBQkEBgYECYsLFR4KhwoVHQtjcAUOCwZwDQkFDgoFCQAAAAAEAAAAAAEaARoAEQAfACgANAAAJScuASIGDwEGFRQWOwE+ATU0ByMiJjQ1NzYyHwEWFAYnFAYiJjQ2MhYnNTQ2MhYdARQGIiYBFmkEDA4MBGkDDwvSCw8a0gMEagIIAmoBBV4IDAgIDAgXBQgFBQgFTMAGBwcGwAYHChABDwoHDgQFAsAEBMACBQQhBggIDAgIJEIEBQUEQgQFBQAEAAAAAAD0ARoAKQAzAD0AVQAANyM0Jic1NCYrASIGHQEOAR0BFBYXFRQWOwEyNj0BPgE9ATMyNj0BNCYjJzQ2OwE2Fh0BIxcUBisBIiY9ATM3FAYHBisBIicuAT0BNDY3NjsBMhceARXqCQoJEAw4DBAJCgoJEAw4DBAJCgkEBgYEeQUEOAQGS0sGBDgEBUsSBwUEAksDBAUHBwUEA0sCBAUHvAoRBSEMEBAMIQURCksLEQUhDBAQDCEFEQoTBgQlBAVCBAUBBgQcsgQFBQQcJgYKAgEBAgoGSwUKAgEBAgoFAAACAAAAAADhAQcAHgAmAAATMx4BFAYrARUUDgEmPQEjFRQOASY9ASMiLgE0PgEzFTM1IyIGFBaDVQQFBQQKBQgFEwYIBRMSHhERHhITExMcHAEHAQUIBcUEBQEGBMXFBAUBBgRUEh4kHhFwXhwnGwAABQAAAAABLAEHABwAPABIAGIAegAAJTIWHQEUBisBIiY9ATQ2MhYdARQWOwEyNj0BNDYnHgEXFRQGByMiJj0BBiImND4BFzQmJyYHBi4BNjc2MxcmBw4BFBYzMj8BNTcyFhUXNjMyHgEGIyInFRYGKwEiJj0BNDYzFw4BBwYdARQXHgE7ATI2NzY3NSYnLgEnASMEBRAM9AwQBQgGBQT0BAUGxBIVAQQEAQQFEyEXFSMSCgwSBwMIBQIDDBYVDw8LDAwKDRIDQwMFAQwQExsBHBMQDQEFBAEEBQUEJAUMBAUFBAwFAwYLBAUBAQUECwZCBgQJDBAQDAkEBgYECQQFBQQJBAaAARQRSAMFAQUDAwsWIxYEBQsKAQEGAgIGCAIIOwQCAQwTDAwCG4AFA04LIS4hCwIDBgUEqgQEXQEIBwkLBAsJBwgIBwkLBAsJBwgBAAAAAAQAAAAAASwBGgAMAB8AOwBDAAA3Mh4BFA4BIi4BND4BFyYiDwEnJiIGFB8BFjI/ATE2NCcyFh0BIycmJzUjFRQWOwEWHwEVIyImPQE0NjMVIgYVMzQmI9gXJhcXJi4nFxcnQwMIAzEMAwgFAxIDCAM4AiUXIQcDBgLhFRAxAQQCOBchIRcQFeEWEKkXJy4mFxcmLicXMgMDMg0CBQgDEgMDOAMHpSEXOAIEAR6DEBUDBgMHIReWFyESFhAQFgAAAAYAAAAAAQcBGgAeACcAPABFAF8AhwAANzU0JiMiBw4BFBYyNjMyFxYdASYjIgYUFjMyNxYyNicyFxUGIiY0NhcyNjQmIyIHNTQmIgYdARQWMjY3FjcyFhQGIiY0NgcGIicmNDc2MhYyNjQnJg4CFjMyNzY0LgE3IyIGFBY7ATIWHQEUBisBNzY0JiIPAQYUHwEWMjY0LwEzMjY9ATQmXhQNCwcFBQUIBgkEAwcGCBIUFBIJCAIIBiEIBgQTCgpiEBYWEAoJBQgFBQcFAQkKCAsLEAsLOQQOBQYGBQ4HCAUDCx4TARYQDQoDBQiSEgQGBgQSBAYGBEcWAgUIAyUDAyUDCAUCFkcMERGyNA0PAwIFCAYFAQIGBgERFhEDAwUgAQ4EBggFJRgjGQYZBAUFBF4EBQMDBkENFA4OFA2+AwYHFwgGBgYIAgoDGSMbCQMHBgGyBQgGBQRxAwYWAggGAyYDBwMmAgUIAxURC3EMEAAAAwAAAAABBwEaABoAKgA7AAA3IicmJyYiBwYHBiMiBh0BFBYXOwE+AT0BNCYHFAYHLgE9ATY3NjcWFxYXBzc2MhYUDwEGIi8BJjQ2Mhf7HRQZEwMKAxMZFB0FBjY2BAQ2NwcMLy8vLxsUGhUVGhQbZzEDCAUDOAIIAxwDBgcD9AYIFAMDFAgGBwRENkoSEko2RAQHTzA/EBA/MDwBBggUFAgGAVoyAgUIAzgDAxwDCAUCAAAABAAAAAABBwEaAAgAKgBFAFUAADcUBiImND4BFicUFjI2NDYyFhUUBgcVBgcGFRQWMjY0NjczNjc2NTQmIgY3FRQGBysBLgE9AT4BMzI3Njc2MhcWFxYzMhYHJicmJwYHBgcVFBYXPgE1pAgMCAgMCC8GBwYIDAgEBQcCBQUIBQQFAQYDBRMcE5I3NgQENjcBBgUcFRkTAwoDExkUHQUHExsUGhUVGhQbLy8vL2IFCQkLCAEJRQMGBgkJCQYDBgUBBgQICQQFBQgGBQcECAgOExMuRDZKEhJKNkQEBwYIFAMDFAgGBwwBBggUFAgGATwwPxAQPzAAAAADAAAAAAEHARoAJAA/AE8AADcXNz4BHwEeAQ8BFx4BDwEOAS8BBw4BLwEuAT8BJy4BPwE+ARc3FRQGBysBLgE9AT4BMzI3Njc2MhcWFxYzMhYHJicmJwYHBgcVFBYXPgE1gRUWAgcCAgIBAhcWAgECAQMGAxcVAwcCAgIBAhcWAgECAQMGA4g3NgQENjcBBgUcFRkTAwoDExkUHQUHExsUGhUVGhQbLy8vL7kWFgIBAgEDBgMXFQMHAgICAQIXFgIBAgEDBgMXFgIHAgICAQIvRDZKEhJKNkQEBwYIFAMDFAgGBwwBBggUFAgGATwwPxAQPzAAAwAAAAABBwEaABwANABCAAA3MhYdATMyFhQGKwEVFAYiJj0BIyImNDY7ATU0NjcyHgEVFAYHFxYUBiIvAQ4BIyIuATQ+ARciDgEeAjI+ATQuASN6BAUcBAYGBBwFCAYcBAUFBB0FBBwvHAwMOwIFCAM6DiISHDAbGzAcFycXARYnLicWFicX4QUEHAYIBRwEBgYEHAUIBhwEBTgbMBwSIg46AwgFAjsMDBwvODAbEhcnLicWFicuJxYAAAADAAAAAAEHARoACwAjADEAADcyFhQGKwEiJjQ2MzcyHgEVFAYHFxYUBiIvAQ4BIyIuATQ+ARciDgEeAjI+ATQuASOfBAYGBEsEBQUEJhwvHAwMOwIFCAM6DiISHDAbGzAcFycXARYnLicWFicXvAYIBQUIBl0bMBwSIg46AwgFAjsMDBwvODAbEhcnLicWFicuJxYAAAAQAMYAAQAAAAAAAQAHAAAAAQAAAAAAAgAHAAcAAQAAAAAAAwAHAA4AAQAAAAAABAAHABUAAQAAAAAABQAMABwAAQAAAAAABgAHACgAAQAAAAAACgAkAC8AAQAAAAAACwATAFMAAwABBAkAAQAOAGYAAwABBAkAAgAOAHQAAwABBAkAAwAOAIIAAwABBAkABAAOAJAAAwABBAkABQAYAJ4AAwABBAkABgAOALYAAwABBAkACgBIAMQAAwABBAkACwAmAQxjb2RpY29uUmVndWxhcmNvZGljb25jb2RpY29uVmVyc2lvbiAxLjE1Y29kaWNvblRoZSBpY29uIGZvbnQgZm9yIFZpc3VhbCBTdHVkaW8gQ29kZWh0dHA6Ly9mb250ZWxsby5jb20AYwBvAGQAaQBjAG8AbgBSAGUAZwB1AGwAYQByAGMAbwBkAGkAYwBvAG4AYwBvAGQAaQBjAG8AbgBWAGUAcgBzAGkAbwBuACAAMQAuADEANQBjAG8AZABpAGMAbwBuAFQAaABlACAAaQBjAG8AbgAgAGYAbwBuAHQAIABmAG8AcgAgAFYAaQBzAHUAYQBsACAAUwB0AHUAZABpAG8AIABDAG8AZABlAGgAdAB0AHAAOgAvAC8AZgBvAG4AdABlAGwAbABvAC4AYwBvAG0AAgAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIEAQIBAwEEAQUBBgEHAQgBCQEKAQsBDAENAQ4BDwEQAREBEgETARQBFQEWARcBGAEZARoBGwEcAR0BHgEfASABIQEiASMBJAElASYBJwEoASkBKgErASwBLQEuAS8BMAExATIBMwE0ATUBNgE3ATgBOQE6ATsBPAE9AT4BPwFAAUEBQgFDAUQBRQFGAUcBSAFJAUoBSwFMAU0BTgFPAVABUQFSAVMBVAFVAVYBVwFYAVkBWgFbAVwBXQFeAV8BYAFhAWIBYwFkAWUBZgFnAWgBaQFqAWsBbAFtAW4BbwFwAXEBcgFzAXQBdQF2AXcBeAF5AXoBewF8AX0BfgF/AYABgQGCAYMBhAGFAYYBhwGIAYkBigGLAYwBjQGOAY8BkAGRAZIBkwGUAZUBlgGXAZgBmQGaAZsBnAGdAZ4BnwGgAaEBogGjAaQBpQGmAacBqAGpAaoBqwGsAa0BrgGvAbABsQGyAbMBtAG1AbYBtwG4AbkBugG7AbwBvQG+Ab8BwAHBAcIBwwHEAcUBxgHHAcgByQHKAcsBzAHNAc4BzwHQAdEB0gHTAdQB1QHWAdcB2AHZAdoB2wHcAd0B3gHfAeAB4QHiAeMB5AHlAeYB5wHoAekB6gHrAewB7QHuAe8B8AHxAfIB8wH0AfUB9gH3AfgB+QH6AfsB/AH9Af4B/wIAAgECAgIDAgQCBQIGAgcCCAIJAgoCCwIMAg0CDgIPAhACEQISAhMCFAIVAhYCFwIYAhkCGgIbAhwCHQIeAh8CIAIhAiICIwIkAiUCJgInAigCKQIqAisCLAItAi4CLwIwAjECMgIzAjQCNQI2AjcCOAI5AjoCOwI8Aj0CPgI/AkACQQJCAkMCRAJFAkYCRwJIAkkCSgJLAkwCTQJOAk8CUAJRAlICUwJUAlUCVgJXAlgCWQJaAlsCXAJdAl4CXwJgAmECYgJjAmQCZQJmAmcCaAJpAmoCawJsAm0CbgJvAnACcQJyAnMCdAJ1AnYCdwJ4AnkCegJ7AnwCfQJ+An8CgAKBAoICgwKEAoUChgKHAogCiQKKAosCjAKNAo4CjwKQApECkgKTApQClQKWApcCmAKZApoCmwKcAp0CngKfAqACoQKiAqMCpAKlAqYCpwKoAqkCqgKrAqwCrQKuAq8CsAKxArICswK0ArUCtgK3ArgCuQK6ArsCvAK9Ar4CvwLAAsECwgLDAsQCxQLGAscCyALJAsoCywLMAs0CzgLPAtAC0QLSAtMC1ALVAtYC1wLYAtkC2gLbAtwC3QLeAt8C4ALhAuIC4wLkAuUC5gLnAugC6QLqAusC7ALtAu4C7wLwAvEC8gLzAvQC9QL2AvcC+AL5AvoC+wL8Av0C/gL/AwADAQMCAwMDBAMFAAdhY2NvdW50FGFjdGl2YXRlLWJyZWFrcG9pbnRzA2FkZAVhZ2VudAdhcmNoaXZlCmFycm93LWJvdGgRYXJyb3ctY2lyY2xlLWRvd24RYXJyb3ctY2lyY2xlLWxlZnQSYXJyb3ctY2lyY2xlLXJpZ2h0D2Fycm93LWNpcmNsZS11cAphcnJvdy1kb3duCmFycm93LWxlZnQLYXJyb3ctcmlnaHQQYXJyb3ctc21hbGwtZG93bhBhcnJvdy1zbWFsbC1sZWZ0EWFycm93LXNtYWxsLXJpZ2h0DmFycm93LXNtYWxsLXVwCmFycm93LXN3YXAIYXJyb3ctdXAGYXR0YWNoDGF6dXJlLWRldm9wcwVhenVyZQtiZWFrZXItc3RvcAZiZWFrZXIIYmVsbC1kb3QOYmVsbC1zbGFzaC1kb3QKYmVsbC1zbGFzaARiZWxsBWJsYW5rBGJvbGQEYm9vawhib29rbWFyawticmFja2V0LWRvdA1icmFja2V0LWVycm9yCWJyaWVmY2FzZQlicm9hZGNhc3QHYnJvd3NlcgNidWcFYnVpbGQIY2FsZW5kYXINY2FsbC1pbmNvbWluZw1jYWxsLW91dGdvaW5nDmNhc2Utc2Vuc2l0aXZlEmNoYXQtc3BhcmtsZS1lcnJvchRjaGF0LXNwYXJrbGUtd2FybmluZwxjaGF0LXNwYXJrbGUJY2hlY2stYWxsBWNoZWNrCWNoZWNrbGlzdAxjaGV2cm9uLWRvd24MY2hldnJvbi1sZWZ0DWNoZXZyb24tcmlnaHQKY2hldnJvbi11cARjaGlwDGNocm9tZS1jbG9zZQ9jaHJvbWUtbWF4aW1pemUPY2hyb21lLW1pbmltaXplDmNocm9tZS1yZXN0b3JlDWNpcmNsZS1maWxsZWQTY2lyY2xlLWxhcmdlLWZpbGxlZAxjaXJjbGUtbGFyZ2UMY2lyY2xlLXNsYXNoE2NpcmNsZS1zbWFsbC1maWxsZWQMY2lyY2xlLXNtYWxsBmNpcmNsZQ1jaXJjdWl0LWJvYXJkCWNsZWFyLWFsbAZjbGlwcHkJY2xvc2UtYWxsBWNsb3NlDmNsb3VkLWRvd25sb2FkDGNsb3VkLXVwbG9hZAVjbG91ZAhjb2RlLW9zcwtjb2RlLXJldmlldwRjb2RlBmNvZmZlZQxjb2xsYXBzZS1hbGwKY29sbGVjdGlvbgpjb2xvci1tb2RlB2NvbWJpbmUYY29tbWVudC1kaXNjdXNzaW9uLXF1b3RlGmNvbW1lbnQtZGlzY3Vzc2lvbi1zcGFya2xlEmNvbW1lbnQtZGlzY3Vzc2lvbg1jb21tZW50LWRyYWZ0EmNvbW1lbnQtdW5yZXNvbHZlZAdjb21tZW50DmNvbXBhc3MtYWN0aXZlC2NvbXBhc3MtZG90B2NvbXBhc3MPY29waWxvdC1ibG9ja2VkDWNvcGlsb3QtZXJyb3ITY29waWxvdC1pbi1wcm9ncmVzcw1jb3BpbG90LWxhcmdlFWNvcGlsb3Qtbm90LWNvbm5lY3RlZA5jb3BpbG90LXNub296ZQ9jb3BpbG90LXN1Y2Nlc3MTY29waWxvdC11bmF2YWlsYWJsZRVjb3BpbG90LXdhcm5pbmctbGFyZ2UPY29waWxvdC13YXJuaW5nB2NvcGlsb3QEY29weQhjb3ZlcmFnZQtjcmVkaXQtY2FyZAZjdXJzb3IEZGFzaAlkYXNoYm9hcmQIZGF0YWJhc2UJZGVidWctYWxsD2RlYnVnLWFsdC1zbWFsbAlkZWJ1Zy1hbHQnZGVidWctYnJlYWtwb2ludC1jb25kaXRpb25hbC11bnZlcmlmaWVkHGRlYnVnLWJyZWFrcG9pbnQtY29uZGl0aW9uYWwgZGVidWctYnJlYWtwb2ludC1kYXRhLXVudmVyaWZpZWQVZGVidWctYnJlYWtwb2ludC1kYXRhJGRlYnVnLWJyZWFrcG9pbnQtZnVuY3Rpb24tdW52ZXJpZmllZBlkZWJ1Zy1icmVha3BvaW50LWZ1bmN0aW9uH2RlYnVnLWJyZWFrcG9pbnQtbG9nLXVudmVyaWZpZWQUZGVidWctYnJlYWtwb2ludC1sb2ccZGVidWctYnJlYWtwb2ludC11bnN1cHBvcnRlZA9kZWJ1Zy1jb25uZWN0ZWQNZGVidWctY29uc29sZRRkZWJ1Zy1jb250aW51ZS1zbWFsbA5kZWJ1Zy1jb3ZlcmFnZRBkZWJ1Zy1kaXNjb25uZWN0EmRlYnVnLWxpbmUtYnktbGluZQtkZWJ1Zy1wYXVzZQtkZWJ1Zy1yZXJ1bhNkZWJ1Zy1yZXN0YXJ0LWZyYW1lDWRlYnVnLXJlc3RhcnQWZGVidWctcmV2ZXJzZS1jb250aW51ZRdkZWJ1Zy1zdGFja2ZyYW1lLWFjdGl2ZRBkZWJ1Zy1zdGFja2ZyYW1lC2RlYnVnLXN0YXJ0D2RlYnVnLXN0ZXAtYmFjaw9kZWJ1Zy1zdGVwLWludG8OZGVidWctc3RlcC1vdXQPZGVidWctc3RlcC1vdmVyCmRlYnVnLXN0b3AFZGVidWcQZGVza3RvcC1kb3dubG9hZBNkZXZpY2UtY2FtZXJhLXZpZGVvDWRldmljZS1jYW1lcmENZGV2aWNlLW1vYmlsZQpkaWZmLWFkZGVkDGRpZmYtaWdub3JlZA1kaWZmLW1vZGlmaWVkDWRpZmYtbXVsdGlwbGUMZGlmZi1yZW1vdmVkDGRpZmYtcmVuYW1lZAtkaWZmLXNpbmdsZQRkaWZmB2Rpc2NhcmQJZWRpdC1jb2RlDGVkaXQtc2Vzc2lvbgxlZGl0LXNwYXJrbGUEZWRpdA1lZGl0b3ItbGF5b3V0CGVsbGlwc2lzDGVtcHR5LXdpbmRvdwZlcmFzZXILZXJyb3Itc21hbGwFZXJyb3IHZXhjbHVkZQpleHBhbmQtYWxsBmV4cG9ydBBleHRlbnNpb25zLWxhcmdlCmV4dGVuc2lvbnMKZXllLWNsb3NlZANleWUIZmVlZGJhY2sLZmlsZS1iaW5hcnkJZmlsZS1jb2RlCmZpbGUtbWVkaWEIZmlsZS1wZGYOZmlsZS1zdWJtb2R1bGUWZmlsZS1zeW1saW5rLWRpcmVjdG9yeRFmaWxlLXN5bWxpbmstZmlsZQlmaWxlLXRleHQIZmlsZS16aXAEZmlsZQVmaWxlcw1maWx0ZXItZmlsbGVkBmZpbHRlcgRmbGFnBWZsYW1lCWZvbGQtZG93bgdmb2xkLXVwBGZvbGQNZm9sZGVyLWFjdGl2ZQ5mb2xkZXItbGlicmFyeQ1mb2xkZXItb3BlbmVkBmZvbGRlcgRnYW1lBGdlYXIEZ2lmdAtnaXN0LXNlY3JldARnaXN0EmdpdC1icmFuY2gtY2hhbmdlcxRnaXQtYnJhbmNoLWNvbmZsaWN0cxlnaXQtYnJhbmNoLXN0YWdlZC1jaGFuZ2VzCmdpdC1icmFuY2gKZ2l0LWNvbW1pdAtnaXQtY29tcGFyZQlnaXQtZmV0Y2gIZ2l0LWxlbnMJZ2l0LW1lcmdlF2dpdC1wdWxsLXJlcXVlc3QtY2xvc2VkF2dpdC1wdWxsLXJlcXVlc3QtY3JlYXRlFWdpdC1wdWxsLXJlcXVlc3QtZG9uZRZnaXQtcHVsbC1yZXF1ZXN0LWRyYWZ0HmdpdC1wdWxsLXJlcXVlc3QtZ28tdG8tY2hhbmdlcxxnaXQtcHVsbC1yZXF1ZXN0LW5ldy1jaGFuZ2VzEGdpdC1wdWxsLXJlcXVlc3QPZ2l0LXN0YXNoLWFwcGx5DWdpdC1zdGFzaC1wb3AJZ2l0LXN0YXNoDWdpdGh1Yi1hY3Rpb24KZ2l0aHViLWFsdA9naXRodWItaW52ZXJ0ZWQOZ2l0aHViLXByb2plY3QGZ2l0aHViBWdsb2JlFWdvLXRvLWVkaXRpbmctc2Vzc2lvbgpnby10by1maWxlDGdvLXRvLXNlYXJjaAdncmFiYmVyCmdyYXBoLWxlZnQKZ3JhcGgtbGluZQ1ncmFwaC1zY2F0dGVyBWdyYXBoB2dyaXBwZXIRZ3JvdXAtYnktcmVmLXR5cGUMaGVhcnQtZmlsbGVkBWhlYXJ0B2hpc3RvcnkEaG9tZQ9ob3Jpem9udGFsLXJ1bGUFaHVib3QFaW5ib3gGaW5kZW50CmluZGV4LXplcm8EaW5mbwZpbnNlcnQHaW5zcGVjdAtpc3N1ZS1kcmFmdA5pc3N1ZS1yZW9wZW5lZAZpc3N1ZXMGaXRhbGljBmplcnNleQRqc29uDmtlYmFiLXZlcnRpY2FsA2tleRJrZXlib2FyZC10YWItYWJvdmUSa2V5Ym9hcmQtdGFiLWJlbG93DGtleWJvYXJkLXRhYgNsYXcNbGF5ZXJzLWFjdGl2ZQpsYXllcnMtZG90BmxheWVycxdsYXlvdXQtYWN0aXZpdHliYXItbGVmdBhsYXlvdXQtYWN0aXZpdHliYXItcmlnaHQPbGF5b3V0LWNlbnRlcmVkDmxheW91dC1tZW51YmFyE2xheW91dC1wYW5lbC1jZW50ZXIRbGF5b3V0LXBhbmVsLWRvY2sUbGF5b3V0LXBhbmVsLWp1c3RpZnkRbGF5b3V0LXBhbmVsLWxlZnQQbGF5b3V0LXBhbmVsLW9mZhJsYXlvdXQtcGFuZWwtcmlnaHQMbGF5b3V0LXBhbmVsGGxheW91dC1zaWRlYmFyLWxlZnQtZG9jaxdsYXlvdXQtc2lkZWJhci1sZWZ0LW9mZhNsYXlvdXQtc2lkZWJhci1sZWZ0GWxheW91dC1zaWRlYmFyLXJpZ2h0LWRvY2sYbGF5b3V0LXNpZGViYXItcmlnaHQtb2ZmFGxheW91dC1zaWRlYmFyLXJpZ2h0EGxheW91dC1zdGF0dXNiYXIGbGF5b3V0B2xpYnJhcnkRbGlnaHRidWxiLWF1dG9maXgPbGlnaHRidWxiLWVtcHR5EWxpZ2h0YnVsYi1zcGFya2xlCWxpZ2h0YnVsYg1saW5rLWV4dGVybmFsBGxpbmsJbGlzdC1mbGF0DGxpc3Qtb3JkZXJlZA5saXN0LXNlbGVjdGlvbglsaXN0LXRyZWUObGlzdC11bm9yZGVyZWQKbGl2ZS1zaGFyZQdsb2FkaW5nCGxvY2F0aW9uCmxvY2stc21hbGwEbG9jawZtYWduZXQJbWFpbC1yZWFkBG1haWwKbWFwLWZpbGxlZBNtYXAtdmVydGljYWwtZmlsbGVkDG1hcC12ZXJ0aWNhbANtYXAIbWFya2Rvd24DbWNwCW1lZ2FwaG9uZQdtZW50aW9uBG1lbnUKbWVyZ2UtaW50bwVtZXJnZQptaWMtZmlsbGVkA21pYwltaWxlc3RvbmUGbWlycm9yDG1vcnRhci1ib2FyZARtb3ZlEG11bHRpcGxlLXdpbmRvd3MFbXVzaWMEbXV0ZQ5uZXctY29sbGVjdGlvbghuZXctZmlsZQpuZXctZm9sZGVyB25ld2xpbmUKbm8tbmV3bGluZQRub3RlEW5vdGVib29rLXRlbXBsYXRlCG5vdGVib29rCG9jdG9mYWNlD29wZW4taW4tcHJvZHVjdAxvcGVuLXByZXZpZXcMb3JnYW5pemF0aW9uBm91dHB1dAdwYWNrYWdlCHBhaW50Y2FuC3Bhc3MtZmlsbGVkBHBhc3MKcGVyY2VudGFnZQpwZXJzb24tYWRkBnBlcnNvbgVwaWFubwlwaWUtY2hhcnQDcGluDHBpbm5lZC1kaXJ0eQZwaW5uZWQLcGxheS1jaXJjbGUEcGx1Zw1wcmVzZXJ2ZS1jYXNlB3ByZXZpZXcQcHJpbWl0aXZlLXNxdWFyZQdwcm9qZWN0BXB1bHNlBnB5dGhvbghxdWVzdGlvbgVxdW90ZQZxdW90ZXMLcmFkaW8tdG93ZXIJcmVhY3Rpb25zC3JlY29yZC1rZXlzDHJlY29yZC1zbWFsbAZyZWNvcmQEcmVkbwpyZWZlcmVuY2VzB3JlZnJlc2gFcmVnZXgPcmVtb3RlLWV4cGxvcmVyBnJlbW90ZQZyZW1vdmUGcmVuYW1lC3JlcGxhY2UtYWxsB3JlcGxhY2UFcmVwbHkKcmVwby1jbG9uZQpyZXBvLWZldGNoD3JlcG8tZm9yY2UtcHVzaAtyZXBvLWZvcmtlZAtyZXBvLXBpbm5lZAlyZXBvLXB1bGwJcmVwby1wdXNoDXJlcG8tc2VsZWN0ZWQEcmVwbwZyZXBvcnQFcm9ib3QGcm9ja2V0EnJvb3QtZm9sZGVyLW9wZW5lZAtyb290LWZvbGRlcgNyc3MEcnVieQlydW4tYWJvdmUQcnVuLWFsbC1jb3ZlcmFnZQdydW4tYWxsCXJ1bi1iZWxvdwxydW4tY292ZXJhZ2UKcnVuLWVycm9ycw1ydW4td2l0aC1kZXBzCHNhdmUtYWxsB3NhdmUtYXMEc2F2ZQtzY3JlZW4tZnVsbA1zY3JlZW4tbm9ybWFsDHNlYXJjaC1mdXp6eQxzZWFyY2gtbGFyZ2UOc2VhcmNoLXNwYXJrbGULc2VhcmNoLXN0b3AGc2VhcmNoFHNlbmQtdG8tcmVtb3RlLWFnZW50BHNlbmQSc2VydmVyLWVudmlyb25tZW50DnNlcnZlci1wcm9jZXNzBnNlcnZlcg1zZXR0aW5ncy1nZWFyCHNldHRpbmdzBXNoYXJlBnNoaWVsZAdzaWduLWluCHNpZ24tb3V0BHNraXAGc21pbGV5BXNuYWtlD3NvcnQtcHJlY2VkZW5jZQ5zcGFya2xlLWZpbGxlZAdzcGFya2xlEHNwbGl0LWhvcml6b250YWwOc3BsaXQtdmVydGljYWwIc3F1aXJyZWwKc3Rhci1lbXB0eQlzdGFyLWZ1bGwJc3Rhci1oYWxmC3N0b3AtY2lyY2xlDXN0cmlrZXRocm91Z2gNc3Vycm91bmQtd2l0aAxzeW1ib2wtYXJyYXkOc3ltYm9sLWJvb2xlYW4Mc3ltYm9sLWNsYXNzDHN5bWJvbC1jb2xvcg9zeW1ib2wtY29uc3RhbnQSc3ltYm9sLWVudW0tbWVtYmVyC3N5bWJvbC1lbnVtDHN5bWJvbC1ldmVudAxzeW1ib2wtZmllbGQQc3ltYm9sLWludGVyZmFjZQpzeW1ib2wta2V5DnN5bWJvbC1rZXl3b3JkE3N5bWJvbC1tZXRob2QtYXJyb3cNc3ltYm9sLW1ldGhvZAtzeW1ib2wtbWlzYw5zeW1ib2wtbnVtZXJpYw9zeW1ib2wtb3BlcmF0b3IQc3ltYm9sLXBhcmFtZXRlcg9zeW1ib2wtcHJvcGVydHkMc3ltYm9sLXJ1bGVyDnN5bWJvbC1zbmlwcGV0EHN5bWJvbC1zdHJ1Y3R1cmUPc3ltYm9sLXZhcmlhYmxlDHN5bmMtaWdub3JlZARzeW5jBXRhYmxlA3RhZwZ0YXJnZXQIdGFza2xpc3QJdGVsZXNjb3BlDXRlcm1pbmFsLWJhc2gMdGVybWluYWwtY21kD3Rlcm1pbmFsLWRlYmlhbhF0ZXJtaW5hbC1naXQtYmFzaA50ZXJtaW5hbC1saW51eBN0ZXJtaW5hbC1wb3dlcnNoZWxsDXRlcm1pbmFsLXRtdXgPdGVybWluYWwtdWJ1bnR1CHRlcm1pbmFsCXRleHQtc2l6ZQh0aGlua2luZwp0aHJlZS1iYXJzEXRodW1ic2Rvd24tZmlsbGVkCnRodW1ic2Rvd24PdGh1bWJzdXAtZmlsbGVkCHRodW1ic3VwBXRvb2xzBXRyYXNoDXRyaWFuZ2xlLWRvd24NdHJpYW5nbGUtbGVmdA50cmlhbmdsZS1yaWdodAt0cmlhbmdsZS11cAd0d2l0dGVyEnR5cGUtaGllcmFyY2h5LXN1YhR0eXBlLWhpZXJhcmNoeS1zdXBlcg50eXBlLWhpZXJhcmNoeQZ1bmZvbGQTdW5ncm91cC1ieS1yZWYtdHlwZQZ1bmxvY2sGdW5tdXRlCnVudmVyaWZpZWQOdmFyaWFibGUtZ3JvdXAPdmVyaWZpZWQtZmlsbGVkCHZlcmlmaWVkCXZtLWFjdGl2ZQp2bS1jb25uZWN0CnZtLW91dGxpbmUKdm0tcGVuZGluZwp2bS1ydW5uaW5nAnZtAnZyD3ZzY29kZS1pbnNpZGVycwZ2c2NvZGUEd2FuZAd3YXJuaW5nBXdhdGNoCndoaXRlc3BhY2UKd2hvbGUtd29yZA13aW5kb3ctYWN0aXZlCXdvcmQtd3JhcBF3b3Jrc3BhY2UtdHJ1c3RlZBF3b3Jrc3BhY2UtdW5rbm93bhN3b3Jrc3BhY2UtdW50cnVzdGVkB3pvb20taW4Iem9vbS1vdXQAAA==) format(\"truetype\")}.codicon[class*=codicon-]{font: 16px/1 codicon;display:inline-block;text-decoration:none;text-rendering:auto;text-align:center;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;user-select:none;-webkit-user-select:none}.codicon-wrench-subaction{opacity:.5}@keyframes codicon-spin{to{transform:rotate(360deg)}}.codicon-sync.codicon-modifier-spin,.codicon-loading.codicon-modifier-spin,.codicon-gear.codicon-modifier-spin,.codicon-notebook-state-executing.codicon-modifier-spin{animation:codicon-spin 1.5s steps(30) infinite}.codicon-modifier-disabled{opacity:.4}.codicon-loading,.codicon-tree-item-loading:before{animation-duration:1s!important;animation-timing-function:cubic-bezier(.53,.21,.29,.67)!important}.monaco-editor .codicon.codicon-symbol-array,.monaco-workbench .codicon.codicon-symbol-array{color:var(--vscode-symbolIcon-arrayForeground)}.monaco-editor .codicon.codicon-symbol-boolean,.monaco-workbench .codicon.codicon-symbol-boolean{color:var(--vscode-symbolIcon-booleanForeground)}.monaco-editor .codicon.codicon-symbol-class,.monaco-workbench .codicon.codicon-symbol-class{color:var(--vscode-symbolIcon-classForeground)}.monaco-editor .codicon.codicon-symbol-method,.monaco-workbench .codicon.codicon-symbol-method{color:var(--vscode-symbolIcon-methodForeground)}.monaco-editor .codicon.codicon-symbol-color,.monaco-workbench .codicon.codicon-symbol-color{color:var(--vscode-symbolIcon-colorForeground)}.monaco-editor .codicon.codicon-symbol-constant,.monaco-workbench .codicon.codicon-symbol-constant{color:var(--vscode-symbolIcon-constantForeground)}.monaco-editor .codicon.codicon-symbol-constructor,.monaco-workbench .codicon.codicon-symbol-constructor{color:var(--vscode-symbolIcon-constructorForeground)}.monaco-editor .codicon.codicon-symbol-value,.monaco-workbench .codicon.codicon-symbol-value,.monaco-editor .codicon.codicon-symbol-enum,.monaco-workbench .codicon.codicon-symbol-enum{color:var(--vscode-symbolIcon-enumeratorForeground)}.monaco-editor .codicon.codicon-symbol-enum-member,.monaco-workbench .codicon.codicon-symbol-enum-member{color:var(--vscode-symbolIcon-enumeratorMemberForeground)}.monaco-editor .codicon.codicon-symbol-event,.monaco-workbench .codicon.codicon-symbol-event{color:var(--vscode-symbolIcon-eventForeground)}.monaco-editor .codicon.codicon-symbol-field,.monaco-workbench .codicon.codicon-symbol-field{color:var(--vscode-symbolIcon-fieldForeground)}.monaco-editor .codicon.codicon-symbol-file,.monaco-workbench .codicon.codicon-symbol-file{color:var(--vscode-symbolIcon-fileForeground)}.monaco-editor .codicon.codicon-symbol-folder,.monaco-workbench .codicon.codicon-symbol-folder{color:var(--vscode-symbolIcon-folderForeground)}.monaco-editor .codicon.codicon-symbol-function,.monaco-workbench .codicon.codicon-symbol-function{color:var(--vscode-symbolIcon-functionForeground)}.monaco-editor .codicon.codicon-symbol-interface,.monaco-workbench .codicon.codicon-symbol-interface{color:var(--vscode-symbolIcon-interfaceForeground)}.monaco-editor .codicon.codicon-symbol-key,.monaco-workbench .codicon.codicon-symbol-key{color:var(--vscode-symbolIcon-keyForeground)}.monaco-editor .codicon.codicon-symbol-keyword,.monaco-workbench .codicon.codicon-symbol-keyword{color:var(--vscode-symbolIcon-keywordForeground)}.monaco-editor .codicon.codicon-symbol-module,.monaco-workbench .codicon.codicon-symbol-module{color:var(--vscode-symbolIcon-moduleForeground)}.monaco-editor .codicon.codicon-symbol-namespace,.monaco-workbench .codicon.codicon-symbol-namespace{color:var(--vscode-symbolIcon-namespaceForeground)}.monaco-editor .codicon.codicon-symbol-null,.monaco-workbench .codicon.codicon-symbol-null{color:var(--vscode-symbolIcon-nullForeground)}.monaco-editor .codicon.codicon-symbol-number,.monaco-workbench .codicon.codicon-symbol-number{color:var(--vscode-symbolIcon-numberForeground)}.monaco-editor .codicon.codicon-symbol-object,.monaco-workbench .codicon.codicon-symbol-object{color:var(--vscode-symbolIcon-objectForeground)}.monaco-editor .codicon.codicon-symbol-operator,.monaco-workbench .codicon.codicon-symbol-operator{color:var(--vscode-symbolIcon-operatorForeground)}.monaco-editor .codicon.codicon-symbol-package,.monaco-workbench .codicon.codicon-symbol-package{color:var(--vscode-symbolIcon-packageForeground)}.monaco-editor .codicon.codicon-symbol-property,.monaco-workbench .codicon.codicon-symbol-property{color:var(--vscode-symbolIcon-propertyForeground)}.monaco-editor .codicon.codicon-symbol-reference,.monaco-workbench .codicon.codicon-symbol-reference{color:var(--vscode-symbolIcon-referenceForeground)}.monaco-editor .codicon.codicon-symbol-snippet,.monaco-workbench .codicon.codicon-symbol-snippet{color:var(--vscode-symbolIcon-snippetForeground)}.monaco-editor .codicon.codicon-symbol-string,.monaco-workbench .codicon.codicon-symbol-string{color:var(--vscode-symbolIcon-stringForeground)}.monaco-editor .codicon.codicon-symbol-struct,.monaco-workbench .codicon.codicon-symbol-struct{color:var(--vscode-symbolIcon-structForeground)}.monaco-editor .codicon.codicon-symbol-text,.monaco-workbench .codicon.codicon-symbol-text{color:var(--vscode-symbolIcon-textForeground)}.monaco-editor .codicon.codicon-symbol-type-parameter,.monaco-workbench .codicon.codicon-symbol-type-parameter{color:var(--vscode-symbolIcon-typeParameterForeground)}.monaco-editor .codicon.codicon-symbol-unit,.monaco-workbench .codicon.codicon-symbol-unit{color:var(--vscode-symbolIcon-unitForeground)}.monaco-editor .codicon.codicon-symbol-variable,.monaco-workbench .codicon.codicon-symbol-variable{color:var(--vscode-symbolIcon-variableForeground)}.monaco-editor .lightBulbWidget{display:flex;align-items:center;justify-content:center}.monaco-editor .lightBulbWidget:hover{cursor:pointer}.monaco-editor .lightBulbWidget.codicon-light-bulb,.monaco-editor .lightBulbWidget.codicon-lightbulb-sparkle{color:var(--vscode-editorLightBulb-foreground)}.monaco-editor .lightBulbWidget.codicon-lightbulb-autofix,.monaco-editor .lightBulbWidget.codicon-lightbulb-sparkle-autofix{color:var(--vscode-editorLightBulbAutoFix-foreground, var(--vscode-editorLightBulb-foreground))}.monaco-editor .lightBulbWidget.codicon-sparkle-filled{color:var(--vscode-editorLightBulbAi-foreground, var(--vscode-icon-foreground))}.monaco-editor .lightBulbWidget:before{position:relative;z-index:2}.monaco-editor .lightBulbWidget:after{position:absolute;top:0;left:0;content:\"\";display:block;width:100%;height:100%;opacity:.3;z-index:1}.monaco-editor .glyph-margin-widgets .cgmr[class*=codicon-gutter-lightbulb]{display:block;cursor:pointer}.monaco-editor .glyph-margin-widgets .cgmr.codicon-gutter-lightbulb,.monaco-editor .glyph-margin-widgets .cgmr.codicon-gutter-lightbulb-sparkle{color:var(--vscode-editorLightBulb-foreground)}.monaco-editor .glyph-margin-widgets .cgmr.codicon-gutter-lightbulb-auto-fix,.monaco-editor .glyph-margin-widgets .cgmr.codicon-gutter-lightbulb-aifix-auto-fix{color:var(--vscode-editorLightBulbAutoFix-foreground, var(--vscode-editorLightBulb-foreground))}.monaco-editor .glyph-margin-widgets .cgmr.codicon-gutter-lightbulb-sparkle-filled{color:var(--vscode-editorLightBulbAi-foreground, var(--vscode-icon-foreground))}.monaco-editor .codelens-decoration{overflow:hidden;display:inline-flex!important;align-items:center;text-overflow:ellipsis;white-space:nowrap;color:var(--vscode-editorCodeLens-foreground);line-height:var(--vscode-editorCodeLens-lineHeight);font-size:var(--vscode-editorCodeLens-fontSize);padding-right:calc(var(--vscode-editorCodeLens-fontSize)*.5);font-feature-settings:var(--vscode-editorCodeLens-fontFeatureSettings);font-family:var(--vscode-editorCodeLens-fontFamily),var(--vscode-editorCodeLens-fontFamilyDefault)}.monaco-editor .codelens-decoration>span,.monaco-editor .codelens-decoration>a{user-select:none;-webkit-user-select:none;white-space:nowrap;vertical-align:sub;display:inline-flex;align-items:center}.monaco-editor .codelens-decoration>a{text-decoration:none}.monaco-editor .codelens-decoration>a:hover{cursor:pointer;color:var(--vscode-editorLink-activeForeground)!important}.monaco-editor .codelens-decoration>a:hover .codicon{color:var(--vscode-editorLink-activeForeground)!important}.monaco-editor .codelens-decoration .codicon[class*=codicon-]{vertical-align:middle;color:currentColor!important;color:var(--vscode-editorCodeLens-foreground);line-height:var(--vscode-editorCodeLens-lineHeight);font-size:var(--vscode-editorCodeLens-fontSize)}.monaco-editor .codelens-decoration>a:hover .codicon:before{cursor:pointer}@keyframes fadein{0%{opacity:0}to{opacity:1}}.monaco-editor .codelens-decoration.fadein{animation:fadein .1s linear}.monaco-editor .inlineSuggestionsHints{padding:4px;.warningMessage p{margin:0}}.monaco-editor .inlineSuggestionsHints.withBorder{z-index:39;color:var(--vscode-editorHoverWidget-foreground);background-color:var(--vscode-editorHoverWidget-background);border:1px solid var(--vscode-editorHoverWidget-border)}.monaco-editor .inlineSuggestionsHints a,.monaco-editor .inlineSuggestionsHints a:hover{color:var(--vscode-foreground)!important}.monaco-editor .inlineSuggestionsHints .keybinding{display:flex;margin-left:4px;opacity:.6}.monaco-editor .inlineSuggestionsHints .keybinding .monaco-keybinding-key{font-size:8px;padding:2px 3px}.monaco-editor .inlineSuggestionsHints .availableSuggestionCount a{display:flex;min-width:19px;justify-content:center}.monaco-editor .inlineSuggestionStatusBarItemLabel{margin-right:2px}.monaco-hover{cursor:default;position:absolute;overflow:hidden;user-select:text;-webkit-user-select:text;box-sizing:border-box;line-height:1.5em;white-space:var(--vscode-hover-whiteSpace, normal)}.monaco-hover.fade-in{animation:fadein .1s linear}.monaco-hover.hidden{display:none}.monaco-hover a:hover:not(.disabled){cursor:pointer}.monaco-hover .hover-contents:not(.html-hover-contents){padding:4px 8px}.monaco-hover .markdown-hover>.hover-contents:not(.code-hover-contents){max-width:var(--vscode-hover-maxWidth, 500px);word-wrap:break-word}.monaco-hover .markdown-hover>.hover-contents:not(.code-hover-contents) hr{min-width:100%}.monaco-hover p,.monaco-hover .code,.monaco-hover ul,.monaco-hover h1,.monaco-hover h2,.monaco-hover h3,.monaco-hover h4,.monaco-hover h5,.monaco-hover h6{margin:8px 0}.monaco-hover h1,.monaco-hover h2,.monaco-hover h3,.monaco-hover h4,.monaco-hover h5,.monaco-hover h6{line-height:1.1}.monaco-hover code{font-family:var(--monaco-monospace-font)}.monaco-hover hr{box-sizing:border-box;border-left:0px;border-right:0px;margin:4px -8px -4px;height:1px}.monaco-hover p:first-child,.monaco-hover .code:first-child,.monaco-hover ul:first-child{margin-top:0}.monaco-hover p:last-child,.monaco-hover .code:last-child,.monaco-hover ul:last-child{margin-bottom:0}.monaco-hover ul,.monaco-hover ol{padding-left:20px}.monaco-hover li>p{margin-bottom:0}.monaco-hover li>ul{margin-top:0}.monaco-hover code{border-radius:3px;padding:0 .4em}.monaco-hover .monaco-tokenized-source{white-space:var(--vscode-hover-sourceWhiteSpace, pre-wrap)}.monaco-hover .hover-row.status-bar{font-size:12px;line-height:22px}.monaco-hover .hover-row.status-bar .info{font-style:italic;padding:0 8px}.monaco-hover .hover-row.status-bar .actions{display:flex;padding:0 8px;width:100%}.monaco-hover .hover-row.status-bar .actions .action-container{margin-right:16px;cursor:pointer;overflow:hidden;text-wrap:nowrap;text-overflow:ellipsis}.monaco-hover .hover-row.status-bar .actions .action-container .action .icon{padding-right:4px;vertical-align:middle}.monaco-hover .hover-row.status-bar .actions .action-container a{color:var(--vscode-textLink-foreground);text-decoration:var(--text-link-decoration)}.monaco-hover .hover-row.status-bar .actions .action-container a .icon.codicon{color:var(--vscode-textLink-foreground)}.monaco-hover .markdown-hover .hover-contents .codicon{color:inherit;font-size:inherit;vertical-align:middle}.monaco-hover .hover-contents a.code-link:hover,.monaco-hover .hover-contents a.code-link{color:inherit}.monaco-hover .hover-contents a.code-link:before{content:\"(\"}.monaco-hover .hover-contents a.code-link:after{content:\")\"}.monaco-hover .hover-contents a.code-link>span{text-decoration:underline;border-bottom:1px solid transparent;text-underline-position:under;color:var(--vscode-textLink-foreground)}.monaco-hover .hover-contents a.code-link>span:hover{color:var(--vscode-textLink-activeForeground)}.monaco-hover .markdown-hover .hover-contents:not(.code-hover-contents):not(.html-hover-contents) p:last-child [style*=background-color]{margin-bottom:4px;display:inline-block}.monaco-hover .markdown-hover .hover-contents:not(.code-hover-contents):not(.html-hover-contents) span.codicon{margin-bottom:2px}.monaco-hover-content .action-container a{-webkit-user-select:none;user-select:none}.monaco-hover-content .action-container.disabled{pointer-events:none;opacity:.4;cursor:default}.monaco-hover .action-container,.monaco-hover .action,.monaco-hover button,.monaco-hover .monaco-button,.monaco-hover .monaco-text-button,.monaco-hover [role=button]{-webkit-user-select:none;user-select:none}.monaco-custom-toggle{margin-left:2px;float:left;cursor:pointer;overflow:hidden;width:20px;height:20px;border-radius:3px;border:1px solid transparent;padding:1px;box-sizing:border-box;user-select:none;-webkit-user-select:none}.monaco-custom-toggle:hover{background-color:var(--vscode-inputOption-hoverBackground)}.hc-black .monaco-custom-toggle:hover,.hc-light .monaco-custom-toggle:hover{border:1px dashed var(--vscode-focusBorder)}.hc-black .monaco-custom-toggle,.hc-light .monaco-custom-toggle,.hc-black .monaco-custom-toggle:hover,.hc-light .monaco-custom-toggle:hover{background:none}.monaco-custom-toggle.monaco-checkbox{height:18px;width:18px;border:1px solid transparent;border-radius:3px;margin-right:9px;margin-left:0;padding:0;opacity:1;background-size:16px!important}.monaco-action-bar .checkbox-action-item{display:flex;align-items:center;border-radius:2px;padding-right:2px}.monaco-action-bar .checkbox-action-item:hover{background-color:var(--vscode-toolbar-hoverBackground)}.monaco-action-bar .checkbox-action-item>.monaco-custom-toggle.monaco-checkbox{margin-right:4px}.monaco-action-bar .checkbox-action-item>.checkbox-label{font-size:12px}.monaco-editor .find-widget{position:absolute;z-index:35;height:33px;overflow:hidden;line-height:19px;transition:transform .2s linear;padding:0 4px;box-sizing:border-box;transform:translateY(calc(-100% - 10px));box-shadow:0 0 8px 2px var(--vscode-widget-shadow);color:var(--vscode-editorWidget-foreground);border-left:1px solid var(--vscode-widget-border);border-right:1px solid var(--vscode-widget-border);border-bottom:1px solid var(--vscode-widget-border);border-bottom-left-radius:4px;border-bottom-right-radius:4px;background-color:var(--vscode-editorWidget-background)}.monaco-reduce-motion .monaco-editor .find-widget{transition:transform 0ms linear}.monaco-editor .find-widget textarea{margin:0}.monaco-editor .find-widget.hiddenEditor{display:none}.monaco-editor .find-widget.replaceToggled>.replace-part{display:flex}.monaco-editor .find-widget.visible{transform:translateY(0)}.monaco-editor .find-widget .monaco-inputbox.synthetic-focus{outline:1px solid -webkit-focus-ring-color;outline-offset:-1px;outline-color:var(--vscode-focusBorder)}.monaco-editor .find-widget .monaco-inputbox .input{background-color:transparent;min-height:0}.monaco-editor .find-widget .monaco-findInput .input{font-size:13px}.monaco-editor .find-widget>.find-part,.monaco-editor .find-widget>.replace-part{margin:3px 25px 0 17px;font-size:12px;display:flex}.monaco-editor .find-widget>.find-part .monaco-inputbox,.monaco-editor .find-widget>.replace-part .monaco-inputbox{min-height:25px}.monaco-editor .find-widget>.replace-part .monaco-inputbox>.ibwrapper>.mirror{padding-right:22px}.monaco-editor .find-widget>.find-part .monaco-inputbox>.ibwrapper>.input,.monaco-editor .find-widget>.find-part .monaco-inputbox>.ibwrapper>.mirror,.monaco-editor .find-widget>.replace-part .monaco-inputbox>.ibwrapper>.input,.monaco-editor .find-widget>.replace-part .monaco-inputbox>.ibwrapper>.mirror{padding-top:2px;padding-bottom:2px}.monaco-editor .find-widget>.find-part .find-actions{height:25px;display:flex;align-items:center}.monaco-editor .find-widget>.replace-part .replace-actions{height:25px;display:flex;align-items:center}.monaco-editor .find-widget .monaco-findInput{vertical-align:middle;display:flex;flex:1}.monaco-editor .find-widget .monaco-findInput .monaco-scrollable-element{width:100%}.monaco-editor .find-widget .monaco-findInput .monaco-scrollable-element .scrollbar.vertical{opacity:0}.monaco-editor .find-widget .matchesCount{display:flex;flex:initial;margin:0 0 0 3px;padding:2px 0 0 2px;height:25px;vertical-align:middle;box-sizing:border-box;text-align:center;line-height:23px}.monaco-editor .find-widget .button{width:16px;height:16px;padding:3px;border-radius:5px;flex:initial;margin-left:3px;background-position:center center;background-repeat:no-repeat;cursor:pointer;display:flex;align-items:center;justify-content:center}.monaco-editor .find-widget .codicon-find-selection{width:22px;height:22px;padding:3px;border-radius:5px}.monaco-editor .find-widget .button.left{margin-left:0;margin-right:3px}.monaco-editor .find-widget .button.wide{width:auto;padding:1px 6px;top:-1px}.monaco-editor .find-widget .button.toggle{position:absolute;top:0;left:3px;width:18px;height:100%;border-radius:0;box-sizing:border-box}.monaco-editor .find-widget .button.toggle.disabled{display:none}.monaco-editor .find-widget .disabled{color:var(--vscode-disabledForeground);cursor:default}.monaco-editor .find-widget>.replace-part{display:none}.monaco-editor .find-widget>.replace-part>.monaco-findInput{position:relative;display:flex;vertical-align:middle;flex:auto;flex-grow:0;flex-shrink:0}.monaco-editor .find-widget>.replace-part>.monaco-findInput>.controls{position:absolute;top:3px;right:2px}.monaco-editor .find-widget.reduced-find-widget .matchesCount{display:none}.monaco-editor .find-widget.narrow-find-widget{max-width:257px!important}.monaco-editor .find-widget.collapsed-find-widget{max-width:170px!important}.monaco-editor .find-widget.collapsed-find-widget .button.previous,.monaco-editor .find-widget.collapsed-find-widget .button.next,.monaco-editor .find-widget.collapsed-find-widget .button.replace,.monaco-editor .find-widget.collapsed-find-widget .button.replace-all,.monaco-editor .find-widget.collapsed-find-widget>.find-part .monaco-findInput .controls{display:none}.monaco-editor .find-widget.no-results .matchesCount{color:var(--vscode-errorForeground)}.monaco-editor .findMatch{animation-duration:0;animation-name:inherit!important;background-color:var(--vscode-editor-findMatchHighlightBackground)}.monaco-editor .currentFindMatch{background-color:var(--vscode-editor-findMatchBackground);border:2px solid var(--vscode-editor-findMatchBorder);padding:1px;box-sizing:border-box}.monaco-editor .findScope{background-color:var(--vscode-editor-findRangeHighlightBackground)}.monaco-editor .find-widget .monaco-sash{left:0!important;background-color:var(--vscode-editorWidget-resizeBorder, var(--vscode-editorWidget-border))}.monaco-editor.hc-black .find-widget .button:before{position:relative;top:1px;left:2px}.monaco-editor .find-widget .button:not(.disabled):hover,.monaco-editor .find-widget .codicon-find-selection:hover{background-color:var(--vscode-toolbar-hoverBackground)!important}.monaco-editor.findMatch{background-color:var(--vscode-editor-findMatchHighlightBackground)}.monaco-editor.currentFindMatch{background-color:var(--vscode-editor-findMatchBackground)}.monaco-editor.findScope{background-color:var(--vscode-editor-findRangeHighlightBackground)}.monaco-editor.findMatch{background-color:var(--vscode-editorWidget-background)}.monaco-editor .find-widget>.button.codicon-widget-close{position:absolute;top:5px;right:4px}.monaco-inputbox{position:relative;display:block;padding:0;box-sizing:border-box;border-radius:2px;font-size:inherit}.monaco-inputbox>.ibwrapper>.input,.monaco-inputbox>.ibwrapper>.mirror{padding:4px 6px}.monaco-inputbox>.ibwrapper{position:relative;width:100%}.monaco-inputbox>.ibwrapper>.input{display:inline-block;box-sizing:border-box;width:100%;height:100%;line-height:inherit;border:none;font-family:inherit;font-size:inherit;resize:none;color:inherit}.monaco-inputbox>.ibwrapper>input{text-overflow:ellipsis}.monaco-inputbox>.ibwrapper>textarea.input{display:block;scrollbar-width:none;outline:none}.monaco-inputbox>.ibwrapper>textarea.input::-webkit-scrollbar{display:none}.monaco-inputbox>.ibwrapper>textarea.input.empty{white-space:nowrap}.monaco-inputbox>.ibwrapper>.mirror{position:absolute;display:inline-block;width:100%;top:0;left:0;box-sizing:border-box;white-space:pre-wrap;visibility:hidden;word-wrap:break-word}.monaco-inputbox-container{text-align:right}.monaco-inputbox-container .monaco-inputbox-message{display:inline-block;overflow:hidden;text-align:left;width:100%;box-sizing:border-box;padding:.4em;font-size:12px;line-height:17px;margin-top:-1px;word-wrap:break-word}.monaco-inputbox .monaco-action-bar{position:absolute;right:2px;top:4px}.monaco-inputbox .monaco-action-bar .action-item{margin-left:2px}.monaco-inputbox .monaco-action-bar .action-item .codicon{background-repeat:no-repeat;width:16px;height:16px}.monaco-findInput{position:relative}.monaco-findInput .monaco-inputbox{font-size:13px;width:100%}.monaco-findInput>.controls{position:absolute;top:3px;right:2px}.vs .monaco-findInput.disabled{background-color:#e1e1e1}.vs-dark .monaco-findInput.disabled{background-color:#333}.monaco-findInput.highlight-0 .controls,.hc-light .monaco-findInput.highlight-0 .controls{animation:monaco-findInput-highlight-0 .1s linear 0s}.monaco-findInput.highlight-1 .controls,.hc-light .monaco-findInput.highlight-1 .controls{animation:monaco-findInput-highlight-1 .1s linear 0s}.hc-black .monaco-findInput.highlight-0 .controls,.vs-dark .monaco-findInput.highlight-0 .controls{animation:monaco-findInput-highlight-dark-0 .1s linear 0s}.hc-black .monaco-findInput.highlight-1 .controls,.vs-dark .monaco-findInput.highlight-1 .controls{animation:monaco-findInput-highlight-dark-1 .1s linear 0s}@keyframes monaco-findInput-highlight-0{0%{background:#fdff00cc}to{background:transparent}}@keyframes monaco-findInput-highlight-1{0%{background:#fdff00cc}99%{background:transparent}}@keyframes monaco-findInput-highlight-dark-0{0%{background:#ffffff70}to{background:transparent}}@keyframes monaco-findInput-highlight-dark-1{0%{background:#ffffff70}99%{background:transparent}}.colorpicker-widget{height:190px;user-select:none;-webkit-user-select:none}.colorpicker-color-decoration,.hc-light .colorpicker-color-decoration{border:solid .1em #000;box-sizing:border-box;margin:.1em .2em 0;width:.8em;height:.8em;line-height:.8em;display:inline-block;cursor:pointer}.hc-black .colorpicker-color-decoration,.vs-dark .colorpicker-color-decoration{border:solid .1em #eee}.colorpicker-header{display:flex;height:24px;position:relative;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAACp8Z5+AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuMTZEaa/1AAAAHUlEQVQYV2PYvXu3JAi7uLiAMaYAjAGTQBPYLQkAa/0Zef3qRswAAAAASUVORK5CYII=);background-size:9px 9px;image-rendering:pixelated}.colorpicker-header .picked-color{width:240px;display:flex;align-items:center;justify-content:center;line-height:24px;cursor:pointer;color:#fff;flex:1;white-space:nowrap;overflow:hidden}.colorpicker-header .picked-color .picked-color-presentation{white-space:nowrap;margin-left:5px;margin-right:5px}.colorpicker-header .picked-color .codicon{color:inherit;font-size:14px}.colorpicker-header .picked-color.light{color:#000}.colorpicker-header .original-color{width:74px;z-index:inherit;cursor:pointer}.standalone-colorpicker{color:var(--vscode-editorHoverWidget-foreground);background-color:var(--vscode-editorHoverWidget-background);border:1px solid var(--vscode-editorHoverWidget-border)}.colorpicker-header.standalone-colorpicker{border-bottom:none}.colorpicker-header .close-button{cursor:pointer;background-color:var(--vscode-editorHoverWidget-background);border-left:1px solid var(--vscode-editorHoverWidget-border)}.colorpicker-header .close-button-inner-div{width:100%;height:100%;text-align:center}.colorpicker-header .close-button-inner-div:hover{background-color:var(--vscode-toolbar-hoverBackground)}.colorpicker-header .close-icon{padding:3px}.colorpicker-body{display:flex;padding:8px;position:relative}.colorpicker-body .saturation-wrap{overflow:hidden;height:150px;position:relative;min-width:220px;flex:1}.colorpicker-body .saturation-box{height:150px;position:absolute}.colorpicker-body .saturation-selection{width:9px;height:9px;margin:-5px 0 0 -5px;border:1px solid rgb(255,255,255);border-radius:100%;box-shadow:0 0 2px #000c;position:absolute}.colorpicker-body .strip{width:25px;height:150px}.colorpicker-body .standalone-strip{width:25px;height:122px}.colorpicker-body .hue-strip{position:relative;margin-left:8px;cursor:grab;background:linear-gradient(to bottom,red,#ff0 17%,#0f0 33%,#0ff,#00f 67%,#f0f 83%,red)}.colorpicker-body .opacity-strip{position:relative;margin-left:8px;cursor:grab;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAACp8Z5+AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuMTZEaa/1AAAAHUlEQVQYV2PYvXu3JAi7uLiAMaYAjAGTQBPYLQkAa/0Zef3qRswAAAAASUVORK5CYII=);background-size:9px 9px;image-rendering:pixelated}.colorpicker-body .strip.grabbing{cursor:grabbing}.colorpicker-body .slider{position:absolute;top:0;left:-2px;width:calc(100% + 4px);height:4px;box-sizing:border-box;border:1px solid rgba(255,255,255,.71);box-shadow:0 0 1px #000000d9}.colorpicker-body .strip .overlay{height:150px;pointer-events:none}.colorpicker-body .standalone-strip .standalone-overlay{height:122px;pointer-events:none}.standalone-colorpicker-body{display:block;border:1px solid transparent;border-bottom:1px solid var(--vscode-editorHoverWidget-border);overflow:hidden}.colorpicker-body .insert-button{position:absolute;height:20px;width:58px;padding:0;right:8px;bottom:8px;background:var(--vscode-button-background);color:var(--vscode-button-foreground);border-radius:2px;border:none;cursor:pointer}.colorpicker-body .insert-button:hover{background:var(--vscode-button-hoverBackground)}.monaco-editor .peekview-widget .head{box-sizing:border-box;display:flex;justify-content:space-between;flex-wrap:nowrap}.monaco-editor .peekview-widget .head .peekview-title{display:flex;align-items:baseline;font-size:13px;margin-left:20px;min-width:0;text-overflow:ellipsis;overflow:hidden}.monaco-editor .peekview-widget .head .peekview-title.clickable{cursor:pointer}.monaco-editor .peekview-widget .head .peekview-title .dirname:not(:empty){font-size:.9em;margin-left:.5em}.monaco-editor .peekview-widget .head .peekview-title .meta{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.monaco-editor .peekview-widget .head .peekview-title .dirname,.monaco-editor .peekview-widget .head .peekview-title .filename{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.monaco-editor .peekview-widget .head .peekview-title .meta:not(:empty):before{content:\"-\";padding:0 .3em}.monaco-editor .peekview-widget .head .peekview-actions{flex:1;text-align:right;padding-right:2px}.monaco-editor .peekview-widget .head .peekview-actions>.monaco-action-bar{display:inline-block}.monaco-editor .peekview-widget .head .peekview-actions>.monaco-action-bar,.monaco-editor .peekview-widget .head .peekview-actions>.monaco-action-bar>.actions-container{height:100%}.monaco-editor .peekview-widget>.body{border-top:1px solid;position:relative}.monaco-editor .peekview-widget .head .peekview-title .codicon{margin-right:4px;align-self:center}.monaco-editor .peekview-widget .monaco-list .monaco-list-row.focused .codicon{color:inherit!important}.monaco-editor .zone-widget{position:absolute;z-index:10}.monaco-editor .zone-widget .zone-widget-container{border-top-style:solid;border-bottom-style:solid;border-top-width:0;border-bottom-width:0;position:relative}.monaco-split-view2{position:relative;width:100%;height:100%}.monaco-split-view2>.sash-container{position:absolute;width:100%;height:100%;pointer-events:none}.monaco-split-view2>.sash-container>.monaco-sash{pointer-events:initial}.monaco-split-view2>.monaco-scrollable-element{width:100%;height:100%}.monaco-split-view2>.monaco-scrollable-element>.split-view-container{width:100%;height:100%;white-space:nowrap;position:relative}.monaco-split-view2>.monaco-scrollable-element>.split-view-container>.split-view-view{white-space:initial;position:absolute}.monaco-split-view2>.monaco-scrollable-element>.split-view-container>.split-view-view:not(.visible){display:none}.monaco-split-view2.vertical>.monaco-scrollable-element>.split-view-container>.split-view-view{width:100%}.monaco-split-view2.horizontal>.monaco-scrollable-element>.split-view-container>.split-view-view{height:100%}.monaco-split-view2.separator-border>.monaco-scrollable-element>.split-view-container>.split-view-view:not(:first-child):before{content:\" \";position:absolute;top:0;left:0;z-index:5;pointer-events:none;background-color:var(--separator-border)}.monaco-split-view2.separator-border.horizontal>.monaco-scrollable-element>.split-view-container>.split-view-view:not(:first-child):before{height:100%;width:1px}.monaco-split-view2.separator-border.vertical>.monaco-scrollable-element>.split-view-container>.split-view-view:not(:first-child):before{height:1px;width:100%}.monaco-table{display:flex;flex-direction:column;position:relative;height:100%;width:100%;white-space:nowrap;overflow:hidden}.monaco-table>.monaco-split-view2{border-bottom:1px solid transparent}.monaco-table>.monaco-list{flex:1}.monaco-table-tr{display:flex;height:100%}.monaco-table-th{width:100%;height:100%;font-weight:700;overflow:hidden;text-overflow:ellipsis}.monaco-table-th,.monaco-table-td{box-sizing:border-box;flex-shrink:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.monaco-table>.monaco-split-view2 .monaco-sash.vertical:before{content:\"\";position:absolute;left:calc(var(--vscode-sash-size) / 2);width:0;border-left:1px solid transparent}.monaco-enable-motion .monaco-table>.monaco-split-view2,.monaco-enable-motion .monaco-table>.monaco-split-view2 .monaco-sash.vertical:before{transition:border-color .2s ease-out}.monaco-tl-row{display:flex;height:100%;align-items:center;position:relative}.monaco-tl-row.disabled{cursor:default}.monaco-tl-indent{height:100%;position:absolute;top:0;left:16px;pointer-events:none}.hide-arrows .monaco-tl-indent{left:12px}.monaco-tl-indent>.indent-guide{display:inline-block;box-sizing:border-box;height:100%;border-left:1px solid transparent;opacity:0}.monaco-enable-motion .monaco-tl-indent>.indent-guide{transition:opacity .1s linear}.monaco-tl-twistie,.monaco-tl-contents{height:100%}.monaco-tl-twistie{font-size:10px;text-align:right;padding-right:6px;flex-shrink:0;width:16px;display:flex!important;align-items:center;justify-content:center;transform:translate(3px)}.monaco-tl-contents{flex:1;overflow:hidden}.monaco-tl-twistie:before{border-radius:20px}.monaco-tl-twistie.collapsed:before{transform:rotate(-90deg)}.monaco-tl-twistie.codicon-tree-item-loading:before{animation:codicon-spin 1.25s steps(30) infinite}.monaco-tree-type-filter{position:absolute;top:0;right:0;display:flex;padding:3px;max-width:200px;z-index:100;margin:0 10px 0 6px;border:1px solid var(--vscode-widget-border);border-bottom-left-radius:4px;border-bottom-right-radius:4px}.monaco-enable-motion .monaco-tree-type-filter{transition:top .3s}.monaco-tree-type-filter.disabled{top:-40px!important}.monaco-tree-type-filter-input{flex:1}.monaco-tree-type-filter-input .monaco-inputbox{height:23px}.monaco-tree-type-filter-input .monaco-inputbox>.ibwrapper>.input,.monaco-tree-type-filter-input .monaco-inputbox>.ibwrapper>.mirror{padding:2px 4px}.monaco-tree-type-filter-input .monaco-findInput>.controls{top:2px}.monaco-tree-type-filter-actionbar{margin-left:4px}.monaco-tree-type-filter-actionbar .monaco-action-bar .action-label{padding:2px}.monaco-list .monaco-scrollable-element .monaco-tree-sticky-container{position:absolute;top:0;left:0;width:100%;height:0;z-index:13;background-color:var(--vscode-sideBar-background)}.monaco-list .monaco-scrollable-element .monaco-tree-sticky-container .monaco-tree-sticky-row.monaco-list-row{position:absolute;width:100%;opacity:1!important;overflow:hidden;background-color:var(--vscode-sideBar-background)}.monaco-list .monaco-scrollable-element .monaco-tree-sticky-container .monaco-tree-sticky-row:hover{background-color:var(--vscode-list-hoverBackground)!important;cursor:pointer}.monaco-list .monaco-scrollable-element .monaco-tree-sticky-container.empty,.monaco-list .monaco-scrollable-element .monaco-tree-sticky-container.empty .monaco-tree-sticky-container-shadow{display:none}.monaco-list .monaco-scrollable-element .monaco-tree-sticky-container .monaco-tree-sticky-container-shadow{position:absolute;bottom:-3px;left:0;height:0px;width:100%}.monaco-list .monaco-scrollable-element .monaco-tree-sticky-container[tabindex=\"0\"]:focus{outline:none}.monaco-editor .zone-widget .zone-widget-container.reference-zone-widget{border-top-width:1px;border-bottom-width:1px}.monaco-editor .reference-zone-widget .inline{display:inline-block;vertical-align:top}.monaco-editor .reference-zone-widget .messages{height:100%;width:100%;text-align:center;padding:3em 0}.monaco-editor .reference-zone-widget .ref-tree{line-height:23px;background-color:var(--vscode-peekViewResult-background);color:var(--vscode-peekViewResult-lineForeground)}.monaco-editor .reference-zone-widget .ref-tree .reference{text-overflow:ellipsis;overflow:hidden}.monaco-editor .reference-zone-widget .ref-tree .reference-file{display:inline-flex;width:100%;height:100%;color:var(--vscode-peekViewResult-fileForeground)}.monaco-editor .reference-zone-widget .ref-tree .monaco-list:focus .selected .reference-file{color:inherit!important}.monaco-editor .reference-zone-widget .ref-tree .monaco-list:focus .monaco-list-rows>.monaco-list-row.selected:not(.highlighted){background-color:var(--vscode-peekViewResult-selectionBackground);color:var(--vscode-peekViewResult-selectionForeground)!important}.monaco-editor .reference-zone-widget .ref-tree .reference-file .count{margin-right:12px;margin-left:auto}.monaco-editor .reference-zone-widget .ref-tree .referenceMatch .highlight{color:var(--vscode-peekViewResult-fileForeground)!important;background-color:var(--vscode-peekViewResult-matchHighlightBackground)!important}.monaco-editor .reference-zone-widget .preview .reference-decoration{background-color:var(--vscode-peekViewEditor-matchHighlightBackground);border:2px solid var(--vscode-peekViewEditor-matchHighlightBorder);box-sizing:border-box}.monaco-editor .reference-zone-widget .preview .monaco-editor .monaco-editor-background,.monaco-editor .reference-zone-widget .preview .monaco-editor .inputarea.ime-input{background-color:var(--vscode-peekViewEditor-background)}.monaco-editor .reference-zone-widget .preview .monaco-editor .margin{background-color:var(--vscode-peekViewEditorGutter-background)}.monaco-editor.hc-black .reference-zone-widget .ref-tree .reference-file,.monaco-editor.hc-light .reference-zone-widget .ref-tree .reference-file{font-weight:700}.monaco-editor.hc-black .reference-zone-widget .ref-tree .referenceMatch .highlight,.monaco-editor.hc-light .reference-zone-widget .ref-tree .referenceMatch .highlight{border:1px dotted var(--vscode-contrastActiveBorder, transparent);box-sizing:border-box}.monaco-count-badge{padding:3px 5px;border-radius:11px;font-size:11px;min-width:18px;min-height:18px;line-height:11px;font-weight:400;text-align:center;display:inline-block;box-sizing:border-box}.monaco-count-badge.long{padding:2px 3px;border-radius:2px;min-height:auto;line-height:normal}.monaco-icon-label{display:flex;overflow:hidden;text-overflow:ellipsis}.monaco-icon-label:before{background-size:16px;background-position:left center;background-repeat:no-repeat;padding-right:6px;width:16px;height:22px;line-height:inherit!important;display:inline-block;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;vertical-align:top;flex-shrink:0}.monaco-icon-label-iconpath{width:16px;height:22px;margin-right:6px;display:flex}.monaco-icon-label-container.disabled{color:var(--vscode-disabledForeground)}.monaco-icon-label>.monaco-icon-label-container{min-width:0;overflow:hidden;text-overflow:ellipsis;flex:1}.monaco-icon-label>.monaco-icon-label-container>.monaco-icon-name-container>.label-name{color:inherit;white-space:pre}.monaco-icon-label>.monaco-icon-label-container>.monaco-icon-name-container>.label-name>.label-separator{margin:0 2px;opacity:.5}.monaco-icon-label>.monaco-icon-label-container>.monaco-icon-suffix-container>.label-suffix{opacity:.7;white-space:pre}.monaco-icon-label>.monaco-icon-label-container>.monaco-icon-description-container>.label-description{opacity:.7;margin-left:.5em;font-size:.9em;white-space:pre}.monaco-icon-label.nowrap>.monaco-icon-label-container>.monaco-icon-description-container>.label-description{white-space:nowrap}.vs .monaco-icon-label>.monaco-icon-label-container>.monaco-icon-description-container>.label-description{opacity:.95}.monaco-icon-label.bold>.monaco-icon-label-container>.monaco-icon-name-container>.label-name,.monaco-icon-label.bold>.monaco-icon-label-container>.monaco-icon-description-container>.label-description{font-weight:700}.monaco-icon-label.italic>.monaco-icon-label-container>.monaco-icon-name-container>.label-name,.monaco-icon-label.italic>.monaco-icon-label-container>.monaco-icon-description-container>.label-description{font-style:italic}.monaco-icon-label.deprecated{text-decoration:line-through;opacity:.66}.monaco-icon-label.strikethrough>.monaco-icon-label-container>.monaco-icon-name-container>.label-name,.monaco-icon-label.strikethrough>.monaco-icon-label-container>.monaco-icon-description-container>.label-description{text-decoration:line-through}.monaco-icon-label:after{opacity:.75;font-size:90%;font-weight:600;margin:auto 16px 0 5px;text-align:center}.monaco-list:focus .selected .monaco-icon-label,.monaco-list:focus .selected .monaco-icon-label:after{color:inherit!important}.monaco-list-row.focused.selected .label-description,.monaco-list-row.selected .label-description{opacity:.8}.monaco-editor .peekview-widget .head .peekview-title .severity-icon{display:inline-block;vertical-align:text-top;margin-right:4px}.monaco-editor .marker-widget{text-overflow:ellipsis;white-space:nowrap}.monaco-editor .marker-widget>.stale{opacity:.6;font-style:italic}.monaco-editor .marker-widget .title{display:inline-block;padding-right:5px}.monaco-editor .marker-widget .descriptioncontainer{position:absolute;white-space:pre;user-select:text;-webkit-user-select:text;padding:8px 12px 0 20px}.monaco-editor .marker-widget .descriptioncontainer .message{display:flex;flex-direction:column}.monaco-editor .marker-widget .descriptioncontainer .message .details{padding-left:6px}.monaco-editor .marker-widget .descriptioncontainer .message .source,.monaco-editor .marker-widget .descriptioncontainer .message span.code{opacity:.6}.monaco-editor .marker-widget .descriptioncontainer .message a.code-link{opacity:.6;color:inherit}.monaco-editor .marker-widget .descriptioncontainer .message a.code-link:before{content:\"(\"}.monaco-editor .marker-widget .descriptioncontainer .message a.code-link:after{content:\")\"}.monaco-editor .marker-widget .descriptioncontainer .message a.code-link>span{text-decoration:underline;border-bottom:1px solid transparent;text-underline-position:under;color:var(--vscode-textLink-activeForeground)}.monaco-editor .marker-widget .descriptioncontainer .filename{cursor:pointer;color:var(--vscode-textLink-activeForeground)}.monaco-editor .zone-widget .codicon.codicon-error,.markers-panel .marker-icon.error,.markers-panel .marker-icon .codicon.codicon-error,.text-search-provider-messages .providerMessage .codicon.codicon-error,.extensions-viewlet>.extensions .codicon.codicon-error,.extension-editor .codicon.codicon-error,.chat-attached-context-attachment .codicon.codicon-error{color:var(--vscode-problemsErrorIcon-foreground)}.monaco-editor .zone-widget .codicon.codicon-warning,.markers-panel .marker-icon.warning,.markers-panel .marker-icon .codicon.codicon-warning,.text-search-provider-messages .providerMessage .codicon.codicon-warning,.extensions-viewlet>.extensions .codicon.codicon-warning,.extension-editor .codicon.codicon-warning,.preferences-editor .codicon.codicon-warning{color:var(--vscode-problemsWarningIcon-foreground)}.monaco-editor .zone-widget .codicon.codicon-info,.markers-panel .marker-icon.info,.markers-panel .marker-icon .codicon.codicon-info,.text-search-provider-messages .providerMessage .codicon.codicon-info,.extensions-viewlet>.extensions .codicon.codicon-info,.extension-editor .codicon.codicon-info{color:var(--vscode-problemsInfoIcon-foreground)}.monaco-editor .hoverHighlight{background-color:var(--vscode-editor-hoverHighlightBackground)}.monaco-editor .monaco-resizable-hover{border:1px solid var(--vscode-editorHoverWidget-border);border-radius:3px;box-sizing:content-box}.monaco-editor .monaco-resizable-hover>.monaco-hover{border:none;border-radius:none}.monaco-editor .monaco-hover{border:1px solid var(--vscode-editorHoverWidget-border);border-radius:3px;color:var(--vscode-editorHoverWidget-foreground);background-color:var(--vscode-editorHoverWidget-background)}.monaco-editor .monaco-hover a{color:var(--vscode-textLink-foreground)}.monaco-editor .monaco-hover a:hover{color:var(--vscode-textLink-activeForeground)}.monaco-editor .monaco-hover .hover-row{display:flex}.monaco-editor .monaco-hover .hover-row.hover-row-with-copy{position:relative;padding-right:20px}.monaco-editor .monaco-hover .hover-row .hover-row-contents{min-width:0;display:flex;flex-direction:column}.monaco-editor .monaco-hover .hover-row .verbosity-actions{border-right:1px solid var(--vscode-editorHoverWidget-border);width:22px;overflow-y:clip}.monaco-editor .monaco-hover .hover-row .verbosity-actions-inner{display:flex;flex-direction:column;padding-left:5px;padding-right:5px;justify-content:flex-end;position:relative}.monaco-editor .monaco-hover .hover-row .verbosity-actions-inner .codicon{cursor:pointer;font-size:11px}.monaco-editor .monaco-hover .hover-row .verbosity-actions-inner .codicon.enabled{color:var(--vscode-textLink-foreground)}.monaco-editor .monaco-hover .hover-row .verbosity-actions-inner .codicon.disabled{opacity:.6}.monaco-editor .monaco-hover .hover-row .actions{background-color:var(--vscode-editorHoverWidget-statusBarBackground)}.monaco-editor .monaco-hover code{background-color:var(--vscode-textCodeBlock-background)}.monaco-editor .monaco-hover .hover-copy-button{position:absolute;top:4px;right:4px;padding:2px 4px;border-radius:3px;display:flex;align-items:center;justify-content:center;opacity:0}.monaco-editor .monaco-hover .hover-row-with-copy:hover .hover-copy-button,.monaco-editor .monaco-hover .hover-row-with-copy:focus-within .hover-copy-button{opacity:1}.monaco-editor .monaco-hover .hover-copy-button:hover{background-color:var(--vscode-toolbar-hoverBackground);cursor:pointer}.monaco-editor .monaco-hover .hover-copy-button:focus{outline:1px solid var(--vscode-focusBorder);outline-offset:-1px}.monaco-editor .monaco-hover .hover-copy-button .codicon{font-size:16px;color:var(--vscode-foreground)}.monaco-editor.vs .dnd-target,.monaco-editor.hc-light .dnd-target{border-right:2px dotted black;color:#fff}.monaco-editor.vs-dark .dnd-target{border-right:2px dotted #AEAFAD;color:#51504f}.monaco-editor.hc-black .dnd-target{border-right:2px dotted #fff;color:#000}.monaco-editor.mouse-default .view-lines,.monaco-editor.vs-dark.mac.mouse-default .view-lines,.monaco-editor.hc-black.mac.mouse-default .view-lines,.monaco-editor.hc-light.mac.mouse-default .view-lines{cursor:default}.monaco-editor.mouse-copy .view-lines,.monaco-editor.vs-dark.mac.mouse-copy .view-lines,.monaco-editor.hc-black.mac.mouse-copy .view-lines,.monaco-editor.hc-light.mac.mouse-copy .view-lines{cursor:copy}.monaco-editor .findOptionsWidget{background-color:var(--vscode-editorWidget-background);color:var(--vscode-editorWidget-foreground);box-shadow:0 0 8px 2px var(--vscode-widget-shadow);border:2px solid var(--vscode-contrastBorder)}.monaco-editor .margin-view-overlays .codicon-folding-manual-collapsed,.monaco-editor .margin-view-overlays .codicon-folding-manual-expanded,.monaco-editor .margin-view-overlays .codicon-folding-expanded,.monaco-editor .margin-view-overlays .codicon-folding-collapsed{cursor:pointer;opacity:0;transition:opacity .5s;display:flex;align-items:center;justify-content:center;font-size:100%;margin-left:2px}.monaco-reduce-motion .monaco-editor .margin-view-overlays .codicon-folding-manual-collapsed,.monaco-reduce-motion .monaco-editor .margin-view-overlays .codicon-folding-manual-expanded,.monaco-reduce-motion .monaco-editor .margin-view-overlays .codicon-folding-expanded,.monaco-reduce-motion .monaco-editor .margin-view-overlays .codicon-folding-collapsed{transition:initial}.monaco-editor .margin-view-overlays:hover .codicon,.monaco-editor .margin-view-overlays .codicon.codicon-folding-collapsed,.monaco-editor .margin-view-overlays .codicon.codicon-folding-manual-collapsed,.monaco-editor .margin-view-overlays .codicon.alwaysShowFoldIcons{opacity:1}.monaco-editor .inline-folded:after{color:var(--vscode-editor-foldPlaceholderForeground);margin:.1em .2em 0;content:\"\\22ef\";display:inline;line-height:1em;cursor:pointer}.monaco-editor .folded-background{background-color:var(--vscode-editor-foldBackground)}.monaco-editor .cldr.codicon.codicon-folding-expanded,.monaco-editor .cldr.codicon.codicon-folding-collapsed,.monaco-editor .cldr.codicon.codicon-folding-manual-expanded,.monaco-editor .cldr.codicon.codicon-folding-manual-collapsed{color:var(--vscode-editorGutter-foldingControlForeground)!important}.monaco-editor .snippet-placeholder{min-width:2px;outline-style:solid;outline-width:1px;background-color:var(--vscode-editor-snippetTabstopHighlightBackground, transparent);outline-color:var(--vscode-editor-snippetTabstopHighlightBorder, transparent)}.monaco-editor .finish-snippet-placeholder{outline-style:solid;outline-width:1px;background-color:var(--vscode-editor-snippetFinalTabstopHighlightBackground, transparent);outline-color:var(--vscode-editor-snippetFinalTabstopHighlightBorder, transparent)}.monaco-editor .suggest-widget{width:430px;z-index:40;display:flex;flex-direction:column;border-radius:3px}.monaco-editor .suggest-widget.message{flex-direction:row;align-items:center}.monaco-editor .suggest-widget,.monaco-editor .suggest-details{flex:0 1 auto;width:100%;border-style:solid;border-width:1px;border-color:var(--vscode-editorSuggestWidget-border);background-color:var(--vscode-editorSuggestWidget-background)}.monaco-editor.hc-black .suggest-widget,.monaco-editor.hc-black .suggest-details,.monaco-editor.hc-light .suggest-widget,.monaco-editor.hc-light .suggest-details{border-width:2px}.monaco-editor .suggest-widget .suggest-status-bar{box-sizing:border-box;display:none;flex-flow:row nowrap;justify-content:space-between;width:100%;font-size:80%;padding:0 4px;border-top:1px solid var(--vscode-editorSuggestWidget-border);overflow:hidden}.monaco-editor .suggest-widget.with-status-bar .suggest-status-bar{display:flex}.monaco-editor .suggest-widget .suggest-status-bar .left{padding-right:8px}.monaco-editor .suggest-widget.with-status-bar .suggest-status-bar .action-label{color:var(--vscode-editorSuggestWidgetStatus-foreground)}.monaco-editor .suggest-widget.with-status-bar .suggest-status-bar .action-item:not(:last-of-type) .action-label{margin-right:0}.monaco-editor .suggest-widget.with-status-bar .suggest-status-bar .action-item:not(:last-of-type) .action-label:after{content:\", \";margin-right:.3em}.monaco-editor .suggest-widget.with-status-bar .monaco-list .monaco-list-row>.contents>.main>.right>.readMore,.monaco-editor .suggest-widget.with-status-bar .monaco-list .monaco-list-row.focused.string-label>.contents>.main>.right>.readMore{display:none}.monaco-editor .suggest-widget.with-status-bar:not(.docs-side) .monaco-list .monaco-list-row:hover>.contents>.main>.right.can-expand-details>.details-label{width:100%}.monaco-editor .suggest-widget>.message{padding-left:22px}.monaco-editor .suggest-widget>.tree{height:100%;width:100%}.monaco-editor .suggest-widget .monaco-list{user-select:none;-webkit-user-select:none}.monaco-editor .suggest-widget .monaco-list .monaco-list-row{display:flex;-mox-box-sizing:border-box;box-sizing:border-box;padding-right:10px;background-repeat:no-repeat;background-position:2px 2px;white-space:nowrap;cursor:pointer;touch-action:none}.monaco-editor .suggest-widget .monaco-list .monaco-list-row.focused{color:var(--vscode-editorSuggestWidget-selectedForeground)}.monaco-editor .suggest-widget .monaco-list .monaco-list-row.focused .codicon{color:var(--vscode-editorSuggestWidget-selectedIconForeground)}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents{flex:1;height:100%;overflow:hidden;padding-left:2px}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main{display:flex;overflow:hidden;text-overflow:ellipsis;white-space:pre;justify-content:space-between}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.left,.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.right{display:flex}.monaco-editor .suggest-widget .monaco-list .monaco-list-row:not(.focused)>.contents>.main .monaco-icon-label{color:var(--vscode-editorSuggestWidget-foreground)}.monaco-editor .suggest-widget:not(.frozen) .monaco-highlighted-label .highlight{font-weight:700}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main .monaco-highlighted-label .highlight{color:var(--vscode-editorSuggestWidget-highlightForeground)}.monaco-editor .suggest-widget .monaco-list .monaco-list-row.focused>.contents>.main .monaco-highlighted-label .highlight{color:var(--vscode-editorSuggestWidget-focusHighlightForeground)}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.header>.codicon-close,.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.right>.readMore:before{color:inherit;opacity:1;font-size:14px;cursor:pointer}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.header>.codicon-close{position:absolute;top:6px;right:2px}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.header>.codicon-close:hover,.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.right>.readMore:hover{opacity:1}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.right>.details-label{opacity:.7}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.left>.signature-label{overflow:hidden;text-overflow:ellipsis;opacity:.6}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.left>.qualifier-label{margin-left:12px;opacity:.4;font-size:85%;line-height:initial;text-overflow:ellipsis;overflow:hidden;align-self:center}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.right>.details-label{font-size:85%;margin-left:1.1em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.right>.details-label>.monaco-tokenized-source{display:inline}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.right>.details-label{display:none}.monaco-editor .suggest-widget:not(.shows-details) .monaco-list .monaco-list-row.focused>.contents>.main>.right>.details-label{display:inline}.monaco-editor .suggest-widget .monaco-list .monaco-list-row:not(.string-label)>.contents>.main>.right>.details-label,.monaco-editor .suggest-widget.docs-side .monaco-list .monaco-list-row.focused:not(.string-label)>.contents>.main>.right>.details-label{display:inline}.monaco-editor .suggest-widget:not(.docs-side) .monaco-list .monaco-list-row.focused:hover>.contents>.main>.right.can-expand-details>.details-label{width:calc(100% - 26px)}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.left{flex-shrink:1;flex-grow:1;overflow:hidden}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.left>.monaco-icon-label{flex-shrink:0}.monaco-editor .suggest-widget .monaco-list .monaco-list-row:not(.string-label)>.contents>.main>.left>.monaco-icon-label{max-width:100%}.monaco-editor .suggest-widget .monaco-list .monaco-list-row.string-label>.contents>.main>.left>.monaco-icon-label{flex-shrink:1}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.right{overflow:hidden;flex-shrink:4;max-width:70%}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.right>.readMore{display:inline-block;position:absolute;right:10px;width:18px;height:18px;visibility:hidden}.monaco-editor .suggest-widget.docs-side .monaco-list .monaco-list-row>.contents>.main>.right>.readMore{display:none!important}.monaco-editor .suggest-widget .monaco-list .monaco-list-row.string-label>.contents>.main>.right>.readMore{display:none}.monaco-editor .suggest-widget .monaco-list .monaco-list-row.focused.string-label>.contents>.main>.right>.readMore{display:inline-block}.monaco-editor .suggest-widget .monaco-list .monaco-list-row.focused:hover>.contents>.main>.right>.readMore{visibility:visible}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .monaco-icon-label.deprecated{opacity:.66;text-decoration:unset}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .monaco-icon-label.deprecated>.monaco-icon-label-container>.monaco-icon-name-container{text-decoration:line-through}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .monaco-icon-label:before{height:100%}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .icon{display:block;height:16px;width:16px;margin-left:2px;background-repeat:no-repeat;background-size:80%;background-position:center}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .icon.hide{display:none}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .suggest-icon{display:flex;align-items:center;margin-right:4px}.monaco-editor .suggest-widget.no-icons .monaco-list .monaco-list-row .icon,.monaco-editor .suggest-widget.no-icons .monaco-list .monaco-list-row .suggest-icon:before{display:none}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .icon.customcolor .colorspan{margin:0 0 0 .3em;border:.1em solid #000;width:.7em;height:.7em;display:inline-block}.monaco-editor .suggest-details-container{z-index:41}.monaco-editor .suggest-details{display:flex;flex-direction:column;cursor:default;color:var(--vscode-editorSuggestWidget-foreground)}.monaco-editor .suggest-details:focus{border-color:var(--vscode-focusBorder)}.monaco-editor .suggest-details a{color:var(--vscode-textLink-foreground)}.monaco-editor .suggest-details a:hover{color:var(--vscode-textLink-activeForeground)}.monaco-editor .suggest-details code{background-color:var(--vscode-textCodeBlock-background)}.monaco-editor .suggest-details.no-docs{display:none}.monaco-editor .suggest-details>.monaco-scrollable-element{flex:1}.monaco-editor .suggest-details>.monaco-scrollable-element>.body{box-sizing:border-box;height:100%;width:100%}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.header>.type{flex:2;overflow:hidden;text-overflow:ellipsis;opacity:.7;white-space:pre;margin:0 24px 0 0;padding:4px 0 4px 5px}.monaco-editor .suggest-details.detail-and-doc>.monaco-scrollable-element>.body>.header>.type{padding-bottom:12px}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.header>.type.auto-wrap{white-space:normal;word-break:break-all}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.docs{margin:0;padding:4px 5px;white-space:pre-wrap}.monaco-editor .suggest-details.no-type>.monaco-scrollable-element>.body>.docs{margin-right:24px;overflow:hidden}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.docs.markdown-docs{padding:0;white-space:initial;min-height:calc(1rem + 8px)}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.docs.markdown-docs>div,.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.docs.markdown-docs>span:not(:empty){padding:4px 5px}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.docs.markdown-docs>div>p:first-child{margin-top:0}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.docs.markdown-docs>div>p:last-child{margin-bottom:0}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.docs.markdown-docs .monaco-tokenized-source{white-space:pre}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.docs .code{white-space:pre-wrap;word-wrap:break-word}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.docs.markdown-docs .codicon{vertical-align:sub}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>p:empty{display:none}.monaco-editor .suggest-details code{border-radius:3px;padding:0 .4em}.monaco-editor .suggest-details ul,.monaco-editor .suggest-details ol{padding-left:20px}.monaco-editor .suggest-details p code{font-family:var(--monaco-monospace-font)}.monaco-editor .suggest-preview-additional-widget{white-space:nowrap}.monaco-editor .suggest-preview-additional-widget .content-spacer{color:transparent;white-space:pre}.monaco-editor .suggest-preview-additional-widget .button{display:inline-block;cursor:pointer;text-decoration:underline;text-underline-position:under}.monaco-editor .ghost-text-hidden{opacity:0;font-size:0}.monaco-editor .ghost-text-decoration,.monaco-editor .suggest-preview-text .ghost-text{font-style:italic}.monaco-editor .suggest-preview-text.clickable .view-line{z-index:1}.monaco-editor .ghost-text-decoration.clickable,.monaco-editor .ghost-text-decoration-preview.clickable,.monaco-editor .suggest-preview-text.clickable .ghost-text{cursor:pointer}.monaco-editor .inline-completion-text-to-replace{text-decoration:underline;text-underline-position:under}.monaco-editor .ghost-text-decoration,.monaco-editor .ghost-text-decoration-preview,.monaco-editor .suggest-preview-text .ghost-text{&.syntax-highlighted{opacity:.7}&:not(.syntax-highlighted){color:var(--vscode-editorGhostText-foreground)}background-color:var(--vscode-editorGhostText-background);border:1px solid var(--vscode-editorGhostText-border)}.monaco-editor .ghost-text-decoration.warning,.monaco-editor .ghost-text-decoration-preview.warning,.monaco-editor .suggest-preview-text .ghost-text.warning{background:var(--monaco-editor-warning-decoration) repeat-x bottom left;border-bottom:4px double var(--vscode-editorWarning-border)}.ghost-text-view-warning-widget-icon{.codicon{color:var(--vscode-editorWarning-foreground)!important}}.monaco-editor{.edits-fadeout-decoration{opacity:var(--animation-opacity, 1);background-color:var(--vscode-inlineEdit-modifiedChangedTextBackground)}}.monaco-editor .sticky-widget{overflow:hidden;border-bottom:1px solid var(--vscode-editorStickyScroll-border);width:100%;box-shadow:var(--vscode-editorStickyScroll-shadow) 0 4px 2px -2px;z-index:4;right:initial!important;margin-left:\"0px\"}.monaco-editor .sticky-widget .sticky-widget-line-numbers{float:left;background-color:var(--vscode-editorStickyScrollGutter-background)}.monaco-editor .sticky-widget.peek .sticky-widget-line-numbers{background-color:var(--vscode-peekViewEditorStickyScrollGutter-background)}.monaco-editor .sticky-widget .sticky-widget-lines-scrollable{display:inline-block;position:absolute;overflow:hidden;width:var(--vscode-editorStickyScroll-scrollableWidth);background-color:var(--vscode-editorStickyScroll-background)}.monaco-editor .sticky-widget.peek .sticky-widget-lines-scrollable{background-color:var(--vscode-peekViewEditorStickyScroll-background)}.monaco-editor .sticky-widget .sticky-widget-lines{position:absolute;background-color:inherit}.monaco-editor .sticky-widget .sticky-line-number,.monaco-editor .sticky-widget .sticky-line-content{color:var(--vscode-editorLineNumber-foreground);white-space:nowrap;display:inline-block;position:absolute;background-color:inherit}.monaco-editor .sticky-widget .sticky-line-number .codicon-folding-expanded,.monaco-editor .sticky-widget .sticky-line-number .codicon-folding-collapsed{float:right;transition:var(--vscode-editorStickyScroll-foldingOpacityTransition);position:absolute;margin-left:2px}.monaco-editor .sticky-widget .sticky-line-content{width:var(--vscode-editorStickyScroll-scrollableWidth);background-color:inherit;white-space:nowrap}.monaco-editor .sticky-widget .sticky-line-number-inner{display:inline-block;text-align:right}.monaco-editor .sticky-widget .sticky-line-content:hover{background-color:var(--vscode-editorStickyScrollHover-background);cursor:pointer}.monaco-editor{.inline-edits-view-indicator{display:flex;z-index:34;height:20px;color:var(--vscode-inlineEdit-gutterIndicator-primaryForeground);background-color:var(--vscode-inlineEdit-gutterIndicator-background);border:1px solid var(--vscode-inlineEdit-gutterIndicator-primaryBorder);border-radius:3px;align-items:center;padding:2px 10px 2px 2px;margin:0 4px;opacity:0;&.contained{transition:opacity .2s ease-in-out;transition-delay:.4s}&.visible{opacity:1}&.top{opacity:1;.icon{transform:rotate(90deg)}}&.bottom{opacity:1;.icon{transform:rotate(-90deg)}}.icon{display:flex;align-items:center;margin:0 2px;transform:none;transition:transform .2s ease-in-out;.codicon{color:var(--vscode-inlineEdit-gutterIndicator-primaryForeground)}}.label{margin:0 2px;display:flex;justify-content:center;width:100%}}.inline-edits-view .editorContainer{.preview .monaco-editor{.view-overlays .current-line-exact,.current-line-margin{border:none}}.inline-edits-view-zone.diagonal-fill{opacity:.5}}.strike-through{text-decoration:line-through}.inlineCompletions-line-insert{background:var(--vscode-inlineEdit-modifiedChangedLineBackground)}.inlineCompletions-line-delete{background:var(--vscode-inlineEdit-originalChangedLineBackground)}.inlineCompletions-char-insert{background:var(--vscode-inlineEdit-modifiedChangedTextBackground);cursor:pointer}.inlineCompletions-char-delete{background:var(--vscode-inlineEdit-originalChangedTextBackground)}.inlineCompletions-char-delete.diff-range-empty{margin-left:-1px;border-left:solid var(--vscode-inlineEdit-originalChangedTextBackground) 3px}.inlineCompletions-char-insert.diff-range-empty{border-left:solid var(--vscode-inlineEdit-modifiedChangedTextBackground) 3px}.inlineCompletions-char-delete.single-line-inline{border:1px solid var(--vscode-editorHoverWidget-border);margin:-2px 0 0 -2px}.inlineCompletions-char-insert.single-line-inline{border-top:1px solid var(--vscode-inlineEdit-modifiedBorder);border-bottom:1px solid var(--vscode-inlineEdit-modifiedBorder)}.inlineCompletions-char-insert.single-line-inline.start{border-top-left-radius:4px;border-bottom-left-radius:4px;border-left:1px solid var(--vscode-inlineEdit-modifiedBorder)}.inlineCompletions-char-insert.single-line-inline.end{border-top-right-radius:4px;border-bottom-right-radius:4px;border-right:1px solid var(--vscode-inlineEdit-modifiedBorder)}.inlineCompletions-char-delete.single-line-inline.empty,.inlineCompletions-char-insert.single-line-inline.empty{display:none}.inlineCompletions.strike-through{text-decoration-thickness:1px}.inlineCompletions-modified-bubble{background:var(--vscode-inlineEdit-modifiedChangedTextBackground)}.inlineCompletions-original-bubble{background:var(--vscode-inlineEdit-originalChangedTextBackground)}.inlineCompletions-modified-bubble,.inlineCompletions-original-bubble{pointer-events:none;display:inline-block}.inline-edit.ghost-text,.inline-edit.ghost-text-decoration,.inline-edit.ghost-text-decoration-preview,.inline-edit.suggest-preview-text .ghost-text{&.syntax-highlighted{opacity:1!important}font-style:normal!important}.inline-edit.modified-background.ghost-text,.inline-edit.modified-background.ghost-text-decoration,.inline-edit.modified-background.ghost-text-decoration-preview,.inline-edit.modified-background.suggest-preview-text .ghost-text{background:var(--vscode-inlineEdit-modifiedChangedTextBackground)!important;display:inline-block!important}.inlineCompletions-original-lines{background:var(--vscode-editor-background)}}.monaco-menu-option{color:var(--vscode-editorActionList-foreground);font-size:13px;padding:0 4px;line-height:28px;display:flex;gap:4px;align-items:center;border-radius:3px;cursor:pointer;.monaco-keybinding-key{font-size:13px;opacity:.7}&.active{background:var(--vscode-editorActionList-focusBackground);color:var(--vscode-editorActionList-focusForeground);outline:1px solid var(--vscode-menu-selectionBorder, transparent);outline-offset:-1px;.monaco-keybinding-key{color:var(--vscode-editorActionList-focusForeground)}}}.monaco-editor .goto-definition-link{text-decoration:underline;cursor:pointer;color:var(--vscode-editorLink-activeForeground)!important}.monaco-editor.vs .valueSetReplacement{outline:solid 2px var(--vscode-editorBracketMatch-border)}.monaco-editor .linked-editing-decoration{background-color:var(--vscode-editor-linkedEditingBackground);min-width:1px}.monaco-editor .detected-link,.monaco-editor .detected-link-active{text-decoration:underline;text-underline-position:under}.monaco-editor .detected-link-active{cursor:pointer;color:var(--vscode-editorLink-activeForeground)!important}.monaco-editor{.scroll-editor-on-middle-click-dot{cursor:all-scroll;position:absolute;z-index:1;background-color:var(--vscode-editor-foreground, white);border:1px solid var(--vscode-editor-background, black);opacity:.5;width:5px;height:5px;border-radius:50%;transform:translate(-50%,-50%);&.hidden{display:none}}&.scroll-editor-on-middle-click-editor *{cursor:all-scroll}}.monaco-editor .focused .selectionHighlight{background-color:var(--vscode-editor-selectionHighlightBackground);box-sizing:border-box;border:1px solid var(--vscode-editor-selectionHighlightBorder)}.monaco-editor.hc-black .focused .selectionHighlight,.monaco-editor.hc-light .focused .selectionHighlight{border-style:dotted}.monaco-editor .wordHighlight{background-color:var(--vscode-editor-wordHighlightBackground);box-sizing:border-box;border:1px solid var(--vscode-editor-wordHighlightBorder)}.monaco-editor.hc-black .wordHighlight,.monaco-editor.hc-light .wordHighlight{border-style:dotted}.monaco-editor .wordHighlightStrong{background-color:var(--vscode-editor-wordHighlightStrongBackground);box-sizing:border-box;border:1px solid var(--vscode-editor-wordHighlightStrongBorder)}.monaco-editor.hc-black .wordHighlightStrong,.monaco-editor.hc-light .wordHighlightStrong{border-style:dotted}.monaco-editor .wordHighlightText{background-color:var(--vscode-editor-wordHighlightTextBackground);box-sizing:border-box;border:1px solid var(--vscode-editor-wordHighlightTextBorder)}.monaco-editor.hc-black .wordHighlightText,.monaco-editor.hc-light .wordHighlightText{border-style:dotted}.monaco-editor .parameter-hints-widget{z-index:39;display:flex;flex-direction:column;line-height:1.5em;cursor:default;color:var(--vscode-editorHoverWidget-foreground);background-color:var(--vscode-editorHoverWidget-background);border:1px solid var(--vscode-editorHoverWidget-border)}.hc-black .monaco-editor .parameter-hints-widget,.hc-light .monaco-editor .parameter-hints-widget{border-width:2px}.monaco-editor .parameter-hints-widget>.phwrapper{max-width:440px;display:flex;flex-direction:row}.monaco-editor .parameter-hints-widget.multiple{min-height:3.3em;padding:0}.monaco-editor .parameter-hints-widget.multiple .body:before{content:\"\";display:block;height:100%;position:absolute;opacity:.5;border-left:1px solid var(--vscode-editorHoverWidget-border)}.monaco-editor .parameter-hints-widget p,.monaco-editor .parameter-hints-widget ul{margin:8px 0}.monaco-editor .parameter-hints-widget .monaco-scrollable-element,.monaco-editor .parameter-hints-widget .body{display:flex;flex:1;flex-direction:column;min-height:100%}.monaco-editor .parameter-hints-widget .signature{padding:4px 5px;position:relative}.monaco-editor .parameter-hints-widget .signature.has-docs:after{content:\"\";display:block;position:absolute;left:0;width:100%;padding-top:4px;opacity:.5;border-bottom:1px solid var(--vscode-editorHoverWidget-border)}.monaco-editor .parameter-hints-widget .code{font-family:var(--vscode-parameterHintsWidget-editorFontFamily),var(--vscode-parameterHintsWidget-editorFontFamilyDefault)}.monaco-editor .parameter-hints-widget .docs{padding:0 10px 0 5px;white-space:pre-wrap}.monaco-editor .parameter-hints-widget .docs.empty{display:none}.monaco-editor .parameter-hints-widget .docs a{color:var(--vscode-textLink-foreground)}.monaco-editor .parameter-hints-widget .docs a:hover{color:var(--vscode-textLink-activeForeground);cursor:pointer}.monaco-editor .parameter-hints-widget .docs .markdown-docs{white-space:initial}.monaco-editor .parameter-hints-widget .docs code{font-family:var(--monaco-monospace-font);border-radius:3px;padding:0 .4em;background-color:var(--vscode-textCodeBlock-background)}.monaco-editor .parameter-hints-widget .docs .monaco-tokenized-source,.monaco-editor .parameter-hints-widget .docs .code{white-space:pre-wrap}.monaco-editor .parameter-hints-widget .controls{display:none;flex-direction:column;align-items:center;min-width:22px;justify-content:flex-end}.monaco-editor .parameter-hints-widget.multiple .controls{display:flex;padding:0 2px}.monaco-editor .parameter-hints-widget.multiple .button{width:16px;height:16px;background-repeat:no-repeat;cursor:pointer}.monaco-editor .parameter-hints-widget .button.previous{bottom:24px}.monaco-editor .parameter-hints-widget .overloads{text-align:center;height:12px;line-height:12px;font-family:var(--monaco-monospace-font)}.monaco-editor .parameter-hints-widget .signature .parameter.active{color:var(--vscode-editorHoverWidget-highlightForeground);font-weight:700}.monaco-editor .parameter-hints-widget .documentation-parameter>.parameter{font-weight:700;margin-right:.5em}.monaco-editor{.editorPlaceholder{top:0;position:absolute;overflow:hidden;text-overflow:ellipsis;text-wrap:nowrap;pointer-events:none;color:var(--vscode-editor-placeholder-foreground)}}.monaco-editor .rename-box{z-index:100;color:inherit;border-radius:4px}.monaco-editor .rename-box.preview{padding:4px 4px 0}.monaco-editor .rename-box .rename-input-with-button{padding:3px;border-radius:2px;width:calc(100% - 8px)}.monaco-editor .rename-box .rename-input{width:calc(100% - 8px);padding:0}.monaco-editor .rename-box .rename-input:focus{outline:none}.monaco-editor .rename-box .rename-suggestions-button{display:flex;align-items:center;padding:3px;background-color:transparent;border:none;border-radius:5px;cursor:pointer}.monaco-editor .rename-box .rename-suggestions-button:hover{background-color:var(--vscode-toolbar-hoverBackground)}.monaco-editor .rename-box .rename-candidate-list-container .monaco-list-row{border-radius:2px}.monaco-editor .rename-box .rename-label{display:none;opacity:.8}.monaco-editor .rename-box.preview .rename-label{display:inherit}.monaco-editor .unicode-highlight{border:1px solid var(--vscode-editorUnicodeHighlight-border);background-color:var(--vscode-editorUnicodeHighlight-background);box-sizing:border-box}.editor-banner{box-sizing:border-box;cursor:default;width:100%;font-size:12px;display:flex;overflow:visible;height:26px;background:var(--vscode-banner-background)}.editor-banner .icon-container{display:flex;flex-shrink:0;align-items:center;padding:0 6px 0 10px}.editor-banner .icon-container.custom-icon{background-repeat:no-repeat;background-position:center center;background-size:16px;width:16px;padding:0;margin:0 6px 0 10px}.editor-banner .message-container{display:flex;align-items:center;line-height:26px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.editor-banner .message-container p{margin-block-start:0;margin-block-end:0}.editor-banner .message-actions-container{flex-grow:1;flex-shrink:0;line-height:26px;margin:0 4px}.editor-banner .message-actions-container a.monaco-button{width:inherit;margin:2px 8px;padding:0 12px}.editor-banner .message-actions-container a{padding:3px;margin-left:12px;text-decoration:underline}.editor-banner .action-container{padding:0 10px 0 6px}.editor-banner{background-color:var(--vscode-banner-background)}.editor-banner,.editor-banner .action-container .codicon,.editor-banner .message-actions-container .monaco-link{color:var(--vscode-banner-foreground)}.editor-banner .icon-container .codicon{color:var(--vscode-banner-iconForeground)}.monaco-link{color:var(--vscode-textLink-foreground)}.monaco-link:hover{color:var(--vscode-textLink-activeForeground)}.floating-menu-overlay-widget{padding:0;color:var(--vscode-button-foreground);background-color:var(--vscode-button-background);border-radius:2px;border:1px solid var(--vscode-contrastBorder);display:flex;align-items:center;z-index:10;box-shadow:0 2px 8px var(--vscode-widget-shadow);overflow:hidden;.action-item>.action-label{padding:5px;font-size:12px;border-radius:2px}.action-item>.action-label.codicon{color:var(--vscode-button-foreground)}.action-item>.action-label.codicon:not(.separator){padding-top:6px;padding-bottom:6px}.action-item:first-child>.action-label{padding-left:7px}.action-item:last-child>.action-label{padding-right:7px}.action-item .action-label.separator{background-color:var(--vscode-menu-separatorBackground)}}.monaco-editor .iPadShowKeyboard{width:58px;min-width:0;height:36px;min-height:0;margin:0;padding:0;position:absolute;resize:none;overflow:hidden;background:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTMiIGhlaWdodD0iMzYiIHZpZXdCb3g9IjAgMCA1MyAzNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgY2xpcC1wYXRoPSJ1cmwoI2NsaXAwKSI+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNDguMDM2NCA0LjAxMDQySDQuMDA3NzlMNC4wMDc3OSAzMi4wMjg2SDQ4LjAzNjRWNC4wMTA0MlpNNC4wMDc3OSAwLjAwNzgxMjVDMS43OTcyMSAwLjAwNzgxMjUgMC4wMDUxODc5OSAxLjc5OTg0IDAuMDA1MTg3OTkgNC4wMTA0MlYzMi4wMjg2QzAuMDA1MTg3OTkgMzQuMjM5MiAxLjc5NzIxIDM2LjAzMTIgNC4wMDc3OSAzNi4wMzEySDQ4LjAzNjRDNTAuMjQ3IDM2LjAzMTIgNTIuMDM5IDM0LjIzOTIgNTIuMDM5IDMyLjAyODZWNC4wMTA0MkM1Mi4wMzkgMS43OTk4NCA1MC4yNDcgMC4wMDc4MTI1IDQ4LjAzNjQgMC4wMDc4MTI1SDQuMDA3NzlaTTguMDEwNDIgOC4wMTMwMkgxMi4wMTNWMTIuMDE1Nkg4LjAxMDQyVjguMDEzMDJaTTIwLjAxODIgOC4wMTMwMkgxNi4wMTU2VjEyLjAxNTZIMjAuMDE4MlY4LjAxMzAyWk0yNC4wMjA4IDguMDEzMDJIMjguMDIzNFYxMi4wMTU2SDI0LjAyMDhWOC4wMTMwMlpNMzYuMDI4NiA4LjAxMzAySDMyLjAyNlYxMi4wMTU2SDM2LjAyODZWOC4wMTMwMlpNNDAuMDMxMiA4LjAxMzAySDQ0LjAzMzlWMTIuMDE1Nkg0MC4wMzEyVjguMDEzMDJaTTE2LjAxNTYgMTYuMDE4Mkg4LjAxMDQyVjIwLjAyMDhIMTYuMDE1NlYxNi4wMTgyWk0yMC4wMTgyIDE2LjAxODJIMjQuMDIwOFYyMC4wMjA4SDIwLjAxODJWMTYuMDE4MlpNMzIuMDI2IDE2LjAxODJIMjguMDIzNFYyMC4wMjA4SDMyLjAyNlYxNi4wMTgyWk00NC4wMzM5IDE2LjAxODJWMjAuMDIwOEgzNi4wMjg2VjE2LjAxODJINDQuMDMzOVpNMTIuMDEzIDI0LjAyMzRIOC4wMTA0MlYyOC4wMjZIMTIuMDEzVjI0LjAyMzRaTTE2LjAxNTYgMjQuMDIzNEgzNi4wMjg2VjI4LjAyNkgxNi4wMTU2VjI0LjAyMzRaTTQ0LjAzMzkgMjQuMDIzNEg0MC4wMzEyVjI4LjAyNkg0NC4wMzM5VjI0LjAyMzRaIiBmaWxsPSIjNDI0MjQyIi8+CjwvZz4KPGRlZnM+CjxjbGlwUGF0aCBpZD0iY2xpcDAiPgo8cmVjdCB3aWR0aD0iNTMiIGhlaWdodD0iMzYiIGZpbGw9IndoaXRlIi8+CjwvY2xpcFBhdGg+CjwvZGVmcz4KPC9zdmc+Cg==) center center no-repeat;border:4px solid #F6F6F6;border-radius:4px}.monaco-editor.vs-dark .iPadShowKeyboard{background:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTMiIGhlaWdodD0iMzYiIHZpZXdCb3g9IjAgMCA1MyAzNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgY2xpcC1wYXRoPSJ1cmwoI2NsaXAwKSI+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNDguMDM2NCA0LjAxMDQySDQuMDA3NzlMNC4wMDc3OSAzMi4wMjg2SDQ4LjAzNjRWNC4wMTA0MlpNNC4wMDc3OSAwLjAwNzgxMjVDMS43OTcyMSAwLjAwNzgxMjUgMC4wMDUxODc5OSAxLjc5OTg0IDAuMDA1MTg3OTkgNC4wMTA0MlYzMi4wMjg2QzAuMDA1MTg3OTkgMzQuMjM5MiAxLjc5NzIxIDM2LjAzMTIgNC4wMDc3OSAzNi4wMzEySDQ4LjAzNjRDNTAuMjQ3IDM2LjAzMTIgNTIuMDM5IDM0LjIzOTIgNTIuMDM5IDMyLjAyODZWNC4wMTA0MkM1Mi4wMzkgMS43OTk4NCA1MC4yNDcgMC4wMDc4MTI1IDQ4LjAzNjQgMC4wMDc4MTI1SDQuMDA3NzlaTTguMDEwNDIgOC4wMTMwMkgxMi4wMTNWMTIuMDE1Nkg4LjAxMDQyVjguMDEzMDJaTTIwLjAxODIgOC4wMTMwMkgxNi4wMTU2VjEyLjAxNTZIMjAuMDE4MlY4LjAxMzAyWk0yNC4wMjA4IDguMDEzMDJIMjguMDIzNFYxMi4wMTU2SDI0LjAyMDhWOC4wMTMwMlpNMzYuMDI4NiA4LjAxMzAySDMyLjAyNlYxMi4wMTU2SDM2LjAyODZWOC4wMTMwMlpNNDAuMDMxMiA4LjAxMzAySDQ0LjAzMzlWMTIuMDE1Nkg0MC4wMzEyVjguMDEzMDJaTTE2LjAxNTYgMTYuMDE4Mkg4LjAxMDQyVjIwLjAyMDhIMTYuMDE1NlYxNi4wMTgyWk0yMC4wMTgyIDE2LjAxODJIMjQuMDIwOFYyMC4wMjA4SDIwLjAxODJWMTYuMDE4MlpNMzIuMDI2IDE2LjAxODJIMjguMDIzNFYyMC4wMjA4SDMyLjAyNlYxNi4wMTgyWk00NC4wMzM5IDE2LjAxODJWMjAuMDIwOEgzNi4wMjg2VjE2LjAxODJINDQuMDMzOVpNMTIuMDEzIDI0LjAyMzRIOC4wMTA0MlYyOC4wMjZIMTIuMDEzVjI0LjAyMzRaTTE2LjAxNTYgMjQuMDIzNEgzNi4wMjg2VjI4LjAyNkgxNi4wMTU2VjI0LjAyMzRaTTQ0LjAzMzkgMjQuMDIzNEg0MC4wMzEyVjI4LjAyNkg0NC4wMzM5VjI0LjAyMzRaIiBmaWxsPSIjQzVDNUM1Ii8+CjwvZz4KPGRlZnM+CjxjbGlwUGF0aCBpZD0iY2xpcDAiPgo8cmVjdCB3aWR0aD0iNTMiIGhlaWdodD0iMzYiIGZpbGw9IndoaXRlIi8+CjwvY2xpcFBhdGg+CjwvZGVmcz4KPC9zdmc+Cg==) center center no-repeat;border:4px solid #252526}.monaco-editor .tokens-inspect-widget{z-index:50;user-select:text;-webkit-user-select:text;padding:10px;color:var(--vscode-editorHoverWidget-foreground);background-color:var(--vscode-editorHoverWidget-background);border:1px solid var(--vscode-editorHoverWidget-border)}.monaco-editor.hc-black .tokens-inspect-widget,.monaco-editor.hc-light .tokens-inspect-widget{border-width:2px}.monaco-editor .tokens-inspect-widget .tokens-inspect-separator{height:1px;border:0;background-color:var(--vscode-editorHoverWidget-border)}.monaco-editor .tokens-inspect-widget .tm-token{font-family:var(--monaco-monospace-font)}.monaco-editor .tokens-inspect-widget .tm-token-length{font-weight:400;font-size:60%;float:right}.monaco-editor .tokens-inspect-widget .tm-metadata-table{width:100%}.monaco-editor .tokens-inspect-widget .tm-metadata-value{font-family:var(--monaco-monospace-font);text-align:right}.monaco-editor .tokens-inspect-widget .tm-token-type{font-family:var(--monaco-monospace-font)}.monaco-editor{font-family:-apple-system,BlinkMacSystemFont,Segoe WPC,Segoe UI,HelveticaNeue-Light,system-ui,Ubuntu,Droid Sans,sans-serif;--monaco-monospace-font: \"SF Mono\", Monaco, Menlo, Consolas, \"Ubuntu Mono\", \"Liberation Mono\", \"DejaVu Sans Mono\", \"Courier New\", monospace}.monaco-menu .monaco-action-bar.vertical .action-item .action-menu-item:focus .action-label{stroke-width:1.2px}.monaco-editor.vs-dark .monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .action-label,.monaco-editor.hc-black .monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .action-label,.monaco-editor.hc-light .monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .action-label{stroke-width:1.2px}.monaco-hover p{margin:0}.monaco-aria-container{position:absolute!important;top:0;height:1px;width:1px;margin:-1px;overflow:hidden;padding:0;clip:rect(1px,1px,1px,1px);clip-path:inset(50%)}.monaco-editor .synthetic-focus,.monaco-diff-editor .synthetic-focus,.monaco-editor [tabindex=\"0\"]:focus,.monaco-diff-editor [tabindex=\"0\"]:focus,.monaco-editor [tabindex=\"-1\"]:focus,.monaco-diff-editor [tabindex=\"-1\"]:focus,.monaco-editor button:focus,.monaco-diff-editor button:focus,.monaco-editor input[type=button]:focus,.monaco-diff-editor input[type=button]:focus,.monaco-editor input[type=checkbox]:focus,.monaco-diff-editor input[type=checkbox]:focus,.monaco-editor input[type=search]:focus,.monaco-diff-editor input[type=search]:focus,.monaco-editor input[type=text]:focus,.monaco-diff-editor input[type=text]:focus,.monaco-editor select:focus,.monaco-diff-editor select:focus,.monaco-editor textarea:focus,.monaco-diff-editor textarea:focus{outline-width:1px;outline-style:solid;outline-offset:-1px;outline-color:var(--vscode-focusBorder);opacity:1}.monaco-hover.workbench-hover{position:relative;font-size:13px;line-height:19px;z-index:40;overflow:hidden;max-width:700px;background:var(--vscode-editorHoverWidget-background);border:1px solid var(--vscode-editorHoverWidget-border);border-radius:5px;color:var(--vscode-editorHoverWidget-foreground);box-shadow:0 2px 8px var(--vscode-widget-shadow)}.monaco-hover.workbench-hover .monaco-action-bar .action-item .codicon{width:13px;height:13px}.monaco-hover.workbench-hover hr{border-bottom:none}.monaco-hover.workbench-hover.compact{font-size:12px}.monaco-hover.workbench-hover.compact .monaco-action-bar .action-item .codicon{width:12px;height:12px}.monaco-hover.workbench-hover.compact .hover-contents{padding:2px 8px}.workbench-hover-container.locked .monaco-hover.workbench-hover{outline:1px solid var(--vscode-editorHoverWidget-border)}.workbench-hover-container:focus-within.locked .monaco-hover.workbench-hover{outline-color:var(--vscode-focusBorder)}.workbench-hover-pointer{position:absolute;z-index:41;pointer-events:none}.workbench-hover-pointer:after{content:\"\";position:absolute;width:5px;height:5px;background-color:var(--vscode-editorHoverWidget-background);border-right:1px solid var(--vscode-editorHoverWidget-border);border-bottom:1px solid var(--vscode-editorHoverWidget-border)}.workbench-hover-container:not(:focus-within).locked .workbench-hover-pointer:after{width:4px;height:4px;border-right-width:2px;border-bottom-width:2px}.workbench-hover-container:focus-within .workbench-hover-pointer:after{border-right:1px solid var(--vscode-focusBorder);border-bottom:1px solid var(--vscode-focusBorder)}.workbench-hover-pointer.left{left:-3px}.workbench-hover-pointer.right{right:3px}.workbench-hover-pointer.top{top:-3px}.workbench-hover-pointer.bottom{bottom:3px}.workbench-hover-pointer.left:after{transform:rotate(135deg)}.workbench-hover-pointer.right:after{transform:rotate(315deg)}.workbench-hover-pointer.top:after{transform:rotate(225deg)}.workbench-hover-pointer.bottom:after{transform:rotate(45deg)}.monaco-hover.workbench-hover a{color:var(--vscode-textLink-foreground)}.monaco-hover.workbench-hover a:focus{outline:1px solid;outline-offset:-1px;text-decoration:underline;outline-color:var(--vscode-focusBorder)}.monaco-hover.workbench-hover a.codicon:focus,.monaco-hover.workbench-hover a.monaco-button:focus{text-decoration:none}.monaco-hover.workbench-hover a:hover,.monaco-hover.workbench-hover a:active{color:var(--vscode-textLink-activeForeground)}.monaco-hover.workbench-hover code{background:var(--vscode-textCodeBlock-background)}.monaco-hover.workbench-hover .hover-row .actions{background:var(--vscode-editorHoverWidget-statusBarBackground)}.monaco-hover.workbench-hover.right-aligned{left:1px}.monaco-hover.workbench-hover.right-aligned .hover-row.status-bar .actions{flex-direction:row-reverse}.monaco-hover.workbench-hover.right-aligned .hover-row.status-bar .actions .action-container{margin-right:0;margin-left:16px}.context-view{position:absolute}.context-view.fixed{all:initial;font-family:inherit;font-size:13px;position:fixed;color:inherit}.quick-input-widget{font-size:13px}.quick-input-widget .monaco-highlighted-label .highlight{color:#0066bf}.vs .quick-input-widget .monaco-list-row.focused .monaco-highlighted-label .highlight{color:#9dddff}.vs-dark .quick-input-widget .monaco-highlighted-label .highlight{color:#0097fb}.hc-black .quick-input-widget .monaco-highlighted-label .highlight{color:#f38518}.hc-light .quick-input-widget .monaco-highlighted-label .highlight{color:#0f4a85}.monaco-keybinding>.monaco-keybinding-key{background-color:#ddd6;border:solid 1px rgba(204,204,204,.4);border-bottom-color:#bbb6;box-shadow:inset 0 -1px #bbb6;color:#555}.hc-black .monaco-keybinding>.monaco-keybinding-key{background-color:transparent;border:solid 1px rgb(111,195,223);box-shadow:none;color:#fff}.hc-light .monaco-keybinding>.monaco-keybinding-key{background-color:transparent;border:solid 1px #0F4A85;box-shadow:none;color:#292929}.vs-dark .monaco-keybinding>.monaco-keybinding-key{background-color:#8080802b;border:solid 1px rgba(51,51,51,.6);border-bottom-color:#4449;box-shadow:inset 0 -1px #4449;color:#ccc}.quick-input-widget{position:absolute;width:600px;z-index:2550;left:50%;-webkit-app-region:no-drag;border-radius:6px}.quick-input-titlebar{cursor:grab;display:flex;align-items:center;border-top-right-radius:5px;border-top-left-radius:5px}.quick-input-left-action-bar{display:flex;margin-left:4px;flex:1}.quick-input-inline-action-bar>.actions-container>.action-item:first-child{margin-left:5px}.quick-input-inline-action-bar>.actions-container>.action-item{margin-top:2px}.quick-input-title{cursor:grab;padding:3px 0;text-align:center;text-overflow:ellipsis;overflow:hidden}.quick-input-right-action-bar{display:flex;margin-right:4px;flex:1}.quick-input-right-action-bar>.actions-container{justify-content:flex-end}.quick-input-right-action-bar>.actions-container>.action-item{margin-left:4px}.quick-input-titlebar .monaco-action-bar .action-label.codicon{background-position:center;background-repeat:no-repeat;padding:2px}.quick-input-description{margin:6px 6px 6px 11px}.quick-input-header .quick-input-description{margin:4px 2px;flex:1}.quick-input-header{cursor:grab;display:flex;padding:6px 6px 2px}.quick-input-widget.hidden-input .quick-input-header{padding:0;margin-bottom:0}.quick-input-and-message{display:flex;flex-direction:column;flex-grow:1;min-width:0;position:relative}.quick-input-check-all{align-self:center;margin:0}.quick-input-widget .quick-input-header .monaco-checkbox{margin-top:6px}.quick-input-filter{flex-grow:1;display:flex;position:relative}.quick-input-box{flex-grow:1}.quick-input-widget.show-checkboxes .quick-input-box,.quick-input-widget.show-checkboxes .quick-input-message{margin-left:5px}.quick-input-visible-count{position:absolute;left:-10000px}.quick-input-count{align-self:center;position:absolute;right:4px;display:flex;align-items:center}.quick-input-count .monaco-count-badge{vertical-align:middle;padding:2px 4px;border-radius:2px;min-height:auto;line-height:normal}.quick-input-action{margin-left:6px}.quick-input-action .monaco-text-button{font-size:11px;padding:0 6px;display:flex;height:25px;align-items:center}.quick-input-message{margin-top:-1px;padding:5px;overflow-wrap:break-word}.quick-input-message>.codicon{margin:0 .2em;vertical-align:text-bottom}.quick-input-message a{color:inherit}.quick-input-progress.monaco-progress-container{position:relative}.quick-input-list{line-height:22px}.quick-input-widget.hidden-input .quick-input-list{margin-top:4px;padding-bottom:4px}.quick-input-list .monaco-list{overflow:hidden;max-height:440px;padding-bottom:5px}.quick-input-list .monaco-scrollable-element{padding:0 6px}.quick-input-list .quick-input-list-entry{box-sizing:border-box;overflow:hidden;display:flex;padding:0 6px}.quick-input-list .quick-input-list-entry.quick-input-list-separator-border{border-top-width:1px;border-top-style:solid}.quick-input-list .monaco-list-row{border-radius:3px}.quick-input-list .monaco-list-row[data-index=\"0\"] .quick-input-list-entry.quick-input-list-separator-border{border-top-style:none}.quick-input-list .quick-input-list-label{overflow:hidden;display:flex;height:100%;flex:1}.quick-input-widget .monaco-checkbox{margin-right:0}.quick-input-widget .quick-input-list .monaco-checkbox,.quick-input-widget .quick-input-tree .monaco-checkbox{margin-top:4px}.quick-input-list .quick-input-list-icon{background-size:16px;background-position:left center;background-repeat:no-repeat;padding-right:6px;width:16px;height:22px;display:flex;align-items:center;justify-content:center}.quick-input-list .quick-input-list-rows{overflow:hidden;text-overflow:ellipsis;display:flex;flex-direction:column;height:100%;flex:1;margin-left:5px}.quick-input-list .quick-input-list-rows>.quick-input-list-row{display:flex;align-items:center}.quick-input-list .quick-input-list-rows>.quick-input-list-row .monaco-icon-label,.quick-input-list .quick-input-list-rows>.quick-input-list-row .monaco-icon-label .monaco-icon-label-container>.monaco-icon-name-container{flex:1}.quick-input-list .quick-input-list-rows>.quick-input-list-row .codicon[class*=codicon-]{vertical-align:text-bottom}.quick-input-list .quick-input-list-rows .monaco-highlighted-label>span{opacity:1}.quick-input-list .quick-input-list-entry .quick-input-list-entry-keybinding{margin-right:8px}.quick-input-list .quick-input-list-label-meta{opacity:.7;line-height:normal;text-overflow:ellipsis;overflow:hidden}.quick-input-list .monaco-list .monaco-list-row .monaco-highlighted-label .highlight{font-weight:700;background-color:unset;color:var(--vscode-list-highlightForeground)!important}.quick-input-list .monaco-list .monaco-list-row.focused .monaco-highlighted-label .highlight{color:var(--vscode-list-focusHighlightForeground)!important}.quick-input-list .quick-input-list-entry .quick-input-list-separator{margin-right:4px}.quick-input-list .quick-input-list-entry-action-bar{display:flex;flex:0;overflow:visible}.quick-input-list .quick-input-list-entry-action-bar .action-label{display:none}.quick-input-list .quick-input-list-entry-action-bar .action-label.codicon{margin-right:4px;padding:2px}.quick-input-list .quick-input-list-entry-action-bar{margin-top:1px}.quick-input-list .quick-input-list-entry-action-bar{margin-right:4px}.quick-input-list .quick-input-list-entry .quick-input-list-entry-action-bar .action-label.always-visible,.quick-input-list .quick-input-list-entry:hover .quick-input-list-entry-action-bar .action-label,.quick-input-list .quick-input-list-entry.focus-inside .quick-input-list-entry-action-bar .action-label,.quick-input-list .monaco-list-row.focused .quick-input-list-entry-action-bar .action-label,.quick-input-list .monaco-list-row.passive-focused .quick-input-list-entry-action-bar .action-label{display:flex}.quick-input-list>.monaco-list:focus .monaco-list-row.focused{outline:1px solid var(--vscode-list-focusOutline)!important;outline-offset:-1px}.quick-input-list>.monaco-list:focus .monaco-list-row.focused .quick-input-list-entry.quick-input-list-separator-border{border-color:transparent}.quick-input-list .monaco-list-row.focused .monaco-keybinding-key,.quick-input-list .monaco-list-row.focused .quick-input-list-entry .quick-input-list-separator{color:inherit}.quick-input-list .monaco-list-row.focused .monaco-keybinding-key{background:none}.quick-input-list .quick-input-list-separator-as-item{padding:4px 6px;font-size:12px}.quick-input-list .quick-input-list-separator-as-item .label-name{font-weight:600}.quick-input-list .quick-input-list-separator-as-item .label-description{opacity:1!important}.quick-input-list .monaco-tree-sticky-row .quick-input-list-entry.quick-input-list-separator-as-item.quick-input-list-separator-border{border-top-style:none}.quick-input-list .monaco-tree-sticky-row{padding:0 5px}.quick-input-list .monaco-tl-twistie{display:none!important}.quick-input-tree .monaco-list{overflow:hidden;max-height:440px;padding-bottom:5px}.quick-input-tree .quick-input-tree-entry{box-sizing:border-box;overflow:hidden;display:flex;padding:0 6px}.quick-input-tree .quick-input-tree-label{overflow:hidden;display:flex;height:100%;flex:1}.quick-input-tree .quick-input-tree-icon{background-size:16px;background-position:left center;background-repeat:no-repeat;padding-right:6px;width:16px;height:22px;display:flex;align-items:center;justify-content:center}.quick-input-tree .quick-input-tree-rows{overflow:hidden;text-overflow:ellipsis;display:flex;flex-direction:column;height:100%;flex:1;margin-left:5px}.quick-input-tree .quick-input-tree-rows>.quick-input-tree-row{display:flex;align-items:center}.quick-input-tree .quick-input-tree-rows>.quick-input-tree-row .monaco-icon-label,.quick-input-tree .quick-input-tree-rows>.quick-input-tree-row .monaco-icon-label .monaco-icon-label-container>.monaco-icon-name-container{flex:1}.quick-input-tree .quick-input-tree-rows>.quick-input-tree-row .codicon[class*=codicon-]{vertical-align:text-bottom}.quick-input-tree .quick-input-tree-rows .monaco-highlighted-label>span{opacity:1}.quick-input-tree .quick-input-tree-entry-action-bar{display:flex;flex:0;overflow:visible}.quick-input-tree .quick-input-tree-entry-action-bar .action-label{display:none}.quick-input-tree .quick-input-tree-entry-action-bar .action-label.codicon{margin-right:4px;padding:2px}.quick-input-tree .quick-input-tree-entry-action-bar{margin-top:1px}.quick-input-tree .quick-input-tree-entry-action-bar{margin-right:4px}.quick-input-tree .quick-input-tree-entry .quick-input-tree-entry-action-bar .action-label.always-visible,.quick-input-tree .quick-input-tree-entry:hover .quick-input-tree-entry-action-bar .action-label,.quick-input-tree .quick-input-tree-entry.focus-inside .quick-input-tree-entry-action-bar .action-label,.quick-input-tree .monaco-list-row.focused .quick-input-tree-entry-action-bar .action-label,.quick-input-tree .monaco-list-row.passive-focused .quick-input-tree-entry-action-bar .action-label{display:flex}.quick-input-tree>.monaco-list:focus .monaco-list-row.focused{outline:1px solid var(--vscode-list-focusOutline)!important;outline-offset:-1px}.monaco-progress-container{width:100%;height:2px;overflow:hidden}.monaco-progress-container .progress-bit{width:2%;height:2px;position:absolute;left:0;display:none}.monaco-progress-container.active .progress-bit{display:inherit}.monaco-progress-container.discrete .progress-bit{left:0;transition:width .1s linear}.monaco-progress-container.discrete.done .progress-bit{width:100%}.monaco-progress-container.infinite .progress-bit{animation-name:progress;animation-duration:4s;animation-iteration-count:infinite;transform:translateZ(0);animation-timing-function:linear}.monaco-progress-container.infinite.infinite-long-running .progress-bit{animation-timing-function:steps(100)}@keyframes progress{0%{transform:translate(0) scaleX(1)}50%{transform:translate(2500%) scaleX(3)}to{transform:translate(4900%) scaleX(1)}}.monaco-editor .rendered-markdown kbd{background-color:var(--vscode-keybindingLabel-background);color:var(--vscode-keybindingLabel-foreground);border-style:solid;border-width:1px;border-radius:3px;border-color:var(--vscode-keybindingLabel-border);border-bottom-color:var(--vscode-keybindingLabel-bottomBorder);box-shadow:inset 0 -1px 0 var(--vscode-widget-shadow);vertical-align:middle;padding:1px 3px}.rendered-markdown li:has(input[type=checkbox]){list-style-type:none}.monaco-component.multiDiffEditor{background:var(--vscode-multiDiffEditor-background);position:relative;height:100%;width:100%;overflow-y:hidden;>div{position:absolute;top:0;left:0;height:100%;width:100%;&.placeholder{visibility:hidden;&.visible{visibility:visible}display:grid;place-items:center;place-content:center}}.active{--vscode-multiDiffEditor-border: var(--vscode-focusBorder)}.multiDiffEntry{display:flex;flex-direction:column;flex:1;overflow:hidden;.collapse-button{margin:0 5px;cursor:pointer;a{display:block}}.header{z-index:1000;background:var(--vscode-editor-background);&:not(.collapsed) .header-content{border-bottom:1px solid var(--vscode-sideBarSectionHeader-border)}.header-content{margin:8px 0 0;padding:4px 5px;border-top:1px solid var(--vscode-multiDiffEditor-border);display:flex;align-items:center;color:var(--vscode-foreground);background:var(--vscode-multiDiffEditor-headerBackground);&.shadow{box-shadow:var(--vscode-scrollbar-shadow) 0 6px 6px -6px}.file-path{display:flex;flex:1;min-width:0;.title{font-size:14px;line-height:22px;&.original{flex:1;min-width:0;text-overflow:ellipsis}}.status{font-weight:600;opacity:.75;margin:0 10px;line-height:22px}}.actions{padding:0 8px}}}.editorParent{flex:1;display:flex;flex-direction:column;border-bottom:1px solid var(--vscode-multiDiffEditor-border);overflow:hidden}.editorContainer{flex:1}}}\n.monaco-inputbox input{outline:1px solid var(--vscode-focusBorder)} .rename-box input{color:inherit;font-family:inherit;font-size:100%;}.monaco-editor .rename-box .rename-input-with-button{width:auto}" \ No newline at end of file diff --git a/web/public/hoisted-modern-monaco/modern-monaco/editor-worker-main.mjs b/web/public/hoisted-modern-monaco/modern-monaco/editor-worker-main.mjs new file mode 100644 index 0000000000..7a6dab88fa --- /dev/null +++ b/web/public/hoisted-modern-monaco/modern-monaco/editor-worker-main.mjs @@ -0,0 +1,5 @@ +// src/editor-worker-main.ts +import { start } from "./editor-worker.mjs"; +self.onmessage = (e) => { + start(() => ({})); +}; diff --git a/web/public/hoisted-modern-monaco/modern-monaco/editor-worker.mjs b/web/public/hoisted-modern-monaco/modern-monaco/editor-worker.mjs new file mode 100644 index 0000000000..10fee2fa96 --- /dev/null +++ b/web/public/hoisted-modern-monaco/modern-monaco/editor-worker.mjs @@ -0,0 +1,14466 @@ +// node_modules/monaco-editor-core/esm/vs/base/common/errors.js +var ErrorHandler = class { + constructor() { + this.listeners = []; + this.unexpectedErrorHandler = function(e) { + setTimeout(() => { + if (e.stack) { + if (ErrorNoTelemetry.isErrorNoTelemetry(e)) { + throw new ErrorNoTelemetry(e.message + "\n\n" + e.stack); + } + throw new Error(e.message + "\n\n" + e.stack); + } + throw e; + }, 0); + }; + } + emit(e) { + this.listeners.forEach((listener) => { + listener(e); + }); + } + onUnexpectedError(e) { + this.unexpectedErrorHandler(e); + this.emit(e); + } + // For external errors, we don't want the listeners to be called + onUnexpectedExternalError(e) { + this.unexpectedErrorHandler(e); + } +}; +var errorHandler = new ErrorHandler(); +function onUnexpectedError(e) { + if (!isCancellationError(e)) { + errorHandler.onUnexpectedError(e); + } + return void 0; +} +function transformErrorForSerialization(error) { + if (error instanceof Error) { + const { name, message, cause } = error; + const stack = error.stacktrace || error.stack; + return { + $isError: true, + name, + message, + stack, + noTelemetry: ErrorNoTelemetry.isErrorNoTelemetry(error), + cause: cause ? transformErrorForSerialization(cause) : void 0, + code: error.code + }; + } + return error; +} +var canceledName = "Canceled"; +function isCancellationError(error) { + if (error instanceof CancellationError) { + return true; + } + return error instanceof Error && error.name === canceledName && error.message === canceledName; +} +var CancellationError = class extends Error { + constructor() { + super(canceledName); + this.name = this.message; + } +}; +var ErrorNoTelemetry = class _ErrorNoTelemetry extends Error { + constructor(msg) { + super(msg); + this.name = "CodeExpectedError"; + } + static fromError(err) { + if (err instanceof _ErrorNoTelemetry) { + return err; + } + const result = new _ErrorNoTelemetry(); + result.message = err.message; + result.stack = err.stack; + return result; + } + static isErrorNoTelemetry(err) { + return err.name === "CodeExpectedError"; + } +}; +var BugIndicatingError = class _BugIndicatingError extends Error { + constructor(message) { + super(message || "An unexpected bug occurred."); + Object.setPrototypeOf(this, _BugIndicatingError.prototype); + } +}; + +// node_modules/monaco-editor-core/esm/vs/base/common/assert.js +function assertNever(value, message = "Unreachable") { + throw new Error(message); +} +function assert(condition, messageOrError = "unexpected state") { + if (!condition) { + const errorToThrow = typeof messageOrError === "string" ? new BugIndicatingError(`Assertion Failed: ${messageOrError}`) : messageOrError; + throw errorToThrow; + } +} +function assertFn(condition) { + if (!condition()) { + debugger; + condition(); + onUnexpectedError(new BugIndicatingError("Assertion Failed")); + } +} +function checkAdjacentItems(items, predicate) { + let i = 0; + while (i < items.length - 1) { + const a = items[i]; + const b = items[i + 1]; + if (!predicate(a, b)) { + return false; + } + i++; + } + return true; +} + +// node_modules/monaco-editor-core/esm/vs/base/common/types.js +function isString(str) { + return typeof str === "string"; +} +function isIterable(obj) { + return !!obj && typeof obj[Symbol.iterator] === "function"; +} + +// node_modules/monaco-editor-core/esm/vs/base/common/iterator.js +var Iterable; +(function(Iterable2) { + function is(thing) { + return !!thing && typeof thing === "object" && typeof thing[Symbol.iterator] === "function"; + } + Iterable2.is = is; + const _empty2 = Object.freeze([]); + function empty() { + return _empty2; + } + Iterable2.empty = empty; + function* single(element) { + yield element; + } + Iterable2.single = single; + function wrap(iterableOrElement) { + if (is(iterableOrElement)) { + return iterableOrElement; + } else { + return single(iterableOrElement); + } + } + Iterable2.wrap = wrap; + function from(iterable) { + return iterable || _empty2; + } + Iterable2.from = from; + function* reverse(array) { + for (let i = array.length - 1; i >= 0; i--) { + yield array[i]; + } + } + Iterable2.reverse = reverse; + function isEmpty(iterable) { + return !iterable || iterable[Symbol.iterator]().next().done === true; + } + Iterable2.isEmpty = isEmpty; + function first(iterable) { + return iterable[Symbol.iterator]().next().value; + } + Iterable2.first = first; + function some(iterable, predicate) { + let i = 0; + for (const element of iterable) { + if (predicate(element, i++)) { + return true; + } + } + return false; + } + Iterable2.some = some; + function every(iterable, predicate) { + let i = 0; + for (const element of iterable) { + if (!predicate(element, i++)) { + return false; + } + } + return true; + } + Iterable2.every = every; + function find(iterable, predicate) { + for (const element of iterable) { + if (predicate(element)) { + return element; + } + } + return void 0; + } + Iterable2.find = find; + function* filter(iterable, predicate) { + for (const element of iterable) { + if (predicate(element)) { + yield element; + } + } + } + Iterable2.filter = filter; + function* map(iterable, fn) { + let index = 0; + for (const element of iterable) { + yield fn(element, index++); + } + } + Iterable2.map = map; + function* flatMap(iterable, fn) { + let index = 0; + for (const element of iterable) { + yield* fn(element, index++); + } + } + Iterable2.flatMap = flatMap; + function* concat(...iterables) { + for (const item of iterables) { + if (isIterable(item)) { + yield* item; + } else { + yield item; + } + } + } + Iterable2.concat = concat; + function reduce(iterable, reducer, initialValue) { + let value = initialValue; + for (const element of iterable) { + value = reducer(value, element); + } + return value; + } + Iterable2.reduce = reduce; + function length(iterable) { + let count = 0; + for (const _ of iterable) { + count++; + } + return count; + } + Iterable2.length = length; + function* slice(arr, from2, to = arr.length) { + if (from2 < -arr.length) { + from2 = 0; + } + if (from2 < 0) { + from2 += arr.length; + } + if (to < 0) { + to += arr.length; + } else if (to > arr.length) { + to = arr.length; + } + for (; from2 < to; from2++) { + yield arr[from2]; + } + } + Iterable2.slice = slice; + function consume(iterable, atMost = Number.POSITIVE_INFINITY) { + const consumed = []; + if (atMost === 0) { + return [consumed, iterable]; + } + const iterator = iterable[Symbol.iterator](); + for (let i = 0; i < atMost; i++) { + const next = iterator.next(); + if (next.done) { + return [consumed, Iterable2.empty()]; + } + consumed.push(next.value); + } + return [consumed, { [Symbol.iterator]() { + return iterator; + } }]; + } + Iterable2.consume = consume; + async function asyncToArray(iterable) { + const result = []; + for await (const item of iterable) { + result.push(item); + } + return result; + } + Iterable2.asyncToArray = asyncToArray; + async function asyncToArrayFlat(iterable) { + let result = []; + for await (const item of iterable) { + result = result.concat(item); + } + return result; + } + Iterable2.asyncToArrayFlat = asyncToArrayFlat; +})(Iterable || (Iterable = {})); + +// node_modules/monaco-editor-core/esm/vs/base/common/lifecycle.js +var TRACK_DISPOSABLES = false; +var disposableTracker = null; +function setDisposableTracker(tracker) { + disposableTracker = tracker; +} +if (TRACK_DISPOSABLES) { + const __is_disposable_tracked__ = "__is_disposable_tracked__"; + setDisposableTracker(new class { + trackDisposable(x) { + const stack = new Error("Potentially leaked disposable").stack; + setTimeout(() => { + if (!x[__is_disposable_tracked__]) { + console.log(stack); + } + }, 3e3); + } + setParent(child, parent) { + if (child && child !== Disposable.None) { + try { + child[__is_disposable_tracked__] = true; + } catch { + } + } + } + markAsDisposed(disposable) { + if (disposable && disposable !== Disposable.None) { + try { + disposable[__is_disposable_tracked__] = true; + } catch { + } + } + } + markAsSingleton(disposable) { + } + }()); +} +function trackDisposable(x) { + disposableTracker?.trackDisposable(x); + return x; +} +function markAsDisposed(disposable) { + disposableTracker?.markAsDisposed(disposable); +} +function setParentOfDisposable(child, parent) { + disposableTracker?.setParent(child, parent); +} +function setParentOfDisposables(children, parent) { + if (!disposableTracker) { + return; + } + for (const child of children) { + disposableTracker.setParent(child, parent); + } +} +function dispose(arg) { + if (Iterable.is(arg)) { + const errors = []; + for (const d of arg) { + if (d) { + try { + d.dispose(); + } catch (e) { + errors.push(e); + } + } + } + if (errors.length === 1) { + throw errors[0]; + } else if (errors.length > 1) { + throw new AggregateError(errors, "Encountered errors while disposing of store"); + } + return Array.isArray(arg) ? [] : arg; + } else if (arg) { + arg.dispose(); + return arg; + } +} +function combinedDisposable(...disposables) { + const parent = toDisposable(() => dispose(disposables)); + setParentOfDisposables(disposables, parent); + return parent; +} +var FunctionDisposable = class { + constructor(fn) { + this._isDisposed = false; + this._fn = fn; + trackDisposable(this); + } + dispose() { + if (this._isDisposed) { + return; + } + if (!this._fn) { + throw new Error(`Unbound disposable context: Need to use an arrow function to preserve the value of this`); + } + this._isDisposed = true; + markAsDisposed(this); + this._fn(); + } +}; +function toDisposable(fn) { + return new FunctionDisposable(fn); +} +var DisposableStore = class _DisposableStore { + static { + this.DISABLE_DISPOSED_WARNING = false; + } + constructor() { + this._toDispose = /* @__PURE__ */ new Set(); + this._isDisposed = false; + trackDisposable(this); + } + /** + * Dispose of all registered disposables and mark this object as disposed. + * + * Any future disposables added to this object will be disposed of on `add`. + */ + dispose() { + if (this._isDisposed) { + return; + } + markAsDisposed(this); + this._isDisposed = true; + this.clear(); + } + /** + * @return `true` if this object has been disposed of. + */ + get isDisposed() { + return this._isDisposed; + } + /** + * Dispose of all registered disposables but do not mark this object as disposed. + */ + clear() { + if (this._toDispose.size === 0) { + return; + } + try { + dispose(this._toDispose); + } finally { + this._toDispose.clear(); + } + } + /** + * Add a new {@link IDisposable disposable} to the collection. + */ + add(o) { + if (!o || o === Disposable.None) { + return o; + } + if (o === this) { + throw new Error("Cannot register a disposable on itself!"); + } + setParentOfDisposable(o, this); + if (this._isDisposed) { + if (!_DisposableStore.DISABLE_DISPOSED_WARNING) { + console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack); + } + } else { + this._toDispose.add(o); + } + return o; + } + /** + * Deletes a disposable from store and disposes of it. This will not throw or warn and proceed to dispose the + * disposable even when the disposable is not part in the store. + */ + delete(o) { + if (!o) { + return; + } + if (o === this) { + throw new Error("Cannot dispose a disposable on itself!"); + } + this._toDispose.delete(o); + o.dispose(); + } +}; +var Disposable = class { + static { + this.None = Object.freeze({ dispose() { + } }); + } + constructor() { + this._store = new DisposableStore(); + trackDisposable(this); + setParentOfDisposable(this._store, this); + } + dispose() { + markAsDisposed(this); + this._store.dispose(); + } + /** + * Adds `o` to the collection of disposables managed by this object. + */ + _register(o) { + if (o === this) { + throw new Error("Cannot register a disposable on itself!"); + } + return this._store.add(o); + } +}; + +// node_modules/monaco-editor-core/esm/vs/base/common/linkedList.js +var Node = class _Node { + static { + this.Undefined = new _Node(void 0); + } + constructor(element) { + this.element = element; + this.next = _Node.Undefined; + this.prev = _Node.Undefined; + } +}; +var LinkedList = class { + constructor() { + this._first = Node.Undefined; + this._last = Node.Undefined; + this._size = 0; + } + get size() { + return this._size; + } + isEmpty() { + return this._first === Node.Undefined; + } + clear() { + let node = this._first; + while (node !== Node.Undefined) { + const next = node.next; + node.prev = Node.Undefined; + node.next = Node.Undefined; + node = next; + } + this._first = Node.Undefined; + this._last = Node.Undefined; + this._size = 0; + } + unshift(element) { + return this._insert(element, false); + } + push(element) { + return this._insert(element, true); + } + _insert(element, atTheEnd) { + const newNode = new Node(element); + if (this._first === Node.Undefined) { + this._first = newNode; + this._last = newNode; + } else if (atTheEnd) { + const oldLast = this._last; + this._last = newNode; + newNode.prev = oldLast; + oldLast.next = newNode; + } else { + const oldFirst = this._first; + this._first = newNode; + newNode.next = oldFirst; + oldFirst.prev = newNode; + } + this._size += 1; + let didRemove = false; + return () => { + if (!didRemove) { + didRemove = true; + this._remove(newNode); + } + }; + } + shift() { + if (this._first === Node.Undefined) { + return void 0; + } else { + const res = this._first.element; + this._remove(this._first); + return res; + } + } + pop() { + if (this._last === Node.Undefined) { + return void 0; + } else { + const res = this._last.element; + this._remove(this._last); + return res; + } + } + _remove(node) { + if (node.prev !== Node.Undefined && node.next !== Node.Undefined) { + const anchor = node.prev; + anchor.next = node.next; + node.next.prev = anchor; + } else if (node.prev === Node.Undefined && node.next === Node.Undefined) { + this._first = Node.Undefined; + this._last = Node.Undefined; + } else if (node.next === Node.Undefined) { + this._last = this._last.prev; + this._last.next = Node.Undefined; + } else if (node.prev === Node.Undefined) { + this._first = this._first.next; + this._first.prev = Node.Undefined; + } + this._size -= 1; + } + *[Symbol.iterator]() { + let node = this._first; + while (node !== Node.Undefined) { + yield node.element; + node = node.next; + } + } +}; + +// node_modules/monaco-editor-core/esm/vs/base/common/stopwatch.js +var performanceNow = globalThis.performance.now.bind(globalThis.performance); +var StopWatch = class _StopWatch { + static create(highResolution) { + return new _StopWatch(highResolution); + } + constructor(highResolution) { + this._now = highResolution === false ? Date.now : performanceNow; + this._startTime = this._now(); + this._stopTime = -1; + } + stop() { + this._stopTime = this._now(); + } + reset() { + this._startTime = this._now(); + this._stopTime = -1; + } + elapsed() { + if (this._stopTime !== -1) { + return this._stopTime - this._startTime; + } + return this._now() - this._startTime; + } +}; + +// node_modules/monaco-editor-core/esm/vs/base/common/event.js +var _enableDisposeWithListenerWarning = false; +var _enableSnapshotPotentialLeakWarning = false; +var Event; +(function(Event2) { + Event2.None = () => Disposable.None; + function _addLeakageTraceLogic(options) { + if (_enableSnapshotPotentialLeakWarning) { + const { onDidAddListener: origListenerDidAdd } = options; + const stack = Stacktrace.create(); + let count = 0; + options.onDidAddListener = () => { + if (++count === 2) { + console.warn("snapshotted emitter LIKELY used public and SHOULD HAVE BEEN created with DisposableStore. snapshotted here"); + stack.print(); + } + origListenerDidAdd?.(); + }; + } + } + function defer(event, disposable) { + return debounce(event, () => void 0, 0, void 0, true, void 0, disposable); + } + Event2.defer = defer; + function once(event) { + return (listener, thisArgs = null, disposables) => { + let didFire = false; + let result = void 0; + result = event((e) => { + if (didFire) { + return; + } else if (result) { + result.dispose(); + } else { + didFire = true; + } + return listener.call(thisArgs, e); + }, null, disposables); + if (didFire) { + result.dispose(); + } + return result; + }; + } + Event2.once = once; + function onceIf(event, condition) { + return Event2.once(Event2.filter(event, condition)); + } + Event2.onceIf = onceIf; + function map(event, map2, disposable) { + return snapshot((listener, thisArgs = null, disposables) => event((i) => listener.call(thisArgs, map2(i)), null, disposables), disposable); + } + Event2.map = map; + function forEach(event, each, disposable) { + return snapshot((listener, thisArgs = null, disposables) => event((i) => { + each(i); + listener.call(thisArgs, i); + }, null, disposables), disposable); + } + Event2.forEach = forEach; + function filter(event, filter2, disposable) { + return snapshot((listener, thisArgs = null, disposables) => event((e) => filter2(e) && listener.call(thisArgs, e), null, disposables), disposable); + } + Event2.filter = filter; + function signal(event) { + return event; + } + Event2.signal = signal; + function any(...events) { + return (listener, thisArgs = null, disposables) => { + const disposable = combinedDisposable(...events.map((event) => event((e) => listener.call(thisArgs, e)))); + return addAndReturnDisposable(disposable, disposables); + }; + } + Event2.any = any; + function reduce(event, merge, initial, disposable) { + let output = initial; + return map(event, (e) => { + output = merge(output, e); + return output; + }, disposable); + } + Event2.reduce = reduce; + function snapshot(event, disposable) { + let listener; + const options = { + onWillAddFirstListener() { + listener = event(emitter.fire, emitter); + }, + onDidRemoveLastListener() { + listener?.dispose(); + } + }; + if (!disposable) { + _addLeakageTraceLogic(options); + } + const emitter = new Emitter(options); + disposable?.add(emitter); + return emitter.event; + } + function addAndReturnDisposable(d, store) { + if (store instanceof Array) { + store.push(d); + } else if (store) { + store.add(d); + } + return d; + } + function debounce(event, merge, delay = 100, leading = false, flushOnListenerRemove = false, leakWarningThreshold, disposable) { + let subscription; + let output = void 0; + let handle = void 0; + let numDebouncedCalls = 0; + let doFire; + const options = { + leakWarningThreshold, + onWillAddFirstListener() { + subscription = event((cur) => { + numDebouncedCalls++; + output = merge(output, cur); + if (leading && !handle) { + emitter.fire(output); + output = void 0; + } + doFire = () => { + const _output = output; + output = void 0; + handle = void 0; + if (!leading || numDebouncedCalls > 1) { + emitter.fire(_output); + } + numDebouncedCalls = 0; + }; + if (typeof delay === "number") { + if (handle) { + clearTimeout(handle); + } + handle = setTimeout(doFire, delay); + } else { + if (handle === void 0) { + handle = null; + queueMicrotask(doFire); + } + } + }); + }, + onWillRemoveListener() { + if (flushOnListenerRemove && numDebouncedCalls > 0) { + doFire?.(); + } + }, + onDidRemoveLastListener() { + doFire = void 0; + subscription.dispose(); + } + }; + if (!disposable) { + _addLeakageTraceLogic(options); + } + const emitter = new Emitter(options); + disposable?.add(emitter); + return emitter.event; + } + Event2.debounce = debounce; + function accumulate(event, delay = 0, disposable) { + return Event2.debounce(event, (last, e) => { + if (!last) { + return [e]; + } + last.push(e); + return last; + }, delay, void 0, true, void 0, disposable); + } + Event2.accumulate = accumulate; + function latch(event, equals3 = (a, b) => a === b, disposable) { + let firstCall = true; + let cache; + return filter(event, (value) => { + const shouldEmit = firstCall || !equals3(value, cache); + firstCall = false; + cache = value; + return shouldEmit; + }, disposable); + } + Event2.latch = latch; + function split(event, isT, disposable) { + return [ + Event2.filter(event, isT, disposable), + Event2.filter(event, (e) => !isT(e), disposable) + ]; + } + Event2.split = split; + function buffer(event, flushAfterTimeout = false, _buffer = [], disposable) { + let buffer2 = _buffer.slice(); + let listener = event((e) => { + if (buffer2) { + buffer2.push(e); + } else { + emitter.fire(e); + } + }); + if (disposable) { + disposable.add(listener); + } + const flush = () => { + buffer2?.forEach((e) => emitter.fire(e)); + buffer2 = null; + }; + const emitter = new Emitter({ + onWillAddFirstListener() { + if (!listener) { + listener = event((e) => emitter.fire(e)); + if (disposable) { + disposable.add(listener); + } + } + }, + onDidAddFirstListener() { + if (buffer2) { + if (flushAfterTimeout) { + setTimeout(flush); + } else { + flush(); + } + } + }, + onDidRemoveLastListener() { + if (listener) { + listener.dispose(); + } + listener = null; + } + }); + if (disposable) { + disposable.add(emitter); + } + return emitter.event; + } + Event2.buffer = buffer; + function chain(event, sythensize) { + const fn = (listener, thisArgs, disposables) => { + const cs = sythensize(new ChainableSynthesis()); + return event(function(value) { + const result = cs.evaluate(value); + if (result !== HaltChainable) { + listener.call(thisArgs, result); + } + }, void 0, disposables); + }; + return fn; + } + Event2.chain = chain; + const HaltChainable = /* @__PURE__ */ Symbol("HaltChainable"); + class ChainableSynthesis { + constructor() { + this.steps = []; + } + map(fn) { + this.steps.push(fn); + return this; + } + forEach(fn) { + this.steps.push((v) => { + fn(v); + return v; + }); + return this; + } + filter(fn) { + this.steps.push((v) => fn(v) ? v : HaltChainable); + return this; + } + reduce(merge, initial) { + let last = initial; + this.steps.push((v) => { + last = merge(last, v); + return last; + }); + return this; + } + latch(equals3 = (a, b) => a === b) { + let firstCall = true; + let cache; + this.steps.push((value) => { + const shouldEmit = firstCall || !equals3(value, cache); + firstCall = false; + cache = value; + return shouldEmit ? value : HaltChainable; + }); + return this; + } + evaluate(value) { + for (const step of this.steps) { + value = step(value); + if (value === HaltChainable) { + break; + } + } + return value; + } + } + function fromNodeEventEmitter(emitter, eventName, map2 = (id) => id) { + const fn = (...args) => result.fire(map2(...args)); + const onFirstListenerAdd = () => emitter.on(eventName, fn); + const onLastListenerRemove = () => emitter.removeListener(eventName, fn); + const result = new Emitter({ onWillAddFirstListener: onFirstListenerAdd, onDidRemoveLastListener: onLastListenerRemove }); + return result.event; + } + Event2.fromNodeEventEmitter = fromNodeEventEmitter; + function fromDOMEventEmitter(emitter, eventName, map2 = (id) => id) { + const fn = (...args) => result.fire(map2(...args)); + const onFirstListenerAdd = () => emitter.addEventListener(eventName, fn); + const onLastListenerRemove = () => emitter.removeEventListener(eventName, fn); + const result = new Emitter({ onWillAddFirstListener: onFirstListenerAdd, onDidRemoveLastListener: onLastListenerRemove }); + return result.event; + } + Event2.fromDOMEventEmitter = fromDOMEventEmitter; + function toPromise(event, disposables) { + let cancelRef; + const promise = new Promise((resolve2, reject) => { + const listener = once(event)(resolve2, null, disposables); + cancelRef = () => listener.dispose(); + }); + promise.cancel = cancelRef; + return promise; + } + Event2.toPromise = toPromise; + function forward(from, to) { + return from((e) => to.fire(e)); + } + Event2.forward = forward; + function runAndSubscribe(event, handler, initial) { + handler(initial); + return event((e) => handler(e)); + } + Event2.runAndSubscribe = runAndSubscribe; + class EmitterObserver { + constructor(_observable, store) { + this._observable = _observable; + this._counter = 0; + this._hasChanged = false; + const options = { + onWillAddFirstListener: () => { + _observable.addObserver(this); + this._observable.reportChanges(); + }, + onDidRemoveLastListener: () => { + _observable.removeObserver(this); + } + }; + if (!store) { + _addLeakageTraceLogic(options); + } + this.emitter = new Emitter(options); + if (store) { + store.add(this.emitter); + } + } + beginUpdate(_observable) { + this._counter++; + } + handlePossibleChange(_observable) { + } + handleChange(_observable, _change) { + this._hasChanged = true; + } + endUpdate(_observable) { + this._counter--; + if (this._counter === 0) { + this._observable.reportChanges(); + if (this._hasChanged) { + this._hasChanged = false; + this.emitter.fire(this._observable.get()); + } + } + } + } + function fromObservable(obs, store) { + const observer = new EmitterObserver(obs, store); + return observer.emitter.event; + } + Event2.fromObservable = fromObservable; + function fromObservableLight(observable) { + return (listener, thisArgs, disposables) => { + let count = 0; + let didChange = false; + const observer = { + beginUpdate() { + count++; + }, + endUpdate() { + count--; + if (count === 0) { + observable.reportChanges(); + if (didChange) { + didChange = false; + listener.call(thisArgs); + } + } + }, + handlePossibleChange() { + }, + handleChange() { + didChange = true; + } + }; + observable.addObserver(observer); + observable.reportChanges(); + const disposable = { + dispose() { + observable.removeObserver(observer); + } + }; + if (disposables instanceof DisposableStore) { + disposables.add(disposable); + } else if (Array.isArray(disposables)) { + disposables.push(disposable); + } + return disposable; + }; + } + Event2.fromObservableLight = fromObservableLight; +})(Event || (Event = {})); +var EventProfiling = class _EventProfiling { + static { + this.all = /* @__PURE__ */ new Set(); + } + static { + this._idPool = 0; + } + constructor(name) { + this.listenerCount = 0; + this.invocationCount = 0; + this.elapsedOverall = 0; + this.durations = []; + this.name = `${name}_${_EventProfiling._idPool++}`; + _EventProfiling.all.add(this); + } + start(listenerCount) { + this._stopWatch = new StopWatch(); + this.listenerCount = listenerCount; + } + stop() { + if (this._stopWatch) { + const elapsed = this._stopWatch.elapsed(); + this.durations.push(elapsed); + this.elapsedOverall += elapsed; + this.invocationCount += 1; + this._stopWatch = void 0; + } + } +}; +var _globalLeakWarningThreshold = -1; +var LeakageMonitor = class _LeakageMonitor { + static { + this._idPool = 1; + } + constructor(_errorHandler, threshold, name = (_LeakageMonitor._idPool++).toString(16).padStart(3, "0")) { + this._errorHandler = _errorHandler; + this.threshold = threshold; + this.name = name; + this._warnCountdown = 0; + } + dispose() { + this._stacks?.clear(); + } + check(stack, listenerCount) { + const threshold = this.threshold; + if (threshold <= 0 || listenerCount < threshold) { + return void 0; + } + if (!this._stacks) { + this._stacks = /* @__PURE__ */ new Map(); + } + const count = this._stacks.get(stack.value) || 0; + this._stacks.set(stack.value, count + 1); + this._warnCountdown -= 1; + if (this._warnCountdown <= 0) { + this._warnCountdown = threshold * 0.5; + const [topStack, topCount] = this.getMostFrequentStack(); + const message = `[${this.name}] potential listener LEAK detected, having ${listenerCount} listeners already. MOST frequent listener (${topCount}):`; + console.warn(message); + console.warn(topStack); + const error = new ListenerLeakError(message, topStack); + this._errorHandler(error); + } + return () => { + const count2 = this._stacks.get(stack.value) || 0; + this._stacks.set(stack.value, count2 - 1); + }; + } + getMostFrequentStack() { + if (!this._stacks) { + return void 0; + } + let topStack; + let topCount = 0; + for (const [stack, count] of this._stacks) { + if (!topStack || topCount < count) { + topStack = [stack, count]; + topCount = count; + } + } + return topStack; + } +}; +var Stacktrace = class _Stacktrace { + static create() { + const err = new Error(); + return new _Stacktrace(err.stack ?? ""); + } + constructor(value) { + this.value = value; + } + print() { + console.warn(this.value.split("\n").slice(2).join("\n")); + } +}; +var ListenerLeakError = class extends Error { + constructor(message, stack) { + super(message); + this.name = "ListenerLeakError"; + this.stack = stack; + } +}; +var ListenerRefusalError = class extends Error { + constructor(message, stack) { + super(message); + this.name = "ListenerRefusalError"; + this.stack = stack; + } +}; +var UniqueContainer = class { + constructor(value) { + this.value = value; + } +}; +var compactionThreshold = 2; +var forEachListener = (listeners, fn) => { + if (listeners instanceof UniqueContainer) { + fn(listeners); + } else { + for (let i = 0; i < listeners.length; i++) { + const l = listeners[i]; + if (l) { + fn(l); + } + } + } +}; +var Emitter = class { + constructor(options) { + this._size = 0; + this._options = options; + this._leakageMon = _globalLeakWarningThreshold > 0 || this._options?.leakWarningThreshold ? new LeakageMonitor(options?.onListenerError ?? onUnexpectedError, this._options?.leakWarningThreshold ?? _globalLeakWarningThreshold) : void 0; + this._perfMon = this._options?._profName ? new EventProfiling(this._options._profName) : void 0; + this._deliveryQueue = this._options?.deliveryQueue; + } + dispose() { + if (!this._disposed) { + this._disposed = true; + if (this._deliveryQueue?.current === this) { + this._deliveryQueue.reset(); + } + if (this._listeners) { + if (_enableDisposeWithListenerWarning) { + const listeners = this._listeners; + queueMicrotask(() => { + forEachListener(listeners, (l) => l.stack?.print()); + }); + } + this._listeners = void 0; + this._size = 0; + } + this._options?.onDidRemoveLastListener?.(); + this._leakageMon?.dispose(); + } + } + /** + * For the public to allow to subscribe + * to events from this Emitter + */ + get event() { + this._event ??= (callback, thisArgs, disposables) => { + if (this._leakageMon && this._size > this._leakageMon.threshold ** 2) { + const message = `[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`; + console.warn(message); + const tuple = this._leakageMon.getMostFrequentStack() ?? ["UNKNOWN stack", -1]; + const error = new ListenerRefusalError(`${message}. HINT: Stack shows most frequent listener (${tuple[1]}-times)`, tuple[0]); + const errorHandler2 = this._options?.onListenerError || onUnexpectedError; + errorHandler2(error); + return Disposable.None; + } + if (this._disposed) { + return Disposable.None; + } + if (thisArgs) { + callback = callback.bind(thisArgs); + } + const contained = new UniqueContainer(callback); + let removeMonitor; + let stack; + if (this._leakageMon && this._size >= Math.ceil(this._leakageMon.threshold * 0.2)) { + contained.stack = Stacktrace.create(); + removeMonitor = this._leakageMon.check(contained.stack, this._size + 1); + } + if (_enableDisposeWithListenerWarning) { + contained.stack = stack ?? Stacktrace.create(); + } + if (!this._listeners) { + this._options?.onWillAddFirstListener?.(this); + this._listeners = contained; + this._options?.onDidAddFirstListener?.(this); + } else if (this._listeners instanceof UniqueContainer) { + this._deliveryQueue ??= new EventDeliveryQueuePrivate(); + this._listeners = [this._listeners, contained]; + } else { + this._listeners.push(contained); + } + this._options?.onDidAddListener?.(this); + this._size++; + const result = toDisposable(() => { + removeMonitor?.(); + this._removeListener(contained); + }); + if (disposables instanceof DisposableStore) { + disposables.add(result); + } else if (Array.isArray(disposables)) { + disposables.push(result); + } + return result; + }; + return this._event; + } + _removeListener(listener) { + this._options?.onWillRemoveListener?.(this); + if (!this._listeners) { + return; + } + if (this._size === 1) { + this._listeners = void 0; + this._options?.onDidRemoveLastListener?.(this); + this._size = 0; + return; + } + const listeners = this._listeners; + const index = listeners.indexOf(listener); + if (index === -1) { + console.log("disposed?", this._disposed); + console.log("size?", this._size); + console.log("arr?", JSON.stringify(this._listeners)); + throw new Error("Attempted to dispose unknown listener"); + } + this._size--; + listeners[index] = void 0; + const adjustDeliveryQueue = this._deliveryQueue.current === this; + if (this._size * compactionThreshold <= listeners.length) { + let n = 0; + for (let i = 0; i < listeners.length; i++) { + if (listeners[i]) { + listeners[n++] = listeners[i]; + } else if (adjustDeliveryQueue && n < this._deliveryQueue.end) { + this._deliveryQueue.end--; + if (n < this._deliveryQueue.i) { + this._deliveryQueue.i--; + } + } + } + listeners.length = n; + } + } + _deliver(listener, value) { + if (!listener) { + return; + } + const errorHandler2 = this._options?.onListenerError || onUnexpectedError; + if (!errorHandler2) { + listener.value(value); + return; + } + try { + listener.value(value); + } catch (e) { + errorHandler2(e); + } + } + /** Delivers items in the queue. Assumes the queue is ready to go. */ + _deliverQueue(dq) { + const listeners = dq.current._listeners; + while (dq.i < dq.end) { + this._deliver(listeners[dq.i++], dq.value); + } + dq.reset(); + } + /** + * To be kept private to fire an event to + * subscribers + */ + fire(event) { + if (this._deliveryQueue?.current) { + this._deliverQueue(this._deliveryQueue); + this._perfMon?.stop(); + } + this._perfMon?.start(this._size); + if (!this._listeners) { + } else if (this._listeners instanceof UniqueContainer) { + this._deliver(this._listeners, event); + } else { + const dq = this._deliveryQueue; + dq.enqueue(this, event, this._listeners.length); + this._deliverQueue(dq); + } + this._perfMon?.stop(); + } + hasListeners() { + return this._size > 0; + } +}; +var EventDeliveryQueuePrivate = class { + constructor() { + this.i = -1; + this.end = 0; + } + enqueue(emitter, value, end) { + this.i = 0; + this.end = end; + this.current = emitter; + this.value = value; + } + reset() { + this.i = this.end; + this.current = void 0; + this.value = void 0; + } +}; + +// node_modules/monaco-editor-core/esm/vs/nls.messages.js +function getNLSMessages() { + return globalThis._VSCODE_NLS_MESSAGES; +} +function getNLSLanguage() { + return globalThis._VSCODE_NLS_LANGUAGE; +} + +// node_modules/monaco-editor-core/esm/vs/nls.js +var isPseudo = getNLSLanguage() === "pseudo" || typeof document !== "undefined" && document.location && typeof document.location.hash === "string" && document.location.hash.indexOf("pseudo=true") >= 0; +function _format(message, args) { + let result; + if (args.length === 0) { + result = message; + } else { + result = message.replace(/\{(\d+)\}/g, (match, rest) => { + const index = rest[0]; + const arg = args[index]; + let result2 = match; + if (typeof arg === "string") { + result2 = arg; + } else if (typeof arg === "number" || typeof arg === "boolean" || arg === void 0 || arg === null) { + result2 = String(arg); + } + return result2; + }); + } + if (isPseudo) { + result = "\uFF3B" + result.replace(/[aouei]/g, "$&$&") + "\uFF3D"; + } + return result; +} +function localize(data, message, ...args) { + if (typeof data === "number") { + return _format(lookupMessage(data, message), args); + } + return _format(message, args); +} +function lookupMessage(index, fallback) { + const message = getNLSMessages()?.[index]; + if (typeof message !== "string") { + if (typeof fallback === "string") { + return fallback; + } + throw new Error(`!!! NLS MISSING: ${index} !!!`); + } + return message; +} + +// node_modules/monaco-editor-core/esm/vs/base/common/platform.js +var LANGUAGE_DEFAULT = "en"; +var _isWindows = false; +var _isMacintosh = false; +var _isLinux = false; +var _isLinuxSnap = false; +var _isNative = false; +var _isWeb = false; +var _isElectron = false; +var _isIOS = false; +var _isCI = false; +var _isMobile = false; +var _locale = void 0; +var _language = LANGUAGE_DEFAULT; +var _platformLocale = LANGUAGE_DEFAULT; +var _translationsConfigFile = void 0; +var _userAgent = void 0; +var $globalThis = globalThis; +var nodeProcess = void 0; +if (typeof $globalThis.vscode !== "undefined" && typeof $globalThis.vscode.process !== "undefined") { + nodeProcess = $globalThis.vscode.process; +} else if (typeof process !== "undefined" && typeof process?.versions?.node === "string") { + nodeProcess = process; +} +var isElectronProcess = typeof nodeProcess?.versions?.electron === "string"; +var isElectronRenderer = isElectronProcess && nodeProcess?.type === "renderer"; +if (typeof nodeProcess === "object") { + _isWindows = nodeProcess.platform === "win32"; + _isMacintosh = nodeProcess.platform === "darwin"; + _isLinux = nodeProcess.platform === "linux"; + _isLinuxSnap = _isLinux && !!nodeProcess.env["SNAP"] && !!nodeProcess.env["SNAP_REVISION"]; + _isElectron = isElectronProcess; + _isCI = !!nodeProcess.env["CI"] || !!nodeProcess.env["BUILD_ARTIFACTSTAGINGDIRECTORY"] || !!nodeProcess.env["GITHUB_WORKSPACE"]; + _locale = LANGUAGE_DEFAULT; + _language = LANGUAGE_DEFAULT; + const rawNlsConfig = nodeProcess.env["VSCODE_NLS_CONFIG"]; + if (rawNlsConfig) { + try { + const nlsConfig = JSON.parse(rawNlsConfig); + _locale = nlsConfig.userLocale; + _platformLocale = nlsConfig.osLocale; + _language = nlsConfig.resolvedLanguage || LANGUAGE_DEFAULT; + _translationsConfigFile = nlsConfig.languagePack?.translationsConfigFile; + } catch (e) { + } + } + _isNative = true; +} else if (typeof navigator === "object" && !isElectronRenderer) { + _userAgent = navigator.userAgent; + _isWindows = _userAgent.indexOf("Windows") >= 0; + _isMacintosh = _userAgent.indexOf("Macintosh") >= 0; + _isIOS = (_userAgent.indexOf("Macintosh") >= 0 || _userAgent.indexOf("iPad") >= 0 || _userAgent.indexOf("iPhone") >= 0) && !!navigator.maxTouchPoints && navigator.maxTouchPoints > 0; + _isLinux = _userAgent.indexOf("Linux") >= 0; + _isMobile = _userAgent?.indexOf("Mobi") >= 0; + _isWeb = true; + _language = getNLSLanguage() || LANGUAGE_DEFAULT; + _locale = navigator.language.toLowerCase(); + _platformLocale = _locale; +} else { + console.error("Unable to resolve platform."); +} +var _platform = 0; +if (_isMacintosh) { + _platform = 1; +} else if (_isWindows) { + _platform = 3; +} else if (_isLinux) { + _platform = 2; +} +var isWindows = _isWindows; +var isMacintosh = _isMacintosh; +var isWebWorker = _isWeb && typeof $globalThis.importScripts === "function"; +var webWorkerOrigin = isWebWorker ? $globalThis.origin : void 0; +var userAgent = _userAgent; +var setTimeout0IsFaster = typeof $globalThis.postMessage === "function" && !$globalThis.importScripts; +var setTimeout0 = (() => { + if (setTimeout0IsFaster) { + const pending = []; + $globalThis.addEventListener("message", (e) => { + if (e.data && e.data.vscodeScheduleAsyncWork) { + for (let i = 0, len = pending.length; i < len; i++) { + const candidate = pending[i]; + if (candidate.id === e.data.vscodeScheduleAsyncWork) { + pending.splice(i, 1); + candidate.callback(); + return; + } + } + } + }); + let lastId = 0; + return (callback) => { + const myId = ++lastId; + pending.push({ + id: myId, + callback + }); + $globalThis.postMessage({ vscodeScheduleAsyncWork: myId }, "*"); + }; + } + return (callback) => setTimeout(callback); +})(); +var isChrome = !!(userAgent && userAgent.indexOf("Chrome") >= 0); +var isFirefox = !!(userAgent && userAgent.indexOf("Firefox") >= 0); +var isSafari = !!(!isChrome && (userAgent && userAgent.indexOf("Safari") >= 0)); +var isEdge = !!(userAgent && userAgent.indexOf("Edg/") >= 0); +var isAndroid = !!(userAgent && userAgent.indexOf("Android") >= 0); + +// node_modules/monaco-editor-core/esm/vs/base/common/cache.js +function identity(t) { + return t; +} +var LRUCachedFunction = class { + constructor(arg1, arg2) { + this.lastCache = void 0; + this.lastArgKey = void 0; + if (typeof arg1 === "function") { + this._fn = arg1; + this._computeKey = identity; + } else { + this._fn = arg2; + this._computeKey = arg1.getCacheKey; + } + } + get(arg) { + const key = this._computeKey(arg); + if (this.lastArgKey !== key) { + this.lastArgKey = key; + this.lastCache = this._fn(arg); + } + return this.lastCache; + } +}; + +// node_modules/monaco-editor-core/esm/vs/base/common/lazy.js +var LazyValueState; +(function(LazyValueState2) { + LazyValueState2[LazyValueState2["Uninitialized"] = 0] = "Uninitialized"; + LazyValueState2[LazyValueState2["Running"] = 1] = "Running"; + LazyValueState2[LazyValueState2["Completed"] = 2] = "Completed"; +})(LazyValueState || (LazyValueState = {})); +var Lazy = class { + constructor(executor) { + this.executor = executor; + this._state = LazyValueState.Uninitialized; + } + /** + * Get the wrapped value. + * + * This will force evaluation of the lazy value if it has not been resolved yet. Lazy values are only + * resolved once. `getValue` will re-throw exceptions that are hit while resolving the value + */ + get value() { + if (this._state === LazyValueState.Uninitialized) { + this._state = LazyValueState.Running; + try { + this._value = this.executor(); + } catch (err) { + this._error = err; + } finally { + this._state = LazyValueState.Completed; + } + } else if (this._state === LazyValueState.Running) { + throw new Error("Cannot read the value of a lazy that is being initialized"); + } + if (this._error) { + throw this._error; + } + return this._value; + } + /** + * Get the wrapped value without forcing evaluation. + */ + get rawValue() { + return this._value; + } +}; + +// node_modules/monaco-editor-core/esm/vs/base/common/strings.js +function escapeRegExpCharacters(value) { + return value.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g, "\\$&"); +} +function regExpLeadsToEndlessLoop(regexp) { + if (regexp.source === "^" || regexp.source === "^$" || regexp.source === "$" || regexp.source === "^\\s*$") { + return false; + } + const match = regexp.exec(""); + return !!(match && regexp.lastIndex === 0); +} +function splitLines(str) { + return str.split(/\r\n|\r|\n/); +} +function firstNonWhitespaceIndex(str) { + for (let i = 0, len = str.length; i < len; i++) { + const chCode = str.charCodeAt(i); + if (chCode !== 32 && chCode !== 9) { + return i; + } + } + return -1; +} +function lastNonWhitespaceIndex(str, startIndex = str.length - 1) { + for (let i = startIndex; i >= 0; i--) { + const chCode = str.charCodeAt(i); + if (chCode !== 32 && chCode !== 9) { + return i; + } + } + return -1; +} +function isUpperAsciiLetter(code) { + return code >= 65 && code <= 90; +} +function commonPrefixLength(a, b) { + const len = Math.min(a.length, b.length); + let i; + for (i = 0; i < len; i++) { + if (a.charCodeAt(i) !== b.charCodeAt(i)) { + return i; + } + } + return len; +} +function commonSuffixLength(a, b) { + const len = Math.min(a.length, b.length); + let i; + const aLastIndex = a.length - 1; + const bLastIndex = b.length - 1; + for (i = 0; i < len; i++) { + if (a.charCodeAt(aLastIndex - i) !== b.charCodeAt(bLastIndex - i)) { + return i; + } + } + return len; +} +function isHighSurrogate(charCode) { + return 55296 <= charCode && charCode <= 56319; +} +function isLowSurrogate(charCode) { + return 56320 <= charCode && charCode <= 57343; +} +function computeCodePoint(highSurrogate, lowSurrogate) { + return (highSurrogate - 55296 << 10) + (lowSurrogate - 56320) + 65536; +} +function getNextCodePoint(str, len, offset) { + const charCode = str.charCodeAt(offset); + if (isHighSurrogate(charCode) && offset + 1 < len) { + const nextCharCode = str.charCodeAt(offset + 1); + if (isLowSurrogate(nextCharCode)) { + return computeCodePoint(charCode, nextCharCode); + } + } + return charCode; +} +var IS_BASIC_ASCII = /^[\t\n\r\x20-\x7E]*$/; +function isBasicASCII(str) { + return IS_BASIC_ASCII.test(str); +} +var CSI_SEQUENCE = /(?:\x1b\[|\x9b)[=?>!]?[\d;:]*["$#'* ]?[a-zA-Z@^`{}|~]/; +var OSC_SEQUENCE = /(?:\x1b\]|\x9d).*?(?:\x1b\\|\x07|\x9c)/; +var ESC_SEQUENCE = /\x1b(?:[ #%\(\)\*\+\-\.\/]?[a-zA-Z0-9\|}~@])/; +var CONTROL_SEQUENCES = new RegExp("(?:" + [ + CSI_SEQUENCE.source, + OSC_SEQUENCE.source, + ESC_SEQUENCE.source +].join("|") + ")", "g"); +var UTF8_BOM_CHARACTER = String.fromCharCode( + 65279 + /* CharCode.UTF8_BOM */ +); +var GraphemeBreakTree = class _GraphemeBreakTree { + static { + this._INSTANCE = null; + } + static getInstance() { + if (!_GraphemeBreakTree._INSTANCE) { + _GraphemeBreakTree._INSTANCE = new _GraphemeBreakTree(); + } + return _GraphemeBreakTree._INSTANCE; + } + constructor() { + this._data = getGraphemeBreakRawData(); + } + getGraphemeBreakType(codePoint) { + if (codePoint < 32) { + if (codePoint === 10) { + return 3; + } + if (codePoint === 13) { + return 2; + } + return 4; + } + if (codePoint < 127) { + return 0; + } + const data = this._data; + const nodeCount = data.length / 3; + let nodeIndex = 1; + while (nodeIndex <= nodeCount) { + if (codePoint < data[3 * nodeIndex]) { + nodeIndex = 2 * nodeIndex; + } else if (codePoint > data[3 * nodeIndex + 1]) { + nodeIndex = 2 * nodeIndex + 1; + } else { + return data[3 * nodeIndex + 2]; + } + } + return 0; + } +}; +function getGraphemeBreakRawData() { + return JSON.parse("[0,0,0,51229,51255,12,44061,44087,12,127462,127487,6,7083,7085,5,47645,47671,12,54813,54839,12,128678,128678,14,3270,3270,5,9919,9923,14,45853,45879,12,49437,49463,12,53021,53047,12,71216,71218,7,128398,128399,14,129360,129374,14,2519,2519,5,4448,4519,9,9742,9742,14,12336,12336,14,44957,44983,12,46749,46775,12,48541,48567,12,50333,50359,12,52125,52151,12,53917,53943,12,69888,69890,5,73018,73018,5,127990,127990,14,128558,128559,14,128759,128760,14,129653,129655,14,2027,2035,5,2891,2892,7,3761,3761,5,6683,6683,5,8293,8293,4,9825,9826,14,9999,9999,14,43452,43453,5,44509,44535,12,45405,45431,12,46301,46327,12,47197,47223,12,48093,48119,12,48989,49015,12,49885,49911,12,50781,50807,12,51677,51703,12,52573,52599,12,53469,53495,12,54365,54391,12,65279,65279,4,70471,70472,7,72145,72147,7,119173,119179,5,127799,127818,14,128240,128244,14,128512,128512,14,128652,128652,14,128721,128722,14,129292,129292,14,129445,129450,14,129734,129743,14,1476,1477,5,2366,2368,7,2750,2752,7,3076,3076,5,3415,3415,5,4141,4144,5,6109,6109,5,6964,6964,5,7394,7400,5,9197,9198,14,9770,9770,14,9877,9877,14,9968,9969,14,10084,10084,14,43052,43052,5,43713,43713,5,44285,44311,12,44733,44759,12,45181,45207,12,45629,45655,12,46077,46103,12,46525,46551,12,46973,46999,12,47421,47447,12,47869,47895,12,48317,48343,12,48765,48791,12,49213,49239,12,49661,49687,12,50109,50135,12,50557,50583,12,51005,51031,12,51453,51479,12,51901,51927,12,52349,52375,12,52797,52823,12,53245,53271,12,53693,53719,12,54141,54167,12,54589,54615,12,55037,55063,12,69506,69509,5,70191,70193,5,70841,70841,7,71463,71467,5,72330,72342,5,94031,94031,5,123628,123631,5,127763,127765,14,127941,127941,14,128043,128062,14,128302,128317,14,128465,128467,14,128539,128539,14,128640,128640,14,128662,128662,14,128703,128703,14,128745,128745,14,129004,129007,14,129329,129330,14,129402,129402,14,129483,129483,14,129686,129704,14,130048,131069,14,173,173,4,1757,1757,1,2200,2207,5,2434,2435,7,2631,2632,5,2817,2817,5,3008,3008,5,3201,3201,5,3387,3388,5,3542,3542,5,3902,3903,7,4190,4192,5,6002,6003,5,6439,6440,5,6765,6770,7,7019,7027,5,7154,7155,7,8205,8205,13,8505,8505,14,9654,9654,14,9757,9757,14,9792,9792,14,9852,9853,14,9890,9894,14,9937,9937,14,9981,9981,14,10035,10036,14,11035,11036,14,42654,42655,5,43346,43347,7,43587,43587,5,44006,44007,7,44173,44199,12,44397,44423,12,44621,44647,12,44845,44871,12,45069,45095,12,45293,45319,12,45517,45543,12,45741,45767,12,45965,45991,12,46189,46215,12,46413,46439,12,46637,46663,12,46861,46887,12,47085,47111,12,47309,47335,12,47533,47559,12,47757,47783,12,47981,48007,12,48205,48231,12,48429,48455,12,48653,48679,12,48877,48903,12,49101,49127,12,49325,49351,12,49549,49575,12,49773,49799,12,49997,50023,12,50221,50247,12,50445,50471,12,50669,50695,12,50893,50919,12,51117,51143,12,51341,51367,12,51565,51591,12,51789,51815,12,52013,52039,12,52237,52263,12,52461,52487,12,52685,52711,12,52909,52935,12,53133,53159,12,53357,53383,12,53581,53607,12,53805,53831,12,54029,54055,12,54253,54279,12,54477,54503,12,54701,54727,12,54925,54951,12,55149,55175,12,68101,68102,5,69762,69762,7,70067,70069,7,70371,70378,5,70720,70721,7,71087,71087,5,71341,71341,5,71995,71996,5,72249,72249,7,72850,72871,5,73109,73109,5,118576,118598,5,121505,121519,5,127245,127247,14,127568,127569,14,127777,127777,14,127872,127891,14,127956,127967,14,128015,128016,14,128110,128172,14,128259,128259,14,128367,128368,14,128424,128424,14,128488,128488,14,128530,128532,14,128550,128551,14,128566,128566,14,128647,128647,14,128656,128656,14,128667,128673,14,128691,128693,14,128715,128715,14,128728,128732,14,128752,128752,14,128765,128767,14,129096,129103,14,129311,129311,14,129344,129349,14,129394,129394,14,129413,129425,14,129466,129471,14,129511,129535,14,129664,129666,14,129719,129722,14,129760,129767,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2307,2307,7,2382,2383,7,2497,2500,5,2563,2563,7,2677,2677,5,2763,2764,7,2879,2879,5,2914,2915,5,3021,3021,5,3142,3144,5,3263,3263,5,3285,3286,5,3398,3400,7,3530,3530,5,3633,3633,5,3864,3865,5,3974,3975,5,4155,4156,7,4229,4230,5,5909,5909,7,6078,6085,7,6277,6278,5,6451,6456,7,6744,6750,5,6846,6846,5,6972,6972,5,7074,7077,5,7146,7148,7,7222,7223,5,7416,7417,5,8234,8238,4,8417,8417,5,9000,9000,14,9203,9203,14,9730,9731,14,9748,9749,14,9762,9763,14,9776,9783,14,9800,9811,14,9831,9831,14,9872,9873,14,9882,9882,14,9900,9903,14,9929,9933,14,9941,9960,14,9974,9974,14,9989,9989,14,10006,10006,14,10062,10062,14,10160,10160,14,11647,11647,5,12953,12953,14,43019,43019,5,43232,43249,5,43443,43443,5,43567,43568,7,43696,43696,5,43765,43765,7,44013,44013,5,44117,44143,12,44229,44255,12,44341,44367,12,44453,44479,12,44565,44591,12,44677,44703,12,44789,44815,12,44901,44927,12,45013,45039,12,45125,45151,12,45237,45263,12,45349,45375,12,45461,45487,12,45573,45599,12,45685,45711,12,45797,45823,12,45909,45935,12,46021,46047,12,46133,46159,12,46245,46271,12,46357,46383,12,46469,46495,12,46581,46607,12,46693,46719,12,46805,46831,12,46917,46943,12,47029,47055,12,47141,47167,12,47253,47279,12,47365,47391,12,47477,47503,12,47589,47615,12,47701,47727,12,47813,47839,12,47925,47951,12,48037,48063,12,48149,48175,12,48261,48287,12,48373,48399,12,48485,48511,12,48597,48623,12,48709,48735,12,48821,48847,12,48933,48959,12,49045,49071,12,49157,49183,12,49269,49295,12,49381,49407,12,49493,49519,12,49605,49631,12,49717,49743,12,49829,49855,12,49941,49967,12,50053,50079,12,50165,50191,12,50277,50303,12,50389,50415,12,50501,50527,12,50613,50639,12,50725,50751,12,50837,50863,12,50949,50975,12,51061,51087,12,51173,51199,12,51285,51311,12,51397,51423,12,51509,51535,12,51621,51647,12,51733,51759,12,51845,51871,12,51957,51983,12,52069,52095,12,52181,52207,12,52293,52319,12,52405,52431,12,52517,52543,12,52629,52655,12,52741,52767,12,52853,52879,12,52965,52991,12,53077,53103,12,53189,53215,12,53301,53327,12,53413,53439,12,53525,53551,12,53637,53663,12,53749,53775,12,53861,53887,12,53973,53999,12,54085,54111,12,54197,54223,12,54309,54335,12,54421,54447,12,54533,54559,12,54645,54671,12,54757,54783,12,54869,54895,12,54981,55007,12,55093,55119,12,55243,55291,10,66045,66045,5,68325,68326,5,69688,69702,5,69817,69818,5,69957,69958,7,70089,70092,5,70198,70199,5,70462,70462,5,70502,70508,5,70750,70750,5,70846,70846,7,71100,71101,5,71230,71230,7,71351,71351,5,71737,71738,5,72000,72000,7,72160,72160,5,72273,72278,5,72752,72758,5,72882,72883,5,73031,73031,5,73461,73462,7,94192,94193,7,119149,119149,7,121403,121452,5,122915,122916,5,126980,126980,14,127358,127359,14,127535,127535,14,127759,127759,14,127771,127771,14,127792,127793,14,127825,127867,14,127897,127899,14,127945,127945,14,127985,127986,14,128000,128007,14,128021,128021,14,128066,128100,14,128184,128235,14,128249,128252,14,128266,128276,14,128335,128335,14,128379,128390,14,128407,128419,14,128444,128444,14,128481,128481,14,128499,128499,14,128526,128526,14,128536,128536,14,128543,128543,14,128556,128556,14,128564,128564,14,128577,128580,14,128643,128645,14,128649,128649,14,128654,128654,14,128660,128660,14,128664,128664,14,128675,128675,14,128686,128689,14,128695,128696,14,128705,128709,14,128717,128719,14,128725,128725,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129009,129023,14,129160,129167,14,129296,129304,14,129320,129327,14,129340,129342,14,129356,129356,14,129388,129392,14,129399,129400,14,129404,129407,14,129432,129442,14,129454,129455,14,129473,129474,14,129485,129487,14,129648,129651,14,129659,129660,14,129671,129679,14,129709,129711,14,129728,129730,14,129751,129753,14,129776,129782,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2274,2274,1,2363,2363,7,2377,2380,7,2402,2403,5,2494,2494,5,2507,2508,7,2558,2558,5,2622,2624,7,2641,2641,5,2691,2691,7,2759,2760,5,2786,2787,5,2876,2876,5,2881,2884,5,2901,2902,5,3006,3006,5,3014,3016,7,3072,3072,5,3134,3136,5,3157,3158,5,3260,3260,5,3266,3266,5,3274,3275,7,3328,3329,5,3391,3392,7,3405,3405,5,3457,3457,5,3536,3537,7,3551,3551,5,3636,3642,5,3764,3772,5,3895,3895,5,3967,3967,7,3993,4028,5,4146,4151,5,4182,4183,7,4226,4226,5,4253,4253,5,4957,4959,5,5940,5940,7,6070,6070,7,6087,6088,7,6158,6158,4,6432,6434,5,6448,6449,7,6679,6680,5,6742,6742,5,6754,6754,5,6783,6783,5,6912,6915,5,6966,6970,5,6978,6978,5,7042,7042,7,7080,7081,5,7143,7143,7,7150,7150,7,7212,7219,5,7380,7392,5,7412,7412,5,8203,8203,4,8232,8232,4,8265,8265,14,8400,8412,5,8421,8432,5,8617,8618,14,9167,9167,14,9200,9200,14,9410,9410,14,9723,9726,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9774,14,9786,9786,14,9794,9794,14,9823,9823,14,9828,9828,14,9833,9850,14,9855,9855,14,9875,9875,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9935,9935,14,9939,9939,14,9962,9962,14,9972,9972,14,9978,9978,14,9986,9986,14,9997,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10133,10135,14,10548,10549,14,11093,11093,14,12330,12333,5,12441,12442,5,42608,42610,5,43010,43010,5,43045,43046,5,43188,43203,7,43302,43309,5,43392,43394,5,43446,43449,5,43493,43493,5,43571,43572,7,43597,43597,7,43703,43704,5,43756,43757,5,44003,44004,7,44009,44010,7,44033,44059,12,44089,44115,12,44145,44171,12,44201,44227,12,44257,44283,12,44313,44339,12,44369,44395,12,44425,44451,12,44481,44507,12,44537,44563,12,44593,44619,12,44649,44675,12,44705,44731,12,44761,44787,12,44817,44843,12,44873,44899,12,44929,44955,12,44985,45011,12,45041,45067,12,45097,45123,12,45153,45179,12,45209,45235,12,45265,45291,12,45321,45347,12,45377,45403,12,45433,45459,12,45489,45515,12,45545,45571,12,45601,45627,12,45657,45683,12,45713,45739,12,45769,45795,12,45825,45851,12,45881,45907,12,45937,45963,12,45993,46019,12,46049,46075,12,46105,46131,12,46161,46187,12,46217,46243,12,46273,46299,12,46329,46355,12,46385,46411,12,46441,46467,12,46497,46523,12,46553,46579,12,46609,46635,12,46665,46691,12,46721,46747,12,46777,46803,12,46833,46859,12,46889,46915,12,46945,46971,12,47001,47027,12,47057,47083,12,47113,47139,12,47169,47195,12,47225,47251,12,47281,47307,12,47337,47363,12,47393,47419,12,47449,47475,12,47505,47531,12,47561,47587,12,47617,47643,12,47673,47699,12,47729,47755,12,47785,47811,12,47841,47867,12,47897,47923,12,47953,47979,12,48009,48035,12,48065,48091,12,48121,48147,12,48177,48203,12,48233,48259,12,48289,48315,12,48345,48371,12,48401,48427,12,48457,48483,12,48513,48539,12,48569,48595,12,48625,48651,12,48681,48707,12,48737,48763,12,48793,48819,12,48849,48875,12,48905,48931,12,48961,48987,12,49017,49043,12,49073,49099,12,49129,49155,12,49185,49211,12,49241,49267,12,49297,49323,12,49353,49379,12,49409,49435,12,49465,49491,12,49521,49547,12,49577,49603,12,49633,49659,12,49689,49715,12,49745,49771,12,49801,49827,12,49857,49883,12,49913,49939,12,49969,49995,12,50025,50051,12,50081,50107,12,50137,50163,12,50193,50219,12,50249,50275,12,50305,50331,12,50361,50387,12,50417,50443,12,50473,50499,12,50529,50555,12,50585,50611,12,50641,50667,12,50697,50723,12,50753,50779,12,50809,50835,12,50865,50891,12,50921,50947,12,50977,51003,12,51033,51059,12,51089,51115,12,51145,51171,12,51201,51227,12,51257,51283,12,51313,51339,12,51369,51395,12,51425,51451,12,51481,51507,12,51537,51563,12,51593,51619,12,51649,51675,12,51705,51731,12,51761,51787,12,51817,51843,12,51873,51899,12,51929,51955,12,51985,52011,12,52041,52067,12,52097,52123,12,52153,52179,12,52209,52235,12,52265,52291,12,52321,52347,12,52377,52403,12,52433,52459,12,52489,52515,12,52545,52571,12,52601,52627,12,52657,52683,12,52713,52739,12,52769,52795,12,52825,52851,12,52881,52907,12,52937,52963,12,52993,53019,12,53049,53075,12,53105,53131,12,53161,53187,12,53217,53243,12,53273,53299,12,53329,53355,12,53385,53411,12,53441,53467,12,53497,53523,12,53553,53579,12,53609,53635,12,53665,53691,12,53721,53747,12,53777,53803,12,53833,53859,12,53889,53915,12,53945,53971,12,54001,54027,12,54057,54083,12,54113,54139,12,54169,54195,12,54225,54251,12,54281,54307,12,54337,54363,12,54393,54419,12,54449,54475,12,54505,54531,12,54561,54587,12,54617,54643,12,54673,54699,12,54729,54755,12,54785,54811,12,54841,54867,12,54897,54923,12,54953,54979,12,55009,55035,12,55065,55091,12,55121,55147,12,55177,55203,12,65024,65039,5,65520,65528,4,66422,66426,5,68152,68154,5,69291,69292,5,69633,69633,5,69747,69748,5,69811,69814,5,69826,69826,5,69932,69932,7,70016,70017,5,70079,70080,7,70095,70095,5,70196,70196,5,70367,70367,5,70402,70403,7,70464,70464,5,70487,70487,5,70709,70711,7,70725,70725,7,70833,70834,7,70843,70844,7,70849,70849,7,71090,71093,5,71103,71104,5,71227,71228,7,71339,71339,5,71344,71349,5,71458,71461,5,71727,71735,5,71985,71989,7,71998,71998,5,72002,72002,7,72154,72155,5,72193,72202,5,72251,72254,5,72281,72283,5,72344,72345,5,72766,72766,7,72874,72880,5,72885,72886,5,73023,73029,5,73104,73105,5,73111,73111,5,92912,92916,5,94095,94098,5,113824,113827,4,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,125252,125258,5,127183,127183,14,127340,127343,14,127377,127386,14,127491,127503,14,127548,127551,14,127744,127756,14,127761,127761,14,127769,127769,14,127773,127774,14,127780,127788,14,127796,127797,14,127820,127823,14,127869,127869,14,127894,127895,14,127902,127903,14,127943,127943,14,127947,127950,14,127972,127972,14,127988,127988,14,127992,127994,14,128009,128011,14,128019,128019,14,128023,128041,14,128064,128064,14,128102,128107,14,128174,128181,14,128238,128238,14,128246,128247,14,128254,128254,14,128264,128264,14,128278,128299,14,128329,128330,14,128348,128359,14,128371,128377,14,128392,128393,14,128401,128404,14,128421,128421,14,128433,128434,14,128450,128452,14,128476,128478,14,128483,128483,14,128495,128495,14,128506,128506,14,128519,128520,14,128528,128528,14,128534,128534,14,128538,128538,14,128540,128542,14,128544,128549,14,128552,128555,14,128557,128557,14,128560,128563,14,128565,128565,14,128567,128576,14,128581,128591,14,128641,128642,14,128646,128646,14,128648,128648,14,128650,128651,14,128653,128653,14,128655,128655,14,128657,128659,14,128661,128661,14,128663,128663,14,128665,128666,14,128674,128674,14,128676,128677,14,128679,128685,14,128690,128690,14,128694,128694,14,128697,128702,14,128704,128704,14,128710,128714,14,128716,128716,14,128720,128720,14,128723,128724,14,128726,128727,14,128733,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129008,129008,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129661,129663,14,129667,129670,14,129680,129685,14,129705,129708,14,129712,129718,14,129723,129727,14,129731,129733,14,129744,129750,14,129754,129759,14,129768,129775,14,129783,129791,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2192,2193,1,2250,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3132,3132,5,3137,3140,7,3146,3149,5,3170,3171,5,3202,3203,7,3262,3262,7,3264,3265,7,3267,3268,7,3271,3272,7,3276,3277,5,3298,3299,5,3330,3331,7,3390,3390,5,3393,3396,5,3402,3404,7,3406,3406,1,3426,3427,5,3458,3459,7,3535,3535,5,3538,3540,5,3544,3550,7,3570,3571,7,3635,3635,7,3655,3662,5,3763,3763,7,3784,3789,5,3893,3893,5,3897,3897,5,3953,3966,5,3968,3972,5,3981,3991,5,4038,4038,5,4145,4145,7,4153,4154,5,4157,4158,5,4184,4185,5,4209,4212,5,4228,4228,7,4237,4237,5,4352,4447,8,4520,4607,10,5906,5908,5,5938,5939,5,5970,5971,5,6068,6069,5,6071,6077,5,6086,6086,5,6089,6099,5,6155,6157,5,6159,6159,5,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6862,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7679,5,8204,8204,5,8206,8207,4,8233,8233,4,8252,8252,14,8288,8292,4,8294,8303,4,8413,8416,5,8418,8420,5,8482,8482,14,8596,8601,14,8986,8987,14,9096,9096,14,9193,9196,14,9199,9199,14,9201,9202,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9729,14,9732,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9775,9775,14,9784,9785,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9874,14,9876,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9934,14,9936,9936,14,9938,9938,14,9940,9940,14,9961,9961,14,9963,9967,14,9970,9971,14,9973,9973,14,9975,9977,14,9979,9980,14,9982,9985,14,9987,9988,14,9992,9996,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10083,14,10085,10087,14,10145,10145,14,10175,10175,14,11013,11015,14,11088,11088,14,11503,11505,5,11744,11775,5,12334,12335,5,12349,12349,14,12951,12951,14,42607,42607,5,42612,42621,5,42736,42737,5,43014,43014,5,43043,43044,7,43047,43047,7,43136,43137,7,43204,43205,5,43263,43263,5,43335,43345,5,43360,43388,8,43395,43395,7,43444,43445,7,43450,43451,7,43454,43456,7,43561,43566,5,43569,43570,5,43573,43574,5,43596,43596,5,43644,43644,5,43698,43700,5,43710,43711,5,43755,43755,7,43758,43759,7,43766,43766,5,44005,44005,5,44008,44008,5,44012,44012,7,44032,44032,11,44060,44060,11,44088,44088,11,44116,44116,11,44144,44144,11,44172,44172,11,44200,44200,11,44228,44228,11,44256,44256,11,44284,44284,11,44312,44312,11,44340,44340,11,44368,44368,11,44396,44396,11,44424,44424,11,44452,44452,11,44480,44480,11,44508,44508,11,44536,44536,11,44564,44564,11,44592,44592,11,44620,44620,11,44648,44648,11,44676,44676,11,44704,44704,11,44732,44732,11,44760,44760,11,44788,44788,11,44816,44816,11,44844,44844,11,44872,44872,11,44900,44900,11,44928,44928,11,44956,44956,11,44984,44984,11,45012,45012,11,45040,45040,11,45068,45068,11,45096,45096,11,45124,45124,11,45152,45152,11,45180,45180,11,45208,45208,11,45236,45236,11,45264,45264,11,45292,45292,11,45320,45320,11,45348,45348,11,45376,45376,11,45404,45404,11,45432,45432,11,45460,45460,11,45488,45488,11,45516,45516,11,45544,45544,11,45572,45572,11,45600,45600,11,45628,45628,11,45656,45656,11,45684,45684,11,45712,45712,11,45740,45740,11,45768,45768,11,45796,45796,11,45824,45824,11,45852,45852,11,45880,45880,11,45908,45908,11,45936,45936,11,45964,45964,11,45992,45992,11,46020,46020,11,46048,46048,11,46076,46076,11,46104,46104,11,46132,46132,11,46160,46160,11,46188,46188,11,46216,46216,11,46244,46244,11,46272,46272,11,46300,46300,11,46328,46328,11,46356,46356,11,46384,46384,11,46412,46412,11,46440,46440,11,46468,46468,11,46496,46496,11,46524,46524,11,46552,46552,11,46580,46580,11,46608,46608,11,46636,46636,11,46664,46664,11,46692,46692,11,46720,46720,11,46748,46748,11,46776,46776,11,46804,46804,11,46832,46832,11,46860,46860,11,46888,46888,11,46916,46916,11,46944,46944,11,46972,46972,11,47000,47000,11,47028,47028,11,47056,47056,11,47084,47084,11,47112,47112,11,47140,47140,11,47168,47168,11,47196,47196,11,47224,47224,11,47252,47252,11,47280,47280,11,47308,47308,11,47336,47336,11,47364,47364,11,47392,47392,11,47420,47420,11,47448,47448,11,47476,47476,11,47504,47504,11,47532,47532,11,47560,47560,11,47588,47588,11,47616,47616,11,47644,47644,11,47672,47672,11,47700,47700,11,47728,47728,11,47756,47756,11,47784,47784,11,47812,47812,11,47840,47840,11,47868,47868,11,47896,47896,11,47924,47924,11,47952,47952,11,47980,47980,11,48008,48008,11,48036,48036,11,48064,48064,11,48092,48092,11,48120,48120,11,48148,48148,11,48176,48176,11,48204,48204,11,48232,48232,11,48260,48260,11,48288,48288,11,48316,48316,11,48344,48344,11,48372,48372,11,48400,48400,11,48428,48428,11,48456,48456,11,48484,48484,11,48512,48512,11,48540,48540,11,48568,48568,11,48596,48596,11,48624,48624,11,48652,48652,11,48680,48680,11,48708,48708,11,48736,48736,11,48764,48764,11,48792,48792,11,48820,48820,11,48848,48848,11,48876,48876,11,48904,48904,11,48932,48932,11,48960,48960,11,48988,48988,11,49016,49016,11,49044,49044,11,49072,49072,11,49100,49100,11,49128,49128,11,49156,49156,11,49184,49184,11,49212,49212,11,49240,49240,11,49268,49268,11,49296,49296,11,49324,49324,11,49352,49352,11,49380,49380,11,49408,49408,11,49436,49436,11,49464,49464,11,49492,49492,11,49520,49520,11,49548,49548,11,49576,49576,11,49604,49604,11,49632,49632,11,49660,49660,11,49688,49688,11,49716,49716,11,49744,49744,11,49772,49772,11,49800,49800,11,49828,49828,11,49856,49856,11,49884,49884,11,49912,49912,11,49940,49940,11,49968,49968,11,49996,49996,11,50024,50024,11,50052,50052,11,50080,50080,11,50108,50108,11,50136,50136,11,50164,50164,11,50192,50192,11,50220,50220,11,50248,50248,11,50276,50276,11,50304,50304,11,50332,50332,11,50360,50360,11,50388,50388,11,50416,50416,11,50444,50444,11,50472,50472,11,50500,50500,11,50528,50528,11,50556,50556,11,50584,50584,11,50612,50612,11,50640,50640,11,50668,50668,11,50696,50696,11,50724,50724,11,50752,50752,11,50780,50780,11,50808,50808,11,50836,50836,11,50864,50864,11,50892,50892,11,50920,50920,11,50948,50948,11,50976,50976,11,51004,51004,11,51032,51032,11,51060,51060,11,51088,51088,11,51116,51116,11,51144,51144,11,51172,51172,11,51200,51200,11,51228,51228,11,51256,51256,11,51284,51284,11,51312,51312,11,51340,51340,11,51368,51368,11,51396,51396,11,51424,51424,11,51452,51452,11,51480,51480,11,51508,51508,11,51536,51536,11,51564,51564,11,51592,51592,11,51620,51620,11,51648,51648,11,51676,51676,11,51704,51704,11,51732,51732,11,51760,51760,11,51788,51788,11,51816,51816,11,51844,51844,11,51872,51872,11,51900,51900,11,51928,51928,11,51956,51956,11,51984,51984,11,52012,52012,11,52040,52040,11,52068,52068,11,52096,52096,11,52124,52124,11,52152,52152,11,52180,52180,11,52208,52208,11,52236,52236,11,52264,52264,11,52292,52292,11,52320,52320,11,52348,52348,11,52376,52376,11,52404,52404,11,52432,52432,11,52460,52460,11,52488,52488,11,52516,52516,11,52544,52544,11,52572,52572,11,52600,52600,11,52628,52628,11,52656,52656,11,52684,52684,11,52712,52712,11,52740,52740,11,52768,52768,11,52796,52796,11,52824,52824,11,52852,52852,11,52880,52880,11,52908,52908,11,52936,52936,11,52964,52964,11,52992,52992,11,53020,53020,11,53048,53048,11,53076,53076,11,53104,53104,11,53132,53132,11,53160,53160,11,53188,53188,11,53216,53216,11,53244,53244,11,53272,53272,11,53300,53300,11,53328,53328,11,53356,53356,11,53384,53384,11,53412,53412,11,53440,53440,11,53468,53468,11,53496,53496,11,53524,53524,11,53552,53552,11,53580,53580,11,53608,53608,11,53636,53636,11,53664,53664,11,53692,53692,11,53720,53720,11,53748,53748,11,53776,53776,11,53804,53804,11,53832,53832,11,53860,53860,11,53888,53888,11,53916,53916,11,53944,53944,11,53972,53972,11,54000,54000,11,54028,54028,11,54056,54056,11,54084,54084,11,54112,54112,11,54140,54140,11,54168,54168,11,54196,54196,11,54224,54224,11,54252,54252,11,54280,54280,11,54308,54308,11,54336,54336,11,54364,54364,11,54392,54392,11,54420,54420,11,54448,54448,11,54476,54476,11,54504,54504,11,54532,54532,11,54560,54560,11,54588,54588,11,54616,54616,11,54644,54644,11,54672,54672,11,54700,54700,11,54728,54728,11,54756,54756,11,54784,54784,11,54812,54812,11,54840,54840,11,54868,54868,11,54896,54896,11,54924,54924,11,54952,54952,11,54980,54980,11,55008,55008,11,55036,55036,11,55064,55064,11,55092,55092,11,55120,55120,11,55148,55148,11,55176,55176,11,55216,55238,9,64286,64286,5,65056,65071,5,65438,65439,5,65529,65531,4,66272,66272,5,68097,68099,5,68108,68111,5,68159,68159,5,68900,68903,5,69446,69456,5,69632,69632,7,69634,69634,7,69744,69744,5,69759,69761,5,69808,69810,7,69815,69816,7,69821,69821,1,69837,69837,1,69927,69931,5,69933,69940,5,70003,70003,5,70018,70018,7,70070,70078,5,70082,70083,1,70094,70094,7,70188,70190,7,70194,70195,7,70197,70197,7,70206,70206,5,70368,70370,7,70400,70401,5,70459,70460,5,70463,70463,7,70465,70468,7,70475,70477,7,70498,70499,7,70512,70516,5,70712,70719,5,70722,70724,5,70726,70726,5,70832,70832,5,70835,70840,5,70842,70842,5,70845,70845,5,70847,70848,5,70850,70851,5,71088,71089,7,71096,71099,7,71102,71102,7,71132,71133,5,71219,71226,5,71229,71229,5,71231,71232,5,71340,71340,7,71342,71343,7,71350,71350,7,71453,71455,5,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,118528,118573,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123566,123566,5,125136,125142,5,126976,126979,14,126981,127182,14,127184,127231,14,127279,127279,14,127344,127345,14,127374,127374,14,127405,127461,14,127489,127490,14,127514,127514,14,127538,127546,14,127561,127567,14,127570,127743,14,127757,127758,14,127760,127760,14,127762,127762,14,127766,127768,14,127770,127770,14,127772,127772,14,127775,127776,14,127778,127779,14,127789,127791,14,127794,127795,14,127798,127798,14,127819,127819,14,127824,127824,14,127868,127868,14,127870,127871,14,127892,127893,14,127896,127896,14,127900,127901,14,127904,127940,14,127942,127942,14,127944,127944,14,127946,127946,14,127951,127955,14,127968,127971,14,127973,127984,14,127987,127987,14,127989,127989,14,127991,127991,14,127995,127999,5,128008,128008,14,128012,128014,14,128017,128018,14,128020,128020,14,128022,128022,14,128042,128042,14,128063,128063,14,128065,128065,14,128101,128101,14,128108,128109,14,128173,128173,14,128182,128183,14,128236,128237,14,128239,128239,14,128245,128245,14,128248,128248,14,128253,128253,14,128255,128258,14,128260,128263,14,128265,128265,14,128277,128277,14,128300,128301,14,128326,128328,14,128331,128334,14,128336,128347,14,128360,128366,14,128369,128370,14,128378,128378,14,128391,128391,14,128394,128397,14,128400,128400,14,128405,128406,14,128420,128420,14,128422,128423,14,128425,128432,14,128435,128443,14,128445,128449,14,128453,128464,14,128468,128475,14,128479,128480,14,128482,128482,14,128484,128487,14,128489,128494,14,128496,128498,14,128500,128505,14,128507,128511,14,128513,128518,14,128521,128525,14,128527,128527,14,128529,128529,14,128533,128533,14,128535,128535,14,128537,128537,14]"); +} +var AmbiguousCharacters = class _AmbiguousCharacters { + static { + this.ambiguousCharacterData = new Lazy(() => { + return JSON.parse('{"_common":[8232,32,8233,32,5760,32,8192,32,8193,32,8194,32,8195,32,8196,32,8197,32,8198,32,8200,32,8201,32,8202,32,8287,32,8199,32,8239,32,2042,95,65101,95,65102,95,65103,95,8208,45,8209,45,8210,45,65112,45,1748,45,8259,45,727,45,8722,45,10134,45,11450,45,1549,44,1643,44,184,44,42233,44,894,59,2307,58,2691,58,1417,58,1795,58,1796,58,5868,58,65072,58,6147,58,6153,58,8282,58,1475,58,760,58,42889,58,8758,58,720,58,42237,58,451,33,11601,33,660,63,577,63,2429,63,5038,63,42731,63,119149,46,8228,46,1793,46,1794,46,42510,46,68176,46,1632,46,1776,46,42232,46,1373,96,65287,96,8219,96,1523,96,8242,96,1370,96,8175,96,65344,96,900,96,8189,96,8125,96,8127,96,8190,96,697,96,884,96,712,96,714,96,715,96,756,96,699,96,701,96,700,96,702,96,42892,96,1497,96,2036,96,2037,96,5194,96,5836,96,94033,96,94034,96,65339,91,10088,40,10098,40,12308,40,64830,40,65341,93,10089,41,10099,41,12309,41,64831,41,10100,123,119060,123,10101,125,65342,94,8270,42,1645,42,8727,42,66335,42,5941,47,8257,47,8725,47,8260,47,9585,47,10187,47,10744,47,119354,47,12755,47,12339,47,11462,47,20031,47,12035,47,65340,92,65128,92,8726,92,10189,92,10741,92,10745,92,119311,92,119355,92,12756,92,20022,92,12034,92,42872,38,708,94,710,94,5869,43,10133,43,66203,43,8249,60,10094,60,706,60,119350,60,5176,60,5810,60,5120,61,11840,61,12448,61,42239,61,8250,62,10095,62,707,62,119351,62,5171,62,94015,62,8275,126,732,126,8128,126,8764,126,65372,124,65293,45,118002,50,120784,50,120794,50,120804,50,120814,50,120824,50,130034,50,42842,50,423,50,1000,50,42564,50,5311,50,42735,50,119302,51,118003,51,120785,51,120795,51,120805,51,120815,51,120825,51,130035,51,42923,51,540,51,439,51,42858,51,11468,51,1248,51,94011,51,71882,51,118004,52,120786,52,120796,52,120806,52,120816,52,120826,52,130036,52,5070,52,71855,52,118005,53,120787,53,120797,53,120807,53,120817,53,120827,53,130037,53,444,53,71867,53,118006,54,120788,54,120798,54,120808,54,120818,54,120828,54,130038,54,11474,54,5102,54,71893,54,119314,55,118007,55,120789,55,120799,55,120809,55,120819,55,120829,55,130039,55,66770,55,71878,55,2819,56,2538,56,2666,56,125131,56,118008,56,120790,56,120800,56,120810,56,120820,56,120830,56,130040,56,547,56,546,56,66330,56,2663,57,2920,57,2541,57,3437,57,118009,57,120791,57,120801,57,120811,57,120821,57,120831,57,130041,57,42862,57,11466,57,71884,57,71852,57,71894,57,9082,97,65345,97,119834,97,119886,97,119938,97,119990,97,120042,97,120094,97,120146,97,120198,97,120250,97,120302,97,120354,97,120406,97,120458,97,593,97,945,97,120514,97,120572,97,120630,97,120688,97,120746,97,65313,65,117974,65,119808,65,119860,65,119912,65,119964,65,120016,65,120068,65,120120,65,120172,65,120224,65,120276,65,120328,65,120380,65,120432,65,913,65,120488,65,120546,65,120604,65,120662,65,120720,65,5034,65,5573,65,42222,65,94016,65,66208,65,119835,98,119887,98,119939,98,119991,98,120043,98,120095,98,120147,98,120199,98,120251,98,120303,98,120355,98,120407,98,120459,98,388,98,5071,98,5234,98,5551,98,65314,66,8492,66,117975,66,119809,66,119861,66,119913,66,120017,66,120069,66,120121,66,120173,66,120225,66,120277,66,120329,66,120381,66,120433,66,42932,66,914,66,120489,66,120547,66,120605,66,120663,66,120721,66,5108,66,5623,66,42192,66,66178,66,66209,66,66305,66,65347,99,8573,99,119836,99,119888,99,119940,99,119992,99,120044,99,120096,99,120148,99,120200,99,120252,99,120304,99,120356,99,120408,99,120460,99,7428,99,1010,99,11429,99,43951,99,66621,99,128844,67,71913,67,71922,67,65315,67,8557,67,8450,67,8493,67,117976,67,119810,67,119862,67,119914,67,119966,67,120018,67,120174,67,120226,67,120278,67,120330,67,120382,67,120434,67,1017,67,11428,67,5087,67,42202,67,66210,67,66306,67,66581,67,66844,67,8574,100,8518,100,119837,100,119889,100,119941,100,119993,100,120045,100,120097,100,120149,100,120201,100,120253,100,120305,100,120357,100,120409,100,120461,100,1281,100,5095,100,5231,100,42194,100,8558,68,8517,68,117977,68,119811,68,119863,68,119915,68,119967,68,120019,68,120071,68,120123,68,120175,68,120227,68,120279,68,120331,68,120383,68,120435,68,5024,68,5598,68,5610,68,42195,68,8494,101,65349,101,8495,101,8519,101,119838,101,119890,101,119942,101,120046,101,120098,101,120150,101,120202,101,120254,101,120306,101,120358,101,120410,101,120462,101,43826,101,1213,101,8959,69,65317,69,8496,69,117978,69,119812,69,119864,69,119916,69,120020,69,120072,69,120124,69,120176,69,120228,69,120280,69,120332,69,120384,69,120436,69,917,69,120492,69,120550,69,120608,69,120666,69,120724,69,11577,69,5036,69,42224,69,71846,69,71854,69,66182,69,119839,102,119891,102,119943,102,119995,102,120047,102,120099,102,120151,102,120203,102,120255,102,120307,102,120359,102,120411,102,120463,102,43829,102,42905,102,383,102,7837,102,1412,102,119315,70,8497,70,117979,70,119813,70,119865,70,119917,70,120021,70,120073,70,120125,70,120177,70,120229,70,120281,70,120333,70,120385,70,120437,70,42904,70,988,70,120778,70,5556,70,42205,70,71874,70,71842,70,66183,70,66213,70,66853,70,65351,103,8458,103,119840,103,119892,103,119944,103,120048,103,120100,103,120152,103,120204,103,120256,103,120308,103,120360,103,120412,103,120464,103,609,103,7555,103,397,103,1409,103,117980,71,119814,71,119866,71,119918,71,119970,71,120022,71,120074,71,120126,71,120178,71,120230,71,120282,71,120334,71,120386,71,120438,71,1292,71,5056,71,5107,71,42198,71,65352,104,8462,104,119841,104,119945,104,119997,104,120049,104,120101,104,120153,104,120205,104,120257,104,120309,104,120361,104,120413,104,120465,104,1211,104,1392,104,5058,104,65320,72,8459,72,8460,72,8461,72,117981,72,119815,72,119867,72,119919,72,120023,72,120179,72,120231,72,120283,72,120335,72,120387,72,120439,72,919,72,120494,72,120552,72,120610,72,120668,72,120726,72,11406,72,5051,72,5500,72,42215,72,66255,72,731,105,9075,105,65353,105,8560,105,8505,105,8520,105,119842,105,119894,105,119946,105,119998,105,120050,105,120102,105,120154,105,120206,105,120258,105,120310,105,120362,105,120414,105,120466,105,120484,105,618,105,617,105,953,105,8126,105,890,105,120522,105,120580,105,120638,105,120696,105,120754,105,1110,105,42567,105,1231,105,43893,105,5029,105,71875,105,65354,106,8521,106,119843,106,119895,106,119947,106,119999,106,120051,106,120103,106,120155,106,120207,106,120259,106,120311,106,120363,106,120415,106,120467,106,1011,106,1112,106,65322,74,117983,74,119817,74,119869,74,119921,74,119973,74,120025,74,120077,74,120129,74,120181,74,120233,74,120285,74,120337,74,120389,74,120441,74,42930,74,895,74,1032,74,5035,74,5261,74,42201,74,119844,107,119896,107,119948,107,120000,107,120052,107,120104,107,120156,107,120208,107,120260,107,120312,107,120364,107,120416,107,120468,107,8490,75,65323,75,117984,75,119818,75,119870,75,119922,75,119974,75,120026,75,120078,75,120130,75,120182,75,120234,75,120286,75,120338,75,120390,75,120442,75,922,75,120497,75,120555,75,120613,75,120671,75,120729,75,11412,75,5094,75,5845,75,42199,75,66840,75,1472,108,8739,73,9213,73,65512,73,1633,108,1777,73,66336,108,125127,108,118001,108,120783,73,120793,73,120803,73,120813,73,120823,73,130033,73,65321,73,8544,73,8464,73,8465,73,117982,108,119816,73,119868,73,119920,73,120024,73,120128,73,120180,73,120232,73,120284,73,120336,73,120388,73,120440,73,65356,108,8572,73,8467,108,119845,108,119897,108,119949,108,120001,108,120053,108,120105,73,120157,73,120209,73,120261,73,120313,73,120365,73,120417,73,120469,73,448,73,120496,73,120554,73,120612,73,120670,73,120728,73,11410,73,1030,73,1216,73,1493,108,1503,108,1575,108,126464,108,126592,108,65166,108,65165,108,1994,108,11599,73,5825,73,42226,73,93992,73,66186,124,66313,124,119338,76,8556,76,8466,76,117985,76,119819,76,119871,76,119923,76,120027,76,120079,76,120131,76,120183,76,120235,76,120287,76,120339,76,120391,76,120443,76,11472,76,5086,76,5290,76,42209,76,93974,76,71843,76,71858,76,66587,76,66854,76,65325,77,8559,77,8499,77,117986,77,119820,77,119872,77,119924,77,120028,77,120080,77,120132,77,120184,77,120236,77,120288,77,120340,77,120392,77,120444,77,924,77,120499,77,120557,77,120615,77,120673,77,120731,77,1018,77,11416,77,5047,77,5616,77,5846,77,42207,77,66224,77,66321,77,119847,110,119899,110,119951,110,120003,110,120055,110,120107,110,120159,110,120211,110,120263,110,120315,110,120367,110,120419,110,120471,110,1400,110,1404,110,65326,78,8469,78,117987,78,119821,78,119873,78,119925,78,119977,78,120029,78,120081,78,120185,78,120237,78,120289,78,120341,78,120393,78,120445,78,925,78,120500,78,120558,78,120616,78,120674,78,120732,78,11418,78,42208,78,66835,78,3074,111,3202,111,3330,111,3458,111,2406,111,2662,111,2790,111,3046,111,3174,111,3302,111,3430,111,3664,111,3792,111,4160,111,1637,111,1781,111,65359,111,8500,111,119848,111,119900,111,119952,111,120056,111,120108,111,120160,111,120212,111,120264,111,120316,111,120368,111,120420,111,120472,111,7439,111,7441,111,43837,111,959,111,120528,111,120586,111,120644,111,120702,111,120760,111,963,111,120532,111,120590,111,120648,111,120706,111,120764,111,11423,111,4351,111,1413,111,1505,111,1607,111,126500,111,126564,111,126596,111,65259,111,65260,111,65258,111,65257,111,1726,111,64428,111,64429,111,64427,111,64426,111,1729,111,64424,111,64425,111,64423,111,64422,111,1749,111,3360,111,4125,111,66794,111,71880,111,71895,111,66604,111,1984,79,2534,79,2918,79,12295,79,70864,79,71904,79,118000,79,120782,79,120792,79,120802,79,120812,79,120822,79,130032,79,65327,79,117988,79,119822,79,119874,79,119926,79,119978,79,120030,79,120082,79,120134,79,120186,79,120238,79,120290,79,120342,79,120394,79,120446,79,927,79,120502,79,120560,79,120618,79,120676,79,120734,79,11422,79,1365,79,11604,79,4816,79,2848,79,66754,79,42227,79,71861,79,66194,79,66219,79,66564,79,66838,79,9076,112,65360,112,119849,112,119901,112,119953,112,120005,112,120057,112,120109,112,120161,112,120213,112,120265,112,120317,112,120369,112,120421,112,120473,112,961,112,120530,112,120544,112,120588,112,120602,112,120646,112,120660,112,120704,112,120718,112,120762,112,120776,112,11427,112,65328,80,8473,80,117989,80,119823,80,119875,80,119927,80,119979,80,120031,80,120083,80,120187,80,120239,80,120291,80,120343,80,120395,80,120447,80,929,80,120504,80,120562,80,120620,80,120678,80,120736,80,11426,80,5090,80,5229,80,42193,80,66197,80,119850,113,119902,113,119954,113,120006,113,120058,113,120110,113,120162,113,120214,113,120266,113,120318,113,120370,113,120422,113,120474,113,1307,113,1379,113,1382,113,8474,81,117990,81,119824,81,119876,81,119928,81,119980,81,120032,81,120084,81,120188,81,120240,81,120292,81,120344,81,120396,81,120448,81,11605,81,119851,114,119903,114,119955,114,120007,114,120059,114,120111,114,120163,114,120215,114,120267,114,120319,114,120371,114,120423,114,120475,114,43847,114,43848,114,7462,114,11397,114,43905,114,119318,82,8475,82,8476,82,8477,82,117991,82,119825,82,119877,82,119929,82,120033,82,120189,82,120241,82,120293,82,120345,82,120397,82,120449,82,422,82,5025,82,5074,82,66740,82,5511,82,42211,82,94005,82,65363,115,119852,115,119904,115,119956,115,120008,115,120060,115,120112,115,120164,115,120216,115,120268,115,120320,115,120372,115,120424,115,120476,115,42801,115,445,115,1109,115,43946,115,71873,115,66632,115,65331,83,117992,83,119826,83,119878,83,119930,83,119982,83,120034,83,120086,83,120138,83,120190,83,120242,83,120294,83,120346,83,120398,83,120450,83,1029,83,1359,83,5077,83,5082,83,42210,83,94010,83,66198,83,66592,83,119853,116,119905,116,119957,116,120009,116,120061,116,120113,116,120165,116,120217,116,120269,116,120321,116,120373,116,120425,116,120477,116,8868,84,10201,84,128872,84,65332,84,117993,84,119827,84,119879,84,119931,84,119983,84,120035,84,120087,84,120139,84,120191,84,120243,84,120295,84,120347,84,120399,84,120451,84,932,84,120507,84,120565,84,120623,84,120681,84,120739,84,11430,84,5026,84,42196,84,93962,84,71868,84,66199,84,66225,84,66325,84,119854,117,119906,117,119958,117,120010,117,120062,117,120114,117,120166,117,120218,117,120270,117,120322,117,120374,117,120426,117,120478,117,42911,117,7452,117,43854,117,43858,117,651,117,965,117,120534,117,120592,117,120650,117,120708,117,120766,117,1405,117,66806,117,71896,117,8746,85,8899,85,117994,85,119828,85,119880,85,119932,85,119984,85,120036,85,120088,85,120140,85,120192,85,120244,85,120296,85,120348,85,120400,85,120452,85,1357,85,4608,85,66766,85,5196,85,42228,85,94018,85,71864,85,8744,118,8897,118,65366,118,8564,118,119855,118,119907,118,119959,118,120011,118,120063,118,120115,118,120167,118,120219,118,120271,118,120323,118,120375,118,120427,118,120479,118,7456,118,957,118,120526,118,120584,118,120642,118,120700,118,120758,118,1141,118,1496,118,71430,118,43945,118,71872,118,119309,86,1639,86,1783,86,8548,86,117995,86,119829,86,119881,86,119933,86,119985,86,120037,86,120089,86,120141,86,120193,86,120245,86,120297,86,120349,86,120401,86,120453,86,1140,86,11576,86,5081,86,5167,86,42719,86,42214,86,93960,86,71840,86,66845,86,623,119,119856,119,119908,119,119960,119,120012,119,120064,119,120116,119,120168,119,120220,119,120272,119,120324,119,120376,119,120428,119,120480,119,7457,119,1121,119,1309,119,1377,119,71434,119,71438,119,71439,119,43907,119,71910,87,71919,87,117996,87,119830,87,119882,87,119934,87,119986,87,120038,87,120090,87,120142,87,120194,87,120246,87,120298,87,120350,87,120402,87,120454,87,1308,87,5043,87,5076,87,42218,87,5742,120,10539,120,10540,120,10799,120,65368,120,8569,120,119857,120,119909,120,119961,120,120013,120,120065,120,120117,120,120169,120,120221,120,120273,120,120325,120,120377,120,120429,120,120481,120,5441,120,5501,120,5741,88,9587,88,66338,88,71916,88,65336,88,8553,88,117997,88,119831,88,119883,88,119935,88,119987,88,120039,88,120091,88,120143,88,120195,88,120247,88,120299,88,120351,88,120403,88,120455,88,42931,88,935,88,120510,88,120568,88,120626,88,120684,88,120742,88,11436,88,11613,88,5815,88,42219,88,66192,88,66228,88,66327,88,66855,88,611,121,7564,121,65369,121,119858,121,119910,121,119962,121,120014,121,120066,121,120118,121,120170,121,120222,121,120274,121,120326,121,120378,121,120430,121,120482,121,655,121,7935,121,43866,121,947,121,8509,121,120516,121,120574,121,120632,121,120690,121,120748,121,1199,121,4327,121,71900,121,65337,89,117998,89,119832,89,119884,89,119936,89,119988,89,120040,89,120092,89,120144,89,120196,89,120248,89,120300,89,120352,89,120404,89,120456,89,933,89,978,89,120508,89,120566,89,120624,89,120682,89,120740,89,11432,89,1198,89,5033,89,5053,89,42220,89,94019,89,71844,89,66226,89,119859,122,119911,122,119963,122,120015,122,120067,122,120119,122,120171,122,120223,122,120275,122,120327,122,120379,122,120431,122,120483,122,7458,122,43923,122,71876,122,71909,90,66293,90,65338,90,8484,90,8488,90,117999,90,119833,90,119885,90,119937,90,119989,90,120041,90,120197,90,120249,90,120301,90,120353,90,120405,90,120457,90,918,90,120493,90,120551,90,120609,90,120667,90,120725,90,5059,90,42204,90,71849,90,65282,34,65283,35,65284,36,65285,37,65286,38,65290,42,65291,43,65294,46,65295,47,65296,48,65298,50,65299,51,65300,52,65301,53,65302,54,65303,55,65304,56,65305,57,65308,60,65309,61,65310,62,65312,64,65316,68,65318,70,65319,71,65324,76,65329,81,65330,82,65333,85,65334,86,65335,87,65343,95,65346,98,65348,100,65350,102,65355,107,65357,109,65358,110,65361,113,65362,114,65364,116,65365,117,65367,119,65370,122,65371,123,65373,125,119846,109],"_default":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"cs":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"de":[65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"es":[8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"fr":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"it":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"ja":[8211,45,8218,44,65281,33,8216,96,8245,96,180,96,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65292,44,65297,49,65307,59],"ko":[8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"pl":[65374,126,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"pt-BR":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"qps-ploc":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"ru":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,305,105,921,73,1009,112,215,120,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"tr":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"zh-hans":[160,32,65374,126,8218,44,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65297,49],"zh-hant":[8211,45,65374,126,8218,44,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89]}'); + }); + } + static { + this.cache = new LRUCachedFunction({ getCacheKey: JSON.stringify }, (locales) => { + function arrayToMap(arr) { + const result = /* @__PURE__ */ new Map(); + for (let i = 0; i < arr.length; i += 2) { + result.set(arr[i], arr[i + 1]); + } + return result; + } + function mergeMaps(map1, map2) { + const result = new Map(map1); + for (const [key, value] of map2) { + result.set(key, value); + } + return result; + } + function intersectMaps(map1, map2) { + if (!map1) { + return map2; + } + const result = /* @__PURE__ */ new Map(); + for (const [key, value] of map1) { + if (map2.has(key)) { + result.set(key, value); + } + } + return result; + } + const data = this.ambiguousCharacterData.value; + let filteredLocales = locales.filter((l) => !l.startsWith("_") && Object.hasOwn(data, l)); + if (filteredLocales.length === 0) { + filteredLocales = ["_default"]; + } + let languageSpecificMap = void 0; + for (const locale of filteredLocales) { + const map2 = arrayToMap(data[locale]); + languageSpecificMap = intersectMaps(languageSpecificMap, map2); + } + const commonMap = arrayToMap(data["_common"]); + const map = mergeMaps(commonMap, languageSpecificMap); + return new _AmbiguousCharacters(map); + }); + } + static getInstance(locales) { + return _AmbiguousCharacters.cache.get(Array.from(locales)); + } + static { + this._locales = new Lazy(() => Object.keys(_AmbiguousCharacters.ambiguousCharacterData.value).filter((k) => !k.startsWith("_"))); + } + static getLocales() { + return _AmbiguousCharacters._locales.value; + } + constructor(confusableDictionary) { + this.confusableDictionary = confusableDictionary; + } + isAmbiguous(codePoint) { + return this.confusableDictionary.has(codePoint); + } + /** + * Returns the non basic ASCII code point that the given code point can be confused, + * or undefined if such code point does note exist. + */ + getPrimaryConfusable(codePoint) { + return this.confusableDictionary.get(codePoint); + } + getConfusableCodePoints() { + return new Set(this.confusableDictionary.keys()); + } +}; +var InvisibleCharacters = class _InvisibleCharacters { + static getRawData() { + return JSON.parse('{"_common":[11,12,13,127,847,1564,4447,4448,6068,6069,6155,6156,6157,6158,7355,7356,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8204,8205,8206,8207,8234,8235,8236,8237,8238,8239,8287,8288,8289,8290,8291,8292,8293,8294,8295,8296,8297,8298,8299,8300,8301,8302,8303,10240,12644,65024,65025,65026,65027,65028,65029,65030,65031,65032,65033,65034,65035,65036,65037,65038,65039,65279,65440,65520,65521,65522,65523,65524,65525,65526,65527,65528,65532,78844,119155,119156,119157,119158,119159,119160,119161,119162,917504,917505,917506,917507,917508,917509,917510,917511,917512,917513,917514,917515,917516,917517,917518,917519,917520,917521,917522,917523,917524,917525,917526,917527,917528,917529,917530,917531,917532,917533,917534,917535,917536,917537,917538,917539,917540,917541,917542,917543,917544,917545,917546,917547,917548,917549,917550,917551,917552,917553,917554,917555,917556,917557,917558,917559,917560,917561,917562,917563,917564,917565,917566,917567,917568,917569,917570,917571,917572,917573,917574,917575,917576,917577,917578,917579,917580,917581,917582,917583,917584,917585,917586,917587,917588,917589,917590,917591,917592,917593,917594,917595,917596,917597,917598,917599,917600,917601,917602,917603,917604,917605,917606,917607,917608,917609,917610,917611,917612,917613,917614,917615,917616,917617,917618,917619,917620,917621,917622,917623,917624,917625,917626,917627,917628,917629,917630,917631,917760,917761,917762,917763,917764,917765,917766,917767,917768,917769,917770,917771,917772,917773,917774,917775,917776,917777,917778,917779,917780,917781,917782,917783,917784,917785,917786,917787,917788,917789,917790,917791,917792,917793,917794,917795,917796,917797,917798,917799,917800,917801,917802,917803,917804,917805,917806,917807,917808,917809,917810,917811,917812,917813,917814,917815,917816,917817,917818,917819,917820,917821,917822,917823,917824,917825,917826,917827,917828,917829,917830,917831,917832,917833,917834,917835,917836,917837,917838,917839,917840,917841,917842,917843,917844,917845,917846,917847,917848,917849,917850,917851,917852,917853,917854,917855,917856,917857,917858,917859,917860,917861,917862,917863,917864,917865,917866,917867,917868,917869,917870,917871,917872,917873,917874,917875,917876,917877,917878,917879,917880,917881,917882,917883,917884,917885,917886,917887,917888,917889,917890,917891,917892,917893,917894,917895,917896,917897,917898,917899,917900,917901,917902,917903,917904,917905,917906,917907,917908,917909,917910,917911,917912,917913,917914,917915,917916,917917,917918,917919,917920,917921,917922,917923,917924,917925,917926,917927,917928,917929,917930,917931,917932,917933,917934,917935,917936,917937,917938,917939,917940,917941,917942,917943,917944,917945,917946,917947,917948,917949,917950,917951,917952,917953,917954,917955,917956,917957,917958,917959,917960,917961,917962,917963,917964,917965,917966,917967,917968,917969,917970,917971,917972,917973,917974,917975,917976,917977,917978,917979,917980,917981,917982,917983,917984,917985,917986,917987,917988,917989,917990,917991,917992,917993,917994,917995,917996,917997,917998,917999],"cs":[173,8203,12288],"de":[173,8203,12288],"es":[8203,12288],"fr":[173,8203,12288],"it":[160,173,12288],"ja":[173],"ko":[173,12288],"pl":[173,8203,12288],"pt-BR":[173,8203,12288],"qps-ploc":[160,173,8203,12288],"ru":[173,12288],"tr":[160,173,8203,12288],"zh-hans":[160,173,8203,12288],"zh-hant":[173,12288]}'); + } + static { + this._data = void 0; + } + static getData() { + if (!this._data) { + this._data = new Set([...Object.values(_InvisibleCharacters.getRawData())].flat()); + } + return this._data; + } + static isInvisibleCharacter(codePoint) { + return _InvisibleCharacters.getData().has(codePoint); + } + static get codePoints() { + return _InvisibleCharacters.getData(); + } +}; + +// node_modules/monaco-editor-core/esm/vs/base/common/worker/webWorker.js +var DEFAULT_CHANNEL = "default"; +var INITIALIZE = "$initialize"; +var RequestMessage = class { + constructor(vsWorker, req, channel, method, args) { + this.vsWorker = vsWorker; + this.req = req; + this.channel = channel; + this.method = method; + this.args = args; + this.type = 0; + } +}; +var ReplyMessage = class { + constructor(vsWorker, seq, res, err) { + this.vsWorker = vsWorker; + this.seq = seq; + this.res = res; + this.err = err; + this.type = 1; + } +}; +var SubscribeEventMessage = class { + constructor(vsWorker, req, channel, eventName, arg) { + this.vsWorker = vsWorker; + this.req = req; + this.channel = channel; + this.eventName = eventName; + this.arg = arg; + this.type = 2; + } +}; +var EventMessage = class { + constructor(vsWorker, req, event) { + this.vsWorker = vsWorker; + this.req = req; + this.event = event; + this.type = 3; + } +}; +var UnsubscribeEventMessage = class { + constructor(vsWorker, req) { + this.vsWorker = vsWorker; + this.req = req; + this.type = 4; + } +}; +var WebWorkerProtocol = class { + constructor(handler) { + this._workerId = -1; + this._handler = handler; + this._lastSentReq = 0; + this._pendingReplies = /* @__PURE__ */ Object.create(null); + this._pendingEmitters = /* @__PURE__ */ new Map(); + this._pendingEvents = /* @__PURE__ */ new Map(); + } + setWorkerId(workerId) { + this._workerId = workerId; + } + async sendMessage(channel, method, args) { + const req = String(++this._lastSentReq); + return new Promise((resolve2, reject) => { + this._pendingReplies[req] = { + resolve: resolve2, + reject + }; + this._send(new RequestMessage(this._workerId, req, channel, method, args)); + }); + } + listen(channel, eventName, arg) { + let req = null; + const emitter = new Emitter({ + onWillAddFirstListener: () => { + req = String(++this._lastSentReq); + this._pendingEmitters.set(req, emitter); + this._send(new SubscribeEventMessage(this._workerId, req, channel, eventName, arg)); + }, + onDidRemoveLastListener: () => { + this._pendingEmitters.delete(req); + this._send(new UnsubscribeEventMessage(this._workerId, req)); + req = null; + } + }); + return emitter.event; + } + handleMessage(message) { + if (!message || !message.vsWorker) { + return; + } + if (this._workerId !== -1 && message.vsWorker !== this._workerId) { + return; + } + this._handleMessage(message); + } + createProxyToRemoteChannel(channel, sendMessageBarrier) { + const handler = { + get: (target, name) => { + if (typeof name === "string" && !target[name]) { + if (propertyIsDynamicEvent(name)) { + target[name] = (arg) => { + return this.listen(channel, name, arg); + }; + } else if (propertyIsEvent(name)) { + target[name] = this.listen(channel, name, void 0); + } else if (name.charCodeAt(0) === 36) { + target[name] = async (...myArgs) => { + await sendMessageBarrier?.(); + return this.sendMessage(channel, name, myArgs); + }; + } + } + return target[name]; + } + }; + return new Proxy(/* @__PURE__ */ Object.create(null), handler); + } + _handleMessage(msg) { + switch (msg.type) { + case 1: + return this._handleReplyMessage(msg); + case 0: + return this._handleRequestMessage(msg); + case 2: + return this._handleSubscribeEventMessage(msg); + case 3: + return this._handleEventMessage(msg); + case 4: + return this._handleUnsubscribeEventMessage(msg); + } + } + _handleReplyMessage(replyMessage) { + if (!this._pendingReplies[replyMessage.seq]) { + console.warn("Got reply to unknown seq"); + return; + } + const reply = this._pendingReplies[replyMessage.seq]; + delete this._pendingReplies[replyMessage.seq]; + if (replyMessage.err) { + let err = replyMessage.err; + if (replyMessage.err.$isError) { + const newErr = new Error(); + newErr.name = replyMessage.err.name; + newErr.message = replyMessage.err.message; + newErr.stack = replyMessage.err.stack; + err = newErr; + } + reply.reject(err); + return; + } + reply.resolve(replyMessage.res); + } + _handleRequestMessage(requestMessage) { + const req = requestMessage.req; + const result = this._handler.handleMessage(requestMessage.channel, requestMessage.method, requestMessage.args); + result.then((r) => { + this._send(new ReplyMessage(this._workerId, req, r, void 0)); + }, (e) => { + if (e.detail instanceof Error) { + e.detail = transformErrorForSerialization(e.detail); + } + this._send(new ReplyMessage(this._workerId, req, void 0, transformErrorForSerialization(e))); + }); + } + _handleSubscribeEventMessage(msg) { + const req = msg.req; + const disposable = this._handler.handleEvent(msg.channel, msg.eventName, msg.arg)((event) => { + this._send(new EventMessage(this._workerId, req, event)); + }); + this._pendingEvents.set(req, disposable); + } + _handleEventMessage(msg) { + if (!this._pendingEmitters.has(msg.req)) { + console.warn("Got event for unknown req"); + return; + } + this._pendingEmitters.get(msg.req).fire(msg.event); + } + _handleUnsubscribeEventMessage(msg) { + if (!this._pendingEvents.has(msg.req)) { + console.warn("Got unsubscribe for unknown req"); + return; + } + this._pendingEvents.get(msg.req).dispose(); + this._pendingEvents.delete(msg.req); + } + _send(msg) { + const transfer = []; + if (msg.type === 0) { + for (let i = 0; i < msg.args.length; i++) { + const arg = msg.args[i]; + if (arg instanceof ArrayBuffer) { + transfer.push(arg); + } + } + } else if (msg.type === 1) { + if (msg.res instanceof ArrayBuffer) { + transfer.push(msg.res); + } + } + this._handler.sendMessage(msg, transfer); + } +}; +function propertyIsEvent(name) { + return name[0] === "o" && name[1] === "n" && isUpperAsciiLetter(name.charCodeAt(2)); +} +function propertyIsDynamicEvent(name) { + return /^onDynamic/.test(name) && isUpperAsciiLetter(name.charCodeAt(9)); +} +var WebWorkerServer = class { + constructor(postMessage, requestHandlerFactory) { + this._localChannels = /* @__PURE__ */ new Map(); + this._remoteChannels = /* @__PURE__ */ new Map(); + this._protocol = new WebWorkerProtocol({ + sendMessage: (msg, transfer) => { + postMessage(msg, transfer); + }, + handleMessage: (channel, method, args) => this._handleMessage(channel, method, args), + handleEvent: (channel, eventName, arg) => this._handleEvent(channel, eventName, arg) + }); + this.requestHandler = requestHandlerFactory(this); + } + onmessage(msg) { + this._protocol.handleMessage(msg); + } + _handleMessage(channel, method, args) { + if (channel === DEFAULT_CHANNEL && method === INITIALIZE) { + return this.initialize(args[0]); + } + const requestHandler = channel === DEFAULT_CHANNEL ? this.requestHandler : this._localChannels.get(channel); + if (!requestHandler) { + return Promise.reject(new Error(`Missing channel ${channel} on worker thread`)); + } + const fn = requestHandler[method]; + if (typeof fn !== "function") { + return Promise.reject(new Error(`Missing method ${method} on worker thread channel ${channel}`)); + } + try { + return Promise.resolve(fn.apply(requestHandler, args)); + } catch (e) { + return Promise.reject(e); + } + } + _handleEvent(channel, eventName, arg) { + const requestHandler = channel === DEFAULT_CHANNEL ? this.requestHandler : this._localChannels.get(channel); + if (!requestHandler) { + throw new Error(`Missing channel ${channel} on worker thread`); + } + if (propertyIsDynamicEvent(eventName)) { + const fn = requestHandler[eventName]; + if (typeof fn !== "function") { + throw new Error(`Missing dynamic event ${eventName} on request handler.`); + } + const event = fn.call(requestHandler, arg); + if (typeof event !== "function") { + throw new Error(`Missing dynamic event ${eventName} on request handler.`); + } + return event; + } + if (propertyIsEvent(eventName)) { + const event = requestHandler[eventName]; + if (typeof event !== "function") { + throw new Error(`Missing event ${eventName} on request handler.`); + } + return event; + } + throw new Error(`Malformed event name ${eventName}`); + } + getChannel(channel) { + if (!this._remoteChannels.has(channel)) { + const inst = this._protocol.createProxyToRemoteChannel(channel); + this._remoteChannels.set(channel, inst); + } + return this._remoteChannels.get(channel); + } + async initialize(workerId) { + this._protocol.setWorkerId(workerId); + } +}; + +// node_modules/monaco-editor-core/esm/vs/base/common/worker/webWorkerBootstrap.js +var initialized = false; +function initialize(factory) { + if (initialized) { + throw new Error("WebWorker already initialized!"); + } + initialized = true; + const webWorkerServer = new WebWorkerServer((msg) => globalThis.postMessage(msg), (workerServer) => factory(workerServer)); + globalThis.onmessage = (e) => { + webWorkerServer.onmessage(e.data); + }; + return webWorkerServer; +} + +// node_modules/monaco-editor-core/esm/vs/base/common/diff/diffChange.js +var DiffChange = class { + /** + * Constructs a new DiffChange with the given sequence information + * and content. + */ + constructor(originalStart, originalLength, modifiedStart, modifiedLength) { + this.originalStart = originalStart; + this.originalLength = originalLength; + this.modifiedStart = modifiedStart; + this.modifiedLength = modifiedLength; + } + /** + * The end point (exclusive) of the change in the original sequence. + */ + getOriginalEnd() { + return this.originalStart + this.originalLength; + } + /** + * The end point (exclusive) of the change in the modified sequence. + */ + getModifiedEnd() { + return this.modifiedStart + this.modifiedLength; + } +}; + +// node_modules/monaco-editor-core/esm/vs/base/common/buffer.js +var hasBuffer = typeof Buffer !== "undefined"; +var indexOfTable = new Lazy(() => new Uint8Array(256)); +var textDecoder; +var VSBuffer = class _VSBuffer { + /** + * When running in a nodejs context, if `actual` is not a nodejs Buffer, the backing store for + * the returned `VSBuffer` instance might use a nodejs Buffer allocated from node's Buffer pool, + * which is not transferrable. + */ + static wrap(actual) { + if (hasBuffer && !Buffer.isBuffer(actual)) { + actual = Buffer.from(actual.buffer, actual.byteOffset, actual.byteLength); + } + return new _VSBuffer(actual); + } + constructor(buffer) { + this.buffer = buffer; + this.byteLength = this.buffer.byteLength; + } + toString() { + if (hasBuffer) { + return this.buffer.toString(); + } else { + if (!textDecoder) { + textDecoder = new TextDecoder(); + } + return textDecoder.decode(this.buffer); + } + } +}; +var hexChars = "0123456789abcdef"; +function encodeHex({ buffer }) { + let result = ""; + for (let i = 0; i < buffer.length; i++) { + const byte = buffer[i]; + result += hexChars[byte >>> 4]; + result += hexChars[byte & 15]; + } + return result; +} + +// node_modules/monaco-editor-core/esm/vs/base/common/hash.js +function numberHash(val, initialHashVal) { + return (initialHashVal << 5) - initialHashVal + val | 0; +} +function stringHash(s, hashVal) { + hashVal = numberHash(149417, hashVal); + for (let i = 0, length = s.length; i < length; i++) { + hashVal = numberHash(s.charCodeAt(i), hashVal); + } + return hashVal; +} +function leftRotate(value, bits, totalBits = 32) { + const delta = totalBits - bits; + const mask = ~((1 << delta) - 1); + return (value << bits | (mask & value) >>> delta) >>> 0; +} +function toHexString(bufferOrValue, bitsize = 32) { + if (bufferOrValue instanceof ArrayBuffer) { + return encodeHex(VSBuffer.wrap(new Uint8Array(bufferOrValue))); + } + return (bufferOrValue >>> 0).toString(16).padStart(bitsize / 4, "0"); +} +var StringSHA1 = class _StringSHA1 { + static { + this._bigBlock32 = new DataView(new ArrayBuffer(320)); + } + // 80 * 4 = 320 + constructor() { + this._h0 = 1732584193; + this._h1 = 4023233417; + this._h2 = 2562383102; + this._h3 = 271733878; + this._h4 = 3285377520; + this._buff = new Uint8Array( + 64 + 3 + /* to fit any utf-8 */ + ); + this._buffDV = new DataView(this._buff.buffer); + this._buffLen = 0; + this._totalLen = 0; + this._leftoverHighSurrogate = 0; + this._finished = false; + } + update(str) { + const strLen = str.length; + if (strLen === 0) { + return; + } + const buff = this._buff; + let buffLen = this._buffLen; + let leftoverHighSurrogate = this._leftoverHighSurrogate; + let charCode; + let offset; + if (leftoverHighSurrogate !== 0) { + charCode = leftoverHighSurrogate; + offset = -1; + leftoverHighSurrogate = 0; + } else { + charCode = str.charCodeAt(0); + offset = 0; + } + while (true) { + let codePoint = charCode; + if (isHighSurrogate(charCode)) { + if (offset + 1 < strLen) { + const nextCharCode = str.charCodeAt(offset + 1); + if (isLowSurrogate(nextCharCode)) { + offset++; + codePoint = computeCodePoint(charCode, nextCharCode); + } else { + codePoint = 65533; + } + } else { + leftoverHighSurrogate = charCode; + break; + } + } else if (isLowSurrogate(charCode)) { + codePoint = 65533; + } + buffLen = this._push(buff, buffLen, codePoint); + offset++; + if (offset < strLen) { + charCode = str.charCodeAt(offset); + } else { + break; + } + } + this._buffLen = buffLen; + this._leftoverHighSurrogate = leftoverHighSurrogate; + } + _push(buff, buffLen, codePoint) { + if (codePoint < 128) { + buff[buffLen++] = codePoint; + } else if (codePoint < 2048) { + buff[buffLen++] = 192 | (codePoint & 1984) >>> 6; + buff[buffLen++] = 128 | (codePoint & 63) >>> 0; + } else if (codePoint < 65536) { + buff[buffLen++] = 224 | (codePoint & 61440) >>> 12; + buff[buffLen++] = 128 | (codePoint & 4032) >>> 6; + buff[buffLen++] = 128 | (codePoint & 63) >>> 0; + } else { + buff[buffLen++] = 240 | (codePoint & 1835008) >>> 18; + buff[buffLen++] = 128 | (codePoint & 258048) >>> 12; + buff[buffLen++] = 128 | (codePoint & 4032) >>> 6; + buff[buffLen++] = 128 | (codePoint & 63) >>> 0; + } + if (buffLen >= 64) { + this._step(); + buffLen -= 64; + this._totalLen += 64; + buff[0] = buff[64 + 0]; + buff[1] = buff[64 + 1]; + buff[2] = buff[64 + 2]; + } + return buffLen; + } + digest() { + if (!this._finished) { + this._finished = true; + if (this._leftoverHighSurrogate) { + this._leftoverHighSurrogate = 0; + this._buffLen = this._push( + this._buff, + this._buffLen, + 65533 + /* SHA1Constant.UNICODE_REPLACEMENT */ + ); + } + this._totalLen += this._buffLen; + this._wrapUp(); + } + return toHexString(this._h0) + toHexString(this._h1) + toHexString(this._h2) + toHexString(this._h3) + toHexString(this._h4); + } + _wrapUp() { + this._buff[this._buffLen++] = 128; + this._buff.subarray(this._buffLen).fill(0); + if (this._buffLen > 56) { + this._step(); + this._buff.fill(0); + } + const ml = 8 * this._totalLen; + this._buffDV.setUint32(56, Math.floor(ml / 4294967296), false); + this._buffDV.setUint32(60, ml % 4294967296, false); + this._step(); + } + _step() { + const bigBlock32 = _StringSHA1._bigBlock32; + const data = this._buffDV; + for (let j = 0; j < 64; j += 4) { + bigBlock32.setUint32(j, data.getUint32(j, false), false); + } + for (let j = 64; j < 320; j += 4) { + bigBlock32.setUint32(j, leftRotate(bigBlock32.getUint32(j - 12, false) ^ bigBlock32.getUint32(j - 32, false) ^ bigBlock32.getUint32(j - 56, false) ^ bigBlock32.getUint32(j - 64, false), 1), false); + } + let a = this._h0; + let b = this._h1; + let c = this._h2; + let d = this._h3; + let e = this._h4; + let f, k; + let temp; + for (let j = 0; j < 80; j++) { + if (j < 20) { + f = b & c | ~b & d; + k = 1518500249; + } else if (j < 40) { + f = b ^ c ^ d; + k = 1859775393; + } else if (j < 60) { + f = b & c | b & d | c & d; + k = 2400959708; + } else { + f = b ^ c ^ d; + k = 3395469782; + } + temp = leftRotate(a, 5) + f + e + k + bigBlock32.getUint32(j * 4, false) & 4294967295; + e = d; + d = c; + c = leftRotate(b, 30); + b = a; + a = temp; + } + this._h0 = this._h0 + a & 4294967295; + this._h1 = this._h1 + b & 4294967295; + this._h2 = this._h2 + c & 4294967295; + this._h3 = this._h3 + d & 4294967295; + this._h4 = this._h4 + e & 4294967295; + } +}; + +// node_modules/monaco-editor-core/esm/vs/base/common/diff/diff.js +var StringDiffSequence = class { + constructor(source) { + this.source = source; + } + getElements() { + const source = this.source; + const characters = new Int32Array(source.length); + for (let i = 0, len = source.length; i < len; i++) { + characters[i] = source.charCodeAt(i); + } + return characters; + } +}; +function stringDiff(original, modified, pretty) { + return new LcsDiff(new StringDiffSequence(original), new StringDiffSequence(modified)).ComputeDiff(pretty).changes; +} +var Debug = class { + static Assert(condition, message) { + if (!condition) { + throw new Error(message); + } + } +}; +var MyArray = class { + /** + * Copies a range of elements from an Array starting at the specified source index and pastes + * them to another Array starting at the specified destination index. The length and the indexes + * are specified as 64-bit integers. + * sourceArray: + * The Array that contains the data to copy. + * sourceIndex: + * A 64-bit integer that represents the index in the sourceArray at which copying begins. + * destinationArray: + * The Array that receives the data. + * destinationIndex: + * A 64-bit integer that represents the index in the destinationArray at which storing begins. + * length: + * A 64-bit integer that represents the number of elements to copy. + */ + static Copy(sourceArray, sourceIndex, destinationArray, destinationIndex, length) { + for (let i = 0; i < length; i++) { + destinationArray[destinationIndex + i] = sourceArray[sourceIndex + i]; + } + } + static Copy2(sourceArray, sourceIndex, destinationArray, destinationIndex, length) { + for (let i = 0; i < length; i++) { + destinationArray[destinationIndex + i] = sourceArray[sourceIndex + i]; + } + } +}; +var DiffChangeHelper = class { + /** + * Constructs a new DiffChangeHelper for the given DiffSequences. + */ + constructor() { + this.m_changes = []; + this.m_originalStart = 1073741824; + this.m_modifiedStart = 1073741824; + this.m_originalCount = 0; + this.m_modifiedCount = 0; + } + /** + * Marks the beginning of the next change in the set of differences. + */ + MarkNextChange() { + if (this.m_originalCount > 0 || this.m_modifiedCount > 0) { + this.m_changes.push(new DiffChange(this.m_originalStart, this.m_originalCount, this.m_modifiedStart, this.m_modifiedCount)); + } + this.m_originalCount = 0; + this.m_modifiedCount = 0; + this.m_originalStart = 1073741824; + this.m_modifiedStart = 1073741824; + } + /** + * Adds the original element at the given position to the elements + * affected by the current change. The modified index gives context + * to the change position with respect to the original sequence. + * @param originalIndex The index of the original element to add. + * @param modifiedIndex The index of the modified element that provides corresponding position in the modified sequence. + */ + AddOriginalElement(originalIndex, modifiedIndex) { + this.m_originalStart = Math.min(this.m_originalStart, originalIndex); + this.m_modifiedStart = Math.min(this.m_modifiedStart, modifiedIndex); + this.m_originalCount++; + } + /** + * Adds the modified element at the given position to the elements + * affected by the current change. The original index gives context + * to the change position with respect to the modified sequence. + * @param originalIndex The index of the original element that provides corresponding position in the original sequence. + * @param modifiedIndex The index of the modified element to add. + */ + AddModifiedElement(originalIndex, modifiedIndex) { + this.m_originalStart = Math.min(this.m_originalStart, originalIndex); + this.m_modifiedStart = Math.min(this.m_modifiedStart, modifiedIndex); + this.m_modifiedCount++; + } + /** + * Retrieves all of the changes marked by the class. + */ + getChanges() { + if (this.m_originalCount > 0 || this.m_modifiedCount > 0) { + this.MarkNextChange(); + } + return this.m_changes; + } + /** + * Retrieves all of the changes marked by the class in the reverse order + */ + getReverseChanges() { + if (this.m_originalCount > 0 || this.m_modifiedCount > 0) { + this.MarkNextChange(); + } + this.m_changes.reverse(); + return this.m_changes; + } +}; +var LcsDiff = class _LcsDiff { + /** + * Constructs the DiffFinder + */ + constructor(originalSequence, modifiedSequence, continueProcessingPredicate = null) { + this.ContinueProcessingPredicate = continueProcessingPredicate; + this._originalSequence = originalSequence; + this._modifiedSequence = modifiedSequence; + const [originalStringElements, originalElementsOrHash, originalHasStrings] = _LcsDiff._getElements(originalSequence); + const [modifiedStringElements, modifiedElementsOrHash, modifiedHasStrings] = _LcsDiff._getElements(modifiedSequence); + this._hasStrings = originalHasStrings && modifiedHasStrings; + this._originalStringElements = originalStringElements; + this._originalElementsOrHash = originalElementsOrHash; + this._modifiedStringElements = modifiedStringElements; + this._modifiedElementsOrHash = modifiedElementsOrHash; + this.m_forwardHistory = []; + this.m_reverseHistory = []; + } + static _isStringArray(arr) { + return arr.length > 0 && typeof arr[0] === "string"; + } + static _getElements(sequence) { + const elements = sequence.getElements(); + if (_LcsDiff._isStringArray(elements)) { + const hashes = new Int32Array(elements.length); + for (let i = 0, len = elements.length; i < len; i++) { + hashes[i] = stringHash(elements[i], 0); + } + return [elements, hashes, true]; + } + if (elements instanceof Int32Array) { + return [[], elements, false]; + } + return [[], new Int32Array(elements), false]; + } + ElementsAreEqual(originalIndex, newIndex) { + if (this._originalElementsOrHash[originalIndex] !== this._modifiedElementsOrHash[newIndex]) { + return false; + } + return this._hasStrings ? this._originalStringElements[originalIndex] === this._modifiedStringElements[newIndex] : true; + } + ElementsAreStrictEqual(originalIndex, newIndex) { + if (!this.ElementsAreEqual(originalIndex, newIndex)) { + return false; + } + const originalElement = _LcsDiff._getStrictElement(this._originalSequence, originalIndex); + const modifiedElement = _LcsDiff._getStrictElement(this._modifiedSequence, newIndex); + return originalElement === modifiedElement; + } + static _getStrictElement(sequence, index) { + if (typeof sequence.getStrictElement === "function") { + return sequence.getStrictElement(index); + } + return null; + } + OriginalElementsAreEqual(index1, index2) { + if (this._originalElementsOrHash[index1] !== this._originalElementsOrHash[index2]) { + return false; + } + return this._hasStrings ? this._originalStringElements[index1] === this._originalStringElements[index2] : true; + } + ModifiedElementsAreEqual(index1, index2) { + if (this._modifiedElementsOrHash[index1] !== this._modifiedElementsOrHash[index2]) { + return false; + } + return this._hasStrings ? this._modifiedStringElements[index1] === this._modifiedStringElements[index2] : true; + } + ComputeDiff(pretty) { + return this._ComputeDiff(0, this._originalElementsOrHash.length - 1, 0, this._modifiedElementsOrHash.length - 1, pretty); + } + /** + * Computes the differences between the original and modified input + * sequences on the bounded range. + * @returns An array of the differences between the two input sequences. + */ + _ComputeDiff(originalStart, originalEnd, modifiedStart, modifiedEnd, pretty) { + const quitEarlyArr = [false]; + let changes = this.ComputeDiffRecursive(originalStart, originalEnd, modifiedStart, modifiedEnd, quitEarlyArr); + if (pretty) { + changes = this.PrettifyChanges(changes); + } + return { + quitEarly: quitEarlyArr[0], + changes + }; + } + /** + * Private helper method which computes the differences on the bounded range + * recursively. + * @returns An array of the differences between the two input sequences. + */ + ComputeDiffRecursive(originalStart, originalEnd, modifiedStart, modifiedEnd, quitEarlyArr) { + quitEarlyArr[0] = false; + while (originalStart <= originalEnd && modifiedStart <= modifiedEnd && this.ElementsAreEqual(originalStart, modifiedStart)) { + originalStart++; + modifiedStart++; + } + while (originalEnd >= originalStart && modifiedEnd >= modifiedStart && this.ElementsAreEqual(originalEnd, modifiedEnd)) { + originalEnd--; + modifiedEnd--; + } + if (originalStart > originalEnd || modifiedStart > modifiedEnd) { + let changes; + if (modifiedStart <= modifiedEnd) { + Debug.Assert(originalStart === originalEnd + 1, "originalStart should only be one more than originalEnd"); + changes = [ + new DiffChange(originalStart, 0, modifiedStart, modifiedEnd - modifiedStart + 1) + ]; + } else if (originalStart <= originalEnd) { + Debug.Assert(modifiedStart === modifiedEnd + 1, "modifiedStart should only be one more than modifiedEnd"); + changes = [ + new DiffChange(originalStart, originalEnd - originalStart + 1, modifiedStart, 0) + ]; + } else { + Debug.Assert(originalStart === originalEnd + 1, "originalStart should only be one more than originalEnd"); + Debug.Assert(modifiedStart === modifiedEnd + 1, "modifiedStart should only be one more than modifiedEnd"); + changes = []; + } + return changes; + } + const midOriginalArr = [0]; + const midModifiedArr = [0]; + const result = this.ComputeRecursionPoint(originalStart, originalEnd, modifiedStart, modifiedEnd, midOriginalArr, midModifiedArr, quitEarlyArr); + const midOriginal = midOriginalArr[0]; + const midModified = midModifiedArr[0]; + if (result !== null) { + return result; + } else if (!quitEarlyArr[0]) { + const leftChanges = this.ComputeDiffRecursive(originalStart, midOriginal, modifiedStart, midModified, quitEarlyArr); + let rightChanges = []; + if (!quitEarlyArr[0]) { + rightChanges = this.ComputeDiffRecursive(midOriginal + 1, originalEnd, midModified + 1, modifiedEnd, quitEarlyArr); + } else { + rightChanges = [ + new DiffChange(midOriginal + 1, originalEnd - (midOriginal + 1) + 1, midModified + 1, modifiedEnd - (midModified + 1) + 1) + ]; + } + return this.ConcatenateChanges(leftChanges, rightChanges); + } + return [ + new DiffChange(originalStart, originalEnd - originalStart + 1, modifiedStart, modifiedEnd - modifiedStart + 1) + ]; + } + WALKTRACE(diagonalForwardBase, diagonalForwardStart, diagonalForwardEnd, diagonalForwardOffset, diagonalReverseBase, diagonalReverseStart, diagonalReverseEnd, diagonalReverseOffset, forwardPoints, reversePoints, originalIndex, originalEnd, midOriginalArr, modifiedIndex, modifiedEnd, midModifiedArr, deltaIsEven, quitEarlyArr) { + let forwardChanges = null; + let reverseChanges = null; + let changeHelper = new DiffChangeHelper(); + let diagonalMin = diagonalForwardStart; + let diagonalMax = diagonalForwardEnd; + let diagonalRelative = midOriginalArr[0] - midModifiedArr[0] - diagonalForwardOffset; + let lastOriginalIndex = -1073741824; + let historyIndex = this.m_forwardHistory.length - 1; + do { + const diagonal = diagonalRelative + diagonalForwardBase; + if (diagonal === diagonalMin || diagonal < diagonalMax && forwardPoints[diagonal - 1] < forwardPoints[diagonal + 1]) { + originalIndex = forwardPoints[diagonal + 1]; + modifiedIndex = originalIndex - diagonalRelative - diagonalForwardOffset; + if (originalIndex < lastOriginalIndex) { + changeHelper.MarkNextChange(); + } + lastOriginalIndex = originalIndex; + changeHelper.AddModifiedElement(originalIndex + 1, modifiedIndex); + diagonalRelative = diagonal + 1 - diagonalForwardBase; + } else { + originalIndex = forwardPoints[diagonal - 1] + 1; + modifiedIndex = originalIndex - diagonalRelative - diagonalForwardOffset; + if (originalIndex < lastOriginalIndex) { + changeHelper.MarkNextChange(); + } + lastOriginalIndex = originalIndex - 1; + changeHelper.AddOriginalElement(originalIndex, modifiedIndex + 1); + diagonalRelative = diagonal - 1 - diagonalForwardBase; + } + if (historyIndex >= 0) { + forwardPoints = this.m_forwardHistory[historyIndex]; + diagonalForwardBase = forwardPoints[0]; + diagonalMin = 1; + diagonalMax = forwardPoints.length - 1; + } + } while (--historyIndex >= -1); + forwardChanges = changeHelper.getReverseChanges(); + if (quitEarlyArr[0]) { + let originalStartPoint = midOriginalArr[0] + 1; + let modifiedStartPoint = midModifiedArr[0] + 1; + if (forwardChanges !== null && forwardChanges.length > 0) { + const lastForwardChange = forwardChanges[forwardChanges.length - 1]; + originalStartPoint = Math.max(originalStartPoint, lastForwardChange.getOriginalEnd()); + modifiedStartPoint = Math.max(modifiedStartPoint, lastForwardChange.getModifiedEnd()); + } + reverseChanges = [ + new DiffChange(originalStartPoint, originalEnd - originalStartPoint + 1, modifiedStartPoint, modifiedEnd - modifiedStartPoint + 1) + ]; + } else { + changeHelper = new DiffChangeHelper(); + diagonalMin = diagonalReverseStart; + diagonalMax = diagonalReverseEnd; + diagonalRelative = midOriginalArr[0] - midModifiedArr[0] - diagonalReverseOffset; + lastOriginalIndex = 1073741824; + historyIndex = deltaIsEven ? this.m_reverseHistory.length - 1 : this.m_reverseHistory.length - 2; + do { + const diagonal = diagonalRelative + diagonalReverseBase; + if (diagonal === diagonalMin || diagonal < diagonalMax && reversePoints[diagonal - 1] >= reversePoints[diagonal + 1]) { + originalIndex = reversePoints[diagonal + 1] - 1; + modifiedIndex = originalIndex - diagonalRelative - diagonalReverseOffset; + if (originalIndex > lastOriginalIndex) { + changeHelper.MarkNextChange(); + } + lastOriginalIndex = originalIndex + 1; + changeHelper.AddOriginalElement(originalIndex + 1, modifiedIndex + 1); + diagonalRelative = diagonal + 1 - diagonalReverseBase; + } else { + originalIndex = reversePoints[diagonal - 1]; + modifiedIndex = originalIndex - diagonalRelative - diagonalReverseOffset; + if (originalIndex > lastOriginalIndex) { + changeHelper.MarkNextChange(); + } + lastOriginalIndex = originalIndex; + changeHelper.AddModifiedElement(originalIndex + 1, modifiedIndex + 1); + diagonalRelative = diagonal - 1 - diagonalReverseBase; + } + if (historyIndex >= 0) { + reversePoints = this.m_reverseHistory[historyIndex]; + diagonalReverseBase = reversePoints[0]; + diagonalMin = 1; + diagonalMax = reversePoints.length - 1; + } + } while (--historyIndex >= -1); + reverseChanges = changeHelper.getChanges(); + } + return this.ConcatenateChanges(forwardChanges, reverseChanges); + } + /** + * Given the range to compute the diff on, this method finds the point: + * (midOriginal, midModified) + * that exists in the middle of the LCS of the two sequences and + * is the point at which the LCS problem may be broken down recursively. + * This method will try to keep the LCS trace in memory. If the LCS recursion + * point is calculated and the full trace is available in memory, then this method + * will return the change list. + * @param originalStart The start bound of the original sequence range + * @param originalEnd The end bound of the original sequence range + * @param modifiedStart The start bound of the modified sequence range + * @param modifiedEnd The end bound of the modified sequence range + * @param midOriginal The middle point of the original sequence range + * @param midModified The middle point of the modified sequence range + * @returns The diff changes, if available, otherwise null + */ + ComputeRecursionPoint(originalStart, originalEnd, modifiedStart, modifiedEnd, midOriginalArr, midModifiedArr, quitEarlyArr) { + let originalIndex = 0, modifiedIndex = 0; + let diagonalForwardStart = 0, diagonalForwardEnd = 0; + let diagonalReverseStart = 0, diagonalReverseEnd = 0; + originalStart--; + modifiedStart--; + midOriginalArr[0] = 0; + midModifiedArr[0] = 0; + this.m_forwardHistory = []; + this.m_reverseHistory = []; + const maxDifferences = originalEnd - originalStart + (modifiedEnd - modifiedStart); + const numDiagonals = maxDifferences + 1; + const forwardPoints = new Int32Array(numDiagonals); + const reversePoints = new Int32Array(numDiagonals); + const diagonalForwardBase = modifiedEnd - modifiedStart; + const diagonalReverseBase = originalEnd - originalStart; + const diagonalForwardOffset = originalStart - modifiedStart; + const diagonalReverseOffset = originalEnd - modifiedEnd; + const delta = diagonalReverseBase - diagonalForwardBase; + const deltaIsEven = delta % 2 === 0; + forwardPoints[diagonalForwardBase] = originalStart; + reversePoints[diagonalReverseBase] = originalEnd; + quitEarlyArr[0] = false; + for (let numDifferences = 1; numDifferences <= maxDifferences / 2 + 1; numDifferences++) { + let furthestOriginalIndex = 0; + let furthestModifiedIndex = 0; + diagonalForwardStart = this.ClipDiagonalBound(diagonalForwardBase - numDifferences, numDifferences, diagonalForwardBase, numDiagonals); + diagonalForwardEnd = this.ClipDiagonalBound(diagonalForwardBase + numDifferences, numDifferences, diagonalForwardBase, numDiagonals); + for (let diagonal = diagonalForwardStart; diagonal <= diagonalForwardEnd; diagonal += 2) { + if (diagonal === diagonalForwardStart || diagonal < diagonalForwardEnd && forwardPoints[diagonal - 1] < forwardPoints[diagonal + 1]) { + originalIndex = forwardPoints[diagonal + 1]; + } else { + originalIndex = forwardPoints[diagonal - 1] + 1; + } + modifiedIndex = originalIndex - (diagonal - diagonalForwardBase) - diagonalForwardOffset; + const tempOriginalIndex = originalIndex; + while (originalIndex < originalEnd && modifiedIndex < modifiedEnd && this.ElementsAreEqual(originalIndex + 1, modifiedIndex + 1)) { + originalIndex++; + modifiedIndex++; + } + forwardPoints[diagonal] = originalIndex; + if (originalIndex + modifiedIndex > furthestOriginalIndex + furthestModifiedIndex) { + furthestOriginalIndex = originalIndex; + furthestModifiedIndex = modifiedIndex; + } + if (!deltaIsEven && Math.abs(diagonal - diagonalReverseBase) <= numDifferences - 1) { + if (originalIndex >= reversePoints[diagonal]) { + midOriginalArr[0] = originalIndex; + midModifiedArr[0] = modifiedIndex; + if (tempOriginalIndex <= reversePoints[diagonal] && 1447 > 0 && numDifferences <= 1447 + 1) { + return this.WALKTRACE(diagonalForwardBase, diagonalForwardStart, diagonalForwardEnd, diagonalForwardOffset, diagonalReverseBase, diagonalReverseStart, diagonalReverseEnd, diagonalReverseOffset, forwardPoints, reversePoints, originalIndex, originalEnd, midOriginalArr, modifiedIndex, modifiedEnd, midModifiedArr, deltaIsEven, quitEarlyArr); + } else { + return null; + } + } + } + } + const matchLengthOfLongest = (furthestOriginalIndex - originalStart + (furthestModifiedIndex - modifiedStart) - numDifferences) / 2; + if (this.ContinueProcessingPredicate !== null && !this.ContinueProcessingPredicate(furthestOriginalIndex, matchLengthOfLongest)) { + quitEarlyArr[0] = true; + midOriginalArr[0] = furthestOriginalIndex; + midModifiedArr[0] = furthestModifiedIndex; + if (matchLengthOfLongest > 0 && 1447 > 0 && numDifferences <= 1447 + 1) { + return this.WALKTRACE(diagonalForwardBase, diagonalForwardStart, diagonalForwardEnd, diagonalForwardOffset, diagonalReverseBase, diagonalReverseStart, diagonalReverseEnd, diagonalReverseOffset, forwardPoints, reversePoints, originalIndex, originalEnd, midOriginalArr, modifiedIndex, modifiedEnd, midModifiedArr, deltaIsEven, quitEarlyArr); + } else { + originalStart++; + modifiedStart++; + return [ + new DiffChange(originalStart, originalEnd - originalStart + 1, modifiedStart, modifiedEnd - modifiedStart + 1) + ]; + } + } + diagonalReverseStart = this.ClipDiagonalBound(diagonalReverseBase - numDifferences, numDifferences, diagonalReverseBase, numDiagonals); + diagonalReverseEnd = this.ClipDiagonalBound(diagonalReverseBase + numDifferences, numDifferences, diagonalReverseBase, numDiagonals); + for (let diagonal = diagonalReverseStart; diagonal <= diagonalReverseEnd; diagonal += 2) { + if (diagonal === diagonalReverseStart || diagonal < diagonalReverseEnd && reversePoints[diagonal - 1] >= reversePoints[diagonal + 1]) { + originalIndex = reversePoints[diagonal + 1] - 1; + } else { + originalIndex = reversePoints[diagonal - 1]; + } + modifiedIndex = originalIndex - (diagonal - diagonalReverseBase) - diagonalReverseOffset; + const tempOriginalIndex = originalIndex; + while (originalIndex > originalStart && modifiedIndex > modifiedStart && this.ElementsAreEqual(originalIndex, modifiedIndex)) { + originalIndex--; + modifiedIndex--; + } + reversePoints[diagonal] = originalIndex; + if (deltaIsEven && Math.abs(diagonal - diagonalForwardBase) <= numDifferences) { + if (originalIndex <= forwardPoints[diagonal]) { + midOriginalArr[0] = originalIndex; + midModifiedArr[0] = modifiedIndex; + if (tempOriginalIndex >= forwardPoints[diagonal] && 1447 > 0 && numDifferences <= 1447 + 1) { + return this.WALKTRACE(diagonalForwardBase, diagonalForwardStart, diagonalForwardEnd, diagonalForwardOffset, diagonalReverseBase, diagonalReverseStart, diagonalReverseEnd, diagonalReverseOffset, forwardPoints, reversePoints, originalIndex, originalEnd, midOriginalArr, modifiedIndex, modifiedEnd, midModifiedArr, deltaIsEven, quitEarlyArr); + } else { + return null; + } + } + } + } + if (numDifferences <= 1447) { + let temp = new Int32Array(diagonalForwardEnd - diagonalForwardStart + 2); + temp[0] = diagonalForwardBase - diagonalForwardStart + 1; + MyArray.Copy2(forwardPoints, diagonalForwardStart, temp, 1, diagonalForwardEnd - diagonalForwardStart + 1); + this.m_forwardHistory.push(temp); + temp = new Int32Array(diagonalReverseEnd - diagonalReverseStart + 2); + temp[0] = diagonalReverseBase - diagonalReverseStart + 1; + MyArray.Copy2(reversePoints, diagonalReverseStart, temp, 1, diagonalReverseEnd - diagonalReverseStart + 1); + this.m_reverseHistory.push(temp); + } + } + return this.WALKTRACE(diagonalForwardBase, diagonalForwardStart, diagonalForwardEnd, diagonalForwardOffset, diagonalReverseBase, diagonalReverseStart, diagonalReverseEnd, diagonalReverseOffset, forwardPoints, reversePoints, originalIndex, originalEnd, midOriginalArr, modifiedIndex, modifiedEnd, midModifiedArr, deltaIsEven, quitEarlyArr); + } + /** + * Shifts the given changes to provide a more intuitive diff. + * While the first element in a diff matches the first element after the diff, + * we shift the diff down. + * + * @param changes The list of changes to shift + * @returns The shifted changes + */ + PrettifyChanges(changes) { + for (let i = 0; i < changes.length; i++) { + const change = changes[i]; + const originalStop = i < changes.length - 1 ? changes[i + 1].originalStart : this._originalElementsOrHash.length; + const modifiedStop = i < changes.length - 1 ? changes[i + 1].modifiedStart : this._modifiedElementsOrHash.length; + const checkOriginal = change.originalLength > 0; + const checkModified = change.modifiedLength > 0; + while (change.originalStart + change.originalLength < originalStop && change.modifiedStart + change.modifiedLength < modifiedStop && (!checkOriginal || this.OriginalElementsAreEqual(change.originalStart, change.originalStart + change.originalLength)) && (!checkModified || this.ModifiedElementsAreEqual(change.modifiedStart, change.modifiedStart + change.modifiedLength))) { + const startStrictEqual = this.ElementsAreStrictEqual(change.originalStart, change.modifiedStart); + const endStrictEqual = this.ElementsAreStrictEqual(change.originalStart + change.originalLength, change.modifiedStart + change.modifiedLength); + if (endStrictEqual && !startStrictEqual) { + break; + } + change.originalStart++; + change.modifiedStart++; + } + const mergedChangeArr = [null]; + if (i < changes.length - 1 && this.ChangesOverlap(changes[i], changes[i + 1], mergedChangeArr)) { + changes[i] = mergedChangeArr[0]; + changes.splice(i + 1, 1); + i--; + continue; + } + } + for (let i = changes.length - 1; i >= 0; i--) { + const change = changes[i]; + let originalStop = 0; + let modifiedStop = 0; + if (i > 0) { + const prevChange = changes[i - 1]; + originalStop = prevChange.originalStart + prevChange.originalLength; + modifiedStop = prevChange.modifiedStart + prevChange.modifiedLength; + } + const checkOriginal = change.originalLength > 0; + const checkModified = change.modifiedLength > 0; + let bestDelta = 0; + let bestScore = this._boundaryScore(change.originalStart, change.originalLength, change.modifiedStart, change.modifiedLength); + for (let delta = 1; ; delta++) { + const originalStart = change.originalStart - delta; + const modifiedStart = change.modifiedStart - delta; + if (originalStart < originalStop || modifiedStart < modifiedStop) { + break; + } + if (checkOriginal && !this.OriginalElementsAreEqual(originalStart, originalStart + change.originalLength)) { + break; + } + if (checkModified && !this.ModifiedElementsAreEqual(modifiedStart, modifiedStart + change.modifiedLength)) { + break; + } + const touchingPreviousChange = originalStart === originalStop && modifiedStart === modifiedStop; + const score2 = (touchingPreviousChange ? 5 : 0) + this._boundaryScore(originalStart, change.originalLength, modifiedStart, change.modifiedLength); + if (score2 > bestScore) { + bestScore = score2; + bestDelta = delta; + } + } + change.originalStart -= bestDelta; + change.modifiedStart -= bestDelta; + const mergedChangeArr = [null]; + if (i > 0 && this.ChangesOverlap(changes[i - 1], changes[i], mergedChangeArr)) { + changes[i - 1] = mergedChangeArr[0]; + changes.splice(i, 1); + i++; + continue; + } + } + if (this._hasStrings) { + for (let i = 1, len = changes.length; i < len; i++) { + const aChange = changes[i - 1]; + const bChange = changes[i]; + const matchedLength = bChange.originalStart - aChange.originalStart - aChange.originalLength; + const aOriginalStart = aChange.originalStart; + const bOriginalEnd = bChange.originalStart + bChange.originalLength; + const abOriginalLength = bOriginalEnd - aOriginalStart; + const aModifiedStart = aChange.modifiedStart; + const bModifiedEnd = bChange.modifiedStart + bChange.modifiedLength; + const abModifiedLength = bModifiedEnd - aModifiedStart; + if (matchedLength < 5 && abOriginalLength < 20 && abModifiedLength < 20) { + const t = this._findBetterContiguousSequence(aOriginalStart, abOriginalLength, aModifiedStart, abModifiedLength, matchedLength); + if (t) { + const [originalMatchStart, modifiedMatchStart] = t; + if (originalMatchStart !== aChange.originalStart + aChange.originalLength || modifiedMatchStart !== aChange.modifiedStart + aChange.modifiedLength) { + aChange.originalLength = originalMatchStart - aChange.originalStart; + aChange.modifiedLength = modifiedMatchStart - aChange.modifiedStart; + bChange.originalStart = originalMatchStart + matchedLength; + bChange.modifiedStart = modifiedMatchStart + matchedLength; + bChange.originalLength = bOriginalEnd - bChange.originalStart; + bChange.modifiedLength = bModifiedEnd - bChange.modifiedStart; + } + } + } + } + } + return changes; + } + _findBetterContiguousSequence(originalStart, originalLength, modifiedStart, modifiedLength, desiredLength) { + if (originalLength < desiredLength || modifiedLength < desiredLength) { + return null; + } + const originalMax = originalStart + originalLength - desiredLength + 1; + const modifiedMax = modifiedStart + modifiedLength - desiredLength + 1; + let bestScore = 0; + let bestOriginalStart = 0; + let bestModifiedStart = 0; + for (let i = originalStart; i < originalMax; i++) { + for (let j = modifiedStart; j < modifiedMax; j++) { + const score2 = this._contiguousSequenceScore(i, j, desiredLength); + if (score2 > 0 && score2 > bestScore) { + bestScore = score2; + bestOriginalStart = i; + bestModifiedStart = j; + } + } + } + if (bestScore > 0) { + return [bestOriginalStart, bestModifiedStart]; + } + return null; + } + _contiguousSequenceScore(originalStart, modifiedStart, length) { + let score2 = 0; + for (let l = 0; l < length; l++) { + if (!this.ElementsAreEqual(originalStart + l, modifiedStart + l)) { + return 0; + } + score2 += this._originalStringElements[originalStart + l].length; + } + return score2; + } + _OriginalIsBoundary(index) { + if (index <= 0 || index >= this._originalElementsOrHash.length - 1) { + return true; + } + return this._hasStrings && /^\s*$/.test(this._originalStringElements[index]); + } + _OriginalRegionIsBoundary(originalStart, originalLength) { + if (this._OriginalIsBoundary(originalStart) || this._OriginalIsBoundary(originalStart - 1)) { + return true; + } + if (originalLength > 0) { + const originalEnd = originalStart + originalLength; + if (this._OriginalIsBoundary(originalEnd - 1) || this._OriginalIsBoundary(originalEnd)) { + return true; + } + } + return false; + } + _ModifiedIsBoundary(index) { + if (index <= 0 || index >= this._modifiedElementsOrHash.length - 1) { + return true; + } + return this._hasStrings && /^\s*$/.test(this._modifiedStringElements[index]); + } + _ModifiedRegionIsBoundary(modifiedStart, modifiedLength) { + if (this._ModifiedIsBoundary(modifiedStart) || this._ModifiedIsBoundary(modifiedStart - 1)) { + return true; + } + if (modifiedLength > 0) { + const modifiedEnd = modifiedStart + modifiedLength; + if (this._ModifiedIsBoundary(modifiedEnd - 1) || this._ModifiedIsBoundary(modifiedEnd)) { + return true; + } + } + return false; + } + _boundaryScore(originalStart, originalLength, modifiedStart, modifiedLength) { + const originalScore = this._OriginalRegionIsBoundary(originalStart, originalLength) ? 1 : 0; + const modifiedScore = this._ModifiedRegionIsBoundary(modifiedStart, modifiedLength) ? 1 : 0; + return originalScore + modifiedScore; + } + /** + * Concatenates the two input DiffChange lists and returns the resulting + * list. + * @param The left changes + * @param The right changes + * @returns The concatenated list + */ + ConcatenateChanges(left, right) { + const mergedChangeArr = []; + if (left.length === 0 || right.length === 0) { + return right.length > 0 ? right : left; + } else if (this.ChangesOverlap(left[left.length - 1], right[0], mergedChangeArr)) { + const result = new Array(left.length + right.length - 1); + MyArray.Copy(left, 0, result, 0, left.length - 1); + result[left.length - 1] = mergedChangeArr[0]; + MyArray.Copy(right, 1, result, left.length, right.length - 1); + return result; + } else { + const result = new Array(left.length + right.length); + MyArray.Copy(left, 0, result, 0, left.length); + MyArray.Copy(right, 0, result, left.length, right.length); + return result; + } + } + /** + * Returns true if the two changes overlap and can be merged into a single + * change + * @param left The left change + * @param right The right change + * @param mergedChange The merged change if the two overlap, null otherwise + * @returns True if the two changes overlap + */ + ChangesOverlap(left, right, mergedChangeArr) { + Debug.Assert(left.originalStart <= right.originalStart, "Left change is not less than or equal to right change"); + Debug.Assert(left.modifiedStart <= right.modifiedStart, "Left change is not less than or equal to right change"); + if (left.originalStart + left.originalLength >= right.originalStart || left.modifiedStart + left.modifiedLength >= right.modifiedStart) { + const originalStart = left.originalStart; + let originalLength = left.originalLength; + const modifiedStart = left.modifiedStart; + let modifiedLength = left.modifiedLength; + if (left.originalStart + left.originalLength >= right.originalStart) { + originalLength = right.originalStart + right.originalLength - left.originalStart; + } + if (left.modifiedStart + left.modifiedLength >= right.modifiedStart) { + modifiedLength = right.modifiedStart + right.modifiedLength - left.modifiedStart; + } + mergedChangeArr[0] = new DiffChange(originalStart, originalLength, modifiedStart, modifiedLength); + return true; + } else { + mergedChangeArr[0] = null; + return false; + } + } + /** + * Helper method used to clip a diagonal index to the range of valid + * diagonals. This also decides whether or not the diagonal index, + * if it exceeds the boundary, should be clipped to the boundary or clipped + * one inside the boundary depending on the Even/Odd status of the boundary + * and numDifferences. + * @param diagonal The index of the diagonal to clip. + * @param numDifferences The current number of differences being iterated upon. + * @param diagonalBaseIndex The base reference diagonal. + * @param numDiagonals The total number of diagonals. + * @returns The clipped diagonal index. + */ + ClipDiagonalBound(diagonal, numDifferences, diagonalBaseIndex, numDiagonals) { + if (diagonal >= 0 && diagonal < numDiagonals) { + return diagonal; + } + const diagonalsBelow = diagonalBaseIndex; + const diagonalsAbove = numDiagonals - diagonalBaseIndex - 1; + const diffEven = numDifferences % 2 === 0; + if (diagonal < 0) { + const lowerBoundEven = diagonalsBelow % 2 === 0; + return diffEven === lowerBoundEven ? 0 : 1; + } else { + const upperBoundEven = diagonalsAbove % 2 === 0; + return diffEven === upperBoundEven ? numDiagonals - 1 : numDiagonals - 2; + } + } +}; +var precomputedEqualityArray = new Uint32Array(65536); + +// node_modules/monaco-editor-core/esm/vs/editor/common/core/position.js +var Position = class _Position { + constructor(lineNumber, column) { + this.lineNumber = lineNumber; + this.column = column; + } + /** + * Create a new position from this position. + * + * @param newLineNumber new line number + * @param newColumn new column + */ + with(newLineNumber = this.lineNumber, newColumn = this.column) { + if (newLineNumber === this.lineNumber && newColumn === this.column) { + return this; + } else { + return new _Position(newLineNumber, newColumn); + } + } + /** + * Derive a new position from this position. + * + * @param deltaLineNumber line number delta + * @param deltaColumn column delta + */ + delta(deltaLineNumber = 0, deltaColumn = 0) { + return this.with(Math.max(1, this.lineNumber + deltaLineNumber), Math.max(1, this.column + deltaColumn)); + } + /** + * Test if this position equals other position + */ + equals(other) { + return _Position.equals(this, other); + } + /** + * Test if position `a` equals position `b` + */ + static equals(a, b) { + if (!a && !b) { + return true; + } + return !!a && !!b && a.lineNumber === b.lineNumber && a.column === b.column; + } + /** + * Test if this position is before other position. + * If the two positions are equal, the result will be false. + */ + isBefore(other) { + return _Position.isBefore(this, other); + } + /** + * Test if position `a` is before position `b`. + * If the two positions are equal, the result will be false. + */ + static isBefore(a, b) { + if (a.lineNumber < b.lineNumber) { + return true; + } + if (b.lineNumber < a.lineNumber) { + return false; + } + return a.column < b.column; + } + /** + * Test if this position is before other position. + * If the two positions are equal, the result will be true. + */ + isBeforeOrEqual(other) { + return _Position.isBeforeOrEqual(this, other); + } + /** + * Test if position `a` is before position `b`. + * If the two positions are equal, the result will be true. + */ + static isBeforeOrEqual(a, b) { + if (a.lineNumber < b.lineNumber) { + return true; + } + if (b.lineNumber < a.lineNumber) { + return false; + } + return a.column <= b.column; + } + /** + * A function that compares positions, useful for sorting + */ + static compare(a, b) { + const aLineNumber = a.lineNumber | 0; + const bLineNumber = b.lineNumber | 0; + if (aLineNumber === bLineNumber) { + const aColumn = a.column | 0; + const bColumn = b.column | 0; + return aColumn - bColumn; + } + return aLineNumber - bLineNumber; + } + /** + * Clone this position. + */ + clone() { + return new _Position(this.lineNumber, this.column); + } + /** + * Convert to a human-readable representation. + */ + toString() { + return "(" + this.lineNumber + "," + this.column + ")"; + } + // --- + /** + * Create a `Position` from an `IPosition`. + */ + static lift(pos) { + return new _Position(pos.lineNumber, pos.column); + } + /** + * Test if `obj` is an `IPosition`. + */ + static isIPosition(obj) { + return !!obj && typeof obj.lineNumber === "number" && typeof obj.column === "number"; + } + toJSON() { + return { + lineNumber: this.lineNumber, + column: this.column + }; + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/common/core/range.js +var Range = class _Range { + constructor(startLineNumber, startColumn, endLineNumber, endColumn) { + if (startLineNumber > endLineNumber || startLineNumber === endLineNumber && startColumn > endColumn) { + this.startLineNumber = endLineNumber; + this.startColumn = endColumn; + this.endLineNumber = startLineNumber; + this.endColumn = startColumn; + } else { + this.startLineNumber = startLineNumber; + this.startColumn = startColumn; + this.endLineNumber = endLineNumber; + this.endColumn = endColumn; + } + } + /** + * Test if this range is empty. + */ + isEmpty() { + return _Range.isEmpty(this); + } + /** + * Test if `range` is empty. + */ + static isEmpty(range) { + return range.startLineNumber === range.endLineNumber && range.startColumn === range.endColumn; + } + /** + * Test if position is in this range. If the position is at the edges, will return true. + */ + containsPosition(position) { + return _Range.containsPosition(this, position); + } + /** + * Test if `position` is in `range`. If the position is at the edges, will return true. + */ + static containsPosition(range, position) { + if (position.lineNumber < range.startLineNumber || position.lineNumber > range.endLineNumber) { + return false; + } + if (position.lineNumber === range.startLineNumber && position.column < range.startColumn) { + return false; + } + if (position.lineNumber === range.endLineNumber && position.column > range.endColumn) { + return false; + } + return true; + } + /** + * Test if `position` is in `range`. If the position is at the edges, will return false. + * @internal + */ + static strictContainsPosition(range, position) { + if (position.lineNumber < range.startLineNumber || position.lineNumber > range.endLineNumber) { + return false; + } + if (position.lineNumber === range.startLineNumber && position.column <= range.startColumn) { + return false; + } + if (position.lineNumber === range.endLineNumber && position.column >= range.endColumn) { + return false; + } + return true; + } + /** + * Test if range is in this range. If the range is equal to this range, will return true. + */ + containsRange(range) { + return _Range.containsRange(this, range); + } + /** + * Test if `otherRange` is in `range`. If the ranges are equal, will return true. + */ + static containsRange(range, otherRange) { + if (otherRange.startLineNumber < range.startLineNumber || otherRange.endLineNumber < range.startLineNumber) { + return false; + } + if (otherRange.startLineNumber > range.endLineNumber || otherRange.endLineNumber > range.endLineNumber) { + return false; + } + if (otherRange.startLineNumber === range.startLineNumber && otherRange.startColumn < range.startColumn) { + return false; + } + if (otherRange.endLineNumber === range.endLineNumber && otherRange.endColumn > range.endColumn) { + return false; + } + return true; + } + /** + * Test if `range` is strictly in this range. `range` must start after and end before this range for the result to be true. + */ + strictContainsRange(range) { + return _Range.strictContainsRange(this, range); + } + /** + * Test if `otherRange` is strictly in `range` (must start after, and end before). If the ranges are equal, will return false. + */ + static strictContainsRange(range, otherRange) { + if (otherRange.startLineNumber < range.startLineNumber || otherRange.endLineNumber < range.startLineNumber) { + return false; + } + if (otherRange.startLineNumber > range.endLineNumber || otherRange.endLineNumber > range.endLineNumber) { + return false; + } + if (otherRange.startLineNumber === range.startLineNumber && otherRange.startColumn <= range.startColumn) { + return false; + } + if (otherRange.endLineNumber === range.endLineNumber && otherRange.endColumn >= range.endColumn) { + return false; + } + return true; + } + /** + * A reunion of the two ranges. + * The smallest position will be used as the start point, and the largest one as the end point. + */ + plusRange(range) { + return _Range.plusRange(this, range); + } + /** + * A reunion of the two ranges. + * The smallest position will be used as the start point, and the largest one as the end point. + */ + static plusRange(a, b) { + let startLineNumber; + let startColumn; + let endLineNumber; + let endColumn; + if (b.startLineNumber < a.startLineNumber) { + startLineNumber = b.startLineNumber; + startColumn = b.startColumn; + } else if (b.startLineNumber === a.startLineNumber) { + startLineNumber = b.startLineNumber; + startColumn = Math.min(b.startColumn, a.startColumn); + } else { + startLineNumber = a.startLineNumber; + startColumn = a.startColumn; + } + if (b.endLineNumber > a.endLineNumber) { + endLineNumber = b.endLineNumber; + endColumn = b.endColumn; + } else if (b.endLineNumber === a.endLineNumber) { + endLineNumber = b.endLineNumber; + endColumn = Math.max(b.endColumn, a.endColumn); + } else { + endLineNumber = a.endLineNumber; + endColumn = a.endColumn; + } + return new _Range(startLineNumber, startColumn, endLineNumber, endColumn); + } + /** + * A intersection of the two ranges. + */ + intersectRanges(range) { + return _Range.intersectRanges(this, range); + } + /** + * A intersection of the two ranges. + */ + static intersectRanges(a, b) { + let resultStartLineNumber = a.startLineNumber; + let resultStartColumn = a.startColumn; + let resultEndLineNumber = a.endLineNumber; + let resultEndColumn = a.endColumn; + const otherStartLineNumber = b.startLineNumber; + const otherStartColumn = b.startColumn; + const otherEndLineNumber = b.endLineNumber; + const otherEndColumn = b.endColumn; + if (resultStartLineNumber < otherStartLineNumber) { + resultStartLineNumber = otherStartLineNumber; + resultStartColumn = otherStartColumn; + } else if (resultStartLineNumber === otherStartLineNumber) { + resultStartColumn = Math.max(resultStartColumn, otherStartColumn); + } + if (resultEndLineNumber > otherEndLineNumber) { + resultEndLineNumber = otherEndLineNumber; + resultEndColumn = otherEndColumn; + } else if (resultEndLineNumber === otherEndLineNumber) { + resultEndColumn = Math.min(resultEndColumn, otherEndColumn); + } + if (resultStartLineNumber > resultEndLineNumber) { + return null; + } + if (resultStartLineNumber === resultEndLineNumber && resultStartColumn > resultEndColumn) { + return null; + } + return new _Range(resultStartLineNumber, resultStartColumn, resultEndLineNumber, resultEndColumn); + } + /** + * Test if this range equals other. + */ + equalsRange(other) { + return _Range.equalsRange(this, other); + } + /** + * Test if range `a` equals `b`. + */ + static equalsRange(a, b) { + if (!a && !b) { + return true; + } + return !!a && !!b && a.startLineNumber === b.startLineNumber && a.startColumn === b.startColumn && a.endLineNumber === b.endLineNumber && a.endColumn === b.endColumn; + } + /** + * Return the end position (which will be after or equal to the start position) + */ + getEndPosition() { + return _Range.getEndPosition(this); + } + /** + * Return the end position (which will be after or equal to the start position) + */ + static getEndPosition(range) { + return new Position(range.endLineNumber, range.endColumn); + } + /** + * Return the start position (which will be before or equal to the end position) + */ + getStartPosition() { + return _Range.getStartPosition(this); + } + /** + * Return the start position (which will be before or equal to the end position) + */ + static getStartPosition(range) { + return new Position(range.startLineNumber, range.startColumn); + } + /** + * Transform to a user presentable string representation. + */ + toString() { + return "[" + this.startLineNumber + "," + this.startColumn + " -> " + this.endLineNumber + "," + this.endColumn + "]"; + } + /** + * Create a new range using this range's start position, and using endLineNumber and endColumn as the end position. + */ + setEndPosition(endLineNumber, endColumn) { + return new _Range(this.startLineNumber, this.startColumn, endLineNumber, endColumn); + } + /** + * Create a new range using this range's end position, and using startLineNumber and startColumn as the start position. + */ + setStartPosition(startLineNumber, startColumn) { + return new _Range(startLineNumber, startColumn, this.endLineNumber, this.endColumn); + } + /** + * Create a new empty range using this range's start position. + */ + collapseToStart() { + return _Range.collapseToStart(this); + } + /** + * Create a new empty range using this range's start position. + */ + static collapseToStart(range) { + return new _Range(range.startLineNumber, range.startColumn, range.startLineNumber, range.startColumn); + } + /** + * Create a new empty range using this range's end position. + */ + collapseToEnd() { + return _Range.collapseToEnd(this); + } + /** + * Create a new empty range using this range's end position. + */ + static collapseToEnd(range) { + return new _Range(range.endLineNumber, range.endColumn, range.endLineNumber, range.endColumn); + } + /** + * Moves the range by the given amount of lines. + */ + delta(lineCount) { + return new _Range(this.startLineNumber + lineCount, this.startColumn, this.endLineNumber + lineCount, this.endColumn); + } + isSingleLine() { + return this.startLineNumber === this.endLineNumber; + } + // --- + static fromPositions(start2, end = start2) { + return new _Range(start2.lineNumber, start2.column, end.lineNumber, end.column); + } + static lift(range) { + if (!range) { + return null; + } + return new _Range(range.startLineNumber, range.startColumn, range.endLineNumber, range.endColumn); + } + /** + * Test if `obj` is an `IRange`. + */ + static isIRange(obj) { + return !!obj && typeof obj.startLineNumber === "number" && typeof obj.startColumn === "number" && typeof obj.endLineNumber === "number" && typeof obj.endColumn === "number"; + } + /** + * Test if the two ranges are touching in any way. + */ + static areIntersectingOrTouching(a, b) { + if (a.endLineNumber < b.startLineNumber || a.endLineNumber === b.startLineNumber && a.endColumn < b.startColumn) { + return false; + } + if (b.endLineNumber < a.startLineNumber || b.endLineNumber === a.startLineNumber && b.endColumn < a.startColumn) { + return false; + } + return true; + } + /** + * Test if the two ranges are intersecting. If the ranges are touching it returns true. + */ + static areIntersecting(a, b) { + if (a.endLineNumber < b.startLineNumber || a.endLineNumber === b.startLineNumber && a.endColumn <= b.startColumn) { + return false; + } + if (b.endLineNumber < a.startLineNumber || b.endLineNumber === a.startLineNumber && b.endColumn <= a.startColumn) { + return false; + } + return true; + } + /** + * Test if the two ranges are intersecting, but not touching at all. + */ + static areOnlyIntersecting(a, b) { + if (a.endLineNumber < b.startLineNumber - 1 || a.endLineNumber === b.startLineNumber && a.endColumn < b.startColumn - 1) { + return false; + } + if (b.endLineNumber < a.startLineNumber - 1 || b.endLineNumber === a.startLineNumber && b.endColumn < a.startColumn - 1) { + return false; + } + return true; + } + /** + * A function that compares ranges, useful for sorting ranges + * It will first compare ranges on the startPosition and then on the endPosition + */ + static compareRangesUsingStarts(a, b) { + if (a && b) { + const aStartLineNumber = a.startLineNumber | 0; + const bStartLineNumber = b.startLineNumber | 0; + if (aStartLineNumber === bStartLineNumber) { + const aStartColumn = a.startColumn | 0; + const bStartColumn = b.startColumn | 0; + if (aStartColumn === bStartColumn) { + const aEndLineNumber = a.endLineNumber | 0; + const bEndLineNumber = b.endLineNumber | 0; + if (aEndLineNumber === bEndLineNumber) { + const aEndColumn = a.endColumn | 0; + const bEndColumn = b.endColumn | 0; + return aEndColumn - bEndColumn; + } + return aEndLineNumber - bEndLineNumber; + } + return aStartColumn - bStartColumn; + } + return aStartLineNumber - bStartLineNumber; + } + const aExists = a ? 1 : 0; + const bExists = b ? 1 : 0; + return aExists - bExists; + } + /** + * A function that compares ranges, useful for sorting ranges + * It will first compare ranges on the endPosition and then on the startPosition + */ + static compareRangesUsingEnds(a, b) { + if (a.endLineNumber === b.endLineNumber) { + if (a.endColumn === b.endColumn) { + if (a.startLineNumber === b.startLineNumber) { + return a.startColumn - b.startColumn; + } + return a.startLineNumber - b.startLineNumber; + } + return a.endColumn - b.endColumn; + } + return a.endLineNumber - b.endLineNumber; + } + /** + * Test if the range spans multiple lines. + */ + static spansMultipleLines(range) { + return range.endLineNumber > range.startLineNumber; + } + toJSON() { + return this; + } +}; + +// node_modules/monaco-editor-core/esm/vs/base/common/uint.js +function toUint8(v) { + if (v < 0) { + return 0; + } + if (v > 255) { + return 255; + } + return v | 0; +} +function toUint32(v) { + if (v < 0) { + return 0; + } + if (v > 4294967295) { + return 4294967295; + } + return v | 0; +} + +// node_modules/monaco-editor-core/esm/vs/editor/common/core/characterClassifier.js +var CharacterClassifier = class _CharacterClassifier { + constructor(_defaultValue) { + const defaultValue = toUint8(_defaultValue); + this._defaultValue = defaultValue; + this._asciiMap = _CharacterClassifier._createAsciiMap(defaultValue); + this._map = /* @__PURE__ */ new Map(); + } + static _createAsciiMap(defaultValue) { + const asciiMap = new Uint8Array(256); + asciiMap.fill(defaultValue); + return asciiMap; + } + set(charCode, _value) { + const value = toUint8(_value); + if (charCode >= 0 && charCode < 256) { + this._asciiMap[charCode] = value; + } else { + this._map.set(charCode, value); + } + } + get(charCode) { + if (charCode >= 0 && charCode < 256) { + return this._asciiMap[charCode]; + } else { + return this._map.get(charCode) || this._defaultValue; + } + } + clear() { + this._asciiMap.fill(this._defaultValue); + this._map.clear(); + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/common/languages/linkComputer.js +var Uint8Matrix = class { + constructor(rows, cols, defaultValue) { + const data = new Uint8Array(rows * cols); + for (let i = 0, len = rows * cols; i < len; i++) { + data[i] = defaultValue; + } + this._data = data; + this.rows = rows; + this.cols = cols; + } + get(row, col) { + return this._data[row * this.cols + col]; + } + set(row, col, value) { + this._data[row * this.cols + col] = value; + } +}; +var StateMachine = class { + constructor(edges) { + let maxCharCode = 0; + let maxState = 0; + for (let i = 0, len = edges.length; i < len; i++) { + const [from, chCode, to] = edges[i]; + if (chCode > maxCharCode) { + maxCharCode = chCode; + } + if (from > maxState) { + maxState = from; + } + if (to > maxState) { + maxState = to; + } + } + maxCharCode++; + maxState++; + const states = new Uint8Matrix( + maxState, + maxCharCode, + 0 + /* State.Invalid */ + ); + for (let i = 0, len = edges.length; i < len; i++) { + const [from, chCode, to] = edges[i]; + states.set(from, chCode, to); + } + this._states = states; + this._maxCharCode = maxCharCode; + } + nextState(currentState, chCode) { + if (chCode < 0 || chCode >= this._maxCharCode) { + return 0; + } + return this._states.get(currentState, chCode); + } +}; +var _stateMachine = null; +function getStateMachine() { + if (_stateMachine === null) { + _stateMachine = new StateMachine([ + [ + 1, + 104, + 2 + /* State.H */ + ], + [ + 1, + 72, + 2 + /* State.H */ + ], + [ + 1, + 102, + 6 + /* State.F */ + ], + [ + 1, + 70, + 6 + /* State.F */ + ], + [ + 2, + 116, + 3 + /* State.HT */ + ], + [ + 2, + 84, + 3 + /* State.HT */ + ], + [ + 3, + 116, + 4 + /* State.HTT */ + ], + [ + 3, + 84, + 4 + /* State.HTT */ + ], + [ + 4, + 112, + 5 + /* State.HTTP */ + ], + [ + 4, + 80, + 5 + /* State.HTTP */ + ], + [ + 5, + 115, + 9 + /* State.BeforeColon */ + ], + [ + 5, + 83, + 9 + /* State.BeforeColon */ + ], + [ + 5, + 58, + 10 + /* State.AfterColon */ + ], + [ + 6, + 105, + 7 + /* State.FI */ + ], + [ + 6, + 73, + 7 + /* State.FI */ + ], + [ + 7, + 108, + 8 + /* State.FIL */ + ], + [ + 7, + 76, + 8 + /* State.FIL */ + ], + [ + 8, + 101, + 9 + /* State.BeforeColon */ + ], + [ + 8, + 69, + 9 + /* State.BeforeColon */ + ], + [ + 9, + 58, + 10 + /* State.AfterColon */ + ], + [ + 10, + 47, + 11 + /* State.AlmostThere */ + ], + [ + 11, + 47, + 12 + /* State.End */ + ] + ]); + } + return _stateMachine; +} +var _classifier = null; +function getClassifier() { + if (_classifier === null) { + _classifier = new CharacterClassifier( + 0 + /* CharacterClass.None */ + ); + const FORCE_TERMINATION_CHARACTERS = ` <>'"\u3001\u3002\uFF61\uFF64\uFF0C\uFF0E\uFF1A\uFF1B\u2018\u3008\u300C\u300E\u3014\uFF08\uFF3B\uFF5B\uFF62\uFF63\uFF5D\uFF3D\uFF09\u3015\u300F\u300D\u3009\u2019\uFF40\uFF5E\u2026|`; + for (let i = 0; i < FORCE_TERMINATION_CHARACTERS.length; i++) { + _classifier.set( + FORCE_TERMINATION_CHARACTERS.charCodeAt(i), + 1 + /* CharacterClass.ForceTermination */ + ); + } + const CANNOT_END_WITH_CHARACTERS = ".,;:"; + for (let i = 0; i < CANNOT_END_WITH_CHARACTERS.length; i++) { + _classifier.set( + CANNOT_END_WITH_CHARACTERS.charCodeAt(i), + 2 + /* CharacterClass.CannotEndIn */ + ); + } + } + return _classifier; +} +var LinkComputer = class _LinkComputer { + static _createLink(classifier, line, lineNumber, linkBeginIndex, linkEndIndex) { + let lastIncludedCharIndex = linkEndIndex - 1; + do { + const chCode = line.charCodeAt(lastIncludedCharIndex); + const chClass = classifier.get(chCode); + if (chClass !== 2) { + break; + } + lastIncludedCharIndex--; + } while (lastIncludedCharIndex > linkBeginIndex); + if (linkBeginIndex > 0) { + const charCodeBeforeLink = line.charCodeAt(linkBeginIndex - 1); + const lastCharCodeInLink = line.charCodeAt(lastIncludedCharIndex); + if (charCodeBeforeLink === 40 && lastCharCodeInLink === 41 || charCodeBeforeLink === 91 && lastCharCodeInLink === 93 || charCodeBeforeLink === 123 && lastCharCodeInLink === 125) { + lastIncludedCharIndex--; + } + } + return { + range: { + startLineNumber: lineNumber, + startColumn: linkBeginIndex + 1, + endLineNumber: lineNumber, + endColumn: lastIncludedCharIndex + 2 + }, + url: line.substring(linkBeginIndex, lastIncludedCharIndex + 1) + }; + } + static computeLinks(model, stateMachine = getStateMachine()) { + const classifier = getClassifier(); + const result = []; + for (let i = 1, lineCount = model.getLineCount(); i <= lineCount; i++) { + const line = model.getLineContent(i); + const len = line.length; + let j = 0; + let linkBeginIndex = 0; + let linkBeginChCode = 0; + let state = 1; + let hasOpenParens = false; + let hasOpenSquareBracket = false; + let inSquareBrackets = false; + let hasOpenCurlyBracket = false; + while (j < len) { + let resetStateMachine = false; + const chCode = line.charCodeAt(j); + if (state === 13) { + let chClass; + switch (chCode) { + case 40: + hasOpenParens = true; + chClass = 0; + break; + case 41: + chClass = hasOpenParens ? 0 : 1; + break; + case 91: + inSquareBrackets = true; + hasOpenSquareBracket = true; + chClass = 0; + break; + case 93: + inSquareBrackets = false; + chClass = hasOpenSquareBracket ? 0 : 1; + break; + case 123: + hasOpenCurlyBracket = true; + chClass = 0; + break; + case 125: + chClass = hasOpenCurlyBracket ? 0 : 1; + break; + // The following three rules make it that ' or " or ` are allowed inside links + // only if the link is wrapped by some other quote character + case 39: + case 34: + case 96: + if (linkBeginChCode === chCode) { + chClass = 1; + } else if (linkBeginChCode === 39 || linkBeginChCode === 34 || linkBeginChCode === 96) { + chClass = 0; + } else { + chClass = 1; + } + break; + case 42: + chClass = linkBeginChCode === 42 ? 1 : 0; + break; + case 32: + chClass = inSquareBrackets ? 0 : 1; + break; + default: + chClass = classifier.get(chCode); + } + if (chClass === 1) { + result.push(_LinkComputer._createLink(classifier, line, i, linkBeginIndex, j)); + resetStateMachine = true; + } + } else if (state === 12) { + let chClass; + if (chCode === 91) { + hasOpenSquareBracket = true; + chClass = 0; + } else { + chClass = classifier.get(chCode); + } + if (chClass === 1) { + resetStateMachine = true; + } else { + state = 13; + } + } else { + state = stateMachine.nextState(state, chCode); + if (state === 0) { + resetStateMachine = true; + } + } + if (resetStateMachine) { + state = 1; + hasOpenParens = false; + hasOpenSquareBracket = false; + hasOpenCurlyBracket = false; + linkBeginIndex = j + 1; + linkBeginChCode = chCode; + } + j++; + } + if (state === 13) { + result.push(_LinkComputer._createLink(classifier, line, i, linkBeginIndex, len)); + } + } + return result; + } +}; +function computeLinks(model) { + if (!model || typeof model.getLineCount !== "function" || typeof model.getLineContent !== "function") { + return []; + } + return LinkComputer.computeLinks(model); +} + +// node_modules/monaco-editor-core/esm/vs/editor/common/languages/supports/inplaceReplaceSupport.js +var BasicInplaceReplace = class _BasicInplaceReplace { + constructor() { + this._defaultValueSet = [ + ["true", "false"], + ["True", "False"], + ["Private", "Public", "Friend", "ReadOnly", "Partial", "Protected", "WriteOnly"], + ["public", "protected", "private"] + ]; + } + static { + this.INSTANCE = new _BasicInplaceReplace(); + } + navigateValueSet(range1, text1, range2, text2, up) { + if (range1 && text1) { + const result = this.doNavigateValueSet(text1, up); + if (result) { + return { + range: range1, + value: result + }; + } + } + if (range2 && text2) { + const result = this.doNavigateValueSet(text2, up); + if (result) { + return { + range: range2, + value: result + }; + } + } + return null; + } + doNavigateValueSet(text, up) { + const numberResult = this.numberReplace(text, up); + if (numberResult !== null) { + return numberResult; + } + return this.textReplace(text, up); + } + numberReplace(value, up) { + const precision = Math.pow(10, value.length - (value.lastIndexOf(".") + 1)); + let n1 = Number(value); + const n2 = parseFloat(value); + if (!isNaN(n1) && !isNaN(n2) && n1 === n2) { + if (n1 === 0 && !up) { + return null; + } else { + n1 = Math.floor(n1 * precision); + n1 += up ? precision : -precision; + return String(n1 / precision); + } + } + return null; + } + textReplace(value, up) { + return this.valueSetsReplace(this._defaultValueSet, value, up); + } + valueSetsReplace(valueSets, value, up) { + let result = null; + for (let i = 0, len = valueSets.length; result === null && i < len; i++) { + result = this.valueSetReplace(valueSets[i], value, up); + } + return result; + } + valueSetReplace(valueSet, value, up) { + let idx = valueSet.indexOf(value); + if (idx >= 0) { + idx += up ? 1 : -1; + if (idx < 0) { + idx = valueSet.length - 1; + } else { + idx %= valueSet.length; + } + return valueSet[idx]; + } + return null; + } +}; + +// node_modules/monaco-editor-core/esm/vs/base/common/cancellation.js +var shortcutEvent = Object.freeze(function(callback, context) { + const handle = setTimeout(callback.bind(context), 0); + return { dispose() { + clearTimeout(handle); + } }; +}); +var CancellationToken; +(function(CancellationToken2) { + function isCancellationToken(thing) { + if (thing === CancellationToken2.None || thing === CancellationToken2.Cancelled) { + return true; + } + if (thing instanceof MutableToken) { + return true; + } + if (!thing || typeof thing !== "object") { + return false; + } + return typeof thing.isCancellationRequested === "boolean" && typeof thing.onCancellationRequested === "function"; + } + CancellationToken2.isCancellationToken = isCancellationToken; + CancellationToken2.None = Object.freeze({ + isCancellationRequested: false, + onCancellationRequested: Event.None + }); + CancellationToken2.Cancelled = Object.freeze({ + isCancellationRequested: true, + onCancellationRequested: shortcutEvent + }); +})(CancellationToken || (CancellationToken = {})); +var MutableToken = class { + constructor() { + this._isCancelled = false; + this._emitter = null; + } + cancel() { + if (!this._isCancelled) { + this._isCancelled = true; + if (this._emitter) { + this._emitter.fire(void 0); + this.dispose(); + } + } + } + get isCancellationRequested() { + return this._isCancelled; + } + get onCancellationRequested() { + if (this._isCancelled) { + return shortcutEvent; + } + if (!this._emitter) { + this._emitter = new Emitter(); + } + return this._emitter.event; + } + dispose() { + if (this._emitter) { + this._emitter.dispose(); + this._emitter = null; + } + } +}; +var CancellationTokenSource = class { + constructor(parent) { + this._token = void 0; + this._parentListener = void 0; + this._parentListener = parent && parent.onCancellationRequested(this.cancel, this); + } + get token() { + if (!this._token) { + this._token = new MutableToken(); + } + return this._token; + } + cancel() { + if (!this._token) { + this._token = CancellationToken.Cancelled; + } else if (this._token instanceof MutableToken) { + this._token.cancel(); + } + } + dispose(cancel = false) { + if (cancel) { + this.cancel(); + } + this._parentListener?.dispose(); + if (!this._token) { + this._token = CancellationToken.None; + } else if (this._token instanceof MutableToken) { + this._token.dispose(); + } + } +}; + +// node_modules/monaco-editor-core/esm/vs/base/common/keyCodes.js +var KeyCodeStrMap = class { + constructor() { + this._keyCodeToStr = []; + this._strToKeyCode = /* @__PURE__ */ Object.create(null); + } + define(keyCode, str) { + this._keyCodeToStr[keyCode] = str; + this._strToKeyCode[str.toLowerCase()] = keyCode; + } + keyCodeToStr(keyCode) { + return this._keyCodeToStr[keyCode]; + } + strToKeyCode(str) { + return this._strToKeyCode[str.toLowerCase()] || 0; + } +}; +var uiMap = new KeyCodeStrMap(); +var userSettingsUSMap = new KeyCodeStrMap(); +var userSettingsGeneralMap = new KeyCodeStrMap(); +var EVENT_KEY_CODE_MAP = new Array(230); +var NATIVE_WINDOWS_KEY_CODE_TO_KEY_CODE = {}; +var scanCodeIntToStr = []; +var scanCodeStrToInt = /* @__PURE__ */ Object.create(null); +var scanCodeLowerCaseStrToInt = /* @__PURE__ */ Object.create(null); +var IMMUTABLE_CODE_TO_KEY_CODE = []; +var IMMUTABLE_KEY_CODE_TO_CODE = []; +for (let i = 0; i <= 193; i++) { + IMMUTABLE_CODE_TO_KEY_CODE[i] = -1; +} +for (let i = 0; i <= 132; i++) { + IMMUTABLE_KEY_CODE_TO_CODE[i] = -1; +} +(function() { + const empty = ""; + const mappings = [ + // immutable, scanCode, scanCodeStr, keyCode, keyCodeStr, eventKeyCode, vkey, usUserSettingsLabel, generalUserSettingsLabel + [1, 0, "None", 0, "unknown", 0, "VK_UNKNOWN", empty, empty], + [1, 1, "Hyper", 0, empty, 0, empty, empty, empty], + [1, 2, "Super", 0, empty, 0, empty, empty, empty], + [1, 3, "Fn", 0, empty, 0, empty, empty, empty], + [1, 4, "FnLock", 0, empty, 0, empty, empty, empty], + [1, 5, "Suspend", 0, empty, 0, empty, empty, empty], + [1, 6, "Resume", 0, empty, 0, empty, empty, empty], + [1, 7, "Turbo", 0, empty, 0, empty, empty, empty], + [1, 8, "Sleep", 0, empty, 0, "VK_SLEEP", empty, empty], + [1, 9, "WakeUp", 0, empty, 0, empty, empty, empty], + [0, 10, "KeyA", 31, "A", 65, "VK_A", empty, empty], + [0, 11, "KeyB", 32, "B", 66, "VK_B", empty, empty], + [0, 12, "KeyC", 33, "C", 67, "VK_C", empty, empty], + [0, 13, "KeyD", 34, "D", 68, "VK_D", empty, empty], + [0, 14, "KeyE", 35, "E", 69, "VK_E", empty, empty], + [0, 15, "KeyF", 36, "F", 70, "VK_F", empty, empty], + [0, 16, "KeyG", 37, "G", 71, "VK_G", empty, empty], + [0, 17, "KeyH", 38, "H", 72, "VK_H", empty, empty], + [0, 18, "KeyI", 39, "I", 73, "VK_I", empty, empty], + [0, 19, "KeyJ", 40, "J", 74, "VK_J", empty, empty], + [0, 20, "KeyK", 41, "K", 75, "VK_K", empty, empty], + [0, 21, "KeyL", 42, "L", 76, "VK_L", empty, empty], + [0, 22, "KeyM", 43, "M", 77, "VK_M", empty, empty], + [0, 23, "KeyN", 44, "N", 78, "VK_N", empty, empty], + [0, 24, "KeyO", 45, "O", 79, "VK_O", empty, empty], + [0, 25, "KeyP", 46, "P", 80, "VK_P", empty, empty], + [0, 26, "KeyQ", 47, "Q", 81, "VK_Q", empty, empty], + [0, 27, "KeyR", 48, "R", 82, "VK_R", empty, empty], + [0, 28, "KeyS", 49, "S", 83, "VK_S", empty, empty], + [0, 29, "KeyT", 50, "T", 84, "VK_T", empty, empty], + [0, 30, "KeyU", 51, "U", 85, "VK_U", empty, empty], + [0, 31, "KeyV", 52, "V", 86, "VK_V", empty, empty], + [0, 32, "KeyW", 53, "W", 87, "VK_W", empty, empty], + [0, 33, "KeyX", 54, "X", 88, "VK_X", empty, empty], + [0, 34, "KeyY", 55, "Y", 89, "VK_Y", empty, empty], + [0, 35, "KeyZ", 56, "Z", 90, "VK_Z", empty, empty], + [0, 36, "Digit1", 22, "1", 49, "VK_1", empty, empty], + [0, 37, "Digit2", 23, "2", 50, "VK_2", empty, empty], + [0, 38, "Digit3", 24, "3", 51, "VK_3", empty, empty], + [0, 39, "Digit4", 25, "4", 52, "VK_4", empty, empty], + [0, 40, "Digit5", 26, "5", 53, "VK_5", empty, empty], + [0, 41, "Digit6", 27, "6", 54, "VK_6", empty, empty], + [0, 42, "Digit7", 28, "7", 55, "VK_7", empty, empty], + [0, 43, "Digit8", 29, "8", 56, "VK_8", empty, empty], + [0, 44, "Digit9", 30, "9", 57, "VK_9", empty, empty], + [0, 45, "Digit0", 21, "0", 48, "VK_0", empty, empty], + [1, 46, "Enter", 3, "Enter", 13, "VK_RETURN", empty, empty], + [1, 47, "Escape", 9, "Escape", 27, "VK_ESCAPE", empty, empty], + [1, 48, "Backspace", 1, "Backspace", 8, "VK_BACK", empty, empty], + [1, 49, "Tab", 2, "Tab", 9, "VK_TAB", empty, empty], + [1, 50, "Space", 10, "Space", 32, "VK_SPACE", empty, empty], + [0, 51, "Minus", 88, "-", 189, "VK_OEM_MINUS", "-", "OEM_MINUS"], + [0, 52, "Equal", 86, "=", 187, "VK_OEM_PLUS", "=", "OEM_PLUS"], + [0, 53, "BracketLeft", 92, "[", 219, "VK_OEM_4", "[", "OEM_4"], + [0, 54, "BracketRight", 94, "]", 221, "VK_OEM_6", "]", "OEM_6"], + [0, 55, "Backslash", 93, "\\", 220, "VK_OEM_5", "\\", "OEM_5"], + [0, 56, "IntlHash", 0, empty, 0, empty, empty, empty], + // has been dropped from the w3c spec + [0, 57, "Semicolon", 85, ";", 186, "VK_OEM_1", ";", "OEM_1"], + [0, 58, "Quote", 95, "'", 222, "VK_OEM_7", "'", "OEM_7"], + [0, 59, "Backquote", 91, "`", 192, "VK_OEM_3", "`", "OEM_3"], + [0, 60, "Comma", 87, ",", 188, "VK_OEM_COMMA", ",", "OEM_COMMA"], + [0, 61, "Period", 89, ".", 190, "VK_OEM_PERIOD", ".", "OEM_PERIOD"], + [0, 62, "Slash", 90, "/", 191, "VK_OEM_2", "/", "OEM_2"], + [1, 63, "CapsLock", 8, "CapsLock", 20, "VK_CAPITAL", empty, empty], + [1, 64, "F1", 59, "F1", 112, "VK_F1", empty, empty], + [1, 65, "F2", 60, "F2", 113, "VK_F2", empty, empty], + [1, 66, "F3", 61, "F3", 114, "VK_F3", empty, empty], + [1, 67, "F4", 62, "F4", 115, "VK_F4", empty, empty], + [1, 68, "F5", 63, "F5", 116, "VK_F5", empty, empty], + [1, 69, "F6", 64, "F6", 117, "VK_F6", empty, empty], + [1, 70, "F7", 65, "F7", 118, "VK_F7", empty, empty], + [1, 71, "F8", 66, "F8", 119, "VK_F8", empty, empty], + [1, 72, "F9", 67, "F9", 120, "VK_F9", empty, empty], + [1, 73, "F10", 68, "F10", 121, "VK_F10", empty, empty], + [1, 74, "F11", 69, "F11", 122, "VK_F11", empty, empty], + [1, 75, "F12", 70, "F12", 123, "VK_F12", empty, empty], + [1, 76, "PrintScreen", 0, empty, 0, empty, empty, empty], + [1, 77, "ScrollLock", 84, "ScrollLock", 145, "VK_SCROLL", empty, empty], + [1, 78, "Pause", 7, "PauseBreak", 19, "VK_PAUSE", empty, empty], + [1, 79, "Insert", 19, "Insert", 45, "VK_INSERT", empty, empty], + [1, 80, "Home", 14, "Home", 36, "VK_HOME", empty, empty], + [1, 81, "PageUp", 11, "PageUp", 33, "VK_PRIOR", empty, empty], + [1, 82, "Delete", 20, "Delete", 46, "VK_DELETE", empty, empty], + [1, 83, "End", 13, "End", 35, "VK_END", empty, empty], + [1, 84, "PageDown", 12, "PageDown", 34, "VK_NEXT", empty, empty], + [1, 85, "ArrowRight", 17, "RightArrow", 39, "VK_RIGHT", "Right", empty], + [1, 86, "ArrowLeft", 15, "LeftArrow", 37, "VK_LEFT", "Left", empty], + [1, 87, "ArrowDown", 18, "DownArrow", 40, "VK_DOWN", "Down", empty], + [1, 88, "ArrowUp", 16, "UpArrow", 38, "VK_UP", "Up", empty], + [1, 89, "NumLock", 83, "NumLock", 144, "VK_NUMLOCK", empty, empty], + [1, 90, "NumpadDivide", 113, "NumPad_Divide", 111, "VK_DIVIDE", empty, empty], + [1, 91, "NumpadMultiply", 108, "NumPad_Multiply", 106, "VK_MULTIPLY", empty, empty], + [1, 92, "NumpadSubtract", 111, "NumPad_Subtract", 109, "VK_SUBTRACT", empty, empty], + [1, 93, "NumpadAdd", 109, "NumPad_Add", 107, "VK_ADD", empty, empty], + [1, 94, "NumpadEnter", 3, empty, 0, empty, empty, empty], + [1, 95, "Numpad1", 99, "NumPad1", 97, "VK_NUMPAD1", empty, empty], + [1, 96, "Numpad2", 100, "NumPad2", 98, "VK_NUMPAD2", empty, empty], + [1, 97, "Numpad3", 101, "NumPad3", 99, "VK_NUMPAD3", empty, empty], + [1, 98, "Numpad4", 102, "NumPad4", 100, "VK_NUMPAD4", empty, empty], + [1, 99, "Numpad5", 103, "NumPad5", 101, "VK_NUMPAD5", empty, empty], + [1, 100, "Numpad6", 104, "NumPad6", 102, "VK_NUMPAD6", empty, empty], + [1, 101, "Numpad7", 105, "NumPad7", 103, "VK_NUMPAD7", empty, empty], + [1, 102, "Numpad8", 106, "NumPad8", 104, "VK_NUMPAD8", empty, empty], + [1, 103, "Numpad9", 107, "NumPad9", 105, "VK_NUMPAD9", empty, empty], + [1, 104, "Numpad0", 98, "NumPad0", 96, "VK_NUMPAD0", empty, empty], + [1, 105, "NumpadDecimal", 112, "NumPad_Decimal", 110, "VK_DECIMAL", empty, empty], + [0, 106, "IntlBackslash", 97, "OEM_102", 226, "VK_OEM_102", empty, empty], + [1, 107, "ContextMenu", 58, "ContextMenu", 93, empty, empty, empty], + [1, 108, "Power", 0, empty, 0, empty, empty, empty], + [1, 109, "NumpadEqual", 0, empty, 0, empty, empty, empty], + [1, 110, "F13", 71, "F13", 124, "VK_F13", empty, empty], + [1, 111, "F14", 72, "F14", 125, "VK_F14", empty, empty], + [1, 112, "F15", 73, "F15", 126, "VK_F15", empty, empty], + [1, 113, "F16", 74, "F16", 127, "VK_F16", empty, empty], + [1, 114, "F17", 75, "F17", 128, "VK_F17", empty, empty], + [1, 115, "F18", 76, "F18", 129, "VK_F18", empty, empty], + [1, 116, "F19", 77, "F19", 130, "VK_F19", empty, empty], + [1, 117, "F20", 78, "F20", 131, "VK_F20", empty, empty], + [1, 118, "F21", 79, "F21", 132, "VK_F21", empty, empty], + [1, 119, "F22", 80, "F22", 133, "VK_F22", empty, empty], + [1, 120, "F23", 81, "F23", 134, "VK_F23", empty, empty], + [1, 121, "F24", 82, "F24", 135, "VK_F24", empty, empty], + [1, 122, "Open", 0, empty, 0, empty, empty, empty], + [1, 123, "Help", 0, empty, 0, empty, empty, empty], + [1, 124, "Select", 0, empty, 0, empty, empty, empty], + [1, 125, "Again", 0, empty, 0, empty, empty, empty], + [1, 126, "Undo", 0, empty, 0, empty, empty, empty], + [1, 127, "Cut", 0, empty, 0, empty, empty, empty], + [1, 128, "Copy", 0, empty, 0, empty, empty, empty], + [1, 129, "Paste", 0, empty, 0, empty, empty, empty], + [1, 130, "Find", 0, empty, 0, empty, empty, empty], + [1, 131, "AudioVolumeMute", 117, "AudioVolumeMute", 173, "VK_VOLUME_MUTE", empty, empty], + [1, 132, "AudioVolumeUp", 118, "AudioVolumeUp", 175, "VK_VOLUME_UP", empty, empty], + [1, 133, "AudioVolumeDown", 119, "AudioVolumeDown", 174, "VK_VOLUME_DOWN", empty, empty], + [1, 134, "NumpadComma", 110, "NumPad_Separator", 108, "VK_SEPARATOR", empty, empty], + [0, 135, "IntlRo", 115, "ABNT_C1", 193, "VK_ABNT_C1", empty, empty], + [1, 136, "KanaMode", 0, empty, 0, empty, empty, empty], + [0, 137, "IntlYen", 0, empty, 0, empty, empty, empty], + [1, 138, "Convert", 0, empty, 0, empty, empty, empty], + [1, 139, "NonConvert", 0, empty, 0, empty, empty, empty], + [1, 140, "Lang1", 0, empty, 0, empty, empty, empty], + [1, 141, "Lang2", 0, empty, 0, empty, empty, empty], + [1, 142, "Lang3", 0, empty, 0, empty, empty, empty], + [1, 143, "Lang4", 0, empty, 0, empty, empty, empty], + [1, 144, "Lang5", 0, empty, 0, empty, empty, empty], + [1, 145, "Abort", 0, empty, 0, empty, empty, empty], + [1, 146, "Props", 0, empty, 0, empty, empty, empty], + [1, 147, "NumpadParenLeft", 0, empty, 0, empty, empty, empty], + [1, 148, "NumpadParenRight", 0, empty, 0, empty, empty, empty], + [1, 149, "NumpadBackspace", 0, empty, 0, empty, empty, empty], + [1, 150, "NumpadMemoryStore", 0, empty, 0, empty, empty, empty], + [1, 151, "NumpadMemoryRecall", 0, empty, 0, empty, empty, empty], + [1, 152, "NumpadMemoryClear", 0, empty, 0, empty, empty, empty], + [1, 153, "NumpadMemoryAdd", 0, empty, 0, empty, empty, empty], + [1, 154, "NumpadMemorySubtract", 0, empty, 0, empty, empty, empty], + [1, 155, "NumpadClear", 131, "Clear", 12, "VK_CLEAR", empty, empty], + [1, 156, "NumpadClearEntry", 0, empty, 0, empty, empty, empty], + [1, 0, empty, 5, "Ctrl", 17, "VK_CONTROL", empty, empty], + [1, 0, empty, 4, "Shift", 16, "VK_SHIFT", empty, empty], + [1, 0, empty, 6, "Alt", 18, "VK_MENU", empty, empty], + [1, 0, empty, 57, "Meta", 91, "VK_COMMAND", empty, empty], + [1, 157, "ControlLeft", 5, empty, 0, "VK_LCONTROL", empty, empty], + [1, 158, "ShiftLeft", 4, empty, 0, "VK_LSHIFT", empty, empty], + [1, 159, "AltLeft", 6, empty, 0, "VK_LMENU", empty, empty], + [1, 160, "MetaLeft", 57, empty, 0, "VK_LWIN", empty, empty], + [1, 161, "ControlRight", 5, empty, 0, "VK_RCONTROL", empty, empty], + [1, 162, "ShiftRight", 4, empty, 0, "VK_RSHIFT", empty, empty], + [1, 163, "AltRight", 6, empty, 0, "VK_RMENU", empty, empty], + [1, 164, "MetaRight", 57, empty, 0, "VK_RWIN", empty, empty], + [1, 165, "BrightnessUp", 0, empty, 0, empty, empty, empty], + [1, 166, "BrightnessDown", 0, empty, 0, empty, empty, empty], + [1, 167, "MediaPlay", 0, empty, 0, empty, empty, empty], + [1, 168, "MediaRecord", 0, empty, 0, empty, empty, empty], + [1, 169, "MediaFastForward", 0, empty, 0, empty, empty, empty], + [1, 170, "MediaRewind", 0, empty, 0, empty, empty, empty], + [1, 171, "MediaTrackNext", 124, "MediaTrackNext", 176, "VK_MEDIA_NEXT_TRACK", empty, empty], + [1, 172, "MediaTrackPrevious", 125, "MediaTrackPrevious", 177, "VK_MEDIA_PREV_TRACK", empty, empty], + [1, 173, "MediaStop", 126, "MediaStop", 178, "VK_MEDIA_STOP", empty, empty], + [1, 174, "Eject", 0, empty, 0, empty, empty, empty], + [1, 175, "MediaPlayPause", 127, "MediaPlayPause", 179, "VK_MEDIA_PLAY_PAUSE", empty, empty], + [1, 176, "MediaSelect", 128, "LaunchMediaPlayer", 181, "VK_MEDIA_LAUNCH_MEDIA_SELECT", empty, empty], + [1, 177, "LaunchMail", 129, "LaunchMail", 180, "VK_MEDIA_LAUNCH_MAIL", empty, empty], + [1, 178, "LaunchApp2", 130, "LaunchApp2", 183, "VK_MEDIA_LAUNCH_APP2", empty, empty], + [1, 179, "LaunchApp1", 0, empty, 0, "VK_MEDIA_LAUNCH_APP1", empty, empty], + [1, 180, "SelectTask", 0, empty, 0, empty, empty, empty], + [1, 181, "LaunchScreenSaver", 0, empty, 0, empty, empty, empty], + [1, 182, "BrowserSearch", 120, "BrowserSearch", 170, "VK_BROWSER_SEARCH", empty, empty], + [1, 183, "BrowserHome", 121, "BrowserHome", 172, "VK_BROWSER_HOME", empty, empty], + [1, 184, "BrowserBack", 122, "BrowserBack", 166, "VK_BROWSER_BACK", empty, empty], + [1, 185, "BrowserForward", 123, "BrowserForward", 167, "VK_BROWSER_FORWARD", empty, empty], + [1, 186, "BrowserStop", 0, empty, 0, "VK_BROWSER_STOP", empty, empty], + [1, 187, "BrowserRefresh", 0, empty, 0, "VK_BROWSER_REFRESH", empty, empty], + [1, 188, "BrowserFavorites", 0, empty, 0, "VK_BROWSER_FAVORITES", empty, empty], + [1, 189, "ZoomToggle", 0, empty, 0, empty, empty, empty], + [1, 190, "MailReply", 0, empty, 0, empty, empty, empty], + [1, 191, "MailForward", 0, empty, 0, empty, empty, empty], + [1, 192, "MailSend", 0, empty, 0, empty, empty, empty], + // See https://lists.w3.org/Archives/Public/www-dom/2010JulSep/att-0182/keyCode-spec.html + // If an Input Method Editor is processing key input and the event is keydown, return 229. + [1, 0, empty, 114, "KeyInComposition", 229, empty, empty, empty], + [1, 0, empty, 116, "ABNT_C2", 194, "VK_ABNT_C2", empty, empty], + [1, 0, empty, 96, "OEM_8", 223, "VK_OEM_8", empty, empty], + [1, 0, empty, 0, empty, 0, "VK_KANA", empty, empty], + [1, 0, empty, 0, empty, 0, "VK_HANGUL", empty, empty], + [1, 0, empty, 0, empty, 0, "VK_JUNJA", empty, empty], + [1, 0, empty, 0, empty, 0, "VK_FINAL", empty, empty], + [1, 0, empty, 0, empty, 0, "VK_HANJA", empty, empty], + [1, 0, empty, 0, empty, 0, "VK_KANJI", empty, empty], + [1, 0, empty, 0, empty, 0, "VK_CONVERT", empty, empty], + [1, 0, empty, 0, empty, 0, "VK_NONCONVERT", empty, empty], + [1, 0, empty, 0, empty, 0, "VK_ACCEPT", empty, empty], + [1, 0, empty, 0, empty, 0, "VK_MODECHANGE", empty, empty], + [1, 0, empty, 0, empty, 0, "VK_SELECT", empty, empty], + [1, 0, empty, 0, empty, 0, "VK_PRINT", empty, empty], + [1, 0, empty, 0, empty, 0, "VK_EXECUTE", empty, empty], + [1, 0, empty, 0, empty, 0, "VK_SNAPSHOT", empty, empty], + [1, 0, empty, 0, empty, 0, "VK_HELP", empty, empty], + [1, 0, empty, 0, empty, 0, "VK_APPS", empty, empty], + [1, 0, empty, 0, empty, 0, "VK_PROCESSKEY", empty, empty], + [1, 0, empty, 0, empty, 0, "VK_PACKET", empty, empty], + [1, 0, empty, 0, empty, 0, "VK_DBE_SBCSCHAR", empty, empty], + [1, 0, empty, 0, empty, 0, "VK_DBE_DBCSCHAR", empty, empty], + [1, 0, empty, 0, empty, 0, "VK_ATTN", empty, empty], + [1, 0, empty, 0, empty, 0, "VK_CRSEL", empty, empty], + [1, 0, empty, 0, empty, 0, "VK_EXSEL", empty, empty], + [1, 0, empty, 0, empty, 0, "VK_EREOF", empty, empty], + [1, 0, empty, 0, empty, 0, "VK_PLAY", empty, empty], + [1, 0, empty, 0, empty, 0, "VK_ZOOM", empty, empty], + [1, 0, empty, 0, empty, 0, "VK_NONAME", empty, empty], + [1, 0, empty, 0, empty, 0, "VK_PA1", empty, empty], + [1, 0, empty, 0, empty, 0, "VK_OEM_CLEAR", empty, empty] + ]; + const seenKeyCode = []; + const seenScanCode = []; + for (const mapping of mappings) { + const [immutable, scanCode, scanCodeStr, keyCode, keyCodeStr, eventKeyCode, vkey, usUserSettingsLabel, generalUserSettingsLabel] = mapping; + if (!seenScanCode[scanCode]) { + seenScanCode[scanCode] = true; + scanCodeIntToStr[scanCode] = scanCodeStr; + scanCodeStrToInt[scanCodeStr] = scanCode; + scanCodeLowerCaseStrToInt[scanCodeStr.toLowerCase()] = scanCode; + if (immutable) { + IMMUTABLE_CODE_TO_KEY_CODE[scanCode] = keyCode; + if (keyCode !== 0 && keyCode !== 3 && keyCode !== 5 && keyCode !== 4 && keyCode !== 6 && keyCode !== 57) { + IMMUTABLE_KEY_CODE_TO_CODE[keyCode] = scanCode; + } + } + } + if (!seenKeyCode[keyCode]) { + seenKeyCode[keyCode] = true; + if (!keyCodeStr) { + throw new Error(`String representation missing for key code ${keyCode} around scan code ${scanCodeStr}`); + } + uiMap.define(keyCode, keyCodeStr); + userSettingsUSMap.define(keyCode, usUserSettingsLabel || keyCodeStr); + userSettingsGeneralMap.define(keyCode, generalUserSettingsLabel || usUserSettingsLabel || keyCodeStr); + } + if (eventKeyCode) { + EVENT_KEY_CODE_MAP[eventKeyCode] = keyCode; + } + if (vkey) { + NATIVE_WINDOWS_KEY_CODE_TO_KEY_CODE[vkey] = keyCode; + } + } + IMMUTABLE_KEY_CODE_TO_CODE[ + 3 + /* KeyCode.Enter */ + ] = 46; +})(); +var KeyCodeUtils; +(function(KeyCodeUtils2) { + function toString(keyCode) { + return uiMap.keyCodeToStr(keyCode); + } + KeyCodeUtils2.toString = toString; + function fromString(key) { + return uiMap.strToKeyCode(key); + } + KeyCodeUtils2.fromString = fromString; + function toUserSettingsUS(keyCode) { + return userSettingsUSMap.keyCodeToStr(keyCode); + } + KeyCodeUtils2.toUserSettingsUS = toUserSettingsUS; + function toUserSettingsGeneral(keyCode) { + return userSettingsGeneralMap.keyCodeToStr(keyCode); + } + KeyCodeUtils2.toUserSettingsGeneral = toUserSettingsGeneral; + function fromUserSettings(key) { + return userSettingsUSMap.strToKeyCode(key) || userSettingsGeneralMap.strToKeyCode(key); + } + KeyCodeUtils2.fromUserSettings = fromUserSettings; + function toElectronAccelerator(keyCode) { + if (keyCode >= 98 && keyCode <= 113) { + return null; + } + switch (keyCode) { + case 16: + return "Up"; + case 18: + return "Down"; + case 15: + return "Left"; + case 17: + return "Right"; + } + return uiMap.keyCodeToStr(keyCode); + } + KeyCodeUtils2.toElectronAccelerator = toElectronAccelerator; +})(KeyCodeUtils || (KeyCodeUtils = {})); +function KeyChord(firstPart, secondPart) { + const chordPart = (secondPart & 65535) << 16 >>> 0; + return (firstPart | chordPart) >>> 0; +} + +// node_modules/monaco-editor-core/esm/vs/base/common/process.js +var safeProcess; +var vscodeGlobal = globalThis.vscode; +if (typeof vscodeGlobal !== "undefined" && typeof vscodeGlobal.process !== "undefined") { + const sandboxProcess = vscodeGlobal.process; + safeProcess = { + get platform() { + return sandboxProcess.platform; + }, + get arch() { + return sandboxProcess.arch; + }, + get env() { + return sandboxProcess.env; + }, + cwd() { + return sandboxProcess.cwd(); + } + }; +} else if (typeof process !== "undefined" && typeof process?.versions?.node === "string") { + safeProcess = { + get platform() { + return process.platform; + }, + get arch() { + return process.arch; + }, + get env() { + return process.env; + }, + cwd() { + return process.env["VSCODE_CWD"] || process.cwd(); + } + }; +} else { + safeProcess = { + // Supported + get platform() { + return isWindows ? "win32" : isMacintosh ? "darwin" : "linux"; + }, + get arch() { + return void 0; + }, + // Unsupported + get env() { + return {}; + }, + cwd() { + return "/"; + } + }; +} +var cwd = safeProcess.cwd; +var env = safeProcess.env; +var platform = safeProcess.platform; + +// node_modules/monaco-editor-core/esm/vs/base/common/path.js +var CHAR_UPPERCASE_A = 65; +var CHAR_LOWERCASE_A = 97; +var CHAR_UPPERCASE_Z = 90; +var CHAR_LOWERCASE_Z = 122; +var CHAR_DOT = 46; +var CHAR_FORWARD_SLASH = 47; +var CHAR_BACKWARD_SLASH = 92; +var CHAR_COLON = 58; +var CHAR_QUESTION_MARK = 63; +var ErrorInvalidArgType = class extends Error { + constructor(name, expected, actual) { + let determiner; + if (typeof expected === "string" && expected.indexOf("not ") === 0) { + determiner = "must not be"; + expected = expected.replace(/^not /, ""); + } else { + determiner = "must be"; + } + const type = name.indexOf(".") !== -1 ? "property" : "argument"; + let msg = `The "${name}" ${type} ${determiner} of type ${expected}`; + msg += `. Received type ${typeof actual}`; + super(msg); + this.code = "ERR_INVALID_ARG_TYPE"; + } +}; +function validateObject(pathObject, name) { + if (pathObject === null || typeof pathObject !== "object") { + throw new ErrorInvalidArgType(name, "Object", pathObject); + } +} +function validateString(value, name) { + if (typeof value !== "string") { + throw new ErrorInvalidArgType(name, "string", value); + } +} +var platformIsWin32 = platform === "win32"; +function isPathSeparator(code) { + return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH; +} +function isPosixPathSeparator(code) { + return code === CHAR_FORWARD_SLASH; +} +function isWindowsDeviceRoot(code) { + return code >= CHAR_UPPERCASE_A && code <= CHAR_UPPERCASE_Z || code >= CHAR_LOWERCASE_A && code <= CHAR_LOWERCASE_Z; +} +function normalizeString(path, allowAboveRoot, separator, isPathSeparator2) { + let res = ""; + let lastSegmentLength = 0; + let lastSlash = -1; + let dots = 0; + let code = 0; + for (let i = 0; i <= path.length; ++i) { + if (i < path.length) { + code = path.charCodeAt(i); + } else if (isPathSeparator2(code)) { + break; + } else { + code = CHAR_FORWARD_SLASH; + } + if (isPathSeparator2(code)) { + if (lastSlash === i - 1 || dots === 1) { + } else if (dots === 2) { + if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== CHAR_DOT || res.charCodeAt(res.length - 2) !== CHAR_DOT) { + if (res.length > 2) { + const lastSlashIndex = res.lastIndexOf(separator); + if (lastSlashIndex === -1) { + res = ""; + lastSegmentLength = 0; + } else { + res = res.slice(0, lastSlashIndex); + lastSegmentLength = res.length - 1 - res.lastIndexOf(separator); + } + lastSlash = i; + dots = 0; + continue; + } else if (res.length !== 0) { + res = ""; + lastSegmentLength = 0; + lastSlash = i; + dots = 0; + continue; + } + } + if (allowAboveRoot) { + res += res.length > 0 ? `${separator}..` : ".."; + lastSegmentLength = 2; + } + } else { + if (res.length > 0) { + res += `${separator}${path.slice(lastSlash + 1, i)}`; + } else { + res = path.slice(lastSlash + 1, i); + } + lastSegmentLength = i - lastSlash - 1; + } + lastSlash = i; + dots = 0; + } else if (code === CHAR_DOT && dots !== -1) { + ++dots; + } else { + dots = -1; + } + } + return res; +} +function formatExt(ext) { + return ext ? `${ext[0] === "." ? "" : "."}${ext}` : ""; +} +function _format2(sep2, pathObject) { + validateObject(pathObject, "pathObject"); + const dir = pathObject.dir || pathObject.root; + const base = pathObject.base || `${pathObject.name || ""}${formatExt(pathObject.ext)}`; + if (!dir) { + return base; + } + return dir === pathObject.root ? `${dir}${base}` : `${dir}${sep2}${base}`; +} +var win32 = { + // path.resolve([from ...], to) + resolve(...pathSegments) { + let resolvedDevice = ""; + let resolvedTail = ""; + let resolvedAbsolute = false; + for (let i = pathSegments.length - 1; i >= -1; i--) { + let path; + if (i >= 0) { + path = pathSegments[i]; + validateString(path, `paths[${i}]`); + if (path.length === 0) { + continue; + } + } else if (resolvedDevice.length === 0) { + path = cwd(); + } else { + path = env[`=${resolvedDevice}`] || cwd(); + if (path === void 0 || path.slice(0, 2).toLowerCase() !== resolvedDevice.toLowerCase() && path.charCodeAt(2) === CHAR_BACKWARD_SLASH) { + path = `${resolvedDevice}\\`; + } + } + const len = path.length; + let rootEnd = 0; + let device = ""; + let isAbsolute = false; + const code = path.charCodeAt(0); + if (len === 1) { + if (isPathSeparator(code)) { + rootEnd = 1; + isAbsolute = true; + } + } else if (isPathSeparator(code)) { + isAbsolute = true; + if (isPathSeparator(path.charCodeAt(1))) { + let j = 2; + let last = j; + while (j < len && !isPathSeparator(path.charCodeAt(j))) { + j++; + } + if (j < len && j !== last) { + const firstPart = path.slice(last, j); + last = j; + while (j < len && isPathSeparator(path.charCodeAt(j))) { + j++; + } + if (j < len && j !== last) { + last = j; + while (j < len && !isPathSeparator(path.charCodeAt(j))) { + j++; + } + if (j === len || j !== last) { + device = `\\\\${firstPart}\\${path.slice(last, j)}`; + rootEnd = j; + } + } + } + } else { + rootEnd = 1; + } + } else if (isWindowsDeviceRoot(code) && path.charCodeAt(1) === CHAR_COLON) { + device = path.slice(0, 2); + rootEnd = 2; + if (len > 2 && isPathSeparator(path.charCodeAt(2))) { + isAbsolute = true; + rootEnd = 3; + } + } + if (device.length > 0) { + if (resolvedDevice.length > 0) { + if (device.toLowerCase() !== resolvedDevice.toLowerCase()) { + continue; + } + } else { + resolvedDevice = device; + } + } + if (resolvedAbsolute) { + if (resolvedDevice.length > 0) { + break; + } + } else { + resolvedTail = `${path.slice(rootEnd)}\\${resolvedTail}`; + resolvedAbsolute = isAbsolute; + if (isAbsolute && resolvedDevice.length > 0) { + break; + } + } + } + resolvedTail = normalizeString(resolvedTail, !resolvedAbsolute, "\\", isPathSeparator); + return resolvedAbsolute ? `${resolvedDevice}\\${resolvedTail}` : `${resolvedDevice}${resolvedTail}` || "."; + }, + normalize(path) { + validateString(path, "path"); + const len = path.length; + if (len === 0) { + return "."; + } + let rootEnd = 0; + let device; + let isAbsolute = false; + const code = path.charCodeAt(0); + if (len === 1) { + return isPosixPathSeparator(code) ? "\\" : path; + } + if (isPathSeparator(code)) { + isAbsolute = true; + if (isPathSeparator(path.charCodeAt(1))) { + let j = 2; + let last = j; + while (j < len && !isPathSeparator(path.charCodeAt(j))) { + j++; + } + if (j < len && j !== last) { + const firstPart = path.slice(last, j); + last = j; + while (j < len && isPathSeparator(path.charCodeAt(j))) { + j++; + } + if (j < len && j !== last) { + last = j; + while (j < len && !isPathSeparator(path.charCodeAt(j))) { + j++; + } + if (j === len) { + return `\\\\${firstPart}\\${path.slice(last)}\\`; + } + if (j !== last) { + device = `\\\\${firstPart}\\${path.slice(last, j)}`; + rootEnd = j; + } + } + } + } else { + rootEnd = 1; + } + } else if (isWindowsDeviceRoot(code) && path.charCodeAt(1) === CHAR_COLON) { + device = path.slice(0, 2); + rootEnd = 2; + if (len > 2 && isPathSeparator(path.charCodeAt(2))) { + isAbsolute = true; + rootEnd = 3; + } + } + let tail = rootEnd < len ? normalizeString(path.slice(rootEnd), !isAbsolute, "\\", isPathSeparator) : ""; + if (tail.length === 0 && !isAbsolute) { + tail = "."; + } + if (tail.length > 0 && isPathSeparator(path.charCodeAt(len - 1))) { + tail += "\\"; + } + if (!isAbsolute && device === void 0 && path.includes(":")) { + if (tail.length >= 2 && isWindowsDeviceRoot(tail.charCodeAt(0)) && tail.charCodeAt(1) === CHAR_COLON) { + return `.\\${tail}`; + } + let index = path.indexOf(":"); + do { + if (index === len - 1 || isPathSeparator(path.charCodeAt(index + 1))) { + return `.\\${tail}`; + } + } while ((index = path.indexOf(":", index + 1)) !== -1); + } + if (device === void 0) { + return isAbsolute ? `\\${tail}` : tail; + } + return isAbsolute ? `${device}\\${tail}` : `${device}${tail}`; + }, + isAbsolute(path) { + validateString(path, "path"); + const len = path.length; + if (len === 0) { + return false; + } + const code = path.charCodeAt(0); + return isPathSeparator(code) || // Possible device root + len > 2 && isWindowsDeviceRoot(code) && path.charCodeAt(1) === CHAR_COLON && isPathSeparator(path.charCodeAt(2)); + }, + join(...paths) { + if (paths.length === 0) { + return "."; + } + let joined; + let firstPart; + for (let i = 0; i < paths.length; ++i) { + const arg = paths[i]; + validateString(arg, "path"); + if (arg.length > 0) { + if (joined === void 0) { + joined = firstPart = arg; + } else { + joined += `\\${arg}`; + } + } + } + if (joined === void 0) { + return "."; + } + let needsReplace = true; + let slashCount = 0; + if (typeof firstPart === "string" && isPathSeparator(firstPart.charCodeAt(0))) { + ++slashCount; + const firstLen = firstPart.length; + if (firstLen > 1 && isPathSeparator(firstPart.charCodeAt(1))) { + ++slashCount; + if (firstLen > 2) { + if (isPathSeparator(firstPart.charCodeAt(2))) { + ++slashCount; + } else { + needsReplace = false; + } + } + } + } + if (needsReplace) { + while (slashCount < joined.length && isPathSeparator(joined.charCodeAt(slashCount))) { + slashCount++; + } + if (slashCount >= 2) { + joined = `\\${joined.slice(slashCount)}`; + } + } + return win32.normalize(joined); + }, + // It will solve the relative path from `from` to `to`, for instance: + // from = 'C:\\orandea\\test\\aaa' + // to = 'C:\\orandea\\impl\\bbb' + // The output of the function should be: '..\\..\\impl\\bbb' + relative(from, to) { + validateString(from, "from"); + validateString(to, "to"); + if (from === to) { + return ""; + } + const fromOrig = win32.resolve(from); + const toOrig = win32.resolve(to); + if (fromOrig === toOrig) { + return ""; + } + from = fromOrig.toLowerCase(); + to = toOrig.toLowerCase(); + if (from === to) { + return ""; + } + if (fromOrig.length !== from.length || toOrig.length !== to.length) { + const fromSplit = fromOrig.split("\\"); + const toSplit = toOrig.split("\\"); + if (fromSplit[fromSplit.length - 1] === "") { + fromSplit.pop(); + } + if (toSplit[toSplit.length - 1] === "") { + toSplit.pop(); + } + const fromLen2 = fromSplit.length; + const toLen2 = toSplit.length; + const length2 = fromLen2 < toLen2 ? fromLen2 : toLen2; + let i2; + for (i2 = 0; i2 < length2; i2++) { + if (fromSplit[i2].toLowerCase() !== toSplit[i2].toLowerCase()) { + break; + } + } + if (i2 === 0) { + return toOrig; + } else if (i2 === length2) { + if (toLen2 > length2) { + return toSplit.slice(i2).join("\\"); + } + if (fromLen2 > length2) { + return "..\\".repeat(fromLen2 - 1 - i2) + ".."; + } + return ""; + } + return "..\\".repeat(fromLen2 - i2) + toSplit.slice(i2).join("\\"); + } + let fromStart = 0; + while (fromStart < from.length && from.charCodeAt(fromStart) === CHAR_BACKWARD_SLASH) { + fromStart++; + } + let fromEnd = from.length; + while (fromEnd - 1 > fromStart && from.charCodeAt(fromEnd - 1) === CHAR_BACKWARD_SLASH) { + fromEnd--; + } + const fromLen = fromEnd - fromStart; + let toStart = 0; + while (toStart < to.length && to.charCodeAt(toStart) === CHAR_BACKWARD_SLASH) { + toStart++; + } + let toEnd = to.length; + while (toEnd - 1 > toStart && to.charCodeAt(toEnd - 1) === CHAR_BACKWARD_SLASH) { + toEnd--; + } + const toLen = toEnd - toStart; + const length = fromLen < toLen ? fromLen : toLen; + let lastCommonSep = -1; + let i = 0; + for (; i < length; i++) { + const fromCode = from.charCodeAt(fromStart + i); + if (fromCode !== to.charCodeAt(toStart + i)) { + break; + } else if (fromCode === CHAR_BACKWARD_SLASH) { + lastCommonSep = i; + } + } + if (i !== length) { + if (lastCommonSep === -1) { + return toOrig; + } + } else { + if (toLen > length) { + if (to.charCodeAt(toStart + i) === CHAR_BACKWARD_SLASH) { + return toOrig.slice(toStart + i + 1); + } + if (i === 2) { + return toOrig.slice(toStart + i); + } + } + if (fromLen > length) { + if (from.charCodeAt(fromStart + i) === CHAR_BACKWARD_SLASH) { + lastCommonSep = i; + } else if (i === 2) { + lastCommonSep = 3; + } + } + if (lastCommonSep === -1) { + lastCommonSep = 0; + } + } + let out = ""; + for (i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i) { + if (i === fromEnd || from.charCodeAt(i) === CHAR_BACKWARD_SLASH) { + out += out.length === 0 ? ".." : "\\.."; + } + } + toStart += lastCommonSep; + if (out.length > 0) { + return `${out}${toOrig.slice(toStart, toEnd)}`; + } + if (toOrig.charCodeAt(toStart) === CHAR_BACKWARD_SLASH) { + ++toStart; + } + return toOrig.slice(toStart, toEnd); + }, + toNamespacedPath(path) { + if (typeof path !== "string" || path.length === 0) { + return path; + } + const resolvedPath = win32.resolve(path); + if (resolvedPath.length <= 2) { + return path; + } + if (resolvedPath.charCodeAt(0) === CHAR_BACKWARD_SLASH) { + if (resolvedPath.charCodeAt(1) === CHAR_BACKWARD_SLASH) { + const code = resolvedPath.charCodeAt(2); + if (code !== CHAR_QUESTION_MARK && code !== CHAR_DOT) { + return `\\\\?\\UNC\\${resolvedPath.slice(2)}`; + } + } + } else if (isWindowsDeviceRoot(resolvedPath.charCodeAt(0)) && resolvedPath.charCodeAt(1) === CHAR_COLON && resolvedPath.charCodeAt(2) === CHAR_BACKWARD_SLASH) { + return `\\\\?\\${resolvedPath}`; + } + return resolvedPath; + }, + dirname(path) { + validateString(path, "path"); + const len = path.length; + if (len === 0) { + return "."; + } + let rootEnd = -1; + let offset = 0; + const code = path.charCodeAt(0); + if (len === 1) { + return isPathSeparator(code) ? path : "."; + } + if (isPathSeparator(code)) { + rootEnd = offset = 1; + if (isPathSeparator(path.charCodeAt(1))) { + let j = 2; + let last = j; + while (j < len && !isPathSeparator(path.charCodeAt(j))) { + j++; + } + if (j < len && j !== last) { + last = j; + while (j < len && isPathSeparator(path.charCodeAt(j))) { + j++; + } + if (j < len && j !== last) { + last = j; + while (j < len && !isPathSeparator(path.charCodeAt(j))) { + j++; + } + if (j === len) { + return path; + } + if (j !== last) { + rootEnd = offset = j + 1; + } + } + } + } + } else if (isWindowsDeviceRoot(code) && path.charCodeAt(1) === CHAR_COLON) { + rootEnd = len > 2 && isPathSeparator(path.charCodeAt(2)) ? 3 : 2; + offset = rootEnd; + } + let end = -1; + let matchedSlash = true; + for (let i = len - 1; i >= offset; --i) { + if (isPathSeparator(path.charCodeAt(i))) { + if (!matchedSlash) { + end = i; + break; + } + } else { + matchedSlash = false; + } + } + if (end === -1) { + if (rootEnd === -1) { + return "."; + } + end = rootEnd; + } + return path.slice(0, end); + }, + basename(path, suffix) { + if (suffix !== void 0) { + validateString(suffix, "suffix"); + } + validateString(path, "path"); + let start2 = 0; + let end = -1; + let matchedSlash = true; + let i; + if (path.length >= 2 && isWindowsDeviceRoot(path.charCodeAt(0)) && path.charCodeAt(1) === CHAR_COLON) { + start2 = 2; + } + if (suffix !== void 0 && suffix.length > 0 && suffix.length <= path.length) { + if (suffix === path) { + return ""; + } + let extIdx = suffix.length - 1; + let firstNonSlashEnd = -1; + for (i = path.length - 1; i >= start2; --i) { + const code = path.charCodeAt(i); + if (isPathSeparator(code)) { + if (!matchedSlash) { + start2 = i + 1; + break; + } + } else { + if (firstNonSlashEnd === -1) { + matchedSlash = false; + firstNonSlashEnd = i + 1; + } + if (extIdx >= 0) { + if (code === suffix.charCodeAt(extIdx)) { + if (--extIdx === -1) { + end = i; + } + } else { + extIdx = -1; + end = firstNonSlashEnd; + } + } + } + } + if (start2 === end) { + end = firstNonSlashEnd; + } else if (end === -1) { + end = path.length; + } + return path.slice(start2, end); + } + for (i = path.length - 1; i >= start2; --i) { + if (isPathSeparator(path.charCodeAt(i))) { + if (!matchedSlash) { + start2 = i + 1; + break; + } + } else if (end === -1) { + matchedSlash = false; + end = i + 1; + } + } + if (end === -1) { + return ""; + } + return path.slice(start2, end); + }, + extname(path) { + validateString(path, "path"); + let start2 = 0; + let startDot = -1; + let startPart = 0; + let end = -1; + let matchedSlash = true; + let preDotState = 0; + if (path.length >= 2 && path.charCodeAt(1) === CHAR_COLON && isWindowsDeviceRoot(path.charCodeAt(0))) { + start2 = startPart = 2; + } + for (let i = path.length - 1; i >= start2; --i) { + const code = path.charCodeAt(i); + if (isPathSeparator(code)) { + if (!matchedSlash) { + startPart = i + 1; + break; + } + continue; + } + if (end === -1) { + matchedSlash = false; + end = i + 1; + } + if (code === CHAR_DOT) { + if (startDot === -1) { + startDot = i; + } else if (preDotState !== 1) { + preDotState = 1; + } + } else if (startDot !== -1) { + preDotState = -1; + } + } + if (startDot === -1 || end === -1 || // We saw a non-dot character immediately before the dot + preDotState === 0 || // The (right-most) trimmed path component is exactly '..' + preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) { + return ""; + } + return path.slice(startDot, end); + }, + format: _format2.bind(null, "\\"), + parse(path) { + validateString(path, "path"); + const ret = { root: "", dir: "", base: "", ext: "", name: "" }; + if (path.length === 0) { + return ret; + } + const len = path.length; + let rootEnd = 0; + let code = path.charCodeAt(0); + if (len === 1) { + if (isPathSeparator(code)) { + ret.root = ret.dir = path; + return ret; + } + ret.base = ret.name = path; + return ret; + } + if (isPathSeparator(code)) { + rootEnd = 1; + if (isPathSeparator(path.charCodeAt(1))) { + let j = 2; + let last = j; + while (j < len && !isPathSeparator(path.charCodeAt(j))) { + j++; + } + if (j < len && j !== last) { + last = j; + while (j < len && isPathSeparator(path.charCodeAt(j))) { + j++; + } + if (j < len && j !== last) { + last = j; + while (j < len && !isPathSeparator(path.charCodeAt(j))) { + j++; + } + if (j === len) { + rootEnd = j; + } else if (j !== last) { + rootEnd = j + 1; + } + } + } + } + } else if (isWindowsDeviceRoot(code) && path.charCodeAt(1) === CHAR_COLON) { + if (len <= 2) { + ret.root = ret.dir = path; + return ret; + } + rootEnd = 2; + if (isPathSeparator(path.charCodeAt(2))) { + if (len === 3) { + ret.root = ret.dir = path; + return ret; + } + rootEnd = 3; + } + } + if (rootEnd > 0) { + ret.root = path.slice(0, rootEnd); + } + let startDot = -1; + let startPart = rootEnd; + let end = -1; + let matchedSlash = true; + let i = path.length - 1; + let preDotState = 0; + for (; i >= rootEnd; --i) { + code = path.charCodeAt(i); + if (isPathSeparator(code)) { + if (!matchedSlash) { + startPart = i + 1; + break; + } + continue; + } + if (end === -1) { + matchedSlash = false; + end = i + 1; + } + if (code === CHAR_DOT) { + if (startDot === -1) { + startDot = i; + } else if (preDotState !== 1) { + preDotState = 1; + } + } else if (startDot !== -1) { + preDotState = -1; + } + } + if (end !== -1) { + if (startDot === -1 || // We saw a non-dot character immediately before the dot + preDotState === 0 || // The (right-most) trimmed path component is exactly '..' + preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) { + ret.base = ret.name = path.slice(startPart, end); + } else { + ret.name = path.slice(startPart, startDot); + ret.base = path.slice(startPart, end); + ret.ext = path.slice(startDot, end); + } + } + if (startPart > 0 && startPart !== rootEnd) { + ret.dir = path.slice(0, startPart - 1); + } else { + ret.dir = ret.root; + } + return ret; + }, + sep: "\\", + delimiter: ";", + win32: null, + posix: null +}; +var posixCwd = (() => { + if (platformIsWin32) { + const regexp = /\\/g; + return () => { + const cwd2 = cwd().replace(regexp, "/"); + return cwd2.slice(cwd2.indexOf("/")); + }; + } + return () => cwd(); +})(); +var posix = { + // path.resolve([from ...], to) + resolve(...pathSegments) { + let resolvedPath = ""; + let resolvedAbsolute = false; + for (let i = pathSegments.length - 1; i >= 0 && !resolvedAbsolute; i--) { + const path = pathSegments[i]; + validateString(path, `paths[${i}]`); + if (path.length === 0) { + continue; + } + resolvedPath = `${path}/${resolvedPath}`; + resolvedAbsolute = path.charCodeAt(0) === CHAR_FORWARD_SLASH; + } + if (!resolvedAbsolute) { + const cwd2 = posixCwd(); + resolvedPath = `${cwd2}/${resolvedPath}`; + resolvedAbsolute = cwd2.charCodeAt(0) === CHAR_FORWARD_SLASH; + } + resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute, "/", isPosixPathSeparator); + if (resolvedAbsolute) { + return `/${resolvedPath}`; + } + return resolvedPath.length > 0 ? resolvedPath : "."; + }, + normalize(path) { + validateString(path, "path"); + if (path.length === 0) { + return "."; + } + const isAbsolute = path.charCodeAt(0) === CHAR_FORWARD_SLASH; + const trailingSeparator = path.charCodeAt(path.length - 1) === CHAR_FORWARD_SLASH; + path = normalizeString(path, !isAbsolute, "/", isPosixPathSeparator); + if (path.length === 0) { + if (isAbsolute) { + return "/"; + } + return trailingSeparator ? "./" : "."; + } + if (trailingSeparator) { + path += "/"; + } + return isAbsolute ? `/${path}` : path; + }, + isAbsolute(path) { + validateString(path, "path"); + return path.length > 0 && path.charCodeAt(0) === CHAR_FORWARD_SLASH; + }, + join(...paths) { + if (paths.length === 0) { + return "."; + } + const path = []; + for (let i = 0; i < paths.length; ++i) { + const arg = paths[i]; + validateString(arg, "path"); + if (arg.length > 0) { + path.push(arg); + } + } + if (path.length === 0) { + return "."; + } + return posix.normalize(path.join("/")); + }, + relative(from, to) { + validateString(from, "from"); + validateString(to, "to"); + if (from === to) { + return ""; + } + from = posix.resolve(from); + to = posix.resolve(to); + if (from === to) { + return ""; + } + const fromStart = 1; + const fromEnd = from.length; + const fromLen = fromEnd - fromStart; + const toStart = 1; + const toLen = to.length - toStart; + const length = fromLen < toLen ? fromLen : toLen; + let lastCommonSep = -1; + let i = 0; + for (; i < length; i++) { + const fromCode = from.charCodeAt(fromStart + i); + if (fromCode !== to.charCodeAt(toStart + i)) { + break; + } else if (fromCode === CHAR_FORWARD_SLASH) { + lastCommonSep = i; + } + } + if (i === length) { + if (toLen > length) { + if (to.charCodeAt(toStart + i) === CHAR_FORWARD_SLASH) { + return to.slice(toStart + i + 1); + } + if (i === 0) { + return to.slice(toStart + i); + } + } else if (fromLen > length) { + if (from.charCodeAt(fromStart + i) === CHAR_FORWARD_SLASH) { + lastCommonSep = i; + } else if (i === 0) { + lastCommonSep = 0; + } + } + } + let out = ""; + for (i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i) { + if (i === fromEnd || from.charCodeAt(i) === CHAR_FORWARD_SLASH) { + out += out.length === 0 ? ".." : "/.."; + } + } + return `${out}${to.slice(toStart + lastCommonSep)}`; + }, + toNamespacedPath(path) { + return path; + }, + dirname(path) { + validateString(path, "path"); + if (path.length === 0) { + return "."; + } + const hasRoot = path.charCodeAt(0) === CHAR_FORWARD_SLASH; + let end = -1; + let matchedSlash = true; + for (let i = path.length - 1; i >= 1; --i) { + if (path.charCodeAt(i) === CHAR_FORWARD_SLASH) { + if (!matchedSlash) { + end = i; + break; + } + } else { + matchedSlash = false; + } + } + if (end === -1) { + return hasRoot ? "/" : "."; + } + if (hasRoot && end === 1) { + return "//"; + } + return path.slice(0, end); + }, + basename(path, suffix) { + if (suffix !== void 0) { + validateString(suffix, "suffix"); + } + validateString(path, "path"); + let start2 = 0; + let end = -1; + let matchedSlash = true; + let i; + if (suffix !== void 0 && suffix.length > 0 && suffix.length <= path.length) { + if (suffix === path) { + return ""; + } + let extIdx = suffix.length - 1; + let firstNonSlashEnd = -1; + for (i = path.length - 1; i >= 0; --i) { + const code = path.charCodeAt(i); + if (code === CHAR_FORWARD_SLASH) { + if (!matchedSlash) { + start2 = i + 1; + break; + } + } else { + if (firstNonSlashEnd === -1) { + matchedSlash = false; + firstNonSlashEnd = i + 1; + } + if (extIdx >= 0) { + if (code === suffix.charCodeAt(extIdx)) { + if (--extIdx === -1) { + end = i; + } + } else { + extIdx = -1; + end = firstNonSlashEnd; + } + } + } + } + if (start2 === end) { + end = firstNonSlashEnd; + } else if (end === -1) { + end = path.length; + } + return path.slice(start2, end); + } + for (i = path.length - 1; i >= 0; --i) { + if (path.charCodeAt(i) === CHAR_FORWARD_SLASH) { + if (!matchedSlash) { + start2 = i + 1; + break; + } + } else if (end === -1) { + matchedSlash = false; + end = i + 1; + } + } + if (end === -1) { + return ""; + } + return path.slice(start2, end); + }, + extname(path) { + validateString(path, "path"); + let startDot = -1; + let startPart = 0; + let end = -1; + let matchedSlash = true; + let preDotState = 0; + for (let i = path.length - 1; i >= 0; --i) { + const char = path[i]; + if (char === "/") { + if (!matchedSlash) { + startPart = i + 1; + break; + } + continue; + } + if (end === -1) { + matchedSlash = false; + end = i + 1; + } + if (char === ".") { + if (startDot === -1) { + startDot = i; + } else if (preDotState !== 1) { + preDotState = 1; + } + } else if (startDot !== -1) { + preDotState = -1; + } + } + if (startDot === -1 || end === -1 || // We saw a non-dot character immediately before the dot + preDotState === 0 || // The (right-most) trimmed path component is exactly '..' + preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) { + return ""; + } + return path.slice(startDot, end); + }, + format: _format2.bind(null, "/"), + parse(path) { + validateString(path, "path"); + const ret = { root: "", dir: "", base: "", ext: "", name: "" }; + if (path.length === 0) { + return ret; + } + const isAbsolute = path.charCodeAt(0) === CHAR_FORWARD_SLASH; + let start2; + if (isAbsolute) { + ret.root = "/"; + start2 = 1; + } else { + start2 = 0; + } + let startDot = -1; + let startPart = 0; + let end = -1; + let matchedSlash = true; + let i = path.length - 1; + let preDotState = 0; + for (; i >= start2; --i) { + const code = path.charCodeAt(i); + if (code === CHAR_FORWARD_SLASH) { + if (!matchedSlash) { + startPart = i + 1; + break; + } + continue; + } + if (end === -1) { + matchedSlash = false; + end = i + 1; + } + if (code === CHAR_DOT) { + if (startDot === -1) { + startDot = i; + } else if (preDotState !== 1) { + preDotState = 1; + } + } else if (startDot !== -1) { + preDotState = -1; + } + } + if (end !== -1) { + const start3 = startPart === 0 && isAbsolute ? 1 : startPart; + if (startDot === -1 || // We saw a non-dot character immediately before the dot + preDotState === 0 || // The (right-most) trimmed path component is exactly '..' + preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) { + ret.base = ret.name = path.slice(start3, end); + } else { + ret.name = path.slice(start3, startDot); + ret.base = path.slice(start3, end); + ret.ext = path.slice(startDot, end); + } + } + if (startPart > 0) { + ret.dir = path.slice(0, startPart - 1); + } else if (isAbsolute) { + ret.dir = "/"; + } + return ret; + }, + sep: "/", + delimiter: ":", + win32: null, + posix: null +}; +posix.win32 = win32.win32 = win32; +posix.posix = win32.posix = posix; +var normalize = platformIsWin32 ? win32.normalize : posix.normalize; +var resolve = platformIsWin32 ? win32.resolve : posix.resolve; +var relative = platformIsWin32 ? win32.relative : posix.relative; +var dirname = platformIsWin32 ? win32.dirname : posix.dirname; +var basename = platformIsWin32 ? win32.basename : posix.basename; +var extname = platformIsWin32 ? win32.extname : posix.extname; +var sep = platformIsWin32 ? win32.sep : posix.sep; + +// node_modules/monaco-editor-core/esm/vs/base/common/uri.js +var _schemePattern = /^\w[\w\d+.-]*$/; +var _singleSlashStart = /^\//; +var _doubleSlashStart = /^\/\//; +function _validateUri(ret, _strict) { + if (!ret.scheme && _strict) { + throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${ret.authority}", path: "${ret.path}", query: "${ret.query}", fragment: "${ret.fragment}"}`); + } + if (ret.scheme && !_schemePattern.test(ret.scheme)) { + throw new Error("[UriError]: Scheme contains illegal characters."); + } + if (ret.path) { + if (ret.authority) { + if (!_singleSlashStart.test(ret.path)) { + throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character'); + } + } else { + if (_doubleSlashStart.test(ret.path)) { + throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")'); + } + } + } +} +function _schemeFix(scheme, _strict) { + if (!scheme && !_strict) { + return "file"; + } + return scheme; +} +function _referenceResolution(scheme, path) { + switch (scheme) { + case "https": + case "http": + case "file": + if (!path) { + path = _slash; + } else if (path[0] !== _slash) { + path = _slash + path; + } + break; + } + return path; +} +var _empty = ""; +var _slash = "/"; +var _regexp = /^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/; +var URI = class _URI { + static isUri(thing) { + if (thing instanceof _URI) { + return true; + } + if (!thing || typeof thing !== "object") { + return false; + } + return typeof thing.authority === "string" && typeof thing.fragment === "string" && typeof thing.path === "string" && typeof thing.query === "string" && typeof thing.scheme === "string" && typeof thing.fsPath === "string" && typeof thing.with === "function" && typeof thing.toString === "function"; + } + /** + * @internal + */ + constructor(schemeOrData, authority, path, query, fragment, _strict = false) { + if (typeof schemeOrData === "object") { + this.scheme = schemeOrData.scheme || _empty; + this.authority = schemeOrData.authority || _empty; + this.path = schemeOrData.path || _empty; + this.query = schemeOrData.query || _empty; + this.fragment = schemeOrData.fragment || _empty; + } else { + this.scheme = _schemeFix(schemeOrData, _strict); + this.authority = authority || _empty; + this.path = _referenceResolution(this.scheme, path || _empty); + this.query = query || _empty; + this.fragment = fragment || _empty; + _validateUri(this, _strict); + } + } + // ---- filesystem path ----------------------- + /** + * Returns a string representing the corresponding file system path of this URI. + * Will handle UNC paths, normalizes windows drive letters to lower-case, and uses the + * platform specific path separator. + * + * * Will *not* validate the path for invalid characters and semantics. + * * Will *not* look at the scheme of this URI. + * * The result shall *not* be used for display purposes but for accessing a file on disk. + * + * + * The *difference* to `URI#path` is the use of the platform specific separator and the handling + * of UNC paths. See the below sample of a file-uri with an authority (UNC path). + * + * ```ts + const u = URI.parse('file://server/c$/folder/file.txt') + u.authority === 'server' + u.path === '/shares/c$/file.txt' + u.fsPath === '\\server\c$\folder\file.txt' + ``` + * + * Using `URI#path` to read a file (using fs-apis) would not be enough because parts of the path, + * namely the server name, would be missing. Therefore `URI#fsPath` exists - it's sugar to ease working + * with URIs that represent files on disk (`file` scheme). + */ + get fsPath() { + return uriToFsPath(this, false); + } + // ---- modify to new ------------------------- + with(change) { + if (!change) { + return this; + } + let { scheme, authority, path, query, fragment } = change; + if (scheme === void 0) { + scheme = this.scheme; + } else if (scheme === null) { + scheme = _empty; + } + if (authority === void 0) { + authority = this.authority; + } else if (authority === null) { + authority = _empty; + } + if (path === void 0) { + path = this.path; + } else if (path === null) { + path = _empty; + } + if (query === void 0) { + query = this.query; + } else if (query === null) { + query = _empty; + } + if (fragment === void 0) { + fragment = this.fragment; + } else if (fragment === null) { + fragment = _empty; + } + if (scheme === this.scheme && authority === this.authority && path === this.path && query === this.query && fragment === this.fragment) { + return this; + } + return new Uri(scheme, authority, path, query, fragment); + } + // ---- parse & validate ------------------------ + /** + * Creates a new URI from a string, e.g. `http://www.example.com/some/path`, + * `file:///usr/home`, or `scheme:with/path`. + * + * @param value A string which represents an URI (see `URI#toString`). + */ + static parse(value, _strict = false) { + const match = _regexp.exec(value); + if (!match) { + return new Uri(_empty, _empty, _empty, _empty, _empty); + } + return new Uri(match[2] || _empty, percentDecode(match[4] || _empty), percentDecode(match[5] || _empty), percentDecode(match[7] || _empty), percentDecode(match[9] || _empty), _strict); + } + /** + * Creates a new URI from a file system path, e.g. `c:\my\files`, + * `/usr/home`, or `\\server\share\some\path`. + * + * The *difference* between `URI#parse` and `URI#file` is that the latter treats the argument + * as path, not as stringified-uri. E.g. `URI.file(path)` is **not the same as** + * `URI.parse('file://' + path)` because the path might contain characters that are + * interpreted (# and ?). See the following sample: + * ```ts + const good = URI.file('/coding/c#/project1'); + good.scheme === 'file'; + good.path === '/coding/c#/project1'; + good.fragment === ''; + const bad = URI.parse('file://' + '/coding/c#/project1'); + bad.scheme === 'file'; + bad.path === '/coding/c'; // path is now broken + bad.fragment === '/project1'; + ``` + * + * @param path A file system path (see `URI#fsPath`) + */ + static file(path) { + let authority = _empty; + if (isWindows) { + path = path.replace(/\\/g, _slash); + } + if (path[0] === _slash && path[1] === _slash) { + const idx = path.indexOf(_slash, 2); + if (idx === -1) { + authority = path.substring(2); + path = _slash; + } else { + authority = path.substring(2, idx); + path = path.substring(idx) || _slash; + } + } + return new Uri("file", authority, path, _empty, _empty); + } + /** + * Creates new URI from uri components. + * + * Unless `strict` is `true` the scheme is defaults to be `file`. This function performs + * validation and should be used for untrusted uri components retrieved from storage, + * user input, command arguments etc + */ + static from(components, strict) { + const result = new Uri(components.scheme, components.authority, components.path, components.query, components.fragment, strict); + return result; + } + /** + * Join a URI path with path fragments and normalizes the resulting path. + * + * @param uri The input URI. + * @param pathFragment The path fragment to add to the URI path. + * @returns The resulting URI. + */ + static joinPath(uri, ...pathFragment) { + if (!uri.path) { + throw new Error(`[UriError]: cannot call joinPath on URI without path`); + } + let newPath; + if (isWindows && uri.scheme === "file") { + newPath = _URI.file(win32.join(uriToFsPath(uri, true), ...pathFragment)).path; + } else { + newPath = posix.join(uri.path, ...pathFragment); + } + return uri.with({ path: newPath }); + } + // ---- printing/externalize --------------------------- + /** + * Creates a string representation for this URI. It's guaranteed that calling + * `URI.parse` with the result of this function creates an URI which is equal + * to this URI. + * + * * The result shall *not* be used for display purposes but for externalization or transport. + * * The result will be encoded using the percentage encoding and encoding happens mostly + * ignore the scheme-specific encoding rules. + * + * @param skipEncoding Do not encode the result, default is `false` + */ + toString(skipEncoding = false) { + return _asFormatted(this, skipEncoding); + } + toJSON() { + return this; + } + static revive(data) { + if (!data) { + return data; + } else if (data instanceof _URI) { + return data; + } else { + const result = new Uri(data); + result._formatted = data.external ?? null; + result._fsPath = data._sep === _pathSepMarker ? data.fsPath ?? null : null; + return result; + } + } +}; +var _pathSepMarker = isWindows ? 1 : void 0; +var Uri = class extends URI { + constructor() { + super(...arguments); + this._formatted = null; + this._fsPath = null; + } + get fsPath() { + if (!this._fsPath) { + this._fsPath = uriToFsPath(this, false); + } + return this._fsPath; + } + toString(skipEncoding = false) { + if (!skipEncoding) { + if (!this._formatted) { + this._formatted = _asFormatted(this, false); + } + return this._formatted; + } else { + return _asFormatted(this, true); + } + } + toJSON() { + const res = { + $mid: 1 + /* MarshalledId.Uri */ + }; + if (this._fsPath) { + res.fsPath = this._fsPath; + res._sep = _pathSepMarker; + } + if (this._formatted) { + res.external = this._formatted; + } + if (this.path) { + res.path = this.path; + } + if (this.scheme) { + res.scheme = this.scheme; + } + if (this.authority) { + res.authority = this.authority; + } + if (this.query) { + res.query = this.query; + } + if (this.fragment) { + res.fragment = this.fragment; + } + return res; + } +}; +var encodeTable = { + [ + 58 + /* CharCode.Colon */ + ]: "%3A", + // gen-delims + [ + 47 + /* CharCode.Slash */ + ]: "%2F", + [ + 63 + /* CharCode.QuestionMark */ + ]: "%3F", + [ + 35 + /* CharCode.Hash */ + ]: "%23", + [ + 91 + /* CharCode.OpenSquareBracket */ + ]: "%5B", + [ + 93 + /* CharCode.CloseSquareBracket */ + ]: "%5D", + [ + 64 + /* CharCode.AtSign */ + ]: "%40", + [ + 33 + /* CharCode.ExclamationMark */ + ]: "%21", + // sub-delims + [ + 36 + /* CharCode.DollarSign */ + ]: "%24", + [ + 38 + /* CharCode.Ampersand */ + ]: "%26", + [ + 39 + /* CharCode.SingleQuote */ + ]: "%27", + [ + 40 + /* CharCode.OpenParen */ + ]: "%28", + [ + 41 + /* CharCode.CloseParen */ + ]: "%29", + [ + 42 + /* CharCode.Asterisk */ + ]: "%2A", + [ + 43 + /* CharCode.Plus */ + ]: "%2B", + [ + 44 + /* CharCode.Comma */ + ]: "%2C", + [ + 59 + /* CharCode.Semicolon */ + ]: "%3B", + [ + 61 + /* CharCode.Equals */ + ]: "%3D", + [ + 32 + /* CharCode.Space */ + ]: "%20" +}; +function encodeURIComponentFast(uriComponent, isPath, isAuthority) { + let res = void 0; + let nativeEncodePos = -1; + for (let pos = 0; pos < uriComponent.length; pos++) { + const code = uriComponent.charCodeAt(pos); + if (code >= 97 && code <= 122 || code >= 65 && code <= 90 || code >= 48 && code <= 57 || code === 45 || code === 46 || code === 95 || code === 126 || isPath && code === 47 || isAuthority && code === 91 || isAuthority && code === 93 || isAuthority && code === 58) { + if (nativeEncodePos !== -1) { + res += encodeURIComponent(uriComponent.substring(nativeEncodePos, pos)); + nativeEncodePos = -1; + } + if (res !== void 0) { + res += uriComponent.charAt(pos); + } + } else { + if (res === void 0) { + res = uriComponent.substr(0, pos); + } + const escaped = encodeTable[code]; + if (escaped !== void 0) { + if (nativeEncodePos !== -1) { + res += encodeURIComponent(uriComponent.substring(nativeEncodePos, pos)); + nativeEncodePos = -1; + } + res += escaped; + } else if (nativeEncodePos === -1) { + nativeEncodePos = pos; + } + } + } + if (nativeEncodePos !== -1) { + res += encodeURIComponent(uriComponent.substring(nativeEncodePos)); + } + return res !== void 0 ? res : uriComponent; +} +function encodeURIComponentMinimal(path) { + let res = void 0; + for (let pos = 0; pos < path.length; pos++) { + const code = path.charCodeAt(pos); + if (code === 35 || code === 63) { + if (res === void 0) { + res = path.substr(0, pos); + } + res += encodeTable[code]; + } else { + if (res !== void 0) { + res += path[pos]; + } + } + } + return res !== void 0 ? res : path; +} +function uriToFsPath(uri, keepDriveLetterCasing) { + let value; + if (uri.authority && uri.path.length > 1 && uri.scheme === "file") { + value = `//${uri.authority}${uri.path}`; + } else if (uri.path.charCodeAt(0) === 47 && (uri.path.charCodeAt(1) >= 65 && uri.path.charCodeAt(1) <= 90 || uri.path.charCodeAt(1) >= 97 && uri.path.charCodeAt(1) <= 122) && uri.path.charCodeAt(2) === 58) { + if (!keepDriveLetterCasing) { + value = uri.path[1].toLowerCase() + uri.path.substr(2); + } else { + value = uri.path.substr(1); + } + } else { + value = uri.path; + } + if (isWindows) { + value = value.replace(/\//g, "\\"); + } + return value; +} +function _asFormatted(uri, skipEncoding) { + const encoder = !skipEncoding ? encodeURIComponentFast : encodeURIComponentMinimal; + let res = ""; + let { scheme, authority, path, query, fragment } = uri; + if (scheme) { + res += scheme; + res += ":"; + } + if (authority || scheme === "file") { + res += _slash; + res += _slash; + } + if (authority) { + let idx = authority.indexOf("@"); + if (idx !== -1) { + const userinfo = authority.substr(0, idx); + authority = authority.substr(idx + 1); + idx = userinfo.lastIndexOf(":"); + if (idx === -1) { + res += encoder(userinfo, false, false); + } else { + res += encoder(userinfo.substr(0, idx), false, false); + res += ":"; + res += encoder(userinfo.substr(idx + 1), false, true); + } + res += "@"; + } + authority = authority.toLowerCase(); + idx = authority.lastIndexOf(":"); + if (idx === -1) { + res += encoder(authority, false, true); + } else { + res += encoder(authority.substr(0, idx), false, true); + res += authority.substr(idx); + } + } + if (path) { + if (path.length >= 3 && path.charCodeAt(0) === 47 && path.charCodeAt(2) === 58) { + const code = path.charCodeAt(1); + if (code >= 65 && code <= 90) { + path = `/${String.fromCharCode(code + 32)}:${path.substr(3)}`; + } + } else if (path.length >= 2 && path.charCodeAt(1) === 58) { + const code = path.charCodeAt(0); + if (code >= 65 && code <= 90) { + path = `${String.fromCharCode(code + 32)}:${path.substr(2)}`; + } + } + res += encoder(path, true, false); + } + if (query) { + res += "?"; + res += encoder(query, false, false); + } + if (fragment) { + res += "#"; + res += !skipEncoding ? encodeURIComponentFast(fragment, false, false) : fragment; + } + return res; +} +function decodeURIComponentGraceful(str) { + try { + return decodeURIComponent(str); + } catch { + if (str.length > 3) { + return str.substr(0, 3) + decodeURIComponentGraceful(str.substr(3)); + } else { + return str; + } + } +} +var _rEncodedAsHex = /(%[0-9A-Za-z][0-9A-Za-z])+/g; +function percentDecode(str) { + if (!str.match(_rEncodedAsHex)) { + return str; + } + return str.replace(_rEncodedAsHex, (match) => decodeURIComponentGraceful(match)); +} + +// node_modules/monaco-editor-core/esm/vs/editor/common/core/selection.js +var Selection = class _Selection extends Range { + constructor(selectionStartLineNumber, selectionStartColumn, positionLineNumber, positionColumn) { + super(selectionStartLineNumber, selectionStartColumn, positionLineNumber, positionColumn); + this.selectionStartLineNumber = selectionStartLineNumber; + this.selectionStartColumn = selectionStartColumn; + this.positionLineNumber = positionLineNumber; + this.positionColumn = positionColumn; + } + /** + * Transform to a human-readable representation. + */ + toString() { + return "[" + this.selectionStartLineNumber + "," + this.selectionStartColumn + " -> " + this.positionLineNumber + "," + this.positionColumn + "]"; + } + /** + * Test if equals other selection. + */ + equalsSelection(other) { + return _Selection.selectionsEqual(this, other); + } + /** + * Test if the two selections are equal. + */ + static selectionsEqual(a, b) { + return a.selectionStartLineNumber === b.selectionStartLineNumber && a.selectionStartColumn === b.selectionStartColumn && a.positionLineNumber === b.positionLineNumber && a.positionColumn === b.positionColumn; + } + /** + * Get directions (LTR or RTL). + */ + getDirection() { + if (this.selectionStartLineNumber === this.startLineNumber && this.selectionStartColumn === this.startColumn) { + return 0; + } + return 1; + } + /** + * Create a new selection with a different `positionLineNumber` and `positionColumn`. + */ + setEndPosition(endLineNumber, endColumn) { + if (this.getDirection() === 0) { + return new _Selection(this.startLineNumber, this.startColumn, endLineNumber, endColumn); + } + return new _Selection(endLineNumber, endColumn, this.startLineNumber, this.startColumn); + } + /** + * Get the position at `positionLineNumber` and `positionColumn`. + */ + getPosition() { + return new Position(this.positionLineNumber, this.positionColumn); + } + /** + * Get the position at the start of the selection. + */ + getSelectionStart() { + return new Position(this.selectionStartLineNumber, this.selectionStartColumn); + } + /** + * Create a new selection with a different `selectionStartLineNumber` and `selectionStartColumn`. + */ + setStartPosition(startLineNumber, startColumn) { + if (this.getDirection() === 0) { + return new _Selection(startLineNumber, startColumn, this.endLineNumber, this.endColumn); + } + return new _Selection(this.endLineNumber, this.endColumn, startLineNumber, startColumn); + } + // ---- + /** + * Create a `Selection` from one or two positions + */ + static fromPositions(start2, end = start2) { + return new _Selection(start2.lineNumber, start2.column, end.lineNumber, end.column); + } + /** + * Creates a `Selection` from a range, given a direction. + */ + static fromRange(range, direction) { + if (direction === 0) { + return new _Selection(range.startLineNumber, range.startColumn, range.endLineNumber, range.endColumn); + } else { + return new _Selection(range.endLineNumber, range.endColumn, range.startLineNumber, range.startColumn); + } + } + /** + * Create a `Selection` from an `ISelection`. + */ + static liftSelection(sel) { + return new _Selection(sel.selectionStartLineNumber, sel.selectionStartColumn, sel.positionLineNumber, sel.positionColumn); + } + /** + * `a` equals `b`. + */ + static selectionsArrEqual(a, b) { + if (a && !b || !a && b) { + return false; + } + if (!a && !b) { + return true; + } + if (a.length !== b.length) { + return false; + } + for (let i = 0, len = a.length; i < len; i++) { + if (!this.selectionsEqual(a[i], b[i])) { + return false; + } + } + return true; + } + /** + * Test if `obj` is an `ISelection`. + */ + static isISelection(obj) { + return !!obj && typeof obj.selectionStartLineNumber === "number" && typeof obj.selectionStartColumn === "number" && typeof obj.positionLineNumber === "number" && typeof obj.positionColumn === "number"; + } + /** + * Create with a direction. + */ + static createWithDirection(startLineNumber, startColumn, endLineNumber, endColumn, direction) { + if (direction === 0) { + return new _Selection(startLineNumber, startColumn, endLineNumber, endColumn); + } + return new _Selection(endLineNumber, endColumn, startLineNumber, startColumn); + } +}; + +// node_modules/monaco-editor-core/esm/vs/base/common/codiconsUtil.js +var _codiconFontCharacters = /* @__PURE__ */ Object.create(null); +function register(id, fontCharacter) { + if (isString(fontCharacter)) { + const val = _codiconFontCharacters[fontCharacter]; + if (val === void 0) { + throw new Error(`${id} references an unknown codicon: ${fontCharacter}`); + } + fontCharacter = val; + } + _codiconFontCharacters[id] = fontCharacter; + return { id }; +} + +// node_modules/monaco-editor-core/esm/vs/base/common/codiconsLibrary.js +var codiconsLibrary = { + add: register("add", 6e4), + plus: register("plus", 6e4), + gistNew: register("gist-new", 6e4), + repoCreate: register("repo-create", 6e4), + lightbulb: register("lightbulb", 60001), + lightBulb: register("light-bulb", 60001), + repo: register("repo", 60002), + repoDelete: register("repo-delete", 60002), + gistFork: register("gist-fork", 60003), + repoForked: register("repo-forked", 60003), + gitPullRequest: register("git-pull-request", 60004), + gitPullRequestAbandoned: register("git-pull-request-abandoned", 60004), + recordKeys: register("record-keys", 60005), + keyboard: register("keyboard", 60005), + tag: register("tag", 60006), + gitPullRequestLabel: register("git-pull-request-label", 60006), + tagAdd: register("tag-add", 60006), + tagRemove: register("tag-remove", 60006), + person: register("person", 60007), + personFollow: register("person-follow", 60007), + personOutline: register("person-outline", 60007), + personFilled: register("person-filled", 60007), + sourceControl: register("source-control", 60008), + mirror: register("mirror", 60009), + mirrorPublic: register("mirror-public", 60009), + star: register("star", 60010), + starAdd: register("star-add", 60010), + starDelete: register("star-delete", 60010), + starEmpty: register("star-empty", 60010), + comment: register("comment", 60011), + commentAdd: register("comment-add", 60011), + alert: register("alert", 60012), + warning: register("warning", 60012), + search: register("search", 60013), + searchSave: register("search-save", 60013), + logOut: register("log-out", 60014), + signOut: register("sign-out", 60014), + logIn: register("log-in", 60015), + signIn: register("sign-in", 60015), + eye: register("eye", 60016), + eyeUnwatch: register("eye-unwatch", 60016), + eyeWatch: register("eye-watch", 60016), + circleFilled: register("circle-filled", 60017), + primitiveDot: register("primitive-dot", 60017), + closeDirty: register("close-dirty", 60017), + debugBreakpoint: register("debug-breakpoint", 60017), + debugBreakpointDisabled: register("debug-breakpoint-disabled", 60017), + debugHint: register("debug-hint", 60017), + terminalDecorationSuccess: register("terminal-decoration-success", 60017), + primitiveSquare: register("primitive-square", 60018), + edit: register("edit", 60019), + pencil: register("pencil", 60019), + info: register("info", 60020), + issueOpened: register("issue-opened", 60020), + gistPrivate: register("gist-private", 60021), + gitForkPrivate: register("git-fork-private", 60021), + lock: register("lock", 60021), + mirrorPrivate: register("mirror-private", 60021), + close: register("close", 60022), + removeClose: register("remove-close", 60022), + x: register("x", 60022), + repoSync: register("repo-sync", 60023), + sync: register("sync", 60023), + clone: register("clone", 60024), + desktopDownload: register("desktop-download", 60024), + beaker: register("beaker", 60025), + microscope: register("microscope", 60025), + vm: register("vm", 60026), + deviceDesktop: register("device-desktop", 60026), + file: register("file", 60027), + more: register("more", 60028), + ellipsis: register("ellipsis", 60028), + kebabHorizontal: register("kebab-horizontal", 60028), + mailReply: register("mail-reply", 60029), + reply: register("reply", 60029), + organization: register("organization", 60030), + organizationFilled: register("organization-filled", 60030), + organizationOutline: register("organization-outline", 60030), + newFile: register("new-file", 60031), + fileAdd: register("file-add", 60031), + newFolder: register("new-folder", 60032), + fileDirectoryCreate: register("file-directory-create", 60032), + trash: register("trash", 60033), + trashcan: register("trashcan", 60033), + history: register("history", 60034), + clock: register("clock", 60034), + folder: register("folder", 60035), + fileDirectory: register("file-directory", 60035), + symbolFolder: register("symbol-folder", 60035), + logoGithub: register("logo-github", 60036), + markGithub: register("mark-github", 60036), + github: register("github", 60036), + terminal: register("terminal", 60037), + console: register("console", 60037), + repl: register("repl", 60037), + zap: register("zap", 60038), + symbolEvent: register("symbol-event", 60038), + error: register("error", 60039), + stop: register("stop", 60039), + variable: register("variable", 60040), + symbolVariable: register("symbol-variable", 60040), + array: register("array", 60042), + symbolArray: register("symbol-array", 60042), + symbolModule: register("symbol-module", 60043), + symbolPackage: register("symbol-package", 60043), + symbolNamespace: register("symbol-namespace", 60043), + symbolObject: register("symbol-object", 60043), + symbolMethod: register("symbol-method", 60044), + symbolFunction: register("symbol-function", 60044), + symbolConstructor: register("symbol-constructor", 60044), + symbolBoolean: register("symbol-boolean", 60047), + symbolNull: register("symbol-null", 60047), + symbolNumeric: register("symbol-numeric", 60048), + symbolNumber: register("symbol-number", 60048), + symbolStructure: register("symbol-structure", 60049), + symbolStruct: register("symbol-struct", 60049), + symbolParameter: register("symbol-parameter", 60050), + symbolTypeParameter: register("symbol-type-parameter", 60050), + symbolKey: register("symbol-key", 60051), + symbolText: register("symbol-text", 60051), + symbolReference: register("symbol-reference", 60052), + goToFile: register("go-to-file", 60052), + symbolEnum: register("symbol-enum", 60053), + symbolValue: register("symbol-value", 60053), + symbolRuler: register("symbol-ruler", 60054), + symbolUnit: register("symbol-unit", 60054), + activateBreakpoints: register("activate-breakpoints", 60055), + archive: register("archive", 60056), + arrowBoth: register("arrow-both", 60057), + arrowDown: register("arrow-down", 60058), + arrowLeft: register("arrow-left", 60059), + arrowRight: register("arrow-right", 60060), + arrowSmallDown: register("arrow-small-down", 60061), + arrowSmallLeft: register("arrow-small-left", 60062), + arrowSmallRight: register("arrow-small-right", 60063), + arrowSmallUp: register("arrow-small-up", 60064), + arrowUp: register("arrow-up", 60065), + bell: register("bell", 60066), + bold: register("bold", 60067), + book: register("book", 60068), + bookmark: register("bookmark", 60069), + debugBreakpointConditionalUnverified: register("debug-breakpoint-conditional-unverified", 60070), + debugBreakpointConditional: register("debug-breakpoint-conditional", 60071), + debugBreakpointConditionalDisabled: register("debug-breakpoint-conditional-disabled", 60071), + debugBreakpointDataUnverified: register("debug-breakpoint-data-unverified", 60072), + debugBreakpointData: register("debug-breakpoint-data", 60073), + debugBreakpointDataDisabled: register("debug-breakpoint-data-disabled", 60073), + debugBreakpointLogUnverified: register("debug-breakpoint-log-unverified", 60074), + debugBreakpointLog: register("debug-breakpoint-log", 60075), + debugBreakpointLogDisabled: register("debug-breakpoint-log-disabled", 60075), + briefcase: register("briefcase", 60076), + broadcast: register("broadcast", 60077), + browser: register("browser", 60078), + bug: register("bug", 60079), + calendar: register("calendar", 60080), + caseSensitive: register("case-sensitive", 60081), + check: register("check", 60082), + checklist: register("checklist", 60083), + chevronDown: register("chevron-down", 60084), + chevronLeft: register("chevron-left", 60085), + chevronRight: register("chevron-right", 60086), + chevronUp: register("chevron-up", 60087), + chromeClose: register("chrome-close", 60088), + chromeMaximize: register("chrome-maximize", 60089), + chromeMinimize: register("chrome-minimize", 60090), + chromeRestore: register("chrome-restore", 60091), + circleOutline: register("circle-outline", 60092), + circle: register("circle", 60092), + debugBreakpointUnverified: register("debug-breakpoint-unverified", 60092), + terminalDecorationIncomplete: register("terminal-decoration-incomplete", 60092), + circleSlash: register("circle-slash", 60093), + circuitBoard: register("circuit-board", 60094), + clearAll: register("clear-all", 60095), + clippy: register("clippy", 60096), + closeAll: register("close-all", 60097), + cloudDownload: register("cloud-download", 60098), + cloudUpload: register("cloud-upload", 60099), + code: register("code", 60100), + collapseAll: register("collapse-all", 60101), + colorMode: register("color-mode", 60102), + commentDiscussion: register("comment-discussion", 60103), + creditCard: register("credit-card", 60105), + dash: register("dash", 60108), + dashboard: register("dashboard", 60109), + database: register("database", 60110), + debugContinue: register("debug-continue", 60111), + debugDisconnect: register("debug-disconnect", 60112), + debugPause: register("debug-pause", 60113), + debugRestart: register("debug-restart", 60114), + debugStart: register("debug-start", 60115), + debugStepInto: register("debug-step-into", 60116), + debugStepOut: register("debug-step-out", 60117), + debugStepOver: register("debug-step-over", 60118), + debugStop: register("debug-stop", 60119), + debug: register("debug", 60120), + deviceCameraVideo: register("device-camera-video", 60121), + deviceCamera: register("device-camera", 60122), + deviceMobile: register("device-mobile", 60123), + diffAdded: register("diff-added", 60124), + diffIgnored: register("diff-ignored", 60125), + diffModified: register("diff-modified", 60126), + diffRemoved: register("diff-removed", 60127), + diffRenamed: register("diff-renamed", 60128), + diff: register("diff", 60129), + diffSidebyside: register("diff-sidebyside", 60129), + discard: register("discard", 60130), + editorLayout: register("editor-layout", 60131), + emptyWindow: register("empty-window", 60132), + exclude: register("exclude", 60133), + extensions: register("extensions", 60134), + eyeClosed: register("eye-closed", 60135), + fileBinary: register("file-binary", 60136), + fileCode: register("file-code", 60137), + fileMedia: register("file-media", 60138), + filePdf: register("file-pdf", 60139), + fileSubmodule: register("file-submodule", 60140), + fileSymlinkDirectory: register("file-symlink-directory", 60141), + fileSymlinkFile: register("file-symlink-file", 60142), + fileZip: register("file-zip", 60143), + files: register("files", 60144), + filter: register("filter", 60145), + flame: register("flame", 60146), + foldDown: register("fold-down", 60147), + foldUp: register("fold-up", 60148), + fold: register("fold", 60149), + folderActive: register("folder-active", 60150), + folderOpened: register("folder-opened", 60151), + gear: register("gear", 60152), + gift: register("gift", 60153), + gistSecret: register("gist-secret", 60154), + gist: register("gist", 60155), + gitCommit: register("git-commit", 60156), + gitCompare: register("git-compare", 60157), + compareChanges: register("compare-changes", 60157), + gitMerge: register("git-merge", 60158), + githubAction: register("github-action", 60159), + githubAlt: register("github-alt", 60160), + globe: register("globe", 60161), + grabber: register("grabber", 60162), + graph: register("graph", 60163), + gripper: register("gripper", 60164), + heart: register("heart", 60165), + home: register("home", 60166), + horizontalRule: register("horizontal-rule", 60167), + hubot: register("hubot", 60168), + inbox: register("inbox", 60169), + issueReopened: register("issue-reopened", 60171), + issues: register("issues", 60172), + italic: register("italic", 60173), + jersey: register("jersey", 60174), + json: register("json", 60175), + kebabVertical: register("kebab-vertical", 60176), + key: register("key", 60177), + law: register("law", 60178), + lightbulbAutofix: register("lightbulb-autofix", 60179), + linkExternal: register("link-external", 60180), + link: register("link", 60181), + listOrdered: register("list-ordered", 60182), + listUnordered: register("list-unordered", 60183), + liveShare: register("live-share", 60184), + loading: register("loading", 60185), + location: register("location", 60186), + mailRead: register("mail-read", 60187), + mail: register("mail", 60188), + markdown: register("markdown", 60189), + megaphone: register("megaphone", 60190), + mention: register("mention", 60191), + milestone: register("milestone", 60192), + gitPullRequestMilestone: register("git-pull-request-milestone", 60192), + mortarBoard: register("mortar-board", 60193), + move: register("move", 60194), + multipleWindows: register("multiple-windows", 60195), + mute: register("mute", 60196), + noNewline: register("no-newline", 60197), + note: register("note", 60198), + octoface: register("octoface", 60199), + openPreview: register("open-preview", 60200), + package: register("package", 60201), + paintcan: register("paintcan", 60202), + pin: register("pin", 60203), + play: register("play", 60204), + run: register("run", 60204), + plug: register("plug", 60205), + preserveCase: register("preserve-case", 60206), + preview: register("preview", 60207), + project: register("project", 60208), + pulse: register("pulse", 60209), + question: register("question", 60210), + quote: register("quote", 60211), + radioTower: register("radio-tower", 60212), + reactions: register("reactions", 60213), + references: register("references", 60214), + refresh: register("refresh", 60215), + regex: register("regex", 60216), + remoteExplorer: register("remote-explorer", 60217), + remote: register("remote", 60218), + remove: register("remove", 60219), + replaceAll: register("replace-all", 60220), + replace: register("replace", 60221), + repoClone: register("repo-clone", 60222), + repoForcePush: register("repo-force-push", 60223), + repoPull: register("repo-pull", 60224), + repoPush: register("repo-push", 60225), + report: register("report", 60226), + requestChanges: register("request-changes", 60227), + rocket: register("rocket", 60228), + rootFolderOpened: register("root-folder-opened", 60229), + rootFolder: register("root-folder", 60230), + rss: register("rss", 60231), + ruby: register("ruby", 60232), + saveAll: register("save-all", 60233), + saveAs: register("save-as", 60234), + save: register("save", 60235), + screenFull: register("screen-full", 60236), + screenNormal: register("screen-normal", 60237), + searchStop: register("search-stop", 60238), + server: register("server", 60240), + settingsGear: register("settings-gear", 60241), + settings: register("settings", 60242), + shield: register("shield", 60243), + smiley: register("smiley", 60244), + sortPrecedence: register("sort-precedence", 60245), + splitHorizontal: register("split-horizontal", 60246), + splitVertical: register("split-vertical", 60247), + squirrel: register("squirrel", 60248), + starFull: register("star-full", 60249), + starHalf: register("star-half", 60250), + symbolClass: register("symbol-class", 60251), + symbolColor: register("symbol-color", 60252), + symbolConstant: register("symbol-constant", 60253), + symbolEnumMember: register("symbol-enum-member", 60254), + symbolField: register("symbol-field", 60255), + symbolFile: register("symbol-file", 60256), + symbolInterface: register("symbol-interface", 60257), + symbolKeyword: register("symbol-keyword", 60258), + symbolMisc: register("symbol-misc", 60259), + symbolOperator: register("symbol-operator", 60260), + symbolProperty: register("symbol-property", 60261), + wrench: register("wrench", 60261), + wrenchSubaction: register("wrench-subaction", 60261), + symbolSnippet: register("symbol-snippet", 60262), + tasklist: register("tasklist", 60263), + telescope: register("telescope", 60264), + textSize: register("text-size", 60265), + threeBars: register("three-bars", 60266), + thumbsdown: register("thumbsdown", 60267), + thumbsup: register("thumbsup", 60268), + tools: register("tools", 60269), + triangleDown: register("triangle-down", 60270), + triangleLeft: register("triangle-left", 60271), + triangleRight: register("triangle-right", 60272), + triangleUp: register("triangle-up", 60273), + twitter: register("twitter", 60274), + unfold: register("unfold", 60275), + unlock: register("unlock", 60276), + unmute: register("unmute", 60277), + unverified: register("unverified", 60278), + verified: register("verified", 60279), + versions: register("versions", 60280), + vmActive: register("vm-active", 60281), + vmOutline: register("vm-outline", 60282), + vmRunning: register("vm-running", 60283), + watch: register("watch", 60284), + whitespace: register("whitespace", 60285), + wholeWord: register("whole-word", 60286), + window: register("window", 60287), + wordWrap: register("word-wrap", 60288), + zoomIn: register("zoom-in", 60289), + zoomOut: register("zoom-out", 60290), + listFilter: register("list-filter", 60291), + listFlat: register("list-flat", 60292), + listSelection: register("list-selection", 60293), + selection: register("selection", 60293), + listTree: register("list-tree", 60294), + debugBreakpointFunctionUnverified: register("debug-breakpoint-function-unverified", 60295), + debugBreakpointFunction: register("debug-breakpoint-function", 60296), + debugBreakpointFunctionDisabled: register("debug-breakpoint-function-disabled", 60296), + debugStackframeActive: register("debug-stackframe-active", 60297), + circleSmallFilled: register("circle-small-filled", 60298), + debugStackframeDot: register("debug-stackframe-dot", 60298), + terminalDecorationMark: register("terminal-decoration-mark", 60298), + debugStackframe: register("debug-stackframe", 60299), + debugStackframeFocused: register("debug-stackframe-focused", 60299), + debugBreakpointUnsupported: register("debug-breakpoint-unsupported", 60300), + symbolString: register("symbol-string", 60301), + debugReverseContinue: register("debug-reverse-continue", 60302), + debugStepBack: register("debug-step-back", 60303), + debugRestartFrame: register("debug-restart-frame", 60304), + debugAlt: register("debug-alt", 60305), + callIncoming: register("call-incoming", 60306), + callOutgoing: register("call-outgoing", 60307), + menu: register("menu", 60308), + expandAll: register("expand-all", 60309), + feedback: register("feedback", 60310), + gitPullRequestReviewer: register("git-pull-request-reviewer", 60310), + groupByRefType: register("group-by-ref-type", 60311), + ungroupByRefType: register("ungroup-by-ref-type", 60312), + account: register("account", 60313), + gitPullRequestAssignee: register("git-pull-request-assignee", 60313), + bellDot: register("bell-dot", 60314), + debugConsole: register("debug-console", 60315), + library: register("library", 60316), + output: register("output", 60317), + runAll: register("run-all", 60318), + syncIgnored: register("sync-ignored", 60319), + pinned: register("pinned", 60320), + githubInverted: register("github-inverted", 60321), + serverProcess: register("server-process", 60322), + serverEnvironment: register("server-environment", 60323), + pass: register("pass", 60324), + issueClosed: register("issue-closed", 60324), + stopCircle: register("stop-circle", 60325), + playCircle: register("play-circle", 60326), + record: register("record", 60327), + debugAltSmall: register("debug-alt-small", 60328), + vmConnect: register("vm-connect", 60329), + cloud: register("cloud", 60330), + merge: register("merge", 60331), + export: register("export", 60332), + graphLeft: register("graph-left", 60333), + magnet: register("magnet", 60334), + notebook: register("notebook", 60335), + redo: register("redo", 60336), + checkAll: register("check-all", 60337), + pinnedDirty: register("pinned-dirty", 60338), + passFilled: register("pass-filled", 60339), + circleLargeFilled: register("circle-large-filled", 60340), + circleLarge: register("circle-large", 60341), + circleLargeOutline: register("circle-large-outline", 60341), + combine: register("combine", 60342), + gather: register("gather", 60342), + table: register("table", 60343), + variableGroup: register("variable-group", 60344), + typeHierarchy: register("type-hierarchy", 60345), + typeHierarchySub: register("type-hierarchy-sub", 60346), + typeHierarchySuper: register("type-hierarchy-super", 60347), + gitPullRequestCreate: register("git-pull-request-create", 60348), + runAbove: register("run-above", 60349), + runBelow: register("run-below", 60350), + notebookTemplate: register("notebook-template", 60351), + debugRerun: register("debug-rerun", 60352), + workspaceTrusted: register("workspace-trusted", 60353), + workspaceUntrusted: register("workspace-untrusted", 60354), + workspaceUnknown: register("workspace-unknown", 60355), + terminalCmd: register("terminal-cmd", 60356), + terminalDebian: register("terminal-debian", 60357), + terminalLinux: register("terminal-linux", 60358), + terminalPowershell: register("terminal-powershell", 60359), + terminalTmux: register("terminal-tmux", 60360), + terminalUbuntu: register("terminal-ubuntu", 60361), + terminalBash: register("terminal-bash", 60362), + arrowSwap: register("arrow-swap", 60363), + copy: register("copy", 60364), + personAdd: register("person-add", 60365), + filterFilled: register("filter-filled", 60366), + wand: register("wand", 60367), + debugLineByLine: register("debug-line-by-line", 60368), + inspect: register("inspect", 60369), + layers: register("layers", 60370), + layersDot: register("layers-dot", 60371), + layersActive: register("layers-active", 60372), + compass: register("compass", 60373), + compassDot: register("compass-dot", 60374), + compassActive: register("compass-active", 60375), + azure: register("azure", 60376), + issueDraft: register("issue-draft", 60377), + gitPullRequestClosed: register("git-pull-request-closed", 60378), + gitPullRequestDraft: register("git-pull-request-draft", 60379), + debugAll: register("debug-all", 60380), + debugCoverage: register("debug-coverage", 60381), + runErrors: register("run-errors", 60382), + folderLibrary: register("folder-library", 60383), + debugContinueSmall: register("debug-continue-small", 60384), + beakerStop: register("beaker-stop", 60385), + graphLine: register("graph-line", 60386), + graphScatter: register("graph-scatter", 60387), + pieChart: register("pie-chart", 60388), + bracket: register("bracket", 60175), + bracketDot: register("bracket-dot", 60389), + bracketError: register("bracket-error", 60390), + lockSmall: register("lock-small", 60391), + azureDevops: register("azure-devops", 60392), + verifiedFilled: register("verified-filled", 60393), + newline: register("newline", 60394), + layout: register("layout", 60395), + layoutActivitybarLeft: register("layout-activitybar-left", 60396), + layoutActivitybarRight: register("layout-activitybar-right", 60397), + layoutPanelLeft: register("layout-panel-left", 60398), + layoutPanelCenter: register("layout-panel-center", 60399), + layoutPanelJustify: register("layout-panel-justify", 60400), + layoutPanelRight: register("layout-panel-right", 60401), + layoutPanel: register("layout-panel", 60402), + layoutSidebarLeft: register("layout-sidebar-left", 60403), + layoutSidebarRight: register("layout-sidebar-right", 60404), + layoutStatusbar: register("layout-statusbar", 60405), + layoutMenubar: register("layout-menubar", 60406), + layoutCentered: register("layout-centered", 60407), + target: register("target", 60408), + indent: register("indent", 60409), + recordSmall: register("record-small", 60410), + errorSmall: register("error-small", 60411), + terminalDecorationError: register("terminal-decoration-error", 60411), + arrowCircleDown: register("arrow-circle-down", 60412), + arrowCircleLeft: register("arrow-circle-left", 60413), + arrowCircleRight: register("arrow-circle-right", 60414), + arrowCircleUp: register("arrow-circle-up", 60415), + layoutSidebarRightOff: register("layout-sidebar-right-off", 60416), + layoutPanelOff: register("layout-panel-off", 60417), + layoutSidebarLeftOff: register("layout-sidebar-left-off", 60418), + blank: register("blank", 60419), + heartFilled: register("heart-filled", 60420), + map: register("map", 60421), + mapHorizontal: register("map-horizontal", 60421), + foldHorizontal: register("fold-horizontal", 60421), + mapFilled: register("map-filled", 60422), + mapHorizontalFilled: register("map-horizontal-filled", 60422), + foldHorizontalFilled: register("fold-horizontal-filled", 60422), + circleSmall: register("circle-small", 60423), + bellSlash: register("bell-slash", 60424), + bellSlashDot: register("bell-slash-dot", 60425), + commentUnresolved: register("comment-unresolved", 60426), + gitPullRequestGoToChanges: register("git-pull-request-go-to-changes", 60427), + gitPullRequestNewChanges: register("git-pull-request-new-changes", 60428), + searchFuzzy: register("search-fuzzy", 60429), + commentDraft: register("comment-draft", 60430), + send: register("send", 60431), + sparkle: register("sparkle", 60432), + insert: register("insert", 60433), + mic: register("mic", 60434), + thumbsdownFilled: register("thumbsdown-filled", 60435), + thumbsupFilled: register("thumbsup-filled", 60436), + coffee: register("coffee", 60437), + snake: register("snake", 60438), + game: register("game", 60439), + vr: register("vr", 60440), + chip: register("chip", 60441), + piano: register("piano", 60442), + music: register("music", 60443), + micFilled: register("mic-filled", 60444), + repoFetch: register("repo-fetch", 60445), + copilot: register("copilot", 60446), + lightbulbSparkle: register("lightbulb-sparkle", 60447), + robot: register("robot", 60448), + sparkleFilled: register("sparkle-filled", 60449), + diffSingle: register("diff-single", 60450), + diffMultiple: register("diff-multiple", 60451), + surroundWith: register("surround-with", 60452), + share: register("share", 60453), + gitStash: register("git-stash", 60454), + gitStashApply: register("git-stash-apply", 60455), + gitStashPop: register("git-stash-pop", 60456), + vscode: register("vscode", 60457), + vscodeInsiders: register("vscode-insiders", 60458), + codeOss: register("code-oss", 60459), + runCoverage: register("run-coverage", 60460), + runAllCoverage: register("run-all-coverage", 60461), + coverage: register("coverage", 60462), + githubProject: register("github-project", 60463), + mapVertical: register("map-vertical", 60464), + foldVertical: register("fold-vertical", 60464), + mapVerticalFilled: register("map-vertical-filled", 60465), + foldVerticalFilled: register("fold-vertical-filled", 60465), + goToSearch: register("go-to-search", 60466), + percentage: register("percentage", 60467), + sortPercentage: register("sort-percentage", 60467), + attach: register("attach", 60468), + goToEditingSession: register("go-to-editing-session", 60469), + editSession: register("edit-session", 60470), + codeReview: register("code-review", 60471), + copilotWarning: register("copilot-warning", 60472), + python: register("python", 60473), + copilotLarge: register("copilot-large", 60474), + copilotWarningLarge: register("copilot-warning-large", 60475), + keyboardTab: register("keyboard-tab", 60476), + copilotBlocked: register("copilot-blocked", 60477), + copilotNotConnected: register("copilot-not-connected", 60478), + flag: register("flag", 60479), + lightbulbEmpty: register("lightbulb-empty", 60480), + symbolMethodArrow: register("symbol-method-arrow", 60481), + copilotUnavailable: register("copilot-unavailable", 60482), + repoPinned: register("repo-pinned", 60483), + keyboardTabAbove: register("keyboard-tab-above", 60484), + keyboardTabBelow: register("keyboard-tab-below", 60485), + gitPullRequestDone: register("git-pull-request-done", 60486), + mcp: register("mcp", 60487), + extensionsLarge: register("extensions-large", 60488), + layoutPanelDock: register("layout-panel-dock", 60489), + layoutSidebarLeftDock: register("layout-sidebar-left-dock", 60490), + layoutSidebarRightDock: register("layout-sidebar-right-dock", 60491), + copilotInProgress: register("copilot-in-progress", 60492), + copilotError: register("copilot-error", 60493), + copilotSuccess: register("copilot-success", 60494), + chatSparkle: register("chat-sparkle", 60495), + searchSparkle: register("search-sparkle", 60496), + editSparkle: register("edit-sparkle", 60497), + copilotSnooze: register("copilot-snooze", 60498), + sendToRemoteAgent: register("send-to-remote-agent", 60499), + commentDiscussionSparkle: register("comment-discussion-sparkle", 60500), + chatSparkleWarning: register("chat-sparkle-warning", 60501), + chatSparkleError: register("chat-sparkle-error", 60502), + collection: register("collection", 60503), + newCollection: register("new-collection", 60504), + thinking: register("thinking", 60505), + build: register("build", 60506), + commentDiscussionQuote: register("comment-discussion-quote", 60507), + cursor: register("cursor", 60508), + eraser: register("eraser", 60509), + fileText: register("file-text", 60510), + gitLens: register("git-lens", 60511), + quotes: register("quotes", 60512), + rename: register("rename", 60513), + runWithDeps: register("run-with-deps", 60514), + debugConnected: register("debug-connected", 60515), + strikethrough: register("strikethrough", 60516), + openInProduct: register("open-in-product", 60517), + indexZero: register("index-zero", 60518), + agent: register("agent", 60519), + editCode: register("edit-code", 60520), + repoSelected: register("repo-selected", 60521), + skip: register("skip", 60522), + mergeInto: register("merge-into", 60523), + gitBranchChanges: register("git-branch-changes", 60524), + gitBranchStagedChanges: register("git-branch-staged-changes", 60525), + gitBranchConflicts: register("git-branch-conflicts", 60526), + gitBranch: register("git-branch", 60527), + gitBranchCreate: register("git-branch-create", 60527), + gitBranchDelete: register("git-branch-delete", 60527), + searchLarge: register("search-large", 60528), + terminalGitBash: register("terminal-git-bash", 60529) +}; + +// node_modules/monaco-editor-core/esm/vs/base/common/codicons.js +var codiconsDerived = { + dialogError: register("dialog-error", "error"), + dialogWarning: register("dialog-warning", "warning"), + dialogInfo: register("dialog-info", "info"), + dialogClose: register("dialog-close", "close"), + treeItemExpanded: register("tree-item-expanded", "chevron-down"), + // collapsed is done with rotation + treeFilterOnTypeOn: register("tree-filter-on-type-on", "list-filter"), + treeFilterOnTypeOff: register("tree-filter-on-type-off", "list-selection"), + treeFilterClear: register("tree-filter-clear", "close"), + treeItemLoading: register("tree-item-loading", "loading"), + menuSelection: register("menu-selection", "check"), + menuSubmenu: register("menu-submenu", "chevron-right"), + menuBarMore: register("menubar-more", "more"), + scrollbarButtonLeft: register("scrollbar-button-left", "triangle-left"), + scrollbarButtonRight: register("scrollbar-button-right", "triangle-right"), + scrollbarButtonUp: register("scrollbar-button-up", "triangle-up"), + scrollbarButtonDown: register("scrollbar-button-down", "triangle-down"), + toolBarMore: register("toolbar-more", "more"), + quickInputBack: register("quick-input-back", "arrow-left"), + dropDownButton: register("drop-down-button", 60084), + symbolCustomColor: register("symbol-customcolor", 60252), + exportIcon: register("export", 60332), + workspaceUnspecified: register("workspace-unspecified", 60355), + newLine: register("newline", 60394), + thumbsDownFilled: register("thumbsdown-filled", 60435), + thumbsUpFilled: register("thumbsup-filled", 60436), + gitFetch: register("git-fetch", 60445), + lightbulbSparkleAutofix: register("lightbulb-sparkle-autofix", 60447), + debugBreakpointPending: register("debug-breakpoint-pending", 60377) +}; +var Codicon = { + ...codiconsLibrary, + ...codiconsDerived +}; + +// node_modules/monaco-editor-core/esm/vs/editor/common/tokenizationRegistry.js +var TokenizationRegistry = class { + constructor() { + this._tokenizationSupports = /* @__PURE__ */ new Map(); + this._factories = /* @__PURE__ */ new Map(); + this._onDidChange = new Emitter(); + this.onDidChange = this._onDidChange.event; + this._colorMap = null; + } + handleChange(languageIds) { + this._onDidChange.fire({ + changedLanguages: languageIds, + changedColorMap: false + }); + } + register(languageId, support) { + this._tokenizationSupports.set(languageId, support); + this.handleChange([languageId]); + return toDisposable(() => { + if (this._tokenizationSupports.get(languageId) !== support) { + return; + } + this._tokenizationSupports.delete(languageId); + this.handleChange([languageId]); + }); + } + get(languageId) { + return this._tokenizationSupports.get(languageId) || null; + } + registerFactory(languageId, factory) { + this._factories.get(languageId)?.dispose(); + const myData = new TokenizationSupportFactoryData(this, languageId, factory); + this._factories.set(languageId, myData); + return toDisposable(() => { + const v = this._factories.get(languageId); + if (!v || v !== myData) { + return; + } + this._factories.delete(languageId); + v.dispose(); + }); + } + async getOrCreate(languageId) { + const tokenizationSupport = this.get(languageId); + if (tokenizationSupport) { + return tokenizationSupport; + } + const factory = this._factories.get(languageId); + if (!factory || factory.isResolved) { + return null; + } + await factory.resolve(); + return this.get(languageId); + } + isResolved(languageId) { + const tokenizationSupport = this.get(languageId); + if (tokenizationSupport) { + return true; + } + const factory = this._factories.get(languageId); + if (!factory || factory.isResolved) { + return true; + } + return false; + } + setColorMap(colorMap) { + this._colorMap = colorMap; + this._onDidChange.fire({ + changedLanguages: Array.from(this._tokenizationSupports.keys()), + changedColorMap: true + }); + } + getColorMap() { + return this._colorMap; + } + getDefaultBackground() { + if (this._colorMap && this._colorMap.length > 2) { + return this._colorMap[ + 2 + /* ColorId.DefaultBackground */ + ]; + } + return null; + } +}; +var TokenizationSupportFactoryData = class extends Disposable { + get isResolved() { + return this._isResolved; + } + constructor(_registry, _languageId, _factory) { + super(); + this._registry = _registry; + this._languageId = _languageId; + this._factory = _factory; + this._isDisposed = false; + this._resolvePromise = null; + this._isResolved = false; + } + dispose() { + this._isDisposed = true; + super.dispose(); + } + async resolve() { + if (!this._resolvePromise) { + this._resolvePromise = this._create(); + } + return this._resolvePromise; + } + async _create() { + const value = await this._factory.tokenizationSupport; + this._isResolved = true; + if (value && !this._isDisposed) { + this._register(this._registry.register(this._languageId, value)); + } + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/common/languages.js +var Token = class { + constructor(offset, type, language) { + this.offset = offset; + this.type = type; + this.language = language; + this._tokenBrand = void 0; + } + toString() { + return "(" + this.offset + ", " + this.type + ")"; + } +}; +var HoverVerbosityAction; +(function(HoverVerbosityAction3) { + HoverVerbosityAction3[HoverVerbosityAction3["Increase"] = 0] = "Increase"; + HoverVerbosityAction3[HoverVerbosityAction3["Decrease"] = 1] = "Decrease"; +})(HoverVerbosityAction || (HoverVerbosityAction = {})); +var CompletionItemKinds; +(function(CompletionItemKinds2) { + const byKind = /* @__PURE__ */ new Map(); + byKind.set(0, Codicon.symbolMethod); + byKind.set(1, Codicon.symbolFunction); + byKind.set(2, Codicon.symbolConstructor); + byKind.set(3, Codicon.symbolField); + byKind.set(4, Codicon.symbolVariable); + byKind.set(5, Codicon.symbolClass); + byKind.set(6, Codicon.symbolStruct); + byKind.set(7, Codicon.symbolInterface); + byKind.set(8, Codicon.symbolModule); + byKind.set(9, Codicon.symbolProperty); + byKind.set(10, Codicon.symbolEvent); + byKind.set(11, Codicon.symbolOperator); + byKind.set(12, Codicon.symbolUnit); + byKind.set(13, Codicon.symbolValue); + byKind.set(15, Codicon.symbolEnum); + byKind.set(14, Codicon.symbolConstant); + byKind.set(15, Codicon.symbolEnum); + byKind.set(16, Codicon.symbolEnumMember); + byKind.set(17, Codicon.symbolKeyword); + byKind.set(28, Codicon.symbolSnippet); + byKind.set(18, Codicon.symbolText); + byKind.set(19, Codicon.symbolColor); + byKind.set(20, Codicon.symbolFile); + byKind.set(21, Codicon.symbolReference); + byKind.set(22, Codicon.symbolCustomColor); + byKind.set(23, Codicon.symbolFolder); + byKind.set(24, Codicon.symbolTypeParameter); + byKind.set(25, Codicon.account); + byKind.set(26, Codicon.issues); + byKind.set(27, Codicon.tools); + function toIcon(kind) { + let codicon = byKind.get(kind); + if (!codicon) { + console.info("No codicon found for CompletionItemKind " + kind); + codicon = Codicon.symbolProperty; + } + return codicon; + } + CompletionItemKinds2.toIcon = toIcon; + function toLabel(kind) { + switch (kind) { + case 0: + return localize(728, "Method"); + case 1: + return localize(729, "Function"); + case 2: + return localize(730, "Constructor"); + case 3: + return localize(731, "Field"); + case 4: + return localize(732, "Variable"); + case 5: + return localize(733, "Class"); + case 6: + return localize(734, "Struct"); + case 7: + return localize(735, "Interface"); + case 8: + return localize(736, "Module"); + case 9: + return localize(737, "Property"); + case 10: + return localize(738, "Event"); + case 11: + return localize(739, "Operator"); + case 12: + return localize(740, "Unit"); + case 13: + return localize(741, "Value"); + case 14: + return localize(742, "Constant"); + case 15: + return localize(743, "Enum"); + case 16: + return localize(744, "Enum Member"); + case 17: + return localize(745, "Keyword"); + case 18: + return localize(746, "Text"); + case 19: + return localize(747, "Color"); + case 20: + return localize(748, "File"); + case 21: + return localize(749, "Reference"); + case 22: + return localize(750, "Custom Color"); + case 23: + return localize(751, "Folder"); + case 24: + return localize(752, "Type Parameter"); + case 25: + return localize(753, "User"); + case 26: + return localize(754, "Issue"); + case 27: + return localize(755, "Tool"); + case 28: + return localize(756, "Snippet"); + default: + return ""; + } + } + CompletionItemKinds2.toLabel = toLabel; + const data = /* @__PURE__ */ new Map(); + data.set( + "method", + 0 + /* CompletionItemKind.Method */ + ); + data.set( + "function", + 1 + /* CompletionItemKind.Function */ + ); + data.set( + "constructor", + 2 + /* CompletionItemKind.Constructor */ + ); + data.set( + "field", + 3 + /* CompletionItemKind.Field */ + ); + data.set( + "variable", + 4 + /* CompletionItemKind.Variable */ + ); + data.set( + "class", + 5 + /* CompletionItemKind.Class */ + ); + data.set( + "struct", + 6 + /* CompletionItemKind.Struct */ + ); + data.set( + "interface", + 7 + /* CompletionItemKind.Interface */ + ); + data.set( + "module", + 8 + /* CompletionItemKind.Module */ + ); + data.set( + "property", + 9 + /* CompletionItemKind.Property */ + ); + data.set( + "event", + 10 + /* CompletionItemKind.Event */ + ); + data.set( + "operator", + 11 + /* CompletionItemKind.Operator */ + ); + data.set( + "unit", + 12 + /* CompletionItemKind.Unit */ + ); + data.set( + "value", + 13 + /* CompletionItemKind.Value */ + ); + data.set( + "constant", + 14 + /* CompletionItemKind.Constant */ + ); + data.set( + "enum", + 15 + /* CompletionItemKind.Enum */ + ); + data.set( + "enum-member", + 16 + /* CompletionItemKind.EnumMember */ + ); + data.set( + "enumMember", + 16 + /* CompletionItemKind.EnumMember */ + ); + data.set( + "keyword", + 17 + /* CompletionItemKind.Keyword */ + ); + data.set( + "snippet", + 28 + /* CompletionItemKind.Snippet */ + ); + data.set( + "text", + 18 + /* CompletionItemKind.Text */ + ); + data.set( + "color", + 19 + /* CompletionItemKind.Color */ + ); + data.set( + "file", + 20 + /* CompletionItemKind.File */ + ); + data.set( + "reference", + 21 + /* CompletionItemKind.Reference */ + ); + data.set( + "customcolor", + 22 + /* CompletionItemKind.Customcolor */ + ); + data.set( + "folder", + 23 + /* CompletionItemKind.Folder */ + ); + data.set( + "type-parameter", + 24 + /* CompletionItemKind.TypeParameter */ + ); + data.set( + "typeParameter", + 24 + /* CompletionItemKind.TypeParameter */ + ); + data.set( + "account", + 25 + /* CompletionItemKind.User */ + ); + data.set( + "issue", + 26 + /* CompletionItemKind.Issue */ + ); + data.set( + "tool", + 27 + /* CompletionItemKind.Tool */ + ); + function fromString(value, strict) { + let res = data.get(value); + if (typeof res === "undefined" && !strict) { + res = 9; + } + return res; + } + CompletionItemKinds2.fromString = fromString; +})(CompletionItemKinds || (CompletionItemKinds = {})); +var InlineCompletionTriggerKind; +(function(InlineCompletionTriggerKind3) { + InlineCompletionTriggerKind3[InlineCompletionTriggerKind3["Automatic"] = 0] = "Automatic"; + InlineCompletionTriggerKind3[InlineCompletionTriggerKind3["Explicit"] = 1] = "Explicit"; +})(InlineCompletionTriggerKind || (InlineCompletionTriggerKind = {})); +var InlineCompletionHintStyle; +(function(InlineCompletionHintStyle3) { + InlineCompletionHintStyle3[InlineCompletionHintStyle3["Code"] = 1] = "Code"; + InlineCompletionHintStyle3[InlineCompletionHintStyle3["Label"] = 2] = "Label"; +})(InlineCompletionHintStyle || (InlineCompletionHintStyle = {})); +var InlineCompletionEndOfLifeReasonKind; +(function(InlineCompletionEndOfLifeReasonKind3) { + InlineCompletionEndOfLifeReasonKind3[InlineCompletionEndOfLifeReasonKind3["Accepted"] = 0] = "Accepted"; + InlineCompletionEndOfLifeReasonKind3[InlineCompletionEndOfLifeReasonKind3["Rejected"] = 1] = "Rejected"; + InlineCompletionEndOfLifeReasonKind3[InlineCompletionEndOfLifeReasonKind3["Ignored"] = 2] = "Ignored"; +})(InlineCompletionEndOfLifeReasonKind || (InlineCompletionEndOfLifeReasonKind = {})); +var DocumentPasteTriggerKind; +(function(DocumentPasteTriggerKind2) { + DocumentPasteTriggerKind2[DocumentPasteTriggerKind2["Automatic"] = 0] = "Automatic"; + DocumentPasteTriggerKind2[DocumentPasteTriggerKind2["PasteAs"] = 1] = "PasteAs"; +})(DocumentPasteTriggerKind || (DocumentPasteTriggerKind = {})); +var SignatureHelpTriggerKind; +(function(SignatureHelpTriggerKind3) { + SignatureHelpTriggerKind3[SignatureHelpTriggerKind3["Invoke"] = 1] = "Invoke"; + SignatureHelpTriggerKind3[SignatureHelpTriggerKind3["TriggerCharacter"] = 2] = "TriggerCharacter"; + SignatureHelpTriggerKind3[SignatureHelpTriggerKind3["ContentChange"] = 3] = "ContentChange"; +})(SignatureHelpTriggerKind || (SignatureHelpTriggerKind = {})); +var DocumentHighlightKind; +(function(DocumentHighlightKind3) { + DocumentHighlightKind3[DocumentHighlightKind3["Text"] = 0] = "Text"; + DocumentHighlightKind3[DocumentHighlightKind3["Read"] = 1] = "Read"; + DocumentHighlightKind3[DocumentHighlightKind3["Write"] = 2] = "Write"; +})(DocumentHighlightKind || (DocumentHighlightKind = {})); +var symbolKindNames = { + [ + 17 + /* SymbolKind.Array */ + ]: localize(757, "array"), + [ + 16 + /* SymbolKind.Boolean */ + ]: localize(758, "boolean"), + [ + 4 + /* SymbolKind.Class */ + ]: localize(759, "class"), + [ + 13 + /* SymbolKind.Constant */ + ]: localize(760, "constant"), + [ + 8 + /* SymbolKind.Constructor */ + ]: localize(761, "constructor"), + [ + 9 + /* SymbolKind.Enum */ + ]: localize(762, "enumeration"), + [ + 21 + /* SymbolKind.EnumMember */ + ]: localize(763, "enumeration member"), + [ + 23 + /* SymbolKind.Event */ + ]: localize(764, "event"), + [ + 7 + /* SymbolKind.Field */ + ]: localize(765, "field"), + [ + 0 + /* SymbolKind.File */ + ]: localize(766, "file"), + [ + 11 + /* SymbolKind.Function */ + ]: localize(767, "function"), + [ + 10 + /* SymbolKind.Interface */ + ]: localize(768, "interface"), + [ + 19 + /* SymbolKind.Key */ + ]: localize(769, "key"), + [ + 5 + /* SymbolKind.Method */ + ]: localize(770, "method"), + [ + 1 + /* SymbolKind.Module */ + ]: localize(771, "module"), + [ + 2 + /* SymbolKind.Namespace */ + ]: localize(772, "namespace"), + [ + 20 + /* SymbolKind.Null */ + ]: localize(773, "null"), + [ + 15 + /* SymbolKind.Number */ + ]: localize(774, "number"), + [ + 18 + /* SymbolKind.Object */ + ]: localize(775, "object"), + [ + 24 + /* SymbolKind.Operator */ + ]: localize(776, "operator"), + [ + 3 + /* SymbolKind.Package */ + ]: localize(777, "package"), + [ + 6 + /* SymbolKind.Property */ + ]: localize(778, "property"), + [ + 14 + /* SymbolKind.String */ + ]: localize(779, "string"), + [ + 22 + /* SymbolKind.Struct */ + ]: localize(780, "struct"), + [ + 25 + /* SymbolKind.TypeParameter */ + ]: localize(781, "type parameter"), + [ + 12 + /* SymbolKind.Variable */ + ]: localize(782, "variable") +}; +var SymbolKinds; +(function(SymbolKinds2) { + const byKind = /* @__PURE__ */ new Map(); + byKind.set(0, Codicon.symbolFile); + byKind.set(1, Codicon.symbolModule); + byKind.set(2, Codicon.symbolNamespace); + byKind.set(3, Codicon.symbolPackage); + byKind.set(4, Codicon.symbolClass); + byKind.set(5, Codicon.symbolMethod); + byKind.set(6, Codicon.symbolProperty); + byKind.set(7, Codicon.symbolField); + byKind.set(8, Codicon.symbolConstructor); + byKind.set(9, Codicon.symbolEnum); + byKind.set(10, Codicon.symbolInterface); + byKind.set(11, Codicon.symbolFunction); + byKind.set(12, Codicon.symbolVariable); + byKind.set(13, Codicon.symbolConstant); + byKind.set(14, Codicon.symbolString); + byKind.set(15, Codicon.symbolNumber); + byKind.set(16, Codicon.symbolBoolean); + byKind.set(17, Codicon.symbolArray); + byKind.set(18, Codicon.symbolObject); + byKind.set(19, Codicon.symbolKey); + byKind.set(20, Codicon.symbolNull); + byKind.set(21, Codicon.symbolEnumMember); + byKind.set(22, Codicon.symbolStruct); + byKind.set(23, Codicon.symbolEvent); + byKind.set(24, Codicon.symbolOperator); + byKind.set(25, Codicon.symbolTypeParameter); + function toIcon(kind) { + let icon = byKind.get(kind); + if (!icon) { + console.info("No codicon found for SymbolKind " + kind); + icon = Codicon.symbolProperty; + } + return icon; + } + SymbolKinds2.toIcon = toIcon; + const byCompletionKind = /* @__PURE__ */ new Map(); + byCompletionKind.set( + 0, + 20 + /* CompletionItemKind.File */ + ); + byCompletionKind.set( + 1, + 8 + /* CompletionItemKind.Module */ + ); + byCompletionKind.set( + 2, + 8 + /* CompletionItemKind.Module */ + ); + byCompletionKind.set( + 3, + 8 + /* CompletionItemKind.Module */ + ); + byCompletionKind.set( + 4, + 5 + /* CompletionItemKind.Class */ + ); + byCompletionKind.set( + 5, + 0 + /* CompletionItemKind.Method */ + ); + byCompletionKind.set( + 6, + 9 + /* CompletionItemKind.Property */ + ); + byCompletionKind.set( + 7, + 3 + /* CompletionItemKind.Field */ + ); + byCompletionKind.set( + 8, + 2 + /* CompletionItemKind.Constructor */ + ); + byCompletionKind.set( + 9, + 15 + /* CompletionItemKind.Enum */ + ); + byCompletionKind.set( + 10, + 7 + /* CompletionItemKind.Interface */ + ); + byCompletionKind.set( + 11, + 1 + /* CompletionItemKind.Function */ + ); + byCompletionKind.set( + 12, + 4 + /* CompletionItemKind.Variable */ + ); + byCompletionKind.set( + 13, + 14 + /* CompletionItemKind.Constant */ + ); + byCompletionKind.set( + 14, + 18 + /* CompletionItemKind.Text */ + ); + byCompletionKind.set( + 15, + 13 + /* CompletionItemKind.Value */ + ); + byCompletionKind.set( + 16, + 13 + /* CompletionItemKind.Value */ + ); + byCompletionKind.set( + 17, + 13 + /* CompletionItemKind.Value */ + ); + byCompletionKind.set( + 18, + 13 + /* CompletionItemKind.Value */ + ); + byCompletionKind.set( + 19, + 17 + /* CompletionItemKind.Keyword */ + ); + byCompletionKind.set( + 20, + 13 + /* CompletionItemKind.Value */ + ); + byCompletionKind.set( + 21, + 16 + /* CompletionItemKind.EnumMember */ + ); + byCompletionKind.set( + 22, + 6 + /* CompletionItemKind.Struct */ + ); + byCompletionKind.set( + 23, + 10 + /* CompletionItemKind.Event */ + ); + byCompletionKind.set( + 24, + 11 + /* CompletionItemKind.Operator */ + ); + byCompletionKind.set( + 25, + 24 + /* CompletionItemKind.TypeParameter */ + ); + function toCompletionKind(kind) { + let completionKind = byCompletionKind.get(kind); + if (completionKind === void 0) { + console.info("No completion kind found for SymbolKind " + kind); + completionKind = 20; + } + return completionKind; + } + SymbolKinds2.toCompletionKind = toCompletionKind; +})(SymbolKinds || (SymbolKinds = {})); +var FoldingRangeKind = class _FoldingRangeKind { + static { + this.Comment = new _FoldingRangeKind("comment"); + } + static { + this.Imports = new _FoldingRangeKind("imports"); + } + static { + this.Region = new _FoldingRangeKind("region"); + } + /** + * Returns a {@link FoldingRangeKind} for the given value. + * + * @param value of the kind. + */ + static fromValue(value) { + switch (value) { + case "comment": + return _FoldingRangeKind.Comment; + case "imports": + return _FoldingRangeKind.Imports; + case "region": + return _FoldingRangeKind.Region; + } + return new _FoldingRangeKind(value); + } + /** + * Creates a new {@link FoldingRangeKind}. + * + * @param value of the kind. + */ + constructor(value) { + this.value = value; + } +}; +var NewSymbolNameTag; +(function(NewSymbolNameTag3) { + NewSymbolNameTag3[NewSymbolNameTag3["AIGenerated"] = 1] = "AIGenerated"; +})(NewSymbolNameTag || (NewSymbolNameTag = {})); +var NewSymbolNameTriggerKind; +(function(NewSymbolNameTriggerKind3) { + NewSymbolNameTriggerKind3[NewSymbolNameTriggerKind3["Invoke"] = 0] = "Invoke"; + NewSymbolNameTriggerKind3[NewSymbolNameTriggerKind3["Automatic"] = 1] = "Automatic"; +})(NewSymbolNameTriggerKind || (NewSymbolNameTriggerKind = {})); +var Command; +(function(Command2) { + function is(obj) { + if (!obj || typeof obj !== "object") { + return false; + } + return typeof obj.id === "string" && typeof obj.title === "string"; + } + Command2.is = is; +})(Command || (Command = {})); +var InlayHintKind; +(function(InlayHintKind3) { + InlayHintKind3[InlayHintKind3["Type"] = 1] = "Type"; + InlayHintKind3[InlayHintKind3["Parameter"] = 2] = "Parameter"; +})(InlayHintKind || (InlayHintKind = {})); +var TokenizationRegistry2 = new TokenizationRegistry(); + +// node_modules/monaco-editor-core/esm/vs/editor/common/standalone/standaloneEnums.js +var AccessibilitySupport; +(function(AccessibilitySupport2) { + AccessibilitySupport2[AccessibilitySupport2["Unknown"] = 0] = "Unknown"; + AccessibilitySupport2[AccessibilitySupport2["Disabled"] = 1] = "Disabled"; + AccessibilitySupport2[AccessibilitySupport2["Enabled"] = 2] = "Enabled"; +})(AccessibilitySupport || (AccessibilitySupport = {})); +var CodeActionTriggerType; +(function(CodeActionTriggerType2) { + CodeActionTriggerType2[CodeActionTriggerType2["Invoke"] = 1] = "Invoke"; + CodeActionTriggerType2[CodeActionTriggerType2["Auto"] = 2] = "Auto"; +})(CodeActionTriggerType || (CodeActionTriggerType = {})); +var CompletionItemInsertTextRule; +(function(CompletionItemInsertTextRule2) { + CompletionItemInsertTextRule2[CompletionItemInsertTextRule2["None"] = 0] = "None"; + CompletionItemInsertTextRule2[CompletionItemInsertTextRule2["KeepWhitespace"] = 1] = "KeepWhitespace"; + CompletionItemInsertTextRule2[CompletionItemInsertTextRule2["InsertAsSnippet"] = 4] = "InsertAsSnippet"; +})(CompletionItemInsertTextRule || (CompletionItemInsertTextRule = {})); +var CompletionItemKind; +(function(CompletionItemKind2) { + CompletionItemKind2[CompletionItemKind2["Method"] = 0] = "Method"; + CompletionItemKind2[CompletionItemKind2["Function"] = 1] = "Function"; + CompletionItemKind2[CompletionItemKind2["Constructor"] = 2] = "Constructor"; + CompletionItemKind2[CompletionItemKind2["Field"] = 3] = "Field"; + CompletionItemKind2[CompletionItemKind2["Variable"] = 4] = "Variable"; + CompletionItemKind2[CompletionItemKind2["Class"] = 5] = "Class"; + CompletionItemKind2[CompletionItemKind2["Struct"] = 6] = "Struct"; + CompletionItemKind2[CompletionItemKind2["Interface"] = 7] = "Interface"; + CompletionItemKind2[CompletionItemKind2["Module"] = 8] = "Module"; + CompletionItemKind2[CompletionItemKind2["Property"] = 9] = "Property"; + CompletionItemKind2[CompletionItemKind2["Event"] = 10] = "Event"; + CompletionItemKind2[CompletionItemKind2["Operator"] = 11] = "Operator"; + CompletionItemKind2[CompletionItemKind2["Unit"] = 12] = "Unit"; + CompletionItemKind2[CompletionItemKind2["Value"] = 13] = "Value"; + CompletionItemKind2[CompletionItemKind2["Constant"] = 14] = "Constant"; + CompletionItemKind2[CompletionItemKind2["Enum"] = 15] = "Enum"; + CompletionItemKind2[CompletionItemKind2["EnumMember"] = 16] = "EnumMember"; + CompletionItemKind2[CompletionItemKind2["Keyword"] = 17] = "Keyword"; + CompletionItemKind2[CompletionItemKind2["Text"] = 18] = "Text"; + CompletionItemKind2[CompletionItemKind2["Color"] = 19] = "Color"; + CompletionItemKind2[CompletionItemKind2["File"] = 20] = "File"; + CompletionItemKind2[CompletionItemKind2["Reference"] = 21] = "Reference"; + CompletionItemKind2[CompletionItemKind2["Customcolor"] = 22] = "Customcolor"; + CompletionItemKind2[CompletionItemKind2["Folder"] = 23] = "Folder"; + CompletionItemKind2[CompletionItemKind2["TypeParameter"] = 24] = "TypeParameter"; + CompletionItemKind2[CompletionItemKind2["User"] = 25] = "User"; + CompletionItemKind2[CompletionItemKind2["Issue"] = 26] = "Issue"; + CompletionItemKind2[CompletionItemKind2["Tool"] = 27] = "Tool"; + CompletionItemKind2[CompletionItemKind2["Snippet"] = 28] = "Snippet"; +})(CompletionItemKind || (CompletionItemKind = {})); +var CompletionItemTag; +(function(CompletionItemTag2) { + CompletionItemTag2[CompletionItemTag2["Deprecated"] = 1] = "Deprecated"; +})(CompletionItemTag || (CompletionItemTag = {})); +var CompletionTriggerKind; +(function(CompletionTriggerKind2) { + CompletionTriggerKind2[CompletionTriggerKind2["Invoke"] = 0] = "Invoke"; + CompletionTriggerKind2[CompletionTriggerKind2["TriggerCharacter"] = 1] = "TriggerCharacter"; + CompletionTriggerKind2[CompletionTriggerKind2["TriggerForIncompleteCompletions"] = 2] = "TriggerForIncompleteCompletions"; +})(CompletionTriggerKind || (CompletionTriggerKind = {})); +var ContentWidgetPositionPreference; +(function(ContentWidgetPositionPreference2) { + ContentWidgetPositionPreference2[ContentWidgetPositionPreference2["EXACT"] = 0] = "EXACT"; + ContentWidgetPositionPreference2[ContentWidgetPositionPreference2["ABOVE"] = 1] = "ABOVE"; + ContentWidgetPositionPreference2[ContentWidgetPositionPreference2["BELOW"] = 2] = "BELOW"; +})(ContentWidgetPositionPreference || (ContentWidgetPositionPreference = {})); +var CursorChangeReason; +(function(CursorChangeReason2) { + CursorChangeReason2[CursorChangeReason2["NotSet"] = 0] = "NotSet"; + CursorChangeReason2[CursorChangeReason2["ContentFlush"] = 1] = "ContentFlush"; + CursorChangeReason2[CursorChangeReason2["RecoverFromMarkers"] = 2] = "RecoverFromMarkers"; + CursorChangeReason2[CursorChangeReason2["Explicit"] = 3] = "Explicit"; + CursorChangeReason2[CursorChangeReason2["Paste"] = 4] = "Paste"; + CursorChangeReason2[CursorChangeReason2["Undo"] = 5] = "Undo"; + CursorChangeReason2[CursorChangeReason2["Redo"] = 6] = "Redo"; +})(CursorChangeReason || (CursorChangeReason = {})); +var DefaultEndOfLine; +(function(DefaultEndOfLine2) { + DefaultEndOfLine2[DefaultEndOfLine2["LF"] = 1] = "LF"; + DefaultEndOfLine2[DefaultEndOfLine2["CRLF"] = 2] = "CRLF"; +})(DefaultEndOfLine || (DefaultEndOfLine = {})); +var DocumentHighlightKind2; +(function(DocumentHighlightKind3) { + DocumentHighlightKind3[DocumentHighlightKind3["Text"] = 0] = "Text"; + DocumentHighlightKind3[DocumentHighlightKind3["Read"] = 1] = "Read"; + DocumentHighlightKind3[DocumentHighlightKind3["Write"] = 2] = "Write"; +})(DocumentHighlightKind2 || (DocumentHighlightKind2 = {})); +var EditorAutoIndentStrategy; +(function(EditorAutoIndentStrategy2) { + EditorAutoIndentStrategy2[EditorAutoIndentStrategy2["None"] = 0] = "None"; + EditorAutoIndentStrategy2[EditorAutoIndentStrategy2["Keep"] = 1] = "Keep"; + EditorAutoIndentStrategy2[EditorAutoIndentStrategy2["Brackets"] = 2] = "Brackets"; + EditorAutoIndentStrategy2[EditorAutoIndentStrategy2["Advanced"] = 3] = "Advanced"; + EditorAutoIndentStrategy2[EditorAutoIndentStrategy2["Full"] = 4] = "Full"; +})(EditorAutoIndentStrategy || (EditorAutoIndentStrategy = {})); +var EditorOption; +(function(EditorOption2) { + EditorOption2[EditorOption2["acceptSuggestionOnCommitCharacter"] = 0] = "acceptSuggestionOnCommitCharacter"; + EditorOption2[EditorOption2["acceptSuggestionOnEnter"] = 1] = "acceptSuggestionOnEnter"; + EditorOption2[EditorOption2["accessibilitySupport"] = 2] = "accessibilitySupport"; + EditorOption2[EditorOption2["accessibilityPageSize"] = 3] = "accessibilityPageSize"; + EditorOption2[EditorOption2["allowOverflow"] = 4] = "allowOverflow"; + EditorOption2[EditorOption2["allowVariableLineHeights"] = 5] = "allowVariableLineHeights"; + EditorOption2[EditorOption2["allowVariableFonts"] = 6] = "allowVariableFonts"; + EditorOption2[EditorOption2["allowVariableFontsInAccessibilityMode"] = 7] = "allowVariableFontsInAccessibilityMode"; + EditorOption2[EditorOption2["ariaLabel"] = 8] = "ariaLabel"; + EditorOption2[EditorOption2["ariaRequired"] = 9] = "ariaRequired"; + EditorOption2[EditorOption2["autoClosingBrackets"] = 10] = "autoClosingBrackets"; + EditorOption2[EditorOption2["autoClosingComments"] = 11] = "autoClosingComments"; + EditorOption2[EditorOption2["screenReaderAnnounceInlineSuggestion"] = 12] = "screenReaderAnnounceInlineSuggestion"; + EditorOption2[EditorOption2["autoClosingDelete"] = 13] = "autoClosingDelete"; + EditorOption2[EditorOption2["autoClosingOvertype"] = 14] = "autoClosingOvertype"; + EditorOption2[EditorOption2["autoClosingQuotes"] = 15] = "autoClosingQuotes"; + EditorOption2[EditorOption2["autoIndent"] = 16] = "autoIndent"; + EditorOption2[EditorOption2["autoIndentOnPaste"] = 17] = "autoIndentOnPaste"; + EditorOption2[EditorOption2["autoIndentOnPasteWithinString"] = 18] = "autoIndentOnPasteWithinString"; + EditorOption2[EditorOption2["automaticLayout"] = 19] = "automaticLayout"; + EditorOption2[EditorOption2["autoSurround"] = 20] = "autoSurround"; + EditorOption2[EditorOption2["bracketPairColorization"] = 21] = "bracketPairColorization"; + EditorOption2[EditorOption2["guides"] = 22] = "guides"; + EditorOption2[EditorOption2["codeLens"] = 23] = "codeLens"; + EditorOption2[EditorOption2["codeLensFontFamily"] = 24] = "codeLensFontFamily"; + EditorOption2[EditorOption2["codeLensFontSize"] = 25] = "codeLensFontSize"; + EditorOption2[EditorOption2["colorDecorators"] = 26] = "colorDecorators"; + EditorOption2[EditorOption2["colorDecoratorsLimit"] = 27] = "colorDecoratorsLimit"; + EditorOption2[EditorOption2["columnSelection"] = 28] = "columnSelection"; + EditorOption2[EditorOption2["comments"] = 29] = "comments"; + EditorOption2[EditorOption2["contextmenu"] = 30] = "contextmenu"; + EditorOption2[EditorOption2["copyWithSyntaxHighlighting"] = 31] = "copyWithSyntaxHighlighting"; + EditorOption2[EditorOption2["cursorBlinking"] = 32] = "cursorBlinking"; + EditorOption2[EditorOption2["cursorSmoothCaretAnimation"] = 33] = "cursorSmoothCaretAnimation"; + EditorOption2[EditorOption2["cursorStyle"] = 34] = "cursorStyle"; + EditorOption2[EditorOption2["cursorSurroundingLines"] = 35] = "cursorSurroundingLines"; + EditorOption2[EditorOption2["cursorSurroundingLinesStyle"] = 36] = "cursorSurroundingLinesStyle"; + EditorOption2[EditorOption2["cursorWidth"] = 37] = "cursorWidth"; + EditorOption2[EditorOption2["cursorHeight"] = 38] = "cursorHeight"; + EditorOption2[EditorOption2["disableLayerHinting"] = 39] = "disableLayerHinting"; + EditorOption2[EditorOption2["disableMonospaceOptimizations"] = 40] = "disableMonospaceOptimizations"; + EditorOption2[EditorOption2["domReadOnly"] = 41] = "domReadOnly"; + EditorOption2[EditorOption2["dragAndDrop"] = 42] = "dragAndDrop"; + EditorOption2[EditorOption2["dropIntoEditor"] = 43] = "dropIntoEditor"; + EditorOption2[EditorOption2["editContext"] = 44] = "editContext"; + EditorOption2[EditorOption2["emptySelectionClipboard"] = 45] = "emptySelectionClipboard"; + EditorOption2[EditorOption2["experimentalGpuAcceleration"] = 46] = "experimentalGpuAcceleration"; + EditorOption2[EditorOption2["experimentalWhitespaceRendering"] = 47] = "experimentalWhitespaceRendering"; + EditorOption2[EditorOption2["extraEditorClassName"] = 48] = "extraEditorClassName"; + EditorOption2[EditorOption2["fastScrollSensitivity"] = 49] = "fastScrollSensitivity"; + EditorOption2[EditorOption2["find"] = 50] = "find"; + EditorOption2[EditorOption2["fixedOverflowWidgets"] = 51] = "fixedOverflowWidgets"; + EditorOption2[EditorOption2["folding"] = 52] = "folding"; + EditorOption2[EditorOption2["foldingStrategy"] = 53] = "foldingStrategy"; + EditorOption2[EditorOption2["foldingHighlight"] = 54] = "foldingHighlight"; + EditorOption2[EditorOption2["foldingImportsByDefault"] = 55] = "foldingImportsByDefault"; + EditorOption2[EditorOption2["foldingMaximumRegions"] = 56] = "foldingMaximumRegions"; + EditorOption2[EditorOption2["unfoldOnClickAfterEndOfLine"] = 57] = "unfoldOnClickAfterEndOfLine"; + EditorOption2[EditorOption2["fontFamily"] = 58] = "fontFamily"; + EditorOption2[EditorOption2["fontInfo"] = 59] = "fontInfo"; + EditorOption2[EditorOption2["fontLigatures"] = 60] = "fontLigatures"; + EditorOption2[EditorOption2["fontSize"] = 61] = "fontSize"; + EditorOption2[EditorOption2["fontWeight"] = 62] = "fontWeight"; + EditorOption2[EditorOption2["fontVariations"] = 63] = "fontVariations"; + EditorOption2[EditorOption2["formatOnPaste"] = 64] = "formatOnPaste"; + EditorOption2[EditorOption2["formatOnType"] = 65] = "formatOnType"; + EditorOption2[EditorOption2["glyphMargin"] = 66] = "glyphMargin"; + EditorOption2[EditorOption2["gotoLocation"] = 67] = "gotoLocation"; + EditorOption2[EditorOption2["hideCursorInOverviewRuler"] = 68] = "hideCursorInOverviewRuler"; + EditorOption2[EditorOption2["hover"] = 69] = "hover"; + EditorOption2[EditorOption2["inDiffEditor"] = 70] = "inDiffEditor"; + EditorOption2[EditorOption2["inlineSuggest"] = 71] = "inlineSuggest"; + EditorOption2[EditorOption2["letterSpacing"] = 72] = "letterSpacing"; + EditorOption2[EditorOption2["lightbulb"] = 73] = "lightbulb"; + EditorOption2[EditorOption2["lineDecorationsWidth"] = 74] = "lineDecorationsWidth"; + EditorOption2[EditorOption2["lineHeight"] = 75] = "lineHeight"; + EditorOption2[EditorOption2["lineNumbers"] = 76] = "lineNumbers"; + EditorOption2[EditorOption2["lineNumbersMinChars"] = 77] = "lineNumbersMinChars"; + EditorOption2[EditorOption2["linkedEditing"] = 78] = "linkedEditing"; + EditorOption2[EditorOption2["links"] = 79] = "links"; + EditorOption2[EditorOption2["matchBrackets"] = 80] = "matchBrackets"; + EditorOption2[EditorOption2["minimap"] = 81] = "minimap"; + EditorOption2[EditorOption2["mouseStyle"] = 82] = "mouseStyle"; + EditorOption2[EditorOption2["mouseWheelScrollSensitivity"] = 83] = "mouseWheelScrollSensitivity"; + EditorOption2[EditorOption2["mouseWheelZoom"] = 84] = "mouseWheelZoom"; + EditorOption2[EditorOption2["multiCursorMergeOverlapping"] = 85] = "multiCursorMergeOverlapping"; + EditorOption2[EditorOption2["multiCursorModifier"] = 86] = "multiCursorModifier"; + EditorOption2[EditorOption2["mouseMiddleClickAction"] = 87] = "mouseMiddleClickAction"; + EditorOption2[EditorOption2["multiCursorPaste"] = 88] = "multiCursorPaste"; + EditorOption2[EditorOption2["multiCursorLimit"] = 89] = "multiCursorLimit"; + EditorOption2[EditorOption2["occurrencesHighlight"] = 90] = "occurrencesHighlight"; + EditorOption2[EditorOption2["occurrencesHighlightDelay"] = 91] = "occurrencesHighlightDelay"; + EditorOption2[EditorOption2["overtypeCursorStyle"] = 92] = "overtypeCursorStyle"; + EditorOption2[EditorOption2["overtypeOnPaste"] = 93] = "overtypeOnPaste"; + EditorOption2[EditorOption2["overviewRulerBorder"] = 94] = "overviewRulerBorder"; + EditorOption2[EditorOption2["overviewRulerLanes"] = 95] = "overviewRulerLanes"; + EditorOption2[EditorOption2["padding"] = 96] = "padding"; + EditorOption2[EditorOption2["pasteAs"] = 97] = "pasteAs"; + EditorOption2[EditorOption2["parameterHints"] = 98] = "parameterHints"; + EditorOption2[EditorOption2["peekWidgetDefaultFocus"] = 99] = "peekWidgetDefaultFocus"; + EditorOption2[EditorOption2["placeholder"] = 100] = "placeholder"; + EditorOption2[EditorOption2["definitionLinkOpensInPeek"] = 101] = "definitionLinkOpensInPeek"; + EditorOption2[EditorOption2["quickSuggestions"] = 102] = "quickSuggestions"; + EditorOption2[EditorOption2["quickSuggestionsDelay"] = 103] = "quickSuggestionsDelay"; + EditorOption2[EditorOption2["readOnly"] = 104] = "readOnly"; + EditorOption2[EditorOption2["readOnlyMessage"] = 105] = "readOnlyMessage"; + EditorOption2[EditorOption2["renameOnType"] = 106] = "renameOnType"; + EditorOption2[EditorOption2["renderRichScreenReaderContent"] = 107] = "renderRichScreenReaderContent"; + EditorOption2[EditorOption2["renderControlCharacters"] = 108] = "renderControlCharacters"; + EditorOption2[EditorOption2["renderFinalNewline"] = 109] = "renderFinalNewline"; + EditorOption2[EditorOption2["renderLineHighlight"] = 110] = "renderLineHighlight"; + EditorOption2[EditorOption2["renderLineHighlightOnlyWhenFocus"] = 111] = "renderLineHighlightOnlyWhenFocus"; + EditorOption2[EditorOption2["renderValidationDecorations"] = 112] = "renderValidationDecorations"; + EditorOption2[EditorOption2["renderWhitespace"] = 113] = "renderWhitespace"; + EditorOption2[EditorOption2["revealHorizontalRightPadding"] = 114] = "revealHorizontalRightPadding"; + EditorOption2[EditorOption2["roundedSelection"] = 115] = "roundedSelection"; + EditorOption2[EditorOption2["rulers"] = 116] = "rulers"; + EditorOption2[EditorOption2["scrollbar"] = 117] = "scrollbar"; + EditorOption2[EditorOption2["scrollBeyondLastColumn"] = 118] = "scrollBeyondLastColumn"; + EditorOption2[EditorOption2["scrollBeyondLastLine"] = 119] = "scrollBeyondLastLine"; + EditorOption2[EditorOption2["scrollPredominantAxis"] = 120] = "scrollPredominantAxis"; + EditorOption2[EditorOption2["selectionClipboard"] = 121] = "selectionClipboard"; + EditorOption2[EditorOption2["selectionHighlight"] = 122] = "selectionHighlight"; + EditorOption2[EditorOption2["selectionHighlightMaxLength"] = 123] = "selectionHighlightMaxLength"; + EditorOption2[EditorOption2["selectionHighlightMultiline"] = 124] = "selectionHighlightMultiline"; + EditorOption2[EditorOption2["selectOnLineNumbers"] = 125] = "selectOnLineNumbers"; + EditorOption2[EditorOption2["showFoldingControls"] = 126] = "showFoldingControls"; + EditorOption2[EditorOption2["showUnused"] = 127] = "showUnused"; + EditorOption2[EditorOption2["snippetSuggestions"] = 128] = "snippetSuggestions"; + EditorOption2[EditorOption2["smartSelect"] = 129] = "smartSelect"; + EditorOption2[EditorOption2["smoothScrolling"] = 130] = "smoothScrolling"; + EditorOption2[EditorOption2["stickyScroll"] = 131] = "stickyScroll"; + EditorOption2[EditorOption2["stickyTabStops"] = 132] = "stickyTabStops"; + EditorOption2[EditorOption2["stopRenderingLineAfter"] = 133] = "stopRenderingLineAfter"; + EditorOption2[EditorOption2["suggest"] = 134] = "suggest"; + EditorOption2[EditorOption2["suggestFontSize"] = 135] = "suggestFontSize"; + EditorOption2[EditorOption2["suggestLineHeight"] = 136] = "suggestLineHeight"; + EditorOption2[EditorOption2["suggestOnTriggerCharacters"] = 137] = "suggestOnTriggerCharacters"; + EditorOption2[EditorOption2["suggestSelection"] = 138] = "suggestSelection"; + EditorOption2[EditorOption2["tabCompletion"] = 139] = "tabCompletion"; + EditorOption2[EditorOption2["tabIndex"] = 140] = "tabIndex"; + EditorOption2[EditorOption2["trimWhitespaceOnDelete"] = 141] = "trimWhitespaceOnDelete"; + EditorOption2[EditorOption2["unicodeHighlighting"] = 142] = "unicodeHighlighting"; + EditorOption2[EditorOption2["unusualLineTerminators"] = 143] = "unusualLineTerminators"; + EditorOption2[EditorOption2["useShadowDOM"] = 144] = "useShadowDOM"; + EditorOption2[EditorOption2["useTabStops"] = 145] = "useTabStops"; + EditorOption2[EditorOption2["wordBreak"] = 146] = "wordBreak"; + EditorOption2[EditorOption2["wordSegmenterLocales"] = 147] = "wordSegmenterLocales"; + EditorOption2[EditorOption2["wordSeparators"] = 148] = "wordSeparators"; + EditorOption2[EditorOption2["wordWrap"] = 149] = "wordWrap"; + EditorOption2[EditorOption2["wordWrapBreakAfterCharacters"] = 150] = "wordWrapBreakAfterCharacters"; + EditorOption2[EditorOption2["wordWrapBreakBeforeCharacters"] = 151] = "wordWrapBreakBeforeCharacters"; + EditorOption2[EditorOption2["wordWrapColumn"] = 152] = "wordWrapColumn"; + EditorOption2[EditorOption2["wordWrapOverride1"] = 153] = "wordWrapOverride1"; + EditorOption2[EditorOption2["wordWrapOverride2"] = 154] = "wordWrapOverride2"; + EditorOption2[EditorOption2["wrappingIndent"] = 155] = "wrappingIndent"; + EditorOption2[EditorOption2["wrappingStrategy"] = 156] = "wrappingStrategy"; + EditorOption2[EditorOption2["showDeprecated"] = 157] = "showDeprecated"; + EditorOption2[EditorOption2["inertialScroll"] = 158] = "inertialScroll"; + EditorOption2[EditorOption2["inlayHints"] = 159] = "inlayHints"; + EditorOption2[EditorOption2["wrapOnEscapedLineFeeds"] = 160] = "wrapOnEscapedLineFeeds"; + EditorOption2[EditorOption2["effectiveCursorStyle"] = 161] = "effectiveCursorStyle"; + EditorOption2[EditorOption2["editorClassName"] = 162] = "editorClassName"; + EditorOption2[EditorOption2["pixelRatio"] = 163] = "pixelRatio"; + EditorOption2[EditorOption2["tabFocusMode"] = 164] = "tabFocusMode"; + EditorOption2[EditorOption2["layoutInfo"] = 165] = "layoutInfo"; + EditorOption2[EditorOption2["wrappingInfo"] = 166] = "wrappingInfo"; + EditorOption2[EditorOption2["defaultColorDecorators"] = 167] = "defaultColorDecorators"; + EditorOption2[EditorOption2["colorDecoratorsActivatedOn"] = 168] = "colorDecoratorsActivatedOn"; + EditorOption2[EditorOption2["inlineCompletionsAccessibilityVerbose"] = 169] = "inlineCompletionsAccessibilityVerbose"; + EditorOption2[EditorOption2["effectiveEditContext"] = 170] = "effectiveEditContext"; + EditorOption2[EditorOption2["scrollOnMiddleClick"] = 171] = "scrollOnMiddleClick"; + EditorOption2[EditorOption2["effectiveAllowVariableFonts"] = 172] = "effectiveAllowVariableFonts"; +})(EditorOption || (EditorOption = {})); +var EndOfLinePreference; +(function(EndOfLinePreference2) { + EndOfLinePreference2[EndOfLinePreference2["TextDefined"] = 0] = "TextDefined"; + EndOfLinePreference2[EndOfLinePreference2["LF"] = 1] = "LF"; + EndOfLinePreference2[EndOfLinePreference2["CRLF"] = 2] = "CRLF"; +})(EndOfLinePreference || (EndOfLinePreference = {})); +var EndOfLineSequence; +(function(EndOfLineSequence2) { + EndOfLineSequence2[EndOfLineSequence2["LF"] = 0] = "LF"; + EndOfLineSequence2[EndOfLineSequence2["CRLF"] = 1] = "CRLF"; +})(EndOfLineSequence || (EndOfLineSequence = {})); +var GlyphMarginLane; +(function(GlyphMarginLane3) { + GlyphMarginLane3[GlyphMarginLane3["Left"] = 1] = "Left"; + GlyphMarginLane3[GlyphMarginLane3["Center"] = 2] = "Center"; + GlyphMarginLane3[GlyphMarginLane3["Right"] = 3] = "Right"; +})(GlyphMarginLane || (GlyphMarginLane = {})); +var HoverVerbosityAction2; +(function(HoverVerbosityAction3) { + HoverVerbosityAction3[HoverVerbosityAction3["Increase"] = 0] = "Increase"; + HoverVerbosityAction3[HoverVerbosityAction3["Decrease"] = 1] = "Decrease"; +})(HoverVerbosityAction2 || (HoverVerbosityAction2 = {})); +var IndentAction; +(function(IndentAction2) { + IndentAction2[IndentAction2["None"] = 0] = "None"; + IndentAction2[IndentAction2["Indent"] = 1] = "Indent"; + IndentAction2[IndentAction2["IndentOutdent"] = 2] = "IndentOutdent"; + IndentAction2[IndentAction2["Outdent"] = 3] = "Outdent"; +})(IndentAction || (IndentAction = {})); +var InjectedTextCursorStops; +(function(InjectedTextCursorStops3) { + InjectedTextCursorStops3[InjectedTextCursorStops3["Both"] = 0] = "Both"; + InjectedTextCursorStops3[InjectedTextCursorStops3["Right"] = 1] = "Right"; + InjectedTextCursorStops3[InjectedTextCursorStops3["Left"] = 2] = "Left"; + InjectedTextCursorStops3[InjectedTextCursorStops3["None"] = 3] = "None"; +})(InjectedTextCursorStops || (InjectedTextCursorStops = {})); +var InlayHintKind2; +(function(InlayHintKind3) { + InlayHintKind3[InlayHintKind3["Type"] = 1] = "Type"; + InlayHintKind3[InlayHintKind3["Parameter"] = 2] = "Parameter"; +})(InlayHintKind2 || (InlayHintKind2 = {})); +var InlineCompletionEndOfLifeReasonKind2; +(function(InlineCompletionEndOfLifeReasonKind3) { + InlineCompletionEndOfLifeReasonKind3[InlineCompletionEndOfLifeReasonKind3["Accepted"] = 0] = "Accepted"; + InlineCompletionEndOfLifeReasonKind3[InlineCompletionEndOfLifeReasonKind3["Rejected"] = 1] = "Rejected"; + InlineCompletionEndOfLifeReasonKind3[InlineCompletionEndOfLifeReasonKind3["Ignored"] = 2] = "Ignored"; +})(InlineCompletionEndOfLifeReasonKind2 || (InlineCompletionEndOfLifeReasonKind2 = {})); +var InlineCompletionHintStyle2; +(function(InlineCompletionHintStyle3) { + InlineCompletionHintStyle3[InlineCompletionHintStyle3["Code"] = 1] = "Code"; + InlineCompletionHintStyle3[InlineCompletionHintStyle3["Label"] = 2] = "Label"; +})(InlineCompletionHintStyle2 || (InlineCompletionHintStyle2 = {})); +var InlineCompletionTriggerKind2; +(function(InlineCompletionTriggerKind3) { + InlineCompletionTriggerKind3[InlineCompletionTriggerKind3["Automatic"] = 0] = "Automatic"; + InlineCompletionTriggerKind3[InlineCompletionTriggerKind3["Explicit"] = 1] = "Explicit"; +})(InlineCompletionTriggerKind2 || (InlineCompletionTriggerKind2 = {})); +var KeyCode; +(function(KeyCode2) { + KeyCode2[KeyCode2["DependsOnKbLayout"] = -1] = "DependsOnKbLayout"; + KeyCode2[KeyCode2["Unknown"] = 0] = "Unknown"; + KeyCode2[KeyCode2["Backspace"] = 1] = "Backspace"; + KeyCode2[KeyCode2["Tab"] = 2] = "Tab"; + KeyCode2[KeyCode2["Enter"] = 3] = "Enter"; + KeyCode2[KeyCode2["Shift"] = 4] = "Shift"; + KeyCode2[KeyCode2["Ctrl"] = 5] = "Ctrl"; + KeyCode2[KeyCode2["Alt"] = 6] = "Alt"; + KeyCode2[KeyCode2["PauseBreak"] = 7] = "PauseBreak"; + KeyCode2[KeyCode2["CapsLock"] = 8] = "CapsLock"; + KeyCode2[KeyCode2["Escape"] = 9] = "Escape"; + KeyCode2[KeyCode2["Space"] = 10] = "Space"; + KeyCode2[KeyCode2["PageUp"] = 11] = "PageUp"; + KeyCode2[KeyCode2["PageDown"] = 12] = "PageDown"; + KeyCode2[KeyCode2["End"] = 13] = "End"; + KeyCode2[KeyCode2["Home"] = 14] = "Home"; + KeyCode2[KeyCode2["LeftArrow"] = 15] = "LeftArrow"; + KeyCode2[KeyCode2["UpArrow"] = 16] = "UpArrow"; + KeyCode2[KeyCode2["RightArrow"] = 17] = "RightArrow"; + KeyCode2[KeyCode2["DownArrow"] = 18] = "DownArrow"; + KeyCode2[KeyCode2["Insert"] = 19] = "Insert"; + KeyCode2[KeyCode2["Delete"] = 20] = "Delete"; + KeyCode2[KeyCode2["Digit0"] = 21] = "Digit0"; + KeyCode2[KeyCode2["Digit1"] = 22] = "Digit1"; + KeyCode2[KeyCode2["Digit2"] = 23] = "Digit2"; + KeyCode2[KeyCode2["Digit3"] = 24] = "Digit3"; + KeyCode2[KeyCode2["Digit4"] = 25] = "Digit4"; + KeyCode2[KeyCode2["Digit5"] = 26] = "Digit5"; + KeyCode2[KeyCode2["Digit6"] = 27] = "Digit6"; + KeyCode2[KeyCode2["Digit7"] = 28] = "Digit7"; + KeyCode2[KeyCode2["Digit8"] = 29] = "Digit8"; + KeyCode2[KeyCode2["Digit9"] = 30] = "Digit9"; + KeyCode2[KeyCode2["KeyA"] = 31] = "KeyA"; + KeyCode2[KeyCode2["KeyB"] = 32] = "KeyB"; + KeyCode2[KeyCode2["KeyC"] = 33] = "KeyC"; + KeyCode2[KeyCode2["KeyD"] = 34] = "KeyD"; + KeyCode2[KeyCode2["KeyE"] = 35] = "KeyE"; + KeyCode2[KeyCode2["KeyF"] = 36] = "KeyF"; + KeyCode2[KeyCode2["KeyG"] = 37] = "KeyG"; + KeyCode2[KeyCode2["KeyH"] = 38] = "KeyH"; + KeyCode2[KeyCode2["KeyI"] = 39] = "KeyI"; + KeyCode2[KeyCode2["KeyJ"] = 40] = "KeyJ"; + KeyCode2[KeyCode2["KeyK"] = 41] = "KeyK"; + KeyCode2[KeyCode2["KeyL"] = 42] = "KeyL"; + KeyCode2[KeyCode2["KeyM"] = 43] = "KeyM"; + KeyCode2[KeyCode2["KeyN"] = 44] = "KeyN"; + KeyCode2[KeyCode2["KeyO"] = 45] = "KeyO"; + KeyCode2[KeyCode2["KeyP"] = 46] = "KeyP"; + KeyCode2[KeyCode2["KeyQ"] = 47] = "KeyQ"; + KeyCode2[KeyCode2["KeyR"] = 48] = "KeyR"; + KeyCode2[KeyCode2["KeyS"] = 49] = "KeyS"; + KeyCode2[KeyCode2["KeyT"] = 50] = "KeyT"; + KeyCode2[KeyCode2["KeyU"] = 51] = "KeyU"; + KeyCode2[KeyCode2["KeyV"] = 52] = "KeyV"; + KeyCode2[KeyCode2["KeyW"] = 53] = "KeyW"; + KeyCode2[KeyCode2["KeyX"] = 54] = "KeyX"; + KeyCode2[KeyCode2["KeyY"] = 55] = "KeyY"; + KeyCode2[KeyCode2["KeyZ"] = 56] = "KeyZ"; + KeyCode2[KeyCode2["Meta"] = 57] = "Meta"; + KeyCode2[KeyCode2["ContextMenu"] = 58] = "ContextMenu"; + KeyCode2[KeyCode2["F1"] = 59] = "F1"; + KeyCode2[KeyCode2["F2"] = 60] = "F2"; + KeyCode2[KeyCode2["F3"] = 61] = "F3"; + KeyCode2[KeyCode2["F4"] = 62] = "F4"; + KeyCode2[KeyCode2["F5"] = 63] = "F5"; + KeyCode2[KeyCode2["F6"] = 64] = "F6"; + KeyCode2[KeyCode2["F7"] = 65] = "F7"; + KeyCode2[KeyCode2["F8"] = 66] = "F8"; + KeyCode2[KeyCode2["F9"] = 67] = "F9"; + KeyCode2[KeyCode2["F10"] = 68] = "F10"; + KeyCode2[KeyCode2["F11"] = 69] = "F11"; + KeyCode2[KeyCode2["F12"] = 70] = "F12"; + KeyCode2[KeyCode2["F13"] = 71] = "F13"; + KeyCode2[KeyCode2["F14"] = 72] = "F14"; + KeyCode2[KeyCode2["F15"] = 73] = "F15"; + KeyCode2[KeyCode2["F16"] = 74] = "F16"; + KeyCode2[KeyCode2["F17"] = 75] = "F17"; + KeyCode2[KeyCode2["F18"] = 76] = "F18"; + KeyCode2[KeyCode2["F19"] = 77] = "F19"; + KeyCode2[KeyCode2["F20"] = 78] = "F20"; + KeyCode2[KeyCode2["F21"] = 79] = "F21"; + KeyCode2[KeyCode2["F22"] = 80] = "F22"; + KeyCode2[KeyCode2["F23"] = 81] = "F23"; + KeyCode2[KeyCode2["F24"] = 82] = "F24"; + KeyCode2[KeyCode2["NumLock"] = 83] = "NumLock"; + KeyCode2[KeyCode2["ScrollLock"] = 84] = "ScrollLock"; + KeyCode2[KeyCode2["Semicolon"] = 85] = "Semicolon"; + KeyCode2[KeyCode2["Equal"] = 86] = "Equal"; + KeyCode2[KeyCode2["Comma"] = 87] = "Comma"; + KeyCode2[KeyCode2["Minus"] = 88] = "Minus"; + KeyCode2[KeyCode2["Period"] = 89] = "Period"; + KeyCode2[KeyCode2["Slash"] = 90] = "Slash"; + KeyCode2[KeyCode2["Backquote"] = 91] = "Backquote"; + KeyCode2[KeyCode2["BracketLeft"] = 92] = "BracketLeft"; + KeyCode2[KeyCode2["Backslash"] = 93] = "Backslash"; + KeyCode2[KeyCode2["BracketRight"] = 94] = "BracketRight"; + KeyCode2[KeyCode2["Quote"] = 95] = "Quote"; + KeyCode2[KeyCode2["OEM_8"] = 96] = "OEM_8"; + KeyCode2[KeyCode2["IntlBackslash"] = 97] = "IntlBackslash"; + KeyCode2[KeyCode2["Numpad0"] = 98] = "Numpad0"; + KeyCode2[KeyCode2["Numpad1"] = 99] = "Numpad1"; + KeyCode2[KeyCode2["Numpad2"] = 100] = "Numpad2"; + KeyCode2[KeyCode2["Numpad3"] = 101] = "Numpad3"; + KeyCode2[KeyCode2["Numpad4"] = 102] = "Numpad4"; + KeyCode2[KeyCode2["Numpad5"] = 103] = "Numpad5"; + KeyCode2[KeyCode2["Numpad6"] = 104] = "Numpad6"; + KeyCode2[KeyCode2["Numpad7"] = 105] = "Numpad7"; + KeyCode2[KeyCode2["Numpad8"] = 106] = "Numpad8"; + KeyCode2[KeyCode2["Numpad9"] = 107] = "Numpad9"; + KeyCode2[KeyCode2["NumpadMultiply"] = 108] = "NumpadMultiply"; + KeyCode2[KeyCode2["NumpadAdd"] = 109] = "NumpadAdd"; + KeyCode2[KeyCode2["NUMPAD_SEPARATOR"] = 110] = "NUMPAD_SEPARATOR"; + KeyCode2[KeyCode2["NumpadSubtract"] = 111] = "NumpadSubtract"; + KeyCode2[KeyCode2["NumpadDecimal"] = 112] = "NumpadDecimal"; + KeyCode2[KeyCode2["NumpadDivide"] = 113] = "NumpadDivide"; + KeyCode2[KeyCode2["KEY_IN_COMPOSITION"] = 114] = "KEY_IN_COMPOSITION"; + KeyCode2[KeyCode2["ABNT_C1"] = 115] = "ABNT_C1"; + KeyCode2[KeyCode2["ABNT_C2"] = 116] = "ABNT_C2"; + KeyCode2[KeyCode2["AudioVolumeMute"] = 117] = "AudioVolumeMute"; + KeyCode2[KeyCode2["AudioVolumeUp"] = 118] = "AudioVolumeUp"; + KeyCode2[KeyCode2["AudioVolumeDown"] = 119] = "AudioVolumeDown"; + KeyCode2[KeyCode2["BrowserSearch"] = 120] = "BrowserSearch"; + KeyCode2[KeyCode2["BrowserHome"] = 121] = "BrowserHome"; + KeyCode2[KeyCode2["BrowserBack"] = 122] = "BrowserBack"; + KeyCode2[KeyCode2["BrowserForward"] = 123] = "BrowserForward"; + KeyCode2[KeyCode2["MediaTrackNext"] = 124] = "MediaTrackNext"; + KeyCode2[KeyCode2["MediaTrackPrevious"] = 125] = "MediaTrackPrevious"; + KeyCode2[KeyCode2["MediaStop"] = 126] = "MediaStop"; + KeyCode2[KeyCode2["MediaPlayPause"] = 127] = "MediaPlayPause"; + KeyCode2[KeyCode2["LaunchMediaPlayer"] = 128] = "LaunchMediaPlayer"; + KeyCode2[KeyCode2["LaunchMail"] = 129] = "LaunchMail"; + KeyCode2[KeyCode2["LaunchApp2"] = 130] = "LaunchApp2"; + KeyCode2[KeyCode2["Clear"] = 131] = "Clear"; + KeyCode2[KeyCode2["MAX_VALUE"] = 132] = "MAX_VALUE"; +})(KeyCode || (KeyCode = {})); +var MarkerSeverity; +(function(MarkerSeverity2) { + MarkerSeverity2[MarkerSeverity2["Hint"] = 1] = "Hint"; + MarkerSeverity2[MarkerSeverity2["Info"] = 2] = "Info"; + MarkerSeverity2[MarkerSeverity2["Warning"] = 4] = "Warning"; + MarkerSeverity2[MarkerSeverity2["Error"] = 8] = "Error"; +})(MarkerSeverity || (MarkerSeverity = {})); +var MarkerTag; +(function(MarkerTag2) { + MarkerTag2[MarkerTag2["Unnecessary"] = 1] = "Unnecessary"; + MarkerTag2[MarkerTag2["Deprecated"] = 2] = "Deprecated"; +})(MarkerTag || (MarkerTag = {})); +var MinimapPosition; +(function(MinimapPosition2) { + MinimapPosition2[MinimapPosition2["Inline"] = 1] = "Inline"; + MinimapPosition2[MinimapPosition2["Gutter"] = 2] = "Gutter"; +})(MinimapPosition || (MinimapPosition = {})); +var MinimapSectionHeaderStyle; +(function(MinimapSectionHeaderStyle2) { + MinimapSectionHeaderStyle2[MinimapSectionHeaderStyle2["Normal"] = 1] = "Normal"; + MinimapSectionHeaderStyle2[MinimapSectionHeaderStyle2["Underlined"] = 2] = "Underlined"; +})(MinimapSectionHeaderStyle || (MinimapSectionHeaderStyle = {})); +var MouseTargetType; +(function(MouseTargetType2) { + MouseTargetType2[MouseTargetType2["UNKNOWN"] = 0] = "UNKNOWN"; + MouseTargetType2[MouseTargetType2["TEXTAREA"] = 1] = "TEXTAREA"; + MouseTargetType2[MouseTargetType2["GUTTER_GLYPH_MARGIN"] = 2] = "GUTTER_GLYPH_MARGIN"; + MouseTargetType2[MouseTargetType2["GUTTER_LINE_NUMBERS"] = 3] = "GUTTER_LINE_NUMBERS"; + MouseTargetType2[MouseTargetType2["GUTTER_LINE_DECORATIONS"] = 4] = "GUTTER_LINE_DECORATIONS"; + MouseTargetType2[MouseTargetType2["GUTTER_VIEW_ZONE"] = 5] = "GUTTER_VIEW_ZONE"; + MouseTargetType2[MouseTargetType2["CONTENT_TEXT"] = 6] = "CONTENT_TEXT"; + MouseTargetType2[MouseTargetType2["CONTENT_EMPTY"] = 7] = "CONTENT_EMPTY"; + MouseTargetType2[MouseTargetType2["CONTENT_VIEW_ZONE"] = 8] = "CONTENT_VIEW_ZONE"; + MouseTargetType2[MouseTargetType2["CONTENT_WIDGET"] = 9] = "CONTENT_WIDGET"; + MouseTargetType2[MouseTargetType2["OVERVIEW_RULER"] = 10] = "OVERVIEW_RULER"; + MouseTargetType2[MouseTargetType2["SCROLLBAR"] = 11] = "SCROLLBAR"; + MouseTargetType2[MouseTargetType2["OVERLAY_WIDGET"] = 12] = "OVERLAY_WIDGET"; + MouseTargetType2[MouseTargetType2["OUTSIDE_EDITOR"] = 13] = "OUTSIDE_EDITOR"; +})(MouseTargetType || (MouseTargetType = {})); +var NewSymbolNameTag2; +(function(NewSymbolNameTag3) { + NewSymbolNameTag3[NewSymbolNameTag3["AIGenerated"] = 1] = "AIGenerated"; +})(NewSymbolNameTag2 || (NewSymbolNameTag2 = {})); +var NewSymbolNameTriggerKind2; +(function(NewSymbolNameTriggerKind3) { + NewSymbolNameTriggerKind3[NewSymbolNameTriggerKind3["Invoke"] = 0] = "Invoke"; + NewSymbolNameTriggerKind3[NewSymbolNameTriggerKind3["Automatic"] = 1] = "Automatic"; +})(NewSymbolNameTriggerKind2 || (NewSymbolNameTriggerKind2 = {})); +var OverlayWidgetPositionPreference; +(function(OverlayWidgetPositionPreference2) { + OverlayWidgetPositionPreference2[OverlayWidgetPositionPreference2["TOP_RIGHT_CORNER"] = 0] = "TOP_RIGHT_CORNER"; + OverlayWidgetPositionPreference2[OverlayWidgetPositionPreference2["BOTTOM_RIGHT_CORNER"] = 1] = "BOTTOM_RIGHT_CORNER"; + OverlayWidgetPositionPreference2[OverlayWidgetPositionPreference2["TOP_CENTER"] = 2] = "TOP_CENTER"; +})(OverlayWidgetPositionPreference || (OverlayWidgetPositionPreference = {})); +var OverviewRulerLane; +(function(OverviewRulerLane3) { + OverviewRulerLane3[OverviewRulerLane3["Left"] = 1] = "Left"; + OverviewRulerLane3[OverviewRulerLane3["Center"] = 2] = "Center"; + OverviewRulerLane3[OverviewRulerLane3["Right"] = 4] = "Right"; + OverviewRulerLane3[OverviewRulerLane3["Full"] = 7] = "Full"; +})(OverviewRulerLane || (OverviewRulerLane = {})); +var PartialAcceptTriggerKind; +(function(PartialAcceptTriggerKind2) { + PartialAcceptTriggerKind2[PartialAcceptTriggerKind2["Word"] = 0] = "Word"; + PartialAcceptTriggerKind2[PartialAcceptTriggerKind2["Line"] = 1] = "Line"; + PartialAcceptTriggerKind2[PartialAcceptTriggerKind2["Suggest"] = 2] = "Suggest"; +})(PartialAcceptTriggerKind || (PartialAcceptTriggerKind = {})); +var PositionAffinity; +(function(PositionAffinity2) { + PositionAffinity2[PositionAffinity2["Left"] = 0] = "Left"; + PositionAffinity2[PositionAffinity2["Right"] = 1] = "Right"; + PositionAffinity2[PositionAffinity2["None"] = 2] = "None"; + PositionAffinity2[PositionAffinity2["LeftOfInjectedText"] = 3] = "LeftOfInjectedText"; + PositionAffinity2[PositionAffinity2["RightOfInjectedText"] = 4] = "RightOfInjectedText"; +})(PositionAffinity || (PositionAffinity = {})); +var RenderLineNumbersType; +(function(RenderLineNumbersType2) { + RenderLineNumbersType2[RenderLineNumbersType2["Off"] = 0] = "Off"; + RenderLineNumbersType2[RenderLineNumbersType2["On"] = 1] = "On"; + RenderLineNumbersType2[RenderLineNumbersType2["Relative"] = 2] = "Relative"; + RenderLineNumbersType2[RenderLineNumbersType2["Interval"] = 3] = "Interval"; + RenderLineNumbersType2[RenderLineNumbersType2["Custom"] = 4] = "Custom"; +})(RenderLineNumbersType || (RenderLineNumbersType = {})); +var RenderMinimap; +(function(RenderMinimap2) { + RenderMinimap2[RenderMinimap2["None"] = 0] = "None"; + RenderMinimap2[RenderMinimap2["Text"] = 1] = "Text"; + RenderMinimap2[RenderMinimap2["Blocks"] = 2] = "Blocks"; +})(RenderMinimap || (RenderMinimap = {})); +var ScrollType; +(function(ScrollType2) { + ScrollType2[ScrollType2["Smooth"] = 0] = "Smooth"; + ScrollType2[ScrollType2["Immediate"] = 1] = "Immediate"; +})(ScrollType || (ScrollType = {})); +var ScrollbarVisibility; +(function(ScrollbarVisibility2) { + ScrollbarVisibility2[ScrollbarVisibility2["Auto"] = 1] = "Auto"; + ScrollbarVisibility2[ScrollbarVisibility2["Hidden"] = 2] = "Hidden"; + ScrollbarVisibility2[ScrollbarVisibility2["Visible"] = 3] = "Visible"; +})(ScrollbarVisibility || (ScrollbarVisibility = {})); +var SelectionDirection; +(function(SelectionDirection2) { + SelectionDirection2[SelectionDirection2["LTR"] = 0] = "LTR"; + SelectionDirection2[SelectionDirection2["RTL"] = 1] = "RTL"; +})(SelectionDirection || (SelectionDirection = {})); +var ShowLightbulbIconMode; +(function(ShowLightbulbIconMode2) { + ShowLightbulbIconMode2["Off"] = "off"; + ShowLightbulbIconMode2["OnCode"] = "onCode"; + ShowLightbulbIconMode2["On"] = "on"; +})(ShowLightbulbIconMode || (ShowLightbulbIconMode = {})); +var SignatureHelpTriggerKind2; +(function(SignatureHelpTriggerKind3) { + SignatureHelpTriggerKind3[SignatureHelpTriggerKind3["Invoke"] = 1] = "Invoke"; + SignatureHelpTriggerKind3[SignatureHelpTriggerKind3["TriggerCharacter"] = 2] = "TriggerCharacter"; + SignatureHelpTriggerKind3[SignatureHelpTriggerKind3["ContentChange"] = 3] = "ContentChange"; +})(SignatureHelpTriggerKind2 || (SignatureHelpTriggerKind2 = {})); +var SymbolKind; +(function(SymbolKind2) { + SymbolKind2[SymbolKind2["File"] = 0] = "File"; + SymbolKind2[SymbolKind2["Module"] = 1] = "Module"; + SymbolKind2[SymbolKind2["Namespace"] = 2] = "Namespace"; + SymbolKind2[SymbolKind2["Package"] = 3] = "Package"; + SymbolKind2[SymbolKind2["Class"] = 4] = "Class"; + SymbolKind2[SymbolKind2["Method"] = 5] = "Method"; + SymbolKind2[SymbolKind2["Property"] = 6] = "Property"; + SymbolKind2[SymbolKind2["Field"] = 7] = "Field"; + SymbolKind2[SymbolKind2["Constructor"] = 8] = "Constructor"; + SymbolKind2[SymbolKind2["Enum"] = 9] = "Enum"; + SymbolKind2[SymbolKind2["Interface"] = 10] = "Interface"; + SymbolKind2[SymbolKind2["Function"] = 11] = "Function"; + SymbolKind2[SymbolKind2["Variable"] = 12] = "Variable"; + SymbolKind2[SymbolKind2["Constant"] = 13] = "Constant"; + SymbolKind2[SymbolKind2["String"] = 14] = "String"; + SymbolKind2[SymbolKind2["Number"] = 15] = "Number"; + SymbolKind2[SymbolKind2["Boolean"] = 16] = "Boolean"; + SymbolKind2[SymbolKind2["Array"] = 17] = "Array"; + SymbolKind2[SymbolKind2["Object"] = 18] = "Object"; + SymbolKind2[SymbolKind2["Key"] = 19] = "Key"; + SymbolKind2[SymbolKind2["Null"] = 20] = "Null"; + SymbolKind2[SymbolKind2["EnumMember"] = 21] = "EnumMember"; + SymbolKind2[SymbolKind2["Struct"] = 22] = "Struct"; + SymbolKind2[SymbolKind2["Event"] = 23] = "Event"; + SymbolKind2[SymbolKind2["Operator"] = 24] = "Operator"; + SymbolKind2[SymbolKind2["TypeParameter"] = 25] = "TypeParameter"; +})(SymbolKind || (SymbolKind = {})); +var SymbolTag; +(function(SymbolTag2) { + SymbolTag2[SymbolTag2["Deprecated"] = 1] = "Deprecated"; +})(SymbolTag || (SymbolTag = {})); +var TextDirection; +(function(TextDirection3) { + TextDirection3[TextDirection3["LTR"] = 0] = "LTR"; + TextDirection3[TextDirection3["RTL"] = 1] = "RTL"; +})(TextDirection || (TextDirection = {})); +var TextEditorCursorBlinkingStyle; +(function(TextEditorCursorBlinkingStyle2) { + TextEditorCursorBlinkingStyle2[TextEditorCursorBlinkingStyle2["Hidden"] = 0] = "Hidden"; + TextEditorCursorBlinkingStyle2[TextEditorCursorBlinkingStyle2["Blink"] = 1] = "Blink"; + TextEditorCursorBlinkingStyle2[TextEditorCursorBlinkingStyle2["Smooth"] = 2] = "Smooth"; + TextEditorCursorBlinkingStyle2[TextEditorCursorBlinkingStyle2["Phase"] = 3] = "Phase"; + TextEditorCursorBlinkingStyle2[TextEditorCursorBlinkingStyle2["Expand"] = 4] = "Expand"; + TextEditorCursorBlinkingStyle2[TextEditorCursorBlinkingStyle2["Solid"] = 5] = "Solid"; +})(TextEditorCursorBlinkingStyle || (TextEditorCursorBlinkingStyle = {})); +var TextEditorCursorStyle; +(function(TextEditorCursorStyle2) { + TextEditorCursorStyle2[TextEditorCursorStyle2["Line"] = 1] = "Line"; + TextEditorCursorStyle2[TextEditorCursorStyle2["Block"] = 2] = "Block"; + TextEditorCursorStyle2[TextEditorCursorStyle2["Underline"] = 3] = "Underline"; + TextEditorCursorStyle2[TextEditorCursorStyle2["LineThin"] = 4] = "LineThin"; + TextEditorCursorStyle2[TextEditorCursorStyle2["BlockOutline"] = 5] = "BlockOutline"; + TextEditorCursorStyle2[TextEditorCursorStyle2["UnderlineThin"] = 6] = "UnderlineThin"; +})(TextEditorCursorStyle || (TextEditorCursorStyle = {})); +var TrackedRangeStickiness; +(function(TrackedRangeStickiness2) { + TrackedRangeStickiness2[TrackedRangeStickiness2["AlwaysGrowsWhenTypingAtEdges"] = 0] = "AlwaysGrowsWhenTypingAtEdges"; + TrackedRangeStickiness2[TrackedRangeStickiness2["NeverGrowsWhenTypingAtEdges"] = 1] = "NeverGrowsWhenTypingAtEdges"; + TrackedRangeStickiness2[TrackedRangeStickiness2["GrowsOnlyWhenTypingBefore"] = 2] = "GrowsOnlyWhenTypingBefore"; + TrackedRangeStickiness2[TrackedRangeStickiness2["GrowsOnlyWhenTypingAfter"] = 3] = "GrowsOnlyWhenTypingAfter"; +})(TrackedRangeStickiness || (TrackedRangeStickiness = {})); +var WrappingIndent; +(function(WrappingIndent2) { + WrappingIndent2[WrappingIndent2["None"] = 0] = "None"; + WrappingIndent2[WrappingIndent2["Same"] = 1] = "Same"; + WrappingIndent2[WrappingIndent2["Indent"] = 2] = "Indent"; + WrappingIndent2[WrappingIndent2["DeepIndent"] = 3] = "DeepIndent"; +})(WrappingIndent || (WrappingIndent = {})); + +// node_modules/monaco-editor-core/esm/vs/editor/common/services/editorBaseApi.js +var KeyMod = class { + static { + this.CtrlCmd = 2048; + } + static { + this.Shift = 1024; + } + static { + this.Alt = 512; + } + static { + this.WinCtrl = 256; + } + static chord(firstPart, secondPart) { + return KeyChord(firstPart, secondPart); + } +}; +function createMonacoBaseAPI() { + return { + editor: void 0, + // undefined override expected here + languages: void 0, + // undefined override expected here + CancellationTokenSource, + Emitter, + KeyCode, + KeyMod, + Position, + Range, + Selection, + SelectionDirection, + MarkerSeverity, + MarkerTag, + Uri: URI, + Token + }; +} + +// node_modules/monaco-editor-core/esm/vs/base/common/map.js +var _a; +var _b; +var _c; +var ResourceMapEntry = class { + constructor(uri, value) { + this.uri = uri; + this.value = value; + } +}; +function isEntries(arg) { + return Array.isArray(arg); +} +var ResourceMap = class _ResourceMap { + static { + this.defaultToKey = (resource) => resource.toString(); + } + constructor(arg, toKey) { + this[_a] = "ResourceMap"; + if (arg instanceof _ResourceMap) { + this.map = new Map(arg.map); + this.toKey = toKey ?? _ResourceMap.defaultToKey; + } else if (isEntries(arg)) { + this.map = /* @__PURE__ */ new Map(); + this.toKey = toKey ?? _ResourceMap.defaultToKey; + for (const [resource, value] of arg) { + this.set(resource, value); + } + } else { + this.map = /* @__PURE__ */ new Map(); + this.toKey = arg ?? _ResourceMap.defaultToKey; + } + } + set(resource, value) { + this.map.set(this.toKey(resource), new ResourceMapEntry(resource, value)); + return this; + } + get(resource) { + return this.map.get(this.toKey(resource))?.value; + } + has(resource) { + return this.map.has(this.toKey(resource)); + } + get size() { + return this.map.size; + } + clear() { + this.map.clear(); + } + delete(resource) { + return this.map.delete(this.toKey(resource)); + } + forEach(clb, thisArg) { + if (typeof thisArg !== "undefined") { + clb = clb.bind(thisArg); + } + for (const [_, entry] of this.map) { + clb(entry.value, entry.uri, this); + } + } + *values() { + for (const entry of this.map.values()) { + yield entry.value; + } + } + *keys() { + for (const entry of this.map.values()) { + yield entry.uri; + } + } + *entries() { + for (const entry of this.map.values()) { + yield [entry.uri, entry.value]; + } + } + *[(_a = Symbol.toStringTag, Symbol.iterator)]() { + for (const [, entry] of this.map) { + yield [entry.uri, entry.value]; + } + } +}; +var ResourceSet = class { + constructor(entriesOrKey, toKey) { + this[_b] = "ResourceSet"; + if (!entriesOrKey || typeof entriesOrKey === "function") { + this._map = new ResourceMap(entriesOrKey); + } else { + this._map = new ResourceMap(toKey); + entriesOrKey.forEach(this.add, this); + } + } + get size() { + return this._map.size; + } + add(value) { + this._map.set(value, value); + return this; + } + clear() { + this._map.clear(); + } + delete(value) { + return this._map.delete(value); + } + forEach(callbackfn, thisArg) { + this._map.forEach((_value, key) => callbackfn.call(thisArg, key, key, this)); + } + has(value) { + return this._map.has(value); + } + entries() { + return this._map.entries(); + } + keys() { + return this._map.keys(); + } + values() { + return this._map.keys(); + } + [(_b = Symbol.toStringTag, Symbol.iterator)]() { + return this.keys(); + } +}; +var LinkedMap = class { + constructor() { + this[_c] = "LinkedMap"; + this._map = /* @__PURE__ */ new Map(); + this._head = void 0; + this._tail = void 0; + this._size = 0; + this._state = 0; + } + clear() { + this._map.clear(); + this._head = void 0; + this._tail = void 0; + this._size = 0; + this._state++; + } + isEmpty() { + return !this._head && !this._tail; + } + get size() { + return this._size; + } + get first() { + return this._head?.value; + } + get last() { + return this._tail?.value; + } + has(key) { + return this._map.has(key); + } + get(key, touch = 0) { + const item = this._map.get(key); + if (!item) { + return void 0; + } + if (touch !== 0) { + this.touch(item, touch); + } + return item.value; + } + set(key, value, touch = 0) { + let item = this._map.get(key); + if (item) { + item.value = value; + if (touch !== 0) { + this.touch(item, touch); + } + } else { + item = { key, value, next: void 0, previous: void 0 }; + switch (touch) { + case 0: + this.addItemLast(item); + break; + case 1: + this.addItemFirst(item); + break; + case 2: + this.addItemLast(item); + break; + default: + this.addItemLast(item); + break; + } + this._map.set(key, item); + this._size++; + } + return this; + } + delete(key) { + return !!this.remove(key); + } + remove(key) { + const item = this._map.get(key); + if (!item) { + return void 0; + } + this._map.delete(key); + this.removeItem(item); + this._size--; + return item.value; + } + shift() { + if (!this._head && !this._tail) { + return void 0; + } + if (!this._head || !this._tail) { + throw new Error("Invalid list"); + } + const item = this._head; + this._map.delete(item.key); + this.removeItem(item); + this._size--; + return item.value; + } + forEach(callbackfn, thisArg) { + const state = this._state; + let current = this._head; + while (current) { + if (thisArg) { + callbackfn.bind(thisArg)(current.value, current.key, this); + } else { + callbackfn(current.value, current.key, this); + } + if (this._state !== state) { + throw new Error(`LinkedMap got modified during iteration.`); + } + current = current.next; + } + } + keys() { + const map = this; + const state = this._state; + let current = this._head; + const iterator = { + [Symbol.iterator]() { + return iterator; + }, + next() { + if (map._state !== state) { + throw new Error(`LinkedMap got modified during iteration.`); + } + if (current) { + const result = { value: current.key, done: false }; + current = current.next; + return result; + } else { + return { value: void 0, done: true }; + } + } + }; + return iterator; + } + values() { + const map = this; + const state = this._state; + let current = this._head; + const iterator = { + [Symbol.iterator]() { + return iterator; + }, + next() { + if (map._state !== state) { + throw new Error(`LinkedMap got modified during iteration.`); + } + if (current) { + const result = { value: current.value, done: false }; + current = current.next; + return result; + } else { + return { value: void 0, done: true }; + } + } + }; + return iterator; + } + entries() { + const map = this; + const state = this._state; + let current = this._head; + const iterator = { + [Symbol.iterator]() { + return iterator; + }, + next() { + if (map._state !== state) { + throw new Error(`LinkedMap got modified during iteration.`); + } + if (current) { + const result = { value: [current.key, current.value], done: false }; + current = current.next; + return result; + } else { + return { value: void 0, done: true }; + } + } + }; + return iterator; + } + [(_c = Symbol.toStringTag, Symbol.iterator)]() { + return this.entries(); + } + trimOld(newSize) { + if (newSize >= this.size) { + return; + } + if (newSize === 0) { + this.clear(); + return; + } + let current = this._head; + let currentSize = this.size; + while (current && currentSize > newSize) { + this._map.delete(current.key); + current = current.next; + currentSize--; + } + this._head = current; + this._size = currentSize; + if (current) { + current.previous = void 0; + } + this._state++; + } + trimNew(newSize) { + if (newSize >= this.size) { + return; + } + if (newSize === 0) { + this.clear(); + return; + } + let current = this._tail; + let currentSize = this.size; + while (current && currentSize > newSize) { + this._map.delete(current.key); + current = current.previous; + currentSize--; + } + this._tail = current; + this._size = currentSize; + if (current) { + current.next = void 0; + } + this._state++; + } + addItemFirst(item) { + if (!this._head && !this._tail) { + this._tail = item; + } else if (!this._head) { + throw new Error("Invalid list"); + } else { + item.next = this._head; + this._head.previous = item; + } + this._head = item; + this._state++; + } + addItemLast(item) { + if (!this._head && !this._tail) { + this._head = item; + } else if (!this._tail) { + throw new Error("Invalid list"); + } else { + item.previous = this._tail; + this._tail.next = item; + } + this._tail = item; + this._state++; + } + removeItem(item) { + if (item === this._head && item === this._tail) { + this._head = void 0; + this._tail = void 0; + } else if (item === this._head) { + if (!item.next) { + throw new Error("Invalid list"); + } + item.next.previous = void 0; + this._head = item.next; + } else if (item === this._tail) { + if (!item.previous) { + throw new Error("Invalid list"); + } + item.previous.next = void 0; + this._tail = item.previous; + } else { + const next = item.next; + const previous = item.previous; + if (!next || !previous) { + throw new Error("Invalid list"); + } + next.previous = previous; + previous.next = next; + } + item.next = void 0; + item.previous = void 0; + this._state++; + } + touch(item, touch) { + if (!this._head || !this._tail) { + throw new Error("Invalid list"); + } + if (touch !== 1 && touch !== 2) { + return; + } + if (touch === 1) { + if (item === this._head) { + return; + } + const next = item.next; + const previous = item.previous; + if (item === this._tail) { + previous.next = void 0; + this._tail = previous; + } else { + next.previous = previous; + previous.next = next; + } + item.previous = void 0; + item.next = this._head; + this._head.previous = item; + this._head = item; + this._state++; + } else if (touch === 2) { + if (item === this._tail) { + return; + } + const next = item.next; + const previous = item.previous; + if (item === this._head) { + next.previous = void 0; + this._head = next; + } else { + next.previous = previous; + previous.next = next; + } + item.next = void 0; + item.previous = this._tail; + this._tail.next = item; + this._tail = item; + this._state++; + } + } + toJSON() { + const data = []; + this.forEach((value, key) => { + data.push([key, value]); + }); + return data; + } + fromJSON(data) { + this.clear(); + for (const [key, value] of data) { + this.set(key, value); + } + } +}; +var Cache = class extends LinkedMap { + constructor(limit, ratio = 1) { + super(); + this._limit = limit; + this._ratio = Math.min(Math.max(0, ratio), 1); + } + get limit() { + return this._limit; + } + set limit(limit) { + this._limit = limit; + this.checkTrim(); + } + get(key, touch = 2) { + return super.get(key, touch); + } + peek(key) { + return super.get( + key, + 0 + /* Touch.None */ + ); + } + set(key, value) { + super.set( + key, + value, + 2 + /* Touch.AsNew */ + ); + return this; + } + checkTrim() { + if (this.size > this._limit) { + this.trim(Math.round(this._limit * this._ratio)); + } + } +}; +var LRUCache = class extends Cache { + constructor(limit, ratio = 1) { + super(limit, ratio); + } + trim(newSize) { + this.trimOld(newSize); + } + set(key, value) { + super.set(key, value); + this.checkTrim(); + return this; + } +}; +var SetMap = class { + constructor() { + this.map = /* @__PURE__ */ new Map(); + } + add(key, value) { + let values = this.map.get(key); + if (!values) { + values = /* @__PURE__ */ new Set(); + this.map.set(key, values); + } + values.add(value); + } + delete(key, value) { + const values = this.map.get(key); + if (!values) { + return; + } + values.delete(value); + if (values.size === 0) { + this.map.delete(key); + } + } + forEach(key, fn) { + const values = this.map.get(key); + if (!values) { + return; + } + values.forEach(fn); + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/common/core/wordCharacterClassifier.js +var wordClassifierCache = new LRUCache(10); + +// node_modules/monaco-editor-core/esm/vs/editor/common/model.js +var OverviewRulerLane2; +(function(OverviewRulerLane3) { + OverviewRulerLane3[OverviewRulerLane3["Left"] = 1] = "Left"; + OverviewRulerLane3[OverviewRulerLane3["Center"] = 2] = "Center"; + OverviewRulerLane3[OverviewRulerLane3["Right"] = 4] = "Right"; + OverviewRulerLane3[OverviewRulerLane3["Full"] = 7] = "Full"; +})(OverviewRulerLane2 || (OverviewRulerLane2 = {})); +var GlyphMarginLane2; +(function(GlyphMarginLane3) { + GlyphMarginLane3[GlyphMarginLane3["Left"] = 1] = "Left"; + GlyphMarginLane3[GlyphMarginLane3["Center"] = 2] = "Center"; + GlyphMarginLane3[GlyphMarginLane3["Right"] = 3] = "Right"; +})(GlyphMarginLane2 || (GlyphMarginLane2 = {})); +var TextDirection2; +(function(TextDirection3) { + TextDirection3[TextDirection3["LTR"] = 0] = "LTR"; + TextDirection3[TextDirection3["RTL"] = 1] = "RTL"; +})(TextDirection2 || (TextDirection2 = {})); +var InjectedTextCursorStops2; +(function(InjectedTextCursorStops3) { + InjectedTextCursorStops3[InjectedTextCursorStops3["Both"] = 0] = "Both"; + InjectedTextCursorStops3[InjectedTextCursorStops3["Right"] = 1] = "Right"; + InjectedTextCursorStops3[InjectedTextCursorStops3["Left"] = 2] = "Left"; + InjectedTextCursorStops3[InjectedTextCursorStops3["None"] = 3] = "None"; +})(InjectedTextCursorStops2 || (InjectedTextCursorStops2 = {})); + +// node_modules/monaco-editor-core/esm/vs/editor/common/model/textModelSearch.js +function isMultilineRegexSource(searchString) { + if (!searchString || searchString.length === 0) { + return false; + } + for (let i = 0, len = searchString.length; i < len; i++) { + const chCode = searchString.charCodeAt(i); + if (chCode === 10) { + return true; + } + if (chCode === 92) { + i++; + if (i >= len) { + break; + } + const nextChCode = searchString.charCodeAt(i); + if (nextChCode === 110 || nextChCode === 114 || nextChCode === 87) { + return true; + } + } + } + return false; +} +function leftIsWordBounday(wordSeparators, text, textLength, matchStartIndex, matchLength) { + if (matchStartIndex === 0) { + return true; + } + const charBefore = text.charCodeAt(matchStartIndex - 1); + if (wordSeparators.get(charBefore) !== 0) { + return true; + } + if (charBefore === 13 || charBefore === 10) { + return true; + } + if (matchLength > 0) { + const firstCharInMatch = text.charCodeAt(matchStartIndex); + if (wordSeparators.get(firstCharInMatch) !== 0) { + return true; + } + } + return false; +} +function rightIsWordBounday(wordSeparators, text, textLength, matchStartIndex, matchLength) { + if (matchStartIndex + matchLength === textLength) { + return true; + } + const charAfter = text.charCodeAt(matchStartIndex + matchLength); + if (wordSeparators.get(charAfter) !== 0) { + return true; + } + if (charAfter === 13 || charAfter === 10) { + return true; + } + if (matchLength > 0) { + const lastCharInMatch = text.charCodeAt(matchStartIndex + matchLength - 1); + if (wordSeparators.get(lastCharInMatch) !== 0) { + return true; + } + } + return false; +} +function isValidMatch(wordSeparators, text, textLength, matchStartIndex, matchLength) { + return leftIsWordBounday(wordSeparators, text, textLength, matchStartIndex, matchLength) && rightIsWordBounday(wordSeparators, text, textLength, matchStartIndex, matchLength); +} +var Searcher = class { + constructor(wordSeparators, searchRegex) { + this._wordSeparators = wordSeparators; + this._searchRegex = searchRegex; + this._prevMatchStartIndex = -1; + this._prevMatchLength = 0; + } + reset(lastIndex) { + this._searchRegex.lastIndex = lastIndex; + this._prevMatchStartIndex = -1; + this._prevMatchLength = 0; + } + next(text) { + const textLength = text.length; + let m; + do { + if (this._prevMatchStartIndex + this._prevMatchLength === textLength) { + return null; + } + m = this._searchRegex.exec(text); + if (!m) { + return null; + } + const matchStartIndex = m.index; + const matchLength = m[0].length; + if (matchStartIndex === this._prevMatchStartIndex && matchLength === this._prevMatchLength) { + if (matchLength === 0) { + if (getNextCodePoint(text, textLength, this._searchRegex.lastIndex) > 65535) { + this._searchRegex.lastIndex += 2; + } else { + this._searchRegex.lastIndex += 1; + } + continue; + } + return null; + } + this._prevMatchStartIndex = matchStartIndex; + this._prevMatchLength = matchLength; + if (!this._wordSeparators || isValidMatch(this._wordSeparators, text, textLength, matchStartIndex, matchLength)) { + return m; + } + } while (m); + return null; + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/common/core/wordHelper.js +var USUAL_WORD_SEPARATORS = "`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?"; +function createWordRegExp(allowInWords = "") { + let source = "(-?\\d*\\.\\d\\w*)|([^"; + for (const sep2 of USUAL_WORD_SEPARATORS) { + if (allowInWords.indexOf(sep2) >= 0) { + continue; + } + source += "\\" + sep2; + } + source += "\\s]+)"; + return new RegExp(source, "g"); +} +var DEFAULT_WORD_REGEXP = createWordRegExp(); +function ensureValidWordDefinition(wordDefinition) { + let result = DEFAULT_WORD_REGEXP; + if (wordDefinition && wordDefinition instanceof RegExp) { + if (!wordDefinition.global) { + let flags = "g"; + if (wordDefinition.ignoreCase) { + flags += "i"; + } + if (wordDefinition.multiline) { + flags += "m"; + } + if (wordDefinition.unicode) { + flags += "u"; + } + result = new RegExp(wordDefinition.source, flags); + } else { + result = wordDefinition; + } + } + result.lastIndex = 0; + return result; +} +var _defaultConfig = new LinkedList(); +_defaultConfig.unshift({ + maxLen: 1e3, + windowSize: 15, + timeBudget: 150 +}); +function getWordAtText(column, wordDefinition, text, textOffset, config) { + wordDefinition = ensureValidWordDefinition(wordDefinition); + if (!config) { + config = Iterable.first(_defaultConfig); + } + if (text.length > config.maxLen) { + let start2 = column - config.maxLen / 2; + if (start2 < 0) { + start2 = 0; + } else { + textOffset += start2; + } + text = text.substring(start2, column + config.maxLen / 2); + return getWordAtText(column, wordDefinition, text, textOffset, config); + } + const t1 = Date.now(); + const pos = column - 1 - textOffset; + let prevRegexIndex = -1; + let match = null; + for (let i = 1; ; i++) { + if (Date.now() - t1 >= config.timeBudget) { + break; + } + const regexIndex = pos - config.windowSize * i; + wordDefinition.lastIndex = Math.max(0, regexIndex); + const thisMatch = _findRegexMatchEnclosingPosition(wordDefinition, text, pos, prevRegexIndex); + if (!thisMatch && match) { + break; + } + match = thisMatch; + if (regexIndex <= 0) { + break; + } + prevRegexIndex = regexIndex; + } + if (match) { + const result = { + word: match[0], + startColumn: textOffset + 1 + match.index, + endColumn: textOffset + 1 + match.index + match[0].length + }; + wordDefinition.lastIndex = 0; + return result; + } + return null; +} +function _findRegexMatchEnclosingPosition(wordDefinition, text, pos, stopPos) { + let match; + while (match = wordDefinition.exec(text)) { + const matchIndex = match.index || 0; + if (matchIndex <= pos && wordDefinition.lastIndex >= pos) { + return match; + } else if (stopPos > 0 && matchIndex > stopPos) { + return null; + } + } + return null; +} + +// node_modules/monaco-editor-core/esm/vs/editor/common/services/unicodeTextModelHighlighter.js +var UnicodeTextModelHighlighter = class { + static computeUnicodeHighlights(model, options, range) { + const startLine = range ? range.startLineNumber : 1; + const endLine = range ? range.endLineNumber : model.getLineCount(); + const codePointHighlighter = new CodePointHighlighter(options); + const candidates = codePointHighlighter.getCandidateCodePoints(); + let regex; + if (candidates === "allNonBasicAscii") { + regex = new RegExp("[^\\t\\n\\r\\x20-\\x7E]", "g"); + } else { + regex = new RegExp(`${buildRegExpCharClassExpr(Array.from(candidates))}`, "g"); + } + const searcher = new Searcher(null, regex); + const ranges = []; + let hasMore = false; + let m; + let ambiguousCharacterCount = 0; + let invisibleCharacterCount = 0; + let nonBasicAsciiCharacterCount = 0; + forLoop: for (let lineNumber = startLine, lineCount = endLine; lineNumber <= lineCount; lineNumber++) { + const lineContent = model.getLineContent(lineNumber); + const lineLength = lineContent.length; + searcher.reset(0); + do { + m = searcher.next(lineContent); + if (m) { + let startIndex = m.index; + let endIndex = m.index + m[0].length; + if (startIndex > 0) { + const charCodeBefore = lineContent.charCodeAt(startIndex - 1); + if (isHighSurrogate(charCodeBefore)) { + startIndex--; + } + } + if (endIndex + 1 < lineLength) { + const charCodeBefore = lineContent.charCodeAt(endIndex - 1); + if (isHighSurrogate(charCodeBefore)) { + endIndex++; + } + } + const str = lineContent.substring(startIndex, endIndex); + let word = getWordAtText(startIndex + 1, DEFAULT_WORD_REGEXP, lineContent, 0); + if (word && word.endColumn <= startIndex + 1) { + word = null; + } + const highlightReason = codePointHighlighter.shouldHighlightNonBasicASCII(str, word ? word.word : null); + if (highlightReason !== 0) { + if (highlightReason === 3) { + ambiguousCharacterCount++; + } else if (highlightReason === 2) { + invisibleCharacterCount++; + } else if (highlightReason === 1) { + nonBasicAsciiCharacterCount++; + } else { + assertNever(highlightReason); + } + const MAX_RESULT_LENGTH = 1e3; + if (ranges.length >= MAX_RESULT_LENGTH) { + hasMore = true; + break forLoop; + } + ranges.push(new Range(lineNumber, startIndex + 1, lineNumber, endIndex + 1)); + } + } + } while (m); + } + return { + ranges, + hasMore, + ambiguousCharacterCount, + invisibleCharacterCount, + nonBasicAsciiCharacterCount + }; + } + static computeUnicodeHighlightReason(char, options) { + const codePointHighlighter = new CodePointHighlighter(options); + const reason = codePointHighlighter.shouldHighlightNonBasicASCII(char, null); + switch (reason) { + case 0: + return null; + case 2: + return { + kind: 1 + /* UnicodeHighlighterReasonKind.Invisible */ + }; + case 3: { + const codePoint = char.codePointAt(0); + const primaryConfusable = codePointHighlighter.ambiguousCharacters.getPrimaryConfusable(codePoint); + const notAmbiguousInLocales = AmbiguousCharacters.getLocales().filter((l) => !AmbiguousCharacters.getInstance(/* @__PURE__ */ new Set([...options.allowedLocales, l])).isAmbiguous(codePoint)); + return { kind: 0, confusableWith: String.fromCodePoint(primaryConfusable), notAmbiguousInLocales }; + } + case 1: + return { + kind: 2 + /* UnicodeHighlighterReasonKind.NonBasicAscii */ + }; + } + } +}; +function buildRegExpCharClassExpr(codePoints, flags) { + const src = `[${escapeRegExpCharacters(codePoints.map((i) => String.fromCodePoint(i)).join(""))}]`; + return src; +} +var CodePointHighlighter = class { + constructor(options) { + this.options = options; + this.allowedCodePoints = new Set(options.allowedCodePoints); + this.ambiguousCharacters = AmbiguousCharacters.getInstance(new Set(options.allowedLocales)); + } + getCandidateCodePoints() { + if (this.options.nonBasicASCII) { + return "allNonBasicAscii"; + } + const set = /* @__PURE__ */ new Set(); + if (this.options.invisibleCharacters) { + for (const cp of InvisibleCharacters.codePoints) { + if (!isAllowedInvisibleCharacter(String.fromCodePoint(cp))) { + set.add(cp); + } + } + } + if (this.options.ambiguousCharacters) { + for (const cp of this.ambiguousCharacters.getConfusableCodePoints()) { + set.add(cp); + } + } + for (const cp of this.allowedCodePoints) { + set.delete(cp); + } + return set; + } + shouldHighlightNonBasicASCII(character, wordContext) { + const codePoint = character.codePointAt(0); + if (this.allowedCodePoints.has(codePoint)) { + return 0; + } + if (this.options.nonBasicASCII) { + return 1; + } + let hasBasicASCIICharacters = false; + let hasNonConfusableNonBasicAsciiCharacter = false; + if (wordContext) { + for (const char of wordContext) { + const codePoint2 = char.codePointAt(0); + const isBasicASCII2 = isBasicASCII(char); + hasBasicASCIICharacters = hasBasicASCIICharacters || isBasicASCII2; + if (!isBasicASCII2 && !this.ambiguousCharacters.isAmbiguous(codePoint2) && !InvisibleCharacters.isInvisibleCharacter(codePoint2)) { + hasNonConfusableNonBasicAsciiCharacter = true; + } + } + } + if ( + /* Don't allow mixing weird looking characters with ASCII */ + !hasBasicASCIICharacters && /* Is there an obviously weird looking character? */ + hasNonConfusableNonBasicAsciiCharacter + ) { + return 0; + } + if (this.options.invisibleCharacters) { + if (!isAllowedInvisibleCharacter(character) && InvisibleCharacters.isInvisibleCharacter(codePoint)) { + return 2; + } + } + if (this.options.ambiguousCharacters) { + if (this.ambiguousCharacters.isAmbiguous(codePoint)) { + return 3; + } + } + return 0; + } +}; +function isAllowedInvisibleCharacter(character) { + return character === " " || character === "\n" || character === " "; +} + +// node_modules/monaco-editor-core/esm/vs/editor/common/diff/linesDiffComputer.js +var LinesDiff = class { + constructor(changes, moves, hitTimeout) { + this.changes = changes; + this.moves = moves; + this.hitTimeout = hitTimeout; + } +}; +var MovedText = class { + constructor(lineRangeMapping, changes) { + this.lineRangeMapping = lineRangeMapping; + this.changes = changes; + } +}; + +// node_modules/monaco-editor-core/esm/vs/base/common/arrays.js +function equals2(one, other, itemEquals = (a, b) => a === b) { + if (one === other) { + return true; + } + if (!one || !other) { + return false; + } + if (one.length !== other.length) { + return false; + } + for (let i = 0, len = one.length; i < len; i++) { + if (!itemEquals(one[i], other[i])) { + return false; + } + } + return true; +} +function* groupAdjacentBy(items, shouldBeGrouped) { + let currentGroup; + let last; + for (const item of items) { + if (last !== void 0 && shouldBeGrouped(last, item)) { + currentGroup.push(item); + } else { + if (currentGroup) { + yield currentGroup; + } + currentGroup = [item]; + } + last = item; + } + if (currentGroup) { + yield currentGroup; + } +} +function forEachAdjacent(arr, f) { + for (let i = 0; i <= arr.length; i++) { + f(i === 0 ? void 0 : arr[i - 1], i === arr.length ? void 0 : arr[i]); + } +} +function forEachWithNeighbors(arr, f) { + for (let i = 0; i < arr.length; i++) { + f(i === 0 ? void 0 : arr[i - 1], arr[i], i + 1 === arr.length ? void 0 : arr[i + 1]); + } +} +function pushMany(arr, items) { + for (const item of items) { + arr.push(item); + } +} +var CompareResult; +(function(CompareResult2) { + function isLessThan(result) { + return result < 0; + } + CompareResult2.isLessThan = isLessThan; + function isLessThanOrEqual(result) { + return result <= 0; + } + CompareResult2.isLessThanOrEqual = isLessThanOrEqual; + function isGreaterThan(result) { + return result > 0; + } + CompareResult2.isGreaterThan = isGreaterThan; + function isNeitherLessOrGreaterThan(result) { + return result === 0; + } + CompareResult2.isNeitherLessOrGreaterThan = isNeitherLessOrGreaterThan; + CompareResult2.greaterThan = 1; + CompareResult2.lessThan = -1; + CompareResult2.neitherLessOrGreaterThan = 0; +})(CompareResult || (CompareResult = {})); +function compareBy(selector, comparator) { + return (a, b) => comparator(selector(a), selector(b)); +} +var numberComparator = (a, b) => a - b; +function reverseOrder(comparator) { + return (a, b) => -comparator(a, b); +} +var CallbackIterable = class _CallbackIterable { + static { + this.empty = new _CallbackIterable((_callback) => { + }); + } + constructor(iterate) { + this.iterate = iterate; + } + toArray() { + const result = []; + this.iterate((item) => { + result.push(item); + return true; + }); + return result; + } + filter(predicate) { + return new _CallbackIterable((cb) => this.iterate((item) => predicate(item) ? cb(item) : true)); + } + map(mapFn) { + return new _CallbackIterable((cb) => this.iterate((item) => cb(mapFn(item)))); + } + findLast(predicate) { + let result; + this.iterate((item) => { + if (predicate(item)) { + result = item; + } + return true; + }); + return result; + } + findLastMaxBy(comparator) { + let result; + let first = true; + this.iterate((item) => { + if (first || CompareResult.isGreaterThan(comparator(item, result))) { + first = false; + result = item; + } + return true; + }); + return result; + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/common/core/ranges/offsetRange.js +var OffsetRange = class _OffsetRange { + static fromTo(start2, endExclusive) { + return new _OffsetRange(start2, endExclusive); + } + static addRange(range, sortedRanges) { + let i = 0; + while (i < sortedRanges.length && sortedRanges[i].endExclusive < range.start) { + i++; + } + let j = i; + while (j < sortedRanges.length && sortedRanges[j].start <= range.endExclusive) { + j++; + } + if (i === j) { + sortedRanges.splice(i, 0, range); + } else { + const start2 = Math.min(range.start, sortedRanges[i].start); + const end = Math.max(range.endExclusive, sortedRanges[j - 1].endExclusive); + sortedRanges.splice(i, j - i, new _OffsetRange(start2, end)); + } + } + static tryCreate(start2, endExclusive) { + if (start2 > endExclusive) { + return void 0; + } + return new _OffsetRange(start2, endExclusive); + } + static ofLength(length) { + return new _OffsetRange(0, length); + } + static ofStartAndLength(start2, length) { + return new _OffsetRange(start2, start2 + length); + } + static emptyAt(offset) { + return new _OffsetRange(offset, offset); + } + constructor(start2, endExclusive) { + this.start = start2; + this.endExclusive = endExclusive; + if (start2 > endExclusive) { + throw new BugIndicatingError(`Invalid range: ${this.toString()}`); + } + } + get isEmpty() { + return this.start === this.endExclusive; + } + delta(offset) { + return new _OffsetRange(this.start + offset, this.endExclusive + offset); + } + deltaStart(offset) { + return new _OffsetRange(this.start + offset, this.endExclusive); + } + deltaEnd(offset) { + return new _OffsetRange(this.start, this.endExclusive + offset); + } + get length() { + return this.endExclusive - this.start; + } + toString() { + return `[${this.start}, ${this.endExclusive})`; + } + equals(other) { + return this.start === other.start && this.endExclusive === other.endExclusive; + } + contains(offset) { + return this.start <= offset && offset < this.endExclusive; + } + /** + * for all numbers n: range1.contains(n) or range2.contains(n) => range1.join(range2).contains(n) + * The joined range is the smallest range that contains both ranges. + */ + join(other) { + return new _OffsetRange(Math.min(this.start, other.start), Math.max(this.endExclusive, other.endExclusive)); + } + /** + * for all numbers n: range1.contains(n) and range2.contains(n) <=> range1.intersect(range2).contains(n) + * + * The resulting range is empty if the ranges do not intersect, but touch. + * If the ranges don't even touch, the result is undefined. + */ + intersect(other) { + const start2 = Math.max(this.start, other.start); + const end = Math.min(this.endExclusive, other.endExclusive); + if (start2 <= end) { + return new _OffsetRange(start2, end); + } + return void 0; + } + intersectionLength(range) { + const start2 = Math.max(this.start, range.start); + const end = Math.min(this.endExclusive, range.endExclusive); + return Math.max(0, end - start2); + } + intersects(other) { + const start2 = Math.max(this.start, other.start); + const end = Math.min(this.endExclusive, other.endExclusive); + return start2 < end; + } + intersectsOrTouches(other) { + const start2 = Math.max(this.start, other.start); + const end = Math.min(this.endExclusive, other.endExclusive); + return start2 <= end; + } + isBefore(other) { + return this.endExclusive <= other.start; + } + isAfter(other) { + return this.start >= other.endExclusive; + } + slice(arr) { + return arr.slice(this.start, this.endExclusive); + } + substring(str) { + return str.substring(this.start, this.endExclusive); + } + /** + * Returns the given value if it is contained in this instance, otherwise the closest value that is contained. + * The range must not be empty. + */ + clip(value) { + if (this.isEmpty) { + throw new BugIndicatingError(`Invalid clipping range: ${this.toString()}`); + } + return Math.max(this.start, Math.min(this.endExclusive - 1, value)); + } + /** + * Returns `r := value + k * length` such that `r` is contained in this range. + * The range must not be empty. + * + * E.g. `[5, 10).clipCyclic(10) === 5`, `[5, 10).clipCyclic(11) === 6` and `[5, 10).clipCyclic(4) === 9`. + */ + clipCyclic(value) { + if (this.isEmpty) { + throw new BugIndicatingError(`Invalid clipping range: ${this.toString()}`); + } + if (value < this.start) { + return this.endExclusive - (this.start - value) % this.length; + } + if (value >= this.endExclusive) { + return this.start + (value - this.start) % this.length; + } + return value; + } + forEach(f) { + for (let i = this.start; i < this.endExclusive; i++) { + f(i); + } + } + /** + * this: [ 5, 10), range: [10, 15) => [5, 15)] + * Throws if the ranges are not touching. + */ + joinRightTouching(range) { + if (this.endExclusive !== range.start) { + throw new BugIndicatingError(`Invalid join: ${this.toString()} and ${range.toString()}`); + } + return new _OffsetRange(this.start, range.endExclusive); + } +}; + +// node_modules/monaco-editor-core/esm/vs/base/common/arraysFind.js +function findLastMonotonous(array, predicate) { + const idx = findLastIdxMonotonous(array, predicate); + return idx === -1 ? void 0 : array[idx]; +} +function findLastIdxMonotonous(array, predicate, startIdx = 0, endIdxEx = array.length) { + let i = startIdx; + let j = endIdxEx; + while (i < j) { + const k = Math.floor((i + j) / 2); + if (predicate(array[k])) { + i = k + 1; + } else { + j = k; + } + } + return i - 1; +} +function findFirstMonotonous(array, predicate) { + const idx = findFirstIdxMonotonousOrArrLen(array, predicate); + return idx === array.length ? void 0 : array[idx]; +} +function findFirstIdxMonotonousOrArrLen(array, predicate, startIdx = 0, endIdxEx = array.length) { + let i = startIdx; + let j = endIdxEx; + while (i < j) { + const k = Math.floor((i + j) / 2); + if (predicate(array[k])) { + j = k; + } else { + i = k + 1; + } + } + return i; +} +var MonotonousArray = class _MonotonousArray { + static { + this.assertInvariants = false; + } + constructor(_array) { + this._array = _array; + this._findLastMonotonousLastIdx = 0; + } + /** + * The predicate must be monotonous, i.e. `arr.map(predicate)` must be like `[true, ..., true, false, ..., false]`! + * For subsequent calls, current predicate must be weaker than (or equal to) the previous predicate, i.e. more entries must be `true`. + */ + findLastMonotonous(predicate) { + if (_MonotonousArray.assertInvariants) { + if (this._prevFindLastPredicate) { + for (const item of this._array) { + if (this._prevFindLastPredicate(item) && !predicate(item)) { + throw new Error("MonotonousArray: current predicate must be weaker than (or equal to) the previous predicate."); + } + } + } + this._prevFindLastPredicate = predicate; + } + const idx = findLastIdxMonotonous(this._array, predicate, this._findLastMonotonousLastIdx); + this._findLastMonotonousLastIdx = idx + 1; + return idx === -1 ? void 0 : this._array[idx]; + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/common/core/ranges/lineRange.js +var LineRange = class _LineRange { + static ofLength(startLineNumber, length) { + return new _LineRange(startLineNumber, startLineNumber + length); + } + static fromRange(range) { + return new _LineRange(range.startLineNumber, range.endLineNumber); + } + static fromRangeInclusive(range) { + return new _LineRange(range.startLineNumber, range.endLineNumber + 1); + } + static { + this.compareByStart = compareBy((l) => l.startLineNumber, numberComparator); + } + /** + * @param lineRanges An array of arrays of of sorted line ranges. + */ + static joinMany(lineRanges) { + if (lineRanges.length === 0) { + return []; + } + let result = new LineRangeSet(lineRanges[0].slice()); + for (let i = 1; i < lineRanges.length; i++) { + result = result.getUnion(new LineRangeSet(lineRanges[i].slice())); + } + return result.ranges; + } + static join(lineRanges) { + if (lineRanges.length === 0) { + throw new BugIndicatingError("lineRanges cannot be empty"); + } + let startLineNumber = lineRanges[0].startLineNumber; + let endLineNumberExclusive = lineRanges[0].endLineNumberExclusive; + for (let i = 1; i < lineRanges.length; i++) { + startLineNumber = Math.min(startLineNumber, lineRanges[i].startLineNumber); + endLineNumberExclusive = Math.max(endLineNumberExclusive, lineRanges[i].endLineNumberExclusive); + } + return new _LineRange(startLineNumber, endLineNumberExclusive); + } + /** + * @internal + */ + static deserialize(lineRange) { + return new _LineRange(lineRange[0], lineRange[1]); + } + constructor(startLineNumber, endLineNumberExclusive) { + if (startLineNumber > endLineNumberExclusive) { + throw new BugIndicatingError(`startLineNumber ${startLineNumber} cannot be after endLineNumberExclusive ${endLineNumberExclusive}`); + } + this.startLineNumber = startLineNumber; + this.endLineNumberExclusive = endLineNumberExclusive; + } + /** + * Indicates if this line range contains the given line number. + */ + contains(lineNumber) { + return this.startLineNumber <= lineNumber && lineNumber < this.endLineNumberExclusive; + } + /** + * Indicates if this line range is empty. + */ + get isEmpty() { + return this.startLineNumber === this.endLineNumberExclusive; + } + /** + * Moves this line range by the given offset of line numbers. + */ + delta(offset) { + return new _LineRange(this.startLineNumber + offset, this.endLineNumberExclusive + offset); + } + deltaLength(offset) { + return new _LineRange(this.startLineNumber, this.endLineNumberExclusive + offset); + } + /** + * The number of lines this line range spans. + */ + get length() { + return this.endLineNumberExclusive - this.startLineNumber; + } + /** + * Creates a line range that combines this and the given line range. + */ + join(other) { + return new _LineRange(Math.min(this.startLineNumber, other.startLineNumber), Math.max(this.endLineNumberExclusive, other.endLineNumberExclusive)); + } + toString() { + return `[${this.startLineNumber},${this.endLineNumberExclusive})`; + } + /** + * The resulting range is empty if the ranges do not intersect, but touch. + * If the ranges don't even touch, the result is undefined. + */ + intersect(other) { + const startLineNumber = Math.max(this.startLineNumber, other.startLineNumber); + const endLineNumberExclusive = Math.min(this.endLineNumberExclusive, other.endLineNumberExclusive); + if (startLineNumber <= endLineNumberExclusive) { + return new _LineRange(startLineNumber, endLineNumberExclusive); + } + return void 0; + } + intersectsStrict(other) { + return this.startLineNumber < other.endLineNumberExclusive && other.startLineNumber < this.endLineNumberExclusive; + } + intersectsOrTouches(other) { + return this.startLineNumber <= other.endLineNumberExclusive && other.startLineNumber <= this.endLineNumberExclusive; + } + equals(b) { + return this.startLineNumber === b.startLineNumber && this.endLineNumberExclusive === b.endLineNumberExclusive; + } + toInclusiveRange() { + if (this.isEmpty) { + return null; + } + return new Range(this.startLineNumber, 1, this.endLineNumberExclusive - 1, Number.MAX_SAFE_INTEGER); + } + /** + * @deprecated Using this function is discouraged because it might lead to bugs: The end position is not guaranteed to be a valid position! + */ + toExclusiveRange() { + return new Range(this.startLineNumber, 1, this.endLineNumberExclusive, 1); + } + mapToLineArray(f) { + const result = []; + for (let lineNumber = this.startLineNumber; lineNumber < this.endLineNumberExclusive; lineNumber++) { + result.push(f(lineNumber)); + } + return result; + } + forEach(f) { + for (let lineNumber = this.startLineNumber; lineNumber < this.endLineNumberExclusive; lineNumber++) { + f(lineNumber); + } + } + /** + * @internal + */ + serialize() { + return [this.startLineNumber, this.endLineNumberExclusive]; + } + /** + * Converts this 1-based line range to a 0-based offset range (subtracts 1!). + * @internal + */ + toOffsetRange() { + return new OffsetRange(this.startLineNumber - 1, this.endLineNumberExclusive - 1); + } + addMargin(marginTop, marginBottom) { + return new _LineRange(this.startLineNumber - marginTop, this.endLineNumberExclusive + marginBottom); + } +}; +var LineRangeSet = class _LineRangeSet { + constructor(_normalizedRanges = []) { + this._normalizedRanges = _normalizedRanges; + } + get ranges() { + return this._normalizedRanges; + } + addRange(range) { + if (range.length === 0) { + return; + } + const joinRangeStartIdx = findFirstIdxMonotonousOrArrLen(this._normalizedRanges, (r) => r.endLineNumberExclusive >= range.startLineNumber); + const joinRangeEndIdxExclusive = findLastIdxMonotonous(this._normalizedRanges, (r) => r.startLineNumber <= range.endLineNumberExclusive) + 1; + if (joinRangeStartIdx === joinRangeEndIdxExclusive) { + this._normalizedRanges.splice(joinRangeStartIdx, 0, range); + } else if (joinRangeStartIdx === joinRangeEndIdxExclusive - 1) { + const joinRange = this._normalizedRanges[joinRangeStartIdx]; + this._normalizedRanges[joinRangeStartIdx] = joinRange.join(range); + } else { + const joinRange = this._normalizedRanges[joinRangeStartIdx].join(this._normalizedRanges[joinRangeEndIdxExclusive - 1]).join(range); + this._normalizedRanges.splice(joinRangeStartIdx, joinRangeEndIdxExclusive - joinRangeStartIdx, joinRange); + } + } + contains(lineNumber) { + const rangeThatStartsBeforeEnd = findLastMonotonous(this._normalizedRanges, (r) => r.startLineNumber <= lineNumber); + return !!rangeThatStartsBeforeEnd && rangeThatStartsBeforeEnd.endLineNumberExclusive > lineNumber; + } + intersects(range) { + const rangeThatStartsBeforeEnd = findLastMonotonous(this._normalizedRanges, (r) => r.startLineNumber < range.endLineNumberExclusive); + return !!rangeThatStartsBeforeEnd && rangeThatStartsBeforeEnd.endLineNumberExclusive > range.startLineNumber; + } + getUnion(other) { + if (this._normalizedRanges.length === 0) { + return other; + } + if (other._normalizedRanges.length === 0) { + return this; + } + const result = []; + let i1 = 0; + let i2 = 0; + let current = null; + while (i1 < this._normalizedRanges.length || i2 < other._normalizedRanges.length) { + let next = null; + if (i1 < this._normalizedRanges.length && i2 < other._normalizedRanges.length) { + const lineRange1 = this._normalizedRanges[i1]; + const lineRange2 = other._normalizedRanges[i2]; + if (lineRange1.startLineNumber < lineRange2.startLineNumber) { + next = lineRange1; + i1++; + } else { + next = lineRange2; + i2++; + } + } else if (i1 < this._normalizedRanges.length) { + next = this._normalizedRanges[i1]; + i1++; + } else { + next = other._normalizedRanges[i2]; + i2++; + } + if (current === null) { + current = next; + } else { + if (current.endLineNumberExclusive >= next.startLineNumber) { + current = new LineRange(current.startLineNumber, Math.max(current.endLineNumberExclusive, next.endLineNumberExclusive)); + } else { + result.push(current); + current = next; + } + } + } + if (current !== null) { + result.push(current); + } + return new _LineRangeSet(result); + } + /** + * Subtracts all ranges in this set from `range` and returns the result. + */ + subtractFrom(range) { + const joinRangeStartIdx = findFirstIdxMonotonousOrArrLen(this._normalizedRanges, (r) => r.endLineNumberExclusive >= range.startLineNumber); + const joinRangeEndIdxExclusive = findLastIdxMonotonous(this._normalizedRanges, (r) => r.startLineNumber <= range.endLineNumberExclusive) + 1; + if (joinRangeStartIdx === joinRangeEndIdxExclusive) { + return new _LineRangeSet([range]); + } + const result = []; + let startLineNumber = range.startLineNumber; + for (let i = joinRangeStartIdx; i < joinRangeEndIdxExclusive; i++) { + const r = this._normalizedRanges[i]; + if (r.startLineNumber > startLineNumber) { + result.push(new LineRange(startLineNumber, r.startLineNumber)); + } + startLineNumber = r.endLineNumberExclusive; + } + if (startLineNumber < range.endLineNumberExclusive) { + result.push(new LineRange(startLineNumber, range.endLineNumberExclusive)); + } + return new _LineRangeSet(result); + } + toString() { + return this._normalizedRanges.map((r) => r.toString()).join(", "); + } + getIntersection(other) { + const result = []; + let i1 = 0; + let i2 = 0; + while (i1 < this._normalizedRanges.length && i2 < other._normalizedRanges.length) { + const r1 = this._normalizedRanges[i1]; + const r2 = other._normalizedRanges[i2]; + const i = r1.intersect(r2); + if (i && !i.isEmpty) { + result.push(i); + } + if (r1.endLineNumberExclusive < r2.endLineNumberExclusive) { + i1++; + } else { + i2++; + } + } + return new _LineRangeSet(result); + } + getWithDelta(value) { + return new _LineRangeSet(this._normalizedRanges.map((r) => r.delta(value))); + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/common/core/text/textLength.js +var TextLength = class _TextLength { + static { + this.zero = new _TextLength(0, 0); + } + static betweenPositions(position1, position2) { + if (position1.lineNumber === position2.lineNumber) { + return new _TextLength(0, position2.column - position1.column); + } else { + return new _TextLength(position2.lineNumber - position1.lineNumber, position2.column - 1); + } + } + static fromPosition(pos) { + return new _TextLength(pos.lineNumber - 1, pos.column - 1); + } + static ofRange(range) { + return _TextLength.betweenPositions(range.getStartPosition(), range.getEndPosition()); + } + static ofText(text) { + let line = 0; + let column = 0; + for (const c of text) { + if (c === "\n") { + line++; + column = 0; + } else { + column++; + } + } + return new _TextLength(line, column); + } + constructor(lineCount, columnCount) { + this.lineCount = lineCount; + this.columnCount = columnCount; + } + isGreaterThanOrEqualTo(other) { + if (this.lineCount !== other.lineCount) { + return this.lineCount > other.lineCount; + } + return this.columnCount >= other.columnCount; + } + add(other) { + if (other.lineCount === 0) { + return new _TextLength(this.lineCount, this.columnCount + other.columnCount); + } else { + return new _TextLength(this.lineCount + other.lineCount, other.columnCount); + } + } + createRange(startPosition) { + if (this.lineCount === 0) { + return new Range(startPosition.lineNumber, startPosition.column, startPosition.lineNumber, startPosition.column + this.columnCount); + } else { + return new Range(startPosition.lineNumber, startPosition.column, startPosition.lineNumber + this.lineCount, this.columnCount + 1); + } + } + toRange() { + return new Range(1, 1, this.lineCount + 1, this.columnCount + 1); + } + toLineRange() { + return LineRange.ofLength(1, this.lineCount + 1); + } + addToPosition(position) { + if (this.lineCount === 0) { + return new Position(position.lineNumber, position.column + this.columnCount); + } else { + return new Position(position.lineNumber + this.lineCount, this.columnCount + 1); + } + } + toString() { + return `${this.lineCount},${this.columnCount}`; + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/common/core/text/positionToOffsetImpl.js +var PositionOffsetTransformerBase = class { + getOffsetRange(range) { + return new OffsetRange(this.getOffset(range.getStartPosition()), this.getOffset(range.getEndPosition())); + } + getRange(offsetRange) { + return Range.fromPositions(this.getPosition(offsetRange.start), this.getPosition(offsetRange.endExclusive)); + } + getStringReplacement(edit) { + return new Deps.deps.StringReplacement(this.getOffsetRange(edit.range), edit.text); + } + getTextReplacement(edit) { + return new Deps.deps.TextReplacement(this.getRange(edit.replaceRange), edit.newText); + } + getTextEdit(edit) { + const edits = edit.replacements.map((e) => this.getTextReplacement(e)); + return new Deps.deps.TextEdit(edits); + } +}; +var Deps = class { + static { + this._deps = void 0; + } + static get deps() { + if (!this._deps) { + throw new Error("Dependencies not set. Call _setDependencies first."); + } + return this._deps; + } +}; +var PositionOffsetTransformer = class extends PositionOffsetTransformerBase { + constructor(text) { + super(); + this.text = text; + this.lineStartOffsetByLineIdx = []; + this.lineEndOffsetByLineIdx = []; + this.lineStartOffsetByLineIdx.push(0); + for (let i = 0; i < text.length; i++) { + if (text.charAt(i) === "\n") { + this.lineStartOffsetByLineIdx.push(i + 1); + if (i > 0 && text.charAt(i - 1) === "\r") { + this.lineEndOffsetByLineIdx.push(i - 1); + } else { + this.lineEndOffsetByLineIdx.push(i); + } + } + } + this.lineEndOffsetByLineIdx.push(text.length); + } + getOffset(position) { + const valPos = this._validatePosition(position); + return this.lineStartOffsetByLineIdx[valPos.lineNumber - 1] + valPos.column - 1; + } + _validatePosition(position) { + if (position.lineNumber < 1) { + return new Position(1, 1); + } + const lineCount = this.textLength.lineCount + 1; + if (position.lineNumber > lineCount) { + const lineLength2 = this.getLineLength(lineCount); + return new Position(lineCount, lineLength2 + 1); + } + if (position.column < 1) { + return new Position(position.lineNumber, 1); + } + const lineLength = this.getLineLength(position.lineNumber); + if (position.column - 1 > lineLength) { + return new Position(position.lineNumber, lineLength + 1); + } + return position; + } + getPosition(offset) { + const idx = findLastIdxMonotonous(this.lineStartOffsetByLineIdx, (i) => i <= offset); + const lineNumber = idx + 1; + const column = offset - this.lineStartOffsetByLineIdx[idx] + 1; + return new Position(lineNumber, column); + } + get textLength() { + const lineIdx = this.lineStartOffsetByLineIdx.length - 1; + return new Deps.deps.TextLength(lineIdx, this.text.length - this.lineStartOffsetByLineIdx[lineIdx]); + } + getLineLength(lineNumber) { + return this.lineEndOffsetByLineIdx[lineNumber - 1] - this.lineStartOffsetByLineIdx[lineNumber - 1]; + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/common/core/text/abstractText.js +var AbstractText = class { + constructor() { + this._transformer = void 0; + } + get endPositionExclusive() { + return this.length.addToPosition(new Position(1, 1)); + } + get lineRange() { + return this.length.toLineRange(); + } + getValue() { + return this.getValueOfRange(this.length.toRange()); + } + getValueOfOffsetRange(range) { + return this.getValueOfRange(this.getTransformer().getRange(range)); + } + getLineLength(lineNumber) { + return this.getValueOfRange(new Range(lineNumber, 1, lineNumber, Number.MAX_SAFE_INTEGER)).length; + } + getTransformer() { + if (!this._transformer) { + this._transformer = new PositionOffsetTransformer(this.getValue()); + } + return this._transformer; + } + getLineAt(lineNumber) { + return this.getValueOfRange(new Range(lineNumber, 1, lineNumber, Number.MAX_SAFE_INTEGER)); + } +}; +var LineBasedText = class extends AbstractText { + constructor(_getLineContent, _lineCount) { + assert(_lineCount >= 1); + super(); + this._getLineContent = _getLineContent; + this._lineCount = _lineCount; + } + getValueOfRange(range) { + if (range.startLineNumber === range.endLineNumber) { + return this._getLineContent(range.startLineNumber).substring(range.startColumn - 1, range.endColumn - 1); + } + let result = this._getLineContent(range.startLineNumber).substring(range.startColumn - 1); + for (let i = range.startLineNumber + 1; i < range.endLineNumber; i++) { + result += "\n" + this._getLineContent(i); + } + result += "\n" + this._getLineContent(range.endLineNumber).substring(0, range.endColumn - 1); + return result; + } + getLineLength(lineNumber) { + return this._getLineContent(lineNumber).length; + } + get length() { + const lastLine = this._getLineContent(this._lineCount); + return new TextLength(this._lineCount - 1, lastLine.length); + } +}; +var ArrayText = class extends LineBasedText { + constructor(lines) { + super((lineNumber) => lines[lineNumber - 1], lines.length); + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/common/core/edits/textEdit.js +var TextReplacement = class _TextReplacement { + static joinReplacements(replacements, initialValue) { + if (replacements.length === 0) { + throw new BugIndicatingError(); + } + if (replacements.length === 1) { + return replacements[0]; + } + const startPos = replacements[0].range.getStartPosition(); + const endPos = replacements[replacements.length - 1].range.getEndPosition(); + let newText = ""; + for (let i = 0; i < replacements.length; i++) { + const curEdit = replacements[i]; + newText += curEdit.text; + if (i < replacements.length - 1) { + const nextEdit = replacements[i + 1]; + const gapRange = Range.fromPositions(curEdit.range.getEndPosition(), nextEdit.range.getStartPosition()); + const gapText = initialValue.getValueOfRange(gapRange); + newText += gapText; + } + } + return new _TextReplacement(Range.fromPositions(startPos, endPos), newText); + } + static fromStringReplacement(replacement, initialState) { + return new _TextReplacement(initialState.getTransformer().getRange(replacement.replaceRange), replacement.newText); + } + static delete(range) { + return new _TextReplacement(range, ""); + } + constructor(range, text) { + this.range = range; + this.text = text; + } + get isEmpty() { + return this.range.isEmpty() && this.text.length === 0; + } + static equals(first, second) { + return first.range.equalsRange(second.range) && first.text === second.text; + } + equals(other) { + return _TextReplacement.equals(this, other); + } + removeCommonPrefixAndSuffix(text) { + const prefix = this.removeCommonPrefix(text); + const suffix = prefix.removeCommonSuffix(text); + return suffix; + } + removeCommonPrefix(text) { + const normalizedOriginalText = text.getValueOfRange(this.range).replaceAll("\r\n", "\n"); + const normalizedModifiedText = this.text.replaceAll("\r\n", "\n"); + const commonPrefixLen = commonPrefixLength(normalizedOriginalText, normalizedModifiedText); + const start2 = TextLength.ofText(normalizedOriginalText.substring(0, commonPrefixLen)).addToPosition(this.range.getStartPosition()); + const newText = normalizedModifiedText.substring(commonPrefixLen); + const range = Range.fromPositions(start2, this.range.getEndPosition()); + return new _TextReplacement(range, newText); + } + removeCommonSuffix(text) { + const normalizedOriginalText = text.getValueOfRange(this.range).replaceAll("\r\n", "\n"); + const normalizedModifiedText = this.text.replaceAll("\r\n", "\n"); + const commonSuffixLen = commonSuffixLength(normalizedOriginalText, normalizedModifiedText); + const end = TextLength.ofText(normalizedOriginalText.substring(0, normalizedOriginalText.length - commonSuffixLen)).addToPosition(this.range.getStartPosition()); + const newText = normalizedModifiedText.substring(0, normalizedModifiedText.length - commonSuffixLen); + const range = Range.fromPositions(this.range.getStartPosition(), end); + return new _TextReplacement(range, newText); + } + toString() { + const start2 = this.range.getStartPosition(); + const end = this.range.getEndPosition(); + return `(${start2.lineNumber},${start2.column} -> ${end.lineNumber},${end.column}): "${this.text}"`; + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/common/diff/rangeMapping.js +var LineRangeMapping = class _LineRangeMapping { + static inverse(mapping, originalLineCount, modifiedLineCount) { + const result = []; + let lastOriginalEndLineNumber = 1; + let lastModifiedEndLineNumber = 1; + for (const m of mapping) { + const r2 = new _LineRangeMapping(new LineRange(lastOriginalEndLineNumber, m.original.startLineNumber), new LineRange(lastModifiedEndLineNumber, m.modified.startLineNumber)); + if (!r2.modified.isEmpty) { + result.push(r2); + } + lastOriginalEndLineNumber = m.original.endLineNumberExclusive; + lastModifiedEndLineNumber = m.modified.endLineNumberExclusive; + } + const r = new _LineRangeMapping(new LineRange(lastOriginalEndLineNumber, originalLineCount + 1), new LineRange(lastModifiedEndLineNumber, modifiedLineCount + 1)); + if (!r.modified.isEmpty) { + result.push(r); + } + return result; + } + static clip(mapping, originalRange, modifiedRange) { + const result = []; + for (const m of mapping) { + const original = m.original.intersect(originalRange); + const modified = m.modified.intersect(modifiedRange); + if (original && !original.isEmpty && modified && !modified.isEmpty) { + result.push(new _LineRangeMapping(original, modified)); + } + } + return result; + } + constructor(originalRange, modifiedRange) { + this.original = originalRange; + this.modified = modifiedRange; + } + toString() { + return `{${this.original.toString()}->${this.modified.toString()}}`; + } + flip() { + return new _LineRangeMapping(this.modified, this.original); + } + join(other) { + return new _LineRangeMapping(this.original.join(other.original), this.modified.join(other.modified)); + } + /** + * This method assumes that the LineRangeMapping describes a valid diff! + * I.e. if one range is empty, the other range cannot be the entire document. + * It avoids various problems when the line range points to non-existing line-numbers. + */ + toRangeMapping() { + const origInclusiveRange = this.original.toInclusiveRange(); + const modInclusiveRange = this.modified.toInclusiveRange(); + if (origInclusiveRange && modInclusiveRange) { + return new RangeMapping(origInclusiveRange, modInclusiveRange); + } else if (this.original.startLineNumber === 1 || this.modified.startLineNumber === 1) { + if (!(this.modified.startLineNumber === 1 && this.original.startLineNumber === 1)) { + throw new BugIndicatingError("not a valid diff"); + } + return new RangeMapping(new Range(this.original.startLineNumber, 1, this.original.endLineNumberExclusive, 1), new Range(this.modified.startLineNumber, 1, this.modified.endLineNumberExclusive, 1)); + } else { + return new RangeMapping(new Range(this.original.startLineNumber - 1, Number.MAX_SAFE_INTEGER, this.original.endLineNumberExclusive - 1, Number.MAX_SAFE_INTEGER), new Range(this.modified.startLineNumber - 1, Number.MAX_SAFE_INTEGER, this.modified.endLineNumberExclusive - 1, Number.MAX_SAFE_INTEGER)); + } + } + /** + * This method assumes that the LineRangeMapping describes a valid diff! + * I.e. if one range is empty, the other range cannot be the entire document. + * It avoids various problems when the line range points to non-existing line-numbers. + */ + toRangeMapping2(original, modified) { + if (isValidLineNumber(this.original.endLineNumberExclusive, original) && isValidLineNumber(this.modified.endLineNumberExclusive, modified)) { + return new RangeMapping(new Range(this.original.startLineNumber, 1, this.original.endLineNumberExclusive, 1), new Range(this.modified.startLineNumber, 1, this.modified.endLineNumberExclusive, 1)); + } + if (!this.original.isEmpty && !this.modified.isEmpty) { + return new RangeMapping(Range.fromPositions(new Position(this.original.startLineNumber, 1), normalizePosition(new Position(this.original.endLineNumberExclusive - 1, Number.MAX_SAFE_INTEGER), original)), Range.fromPositions(new Position(this.modified.startLineNumber, 1), normalizePosition(new Position(this.modified.endLineNumberExclusive - 1, Number.MAX_SAFE_INTEGER), modified))); + } + if (this.original.startLineNumber > 1 && this.modified.startLineNumber > 1) { + return new RangeMapping(Range.fromPositions(normalizePosition(new Position(this.original.startLineNumber - 1, Number.MAX_SAFE_INTEGER), original), normalizePosition(new Position(this.original.endLineNumberExclusive - 1, Number.MAX_SAFE_INTEGER), original)), Range.fromPositions(normalizePosition(new Position(this.modified.startLineNumber - 1, Number.MAX_SAFE_INTEGER), modified), normalizePosition(new Position(this.modified.endLineNumberExclusive - 1, Number.MAX_SAFE_INTEGER), modified))); + } + throw new BugIndicatingError(); + } +}; +function normalizePosition(position, content) { + if (position.lineNumber < 1) { + return new Position(1, 1); + } + if (position.lineNumber > content.length) { + return new Position(content.length, content[content.length - 1].length + 1); + } + const line = content[position.lineNumber - 1]; + if (position.column > line.length + 1) { + return new Position(position.lineNumber, line.length + 1); + } + return position; +} +function isValidLineNumber(lineNumber, lines) { + return lineNumber >= 1 && lineNumber <= lines.length; +} +var DetailedLineRangeMapping = class _DetailedLineRangeMapping extends LineRangeMapping { + static fromRangeMappings(rangeMappings) { + const originalRange = LineRange.join(rangeMappings.map((r) => LineRange.fromRangeInclusive(r.originalRange))); + const modifiedRange = LineRange.join(rangeMappings.map((r) => LineRange.fromRangeInclusive(r.modifiedRange))); + return new _DetailedLineRangeMapping(originalRange, modifiedRange, rangeMappings); + } + constructor(originalRange, modifiedRange, innerChanges) { + super(originalRange, modifiedRange); + this.innerChanges = innerChanges; + } + flip() { + return new _DetailedLineRangeMapping(this.modified, this.original, this.innerChanges?.map((c) => c.flip())); + } + withInnerChangesFromLineRanges() { + return new _DetailedLineRangeMapping(this.original, this.modified, [this.toRangeMapping()]); + } +}; +var RangeMapping = class _RangeMapping { + static fromEdit(edit) { + const newRanges = edit.getNewRanges(); + const result = edit.replacements.map((e, idx) => new _RangeMapping(e.range, newRanges[idx])); + return result; + } + static assertSorted(rangeMappings) { + for (let i = 1; i < rangeMappings.length; i++) { + const previous = rangeMappings[i - 1]; + const current = rangeMappings[i]; + if (!(previous.originalRange.getEndPosition().isBeforeOrEqual(current.originalRange.getStartPosition()) && previous.modifiedRange.getEndPosition().isBeforeOrEqual(current.modifiedRange.getStartPosition()))) { + throw new BugIndicatingError("Range mappings must be sorted"); + } + } + } + constructor(originalRange, modifiedRange) { + this.originalRange = originalRange; + this.modifiedRange = modifiedRange; + } + toString() { + return `{${this.originalRange.toString()}->${this.modifiedRange.toString()}}`; + } + flip() { + return new _RangeMapping(this.modifiedRange, this.originalRange); + } + /** + * Creates a single text edit that describes the change from the original to the modified text. + */ + toTextEdit(modified) { + const newText = modified.getValueOfRange(this.modifiedRange); + return new TextReplacement(this.originalRange, newText); + } +}; +function lineRangeMappingFromRangeMappings(alignments, originalLines, modifiedLines, dontAssertStartLine = false) { + const changes = []; + for (const g of groupAdjacentBy(alignments.map((a) => getLineRangeMapping(a, originalLines, modifiedLines)), (a1, a2) => a1.original.intersectsOrTouches(a2.original) || a1.modified.intersectsOrTouches(a2.modified))) { + const first = g[0]; + const last = g[g.length - 1]; + changes.push(new DetailedLineRangeMapping(first.original.join(last.original), first.modified.join(last.modified), g.map((a) => a.innerChanges[0]))); + } + assertFn(() => { + if (!dontAssertStartLine && changes.length > 0) { + if (changes[0].modified.startLineNumber !== changes[0].original.startLineNumber) { + return false; + } + if (modifiedLines.length.lineCount - changes[changes.length - 1].modified.endLineNumberExclusive !== originalLines.length.lineCount - changes[changes.length - 1].original.endLineNumberExclusive) { + return false; + } + } + return checkAdjacentItems(changes, (m1, m2) => m2.original.startLineNumber - m1.original.endLineNumberExclusive === m2.modified.startLineNumber - m1.modified.endLineNumberExclusive && // There has to be an unchanged line in between (otherwise both diffs should have been joined) + m1.original.endLineNumberExclusive < m2.original.startLineNumber && m1.modified.endLineNumberExclusive < m2.modified.startLineNumber); + }); + return changes; +} +function getLineRangeMapping(rangeMapping, originalLines, modifiedLines) { + let lineStartDelta = 0; + let lineEndDelta = 0; + if (rangeMapping.modifiedRange.endColumn === 1 && rangeMapping.originalRange.endColumn === 1 && rangeMapping.originalRange.startLineNumber + lineStartDelta <= rangeMapping.originalRange.endLineNumber && rangeMapping.modifiedRange.startLineNumber + lineStartDelta <= rangeMapping.modifiedRange.endLineNumber) { + lineEndDelta = -1; + } + if (rangeMapping.modifiedRange.startColumn - 1 >= modifiedLines.getLineLength(rangeMapping.modifiedRange.startLineNumber) && rangeMapping.originalRange.startColumn - 1 >= originalLines.getLineLength(rangeMapping.originalRange.startLineNumber) && rangeMapping.originalRange.startLineNumber <= rangeMapping.originalRange.endLineNumber + lineEndDelta && rangeMapping.modifiedRange.startLineNumber <= rangeMapping.modifiedRange.endLineNumber + lineEndDelta) { + lineStartDelta = 1; + } + const originalLineRange = new LineRange(rangeMapping.originalRange.startLineNumber + lineStartDelta, rangeMapping.originalRange.endLineNumber + 1 + lineEndDelta); + const modifiedLineRange = new LineRange(rangeMapping.modifiedRange.startLineNumber + lineStartDelta, rangeMapping.modifiedRange.endLineNumber + 1 + lineEndDelta); + return new DetailedLineRangeMapping(originalLineRange, modifiedLineRange, [rangeMapping]); +} + +// node_modules/monaco-editor-core/esm/vs/editor/common/diff/legacyLinesDiffComputer.js +var MINIMUM_MATCHING_CHARACTER_LENGTH = 3; +var LegacyLinesDiffComputer = class { + computeDiff(originalLines, modifiedLines, options) { + const diffComputer = new DiffComputer(originalLines, modifiedLines, { + maxComputationTime: options.maxComputationTimeMs, + shouldIgnoreTrimWhitespace: options.ignoreTrimWhitespace, + shouldComputeCharChanges: true, + shouldMakePrettyDiff: true, + shouldPostProcessCharChanges: true + }); + const result = diffComputer.computeDiff(); + const changes = []; + let lastChange = null; + for (const c of result.changes) { + let originalRange; + if (c.originalEndLineNumber === 0) { + originalRange = new LineRange(c.originalStartLineNumber + 1, c.originalStartLineNumber + 1); + } else { + originalRange = new LineRange(c.originalStartLineNumber, c.originalEndLineNumber + 1); + } + let modifiedRange; + if (c.modifiedEndLineNumber === 0) { + modifiedRange = new LineRange(c.modifiedStartLineNumber + 1, c.modifiedStartLineNumber + 1); + } else { + modifiedRange = new LineRange(c.modifiedStartLineNumber, c.modifiedEndLineNumber + 1); + } + let change = new DetailedLineRangeMapping(originalRange, modifiedRange, c.charChanges?.map((c2) => new RangeMapping(new Range(c2.originalStartLineNumber, c2.originalStartColumn, c2.originalEndLineNumber, c2.originalEndColumn), new Range(c2.modifiedStartLineNumber, c2.modifiedStartColumn, c2.modifiedEndLineNumber, c2.modifiedEndColumn)))); + if (lastChange) { + if (lastChange.modified.endLineNumberExclusive === change.modified.startLineNumber || lastChange.original.endLineNumberExclusive === change.original.startLineNumber) { + change = new DetailedLineRangeMapping(lastChange.original.join(change.original), lastChange.modified.join(change.modified), lastChange.innerChanges && change.innerChanges ? lastChange.innerChanges.concat(change.innerChanges) : void 0); + changes.pop(); + } + } + changes.push(change); + lastChange = change; + } + assertFn(() => { + return checkAdjacentItems(changes, (m1, m2) => m2.original.startLineNumber - m1.original.endLineNumberExclusive === m2.modified.startLineNumber - m1.modified.endLineNumberExclusive && // There has to be an unchanged line in between (otherwise both diffs should have been joined) + m1.original.endLineNumberExclusive < m2.original.startLineNumber && m1.modified.endLineNumberExclusive < m2.modified.startLineNumber); + }); + return new LinesDiff(changes, [], result.quitEarly); + } +}; +function computeDiff(originalSequence, modifiedSequence, continueProcessingPredicate, pretty) { + const diffAlgo = new LcsDiff(originalSequence, modifiedSequence, continueProcessingPredicate); + return diffAlgo.ComputeDiff(pretty); +} +var LineSequence = class { + constructor(lines) { + const startColumns = []; + const endColumns = []; + for (let i = 0, length = lines.length; i < length; i++) { + startColumns[i] = getFirstNonBlankColumn(lines[i], 1); + endColumns[i] = getLastNonBlankColumn(lines[i], 1); + } + this.lines = lines; + this._startColumns = startColumns; + this._endColumns = endColumns; + } + getElements() { + const elements = []; + for (let i = 0, len = this.lines.length; i < len; i++) { + elements[i] = this.lines[i].substring(this._startColumns[i] - 1, this._endColumns[i] - 1); + } + return elements; + } + getStrictElement(index) { + return this.lines[index]; + } + getStartLineNumber(i) { + return i + 1; + } + getEndLineNumber(i) { + return i + 1; + } + createCharSequence(shouldIgnoreTrimWhitespace, startIndex, endIndex) { + const charCodes = []; + const lineNumbers = []; + const columns = []; + let len = 0; + for (let index = startIndex; index <= endIndex; index++) { + const lineContent = this.lines[index]; + const startColumn = shouldIgnoreTrimWhitespace ? this._startColumns[index] : 1; + const endColumn = shouldIgnoreTrimWhitespace ? this._endColumns[index] : lineContent.length + 1; + for (let col = startColumn; col < endColumn; col++) { + charCodes[len] = lineContent.charCodeAt(col - 1); + lineNumbers[len] = index + 1; + columns[len] = col; + len++; + } + if (!shouldIgnoreTrimWhitespace && index < endIndex) { + charCodes[len] = 10; + lineNumbers[len] = index + 1; + columns[len] = lineContent.length + 1; + len++; + } + } + return new CharSequence(charCodes, lineNumbers, columns); + } +}; +var CharSequence = class { + constructor(charCodes, lineNumbers, columns) { + this._charCodes = charCodes; + this._lineNumbers = lineNumbers; + this._columns = columns; + } + toString() { + return "[" + this._charCodes.map((s, idx) => (s === 10 ? "\\n" : String.fromCharCode(s)) + `-(${this._lineNumbers[idx]},${this._columns[idx]})`).join(", ") + "]"; + } + _assertIndex(index, arr) { + if (index < 0 || index >= arr.length) { + throw new Error(`Illegal index`); + } + } + getElements() { + return this._charCodes; + } + getStartLineNumber(i) { + if (i > 0 && i === this._lineNumbers.length) { + return this.getEndLineNumber(i - 1); + } + this._assertIndex(i, this._lineNumbers); + return this._lineNumbers[i]; + } + getEndLineNumber(i) { + if (i === -1) { + return this.getStartLineNumber(i + 1); + } + this._assertIndex(i, this._lineNumbers); + if (this._charCodes[i] === 10) { + return this._lineNumbers[i] + 1; + } + return this._lineNumbers[i]; + } + getStartColumn(i) { + if (i > 0 && i === this._columns.length) { + return this.getEndColumn(i - 1); + } + this._assertIndex(i, this._columns); + return this._columns[i]; + } + getEndColumn(i) { + if (i === -1) { + return this.getStartColumn(i + 1); + } + this._assertIndex(i, this._columns); + if (this._charCodes[i] === 10) { + return 1; + } + return this._columns[i] + 1; + } +}; +var CharChange = class _CharChange { + constructor(originalStartLineNumber, originalStartColumn, originalEndLineNumber, originalEndColumn, modifiedStartLineNumber, modifiedStartColumn, modifiedEndLineNumber, modifiedEndColumn) { + this.originalStartLineNumber = originalStartLineNumber; + this.originalStartColumn = originalStartColumn; + this.originalEndLineNumber = originalEndLineNumber; + this.originalEndColumn = originalEndColumn; + this.modifiedStartLineNumber = modifiedStartLineNumber; + this.modifiedStartColumn = modifiedStartColumn; + this.modifiedEndLineNumber = modifiedEndLineNumber; + this.modifiedEndColumn = modifiedEndColumn; + } + static createFromDiffChange(diffChange, originalCharSequence, modifiedCharSequence) { + const originalStartLineNumber = originalCharSequence.getStartLineNumber(diffChange.originalStart); + const originalStartColumn = originalCharSequence.getStartColumn(diffChange.originalStart); + const originalEndLineNumber = originalCharSequence.getEndLineNumber(diffChange.originalStart + diffChange.originalLength - 1); + const originalEndColumn = originalCharSequence.getEndColumn(diffChange.originalStart + diffChange.originalLength - 1); + const modifiedStartLineNumber = modifiedCharSequence.getStartLineNumber(diffChange.modifiedStart); + const modifiedStartColumn = modifiedCharSequence.getStartColumn(diffChange.modifiedStart); + const modifiedEndLineNumber = modifiedCharSequence.getEndLineNumber(diffChange.modifiedStart + diffChange.modifiedLength - 1); + const modifiedEndColumn = modifiedCharSequence.getEndColumn(diffChange.modifiedStart + diffChange.modifiedLength - 1); + return new _CharChange(originalStartLineNumber, originalStartColumn, originalEndLineNumber, originalEndColumn, modifiedStartLineNumber, modifiedStartColumn, modifiedEndLineNumber, modifiedEndColumn); + } +}; +function postProcessCharChanges(rawChanges) { + if (rawChanges.length <= 1) { + return rawChanges; + } + const result = [rawChanges[0]]; + let prevChange = result[0]; + for (let i = 1, len = rawChanges.length; i < len; i++) { + const currChange = rawChanges[i]; + const originalMatchingLength = currChange.originalStart - (prevChange.originalStart + prevChange.originalLength); + const modifiedMatchingLength = currChange.modifiedStart - (prevChange.modifiedStart + prevChange.modifiedLength); + const matchingLength = Math.min(originalMatchingLength, modifiedMatchingLength); + if (matchingLength < MINIMUM_MATCHING_CHARACTER_LENGTH) { + prevChange.originalLength = currChange.originalStart + currChange.originalLength - prevChange.originalStart; + prevChange.modifiedLength = currChange.modifiedStart + currChange.modifiedLength - prevChange.modifiedStart; + } else { + result.push(currChange); + prevChange = currChange; + } + } + return result; +} +var LineChange = class _LineChange { + constructor(originalStartLineNumber, originalEndLineNumber, modifiedStartLineNumber, modifiedEndLineNumber, charChanges) { + this.originalStartLineNumber = originalStartLineNumber; + this.originalEndLineNumber = originalEndLineNumber; + this.modifiedStartLineNumber = modifiedStartLineNumber; + this.modifiedEndLineNumber = modifiedEndLineNumber; + this.charChanges = charChanges; + } + static createFromDiffResult(shouldIgnoreTrimWhitespace, diffChange, originalLineSequence, modifiedLineSequence, continueCharDiff, shouldComputeCharChanges, shouldPostProcessCharChanges) { + let originalStartLineNumber; + let originalEndLineNumber; + let modifiedStartLineNumber; + let modifiedEndLineNumber; + let charChanges = void 0; + if (diffChange.originalLength === 0) { + originalStartLineNumber = originalLineSequence.getStartLineNumber(diffChange.originalStart) - 1; + originalEndLineNumber = 0; + } else { + originalStartLineNumber = originalLineSequence.getStartLineNumber(diffChange.originalStart); + originalEndLineNumber = originalLineSequence.getEndLineNumber(diffChange.originalStart + diffChange.originalLength - 1); + } + if (diffChange.modifiedLength === 0) { + modifiedStartLineNumber = modifiedLineSequence.getStartLineNumber(diffChange.modifiedStart) - 1; + modifiedEndLineNumber = 0; + } else { + modifiedStartLineNumber = modifiedLineSequence.getStartLineNumber(diffChange.modifiedStart); + modifiedEndLineNumber = modifiedLineSequence.getEndLineNumber(diffChange.modifiedStart + diffChange.modifiedLength - 1); + } + if (shouldComputeCharChanges && diffChange.originalLength > 0 && diffChange.originalLength < 20 && diffChange.modifiedLength > 0 && diffChange.modifiedLength < 20 && continueCharDiff()) { + const originalCharSequence = originalLineSequence.createCharSequence(shouldIgnoreTrimWhitespace, diffChange.originalStart, diffChange.originalStart + diffChange.originalLength - 1); + const modifiedCharSequence = modifiedLineSequence.createCharSequence(shouldIgnoreTrimWhitespace, diffChange.modifiedStart, diffChange.modifiedStart + diffChange.modifiedLength - 1); + if (originalCharSequence.getElements().length > 0 && modifiedCharSequence.getElements().length > 0) { + let rawChanges = computeDiff(originalCharSequence, modifiedCharSequence, continueCharDiff, true).changes; + if (shouldPostProcessCharChanges) { + rawChanges = postProcessCharChanges(rawChanges); + } + charChanges = []; + for (let i = 0, length = rawChanges.length; i < length; i++) { + charChanges.push(CharChange.createFromDiffChange(rawChanges[i], originalCharSequence, modifiedCharSequence)); + } + } + } + return new _LineChange(originalStartLineNumber, originalEndLineNumber, modifiedStartLineNumber, modifiedEndLineNumber, charChanges); + } +}; +var DiffComputer = class { + constructor(originalLines, modifiedLines, opts) { + this.shouldComputeCharChanges = opts.shouldComputeCharChanges; + this.shouldPostProcessCharChanges = opts.shouldPostProcessCharChanges; + this.shouldIgnoreTrimWhitespace = opts.shouldIgnoreTrimWhitespace; + this.shouldMakePrettyDiff = opts.shouldMakePrettyDiff; + this.originalLines = originalLines; + this.modifiedLines = modifiedLines; + this.original = new LineSequence(originalLines); + this.modified = new LineSequence(modifiedLines); + this.continueLineDiff = createContinueProcessingPredicate(opts.maxComputationTime); + this.continueCharDiff = createContinueProcessingPredicate(opts.maxComputationTime === 0 ? 0 : Math.min(opts.maxComputationTime, 5e3)); + } + computeDiff() { + if (this.original.lines.length === 1 && this.original.lines[0].length === 0) { + if (this.modified.lines.length === 1 && this.modified.lines[0].length === 0) { + return { + quitEarly: false, + changes: [] + }; + } + return { + quitEarly: false, + changes: [{ + originalStartLineNumber: 1, + originalEndLineNumber: 1, + modifiedStartLineNumber: 1, + modifiedEndLineNumber: this.modified.lines.length, + charChanges: void 0 + }] + }; + } + if (this.modified.lines.length === 1 && this.modified.lines[0].length === 0) { + return { + quitEarly: false, + changes: [{ + originalStartLineNumber: 1, + originalEndLineNumber: this.original.lines.length, + modifiedStartLineNumber: 1, + modifiedEndLineNumber: 1, + charChanges: void 0 + }] + }; + } + const diffResult = computeDiff(this.original, this.modified, this.continueLineDiff, this.shouldMakePrettyDiff); + const rawChanges = diffResult.changes; + const quitEarly = diffResult.quitEarly; + if (this.shouldIgnoreTrimWhitespace) { + const lineChanges = []; + for (let i = 0, length = rawChanges.length; i < length; i++) { + lineChanges.push(LineChange.createFromDiffResult(this.shouldIgnoreTrimWhitespace, rawChanges[i], this.original, this.modified, this.continueCharDiff, this.shouldComputeCharChanges, this.shouldPostProcessCharChanges)); + } + return { + quitEarly, + changes: lineChanges + }; + } + const result = []; + let originalLineIndex = 0; + let modifiedLineIndex = 0; + for (let i = -1, len = rawChanges.length; i < len; i++) { + const nextChange = i + 1 < len ? rawChanges[i + 1] : null; + const originalStop = nextChange ? nextChange.originalStart : this.originalLines.length; + const modifiedStop = nextChange ? nextChange.modifiedStart : this.modifiedLines.length; + while (originalLineIndex < originalStop && modifiedLineIndex < modifiedStop) { + const originalLine = this.originalLines[originalLineIndex]; + const modifiedLine = this.modifiedLines[modifiedLineIndex]; + if (originalLine !== modifiedLine) { + { + let originalStartColumn = getFirstNonBlankColumn(originalLine, 1); + let modifiedStartColumn = getFirstNonBlankColumn(modifiedLine, 1); + while (originalStartColumn > 1 && modifiedStartColumn > 1) { + const originalChar = originalLine.charCodeAt(originalStartColumn - 2); + const modifiedChar = modifiedLine.charCodeAt(modifiedStartColumn - 2); + if (originalChar !== modifiedChar) { + break; + } + originalStartColumn--; + modifiedStartColumn--; + } + if (originalStartColumn > 1 || modifiedStartColumn > 1) { + this._pushTrimWhitespaceCharChange(result, originalLineIndex + 1, 1, originalStartColumn, modifiedLineIndex + 1, 1, modifiedStartColumn); + } + } + { + let originalEndColumn = getLastNonBlankColumn(originalLine, 1); + let modifiedEndColumn = getLastNonBlankColumn(modifiedLine, 1); + const originalMaxColumn = originalLine.length + 1; + const modifiedMaxColumn = modifiedLine.length + 1; + while (originalEndColumn < originalMaxColumn && modifiedEndColumn < modifiedMaxColumn) { + const originalChar = originalLine.charCodeAt(originalEndColumn - 1); + const modifiedChar = originalLine.charCodeAt(modifiedEndColumn - 1); + if (originalChar !== modifiedChar) { + break; + } + originalEndColumn++; + modifiedEndColumn++; + } + if (originalEndColumn < originalMaxColumn || modifiedEndColumn < modifiedMaxColumn) { + this._pushTrimWhitespaceCharChange(result, originalLineIndex + 1, originalEndColumn, originalMaxColumn, modifiedLineIndex + 1, modifiedEndColumn, modifiedMaxColumn); + } + } + } + originalLineIndex++; + modifiedLineIndex++; + } + if (nextChange) { + result.push(LineChange.createFromDiffResult(this.shouldIgnoreTrimWhitespace, nextChange, this.original, this.modified, this.continueCharDiff, this.shouldComputeCharChanges, this.shouldPostProcessCharChanges)); + originalLineIndex += nextChange.originalLength; + modifiedLineIndex += nextChange.modifiedLength; + } + } + return { + quitEarly, + changes: result + }; + } + _pushTrimWhitespaceCharChange(result, originalLineNumber, originalStartColumn, originalEndColumn, modifiedLineNumber, modifiedStartColumn, modifiedEndColumn) { + if (this._mergeTrimWhitespaceCharChange(result, originalLineNumber, originalStartColumn, originalEndColumn, modifiedLineNumber, modifiedStartColumn, modifiedEndColumn)) { + return; + } + let charChanges = void 0; + if (this.shouldComputeCharChanges) { + charChanges = [new CharChange(originalLineNumber, originalStartColumn, originalLineNumber, originalEndColumn, modifiedLineNumber, modifiedStartColumn, modifiedLineNumber, modifiedEndColumn)]; + } + result.push(new LineChange(originalLineNumber, originalLineNumber, modifiedLineNumber, modifiedLineNumber, charChanges)); + } + _mergeTrimWhitespaceCharChange(result, originalLineNumber, originalStartColumn, originalEndColumn, modifiedLineNumber, modifiedStartColumn, modifiedEndColumn) { + const len = result.length; + if (len === 0) { + return false; + } + const prevChange = result[len - 1]; + if (prevChange.originalEndLineNumber === 0 || prevChange.modifiedEndLineNumber === 0) { + return false; + } + if (prevChange.originalEndLineNumber === originalLineNumber && prevChange.modifiedEndLineNumber === modifiedLineNumber) { + if (this.shouldComputeCharChanges && prevChange.charChanges) { + prevChange.charChanges.push(new CharChange(originalLineNumber, originalStartColumn, originalLineNumber, originalEndColumn, modifiedLineNumber, modifiedStartColumn, modifiedLineNumber, modifiedEndColumn)); + } + return true; + } + if (prevChange.originalEndLineNumber + 1 === originalLineNumber && prevChange.modifiedEndLineNumber + 1 === modifiedLineNumber) { + prevChange.originalEndLineNumber = originalLineNumber; + prevChange.modifiedEndLineNumber = modifiedLineNumber; + if (this.shouldComputeCharChanges && prevChange.charChanges) { + prevChange.charChanges.push(new CharChange(originalLineNumber, originalStartColumn, originalLineNumber, originalEndColumn, modifiedLineNumber, modifiedStartColumn, modifiedLineNumber, modifiedEndColumn)); + } + return true; + } + return false; + } +}; +function getFirstNonBlankColumn(txt, defaultValue) { + const r = firstNonWhitespaceIndex(txt); + if (r === -1) { + return defaultValue; + } + return r + 1; +} +function getLastNonBlankColumn(txt, defaultValue) { + const r = lastNonWhitespaceIndex(txt); + if (r === -1) { + return defaultValue; + } + return r + 2; +} +function createContinueProcessingPredicate(maximumRuntime) { + if (maximumRuntime === 0) { + return () => true; + } + const startTime = Date.now(); + return () => { + return Date.now() - startTime < maximumRuntime; + }; +} + +// node_modules/monaco-editor-core/esm/vs/editor/common/diff/defaultLinesDiffComputer/algorithms/diffAlgorithm.js +var DiffAlgorithmResult = class _DiffAlgorithmResult { + static trivial(seq1, seq2) { + return new _DiffAlgorithmResult([new SequenceDiff(OffsetRange.ofLength(seq1.length), OffsetRange.ofLength(seq2.length))], false); + } + static trivialTimedOut(seq1, seq2) { + return new _DiffAlgorithmResult([new SequenceDiff(OffsetRange.ofLength(seq1.length), OffsetRange.ofLength(seq2.length))], true); + } + constructor(diffs, hitTimeout) { + this.diffs = diffs; + this.hitTimeout = hitTimeout; + } +}; +var SequenceDiff = class _SequenceDiff { + static invert(sequenceDiffs, doc1Length) { + const result = []; + forEachAdjacent(sequenceDiffs, (a, b) => { + result.push(_SequenceDiff.fromOffsetPairs(a ? a.getEndExclusives() : OffsetPair.zero, b ? b.getStarts() : new OffsetPair(doc1Length, (a ? a.seq2Range.endExclusive - a.seq1Range.endExclusive : 0) + doc1Length))); + }); + return result; + } + static fromOffsetPairs(start2, endExclusive) { + return new _SequenceDiff(new OffsetRange(start2.offset1, endExclusive.offset1), new OffsetRange(start2.offset2, endExclusive.offset2)); + } + static assertSorted(sequenceDiffs) { + let last = void 0; + for (const cur of sequenceDiffs) { + if (last) { + if (!(last.seq1Range.endExclusive <= cur.seq1Range.start && last.seq2Range.endExclusive <= cur.seq2Range.start)) { + throw new BugIndicatingError("Sequence diffs must be sorted"); + } + } + last = cur; + } + } + constructor(seq1Range, seq2Range) { + this.seq1Range = seq1Range; + this.seq2Range = seq2Range; + } + swap() { + return new _SequenceDiff(this.seq2Range, this.seq1Range); + } + toString() { + return `${this.seq1Range} <-> ${this.seq2Range}`; + } + join(other) { + return new _SequenceDiff(this.seq1Range.join(other.seq1Range), this.seq2Range.join(other.seq2Range)); + } + delta(offset) { + if (offset === 0) { + return this; + } + return new _SequenceDiff(this.seq1Range.delta(offset), this.seq2Range.delta(offset)); + } + deltaStart(offset) { + if (offset === 0) { + return this; + } + return new _SequenceDiff(this.seq1Range.deltaStart(offset), this.seq2Range.deltaStart(offset)); + } + deltaEnd(offset) { + if (offset === 0) { + return this; + } + return new _SequenceDiff(this.seq1Range.deltaEnd(offset), this.seq2Range.deltaEnd(offset)); + } + intersect(other) { + const i1 = this.seq1Range.intersect(other.seq1Range); + const i2 = this.seq2Range.intersect(other.seq2Range); + if (!i1 || !i2) { + return void 0; + } + return new _SequenceDiff(i1, i2); + } + getStarts() { + return new OffsetPair(this.seq1Range.start, this.seq2Range.start); + } + getEndExclusives() { + return new OffsetPair(this.seq1Range.endExclusive, this.seq2Range.endExclusive); + } +}; +var OffsetPair = class _OffsetPair { + static { + this.zero = new _OffsetPair(0, 0); + } + static { + this.max = new _OffsetPair(Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER); + } + constructor(offset1, offset2) { + this.offset1 = offset1; + this.offset2 = offset2; + } + toString() { + return `${this.offset1} <-> ${this.offset2}`; + } + delta(offset) { + if (offset === 0) { + return this; + } + return new _OffsetPair(this.offset1 + offset, this.offset2 + offset); + } + equals(other) { + return this.offset1 === other.offset1 && this.offset2 === other.offset2; + } +}; +var InfiniteTimeout = class _InfiniteTimeout { + static { + this.instance = new _InfiniteTimeout(); + } + isValid() { + return true; + } +}; +var DateTimeout = class { + constructor(timeout) { + this.timeout = timeout; + this.startTime = Date.now(); + this.valid = true; + if (timeout <= 0) { + throw new BugIndicatingError("timeout must be positive"); + } + } + // Recommendation: Set a log-point `{this.disable()}` in the body + isValid() { + const valid = Date.now() - this.startTime < this.timeout; + if (!valid && this.valid) { + this.valid = false; + } + return this.valid; + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/common/diff/defaultLinesDiffComputer/utils.js +var Array2D = class { + constructor(width, height) { + this.width = width; + this.height = height; + this.array = []; + this.array = new Array(width * height); + } + get(x, y) { + return this.array[x + y * this.width]; + } + set(x, y, value) { + this.array[x + y * this.width] = value; + } +}; +function isSpace(charCode) { + return charCode === 32 || charCode === 9; +} +var LineRangeFragment = class _LineRangeFragment { + static { + this.chrKeys = /* @__PURE__ */ new Map(); + } + static getKey(chr) { + let key = this.chrKeys.get(chr); + if (key === void 0) { + key = this.chrKeys.size; + this.chrKeys.set(chr, key); + } + return key; + } + constructor(range, lines, source) { + this.range = range; + this.lines = lines; + this.source = source; + this.histogram = []; + let counter = 0; + for (let i = range.startLineNumber - 1; i < range.endLineNumberExclusive - 1; i++) { + const line = lines[i]; + for (let j = 0; j < line.length; j++) { + counter++; + const chr = line[j]; + const key2 = _LineRangeFragment.getKey(chr); + this.histogram[key2] = (this.histogram[key2] || 0) + 1; + } + counter++; + const key = _LineRangeFragment.getKey("\n"); + this.histogram[key] = (this.histogram[key] || 0) + 1; + } + this.totalCount = counter; + } + computeSimilarity(other) { + let sumDifferences = 0; + const maxLength = Math.max(this.histogram.length, other.histogram.length); + for (let i = 0; i < maxLength; i++) { + sumDifferences += Math.abs((this.histogram[i] ?? 0) - (other.histogram[i] ?? 0)); + } + return 1 - sumDifferences / (this.totalCount + other.totalCount); + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/common/diff/defaultLinesDiffComputer/algorithms/dynamicProgrammingDiffing.js +var DynamicProgrammingDiffing = class { + compute(sequence1, sequence2, timeout = InfiniteTimeout.instance, equalityScore) { + if (sequence1.length === 0 || sequence2.length === 0) { + return DiffAlgorithmResult.trivial(sequence1, sequence2); + } + const lcsLengths = new Array2D(sequence1.length, sequence2.length); + const directions = new Array2D(sequence1.length, sequence2.length); + const lengths = new Array2D(sequence1.length, sequence2.length); + for (let s12 = 0; s12 < sequence1.length; s12++) { + for (let s22 = 0; s22 < sequence2.length; s22++) { + if (!timeout.isValid()) { + return DiffAlgorithmResult.trivialTimedOut(sequence1, sequence2); + } + const horizontalLen = s12 === 0 ? 0 : lcsLengths.get(s12 - 1, s22); + const verticalLen = s22 === 0 ? 0 : lcsLengths.get(s12, s22 - 1); + let extendedSeqScore; + if (sequence1.getElement(s12) === sequence2.getElement(s22)) { + if (s12 === 0 || s22 === 0) { + extendedSeqScore = 0; + } else { + extendedSeqScore = lcsLengths.get(s12 - 1, s22 - 1); + } + if (s12 > 0 && s22 > 0 && directions.get(s12 - 1, s22 - 1) === 3) { + extendedSeqScore += lengths.get(s12 - 1, s22 - 1); + } + extendedSeqScore += equalityScore ? equalityScore(s12, s22) : 1; + } else { + extendedSeqScore = -1; + } + const newValue = Math.max(horizontalLen, verticalLen, extendedSeqScore); + if (newValue === extendedSeqScore) { + const prevLen = s12 > 0 && s22 > 0 ? lengths.get(s12 - 1, s22 - 1) : 0; + lengths.set(s12, s22, prevLen + 1); + directions.set(s12, s22, 3); + } else if (newValue === horizontalLen) { + lengths.set(s12, s22, 0); + directions.set(s12, s22, 1); + } else if (newValue === verticalLen) { + lengths.set(s12, s22, 0); + directions.set(s12, s22, 2); + } + lcsLengths.set(s12, s22, newValue); + } + } + const result = []; + let lastAligningPosS1 = sequence1.length; + let lastAligningPosS2 = sequence2.length; + function reportDecreasingAligningPositions(s12, s22) { + if (s12 + 1 !== lastAligningPosS1 || s22 + 1 !== lastAligningPosS2) { + result.push(new SequenceDiff(new OffsetRange(s12 + 1, lastAligningPosS1), new OffsetRange(s22 + 1, lastAligningPosS2))); + } + lastAligningPosS1 = s12; + lastAligningPosS2 = s22; + } + let s1 = sequence1.length - 1; + let s2 = sequence2.length - 1; + while (s1 >= 0 && s2 >= 0) { + if (directions.get(s1, s2) === 3) { + reportDecreasingAligningPositions(s1, s2); + s1--; + s2--; + } else { + if (directions.get(s1, s2) === 1) { + s1--; + } else { + s2--; + } + } + } + reportDecreasingAligningPositions(-1, -1); + result.reverse(); + return new DiffAlgorithmResult(result, false); + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/common/diff/defaultLinesDiffComputer/algorithms/myersDiffAlgorithm.js +var MyersDiffAlgorithm = class { + compute(seq1, seq2, timeout = InfiniteTimeout.instance) { + if (seq1.length === 0 || seq2.length === 0) { + return DiffAlgorithmResult.trivial(seq1, seq2); + } + const seqX = seq1; + const seqY = seq2; + function getXAfterSnake(x, y) { + while (x < seqX.length && y < seqY.length && seqX.getElement(x) === seqY.getElement(y)) { + x++; + y++; + } + return x; + } + let d = 0; + const V = new FastInt32Array(); + V.set(0, getXAfterSnake(0, 0)); + const paths = new FastArrayNegativeIndices(); + paths.set(0, V.get(0) === 0 ? null : new SnakePath(null, 0, 0, V.get(0))); + let k = 0; + loop: while (true) { + d++; + if (!timeout.isValid()) { + return DiffAlgorithmResult.trivialTimedOut(seqX, seqY); + } + const lowerBound = -Math.min(d, seqY.length + d % 2); + const upperBound = Math.min(d, seqX.length + d % 2); + for (k = lowerBound; k <= upperBound; k += 2) { + let step = 0; + const maxXofDLineTop = k === upperBound ? -1 : V.get(k + 1); + const maxXofDLineLeft = k === lowerBound ? -1 : V.get(k - 1) + 1; + step++; + const x = Math.min(Math.max(maxXofDLineTop, maxXofDLineLeft), seqX.length); + const y = x - k; + step++; + if (x > seqX.length || y > seqY.length) { + continue; + } + const newMaxX = getXAfterSnake(x, y); + V.set(k, newMaxX); + const lastPath = x === maxXofDLineTop ? paths.get(k + 1) : paths.get(k - 1); + paths.set(k, newMaxX !== x ? new SnakePath(lastPath, x, y, newMaxX - x) : lastPath); + if (V.get(k) === seqX.length && V.get(k) - k === seqY.length) { + break loop; + } + } + } + let path = paths.get(k); + const result = []; + let lastAligningPosS1 = seqX.length; + let lastAligningPosS2 = seqY.length; + while (true) { + const endX = path ? path.x + path.length : 0; + const endY = path ? path.y + path.length : 0; + if (endX !== lastAligningPosS1 || endY !== lastAligningPosS2) { + result.push(new SequenceDiff(new OffsetRange(endX, lastAligningPosS1), new OffsetRange(endY, lastAligningPosS2))); + } + if (!path) { + break; + } + lastAligningPosS1 = path.x; + lastAligningPosS2 = path.y; + path = path.prev; + } + result.reverse(); + return new DiffAlgorithmResult(result, false); + } +}; +var SnakePath = class { + constructor(prev, x, y, length) { + this.prev = prev; + this.x = x; + this.y = y; + this.length = length; + } +}; +var FastInt32Array = class { + constructor() { + this.positiveArr = new Int32Array(10); + this.negativeArr = new Int32Array(10); + } + get(idx) { + if (idx < 0) { + idx = -idx - 1; + return this.negativeArr[idx]; + } else { + return this.positiveArr[idx]; + } + } + set(idx, value) { + if (idx < 0) { + idx = -idx - 1; + if (idx >= this.negativeArr.length) { + const arr = this.negativeArr; + this.negativeArr = new Int32Array(arr.length * 2); + this.negativeArr.set(arr); + } + this.negativeArr[idx] = value; + } else { + if (idx >= this.positiveArr.length) { + const arr = this.positiveArr; + this.positiveArr = new Int32Array(arr.length * 2); + this.positiveArr.set(arr); + } + this.positiveArr[idx] = value; + } + } +}; +var FastArrayNegativeIndices = class { + constructor() { + this.positiveArr = []; + this.negativeArr = []; + } + get(idx) { + if (idx < 0) { + idx = -idx - 1; + return this.negativeArr[idx]; + } else { + return this.positiveArr[idx]; + } + } + set(idx, value) { + if (idx < 0) { + idx = -idx - 1; + this.negativeArr[idx] = value; + } else { + this.positiveArr[idx] = value; + } + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/common/diff/defaultLinesDiffComputer/linesSliceCharSequence.js +var LinesSliceCharSequence = class { + constructor(lines, range, considerWhitespaceChanges) { + this.lines = lines; + this.range = range; + this.considerWhitespaceChanges = considerWhitespaceChanges; + this.elements = []; + this.firstElementOffsetByLineIdx = []; + this.lineStartOffsets = []; + this.trimmedWsLengthsByLineIdx = []; + this.firstElementOffsetByLineIdx.push(0); + for (let lineNumber = this.range.startLineNumber; lineNumber <= this.range.endLineNumber; lineNumber++) { + let line = lines[lineNumber - 1]; + let lineStartOffset = 0; + if (lineNumber === this.range.startLineNumber && this.range.startColumn > 1) { + lineStartOffset = this.range.startColumn - 1; + line = line.substring(lineStartOffset); + } + this.lineStartOffsets.push(lineStartOffset); + let trimmedWsLength = 0; + if (!considerWhitespaceChanges) { + const trimmedStartLine = line.trimStart(); + trimmedWsLength = line.length - trimmedStartLine.length; + line = trimmedStartLine.trimEnd(); + } + this.trimmedWsLengthsByLineIdx.push(trimmedWsLength); + const lineLength = lineNumber === this.range.endLineNumber ? Math.min(this.range.endColumn - 1 - lineStartOffset - trimmedWsLength, line.length) : line.length; + for (let i = 0; i < lineLength; i++) { + this.elements.push(line.charCodeAt(i)); + } + if (lineNumber < this.range.endLineNumber) { + this.elements.push("\n".charCodeAt(0)); + this.firstElementOffsetByLineIdx.push(this.elements.length); + } + } + } + toString() { + return `Slice: "${this.text}"`; + } + get text() { + return this.getText(new OffsetRange(0, this.length)); + } + getText(range) { + return this.elements.slice(range.start, range.endExclusive).map((e) => String.fromCharCode(e)).join(""); + } + getElement(offset) { + return this.elements[offset]; + } + get length() { + return this.elements.length; + } + getBoundaryScore(length) { + const prevCategory = getCategory(length > 0 ? this.elements[length - 1] : -1); + const nextCategory = getCategory(length < this.elements.length ? this.elements[length] : -1); + if (prevCategory === 7 && nextCategory === 8) { + return 0; + } + if (prevCategory === 8) { + return 150; + } + let score2 = 0; + if (prevCategory !== nextCategory) { + score2 += 10; + if (prevCategory === 0 && nextCategory === 1) { + score2 += 1; + } + } + score2 += getCategoryBoundaryScore(prevCategory); + score2 += getCategoryBoundaryScore(nextCategory); + return score2; + } + translateOffset(offset, preference = "right") { + const i = findLastIdxMonotonous(this.firstElementOffsetByLineIdx, (value) => value <= offset); + const lineOffset = offset - this.firstElementOffsetByLineIdx[i]; + return new Position(this.range.startLineNumber + i, 1 + this.lineStartOffsets[i] + lineOffset + (lineOffset === 0 && preference === "left" ? 0 : this.trimmedWsLengthsByLineIdx[i])); + } + translateRange(range) { + const pos1 = this.translateOffset(range.start, "right"); + const pos2 = this.translateOffset(range.endExclusive, "left"); + if (pos2.isBefore(pos1)) { + return Range.fromPositions(pos2, pos2); + } + return Range.fromPositions(pos1, pos2); + } + /** + * Finds the word that contains the character at the given offset + */ + findWordContaining(offset) { + if (offset < 0 || offset >= this.elements.length) { + return void 0; + } + if (!isWordChar(this.elements[offset])) { + return void 0; + } + let start2 = offset; + while (start2 > 0 && isWordChar(this.elements[start2 - 1])) { + start2--; + } + let end = offset; + while (end < this.elements.length && isWordChar(this.elements[end])) { + end++; + } + return new OffsetRange(start2, end); + } + /** fooBar has the two sub-words foo and bar */ + findSubWordContaining(offset) { + if (offset < 0 || offset >= this.elements.length) { + return void 0; + } + if (!isWordChar(this.elements[offset])) { + return void 0; + } + let start2 = offset; + while (start2 > 0 && isWordChar(this.elements[start2 - 1]) && !isUpperCase(this.elements[start2])) { + start2--; + } + let end = offset; + while (end < this.elements.length && isWordChar(this.elements[end]) && !isUpperCase(this.elements[end])) { + end++; + } + return new OffsetRange(start2, end); + } + countLinesIn(range) { + return this.translateOffset(range.endExclusive).lineNumber - this.translateOffset(range.start).lineNumber; + } + isStronglyEqual(offset1, offset2) { + return this.elements[offset1] === this.elements[offset2]; + } + extendToFullLines(range) { + const start2 = findLastMonotonous(this.firstElementOffsetByLineIdx, (x) => x <= range.start) ?? 0; + const end = findFirstMonotonous(this.firstElementOffsetByLineIdx, (x) => range.endExclusive <= x) ?? this.elements.length; + return new OffsetRange(start2, end); + } +}; +function isWordChar(charCode) { + return charCode >= 97 && charCode <= 122 || charCode >= 65 && charCode <= 90 || charCode >= 48 && charCode <= 57; +} +function isUpperCase(charCode) { + return charCode >= 65 && charCode <= 90; +} +var score = { + [ + 0 + /* CharBoundaryCategory.WordLower */ + ]: 0, + [ + 1 + /* CharBoundaryCategory.WordUpper */ + ]: 0, + [ + 2 + /* CharBoundaryCategory.WordNumber */ + ]: 0, + [ + 3 + /* CharBoundaryCategory.End */ + ]: 10, + [ + 4 + /* CharBoundaryCategory.Other */ + ]: 2, + [ + 5 + /* CharBoundaryCategory.Separator */ + ]: 30, + [ + 6 + /* CharBoundaryCategory.Space */ + ]: 3, + [ + 7 + /* CharBoundaryCategory.LineBreakCR */ + ]: 10, + [ + 8 + /* CharBoundaryCategory.LineBreakLF */ + ]: 10 +}; +function getCategoryBoundaryScore(category) { + return score[category]; +} +function getCategory(charCode) { + if (charCode === 10) { + return 8; + } else if (charCode === 13) { + return 7; + } else if (isSpace(charCode)) { + return 6; + } else if (charCode >= 97 && charCode <= 122) { + return 0; + } else if (charCode >= 65 && charCode <= 90) { + return 1; + } else if (charCode >= 48 && charCode <= 57) { + return 2; + } else if (charCode === -1) { + return 3; + } else if (charCode === 44 || charCode === 59) { + return 5; + } else { + return 4; + } +} + +// node_modules/monaco-editor-core/esm/vs/editor/common/diff/defaultLinesDiffComputer/computeMovedLines.js +function computeMovedLines(changes, originalLines, modifiedLines, hashedOriginalLines, hashedModifiedLines, timeout) { + let { moves, excludedChanges } = computeMovesFromSimpleDeletionsToSimpleInsertions(changes, originalLines, modifiedLines, timeout); + if (!timeout.isValid()) { + return []; + } + const filteredChanges = changes.filter((c) => !excludedChanges.has(c)); + const unchangedMoves = computeUnchangedMoves(filteredChanges, hashedOriginalLines, hashedModifiedLines, originalLines, modifiedLines, timeout); + pushMany(moves, unchangedMoves); + moves = joinCloseConsecutiveMoves(moves); + moves = moves.filter((current) => { + const lines = current.original.toOffsetRange().slice(originalLines).map((l) => l.trim()); + const originalText = lines.join("\n"); + return originalText.length >= 15 && countWhere(lines, (l) => l.length >= 2) >= 2; + }); + moves = removeMovesInSameDiff(changes, moves); + return moves; +} +function countWhere(arr, predicate) { + let count = 0; + for (const t of arr) { + if (predicate(t)) { + count++; + } + } + return count; +} +function computeMovesFromSimpleDeletionsToSimpleInsertions(changes, originalLines, modifiedLines, timeout) { + const moves = []; + const deletions = changes.filter((c) => c.modified.isEmpty && c.original.length >= 3).map((d) => new LineRangeFragment(d.original, originalLines, d)); + const insertions = new Set(changes.filter((c) => c.original.isEmpty && c.modified.length >= 3).map((d) => new LineRangeFragment(d.modified, modifiedLines, d))); + const excludedChanges = /* @__PURE__ */ new Set(); + for (const deletion of deletions) { + let highestSimilarity = -1; + let best; + for (const insertion of insertions) { + const similarity = deletion.computeSimilarity(insertion); + if (similarity > highestSimilarity) { + highestSimilarity = similarity; + best = insertion; + } + } + if (highestSimilarity > 0.9 && best) { + insertions.delete(best); + moves.push(new LineRangeMapping(deletion.range, best.range)); + excludedChanges.add(deletion.source); + excludedChanges.add(best.source); + } + if (!timeout.isValid()) { + return { moves, excludedChanges }; + } + } + return { moves, excludedChanges }; +} +function computeUnchangedMoves(changes, hashedOriginalLines, hashedModifiedLines, originalLines, modifiedLines, timeout) { + const moves = []; + const original3LineHashes = new SetMap(); + for (const change of changes) { + for (let i = change.original.startLineNumber; i < change.original.endLineNumberExclusive - 2; i++) { + const key = `${hashedOriginalLines[i - 1]}:${hashedOriginalLines[i + 1 - 1]}:${hashedOriginalLines[i + 2 - 1]}`; + original3LineHashes.add(key, { range: new LineRange(i, i + 3) }); + } + } + const possibleMappings = []; + changes.sort(compareBy((c) => c.modified.startLineNumber, numberComparator)); + for (const change of changes) { + let lastMappings = []; + for (let i = change.modified.startLineNumber; i < change.modified.endLineNumberExclusive - 2; i++) { + const key = `${hashedModifiedLines[i - 1]}:${hashedModifiedLines[i + 1 - 1]}:${hashedModifiedLines[i + 2 - 1]}`; + const currentModifiedRange = new LineRange(i, i + 3); + const nextMappings = []; + original3LineHashes.forEach(key, ({ range }) => { + for (const lastMapping of lastMappings) { + if (lastMapping.originalLineRange.endLineNumberExclusive + 1 === range.endLineNumberExclusive && lastMapping.modifiedLineRange.endLineNumberExclusive + 1 === currentModifiedRange.endLineNumberExclusive) { + lastMapping.originalLineRange = new LineRange(lastMapping.originalLineRange.startLineNumber, range.endLineNumberExclusive); + lastMapping.modifiedLineRange = new LineRange(lastMapping.modifiedLineRange.startLineNumber, currentModifiedRange.endLineNumberExclusive); + nextMappings.push(lastMapping); + return; + } + } + const mapping = { + modifiedLineRange: currentModifiedRange, + originalLineRange: range + }; + possibleMappings.push(mapping); + nextMappings.push(mapping); + }); + lastMappings = nextMappings; + } + if (!timeout.isValid()) { + return []; + } + } + possibleMappings.sort(reverseOrder(compareBy((m) => m.modifiedLineRange.length, numberComparator))); + const modifiedSet = new LineRangeSet(); + const originalSet = new LineRangeSet(); + for (const mapping of possibleMappings) { + const diffOrigToMod = mapping.modifiedLineRange.startLineNumber - mapping.originalLineRange.startLineNumber; + const modifiedSections = modifiedSet.subtractFrom(mapping.modifiedLineRange); + const originalTranslatedSections = originalSet.subtractFrom(mapping.originalLineRange).getWithDelta(diffOrigToMod); + const modifiedIntersectedSections = modifiedSections.getIntersection(originalTranslatedSections); + for (const s of modifiedIntersectedSections.ranges) { + if (s.length < 3) { + continue; + } + const modifiedLineRange = s; + const originalLineRange = s.delta(-diffOrigToMod); + moves.push(new LineRangeMapping(originalLineRange, modifiedLineRange)); + modifiedSet.addRange(modifiedLineRange); + originalSet.addRange(originalLineRange); + } + } + moves.sort(compareBy((m) => m.original.startLineNumber, numberComparator)); + const monotonousChanges = new MonotonousArray(changes); + for (let i = 0; i < moves.length; i++) { + const move = moves[i]; + const firstTouchingChangeOrig = monotonousChanges.findLastMonotonous((c) => c.original.startLineNumber <= move.original.startLineNumber); + const firstTouchingChangeMod = findLastMonotonous(changes, (c) => c.modified.startLineNumber <= move.modified.startLineNumber); + const linesAbove = Math.max(move.original.startLineNumber - firstTouchingChangeOrig.original.startLineNumber, move.modified.startLineNumber - firstTouchingChangeMod.modified.startLineNumber); + const lastTouchingChangeOrig = monotonousChanges.findLastMonotonous((c) => c.original.startLineNumber < move.original.endLineNumberExclusive); + const lastTouchingChangeMod = findLastMonotonous(changes, (c) => c.modified.startLineNumber < move.modified.endLineNumberExclusive); + const linesBelow = Math.max(lastTouchingChangeOrig.original.endLineNumberExclusive - move.original.endLineNumberExclusive, lastTouchingChangeMod.modified.endLineNumberExclusive - move.modified.endLineNumberExclusive); + let extendToTop; + for (extendToTop = 0; extendToTop < linesAbove; extendToTop++) { + const origLine = move.original.startLineNumber - extendToTop - 1; + const modLine = move.modified.startLineNumber - extendToTop - 1; + if (origLine > originalLines.length || modLine > modifiedLines.length) { + break; + } + if (modifiedSet.contains(modLine) || originalSet.contains(origLine)) { + break; + } + if (!areLinesSimilar(originalLines[origLine - 1], modifiedLines[modLine - 1], timeout)) { + break; + } + } + if (extendToTop > 0) { + originalSet.addRange(new LineRange(move.original.startLineNumber - extendToTop, move.original.startLineNumber)); + modifiedSet.addRange(new LineRange(move.modified.startLineNumber - extendToTop, move.modified.startLineNumber)); + } + let extendToBottom; + for (extendToBottom = 0; extendToBottom < linesBelow; extendToBottom++) { + const origLine = move.original.endLineNumberExclusive + extendToBottom; + const modLine = move.modified.endLineNumberExclusive + extendToBottom; + if (origLine > originalLines.length || modLine > modifiedLines.length) { + break; + } + if (modifiedSet.contains(modLine) || originalSet.contains(origLine)) { + break; + } + if (!areLinesSimilar(originalLines[origLine - 1], modifiedLines[modLine - 1], timeout)) { + break; + } + } + if (extendToBottom > 0) { + originalSet.addRange(new LineRange(move.original.endLineNumberExclusive, move.original.endLineNumberExclusive + extendToBottom)); + modifiedSet.addRange(new LineRange(move.modified.endLineNumberExclusive, move.modified.endLineNumberExclusive + extendToBottom)); + } + if (extendToTop > 0 || extendToBottom > 0) { + moves[i] = new LineRangeMapping(new LineRange(move.original.startLineNumber - extendToTop, move.original.endLineNumberExclusive + extendToBottom), new LineRange(move.modified.startLineNumber - extendToTop, move.modified.endLineNumberExclusive + extendToBottom)); + } + } + return moves; +} +function areLinesSimilar(line1, line2, timeout) { + if (line1.trim() === line2.trim()) { + return true; + } + if (line1.length > 300 && line2.length > 300) { + return false; + } + const myersDiffingAlgorithm = new MyersDiffAlgorithm(); + const result = myersDiffingAlgorithm.compute(new LinesSliceCharSequence([line1], new Range(1, 1, 1, line1.length), false), new LinesSliceCharSequence([line2], new Range(1, 1, 1, line2.length), false), timeout); + let commonNonSpaceCharCount = 0; + const inverted = SequenceDiff.invert(result.diffs, line1.length); + for (const seq of inverted) { + seq.seq1Range.forEach((idx) => { + if (!isSpace(line1.charCodeAt(idx))) { + commonNonSpaceCharCount++; + } + }); + } + function countNonWsChars(str) { + let count = 0; + for (let i = 0; i < line1.length; i++) { + if (!isSpace(str.charCodeAt(i))) { + count++; + } + } + return count; + } + const longerLineLength = countNonWsChars(line1.length > line2.length ? line1 : line2); + const r = commonNonSpaceCharCount / longerLineLength > 0.6 && longerLineLength > 10; + return r; +} +function joinCloseConsecutiveMoves(moves) { + if (moves.length === 0) { + return moves; + } + moves.sort(compareBy((m) => m.original.startLineNumber, numberComparator)); + const result = [moves[0]]; + for (let i = 1; i < moves.length; i++) { + const last = result[result.length - 1]; + const current = moves[i]; + const originalDist = current.original.startLineNumber - last.original.endLineNumberExclusive; + const modifiedDist = current.modified.startLineNumber - last.modified.endLineNumberExclusive; + const currentMoveAfterLast = originalDist >= 0 && modifiedDist >= 0; + if (currentMoveAfterLast && originalDist + modifiedDist <= 2) { + result[result.length - 1] = last.join(current); + continue; + } + result.push(current); + } + return result; +} +function removeMovesInSameDiff(changes, moves) { + const changesMonotonous = new MonotonousArray(changes); + moves = moves.filter((m) => { + const diffBeforeEndOfMoveOriginal = changesMonotonous.findLastMonotonous((c) => c.original.startLineNumber < m.original.endLineNumberExclusive) || new LineRangeMapping(new LineRange(1, 1), new LineRange(1, 1)); + const diffBeforeEndOfMoveModified = findLastMonotonous(changes, (c) => c.modified.startLineNumber < m.modified.endLineNumberExclusive); + const differentDiffs = diffBeforeEndOfMoveOriginal !== diffBeforeEndOfMoveModified; + return differentDiffs; + }); + return moves; +} + +// node_modules/monaco-editor-core/esm/vs/editor/common/diff/defaultLinesDiffComputer/heuristicSequenceOptimizations.js +function optimizeSequenceDiffs(sequence1, sequence2, sequenceDiffs) { + let result = sequenceDiffs; + result = joinSequenceDiffsByShifting(sequence1, sequence2, result); + result = joinSequenceDiffsByShifting(sequence1, sequence2, result); + result = shiftSequenceDiffs(sequence1, sequence2, result); + return result; +} +function joinSequenceDiffsByShifting(sequence1, sequence2, sequenceDiffs) { + if (sequenceDiffs.length === 0) { + return sequenceDiffs; + } + const result = []; + result.push(sequenceDiffs[0]); + for (let i = 1; i < sequenceDiffs.length; i++) { + const prevResult = result[result.length - 1]; + let cur = sequenceDiffs[i]; + if (cur.seq1Range.isEmpty || cur.seq2Range.isEmpty) { + const length = cur.seq1Range.start - prevResult.seq1Range.endExclusive; + let d; + for (d = 1; d <= length; d++) { + if (sequence1.getElement(cur.seq1Range.start - d) !== sequence1.getElement(cur.seq1Range.endExclusive - d) || sequence2.getElement(cur.seq2Range.start - d) !== sequence2.getElement(cur.seq2Range.endExclusive - d)) { + break; + } + } + d--; + if (d === length) { + result[result.length - 1] = new SequenceDiff(new OffsetRange(prevResult.seq1Range.start, cur.seq1Range.endExclusive - length), new OffsetRange(prevResult.seq2Range.start, cur.seq2Range.endExclusive - length)); + continue; + } + cur = cur.delta(-d); + } + result.push(cur); + } + const result2 = []; + for (let i = 0; i < result.length - 1; i++) { + const nextResult = result[i + 1]; + let cur = result[i]; + if (cur.seq1Range.isEmpty || cur.seq2Range.isEmpty) { + const length = nextResult.seq1Range.start - cur.seq1Range.endExclusive; + let d; + for (d = 0; d < length; d++) { + if (!sequence1.isStronglyEqual(cur.seq1Range.start + d, cur.seq1Range.endExclusive + d) || !sequence2.isStronglyEqual(cur.seq2Range.start + d, cur.seq2Range.endExclusive + d)) { + break; + } + } + if (d === length) { + result[i + 1] = new SequenceDiff(new OffsetRange(cur.seq1Range.start + length, nextResult.seq1Range.endExclusive), new OffsetRange(cur.seq2Range.start + length, nextResult.seq2Range.endExclusive)); + continue; + } + if (d > 0) { + cur = cur.delta(d); + } + } + result2.push(cur); + } + if (result.length > 0) { + result2.push(result[result.length - 1]); + } + return result2; +} +function shiftSequenceDiffs(sequence1, sequence2, sequenceDiffs) { + if (!sequence1.getBoundaryScore || !sequence2.getBoundaryScore) { + return sequenceDiffs; + } + for (let i = 0; i < sequenceDiffs.length; i++) { + const prevDiff = i > 0 ? sequenceDiffs[i - 1] : void 0; + const diff = sequenceDiffs[i]; + const nextDiff = i + 1 < sequenceDiffs.length ? sequenceDiffs[i + 1] : void 0; + const seq1ValidRange = new OffsetRange(prevDiff ? prevDiff.seq1Range.endExclusive + 1 : 0, nextDiff ? nextDiff.seq1Range.start - 1 : sequence1.length); + const seq2ValidRange = new OffsetRange(prevDiff ? prevDiff.seq2Range.endExclusive + 1 : 0, nextDiff ? nextDiff.seq2Range.start - 1 : sequence2.length); + if (diff.seq1Range.isEmpty) { + sequenceDiffs[i] = shiftDiffToBetterPosition(diff, sequence1, sequence2, seq1ValidRange, seq2ValidRange); + } else if (diff.seq2Range.isEmpty) { + sequenceDiffs[i] = shiftDiffToBetterPosition(diff.swap(), sequence2, sequence1, seq2ValidRange, seq1ValidRange).swap(); + } + } + return sequenceDiffs; +} +function shiftDiffToBetterPosition(diff, sequence1, sequence2, seq1ValidRange, seq2ValidRange) { + const maxShiftLimit = 100; + let deltaBefore = 1; + while (diff.seq1Range.start - deltaBefore >= seq1ValidRange.start && diff.seq2Range.start - deltaBefore >= seq2ValidRange.start && sequence2.isStronglyEqual(diff.seq2Range.start - deltaBefore, diff.seq2Range.endExclusive - deltaBefore) && deltaBefore < maxShiftLimit) { + deltaBefore++; + } + deltaBefore--; + let deltaAfter = 0; + while (diff.seq1Range.start + deltaAfter < seq1ValidRange.endExclusive && diff.seq2Range.endExclusive + deltaAfter < seq2ValidRange.endExclusive && sequence2.isStronglyEqual(diff.seq2Range.start + deltaAfter, diff.seq2Range.endExclusive + deltaAfter) && deltaAfter < maxShiftLimit) { + deltaAfter++; + } + if (deltaBefore === 0 && deltaAfter === 0) { + return diff; + } + let bestDelta = 0; + let bestScore = -1; + for (let delta = -deltaBefore; delta <= deltaAfter; delta++) { + const seq2OffsetStart = diff.seq2Range.start + delta; + const seq2OffsetEndExclusive = diff.seq2Range.endExclusive + delta; + const seq1Offset = diff.seq1Range.start + delta; + const score2 = sequence1.getBoundaryScore(seq1Offset) + sequence2.getBoundaryScore(seq2OffsetStart) + sequence2.getBoundaryScore(seq2OffsetEndExclusive); + if (score2 > bestScore) { + bestScore = score2; + bestDelta = delta; + } + } + return diff.delta(bestDelta); +} +function removeShortMatches(sequence1, sequence2, sequenceDiffs) { + const result = []; + for (const s of sequenceDiffs) { + const last = result[result.length - 1]; + if (!last) { + result.push(s); + continue; + } + if (s.seq1Range.start - last.seq1Range.endExclusive <= 2 || s.seq2Range.start - last.seq2Range.endExclusive <= 2) { + result[result.length - 1] = new SequenceDiff(last.seq1Range.join(s.seq1Range), last.seq2Range.join(s.seq2Range)); + } else { + result.push(s); + } + } + return result; +} +function extendDiffsToEntireWordIfAppropriate(sequence1, sequence2, sequenceDiffs, findParent, force = false) { + const equalMappings = SequenceDiff.invert(sequenceDiffs, sequence1.length); + const additional = []; + let lastPoint = new OffsetPair(0, 0); + function scanWord(pair, equalMapping) { + if (pair.offset1 < lastPoint.offset1 || pair.offset2 < lastPoint.offset2) { + return; + } + const w1 = findParent(sequence1, pair.offset1); + const w2 = findParent(sequence2, pair.offset2); + if (!w1 || !w2) { + return; + } + let w = new SequenceDiff(w1, w2); + const equalPart = w.intersect(equalMapping); + let equalChars1 = equalPart.seq1Range.length; + let equalChars2 = equalPart.seq2Range.length; + while (equalMappings.length > 0) { + const next = equalMappings[0]; + const intersects = next.seq1Range.intersects(w.seq1Range) || next.seq2Range.intersects(w.seq2Range); + if (!intersects) { + break; + } + const v1 = findParent(sequence1, next.seq1Range.start); + const v2 = findParent(sequence2, next.seq2Range.start); + const v = new SequenceDiff(v1, v2); + const equalPart2 = v.intersect(next); + equalChars1 += equalPart2.seq1Range.length; + equalChars2 += equalPart2.seq2Range.length; + w = w.join(v); + if (w.seq1Range.endExclusive >= next.seq1Range.endExclusive) { + equalMappings.shift(); + } else { + break; + } + } + if (force && equalChars1 + equalChars2 < w.seq1Range.length + w.seq2Range.length || equalChars1 + equalChars2 < (w.seq1Range.length + w.seq2Range.length) * 2 / 3) { + additional.push(w); + } + lastPoint = w.getEndExclusives(); + } + while (equalMappings.length > 0) { + const next = equalMappings.shift(); + if (next.seq1Range.isEmpty) { + continue; + } + scanWord(next.getStarts(), next); + scanWord(next.getEndExclusives().delta(-1), next); + } + const merged = mergeSequenceDiffs(sequenceDiffs, additional); + return merged; +} +function mergeSequenceDiffs(sequenceDiffs1, sequenceDiffs2) { + const result = []; + while (sequenceDiffs1.length > 0 || sequenceDiffs2.length > 0) { + const sd1 = sequenceDiffs1[0]; + const sd2 = sequenceDiffs2[0]; + let next; + if (sd1 && (!sd2 || sd1.seq1Range.start < sd2.seq1Range.start)) { + next = sequenceDiffs1.shift(); + } else { + next = sequenceDiffs2.shift(); + } + if (result.length > 0 && result[result.length - 1].seq1Range.endExclusive >= next.seq1Range.start) { + result[result.length - 1] = result[result.length - 1].join(next); + } else { + result.push(next); + } + } + return result; +} +function removeVeryShortMatchingLinesBetweenDiffs(sequence1, _sequence2, sequenceDiffs) { + let diffs = sequenceDiffs; + if (diffs.length === 0) { + return diffs; + } + let counter = 0; + let shouldRepeat; + do { + shouldRepeat = false; + const result = [ + diffs[0] + ]; + for (let i = 1; i < diffs.length; i++) { + let shouldJoinDiffs = function(before, after) { + const unchangedRange = new OffsetRange(lastResult.seq1Range.endExclusive, cur.seq1Range.start); + const unchangedText = sequence1.getText(unchangedRange); + const unchangedTextWithoutWs = unchangedText.replace(/\s/g, ""); + if (unchangedTextWithoutWs.length <= 4 && (before.seq1Range.length + before.seq2Range.length > 5 || after.seq1Range.length + after.seq2Range.length > 5)) { + return true; + } + return false; + }; + const cur = diffs[i]; + const lastResult = result[result.length - 1]; + const shouldJoin = shouldJoinDiffs(lastResult, cur); + if (shouldJoin) { + shouldRepeat = true; + result[result.length - 1] = result[result.length - 1].join(cur); + } else { + result.push(cur); + } + } + diffs = result; + } while (counter++ < 10 && shouldRepeat); + return diffs; +} +function removeVeryShortMatchingTextBetweenLongDiffs(sequence1, sequence2, sequenceDiffs) { + let diffs = sequenceDiffs; + if (diffs.length === 0) { + return diffs; + } + let counter = 0; + let shouldRepeat; + do { + shouldRepeat = false; + const result = [ + diffs[0] + ]; + for (let i = 1; i < diffs.length; i++) { + let shouldJoinDiffs = function(before, after) { + const unchangedRange = new OffsetRange(lastResult.seq1Range.endExclusive, cur.seq1Range.start); + const unchangedLineCount = sequence1.countLinesIn(unchangedRange); + if (unchangedLineCount > 5 || unchangedRange.length > 500) { + return false; + } + const unchangedText = sequence1.getText(unchangedRange).trim(); + if (unchangedText.length > 20 || unchangedText.split(/\r\n|\r|\n/).length > 1) { + return false; + } + const beforeLineCount1 = sequence1.countLinesIn(before.seq1Range); + const beforeSeq1Length = before.seq1Range.length; + const beforeLineCount2 = sequence2.countLinesIn(before.seq2Range); + const beforeSeq2Length = before.seq2Range.length; + const afterLineCount1 = sequence1.countLinesIn(after.seq1Range); + const afterSeq1Length = after.seq1Range.length; + const afterLineCount2 = sequence2.countLinesIn(after.seq2Range); + const afterSeq2Length = after.seq2Range.length; + const max = 2 * 40 + 50; + function cap(v) { + return Math.min(v, max); + } + if (Math.pow(Math.pow(cap(beforeLineCount1 * 40 + beforeSeq1Length), 1.5) + Math.pow(cap(beforeLineCount2 * 40 + beforeSeq2Length), 1.5), 1.5) + Math.pow(Math.pow(cap(afterLineCount1 * 40 + afterSeq1Length), 1.5) + Math.pow(cap(afterLineCount2 * 40 + afterSeq2Length), 1.5), 1.5) > (max ** 1.5) ** 1.5 * 1.3) { + return true; + } + return false; + }; + const cur = diffs[i]; + const lastResult = result[result.length - 1]; + const shouldJoin = shouldJoinDiffs(lastResult, cur); + if (shouldJoin) { + shouldRepeat = true; + result[result.length - 1] = result[result.length - 1].join(cur); + } else { + result.push(cur); + } + } + diffs = result; + } while (counter++ < 10 && shouldRepeat); + const newDiffs = []; + forEachWithNeighbors(diffs, (prev, cur, next) => { + let newDiff = cur; + function shouldMarkAsChanged(text) { + return text.length > 0 && text.trim().length <= 3 && cur.seq1Range.length + cur.seq2Range.length > 100; + } + const fullRange1 = sequence1.extendToFullLines(cur.seq1Range); + const prefix = sequence1.getText(new OffsetRange(fullRange1.start, cur.seq1Range.start)); + if (shouldMarkAsChanged(prefix)) { + newDiff = newDiff.deltaStart(-prefix.length); + } + const suffix = sequence1.getText(new OffsetRange(cur.seq1Range.endExclusive, fullRange1.endExclusive)); + if (shouldMarkAsChanged(suffix)) { + newDiff = newDiff.deltaEnd(suffix.length); + } + const availableSpace = SequenceDiff.fromOffsetPairs(prev ? prev.getEndExclusives() : OffsetPair.zero, next ? next.getStarts() : OffsetPair.max); + const result = newDiff.intersect(availableSpace); + if (newDiffs.length > 0 && result.getStarts().equals(newDiffs[newDiffs.length - 1].getEndExclusives())) { + newDiffs[newDiffs.length - 1] = newDiffs[newDiffs.length - 1].join(result); + } else { + newDiffs.push(result); + } + }); + return newDiffs; +} + +// node_modules/monaco-editor-core/esm/vs/editor/common/diff/defaultLinesDiffComputer/lineSequence.js +var LineSequence2 = class { + constructor(trimmedHash, lines) { + this.trimmedHash = trimmedHash; + this.lines = lines; + } + getElement(offset) { + return this.trimmedHash[offset]; + } + get length() { + return this.trimmedHash.length; + } + getBoundaryScore(length) { + const indentationBefore = length === 0 ? 0 : getIndentation(this.lines[length - 1]); + const indentationAfter = length === this.lines.length ? 0 : getIndentation(this.lines[length]); + return 1e3 - (indentationBefore + indentationAfter); + } + getText(range) { + return this.lines.slice(range.start, range.endExclusive).join("\n"); + } + isStronglyEqual(offset1, offset2) { + return this.lines[offset1] === this.lines[offset2]; + } +}; +function getIndentation(str) { + let i = 0; + while (i < str.length && (str.charCodeAt(i) === 32 || str.charCodeAt(i) === 9)) { + i++; + } + return i; +} + +// node_modules/monaco-editor-core/esm/vs/editor/common/diff/defaultLinesDiffComputer/defaultLinesDiffComputer.js +var DefaultLinesDiffComputer = class { + constructor() { + this.dynamicProgrammingDiffing = new DynamicProgrammingDiffing(); + this.myersDiffingAlgorithm = new MyersDiffAlgorithm(); + } + computeDiff(originalLines, modifiedLines, options) { + if (originalLines.length <= 1 && equals2(originalLines, modifiedLines, (a, b) => a === b)) { + return new LinesDiff([], [], false); + } + if (originalLines.length === 1 && originalLines[0].length === 0 || modifiedLines.length === 1 && modifiedLines[0].length === 0) { + return new LinesDiff([ + new DetailedLineRangeMapping(new LineRange(1, originalLines.length + 1), new LineRange(1, modifiedLines.length + 1), [ + new RangeMapping(new Range(1, 1, originalLines.length, originalLines[originalLines.length - 1].length + 1), new Range(1, 1, modifiedLines.length, modifiedLines[modifiedLines.length - 1].length + 1)) + ]) + ], [], false); + } + const timeout = options.maxComputationTimeMs === 0 ? InfiniteTimeout.instance : new DateTimeout(options.maxComputationTimeMs); + const considerWhitespaceChanges = !options.ignoreTrimWhitespace; + const perfectHashes = /* @__PURE__ */ new Map(); + function getOrCreateHash(text) { + let hash = perfectHashes.get(text); + if (hash === void 0) { + hash = perfectHashes.size; + perfectHashes.set(text, hash); + } + return hash; + } + const originalLinesHashes = originalLines.map((l) => getOrCreateHash(l.trim())); + const modifiedLinesHashes = modifiedLines.map((l) => getOrCreateHash(l.trim())); + const sequence1 = new LineSequence2(originalLinesHashes, originalLines); + const sequence2 = new LineSequence2(modifiedLinesHashes, modifiedLines); + const lineAlignmentResult = (() => { + if (sequence1.length + sequence2.length < 1700) { + return this.dynamicProgrammingDiffing.compute(sequence1, sequence2, timeout, (offset1, offset2) => originalLines[offset1] === modifiedLines[offset2] ? modifiedLines[offset2].length === 0 ? 0.1 : 1 + Math.log(1 + modifiedLines[offset2].length) : 0.99); + } + return this.myersDiffingAlgorithm.compute(sequence1, sequence2, timeout); + })(); + let lineAlignments = lineAlignmentResult.diffs; + let hitTimeout = lineAlignmentResult.hitTimeout; + lineAlignments = optimizeSequenceDiffs(sequence1, sequence2, lineAlignments); + lineAlignments = removeVeryShortMatchingLinesBetweenDiffs(sequence1, sequence2, lineAlignments); + const alignments = []; + const scanForWhitespaceChanges = (equalLinesCount) => { + if (!considerWhitespaceChanges) { + return; + } + for (let i = 0; i < equalLinesCount; i++) { + const seq1Offset = seq1LastStart + i; + const seq2Offset = seq2LastStart + i; + if (originalLines[seq1Offset] !== modifiedLines[seq2Offset]) { + const characterDiffs = this.refineDiff(originalLines, modifiedLines, new SequenceDiff(new OffsetRange(seq1Offset, seq1Offset + 1), new OffsetRange(seq2Offset, seq2Offset + 1)), timeout, considerWhitespaceChanges, options); + for (const a of characterDiffs.mappings) { + alignments.push(a); + } + if (characterDiffs.hitTimeout) { + hitTimeout = true; + } + } + } + }; + let seq1LastStart = 0; + let seq2LastStart = 0; + for (const diff of lineAlignments) { + assertFn(() => diff.seq1Range.start - seq1LastStart === diff.seq2Range.start - seq2LastStart); + const equalLinesCount = diff.seq1Range.start - seq1LastStart; + scanForWhitespaceChanges(equalLinesCount); + seq1LastStart = diff.seq1Range.endExclusive; + seq2LastStart = diff.seq2Range.endExclusive; + const characterDiffs = this.refineDiff(originalLines, modifiedLines, diff, timeout, considerWhitespaceChanges, options); + if (characterDiffs.hitTimeout) { + hitTimeout = true; + } + for (const a of characterDiffs.mappings) { + alignments.push(a); + } + } + scanForWhitespaceChanges(originalLines.length - seq1LastStart); + const original = new ArrayText(originalLines); + const modified = new ArrayText(modifiedLines); + const changes = lineRangeMappingFromRangeMappings(alignments, original, modified); + let moves = []; + if (options.computeMoves) { + moves = this.computeMoves(changes, originalLines, modifiedLines, originalLinesHashes, modifiedLinesHashes, timeout, considerWhitespaceChanges, options); + } + assertFn(() => { + function validatePosition(pos, lines) { + if (pos.lineNumber < 1 || pos.lineNumber > lines.length) { + return false; + } + const line = lines[pos.lineNumber - 1]; + if (pos.column < 1 || pos.column > line.length + 1) { + return false; + } + return true; + } + function validateRange(range, lines) { + if (range.startLineNumber < 1 || range.startLineNumber > lines.length + 1) { + return false; + } + if (range.endLineNumberExclusive < 1 || range.endLineNumberExclusive > lines.length + 1) { + return false; + } + return true; + } + for (const c of changes) { + if (!c.innerChanges) { + return false; + } + for (const ic of c.innerChanges) { + const valid = validatePosition(ic.modifiedRange.getStartPosition(), modifiedLines) && validatePosition(ic.modifiedRange.getEndPosition(), modifiedLines) && validatePosition(ic.originalRange.getStartPosition(), originalLines) && validatePosition(ic.originalRange.getEndPosition(), originalLines); + if (!valid) { + return false; + } + } + if (!validateRange(c.modified, modifiedLines) || !validateRange(c.original, originalLines)) { + return false; + } + } + return true; + }); + return new LinesDiff(changes, moves, hitTimeout); + } + computeMoves(changes, originalLines, modifiedLines, hashedOriginalLines, hashedModifiedLines, timeout, considerWhitespaceChanges, options) { + const moves = computeMovedLines(changes, originalLines, modifiedLines, hashedOriginalLines, hashedModifiedLines, timeout); + const movesWithDiffs = moves.map((m) => { + const moveChanges = this.refineDiff(originalLines, modifiedLines, new SequenceDiff(m.original.toOffsetRange(), m.modified.toOffsetRange()), timeout, considerWhitespaceChanges, options); + const mappings = lineRangeMappingFromRangeMappings(moveChanges.mappings, new ArrayText(originalLines), new ArrayText(modifiedLines), true); + return new MovedText(m, mappings); + }); + return movesWithDiffs; + } + refineDiff(originalLines, modifiedLines, diff, timeout, considerWhitespaceChanges, options) { + const lineRangeMapping = toLineRangeMapping(diff); + const rangeMapping = lineRangeMapping.toRangeMapping2(originalLines, modifiedLines); + const slice1 = new LinesSliceCharSequence(originalLines, rangeMapping.originalRange, considerWhitespaceChanges); + const slice2 = new LinesSliceCharSequence(modifiedLines, rangeMapping.modifiedRange, considerWhitespaceChanges); + const diffResult = slice1.length + slice2.length < 500 ? this.dynamicProgrammingDiffing.compute(slice1, slice2, timeout) : this.myersDiffingAlgorithm.compute(slice1, slice2, timeout); + const check = false; + let diffs = diffResult.diffs; + if (check) { + SequenceDiff.assertSorted(diffs); + } + diffs = optimizeSequenceDiffs(slice1, slice2, diffs); + if (check) { + SequenceDiff.assertSorted(diffs); + } + diffs = extendDiffsToEntireWordIfAppropriate(slice1, slice2, diffs, (seq, idx) => seq.findWordContaining(idx)); + if (check) { + SequenceDiff.assertSorted(diffs); + } + if (options.extendToSubwords) { + diffs = extendDiffsToEntireWordIfAppropriate(slice1, slice2, diffs, (seq, idx) => seq.findSubWordContaining(idx), true); + if (check) { + SequenceDiff.assertSorted(diffs); + } + } + diffs = removeShortMatches(slice1, slice2, diffs); + if (check) { + SequenceDiff.assertSorted(diffs); + } + diffs = removeVeryShortMatchingTextBetweenLongDiffs(slice1, slice2, diffs); + if (check) { + SequenceDiff.assertSorted(diffs); + } + const result = diffs.map((d) => new RangeMapping(slice1.translateRange(d.seq1Range), slice2.translateRange(d.seq2Range))); + if (check) { + RangeMapping.assertSorted(result); + } + return { + mappings: result, + hitTimeout: diffResult.hitTimeout + }; + } +}; +function toLineRangeMapping(sequenceDiff) { + return new LineRangeMapping(new LineRange(sequenceDiff.seq1Range.start + 1, sequenceDiff.seq1Range.endExclusive + 1), new LineRange(sequenceDiff.seq2Range.start + 1, sequenceDiff.seq2Range.endExclusive + 1)); +} + +// node_modules/monaco-editor-core/esm/vs/editor/common/diff/linesDiffComputers.js +var linesDiffComputers = { + getLegacy: () => new LegacyLinesDiffComputer(), + getDefault: () => new DefaultLinesDiffComputer() +}; + +// node_modules/monaco-editor-core/esm/vs/base/common/color.js +function roundFloat(number, decimalPoints) { + const decimal = Math.pow(10, decimalPoints); + return Math.round(number * decimal) / decimal; +} +var RGBA = class { + constructor(r, g, b, a = 1) { + this._rgbaBrand = void 0; + this.r = Math.min(255, Math.max(0, r)) | 0; + this.g = Math.min(255, Math.max(0, g)) | 0; + this.b = Math.min(255, Math.max(0, b)) | 0; + this.a = roundFloat(Math.max(Math.min(1, a), 0), 3); + } + static equals(a, b) { + return a.r === b.r && a.g === b.g && a.b === b.b && a.a === b.a; + } +}; +var HSLA = class _HSLA { + constructor(h, s, l, a) { + this._hslaBrand = void 0; + this.h = Math.max(Math.min(360, h), 0) | 0; + this.s = roundFloat(Math.max(Math.min(1, s), 0), 3); + this.l = roundFloat(Math.max(Math.min(1, l), 0), 3); + this.a = roundFloat(Math.max(Math.min(1, a), 0), 3); + } + static equals(a, b) { + return a.h === b.h && a.s === b.s && a.l === b.l && a.a === b.a; + } + /** + * Converts an RGB color value to HSL. Conversion formula + * adapted from http://en.wikipedia.org/wiki/HSL_color_space. + * Assumes r, g, and b are contained in the set [0, 255] and + * returns h in the set [0, 360], s, and l in the set [0, 1]. + */ + static fromRGBA(rgba) { + const r = rgba.r / 255; + const g = rgba.g / 255; + const b = rgba.b / 255; + const a = rgba.a; + const max = Math.max(r, g, b); + const min = Math.min(r, g, b); + let h = 0; + let s = 0; + const l = (min + max) / 2; + const chroma = max - min; + if (chroma > 0) { + s = Math.min(l <= 0.5 ? chroma / (2 * l) : chroma / (2 - 2 * l), 1); + switch (max) { + case r: + h = (g - b) / chroma + (g < b ? 6 : 0); + break; + case g: + h = (b - r) / chroma + 2; + break; + case b: + h = (r - g) / chroma + 4; + break; + } + h *= 60; + h = Math.round(h); + } + return new _HSLA(h, s, l, a); + } + static _hue2rgb(p, q, t) { + if (t < 0) { + t += 1; + } + if (t > 1) { + t -= 1; + } + if (t < 1 / 6) { + return p + (q - p) * 6 * t; + } + if (t < 1 / 2) { + return q; + } + if (t < 2 / 3) { + return p + (q - p) * (2 / 3 - t) * 6; + } + return p; + } + /** + * Converts an HSL color value to RGB. Conversion formula + * adapted from http://en.wikipedia.org/wiki/HSL_color_space. + * Assumes h in the set [0, 360] s, and l are contained in the set [0, 1] and + * returns r, g, and b in the set [0, 255]. + */ + static toRGBA(hsla) { + const h = hsla.h / 360; + const { s, l, a } = hsla; + let r, g, b; + if (s === 0) { + r = g = b = l; + } else { + const q = l < 0.5 ? l * (1 + s) : l + s - l * s; + const p = 2 * l - q; + r = _HSLA._hue2rgb(p, q, h + 1 / 3); + g = _HSLA._hue2rgb(p, q, h); + b = _HSLA._hue2rgb(p, q, h - 1 / 3); + } + return new RGBA(Math.round(r * 255), Math.round(g * 255), Math.round(b * 255), a); + } +}; +var HSVA = class _HSVA { + constructor(h, s, v, a) { + this._hsvaBrand = void 0; + this.h = Math.max(Math.min(360, h), 0) | 0; + this.s = roundFloat(Math.max(Math.min(1, s), 0), 3); + this.v = roundFloat(Math.max(Math.min(1, v), 0), 3); + this.a = roundFloat(Math.max(Math.min(1, a), 0), 3); + } + static equals(a, b) { + return a.h === b.h && a.s === b.s && a.v === b.v && a.a === b.a; + } + // from http://www.rapidtables.com/convert/color/rgb-to-hsv.htm + static fromRGBA(rgba) { + const r = rgba.r / 255; + const g = rgba.g / 255; + const b = rgba.b / 255; + const cmax = Math.max(r, g, b); + const cmin = Math.min(r, g, b); + const delta = cmax - cmin; + const s = cmax === 0 ? 0 : delta / cmax; + let m; + if (delta === 0) { + m = 0; + } else if (cmax === r) { + m = ((g - b) / delta % 6 + 6) % 6; + } else if (cmax === g) { + m = (b - r) / delta + 2; + } else { + m = (r - g) / delta + 4; + } + return new _HSVA(Math.round(m * 60), s, cmax, rgba.a); + } + // from http://www.rapidtables.com/convert/color/hsv-to-rgb.htm + static toRGBA(hsva) { + const { h, s, v, a } = hsva; + const c = v * s; + const x = c * (1 - Math.abs(h / 60 % 2 - 1)); + const m = v - c; + let [r, g, b] = [0, 0, 0]; + if (h < 60) { + r = c; + g = x; + } else if (h < 120) { + r = x; + g = c; + } else if (h < 180) { + g = c; + b = x; + } else if (h < 240) { + g = x; + b = c; + } else if (h < 300) { + r = x; + b = c; + } else if (h <= 360) { + r = c; + b = x; + } + r = Math.round((r + m) * 255); + g = Math.round((g + m) * 255); + b = Math.round((b + m) * 255); + return new RGBA(r, g, b, a); + } +}; +var Color = class _Color { + static fromHex(hex) { + return _Color.Format.CSS.parseHex(hex) || _Color.red; + } + static equals(a, b) { + if (!a && !b) { + return true; + } + if (!a || !b) { + return false; + } + return a.equals(b); + } + get hsla() { + if (this._hsla) { + return this._hsla; + } else { + return HSLA.fromRGBA(this.rgba); + } + } + get hsva() { + if (this._hsva) { + return this._hsva; + } + return HSVA.fromRGBA(this.rgba); + } + constructor(arg) { + if (!arg) { + throw new Error("Color needs a value"); + } else if (arg instanceof RGBA) { + this.rgba = arg; + } else if (arg instanceof HSLA) { + this._hsla = arg; + this.rgba = HSLA.toRGBA(arg); + } else if (arg instanceof HSVA) { + this._hsva = arg; + this.rgba = HSVA.toRGBA(arg); + } else { + throw new Error("Invalid color ctor argument"); + } + } + equals(other) { + return !!other && RGBA.equals(this.rgba, other.rgba) && HSLA.equals(this.hsla, other.hsla) && HSVA.equals(this.hsva, other.hsva); + } + /** + * http://www.w3.org/TR/WCAG20/#relativeluminancedef + * Returns the number in the set [0, 1]. O => Darkest Black. 1 => Lightest white. + */ + getRelativeLuminance() { + const R = _Color._relativeLuminanceForComponent(this.rgba.r); + const G = _Color._relativeLuminanceForComponent(this.rgba.g); + const B = _Color._relativeLuminanceForComponent(this.rgba.b); + const luminance = 0.2126 * R + 0.7152 * G + 0.0722 * B; + return roundFloat(luminance, 4); + } + static _relativeLuminanceForComponent(color) { + const c = color / 255; + return c <= 0.03928 ? c / 12.92 : Math.pow((c + 0.055) / 1.055, 2.4); + } + /** + * http://24ways.org/2010/calculating-color-contrast + * Return 'true' if lighter color otherwise 'false' + */ + isLighter() { + const yiq = (this.rgba.r * 299 + this.rgba.g * 587 + this.rgba.b * 114) / 1e3; + return yiq >= 128; + } + isLighterThan(another) { + const lum1 = this.getRelativeLuminance(); + const lum2 = another.getRelativeLuminance(); + return lum1 > lum2; + } + isDarkerThan(another) { + const lum1 = this.getRelativeLuminance(); + const lum2 = another.getRelativeLuminance(); + return lum1 < lum2; + } + lighten(factor) { + return new _Color(new HSLA(this.hsla.h, this.hsla.s, this.hsla.l + this.hsla.l * factor, this.hsla.a)); + } + darken(factor) { + return new _Color(new HSLA(this.hsla.h, this.hsla.s, this.hsla.l - this.hsla.l * factor, this.hsla.a)); + } + transparent(factor) { + const { r, g, b, a } = this.rgba; + return new _Color(new RGBA(r, g, b, a * factor)); + } + isTransparent() { + return this.rgba.a === 0; + } + isOpaque() { + return this.rgba.a === 1; + } + opposite() { + return new _Color(new RGBA(255 - this.rgba.r, 255 - this.rgba.g, 255 - this.rgba.b, this.rgba.a)); + } + /** + * Mixes the current color with the provided color based on the given factor. + * @param color The color to mix with + * @param factor The factor of mixing (0 means this color, 1 means the input color, 0.5 means equal mix) + * @returns A new color representing the mix + */ + mix(color, factor = 0.5) { + const normalize2 = Math.min(Math.max(factor, 0), 1); + const thisRGBA = this.rgba; + const otherRGBA = color.rgba; + const r = thisRGBA.r + (otherRGBA.r - thisRGBA.r) * normalize2; + const g = thisRGBA.g + (otherRGBA.g - thisRGBA.g) * normalize2; + const b = thisRGBA.b + (otherRGBA.b - thisRGBA.b) * normalize2; + const a = thisRGBA.a + (otherRGBA.a - thisRGBA.a) * normalize2; + return new _Color(new RGBA(r, g, b, a)); + } + makeOpaque(opaqueBackground) { + if (this.isOpaque() || opaqueBackground.rgba.a !== 1) { + return this; + } + const { r, g, b, a } = this.rgba; + return new _Color(new RGBA(opaqueBackground.rgba.r - a * (opaqueBackground.rgba.r - r), opaqueBackground.rgba.g - a * (opaqueBackground.rgba.g - g), opaqueBackground.rgba.b - a * (opaqueBackground.rgba.b - b), 1)); + } + toString() { + if (!this._toString) { + this._toString = _Color.Format.CSS.format(this); + } + return this._toString; + } + toNumber32Bit() { + if (!this._toNumber32Bit) { + this._toNumber32Bit = (this.rgba.r << 24 | this.rgba.g << 16 | this.rgba.b << 8 | this.rgba.a * 255 << 0) >>> 0; + } + return this._toNumber32Bit; + } + static getLighterColor(of, relative2, factor) { + if (of.isLighterThan(relative2)) { + return of; + } + factor = factor ? factor : 0.5; + const lum1 = of.getRelativeLuminance(); + const lum2 = relative2.getRelativeLuminance(); + factor = factor * (lum2 - lum1) / lum2; + return of.lighten(factor); + } + static getDarkerColor(of, relative2, factor) { + if (of.isDarkerThan(relative2)) { + return of; + } + factor = factor ? factor : 0.5; + const lum1 = of.getRelativeLuminance(); + const lum2 = relative2.getRelativeLuminance(); + factor = factor * (lum1 - lum2) / lum1; + return of.darken(factor); + } + static { + this.white = new _Color(new RGBA(255, 255, 255, 1)); + } + static { + this.black = new _Color(new RGBA(0, 0, 0, 1)); + } + static { + this.red = new _Color(new RGBA(255, 0, 0, 1)); + } + static { + this.blue = new _Color(new RGBA(0, 0, 255, 1)); + } + static { + this.green = new _Color(new RGBA(0, 255, 0, 1)); + } + static { + this.cyan = new _Color(new RGBA(0, 255, 255, 1)); + } + static { + this.lightgrey = new _Color(new RGBA(211, 211, 211, 1)); + } + static { + this.transparent = new _Color(new RGBA(0, 0, 0, 0)); + } +}; +(function(Color2) { + let Format; + (function(Format2) { + let CSS; + (function(CSS2) { + function formatRGB(color) { + if (color.rgba.a === 1) { + return `rgb(${color.rgba.r}, ${color.rgba.g}, ${color.rgba.b})`; + } + return Color2.Format.CSS.formatRGBA(color); + } + CSS2.formatRGB = formatRGB; + function formatRGBA(color) { + return `rgba(${color.rgba.r}, ${color.rgba.g}, ${color.rgba.b}, ${+color.rgba.a.toFixed(2)})`; + } + CSS2.formatRGBA = formatRGBA; + function formatHSL(color) { + if (color.hsla.a === 1) { + return `hsl(${color.hsla.h}, ${Math.round(color.hsla.s * 100)}%, ${Math.round(color.hsla.l * 100)}%)`; + } + return Color2.Format.CSS.formatHSLA(color); + } + CSS2.formatHSL = formatHSL; + function formatHSLA(color) { + return `hsla(${color.hsla.h}, ${Math.round(color.hsla.s * 100)}%, ${Math.round(color.hsla.l * 100)}%, ${color.hsla.a.toFixed(2)})`; + } + CSS2.formatHSLA = formatHSLA; + function _toTwoDigitHex(n) { + const r = n.toString(16); + return r.length !== 2 ? "0" + r : r; + } + function formatHex(color) { + return `#${_toTwoDigitHex(color.rgba.r)}${_toTwoDigitHex(color.rgba.g)}${_toTwoDigitHex(color.rgba.b)}`; + } + CSS2.formatHex = formatHex; + function formatHexA(color, compact = false) { + if (compact && color.rgba.a === 1) { + return Color2.Format.CSS.formatHex(color); + } + return `#${_toTwoDigitHex(color.rgba.r)}${_toTwoDigitHex(color.rgba.g)}${_toTwoDigitHex(color.rgba.b)}${_toTwoDigitHex(Math.round(color.rgba.a * 255))}`; + } + CSS2.formatHexA = formatHexA; + function format(color) { + if (color.isOpaque()) { + return Color2.Format.CSS.formatHex(color); + } + return Color2.Format.CSS.formatRGBA(color); + } + CSS2.format = format; + function parse(css) { + if (css === "transparent") { + return Color2.transparent; + } + if (css.startsWith("#")) { + return parseHex(css); + } + if (css.startsWith("rgba(")) { + const color = css.match(/rgba\((?(?:\+|-)?\d+), *(?(?:\+|-)?\d+), *(?(?:\+|-)?\d+), *(?(?:\+|-)?\d+(\.\d+)?)\)/); + if (!color) { + throw new Error("Invalid color format " + css); + } + const r = parseInt(color.groups?.r ?? "0"); + const g = parseInt(color.groups?.g ?? "0"); + const b = parseInt(color.groups?.b ?? "0"); + const a = parseFloat(color.groups?.a ?? "0"); + return new Color2(new RGBA(r, g, b, a)); + } + if (css.startsWith("rgb(")) { + const color = css.match(/rgb\((?(?:\+|-)?\d+), *(?(?:\+|-)?\d+), *(?(?:\+|-)?\d+)\)/); + if (!color) { + throw new Error("Invalid color format " + css); + } + const r = parseInt(color.groups?.r ?? "0"); + const g = parseInt(color.groups?.g ?? "0"); + const b = parseInt(color.groups?.b ?? "0"); + return new Color2(new RGBA(r, g, b)); + } + return parseNamedKeyword(css); + } + CSS2.parse = parse; + function parseNamedKeyword(css) { + switch (css) { + case "aliceblue": + return new Color2(new RGBA(240, 248, 255, 1)); + case "antiquewhite": + return new Color2(new RGBA(250, 235, 215, 1)); + case "aqua": + return new Color2(new RGBA(0, 255, 255, 1)); + case "aquamarine": + return new Color2(new RGBA(127, 255, 212, 1)); + case "azure": + return new Color2(new RGBA(240, 255, 255, 1)); + case "beige": + return new Color2(new RGBA(245, 245, 220, 1)); + case "bisque": + return new Color2(new RGBA(255, 228, 196, 1)); + case "black": + return new Color2(new RGBA(0, 0, 0, 1)); + case "blanchedalmond": + return new Color2(new RGBA(255, 235, 205, 1)); + case "blue": + return new Color2(new RGBA(0, 0, 255, 1)); + case "blueviolet": + return new Color2(new RGBA(138, 43, 226, 1)); + case "brown": + return new Color2(new RGBA(165, 42, 42, 1)); + case "burlywood": + return new Color2(new RGBA(222, 184, 135, 1)); + case "cadetblue": + return new Color2(new RGBA(95, 158, 160, 1)); + case "chartreuse": + return new Color2(new RGBA(127, 255, 0, 1)); + case "chocolate": + return new Color2(new RGBA(210, 105, 30, 1)); + case "coral": + return new Color2(new RGBA(255, 127, 80, 1)); + case "cornflowerblue": + return new Color2(new RGBA(100, 149, 237, 1)); + case "cornsilk": + return new Color2(new RGBA(255, 248, 220, 1)); + case "crimson": + return new Color2(new RGBA(220, 20, 60, 1)); + case "cyan": + return new Color2(new RGBA(0, 255, 255, 1)); + case "darkblue": + return new Color2(new RGBA(0, 0, 139, 1)); + case "darkcyan": + return new Color2(new RGBA(0, 139, 139, 1)); + case "darkgoldenrod": + return new Color2(new RGBA(184, 134, 11, 1)); + case "darkgray": + return new Color2(new RGBA(169, 169, 169, 1)); + case "darkgreen": + return new Color2(new RGBA(0, 100, 0, 1)); + case "darkgrey": + return new Color2(new RGBA(169, 169, 169, 1)); + case "darkkhaki": + return new Color2(new RGBA(189, 183, 107, 1)); + case "darkmagenta": + return new Color2(new RGBA(139, 0, 139, 1)); + case "darkolivegreen": + return new Color2(new RGBA(85, 107, 47, 1)); + case "darkorange": + return new Color2(new RGBA(255, 140, 0, 1)); + case "darkorchid": + return new Color2(new RGBA(153, 50, 204, 1)); + case "darkred": + return new Color2(new RGBA(139, 0, 0, 1)); + case "darksalmon": + return new Color2(new RGBA(233, 150, 122, 1)); + case "darkseagreen": + return new Color2(new RGBA(143, 188, 143, 1)); + case "darkslateblue": + return new Color2(new RGBA(72, 61, 139, 1)); + case "darkslategray": + return new Color2(new RGBA(47, 79, 79, 1)); + case "darkslategrey": + return new Color2(new RGBA(47, 79, 79, 1)); + case "darkturquoise": + return new Color2(new RGBA(0, 206, 209, 1)); + case "darkviolet": + return new Color2(new RGBA(148, 0, 211, 1)); + case "deeppink": + return new Color2(new RGBA(255, 20, 147, 1)); + case "deepskyblue": + return new Color2(new RGBA(0, 191, 255, 1)); + case "dimgray": + return new Color2(new RGBA(105, 105, 105, 1)); + case "dimgrey": + return new Color2(new RGBA(105, 105, 105, 1)); + case "dodgerblue": + return new Color2(new RGBA(30, 144, 255, 1)); + case "firebrick": + return new Color2(new RGBA(178, 34, 34, 1)); + case "floralwhite": + return new Color2(new RGBA(255, 250, 240, 1)); + case "forestgreen": + return new Color2(new RGBA(34, 139, 34, 1)); + case "fuchsia": + return new Color2(new RGBA(255, 0, 255, 1)); + case "gainsboro": + return new Color2(new RGBA(220, 220, 220, 1)); + case "ghostwhite": + return new Color2(new RGBA(248, 248, 255, 1)); + case "gold": + return new Color2(new RGBA(255, 215, 0, 1)); + case "goldenrod": + return new Color2(new RGBA(218, 165, 32, 1)); + case "gray": + return new Color2(new RGBA(128, 128, 128, 1)); + case "green": + return new Color2(new RGBA(0, 128, 0, 1)); + case "greenyellow": + return new Color2(new RGBA(173, 255, 47, 1)); + case "grey": + return new Color2(new RGBA(128, 128, 128, 1)); + case "honeydew": + return new Color2(new RGBA(240, 255, 240, 1)); + case "hotpink": + return new Color2(new RGBA(255, 105, 180, 1)); + case "indianred": + return new Color2(new RGBA(205, 92, 92, 1)); + case "indigo": + return new Color2(new RGBA(75, 0, 130, 1)); + case "ivory": + return new Color2(new RGBA(255, 255, 240, 1)); + case "khaki": + return new Color2(new RGBA(240, 230, 140, 1)); + case "lavender": + return new Color2(new RGBA(230, 230, 250, 1)); + case "lavenderblush": + return new Color2(new RGBA(255, 240, 245, 1)); + case "lawngreen": + return new Color2(new RGBA(124, 252, 0, 1)); + case "lemonchiffon": + return new Color2(new RGBA(255, 250, 205, 1)); + case "lightblue": + return new Color2(new RGBA(173, 216, 230, 1)); + case "lightcoral": + return new Color2(new RGBA(240, 128, 128, 1)); + case "lightcyan": + return new Color2(new RGBA(224, 255, 255, 1)); + case "lightgoldenrodyellow": + return new Color2(new RGBA(250, 250, 210, 1)); + case "lightgray": + return new Color2(new RGBA(211, 211, 211, 1)); + case "lightgreen": + return new Color2(new RGBA(144, 238, 144, 1)); + case "lightgrey": + return new Color2(new RGBA(211, 211, 211, 1)); + case "lightpink": + return new Color2(new RGBA(255, 182, 193, 1)); + case "lightsalmon": + return new Color2(new RGBA(255, 160, 122, 1)); + case "lightseagreen": + return new Color2(new RGBA(32, 178, 170, 1)); + case "lightskyblue": + return new Color2(new RGBA(135, 206, 250, 1)); + case "lightslategray": + return new Color2(new RGBA(119, 136, 153, 1)); + case "lightslategrey": + return new Color2(new RGBA(119, 136, 153, 1)); + case "lightsteelblue": + return new Color2(new RGBA(176, 196, 222, 1)); + case "lightyellow": + return new Color2(new RGBA(255, 255, 224, 1)); + case "lime": + return new Color2(new RGBA(0, 255, 0, 1)); + case "limegreen": + return new Color2(new RGBA(50, 205, 50, 1)); + case "linen": + return new Color2(new RGBA(250, 240, 230, 1)); + case "magenta": + return new Color2(new RGBA(255, 0, 255, 1)); + case "maroon": + return new Color2(new RGBA(128, 0, 0, 1)); + case "mediumaquamarine": + return new Color2(new RGBA(102, 205, 170, 1)); + case "mediumblue": + return new Color2(new RGBA(0, 0, 205, 1)); + case "mediumorchid": + return new Color2(new RGBA(186, 85, 211, 1)); + case "mediumpurple": + return new Color2(new RGBA(147, 112, 219, 1)); + case "mediumseagreen": + return new Color2(new RGBA(60, 179, 113, 1)); + case "mediumslateblue": + return new Color2(new RGBA(123, 104, 238, 1)); + case "mediumspringgreen": + return new Color2(new RGBA(0, 250, 154, 1)); + case "mediumturquoise": + return new Color2(new RGBA(72, 209, 204, 1)); + case "mediumvioletred": + return new Color2(new RGBA(199, 21, 133, 1)); + case "midnightblue": + return new Color2(new RGBA(25, 25, 112, 1)); + case "mintcream": + return new Color2(new RGBA(245, 255, 250, 1)); + case "mistyrose": + return new Color2(new RGBA(255, 228, 225, 1)); + case "moccasin": + return new Color2(new RGBA(255, 228, 181, 1)); + case "navajowhite": + return new Color2(new RGBA(255, 222, 173, 1)); + case "navy": + return new Color2(new RGBA(0, 0, 128, 1)); + case "oldlace": + return new Color2(new RGBA(253, 245, 230, 1)); + case "olive": + return new Color2(new RGBA(128, 128, 0, 1)); + case "olivedrab": + return new Color2(new RGBA(107, 142, 35, 1)); + case "orange": + return new Color2(new RGBA(255, 165, 0, 1)); + case "orangered": + return new Color2(new RGBA(255, 69, 0, 1)); + case "orchid": + return new Color2(new RGBA(218, 112, 214, 1)); + case "palegoldenrod": + return new Color2(new RGBA(238, 232, 170, 1)); + case "palegreen": + return new Color2(new RGBA(152, 251, 152, 1)); + case "paleturquoise": + return new Color2(new RGBA(175, 238, 238, 1)); + case "palevioletred": + return new Color2(new RGBA(219, 112, 147, 1)); + case "papayawhip": + return new Color2(new RGBA(255, 239, 213, 1)); + case "peachpuff": + return new Color2(new RGBA(255, 218, 185, 1)); + case "peru": + return new Color2(new RGBA(205, 133, 63, 1)); + case "pink": + return new Color2(new RGBA(255, 192, 203, 1)); + case "plum": + return new Color2(new RGBA(221, 160, 221, 1)); + case "powderblue": + return new Color2(new RGBA(176, 224, 230, 1)); + case "purple": + return new Color2(new RGBA(128, 0, 128, 1)); + case "rebeccapurple": + return new Color2(new RGBA(102, 51, 153, 1)); + case "red": + return new Color2(new RGBA(255, 0, 0, 1)); + case "rosybrown": + return new Color2(new RGBA(188, 143, 143, 1)); + case "royalblue": + return new Color2(new RGBA(65, 105, 225, 1)); + case "saddlebrown": + return new Color2(new RGBA(139, 69, 19, 1)); + case "salmon": + return new Color2(new RGBA(250, 128, 114, 1)); + case "sandybrown": + return new Color2(new RGBA(244, 164, 96, 1)); + case "seagreen": + return new Color2(new RGBA(46, 139, 87, 1)); + case "seashell": + return new Color2(new RGBA(255, 245, 238, 1)); + case "sienna": + return new Color2(new RGBA(160, 82, 45, 1)); + case "silver": + return new Color2(new RGBA(192, 192, 192, 1)); + case "skyblue": + return new Color2(new RGBA(135, 206, 235, 1)); + case "slateblue": + return new Color2(new RGBA(106, 90, 205, 1)); + case "slategray": + return new Color2(new RGBA(112, 128, 144, 1)); + case "slategrey": + return new Color2(new RGBA(112, 128, 144, 1)); + case "snow": + return new Color2(new RGBA(255, 250, 250, 1)); + case "springgreen": + return new Color2(new RGBA(0, 255, 127, 1)); + case "steelblue": + return new Color2(new RGBA(70, 130, 180, 1)); + case "tan": + return new Color2(new RGBA(210, 180, 140, 1)); + case "teal": + return new Color2(new RGBA(0, 128, 128, 1)); + case "thistle": + return new Color2(new RGBA(216, 191, 216, 1)); + case "tomato": + return new Color2(new RGBA(255, 99, 71, 1)); + case "turquoise": + return new Color2(new RGBA(64, 224, 208, 1)); + case "violet": + return new Color2(new RGBA(238, 130, 238, 1)); + case "wheat": + return new Color2(new RGBA(245, 222, 179, 1)); + case "white": + return new Color2(new RGBA(255, 255, 255, 1)); + case "whitesmoke": + return new Color2(new RGBA(245, 245, 245, 1)); + case "yellow": + return new Color2(new RGBA(255, 255, 0, 1)); + case "yellowgreen": + return new Color2(new RGBA(154, 205, 50, 1)); + default: + return null; + } + } + function parseHex(hex) { + const length = hex.length; + if (length === 0) { + return null; + } + if (hex.charCodeAt(0) !== 35) { + return null; + } + if (length === 7) { + const r = 16 * _parseHexDigit(hex.charCodeAt(1)) + _parseHexDigit(hex.charCodeAt(2)); + const g = 16 * _parseHexDigit(hex.charCodeAt(3)) + _parseHexDigit(hex.charCodeAt(4)); + const b = 16 * _parseHexDigit(hex.charCodeAt(5)) + _parseHexDigit(hex.charCodeAt(6)); + return new Color2(new RGBA(r, g, b, 1)); + } + if (length === 9) { + const r = 16 * _parseHexDigit(hex.charCodeAt(1)) + _parseHexDigit(hex.charCodeAt(2)); + const g = 16 * _parseHexDigit(hex.charCodeAt(3)) + _parseHexDigit(hex.charCodeAt(4)); + const b = 16 * _parseHexDigit(hex.charCodeAt(5)) + _parseHexDigit(hex.charCodeAt(6)); + const a = 16 * _parseHexDigit(hex.charCodeAt(7)) + _parseHexDigit(hex.charCodeAt(8)); + return new Color2(new RGBA(r, g, b, a / 255)); + } + if (length === 4) { + const r = _parseHexDigit(hex.charCodeAt(1)); + const g = _parseHexDigit(hex.charCodeAt(2)); + const b = _parseHexDigit(hex.charCodeAt(3)); + return new Color2(new RGBA(16 * r + r, 16 * g + g, 16 * b + b)); + } + if (length === 5) { + const r = _parseHexDigit(hex.charCodeAt(1)); + const g = _parseHexDigit(hex.charCodeAt(2)); + const b = _parseHexDigit(hex.charCodeAt(3)); + const a = _parseHexDigit(hex.charCodeAt(4)); + return new Color2(new RGBA(16 * r + r, 16 * g + g, 16 * b + b, (16 * a + a) / 255)); + } + return null; + } + CSS2.parseHex = parseHex; + function _parseHexDigit(charCode) { + switch (charCode) { + case 48: + return 0; + case 49: + return 1; + case 50: + return 2; + case 51: + return 3; + case 52: + return 4; + case 53: + return 5; + case 54: + return 6; + case 55: + return 7; + case 56: + return 8; + case 57: + return 9; + case 97: + return 10; + case 65: + return 10; + case 98: + return 11; + case 66: + return 11; + case 99: + return 12; + case 67: + return 12; + case 100: + return 13; + case 68: + return 13; + case 101: + return 14; + case 69: + return 14; + case 102: + return 15; + case 70: + return 15; + } + return 0; + } + })(CSS = Format2.CSS || (Format2.CSS = {})); + })(Format = Color2.Format || (Color2.Format = {})); +})(Color || (Color = {})); + +// node_modules/monaco-editor-core/esm/vs/editor/common/languages/defaultDocumentColorsComputer.js +function _parseCaptureGroups(captureGroups) { + const values = []; + for (const captureGroup of captureGroups) { + const parsedNumber = Number(captureGroup); + if (parsedNumber || parsedNumber === 0 && captureGroup.replace(/\s/g, "") !== "") { + values.push(parsedNumber); + } + } + return values; +} +function _toIColor(r, g, b, a) { + return { + red: r / 255, + blue: b / 255, + green: g / 255, + alpha: a + }; +} +function _findRange(model, match) { + const index = match.index; + const length = match[0].length; + if (index === void 0) { + return; + } + const startPosition = model.positionAt(index); + const range = { + startLineNumber: startPosition.lineNumber, + startColumn: startPosition.column, + endLineNumber: startPosition.lineNumber, + endColumn: startPosition.column + length + }; + return range; +} +function _findHexColorInformation(range, hexValue) { + if (!range) { + return; + } + const parsedHexColor = Color.Format.CSS.parseHex(hexValue); + if (!parsedHexColor) { + return; + } + return { + range, + color: _toIColor(parsedHexColor.rgba.r, parsedHexColor.rgba.g, parsedHexColor.rgba.b, parsedHexColor.rgba.a) + }; +} +function _findRGBColorInformation(range, matches, isAlpha) { + if (!range || matches.length !== 1) { + return; + } + const match = matches[0]; + const captureGroups = match.values(); + const parsedRegex = _parseCaptureGroups(captureGroups); + return { + range, + color: _toIColor(parsedRegex[0], parsedRegex[1], parsedRegex[2], isAlpha ? parsedRegex[3] : 1) + }; +} +function _findHSLColorInformation(range, matches, isAlpha) { + if (!range || matches.length !== 1) { + return; + } + const match = matches[0]; + const captureGroups = match.values(); + const parsedRegex = _parseCaptureGroups(captureGroups); + const colorEquivalent = new Color(new HSLA(parsedRegex[0], parsedRegex[1] / 100, parsedRegex[2] / 100, isAlpha ? parsedRegex[3] : 1)); + return { + range, + color: _toIColor(colorEquivalent.rgba.r, colorEquivalent.rgba.g, colorEquivalent.rgba.b, colorEquivalent.rgba.a) + }; +} +function _findMatches(model, regex) { + if (typeof model === "string") { + return [...model.matchAll(regex)]; + } else { + return model.findMatches(regex); + } +} +function computeColors(model) { + const result = []; + const initialValidationRegex = /\b(rgb|rgba|hsl|hsla)(\([0-9\s,.\%]*\))|^(#)([A-Fa-f0-9]{3})\b|^(#)([A-Fa-f0-9]{4})\b|^(#)([A-Fa-f0-9]{6})\b|^(#)([A-Fa-f0-9]{8})\b|(?<=['"\s])(#)([A-Fa-f0-9]{3})\b|(?<=['"\s])(#)([A-Fa-f0-9]{4})\b|(?<=['"\s])(#)([A-Fa-f0-9]{6})\b|(?<=['"\s])(#)([A-Fa-f0-9]{8})\b/gm; + const initialValidationMatches = _findMatches(model, initialValidationRegex); + if (initialValidationMatches.length > 0) { + for (const initialMatch of initialValidationMatches) { + const initialCaptureGroups = initialMatch.filter((captureGroup) => captureGroup !== void 0); + const colorScheme = initialCaptureGroups[1]; + const colorParameters = initialCaptureGroups[2]; + if (!colorParameters) { + continue; + } + let colorInformation; + if (colorScheme === "rgb") { + const regexParameters = /^\(\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*\)$/gm; + colorInformation = _findRGBColorInformation(_findRange(model, initialMatch), _findMatches(colorParameters, regexParameters), false); + } else if (colorScheme === "rgba") { + const regexParameters = /^\(\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(0[.][0-9]+|[.][0-9]+|[01][.]|[01])\s*\)$/gm; + colorInformation = _findRGBColorInformation(_findRange(model, initialMatch), _findMatches(colorParameters, regexParameters), true); + } else if (colorScheme === "hsl") { + const regexParameters = /^\(\s*((?:360(?:\.0+)?|(?:36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])(?:\.\d+)?))\s*[\s,]\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*[\s,]\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*\)$/gm; + colorInformation = _findHSLColorInformation(_findRange(model, initialMatch), _findMatches(colorParameters, regexParameters), false); + } else if (colorScheme === "hsla") { + const regexParameters = /^\(\s*((?:360(?:\.0+)?|(?:36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])(?:\.\d+)?))\s*[\s,]\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*[\s,]\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*[\s,]\s*(0[.][0-9]+|[.][0-9]+|[01][.]0*|[01])\s*\)$/gm; + colorInformation = _findHSLColorInformation(_findRange(model, initialMatch), _findMatches(colorParameters, regexParameters), true); + } else if (colorScheme === "#") { + colorInformation = _findHexColorInformation(_findRange(model, initialMatch), colorScheme + colorParameters); + } + if (colorInformation) { + result.push(colorInformation); + } + } + } + return result; +} +function computeDefaultDocumentColors(model) { + if (!model || typeof model.getValue !== "function" || typeof model.positionAt !== "function") { + return []; + } + return computeColors(model); +} + +// node_modules/monaco-editor-core/esm/vs/editor/common/services/findSectionHeaders.js +var trimDashesRegex = /^-+|-+$/g; +var CHUNK_SIZE = 100; +var MAX_SECTION_LINES = 5; +function findSectionHeaders(model, options) { + let headers = []; + if (options.findRegionSectionHeaders && options.foldingRules?.markers) { + const regionHeaders = collectRegionHeaders(model, options); + headers = headers.concat(regionHeaders); + } + if (options.findMarkSectionHeaders) { + const markHeaders = collectMarkHeaders(model, options); + headers = headers.concat(markHeaders); + } + return headers; +} +function collectRegionHeaders(model, options) { + const regionHeaders = []; + const endLineNumber = model.getLineCount(); + for (let lineNumber = 1; lineNumber <= endLineNumber; lineNumber++) { + const lineContent = model.getLineContent(lineNumber); + const match = lineContent.match(options.foldingRules.markers.start); + if (match) { + const range = { startLineNumber: lineNumber, startColumn: match[0].length + 1, endLineNumber: lineNumber, endColumn: lineContent.length + 1 }; + if (range.endColumn > range.startColumn) { + const sectionHeader = { + range, + ...getHeaderText(lineContent.substring(match[0].length)), + shouldBeInComments: false + }; + if (sectionHeader.text || sectionHeader.hasSeparatorLine) { + regionHeaders.push(sectionHeader); + } + } + } + } + return regionHeaders; +} +function collectMarkHeaders(model, options) { + const markHeaders = []; + const endLineNumber = model.getLineCount(); + if (!options.markSectionHeaderRegex || options.markSectionHeaderRegex.trim() === "") { + return markHeaders; + } + const multiline = isMultilineRegexSource(options.markSectionHeaderRegex); + const regex = new RegExp(options.markSectionHeaderRegex, `gdm${multiline ? "s" : ""}`); + if (regExpLeadsToEndlessLoop(regex)) { + return markHeaders; + } + for (let startLine = 1; startLine <= endLineNumber; startLine += CHUNK_SIZE - MAX_SECTION_LINES) { + const endLine = Math.min(startLine + CHUNK_SIZE - 1, endLineNumber); + const lines = []; + for (let i = startLine; i <= endLine; i++) { + lines.push(model.getLineContent(i)); + } + const text = lines.join("\n"); + regex.lastIndex = 0; + let match; + while ((match = regex.exec(text)) !== null) { + const precedingText = text.substring(0, match.index); + const lineOffset = (precedingText.match(/\n/g) || []).length; + const lineNumber = startLine + lineOffset; + const matchLines = match[0].split("\n"); + const matchHeight = matchLines.length; + const matchEndLine = lineNumber + matchHeight - 1; + const lineStartIndex = precedingText.lastIndexOf("\n") + 1; + const startColumn = match.index - lineStartIndex + 1; + const lastMatchLine = matchLines[matchLines.length - 1]; + const endColumn = matchHeight === 1 ? startColumn + match[0].length : lastMatchLine.length + 1; + const range = { + startLineNumber: lineNumber, + startColumn, + endLineNumber: matchEndLine, + endColumn + }; + const text2 = (match.groups ?? {})["label"] ?? ""; + const hasSeparatorLine = ((match.groups ?? {})["separator"] ?? "") !== ""; + const sectionHeader = { + range, + text: text2, + hasSeparatorLine, + shouldBeInComments: true + }; + if (sectionHeader.text || sectionHeader.hasSeparatorLine) { + if (markHeaders.length === 0 || markHeaders[markHeaders.length - 1].range.endLineNumber < sectionHeader.range.startLineNumber) { + markHeaders.push(sectionHeader); + } + } + regex.lastIndex = match.index + match[0].length; + } + } + return markHeaders; +} +function getHeaderText(text) { + text = text.trim(); + const hasSeparatorLine = text.startsWith("-"); + text = text.replace(trimDashesRegex, ""); + return { text, hasSeparatorLine }; +} + +// node_modules/monaco-editor-core/esm/vs/base/common/async.js +var runWhenGlobalIdle; +var _runWhenIdle; +(function() { + const safeGlobal = globalThis; + if (typeof safeGlobal.requestIdleCallback !== "function" || typeof safeGlobal.cancelIdleCallback !== "function") { + _runWhenIdle = (_targetWindow, runner, timeout) => { + setTimeout0(() => { + if (disposed) { + return; + } + const end = Date.now() + 15; + const deadline = { + didTimeout: true, + timeRemaining() { + return Math.max(0, end - Date.now()); + } + }; + runner(Object.freeze(deadline)); + }); + let disposed = false; + return { + dispose() { + if (disposed) { + return; + } + disposed = true; + } + }; + }; + } else { + _runWhenIdle = (targetWindow, runner, timeout) => { + const handle = targetWindow.requestIdleCallback(runner, typeof timeout === "number" ? { timeout } : void 0); + let disposed = false; + return { + dispose() { + if (disposed) { + return; + } + disposed = true; + targetWindow.cancelIdleCallback(handle); + } + }; + }; + } + runWhenGlobalIdle = (runner, timeout) => _runWhenIdle(globalThis, runner, timeout); +})(); +var DeferredPromise = class { + get isRejected() { + return this.outcome?.outcome === 1; + } + get isSettled() { + return !!this.outcome; + } + constructor() { + this.p = new Promise((c, e) => { + this.completeCallback = c; + this.errorCallback = e; + }); + } + complete(value) { + if (this.isSettled) { + return Promise.resolve(); + } + return new Promise((resolve2) => { + this.completeCallback(value); + this.outcome = { outcome: 0, value }; + resolve2(); + }); + } + error(err) { + if (this.isSettled) { + return Promise.resolve(); + } + return new Promise((resolve2) => { + this.errorCallback(err); + this.outcome = { outcome: 1, value: err }; + resolve2(); + }); + } + cancel() { + return this.error(new CancellationError()); + } +}; +var Promises; +(function(Promises2) { + async function settled(promises) { + let firstError = void 0; + const result = await Promise.all(promises.map((promise) => promise.then((value) => value, (error) => { + if (!firstError) { + firstError = error; + } + return void 0; + }))); + if (typeof firstError !== "undefined") { + throw firstError; + } + return result; + } + Promises2.settled = settled; + function withAsyncBody(bodyFn) { + return new Promise(async (resolve2, reject) => { + try { + await bodyFn(resolve2, reject); + } catch (error) { + reject(error); + } + }); + } + Promises2.withAsyncBody = withAsyncBody; +})(Promises || (Promises = {})); +var ProducerConsumer = class { + constructor() { + this._unsatisfiedConsumers = []; + this._unconsumedValues = []; + } + get hasFinalValue() { + return !!this._finalValue; + } + produce(value) { + this._ensureNoFinalValue(); + if (this._unsatisfiedConsumers.length > 0) { + const deferred = this._unsatisfiedConsumers.shift(); + this._resolveOrRejectDeferred(deferred, value); + } else { + this._unconsumedValues.push(value); + } + } + produceFinal(value) { + this._ensureNoFinalValue(); + this._finalValue = value; + for (const deferred of this._unsatisfiedConsumers) { + this._resolveOrRejectDeferred(deferred, value); + } + this._unsatisfiedConsumers.length = 0; + } + _ensureNoFinalValue() { + if (this._finalValue) { + throw new BugIndicatingError("ProducerConsumer: cannot produce after final value has been set"); + } + } + _resolveOrRejectDeferred(deferred, value) { + if (value.ok) { + deferred.complete(value.value); + } else { + deferred.error(value.error); + } + } + consume() { + if (this._unconsumedValues.length > 0 || this._finalValue) { + const value = this._unconsumedValues.length > 0 ? this._unconsumedValues.shift() : this._finalValue; + if (value.ok) { + return Promise.resolve(value.value); + } else { + return Promise.reject(value.error); + } + } else { + const deferred = new DeferredPromise(); + this._unsatisfiedConsumers.push(deferred); + return deferred.p; + } + } +}; +var AsyncIterableProducer = class _AsyncIterableProducer { + constructor(executor, _onReturn) { + this._onReturn = _onReturn; + this._producerConsumer = new ProducerConsumer(); + this._iterator = { + next: () => this._producerConsumer.consume(), + return: () => { + this._onReturn?.(); + return Promise.resolve({ done: true, value: void 0 }); + }, + throw: async (e) => { + this._finishError(e); + return { done: true, value: void 0 }; + } + }; + queueMicrotask(async () => { + const p = executor({ + emitOne: (value) => this._producerConsumer.produce({ ok: true, value: { done: false, value } }), + emitMany: (values) => { + for (const value of values) { + this._producerConsumer.produce({ ok: true, value: { done: false, value } }); + } + }, + reject: (error) => this._finishError(error) + }); + if (!this._producerConsumer.hasFinalValue) { + try { + await p; + this._finishOk(); + } catch (error) { + this._finishError(error); + } + } + }); + } + static fromArray(items) { + return new _AsyncIterableProducer((writer) => { + writer.emitMany(items); + }); + } + static fromPromise(promise) { + return new _AsyncIterableProducer(async (emitter) => { + emitter.emitMany(await promise); + }); + } + static fromPromisesResolveOrder(promises) { + return new _AsyncIterableProducer(async (emitter) => { + await Promise.all(promises.map(async (p) => emitter.emitOne(await p))); + }); + } + static merge(iterables) { + return new _AsyncIterableProducer(async (emitter) => { + await Promise.all(iterables.map(async (iterable) => { + for await (const item of iterable) { + emitter.emitOne(item); + } + })); + }); + } + static { + this.EMPTY = _AsyncIterableProducer.fromArray([]); + } + static map(iterable, mapFn) { + return new _AsyncIterableProducer(async (emitter) => { + for await (const item of iterable) { + emitter.emitOne(mapFn(item)); + } + }); + } + map(mapFn) { + return _AsyncIterableProducer.map(this, mapFn); + } + static coalesce(iterable) { + return _AsyncIterableProducer.filter(iterable, (item) => !!item); + } + coalesce() { + return _AsyncIterableProducer.coalesce(this); + } + static filter(iterable, filterFn) { + return new _AsyncIterableProducer(async (emitter) => { + for await (const item of iterable) { + if (filterFn(item)) { + emitter.emitOne(item); + } + } + }); + } + filter(filterFn) { + return _AsyncIterableProducer.filter(this, filterFn); + } + _finishOk() { + if (!this._producerConsumer.hasFinalValue) { + this._producerConsumer.produceFinal({ ok: true, value: { done: true, value: void 0 } }); + } + } + _finishError(error) { + if (!this._producerConsumer.hasFinalValue) { + this._producerConsumer.produceFinal({ ok: false, error }); + } + } + [Symbol.asyncIterator]() { + return this._iterator; + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/common/model/prefixSumComputer.js +var PrefixSumComputer = class { + constructor(values) { + this.values = values; + this.prefixSum = new Uint32Array(values.length); + this.prefixSumValidIndex = new Int32Array(1); + this.prefixSumValidIndex[0] = -1; + } + insertValues(insertIndex, insertValues) { + insertIndex = toUint32(insertIndex); + const oldValues = this.values; + const oldPrefixSum = this.prefixSum; + const insertValuesLen = insertValues.length; + if (insertValuesLen === 0) { + return false; + } + this.values = new Uint32Array(oldValues.length + insertValuesLen); + this.values.set(oldValues.subarray(0, insertIndex), 0); + this.values.set(oldValues.subarray(insertIndex), insertIndex + insertValuesLen); + this.values.set(insertValues, insertIndex); + if (insertIndex - 1 < this.prefixSumValidIndex[0]) { + this.prefixSumValidIndex[0] = insertIndex - 1; + } + this.prefixSum = new Uint32Array(this.values.length); + if (this.prefixSumValidIndex[0] >= 0) { + this.prefixSum.set(oldPrefixSum.subarray(0, this.prefixSumValidIndex[0] + 1)); + } + return true; + } + setValue(index, value) { + index = toUint32(index); + value = toUint32(value); + if (this.values[index] === value) { + return false; + } + this.values[index] = value; + if (index - 1 < this.prefixSumValidIndex[0]) { + this.prefixSumValidIndex[0] = index - 1; + } + return true; + } + removeValues(startIndex, count) { + startIndex = toUint32(startIndex); + count = toUint32(count); + const oldValues = this.values; + const oldPrefixSum = this.prefixSum; + if (startIndex >= oldValues.length) { + return false; + } + const maxCount = oldValues.length - startIndex; + if (count >= maxCount) { + count = maxCount; + } + if (count === 0) { + return false; + } + this.values = new Uint32Array(oldValues.length - count); + this.values.set(oldValues.subarray(0, startIndex), 0); + this.values.set(oldValues.subarray(startIndex + count), startIndex); + this.prefixSum = new Uint32Array(this.values.length); + if (startIndex - 1 < this.prefixSumValidIndex[0]) { + this.prefixSumValidIndex[0] = startIndex - 1; + } + if (this.prefixSumValidIndex[0] >= 0) { + this.prefixSum.set(oldPrefixSum.subarray(0, this.prefixSumValidIndex[0] + 1)); + } + return true; + } + getTotalSum() { + if (this.values.length === 0) { + return 0; + } + return this._getPrefixSum(this.values.length - 1); + } + /** + * Returns the sum of the first `index + 1` many items. + * @returns `SUM(0 <= j <= index, values[j])`. + */ + getPrefixSum(index) { + if (index < 0) { + return 0; + } + index = toUint32(index); + return this._getPrefixSum(index); + } + _getPrefixSum(index) { + if (index <= this.prefixSumValidIndex[0]) { + return this.prefixSum[index]; + } + let startIndex = this.prefixSumValidIndex[0] + 1; + if (startIndex === 0) { + this.prefixSum[0] = this.values[0]; + startIndex++; + } + if (index >= this.values.length) { + index = this.values.length - 1; + } + for (let i = startIndex; i <= index; i++) { + this.prefixSum[i] = this.prefixSum[i - 1] + this.values[i]; + } + this.prefixSumValidIndex[0] = Math.max(this.prefixSumValidIndex[0], index); + return this.prefixSum[index]; + } + getIndexOf(sum) { + sum = Math.floor(sum); + this.getTotalSum(); + let low = 0; + let high = this.values.length - 1; + let mid = 0; + let midStop = 0; + let midStart = 0; + while (low <= high) { + mid = low + (high - low) / 2 | 0; + midStop = this.prefixSum[mid]; + midStart = midStop - this.values[mid]; + if (sum < midStart) { + high = mid - 1; + } else if (sum >= midStop) { + low = mid + 1; + } else { + break; + } + } + return new PrefixSumIndexOfResult(mid, sum - midStart); + } +}; +var PrefixSumIndexOfResult = class { + constructor(index, remainder) { + this.index = index; + this.remainder = remainder; + this._prefixSumIndexOfResultBrand = void 0; + this.index = index; + this.remainder = remainder; + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/common/model/mirrorTextModel.js +var MirrorTextModel = class { + constructor(uri, lines, eol, versionId) { + this._uri = uri; + this._lines = lines; + this._eol = eol; + this._versionId = versionId; + this._lineStarts = null; + this._cachedTextValue = null; + } + dispose() { + this._lines.length = 0; + } + get version() { + return this._versionId; + } + getText() { + if (this._cachedTextValue === null) { + this._cachedTextValue = this._lines.join(this._eol); + } + return this._cachedTextValue; + } + onEvents(e) { + if (e.eol && e.eol !== this._eol) { + this._eol = e.eol; + this._lineStarts = null; + } + const changes = e.changes; + for (const change of changes) { + this._acceptDeleteRange(change.range); + this._acceptInsertText(new Position(change.range.startLineNumber, change.range.startColumn), change.text); + } + this._versionId = e.versionId; + this._cachedTextValue = null; + } + _ensureLineStarts() { + if (!this._lineStarts) { + const eolLength = this._eol.length; + const linesLength = this._lines.length; + const lineStartValues = new Uint32Array(linesLength); + for (let i = 0; i < linesLength; i++) { + lineStartValues[i] = this._lines[i].length + eolLength; + } + this._lineStarts = new PrefixSumComputer(lineStartValues); + } + } + /** + * All changes to a line's text go through this method + */ + _setLineText(lineIndex, newValue) { + this._lines[lineIndex] = newValue; + if (this._lineStarts) { + this._lineStarts.setValue(lineIndex, this._lines[lineIndex].length + this._eol.length); + } + } + _acceptDeleteRange(range) { + if (range.startLineNumber === range.endLineNumber) { + if (range.startColumn === range.endColumn) { + return; + } + this._setLineText(range.startLineNumber - 1, this._lines[range.startLineNumber - 1].substring(0, range.startColumn - 1) + this._lines[range.startLineNumber - 1].substring(range.endColumn - 1)); + return; + } + this._setLineText(range.startLineNumber - 1, this._lines[range.startLineNumber - 1].substring(0, range.startColumn - 1) + this._lines[range.endLineNumber - 1].substring(range.endColumn - 1)); + this._lines.splice(range.startLineNumber, range.endLineNumber - range.startLineNumber); + if (this._lineStarts) { + this._lineStarts.removeValues(range.startLineNumber, range.endLineNumber - range.startLineNumber); + } + } + _acceptInsertText(position, insertText) { + if (insertText.length === 0) { + return; + } + const insertLines = splitLines(insertText); + if (insertLines.length === 1) { + this._setLineText(position.lineNumber - 1, this._lines[position.lineNumber - 1].substring(0, position.column - 1) + insertLines[0] + this._lines[position.lineNumber - 1].substring(position.column - 1)); + return; + } + insertLines[insertLines.length - 1] += this._lines[position.lineNumber - 1].substring(position.column - 1); + this._setLineText(position.lineNumber - 1, this._lines[position.lineNumber - 1].substring(0, position.column - 1) + insertLines[0]); + const newLengths = new Uint32Array(insertLines.length - 1); + for (let i = 1; i < insertLines.length; i++) { + this._lines.splice(position.lineNumber + i - 1, 0, insertLines[i]); + newLengths[i - 1] = insertLines[i].length + this._eol.length; + } + if (this._lineStarts) { + this._lineStarts.insertValues(position.lineNumber, newLengths); + } + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/common/services/textModelSync/textModelSync.impl.js +var STOP_SYNC_MODEL_DELTA_TIME_MS = 60 * 1e3; +var WorkerTextModelSyncServer = class { + constructor() { + this._models = /* @__PURE__ */ Object.create(null); + } + getModel(uri) { + return this._models[uri]; + } + getModels() { + const all = []; + Object.keys(this._models).forEach((key) => all.push(this._models[key])); + return all; + } + $acceptNewModel(data) { + this._models[data.url] = new MirrorModel(URI.parse(data.url), data.lines, data.EOL, data.versionId); + } + $acceptModelChanged(uri, e) { + if (!this._models[uri]) { + return; + } + const model = this._models[uri]; + model.onEvents(e); + } + $acceptRemovedModel(uri) { + if (!this._models[uri]) { + return; + } + delete this._models[uri]; + } +}; +var MirrorModel = class extends MirrorTextModel { + get uri() { + return this._uri; + } + get eol() { + return this._eol; + } + getValue() { + return this.getText(); + } + findMatches(regex) { + const matches = []; + for (let i = 0; i < this._lines.length; i++) { + const line = this._lines[i]; + const offsetToAdd = this.offsetAt(new Position(i + 1, 1)); + const iteratorOverMatches = line.matchAll(regex); + for (const match of iteratorOverMatches) { + if (match.index || match.index === 0) { + match.index = match.index + offsetToAdd; + } + matches.push(match); + } + } + return matches; + } + getLinesContent() { + return this._lines.slice(0); + } + getLineCount() { + return this._lines.length; + } + getLineContent(lineNumber) { + return this._lines[lineNumber - 1]; + } + getWordAtPosition(position, wordDefinition) { + const wordAtText = getWordAtText(position.column, ensureValidWordDefinition(wordDefinition), this._lines[position.lineNumber - 1], 0); + if (wordAtText) { + return new Range(position.lineNumber, wordAtText.startColumn, position.lineNumber, wordAtText.endColumn); + } + return null; + } + words(wordDefinition) { + const lines = this._lines; + const wordenize = this._wordenize.bind(this); + let lineNumber = 0; + let lineText = ""; + let wordRangesIdx = 0; + let wordRanges = []; + return { + *[Symbol.iterator]() { + while (true) { + if (wordRangesIdx < wordRanges.length) { + const value = lineText.substring(wordRanges[wordRangesIdx].start, wordRanges[wordRangesIdx].end); + wordRangesIdx += 1; + yield value; + } else { + if (lineNumber < lines.length) { + lineText = lines[lineNumber]; + wordRanges = wordenize(lineText, wordDefinition); + wordRangesIdx = 0; + lineNumber += 1; + } else { + break; + } + } + } + } + }; + } + getLineWords(lineNumber, wordDefinition) { + const content = this._lines[lineNumber - 1]; + const ranges = this._wordenize(content, wordDefinition); + const words = []; + for (const range of ranges) { + words.push({ + word: content.substring(range.start, range.end), + startColumn: range.start + 1, + endColumn: range.end + 1 + }); + } + return words; + } + _wordenize(content, wordDefinition) { + const result = []; + let match; + wordDefinition.lastIndex = 0; + while (match = wordDefinition.exec(content)) { + if (match[0].length === 0) { + break; + } + result.push({ start: match.index, end: match.index + match[0].length }); + } + return result; + } + getValueInRange(range) { + range = this._validateRange(range); + if (range.startLineNumber === range.endLineNumber) { + return this._lines[range.startLineNumber - 1].substring(range.startColumn - 1, range.endColumn - 1); + } + const lineEnding = this._eol; + const startLineIndex = range.startLineNumber - 1; + const endLineIndex = range.endLineNumber - 1; + const resultLines = []; + resultLines.push(this._lines[startLineIndex].substring(range.startColumn - 1)); + for (let i = startLineIndex + 1; i < endLineIndex; i++) { + resultLines.push(this._lines[i]); + } + resultLines.push(this._lines[endLineIndex].substring(0, range.endColumn - 1)); + return resultLines.join(lineEnding); + } + offsetAt(position) { + position = this._validatePosition(position); + this._ensureLineStarts(); + return this._lineStarts.getPrefixSum(position.lineNumber - 2) + (position.column - 1); + } + positionAt(offset) { + offset = Math.floor(offset); + offset = Math.max(0, offset); + this._ensureLineStarts(); + const out = this._lineStarts.getIndexOf(offset); + const lineLength = this._lines[out.index].length; + return { + lineNumber: 1 + out.index, + column: 1 + Math.min(out.remainder, lineLength) + }; + } + _validateRange(range) { + const start2 = this._validatePosition({ lineNumber: range.startLineNumber, column: range.startColumn }); + const end = this._validatePosition({ lineNumber: range.endLineNumber, column: range.endColumn }); + if (start2.lineNumber !== range.startLineNumber || start2.column !== range.startColumn || end.lineNumber !== range.endLineNumber || end.column !== range.endColumn) { + return { + startLineNumber: start2.lineNumber, + startColumn: start2.column, + endLineNumber: end.lineNumber, + endColumn: end.column + }; + } + return range; + } + _validatePosition(position) { + if (!Position.isIPosition(position)) { + throw new Error("bad position"); + } + let { lineNumber, column } = position; + let hasChanged = false; + if (lineNumber < 1) { + lineNumber = 1; + column = 1; + hasChanged = true; + } else if (lineNumber > this._lines.length) { + lineNumber = this._lines.length; + column = this._lines[lineNumber - 1].length + 1; + hasChanged = true; + } else { + const maxCharacter = this._lines[lineNumber - 1].length + 1; + if (column < 1) { + column = 1; + hasChanged = true; + } else if (column > maxCharacter) { + column = maxCharacter; + hasChanged = true; + } + } + if (!hasChanged) { + return position; + } else { + return { lineNumber, column }; + } + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/common/services/editorWebWorker.js +var EditorWorker = class _EditorWorker { + constructor(_foreignModule = null) { + this._foreignModule = _foreignModule; + this._requestHandlerBrand = void 0; + this._workerTextModelSyncServer = new WorkerTextModelSyncServer(); + } + dispose() { + } + async $ping() { + return "pong"; + } + _getModel(uri) { + return this._workerTextModelSyncServer.getModel(uri); + } + getModels() { + return this._workerTextModelSyncServer.getModels(); + } + $acceptNewModel(data) { + this._workerTextModelSyncServer.$acceptNewModel(data); + } + $acceptModelChanged(uri, e) { + this._workerTextModelSyncServer.$acceptModelChanged(uri, e); + } + $acceptRemovedModel(uri) { + this._workerTextModelSyncServer.$acceptRemovedModel(uri); + } + async $computeUnicodeHighlights(url, options, range) { + const model = this._getModel(url); + if (!model) { + return { ranges: [], hasMore: false, ambiguousCharacterCount: 0, invisibleCharacterCount: 0, nonBasicAsciiCharacterCount: 0 }; + } + return UnicodeTextModelHighlighter.computeUnicodeHighlights(model, options, range); + } + async $findSectionHeaders(url, options) { + const model = this._getModel(url); + if (!model) { + return []; + } + return findSectionHeaders(model, options); + } + // ---- BEGIN diff -------------------------------------------------------------------------- + async $computeDiff(originalUrl, modifiedUrl, options, algorithm) { + const original = this._getModel(originalUrl); + const modified = this._getModel(modifiedUrl); + if (!original || !modified) { + return null; + } + const result = _EditorWorker.computeDiff(original, modified, options, algorithm); + return result; + } + static computeDiff(originalTextModel, modifiedTextModel, options, algorithm) { + const diffAlgorithm = algorithm === "advanced" ? linesDiffComputers.getDefault() : linesDiffComputers.getLegacy(); + const originalLines = originalTextModel.getLinesContent(); + const modifiedLines = modifiedTextModel.getLinesContent(); + const result = diffAlgorithm.computeDiff(originalLines, modifiedLines, options); + const identical = result.changes.length > 0 ? false : this._modelsAreIdentical(originalTextModel, modifiedTextModel); + function getLineChanges(changes) { + return changes.map((m) => [m.original.startLineNumber, m.original.endLineNumberExclusive, m.modified.startLineNumber, m.modified.endLineNumberExclusive, m.innerChanges?.map((m2) => [ + m2.originalRange.startLineNumber, + m2.originalRange.startColumn, + m2.originalRange.endLineNumber, + m2.originalRange.endColumn, + m2.modifiedRange.startLineNumber, + m2.modifiedRange.startColumn, + m2.modifiedRange.endLineNumber, + m2.modifiedRange.endColumn + ])]); + } + return { + identical, + quitEarly: result.hitTimeout, + changes: getLineChanges(result.changes), + moves: result.moves.map((m) => [ + m.lineRangeMapping.original.startLineNumber, + m.lineRangeMapping.original.endLineNumberExclusive, + m.lineRangeMapping.modified.startLineNumber, + m.lineRangeMapping.modified.endLineNumberExclusive, + getLineChanges(m.changes) + ]) + }; + } + static _modelsAreIdentical(original, modified) { + const originalLineCount = original.getLineCount(); + const modifiedLineCount = modified.getLineCount(); + if (originalLineCount !== modifiedLineCount) { + return false; + } + for (let line = 1; line <= originalLineCount; line++) { + const originalLine = original.getLineContent(line); + const modifiedLine = modified.getLineContent(line); + if (originalLine !== modifiedLine) { + return false; + } + } + return true; + } + static { + this._diffLimit = 1e5; + } + async $computeMoreMinimalEdits(modelUrl, edits, pretty) { + const model = this._getModel(modelUrl); + if (!model) { + return edits; + } + const result = []; + let lastEol = void 0; + edits = edits.slice(0).sort((a, b) => { + if (a.range && b.range) { + return Range.compareRangesUsingStarts(a.range, b.range); + } + const aRng = a.range ? 0 : 1; + const bRng = b.range ? 0 : 1; + return aRng - bRng; + }); + let writeIndex = 0; + for (let readIndex = 1; readIndex < edits.length; readIndex++) { + if (Range.getEndPosition(edits[writeIndex].range).equals(Range.getStartPosition(edits[readIndex].range))) { + edits[writeIndex].range = Range.fromPositions(Range.getStartPosition(edits[writeIndex].range), Range.getEndPosition(edits[readIndex].range)); + edits[writeIndex].text += edits[readIndex].text; + } else { + writeIndex++; + edits[writeIndex] = edits[readIndex]; + } + } + edits.length = writeIndex + 1; + for (let { range, text, eol } of edits) { + if (typeof eol === "number") { + lastEol = eol; + } + if (Range.isEmpty(range) && !text) { + continue; + } + const original = model.getValueInRange(range); + text = text.replace(/\r\n|\n|\r/g, model.eol); + if (original === text) { + continue; + } + if (Math.max(text.length, original.length) > _EditorWorker._diffLimit) { + result.push({ range, text }); + continue; + } + const changes = stringDiff(original, text, pretty); + const editOffset = model.offsetAt(Range.lift(range).getStartPosition()); + for (const change of changes) { + const start2 = model.positionAt(editOffset + change.originalStart); + const end = model.positionAt(editOffset + change.originalStart + change.originalLength); + const newEdit = { + text: text.substr(change.modifiedStart, change.modifiedLength), + range: { startLineNumber: start2.lineNumber, startColumn: start2.column, endLineNumber: end.lineNumber, endColumn: end.column } + }; + if (model.getValueInRange(newEdit.range) !== newEdit.text) { + result.push(newEdit); + } + } + } + if (typeof lastEol === "number") { + result.push({ eol: lastEol, text: "", range: { startLineNumber: 0, startColumn: 0, endLineNumber: 0, endColumn: 0 } }); + } + return result; + } + // ---- END minimal edits --------------------------------------------------------------- + async $computeLinks(modelUrl) { + const model = this._getModel(modelUrl); + if (!model) { + return null; + } + return computeLinks(model); + } + // --- BEGIN default document colors ----------------------------------------------------------- + async $computeDefaultDocumentColors(modelUrl) { + const model = this._getModel(modelUrl); + if (!model) { + return null; + } + return computeDefaultDocumentColors(model); + } + static { + this._suggestionsLimit = 1e4; + } + async $textualSuggest(modelUrls, leadingWord, wordDef, wordDefFlags) { + const sw = new StopWatch(); + const wordDefRegExp = new RegExp(wordDef, wordDefFlags); + const seen = /* @__PURE__ */ new Set(); + outer: for (const url of modelUrls) { + const model = this._getModel(url); + if (!model) { + continue; + } + for (const word of model.words(wordDefRegExp)) { + if (word === leadingWord || !isNaN(Number(word))) { + continue; + } + seen.add(word); + if (seen.size > _EditorWorker._suggestionsLimit) { + break outer; + } + } + } + return { words: Array.from(seen), duration: sw.elapsed() }; + } + // ---- END suggest -------------------------------------------------------------------------- + //#region -- word ranges -- + async $computeWordRanges(modelUrl, range, wordDef, wordDefFlags) { + const model = this._getModel(modelUrl); + if (!model) { + return /* @__PURE__ */ Object.create(null); + } + const wordDefRegExp = new RegExp(wordDef, wordDefFlags); + const result = /* @__PURE__ */ Object.create(null); + for (let line = range.startLineNumber; line < range.endLineNumber; line++) { + const words = model.getLineWords(line, wordDefRegExp); + for (const word of words) { + if (!isNaN(Number(word.word))) { + continue; + } + let array = result[word.word]; + if (!array) { + array = []; + result[word.word] = array; + } + array.push({ + startLineNumber: line, + startColumn: word.startColumn, + endLineNumber: line, + endColumn: word.endColumn + }); + } + } + return result; + } + //#endregion + async $navigateValueSet(modelUrl, range, up, wordDef, wordDefFlags) { + const model = this._getModel(modelUrl); + if (!model) { + return null; + } + const wordDefRegExp = new RegExp(wordDef, wordDefFlags); + if (range.startColumn === range.endColumn) { + range = { + startLineNumber: range.startLineNumber, + startColumn: range.startColumn, + endLineNumber: range.endLineNumber, + endColumn: range.endColumn + 1 + }; + } + const selectionText = model.getValueInRange(range); + const wordRange = model.getWordAtPosition({ lineNumber: range.startLineNumber, column: range.startColumn }, wordDefRegExp); + if (!wordRange) { + return null; + } + const word = model.getValueInRange(wordRange); + const result = BasicInplaceReplace.INSTANCE.navigateValueSet(range, selectionText, wordRange, word, up); + return result; + } + // ---- BEGIN foreign module support -------------------------------------------------------------------------- + // foreign method request + $fmr(method, args) { + if (!this._foreignModule || typeof this._foreignModule[method] !== "function") { + return Promise.reject(new Error("Missing requestHandler or method: " + method)); + } + try { + return Promise.resolve(this._foreignModule[method].apply(this._foreignModule, args)); + } catch (e) { + return Promise.reject(e); + } + } +}; +if (typeof importScripts === "function") { + globalThis.monaco = createMonacoBaseAPI(); +} + +// node_modules/monaco-editor-core/esm/vs/editor/common/services/editorWorkerHost.js +var EditorWorkerHost = class _EditorWorkerHost { + static { + this.CHANNEL_NAME = "editorWorkerHost"; + } + static getChannel(workerServer) { + return workerServer.getChannel(_EditorWorkerHost.CHANNEL_NAME); + } + static setChannel(workerClient, obj) { + workerClient.setChannel(_EditorWorkerHost.CHANNEL_NAME, obj); + } +}; + +// node_modules/monaco-editor-core/esm/vs/editor/editor.worker.start.js +function start(createClient) { + let client; + const webWorkerServer = initialize((workerServer) => { + const editorWorkerHost = EditorWorkerHost.getChannel(workerServer); + const host = new Proxy({}, { + get(target, prop, receiver) { + if (prop === "then") { + return void 0; + } + if (typeof prop !== "string") { + throw new Error(`Not supported`); + } + return (...args) => { + return editorWorkerHost.$fhr(prop, args); + }; + } + }); + const ctx = { + host, + getMirrorModels: () => { + return webWorkerServer.requestHandler.getModels(); + } + }; + client = createClient(ctx); + return new EditorWorker(client); + }); + return client; +} + +// src/editor-worker.ts +function initializeWorker(Worker) { + self.onmessage = (msg) => { + start((ctx) => new Worker(ctx, msg.data)); + }; +} +export { + initializeWorker, + start +}; diff --git a/web/public/hoisted-modern-monaco/modern-monaco/hoist-manifest.json b/web/public/hoisted-modern-monaco/modern-monaco/hoist-manifest.json new file mode 100644 index 0000000000..8ff8b187e2 --- /dev/null +++ b/web/public/hoisted-modern-monaco/modern-monaco/hoist-manifest.json @@ -0,0 +1,23 @@ +{ + "generatedAt": "2026-03-17T02:53:27.971Z", + "modernMonacoVersion": "0.4.0", + "tmGrammarsVersion": "1.31.2", + "tmThemesVersion": "1.12.1", + "typescriptVersion": "5.9.3", + "localTypeScriptPath": "/hoisted-modern-monaco/typescript@5.9.3/es2022/typescript.mjs", + "themes": [ + "light-plus", + "dark-plus" + ], + "languages": [ + "javascript", + "json", + "python", + "html", + "css" + ], + "importMap": { + "modern-monaco/editor-core": "/hoisted-modern-monaco/modern-monaco/editor-core.mjs", + "modern-monaco/lsp": "/hoisted-modern-monaco/modern-monaco/lsp/index.mjs" + } +} diff --git a/web/public/hoisted-modern-monaco/modern-monaco/index.mjs b/web/public/hoisted-modern-monaco/modern-monaco/index.mjs new file mode 100644 index 0000000000..f5edb9d8b1 --- /dev/null +++ b/web/public/hoisted-modern-monaco/modern-monaco/index.mjs @@ -0,0 +1,29339 @@ +// node_modules/tm-themes/themes/vitesse-dark.json +var vitesse_dark_default = { + colors: { + "activityBar.activeBorder": "#4d9375", + "activityBar.background": "#121212", + "activityBar.border": "#191919", + "activityBar.foreground": "#dbd7caee", + "activityBar.inactiveForeground": "#dedcd550", + "activityBarBadge.background": "#bfbaaa", + "activityBarBadge.foreground": "#121212", + "badge.background": "#dedcd590", + "badge.foreground": "#121212", + "breadcrumb.activeSelectionForeground": "#eeeeee18", + "breadcrumb.background": "#181818", + "breadcrumb.focusForeground": "#dbd7caee", + "breadcrumb.foreground": "#959da5", + "breadcrumbPicker.background": "#121212", + "button.background": "#4d9375", + "button.foreground": "#121212", + "button.hoverBackground": "#4d9375", + "checkbox.background": "#181818", + "checkbox.border": "#2f363d", + "debugToolBar.background": "#121212", + descriptionForeground: "#dedcd590", + "diffEditor.insertedTextBackground": "#4d937550", + "diffEditor.removedTextBackground": "#ab595950", + "dropdown.background": "#121212", + "dropdown.border": "#191919", + "dropdown.foreground": "#dbd7caee", + "dropdown.listBackground": "#181818", + "editor.background": "#121212", + "editor.findMatchBackground": "#e6cc7722", + "editor.findMatchHighlightBackground": "#e6cc7744", + "editor.focusedStackFrameHighlightBackground": "#b808", + "editor.foldBackground": "#eeeeee10", + "editor.foreground": "#dbd7caee", + "editor.inactiveSelectionBackground": "#eeeeee10", + "editor.lineHighlightBackground": "#181818", + "editor.selectionBackground": "#eeeeee18", + "editor.selectionHighlightBackground": "#eeeeee10", + "editor.stackFrameHighlightBackground": "#a707", + "editor.wordHighlightBackground": "#1c6b4805", + "editor.wordHighlightStrongBackground": "#1c6b4810", + "editorBracketHighlight.foreground1": "#5eaab5", + "editorBracketHighlight.foreground2": "#4d9375", + "editorBracketHighlight.foreground3": "#d4976c", + "editorBracketHighlight.foreground4": "#d9739f", + "editorBracketHighlight.foreground5": "#e6cc77", + "editorBracketHighlight.foreground6": "#6394bf", + "editorBracketMatch.background": "#4d937520", + "editorError.foreground": "#cb7676", + "editorGroup.border": "#191919", + "editorGroupHeader.tabsBackground": "#121212", + "editorGroupHeader.tabsBorder": "#191919", + "editorGutter.addedBackground": "#4d9375", + "editorGutter.commentRangeForeground": "#dedcd550", + "editorGutter.deletedBackground": "#cb7676", + "editorGutter.foldingControlForeground": "#dedcd590", + "editorGutter.modifiedBackground": "#6394bf", + "editorHint.foreground": "#4d9375", + "editorIndentGuide.activeBackground": "#ffffff30", + "editorIndentGuide.background": "#ffffff15", + "editorInfo.foreground": "#6394bf", + "editorInlayHint.background": "#181818", + "editorInlayHint.foreground": "#666666", + "editorLineNumber.activeForeground": "#bfbaaa", + "editorLineNumber.foreground": "#dedcd550", + "editorOverviewRuler.border": "#111", + "editorStickyScroll.background": "#181818", + "editorStickyScrollHover.background": "#181818", + "editorWarning.foreground": "#d4976c", + "editorWhitespace.foreground": "#ffffff15", + "editorWidget.background": "#121212", + errorForeground: "#cb7676", + focusBorder: "#00000000", + foreground: "#dbd7caee", + "gitDecoration.addedResourceForeground": "#4d9375", + "gitDecoration.conflictingResourceForeground": "#d4976c", + "gitDecoration.deletedResourceForeground": "#cb7676", + "gitDecoration.ignoredResourceForeground": "#dedcd550", + "gitDecoration.modifiedResourceForeground": "#6394bf", + "gitDecoration.submoduleResourceForeground": "#dedcd590", + "gitDecoration.untrackedResourceForeground": "#5eaab5", + "input.background": "#181818", + "input.border": "#191919", + "input.foreground": "#dbd7caee", + "input.placeholderForeground": "#dedcd590", + "inputOption.activeBackground": "#dedcd550", + "list.activeSelectionBackground": "#181818", + "list.activeSelectionForeground": "#dbd7caee", + "list.focusBackground": "#181818", + "list.highlightForeground": "#4d9375", + "list.hoverBackground": "#181818", + "list.hoverForeground": "#dbd7caee", + "list.inactiveFocusBackground": "#121212", + "list.inactiveSelectionBackground": "#181818", + "list.inactiveSelectionForeground": "#dbd7caee", + "menu.separatorBackground": "#191919", + "notificationCenterHeader.background": "#121212", + "notificationCenterHeader.foreground": "#959da5", + "notifications.background": "#121212", + "notifications.border": "#191919", + "notifications.foreground": "#dbd7caee", + "notificationsErrorIcon.foreground": "#cb7676", + "notificationsInfoIcon.foreground": "#6394bf", + "notificationsWarningIcon.foreground": "#d4976c", + "panel.background": "#121212", + "panel.border": "#191919", + "panelInput.border": "#2f363d", + "panelTitle.activeBorder": "#4d9375", + "panelTitle.activeForeground": "#dbd7caee", + "panelTitle.inactiveForeground": "#959da5", + "peekViewEditor.background": "#121212", + "peekViewEditor.matchHighlightBackground": "#ffd33d33", + "peekViewResult.background": "#121212", + "peekViewResult.matchHighlightBackground": "#ffd33d33", + "pickerGroup.border": "#191919", + "pickerGroup.foreground": "#dbd7caee", + "problemsErrorIcon.foreground": "#cb7676", + "problemsInfoIcon.foreground": "#6394bf", + "problemsWarningIcon.foreground": "#d4976c", + "progressBar.background": "#4d9375", + "quickInput.background": "#121212", + "quickInput.foreground": "#dbd7caee", + "quickInputList.focusBackground": "#181818", + "scrollbar.shadow": "#0000", + "scrollbarSlider.activeBackground": "#dedcd550", + "scrollbarSlider.background": "#dedcd510", + "scrollbarSlider.hoverBackground": "#dedcd550", + "settings.headerForeground": "#dbd7caee", + "settings.modifiedItemIndicator": "#4d9375", + "sideBar.background": "#121212", + "sideBar.border": "#191919", + "sideBar.foreground": "#bfbaaa", + "sideBarSectionHeader.background": "#121212", + "sideBarSectionHeader.border": "#191919", + "sideBarSectionHeader.foreground": "#dbd7caee", + "sideBarTitle.foreground": "#dbd7caee", + "statusBar.background": "#121212", + "statusBar.border": "#191919", + "statusBar.debuggingBackground": "#181818", + "statusBar.debuggingForeground": "#bfbaaa", + "statusBar.foreground": "#bfbaaa", + "statusBar.noFolderBackground": "#121212", + "statusBarItem.prominentBackground": "#181818", + "tab.activeBackground": "#121212", + "tab.activeBorder": "#191919", + "tab.activeBorderTop": "#dedcd590", + "tab.activeForeground": "#dbd7caee", + "tab.border": "#191919", + "tab.hoverBackground": "#181818", + "tab.inactiveBackground": "#121212", + "tab.inactiveForeground": "#959da5", + "tab.unfocusedActiveBorder": "#191919", + "tab.unfocusedActiveBorderTop": "#191919", + "tab.unfocusedHoverBackground": "#121212", + "terminal.ansiBlack": "#393a34", + "terminal.ansiBlue": "#6394bf", + "terminal.ansiBrightBlack": "#777777", + "terminal.ansiBrightBlue": "#6394bf", + "terminal.ansiBrightCyan": "#5eaab5", + "terminal.ansiBrightGreen": "#4d9375", + "terminal.ansiBrightMagenta": "#d9739f", + "terminal.ansiBrightRed": "#cb7676", + "terminal.ansiBrightWhite": "#ffffff", + "terminal.ansiBrightYellow": "#e6cc77", + "terminal.ansiCyan": "#5eaab5", + "terminal.ansiGreen": "#4d9375", + "terminal.ansiMagenta": "#d9739f", + "terminal.ansiRed": "#cb7676", + "terminal.ansiWhite": "#dbd7ca", + "terminal.ansiYellow": "#e6cc77", + "terminal.foreground": "#dbd7caee", + "terminal.selectionBackground": "#eeeeee18", + "textBlockQuote.background": "#121212", + "textBlockQuote.border": "#191919", + "textCodeBlock.background": "#121212", + "textLink.activeForeground": "#4d9375", + "textLink.foreground": "#4d9375", + "textPreformat.foreground": "#d1d5da", + "textSeparator.foreground": "#586069", + "titleBar.activeBackground": "#121212", + "titleBar.activeForeground": "#bfbaaa", + "titleBar.border": "#181818", + "titleBar.inactiveBackground": "#121212", + "titleBar.inactiveForeground": "#959da5", + "tree.indentGuidesStroke": "#2f363d", + "welcomePage.buttonBackground": "#2f363d", + "welcomePage.buttonHoverBackground": "#444d56" + }, + displayName: "Vitesse Dark", + name: "vitesse-dark", + semanticHighlighting: true, + semanticTokenColors: { + class: "#6872ab", + interface: "#5d99a9", + namespace: "#db889a", + property: "#b8a965", + type: "#5d99a9" + }, + tokenColors: [ + { + scope: [ + "comment", + "punctuation.definition.comment", + "string.comment" + ], + settings: { + foreground: "#758575dd" + } + }, + { + scope: [ + "delimiter.bracket", + "delimiter", + "invalid.illegal.character-not-allowed-here.html", + "keyword.operator.rest", + "keyword.operator.spread", + "keyword.operator.type.annotation", + "keyword.operator.relational", + "keyword.operator.assignment", + "keyword.operator.type", + "meta.brace", + "meta.tag.block.any.html", + "meta.tag.inline.any.html", + "meta.tag.structure.input.void.html", + "meta.type.annotation", + "meta.embedded.block.github-actions-expression", + "storage.type.function.arrow", + "meta.objectliteral.ts", + "punctuation", + "punctuation.definition.string.begin.html.vue", + "punctuation.definition.string.end.html.vue" + ], + settings: { + foreground: "#666666" + } + }, + { + scope: [ + "constant", + "entity.name.constant", + "variable.language", + "meta.definition.variable" + ], + settings: { + foreground: "#c99076" + } + }, + { + scope: [ + "entity", + "entity.name" + ], + settings: { + foreground: "#80a665" + } + }, + { + scope: "variable.parameter.function", + settings: { + foreground: "#dbd7caee" + } + }, + { + scope: [ + "entity.name.tag", + "tag.html" + ], + settings: { + foreground: "#4d9375" + } + }, + { + scope: "entity.name.function", + settings: { + foreground: "#80a665" + } + }, + { + scope: [ + "keyword", + "storage.type.class.jsdoc", + "punctuation.definition.template-expression" + ], + settings: { + foreground: "#4d9375" + } + }, + { + scope: [ + "storage", + "storage.type", + "support.type.builtin", + "constant.language.undefined", + "constant.language.null", + "constant.language.import-export-all.ts" + ], + settings: { + foreground: "#cb7676" + } + }, + { + scope: [ + "text.html.derivative", + "storage.modifier.package", + "storage.modifier.import", + "storage.type.java" + ], + settings: { + foreground: "#dbd7caee" + } + }, + { + scope: [ + "string", + "string punctuation.section.embedded source", + "attribute.value" + ], + settings: { + foreground: "#c98a7d" + } + }, + { + scope: [ + "punctuation.definition.string" + ], + settings: { + foreground: "#c98a7d77" + } + }, + { + scope: [ + "punctuation.support.type.property-name" + ], + settings: { + foreground: "#b8a96577" + } + }, + { + scope: "support", + settings: { + foreground: "#b8a965" + } + }, + { + scope: [ + "property", + "meta.property-name", + "meta.object-literal.key", + "entity.name.tag.yaml", + "attribute.name" + ], + settings: { + foreground: "#b8a965" + } + }, + { + scope: [ + "entity.other.attribute-name", + "invalid.deprecated.entity.other.attribute-name.html" + ], + settings: { + foreground: "#bd976a" + } + }, + { + scope: [ + "variable", + "identifier" + ], + settings: { + foreground: "#bd976a" + } + }, + { + scope: [ + "support.type.primitive", + "entity.name.type" + ], + settings: { + foreground: "#5DA994" + } + }, + { + scope: "namespace", + settings: { + foreground: "#db889a" + } + }, + { + scope: [ + "keyword.operator", + "keyword.operator.assignment.compound", + "meta.var.expr.ts" + ], + settings: { + foreground: "#cb7676" + } + }, + { + scope: "invalid.broken", + settings: { + fontStyle: "italic", + foreground: "#fdaeb7" + } + }, + { + scope: "invalid.deprecated", + settings: { + fontStyle: "italic", + foreground: "#fdaeb7" + } + }, + { + scope: "invalid.illegal", + settings: { + fontStyle: "italic", + foreground: "#fdaeb7" + } + }, + { + scope: "invalid.unimplemented", + settings: { + fontStyle: "italic", + foreground: "#fdaeb7" + } + }, + { + scope: "carriage-return", + settings: { + background: "#f97583", + content: "^M", + fontStyle: "italic underline", + foreground: "#24292e" + } + }, + { + scope: "message.error", + settings: { + foreground: "#fdaeb7" + } + }, + { + scope: "string variable", + settings: { + foreground: "#c98a7d" + } + }, + { + scope: [ + "source.regexp", + "string.regexp" + ], + settings: { + foreground: "#c4704f" + } + }, + { + scope: [ + "string.regexp.character-class", + "string.regexp constant.character.escape", + "string.regexp source.ruby.embedded", + "string.regexp string.regexp.arbitrary-repitition" + ], + settings: { + foreground: "#c98a7d" + } + }, + { + scope: "string.regexp constant.character.escape", + settings: { + foreground: "#e6cc77" + } + }, + { + scope: [ + "support.constant" + ], + settings: { + foreground: "#c99076" + } + }, + { + scope: [ + "keyword.operator.quantifier.regexp", + "constant.numeric", + "number" + ], + settings: { + foreground: "#4C9A91" + } + }, + { + scope: [ + "keyword.other.unit" + ], + settings: { + foreground: "#cb7676" + } + }, + { + scope: [ + "constant.language.boolean", + "constant.language" + ], + settings: { + foreground: "#4d9375" + } + }, + { + scope: "meta.module-reference", + settings: { + foreground: "#4d9375" + } + }, + { + scope: "punctuation.definition.list.begin.markdown", + settings: { + foreground: "#d4976c" + } + }, + { + scope: [ + "markup.heading", + "markup.heading entity.name" + ], + settings: { + fontStyle: "bold", + foreground: "#4d9375" + } + }, + { + scope: "markup.quote", + settings: { + foreground: "#5d99a9" + } + }, + { + scope: "markup.italic", + settings: { + fontStyle: "italic", + foreground: "#dbd7caee" + } + }, + { + scope: "markup.bold", + settings: { + fontStyle: "bold", + foreground: "#dbd7caee" + } + }, + { + scope: "markup.raw", + settings: { + foreground: "#4d9375" + } + }, + { + scope: [ + "markup.deleted", + "meta.diff.header.from-file", + "punctuation.definition.deleted" + ], + settings: { + background: "#86181d", + foreground: "#fdaeb7" + } + }, + { + scope: [ + "markup.inserted", + "meta.diff.header.to-file", + "punctuation.definition.inserted" + ], + settings: { + background: "#144620", + foreground: "#85e89d" + } + }, + { + scope: [ + "markup.changed", + "punctuation.definition.changed" + ], + settings: { + background: "#c24e00", + foreground: "#ffab70" + } + }, + { + scope: [ + "markup.ignored", + "markup.untracked" + ], + settings: { + background: "#79b8ff", + foreground: "#2f363d" + } + }, + { + scope: "meta.diff.range", + settings: { + fontStyle: "bold", + foreground: "#b392f0" + } + }, + { + scope: "meta.diff.header", + settings: { + foreground: "#79b8ff" + } + }, + { + scope: "meta.separator", + settings: { + fontStyle: "bold", + foreground: "#79b8ff" + } + }, + { + scope: "meta.output", + settings: { + foreground: "#79b8ff" + } + }, + { + scope: [ + "brackethighlighter.tag", + "brackethighlighter.curly", + "brackethighlighter.round", + "brackethighlighter.square", + "brackethighlighter.angle", + "brackethighlighter.quote" + ], + settings: { + foreground: "#d1d5da" + } + }, + { + scope: "brackethighlighter.unmatched", + settings: { + foreground: "#fdaeb7" + } + }, + { + scope: [ + "constant.other.reference.link", + "string.other.link", + "punctuation.definition.string.begin.markdown", + "punctuation.definition.string.end.markdown" + ], + settings: { + foreground: "#c98a7d" + } + }, + { + scope: [ + "markup.underline.link.markdown", + "markup.underline.link.image.markdown" + ], + settings: { + fontStyle: "underline", + foreground: "#dedcd590" + } + }, + { + scope: [ + "type.identifier", + "constant.other.character-class.regexp" + ], + settings: { + foreground: "#6872ab" + } + }, + { + scope: [ + "entity.other.attribute-name.html.vue" + ], + settings: { + foreground: "#80a665" + } + }, + { + scope: [ + "invalid.illegal.unrecognized-tag.html" + ], + settings: { + fontStyle: "normal" + } + } + ], + type: "dark" +}; + +// node_modules/tm-grammars/grammars/html.json +var html_default = { + displayName: "HTML", + injections: { + "R:text.html - (comment.block, text.html meta.embedded, meta.tag.*.*.html, meta.tag.*.*.*.html, meta.tag.*.*.*.*.html)": { + patterns: [ + { + match: "<", + name: "invalid.illegal.bad-angle-bracket.html" + } + ] + } + }, + name: "html", + patterns: [ + { + include: "#xml-processing" + }, + { + include: "#comment" + }, + { + include: "#doctype" + }, + { + include: "#cdata" + }, + { + include: "#tags-valid" + }, + { + include: "#tags-invalid" + }, + { + include: "#entities" + } + ], + repository: { + attribute: { + patterns: [ + { + begin: "(s(hape|cope|t(ep|art)|ize(s)?|p(ellcheck|an)|elected|lot|andbox|rc(set|doc|lang)?)|h(ttp-equiv|i(dden|gh)|e(ight|aders)|ref(lang)?)|n(o(nce|validate|module)|ame)|c(h(ecked|arset)|ite|o(nt(ent(editable)?|rols)|ords|l(s(pan)?|or))|lass|rossorigin)|t(ype(mustmatch)?|itle|a(rget|bindex)|ranslate)|i(s(map)?|n(tegrity|putmode)|tem(scope|type|id|prop|ref)|d)|op(timum|en)|d(i(sabled|r(name)?)|ownload|e(coding|f(er|ault))|at(etime|a)|raggable)|usemap|p(ing|oster|la(ysinline|ceholder)|attern|reload)|enctype|value|kind|for(m(novalidate|target|enctype|action|method)?)?|w(idth|rap)|l(ist|o(op|w)|a(ng|bel))|a(s(ync)?|c(ce(sskey|pt(-charset)?)|tion)|uto(c(omplete|apitalize)|play|focus)|l(t|low(usermedia|paymentrequest|fullscreen))|bbr)|r(ows(pan)?|e(versed|quired|ferrerpolicy|l|adonly))|m(in(length)?|u(ted|ltiple)|e(thod|dia)|a(nifest|x(length)?)))(?![-:\\w])", + beginCaptures: { + "0": { + name: "entity.other.attribute-name.html" + } + }, + end: "(?=\\s*+[^=\\s])", + name: "meta.attribute.$1.html", + patterns: [ + { + include: "#attribute-interior" + } + ] + }, + { + begin: "style(?![-:\\w])", + beginCaptures: { + "0": { + name: "entity.other.attribute-name.html" + } + }, + end: "(?=\\s*+[^=\\s])", + name: "meta.attribute.style.html", + patterns: [ + { + begin: "=", + beginCaptures: { + "0": { + name: "punctuation.separator.key-value.html" + } + }, + end: "(?<=[^=\\s])(?!\\s*=)|(?=/?>)", + patterns: [ + { + begin: "(?=[^/<=>`\\s]|/(?!>))", + end: "(?!\\G)", + name: "meta.embedded.line.css", + patterns: [ + { + captures: { + "0": { + name: "source.css" + } + }, + match: "([^\"'/<=>`\\s]|/(?!>))+", + name: "string.unquoted.html" + }, + { + begin: '"', + beginCaptures: { + "0": { + name: "punctuation.definition.string.begin.html" + } + }, + contentName: "source.css", + end: '(")', + endCaptures: { + "0": { + name: "punctuation.definition.string.end.html" + }, + "1": { + name: "source.css" + } + }, + name: "string.quoted.double.html", + patterns: [ + { + include: "#entities" + } + ] + }, + { + begin: "'", + beginCaptures: { + "0": { + name: "punctuation.definition.string.begin.html" + } + }, + contentName: "source.css", + end: "(')", + endCaptures: { + "0": { + name: "punctuation.definition.string.end.html" + }, + "1": { + name: "source.css" + } + }, + name: "string.quoted.single.html", + patterns: [ + { + include: "#entities" + } + ] + } + ] + }, + { + match: "=", + name: "invalid.illegal.unexpected-equals-sign.html" + } + ] + } + ] + }, + { + begin: "on(s(croll|t(orage|alled)|u(spend|bmit)|e(curitypolicyviolation|ek(ing|ed)|lect))|hashchange|c(hange|o(ntextmenu|py)|u(t|echange)|l(ick|ose)|an(cel|play(through)?))|t(imeupdate|oggle)|in(put|valid)|o((?:n|ff)line)|d(urationchange|r(op|ag(start|over|e(n(ter|d)|xit)|leave)?)|blclick)|un(handledrejection|load)|p(opstate|lay(ing)?|a(ste|use|ge(show|hide))|rogress)|e(nded|rror|mptied)|volumechange|key(down|up|press)|focus|w(heel|aiting)|l(oad(start|e(nd|d((?:|meta)data)))?|anguagechange)|a(uxclick|fterprint|bort)|r(e(s(ize|et)|jectionhandled)|atechange)|m(ouse(o(ut|ver)|down|up|enter|leave|move)|essage(error)?)|b(efore(unload|print)|lur))(?![-:\\w])", + beginCaptures: { + "0": { + name: "entity.other.attribute-name.html" + } + }, + end: "(?=\\s*+[^=\\s])", + name: "meta.attribute.event-handler.$1.html", + patterns: [ + { + begin: "=", + beginCaptures: { + "0": { + name: "punctuation.separator.key-value.html" + } + }, + end: "(?<=[^=\\s])(?!\\s*=)|(?=/?>)", + patterns: [ + { + begin: "(?=[^/<=>`\\s]|/(?!>))", + end: "(?!\\G)", + name: "meta.embedded.line.js", + patterns: [ + { + captures: { + "0": { + name: "source.js" + }, + "1": { + patterns: [ + { + include: "source.js" + } + ] + } + }, + match: "(([^\"'/<=>`\\s]|/(?!>))+)", + name: "string.unquoted.html" + }, + { + begin: '"', + beginCaptures: { + "0": { + name: "punctuation.definition.string.begin.html" + } + }, + contentName: "source.js", + end: '(")', + endCaptures: { + "0": { + name: "punctuation.definition.string.end.html" + }, + "1": { + name: "source.js" + } + }, + name: "string.quoted.double.html", + patterns: [ + { + captures: { + "0": { + patterns: [ + { + include: "source.js" + } + ] + } + }, + match: '([^\\n"/]|/(?![*/]))+' + }, + { + begin: "//", + beginCaptures: { + "0": { + name: "punctuation.definition.comment.js" + } + }, + end: '(?=")|\\n', + name: "comment.line.double-slash.js" + }, + { + begin: "/\\*", + beginCaptures: { + "0": { + name: "punctuation.definition.comment.begin.js" + } + }, + end: '(?=")|\\*/', + endCaptures: { + "0": { + name: "punctuation.definition.comment.end.js" + } + }, + name: "comment.block.js" + } + ] + }, + { + begin: "'", + beginCaptures: { + "0": { + name: "punctuation.definition.string.begin.html" + } + }, + contentName: "source.js", + end: "(')", + endCaptures: { + "0": { + name: "punctuation.definition.string.end.html" + }, + "1": { + name: "source.js" + } + }, + name: "string.quoted.single.html", + patterns: [ + { + captures: { + "0": { + patterns: [ + { + include: "source.js" + } + ] + } + }, + match: "([^\\n'/]|/(?![*/]))+" + }, + { + begin: "//", + beginCaptures: { + "0": { + name: "punctuation.definition.comment.js" + } + }, + end: "(?=')|\\n", + name: "comment.line.double-slash.js" + }, + { + begin: "/\\*", + beginCaptures: { + "0": { + name: "punctuation.definition.comment.begin.js" + } + }, + end: "(?=')|\\*/", + endCaptures: { + "0": { + name: "punctuation.definition.comment.end.js" + } + }, + name: "comment.block.js" + } + ] + } + ] + }, + { + match: "=", + name: "invalid.illegal.unexpected-equals-sign.html" + } + ] + } + ] + }, + { + begin: "(data-[-a-z]+)(?![-:\\w])", + beginCaptures: { + "0": { + name: "entity.other.attribute-name.html" + } + }, + end: "(?=\\s*+[^=\\s])", + name: "meta.attribute.data-x.$1.html", + patterns: [ + { + include: "#attribute-interior" + } + ] + }, + { + begin: "(align|bgcolor|border)(?![-:\\w])", + beginCaptures: { + "0": { + name: "invalid.deprecated.entity.other.attribute-name.html" + } + }, + end: "(?=\\s*+[^=\\s])", + name: "meta.attribute.$1.html", + patterns: [ + { + include: "#attribute-interior" + } + ] + }, + { + begin: `([^\\x00- "'/<=>\\x7F-\\x{9F}\uFDD0-\uFDEF\uFFFE\uFFFF\u{1FFFE}\u{1FFFF}\u{2FFFE}\u{2FFFF}\u{3FFFE}\u{3FFFF}\\x{4FFFE}\\x{4FFFF}\\x{5FFFE}\\x{5FFFF}\\x{6FFFE}\\x{6FFFF}\\x{7FFFE}\\x{7FFFF}\\x{8FFFE}\\x{8FFFF}\\x{9FFFE}\\x{9FFFF}\\x{AFFFE}\\x{AFFFF}\\x{BFFFE}\\x{BFFFF}\\x{CFFFE}\\x{CFFFF}\\x{DFFFE}\\x{DFFFF}\\x{EFFFE}\\x{EFFFF}\\x{FFFFE}\\x{FFFFF}\\x{10FFFE}\\x{10FFFF}]+)`, + beginCaptures: { + "0": { + name: "entity.other.attribute-name.html" + } + }, + end: "(?=\\s*+[^=\\s])", + name: "meta.attribute.unrecognized.$1.html", + patterns: [ + { + include: "#attribute-interior" + } + ] + }, + { + match: "[^>\\s]+", + name: "invalid.illegal.character-not-allowed-here.html" + } + ] + }, + "attribute-interior": { + patterns: [ + { + begin: "=", + beginCaptures: { + "0": { + name: "punctuation.separator.key-value.html" + } + }, + end: "(?<=[^=\\s])(?!\\s*=)|(?=/?>)", + patterns: [ + { + match: "([^\"'/<=>`\\s]|/(?!>))+", + name: "string.unquoted.html" + }, + { + begin: '"', + beginCaptures: { + "0": { + name: "punctuation.definition.string.begin.html" + } + }, + end: '"', + endCaptures: { + "0": { + name: "punctuation.definition.string.end.html" + } + }, + name: "string.quoted.double.html", + patterns: [ + { + include: "#entities" + } + ] + }, + { + begin: "'", + beginCaptures: { + "0": { + name: "punctuation.definition.string.begin.html" + } + }, + end: "'", + endCaptures: { + "0": { + name: "punctuation.definition.string.end.html" + } + }, + name: "string.quoted.single.html", + patterns: [ + { + include: "#entities" + } + ] + }, + { + match: "=", + name: "invalid.illegal.unexpected-equals-sign.html" + } + ] + } + ] + }, + cdata: { + begin: "", + endCaptures: { + "0": { + name: "punctuation.definition.tag.end.html" + } + }, + name: "meta.tag.metadata.cdata.html" + }, + comment: { + begin: "", + name: "comment.block.html", + patterns: [ + { + match: "\\G-?>", + name: "invalid.illegal.characters-not-allowed-here.html" + }, + { + match: ")|(?=-->))", + name: "invalid.illegal.characters-not-allowed-here.html" + }, + { + match: "--!>", + name: "invalid.illegal.characters-not-allowed-here.html" + } + ] + }, + "core-minus-invalid": { + patterns: [ + { + include: "#xml-processing" + }, + { + include: "#comment" + }, + { + include: "#doctype" + }, + { + include: "#cdata" + }, + { + include: "#tags-valid" + }, + { + include: "#entities" + } + ] + }, + doctype: { + begin: "", + endCaptures: { + "0": { + name: "punctuation.definition.tag.end.html" + } + }, + name: "meta.tag.metadata.doctype.html", + patterns: [ + { + match: "\\G(?i:DOCTYPE)", + name: "entity.name.tag.html" + }, + { + begin: '"', + end: '"', + name: "string.quoted.double.html" + }, + { + match: "[^>\\s]+", + name: "entity.other.attribute-name.html" + } + ] + }, + entities: { + patterns: [ + { + captures: { + "1": { + name: "punctuation.definition.entity.html" + }, + "912": { + name: "punctuation.definition.entity.html" + } + }, + match: "(&)(?=[A-Za-z])((a(s(ymp(eq)?|cr|t)|n(d(slope|[dv]|and)?|g(s(t|ph)|zarr|e|le|rt(vb(d)?)?|msd(a([a-h]))?)?)|c(y|irc|d|ute|E)?|tilde|o(pf|gon)|uml|p(id|os|prox(eq)?|[Ee]|acir)?|elig|f(r)?|w((?:con|)int)|l(pha|e(ph|fsym))|acute|ring|grave|m(p|a(cr|lg))|breve)|A(s(sign|cr)|nd|MP|c(y|irc)|tilde|o(pf|gon)|uml|pplyFunction|fr|Elig|lpha|acute|ring|grave|macr|breve))|(B(scr|cy|opf|umpeq|e(cause|ta|rnoullis)|fr|a(ckslash|r(v|wed))|reve)|b(s(cr|im(e)?|ol(hsub|b)?|emi)|n(ot|e(quiv)?)|c(y|ong)|ig(s(tar|qcup)|c(irc|up|ap)|triangle(down|up)|o(times|dot|plus)|uplus|vee|wedge)|o(t(tom)?|pf|wtie|x(h([DUdu])?|times|H([DUdu])?|d([LRlr])|u([LRlr])|plus|D([LRlr])|v([HLRhlr])?|U([LRlr])|V([HLRhlr])?|minus|box))|Not|dquo|u(ll(et)?|mp(e(q)?|E)?)|prime|e(caus(e)?|t(h|ween|a)|psi|rnou|mptyv)|karow|fr|l(ock|k(1([24])|34)|a(nk|ck(square|triangle(down|left|right)?|lozenge)))|a(ck(sim(eq)?|cong|prime|epsilon)|r(vee|wed(ge)?))|r(eve|vbar)|brk(tbrk)?))|(c(s(cr|u(p(e)?|b(e)?))|h(cy|i|eck(mark)?)|ylcty|c(irc|ups(sm)?|edil|a(ps|ron))|tdot|ir(scir|c(eq|le(d(R|circ|S|dash|ast)|arrow(left|right)))?|e|fnint|E|mid)?|o(n(int|g(dot)?)|p(y(sr)?|f|rod)|lon(e(q)?)?|m(p(fn|le(xes|ment))?|ma(t)?))|dot|u(darr([lr])|p(s|c([au]p)|or|dot|brcap)?|e(sc|pr)|vee|wed|larr(p)?|r(vearrow(left|right)|ly(eq(succ|prec)|vee|wedge)|arr(m)?|ren))|e(nt(erdot)?|dil|mptyv)|fr|w((?:con|)int)|lubs(uit)?|a(cute|p(s|c([au]p)|dot|and|brcup)?|r(on|et))|r(oss|arr))|C(scr|hi|c(irc|onint|edil|aron)|ircle(Minus|Times|Dot|Plus)|Hcy|o(n(tourIntegral|int|gruent)|unterClockwiseContourIntegral|p(f|roduct)|lon(e)?)|dot|up(Cap)?|OPY|e(nterDot|dilla)|fr|lo(seCurly((?:Double|)Quote)|ckwiseContourIntegral)|a(yleys|cute|p(italDifferentialD)?)|ross))|(d(s(c([ry])|trok|ol)|har([lr])|c(y|aron)|t(dot|ri(f)?)|i(sin|e|v(ide(ontimes)?|onx)?|am(s|ond(suit)?)?|gamma)|Har|z(cy|igrarr)|o(t(square|plus|eq(dot)?|minus)?|ublebarwedge|pf|wn(harpoon(left|right)|downarrows|arrow)|llar)|d(otseq|a(rr|gger))?|u(har|arr)|jcy|e(lta|g|mptyv)|f(isht|r)|wangle|lc(orn|rop)|a(sh(v)?|leth|rr|gger)|r(c(orn|rop)|bkarow)|b(karow|lac)|Arr)|D(s(cr|trok)|c(y|aron)|Scy|i(fferentialD|a(critical(Grave|Tilde|Do(t|ubleAcute)|Acute)|mond))|o(t(Dot|Equal)?|uble(Right(Tee|Arrow)|ContourIntegral|Do(t|wnArrow)|Up((?:Down|)Arrow)|VerticalBar|L(ong(RightArrow|Left((?:Right|)Arrow))|eft(RightArrow|Tee|Arrow)))|pf|wn(Right(TeeVector|Vector(Bar)?)|Breve|Tee(Arrow)?|arrow|Left(RightVector|TeeVector|Vector(Bar)?)|Arrow(Bar|UpArrow)?))|Zcy|el(ta)?|D(otrahd)?|Jcy|fr|a(shv|rr|gger)))|(e(s(cr|im|dot)|n(sp|g)|c(y|ir(c)?|olon|aron)|t([ah])|o(pf|gon)|dot|u(ro|ml)|p(si(v|lon)?|lus|ar(sl)?)|e|D(D??ot)|q(s(im|lant(less|gtr))|c(irc|olon)|u(iv(DD)?|est|als)|vparsl)|f(Dot|r)|l(s(dot)?|inters|l)?|a(ster|cute)|r(Dot|arr)|g(s(dot)?|rave)?|x(cl|ist|p(onentiale|ectation))|m(sp(1([34]))?|pty(set|v)?|acr))|E(s(cr|im)|c(y|irc|aron)|ta|o(pf|gon)|NG|dot|uml|TH|psilon|qu(ilibrium|al(Tilde)?)|fr|lement|acute|grave|x(ists|ponentialE)|m(pty((?:|Very)SmallSquare)|acr)))|(f(scr|nof|cy|ilig|o(pf|r(k(v)?|all))|jlig|partint|emale|f(ilig|l(l??ig)|r)|l(tns|lig|at)|allingdotseq|r(own|a(sl|c(1([2-68])|78|2([35])|3([458])|45|5([68])))))|F(scr|cy|illed((?:|Very)SmallSquare)|o(uriertrf|pf|rAll)|fr))|(G(scr|c(y|irc|edil)|t|opf|dot|T|Jcy|fr|amma(d)?|reater(Greater|SlantEqual|Tilde|Equal(Less)?|FullEqual|Less)|g|breve)|g(s(cr|im([el])?)|n(sim|e(q(q)?)?|E|ap(prox)?)|c(y|irc)|t(c(c|ir)|dot|quest|lPar|r(sim|dot|eq(q?less)|less|a(pprox|rr)))?|imel|opf|dot|jcy|e(s(cc|dot(o(l)?)?|l(es)?)?|q(slant|q)?|l)?|v(nE|ertneqq)|fr|E(l)?|l([Eaj])?|a(cute|p|mma(d)?)|rave|g(g)?|breve))|(h(s(cr|trok|lash)|y(phen|bull)|circ|o(ok((?:lef|righ)tarrow)|pf|arr|rbar|mtht)|e(llip|arts(uit)?|rcon)|ks([ew]arow)|fr|a(irsp|lf|r(dcy|r(cir|w)?)|milt)|bar|Arr)|H(s(cr|trok)|circ|ilbertSpace|o(pf|rizontalLine)|ump(DownHump|Equal)|fr|a(cek|t)|ARDcy))|(i(s(cr|in(s(v)?|dot|[Ev])?)|n(care|t(cal|prod|e(rcal|gers)|larhk)?|odot|fin(tie)?)?|c(y|irc)?|t(ilde)?|i(nfin|i(i??nt)|ota)?|o(cy|ta|pf|gon)|u(kcy|ml)|jlig|prod|e(cy|xcl)|quest|f([fr])|acute|grave|m(of|ped|a(cr|th|g(part|e|line))))|I(scr|n(t(e(rsection|gral))?|visible(Comma|Times))|c(y|irc)|tilde|o(ta|pf|gon)|dot|u(kcy|ml)|Ocy|Jlig|fr|Ecy|acute|grave|m(plies|a(cr|ginaryI))?))|(j(s(cr|ercy)|c(y|irc)|opf|ukcy|fr|math)|J(s(cr|ercy)|c(y|irc)|opf|ukcy|fr))|(k(scr|hcy|c(y|edil)|opf|jcy|fr|appa(v)?|green)|K(scr|c(y|edil)|Hcy|opf|Jcy|fr|appa))|(l(s(h|cr|trok|im([eg])?|q(uo(r)?|b)|aquo)|h(ar(d|u(l)?)|blk)|n(sim|e(q(q)?)?|E|ap(prox)?)|c(y|ub|e(d??il)|aron)|Barr|t(hree|c(c|ir)|imes|dot|quest|larr|r(i([ef])?|Par))?|Har|o(ng(left((?:|right)arrow)|rightarrow|mapsto)|times|z(enge|f)?|oparrow(left|right)|p(f|lus|ar)|w(ast|bar)|a(ng|rr)|brk)|d(sh|ca|quo(r)?|r((?:d|us)har))|ur((?:ds|u)har)|jcy|par(lt)?|e(s(s(sim|dot|eq(q?gtr)|approx|gtr)|cc|dot(o(r)?)?|g(es)?)?|q(slant|q)?|ft(harpoon(down|up)|threetimes|leftarrows|arrow(tail)?|right(squigarrow|harpoons|arrow(s)?))|g)?|v(nE|ertneqq)|f(isht|loor|r)|E(g)?|l(hard|corner|tri|arr)?|a(ng(d|le)?|cute|t(e(s)?|ail)?|p|emptyv|quo|rr(sim|hk|tl|pl|fs|lp|b(fs)?)?|gran|mbda)|r(har(d)?|corner|tri|arr|m)|g(E)?|m(idot|oust(ache)?)|b(arr|r(k(sl([du])|e)|ac([ek]))|brk)|A(tail|arr|rr))|L(s(h|cr|trok)|c(y|edil|aron)|t|o(ng(RightArrow|left((?:|right)arrow)|rightarrow|Left((?:Right|)Arrow))|pf|wer((?:Righ|Lef)tArrow))|T|e(ss(Greater|SlantEqual|Tilde|EqualGreater|FullEqual|Less)|ft(Right(Vector|Arrow)|Ceiling|T(ee(Vector|Arrow)?|riangle(Bar|Equal)?)|Do(ubleBracket|wn(TeeVector|Vector(Bar)?))|Up(TeeVector|DownVector|Vector(Bar)?)|Vector(Bar)?|arrow|rightarrow|Floor|A(ngleBracket|rrow(RightArrow|Bar)?)))|Jcy|fr|l(eftarrow)?|a(ng|cute|placetrf|rr|mbda)|midot))|(M(scr|cy|inusPlus|opf|u|e(diumSpace|llintrf)|fr|ap)|m(s(cr|tpos)|ho|nplus|c(y|omma)|i(nus(d(u)?|b)?|cro|d(cir|dot|ast)?)|o(dels|pf)|dash|u((?:lti|)map)?|p|easuredangle|DDot|fr|l(cp|dr)|a(cr|p(sto(down|up|left)?)?|l(t(ese)?|e)|rker)))|(n(s(hort(parallel|mid)|c(cue|[er])?|im(e(q)?)?|u(cc(eq)?|p(set(eq(q)?)?|[Ee])?|b(set(eq(q)?)?|[Ee])?)|par|qsu([bp]e)|mid)|Rightarrow|h(par|arr|Arr)|G(t(v)?|g)|c(y|ong(dot)?|up|edil|a(p|ron))|t(ilde|lg|riangle(left(eq)?|right(eq)?)|gl)|i(s(d)?|v)?|o(t(ni(v([abc]))?|in(dot|v([abc])|E)?)?|pf)|dash|u(m(sp|ero)?)?|jcy|p(olint|ar(sl|t|allel)?|r(cue|e(c(eq)?)?)?)|e(s(im|ear)|dot|quiv|ar(hk|r(ow)?)|xist(s)?|Arr)?|v(sim|infin|Harr|dash|Dash|l(t(rie)?|e|Arr)|ap|r(trie|Arr)|g([et]))|fr|w(near|ar(hk|r(ow)?)|Arr)|V([Dd]ash)|l(sim|t(ri(e)?)?|dr|e(s(s)?|q(slant|q)?|ft((?:|right)arrow))?|E|arr|Arr)|a(ng|cute|tur(al(s)?)?|p(id|os|prox|E)?|bla)|r(tri(e)?|ightarrow|arr([cw])?|Arr)|g(sim|t(r)?|e(s|q(slant|q)?)?|E)|mid|L(t(v)?|eft((?:|right)arrow)|l)|b(sp|ump(e)?))|N(scr|c(y|edil|aron)|tilde|o(nBreakingSpace|Break|t(R(ightTriangle(Bar|Equal)?|everseElement)|Greater(Greater|SlantEqual|Tilde|Equal|FullEqual|Less)?|S(u(cceeds(SlantEqual|Tilde|Equal)?|perset(Equal)?|bset(Equal)?)|quareSu(perset(Equal)?|bset(Equal)?))|Hump(DownHump|Equal)|Nested(GreaterGreater|LessLess)|C(ongruent|upCap)|Tilde(Tilde|Equal|FullEqual)?|DoubleVerticalBar|Precedes((?:Slant|)Equal)?|E(qual(Tilde)?|lement|xists)|VerticalBar|Le(ss(Greater|SlantEqual|Tilde|Equal|Less)?|ftTriangle(Bar|Equal)?))?|pf)|u|e(sted(GreaterGreater|LessLess)|wLine|gative(MediumSpace|Thi((?:n|ck)Space)|VeryThinSpace))|Jcy|fr|acute))|(o(s(cr|ol|lash)|h(m|bar)|c(y|ir(c)?)|ti(lde|mes(as)?)|S|int|opf|d(sold|iv|ot|ash|blac)|uml|p(erp|lus|ar)|elig|vbar|f(cir|r)|l(c(ir|ross)|t|ine|arr)|a(st|cute)|r(slope|igof|or|d(er(of)?|[fm])?|v|arr)?|g(t|on|rave)|m(i(nus|cron|d)|ega|acr))|O(s(cr|lash)|c(y|irc)|ti(lde|mes)|opf|dblac|uml|penCurly((?:Double|)Quote)|ver(B(ar|rac(e|ket))|Parenthesis)|fr|Elig|acute|r|grave|m(icron|ega|acr)))|(p(s(cr|i)|h(i(v)?|one|mmat)|cy|i(tchfork|v)?|o(intint|und|pf)|uncsp|er(cnt|tenk|iod|p|mil)|fr|l(us(sim|cir|two|d([ou])|e|acir|mn|b)?|an(ck(h)?|kv))|ar(s(im|l)|t|a(llel)?)?|r(sim|n(sim|E|ap)|cue|ime(s)?|o(d|p(to)?|f(surf|line|alar))|urel|e(c(sim|n(sim|eqq|approx)|curlyeq|eq|approx)?)?|E|ap)?|m)|P(s(cr|i)|hi|cy|i|o(incareplane|pf)|fr|lusMinus|artialD|r(ime|o(duct|portion(al)?)|ecedes(SlantEqual|Tilde|Equal)?)?))|(q(scr|int|opf|u(ot|est(eq)?|at(int|ernions))|prime|fr)|Q(scr|opf|UOT|fr))|(R(s(h|cr)|ho|c(y|edil|aron)|Barr|ight(Ceiling|T(ee(Vector|Arrow)?|riangle(Bar|Equal)?)|Do(ubleBracket|wn(TeeVector|Vector(Bar)?))|Up(TeeVector|DownVector|Vector(Bar)?)|Vector(Bar)?|arrow|Floor|A(ngleBracket|rrow(Bar|LeftArrow)?))|o(undImplies|pf)|uleDelayed|e(verse(UpEquilibrium|E(quilibrium|lement)))?|fr|EG|a(ng|cute|rr(tl)?)|rightarrow)|r(s(h|cr|q(uo(r)?|b)|aquo)|h(o(v)?|ar(d|u(l)?))|nmid|c(y|ub|e(d??il)|aron)|Barr|t(hree|imes|ri([ef]|ltri)?)|i(singdotseq|ng|ght(squigarrow|harpoon(down|up)|threetimes|left(harpoons|arrows)|arrow(tail)?|rightarrows))|Har|o(times|p(f|lus|ar)|a(ng|rr)|brk)|d(sh|ca|quo(r)?|ldhar)|uluhar|p(polint|ar(gt)?)|e(ct|al(s|ine|part)?|g)|f(isht|loor|r)|l(har|arr|m)|a(ng([de]|le)?|c(ute|e)|t(io(nals)?|ail)|dic|emptyv|quo|rr(sim|hk|c|tl|pl|fs|w|lp|ap|b(fs)?)?)|rarr|x|moust(ache)?|b(arr|r(k(sl([du])|e)|ac([ek]))|brk)|A(tail|arr|rr)))|(s(s(cr|tarf|etmn|mile)|h(y|c(hcy|y)|ort(parallel|mid)|arp)|c(sim|y|n(sim|E|ap)|cue|irc|polint|e(dil)?|E|a(p|ron))?|t(ar(f)?|r(ns|aight(phi|epsilon)))|i(gma([fv])?|m(ne|dot|plus|e(q)?|l(E)?|rarr|g(E)?)?)|zlig|o(pf|ftcy|l(b(ar)?)?)|dot([be])?|u(ng|cc(sim|n(sim|eqq|approx)|curlyeq|eq|approx)?|p(s(im|u([bp])|et(neq(q)?|eq(q)?)?)|hs(ol|ub)|1|n([Ee])|2|d(sub|ot)|3|plus|e(dot)?|E|larr|mult)?|m|b(s(im|u([bp])|et(neq(q)?|eq(q)?)?)|n([Ee])|dot|plus|e(dot)?|E|rarr|mult)?)|pa(des(uit)?|r)|e(swar|ct|tm(n|inus)|ar(hk|r(ow)?)|xt|mi|Arr)|q(su(p(set(eq)?|e)?|b(set(eq)?|e)?)|c(up(s)?|ap(s)?)|u(f|ar([ef]))?)|fr(own)?|w(nwar|ar(hk|r(ow)?)|Arr)|larr|acute|rarr|m(t(e(s)?)?|i(d|le)|eparsl|a(shp|llsetminus))|bquo)|S(scr|hort((?:Right|Down|Up|Left)Arrow)|c(y|irc|edil|aron)?|tar|igma|H(cy|CHcy)|opf|u(c(hThat|ceeds(SlantEqual|Tilde|Equal)?)|p(set|erset(Equal)?)?|m|b(set(Equal)?)?)|OFTcy|q(uare(Su(perset(Equal)?|bset(Equal)?)|Intersection|Union)?|rt)|fr|acute|mallCircle))|(t(s(hcy|c([ry])|trok)|h(i(nsp|ck(sim|approx))|orn|e(ta(sym|v)?|re(4|fore))|k(sim|ap))|c(y|edil|aron)|i(nt|lde|mes(d|b(ar)?)?)|o(sa|p(cir|f(ork)?|bot)?|ea)|dot|prime|elrec|fr|w(ixt|ohead((?:lef|righ)tarrow))|a(u|rget)|r(i(sb|time|dot|plus|e|angle(down|q|left(eq)?|right(eq)?)?|minus)|pezium|ade)|brk)|T(s(cr|trok)|RADE|h(i((?:n|ck)Space)|e(ta|refore))|c(y|edil|aron)|S(H??cy)|ilde(Tilde|Equal|FullEqual)?|HORN|opf|fr|a([bu])|ripleDot))|(u(scr|h(ar([lr])|blk)|c(y|irc)|t(ilde|dot|ri(f)?)|Har|o(pf|gon)|d(har|arr|blac)|u(arr|ml)|p(si(h|lon)?|harpoon(left|right)|downarrow|uparrows|lus|arrow)|f(isht|r)|wangle|l(c(orn(er)?|rop)|tri)|a(cute|rr)|r(c(orn(er)?|rop)|tri|ing)|grave|m(l|acr)|br(cy|eve)|Arr)|U(scr|n(ion(Plus)?|der(B(ar|rac(e|ket))|Parenthesis))|c(y|irc)|tilde|o(pf|gon)|dblac|uml|p(si(lon)?|downarrow|Tee(Arrow)?|per((?:Righ|Lef)tArrow)|DownArrow|Equilibrium|arrow|Arrow(Bar|DownArrow)?)|fr|a(cute|rr(ocir)?)|ring|grave|macr|br(cy|eve)))|(v(s(cr|u(pn([Ee])|bn([Ee])))|nsu([bp])|cy|Bar(v)?|zigzag|opf|dash|prop|e(e(eq|bar)?|llip|r(t|bar))|Dash|fr|ltri|a(ngrt|r(s(igma|u(psetneq(q)?|bsetneq(q)?))|nothing|t(heta|riangle(left|right))|p(hi|i|ropto)|epsilon|kappa|r(ho)?))|rtri|Arr)|V(scr|cy|opf|dash(l)?|e(e|r(yThinSpace|t(ical(Bar|Separator|Tilde|Line))?|bar))|Dash|vdash|fr|bar))|(w(scr|circ|opf|p|e(ierp|d(ge(q)?|bar))|fr|r(eath)?)|W(scr|circ|opf|edge|fr))|(X(scr|i|opf|fr)|x(s(cr|qcup)|h([Aa]rr)|nis|c(irc|up|ap)|i|o(time|dot|p(f|lus))|dtri|u(tri|plus)|vee|fr|wedge|l([Aa]rr)|r([Aa]rr)|map))|(y(scr|c(y|irc)|icy|opf|u(cy|ml)|en|fr|ac(y|ute))|Y(scr|c(y|irc)|opf|uml|Icy|Ucy|fr|acute|Acy))|(z(scr|hcy|c(y|aron)|igrarr|opf|dot|e(ta|etrf)|fr|w(n?j)|acute)|Z(scr|c(y|aron)|Hcy|opf|dot|e(ta|roWidthSpace)|fr|acute)))(;)", + name: "constant.character.entity.named.$2.html" + }, + { + captures: { + "1": { + name: "punctuation.definition.entity.html" + }, + "3": { + name: "punctuation.definition.entity.html" + } + }, + match: "(&)#[0-9]+(;)", + name: "constant.character.entity.numeric.decimal.html" + }, + { + captures: { + "1": { + name: "punctuation.definition.entity.html" + }, + "3": { + name: "punctuation.definition.entity.html" + } + }, + match: "(&)#[Xx]\\h+(;)", + name: "constant.character.entity.numeric.hexadecimal.html" + }, + { + match: "&(?=[0-9A-Za-z]+;)", + name: "invalid.illegal.ambiguous-ampersand.html" + } + ] + }, + math: { + patterns: [ + { + begin: `(?i)(<)(math)(?=\\s|/?>)(?:(([^"'>]|"[^"]*"|'[^']*')*)(>))?`, + beginCaptures: { + "0": { + name: "meta.tag.structure.$2.start.html" + }, + "1": { + name: "punctuation.definition.tag.begin.html" + }, + "2": { + name: "entity.name.tag.html" + }, + "3": { + patterns: [ + { + include: "#attribute" + } + ] + }, + "5": { + name: "punctuation.definition.tag.end.html" + } + }, + end: "(?i)()", + endCaptures: { + "0": { + name: "meta.tag.structure.$2.end.html" + }, + "1": { + name: "punctuation.definition.tag.begin.html" + }, + "2": { + name: "entity.name.tag.html" + }, + "3": { + name: "punctuation.definition.tag.end.html" + } + }, + name: "meta.element.structure.$2.html", + patterns: [ + { + begin: "(?)\\G", + end: ">", + endCaptures: { + "0": { + name: "punctuation.definition.tag.end.html" + } + }, + name: "meta.tag.structure.start.html", + patterns: [ + { + include: "#attribute" + } + ] + }, + { + include: "#tags" + } + ] + } + ], + repository: { + attribute: { + patterns: [ + { + begin: "(s(hift|ymmetric|cript(sizemultiplier|level|minsize)|t(ackalign|retchy)|ide|u([bp]scriptshift)|e(parator(s)?|lection)|rc)|h(eight|ref)|n(otation|umalign)|c(haralign|olumn(spa(n|cing)|width|lines|align)|lose|rossout)|i(n(dent(shift(first|last)?|target|align(first|last)?)|fixlinebreakstyle)|d)|o(pen|verflow)|d(i(splay(style)?|r)|e(nomalign|cimalpoint|pth))|position|e(dge|qual(columns|rows))|voffset|f(orm|ence|rame(spacing)?)|width|l(space|ine(thickness|leading|break(style|multchar)?)|o(ngdivstyle|cation)|ength|quote|argeop)|a(c(cent(under)?|tiontype)|l(t(text|img(-(height|valign|width))?)|ign(mentscope)?))|r(space|ow(spa(n|cing)|lines|align)|quote)|groupalign|x(link:href|mlns)|m(in(size|labelspacing)|ovablelimits|a(th(size|color|variant|background)|xsize))|bevelled)(?![-:\\w])", + beginCaptures: { + "0": { + name: "entity.other.attribute-name.html" + } + }, + end: "(?=\\s*+[^=\\s])", + name: "meta.attribute.$1.html", + patterns: [ + { + include: "#attribute-interior" + } + ] + }, + { + begin: `([^\\x00- "'/<=>\\x7F-\\x{9F}\uFDD0-\uFDEF\uFFFE\uFFFF\u{1FFFE}\u{1FFFF}\u{2FFFE}\u{2FFFF}\u{3FFFE}\u{3FFFF}\\x{4FFFE}\\x{4FFFF}\\x{5FFFE}\\x{5FFFF}\\x{6FFFE}\\x{6FFFF}\\x{7FFFE}\\x{7FFFF}\\x{8FFFE}\\x{8FFFF}\\x{9FFFE}\\x{9FFFF}\\x{AFFFE}\\x{AFFFF}\\x{BFFFE}\\x{BFFFF}\\x{CFFFE}\\x{CFFFF}\\x{DFFFE}\\x{DFFFF}\\x{EFFFE}\\x{EFFFF}\\x{FFFFE}\\x{FFFFF}\\x{10FFFE}\\x{10FFFF}]+)`, + beginCaptures: { + "0": { + name: "entity.other.attribute-name.html" + } + }, + end: "(?=\\s*+[^=\\s])", + name: "meta.attribute.unrecognized.$1.html", + patterns: [ + { + include: "#attribute-interior" + } + ] + }, + { + match: "[^>\\s]+", + name: "invalid.illegal.character-not-allowed-here.html" + } + ] + }, + tags: { + patterns: [ + { + include: "#comment" + }, + { + include: "#cdata" + }, + { + captures: { + "0": { + name: "meta.tag.structure.math.$2.void.html" + }, + "1": { + name: "punctuation.definition.tag.begin.html" + }, + "2": { + name: "entity.name.tag.html" + }, + "3": { + patterns: [ + { + include: "#attribute" + } + ] + }, + "5": { + name: "punctuation.definition.tag.end.html" + } + }, + match: `(?i)(<)(annotation|annotation-xml|semantics|menclose|merror|mfenced|mfrac|mpadded|mphantom|mroot|mrow|msqrt|mstyle|mmultiscripts|mover|mprescripts|msub|msubsup|msup|munder|munderover|none|mlabeledtr|mtable|mtd|mtr|mlongdiv|mscarries|mscarry|msgroup|msline|msrow|mstack|maction)(?=\\s|/?>)(([^"'>]|"[^"]*"|'[^']*')*)(/>)`, + name: "meta.element.structure.math.$2.html" + }, + { + begin: `(?i)(<)(annotation|annotation-xml|semantics|menclose|merror|mfenced|mfrac|mpadded|mphantom|mroot|mrow|msqrt|mstyle|mmultiscripts|mover|mprescripts|msub|msubsup|msup|munder|munderover|none|mlabeledtr|mtable|mtd|mtr|mlongdiv|mscarries|mscarry|msgroup|msline|msrow|mstack|maction)(?=\\s|/?>)(?:(([^"'>]|"[^"]*"|'[^']*')*)(>))?`, + beginCaptures: { + "0": { + name: "meta.tag.structure.math.$2.start.html" + }, + "1": { + name: "punctuation.definition.tag.begin.html" + }, + "2": { + name: "entity.name.tag.html" + }, + "3": { + patterns: [ + { + include: "#attribute" + } + ] + }, + "5": { + name: "punctuation.definition.tag.end.html" + } + }, + end: "(?i)()|(/>)|(?=)\\G", + end: "(?=/>)|>", + endCaptures: { + "0": { + name: "punctuation.definition.tag.end.html" + } + }, + name: "meta.tag.structure.start.html", + patterns: [ + { + include: "#attribute" + } + ] + }, + { + include: "#tags" + } + ] + }, + { + captures: { + "0": { + name: "meta.tag.inline.math.$2.void.html" + }, + "1": { + name: "punctuation.definition.tag.begin.html" + }, + "2": { + name: "entity.name.tag.html" + }, + "3": { + patterns: [ + { + include: "#attribute" + } + ] + }, + "5": { + name: "punctuation.definition.tag.end.html" + } + }, + match: `(?i)(<)(m(?:[inos]|space|text|aligngroup|alignmark))(?=\\s|/?>)(([^"'>]|"[^"]*"|'[^']*')*)(/>)`, + name: "meta.element.inline.math.$2.html" + }, + { + begin: `(?i)(<)(m(?:[inos]|space|text|aligngroup|alignmark))(?=\\s|/?>)(?:(([^"'>]|"[^"]*"|'[^']*')*)(>))?`, + beginCaptures: { + "0": { + name: "meta.tag.inline.math.$2.start.html" + }, + "1": { + name: "punctuation.definition.tag.begin.html" + }, + "2": { + name: "entity.name.tag.html" + }, + "3": { + patterns: [ + { + include: "#attribute" + } + ] + }, + "5": { + name: "punctuation.definition.tag.end.html" + } + }, + end: "(?i)()|(/>)|(?=)\\G", + end: "(?=/>)|>", + endCaptures: { + "0": { + name: "punctuation.definition.tag.end.html" + } + }, + name: "meta.tag.inline.start.html", + patterns: [ + { + include: "#attribute" + } + ] + }, + { + include: "#tags" + } + ] + }, + { + captures: { + "0": { + name: "meta.tag.object.math.$2.void.html" + }, + "1": { + name: "punctuation.definition.tag.begin.html" + }, + "2": { + name: "entity.name.tag.html" + }, + "3": { + patterns: [ + { + include: "#attribute" + } + ] + }, + "5": { + name: "punctuation.definition.tag.end.html" + } + }, + match: `(?i)(<)(mglyph)(?=\\s|/?>)(([^"'>]|"[^"]*"|'[^']*')*)(/>)`, + name: "meta.element.object.math.$2.html" + }, + { + begin: `(?i)(<)(mglyph)(?=\\s|/?>)(?:(([^"'>]|"[^"]*"|'[^']*')*)(>))?`, + beginCaptures: { + "0": { + name: "meta.tag.object.math.$2.start.html" + }, + "1": { + name: "punctuation.definition.tag.begin.html" + }, + "2": { + name: "entity.name.tag.html" + }, + "3": { + patterns: [ + { + include: "#attribute" + } + ] + }, + "5": { + name: "punctuation.definition.tag.end.html" + } + }, + end: "(?i)()|(/>)|(?=)\\G", + end: "(?=/>)|>", + endCaptures: { + "0": { + name: "punctuation.definition.tag.end.html" + } + }, + name: "meta.tag.object.start.html", + patterns: [ + { + include: "#attribute" + } + ] + }, + { + include: "#tags" + } + ] + }, + { + captures: { + "0": { + name: "meta.tag.other.invalid.void.html" + }, + "1": { + name: "punctuation.definition.tag.begin.html" + }, + "2": { + name: "entity.name.tag.html" + }, + "3": { + name: "invalid.illegal.unrecognized-tag.html" + }, + "4": { + patterns: [ + { + include: "#attribute" + } + ] + }, + "6": { + name: "punctuation.definition.tag.end.html" + } + }, + match: `(?i)(<)(([:\\w]+))(?=\\s|/?>)(([^"'>]|"[^"]*"|'[^']*')*)(/>)`, + name: "meta.element.other.invalid.html" + }, + { + begin: `(?i)(<)((\\w[^>\\s]*))(?=\\s|/?>)(?:(([^"'>]|"[^"]*"|'[^']*')*)(>))?`, + beginCaptures: { + "0": { + name: "meta.tag.other.invalid.start.html" + }, + "1": { + name: "punctuation.definition.tag.begin.html" + }, + "2": { + name: "entity.name.tag.html" + }, + "3": { + name: "invalid.illegal.unrecognized-tag.html" + }, + "4": { + patterns: [ + { + include: "#attribute" + } + ] + }, + "6": { + name: "punctuation.definition.tag.end.html" + } + }, + end: "(?i)()|(/>)|(?=)\\G", + end: "(?=/>)|>", + endCaptures: { + "0": { + name: "punctuation.definition.tag.end.html" + } + }, + name: "meta.tag.other.invalid.start.html", + patterns: [ + { + include: "#attribute" + } + ] + }, + { + include: "#tags" + } + ] + }, + { + include: "#tags-invalid" + } + ] + } + } + }, + svg: { + patterns: [ + { + begin: `(?i)(<)(svg)(?=\\s|/?>)(?:(([^"'>]|"[^"]*"|'[^']*')*)(>))?`, + beginCaptures: { + "0": { + name: "meta.tag.structure.$2.start.html" + }, + "1": { + name: "punctuation.definition.tag.begin.html" + }, + "2": { + name: "entity.name.tag.html" + }, + "3": { + patterns: [ + { + include: "#attribute" + } + ] + }, + "5": { + name: "punctuation.definition.tag.end.html" + } + }, + end: "(?i)()", + endCaptures: { + "0": { + name: "meta.tag.structure.$2.end.html" + }, + "1": { + name: "punctuation.definition.tag.begin.html" + }, + "2": { + name: "entity.name.tag.html" + }, + "3": { + name: "punctuation.definition.tag.end.html" + } + }, + name: "meta.element.structure.$2.html", + patterns: [ + { + begin: "(?)\\G", + end: ">", + endCaptures: { + "0": { + name: "punctuation.definition.tag.end.html" + } + }, + name: "meta.tag.structure.start.html", + patterns: [ + { + include: "#attribute" + } + ] + }, + { + include: "#tags" + } + ] + } + ], + repository: { + attribute: { + patterns: [ + { + begin: "(s(hape-rendering|ystemLanguage|cale|t(yle|itchTiles|op-(color|opacity)|dDeviation|em([hv])|artOffset|r(i(ng|kethrough-(thickness|position))|oke(-(opacity|dash(offset|array)|width|line(cap|join)|miterlimit))?))|urfaceScale|p(e(cular(Constant|Exponent)|ed)|acing|readMethod)|eed|lope)|h(oriz-(origin-x|adv-x)|eight|anging|ref(lang)?)|y([12]|ChannelSelector)?|n(umOctaves|ame)|c(y|o(ntentS((?:cript|tyle)Type)|lor(-(interpolation(-filters)?|profile|rendering))?)|ursor|l(ip(-(path|rule)|PathUnits)?|ass)|a(p-height|lcMode)|x)|t(ype|o|ext(-(decoration|anchor|rendering)|Length)|a(rget([XY])?|b(index|leValues))|ransform)|i(n(tercept|2)?|d(eographic)?|mage-rendering)|z(oomAndPan)?|o(p(erator|acity)|ver(flow|line-(thickness|position))|ffset|r(i(ent(ation)?|gin)|der))|d(y|i(splay|visor|ffuseConstant|rection)|ominant-baseline|ur|e(scent|celerate)|x)?|u(1|n(i(code(-(range|bidi))?|ts-per-em)|derline-(thickness|position))|2)|p(ing|oint(s(At([XYZ]))?|er-events)|a(nose-1|t(h(Length)?|tern(ContentUnits|Transform|Units))|int-order)|r(imitiveUnits|eserveA(spectRatio|lpha)))|e(n(d|able-background)|dgeMode|levation|x(ternalResourcesRequired|ponent))|v(i(sibility|ew(Box|Target))|-(hanging|ideographic|alphabetic|mathematical)|e(ctor-effect|r(sion|t-(origin-([xy])|adv-y)))|alues)|k([123]|e(y(Splines|Times|Points)|rn(ing|el(Matrix|UnitLength)))|4)?|f(y|il(ter(Res|Units)?|l(-(opacity|rule))?)|o(nt-(s(t(yle|retch)|ize(-adjust)?)|variant|family|weight)|rmat)|lood-(color|opacity)|r(om)?|x)|w(idth(s)?|ord-spacing|riting-mode)|l(i(ghting-color|mitingConeAngle)|ocal|e(ngthAdjust|tter-spacing)|ang)|a(scent|cc(umulate|ent-height)|ttribute(Name|Type)|zimuth|dditive|utoReverse|l(ignment-baseline|phabetic|lowReorder)|rabic-form|mplitude)|r(y|otate|e(s(tart|ult)|ndering-intent|peat(Count|Dur)|quired(Extensions|Features)|f([XY]|errerPolicy)|l)|adius|x)?|g([12]|lyph(Ref|-(name|orientation-(horizontal|vertical)))|radient(Transform|Units))|x([12]|ChannelSelector|-height|link:(show|href|t(ype|itle)|a(ctuate|rcrole)|role)|ml:(space|lang|base))?|m(in|ode|e(thod|dia)|a(sk((?:Content|)Units)?|thematical|rker(Height|-(start|end|mid)|Units|Width)|x))|b(y|ias|egin|ase(Profile|line-shift|Frequency)|box))(?![-:\\w])", + beginCaptures: { + "0": { + name: "entity.other.attribute-name.html" + } + }, + end: "(?=\\s*+[^=\\s])", + name: "meta.attribute.$1.html", + patterns: [ + { + include: "#attribute-interior" + } + ] + }, + { + begin: `([^\\x00- "'/<=>\\x7F-\\x{9F}\uFDD0-\uFDEF\uFFFE\uFFFF\u{1FFFE}\u{1FFFF}\u{2FFFE}\u{2FFFF}\u{3FFFE}\u{3FFFF}\\x{4FFFE}\\x{4FFFF}\\x{5FFFE}\\x{5FFFF}\\x{6FFFE}\\x{6FFFF}\\x{7FFFE}\\x{7FFFF}\\x{8FFFE}\\x{8FFFF}\\x{9FFFE}\\x{9FFFF}\\x{AFFFE}\\x{AFFFF}\\x{BFFFE}\\x{BFFFF}\\x{CFFFE}\\x{CFFFF}\\x{DFFFE}\\x{DFFFF}\\x{EFFFE}\\x{EFFFF}\\x{FFFFE}\\x{FFFFF}\\x{10FFFE}\\x{10FFFF}]+)`, + beginCaptures: { + "0": { + name: "entity.other.attribute-name.html" + } + }, + end: "(?=\\s*+[^=\\s])", + name: "meta.attribute.unrecognized.$1.html", + patterns: [ + { + include: "#attribute-interior" + } + ] + }, + { + match: "[^>\\s]+", + name: "invalid.illegal.character-not-allowed-here.html" + } + ] + }, + tags: { + patterns: [ + { + include: "#comment" + }, + { + include: "#cdata" + }, + { + captures: { + "0": { + name: "meta.tag.metadata.svg.$2.void.html" + }, + "1": { + name: "punctuation.definition.tag.begin.html" + }, + "2": { + name: "entity.name.tag.html" + }, + "3": { + patterns: [ + { + include: "#attribute" + } + ] + }, + "5": { + name: "punctuation.definition.tag.end.html" + } + }, + match: `(?i)(<)(color-profile|desc|metadata|script|style|title)(?=\\s|/?>)(([^"'>]|"[^"]*"|'[^']*')*)(/>)`, + name: "meta.element.metadata.svg.$2.html" + }, + { + begin: `(?i)(<)(color-profile|desc|metadata|script|style|title)(?=\\s|/?>)(?:(([^"'>]|"[^"]*"|'[^']*')*)(>))?`, + beginCaptures: { + "0": { + name: "meta.tag.metadata.svg.$2.start.html" + }, + "1": { + name: "punctuation.definition.tag.begin.html" + }, + "2": { + name: "entity.name.tag.html" + }, + "3": { + patterns: [ + { + include: "#attribute" + } + ] + }, + "5": { + name: "punctuation.definition.tag.end.html" + } + }, + end: "(?i)()|(/>)|(?=)\\G", + end: "(?=/>)|>", + endCaptures: { + "0": { + name: "punctuation.definition.tag.end.html" + } + }, + name: "meta.tag.metadata.start.html", + patterns: [ + { + include: "#attribute" + } + ] + }, + { + include: "#tags" + } + ] + }, + { + captures: { + "0": { + name: "meta.tag.structure.svg.$2.void.html" + }, + "1": { + name: "punctuation.definition.tag.begin.html" + }, + "2": { + name: "entity.name.tag.html" + }, + "3": { + patterns: [ + { + include: "#attribute" + } + ] + }, + "5": { + name: "punctuation.definition.tag.end.html" + } + }, + match: `(?i)(<)(animateMotion|clipPath|defs|feComponentTransfer|feDiffuseLighting|feMerge|feSpecularLighting|filter|g|hatch|linearGradient|marker|mask|mesh|meshgradient|meshpatch|meshrow|pattern|radialGradient|switch|text|textPath)(?=\\s|/?>)(([^"'>]|"[^"]*"|'[^']*')*)(/>)`, + name: "meta.element.structure.svg.$2.html" + }, + { + begin: `(?i)(<)(animateMotion|clipPath|defs|feComponentTransfer|feDiffuseLighting|feMerge|feSpecularLighting|filter|g|hatch|linearGradient|marker|mask|mesh|meshgradient|meshpatch|meshrow|pattern|radialGradient|switch|text|textPath)(?=\\s|/?>)(?:(([^"'>]|"[^"]*"|'[^']*')*)(>))?`, + beginCaptures: { + "0": { + name: "meta.tag.structure.svg.$2.start.html" + }, + "1": { + name: "punctuation.definition.tag.begin.html" + }, + "2": { + name: "entity.name.tag.html" + }, + "3": { + patterns: [ + { + include: "#attribute" + } + ] + }, + "5": { + name: "punctuation.definition.tag.end.html" + } + }, + end: "(?i)()|(/>)|(?=)\\G", + end: "(?=/>)|>", + endCaptures: { + "0": { + name: "punctuation.definition.tag.end.html" + } + }, + name: "meta.tag.structure.start.html", + patterns: [ + { + include: "#attribute" + } + ] + }, + { + include: "#tags" + } + ] + }, + { + captures: { + "0": { + name: "meta.tag.inline.svg.$2.void.html" + }, + "1": { + name: "punctuation.definition.tag.begin.html" + }, + "2": { + name: "entity.name.tag.html" + }, + "3": { + patterns: [ + { + include: "#attribute" + } + ] + }, + "5": { + name: "punctuation.definition.tag.end.html" + } + }, + match: `(?i)(<)(a|animate|discard|feBlend|feColorMatrix|feComposite|feConvolveMatrix|feDisplacementMap|feDistantLight|feDropShadow|feFlood|feFuncA|feFuncB|feFuncG|feFuncR|feGaussianBlur|feMergeNode|feMorphology|feOffset|fePointLight|feSpotLight|feTile|feTurbulence|hatchPath|mpath|set|solidcolor|stop|tspan)(?=\\s|/?>)(([^"'>]|"[^"]*"|'[^']*')*)(/>)`, + name: "meta.element.inline.svg.$2.html" + }, + { + begin: `(?i)(<)(a|animate|discard|feBlend|feColorMatrix|feComposite|feConvolveMatrix|feDisplacementMap|feDistantLight|feDropShadow|feFlood|feFuncA|feFuncB|feFuncG|feFuncR|feGaussianBlur|feMergeNode|feMorphology|feOffset|fePointLight|feSpotLight|feTile|feTurbulence|hatchPath|mpath|set|solidcolor|stop|tspan)(?=\\s|/?>)(?:(([^"'>]|"[^"]*"|'[^']*')*)(>))?`, + beginCaptures: { + "0": { + name: "meta.tag.inline.svg.$2.start.html" + }, + "1": { + name: "punctuation.definition.tag.begin.html" + }, + "2": { + name: "entity.name.tag.html" + }, + "3": { + patterns: [ + { + include: "#attribute" + } + ] + }, + "5": { + name: "punctuation.definition.tag.end.html" + } + }, + end: "(?i)()|(/>)|(?=)\\G", + end: "(?=/>)|>", + endCaptures: { + "0": { + name: "punctuation.definition.tag.end.html" + } + }, + name: "meta.tag.inline.start.html", + patterns: [ + { + include: "#attribute" + } + ] + }, + { + include: "#tags" + } + ] + }, + { + captures: { + "0": { + name: "meta.tag.object.svg.$2.void.html" + }, + "1": { + name: "punctuation.definition.tag.begin.html" + }, + "2": { + name: "entity.name.tag.html" + }, + "3": { + patterns: [ + { + include: "#attribute" + } + ] + }, + "5": { + name: "punctuation.definition.tag.end.html" + } + }, + match: `(?i)(<)(circle|ellipse|feImage|foreignObject|image|line|path|polygon|polyline|rect|symbol|use|view)(?=\\s|/?>)(([^"'>]|"[^"]*"|'[^']*')*)(/>)`, + name: "meta.element.object.svg.$2.html" + }, + { + begin: `(?i)(<)(a|circle|ellipse|feImage|foreignObject|image|line|path|polygon|polyline|rect|symbol|use|view)(?=\\s|/?>)(?:(([^"'>]|"[^"]*"|'[^']*')*)(>))?`, + beginCaptures: { + "0": { + name: "meta.tag.object.svg.$2.start.html" + }, + "1": { + name: "punctuation.definition.tag.begin.html" + }, + "2": { + name: "entity.name.tag.html" + }, + "3": { + patterns: [ + { + include: "#attribute" + } + ] + }, + "5": { + name: "punctuation.definition.tag.end.html" + } + }, + end: "(?i)()|(/>)|(?=)\\G", + end: "(?=/>)|>", + endCaptures: { + "0": { + name: "punctuation.definition.tag.end.html" + } + }, + name: "meta.tag.object.start.html", + patterns: [ + { + include: "#attribute" + } + ] + }, + { + include: "#tags" + } + ] + }, + { + captures: { + "0": { + name: "meta.tag.other.svg.$2.void.html" + }, + "1": { + name: "punctuation.definition.tag.begin.html" + }, + "2": { + name: "entity.name.tag.html" + }, + "3": { + name: "invalid.deprecated.html" + }, + "4": { + patterns: [ + { + include: "#attribute" + } + ] + }, + "6": { + name: "punctuation.definition.tag.end.html" + } + }, + match: `(?i)(<)((altGlyph|altGlyphDef|altGlyphItem|animateColor|animateTransform|cursor|font|font-face|font-face-format|font-face-name|font-face-src|font-face-uri|glyph|glyphRef|hkern|missing-glyph|tref|vkern))(?=\\s|/?>)(([^"'>]|"[^"]*"|'[^']*')*)(/>)`, + name: "meta.element.other.svg.$2.html" + }, + { + begin: `(?i)(<)((altGlyph|altGlyphDef|altGlyphItem|animateColor|animateTransform|cursor|font|font-face|font-face-format|font-face-name|font-face-src|font-face-uri|glyph|glyphRef|hkern|missing-glyph|tref|vkern))(?=\\s|/?>)(?:(([^"'>]|"[^"]*"|'[^']*')*)(>))?`, + beginCaptures: { + "0": { + name: "meta.tag.other.svg.$2.start.html" + }, + "1": { + name: "punctuation.definition.tag.begin.html" + }, + "2": { + name: "entity.name.tag.html" + }, + "3": { + name: "invalid.deprecated.html" + }, + "4": { + patterns: [ + { + include: "#attribute" + } + ] + }, + "6": { + name: "punctuation.definition.tag.end.html" + } + }, + end: "(?i)()|(/>)|(?=)\\G", + end: "(?=/>)|>", + endCaptures: { + "0": { + name: "punctuation.definition.tag.end.html" + } + }, + name: "meta.tag.other.start.html", + patterns: [ + { + include: "#attribute" + } + ] + }, + { + include: "#tags" + } + ] + }, + { + captures: { + "0": { + name: "meta.tag.other.invalid.void.html" + }, + "1": { + name: "punctuation.definition.tag.begin.html" + }, + "2": { + name: "entity.name.tag.html" + }, + "3": { + name: "invalid.illegal.unrecognized-tag.html" + }, + "4": { + patterns: [ + { + include: "#attribute" + } + ] + }, + "6": { + name: "punctuation.definition.tag.end.html" + } + }, + match: `(?i)(<)(([:\\w]+))(?=\\s|/?>)(([^"'>]|"[^"]*"|'[^']*')*)(/>)`, + name: "meta.element.other.invalid.html" + }, + { + begin: `(?i)(<)((\\w[^>\\s]*))(?=\\s|/?>)(?:(([^"'>]|"[^"]*"|'[^']*')*)(>))?`, + beginCaptures: { + "0": { + name: "meta.tag.other.invalid.start.html" + }, + "1": { + name: "punctuation.definition.tag.begin.html" + }, + "2": { + name: "entity.name.tag.html" + }, + "3": { + name: "invalid.illegal.unrecognized-tag.html" + }, + "4": { + patterns: [ + { + include: "#attribute" + } + ] + }, + "6": { + name: "punctuation.definition.tag.end.html" + } + }, + end: "(?i)()|(/>)|(?=)\\G", + end: "(?=/>)|>", + endCaptures: { + "0": { + name: "punctuation.definition.tag.end.html" + } + }, + name: "meta.tag.other.invalid.start.html", + patterns: [ + { + include: "#attribute" + } + ] + }, + { + include: "#tags" + } + ] + }, + { + include: "#tags-invalid" + } + ] + } + } + }, + "tags-invalid": { + patterns: [ + { + begin: "(\\s]*))(?)", + endCaptures: { + "1": { + name: "punctuation.definition.tag.end.html" + } + }, + name: "meta.tag.other.$2.html", + patterns: [ + { + include: "#attribute" + } + ] + } + ] + }, + "tags-valid": { + patterns: [ + { + begin: "(^[\\t ]+)?(?=<(?i:style)\\b(?!-))", + beginCaptures: { + "1": { + name: "punctuation.whitespace.embedded.leading.html" + } + }, + end: "(?!\\G)([\\t ]*$\\n?)?", + endCaptures: { + "1": { + name: "punctuation.whitespace.embedded.trailing.html" + } + }, + patterns: [ + { + begin: "(?i)(<)(style)(?=\\s|/?>)", + beginCaptures: { + "0": { + name: "meta.tag.metadata.style.start.html" + }, + "1": { + name: "punctuation.definition.tag.begin.html" + }, + "2": { + name: "entity.name.tag.html" + } + }, + end: "(?i)((<)/)(style)\\s*(>)", + endCaptures: { + "0": { + name: "meta.tag.metadata.style.end.html" + }, + "1": { + name: "punctuation.definition.tag.begin.html" + }, + "2": { + name: "source.css-ignored-vscode" + }, + "3": { + name: "entity.name.tag.html" + }, + "4": { + name: "punctuation.definition.tag.end.html" + } + }, + name: "meta.embedded.block.html", + patterns: [ + { + begin: "\\G", + captures: { + "1": { + name: "punctuation.definition.tag.end.html" + } + }, + end: "(>)", + name: "meta.tag.metadata.style.start.html", + patterns: [ + { + include: "#attribute" + } + ] + }, + { + begin: "(?!\\G)", + end: "(?=)", + endCaptures: { + "0": { + name: "meta.tag.metadata.script.end.html" + }, + "1": { + name: "punctuation.definition.tag.begin.html" + }, + "2": { + name: "entity.name.tag.html" + }, + "3": { + name: "punctuation.definition.tag.end.html" + } + }, + name: "meta.embedded.block.html", + patterns: [ + { + begin: "\\G", + end: "(?=/)", + patterns: [ + { + begin: "(>)", + beginCaptures: { + "0": { + name: "meta.tag.metadata.script.start.html" + }, + "1": { + name: "punctuation.definition.tag.end.html" + } + }, + end: "((<))(?=/(?i:script))", + endCaptures: { + "0": { + name: "meta.tag.metadata.script.end.html" + }, + "1": { + name: "punctuation.definition.tag.begin.html" + }, + "2": { + name: "source.js-ignored-vscode" + } + }, + patterns: [ + { + begin: "\\G", + end: "(?=|type(?=[=\\s])(?!\\s*=\\s*(''|""|(["']?)(text/(javascript(1\\.[0-5])?|x-javascript|jscript|livescript|(x-)?ecmascript|babel)|application/((?:(x-)?jav|(x-)?ecm)ascript)|module)["'>\\s]))))`, + name: "meta.tag.metadata.script.start.html", + patterns: [ + { + include: "#attribute" + } + ] + }, + { + begin: `(?i:(?=type\\s*=\\s*(["']?)text/(x-handlebars|(x-(handlebars-)?|ng-)?template|html)["'>\\s]))`, + end: "((<))(?=/(?i:script))", + endCaptures: { + "0": { + name: "meta.tag.metadata.script.end.html" + }, + "1": { + name: "punctuation.definition.tag.begin.html" + }, + "2": { + name: "text.html.basic" + } + }, + patterns: [ + { + begin: "\\G", + end: "(>)", + endCaptures: { + "1": { + name: "punctuation.definition.tag.end.html" + } + }, + name: "meta.tag.metadata.script.start.html", + patterns: [ + { + include: "#attribute" + } + ] + }, + { + begin: "(?!\\G)", + end: "(?=)", + endCaptures: { + "1": { + name: "punctuation.definition.tag.end.html" + } + }, + name: "meta.tag.metadata.script.start.html", + patterns: [ + { + include: "#attribute" + } + ] + }, + { + begin: "(?!\\G)", + end: "(?=)", + beginCaptures: { + "1": { + name: "punctuation.definition.tag.begin.html" + }, + "2": { + name: "entity.name.tag.html" + } + }, + end: "/?>", + endCaptures: { + "0": { + name: "punctuation.definition.tag.end.html" + } + }, + name: "meta.tag.metadata.$2.void.html", + patterns: [ + { + include: "#attribute" + } + ] + }, + { + begin: "(?i)(<)(noscript|title)(?=\\s|/?>)", + beginCaptures: { + "1": { + name: "punctuation.definition.tag.begin.html" + }, + "2": { + name: "entity.name.tag.html" + } + }, + end: ">", + endCaptures: { + "0": { + name: "punctuation.definition.tag.end.html" + } + }, + name: "meta.tag.metadata.$2.start.html", + patterns: [ + { + include: "#attribute" + } + ] + }, + { + begin: "(?i)()", + beginCaptures: { + "1": { + name: "punctuation.definition.tag.begin.html" + }, + "2": { + name: "entity.name.tag.html" + } + }, + end: ">", + endCaptures: { + "0": { + name: "punctuation.definition.tag.end.html" + } + }, + name: "meta.tag.metadata.$2.end.html", + patterns: [ + { + include: "#attribute" + } + ] + }, + { + begin: "(?i)(<)(col|hr|input)(?=\\s|/?>)", + beginCaptures: { + "1": { + name: "punctuation.definition.tag.begin.html" + }, + "2": { + name: "entity.name.tag.html" + } + }, + end: "/?>", + endCaptures: { + "0": { + name: "punctuation.definition.tag.end.html" + } + }, + name: "meta.tag.structure.$2.void.html", + patterns: [ + { + include: "#attribute" + } + ] + }, + { + begin: "(?i)(<)(address|article|aside|blockquote|body|button|caption|colgroup|datalist|dd|details|dialog|div|dl|dt|fieldset|figcaption|figure|footer|form|head|header|hgroup|html|h[1-6]|label|legend|li|main|map|menu|meter|nav|ol|optgroup|option|output|p|pre|progress|section|select|slot|summary|table|tbody|td|template|textarea|tfoot|th|thead|tr|ul)(?=\\s|/?>)", + beginCaptures: { + "1": { + name: "punctuation.definition.tag.begin.html" + }, + "2": { + name: "entity.name.tag.html" + } + }, + end: ">", + endCaptures: { + "0": { + name: "punctuation.definition.tag.end.html" + } + }, + name: "meta.tag.structure.$2.start.html", + patterns: [ + { + include: "#attribute" + } + ] + }, + { + begin: "(?i)()", + beginCaptures: { + "1": { + name: "punctuation.definition.tag.begin.html" + }, + "2": { + name: "entity.name.tag.html" + } + }, + end: ">", + endCaptures: { + "0": { + name: "punctuation.definition.tag.end.html" + } + }, + name: "meta.tag.structure.$2.end.html", + patterns: [ + { + include: "#attribute" + } + ] + }, + { + begin: "(?i)(<)(area|br|wbr)(?=\\s|/?>)", + beginCaptures: { + "1": { + name: "punctuation.definition.tag.begin.html" + }, + "2": { + name: "entity.name.tag.html" + } + }, + end: "/?>", + endCaptures: { + "0": { + name: "punctuation.definition.tag.end.html" + } + }, + name: "meta.tag.inline.$2.void.html", + patterns: [ + { + include: "#attribute" + } + ] + }, + { + begin: "(?i)(<)(a|abbr|b|bdi|bdo|cite|code|data|del|dfn|em|i|ins|kbd|mark|q|rp|rt|ruby|s|samp|small|span|strong|sub|sup|time|u|var)(?=\\s|/?>)", + beginCaptures: { + "1": { + name: "punctuation.definition.tag.begin.html" + }, + "2": { + name: "entity.name.tag.html" + } + }, + end: ">", + endCaptures: { + "0": { + name: "punctuation.definition.tag.end.html" + } + }, + name: "meta.tag.inline.$2.start.html", + patterns: [ + { + include: "#attribute" + } + ] + }, + { + begin: "(?i)()", + beginCaptures: { + "1": { + name: "punctuation.definition.tag.begin.html" + }, + "2": { + name: "entity.name.tag.html" + } + }, + end: ">", + endCaptures: { + "0": { + name: "punctuation.definition.tag.end.html" + } + }, + name: "meta.tag.inline.$2.end.html", + patterns: [ + { + include: "#attribute" + } + ] + }, + { + begin: "(?i)(<)(embed|img|param|source|track)(?=\\s|/?>)", + beginCaptures: { + "1": { + name: "punctuation.definition.tag.begin.html" + }, + "2": { + name: "entity.name.tag.html" + } + }, + end: "/?>", + endCaptures: { + "0": { + name: "punctuation.definition.tag.end.html" + } + }, + name: "meta.tag.object.$2.void.html", + patterns: [ + { + include: "#attribute" + } + ] + }, + { + begin: "(?i)(<)(audio|canvas|iframe|object|picture|video)(?=\\s|/?>)", + beginCaptures: { + "1": { + name: "punctuation.definition.tag.begin.html" + }, + "2": { + name: "entity.name.tag.html" + } + }, + end: ">", + endCaptures: { + "0": { + name: "punctuation.definition.tag.end.html" + } + }, + name: "meta.tag.object.$2.start.html", + patterns: [ + { + include: "#attribute" + } + ] + }, + { + begin: "(?i)()", + beginCaptures: { + "1": { + name: "punctuation.definition.tag.begin.html" + }, + "2": { + name: "entity.name.tag.html" + } + }, + end: ">", + endCaptures: { + "0": { + name: "punctuation.definition.tag.end.html" + } + }, + name: "meta.tag.object.$2.end.html", + patterns: [ + { + include: "#attribute" + } + ] + }, + { + begin: "(?i)(<)((basefont|isindex))(?=\\s|/?>)", + beginCaptures: { + "1": { + name: "punctuation.definition.tag.begin.html" + }, + "2": { + name: "entity.name.tag.html" + }, + "3": { + name: "invalid.deprecated.html" + } + }, + end: "/?>", + endCaptures: { + "0": { + name: "punctuation.definition.tag.end.html" + } + }, + name: "meta.tag.metadata.$2.void.html", + patterns: [ + { + include: "#attribute" + } + ] + }, + { + begin: "(?i)(<)((center|frameset|noembed|noframes))(?=\\s|/?>)", + beginCaptures: { + "1": { + name: "punctuation.definition.tag.begin.html" + }, + "2": { + name: "entity.name.tag.html" + }, + "3": { + name: "invalid.deprecated.html" + } + }, + end: ">", + endCaptures: { + "0": { + name: "punctuation.definition.tag.end.html" + } + }, + name: "meta.tag.structure.$2.start.html", + patterns: [ + { + include: "#attribute" + } + ] + }, + { + begin: "(?i)()", + beginCaptures: { + "1": { + name: "punctuation.definition.tag.begin.html" + }, + "2": { + name: "entity.name.tag.html" + }, + "3": { + name: "invalid.deprecated.html" + } + }, + end: ">", + endCaptures: { + "0": { + name: "punctuation.definition.tag.end.html" + } + }, + name: "meta.tag.structure.$2.end.html", + patterns: [ + { + include: "#attribute" + } + ] + }, + { + begin: "(?i)(<)((acronym|big|blink|font|strike|tt|xmp))(?=\\s|/?>)", + beginCaptures: { + "1": { + name: "punctuation.definition.tag.begin.html" + }, + "2": { + name: "entity.name.tag.html" + }, + "3": { + name: "invalid.deprecated.html" + } + }, + end: ">", + endCaptures: { + "0": { + name: "punctuation.definition.tag.end.html" + } + }, + name: "meta.tag.inline.$2.start.html", + patterns: [ + { + include: "#attribute" + } + ] + }, + { + begin: "(?i)()", + beginCaptures: { + "1": { + name: "punctuation.definition.tag.begin.html" + }, + "2": { + name: "entity.name.tag.html" + }, + "3": { + name: "invalid.deprecated.html" + } + }, + end: ">", + endCaptures: { + "0": { + name: "punctuation.definition.tag.end.html" + } + }, + name: "meta.tag.inline.$2.end.html", + patterns: [ + { + include: "#attribute" + } + ] + }, + { + begin: "(?i)(<)((frame))(?=\\s|/?>)", + beginCaptures: { + "1": { + name: "punctuation.definition.tag.begin.html" + }, + "2": { + name: "entity.name.tag.html" + }, + "3": { + name: "invalid.deprecated.html" + } + }, + end: "/?>", + endCaptures: { + "0": { + name: "punctuation.definition.tag.end.html" + } + }, + name: "meta.tag.object.$2.void.html", + patterns: [ + { + include: "#attribute" + } + ] + }, + { + begin: "(?i)(<)((applet))(?=\\s|/?>)", + beginCaptures: { + "1": { + name: "punctuation.definition.tag.begin.html" + }, + "2": { + name: "entity.name.tag.html" + }, + "3": { + name: "invalid.deprecated.html" + } + }, + end: ">", + endCaptures: { + "0": { + name: "punctuation.definition.tag.end.html" + } + }, + name: "meta.tag.object.$2.start.html", + patterns: [ + { + include: "#attribute" + } + ] + }, + { + begin: "(?i)()", + beginCaptures: { + "1": { + name: "punctuation.definition.tag.begin.html" + }, + "2": { + name: "entity.name.tag.html" + }, + "3": { + name: "invalid.deprecated.html" + } + }, + end: ">", + endCaptures: { + "0": { + name: "punctuation.definition.tag.end.html" + } + }, + name: "meta.tag.object.$2.end.html", + patterns: [ + { + include: "#attribute" + } + ] + }, + { + begin: "(?i)(<)((dir|keygen|listing|menuitem|plaintext|spacer))(?=\\s|/?>)", + beginCaptures: { + "1": { + name: "punctuation.definition.tag.begin.html" + }, + "2": { + name: "entity.name.tag.html" + }, + "3": { + name: "invalid.illegal.no-longer-supported.html" + } + }, + end: ">", + endCaptures: { + "0": { + name: "punctuation.definition.tag.end.html" + } + }, + name: "meta.tag.other.$2.start.html", + patterns: [ + { + include: "#attribute" + } + ] + }, + { + begin: "(?i)()", + beginCaptures: { + "1": { + name: "punctuation.definition.tag.begin.html" + }, + "2": { + name: "entity.name.tag.html" + }, + "3": { + name: "invalid.illegal.no-longer-supported.html" + } + }, + end: ">", + endCaptures: { + "0": { + name: "punctuation.definition.tag.end.html" + } + }, + name: "meta.tag.other.$2.end.html", + patterns: [ + { + include: "#attribute" + } + ] + }, + { + include: "#math" + }, + { + include: "#svg" + }, + { + begin: "(<)([A-Za-z][.0-9A-Z_a-z\xB7\xC0-\xD6\xD8-\xF6\xF8-\u037D\u037F-\u1FFF\u200C\u200D\u203F\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u{10000}-\\x{EFFFF}]*-[-.0-9A-Z_a-z\xB7\xC0-\xD6\xD8-\xF6\xF8-\u037D\u037F-\u1FFF\u200C\u200D\u203F\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u{10000}-\\x{EFFFF}]*)(?=\\s|/?>)", + beginCaptures: { + "1": { + name: "punctuation.definition.tag.begin.html" + }, + "2": { + name: "entity.name.tag.html" + } + }, + end: "/?>", + endCaptures: { + "0": { + name: "punctuation.definition.tag.end.html" + } + }, + name: "meta.tag.custom.start.html", + patterns: [ + { + include: "#attribute" + } + ] + }, + { + begin: "()", + beginCaptures: { + "1": { + name: "punctuation.definition.tag.begin.html" + }, + "2": { + name: "entity.name.tag.html" + } + }, + end: ">", + endCaptures: { + "0": { + name: "punctuation.definition.tag.end.html" + } + }, + name: "meta.tag.custom.end.html", + patterns: [ + { + include: "#attribute" + } + ] + } + ] + }, + "xml-processing": { + begin: "(<\\?)(xml)", + captures: { + "1": { + name: "punctuation.definition.tag.html" + }, + "2": { + name: "entity.name.tag.html" + } + }, + end: "(\\?>)", + name: "meta.tag.metadata.processing.xml.html", + patterns: [ + { + include: "#attribute" + } + ] + } + }, + scopeName: "text.html.basic" +}; + +// node_modules/tm-grammars/grammars/css.json +var css_default = { + displayName: "CSS", + name: "css", + patterns: [ + { + include: "#comment-block" + }, + { + include: "#escapes" + }, + { + include: "#combinators" + }, + { + include: "#selector" + }, + { + include: "#at-rules" + }, + { + include: "#rule-list" + } + ], + repository: { + "at-rules": { + patterns: [ + { + begin: "\\A\\uFEFF?(?i:(?=\\s*@charset\\b))", + end: ";|(?=$)", + endCaptures: { + "0": { + name: "punctuation.terminator.rule.css" + } + }, + name: "meta.at-rule.charset.css", + patterns: [ + { + captures: { + "1": { + name: "invalid.illegal.not-lowercase.charset.css" + }, + "2": { + name: "invalid.illegal.leading-whitespace.charset.css" + }, + "3": { + name: "invalid.illegal.no-whitespace.charset.css" + }, + "4": { + name: "invalid.illegal.whitespace.charset.css" + }, + "5": { + name: "invalid.illegal.not-double-quoted.charset.css" + }, + "6": { + name: "invalid.illegal.unclosed-string.charset.css" + }, + "7": { + name: "invalid.illegal.unexpected-characters.charset.css" + } + }, + match: '\\G((?!@charset)@\\w+)|\\G(\\s+)|(@charset\\S[^;]*)|(?<=@charset)( {2,}|\\t+)|(?<=@charset )([^";]+)|("[^"]+)$|(?<=")([^;]+)' + }, + { + captures: { + "1": { + name: "keyword.control.at-rule.charset.css" + }, + "2": { + name: "punctuation.definition.keyword.css" + } + }, + match: "((@)charset)(?=\\s)" + }, + { + begin: '"', + beginCaptures: { + "0": { + name: "punctuation.definition.string.begin.css" + } + }, + end: '"|$', + endCaptures: { + "0": { + name: "punctuation.definition.string.end.css" + } + }, + name: "string.quoted.double.css", + patterns: [ + { + begin: '(?:\\G|^)(?=[^"]+$)', + end: "$", + name: "invalid.illegal.unclosed.string.css" + } + ] + } + ] + }, + { + begin: `(?i)((@)import)(?:\\s+|$|(?=["']|/\\*))`, + beginCaptures: { + "1": { + name: "keyword.control.at-rule.import.css" + }, + "2": { + name: "punctuation.definition.keyword.css" + } + }, + end: ";", + endCaptures: { + "0": { + name: "punctuation.terminator.rule.css" + } + }, + name: "meta.at-rule.import.css", + patterns: [ + { + begin: "\\G\\s*(?=/\\*)", + end: "(?<=\\*/)\\s*", + patterns: [ + { + include: "#comment-block" + } + ] + }, + { + include: "#string" + }, + { + include: "#url" + }, + { + include: "#media-query-list" + } + ] + }, + { + begin: "(?i)((@)font-face)(?=\\s*|\\{|/\\*|$)", + beginCaptures: { + "1": { + name: "keyword.control.at-rule.font-face.css" + }, + "2": { + name: "punctuation.definition.keyword.css" + } + }, + end: "(?!\\G)", + name: "meta.at-rule.font-face.css", + patterns: [ + { + include: "#comment-block" + }, + { + include: "#escapes" + }, + { + include: "#rule-list" + } + ] + }, + { + begin: "(?i)(@)page(?=[:{\\s]|/\\*|$)", + captures: { + "0": { + name: "keyword.control.at-rule.page.css" + }, + "1": { + name: "punctuation.definition.keyword.css" + } + }, + end: "(?=\\s*($|[:;{]))", + name: "meta.at-rule.page.css", + patterns: [ + { + include: "#rule-list" + } + ] + }, + { + begin: "(?i)(?=@media([(\\s]|/\\*|$))", + end: "(?<=})(?!\\G)", + patterns: [ + { + begin: "(?i)\\G(@)media", + beginCaptures: { + "0": { + name: "keyword.control.at-rule.media.css" + }, + "1": { + name: "punctuation.definition.keyword.css" + } + }, + end: "(?=\\s*[;{])", + name: "meta.at-rule.media.header.css", + patterns: [ + { + include: "#media-query-list" + } + ] + }, + { + begin: "\\{", + beginCaptures: { + "0": { + name: "punctuation.section.media.begin.bracket.curly.css" + } + }, + end: "}", + endCaptures: { + "0": { + name: "punctuation.section.media.end.bracket.curly.css" + } + }, + name: "meta.at-rule.media.body.css", + patterns: [ + { + include: "$self" + } + ] + } + ] + }, + { + begin: `(?i)(?=@counter-style(["';{\\s]|/\\*|$))`, + end: "(?<=})(?!\\G)", + patterns: [ + { + begin: "(?i)\\G(@)counter-style", + beginCaptures: { + "0": { + name: "keyword.control.at-rule.counter-style.css" + }, + "1": { + name: "punctuation.definition.keyword.css" + } + }, + end: "(?=\\s*\\{)", + name: "meta.at-rule.counter-style.header.css", + patterns: [ + { + include: "#comment-block" + }, + { + include: "#escapes" + }, + { + captures: { + "0": { + patterns: [ + { + include: "#escapes" + } + ] + } + }, + match: "[-A-Z_a-z[^\\x00-\\x7F]](?:[-0-9A-Z_a-z[^\\x00-\\x7F]]|\\\\(?:\\h{1,6}|.))*", + name: "variable.parameter.style-name.css" + } + ] + }, + { + begin: "\\{", + beginCaptures: { + "0": { + name: "punctuation.section.property-list.begin.bracket.curly.css" + } + }, + end: "}", + endCaptures: { + "0": { + name: "punctuation.section.property-list.end.bracket.curly.css" + } + }, + name: "meta.at-rule.counter-style.body.css", + patterns: [ + { + include: "#comment-block" + }, + { + include: "#escapes" + }, + { + include: "#rule-list-innards" + } + ] + } + ] + }, + { + begin: `(?i)(?=@document(["';{\\s]|/\\*|$))`, + end: "(?<=})(?!\\G)", + patterns: [ + { + begin: "(?i)\\G(@)document", + beginCaptures: { + "0": { + name: "keyword.control.at-rule.document.css" + }, + "1": { + name: "punctuation.definition.keyword.css" + } + }, + end: "(?=\\s*[;{])", + name: "meta.at-rule.document.header.css", + patterns: [ + { + begin: "(?i)(?>>", + name: "invalid.deprecated.combinator.css" + }, + { + match: ">>|[+>~]", + name: "keyword.operator.combinator.css" + } + ] + }, + commas: { + match: ",", + name: "punctuation.separator.list.comma.css" + }, + "comment-block": { + begin: "/\\*", + beginCaptures: { + "0": { + name: "punctuation.definition.comment.begin.css" + } + }, + end: "\\*/", + endCaptures: { + "0": { + name: "punctuation.definition.comment.end.css" + } + }, + name: "comment.block.css" + }, + escapes: { + patterns: [ + { + match: "\\\\\\h{1,6}", + name: "constant.character.escape.codepoint.css" + }, + { + begin: "\\\\$\\s*", + end: "^(?]|/\\*)" + }, + "media-query": { + begin: "\\G", + end: "(?=\\s*[;{])", + patterns: [ + { + include: "#comment-block" + }, + { + include: "#escapes" + }, + { + include: "#media-types" + }, + { + match: "(?i)(?<=\\s|^|,|\\*/)(only|not)(?=[{\\s]|/\\*|$)", + name: "keyword.operator.logical.$1.media.css" + }, + { + match: "(?i)(?<=\\s|^|\\*/|\\))and(?=\\s|/\\*|$)", + name: "keyword.operator.logical.and.media.css" + }, + { + match: ",(?:(?:\\s*,)+|(?=\\s*[);{]))", + name: "invalid.illegal.comma.css" + }, + { + include: "#commas" + }, + { + begin: "\\(", + beginCaptures: { + "0": { + name: "punctuation.definition.parameters.begin.bracket.round.css" + } + }, + end: "\\)", + endCaptures: { + "0": { + name: "punctuation.definition.parameters.end.bracket.round.css" + } + }, + patterns: [ + { + include: "#media-features" + }, + { + include: "#media-feature-keywords" + }, + { + match: ":", + name: "punctuation.separator.key-value.css" + }, + { + match: ">=|<=|[<=>]", + name: "keyword.operator.comparison.css" + }, + { + captures: { + "1": { + name: "constant.numeric.css" + }, + "2": { + name: "keyword.operator.arithmetic.css" + }, + "3": { + name: "constant.numeric.css" + } + }, + match: "(\\d+)\\s*(/)\\s*(\\d+)", + name: "meta.ratio.css" + }, + { + include: "#numeric-values" + }, + { + include: "#comment-block" + } + ] + } + ] + }, + "media-query-list": { + begin: "(?=\\s*[^;{])", + end: "(?=\\s*[;{])", + patterns: [ + { + include: "#media-query" + } + ] + }, + "media-types": { + captures: { + "1": { + name: "support.constant.media.css" + }, + "2": { + name: "invalid.deprecated.constant.media.css" + } + }, + match: "(?i)(?<=^|[,\\s]|\\*/)(?:(all|print|screen|speech)|(aural|braille|embossed|handheld|projection|tty|tv))(?=$|[,;{\\s]|/\\*)" + }, + "numeric-values": { + patterns: [ + { + captures: { + "1": { + name: "punctuation.definition.constant.css" + } + }, + match: "(#)(?:\\h{3,4}|\\h{6}|\\h{8})\\b", + name: "constant.other.color.rgb-value.hex.css" + }, + { + captures: { + "1": { + name: "keyword.other.unit.percentage.css" + }, + "2": { + name: "keyword.other.unit.${2:/downcase}.css" + } + }, + match: "(?i)(?\\[{|~\\s]|/\\*)|(?:[-0-9A-Z_a-z[^\\x00-\\x7F]]|\\\\(?:\\h{1,6}|.))*(?:[]!"%-(*;\\[{|~\\s]|/\\*)", + name: "entity.other.attribute-name.class.css" + }, + { + captures: { + "1": { + name: "punctuation.definition.entity.css" + }, + "2": { + patterns: [ + { + include: "#escapes" + } + ] + } + }, + match: "(#)(-?(?![0-9])(?:[-0-9A-Z_a-z[^\\x00-\\x7F]]|\\\\(?:\\h{1,6}|.))+)(?=$|[#)+,.:>\\[{|~\\s]|/\\*)", + name: "entity.other.attribute-name.id.css" + }, + { + begin: "\\[", + beginCaptures: { + "0": { + name: "punctuation.definition.entity.begin.bracket.square.css" + } + }, + end: "]", + endCaptures: { + "0": { + name: "punctuation.definition.entity.end.bracket.square.css" + } + }, + name: "meta.attribute-selector.css", + patterns: [ + { + include: "#comment-block" + }, + { + include: "#string" + }, + { + captures: { + "1": { + name: "storage.modifier.ignore-case.css" + } + }, + match: `(?<=["'\\s]|^|\\*/)\\s*([Ii])\\s*(?=[]\\s]|/\\*|$)` + }, + { + captures: { + "1": { + name: "string.unquoted.attribute-value.css", + patterns: [ + { + include: "#escapes" + } + ] + } + }, + match: `(?<==)\\s*((?!/\\*)(?:[^]"'\\\\\\s]|\\\\.)+)` + }, + { + include: "#escapes" + }, + { + match: "[$*^|~]?=", + name: "keyword.operator.pattern.css" + }, + { + match: "\\|", + name: "punctuation.separator.css" + }, + { + captures: { + "1": { + name: "entity.other.namespace-prefix.css", + patterns: [ + { + include: "#escapes" + } + ] + } + }, + match: "(-?(?!\\d)(?:[-\\w[^\\x00-\\x7F]]|\\\\(?:\\h{1,6}|.))+|\\*)(?=\\|(?![=\\s]|$|])(?:-?(?!\\d)|[-\\\\\\w[^\\x00-\\x7F]]))" + }, + { + captures: { + "1": { + name: "entity.other.attribute-name.css", + patterns: [ + { + include: "#escapes" + } + ] + } + }, + match: "(-?(?!\\d)(?>[-\\w[^\\x00-\\x7F]]|\\\\(?:\\h{1,6}|.))+)\\s*(?=[]$*=^|~]|/\\*)" + } + ] + }, + { + include: "#pseudo-classes" + }, + { + include: "#pseudo-elements" + }, + { + include: "#functional-pseudo-classes" + }, + { + match: "(?\\[{|~\\s]|/\\*|$)", + name: "entity.name.tag.css" + }, + "unicode-range": { + captures: { + "0": { + name: "constant.other.unicode-range.css" + }, + "1": { + name: "punctuation.separator.dash.unicode-range.css" + } + }, + match: "(??\\[]|^await|[^$._[:alnum:]]await|^return|[^$._[:alnum:]]return|^yield|[^$._[:alnum:]]yield|^throw|[^$._[:alnum:]]throw|^in|[^$._[:alnum:]]in|^of|[^$._[:alnum:]]of|^typeof|[^$._[:alnum:]]typeof|&&|\\|\\||\\*)\\s*(\\{)", + beginCaptures: { + "1": { + name: "punctuation.definition.block.js" + } + }, + end: "}", + endCaptures: { + "0": { + name: "punctuation.definition.block.js" + } + }, + name: "meta.objectliteral.js", + patterns: [ + { + include: "#object-member" + } + ] + }, + "array-binding-pattern": { + begin: "(?:(\\.\\.\\.)\\s*)?(\\[)", + beginCaptures: { + "1": { + name: "keyword.operator.rest.js" + }, + "2": { + name: "punctuation.definition.binding-pattern.array.js" + } + }, + end: "]", + endCaptures: { + "0": { + name: "punctuation.definition.binding-pattern.array.js" + } + }, + patterns: [ + { + include: "#binding-element" + }, + { + include: "#punctuation-comma" + } + ] + }, + "array-binding-pattern-const": { + begin: "(?:(\\.\\.\\.)\\s*)?(\\[)", + beginCaptures: { + "1": { + name: "keyword.operator.rest.js" + }, + "2": { + name: "punctuation.definition.binding-pattern.array.js" + } + }, + end: "]", + endCaptures: { + "0": { + name: "punctuation.definition.binding-pattern.array.js" + } + }, + patterns: [ + { + include: "#binding-element-const" + }, + { + include: "#punctuation-comma" + } + ] + }, + "array-literal": { + begin: "\\s*(\\[)", + beginCaptures: { + "1": { + name: "meta.brace.square.js" + } + }, + end: "]", + endCaptures: { + "0": { + name: "meta.brace.square.js" + } + }, + name: "meta.array.literal.js", + patterns: [ + { + include: "#expression" + }, + { + include: "#punctuation-comma" + } + ] + }, + "arrow-function": { + patterns: [ + { + captures: { + "1": { + name: "storage.modifier.async.js" + }, + "2": { + name: "variable.parameter.js" + } + }, + match: "(?:(?)", + name: "meta.arrow.js" + }, + { + begin: "(?:(?]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*((\\)\\s*:)|((\\.\\.\\.\\s*)?[$_[:alpha:]][$_[:alnum:]]*\\s*:)))|(<\\s*[$_[:alpha:]][$_[:alnum:]]*\\s+extends\\s*[^=>])|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*(([$_[:alpha:]]|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|(\\.\\.\\.\\s*[$_[:alpha:]]))([^\"'()`]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))*)?\\)(\\s*:\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+)?\\s*=>)))", + beginCaptures: { + "1": { + name: "storage.modifier.async.js" + } + }, + end: "(?==>|\\{|^(\\s*(export|function|class|interface|let|var|\\busing(?=\\s+(?!in\\b|of\\b(?!\\s*(?:of\\b|=)))[$_[:alpha:]])\\b|\\bawait\\s+\\busing(?=\\s+(?!in\\b|of\\b(?!\\s*(?:of\\b|=)))[$_[:alpha:]])\\b\\b|const|import|enum|namespace|module|type|abstract|declare)\\s+))", + name: "meta.arrow.js", + patterns: [ + { + include: "#comment" + }, + { + include: "#type-parameters" + }, + { + include: "#function-parameters" + }, + { + include: "#arrow-return-type" + }, + { + include: "#possibly-arrow-return-type" + } + ] + }, + { + begin: "=>", + beginCaptures: { + "0": { + name: "storage.type.function.arrow.js" + } + }, + end: "((?<=[}\\S])(?)|((?!\\{)(?=\\S)))(?!/[*/])", + name: "meta.arrow.js", + patterns: [ + { + include: "#single-line-comment-consuming-line-ending" + }, + { + include: "#decl-block" + }, + { + include: "#expression" + } + ] + } + ] + }, + "arrow-return-type": { + begin: "(?<=\\))\\s*(:)", + beginCaptures: { + "1": { + name: "keyword.operator.type.annotation.js" + } + }, + end: "(?==>|\\{|^(\\s*(export|function|class|interface|let|var|\\busing(?=\\s+(?!in\\b|of\\b(?!\\s*(?:of\\b|=)))[$_[:alpha:]])\\b|\\bawait\\s+\\busing(?=\\s+(?!in\\b|of\\b(?!\\s*(?:of\\b|=)))[$_[:alpha:]])\\b\\b|const|import|enum|namespace|module|type|abstract|declare)\\s+))", + name: "meta.return.type.arrow.js", + patterns: [ + { + include: "#arrow-return-type-body" + } + ] + }, + "arrow-return-type-body": { + patterns: [ + { + begin: "(?<=:)(?=\\s*\\{)", + end: "(?<=})", + patterns: [ + { + include: "#type-object" + } + ] + }, + { + include: "#type-predicate-operator" + }, + { + include: "#type" + } + ] + }, + "async-modifier": { + match: "(?\\s*$)", + beginCaptures: { + "1": { + name: "punctuation.definition.comment.js" + } + }, + end: "(?=$)", + name: "comment.line.triple-slash.directive.js", + patterns: [ + { + begin: "(<)(reference|amd-dependency|amd-module)", + beginCaptures: { + "1": { + name: "punctuation.definition.tag.directive.js" + }, + "2": { + name: "entity.name.tag.directive.js" + } + }, + end: "/>", + endCaptures: { + "0": { + name: "punctuation.definition.tag.directive.js" + } + }, + name: "meta.tag.js", + patterns: [ + { + match: "path|types|no-default-lib|lib|name|resolution-mode", + name: "entity.other.attribute-name.directive.js" + }, + { + match: "=", + name: "keyword.operator.assignment.js" + }, + { + include: "#string" + } + ] + } + ] + }, + docblock: { + patterns: [ + { + captures: { + "1": { + name: "storage.type.class.jsdoc" + }, + "2": { + name: "punctuation.definition.block.tag.jsdoc" + }, + "3": { + name: "constant.language.access-type.jsdoc" + } + }, + match: "((@)a(?:ccess|pi))\\s+(p(?:rivate|rotected|ublic))\\b" + }, + { + captures: { + "1": { + name: "storage.type.class.jsdoc" + }, + "2": { + name: "punctuation.definition.block.tag.jsdoc" + }, + "3": { + name: "entity.name.type.instance.jsdoc" + }, + "4": { + name: "punctuation.definition.bracket.angle.begin.jsdoc" + }, + "5": { + name: "constant.other.email.link.underline.jsdoc" + }, + "6": { + name: "punctuation.definition.bracket.angle.end.jsdoc" + } + }, + match: "((@)author)\\s+([^*/<>@\\s](?:[^*/<>@]|\\*[^/])*)(?:\\s*(<)([^>\\s]+)(>))?" + }, + { + captures: { + "1": { + name: "storage.type.class.jsdoc" + }, + "2": { + name: "punctuation.definition.block.tag.jsdoc" + }, + "3": { + name: "entity.name.type.instance.jsdoc" + }, + "4": { + name: "keyword.operator.control.jsdoc" + }, + "5": { + name: "entity.name.type.instance.jsdoc" + } + }, + match: "((@)borrows)\\s+((?:[^*/@\\s]|\\*[^/])+)\\s+(as)\\s+((?:[^*/@\\s]|\\*[^/])+)" + }, + { + begin: "((@)example)\\s+", + beginCaptures: { + "1": { + name: "storage.type.class.jsdoc" + }, + "2": { + name: "punctuation.definition.block.tag.jsdoc" + } + }, + end: "(?=@|\\*/)", + name: "meta.example.jsdoc", + patterns: [ + { + match: "^\\s\\*\\s+" + }, + { + begin: "\\G(<)caption(>)", + beginCaptures: { + "0": { + name: "entity.name.tag.inline.jsdoc" + }, + "1": { + name: "punctuation.definition.bracket.angle.begin.jsdoc" + }, + "2": { + name: "punctuation.definition.bracket.angle.end.jsdoc" + } + }, + contentName: "constant.other.description.jsdoc", + end: "()|(?=\\*/)", + endCaptures: { + "0": { + name: "entity.name.tag.inline.jsdoc" + }, + "1": { + name: "punctuation.definition.bracket.angle.begin.jsdoc" + }, + "2": { + name: "punctuation.definition.bracket.angle.end.jsdoc" + } + } + }, + { + captures: { + "0": { + name: "source.embedded.js" + } + }, + match: "[^*@\\s](?:[^*]|\\*[^/])*" + } + ] + }, + { + captures: { + "1": { + name: "storage.type.class.jsdoc" + }, + "2": { + name: "punctuation.definition.block.tag.jsdoc" + }, + "3": { + name: "constant.language.symbol-type.jsdoc" + } + }, + match: "((@)kind)\\s+(class|constant|event|external|file|function|member|mixin|module|namespace|typedef)\\b" + }, + { + captures: { + "1": { + name: "storage.type.class.jsdoc" + }, + "2": { + name: "punctuation.definition.block.tag.jsdoc" + }, + "3": { + name: "variable.other.link.underline.jsdoc" + }, + "4": { + name: "entity.name.type.instance.jsdoc" + } + }, + match: "((@)see)\\s+(?:((?=https?://)(?:[^*\\s]|\\*[^/])+)|((?!https?://|(?:\\[[^]\\[]*])?\\{@(?:link|linkcode|linkplain|tutorial)\\b)(?:[^*/@\\s]|\\*[^/])+))" + }, + { + captures: { + "1": { + name: "storage.type.class.jsdoc" + }, + "2": { + name: "punctuation.definition.block.tag.jsdoc" + }, + "3": { + name: "variable.other.jsdoc" + } + }, + match: "((@)template)\\s+([$A-Z_a-z][]$.\\[\\w]*(?:\\s*,\\s*[$A-Z_a-z][]$.\\[\\w]*)*)" + }, + { + begin: "((@)template)\\s+(?=\\{)", + beginCaptures: { + "1": { + name: "storage.type.class.jsdoc" + }, + "2": { + name: "punctuation.definition.block.tag.jsdoc" + } + }, + end: "(?=\\s|\\*/|[^]$A-\\[_a-{}])", + patterns: [ + { + include: "#jsdoctype" + }, + { + match: "([$A-Z_a-z][]$.\\[\\w]*)", + name: "variable.other.jsdoc" + } + ] + }, + { + captures: { + "1": { + name: "storage.type.class.jsdoc" + }, + "2": { + name: "punctuation.definition.block.tag.jsdoc" + }, + "3": { + name: "variable.other.jsdoc" + } + }, + match: "((@)(?:arg|argument|const|constant|member|namespace|param|var))\\s+([$A-Z_a-z][]$.\\[\\w]*)" + }, + { + begin: "((@)typedef)\\s+(?=\\{)", + beginCaptures: { + "1": { + name: "storage.type.class.jsdoc" + }, + "2": { + name: "punctuation.definition.block.tag.jsdoc" + } + }, + end: "(?=\\s|\\*/|[^]$A-\\[_a-{}])", + patterns: [ + { + include: "#jsdoctype" + }, + { + match: "(?:[^*/@\\s]|\\*[^/])+", + name: "entity.name.type.instance.jsdoc" + } + ] + }, + { + begin: "((@)(?:arg|argument|const|constant|member|namespace|param|prop|property|var))\\s+(?=\\{)", + beginCaptures: { + "1": { + name: "storage.type.class.jsdoc" + }, + "2": { + name: "punctuation.definition.block.tag.jsdoc" + } + }, + end: "(?=\\s|\\*/|[^]$A-\\[_a-{}])", + patterns: [ + { + include: "#jsdoctype" + }, + { + match: "([$A-Z_a-z][]$.\\[\\w]*)", + name: "variable.other.jsdoc" + }, + { + captures: { + "1": { + name: "punctuation.definition.optional-value.begin.bracket.square.jsdoc" + }, + "2": { + name: "keyword.operator.assignment.jsdoc" + }, + "3": { + name: "source.embedded.js" + }, + "4": { + name: "punctuation.definition.optional-value.end.bracket.square.jsdoc" + }, + "5": { + name: "invalid.illegal.syntax.jsdoc" + } + }, + match: `(\\[)\\s*[$\\w]+(?:(?:\\[])?\\.[$\\w]+)*(?:\\s*(=)\\s*((?>"(?:\\*(?!/)|\\\\(?!")|[^*\\\\])*?"|'(?:\\*(?!/)|\\\\(?!')|[^*\\\\])*?'|\\[(?:\\*(?!/)|[^*])*?]|(?:\\*(?!/)|\\s(?!\\s*])|\\[.*?(?:]|(?=\\*/))|[^]*\\[\\s])*)*))?\\s*(?:(])((?:[^*\\s]|\\*[^/\\s])+)?|(?=\\*/))`, + name: "variable.other.jsdoc" + } + ] + }, + { + begin: "((@)(?:define|enum|exception|export|extends|lends|implements|modifies|namespace|private|protected|returns?|satisfies|suppress|this|throws|type|yields?))\\s+(?=\\{)", + beginCaptures: { + "1": { + name: "storage.type.class.jsdoc" + }, + "2": { + name: "punctuation.definition.block.tag.jsdoc" + } + }, + end: "(?=\\s|\\*/|[^]$A-\\[_a-{}])", + patterns: [ + { + include: "#jsdoctype" + } + ] + }, + { + captures: { + "1": { + name: "storage.type.class.jsdoc" + }, + "2": { + name: "punctuation.definition.block.tag.jsdoc" + }, + "3": { + name: "entity.name.type.instance.jsdoc" + } + }, + match: "((@)(?:alias|augments|callback|constructs|emits|event|fires|exports?|extends|external|function|func|host|lends|listens|interface|memberof!?|method|module|mixes|mixin|name|requires|see|this|typedef|uses))\\s+((?:[^*@{}\\s]|\\*[^/])+)" + }, + { + begin: `((@)(?:default(?:value)?|license|version))\\s+((["']))`, + beginCaptures: { + "1": { + name: "storage.type.class.jsdoc" + }, + "2": { + name: "punctuation.definition.block.tag.jsdoc" + }, + "3": { + name: "variable.other.jsdoc" + }, + "4": { + name: "punctuation.definition.string.begin.jsdoc" + } + }, + contentName: "variable.other.jsdoc", + end: "(\\3)|(?=$|\\*/)", + endCaptures: { + "0": { + name: "variable.other.jsdoc" + }, + "1": { + name: "punctuation.definition.string.end.jsdoc" + } + } + }, + { + captures: { + "1": { + name: "storage.type.class.jsdoc" + }, + "2": { + name: "punctuation.definition.block.tag.jsdoc" + }, + "3": { + name: "variable.other.jsdoc" + } + }, + match: "((@)(?:default(?:value)?|license|tutorial|variation|version))\\s+([^*\\s]+)" + }, + { + captures: { + "1": { + name: "punctuation.definition.block.tag.jsdoc" + } + }, + match: "(@)(?:abstract|access|alias|api|arg|argument|async|attribute|augments|author|beta|borrows|bubbles|callback|chainable|class|classdesc|code|config|const|constant|constructor|constructs|copyright|default|defaultvalue|define|deprecated|desc|description|dict|emits|enum|event|example|exception|exports?|extends|extension(?:_?for)?|external|externs|file|fileoverview|final|fires|for|func|function|generator|global|hideconstructor|host|ignore|implements|implicitCast|inherit[Dd]oc|inner|instance|interface|internal|kind|lends|license|listens|main|member|memberof!?|method|mixes|mixins?|modifies|module|name|namespace|noalias|nocollapse|nocompile|nosideeffects|override|overview|package|param|polymer(?:Behavior)?|preserve|private|prop|property|protected|public|read[Oo]nly|record|require[ds]|returns?|see|since|static|struct|submodule|summary|suppress|template|this|throws|todo|tutorial|type|typedef|unrestricted|uses|var|variation|version|virtual|writeOnce|yields?)\\b", + name: "storage.type.class.jsdoc" + }, + { + include: "#inline-tags" + }, + { + captures: { + "1": { + name: "storage.type.class.jsdoc" + }, + "2": { + name: "punctuation.definition.block.tag.jsdoc" + } + }, + match: "((@)[$_[:alpha:]][$_[:alnum:]]*)(?=\\s+)" + } + ] + }, + "enum-declaration": { + begin: "(?)))|((async\\s*)?(((<\\s*)$|(\\(\\s*((([\\[{]\\s*)?)$|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})\\s*((:\\s*\\{?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))|((\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])\\s*((:\\s*\\[?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*))))))|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*((\\)\\s*:)|((\\.\\.\\.\\s*)?[$_[:alpha:]][$_[:alnum:]]*\\s*:)))|(<\\s*[$_[:alpha:]][$_[:alnum:]]*\\s+extends\\s*[^=>])|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*(([$_[:alpha:]]|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|(\\.\\.\\.\\s*[$_[:alpha:]]))([^\"'()`]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))*)?\\)(\\s*:\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+)?\\s*=>)))))|(:\\s*((<)|(\\(\\s*((\\))|(\\.\\.\\.)|([$_[:alnum:]]+\\s*(([,:=?])|(\\)\\s*=>)))))))|(:\\s*(?{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))|((\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])\\s*((:\\s*\\[?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))))))|(:\\s*(=>|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(<[^<>]*>)|[^(),<=>])+=\\s*(((async\\s+)?((function\\s*[(*<])|(function\\s+)|([$_[:alpha:]][$_[:alnum:]]*\\s*=>)))|((async\\s*)?(((<\\s*)$|(\\(\\s*((([\\[{]\\s*)?)$|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})\\s*((:\\s*\\{?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))|((\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])\\s*((:\\s*\\[?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*))))))|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*((\\)\\s*:)|((\\.\\.\\.\\s*)?[$_[:alpha:]][$_[:alnum:]]*\\s*:)))|(<\\s*[$_[:alpha:]][$_[:alnum:]]*\\s+extends\\s*[^=>])|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*(([$_[:alpha:]]|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|(\\.\\.\\.\\s*[$_[:alpha:]]))([^\"'()`]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))*)?\\)(\\s*:\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+)?\\s*=>))))))" + }, + { + captures: { + "1": { + name: "storage.modifier.js" + }, + "2": { + name: "keyword.operator.rest.js" + }, + "3": { + name: "variable.parameter.js variable.language.this.js" + }, + "4": { + name: "variable.parameter.js" + }, + "5": { + name: "keyword.operator.optional.js" + } + }, + match: "(?:(??}]|\\|\\||&&|!==|$|((?>>??|\\|)=", + name: "keyword.operator.assignment.compound.bitwise.js" + }, + { + match: "<<|>>>?", + name: "keyword.operator.bitwise.shift.js" + }, + { + match: "[!=]==?", + name: "keyword.operator.comparison.js" + }, + { + match: "<=|>=|<>|[<>]", + name: "keyword.operator.relational.js" + }, + { + captures: { + "1": { + name: "keyword.operator.logical.js" + }, + "2": { + name: "keyword.operator.assignment.compound.js" + }, + "3": { + name: "keyword.operator.arithmetic.js" + } + }, + match: "(?<=[$_[:alnum:]])(!)\\s*(?:(/=)|(/)(?![*/]))" + }, + { + match: "!|&&|\\|\\||\\?\\?", + name: "keyword.operator.logical.js" + }, + { + match: "[\\&^|~]", + name: "keyword.operator.bitwise.js" + }, + { + match: "=", + name: "keyword.operator.assignment.js" + }, + { + match: "--", + name: "keyword.operator.decrement.js" + }, + { + match: "\\+\\+", + name: "keyword.operator.increment.js" + }, + { + match: "[-%*+/]", + name: "keyword.operator.arithmetic.js" + }, + { + begin: "(?<=[]$)_[:alnum:]])\\s*(?=(/\\*([^*]|(\\*[^/]))*\\*/\\s*)+(?:(/=)|(/)(?![*/])))", + end: "(/=)|(/)(?!\\*([^*]|(\\*[^/]))*\\*/)", + endCaptures: { + "1": { + name: "keyword.operator.assignment.compound.js" + }, + "2": { + name: "keyword.operator.arithmetic.js" + } + }, + patterns: [ + { + include: "#comment" + } + ] + }, + { + captures: { + "1": { + name: "keyword.operator.assignment.compound.js" + }, + "2": { + name: "keyword.operator.arithmetic.js" + } + }, + match: "(?<=[]$)_[:alnum:]])\\s*(?:(/=)|(/)(?![*/]))" + } + ] + }, + expressionPunctuations: { + patterns: [ + { + include: "#punctuation-comma" + }, + { + include: "#punctuation-accessor" + } + ] + }, + expressionWithoutIdentifiers: { + patterns: [ + { + include: "#jsx" + }, + { + include: "#string" + }, + { + include: "#regex" + }, + { + include: "#comment" + }, + { + include: "#function-expression" + }, + { + include: "#class-expression" + }, + { + include: "#arrow-function" + }, + { + include: "#paren-expression-possibly-arrow" + }, + { + include: "#cast" + }, + { + include: "#ternary-expression" + }, + { + include: "#new-expr" + }, + { + include: "#instanceof-expr" + }, + { + include: "#object-literal" + }, + { + include: "#expression-operators" + }, + { + include: "#function-call" + }, + { + include: "#literal" + }, + { + include: "#support-objects" + }, + { + include: "#paren-expression" + } + ] + }, + "field-declaration": { + begin: "(?)))|((async\\s*)?(((<\\s*)$|(\\(\\s*((([\\[{]\\s*)?)$|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})\\s*((:\\s*\\{?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))|((\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])\\s*((:\\s*\\[?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*))))))|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*((\\)\\s*:)|((\\.\\.\\.\\s*)?[$_[:alpha:]][$_[:alnum:]]*\\s*:)))|(<\\s*[$_[:alpha:]][$_[:alnum:]]*\\s+extends\\s*[^=>])|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*(([$_[:alpha:]]|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|(\\.\\.\\.\\s*[$_[:alpha:]]))([^\"'()`]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))*)?\\)(\\s*:\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+)?\\s*=>)))))|(:\\s*((<)|(\\(\\s*((\\))|(\\.\\.\\.)|([$_[:alnum:]]+\\s*(([,:=?])|(\\)\\s*=>)))))))|(:\\s*(?{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))|((\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])\\s*((:\\s*\\[?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))))))|(:\\s*(=>|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(<[^<>]*>)|[^(),<=>])+=\\s*(((async\\s+)?((function\\s*[(*<])|(function\\s+)|([$_[:alpha:]][$_[:alnum:]]*\\s*=>)))|((async\\s*)?(((<\\s*)$|(\\(\\s*((([\\[{]\\s*)?)$|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})\\s*((:\\s*\\{?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))|((\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])\\s*((:\\s*\\[?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*))))))|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*((\\)\\s*:)|((\\.\\.\\.\\s*)?[$_[:alpha:]][$_[:alnum:]]*\\s*:)))|(<\\s*[$_[:alpha:]][$_[:alnum:]]*\\s+extends\\s*[^=>])|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*(([$_[:alpha:]]|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|(\\.\\.\\.\\s*[$_[:alpha:]]))([^\"'()`]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))*)?\\)(\\s*:\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+)?\\s*=>))))))" + }, + { + match: "#?[$_[:alpha:]][$_[:alnum:]]*", + name: "meta.definition.property.js variable.object.property.js" + }, + { + match: "\\?", + name: "keyword.operator.optional.js" + }, + { + match: "!", + name: "keyword.operator.definiteassignment.js" + } + ] + }, + "for-loop": { + begin: "(?\\[]|=>|&(?!&)|\\|(?!\\|)))))([^(<>]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>|<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([$_[:alpha:]][$_[:alnum:]]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))(?=\\s*([,.<>\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^(<>]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>|<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([$_[:alpha:]][$_[:alnum:]]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))(?=\\s*([,.<>\\[]|=>|&(?!&)|\\|(?!\\|)))))([^(<>]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>)*(?))*(?)*(?\\s*)?\\())", + end: "(?<=\\))(?!(((([$_[:alpha:]][$_[:alnum:]]*)(\\s*\\??\\.\\s*(#?[$_[:alpha:]][$_[:alnum:]]*))*)|(\\??\\.\\s*#?[$_[:alpha:]][$_[:alnum:]]*))|(?<=\\)))\\s*(?:(\\?\\.\\s*)|(!))?((<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([$_[:alpha:]][$_[:alnum:]]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))(?=\\s*([,.<>\\[]|=>|&(?!&)|\\|(?!\\|)))))([^(<>]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>|<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([$_[:alpha:]][$_[:alnum:]]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))(?=\\s*([,.<>\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^(<>]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>|<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([$_[:alpha:]][$_[:alnum:]]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))(?=\\s*([,.<>\\[]|=>|&(?!&)|\\|(?!\\|)))))([^(<>]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>)*(?))*(?)*(?\\s*)?\\())", + patterns: [ + { + begin: "(?=(([$_[:alpha:]][$_[:alnum:]]*)(\\s*\\??\\.\\s*(#?[$_[:alpha:]][$_[:alnum:]]*))*)|(\\??\\.\\s*#?[$_[:alpha:]][$_[:alnum:]]*))", + end: "(?=\\s*(?:(\\?\\.\\s*)|(!))?((<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([$_[:alpha:]][$_[:alnum:]]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))(?=\\s*([,.<>\\[]|=>|&(?!&)|\\|(?!\\|)))))([^(<>]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>|<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([$_[:alpha:]][$_[:alnum:]]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))(?=\\s*([,.<>\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^(<>]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>|<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([$_[:alpha:]][$_[:alnum:]]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))(?=\\s*([,.<>\\[]|=>|&(?!&)|\\|(?!\\|)))))([^(<>]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>)*(?))*(?)*(?\\s*)?\\())", + name: "meta.function-call.js", + patterns: [ + { + include: "#function-call-target" + } + ] + }, + { + include: "#comment" + }, + { + include: "#function-call-optionals" + }, + { + include: "#type-arguments" + }, + { + include: "#paren-expression" + } + ] + }, + { + begin: "(?=(((([$_[:alpha:]][$_[:alnum:]]*)(\\s*\\??\\.\\s*(#?[$_[:alpha:]][$_[:alnum:]]*))*)|(\\??\\.\\s*#?[$_[:alpha:]][$_[:alnum:]]*))|(?<=\\)))(<\\s*[(\\[{]\\s*)$)", + end: "(?<=>)(?!(((([$_[:alpha:]][$_[:alnum:]]*)(\\s*\\??\\.\\s*(#?[$_[:alpha:]][$_[:alnum:]]*))*)|(\\??\\.\\s*#?[$_[:alpha:]][$_[:alnum:]]*))|(?<=\\)))(<\\s*[(\\[{]\\s*)$)", + patterns: [ + { + begin: "(?=(([$_[:alpha:]][$_[:alnum:]]*)(\\s*\\??\\.\\s*(#?[$_[:alpha:]][$_[:alnum:]]*))*)|(\\??\\.\\s*#?[$_[:alpha:]][$_[:alnum:]]*))", + end: "(?=(<\\s*[(\\[{]\\s*)$)", + name: "meta.function-call.js", + patterns: [ + { + include: "#function-call-target" + } + ] + }, + { + include: "#comment" + }, + { + include: "#function-call-optionals" + }, + { + include: "#type-arguments" + } + ] + } + ] + }, + "function-call-optionals": { + patterns: [ + { + match: "\\?\\.", + name: "meta.function-call.js punctuation.accessor.optional.js" + }, + { + match: "!", + name: "meta.function-call.js keyword.operator.definiteassignment.js" + } + ] + }, + "function-call-target": { + patterns: [ + { + include: "#support-function-call-identifiers" + }, + { + match: "(#?[$_[:alpha:]][$_[:alnum:]]*)", + name: "entity.name.function.js" + } + ] + }, + "function-declaration": { + begin: "(?)))|((async\\s*)?(((<\\s*)$|(\\(\\s*((([\\[{]\\s*)?)$|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})\\s*((:\\s*\\{?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))|((\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])\\s*((:\\s*\\[?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*))))))|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*((\\)\\s*:)|((\\.\\.\\.\\s*)?[$_[:alpha:]][$_[:alnum:]]*\\s*:)))|(<\\s*[$_[:alpha:]][$_[:alnum:]]*\\s+extends\\s*[^=>])|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*(([$_[:alpha:]]|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|(\\.\\.\\.\\s*[$_[:alpha:]]))([^\"'()`]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))*)?\\)(\\s*:\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+)?\\s*=>)))))" + }, + { + captures: { + "1": { + name: "punctuation.accessor.js" + }, + "2": { + name: "punctuation.accessor.optional.js" + }, + "3": { + name: "variable.other.constant.property.js" + } + }, + match: "(?:(\\.)|(\\?\\.(?!\\s*\\d)))\\s*(#?\\p{upper}[$_\\d[:upper:]]*)(?![$_[:alnum:]])" + }, + { + captures: { + "1": { + name: "punctuation.accessor.js" + }, + "2": { + name: "punctuation.accessor.optional.js" + }, + "3": { + name: "variable.other.property.js" + } + }, + match: "(?:(\\.)|(\\?\\.(?!\\s*\\d)))\\s*(#?[$_[:alpha:]][$_[:alnum:]]*)" + }, + { + match: "(\\p{upper}[$_\\d[:upper:]]*)(?![$_[:alnum:]])", + name: "variable.other.constant.js" + }, + { + match: "[$_[:alpha:]][$_[:alnum:]]*", + name: "variable.other.readwrite.js" + } + ] + }, + "if-statement": { + patterns: [ + { + begin: "(??}]|\\|\\||&&|!==|$|([!=]==?)|(([\\&^|~]\\s*)?[$_[:alpha:]][$_[:alnum:]]*\\s+instanceof(?![$_[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.)))|((?))", + end: "(/>)|()", + endCaptures: { + "1": { + name: "punctuation.definition.tag.end.js" + }, + "2": { + name: "punctuation.definition.tag.begin.js" + }, + "3": { + name: "entity.name.tag.namespace.js" + }, + "4": { + name: "punctuation.separator.namespace.js" + }, + "5": { + name: "entity.name.tag.js" + }, + "6": { + name: "support.class.component.js" + }, + "7": { + name: "punctuation.definition.tag.end.js" + } + }, + name: "meta.tag.js", + patterns: [ + { + begin: "(<)\\s*(?:([$_[:alpha:]][-$._[:alnum:]]*)(?)", + beginCaptures: { + "1": { + name: "punctuation.definition.tag.begin.js" + }, + "2": { + name: "entity.name.tag.namespace.js" + }, + "3": { + name: "punctuation.separator.namespace.js" + }, + "4": { + name: "entity.name.tag.js" + }, + "5": { + name: "support.class.component.js" + } + }, + end: "(?=/?>)", + patterns: [ + { + include: "#comment" + }, + { + include: "#type-arguments" + }, + { + include: "#jsx-tag-attributes" + } + ] + }, + { + begin: "(>)", + beginCaptures: { + "1": { + name: "punctuation.definition.tag.end.js" + } + }, + contentName: "meta.jsx.children.js", + end: "(?=|/\\*|//)" + }, + "jsx-tag-attributes": { + begin: "\\s+", + end: "(?=/?>)", + name: "meta.tag.attributes.js", + patterns: [ + { + include: "#comment" + }, + { + include: "#jsx-tag-attribute-name" + }, + { + include: "#jsx-tag-attribute-assignment" + }, + { + include: "#jsx-string-double-quoted" + }, + { + include: "#jsx-string-single-quoted" + }, + { + include: "#jsx-evaluated-code" + }, + { + include: "#jsx-tag-attributes-illegal" + } + ] + }, + "jsx-tag-attributes-illegal": { + match: "\\S+", + name: "invalid.illegal.attribute.js" + }, + "jsx-tag-in-expression": { + begin: "(??\\[{]|&&|\\|\\||\\?|\\*/|^await|[^$._[:alnum:]]await|^return|[^$._[:alnum:]]return|^default|[^$._[:alnum:]]default|^yield|[^$._[:alnum:]]yield|^)\\s*(?!<\\s*[$_[:alpha:]][$_[:alnum:]]*((\\s+extends\\s+[^=>])|,))(?=(<)\\s*(?:([$_[:alpha:]][-$._[:alnum:]]*)(?))", + end: "(?!(<)\\s*(?:([$_[:alpha:]][-$._[:alnum:]]*)(?))", + patterns: [ + { + include: "#jsx-tag" + } + ] + }, + "jsx-tag-without-attributes": { + begin: "(<)\\s*(?:([$_[:alpha:]][-$._[:alnum:]]*)(?)", + beginCaptures: { + "1": { + name: "punctuation.definition.tag.begin.js" + }, + "2": { + name: "entity.name.tag.namespace.js" + }, + "3": { + name: "punctuation.separator.namespace.js" + }, + "4": { + name: "entity.name.tag.js" + }, + "5": { + name: "support.class.component.js" + }, + "6": { + name: "punctuation.definition.tag.end.js" + } + }, + contentName: "meta.jsx.children.js", + end: "()", + endCaptures: { + "1": { + name: "punctuation.definition.tag.begin.js" + }, + "2": { + name: "entity.name.tag.namespace.js" + }, + "3": { + name: "punctuation.separator.namespace.js" + }, + "4": { + name: "entity.name.tag.js" + }, + "5": { + name: "support.class.component.js" + }, + "6": { + name: "punctuation.definition.tag.end.js" + } + }, + name: "meta.tag.without-attributes.js", + patterns: [ + { + include: "#jsx-children" + } + ] + }, + "jsx-tag-without-attributes-in-expression": { + begin: "(??\\[{]|&&|\\|\\||\\?|\\*/|^await|[^$._[:alnum:]]await|^return|[^$._[:alnum:]]return|^default|[^$._[:alnum:]]default|^yield|[^$._[:alnum:]]yield|^)\\s*(?=(<)\\s*(?:([$_[:alpha:]][-$._[:alnum:]]*)(?))", + end: "(?!(<)\\s*(?:([$_[:alpha:]][-$._[:alnum:]]*)(?))", + patterns: [ + { + include: "#jsx-tag-without-attributes" + } + ] + }, + label: { + patterns: [ + { + begin: "([$_[:alpha:]][$_[:alnum:]]*)\\s*(:)(?=\\s*\\{)", + beginCaptures: { + "1": { + name: "entity.name.label.js" + }, + "2": { + name: "punctuation.separator.label.js" + } + }, + end: "(?<=})", + patterns: [ + { + include: "#decl-block" + } + ] + }, + { + captures: { + "1": { + name: "entity.name.label.js" + }, + "2": { + name: "punctuation.separator.label.js" + } + }, + match: "([$_[:alpha:]][$_[:alnum:]]*)\\s*(:)" + } + ] + }, + literal: { + patterns: [ + { + include: "#numeric-literal" + }, + { + include: "#boolean-literal" + }, + { + include: "#null-literal" + }, + { + include: "#undefined-literal" + }, + { + include: "#numericConstant-literal" + }, + { + include: "#array-literal" + }, + { + include: "#this-literal" + }, + { + include: "#super-literal" + } + ] + }, + "method-declaration": { + patterns: [ + { + begin: "(?]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*))?\\()", + beginCaptures: { + "1": { + name: "storage.modifier.js" + }, + "2": { + name: "storage.modifier.js" + }, + "3": { + name: "storage.modifier.js" + }, + "4": { + name: "storage.modifier.async.js" + }, + "5": { + name: "keyword.operator.new.js" + }, + "6": { + name: "keyword.generator.asterisk.js" + } + }, + end: "(?=[,;}]|$)|(?<=})", + name: "meta.method.declaration.js", + patterns: [ + { + include: "#method-declaration-name" + }, + { + include: "#function-body" + } + ] + }, + { + begin: "(?]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*))?\\()", + beginCaptures: { + "1": { + name: "storage.modifier.js" + }, + "2": { + name: "storage.modifier.js" + }, + "3": { + name: "storage.modifier.js" + }, + "4": { + name: "storage.modifier.async.js" + }, + "5": { + name: "storage.type.property.js" + }, + "6": { + name: "keyword.generator.asterisk.js" + } + }, + end: "(?=[,;}]|$)|(?<=})", + name: "meta.method.declaration.js", + patterns: [ + { + include: "#method-declaration-name" + }, + { + include: "#function-body" + } + ] + } + ] + }, + "method-declaration-name": { + begin: "(?=(\\b((??}]|\\|\\||&&|!==|$|((?]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*))?\\()", + beginCaptures: { + "1": { + name: "storage.modifier.async.js" + }, + "2": { + name: "storage.type.property.js" + }, + "3": { + name: "keyword.generator.asterisk.js" + } + }, + end: "(?=[,;}])|(?<=})", + name: "meta.method.declaration.js", + patterns: [ + { + include: "#method-declaration-name" + }, + { + include: "#function-body" + }, + { + begin: "(?]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*))?\\()", + beginCaptures: { + "1": { + name: "storage.modifier.async.js" + }, + "2": { + name: "storage.type.property.js" + }, + "3": { + name: "keyword.generator.asterisk.js" + } + }, + end: "(?=[(<])", + patterns: [ + { + include: "#method-declaration-name" + } + ] + } + ] + }, + "object-member": { + patterns: [ + { + include: "#comment" + }, + { + include: "#object-literal-method-declaration" + }, + { + begin: "(?=\\[)", + end: "(?=:)|((?<=])(?=\\s*[(<]))", + name: "meta.object.member.js meta.object-literal.key.js", + patterns: [ + { + include: "#comment" + }, + { + include: "#array-literal" + } + ] + }, + { + begin: "(?=[\"'`])", + end: "(?=:)|((?<=[\"'`])(?=((\\s*[(,<}])|(\\s+(as|satisifies)\\s+))))", + name: "meta.object.member.js meta.object-literal.key.js", + patterns: [ + { + include: "#comment" + }, + { + include: "#string" + } + ] + }, + { + begin: "(?=\\b((?)))|((async\\s*)?(((<\\s*)$|(\\(\\s*((([\\[{]\\s*)?)$|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})\\s*((:\\s*\\{?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))|((\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])\\s*((:\\s*\\[?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*))))))|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*((\\)\\s*:)|((\\.\\.\\.\\s*)?[$_[:alpha:]][$_[:alnum:]]*\\s*:)))|(<\\s*[$_[:alpha:]][$_[:alnum:]]*\\s+extends\\s*[^=>])|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*(([$_[:alpha:]]|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|(\\.\\.\\.\\s*[$_[:alpha:]]))([^\"'()`]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))*)?\\)(\\s*:\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+)?\\s*=>)))))", + name: "meta.object.member.js" + }, + { + captures: { + "0": { + name: "meta.object-literal.key.js" + } + }, + match: "[$_[:alpha:]][$_[:alnum:]]*\\s*(?=(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*:)", + name: "meta.object.member.js" + }, + { + begin: "\\.\\.\\.", + beginCaptures: { + "0": { + name: "keyword.operator.spread.js" + } + }, + end: "(?=[,}])", + name: "meta.object.member.js", + patterns: [ + { + include: "#expression" + } + ] + }, + { + captures: { + "1": { + name: "variable.other.readwrite.js" + } + }, + match: "([$_[:alpha:]][$_[:alnum:]]*)\\s*(?=[,}]|$|//|/\\*)", + name: "meta.object.member.js" + }, + { + captures: { + "1": { + name: "keyword.control.as.js" + }, + "2": { + name: "storage.modifier.js" + } + }, + match: "(??}]|\\|\\||&&|!==|$|^|((?]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)\\(\\s*((([\\[{]\\s*)?)$|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})\\s*((:\\s*\\{?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))|((\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])\\s*((:\\s*\\[?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))))", + beginCaptures: { + "1": { + name: "storage.modifier.async.js" + } + }, + end: "(?<=\\))", + patterns: [ + { + include: "#type-parameters" + }, + { + begin: "\\(", + beginCaptures: { + "0": { + name: "meta.brace.round.js" + } + }, + end: "\\)", + endCaptures: { + "0": { + name: "meta.brace.round.js" + } + }, + patterns: [ + { + include: "#expression-inside-possibly-arrow-parens" + } + ] + } + ] + }, + { + begin: "(?<=:)\\s*(async)?\\s*(\\()(?=\\s*((([\\[{]\\s*)?)$|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})\\s*((:\\s*\\{?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))|((\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])\\s*((:\\s*\\[?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))))", + beginCaptures: { + "1": { + name: "storage.modifier.async.js" + }, + "2": { + name: "meta.brace.round.js" + } + }, + end: "\\)", + endCaptures: { + "0": { + name: "meta.brace.round.js" + } + }, + patterns: [ + { + include: "#expression-inside-possibly-arrow-parens" + } + ] + }, + { + begin: "(?<=:)\\s*(async)?\\s*(?=<\\s*$)", + beginCaptures: { + "1": { + name: "storage.modifier.async.js" + } + }, + end: "(?<=>)", + patterns: [ + { + include: "#type-parameters" + } + ] + }, + { + begin: "(?<=>)\\s*(\\()(?=\\s*((([\\[{]\\s*)?)$|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})\\s*((:\\s*\\{?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))|((\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])\\s*((:\\s*\\[?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))))", + beginCaptures: { + "1": { + name: "meta.brace.round.js" + } + }, + end: "\\)", + endCaptures: { + "0": { + name: "meta.brace.round.js" + } + }, + patterns: [ + { + include: "#expression-inside-possibly-arrow-parens" + } + ] + }, + { + include: "#possibly-arrow-return-type" + }, + { + include: "#expression" + } + ] + }, + { + include: "#punctuation-comma" + }, + { + include: "#decl-block" + } + ] + }, + "parameter-array-binding-pattern": { + begin: "(?:(\\.\\.\\.)\\s*)?(\\[)", + beginCaptures: { + "1": { + name: "keyword.operator.rest.js" + }, + "2": { + name: "punctuation.definition.binding-pattern.array.js" + } + }, + end: "]", + endCaptures: { + "0": { + name: "punctuation.definition.binding-pattern.array.js" + } + }, + patterns: [ + { + include: "#parameter-binding-element" + }, + { + include: "#punctuation-comma" + } + ] + }, + "parameter-binding-element": { + patterns: [ + { + include: "#comment" + }, + { + include: "#string" + }, + { + include: "#numeric-literal" + }, + { + include: "#regex" + }, + { + include: "#parameter-object-binding-pattern" + }, + { + include: "#parameter-array-binding-pattern" + }, + { + include: "#destructuring-parameter-rest" + }, + { + include: "#variable-initializer" + } + ] + }, + "parameter-name": { + patterns: [ + { + captures: { + "1": { + name: "storage.modifier.js" + } + }, + match: "(?)))|((async\\s*)?(((<\\s*)$|(\\(\\s*((([\\[{]\\s*)?)$|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})\\s*((:\\s*\\{?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))|((\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])\\s*((:\\s*\\[?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*))))))|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*((\\)\\s*:)|((\\.\\.\\.\\s*)?[$_[:alpha:]][$_[:alnum:]]*\\s*:)))|(<\\s*[$_[:alpha:]][$_[:alnum:]]*\\s+extends\\s*[^=>])|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*(([$_[:alpha:]]|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|(\\.\\.\\.\\s*[$_[:alpha:]]))([^\"'()`]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))*)?\\)(\\s*:\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+)?\\s*=>)))))|(:\\s*((<)|(\\(\\s*((\\))|(\\.\\.\\.)|([$_[:alnum:]]+\\s*(([,:=?])|(\\)\\s*=>)))))))|(:\\s*(?{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))|((\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])\\s*((:\\s*\\[?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))))))|(:\\s*(=>|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(<[^<>]*>)|[^(),<=>])+=\\s*(((async\\s+)?((function\\s*[(*<])|(function\\s+)|([$_[:alpha:]][$_[:alnum:]]*\\s*=>)))|((async\\s*)?(((<\\s*)$|(\\(\\s*((([\\[{]\\s*)?)$|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})\\s*((:\\s*\\{?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))|((\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])\\s*((:\\s*\\[?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*))))))|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*((\\)\\s*:)|((\\.\\.\\.\\s*)?[$_[:alpha:]][$_[:alnum:]]*\\s*:)))|(<\\s*[$_[:alpha:]][$_[:alnum:]]*\\s+extends\\s*[^=>])|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*(([$_[:alpha:]]|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|(\\.\\.\\.\\s*[$_[:alpha:]]))([^\"'()`]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))*)?\\)(\\s*:\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+)?\\s*=>))))))" + }, + { + captures: { + "1": { + name: "storage.modifier.js" + }, + "2": { + name: "keyword.operator.rest.js" + }, + "3": { + name: "variable.parameter.js variable.language.this.js" + }, + "4": { + name: "variable.parameter.js" + }, + "5": { + name: "keyword.operator.optional.js" + } + }, + match: "(?:(?])", + name: "meta.type.annotation.js", + patterns: [ + { + include: "#type" + } + ] + } + ] + }, + "paren-expression": { + begin: "\\(", + beginCaptures: { + "0": { + name: "meta.brace.round.js" + } + }, + end: "\\)", + endCaptures: { + "0": { + name: "meta.brace.round.js" + } + }, + patterns: [ + { + include: "#expression" + } + ] + }, + "paren-expression-possibly-arrow": { + patterns: [ + { + begin: "(?<=[(,=])\\s*(async)?(?=\\s*((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*))?\\(\\s*((([\\[{]\\s*)?)$|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})\\s*((:\\s*\\{?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))|((\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])\\s*((:\\s*\\[?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))))", + beginCaptures: { + "1": { + name: "storage.modifier.async.js" + } + }, + end: "(?<=\\))", + patterns: [ + { + include: "#paren-expression-possibly-arrow-with-typeparameters" + } + ] + }, + { + begin: "(?<=[(,=]|=>|^return|[^$._[:alnum:]]return)\\s*(async)?(?=\\s*((((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*))?\\()|(<)|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)))\\s*$)", + beginCaptures: { + "1": { + name: "storage.modifier.async.js" + } + }, + end: "(?<=\\))", + patterns: [ + { + include: "#paren-expression-possibly-arrow-with-typeparameters" + } + ] + }, + { + include: "#possibly-arrow-return-type" + } + ] + }, + "paren-expression-possibly-arrow-with-typeparameters": { + patterns: [ + { + include: "#type-parameters" + }, + { + begin: "\\(", + beginCaptures: { + "0": { + name: "meta.brace.round.js" + } + }, + end: "\\)", + endCaptures: { + "0": { + name: "meta.brace.round.js" + } + }, + patterns: [ + { + include: "#expression-inside-possibly-arrow-parens" + } + ] + } + ] + }, + "possibly-arrow-return-type": { + begin: "(?<=\\)|^)\\s*(:)(?=\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*=>)", + beginCaptures: { + "1": { + name: "meta.arrow.js meta.return.type.arrow.js keyword.operator.type.annotation.js" + } + }, + contentName: "meta.arrow.js meta.return.type.arrow.js", + end: "(?==>|\\{|^(\\s*(export|function|class|interface|let|var|\\busing(?=\\s+(?!in\\b|of\\b(?!\\s*(?:of\\b|=)))[$_[:alpha:]])\\b|\\bawait\\s+\\busing(?=\\s+(?!in\\b|of\\b(?!\\s*(?:of\\b|=)))[$_[:alpha:]])\\b\\b|const|import|enum|namespace|module|type|abstract|declare)\\s+))", + patterns: [ + { + include: "#arrow-return-type-body" + } + ] + }, + "property-accessor": { + match: "(?|&&|\\|\\||\\*/)\\s*(/)(?![*/])(?=(?:[^()/\\[\\\\]|\\\\.|\\[([^]\\\\]|\\\\.)+]|\\(([^)\\\\]|\\\\.)+\\))+/([dgimsuvy]+|(?![*/])|(?=/\\*))(?!\\s*[$0-9A-Z_a-z]))", + beginCaptures: { + "1": { + name: "punctuation.definition.string.begin.js" + } + }, + end: "(/)([dgimsuvy]*)", + endCaptures: { + "1": { + name: "punctuation.definition.string.end.js" + }, + "2": { + name: "keyword.other.js" + } + }, + name: "string.regexp.js", + patterns: [ + { + include: "#regexp" + } + ] + }, + { + begin: "((?)" + }, + { + match: "[*+?]|\\{(\\d+,\\d+|\\d+,|,\\d+|\\d+)}\\??", + name: "keyword.operator.quantifier.regexp" + }, + { + match: "\\|", + name: "keyword.operator.or.regexp" + }, + { + begin: "(\\()((\\?=)|(\\?!)|(\\?<=)|(\\?)?", + beginCaptures: { + "0": { + name: "punctuation.definition.group.regexp" + }, + "1": { + name: "punctuation.definition.group.no-capture.regexp" + }, + "2": { + name: "variable.other.regexp" + } + }, + end: "\\)", + endCaptures: { + "0": { + name: "punctuation.definition.group.regexp" + } + }, + name: "meta.group.regexp", + patterns: [ + { + include: "#regexp" + } + ] + }, + { + begin: "(\\[)(\\^)?", + beginCaptures: { + "1": { + name: "punctuation.definition.character-class.regexp" + }, + "2": { + name: "keyword.operator.negation.regexp" + } + }, + end: "(])", + endCaptures: { + "1": { + name: "punctuation.definition.character-class.regexp" + } + }, + name: "constant.other.character-class.set.regexp", + patterns: [ + { + captures: { + "1": { + name: "constant.character.numeric.regexp" + }, + "2": { + name: "constant.character.control.regexp" + }, + "3": { + name: "constant.character.escape.backslash.regexp" + }, + "4": { + name: "constant.character.numeric.regexp" + }, + "5": { + name: "constant.character.control.regexp" + }, + "6": { + name: "constant.character.escape.backslash.regexp" + } + }, + match: "(?:.|(\\\\(?:[0-7]{3}|x\\h{2}|u\\h{4}))|(\\\\c[A-Z])|(\\\\.))-(?:[^]\\\\]|(\\\\(?:[0-7]{3}|x\\h{2}|u\\h{4}))|(\\\\c[A-Z])|(\\\\.))", + name: "constant.other.character-class.range.regexp" + }, + { + include: "#regex-character-class" + } + ] + }, + { + include: "#regex-character-class" + } + ] + }, + "return-type": { + patterns: [ + { + begin: "(?<=\\))\\s*(:)(?=\\s*\\S)", + beginCaptures: { + "1": { + name: "keyword.operator.type.annotation.js" + } + }, + end: "(?]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\()|(EPSILON|MAX_SAFE_INTEGER|MAX_VALUE|MIN_SAFE_INTEGER|MIN_VALUE|NEGATIVE_INFINITY|POSITIVE_INFINITY)\\b(?!\\$))" + }, + { + captures: { + "1": { + name: "support.type.object.module.js" + }, + "2": { + name: "support.type.object.module.js" + }, + "3": { + name: "punctuation.accessor.js" + }, + "4": { + name: "punctuation.accessor.optional.js" + }, + "5": { + name: "support.type.object.module.js" + } + }, + match: "(?\\[]|=>|&(?!&)|\\|(?!\\|)))))([^(<>]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>|<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([$_[:alpha:]][$_[:alnum:]]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))(?=\\s*([,.<>\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^(<>]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>|<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([$_[:alpha:]][$_[:alnum:]]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))(?=\\s*([,.<>\\[]|=>|&(?!&)|\\|(?!\\|)))))([^(<>]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>)*(?))*(?)*(?\\s*)?`)", + end: "(?=`)", + patterns: [ + { + begin: "(?=(([$_[:alpha:]][$_[:alnum:]]*\\s*\\??\\.\\s*)*|(\\??\\.\\s*)?)([$_[:alpha:]][$_[:alnum:]]*))", + end: "(?=(<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([$_[:alpha:]][$_[:alnum:]]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))(?=\\s*([,.<>\\[]|=>|&(?!&)|\\|(?!\\|)))))([^(<>]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>|<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([$_[:alpha:]][$_[:alnum:]]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))(?=\\s*([,.<>\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^(<>]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>|<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([$_[:alpha:]][$_[:alnum:]]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))(?=\\s*([,.<>\\[]|=>|&(?!&)|\\|(?!\\|)))))([^(<>]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>)*(?))*(?)*(?\\s*)?`)", + patterns: [ + { + include: "#support-function-call-identifiers" + }, + { + match: "([$_[:alpha:]][$_[:alnum:]]*)", + name: "entity.name.function.tagged-template.js" + } + ] + }, + { + include: "#type-arguments" + } + ] + }, + { + begin: "([$_[:alpha:]][$_[:alnum:]]*)?\\s*(?=(<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([$_[:alpha:]][$_[:alnum:]]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))(?=\\s*([,.<>\\[]|=>|&(?!&)|\\|(?!\\|)))))([^(<>]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>|<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([$_[:alpha:]][$_[:alnum:]]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))(?=\\s*([,.<>\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^(<>]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>|<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([$_[:alpha:]][$_[:alnum:]]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))(?=\\s*([,.<>\\[]|=>|&(?!&)|\\|(?!\\|)))))([^(<>]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>)*(?))*(?)*(?\\s*)`)", + beginCaptures: { + "1": { + name: "entity.name.function.tagged-template.js" + } + }, + end: "(?=`)", + patterns: [ + { + include: "#type-arguments" + } + ] + } + ] + }, + "template-substitution-element": { + begin: "\\$\\{", + beginCaptures: { + "0": { + name: "punctuation.definition.template-expression.begin.js" + } + }, + contentName: "meta.embedded.line.js", + end: "}", + endCaptures: { + "0": { + name: "punctuation.definition.template-expression.end.js" + } + }, + name: "meta.template.expression.js", + patterns: [ + { + include: "#expression" + } + ] + }, + "template-type": { + patterns: [ + { + include: "#template-call" + }, + { + begin: "([$_[:alpha:]][$_[:alnum:]]*)?(`)", + beginCaptures: { + "1": { + name: "entity.name.function.tagged-template.js" + }, + "2": { + name: "string.template.js punctuation.definition.string.template.begin.js" + } + }, + contentName: "string.template.js", + end: "`", + endCaptures: { + "0": { + name: "string.template.js punctuation.definition.string.template.end.js" + } + }, + patterns: [ + { + include: "#template-type-substitution-element" + }, + { + include: "#string-character-escape" + } + ] + } + ] + }, + "template-type-substitution-element": { + begin: "\\$\\{", + beginCaptures: { + "0": { + name: "punctuation.definition.template-expression.begin.js" + } + }, + contentName: "meta.embedded.line.js", + end: "}", + endCaptures: { + "0": { + name: "punctuation.definition.template-expression.end.js" + } + }, + name: "meta.template.expression.js", + patterns: [ + { + include: "#type" + } + ] + }, + "ternary-expression": { + begin: "(?!\\?\\.\\s*\\D)(\\?)(?!\\?)", + beginCaptures: { + "1": { + name: "keyword.operator.ternary.js" + } + }, + end: "\\s*(:)", + endCaptures: { + "1": { + name: "keyword.operator.ternary.js" + } + }, + patterns: [ + { + include: "#expression" + } + ] + }, + "this-literal": { + match: "(?])|((?<=[]$)>_}[:alpha:]])\\s*(?=\\{)))", + name: "meta.type.annotation.js", + patterns: [ + { + include: "#type" + } + ] + }, + { + begin: "(:)", + beginCaptures: { + "1": { + name: "keyword.operator.type.annotation.js" + } + }, + end: "(?])|(?=^\\s*$)|((?<=[]$)>_}[:alpha:]])\\s*(?=\\{)))", + name: "meta.type.annotation.js", + patterns: [ + { + include: "#type" + } + ] + } + ] + }, + "type-arguments": { + begin: "<", + beginCaptures: { + "0": { + name: "punctuation.definition.typeparameters.begin.js" + } + }, + end: ">", + endCaptures: { + "0": { + name: "punctuation.definition.typeparameters.end.js" + } + }, + name: "meta.type.parameters.js", + patterns: [ + { + include: "#type-arguments-body" + } + ] + }, + "type-arguments-body": { + patterns: [ + { + captures: { + "0": { + name: "keyword.operator.type.js" + } + }, + match: "(?)", + patterns: [ + { + include: "#comment" + }, + { + include: "#type-parameters" + } + ] + }, + { + begin: "(?))))))", + end: "(?<=\\))", + name: "meta.type.function.js", + patterns: [ + { + include: "#function-parameters" + } + ] + } + ] + }, + "type-function-return-type": { + patterns: [ + { + begin: "(=>)(?=\\s*\\S)", + beginCaptures: { + "1": { + name: "storage.type.function.arrow.js" + } + }, + end: "(?)(??{}]|//|$)", + name: "meta.type.function.return.js", + patterns: [ + { + include: "#type-function-return-type-core" + } + ] + }, + { + begin: "=>", + beginCaptures: { + "0": { + name: "storage.type.function.arrow.js" + } + }, + end: "(?)(??{}]|//|^\\s*$)|((?<=\\S)(?=\\s*$)))", + name: "meta.type.function.return.js", + patterns: [ + { + include: "#type-function-return-type-core" + } + ] + } + ] + }, + "type-function-return-type-core": { + patterns: [ + { + include: "#comment" + }, + { + begin: "(?<==>)(?=\\s*\\{)", + end: "(?<=})", + patterns: [ + { + include: "#type-object" + } + ] + }, + { + include: "#type-predicate-operator" + }, + { + include: "#type" + } + ] + }, + "type-infer": { + patterns: [ + { + captures: { + "1": { + name: "keyword.operator.expression.infer.js" + }, + "2": { + name: "entity.name.type.js" + }, + "3": { + name: "keyword.operator.expression.extends.js" + } + }, + match: "(?)", + endCaptures: { + "1": { + name: "meta.type.parameters.js punctuation.definition.typeparameters.end.js" + } + }, + patterns: [ + { + include: "#type-arguments-body" + } + ] + }, + { + begin: "([$_[:alpha:]][$_[:alnum:]]*)\\s*(<)", + beginCaptures: { + "1": { + name: "entity.name.type.js" + }, + "2": { + name: "meta.type.parameters.js punctuation.definition.typeparameters.begin.js" + } + }, + contentName: "meta.type.parameters.js", + end: "(>)", + endCaptures: { + "1": { + name: "meta.type.parameters.js punctuation.definition.typeparameters.end.js" + } + }, + patterns: [ + { + include: "#type-arguments-body" + } + ] + }, + { + captures: { + "1": { + name: "entity.name.type.module.js" + }, + "2": { + name: "punctuation.accessor.js" + }, + "3": { + name: "punctuation.accessor.optional.js" + } + }, + match: "([$_[:alpha:]][$_[:alnum:]]*)\\s*(?:(\\.)|(\\?\\.(?!\\s*\\d)))" + }, + { + match: "[$_[:alpha:]][$_[:alnum:]]*", + name: "entity.name.type.js" + } + ] + }, + "type-object": { + begin: "\\{", + beginCaptures: { + "0": { + name: "punctuation.definition.block.js" + } + }, + end: "}", + endCaptures: { + "0": { + name: "punctuation.definition.block.js" + } + }, + name: "meta.object.type.js", + patterns: [ + { + include: "#comment" + }, + { + include: "#method-declaration" + }, + { + include: "#indexer-declaration" + }, + { + include: "#indexer-mapped-type-declaration" + }, + { + include: "#field-declaration" + }, + { + include: "#type-annotation" + }, + { + begin: "\\.\\.\\.", + beginCaptures: { + "0": { + name: "keyword.operator.spread.js" + } + }, + end: "(?=[,;}]|$)|(?<=})", + patterns: [ + { + include: "#type" + } + ] + }, + { + include: "#punctuation-comma" + }, + { + include: "#punctuation-semicolon" + }, + { + include: "#type" + } + ] + }, + "type-operators": { + patterns: [ + { + include: "#typeof-operator" + }, + { + include: "#type-infer" + }, + { + begin: "([\\&|])(?=\\s*\\{)", + beginCaptures: { + "0": { + name: "keyword.operator.type.js" + } + }, + end: "(?<=})", + patterns: [ + { + include: "#type-object" + } + ] + }, + { + begin: "[\\&|]", + beginCaptures: { + "0": { + name: "keyword.operator.type.js" + } + }, + end: "(?=\\S)" + }, + { + match: "(?)", + endCaptures: { + "1": { + name: "punctuation.definition.typeparameters.end.js" + } + }, + name: "meta.type.parameters.js", + patterns: [ + { + include: "#comment" + }, + { + match: "(?)", + name: "keyword.operator.assignment.js" + } + ] + }, + "type-paren-or-function-parameters": { + begin: "\\(", + beginCaptures: { + "0": { + name: "meta.brace.round.js" + } + }, + end: "\\)", + endCaptures: { + "0": { + name: "meta.brace.round.js" + } + }, + name: "meta.type.paren.cover.js", + patterns: [ + { + captures: { + "1": { + name: "storage.modifier.js" + }, + "2": { + name: "keyword.operator.rest.js" + }, + "3": { + name: "entity.name.function.js variable.language.this.js" + }, + "4": { + name: "entity.name.function.js" + }, + "5": { + name: "keyword.operator.optional.js" + } + }, + match: "(?:(?)))))))|(:\\s*(?{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))|((\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])\\s*((:\\s*\\[?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*))))))))" + }, + { + captures: { + "1": { + name: "storage.modifier.js" + }, + "2": { + name: "keyword.operator.rest.js" + }, + "3": { + name: "variable.parameter.js variable.language.this.js" + }, + "4": { + name: "variable.parameter.js" + }, + "5": { + name: "keyword.operator.optional.js" + } + }, + match: "(?:(??{|}]|(extends\\s+)|$|;|^\\s*$|^\\s*(?:abstract|async|\\bawait\\s+\\busing(?=\\s+(?!in\\b|of\\b(?!\\s*(?:of\\b|=)))[$_[:alpha:]])\\b\\b|break|case|catch|class|const|continue|declare|do|else|enum|export|finally|function|for|goto|if|import|interface|let|module|namespace|switch|return|throw|try|type|\\busing(?=\\s+(?!in\\b|of\\b(?!\\s*(?:of\\b|=)))[$_[:alpha:]])\\b|var|while)\\b)", + patterns: [ + { + include: "#type-arguments" + }, + { + include: "#expression" + } + ] + }, + "undefined-literal": { + match: "(?)))|((async\\s*)?(((<\\s*)$|(\\(\\s*((([\\[{]\\s*)?)$|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})\\s*((:\\s*\\{?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))|((\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])\\s*((:\\s*\\[?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*))))))|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*((\\)\\s*:)|((\\.\\.\\.\\s*)?[$_[:alpha:]][$_[:alnum:]]*\\s*:)))|(<\\s*[$_[:alpha:]][$_[:alnum:]]*\\s+extends\\s*[^=>])|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*(([$_[:alpha:]]|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|(\\.\\.\\.\\s*[$_[:alpha:]]))([^\"'()`]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))*)?\\)(\\s*:\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+)?\\s*=>)))))|(:\\s*((<)|(\\(\\s*((\\))|(\\.\\.\\.)|([$_[:alnum:]]+\\s*(([,:=?])|(\\)\\s*=>)))))))|(:\\s*(?{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))|((\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])\\s*((:\\s*\\[?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))))))|(:\\s*(=>|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(<[^<>]*>)|[^(),<=>])+=\\s*(((async\\s+)?((function\\s*[(*<])|(function\\s+)|([$_[:alpha:]][$_[:alnum:]]*\\s*=>)))|((async\\s*)?(((<\\s*)$|(\\(\\s*((([\\[{]\\s*)?)$|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})\\s*((:\\s*\\{?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))|((\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])\\s*((:\\s*\\[?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*))))))|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*((\\)\\s*:)|((\\.\\.\\.\\s*)?[$_[:alpha:]][$_[:alnum:]]*\\s*:)))|(<\\s*[$_[:alpha:]][$_[:alnum:]]*\\s+extends\\s*[^=>])|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*(([$_[:alpha:]]|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|(\\.\\.\\.\\s*[$_[:alpha:]]))([^\"'()`]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))*)?\\)(\\s*:\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+)?\\s*=>))))))", + beginCaptures: { + "1": { + name: "meta.definition.variable.js variable.other.constant.js entity.name.function.js" + } + }, + end: "(?=$|^|[,;=}]|((?)))|((async\\s*)?(((<\\s*)$|(\\(\\s*((([\\[{]\\s*)?)$|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})\\s*((:\\s*\\{?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))|((\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])\\s*((:\\s*\\[?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*))))))|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*((\\)\\s*:)|((\\.\\.\\.\\s*)?[$_[:alpha:]][$_[:alnum:]]*\\s*:)))|(<\\s*[$_[:alpha:]][$_[:alnum:]]*\\s+extends\\s*[^=>])|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*(([$_[:alpha:]]|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|(\\.\\.\\.\\s*[$_[:alpha:]]))([^\"'()`]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))*)?\\)(\\s*:\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+)?\\s*=>)))))|(:\\s*((<)|(\\(\\s*((\\))|(\\.\\.\\.)|([$_[:alnum:]]+\\s*(([,:=?])|(\\)\\s*=>)))))))|(:\\s*(?{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))|((\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])\\s*((:\\s*\\[?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))))))|(:\\s*(=>|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(<[^<>]*>)|[^(),<=>])+=\\s*(((async\\s+)?((function\\s*[(*<])|(function\\s+)|([$_[:alpha:]][$_[:alnum:]]*\\s*=>)))|((async\\s*)?(((<\\s*)$|(\\(\\s*((([\\[{]\\s*)?)$|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})\\s*((:\\s*\\{?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))|((\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])\\s*((:\\s*\\[?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*))))))|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*((\\)\\s*:)|((\\.\\.\\.\\s*)?[$_[:alpha:]][$_[:alnum:]]*\\s*:)))|(<\\s*[$_[:alpha:]][$_[:alnum:]]*\\s+extends\\s*[^=>])|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*(([$_[:alpha:]]|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|(\\.\\.\\.\\s*[$_[:alpha:]]))([^\"'()`]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))*)?\\)(\\s*:\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+)?\\s*=>))))))", + beginCaptures: { + "1": { + name: "meta.definition.variable.js entity.name.function.js" + }, + "2": { + name: "keyword.operator.definiteassignment.js" + } + }, + end: "(?=$|^|[,;=}]|((?\\s*$)", + beginCaptures: { + "1": { + name: "keyword.operator.assignment.js" + } + }, + end: "(?=$|^|[]),;}]|((??\\[]|^await|[^$._[:alnum:]]await|^return|[^$._[:alnum:]]return|^yield|[^$._[:alnum:]]yield|^throw|[^$._[:alnum:]]throw|^in|[^$._[:alnum:]]in|^of|[^$._[:alnum:]]of|^typeof|[^$._[:alnum:]]typeof|&&|\\|\\||\\*)\\s*(\\{)", + beginCaptures: { + "1": { + name: "punctuation.definition.block.ts" + } + }, + end: "}", + endCaptures: { + "0": { + name: "punctuation.definition.block.ts" + } + }, + name: "meta.objectliteral.ts", + patterns: [ + { + include: "#object-member" + } + ] + }, + "array-binding-pattern": { + begin: "(?:(\\.\\.\\.)\\s*)?(\\[)", + beginCaptures: { + "1": { + name: "keyword.operator.rest.ts" + }, + "2": { + name: "punctuation.definition.binding-pattern.array.ts" + } + }, + end: "]", + endCaptures: { + "0": { + name: "punctuation.definition.binding-pattern.array.ts" + } + }, + patterns: [ + { + include: "#binding-element" + }, + { + include: "#punctuation-comma" + } + ] + }, + "array-binding-pattern-const": { + begin: "(?:(\\.\\.\\.)\\s*)?(\\[)", + beginCaptures: { + "1": { + name: "keyword.operator.rest.ts" + }, + "2": { + name: "punctuation.definition.binding-pattern.array.ts" + } + }, + end: "]", + endCaptures: { + "0": { + name: "punctuation.definition.binding-pattern.array.ts" + } + }, + patterns: [ + { + include: "#binding-element-const" + }, + { + include: "#punctuation-comma" + } + ] + }, + "array-literal": { + begin: "\\s*(\\[)", + beginCaptures: { + "1": { + name: "meta.brace.square.ts" + } + }, + end: "]", + endCaptures: { + "0": { + name: "meta.brace.square.ts" + } + }, + name: "meta.array.literal.ts", + patterns: [ + { + include: "#expression" + }, + { + include: "#punctuation-comma" + } + ] + }, + "arrow-function": { + patterns: [ + { + captures: { + "1": { + name: "storage.modifier.async.ts" + }, + "2": { + name: "variable.parameter.ts" + } + }, + match: "(?:(?)", + name: "meta.arrow.ts" + }, + { + begin: "(?:(?]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*((\\)\\s*:)|((\\.\\.\\.\\s*)?[$_[:alpha:]][$_[:alnum:]]*\\s*:)))|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*(([$_[:alpha:]]|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|(\\.\\.\\.\\s*[$_[:alpha:]]))([^\"'()`]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))*)?\\)(\\s*:\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+)?\\s*=>)))", + beginCaptures: { + "1": { + name: "storage.modifier.async.ts" + } + }, + end: "(?==>|\\{|^(\\s*(export|function|class|interface|let|var|\\busing(?=\\s+(?!in\\b|of\\b(?!\\s*(?:of\\b|=)))[$_[:alpha:]])\\b|\\bawait\\s+\\busing(?=\\s+(?!in\\b|of\\b(?!\\s*(?:of\\b|=)))[$_[:alpha:]])\\b\\b|const|import|enum|namespace|module|type|abstract|declare)\\s+))", + name: "meta.arrow.ts", + patterns: [ + { + include: "#comment" + }, + { + include: "#type-parameters" + }, + { + include: "#function-parameters" + }, + { + include: "#arrow-return-type" + }, + { + include: "#possibly-arrow-return-type" + } + ] + }, + { + begin: "=>", + beginCaptures: { + "0": { + name: "storage.type.function.arrow.ts" + } + }, + end: "((?<=[}\\S])(?)|((?!\\{)(?=\\S)))(?!/[*/])", + name: "meta.arrow.ts", + patterns: [ + { + include: "#single-line-comment-consuming-line-ending" + }, + { + include: "#decl-block" + }, + { + include: "#expression" + } + ] + } + ] + }, + "arrow-return-type": { + begin: "(?<=\\))\\s*(:)", + beginCaptures: { + "1": { + name: "keyword.operator.type.annotation.ts" + } + }, + end: "(?==>|\\{|^(\\s*(export|function|class|interface|let|var|\\busing(?=\\s+(?!in\\b|of\\b(?!\\s*(?:of\\b|=)))[$_[:alpha:]])\\b|\\bawait\\s+\\busing(?=\\s+(?!in\\b|of\\b(?!\\s*(?:of\\b|=)))[$_[:alpha:]])\\b\\b|const|import|enum|namespace|module|type|abstract|declare)\\s+))", + name: "meta.return.type.arrow.ts", + patterns: [ + { + include: "#arrow-return-type-body" + } + ] + }, + "arrow-return-type-body": { + patterns: [ + { + begin: "(?<=:)(?=\\s*\\{)", + end: "(?<=})", + patterns: [ + { + include: "#type-object" + } + ] + }, + { + include: "#type-predicate-operator" + }, + { + include: "#type" + } + ] + }, + "async-modifier": { + match: "(?)", + name: "cast.expr.ts" + }, + { + begin: "(??^|]|[^$_[:alnum:]](?:\\+\\+|--)|[^+]\\+|[^-]-)\\s*(<)(?!)", + endCaptures: { + "1": { + name: "meta.brace.angle.ts" + } + }, + name: "cast.expr.ts", + patterns: [ + { + include: "#type" + } + ] + }, + { + begin: "(?<=^)\\s*(<)(?=[$_[:alpha:]][$_[:alnum:]]*\\s*>)", + beginCaptures: { + "1": { + name: "meta.brace.angle.ts" + } + }, + end: "(>)", + endCaptures: { + "1": { + name: "meta.brace.angle.ts" + } + }, + name: "cast.expr.ts", + patterns: [ + { + include: "#type" + } + ] + } + ] + }, + "class-declaration": { + begin: "(?\\s*$)", + beginCaptures: { + "1": { + name: "punctuation.definition.comment.ts" + } + }, + end: "(?=$)", + name: "comment.line.triple-slash.directive.ts", + patterns: [ + { + begin: "(<)(reference|amd-dependency|amd-module)", + beginCaptures: { + "1": { + name: "punctuation.definition.tag.directive.ts" + }, + "2": { + name: "entity.name.tag.directive.ts" + } + }, + end: "/>", + endCaptures: { + "0": { + name: "punctuation.definition.tag.directive.ts" + } + }, + name: "meta.tag.ts", + patterns: [ + { + match: "path|types|no-default-lib|lib|name|resolution-mode", + name: "entity.other.attribute-name.directive.ts" + }, + { + match: "=", + name: "keyword.operator.assignment.ts" + }, + { + include: "#string" + } + ] + } + ] + }, + docblock: { + patterns: [ + { + captures: { + "1": { + name: "storage.type.class.jsdoc" + }, + "2": { + name: "punctuation.definition.block.tag.jsdoc" + }, + "3": { + name: "constant.language.access-type.jsdoc" + } + }, + match: "((@)a(?:ccess|pi))\\s+(p(?:rivate|rotected|ublic))\\b" + }, + { + captures: { + "1": { + name: "storage.type.class.jsdoc" + }, + "2": { + name: "punctuation.definition.block.tag.jsdoc" + }, + "3": { + name: "entity.name.type.instance.jsdoc" + }, + "4": { + name: "punctuation.definition.bracket.angle.begin.jsdoc" + }, + "5": { + name: "constant.other.email.link.underline.jsdoc" + }, + "6": { + name: "punctuation.definition.bracket.angle.end.jsdoc" + } + }, + match: "((@)author)\\s+([^*/<>@\\s](?:[^*/<>@]|\\*[^/])*)(?:\\s*(<)([^>\\s]+)(>))?" + }, + { + captures: { + "1": { + name: "storage.type.class.jsdoc" + }, + "2": { + name: "punctuation.definition.block.tag.jsdoc" + }, + "3": { + name: "entity.name.type.instance.jsdoc" + }, + "4": { + name: "keyword.operator.control.jsdoc" + }, + "5": { + name: "entity.name.type.instance.jsdoc" + } + }, + match: "((@)borrows)\\s+((?:[^*/@\\s]|\\*[^/])+)\\s+(as)\\s+((?:[^*/@\\s]|\\*[^/])+)" + }, + { + begin: "((@)example)\\s+", + beginCaptures: { + "1": { + name: "storage.type.class.jsdoc" + }, + "2": { + name: "punctuation.definition.block.tag.jsdoc" + } + }, + end: "(?=@|\\*/)", + name: "meta.example.jsdoc", + patterns: [ + { + match: "^\\s\\*\\s+" + }, + { + begin: "\\G(<)caption(>)", + beginCaptures: { + "0": { + name: "entity.name.tag.inline.jsdoc" + }, + "1": { + name: "punctuation.definition.bracket.angle.begin.jsdoc" + }, + "2": { + name: "punctuation.definition.bracket.angle.end.jsdoc" + } + }, + contentName: "constant.other.description.jsdoc", + end: "()|(?=\\*/)", + endCaptures: { + "0": { + name: "entity.name.tag.inline.jsdoc" + }, + "1": { + name: "punctuation.definition.bracket.angle.begin.jsdoc" + }, + "2": { + name: "punctuation.definition.bracket.angle.end.jsdoc" + } + } + }, + { + captures: { + "0": { + name: "source.embedded.ts" + } + }, + match: "[^*@\\s](?:[^*]|\\*[^/])*" + } + ] + }, + { + captures: { + "1": { + name: "storage.type.class.jsdoc" + }, + "2": { + name: "punctuation.definition.block.tag.jsdoc" + }, + "3": { + name: "constant.language.symbol-type.jsdoc" + } + }, + match: "((@)kind)\\s+(class|constant|event|external|file|function|member|mixin|module|namespace|typedef)\\b" + }, + { + captures: { + "1": { + name: "storage.type.class.jsdoc" + }, + "2": { + name: "punctuation.definition.block.tag.jsdoc" + }, + "3": { + name: "variable.other.link.underline.jsdoc" + }, + "4": { + name: "entity.name.type.instance.jsdoc" + } + }, + match: "((@)see)\\s+(?:((?=https?://)(?:[^*\\s]|\\*[^/])+)|((?!https?://|(?:\\[[^]\\[]*])?\\{@(?:link|linkcode|linkplain|tutorial)\\b)(?:[^*/@\\s]|\\*[^/])+))" + }, + { + captures: { + "1": { + name: "storage.type.class.jsdoc" + }, + "2": { + name: "punctuation.definition.block.tag.jsdoc" + }, + "3": { + name: "variable.other.jsdoc" + } + }, + match: "((@)template)\\s+([$A-Z_a-z][]$.\\[\\w]*(?:\\s*,\\s*[$A-Z_a-z][]$.\\[\\w]*)*)" + }, + { + begin: "((@)template)\\s+(?=\\{)", + beginCaptures: { + "1": { + name: "storage.type.class.jsdoc" + }, + "2": { + name: "punctuation.definition.block.tag.jsdoc" + } + }, + end: "(?=\\s|\\*/|[^]$A-\\[_a-{}])", + patterns: [ + { + include: "#jsdoctype" + }, + { + match: "([$A-Z_a-z][]$.\\[\\w]*)", + name: "variable.other.jsdoc" + } + ] + }, + { + captures: { + "1": { + name: "storage.type.class.jsdoc" + }, + "2": { + name: "punctuation.definition.block.tag.jsdoc" + }, + "3": { + name: "variable.other.jsdoc" + } + }, + match: "((@)(?:arg|argument|const|constant|member|namespace|param|var))\\s+([$A-Z_a-z][]$.\\[\\w]*)" + }, + { + begin: "((@)typedef)\\s+(?=\\{)", + beginCaptures: { + "1": { + name: "storage.type.class.jsdoc" + }, + "2": { + name: "punctuation.definition.block.tag.jsdoc" + } + }, + end: "(?=\\s|\\*/|[^]$A-\\[_a-{}])", + patterns: [ + { + include: "#jsdoctype" + }, + { + match: "(?:[^*/@\\s]|\\*[^/])+", + name: "entity.name.type.instance.jsdoc" + } + ] + }, + { + begin: "((@)(?:arg|argument|const|constant|member|namespace|param|prop|property|var))\\s+(?=\\{)", + beginCaptures: { + "1": { + name: "storage.type.class.jsdoc" + }, + "2": { + name: "punctuation.definition.block.tag.jsdoc" + } + }, + end: "(?=\\s|\\*/|[^]$A-\\[_a-{}])", + patterns: [ + { + include: "#jsdoctype" + }, + { + match: "([$A-Z_a-z][]$.\\[\\w]*)", + name: "variable.other.jsdoc" + }, + { + captures: { + "1": { + name: "punctuation.definition.optional-value.begin.bracket.square.jsdoc" + }, + "2": { + name: "keyword.operator.assignment.jsdoc" + }, + "3": { + name: "source.embedded.ts" + }, + "4": { + name: "punctuation.definition.optional-value.end.bracket.square.jsdoc" + }, + "5": { + name: "invalid.illegal.syntax.jsdoc" + } + }, + match: `(\\[)\\s*[$\\w]+(?:(?:\\[])?\\.[$\\w]+)*(?:\\s*(=)\\s*((?>"(?:\\*(?!/)|\\\\(?!")|[^*\\\\])*?"|'(?:\\*(?!/)|\\\\(?!')|[^*\\\\])*?'|\\[(?:\\*(?!/)|[^*])*?]|(?:\\*(?!/)|\\s(?!\\s*])|\\[.*?(?:]|(?=\\*/))|[^]*\\[\\s])*)*))?\\s*(?:(])((?:[^*\\s]|\\*[^/\\s])+)?|(?=\\*/))`, + name: "variable.other.jsdoc" + } + ] + }, + { + begin: "((@)(?:define|enum|exception|export|extends|lends|implements|modifies|namespace|private|protected|returns?|satisfies|suppress|this|throws|type|yields?))\\s+(?=\\{)", + beginCaptures: { + "1": { + name: "storage.type.class.jsdoc" + }, + "2": { + name: "punctuation.definition.block.tag.jsdoc" + } + }, + end: "(?=\\s|\\*/|[^]$A-\\[_a-{}])", + patterns: [ + { + include: "#jsdoctype" + } + ] + }, + { + captures: { + "1": { + name: "storage.type.class.jsdoc" + }, + "2": { + name: "punctuation.definition.block.tag.jsdoc" + }, + "3": { + name: "entity.name.type.instance.jsdoc" + } + }, + match: "((@)(?:alias|augments|callback|constructs|emits|event|fires|exports?|extends|external|function|func|host|lends|listens|interface|memberof!?|method|module|mixes|mixin|name|requires|see|this|typedef|uses))\\s+((?:[^*@{}\\s]|\\*[^/])+)" + }, + { + begin: `((@)(?:default(?:value)?|license|version))\\s+((["']))`, + beginCaptures: { + "1": { + name: "storage.type.class.jsdoc" + }, + "2": { + name: "punctuation.definition.block.tag.jsdoc" + }, + "3": { + name: "variable.other.jsdoc" + }, + "4": { + name: "punctuation.definition.string.begin.jsdoc" + } + }, + contentName: "variable.other.jsdoc", + end: "(\\3)|(?=$|\\*/)", + endCaptures: { + "0": { + name: "variable.other.jsdoc" + }, + "1": { + name: "punctuation.definition.string.end.jsdoc" + } + } + }, + { + captures: { + "1": { + name: "storage.type.class.jsdoc" + }, + "2": { + name: "punctuation.definition.block.tag.jsdoc" + }, + "3": { + name: "variable.other.jsdoc" + } + }, + match: "((@)(?:default(?:value)?|license|tutorial|variation|version))\\s+([^*\\s]+)" + }, + { + captures: { + "1": { + name: "punctuation.definition.block.tag.jsdoc" + } + }, + match: "(@)(?:abstract|access|alias|api|arg|argument|async|attribute|augments|author|beta|borrows|bubbles|callback|chainable|class|classdesc|code|config|const|constant|constructor|constructs|copyright|default|defaultvalue|define|deprecated|desc|description|dict|emits|enum|event|example|exception|exports?|extends|extension(?:_?for)?|external|externs|file|fileoverview|final|fires|for|func|function|generator|global|hideconstructor|host|ignore|implements|implicitCast|inherit[Dd]oc|inner|instance|interface|internal|kind|lends|license|listens|main|member|memberof!?|method|mixes|mixins?|modifies|module|name|namespace|noalias|nocollapse|nocompile|nosideeffects|override|overview|package|param|polymer(?:Behavior)?|preserve|private|prop|property|protected|public|read[Oo]nly|record|require[ds]|returns?|see|since|static|struct|submodule|summary|suppress|template|this|throws|todo|tutorial|type|typedef|unrestricted|uses|var|variation|version|virtual|writeOnce|yields?)\\b", + name: "storage.type.class.jsdoc" + }, + { + include: "#inline-tags" + }, + { + captures: { + "1": { + name: "storage.type.class.jsdoc" + }, + "2": { + name: "punctuation.definition.block.tag.jsdoc" + } + }, + match: "((@)[$_[:alpha:]][$_[:alnum:]]*)(?=\\s+)" + } + ] + }, + "enum-declaration": { + begin: "(?)))|((async\\s*)?(((<\\s*)$|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*((([\\[{]\\s*)?)$|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})\\s*((:\\s*\\{?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))|((\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])\\s*((:\\s*\\[?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*))))))|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*((\\)\\s*:)|((\\.\\.\\.\\s*)?[$_[:alpha:]][$_[:alnum:]]*\\s*:)))|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*(([$_[:alpha:]]|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|(\\.\\.\\.\\s*[$_[:alpha:]]))([^\"'()`]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))*)?\\)(\\s*:\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+)?\\s*=>)))))|(:\\s*((<)|(\\(\\s*((\\))|(\\.\\.\\.)|([$_[:alnum:]]+\\s*(([,:=?])|(\\)\\s*=>)))))))|(:\\s*(?]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*((([\\[{]\\s*)?)$|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})\\s*((:\\s*\\{?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))|((\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])\\s*((:\\s*\\[?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))))))|(:\\s*(=>|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(<[^<>]*>)|[^(),<=>])+=\\s*(((async\\s+)?((function\\s*[(*<])|(function\\s+)|([$_[:alpha:]][$_[:alnum:]]*\\s*=>)))|((async\\s*)?(((<\\s*)$|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*((([\\[{]\\s*)?)$|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})\\s*((:\\s*\\{?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))|((\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])\\s*((:\\s*\\[?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*))))))|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*((\\)\\s*:)|((\\.\\.\\.\\s*)?[$_[:alpha:]][$_[:alnum:]]*\\s*:)))|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*(([$_[:alpha:]]|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|(\\.\\.\\.\\s*[$_[:alpha:]]))([^\"'()`]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))*)?\\)(\\s*:\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+)?\\s*=>))))))" + }, + { + captures: { + "1": { + name: "storage.modifier.ts" + }, + "2": { + name: "keyword.operator.rest.ts" + }, + "3": { + name: "variable.parameter.ts variable.language.this.ts" + }, + "4": { + name: "variable.parameter.ts" + }, + "5": { + name: "keyword.operator.optional.ts" + } + }, + match: "(?:(??}]|\\|\\||&&|!==|$|((?>>??|\\|)=", + name: "keyword.operator.assignment.compound.bitwise.ts" + }, + { + match: "<<|>>>?", + name: "keyword.operator.bitwise.shift.ts" + }, + { + match: "[!=]==?", + name: "keyword.operator.comparison.ts" + }, + { + match: "<=|>=|<>|[<>]", + name: "keyword.operator.relational.ts" + }, + { + captures: { + "1": { + name: "keyword.operator.logical.ts" + }, + "2": { + name: "keyword.operator.assignment.compound.ts" + }, + "3": { + name: "keyword.operator.arithmetic.ts" + } + }, + match: "(?<=[$_[:alnum:]])(!)\\s*(?:(/=)|(/)(?![*/]))" + }, + { + match: "!|&&|\\|\\||\\?\\?", + name: "keyword.operator.logical.ts" + }, + { + match: "[\\&^|~]", + name: "keyword.operator.bitwise.ts" + }, + { + match: "=", + name: "keyword.operator.assignment.ts" + }, + { + match: "--", + name: "keyword.operator.decrement.ts" + }, + { + match: "\\+\\+", + name: "keyword.operator.increment.ts" + }, + { + match: "[-%*+/]", + name: "keyword.operator.arithmetic.ts" + }, + { + begin: "(?<=[]$)_[:alnum:]])\\s*(?=(/\\*([^*]|(\\*[^/]))*\\*/\\s*)+(?:(/=)|(/)(?![*/])))", + end: "(/=)|(/)(?!\\*([^*]|(\\*[^/]))*\\*/)", + endCaptures: { + "1": { + name: "keyword.operator.assignment.compound.ts" + }, + "2": { + name: "keyword.operator.arithmetic.ts" + } + }, + patterns: [ + { + include: "#comment" + } + ] + }, + { + captures: { + "1": { + name: "keyword.operator.assignment.compound.ts" + }, + "2": { + name: "keyword.operator.arithmetic.ts" + } + }, + match: "(?<=[]$)_[:alnum:]])\\s*(?:(/=)|(/)(?![*/]))" + } + ] + }, + expressionPunctuations: { + patterns: [ + { + include: "#punctuation-comma" + }, + { + include: "#punctuation-accessor" + } + ] + }, + expressionWithoutIdentifiers: { + patterns: [ + { + include: "#string" + }, + { + include: "#regex" + }, + { + include: "#comment" + }, + { + include: "#function-expression" + }, + { + include: "#class-expression" + }, + { + include: "#arrow-function" + }, + { + include: "#paren-expression-possibly-arrow" + }, + { + include: "#cast" + }, + { + include: "#ternary-expression" + }, + { + include: "#new-expr" + }, + { + include: "#instanceof-expr" + }, + { + include: "#object-literal" + }, + { + include: "#expression-operators" + }, + { + include: "#function-call" + }, + { + include: "#literal" + }, + { + include: "#support-objects" + }, + { + include: "#paren-expression" + } + ] + }, + "field-declaration": { + begin: "(?)))|((async\\s*)?(((<\\s*)$|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*((([\\[{]\\s*)?)$|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})\\s*((:\\s*\\{?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))|((\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])\\s*((:\\s*\\[?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*))))))|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*((\\)\\s*:)|((\\.\\.\\.\\s*)?[$_[:alpha:]][$_[:alnum:]]*\\s*:)))|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*(([$_[:alpha:]]|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|(\\.\\.\\.\\s*[$_[:alpha:]]))([^\"'()`]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))*)?\\)(\\s*:\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+)?\\s*=>)))))|(:\\s*((<)|(\\(\\s*((\\))|(\\.\\.\\.)|([$_[:alnum:]]+\\s*(([,:=?])|(\\)\\s*=>)))))))|(:\\s*(?]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*((([\\[{]\\s*)?)$|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})\\s*((:\\s*\\{?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))|((\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])\\s*((:\\s*\\[?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))))))|(:\\s*(=>|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(<[^<>]*>)|[^(),<=>])+=\\s*(((async\\s+)?((function\\s*[(*<])|(function\\s+)|([$_[:alpha:]][$_[:alnum:]]*\\s*=>)))|((async\\s*)?(((<\\s*)$|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*((([\\[{]\\s*)?)$|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})\\s*((:\\s*\\{?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))|((\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])\\s*((:\\s*\\[?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*))))))|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*((\\)\\s*:)|((\\.\\.\\.\\s*)?[$_[:alpha:]][$_[:alnum:]]*\\s*:)))|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*(([$_[:alpha:]]|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|(\\.\\.\\.\\s*[$_[:alpha:]]))([^\"'()`]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))*)?\\)(\\s*:\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+)?\\s*=>))))))" + }, + { + match: "#?[$_[:alpha:]][$_[:alnum:]]*", + name: "meta.definition.property.ts variable.object.property.ts" + }, + { + match: "\\?", + name: "keyword.operator.optional.ts" + }, + { + match: "!", + name: "keyword.operator.definiteassignment.ts" + } + ] + }, + "for-loop": { + begin: "(?\\[]|=>|&(?!&)|\\|(?!\\|)))))([^(<>]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>|<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([$_[:alpha:]][$_[:alnum:]]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))(?=\\s*([,.<>\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^(<>]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>|<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([$_[:alpha:]][$_[:alnum:]]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))(?=\\s*([,.<>\\[]|=>|&(?!&)|\\|(?!\\|)))))([^(<>]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>)*(?))*(?)*(?\\s*)?\\())", + end: "(?<=\\))(?!(((([$_[:alpha:]][$_[:alnum:]]*)(\\s*\\??\\.\\s*(#?[$_[:alpha:]][$_[:alnum:]]*))*)|(\\??\\.\\s*#?[$_[:alpha:]][$_[:alnum:]]*))|(?<=\\)))\\s*(?:(\\?\\.\\s*)|(!))?((<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([$_[:alpha:]][$_[:alnum:]]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))(?=\\s*([,.<>\\[]|=>|&(?!&)|\\|(?!\\|)))))([^(<>]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>|<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([$_[:alpha:]][$_[:alnum:]]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))(?=\\s*([,.<>\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^(<>]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>|<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([$_[:alpha:]][$_[:alnum:]]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))(?=\\s*([,.<>\\[]|=>|&(?!&)|\\|(?!\\|)))))([^(<>]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>)*(?))*(?)*(?\\s*)?\\())", + patterns: [ + { + begin: "(?=(([$_[:alpha:]][$_[:alnum:]]*)(\\s*\\??\\.\\s*(#?[$_[:alpha:]][$_[:alnum:]]*))*)|(\\??\\.\\s*#?[$_[:alpha:]][$_[:alnum:]]*))", + end: "(?=\\s*(?:(\\?\\.\\s*)|(!))?((<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([$_[:alpha:]][$_[:alnum:]]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))(?=\\s*([,.<>\\[]|=>|&(?!&)|\\|(?!\\|)))))([^(<>]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>|<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([$_[:alpha:]][$_[:alnum:]]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))(?=\\s*([,.<>\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^(<>]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>|<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([$_[:alpha:]][$_[:alnum:]]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))(?=\\s*([,.<>\\[]|=>|&(?!&)|\\|(?!\\|)))))([^(<>]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>)*(?))*(?)*(?\\s*)?\\())", + name: "meta.function-call.ts", + patterns: [ + { + include: "#function-call-target" + } + ] + }, + { + include: "#comment" + }, + { + include: "#function-call-optionals" + }, + { + include: "#type-arguments" + }, + { + include: "#paren-expression" + } + ] + }, + { + begin: "(?=(((([$_[:alpha:]][$_[:alnum:]]*)(\\s*\\??\\.\\s*(#?[$_[:alpha:]][$_[:alnum:]]*))*)|(\\??\\.\\s*#?[$_[:alpha:]][$_[:alnum:]]*))|(?<=\\)))(<\\s*[(\\[{]\\s*)$)", + end: "(?<=>)(?!(((([$_[:alpha:]][$_[:alnum:]]*)(\\s*\\??\\.\\s*(#?[$_[:alpha:]][$_[:alnum:]]*))*)|(\\??\\.\\s*#?[$_[:alpha:]][$_[:alnum:]]*))|(?<=\\)))(<\\s*[(\\[{]\\s*)$)", + patterns: [ + { + begin: "(?=(([$_[:alpha:]][$_[:alnum:]]*)(\\s*\\??\\.\\s*(#?[$_[:alpha:]][$_[:alnum:]]*))*)|(\\??\\.\\s*#?[$_[:alpha:]][$_[:alnum:]]*))", + end: "(?=(<\\s*[(\\[{]\\s*)$)", + name: "meta.function-call.ts", + patterns: [ + { + include: "#function-call-target" + } + ] + }, + { + include: "#comment" + }, + { + include: "#function-call-optionals" + }, + { + include: "#type-arguments" + } + ] + } + ] + }, + "function-call-optionals": { + patterns: [ + { + match: "\\?\\.", + name: "meta.function-call.ts punctuation.accessor.optional.ts" + }, + { + match: "!", + name: "meta.function-call.ts keyword.operator.definiteassignment.ts" + } + ] + }, + "function-call-target": { + patterns: [ + { + include: "#support-function-call-identifiers" + }, + { + match: "(#?[$_[:alpha:]][$_[:alnum:]]*)", + name: "entity.name.function.ts" + } + ] + }, + "function-declaration": { + begin: "(?)))|((async\\s*)?(((<\\s*)$|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*((([\\[{]\\s*)?)$|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})\\s*((:\\s*\\{?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))|((\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])\\s*((:\\s*\\[?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*))))))|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*((\\)\\s*:)|((\\.\\.\\.\\s*)?[$_[:alpha:]][$_[:alnum:]]*\\s*:)))|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*(([$_[:alpha:]]|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|(\\.\\.\\.\\s*[$_[:alpha:]]))([^\"'()`]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))*)?\\)(\\s*:\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+)?\\s*=>)))))" + }, + { + captures: { + "1": { + name: "punctuation.accessor.ts" + }, + "2": { + name: "punctuation.accessor.optional.ts" + }, + "3": { + name: "variable.other.constant.property.ts" + } + }, + match: "(?:(\\.)|(\\?\\.(?!\\s*\\d)))\\s*(#?\\p{upper}[$_\\d[:upper:]]*)(?![$_[:alnum:]])" + }, + { + captures: { + "1": { + name: "punctuation.accessor.ts" + }, + "2": { + name: "punctuation.accessor.optional.ts" + }, + "3": { + name: "variable.other.property.ts" + } + }, + match: "(?:(\\.)|(\\?\\.(?!\\s*\\d)))\\s*(#?[$_[:alpha:]][$_[:alnum:]]*)" + }, + { + match: "(\\p{upper}[$_\\d[:upper:]]*)(?![$_[:alnum:]])", + name: "variable.other.constant.ts" + }, + { + match: "[$_[:alpha:]][$_[:alnum:]]*", + name: "variable.other.readwrite.ts" + } + ] + }, + "if-statement": { + patterns: [ + { + begin: "(??}]|\\|\\||&&|!==|$|([!=]==?)|(([\\&^|~]\\s*)?[$_[:alpha:]][$_[:alnum:]]*\\s+instanceof(?![$_[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.)))|((?]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*))?\\()", + beginCaptures: { + "1": { + name: "storage.modifier.ts" + }, + "2": { + name: "storage.modifier.ts" + }, + "3": { + name: "storage.modifier.ts" + }, + "4": { + name: "storage.modifier.async.ts" + }, + "5": { + name: "keyword.operator.new.ts" + }, + "6": { + name: "keyword.generator.asterisk.ts" + } + }, + end: "(?=[,;}]|$)|(?<=})", + name: "meta.method.declaration.ts", + patterns: [ + { + include: "#method-declaration-name" + }, + { + include: "#function-body" + } + ] + }, + { + begin: "(?]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*))?\\()", + beginCaptures: { + "1": { + name: "storage.modifier.ts" + }, + "2": { + name: "storage.modifier.ts" + }, + "3": { + name: "storage.modifier.ts" + }, + "4": { + name: "storage.modifier.async.ts" + }, + "5": { + name: "storage.type.property.ts" + }, + "6": { + name: "keyword.generator.asterisk.ts" + } + }, + end: "(?=[,;}]|$)|(?<=})", + name: "meta.method.declaration.ts", + patterns: [ + { + include: "#method-declaration-name" + }, + { + include: "#function-body" + } + ] + } + ] + }, + "method-declaration-name": { + begin: "(?=(\\b((??}]|\\|\\||&&|!==|$|((?]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*))?\\()", + beginCaptures: { + "1": { + name: "storage.modifier.async.ts" + }, + "2": { + name: "storage.type.property.ts" + }, + "3": { + name: "keyword.generator.asterisk.ts" + } + }, + end: "(?=[,;}])|(?<=})", + name: "meta.method.declaration.ts", + patterns: [ + { + include: "#method-declaration-name" + }, + { + include: "#function-body" + }, + { + begin: "(?]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*))?\\()", + beginCaptures: { + "1": { + name: "storage.modifier.async.ts" + }, + "2": { + name: "storage.type.property.ts" + }, + "3": { + name: "keyword.generator.asterisk.ts" + } + }, + end: "(?=[(<])", + patterns: [ + { + include: "#method-declaration-name" + } + ] + } + ] + }, + "object-member": { + patterns: [ + { + include: "#comment" + }, + { + include: "#object-literal-method-declaration" + }, + { + begin: "(?=\\[)", + end: "(?=:)|((?<=])(?=\\s*[(<]))", + name: "meta.object.member.ts meta.object-literal.key.ts", + patterns: [ + { + include: "#comment" + }, + { + include: "#array-literal" + } + ] + }, + { + begin: "(?=[\"'`])", + end: "(?=:)|((?<=[\"'`])(?=((\\s*[(,<}])|(\\s+(as|satisifies)\\s+))))", + name: "meta.object.member.ts meta.object-literal.key.ts", + patterns: [ + { + include: "#comment" + }, + { + include: "#string" + } + ] + }, + { + begin: "(?=\\b((?)))|((async\\s*)?(((<\\s*)$|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*((([\\[{]\\s*)?)$|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})\\s*((:\\s*\\{?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))|((\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])\\s*((:\\s*\\[?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*))))))|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*((\\)\\s*:)|((\\.\\.\\.\\s*)?[$_[:alpha:]][$_[:alnum:]]*\\s*:)))|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*(([$_[:alpha:]]|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|(\\.\\.\\.\\s*[$_[:alpha:]]))([^\"'()`]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))*)?\\)(\\s*:\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+)?\\s*=>)))))", + name: "meta.object.member.ts" + }, + { + captures: { + "0": { + name: "meta.object-literal.key.ts" + } + }, + match: "[$_[:alpha:]][$_[:alnum:]]*\\s*(?=(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*:)", + name: "meta.object.member.ts" + }, + { + begin: "\\.\\.\\.", + beginCaptures: { + "0": { + name: "keyword.operator.spread.ts" + } + }, + end: "(?=[,}])", + name: "meta.object.member.ts", + patterns: [ + { + include: "#expression" + } + ] + }, + { + captures: { + "1": { + name: "variable.other.readwrite.ts" + } + }, + match: "([$_[:alpha:]][$_[:alnum:]]*)\\s*(?=[,}]|$|//|/\\*)", + name: "meta.object.member.ts" + }, + { + captures: { + "1": { + name: "keyword.control.as.ts" + }, + "2": { + name: "storage.modifier.ts" + } + }, + match: "(??}]|\\|\\||&&|!==|$|^|((?]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)\\(\\s*((([\\[{]\\s*)?)$|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})\\s*((:\\s*\\{?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))|((\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])\\s*((:\\s*\\[?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))))", + beginCaptures: { + "1": { + name: "storage.modifier.async.ts" + } + }, + end: "(?<=\\))", + patterns: [ + { + include: "#type-parameters" + }, + { + begin: "\\(", + beginCaptures: { + "0": { + name: "meta.brace.round.ts" + } + }, + end: "\\)", + endCaptures: { + "0": { + name: "meta.brace.round.ts" + } + }, + patterns: [ + { + include: "#expression-inside-possibly-arrow-parens" + } + ] + } + ] + }, + { + begin: "(?<=:)\\s*(async)?\\s*(\\()(?=\\s*((([\\[{]\\s*)?)$|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})\\s*((:\\s*\\{?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))|((\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])\\s*((:\\s*\\[?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))))", + beginCaptures: { + "1": { + name: "storage.modifier.async.ts" + }, + "2": { + name: "meta.brace.round.ts" + } + }, + end: "\\)", + endCaptures: { + "0": { + name: "meta.brace.round.ts" + } + }, + patterns: [ + { + include: "#expression-inside-possibly-arrow-parens" + } + ] + }, + { + begin: "(?<=:)\\s*(async)?\\s*(?=<\\s*$)", + beginCaptures: { + "1": { + name: "storage.modifier.async.ts" + } + }, + end: "(?<=>)", + patterns: [ + { + include: "#type-parameters" + } + ] + }, + { + begin: "(?<=>)\\s*(\\()(?=\\s*((([\\[{]\\s*)?)$|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})\\s*((:\\s*\\{?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))|((\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])\\s*((:\\s*\\[?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))))", + beginCaptures: { + "1": { + name: "meta.brace.round.ts" + } + }, + end: "\\)", + endCaptures: { + "0": { + name: "meta.brace.round.ts" + } + }, + patterns: [ + { + include: "#expression-inside-possibly-arrow-parens" + } + ] + }, + { + include: "#possibly-arrow-return-type" + }, + { + include: "#expression" + } + ] + }, + { + include: "#punctuation-comma" + }, + { + include: "#decl-block" + } + ] + }, + "parameter-array-binding-pattern": { + begin: "(?:(\\.\\.\\.)\\s*)?(\\[)", + beginCaptures: { + "1": { + name: "keyword.operator.rest.ts" + }, + "2": { + name: "punctuation.definition.binding-pattern.array.ts" + } + }, + end: "]", + endCaptures: { + "0": { + name: "punctuation.definition.binding-pattern.array.ts" + } + }, + patterns: [ + { + include: "#parameter-binding-element" + }, + { + include: "#punctuation-comma" + } + ] + }, + "parameter-binding-element": { + patterns: [ + { + include: "#comment" + }, + { + include: "#string" + }, + { + include: "#numeric-literal" + }, + { + include: "#regex" + }, + { + include: "#parameter-object-binding-pattern" + }, + { + include: "#parameter-array-binding-pattern" + }, + { + include: "#destructuring-parameter-rest" + }, + { + include: "#variable-initializer" + } + ] + }, + "parameter-name": { + patterns: [ + { + captures: { + "1": { + name: "storage.modifier.ts" + } + }, + match: "(?)))|((async\\s*)?(((<\\s*)$|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*((([\\[{]\\s*)?)$|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})\\s*((:\\s*\\{?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))|((\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])\\s*((:\\s*\\[?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*))))))|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*((\\)\\s*:)|((\\.\\.\\.\\s*)?[$_[:alpha:]][$_[:alnum:]]*\\s*:)))|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*(([$_[:alpha:]]|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|(\\.\\.\\.\\s*[$_[:alpha:]]))([^\"'()`]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))*)?\\)(\\s*:\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+)?\\s*=>)))))|(:\\s*((<)|(\\(\\s*((\\))|(\\.\\.\\.)|([$_[:alnum:]]+\\s*(([,:=?])|(\\)\\s*=>)))))))|(:\\s*(?]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*((([\\[{]\\s*)?)$|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})\\s*((:\\s*\\{?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))|((\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])\\s*((:\\s*\\[?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))))))|(:\\s*(=>|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(<[^<>]*>)|[^(),<=>])+=\\s*(((async\\s+)?((function\\s*[(*<])|(function\\s+)|([$_[:alpha:]][$_[:alnum:]]*\\s*=>)))|((async\\s*)?(((<\\s*)$|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*((([\\[{]\\s*)?)$|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})\\s*((:\\s*\\{?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))|((\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])\\s*((:\\s*\\[?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*))))))|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*((\\)\\s*:)|((\\.\\.\\.\\s*)?[$_[:alpha:]][$_[:alnum:]]*\\s*:)))|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*(([$_[:alpha:]]|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|(\\.\\.\\.\\s*[$_[:alpha:]]))([^\"'()`]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))*)?\\)(\\s*:\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+)?\\s*=>))))))" + }, + { + captures: { + "1": { + name: "storage.modifier.ts" + }, + "2": { + name: "keyword.operator.rest.ts" + }, + "3": { + name: "variable.parameter.ts variable.language.this.ts" + }, + "4": { + name: "variable.parameter.ts" + }, + "5": { + name: "keyword.operator.optional.ts" + } + }, + match: "(?:(?])", + name: "meta.type.annotation.ts", + patterns: [ + { + include: "#type" + } + ] + } + ] + }, + "paren-expression": { + begin: "\\(", + beginCaptures: { + "0": { + name: "meta.brace.round.ts" + } + }, + end: "\\)", + endCaptures: { + "0": { + name: "meta.brace.round.ts" + } + }, + patterns: [ + { + include: "#expression" + } + ] + }, + "paren-expression-possibly-arrow": { + patterns: [ + { + begin: "(?<=[(,=])\\s*(async)?(?=\\s*((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*))?\\(\\s*((([\\[{]\\s*)?)$|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})\\s*((:\\s*\\{?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))|((\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])\\s*((:\\s*\\[?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))))", + beginCaptures: { + "1": { + name: "storage.modifier.async.ts" + } + }, + end: "(?<=\\))", + patterns: [ + { + include: "#paren-expression-possibly-arrow-with-typeparameters" + } + ] + }, + { + begin: "(?<=[(,=]|=>|^return|[^$._[:alnum:]]return)\\s*(async)?(?=\\s*((((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*))?\\()|(<)|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)))\\s*$)", + beginCaptures: { + "1": { + name: "storage.modifier.async.ts" + } + }, + end: "(?<=\\))", + patterns: [ + { + include: "#paren-expression-possibly-arrow-with-typeparameters" + } + ] + }, + { + include: "#possibly-arrow-return-type" + } + ] + }, + "paren-expression-possibly-arrow-with-typeparameters": { + patterns: [ + { + include: "#type-parameters" + }, + { + begin: "\\(", + beginCaptures: { + "0": { + name: "meta.brace.round.ts" + } + }, + end: "\\)", + endCaptures: { + "0": { + name: "meta.brace.round.ts" + } + }, + patterns: [ + { + include: "#expression-inside-possibly-arrow-parens" + } + ] + } + ] + }, + "possibly-arrow-return-type": { + begin: "(?<=\\)|^)\\s*(:)(?=\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*=>)", + beginCaptures: { + "1": { + name: "meta.arrow.ts meta.return.type.arrow.ts keyword.operator.type.annotation.ts" + } + }, + contentName: "meta.arrow.ts meta.return.type.arrow.ts", + end: "(?==>|\\{|^(\\s*(export|function|class|interface|let|var|\\busing(?=\\s+(?!in\\b|of\\b(?!\\s*(?:of\\b|=)))[$_[:alpha:]])\\b|\\bawait\\s+\\busing(?=\\s+(?!in\\b|of\\b(?!\\s*(?:of\\b|=)))[$_[:alpha:]])\\b\\b|const|import|enum|namespace|module|type|abstract|declare)\\s+))", + patterns: [ + { + include: "#arrow-return-type-body" + } + ] + }, + "property-accessor": { + match: "(?|&&|\\|\\||\\*/)\\s*(/)(?![*/])(?=(?:[^()/\\[\\\\]|\\\\.|\\[([^]\\\\]|\\\\.)+]|\\(([^)\\\\]|\\\\.)+\\))+/([dgimsuvy]+|(?![*/])|(?=/\\*))(?!\\s*[$0-9A-Z_a-z]))", + beginCaptures: { + "1": { + name: "punctuation.definition.string.begin.ts" + } + }, + end: "(/)([dgimsuvy]*)", + endCaptures: { + "1": { + name: "punctuation.definition.string.end.ts" + }, + "2": { + name: "keyword.other.ts" + } + }, + name: "string.regexp.ts", + patterns: [ + { + include: "#regexp" + } + ] + }, + { + begin: "((?)" + }, + { + match: "[*+?]|\\{(\\d+,\\d+|\\d+,|,\\d+|\\d+)}\\??", + name: "keyword.operator.quantifier.regexp" + }, + { + match: "\\|", + name: "keyword.operator.or.regexp" + }, + { + begin: "(\\()((\\?=)|(\\?!)|(\\?<=)|(\\?)?", + beginCaptures: { + "0": { + name: "punctuation.definition.group.regexp" + }, + "1": { + name: "punctuation.definition.group.no-capture.regexp" + }, + "2": { + name: "variable.other.regexp" + } + }, + end: "\\)", + endCaptures: { + "0": { + name: "punctuation.definition.group.regexp" + } + }, + name: "meta.group.regexp", + patterns: [ + { + include: "#regexp" + } + ] + }, + { + begin: "(\\[)(\\^)?", + beginCaptures: { + "1": { + name: "punctuation.definition.character-class.regexp" + }, + "2": { + name: "keyword.operator.negation.regexp" + } + }, + end: "(])", + endCaptures: { + "1": { + name: "punctuation.definition.character-class.regexp" + } + }, + name: "constant.other.character-class.set.regexp", + patterns: [ + { + captures: { + "1": { + name: "constant.character.numeric.regexp" + }, + "2": { + name: "constant.character.control.regexp" + }, + "3": { + name: "constant.character.escape.backslash.regexp" + }, + "4": { + name: "constant.character.numeric.regexp" + }, + "5": { + name: "constant.character.control.regexp" + }, + "6": { + name: "constant.character.escape.backslash.regexp" + } + }, + match: "(?:.|(\\\\(?:[0-7]{3}|x\\h{2}|u\\h{4}))|(\\\\c[A-Z])|(\\\\.))-(?:[^]\\\\]|(\\\\(?:[0-7]{3}|x\\h{2}|u\\h{4}))|(\\\\c[A-Z])|(\\\\.))", + name: "constant.other.character-class.range.regexp" + }, + { + include: "#regex-character-class" + } + ] + }, + { + include: "#regex-character-class" + } + ] + }, + "return-type": { + patterns: [ + { + begin: "(?<=\\))\\s*(:)(?=\\s*\\S)", + beginCaptures: { + "1": { + name: "keyword.operator.type.annotation.ts" + } + }, + end: "(?]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\()|(EPSILON|MAX_SAFE_INTEGER|MAX_VALUE|MIN_SAFE_INTEGER|MIN_VALUE|NEGATIVE_INFINITY|POSITIVE_INFINITY)\\b(?!\\$))" + }, + { + captures: { + "1": { + name: "support.type.object.module.ts" + }, + "2": { + name: "support.type.object.module.ts" + }, + "3": { + name: "punctuation.accessor.ts" + }, + "4": { + name: "punctuation.accessor.optional.ts" + }, + "5": { + name: "support.type.object.module.ts" + } + }, + match: "(?\\[]|=>|&(?!&)|\\|(?!\\|)))))([^(<>]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>|<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([$_[:alpha:]][$_[:alnum:]]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))(?=\\s*([,.<>\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^(<>]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>|<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([$_[:alpha:]][$_[:alnum:]]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))(?=\\s*([,.<>\\[]|=>|&(?!&)|\\|(?!\\|)))))([^(<>]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>)*(?))*(?)*(?\\s*)?`)", + end: "(?=`)", + patterns: [ + { + begin: "(?=(([$_[:alpha:]][$_[:alnum:]]*\\s*\\??\\.\\s*)*|(\\??\\.\\s*)?)([$_[:alpha:]][$_[:alnum:]]*))", + end: "(?=(<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([$_[:alpha:]][$_[:alnum:]]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))(?=\\s*([,.<>\\[]|=>|&(?!&)|\\|(?!\\|)))))([^(<>]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>|<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([$_[:alpha:]][$_[:alnum:]]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))(?=\\s*([,.<>\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^(<>]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>|<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([$_[:alpha:]][$_[:alnum:]]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))(?=\\s*([,.<>\\[]|=>|&(?!&)|\\|(?!\\|)))))([^(<>]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>)*(?))*(?)*(?\\s*)?`)", + patterns: [ + { + include: "#support-function-call-identifiers" + }, + { + match: "([$_[:alpha:]][$_[:alnum:]]*)", + name: "entity.name.function.tagged-template.ts" + } + ] + }, + { + include: "#type-arguments" + } + ] + }, + { + begin: "([$_[:alpha:]][$_[:alnum:]]*)?\\s*(?=(<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([$_[:alpha:]][$_[:alnum:]]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))(?=\\s*([,.<>\\[]|=>|&(?!&)|\\|(?!\\|)))))([^(<>]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>|<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([$_[:alpha:]][$_[:alnum:]]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))(?=\\s*([,.<>\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^(<>]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>|<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([$_[:alpha:]][$_[:alnum:]]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))(?=\\s*([,.<>\\[]|=>|&(?!&)|\\|(?!\\|)))))([^(<>]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>)*(?))*(?)*(?\\s*)`)", + beginCaptures: { + "1": { + name: "entity.name.function.tagged-template.ts" + } + }, + end: "(?=`)", + patterns: [ + { + include: "#type-arguments" + } + ] + } + ] + }, + "template-substitution-element": { + begin: "\\$\\{", + beginCaptures: { + "0": { + name: "punctuation.definition.template-expression.begin.ts" + } + }, + contentName: "meta.embedded.line.ts", + end: "}", + endCaptures: { + "0": { + name: "punctuation.definition.template-expression.end.ts" + } + }, + name: "meta.template.expression.ts", + patterns: [ + { + include: "#expression" + } + ] + }, + "template-type": { + patterns: [ + { + include: "#template-call" + }, + { + begin: "([$_[:alpha:]][$_[:alnum:]]*)?(`)", + beginCaptures: { + "1": { + name: "entity.name.function.tagged-template.ts" + }, + "2": { + name: "string.template.ts punctuation.definition.string.template.begin.ts" + } + }, + contentName: "string.template.ts", + end: "`", + endCaptures: { + "0": { + name: "string.template.ts punctuation.definition.string.template.end.ts" + } + }, + patterns: [ + { + include: "#template-type-substitution-element" + }, + { + include: "#string-character-escape" + } + ] + } + ] + }, + "template-type-substitution-element": { + begin: "\\$\\{", + beginCaptures: { + "0": { + name: "punctuation.definition.template-expression.begin.ts" + } + }, + contentName: "meta.embedded.line.ts", + end: "}", + endCaptures: { + "0": { + name: "punctuation.definition.template-expression.end.ts" + } + }, + name: "meta.template.expression.ts", + patterns: [ + { + include: "#type" + } + ] + }, + "ternary-expression": { + begin: "(?!\\?\\.\\s*\\D)(\\?)(?!\\?)", + beginCaptures: { + "1": { + name: "keyword.operator.ternary.ts" + } + }, + end: "\\s*(:)", + endCaptures: { + "1": { + name: "keyword.operator.ternary.ts" + } + }, + patterns: [ + { + include: "#expression" + } + ] + }, + "this-literal": { + match: "(?])|((?<=[]$)>_}[:alpha:]])\\s*(?=\\{)))", + name: "meta.type.annotation.ts", + patterns: [ + { + include: "#type" + } + ] + }, + { + begin: "(:)", + beginCaptures: { + "1": { + name: "keyword.operator.type.annotation.ts" + } + }, + end: "(?])|(?=^\\s*$)|((?<=[]$)>_}[:alpha:]])\\s*(?=\\{)))", + name: "meta.type.annotation.ts", + patterns: [ + { + include: "#type" + } + ] + } + ] + }, + "type-arguments": { + begin: "<", + beginCaptures: { + "0": { + name: "punctuation.definition.typeparameters.begin.ts" + } + }, + end: ">", + endCaptures: { + "0": { + name: "punctuation.definition.typeparameters.end.ts" + } + }, + name: "meta.type.parameters.ts", + patterns: [ + { + include: "#type-arguments-body" + } + ] + }, + "type-arguments-body": { + patterns: [ + { + captures: { + "0": { + name: "keyword.operator.type.ts" + } + }, + match: "(?)", + patterns: [ + { + include: "#comment" + }, + { + include: "#type-parameters" + } + ] + }, + { + begin: "(?))))))", + end: "(?<=\\))", + name: "meta.type.function.ts", + patterns: [ + { + include: "#function-parameters" + } + ] + } + ] + }, + "type-function-return-type": { + patterns: [ + { + begin: "(=>)(?=\\s*\\S)", + beginCaptures: { + "1": { + name: "storage.type.function.arrow.ts" + } + }, + end: "(?)(??{}]|//|$)", + name: "meta.type.function.return.ts", + patterns: [ + { + include: "#type-function-return-type-core" + } + ] + }, + { + begin: "=>", + beginCaptures: { + "0": { + name: "storage.type.function.arrow.ts" + } + }, + end: "(?)(??{}]|//|^\\s*$)|((?<=\\S)(?=\\s*$)))", + name: "meta.type.function.return.ts", + patterns: [ + { + include: "#type-function-return-type-core" + } + ] + } + ] + }, + "type-function-return-type-core": { + patterns: [ + { + include: "#comment" + }, + { + begin: "(?<==>)(?=\\s*\\{)", + end: "(?<=})", + patterns: [ + { + include: "#type-object" + } + ] + }, + { + include: "#type-predicate-operator" + }, + { + include: "#type" + } + ] + }, + "type-infer": { + patterns: [ + { + captures: { + "1": { + name: "keyword.operator.expression.infer.ts" + }, + "2": { + name: "entity.name.type.ts" + }, + "3": { + name: "keyword.operator.expression.extends.ts" + } + }, + match: "(?)", + endCaptures: { + "1": { + name: "meta.type.parameters.ts punctuation.definition.typeparameters.end.ts" + } + }, + patterns: [ + { + include: "#type-arguments-body" + } + ] + }, + { + begin: "([$_[:alpha:]][$_[:alnum:]]*)\\s*(<)", + beginCaptures: { + "1": { + name: "entity.name.type.ts" + }, + "2": { + name: "meta.type.parameters.ts punctuation.definition.typeparameters.begin.ts" + } + }, + contentName: "meta.type.parameters.ts", + end: "(>)", + endCaptures: { + "1": { + name: "meta.type.parameters.ts punctuation.definition.typeparameters.end.ts" + } + }, + patterns: [ + { + include: "#type-arguments-body" + } + ] + }, + { + captures: { + "1": { + name: "entity.name.type.module.ts" + }, + "2": { + name: "punctuation.accessor.ts" + }, + "3": { + name: "punctuation.accessor.optional.ts" + } + }, + match: "([$_[:alpha:]][$_[:alnum:]]*)\\s*(?:(\\.)|(\\?\\.(?!\\s*\\d)))" + }, + { + match: "[$_[:alpha:]][$_[:alnum:]]*", + name: "entity.name.type.ts" + } + ] + }, + "type-object": { + begin: "\\{", + beginCaptures: { + "0": { + name: "punctuation.definition.block.ts" + } + }, + end: "}", + endCaptures: { + "0": { + name: "punctuation.definition.block.ts" + } + }, + name: "meta.object.type.ts", + patterns: [ + { + include: "#comment" + }, + { + include: "#method-declaration" + }, + { + include: "#indexer-declaration" + }, + { + include: "#indexer-mapped-type-declaration" + }, + { + include: "#field-declaration" + }, + { + include: "#type-annotation" + }, + { + begin: "\\.\\.\\.", + beginCaptures: { + "0": { + name: "keyword.operator.spread.ts" + } + }, + end: "(?=[,;}]|$)|(?<=})", + patterns: [ + { + include: "#type" + } + ] + }, + { + include: "#punctuation-comma" + }, + { + include: "#punctuation-semicolon" + }, + { + include: "#type" + } + ] + }, + "type-operators": { + patterns: [ + { + include: "#typeof-operator" + }, + { + include: "#type-infer" + }, + { + begin: "([\\&|])(?=\\s*\\{)", + beginCaptures: { + "0": { + name: "keyword.operator.type.ts" + } + }, + end: "(?<=})", + patterns: [ + { + include: "#type-object" + } + ] + }, + { + begin: "[\\&|]", + beginCaptures: { + "0": { + name: "keyword.operator.type.ts" + } + }, + end: "(?=\\S)" + }, + { + match: "(?)", + endCaptures: { + "1": { + name: "punctuation.definition.typeparameters.end.ts" + } + }, + name: "meta.type.parameters.ts", + patterns: [ + { + include: "#comment" + }, + { + match: "(?)", + name: "keyword.operator.assignment.ts" + } + ] + }, + "type-paren-or-function-parameters": { + begin: "\\(", + beginCaptures: { + "0": { + name: "meta.brace.round.ts" + } + }, + end: "\\)", + endCaptures: { + "0": { + name: "meta.brace.round.ts" + } + }, + name: "meta.type.paren.cover.ts", + patterns: [ + { + captures: { + "1": { + name: "storage.modifier.ts" + }, + "2": { + name: "keyword.operator.rest.ts" + }, + "3": { + name: "entity.name.function.ts variable.language.this.ts" + }, + "4": { + name: "entity.name.function.ts" + }, + "5": { + name: "keyword.operator.optional.ts" + } + }, + match: "(?:(?)))))))|(:\\s*(?]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*((([\\[{]\\s*)?)$|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})\\s*((:\\s*\\{?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))|((\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])\\s*((:\\s*\\[?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*))))))))" + }, + { + captures: { + "1": { + name: "storage.modifier.ts" + }, + "2": { + name: "keyword.operator.rest.ts" + }, + "3": { + name: "variable.parameter.ts variable.language.this.ts" + }, + "4": { + name: "variable.parameter.ts" + }, + "5": { + name: "keyword.operator.optional.ts" + } + }, + match: "(?:(??{|}]|(extends\\s+)|$|;|^\\s*$|^\\s*(?:abstract|async|\\bawait\\s+\\busing(?=\\s+(?!in\\b|of\\b(?!\\s*(?:of\\b|=)))[$_[:alpha:]])\\b\\b|break|case|catch|class|const|continue|declare|do|else|enum|export|finally|function|for|goto|if|import|interface|let|module|namespace|switch|return|throw|try|type|\\busing(?=\\s+(?!in\\b|of\\b(?!\\s*(?:of\\b|=)))[$_[:alpha:]])\\b|var|while)\\b)", + patterns: [ + { + include: "#type-arguments" + }, + { + include: "#expression" + } + ] + }, + "undefined-literal": { + match: "(?)))|((async\\s*)?(((<\\s*)$|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*((([\\[{]\\s*)?)$|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})\\s*((:\\s*\\{?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))|((\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])\\s*((:\\s*\\[?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*))))))|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*((\\)\\s*:)|((\\.\\.\\.\\s*)?[$_[:alpha:]][$_[:alnum:]]*\\s*:)))|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*(([$_[:alpha:]]|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|(\\.\\.\\.\\s*[$_[:alpha:]]))([^\"'()`]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))*)?\\)(\\s*:\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+)?\\s*=>)))))|(:\\s*((<)|(\\(\\s*((\\))|(\\.\\.\\.)|([$_[:alnum:]]+\\s*(([,:=?])|(\\)\\s*=>)))))))|(:\\s*(?]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*((([\\[{]\\s*)?)$|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})\\s*((:\\s*\\{?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))|((\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])\\s*((:\\s*\\[?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))))))|(:\\s*(=>|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(<[^<>]*>)|[^(),<=>])+=\\s*(((async\\s+)?((function\\s*[(*<])|(function\\s+)|([$_[:alpha:]][$_[:alnum:]]*\\s*=>)))|((async\\s*)?(((<\\s*)$|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*((([\\[{]\\s*)?)$|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})\\s*((:\\s*\\{?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))|((\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])\\s*((:\\s*\\[?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*))))))|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*((\\)\\s*:)|((\\.\\.\\.\\s*)?[$_[:alpha:]][$_[:alnum:]]*\\s*:)))|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*(([$_[:alpha:]]|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|(\\.\\.\\.\\s*[$_[:alpha:]]))([^\"'()`]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))*)?\\)(\\s*:\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+)?\\s*=>))))))", + beginCaptures: { + "1": { + name: "meta.definition.variable.ts variable.other.constant.ts entity.name.function.ts" + } + }, + end: "(?=$|^|[,;=}]|((?)))|((async\\s*)?(((<\\s*)$|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*((([\\[{]\\s*)?)$|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})\\s*((:\\s*\\{?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))|((\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])\\s*((:\\s*\\[?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*))))))|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*((\\)\\s*:)|((\\.\\.\\.\\s*)?[$_[:alpha:]][$_[:alnum:]]*\\s*:)))|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*(([$_[:alpha:]]|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|(\\.\\.\\.\\s*[$_[:alpha:]]))([^\"'()`]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))*)?\\)(\\s*:\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+)?\\s*=>)))))|(:\\s*((<)|(\\(\\s*((\\))|(\\.\\.\\.)|([$_[:alnum:]]+\\s*(([,:=?])|(\\)\\s*=>)))))))|(:\\s*(?]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*((([\\[{]\\s*)?)$|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})\\s*((:\\s*\\{?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))|((\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])\\s*((:\\s*\\[?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))))))|(:\\s*(=>|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(<[^<>]*>)|[^(),<=>])+=\\s*(((async\\s+)?((function\\s*[(*<])|(function\\s+)|([$_[:alpha:]][$_[:alnum:]]*\\s*=>)))|((async\\s*)?(((<\\s*)$|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*((([\\[{]\\s*)?)$|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})\\s*((:\\s*\\{?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))|((\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])\\s*((:\\s*\\[?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*))))))|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*((\\)\\s*:)|((\\.\\.\\.\\s*)?[$_[:alpha:]][$_[:alnum:]]*\\s*:)))|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*(([$_[:alpha:]]|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|(\\.\\.\\.\\s*[$_[:alpha:]]))([^\"'()`]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))*)?\\)(\\s*:\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+)?\\s*=>))))))", + beginCaptures: { + "1": { + name: "meta.definition.variable.ts entity.name.function.ts" + }, + "2": { + name: "keyword.operator.definiteassignment.ts" + } + }, + end: "(?=$|^|[,;=}]|((?\\s*$)", + beginCaptures: { + "1": { + name: "keyword.operator.assignment.ts" + } + }, + end: "(?=$|^|[]),;}]|((??\\[]|^await|[^$._[:alnum:]]await|^return|[^$._[:alnum:]]return|^yield|[^$._[:alnum:]]yield|^throw|[^$._[:alnum:]]throw|^in|[^$._[:alnum:]]in|^of|[^$._[:alnum:]]of|^typeof|[^$._[:alnum:]]typeof|&&|\\|\\||\\*)\\s*(\\{)", + beginCaptures: { + "1": { + name: "punctuation.definition.block.js.jsx" + } + }, + end: "}", + endCaptures: { + "0": { + name: "punctuation.definition.block.js.jsx" + } + }, + name: "meta.objectliteral.js.jsx", + patterns: [ + { + include: "#object-member" + } + ] + }, + "array-binding-pattern": { + begin: "(?:(\\.\\.\\.)\\s*)?(\\[)", + beginCaptures: { + "1": { + name: "keyword.operator.rest.js.jsx" + }, + "2": { + name: "punctuation.definition.binding-pattern.array.js.jsx" + } + }, + end: "]", + endCaptures: { + "0": { + name: "punctuation.definition.binding-pattern.array.js.jsx" + } + }, + patterns: [ + { + include: "#binding-element" + }, + { + include: "#punctuation-comma" + } + ] + }, + "array-binding-pattern-const": { + begin: "(?:(\\.\\.\\.)\\s*)?(\\[)", + beginCaptures: { + "1": { + name: "keyword.operator.rest.js.jsx" + }, + "2": { + name: "punctuation.definition.binding-pattern.array.js.jsx" + } + }, + end: "]", + endCaptures: { + "0": { + name: "punctuation.definition.binding-pattern.array.js.jsx" + } + }, + patterns: [ + { + include: "#binding-element-const" + }, + { + include: "#punctuation-comma" + } + ] + }, + "array-literal": { + begin: "\\s*(\\[)", + beginCaptures: { + "1": { + name: "meta.brace.square.js.jsx" + } + }, + end: "]", + endCaptures: { + "0": { + name: "meta.brace.square.js.jsx" + } + }, + name: "meta.array.literal.js.jsx", + patterns: [ + { + include: "#expression" + }, + { + include: "#punctuation-comma" + } + ] + }, + "arrow-function": { + patterns: [ + { + captures: { + "1": { + name: "storage.modifier.async.js.jsx" + }, + "2": { + name: "variable.parameter.js.jsx" + } + }, + match: "(?:(?)", + name: "meta.arrow.js.jsx" + }, + { + begin: "(?:(?]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*((\\)\\s*:)|((\\.\\.\\.\\s*)?[$_[:alpha:]][$_[:alnum:]]*\\s*:)))|(<\\s*[$_[:alpha:]][$_[:alnum:]]*\\s+extends\\s*[^=>])|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*(([$_[:alpha:]]|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|(\\.\\.\\.\\s*[$_[:alpha:]]))([^\"'()`]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))*)?\\)(\\s*:\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+)?\\s*=>)))", + beginCaptures: { + "1": { + name: "storage.modifier.async.js.jsx" + } + }, + end: "(?==>|\\{|^(\\s*(export|function|class|interface|let|var|\\busing(?=\\s+(?!in\\b|of\\b(?!\\s*(?:of\\b|=)))[$_[:alpha:]])\\b|\\bawait\\s+\\busing(?=\\s+(?!in\\b|of\\b(?!\\s*(?:of\\b|=)))[$_[:alpha:]])\\b\\b|const|import|enum|namespace|module|type|abstract|declare)\\s+))", + name: "meta.arrow.js.jsx", + patterns: [ + { + include: "#comment" + }, + { + include: "#type-parameters" + }, + { + include: "#function-parameters" + }, + { + include: "#arrow-return-type" + }, + { + include: "#possibly-arrow-return-type" + } + ] + }, + { + begin: "=>", + beginCaptures: { + "0": { + name: "storage.type.function.arrow.js.jsx" + } + }, + end: "((?<=[}\\S])(?)|((?!\\{)(?=\\S)))(?!/[*/])", + name: "meta.arrow.js.jsx", + patterns: [ + { + include: "#single-line-comment-consuming-line-ending" + }, + { + include: "#decl-block" + }, + { + include: "#expression" + } + ] + } + ] + }, + "arrow-return-type": { + begin: "(?<=\\))\\s*(:)", + beginCaptures: { + "1": { + name: "keyword.operator.type.annotation.js.jsx" + } + }, + end: "(?==>|\\{|^(\\s*(export|function|class|interface|let|var|\\busing(?=\\s+(?!in\\b|of\\b(?!\\s*(?:of\\b|=)))[$_[:alpha:]])\\b|\\bawait\\s+\\busing(?=\\s+(?!in\\b|of\\b(?!\\s*(?:of\\b|=)))[$_[:alpha:]])\\b\\b|const|import|enum|namespace|module|type|abstract|declare)\\s+))", + name: "meta.return.type.arrow.js.jsx", + patterns: [ + { + include: "#arrow-return-type-body" + } + ] + }, + "arrow-return-type-body": { + patterns: [ + { + begin: "(?<=:)(?=\\s*\\{)", + end: "(?<=})", + patterns: [ + { + include: "#type-object" + } + ] + }, + { + include: "#type-predicate-operator" + }, + { + include: "#type" + } + ] + }, + "async-modifier": { + match: "(?\\s*$)", + beginCaptures: { + "1": { + name: "punctuation.definition.comment.js.jsx" + } + }, + end: "(?=$)", + name: "comment.line.triple-slash.directive.js.jsx", + patterns: [ + { + begin: "(<)(reference|amd-dependency|amd-module)", + beginCaptures: { + "1": { + name: "punctuation.definition.tag.directive.js.jsx" + }, + "2": { + name: "entity.name.tag.directive.js.jsx" + } + }, + end: "/>", + endCaptures: { + "0": { + name: "punctuation.definition.tag.directive.js.jsx" + } + }, + name: "meta.tag.js.jsx", + patterns: [ + { + match: "path|types|no-default-lib|lib|name|resolution-mode", + name: "entity.other.attribute-name.directive.js.jsx" + }, + { + match: "=", + name: "keyword.operator.assignment.js.jsx" + }, + { + include: "#string" + } + ] + } + ] + }, + docblock: { + patterns: [ + { + captures: { + "1": { + name: "storage.type.class.jsdoc" + }, + "2": { + name: "punctuation.definition.block.tag.jsdoc" + }, + "3": { + name: "constant.language.access-type.jsdoc" + } + }, + match: "((@)a(?:ccess|pi))\\s+(p(?:rivate|rotected|ublic))\\b" + }, + { + captures: { + "1": { + name: "storage.type.class.jsdoc" + }, + "2": { + name: "punctuation.definition.block.tag.jsdoc" + }, + "3": { + name: "entity.name.type.instance.jsdoc" + }, + "4": { + name: "punctuation.definition.bracket.angle.begin.jsdoc" + }, + "5": { + name: "constant.other.email.link.underline.jsdoc" + }, + "6": { + name: "punctuation.definition.bracket.angle.end.jsdoc" + } + }, + match: "((@)author)\\s+([^*/<>@\\s](?:[^*/<>@]|\\*[^/])*)(?:\\s*(<)([^>\\s]+)(>))?" + }, + { + captures: { + "1": { + name: "storage.type.class.jsdoc" + }, + "2": { + name: "punctuation.definition.block.tag.jsdoc" + }, + "3": { + name: "entity.name.type.instance.jsdoc" + }, + "4": { + name: "keyword.operator.control.jsdoc" + }, + "5": { + name: "entity.name.type.instance.jsdoc" + } + }, + match: "((@)borrows)\\s+((?:[^*/@\\s]|\\*[^/])+)\\s+(as)\\s+((?:[^*/@\\s]|\\*[^/])+)" + }, + { + begin: "((@)example)\\s+", + beginCaptures: { + "1": { + name: "storage.type.class.jsdoc" + }, + "2": { + name: "punctuation.definition.block.tag.jsdoc" + } + }, + end: "(?=@|\\*/)", + name: "meta.example.jsdoc", + patterns: [ + { + match: "^\\s\\*\\s+" + }, + { + begin: "\\G(<)caption(>)", + beginCaptures: { + "0": { + name: "entity.name.tag.inline.jsdoc" + }, + "1": { + name: "punctuation.definition.bracket.angle.begin.jsdoc" + }, + "2": { + name: "punctuation.definition.bracket.angle.end.jsdoc" + } + }, + contentName: "constant.other.description.jsdoc", + end: "()|(?=\\*/)", + endCaptures: { + "0": { + name: "entity.name.tag.inline.jsdoc" + }, + "1": { + name: "punctuation.definition.bracket.angle.begin.jsdoc" + }, + "2": { + name: "punctuation.definition.bracket.angle.end.jsdoc" + } + } + }, + { + captures: { + "0": { + name: "source.embedded.js.jsx" + } + }, + match: "[^*@\\s](?:[^*]|\\*[^/])*" + } + ] + }, + { + captures: { + "1": { + name: "storage.type.class.jsdoc" + }, + "2": { + name: "punctuation.definition.block.tag.jsdoc" + }, + "3": { + name: "constant.language.symbol-type.jsdoc" + } + }, + match: "((@)kind)\\s+(class|constant|event|external|file|function|member|mixin|module|namespace|typedef)\\b" + }, + { + captures: { + "1": { + name: "storage.type.class.jsdoc" + }, + "2": { + name: "punctuation.definition.block.tag.jsdoc" + }, + "3": { + name: "variable.other.link.underline.jsdoc" + }, + "4": { + name: "entity.name.type.instance.jsdoc" + } + }, + match: "((@)see)\\s+(?:((?=https?://)(?:[^*\\s]|\\*[^/])+)|((?!https?://|(?:\\[[^]\\[]*])?\\{@(?:link|linkcode|linkplain|tutorial)\\b)(?:[^*/@\\s]|\\*[^/])+))" + }, + { + captures: { + "1": { + name: "storage.type.class.jsdoc" + }, + "2": { + name: "punctuation.definition.block.tag.jsdoc" + }, + "3": { + name: "variable.other.jsdoc" + } + }, + match: "((@)template)\\s+([$A-Z_a-z][]$.\\[\\w]*(?:\\s*,\\s*[$A-Z_a-z][]$.\\[\\w]*)*)" + }, + { + begin: "((@)template)\\s+(?=\\{)", + beginCaptures: { + "1": { + name: "storage.type.class.jsdoc" + }, + "2": { + name: "punctuation.definition.block.tag.jsdoc" + } + }, + end: "(?=\\s|\\*/|[^]$A-\\[_a-{}])", + patterns: [ + { + include: "#jsdoctype" + }, + { + match: "([$A-Z_a-z][]$.\\[\\w]*)", + name: "variable.other.jsdoc" + } + ] + }, + { + captures: { + "1": { + name: "storage.type.class.jsdoc" + }, + "2": { + name: "punctuation.definition.block.tag.jsdoc" + }, + "3": { + name: "variable.other.jsdoc" + } + }, + match: "((@)(?:arg|argument|const|constant|member|namespace|param|var))\\s+([$A-Z_a-z][]$.\\[\\w]*)" + }, + { + begin: "((@)typedef)\\s+(?=\\{)", + beginCaptures: { + "1": { + name: "storage.type.class.jsdoc" + }, + "2": { + name: "punctuation.definition.block.tag.jsdoc" + } + }, + end: "(?=\\s|\\*/|[^]$A-\\[_a-{}])", + patterns: [ + { + include: "#jsdoctype" + }, + { + match: "(?:[^*/@\\s]|\\*[^/])+", + name: "entity.name.type.instance.jsdoc" + } + ] + }, + { + begin: "((@)(?:arg|argument|const|constant|member|namespace|param|prop|property|var))\\s+(?=\\{)", + beginCaptures: { + "1": { + name: "storage.type.class.jsdoc" + }, + "2": { + name: "punctuation.definition.block.tag.jsdoc" + } + }, + end: "(?=\\s|\\*/|[^]$A-\\[_a-{}])", + patterns: [ + { + include: "#jsdoctype" + }, + { + match: "([$A-Z_a-z][]$.\\[\\w]*)", + name: "variable.other.jsdoc" + }, + { + captures: { + "1": { + name: "punctuation.definition.optional-value.begin.bracket.square.jsdoc" + }, + "2": { + name: "keyword.operator.assignment.jsdoc" + }, + "3": { + name: "source.embedded.js.jsx" + }, + "4": { + name: "punctuation.definition.optional-value.end.bracket.square.jsdoc" + }, + "5": { + name: "invalid.illegal.syntax.jsdoc" + } + }, + match: `(\\[)\\s*[$\\w]+(?:(?:\\[])?\\.[$\\w]+)*(?:\\s*(=)\\s*((?>"(?:\\*(?!/)|\\\\(?!")|[^*\\\\])*?"|'(?:\\*(?!/)|\\\\(?!')|[^*\\\\])*?'|\\[(?:\\*(?!/)|[^*])*?]|(?:\\*(?!/)|\\s(?!\\s*])|\\[.*?(?:]|(?=\\*/))|[^]*\\[\\s])*)*))?\\s*(?:(])((?:[^*\\s]|\\*[^/\\s])+)?|(?=\\*/))`, + name: "variable.other.jsdoc" + } + ] + }, + { + begin: "((@)(?:define|enum|exception|export|extends|lends|implements|modifies|namespace|private|protected|returns?|satisfies|suppress|this|throws|type|yields?))\\s+(?=\\{)", + beginCaptures: { + "1": { + name: "storage.type.class.jsdoc" + }, + "2": { + name: "punctuation.definition.block.tag.jsdoc" + } + }, + end: "(?=\\s|\\*/|[^]$A-\\[_a-{}])", + patterns: [ + { + include: "#jsdoctype" + } + ] + }, + { + captures: { + "1": { + name: "storage.type.class.jsdoc" + }, + "2": { + name: "punctuation.definition.block.tag.jsdoc" + }, + "3": { + name: "entity.name.type.instance.jsdoc" + } + }, + match: "((@)(?:alias|augments|callback|constructs|emits|event|fires|exports?|extends|external|function|func|host|lends|listens|interface|memberof!?|method|module|mixes|mixin|name|requires|see|this|typedef|uses))\\s+((?:[^*@{}\\s]|\\*[^/])+)" + }, + { + begin: `((@)(?:default(?:value)?|license|version))\\s+((["']))`, + beginCaptures: { + "1": { + name: "storage.type.class.jsdoc" + }, + "2": { + name: "punctuation.definition.block.tag.jsdoc" + }, + "3": { + name: "variable.other.jsdoc" + }, + "4": { + name: "punctuation.definition.string.begin.jsdoc" + } + }, + contentName: "variable.other.jsdoc", + end: "(\\3)|(?=$|\\*/)", + endCaptures: { + "0": { + name: "variable.other.jsdoc" + }, + "1": { + name: "punctuation.definition.string.end.jsdoc" + } + } + }, + { + captures: { + "1": { + name: "storage.type.class.jsdoc" + }, + "2": { + name: "punctuation.definition.block.tag.jsdoc" + }, + "3": { + name: "variable.other.jsdoc" + } + }, + match: "((@)(?:default(?:value)?|license|tutorial|variation|version))\\s+([^*\\s]+)" + }, + { + captures: { + "1": { + name: "punctuation.definition.block.tag.jsdoc" + } + }, + match: "(@)(?:abstract|access|alias|api|arg|argument|async|attribute|augments|author|beta|borrows|bubbles|callback|chainable|class|classdesc|code|config|const|constant|constructor|constructs|copyright|default|defaultvalue|define|deprecated|desc|description|dict|emits|enum|event|example|exception|exports?|extends|extension(?:_?for)?|external|externs|file|fileoverview|final|fires|for|func|function|generator|global|hideconstructor|host|ignore|implements|implicitCast|inherit[Dd]oc|inner|instance|interface|internal|kind|lends|license|listens|main|member|memberof!?|method|mixes|mixins?|modifies|module|name|namespace|noalias|nocollapse|nocompile|nosideeffects|override|overview|package|param|polymer(?:Behavior)?|preserve|private|prop|property|protected|public|read[Oo]nly|record|require[ds]|returns?|see|since|static|struct|submodule|summary|suppress|template|this|throws|todo|tutorial|type|typedef|unrestricted|uses|var|variation|version|virtual|writeOnce|yields?)\\b", + name: "storage.type.class.jsdoc" + }, + { + include: "#inline-tags" + }, + { + captures: { + "1": { + name: "storage.type.class.jsdoc" + }, + "2": { + name: "punctuation.definition.block.tag.jsdoc" + } + }, + match: "((@)[$_[:alpha:]][$_[:alnum:]]*)(?=\\s+)" + } + ] + }, + "enum-declaration": { + begin: "(?)))|((async\\s*)?(((<\\s*)$|(\\(\\s*((([\\[{]\\s*)?)$|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})\\s*((:\\s*\\{?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))|((\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])\\s*((:\\s*\\[?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*))))))|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*((\\)\\s*:)|((\\.\\.\\.\\s*)?[$_[:alpha:]][$_[:alnum:]]*\\s*:)))|(<\\s*[$_[:alpha:]][$_[:alnum:]]*\\s+extends\\s*[^=>])|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*(([$_[:alpha:]]|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|(\\.\\.\\.\\s*[$_[:alpha:]]))([^\"'()`]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))*)?\\)(\\s*:\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+)?\\s*=>)))))|(:\\s*((<)|(\\(\\s*((\\))|(\\.\\.\\.)|([$_[:alnum:]]+\\s*(([,:=?])|(\\)\\s*=>)))))))|(:\\s*(?{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))|((\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])\\s*((:\\s*\\[?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))))))|(:\\s*(=>|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(<[^<>]*>)|[^(),<=>])+=\\s*(((async\\s+)?((function\\s*[(*<])|(function\\s+)|([$_[:alpha:]][$_[:alnum:]]*\\s*=>)))|((async\\s*)?(((<\\s*)$|(\\(\\s*((([\\[{]\\s*)?)$|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})\\s*((:\\s*\\{?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))|((\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])\\s*((:\\s*\\[?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*))))))|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*((\\)\\s*:)|((\\.\\.\\.\\s*)?[$_[:alpha:]][$_[:alnum:]]*\\s*:)))|(<\\s*[$_[:alpha:]][$_[:alnum:]]*\\s+extends\\s*[^=>])|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*(([$_[:alpha:]]|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|(\\.\\.\\.\\s*[$_[:alpha:]]))([^\"'()`]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))*)?\\)(\\s*:\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+)?\\s*=>))))))" + }, + { + captures: { + "1": { + name: "storage.modifier.js.jsx" + }, + "2": { + name: "keyword.operator.rest.js.jsx" + }, + "3": { + name: "variable.parameter.js.jsx variable.language.this.js.jsx" + }, + "4": { + name: "variable.parameter.js.jsx" + }, + "5": { + name: "keyword.operator.optional.js.jsx" + } + }, + match: "(?:(??}]|\\|\\||&&|!==|$|((?>>??|\\|)=", + name: "keyword.operator.assignment.compound.bitwise.js.jsx" + }, + { + match: "<<|>>>?", + name: "keyword.operator.bitwise.shift.js.jsx" + }, + { + match: "[!=]==?", + name: "keyword.operator.comparison.js.jsx" + }, + { + match: "<=|>=|<>|[<>]", + name: "keyword.operator.relational.js.jsx" + }, + { + captures: { + "1": { + name: "keyword.operator.logical.js.jsx" + }, + "2": { + name: "keyword.operator.assignment.compound.js.jsx" + }, + "3": { + name: "keyword.operator.arithmetic.js.jsx" + } + }, + match: "(?<=[$_[:alnum:]])(!)\\s*(?:(/=)|(/)(?![*/]))" + }, + { + match: "!|&&|\\|\\||\\?\\?", + name: "keyword.operator.logical.js.jsx" + }, + { + match: "[\\&^|~]", + name: "keyword.operator.bitwise.js.jsx" + }, + { + match: "=", + name: "keyword.operator.assignment.js.jsx" + }, + { + match: "--", + name: "keyword.operator.decrement.js.jsx" + }, + { + match: "\\+\\+", + name: "keyword.operator.increment.js.jsx" + }, + { + match: "[-%*+/]", + name: "keyword.operator.arithmetic.js.jsx" + }, + { + begin: "(?<=[]$)_[:alnum:]])\\s*(?=(/\\*([^*]|(\\*[^/]))*\\*/\\s*)+(?:(/=)|(/)(?![*/])))", + end: "(/=)|(/)(?!\\*([^*]|(\\*[^/]))*\\*/)", + endCaptures: { + "1": { + name: "keyword.operator.assignment.compound.js.jsx" + }, + "2": { + name: "keyword.operator.arithmetic.js.jsx" + } + }, + patterns: [ + { + include: "#comment" + } + ] + }, + { + captures: { + "1": { + name: "keyword.operator.assignment.compound.js.jsx" + }, + "2": { + name: "keyword.operator.arithmetic.js.jsx" + } + }, + match: "(?<=[]$)_[:alnum:]])\\s*(?:(/=)|(/)(?![*/]))" + } + ] + }, + expressionPunctuations: { + patterns: [ + { + include: "#punctuation-comma" + }, + { + include: "#punctuation-accessor" + } + ] + }, + expressionWithoutIdentifiers: { + patterns: [ + { + include: "#jsx" + }, + { + include: "#string" + }, + { + include: "#regex" + }, + { + include: "#comment" + }, + { + include: "#function-expression" + }, + { + include: "#class-expression" + }, + { + include: "#arrow-function" + }, + { + include: "#paren-expression-possibly-arrow" + }, + { + include: "#cast" + }, + { + include: "#ternary-expression" + }, + { + include: "#new-expr" + }, + { + include: "#instanceof-expr" + }, + { + include: "#object-literal" + }, + { + include: "#expression-operators" + }, + { + include: "#function-call" + }, + { + include: "#literal" + }, + { + include: "#support-objects" + }, + { + include: "#paren-expression" + } + ] + }, + "field-declaration": { + begin: "(?)))|((async\\s*)?(((<\\s*)$|(\\(\\s*((([\\[{]\\s*)?)$|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})\\s*((:\\s*\\{?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))|((\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])\\s*((:\\s*\\[?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*))))))|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*((\\)\\s*:)|((\\.\\.\\.\\s*)?[$_[:alpha:]][$_[:alnum:]]*\\s*:)))|(<\\s*[$_[:alpha:]][$_[:alnum:]]*\\s+extends\\s*[^=>])|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*(([$_[:alpha:]]|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|(\\.\\.\\.\\s*[$_[:alpha:]]))([^\"'()`]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))*)?\\)(\\s*:\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+)?\\s*=>)))))|(:\\s*((<)|(\\(\\s*((\\))|(\\.\\.\\.)|([$_[:alnum:]]+\\s*(([,:=?])|(\\)\\s*=>)))))))|(:\\s*(?{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))|((\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])\\s*((:\\s*\\[?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))))))|(:\\s*(=>|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(<[^<>]*>)|[^(),<=>])+=\\s*(((async\\s+)?((function\\s*[(*<])|(function\\s+)|([$_[:alpha:]][$_[:alnum:]]*\\s*=>)))|((async\\s*)?(((<\\s*)$|(\\(\\s*((([\\[{]\\s*)?)$|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})\\s*((:\\s*\\{?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))|((\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])\\s*((:\\s*\\[?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*))))))|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*((\\)\\s*:)|((\\.\\.\\.\\s*)?[$_[:alpha:]][$_[:alnum:]]*\\s*:)))|(<\\s*[$_[:alpha:]][$_[:alnum:]]*\\s+extends\\s*[^=>])|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*(([$_[:alpha:]]|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|(\\.\\.\\.\\s*[$_[:alpha:]]))([^\"'()`]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))*)?\\)(\\s*:\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+)?\\s*=>))))))" + }, + { + match: "#?[$_[:alpha:]][$_[:alnum:]]*", + name: "meta.definition.property.js.jsx variable.object.property.js.jsx" + }, + { + match: "\\?", + name: "keyword.operator.optional.js.jsx" + }, + { + match: "!", + name: "keyword.operator.definiteassignment.js.jsx" + } + ] + }, + "for-loop": { + begin: "(?\\[]|=>|&(?!&)|\\|(?!\\|)))))([^(<>]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>|<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([$_[:alpha:]][$_[:alnum:]]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))(?=\\s*([,.<>\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^(<>]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>|<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([$_[:alpha:]][$_[:alnum:]]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))(?=\\s*([,.<>\\[]|=>|&(?!&)|\\|(?!\\|)))))([^(<>]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>)*(?))*(?)*(?\\s*)?\\())", + end: "(?<=\\))(?!(((([$_[:alpha:]][$_[:alnum:]]*)(\\s*\\??\\.\\s*(#?[$_[:alpha:]][$_[:alnum:]]*))*)|(\\??\\.\\s*#?[$_[:alpha:]][$_[:alnum:]]*))|(?<=\\)))\\s*(?:(\\?\\.\\s*)|(!))?((<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([$_[:alpha:]][$_[:alnum:]]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))(?=\\s*([,.<>\\[]|=>|&(?!&)|\\|(?!\\|)))))([^(<>]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>|<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([$_[:alpha:]][$_[:alnum:]]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))(?=\\s*([,.<>\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^(<>]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>|<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([$_[:alpha:]][$_[:alnum:]]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))(?=\\s*([,.<>\\[]|=>|&(?!&)|\\|(?!\\|)))))([^(<>]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>)*(?))*(?)*(?\\s*)?\\())", + patterns: [ + { + begin: "(?=(([$_[:alpha:]][$_[:alnum:]]*)(\\s*\\??\\.\\s*(#?[$_[:alpha:]][$_[:alnum:]]*))*)|(\\??\\.\\s*#?[$_[:alpha:]][$_[:alnum:]]*))", + end: "(?=\\s*(?:(\\?\\.\\s*)|(!))?((<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([$_[:alpha:]][$_[:alnum:]]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))(?=\\s*([,.<>\\[]|=>|&(?!&)|\\|(?!\\|)))))([^(<>]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>|<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([$_[:alpha:]][$_[:alnum:]]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))(?=\\s*([,.<>\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^(<>]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>|<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([$_[:alpha:]][$_[:alnum:]]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))(?=\\s*([,.<>\\[]|=>|&(?!&)|\\|(?!\\|)))))([^(<>]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>)*(?))*(?)*(?\\s*)?\\())", + name: "meta.function-call.js.jsx", + patterns: [ + { + include: "#function-call-target" + } + ] + }, + { + include: "#comment" + }, + { + include: "#function-call-optionals" + }, + { + include: "#type-arguments" + }, + { + include: "#paren-expression" + } + ] + }, + { + begin: "(?=(((([$_[:alpha:]][$_[:alnum:]]*)(\\s*\\??\\.\\s*(#?[$_[:alpha:]][$_[:alnum:]]*))*)|(\\??\\.\\s*#?[$_[:alpha:]][$_[:alnum:]]*))|(?<=\\)))(<\\s*[(\\[{]\\s*)$)", + end: "(?<=>)(?!(((([$_[:alpha:]][$_[:alnum:]]*)(\\s*\\??\\.\\s*(#?[$_[:alpha:]][$_[:alnum:]]*))*)|(\\??\\.\\s*#?[$_[:alpha:]][$_[:alnum:]]*))|(?<=\\)))(<\\s*[(\\[{]\\s*)$)", + patterns: [ + { + begin: "(?=(([$_[:alpha:]][$_[:alnum:]]*)(\\s*\\??\\.\\s*(#?[$_[:alpha:]][$_[:alnum:]]*))*)|(\\??\\.\\s*#?[$_[:alpha:]][$_[:alnum:]]*))", + end: "(?=(<\\s*[(\\[{]\\s*)$)", + name: "meta.function-call.js.jsx", + patterns: [ + { + include: "#function-call-target" + } + ] + }, + { + include: "#comment" + }, + { + include: "#function-call-optionals" + }, + { + include: "#type-arguments" + } + ] + } + ] + }, + "function-call-optionals": { + patterns: [ + { + match: "\\?\\.", + name: "meta.function-call.js.jsx punctuation.accessor.optional.js.jsx" + }, + { + match: "!", + name: "meta.function-call.js.jsx keyword.operator.definiteassignment.js.jsx" + } + ] + }, + "function-call-target": { + patterns: [ + { + include: "#support-function-call-identifiers" + }, + { + match: "(#?[$_[:alpha:]][$_[:alnum:]]*)", + name: "entity.name.function.js.jsx" + } + ] + }, + "function-declaration": { + begin: "(?)))|((async\\s*)?(((<\\s*)$|(\\(\\s*((([\\[{]\\s*)?)$|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})\\s*((:\\s*\\{?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))|((\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])\\s*((:\\s*\\[?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*))))))|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*((\\)\\s*:)|((\\.\\.\\.\\s*)?[$_[:alpha:]][$_[:alnum:]]*\\s*:)))|(<\\s*[$_[:alpha:]][$_[:alnum:]]*\\s+extends\\s*[^=>])|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*(([$_[:alpha:]]|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|(\\.\\.\\.\\s*[$_[:alpha:]]))([^\"'()`]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))*)?\\)(\\s*:\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+)?\\s*=>)))))" + }, + { + captures: { + "1": { + name: "punctuation.accessor.js.jsx" + }, + "2": { + name: "punctuation.accessor.optional.js.jsx" + }, + "3": { + name: "variable.other.constant.property.js.jsx" + } + }, + match: "(?:(\\.)|(\\?\\.(?!\\s*\\d)))\\s*(#?\\p{upper}[$_\\d[:upper:]]*)(?![$_[:alnum:]])" + }, + { + captures: { + "1": { + name: "punctuation.accessor.js.jsx" + }, + "2": { + name: "punctuation.accessor.optional.js.jsx" + }, + "3": { + name: "variable.other.property.js.jsx" + } + }, + match: "(?:(\\.)|(\\?\\.(?!\\s*\\d)))\\s*(#?[$_[:alpha:]][$_[:alnum:]]*)" + }, + { + match: "(\\p{upper}[$_\\d[:upper:]]*)(?![$_[:alnum:]])", + name: "variable.other.constant.js.jsx" + }, + { + match: "[$_[:alpha:]][$_[:alnum:]]*", + name: "variable.other.readwrite.js.jsx" + } + ] + }, + "if-statement": { + patterns: [ + { + begin: "(??}]|\\|\\||&&|!==|$|([!=]==?)|(([\\&^|~]\\s*)?[$_[:alpha:]][$_[:alnum:]]*\\s+instanceof(?![$_[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.)))|((?))", + end: "(/>)|()", + endCaptures: { + "1": { + name: "punctuation.definition.tag.end.js.jsx" + }, + "2": { + name: "punctuation.definition.tag.begin.js.jsx" + }, + "3": { + name: "entity.name.tag.namespace.js.jsx" + }, + "4": { + name: "punctuation.separator.namespace.js.jsx" + }, + "5": { + name: "entity.name.tag.js.jsx" + }, + "6": { + name: "support.class.component.js.jsx" + }, + "7": { + name: "punctuation.definition.tag.end.js.jsx" + } + }, + name: "meta.tag.js.jsx", + patterns: [ + { + begin: "(<)\\s*(?:([$_[:alpha:]][-$._[:alnum:]]*)(?)", + beginCaptures: { + "1": { + name: "punctuation.definition.tag.begin.js.jsx" + }, + "2": { + name: "entity.name.tag.namespace.js.jsx" + }, + "3": { + name: "punctuation.separator.namespace.js.jsx" + }, + "4": { + name: "entity.name.tag.js.jsx" + }, + "5": { + name: "support.class.component.js.jsx" + } + }, + end: "(?=/?>)", + patterns: [ + { + include: "#comment" + }, + { + include: "#type-arguments" + }, + { + include: "#jsx-tag-attributes" + } + ] + }, + { + begin: "(>)", + beginCaptures: { + "1": { + name: "punctuation.definition.tag.end.js.jsx" + } + }, + contentName: "meta.jsx.children.js.jsx", + end: "(?=|/\\*|//)" + }, + "jsx-tag-attributes": { + begin: "\\s+", + end: "(?=/?>)", + name: "meta.tag.attributes.js.jsx", + patterns: [ + { + include: "#comment" + }, + { + include: "#jsx-tag-attribute-name" + }, + { + include: "#jsx-tag-attribute-assignment" + }, + { + include: "#jsx-string-double-quoted" + }, + { + include: "#jsx-string-single-quoted" + }, + { + include: "#jsx-evaluated-code" + }, + { + include: "#jsx-tag-attributes-illegal" + } + ] + }, + "jsx-tag-attributes-illegal": { + match: "\\S+", + name: "invalid.illegal.attribute.js.jsx" + }, + "jsx-tag-in-expression": { + begin: "(??\\[{]|&&|\\|\\||\\?|\\*/|^await|[^$._[:alnum:]]await|^return|[^$._[:alnum:]]return|^default|[^$._[:alnum:]]default|^yield|[^$._[:alnum:]]yield|^)\\s*(?!<\\s*[$_[:alpha:]][$_[:alnum:]]*((\\s+extends\\s+[^=>])|,))(?=(<)\\s*(?:([$_[:alpha:]][-$._[:alnum:]]*)(?))", + end: "(?!(<)\\s*(?:([$_[:alpha:]][-$._[:alnum:]]*)(?))", + patterns: [ + { + include: "#jsx-tag" + } + ] + }, + "jsx-tag-without-attributes": { + begin: "(<)\\s*(?:([$_[:alpha:]][-$._[:alnum:]]*)(?)", + beginCaptures: { + "1": { + name: "punctuation.definition.tag.begin.js.jsx" + }, + "2": { + name: "entity.name.tag.namespace.js.jsx" + }, + "3": { + name: "punctuation.separator.namespace.js.jsx" + }, + "4": { + name: "entity.name.tag.js.jsx" + }, + "5": { + name: "support.class.component.js.jsx" + }, + "6": { + name: "punctuation.definition.tag.end.js.jsx" + } + }, + contentName: "meta.jsx.children.js.jsx", + end: "()", + endCaptures: { + "1": { + name: "punctuation.definition.tag.begin.js.jsx" + }, + "2": { + name: "entity.name.tag.namespace.js.jsx" + }, + "3": { + name: "punctuation.separator.namespace.js.jsx" + }, + "4": { + name: "entity.name.tag.js.jsx" + }, + "5": { + name: "support.class.component.js.jsx" + }, + "6": { + name: "punctuation.definition.tag.end.js.jsx" + } + }, + name: "meta.tag.without-attributes.js.jsx", + patterns: [ + { + include: "#jsx-children" + } + ] + }, + "jsx-tag-without-attributes-in-expression": { + begin: "(??\\[{]|&&|\\|\\||\\?|\\*/|^await|[^$._[:alnum:]]await|^return|[^$._[:alnum:]]return|^default|[^$._[:alnum:]]default|^yield|[^$._[:alnum:]]yield|^)\\s*(?=(<)\\s*(?:([$_[:alpha:]][-$._[:alnum:]]*)(?))", + end: "(?!(<)\\s*(?:([$_[:alpha:]][-$._[:alnum:]]*)(?))", + patterns: [ + { + include: "#jsx-tag-without-attributes" + } + ] + }, + label: { + patterns: [ + { + begin: "([$_[:alpha:]][$_[:alnum:]]*)\\s*(:)(?=\\s*\\{)", + beginCaptures: { + "1": { + name: "entity.name.label.js.jsx" + }, + "2": { + name: "punctuation.separator.label.js.jsx" + } + }, + end: "(?<=})", + patterns: [ + { + include: "#decl-block" + } + ] + }, + { + captures: { + "1": { + name: "entity.name.label.js.jsx" + }, + "2": { + name: "punctuation.separator.label.js.jsx" + } + }, + match: "([$_[:alpha:]][$_[:alnum:]]*)\\s*(:)" + } + ] + }, + literal: { + patterns: [ + { + include: "#numeric-literal" + }, + { + include: "#boolean-literal" + }, + { + include: "#null-literal" + }, + { + include: "#undefined-literal" + }, + { + include: "#numericConstant-literal" + }, + { + include: "#array-literal" + }, + { + include: "#this-literal" + }, + { + include: "#super-literal" + } + ] + }, + "method-declaration": { + patterns: [ + { + begin: "(?]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*))?\\()", + beginCaptures: { + "1": { + name: "storage.modifier.js.jsx" + }, + "2": { + name: "storage.modifier.js.jsx" + }, + "3": { + name: "storage.modifier.js.jsx" + }, + "4": { + name: "storage.modifier.async.js.jsx" + }, + "5": { + name: "keyword.operator.new.js.jsx" + }, + "6": { + name: "keyword.generator.asterisk.js.jsx" + } + }, + end: "(?=[,;}]|$)|(?<=})", + name: "meta.method.declaration.js.jsx", + patterns: [ + { + include: "#method-declaration-name" + }, + { + include: "#function-body" + } + ] + }, + { + begin: "(?]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*))?\\()", + beginCaptures: { + "1": { + name: "storage.modifier.js.jsx" + }, + "2": { + name: "storage.modifier.js.jsx" + }, + "3": { + name: "storage.modifier.js.jsx" + }, + "4": { + name: "storage.modifier.async.js.jsx" + }, + "5": { + name: "storage.type.property.js.jsx" + }, + "6": { + name: "keyword.generator.asterisk.js.jsx" + } + }, + end: "(?=[,;}]|$)|(?<=})", + name: "meta.method.declaration.js.jsx", + patterns: [ + { + include: "#method-declaration-name" + }, + { + include: "#function-body" + } + ] + } + ] + }, + "method-declaration-name": { + begin: "(?=(\\b((??}]|\\|\\||&&|!==|$|((?]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*))?\\()", + beginCaptures: { + "1": { + name: "storage.modifier.async.js.jsx" + }, + "2": { + name: "storage.type.property.js.jsx" + }, + "3": { + name: "keyword.generator.asterisk.js.jsx" + } + }, + end: "(?=[,;}])|(?<=})", + name: "meta.method.declaration.js.jsx", + patterns: [ + { + include: "#method-declaration-name" + }, + { + include: "#function-body" + }, + { + begin: "(?]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*))?\\()", + beginCaptures: { + "1": { + name: "storage.modifier.async.js.jsx" + }, + "2": { + name: "storage.type.property.js.jsx" + }, + "3": { + name: "keyword.generator.asterisk.js.jsx" + } + }, + end: "(?=[(<])", + patterns: [ + { + include: "#method-declaration-name" + } + ] + } + ] + }, + "object-member": { + patterns: [ + { + include: "#comment" + }, + { + include: "#object-literal-method-declaration" + }, + { + begin: "(?=\\[)", + end: "(?=:)|((?<=])(?=\\s*[(<]))", + name: "meta.object.member.js.jsx meta.object-literal.key.js.jsx", + patterns: [ + { + include: "#comment" + }, + { + include: "#array-literal" + } + ] + }, + { + begin: "(?=[\"'`])", + end: "(?=:)|((?<=[\"'`])(?=((\\s*[(,<}])|(\\s+(as|satisifies)\\s+))))", + name: "meta.object.member.js.jsx meta.object-literal.key.js.jsx", + patterns: [ + { + include: "#comment" + }, + { + include: "#string" + } + ] + }, + { + begin: "(?=\\b((?)))|((async\\s*)?(((<\\s*)$|(\\(\\s*((([\\[{]\\s*)?)$|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})\\s*((:\\s*\\{?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))|((\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])\\s*((:\\s*\\[?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*))))))|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*((\\)\\s*:)|((\\.\\.\\.\\s*)?[$_[:alpha:]][$_[:alnum:]]*\\s*:)))|(<\\s*[$_[:alpha:]][$_[:alnum:]]*\\s+extends\\s*[^=>])|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*(([$_[:alpha:]]|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|(\\.\\.\\.\\s*[$_[:alpha:]]))([^\"'()`]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))*)?\\)(\\s*:\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+)?\\s*=>)))))", + name: "meta.object.member.js.jsx" + }, + { + captures: { + "0": { + name: "meta.object-literal.key.js.jsx" + } + }, + match: "[$_[:alpha:]][$_[:alnum:]]*\\s*(?=(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*:)", + name: "meta.object.member.js.jsx" + }, + { + begin: "\\.\\.\\.", + beginCaptures: { + "0": { + name: "keyword.operator.spread.js.jsx" + } + }, + end: "(?=[,}])", + name: "meta.object.member.js.jsx", + patterns: [ + { + include: "#expression" + } + ] + }, + { + captures: { + "1": { + name: "variable.other.readwrite.js.jsx" + } + }, + match: "([$_[:alpha:]][$_[:alnum:]]*)\\s*(?=[,}]|$|//|/\\*)", + name: "meta.object.member.js.jsx" + }, + { + captures: { + "1": { + name: "keyword.control.as.js.jsx" + }, + "2": { + name: "storage.modifier.js.jsx" + } + }, + match: "(??}]|\\|\\||&&|!==|$|^|((?]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)\\(\\s*((([\\[{]\\s*)?)$|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})\\s*((:\\s*\\{?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))|((\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])\\s*((:\\s*\\[?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))))", + beginCaptures: { + "1": { + name: "storage.modifier.async.js.jsx" + } + }, + end: "(?<=\\))", + patterns: [ + { + include: "#type-parameters" + }, + { + begin: "\\(", + beginCaptures: { + "0": { + name: "meta.brace.round.js.jsx" + } + }, + end: "\\)", + endCaptures: { + "0": { + name: "meta.brace.round.js.jsx" + } + }, + patterns: [ + { + include: "#expression-inside-possibly-arrow-parens" + } + ] + } + ] + }, + { + begin: "(?<=:)\\s*(async)?\\s*(\\()(?=\\s*((([\\[{]\\s*)?)$|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})\\s*((:\\s*\\{?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))|((\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])\\s*((:\\s*\\[?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))))", + beginCaptures: { + "1": { + name: "storage.modifier.async.js.jsx" + }, + "2": { + name: "meta.brace.round.js.jsx" + } + }, + end: "\\)", + endCaptures: { + "0": { + name: "meta.brace.round.js.jsx" + } + }, + patterns: [ + { + include: "#expression-inside-possibly-arrow-parens" + } + ] + }, + { + begin: "(?<=:)\\s*(async)?\\s*(?=<\\s*$)", + beginCaptures: { + "1": { + name: "storage.modifier.async.js.jsx" + } + }, + end: "(?<=>)", + patterns: [ + { + include: "#type-parameters" + } + ] + }, + { + begin: "(?<=>)\\s*(\\()(?=\\s*((([\\[{]\\s*)?)$|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})\\s*((:\\s*\\{?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))|((\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])\\s*((:\\s*\\[?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))))", + beginCaptures: { + "1": { + name: "meta.brace.round.js.jsx" + } + }, + end: "\\)", + endCaptures: { + "0": { + name: "meta.brace.round.js.jsx" + } + }, + patterns: [ + { + include: "#expression-inside-possibly-arrow-parens" + } + ] + }, + { + include: "#possibly-arrow-return-type" + }, + { + include: "#expression" + } + ] + }, + { + include: "#punctuation-comma" + }, + { + include: "#decl-block" + } + ] + }, + "parameter-array-binding-pattern": { + begin: "(?:(\\.\\.\\.)\\s*)?(\\[)", + beginCaptures: { + "1": { + name: "keyword.operator.rest.js.jsx" + }, + "2": { + name: "punctuation.definition.binding-pattern.array.js.jsx" + } + }, + end: "]", + endCaptures: { + "0": { + name: "punctuation.definition.binding-pattern.array.js.jsx" + } + }, + patterns: [ + { + include: "#parameter-binding-element" + }, + { + include: "#punctuation-comma" + } + ] + }, + "parameter-binding-element": { + patterns: [ + { + include: "#comment" + }, + { + include: "#string" + }, + { + include: "#numeric-literal" + }, + { + include: "#regex" + }, + { + include: "#parameter-object-binding-pattern" + }, + { + include: "#parameter-array-binding-pattern" + }, + { + include: "#destructuring-parameter-rest" + }, + { + include: "#variable-initializer" + } + ] + }, + "parameter-name": { + patterns: [ + { + captures: { + "1": { + name: "storage.modifier.js.jsx" + } + }, + match: "(?)))|((async\\s*)?(((<\\s*)$|(\\(\\s*((([\\[{]\\s*)?)$|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})\\s*((:\\s*\\{?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))|((\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])\\s*((:\\s*\\[?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*))))))|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*((\\)\\s*:)|((\\.\\.\\.\\s*)?[$_[:alpha:]][$_[:alnum:]]*\\s*:)))|(<\\s*[$_[:alpha:]][$_[:alnum:]]*\\s+extends\\s*[^=>])|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*(([$_[:alpha:]]|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|(\\.\\.\\.\\s*[$_[:alpha:]]))([^\"'()`]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))*)?\\)(\\s*:\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+)?\\s*=>)))))|(:\\s*((<)|(\\(\\s*((\\))|(\\.\\.\\.)|([$_[:alnum:]]+\\s*(([,:=?])|(\\)\\s*=>)))))))|(:\\s*(?{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))|((\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])\\s*((:\\s*\\[?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))))))|(:\\s*(=>|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(<[^<>]*>)|[^(),<=>])+=\\s*(((async\\s+)?((function\\s*[(*<])|(function\\s+)|([$_[:alpha:]][$_[:alnum:]]*\\s*=>)))|((async\\s*)?(((<\\s*)$|(\\(\\s*((([\\[{]\\s*)?)$|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})\\s*((:\\s*\\{?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))|((\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])\\s*((:\\s*\\[?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*))))))|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*((\\)\\s*:)|((\\.\\.\\.\\s*)?[$_[:alpha:]][$_[:alnum:]]*\\s*:)))|(<\\s*[$_[:alpha:]][$_[:alnum:]]*\\s+extends\\s*[^=>])|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*(([$_[:alpha:]]|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|(\\.\\.\\.\\s*[$_[:alpha:]]))([^\"'()`]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))*)?\\)(\\s*:\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+)?\\s*=>))))))" + }, + { + captures: { + "1": { + name: "storage.modifier.js.jsx" + }, + "2": { + name: "keyword.operator.rest.js.jsx" + }, + "3": { + name: "variable.parameter.js.jsx variable.language.this.js.jsx" + }, + "4": { + name: "variable.parameter.js.jsx" + }, + "5": { + name: "keyword.operator.optional.js.jsx" + } + }, + match: "(?:(?])", + name: "meta.type.annotation.js.jsx", + patterns: [ + { + include: "#type" + } + ] + } + ] + }, + "paren-expression": { + begin: "\\(", + beginCaptures: { + "0": { + name: "meta.brace.round.js.jsx" + } + }, + end: "\\)", + endCaptures: { + "0": { + name: "meta.brace.round.js.jsx" + } + }, + patterns: [ + { + include: "#expression" + } + ] + }, + "paren-expression-possibly-arrow": { + patterns: [ + { + begin: "(?<=[(,=])\\s*(async)?(?=\\s*((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*))?\\(\\s*((([\\[{]\\s*)?)$|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})\\s*((:\\s*\\{?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))|((\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])\\s*((:\\s*\\[?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))))", + beginCaptures: { + "1": { + name: "storage.modifier.async.js.jsx" + } + }, + end: "(?<=\\))", + patterns: [ + { + include: "#paren-expression-possibly-arrow-with-typeparameters" + } + ] + }, + { + begin: "(?<=[(,=]|=>|^return|[^$._[:alnum:]]return)\\s*(async)?(?=\\s*((((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*))?\\()|(<)|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)))\\s*$)", + beginCaptures: { + "1": { + name: "storage.modifier.async.js.jsx" + } + }, + end: "(?<=\\))", + patterns: [ + { + include: "#paren-expression-possibly-arrow-with-typeparameters" + } + ] + }, + { + include: "#possibly-arrow-return-type" + } + ] + }, + "paren-expression-possibly-arrow-with-typeparameters": { + patterns: [ + { + include: "#type-parameters" + }, + { + begin: "\\(", + beginCaptures: { + "0": { + name: "meta.brace.round.js.jsx" + } + }, + end: "\\)", + endCaptures: { + "0": { + name: "meta.brace.round.js.jsx" + } + }, + patterns: [ + { + include: "#expression-inside-possibly-arrow-parens" + } + ] + } + ] + }, + "possibly-arrow-return-type": { + begin: "(?<=\\)|^)\\s*(:)(?=\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*=>)", + beginCaptures: { + "1": { + name: "meta.arrow.js.jsx meta.return.type.arrow.js.jsx keyword.operator.type.annotation.js.jsx" + } + }, + contentName: "meta.arrow.js.jsx meta.return.type.arrow.js.jsx", + end: "(?==>|\\{|^(\\s*(export|function|class|interface|let|var|\\busing(?=\\s+(?!in\\b|of\\b(?!\\s*(?:of\\b|=)))[$_[:alpha:]])\\b|\\bawait\\s+\\busing(?=\\s+(?!in\\b|of\\b(?!\\s*(?:of\\b|=)))[$_[:alpha:]])\\b\\b|const|import|enum|namespace|module|type|abstract|declare)\\s+))", + patterns: [ + { + include: "#arrow-return-type-body" + } + ] + }, + "property-accessor": { + match: "(?|&&|\\|\\||\\*/)\\s*(/)(?![*/])(?=(?:[^()/\\[\\\\]|\\\\.|\\[([^]\\\\]|\\\\.)+]|\\(([^)\\\\]|\\\\.)+\\))+/([dgimsuvy]+|(?![*/])|(?=/\\*))(?!\\s*[$0-9A-Z_a-z]))", + beginCaptures: { + "1": { + name: "punctuation.definition.string.begin.js.jsx" + } + }, + end: "(/)([dgimsuvy]*)", + endCaptures: { + "1": { + name: "punctuation.definition.string.end.js.jsx" + }, + "2": { + name: "keyword.other.js.jsx" + } + }, + name: "string.regexp.js.jsx", + patterns: [ + { + include: "#regexp" + } + ] + }, + { + begin: "((?)" + }, + { + match: "[*+?]|\\{(\\d+,\\d+|\\d+,|,\\d+|\\d+)}\\??", + name: "keyword.operator.quantifier.regexp" + }, + { + match: "\\|", + name: "keyword.operator.or.regexp" + }, + { + begin: "(\\()((\\?=)|(\\?!)|(\\?<=)|(\\?)?", + beginCaptures: { + "0": { + name: "punctuation.definition.group.regexp" + }, + "1": { + name: "punctuation.definition.group.no-capture.regexp" + }, + "2": { + name: "variable.other.regexp" + } + }, + end: "\\)", + endCaptures: { + "0": { + name: "punctuation.definition.group.regexp" + } + }, + name: "meta.group.regexp", + patterns: [ + { + include: "#regexp" + } + ] + }, + { + begin: "(\\[)(\\^)?", + beginCaptures: { + "1": { + name: "punctuation.definition.character-class.regexp" + }, + "2": { + name: "keyword.operator.negation.regexp" + } + }, + end: "(])", + endCaptures: { + "1": { + name: "punctuation.definition.character-class.regexp" + } + }, + name: "constant.other.character-class.set.regexp", + patterns: [ + { + captures: { + "1": { + name: "constant.character.numeric.regexp" + }, + "2": { + name: "constant.character.control.regexp" + }, + "3": { + name: "constant.character.escape.backslash.regexp" + }, + "4": { + name: "constant.character.numeric.regexp" + }, + "5": { + name: "constant.character.control.regexp" + }, + "6": { + name: "constant.character.escape.backslash.regexp" + } + }, + match: "(?:.|(\\\\(?:[0-7]{3}|x\\h{2}|u\\h{4}))|(\\\\c[A-Z])|(\\\\.))-(?:[^]\\\\]|(\\\\(?:[0-7]{3}|x\\h{2}|u\\h{4}))|(\\\\c[A-Z])|(\\\\.))", + name: "constant.other.character-class.range.regexp" + }, + { + include: "#regex-character-class" + } + ] + }, + { + include: "#regex-character-class" + } + ] + }, + "return-type": { + patterns: [ + { + begin: "(?<=\\))\\s*(:)(?=\\s*\\S)", + beginCaptures: { + "1": { + name: "keyword.operator.type.annotation.js.jsx" + } + }, + end: "(?]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\()|(EPSILON|MAX_SAFE_INTEGER|MAX_VALUE|MIN_SAFE_INTEGER|MIN_VALUE|NEGATIVE_INFINITY|POSITIVE_INFINITY)\\b(?!\\$))" + }, + { + captures: { + "1": { + name: "support.type.object.module.js.jsx" + }, + "2": { + name: "support.type.object.module.js.jsx" + }, + "3": { + name: "punctuation.accessor.js.jsx" + }, + "4": { + name: "punctuation.accessor.optional.js.jsx" + }, + "5": { + name: "support.type.object.module.js.jsx" + } + }, + match: "(?\\[]|=>|&(?!&)|\\|(?!\\|)))))([^(<>]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>|<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([$_[:alpha:]][$_[:alnum:]]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))(?=\\s*([,.<>\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^(<>]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>|<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([$_[:alpha:]][$_[:alnum:]]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))(?=\\s*([,.<>\\[]|=>|&(?!&)|\\|(?!\\|)))))([^(<>]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>)*(?))*(?)*(?\\s*)?`)", + end: "(?=`)", + patterns: [ + { + begin: "(?=(([$_[:alpha:]][$_[:alnum:]]*\\s*\\??\\.\\s*)*|(\\??\\.\\s*)?)([$_[:alpha:]][$_[:alnum:]]*))", + end: "(?=(<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([$_[:alpha:]][$_[:alnum:]]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))(?=\\s*([,.<>\\[]|=>|&(?!&)|\\|(?!\\|)))))([^(<>]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>|<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([$_[:alpha:]][$_[:alnum:]]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))(?=\\s*([,.<>\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^(<>]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>|<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([$_[:alpha:]][$_[:alnum:]]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))(?=\\s*([,.<>\\[]|=>|&(?!&)|\\|(?!\\|)))))([^(<>]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>)*(?))*(?)*(?\\s*)?`)", + patterns: [ + { + include: "#support-function-call-identifiers" + }, + { + match: "([$_[:alpha:]][$_[:alnum:]]*)", + name: "entity.name.function.tagged-template.js.jsx" + } + ] + }, + { + include: "#type-arguments" + } + ] + }, + { + begin: "([$_[:alpha:]][$_[:alnum:]]*)?\\s*(?=(<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([$_[:alpha:]][$_[:alnum:]]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))(?=\\s*([,.<>\\[]|=>|&(?!&)|\\|(?!\\|)))))([^(<>]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>|<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([$_[:alpha:]][$_[:alnum:]]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))(?=\\s*([,.<>\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^(<>]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>|<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([$_[:alpha:]][$_[:alnum:]]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))(?=\\s*([,.<>\\[]|=>|&(?!&)|\\|(?!\\|)))))([^(<>]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>)*(?))*(?)*(?\\s*)`)", + beginCaptures: { + "1": { + name: "entity.name.function.tagged-template.js.jsx" + } + }, + end: "(?=`)", + patterns: [ + { + include: "#type-arguments" + } + ] + } + ] + }, + "template-substitution-element": { + begin: "\\$\\{", + beginCaptures: { + "0": { + name: "punctuation.definition.template-expression.begin.js.jsx" + } + }, + contentName: "meta.embedded.line.js.jsx", + end: "}", + endCaptures: { + "0": { + name: "punctuation.definition.template-expression.end.js.jsx" + } + }, + name: "meta.template.expression.js.jsx", + patterns: [ + { + include: "#expression" + } + ] + }, + "template-type": { + patterns: [ + { + include: "#template-call" + }, + { + begin: "([$_[:alpha:]][$_[:alnum:]]*)?(`)", + beginCaptures: { + "1": { + name: "entity.name.function.tagged-template.js.jsx" + }, + "2": { + name: "string.template.js.jsx punctuation.definition.string.template.begin.js.jsx" + } + }, + contentName: "string.template.js.jsx", + end: "`", + endCaptures: { + "0": { + name: "string.template.js.jsx punctuation.definition.string.template.end.js.jsx" + } + }, + patterns: [ + { + include: "#template-type-substitution-element" + }, + { + include: "#string-character-escape" + } + ] + } + ] + }, + "template-type-substitution-element": { + begin: "\\$\\{", + beginCaptures: { + "0": { + name: "punctuation.definition.template-expression.begin.js.jsx" + } + }, + contentName: "meta.embedded.line.js.jsx", + end: "}", + endCaptures: { + "0": { + name: "punctuation.definition.template-expression.end.js.jsx" + } + }, + name: "meta.template.expression.js.jsx", + patterns: [ + { + include: "#type" + } + ] + }, + "ternary-expression": { + begin: "(?!\\?\\.\\s*\\D)(\\?)(?!\\?)", + beginCaptures: { + "1": { + name: "keyword.operator.ternary.js.jsx" + } + }, + end: "\\s*(:)", + endCaptures: { + "1": { + name: "keyword.operator.ternary.js.jsx" + } + }, + patterns: [ + { + include: "#expression" + } + ] + }, + "this-literal": { + match: "(?])|((?<=[]$)>_}[:alpha:]])\\s*(?=\\{)))", + name: "meta.type.annotation.js.jsx", + patterns: [ + { + include: "#type" + } + ] + }, + { + begin: "(:)", + beginCaptures: { + "1": { + name: "keyword.operator.type.annotation.js.jsx" + } + }, + end: "(?])|(?=^\\s*$)|((?<=[]$)>_}[:alpha:]])\\s*(?=\\{)))", + name: "meta.type.annotation.js.jsx", + patterns: [ + { + include: "#type" + } + ] + } + ] + }, + "type-arguments": { + begin: "<", + beginCaptures: { + "0": { + name: "punctuation.definition.typeparameters.begin.js.jsx" + } + }, + end: ">", + endCaptures: { + "0": { + name: "punctuation.definition.typeparameters.end.js.jsx" + } + }, + name: "meta.type.parameters.js.jsx", + patterns: [ + { + include: "#type-arguments-body" + } + ] + }, + "type-arguments-body": { + patterns: [ + { + captures: { + "0": { + name: "keyword.operator.type.js.jsx" + } + }, + match: "(?)", + patterns: [ + { + include: "#comment" + }, + { + include: "#type-parameters" + } + ] + }, + { + begin: "(?))))))", + end: "(?<=\\))", + name: "meta.type.function.js.jsx", + patterns: [ + { + include: "#function-parameters" + } + ] + } + ] + }, + "type-function-return-type": { + patterns: [ + { + begin: "(=>)(?=\\s*\\S)", + beginCaptures: { + "1": { + name: "storage.type.function.arrow.js.jsx" + } + }, + end: "(?)(??{}]|//|$)", + name: "meta.type.function.return.js.jsx", + patterns: [ + { + include: "#type-function-return-type-core" + } + ] + }, + { + begin: "=>", + beginCaptures: { + "0": { + name: "storage.type.function.arrow.js.jsx" + } + }, + end: "(?)(??{}]|//|^\\s*$)|((?<=\\S)(?=\\s*$)))", + name: "meta.type.function.return.js.jsx", + patterns: [ + { + include: "#type-function-return-type-core" + } + ] + } + ] + }, + "type-function-return-type-core": { + patterns: [ + { + include: "#comment" + }, + { + begin: "(?<==>)(?=\\s*\\{)", + end: "(?<=})", + patterns: [ + { + include: "#type-object" + } + ] + }, + { + include: "#type-predicate-operator" + }, + { + include: "#type" + } + ] + }, + "type-infer": { + patterns: [ + { + captures: { + "1": { + name: "keyword.operator.expression.infer.js.jsx" + }, + "2": { + name: "entity.name.type.js.jsx" + }, + "3": { + name: "keyword.operator.expression.extends.js.jsx" + } + }, + match: "(?)", + endCaptures: { + "1": { + name: "meta.type.parameters.js.jsx punctuation.definition.typeparameters.end.js.jsx" + } + }, + patterns: [ + { + include: "#type-arguments-body" + } + ] + }, + { + begin: "([$_[:alpha:]][$_[:alnum:]]*)\\s*(<)", + beginCaptures: { + "1": { + name: "entity.name.type.js.jsx" + }, + "2": { + name: "meta.type.parameters.js.jsx punctuation.definition.typeparameters.begin.js.jsx" + } + }, + contentName: "meta.type.parameters.js.jsx", + end: "(>)", + endCaptures: { + "1": { + name: "meta.type.parameters.js.jsx punctuation.definition.typeparameters.end.js.jsx" + } + }, + patterns: [ + { + include: "#type-arguments-body" + } + ] + }, + { + captures: { + "1": { + name: "entity.name.type.module.js.jsx" + }, + "2": { + name: "punctuation.accessor.js.jsx" + }, + "3": { + name: "punctuation.accessor.optional.js.jsx" + } + }, + match: "([$_[:alpha:]][$_[:alnum:]]*)\\s*(?:(\\.)|(\\?\\.(?!\\s*\\d)))" + }, + { + match: "[$_[:alpha:]][$_[:alnum:]]*", + name: "entity.name.type.js.jsx" + } + ] + }, + "type-object": { + begin: "\\{", + beginCaptures: { + "0": { + name: "punctuation.definition.block.js.jsx" + } + }, + end: "}", + endCaptures: { + "0": { + name: "punctuation.definition.block.js.jsx" + } + }, + name: "meta.object.type.js.jsx", + patterns: [ + { + include: "#comment" + }, + { + include: "#method-declaration" + }, + { + include: "#indexer-declaration" + }, + { + include: "#indexer-mapped-type-declaration" + }, + { + include: "#field-declaration" + }, + { + include: "#type-annotation" + }, + { + begin: "\\.\\.\\.", + beginCaptures: { + "0": { + name: "keyword.operator.spread.js.jsx" + } + }, + end: "(?=[,;}]|$)|(?<=})", + patterns: [ + { + include: "#type" + } + ] + }, + { + include: "#punctuation-comma" + }, + { + include: "#punctuation-semicolon" + }, + { + include: "#type" + } + ] + }, + "type-operators": { + patterns: [ + { + include: "#typeof-operator" + }, + { + include: "#type-infer" + }, + { + begin: "([\\&|])(?=\\s*\\{)", + beginCaptures: { + "0": { + name: "keyword.operator.type.js.jsx" + } + }, + end: "(?<=})", + patterns: [ + { + include: "#type-object" + } + ] + }, + { + begin: "[\\&|]", + beginCaptures: { + "0": { + name: "keyword.operator.type.js.jsx" + } + }, + end: "(?=\\S)" + }, + { + match: "(?)", + endCaptures: { + "1": { + name: "punctuation.definition.typeparameters.end.js.jsx" + } + }, + name: "meta.type.parameters.js.jsx", + patterns: [ + { + include: "#comment" + }, + { + match: "(?)", + name: "keyword.operator.assignment.js.jsx" + } + ] + }, + "type-paren-or-function-parameters": { + begin: "\\(", + beginCaptures: { + "0": { + name: "meta.brace.round.js.jsx" + } + }, + end: "\\)", + endCaptures: { + "0": { + name: "meta.brace.round.js.jsx" + } + }, + name: "meta.type.paren.cover.js.jsx", + patterns: [ + { + captures: { + "1": { + name: "storage.modifier.js.jsx" + }, + "2": { + name: "keyword.operator.rest.js.jsx" + }, + "3": { + name: "entity.name.function.js.jsx variable.language.this.js.jsx" + }, + "4": { + name: "entity.name.function.js.jsx" + }, + "5": { + name: "keyword.operator.optional.js.jsx" + } + }, + match: "(?:(?)))))))|(:\\s*(?{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))|((\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])\\s*((:\\s*\\[?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*))))))))" + }, + { + captures: { + "1": { + name: "storage.modifier.js.jsx" + }, + "2": { + name: "keyword.operator.rest.js.jsx" + }, + "3": { + name: "variable.parameter.js.jsx variable.language.this.js.jsx" + }, + "4": { + name: "variable.parameter.js.jsx" + }, + "5": { + name: "keyword.operator.optional.js.jsx" + } + }, + match: "(?:(??{|}]|(extends\\s+)|$|;|^\\s*$|^\\s*(?:abstract|async|\\bawait\\s+\\busing(?=\\s+(?!in\\b|of\\b(?!\\s*(?:of\\b|=)))[$_[:alpha:]])\\b\\b|break|case|catch|class|const|continue|declare|do|else|enum|export|finally|function|for|goto|if|import|interface|let|module|namespace|switch|return|throw|try|type|\\busing(?=\\s+(?!in\\b|of\\b(?!\\s*(?:of\\b|=)))[$_[:alpha:]])\\b|var|while)\\b)", + patterns: [ + { + include: "#type-arguments" + }, + { + include: "#expression" + } + ] + }, + "undefined-literal": { + match: "(?)))|((async\\s*)?(((<\\s*)$|(\\(\\s*((([\\[{]\\s*)?)$|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})\\s*((:\\s*\\{?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))|((\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])\\s*((:\\s*\\[?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*))))))|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*((\\)\\s*:)|((\\.\\.\\.\\s*)?[$_[:alpha:]][$_[:alnum:]]*\\s*:)))|(<\\s*[$_[:alpha:]][$_[:alnum:]]*\\s+extends\\s*[^=>])|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*(([$_[:alpha:]]|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|(\\.\\.\\.\\s*[$_[:alpha:]]))([^\"'()`]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))*)?\\)(\\s*:\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+)?\\s*=>)))))|(:\\s*((<)|(\\(\\s*((\\))|(\\.\\.\\.)|([$_[:alnum:]]+\\s*(([,:=?])|(\\)\\s*=>)))))))|(:\\s*(?{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))|((\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])\\s*((:\\s*\\[?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))))))|(:\\s*(=>|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(<[^<>]*>)|[^(),<=>])+=\\s*(((async\\s+)?((function\\s*[(*<])|(function\\s+)|([$_[:alpha:]][$_[:alnum:]]*\\s*=>)))|((async\\s*)?(((<\\s*)$|(\\(\\s*((([\\[{]\\s*)?)$|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})\\s*((:\\s*\\{?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))|((\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])\\s*((:\\s*\\[?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*))))))|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*((\\)\\s*:)|((\\.\\.\\.\\s*)?[$_[:alpha:]][$_[:alnum:]]*\\s*:)))|(<\\s*[$_[:alpha:]][$_[:alnum:]]*\\s+extends\\s*[^=>])|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*(([$_[:alpha:]]|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|(\\.\\.\\.\\s*[$_[:alpha:]]))([^\"'()`]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))*)?\\)(\\s*:\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+)?\\s*=>))))))", + beginCaptures: { + "1": { + name: "meta.definition.variable.js.jsx variable.other.constant.js.jsx entity.name.function.js.jsx" + } + }, + end: "(?=$|^|[,;=}]|((?)))|((async\\s*)?(((<\\s*)$|(\\(\\s*((([\\[{]\\s*)?)$|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})\\s*((:\\s*\\{?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))|((\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])\\s*((:\\s*\\[?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*))))))|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*((\\)\\s*:)|((\\.\\.\\.\\s*)?[$_[:alpha:]][$_[:alnum:]]*\\s*:)))|(<\\s*[$_[:alpha:]][$_[:alnum:]]*\\s+extends\\s*[^=>])|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*(([$_[:alpha:]]|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|(\\.\\.\\.\\s*[$_[:alpha:]]))([^\"'()`]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))*)?\\)(\\s*:\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+)?\\s*=>)))))|(:\\s*((<)|(\\(\\s*((\\))|(\\.\\.\\.)|([$_[:alnum:]]+\\s*(([,:=?])|(\\)\\s*=>)))))))|(:\\s*(?{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))|((\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])\\s*((:\\s*\\[?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))))))|(:\\s*(=>|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(<[^<>]*>)|[^(),<=>])+=\\s*(((async\\s+)?((function\\s*[(*<])|(function\\s+)|([$_[:alpha:]][$_[:alnum:]]*\\s*=>)))|((async\\s*)?(((<\\s*)$|(\\(\\s*((([\\[{]\\s*)?)$|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})\\s*((:\\s*\\{?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))|((\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])\\s*((:\\s*\\[?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*))))))|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*((\\)\\s*:)|((\\.\\.\\.\\s*)?[$_[:alpha:]][$_[:alnum:]]*\\s*:)))|(<\\s*[$_[:alpha:]][$_[:alnum:]]*\\s+extends\\s*[^=>])|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*(([$_[:alpha:]]|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|(\\.\\.\\.\\s*[$_[:alpha:]]))([^\"'()`]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))*)?\\)(\\s*:\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+)?\\s*=>))))))", + beginCaptures: { + "1": { + name: "meta.definition.variable.js.jsx entity.name.function.js.jsx" + }, + "2": { + name: "keyword.operator.definiteassignment.js.jsx" + } + }, + end: "(?=$|^|[,;=}]|((?\\s*$)", + beginCaptures: { + "1": { + name: "keyword.operator.assignment.js.jsx" + } + }, + end: "(?=$|^|[]),;}]|((??\\[]|^await|[^$._[:alnum:]]await|^return|[^$._[:alnum:]]return|^yield|[^$._[:alnum:]]yield|^throw|[^$._[:alnum:]]throw|^in|[^$._[:alnum:]]in|^of|[^$._[:alnum:]]of|^typeof|[^$._[:alnum:]]typeof|&&|\\|\\||\\*)\\s*(\\{)", + beginCaptures: { + "1": { + name: "punctuation.definition.block.tsx" + } + }, + end: "}", + endCaptures: { + "0": { + name: "punctuation.definition.block.tsx" + } + }, + name: "meta.objectliteral.tsx", + patterns: [ + { + include: "#object-member" + } + ] + }, + "array-binding-pattern": { + begin: "(?:(\\.\\.\\.)\\s*)?(\\[)", + beginCaptures: { + "1": { + name: "keyword.operator.rest.tsx" + }, + "2": { + name: "punctuation.definition.binding-pattern.array.tsx" + } + }, + end: "]", + endCaptures: { + "0": { + name: "punctuation.definition.binding-pattern.array.tsx" + } + }, + patterns: [ + { + include: "#binding-element" + }, + { + include: "#punctuation-comma" + } + ] + }, + "array-binding-pattern-const": { + begin: "(?:(\\.\\.\\.)\\s*)?(\\[)", + beginCaptures: { + "1": { + name: "keyword.operator.rest.tsx" + }, + "2": { + name: "punctuation.definition.binding-pattern.array.tsx" + } + }, + end: "]", + endCaptures: { + "0": { + name: "punctuation.definition.binding-pattern.array.tsx" + } + }, + patterns: [ + { + include: "#binding-element-const" + }, + { + include: "#punctuation-comma" + } + ] + }, + "array-literal": { + begin: "\\s*(\\[)", + beginCaptures: { + "1": { + name: "meta.brace.square.tsx" + } + }, + end: "]", + endCaptures: { + "0": { + name: "meta.brace.square.tsx" + } + }, + name: "meta.array.literal.tsx", + patterns: [ + { + include: "#expression" + }, + { + include: "#punctuation-comma" + } + ] + }, + "arrow-function": { + patterns: [ + { + captures: { + "1": { + name: "storage.modifier.async.tsx" + }, + "2": { + name: "variable.parameter.tsx" + } + }, + match: "(?:(?)", + name: "meta.arrow.tsx" + }, + { + begin: "(?:(?]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*((\\)\\s*:)|((\\.\\.\\.\\s*)?[$_[:alpha:]][$_[:alnum:]]*\\s*:)))|(<\\s*[$_[:alpha:]][$_[:alnum:]]*\\s+extends\\s*[^=>])|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*(([$_[:alpha:]]|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|(\\.\\.\\.\\s*[$_[:alpha:]]))([^\"'()`]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))*)?\\)(\\s*:\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+)?\\s*=>)))", + beginCaptures: { + "1": { + name: "storage.modifier.async.tsx" + } + }, + end: "(?==>|\\{|^(\\s*(export|function|class|interface|let|var|\\busing(?=\\s+(?!in\\b|of\\b(?!\\s*(?:of\\b|=)))[$_[:alpha:]])\\b|\\bawait\\s+\\busing(?=\\s+(?!in\\b|of\\b(?!\\s*(?:of\\b|=)))[$_[:alpha:]])\\b\\b|const|import|enum|namespace|module|type|abstract|declare)\\s+))", + name: "meta.arrow.tsx", + patterns: [ + { + include: "#comment" + }, + { + include: "#type-parameters" + }, + { + include: "#function-parameters" + }, + { + include: "#arrow-return-type" + }, + { + include: "#possibly-arrow-return-type" + } + ] + }, + { + begin: "=>", + beginCaptures: { + "0": { + name: "storage.type.function.arrow.tsx" + } + }, + end: "((?<=[}\\S])(?)|((?!\\{)(?=\\S)))(?!/[*/])", + name: "meta.arrow.tsx", + patterns: [ + { + include: "#single-line-comment-consuming-line-ending" + }, + { + include: "#decl-block" + }, + { + include: "#expression" + } + ] + } + ] + }, + "arrow-return-type": { + begin: "(?<=\\))\\s*(:)", + beginCaptures: { + "1": { + name: "keyword.operator.type.annotation.tsx" + } + }, + end: "(?==>|\\{|^(\\s*(export|function|class|interface|let|var|\\busing(?=\\s+(?!in\\b|of\\b(?!\\s*(?:of\\b|=)))[$_[:alpha:]])\\b|\\bawait\\s+\\busing(?=\\s+(?!in\\b|of\\b(?!\\s*(?:of\\b|=)))[$_[:alpha:]])\\b\\b|const|import|enum|namespace|module|type|abstract|declare)\\s+))", + name: "meta.return.type.arrow.tsx", + patterns: [ + { + include: "#arrow-return-type-body" + } + ] + }, + "arrow-return-type-body": { + patterns: [ + { + begin: "(?<=:)(?=\\s*\\{)", + end: "(?<=})", + patterns: [ + { + include: "#type-object" + } + ] + }, + { + include: "#type-predicate-operator" + }, + { + include: "#type" + } + ] + }, + "async-modifier": { + match: "(?\\s*$)", + beginCaptures: { + "1": { + name: "punctuation.definition.comment.tsx" + } + }, + end: "(?=$)", + name: "comment.line.triple-slash.directive.tsx", + patterns: [ + { + begin: "(<)(reference|amd-dependency|amd-module)", + beginCaptures: { + "1": { + name: "punctuation.definition.tag.directive.tsx" + }, + "2": { + name: "entity.name.tag.directive.tsx" + } + }, + end: "/>", + endCaptures: { + "0": { + name: "punctuation.definition.tag.directive.tsx" + } + }, + name: "meta.tag.tsx", + patterns: [ + { + match: "path|types|no-default-lib|lib|name|resolution-mode", + name: "entity.other.attribute-name.directive.tsx" + }, + { + match: "=", + name: "keyword.operator.assignment.tsx" + }, + { + include: "#string" + } + ] + } + ] + }, + docblock: { + patterns: [ + { + captures: { + "1": { + name: "storage.type.class.jsdoc" + }, + "2": { + name: "punctuation.definition.block.tag.jsdoc" + }, + "3": { + name: "constant.language.access-type.jsdoc" + } + }, + match: "((@)a(?:ccess|pi))\\s+(p(?:rivate|rotected|ublic))\\b" + }, + { + captures: { + "1": { + name: "storage.type.class.jsdoc" + }, + "2": { + name: "punctuation.definition.block.tag.jsdoc" + }, + "3": { + name: "entity.name.type.instance.jsdoc" + }, + "4": { + name: "punctuation.definition.bracket.angle.begin.jsdoc" + }, + "5": { + name: "constant.other.email.link.underline.jsdoc" + }, + "6": { + name: "punctuation.definition.bracket.angle.end.jsdoc" + } + }, + match: "((@)author)\\s+([^*/<>@\\s](?:[^*/<>@]|\\*[^/])*)(?:\\s*(<)([^>\\s]+)(>))?" + }, + { + captures: { + "1": { + name: "storage.type.class.jsdoc" + }, + "2": { + name: "punctuation.definition.block.tag.jsdoc" + }, + "3": { + name: "entity.name.type.instance.jsdoc" + }, + "4": { + name: "keyword.operator.control.jsdoc" + }, + "5": { + name: "entity.name.type.instance.jsdoc" + } + }, + match: "((@)borrows)\\s+((?:[^*/@\\s]|\\*[^/])+)\\s+(as)\\s+((?:[^*/@\\s]|\\*[^/])+)" + }, + { + begin: "((@)example)\\s+", + beginCaptures: { + "1": { + name: "storage.type.class.jsdoc" + }, + "2": { + name: "punctuation.definition.block.tag.jsdoc" + } + }, + end: "(?=@|\\*/)", + name: "meta.example.jsdoc", + patterns: [ + { + match: "^\\s\\*\\s+" + }, + { + begin: "\\G(<)caption(>)", + beginCaptures: { + "0": { + name: "entity.name.tag.inline.jsdoc" + }, + "1": { + name: "punctuation.definition.bracket.angle.begin.jsdoc" + }, + "2": { + name: "punctuation.definition.bracket.angle.end.jsdoc" + } + }, + contentName: "constant.other.description.jsdoc", + end: "()|(?=\\*/)", + endCaptures: { + "0": { + name: "entity.name.tag.inline.jsdoc" + }, + "1": { + name: "punctuation.definition.bracket.angle.begin.jsdoc" + }, + "2": { + name: "punctuation.definition.bracket.angle.end.jsdoc" + } + } + }, + { + captures: { + "0": { + name: "source.embedded.tsx" + } + }, + match: "[^*@\\s](?:[^*]|\\*[^/])*" + } + ] + }, + { + captures: { + "1": { + name: "storage.type.class.jsdoc" + }, + "2": { + name: "punctuation.definition.block.tag.jsdoc" + }, + "3": { + name: "constant.language.symbol-type.jsdoc" + } + }, + match: "((@)kind)\\s+(class|constant|event|external|file|function|member|mixin|module|namespace|typedef)\\b" + }, + { + captures: { + "1": { + name: "storage.type.class.jsdoc" + }, + "2": { + name: "punctuation.definition.block.tag.jsdoc" + }, + "3": { + name: "variable.other.link.underline.jsdoc" + }, + "4": { + name: "entity.name.type.instance.jsdoc" + } + }, + match: "((@)see)\\s+(?:((?=https?://)(?:[^*\\s]|\\*[^/])+)|((?!https?://|(?:\\[[^]\\[]*])?\\{@(?:link|linkcode|linkplain|tutorial)\\b)(?:[^*/@\\s]|\\*[^/])+))" + }, + { + captures: { + "1": { + name: "storage.type.class.jsdoc" + }, + "2": { + name: "punctuation.definition.block.tag.jsdoc" + }, + "3": { + name: "variable.other.jsdoc" + } + }, + match: "((@)template)\\s+([$A-Z_a-z][]$.\\[\\w]*(?:\\s*,\\s*[$A-Z_a-z][]$.\\[\\w]*)*)" + }, + { + begin: "((@)template)\\s+(?=\\{)", + beginCaptures: { + "1": { + name: "storage.type.class.jsdoc" + }, + "2": { + name: "punctuation.definition.block.tag.jsdoc" + } + }, + end: "(?=\\s|\\*/|[^]$A-\\[_a-{}])", + patterns: [ + { + include: "#jsdoctype" + }, + { + match: "([$A-Z_a-z][]$.\\[\\w]*)", + name: "variable.other.jsdoc" + } + ] + }, + { + captures: { + "1": { + name: "storage.type.class.jsdoc" + }, + "2": { + name: "punctuation.definition.block.tag.jsdoc" + }, + "3": { + name: "variable.other.jsdoc" + } + }, + match: "((@)(?:arg|argument|const|constant|member|namespace|param|var))\\s+([$A-Z_a-z][]$.\\[\\w]*)" + }, + { + begin: "((@)typedef)\\s+(?=\\{)", + beginCaptures: { + "1": { + name: "storage.type.class.jsdoc" + }, + "2": { + name: "punctuation.definition.block.tag.jsdoc" + } + }, + end: "(?=\\s|\\*/|[^]$A-\\[_a-{}])", + patterns: [ + { + include: "#jsdoctype" + }, + { + match: "(?:[^*/@\\s]|\\*[^/])+", + name: "entity.name.type.instance.jsdoc" + } + ] + }, + { + begin: "((@)(?:arg|argument|const|constant|member|namespace|param|prop|property|var))\\s+(?=\\{)", + beginCaptures: { + "1": { + name: "storage.type.class.jsdoc" + }, + "2": { + name: "punctuation.definition.block.tag.jsdoc" + } + }, + end: "(?=\\s|\\*/|[^]$A-\\[_a-{}])", + patterns: [ + { + include: "#jsdoctype" + }, + { + match: "([$A-Z_a-z][]$.\\[\\w]*)", + name: "variable.other.jsdoc" + }, + { + captures: { + "1": { + name: "punctuation.definition.optional-value.begin.bracket.square.jsdoc" + }, + "2": { + name: "keyword.operator.assignment.jsdoc" + }, + "3": { + name: "source.embedded.tsx" + }, + "4": { + name: "punctuation.definition.optional-value.end.bracket.square.jsdoc" + }, + "5": { + name: "invalid.illegal.syntax.jsdoc" + } + }, + match: `(\\[)\\s*[$\\w]+(?:(?:\\[])?\\.[$\\w]+)*(?:\\s*(=)\\s*((?>"(?:\\*(?!/)|\\\\(?!")|[^*\\\\])*?"|'(?:\\*(?!/)|\\\\(?!')|[^*\\\\])*?'|\\[(?:\\*(?!/)|[^*])*?]|(?:\\*(?!/)|\\s(?!\\s*])|\\[.*?(?:]|(?=\\*/))|[^]*\\[\\s])*)*))?\\s*(?:(])((?:[^*\\s]|\\*[^/\\s])+)?|(?=\\*/))`, + name: "variable.other.jsdoc" + } + ] + }, + { + begin: "((@)(?:define|enum|exception|export|extends|lends|implements|modifies|namespace|private|protected|returns?|satisfies|suppress|this|throws|type|yields?))\\s+(?=\\{)", + beginCaptures: { + "1": { + name: "storage.type.class.jsdoc" + }, + "2": { + name: "punctuation.definition.block.tag.jsdoc" + } + }, + end: "(?=\\s|\\*/|[^]$A-\\[_a-{}])", + patterns: [ + { + include: "#jsdoctype" + } + ] + }, + { + captures: { + "1": { + name: "storage.type.class.jsdoc" + }, + "2": { + name: "punctuation.definition.block.tag.jsdoc" + }, + "3": { + name: "entity.name.type.instance.jsdoc" + } + }, + match: "((@)(?:alias|augments|callback|constructs|emits|event|fires|exports?|extends|external|function|func|host|lends|listens|interface|memberof!?|method|module|mixes|mixin|name|requires|see|this|typedef|uses))\\s+((?:[^*@{}\\s]|\\*[^/])+)" + }, + { + begin: `((@)(?:default(?:value)?|license|version))\\s+((["']))`, + beginCaptures: { + "1": { + name: "storage.type.class.jsdoc" + }, + "2": { + name: "punctuation.definition.block.tag.jsdoc" + }, + "3": { + name: "variable.other.jsdoc" + }, + "4": { + name: "punctuation.definition.string.begin.jsdoc" + } + }, + contentName: "variable.other.jsdoc", + end: "(\\3)|(?=$|\\*/)", + endCaptures: { + "0": { + name: "variable.other.jsdoc" + }, + "1": { + name: "punctuation.definition.string.end.jsdoc" + } + } + }, + { + captures: { + "1": { + name: "storage.type.class.jsdoc" + }, + "2": { + name: "punctuation.definition.block.tag.jsdoc" + }, + "3": { + name: "variable.other.jsdoc" + } + }, + match: "((@)(?:default(?:value)?|license|tutorial|variation|version))\\s+([^*\\s]+)" + }, + { + captures: { + "1": { + name: "punctuation.definition.block.tag.jsdoc" + } + }, + match: "(@)(?:abstract|access|alias|api|arg|argument|async|attribute|augments|author|beta|borrows|bubbles|callback|chainable|class|classdesc|code|config|const|constant|constructor|constructs|copyright|default|defaultvalue|define|deprecated|desc|description|dict|emits|enum|event|example|exception|exports?|extends|extension(?:_?for)?|external|externs|file|fileoverview|final|fires|for|func|function|generator|global|hideconstructor|host|ignore|implements|implicitCast|inherit[Dd]oc|inner|instance|interface|internal|kind|lends|license|listens|main|member|memberof!?|method|mixes|mixins?|modifies|module|name|namespace|noalias|nocollapse|nocompile|nosideeffects|override|overview|package|param|polymer(?:Behavior)?|preserve|private|prop|property|protected|public|read[Oo]nly|record|require[ds]|returns?|see|since|static|struct|submodule|summary|suppress|template|this|throws|todo|tutorial|type|typedef|unrestricted|uses|var|variation|version|virtual|writeOnce|yields?)\\b", + name: "storage.type.class.jsdoc" + }, + { + include: "#inline-tags" + }, + { + captures: { + "1": { + name: "storage.type.class.jsdoc" + }, + "2": { + name: "punctuation.definition.block.tag.jsdoc" + } + }, + match: "((@)[$_[:alpha:]][$_[:alnum:]]*)(?=\\s+)" + } + ] + }, + "enum-declaration": { + begin: "(?)))|((async\\s*)?(((<\\s*)$|(\\(\\s*((([\\[{]\\s*)?)$|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})\\s*((:\\s*\\{?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))|((\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])\\s*((:\\s*\\[?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*))))))|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*((\\)\\s*:)|((\\.\\.\\.\\s*)?[$_[:alpha:]][$_[:alnum:]]*\\s*:)))|(<\\s*[$_[:alpha:]][$_[:alnum:]]*\\s+extends\\s*[^=>])|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*(([$_[:alpha:]]|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|(\\.\\.\\.\\s*[$_[:alpha:]]))([^\"'()`]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))*)?\\)(\\s*:\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+)?\\s*=>)))))|(:\\s*((<)|(\\(\\s*((\\))|(\\.\\.\\.)|([$_[:alnum:]]+\\s*(([,:=?])|(\\)\\s*=>)))))))|(:\\s*(?{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))|((\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])\\s*((:\\s*\\[?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))))))|(:\\s*(=>|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(<[^<>]*>)|[^(),<=>])+=\\s*(((async\\s+)?((function\\s*[(*<])|(function\\s+)|([$_[:alpha:]][$_[:alnum:]]*\\s*=>)))|((async\\s*)?(((<\\s*)$|(\\(\\s*((([\\[{]\\s*)?)$|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})\\s*((:\\s*\\{?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))|((\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])\\s*((:\\s*\\[?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*))))))|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*((\\)\\s*:)|((\\.\\.\\.\\s*)?[$_[:alpha:]][$_[:alnum:]]*\\s*:)))|(<\\s*[$_[:alpha:]][$_[:alnum:]]*\\s+extends\\s*[^=>])|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*(([$_[:alpha:]]|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|(\\.\\.\\.\\s*[$_[:alpha:]]))([^\"'()`]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))*)?\\)(\\s*:\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+)?\\s*=>))))))" + }, + { + captures: { + "1": { + name: "storage.modifier.tsx" + }, + "2": { + name: "keyword.operator.rest.tsx" + }, + "3": { + name: "variable.parameter.tsx variable.language.this.tsx" + }, + "4": { + name: "variable.parameter.tsx" + }, + "5": { + name: "keyword.operator.optional.tsx" + } + }, + match: "(?:(??}]|\\|\\||&&|!==|$|((?>>??|\\|)=", + name: "keyword.operator.assignment.compound.bitwise.tsx" + }, + { + match: "<<|>>>?", + name: "keyword.operator.bitwise.shift.tsx" + }, + { + match: "[!=]==?", + name: "keyword.operator.comparison.tsx" + }, + { + match: "<=|>=|<>|[<>]", + name: "keyword.operator.relational.tsx" + }, + { + captures: { + "1": { + name: "keyword.operator.logical.tsx" + }, + "2": { + name: "keyword.operator.assignment.compound.tsx" + }, + "3": { + name: "keyword.operator.arithmetic.tsx" + } + }, + match: "(?<=[$_[:alnum:]])(!)\\s*(?:(/=)|(/)(?![*/]))" + }, + { + match: "!|&&|\\|\\||\\?\\?", + name: "keyword.operator.logical.tsx" + }, + { + match: "[\\&^|~]", + name: "keyword.operator.bitwise.tsx" + }, + { + match: "=", + name: "keyword.operator.assignment.tsx" + }, + { + match: "--", + name: "keyword.operator.decrement.tsx" + }, + { + match: "\\+\\+", + name: "keyword.operator.increment.tsx" + }, + { + match: "[-%*+/]", + name: "keyword.operator.arithmetic.tsx" + }, + { + begin: "(?<=[]$)_[:alnum:]])\\s*(?=(/\\*([^*]|(\\*[^/]))*\\*/\\s*)+(?:(/=)|(/)(?![*/])))", + end: "(/=)|(/)(?!\\*([^*]|(\\*[^/]))*\\*/)", + endCaptures: { + "1": { + name: "keyword.operator.assignment.compound.tsx" + }, + "2": { + name: "keyword.operator.arithmetic.tsx" + } + }, + patterns: [ + { + include: "#comment" + } + ] + }, + { + captures: { + "1": { + name: "keyword.operator.assignment.compound.tsx" + }, + "2": { + name: "keyword.operator.arithmetic.tsx" + } + }, + match: "(?<=[]$)_[:alnum:]])\\s*(?:(/=)|(/)(?![*/]))" + } + ] + }, + expressionPunctuations: { + patterns: [ + { + include: "#punctuation-comma" + }, + { + include: "#punctuation-accessor" + } + ] + }, + expressionWithoutIdentifiers: { + patterns: [ + { + include: "#jsx" + }, + { + include: "#string" + }, + { + include: "#regex" + }, + { + include: "#comment" + }, + { + include: "#function-expression" + }, + { + include: "#class-expression" + }, + { + include: "#arrow-function" + }, + { + include: "#paren-expression-possibly-arrow" + }, + { + include: "#cast" + }, + { + include: "#ternary-expression" + }, + { + include: "#new-expr" + }, + { + include: "#instanceof-expr" + }, + { + include: "#object-literal" + }, + { + include: "#expression-operators" + }, + { + include: "#function-call" + }, + { + include: "#literal" + }, + { + include: "#support-objects" + }, + { + include: "#paren-expression" + } + ] + }, + "field-declaration": { + begin: "(?)))|((async\\s*)?(((<\\s*)$|(\\(\\s*((([\\[{]\\s*)?)$|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})\\s*((:\\s*\\{?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))|((\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])\\s*((:\\s*\\[?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*))))))|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*((\\)\\s*:)|((\\.\\.\\.\\s*)?[$_[:alpha:]][$_[:alnum:]]*\\s*:)))|(<\\s*[$_[:alpha:]][$_[:alnum:]]*\\s+extends\\s*[^=>])|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*(([$_[:alpha:]]|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|(\\.\\.\\.\\s*[$_[:alpha:]]))([^\"'()`]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))*)?\\)(\\s*:\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+)?\\s*=>)))))|(:\\s*((<)|(\\(\\s*((\\))|(\\.\\.\\.)|([$_[:alnum:]]+\\s*(([,:=?])|(\\)\\s*=>)))))))|(:\\s*(?{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))|((\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])\\s*((:\\s*\\[?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))))))|(:\\s*(=>|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(<[^<>]*>)|[^(),<=>])+=\\s*(((async\\s+)?((function\\s*[(*<])|(function\\s+)|([$_[:alpha:]][$_[:alnum:]]*\\s*=>)))|((async\\s*)?(((<\\s*)$|(\\(\\s*((([\\[{]\\s*)?)$|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})\\s*((:\\s*\\{?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))|((\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])\\s*((:\\s*\\[?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*))))))|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*((\\)\\s*:)|((\\.\\.\\.\\s*)?[$_[:alpha:]][$_[:alnum:]]*\\s*:)))|(<\\s*[$_[:alpha:]][$_[:alnum:]]*\\s+extends\\s*[^=>])|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*(([$_[:alpha:]]|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|(\\.\\.\\.\\s*[$_[:alpha:]]))([^\"'()`]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))*)?\\)(\\s*:\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+)?\\s*=>))))))" + }, + { + match: "#?[$_[:alpha:]][$_[:alnum:]]*", + name: "meta.definition.property.tsx variable.object.property.tsx" + }, + { + match: "\\?", + name: "keyword.operator.optional.tsx" + }, + { + match: "!", + name: "keyword.operator.definiteassignment.tsx" + } + ] + }, + "for-loop": { + begin: "(?\\[]|=>|&(?!&)|\\|(?!\\|)))))([^(<>]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>|<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([$_[:alpha:]][$_[:alnum:]]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))(?=\\s*([,.<>\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^(<>]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>|<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([$_[:alpha:]][$_[:alnum:]]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))(?=\\s*([,.<>\\[]|=>|&(?!&)|\\|(?!\\|)))))([^(<>]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>)*(?))*(?)*(?\\s*)?\\())", + end: "(?<=\\))(?!(((([$_[:alpha:]][$_[:alnum:]]*)(\\s*\\??\\.\\s*(#?[$_[:alpha:]][$_[:alnum:]]*))*)|(\\??\\.\\s*#?[$_[:alpha:]][$_[:alnum:]]*))|(?<=\\)))\\s*(?:(\\?\\.\\s*)|(!))?((<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([$_[:alpha:]][$_[:alnum:]]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))(?=\\s*([,.<>\\[]|=>|&(?!&)|\\|(?!\\|)))))([^(<>]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>|<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([$_[:alpha:]][$_[:alnum:]]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))(?=\\s*([,.<>\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^(<>]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>|<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([$_[:alpha:]][$_[:alnum:]]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))(?=\\s*([,.<>\\[]|=>|&(?!&)|\\|(?!\\|)))))([^(<>]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>)*(?))*(?)*(?\\s*)?\\())", + patterns: [ + { + begin: "(?=(([$_[:alpha:]][$_[:alnum:]]*)(\\s*\\??\\.\\s*(#?[$_[:alpha:]][$_[:alnum:]]*))*)|(\\??\\.\\s*#?[$_[:alpha:]][$_[:alnum:]]*))", + end: "(?=\\s*(?:(\\?\\.\\s*)|(!))?((<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([$_[:alpha:]][$_[:alnum:]]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))(?=\\s*([,.<>\\[]|=>|&(?!&)|\\|(?!\\|)))))([^(<>]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>|<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([$_[:alpha:]][$_[:alnum:]]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))(?=\\s*([,.<>\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^(<>]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>|<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([$_[:alpha:]][$_[:alnum:]]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))(?=\\s*([,.<>\\[]|=>|&(?!&)|\\|(?!\\|)))))([^(<>]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>)*(?))*(?)*(?\\s*)?\\())", + name: "meta.function-call.tsx", + patterns: [ + { + include: "#function-call-target" + } + ] + }, + { + include: "#comment" + }, + { + include: "#function-call-optionals" + }, + { + include: "#type-arguments" + }, + { + include: "#paren-expression" + } + ] + }, + { + begin: "(?=(((([$_[:alpha:]][$_[:alnum:]]*)(\\s*\\??\\.\\s*(#?[$_[:alpha:]][$_[:alnum:]]*))*)|(\\??\\.\\s*#?[$_[:alpha:]][$_[:alnum:]]*))|(?<=\\)))(<\\s*[(\\[{]\\s*)$)", + end: "(?<=>)(?!(((([$_[:alpha:]][$_[:alnum:]]*)(\\s*\\??\\.\\s*(#?[$_[:alpha:]][$_[:alnum:]]*))*)|(\\??\\.\\s*#?[$_[:alpha:]][$_[:alnum:]]*))|(?<=\\)))(<\\s*[(\\[{]\\s*)$)", + patterns: [ + { + begin: "(?=(([$_[:alpha:]][$_[:alnum:]]*)(\\s*\\??\\.\\s*(#?[$_[:alpha:]][$_[:alnum:]]*))*)|(\\??\\.\\s*#?[$_[:alpha:]][$_[:alnum:]]*))", + end: "(?=(<\\s*[(\\[{]\\s*)$)", + name: "meta.function-call.tsx", + patterns: [ + { + include: "#function-call-target" + } + ] + }, + { + include: "#comment" + }, + { + include: "#function-call-optionals" + }, + { + include: "#type-arguments" + } + ] + } + ] + }, + "function-call-optionals": { + patterns: [ + { + match: "\\?\\.", + name: "meta.function-call.tsx punctuation.accessor.optional.tsx" + }, + { + match: "!", + name: "meta.function-call.tsx keyword.operator.definiteassignment.tsx" + } + ] + }, + "function-call-target": { + patterns: [ + { + include: "#support-function-call-identifiers" + }, + { + match: "(#?[$_[:alpha:]][$_[:alnum:]]*)", + name: "entity.name.function.tsx" + } + ] + }, + "function-declaration": { + begin: "(?)))|((async\\s*)?(((<\\s*)$|(\\(\\s*((([\\[{]\\s*)?)$|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})\\s*((:\\s*\\{?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))|((\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])\\s*((:\\s*\\[?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*))))))|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*((\\)\\s*:)|((\\.\\.\\.\\s*)?[$_[:alpha:]][$_[:alnum:]]*\\s*:)))|(<\\s*[$_[:alpha:]][$_[:alnum:]]*\\s+extends\\s*[^=>])|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*(([$_[:alpha:]]|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|(\\.\\.\\.\\s*[$_[:alpha:]]))([^\"'()`]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))*)?\\)(\\s*:\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+)?\\s*=>)))))" + }, + { + captures: { + "1": { + name: "punctuation.accessor.tsx" + }, + "2": { + name: "punctuation.accessor.optional.tsx" + }, + "3": { + name: "variable.other.constant.property.tsx" + } + }, + match: "(?:(\\.)|(\\?\\.(?!\\s*\\d)))\\s*(#?\\p{upper}[$_\\d[:upper:]]*)(?![$_[:alnum:]])" + }, + { + captures: { + "1": { + name: "punctuation.accessor.tsx" + }, + "2": { + name: "punctuation.accessor.optional.tsx" + }, + "3": { + name: "variable.other.property.tsx" + } + }, + match: "(?:(\\.)|(\\?\\.(?!\\s*\\d)))\\s*(#?[$_[:alpha:]][$_[:alnum:]]*)" + }, + { + match: "(\\p{upper}[$_\\d[:upper:]]*)(?![$_[:alnum:]])", + name: "variable.other.constant.tsx" + }, + { + match: "[$_[:alpha:]][$_[:alnum:]]*", + name: "variable.other.readwrite.tsx" + } + ] + }, + "if-statement": { + patterns: [ + { + begin: "(??}]|\\|\\||&&|!==|$|([!=]==?)|(([\\&^|~]\\s*)?[$_[:alpha:]][$_[:alnum:]]*\\s+instanceof(?![$_[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.)))|((?))", + end: "(/>)|()", + endCaptures: { + "1": { + name: "punctuation.definition.tag.end.tsx" + }, + "2": { + name: "punctuation.definition.tag.begin.tsx" + }, + "3": { + name: "entity.name.tag.namespace.tsx" + }, + "4": { + name: "punctuation.separator.namespace.tsx" + }, + "5": { + name: "entity.name.tag.tsx" + }, + "6": { + name: "support.class.component.tsx" + }, + "7": { + name: "punctuation.definition.tag.end.tsx" + } + }, + name: "meta.tag.tsx", + patterns: [ + { + begin: "(<)\\s*(?:([$_[:alpha:]][-$._[:alnum:]]*)(?)", + beginCaptures: { + "1": { + name: "punctuation.definition.tag.begin.tsx" + }, + "2": { + name: "entity.name.tag.namespace.tsx" + }, + "3": { + name: "punctuation.separator.namespace.tsx" + }, + "4": { + name: "entity.name.tag.tsx" + }, + "5": { + name: "support.class.component.tsx" + } + }, + end: "(?=/?>)", + patterns: [ + { + include: "#comment" + }, + { + include: "#type-arguments" + }, + { + include: "#jsx-tag-attributes" + } + ] + }, + { + begin: "(>)", + beginCaptures: { + "1": { + name: "punctuation.definition.tag.end.tsx" + } + }, + contentName: "meta.jsx.children.tsx", + end: "(?=|/\\*|//)" + }, + "jsx-tag-attributes": { + begin: "\\s+", + end: "(?=/?>)", + name: "meta.tag.attributes.tsx", + patterns: [ + { + include: "#comment" + }, + { + include: "#jsx-tag-attribute-name" + }, + { + include: "#jsx-tag-attribute-assignment" + }, + { + include: "#jsx-string-double-quoted" + }, + { + include: "#jsx-string-single-quoted" + }, + { + include: "#jsx-evaluated-code" + }, + { + include: "#jsx-tag-attributes-illegal" + } + ] + }, + "jsx-tag-attributes-illegal": { + match: "\\S+", + name: "invalid.illegal.attribute.tsx" + }, + "jsx-tag-in-expression": { + begin: "(??\\[{]|&&|\\|\\||\\?|\\*/|^await|[^$._[:alnum:]]await|^return|[^$._[:alnum:]]return|^default|[^$._[:alnum:]]default|^yield|[^$._[:alnum:]]yield|^)\\s*(?!<\\s*[$_[:alpha:]][$_[:alnum:]]*((\\s+extends\\s+[^=>])|,))(?=(<)\\s*(?:([$_[:alpha:]][-$._[:alnum:]]*)(?))", + end: "(?!(<)\\s*(?:([$_[:alpha:]][-$._[:alnum:]]*)(?))", + patterns: [ + { + include: "#jsx-tag" + } + ] + }, + "jsx-tag-without-attributes": { + begin: "(<)\\s*(?:([$_[:alpha:]][-$._[:alnum:]]*)(?)", + beginCaptures: { + "1": { + name: "punctuation.definition.tag.begin.tsx" + }, + "2": { + name: "entity.name.tag.namespace.tsx" + }, + "3": { + name: "punctuation.separator.namespace.tsx" + }, + "4": { + name: "entity.name.tag.tsx" + }, + "5": { + name: "support.class.component.tsx" + }, + "6": { + name: "punctuation.definition.tag.end.tsx" + } + }, + contentName: "meta.jsx.children.tsx", + end: "()", + endCaptures: { + "1": { + name: "punctuation.definition.tag.begin.tsx" + }, + "2": { + name: "entity.name.tag.namespace.tsx" + }, + "3": { + name: "punctuation.separator.namespace.tsx" + }, + "4": { + name: "entity.name.tag.tsx" + }, + "5": { + name: "support.class.component.tsx" + }, + "6": { + name: "punctuation.definition.tag.end.tsx" + } + }, + name: "meta.tag.without-attributes.tsx", + patterns: [ + { + include: "#jsx-children" + } + ] + }, + "jsx-tag-without-attributes-in-expression": { + begin: "(??\\[{]|&&|\\|\\||\\?|\\*/|^await|[^$._[:alnum:]]await|^return|[^$._[:alnum:]]return|^default|[^$._[:alnum:]]default|^yield|[^$._[:alnum:]]yield|^)\\s*(?=(<)\\s*(?:([$_[:alpha:]][-$._[:alnum:]]*)(?))", + end: "(?!(<)\\s*(?:([$_[:alpha:]][-$._[:alnum:]]*)(?))", + patterns: [ + { + include: "#jsx-tag-without-attributes" + } + ] + }, + label: { + patterns: [ + { + begin: "([$_[:alpha:]][$_[:alnum:]]*)\\s*(:)(?=\\s*\\{)", + beginCaptures: { + "1": { + name: "entity.name.label.tsx" + }, + "2": { + name: "punctuation.separator.label.tsx" + } + }, + end: "(?<=})", + patterns: [ + { + include: "#decl-block" + } + ] + }, + { + captures: { + "1": { + name: "entity.name.label.tsx" + }, + "2": { + name: "punctuation.separator.label.tsx" + } + }, + match: "([$_[:alpha:]][$_[:alnum:]]*)\\s*(:)" + } + ] + }, + literal: { + patterns: [ + { + include: "#numeric-literal" + }, + { + include: "#boolean-literal" + }, + { + include: "#null-literal" + }, + { + include: "#undefined-literal" + }, + { + include: "#numericConstant-literal" + }, + { + include: "#array-literal" + }, + { + include: "#this-literal" + }, + { + include: "#super-literal" + } + ] + }, + "method-declaration": { + patterns: [ + { + begin: "(?]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*))?\\()", + beginCaptures: { + "1": { + name: "storage.modifier.tsx" + }, + "2": { + name: "storage.modifier.tsx" + }, + "3": { + name: "storage.modifier.tsx" + }, + "4": { + name: "storage.modifier.async.tsx" + }, + "5": { + name: "keyword.operator.new.tsx" + }, + "6": { + name: "keyword.generator.asterisk.tsx" + } + }, + end: "(?=[,;}]|$)|(?<=})", + name: "meta.method.declaration.tsx", + patterns: [ + { + include: "#method-declaration-name" + }, + { + include: "#function-body" + } + ] + }, + { + begin: "(?]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*))?\\()", + beginCaptures: { + "1": { + name: "storage.modifier.tsx" + }, + "2": { + name: "storage.modifier.tsx" + }, + "3": { + name: "storage.modifier.tsx" + }, + "4": { + name: "storage.modifier.async.tsx" + }, + "5": { + name: "storage.type.property.tsx" + }, + "6": { + name: "keyword.generator.asterisk.tsx" + } + }, + end: "(?=[,;}]|$)|(?<=})", + name: "meta.method.declaration.tsx", + patterns: [ + { + include: "#method-declaration-name" + }, + { + include: "#function-body" + } + ] + } + ] + }, + "method-declaration-name": { + begin: "(?=(\\b((??}]|\\|\\||&&|!==|$|((?]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*))?\\()", + beginCaptures: { + "1": { + name: "storage.modifier.async.tsx" + }, + "2": { + name: "storage.type.property.tsx" + }, + "3": { + name: "keyword.generator.asterisk.tsx" + } + }, + end: "(?=[,;}])|(?<=})", + name: "meta.method.declaration.tsx", + patterns: [ + { + include: "#method-declaration-name" + }, + { + include: "#function-body" + }, + { + begin: "(?]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*))?\\()", + beginCaptures: { + "1": { + name: "storage.modifier.async.tsx" + }, + "2": { + name: "storage.type.property.tsx" + }, + "3": { + name: "keyword.generator.asterisk.tsx" + } + }, + end: "(?=[(<])", + patterns: [ + { + include: "#method-declaration-name" + } + ] + } + ] + }, + "object-member": { + patterns: [ + { + include: "#comment" + }, + { + include: "#object-literal-method-declaration" + }, + { + begin: "(?=\\[)", + end: "(?=:)|((?<=])(?=\\s*[(<]))", + name: "meta.object.member.tsx meta.object-literal.key.tsx", + patterns: [ + { + include: "#comment" + }, + { + include: "#array-literal" + } + ] + }, + { + begin: "(?=[\"'`])", + end: "(?=:)|((?<=[\"'`])(?=((\\s*[(,<}])|(\\s+(as|satisifies)\\s+))))", + name: "meta.object.member.tsx meta.object-literal.key.tsx", + patterns: [ + { + include: "#comment" + }, + { + include: "#string" + } + ] + }, + { + begin: "(?=\\b((?)))|((async\\s*)?(((<\\s*)$|(\\(\\s*((([\\[{]\\s*)?)$|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})\\s*((:\\s*\\{?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))|((\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])\\s*((:\\s*\\[?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*))))))|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*((\\)\\s*:)|((\\.\\.\\.\\s*)?[$_[:alpha:]][$_[:alnum:]]*\\s*:)))|(<\\s*[$_[:alpha:]][$_[:alnum:]]*\\s+extends\\s*[^=>])|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*(([$_[:alpha:]]|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|(\\.\\.\\.\\s*[$_[:alpha:]]))([^\"'()`]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))*)?\\)(\\s*:\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+)?\\s*=>)))))", + name: "meta.object.member.tsx" + }, + { + captures: { + "0": { + name: "meta.object-literal.key.tsx" + } + }, + match: "[$_[:alpha:]][$_[:alnum:]]*\\s*(?=(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*:)", + name: "meta.object.member.tsx" + }, + { + begin: "\\.\\.\\.", + beginCaptures: { + "0": { + name: "keyword.operator.spread.tsx" + } + }, + end: "(?=[,}])", + name: "meta.object.member.tsx", + patterns: [ + { + include: "#expression" + } + ] + }, + { + captures: { + "1": { + name: "variable.other.readwrite.tsx" + } + }, + match: "([$_[:alpha:]][$_[:alnum:]]*)\\s*(?=[,}]|$|//|/\\*)", + name: "meta.object.member.tsx" + }, + { + captures: { + "1": { + name: "keyword.control.as.tsx" + }, + "2": { + name: "storage.modifier.tsx" + } + }, + match: "(??}]|\\|\\||&&|!==|$|^|((?]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)\\(\\s*((([\\[{]\\s*)?)$|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})\\s*((:\\s*\\{?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))|((\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])\\s*((:\\s*\\[?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))))", + beginCaptures: { + "1": { + name: "storage.modifier.async.tsx" + } + }, + end: "(?<=\\))", + patterns: [ + { + include: "#type-parameters" + }, + { + begin: "\\(", + beginCaptures: { + "0": { + name: "meta.brace.round.tsx" + } + }, + end: "\\)", + endCaptures: { + "0": { + name: "meta.brace.round.tsx" + } + }, + patterns: [ + { + include: "#expression-inside-possibly-arrow-parens" + } + ] + } + ] + }, + { + begin: "(?<=:)\\s*(async)?\\s*(\\()(?=\\s*((([\\[{]\\s*)?)$|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})\\s*((:\\s*\\{?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))|((\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])\\s*((:\\s*\\[?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))))", + beginCaptures: { + "1": { + name: "storage.modifier.async.tsx" + }, + "2": { + name: "meta.brace.round.tsx" + } + }, + end: "\\)", + endCaptures: { + "0": { + name: "meta.brace.round.tsx" + } + }, + patterns: [ + { + include: "#expression-inside-possibly-arrow-parens" + } + ] + }, + { + begin: "(?<=:)\\s*(async)?\\s*(?=<\\s*$)", + beginCaptures: { + "1": { + name: "storage.modifier.async.tsx" + } + }, + end: "(?<=>)", + patterns: [ + { + include: "#type-parameters" + } + ] + }, + { + begin: "(?<=>)\\s*(\\()(?=\\s*((([\\[{]\\s*)?)$|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})\\s*((:\\s*\\{?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))|((\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])\\s*((:\\s*\\[?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))))", + beginCaptures: { + "1": { + name: "meta.brace.round.tsx" + } + }, + end: "\\)", + endCaptures: { + "0": { + name: "meta.brace.round.tsx" + } + }, + patterns: [ + { + include: "#expression-inside-possibly-arrow-parens" + } + ] + }, + { + include: "#possibly-arrow-return-type" + }, + { + include: "#expression" + } + ] + }, + { + include: "#punctuation-comma" + }, + { + include: "#decl-block" + } + ] + }, + "parameter-array-binding-pattern": { + begin: "(?:(\\.\\.\\.)\\s*)?(\\[)", + beginCaptures: { + "1": { + name: "keyword.operator.rest.tsx" + }, + "2": { + name: "punctuation.definition.binding-pattern.array.tsx" + } + }, + end: "]", + endCaptures: { + "0": { + name: "punctuation.definition.binding-pattern.array.tsx" + } + }, + patterns: [ + { + include: "#parameter-binding-element" + }, + { + include: "#punctuation-comma" + } + ] + }, + "parameter-binding-element": { + patterns: [ + { + include: "#comment" + }, + { + include: "#string" + }, + { + include: "#numeric-literal" + }, + { + include: "#regex" + }, + { + include: "#parameter-object-binding-pattern" + }, + { + include: "#parameter-array-binding-pattern" + }, + { + include: "#destructuring-parameter-rest" + }, + { + include: "#variable-initializer" + } + ] + }, + "parameter-name": { + patterns: [ + { + captures: { + "1": { + name: "storage.modifier.tsx" + } + }, + match: "(?)))|((async\\s*)?(((<\\s*)$|(\\(\\s*((([\\[{]\\s*)?)$|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})\\s*((:\\s*\\{?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))|((\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])\\s*((:\\s*\\[?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*))))))|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*((\\)\\s*:)|((\\.\\.\\.\\s*)?[$_[:alpha:]][$_[:alnum:]]*\\s*:)))|(<\\s*[$_[:alpha:]][$_[:alnum:]]*\\s+extends\\s*[^=>])|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*(([$_[:alpha:]]|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|(\\.\\.\\.\\s*[$_[:alpha:]]))([^\"'()`]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))*)?\\)(\\s*:\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+)?\\s*=>)))))|(:\\s*((<)|(\\(\\s*((\\))|(\\.\\.\\.)|([$_[:alnum:]]+\\s*(([,:=?])|(\\)\\s*=>)))))))|(:\\s*(?{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))|((\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])\\s*((:\\s*\\[?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))))))|(:\\s*(=>|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(<[^<>]*>)|[^(),<=>])+=\\s*(((async\\s+)?((function\\s*[(*<])|(function\\s+)|([$_[:alpha:]][$_[:alnum:]]*\\s*=>)))|((async\\s*)?(((<\\s*)$|(\\(\\s*((([\\[{]\\s*)?)$|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})\\s*((:\\s*\\{?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))|((\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])\\s*((:\\s*\\[?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*))))))|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*((\\)\\s*:)|((\\.\\.\\.\\s*)?[$_[:alpha:]][$_[:alnum:]]*\\s*:)))|(<\\s*[$_[:alpha:]][$_[:alnum:]]*\\s+extends\\s*[^=>])|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*(([$_[:alpha:]]|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|(\\.\\.\\.\\s*[$_[:alpha:]]))([^\"'()`]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))*)?\\)(\\s*:\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+)?\\s*=>))))))" + }, + { + captures: { + "1": { + name: "storage.modifier.tsx" + }, + "2": { + name: "keyword.operator.rest.tsx" + }, + "3": { + name: "variable.parameter.tsx variable.language.this.tsx" + }, + "4": { + name: "variable.parameter.tsx" + }, + "5": { + name: "keyword.operator.optional.tsx" + } + }, + match: "(?:(?])", + name: "meta.type.annotation.tsx", + patterns: [ + { + include: "#type" + } + ] + } + ] + }, + "paren-expression": { + begin: "\\(", + beginCaptures: { + "0": { + name: "meta.brace.round.tsx" + } + }, + end: "\\)", + endCaptures: { + "0": { + name: "meta.brace.round.tsx" + } + }, + patterns: [ + { + include: "#expression" + } + ] + }, + "paren-expression-possibly-arrow": { + patterns: [ + { + begin: "(?<=[(,=])\\s*(async)?(?=\\s*((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*))?\\(\\s*((([\\[{]\\s*)?)$|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})\\s*((:\\s*\\{?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))|((\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])\\s*((:\\s*\\[?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))))", + beginCaptures: { + "1": { + name: "storage.modifier.async.tsx" + } + }, + end: "(?<=\\))", + patterns: [ + { + include: "#paren-expression-possibly-arrow-with-typeparameters" + } + ] + }, + { + begin: "(?<=[(,=]|=>|^return|[^$._[:alnum:]]return)\\s*(async)?(?=\\s*((((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*))?\\()|(<)|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)))\\s*$)", + beginCaptures: { + "1": { + name: "storage.modifier.async.tsx" + } + }, + end: "(?<=\\))", + patterns: [ + { + include: "#paren-expression-possibly-arrow-with-typeparameters" + } + ] + }, + { + include: "#possibly-arrow-return-type" + } + ] + }, + "paren-expression-possibly-arrow-with-typeparameters": { + patterns: [ + { + include: "#type-parameters" + }, + { + begin: "\\(", + beginCaptures: { + "0": { + name: "meta.brace.round.tsx" + } + }, + end: "\\)", + endCaptures: { + "0": { + name: "meta.brace.round.tsx" + } + }, + patterns: [ + { + include: "#expression-inside-possibly-arrow-parens" + } + ] + } + ] + }, + "possibly-arrow-return-type": { + begin: "(?<=\\)|^)\\s*(:)(?=\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*=>)", + beginCaptures: { + "1": { + name: "meta.arrow.tsx meta.return.type.arrow.tsx keyword.operator.type.annotation.tsx" + } + }, + contentName: "meta.arrow.tsx meta.return.type.arrow.tsx", + end: "(?==>|\\{|^(\\s*(export|function|class|interface|let|var|\\busing(?=\\s+(?!in\\b|of\\b(?!\\s*(?:of\\b|=)))[$_[:alpha:]])\\b|\\bawait\\s+\\busing(?=\\s+(?!in\\b|of\\b(?!\\s*(?:of\\b|=)))[$_[:alpha:]])\\b\\b|const|import|enum|namespace|module|type|abstract|declare)\\s+))", + patterns: [ + { + include: "#arrow-return-type-body" + } + ] + }, + "property-accessor": { + match: "(?|&&|\\|\\||\\*/)\\s*(/)(?![*/])(?=(?:[^()/\\[\\\\]|\\\\.|\\[([^]\\\\]|\\\\.)+]|\\(([^)\\\\]|\\\\.)+\\))+/([dgimsuvy]+|(?![*/])|(?=/\\*))(?!\\s*[$0-9A-Z_a-z]))", + beginCaptures: { + "1": { + name: "punctuation.definition.string.begin.tsx" + } + }, + end: "(/)([dgimsuvy]*)", + endCaptures: { + "1": { + name: "punctuation.definition.string.end.tsx" + }, + "2": { + name: "keyword.other.tsx" + } + }, + name: "string.regexp.tsx", + patterns: [ + { + include: "#regexp" + } + ] + }, + { + begin: "((?)" + }, + { + match: "[*+?]|\\{(\\d+,\\d+|\\d+,|,\\d+|\\d+)}\\??", + name: "keyword.operator.quantifier.regexp" + }, + { + match: "\\|", + name: "keyword.operator.or.regexp" + }, + { + begin: "(\\()((\\?=)|(\\?!)|(\\?<=)|(\\?)?", + beginCaptures: { + "0": { + name: "punctuation.definition.group.regexp" + }, + "1": { + name: "punctuation.definition.group.no-capture.regexp" + }, + "2": { + name: "variable.other.regexp" + } + }, + end: "\\)", + endCaptures: { + "0": { + name: "punctuation.definition.group.regexp" + } + }, + name: "meta.group.regexp", + patterns: [ + { + include: "#regexp" + } + ] + }, + { + begin: "(\\[)(\\^)?", + beginCaptures: { + "1": { + name: "punctuation.definition.character-class.regexp" + }, + "2": { + name: "keyword.operator.negation.regexp" + } + }, + end: "(])", + endCaptures: { + "1": { + name: "punctuation.definition.character-class.regexp" + } + }, + name: "constant.other.character-class.set.regexp", + patterns: [ + { + captures: { + "1": { + name: "constant.character.numeric.regexp" + }, + "2": { + name: "constant.character.control.regexp" + }, + "3": { + name: "constant.character.escape.backslash.regexp" + }, + "4": { + name: "constant.character.numeric.regexp" + }, + "5": { + name: "constant.character.control.regexp" + }, + "6": { + name: "constant.character.escape.backslash.regexp" + } + }, + match: "(?:.|(\\\\(?:[0-7]{3}|x\\h{2}|u\\h{4}))|(\\\\c[A-Z])|(\\\\.))-(?:[^]\\\\]|(\\\\(?:[0-7]{3}|x\\h{2}|u\\h{4}))|(\\\\c[A-Z])|(\\\\.))", + name: "constant.other.character-class.range.regexp" + }, + { + include: "#regex-character-class" + } + ] + }, + { + include: "#regex-character-class" + } + ] + }, + "return-type": { + patterns: [ + { + begin: "(?<=\\))\\s*(:)(?=\\s*\\S)", + beginCaptures: { + "1": { + name: "keyword.operator.type.annotation.tsx" + } + }, + end: "(?]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\()|(EPSILON|MAX_SAFE_INTEGER|MAX_VALUE|MIN_SAFE_INTEGER|MIN_VALUE|NEGATIVE_INFINITY|POSITIVE_INFINITY)\\b(?!\\$))" + }, + { + captures: { + "1": { + name: "support.type.object.module.tsx" + }, + "2": { + name: "support.type.object.module.tsx" + }, + "3": { + name: "punctuation.accessor.tsx" + }, + "4": { + name: "punctuation.accessor.optional.tsx" + }, + "5": { + name: "support.type.object.module.tsx" + } + }, + match: "(?\\[]|=>|&(?!&)|\\|(?!\\|)))))([^(<>]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>|<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([$_[:alpha:]][$_[:alnum:]]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))(?=\\s*([,.<>\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^(<>]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>|<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([$_[:alpha:]][$_[:alnum:]]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))(?=\\s*([,.<>\\[]|=>|&(?!&)|\\|(?!\\|)))))([^(<>]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>)*(?))*(?)*(?\\s*)?`)", + end: "(?=`)", + patterns: [ + { + begin: "(?=(([$_[:alpha:]][$_[:alnum:]]*\\s*\\??\\.\\s*)*|(\\??\\.\\s*)?)([$_[:alpha:]][$_[:alnum:]]*))", + end: "(?=(<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([$_[:alpha:]][$_[:alnum:]]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))(?=\\s*([,.<>\\[]|=>|&(?!&)|\\|(?!\\|)))))([^(<>]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>|<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([$_[:alpha:]][$_[:alnum:]]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))(?=\\s*([,.<>\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^(<>]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>|<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([$_[:alpha:]][$_[:alnum:]]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))(?=\\s*([,.<>\\[]|=>|&(?!&)|\\|(?!\\|)))))([^(<>]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>)*(?))*(?)*(?\\s*)?`)", + patterns: [ + { + include: "#support-function-call-identifiers" + }, + { + match: "([$_[:alpha:]][$_[:alnum:]]*)", + name: "entity.name.function.tagged-template.tsx" + } + ] + }, + { + include: "#type-arguments" + } + ] + }, + { + begin: "([$_[:alpha:]][$_[:alnum:]]*)?\\s*(?=(<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([$_[:alpha:]][$_[:alnum:]]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))(?=\\s*([,.<>\\[]|=>|&(?!&)|\\|(?!\\|)))))([^(<>]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>|<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([$_[:alpha:]][$_[:alnum:]]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))(?=\\s*([,.<>\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^(<>]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>|<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([$_[:alpha:]][$_[:alnum:]]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))(?=\\s*([,.<>\\[]|=>|&(?!&)|\\|(?!\\|)))))([^(<>]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>)*(?))*(?)*(?\\s*)`)", + beginCaptures: { + "1": { + name: "entity.name.function.tagged-template.tsx" + } + }, + end: "(?=`)", + patterns: [ + { + include: "#type-arguments" + } + ] + } + ] + }, + "template-substitution-element": { + begin: "\\$\\{", + beginCaptures: { + "0": { + name: "punctuation.definition.template-expression.begin.tsx" + } + }, + contentName: "meta.embedded.line.tsx", + end: "}", + endCaptures: { + "0": { + name: "punctuation.definition.template-expression.end.tsx" + } + }, + name: "meta.template.expression.tsx", + patterns: [ + { + include: "#expression" + } + ] + }, + "template-type": { + patterns: [ + { + include: "#template-call" + }, + { + begin: "([$_[:alpha:]][$_[:alnum:]]*)?(`)", + beginCaptures: { + "1": { + name: "entity.name.function.tagged-template.tsx" + }, + "2": { + name: "string.template.tsx punctuation.definition.string.template.begin.tsx" + } + }, + contentName: "string.template.tsx", + end: "`", + endCaptures: { + "0": { + name: "string.template.tsx punctuation.definition.string.template.end.tsx" + } + }, + patterns: [ + { + include: "#template-type-substitution-element" + }, + { + include: "#string-character-escape" + } + ] + } + ] + }, + "template-type-substitution-element": { + begin: "\\$\\{", + beginCaptures: { + "0": { + name: "punctuation.definition.template-expression.begin.tsx" + } + }, + contentName: "meta.embedded.line.tsx", + end: "}", + endCaptures: { + "0": { + name: "punctuation.definition.template-expression.end.tsx" + } + }, + name: "meta.template.expression.tsx", + patterns: [ + { + include: "#type" + } + ] + }, + "ternary-expression": { + begin: "(?!\\?\\.\\s*\\D)(\\?)(?!\\?)", + beginCaptures: { + "1": { + name: "keyword.operator.ternary.tsx" + } + }, + end: "\\s*(:)", + endCaptures: { + "1": { + name: "keyword.operator.ternary.tsx" + } + }, + patterns: [ + { + include: "#expression" + } + ] + }, + "this-literal": { + match: "(?])|((?<=[]$)>_}[:alpha:]])\\s*(?=\\{)))", + name: "meta.type.annotation.tsx", + patterns: [ + { + include: "#type" + } + ] + }, + { + begin: "(:)", + beginCaptures: { + "1": { + name: "keyword.operator.type.annotation.tsx" + } + }, + end: "(?])|(?=^\\s*$)|((?<=[]$)>_}[:alpha:]])\\s*(?=\\{)))", + name: "meta.type.annotation.tsx", + patterns: [ + { + include: "#type" + } + ] + } + ] + }, + "type-arguments": { + begin: "<", + beginCaptures: { + "0": { + name: "punctuation.definition.typeparameters.begin.tsx" + } + }, + end: ">", + endCaptures: { + "0": { + name: "punctuation.definition.typeparameters.end.tsx" + } + }, + name: "meta.type.parameters.tsx", + patterns: [ + { + include: "#type-arguments-body" + } + ] + }, + "type-arguments-body": { + patterns: [ + { + captures: { + "0": { + name: "keyword.operator.type.tsx" + } + }, + match: "(?)", + patterns: [ + { + include: "#comment" + }, + { + include: "#type-parameters" + } + ] + }, + { + begin: "(?))))))", + end: "(?<=\\))", + name: "meta.type.function.tsx", + patterns: [ + { + include: "#function-parameters" + } + ] + } + ] + }, + "type-function-return-type": { + patterns: [ + { + begin: "(=>)(?=\\s*\\S)", + beginCaptures: { + "1": { + name: "storage.type.function.arrow.tsx" + } + }, + end: "(?)(??{}]|//|$)", + name: "meta.type.function.return.tsx", + patterns: [ + { + include: "#type-function-return-type-core" + } + ] + }, + { + begin: "=>", + beginCaptures: { + "0": { + name: "storage.type.function.arrow.tsx" + } + }, + end: "(?)(??{}]|//|^\\s*$)|((?<=\\S)(?=\\s*$)))", + name: "meta.type.function.return.tsx", + patterns: [ + { + include: "#type-function-return-type-core" + } + ] + } + ] + }, + "type-function-return-type-core": { + patterns: [ + { + include: "#comment" + }, + { + begin: "(?<==>)(?=\\s*\\{)", + end: "(?<=})", + patterns: [ + { + include: "#type-object" + } + ] + }, + { + include: "#type-predicate-operator" + }, + { + include: "#type" + } + ] + }, + "type-infer": { + patterns: [ + { + captures: { + "1": { + name: "keyword.operator.expression.infer.tsx" + }, + "2": { + name: "entity.name.type.tsx" + }, + "3": { + name: "keyword.operator.expression.extends.tsx" + } + }, + match: "(?)", + endCaptures: { + "1": { + name: "meta.type.parameters.tsx punctuation.definition.typeparameters.end.tsx" + } + }, + patterns: [ + { + include: "#type-arguments-body" + } + ] + }, + { + begin: "([$_[:alpha:]][$_[:alnum:]]*)\\s*(<)", + beginCaptures: { + "1": { + name: "entity.name.type.tsx" + }, + "2": { + name: "meta.type.parameters.tsx punctuation.definition.typeparameters.begin.tsx" + } + }, + contentName: "meta.type.parameters.tsx", + end: "(>)", + endCaptures: { + "1": { + name: "meta.type.parameters.tsx punctuation.definition.typeparameters.end.tsx" + } + }, + patterns: [ + { + include: "#type-arguments-body" + } + ] + }, + { + captures: { + "1": { + name: "entity.name.type.module.tsx" + }, + "2": { + name: "punctuation.accessor.tsx" + }, + "3": { + name: "punctuation.accessor.optional.tsx" + } + }, + match: "([$_[:alpha:]][$_[:alnum:]]*)\\s*(?:(\\.)|(\\?\\.(?!\\s*\\d)))" + }, + { + match: "[$_[:alpha:]][$_[:alnum:]]*", + name: "entity.name.type.tsx" + } + ] + }, + "type-object": { + begin: "\\{", + beginCaptures: { + "0": { + name: "punctuation.definition.block.tsx" + } + }, + end: "}", + endCaptures: { + "0": { + name: "punctuation.definition.block.tsx" + } + }, + name: "meta.object.type.tsx", + patterns: [ + { + include: "#comment" + }, + { + include: "#method-declaration" + }, + { + include: "#indexer-declaration" + }, + { + include: "#indexer-mapped-type-declaration" + }, + { + include: "#field-declaration" + }, + { + include: "#type-annotation" + }, + { + begin: "\\.\\.\\.", + beginCaptures: { + "0": { + name: "keyword.operator.spread.tsx" + } + }, + end: "(?=[,;}]|$)|(?<=})", + patterns: [ + { + include: "#type" + } + ] + }, + { + include: "#punctuation-comma" + }, + { + include: "#punctuation-semicolon" + }, + { + include: "#type" + } + ] + }, + "type-operators": { + patterns: [ + { + include: "#typeof-operator" + }, + { + include: "#type-infer" + }, + { + begin: "([\\&|])(?=\\s*\\{)", + beginCaptures: { + "0": { + name: "keyword.operator.type.tsx" + } + }, + end: "(?<=})", + patterns: [ + { + include: "#type-object" + } + ] + }, + { + begin: "[\\&|]", + beginCaptures: { + "0": { + name: "keyword.operator.type.tsx" + } + }, + end: "(?=\\S)" + }, + { + match: "(?)", + endCaptures: { + "1": { + name: "punctuation.definition.typeparameters.end.tsx" + } + }, + name: "meta.type.parameters.tsx", + patterns: [ + { + include: "#comment" + }, + { + match: "(?)", + name: "keyword.operator.assignment.tsx" + } + ] + }, + "type-paren-or-function-parameters": { + begin: "\\(", + beginCaptures: { + "0": { + name: "meta.brace.round.tsx" + } + }, + end: "\\)", + endCaptures: { + "0": { + name: "meta.brace.round.tsx" + } + }, + name: "meta.type.paren.cover.tsx", + patterns: [ + { + captures: { + "1": { + name: "storage.modifier.tsx" + }, + "2": { + name: "keyword.operator.rest.tsx" + }, + "3": { + name: "entity.name.function.tsx variable.language.this.tsx" + }, + "4": { + name: "entity.name.function.tsx" + }, + "5": { + name: "keyword.operator.optional.tsx" + } + }, + match: "(?:(?)))))))|(:\\s*(?{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))|((\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])\\s*((:\\s*\\[?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*))))))))" + }, + { + captures: { + "1": { + name: "storage.modifier.tsx" + }, + "2": { + name: "keyword.operator.rest.tsx" + }, + "3": { + name: "variable.parameter.tsx variable.language.this.tsx" + }, + "4": { + name: "variable.parameter.tsx" + }, + "5": { + name: "keyword.operator.optional.tsx" + } + }, + match: "(?:(??{|}]|(extends\\s+)|$|;|^\\s*$|^\\s*(?:abstract|async|\\bawait\\s+\\busing(?=\\s+(?!in\\b|of\\b(?!\\s*(?:of\\b|=)))[$_[:alpha:]])\\b\\b|break|case|catch|class|const|continue|declare|do|else|enum|export|finally|function|for|goto|if|import|interface|let|module|namespace|switch|return|throw|try|type|\\busing(?=\\s+(?!in\\b|of\\b(?!\\s*(?:of\\b|=)))[$_[:alpha:]])\\b|var|while)\\b)", + patterns: [ + { + include: "#type-arguments" + }, + { + include: "#expression" + } + ] + }, + "undefined-literal": { + match: "(?)))|((async\\s*)?(((<\\s*)$|(\\(\\s*((([\\[{]\\s*)?)$|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})\\s*((:\\s*\\{?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))|((\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])\\s*((:\\s*\\[?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*))))))|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*((\\)\\s*:)|((\\.\\.\\.\\s*)?[$_[:alpha:]][$_[:alnum:]]*\\s*:)))|(<\\s*[$_[:alpha:]][$_[:alnum:]]*\\s+extends\\s*[^=>])|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*(([$_[:alpha:]]|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|(\\.\\.\\.\\s*[$_[:alpha:]]))([^\"'()`]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))*)?\\)(\\s*:\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+)?\\s*=>)))))|(:\\s*((<)|(\\(\\s*((\\))|(\\.\\.\\.)|([$_[:alnum:]]+\\s*(([,:=?])|(\\)\\s*=>)))))))|(:\\s*(?{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))|((\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])\\s*((:\\s*\\[?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))))))|(:\\s*(=>|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(<[^<>]*>)|[^(),<=>])+=\\s*(((async\\s+)?((function\\s*[(*<])|(function\\s+)|([$_[:alpha:]][$_[:alnum:]]*\\s*=>)))|((async\\s*)?(((<\\s*)$|(\\(\\s*((([\\[{]\\s*)?)$|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})\\s*((:\\s*\\{?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))|((\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])\\s*((:\\s*\\[?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*))))))|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*((\\)\\s*:)|((\\.\\.\\.\\s*)?[$_[:alpha:]][$_[:alnum:]]*\\s*:)))|(<\\s*[$_[:alpha:]][$_[:alnum:]]*\\s+extends\\s*[^=>])|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*(([$_[:alpha:]]|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|(\\.\\.\\.\\s*[$_[:alpha:]]))([^\"'()`]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))*)?\\)(\\s*:\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+)?\\s*=>))))))", + beginCaptures: { + "1": { + name: "meta.definition.variable.tsx variable.other.constant.tsx entity.name.function.tsx" + } + }, + end: "(?=$|^|[,;=}]|((?)))|((async\\s*)?(((<\\s*)$|(\\(\\s*((([\\[{]\\s*)?)$|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})\\s*((:\\s*\\{?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))|((\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])\\s*((:\\s*\\[?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*))))))|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*((\\)\\s*:)|((\\.\\.\\.\\s*)?[$_[:alpha:]][$_[:alnum:]]*\\s*:)))|(<\\s*[$_[:alpha:]][$_[:alnum:]]*\\s+extends\\s*[^=>])|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*(([$_[:alpha:]]|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|(\\.\\.\\.\\s*[$_[:alpha:]]))([^\"'()`]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))*)?\\)(\\s*:\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+)?\\s*=>)))))|(:\\s*((<)|(\\(\\s*((\\))|(\\.\\.\\.)|([$_[:alnum:]]+\\s*(([,:=?])|(\\)\\s*=>)))))))|(:\\s*(?{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))|((\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])\\s*((:\\s*\\[?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))))))|(:\\s*(=>|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(<[^<>]*>)|[^(),<=>])+=\\s*(((async\\s+)?((function\\s*[(*<])|(function\\s+)|([$_[:alpha:]][$_[:alnum:]]*\\s*=>)))|((async\\s*)?(((<\\s*)$|(\\(\\s*((([\\[{]\\s*)?)$|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})\\s*((:\\s*\\{?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*)))|((\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])\\s*((:\\s*\\[?)$|((\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+\\s*)?=\\s*))))))|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*((\\)\\s*:)|((\\.\\.\\.\\s*)?[$_[:alpha:]][$_[:alnum:]]*\\s*:)))|(<\\s*[$_[:alpha:]][$_[:alnum:]]*\\s+extends\\s*[^=>])|((<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<]|<\\s*(((const\\s+)?[$_[:alpha:]])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*]))([^<=>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(/\\*([^*]|(\\*[^/]))*\\*/\\s*)*(([$_[:alpha:]]|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*})*}))*})|(\\[([^]\\[]|(\\[([^]\\[]|\\[[^]\\[]*])*]))*])|(\\.\\.\\.\\s*[$_[:alpha:]]))([^\"'()`]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|('([^'\\\\]|\\\\.)*')|(\"([^\"\\\\]|\\\\.)*\")|(`([^\\\\`]|\\\\.)*`))*)?\\)(\\s*:\\s*([^()<>{}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+})+)?\\s*=>))))))", + beginCaptures: { + "1": { + name: "meta.definition.variable.tsx entity.name.function.tsx" + }, + "2": { + name: "keyword.operator.definiteassignment.tsx" + } + }, + end: "(?=$|^|[,;=}]|((?\\s*$)", + beginCaptures: { + "1": { + name: "keyword.operator.assignment.tsx" + } + }, + end: "(?=$|^|[]),;}]|((?]*type=(importmap|'importmap'|"importmap"|json|'json'|"json"|'application/json'|"application/json"))(?![^/>]*/>\\s*$)`, + beginCaptures: { + "1": { + name: "punctuation.definition.tag.begin.html" + }, + "2": { + name: "entity.name.tag.html" + } + }, + end: "()", + endCaptures: { + "1": { + name: "punctuation.definition.tag.begin.html" + }, + "2": { + name: "entity.name.tag.html" + }, + "3": { + name: "punctuation.definition.tag.end.html" + } + }, + patterns: [ + { + name: "entity.other.attribute-name.html", + match: "\\b([a-zA-Z\\-:_]+)" + }, + { + name: "punctuation.separator.key-value.html", + match: "=" + }, + { + name: "string.quoted.double.html", + match: `("|').*?("|')` + }, + { + begin: "(>)", + beginCaptures: { + "0": { + name: "meta.tag.metadata.json.start.html" + }, + "1": { + name: "punctuation.definition.tag.end.html" + } + }, + end: "(?=<\/script>)", + endCaptures: { + "0": { + name: "meta.tag.metadata.json.end.html" + } + }, + patterns: [ + { + include: "source.json" + } + ] + } + ] + } + ] +}; + +// src/syntaxes/(js)inline-html.json +var js_inline_html_default = { + $license: "https://github.com/pushqrdx/vscode-inline-html/blob/master/LICENSE", + name: "inline-html", + scopeName: "text.html.inline", + injectTo: [ + "source.js", + "source.js.jsx", + "source.ts", + "source.tsx" + ], + injectionSelector: "L:source.js -comment -string, L:source.jsx -comment -string, L:source.ts -comment -string, L:source.tsx -comment -string, L:source.js (string.quoted.double.html, string.quoted.single.html), L:source.jsx (string.quoted.double.html, string.quoted.single.html), L:source.js.jsx (string.quoted.double.html, string.quoted.single.html), L:source.ts (string.quoted.double.html, string.quoted.single.html), L:source.tsx (string.quoted.double.html, string.quoted.single.html)", + injections: { + "L:source": { + patterns: [ + { + match: "<", + name: "invalid.illegal.bad-angle-bracket.html" + } + ] + } + }, + patterns: [ + { + contentName: "meta.embedded.block.html", + begin: "(?ix)(\\s*?(\\w+\\.)?(?:html|/\\*\\s*html\\s*\\*/)\\s*)(`)", + beginCaptures: { + "0": { + name: "string.template.ts, punctuation.definition.string.template.begin.ts" + }, + "1": { + name: "entity.name.function.tagged-template.ts" + } + }, + end: "(`)", + endCaptures: { + "0": { + name: "string.template.ts, punctuation.definition.string.template.end.ts" + } + }, + patterns: [ + { + include: "source.ts#template-substitution-element" + }, + { + include: "text.html.basic" + } + ] + }, + { + include: "source.ts#template-substitution-element" + } + ] +}; + +// src/syntaxes/(js)inline-css.json +var js_inline_css_default = { + $license: "https://github.com/pushqrdx/vscode-inline-html/blob/master/LICENSE", + name: "inline-css", + scopeName: "source.css.inline", + injectTo: [ + "source.js", + "source.js.jsx", + "source.ts", + "source.tsx" + ], + injectionSelector: "L:source.js -comment -string, L:source.jsx -comment -string, L:source.ts -comment -string, L:source.tsx -comment -string", + patterns: [ + { + contentName: "meta.embedded.block.css", + begin: "(?ix)(\\s*?(\\w+\\.)?(?:css|/\\*\\s*css\\s*\\*/)\\s*)(`)", + beginCaptures: { + "0": { + name: "string.template.ts, punctuation.definition.string.template.begin.ts" + }, + "1": { + name: "entity.name.function.tagged-template.ts" + } + }, + end: "(`)", + endCaptures: { + "0": { + name: "string.template.ts, punctuation.definition.string.template.end.ts" + } + }, + patterns: [ + { + include: "source.ts#template-substitution-element" + }, + { + include: "source.css" + } + ] + }, + { + include: "source.ts#template-substitution-element" + } + ] +}; + +// src/syntaxes/index.ts +var syntaxes = [ + html_default, + css_default, + javascript_default, + typescript_default, + jsx_default, + tsx_default, + json_default, + html_json_script_tag_default, + js_inline_html_default, + js_inline_css_default +]; + +// src/index.ts +import { registerSyntax, registerTheme } from "./core.mjs"; +import { errors, hydrate, init, lazy, Workspace } from "./core.mjs"; +for (const syntax of syntaxes) { + registerSyntax(syntax); +} +registerTheme(vitesse_dark_default); +Object.assign(globalThis, { + MonacoEnvironment: { useBuiltinLSP: true } +}); +export { + Workspace, + errors, + hydrate, + init, + lazy +}; diff --git a/web/public/hoisted-modern-monaco/modern-monaco/lsp/client.mjs b/web/public/hoisted-modern-monaco/modern-monaco/lsp/client.mjs new file mode 100644 index 0000000000..25e2f13637 --- /dev/null +++ b/web/public/hoisted-modern-monaco/modern-monaco/lsp/client.mjs @@ -0,0 +1,2267 @@ +// node_modules/vscode-languageserver-types/lib/esm/main.js +var DocumentUri; +(function(DocumentUri2) { + function is(value) { + return typeof value === "string"; + } + DocumentUri2.is = is; +})(DocumentUri || (DocumentUri = {})); +var URI; +(function(URI2) { + function is(value) { + return typeof value === "string"; + } + URI2.is = is; +})(URI || (URI = {})); +var integer; +(function(integer2) { + integer2.MIN_VALUE = -2147483648; + integer2.MAX_VALUE = 2147483647; + function is(value) { + return typeof value === "number" && integer2.MIN_VALUE <= value && value <= integer2.MAX_VALUE; + } + integer2.is = is; +})(integer || (integer = {})); +var uinteger; +(function(uinteger2) { + uinteger2.MIN_VALUE = 0; + uinteger2.MAX_VALUE = 2147483647; + function is(value) { + return typeof value === "number" && uinteger2.MIN_VALUE <= value && value <= uinteger2.MAX_VALUE; + } + uinteger2.is = is; +})(uinteger || (uinteger = {})); +var Position; +(function(Position2) { + function create(line, character) { + if (line === Number.MAX_VALUE) { + line = uinteger.MAX_VALUE; + } + if (character === Number.MAX_VALUE) { + character = uinteger.MAX_VALUE; + } + return { line, character }; + } + Position2.create = create; + function is(value) { + let candidate = value; + return Is.objectLiteral(candidate) && Is.uinteger(candidate.line) && Is.uinteger(candidate.character); + } + Position2.is = is; +})(Position || (Position = {})); +var Range; +(function(Range2) { + function create(one, two, three, four) { + if (Is.uinteger(one) && Is.uinteger(two) && Is.uinteger(three) && Is.uinteger(four)) { + return { start: Position.create(one, two), end: Position.create(three, four) }; + } else if (Position.is(one) && Position.is(two)) { + return { start: one, end: two }; + } else { + throw new Error(`Range#create called with invalid arguments[${one}, ${two}, ${three}, ${four}]`); + } + } + Range2.create = create; + function is(value) { + let candidate = value; + return Is.objectLiteral(candidate) && Position.is(candidate.start) && Position.is(candidate.end); + } + Range2.is = is; +})(Range || (Range = {})); +var Location; +(function(Location2) { + function create(uri, range) { + return { uri, range }; + } + Location2.create = create; + function is(value) { + let candidate = value; + return Is.objectLiteral(candidate) && Range.is(candidate.range) && (Is.string(candidate.uri) || Is.undefined(candidate.uri)); + } + Location2.is = is; +})(Location || (Location = {})); +var LocationLink; +(function(LocationLink2) { + function create(targetUri, targetRange, targetSelectionRange, originSelectionRange) { + return { targetUri, targetRange, targetSelectionRange, originSelectionRange }; + } + LocationLink2.create = create; + function is(value) { + let candidate = value; + return Is.objectLiteral(candidate) && Range.is(candidate.targetRange) && Is.string(candidate.targetUri) && Range.is(candidate.targetSelectionRange) && (Range.is(candidate.originSelectionRange) || Is.undefined(candidate.originSelectionRange)); + } + LocationLink2.is = is; +})(LocationLink || (LocationLink = {})); +var Color; +(function(Color2) { + function create(red, green, blue, alpha) { + return { + red, + green, + blue, + alpha + }; + } + Color2.create = create; + function is(value) { + const candidate = value; + return Is.objectLiteral(candidate) && Is.numberRange(candidate.red, 0, 1) && Is.numberRange(candidate.green, 0, 1) && Is.numberRange(candidate.blue, 0, 1) && Is.numberRange(candidate.alpha, 0, 1); + } + Color2.is = is; +})(Color || (Color = {})); +var ColorInformation; +(function(ColorInformation2) { + function create(range, color) { + return { + range, + color + }; + } + ColorInformation2.create = create; + function is(value) { + const candidate = value; + return Is.objectLiteral(candidate) && Range.is(candidate.range) && Color.is(candidate.color); + } + ColorInformation2.is = is; +})(ColorInformation || (ColorInformation = {})); +var ColorPresentation; +(function(ColorPresentation2) { + function create(label, textEdit, additionalTextEdits) { + return { + label, + textEdit, + additionalTextEdits + }; + } + ColorPresentation2.create = create; + function is(value) { + const candidate = value; + return Is.objectLiteral(candidate) && Is.string(candidate.label) && (Is.undefined(candidate.textEdit) || TextEdit.is(candidate)) && (Is.undefined(candidate.additionalTextEdits) || Is.typedArray(candidate.additionalTextEdits, TextEdit.is)); + } + ColorPresentation2.is = is; +})(ColorPresentation || (ColorPresentation = {})); +var FoldingRangeKind; +(function(FoldingRangeKind2) { + FoldingRangeKind2.Comment = "comment"; + FoldingRangeKind2.Imports = "imports"; + FoldingRangeKind2.Region = "region"; +})(FoldingRangeKind || (FoldingRangeKind = {})); +var FoldingRange; +(function(FoldingRange2) { + function create(startLine, endLine, startCharacter, endCharacter, kind, collapsedText) { + const result = { + startLine, + endLine + }; + if (Is.defined(startCharacter)) { + result.startCharacter = startCharacter; + } + if (Is.defined(endCharacter)) { + result.endCharacter = endCharacter; + } + if (Is.defined(kind)) { + result.kind = kind; + } + if (Is.defined(collapsedText)) { + result.collapsedText = collapsedText; + } + return result; + } + FoldingRange2.create = create; + function is(value) { + const candidate = value; + return Is.objectLiteral(candidate) && Is.uinteger(candidate.startLine) && Is.uinteger(candidate.startLine) && (Is.undefined(candidate.startCharacter) || Is.uinteger(candidate.startCharacter)) && (Is.undefined(candidate.endCharacter) || Is.uinteger(candidate.endCharacter)) && (Is.undefined(candidate.kind) || Is.string(candidate.kind)); + } + FoldingRange2.is = is; +})(FoldingRange || (FoldingRange = {})); +var DiagnosticRelatedInformation; +(function(DiagnosticRelatedInformation2) { + function create(location, message) { + return { + location, + message + }; + } + DiagnosticRelatedInformation2.create = create; + function is(value) { + let candidate = value; + return Is.defined(candidate) && Location.is(candidate.location) && Is.string(candidate.message); + } + DiagnosticRelatedInformation2.is = is; +})(DiagnosticRelatedInformation || (DiagnosticRelatedInformation = {})); +var DiagnosticSeverity; +(function(DiagnosticSeverity2) { + DiagnosticSeverity2.Error = 1; + DiagnosticSeverity2.Warning = 2; + DiagnosticSeverity2.Information = 3; + DiagnosticSeverity2.Hint = 4; +})(DiagnosticSeverity || (DiagnosticSeverity = {})); +var DiagnosticTag; +(function(DiagnosticTag2) { + DiagnosticTag2.Unnecessary = 1; + DiagnosticTag2.Deprecated = 2; +})(DiagnosticTag || (DiagnosticTag = {})); +var CodeDescription; +(function(CodeDescription2) { + function is(value) { + const candidate = value; + return Is.objectLiteral(candidate) && Is.string(candidate.href); + } + CodeDescription2.is = is; +})(CodeDescription || (CodeDescription = {})); +var Diagnostic; +(function(Diagnostic2) { + function create(range, message, severity, code, source, relatedInformation) { + let result = { range, message }; + if (Is.defined(severity)) { + result.severity = severity; + } + if (Is.defined(code)) { + result.code = code; + } + if (Is.defined(source)) { + result.source = source; + } + if (Is.defined(relatedInformation)) { + result.relatedInformation = relatedInformation; + } + return result; + } + Diagnostic2.create = create; + function is(value) { + var _a; + let candidate = value; + return Is.defined(candidate) && Range.is(candidate.range) && Is.string(candidate.message) && (Is.number(candidate.severity) || Is.undefined(candidate.severity)) && (Is.integer(candidate.code) || Is.string(candidate.code) || Is.undefined(candidate.code)) && (Is.undefined(candidate.codeDescription) || Is.string((_a = candidate.codeDescription) === null || _a === void 0 ? void 0 : _a.href)) && (Is.string(candidate.source) || Is.undefined(candidate.source)) && (Is.undefined(candidate.relatedInformation) || Is.typedArray(candidate.relatedInformation, DiagnosticRelatedInformation.is)); + } + Diagnostic2.is = is; +})(Diagnostic || (Diagnostic = {})); +var Command; +(function(Command2) { + function create(title, command, ...args) { + let result = { title, command }; + if (Is.defined(args) && args.length > 0) { + result.arguments = args; + } + return result; + } + Command2.create = create; + function is(value) { + let candidate = value; + return Is.defined(candidate) && Is.string(candidate.title) && Is.string(candidate.command); + } + Command2.is = is; +})(Command || (Command = {})); +var TextEdit; +(function(TextEdit2) { + function replace(range, newText) { + return { range, newText }; + } + TextEdit2.replace = replace; + function insert(position, newText) { + return { range: { start: position, end: position }, newText }; + } + TextEdit2.insert = insert; + function del(range) { + return { range, newText: "" }; + } + TextEdit2.del = del; + function is(value) { + const candidate = value; + return Is.objectLiteral(candidate) && Is.string(candidate.newText) && Range.is(candidate.range); + } + TextEdit2.is = is; +})(TextEdit || (TextEdit = {})); +var ChangeAnnotation; +(function(ChangeAnnotation2) { + function create(label, needsConfirmation, description) { + const result = { label }; + if (needsConfirmation !== void 0) { + result.needsConfirmation = needsConfirmation; + } + if (description !== void 0) { + result.description = description; + } + return result; + } + ChangeAnnotation2.create = create; + function is(value) { + const candidate = value; + return Is.objectLiteral(candidate) && Is.string(candidate.label) && (Is.boolean(candidate.needsConfirmation) || candidate.needsConfirmation === void 0) && (Is.string(candidate.description) || candidate.description === void 0); + } + ChangeAnnotation2.is = is; +})(ChangeAnnotation || (ChangeAnnotation = {})); +var ChangeAnnotationIdentifier; +(function(ChangeAnnotationIdentifier2) { + function is(value) { + const candidate = value; + return Is.string(candidate); + } + ChangeAnnotationIdentifier2.is = is; +})(ChangeAnnotationIdentifier || (ChangeAnnotationIdentifier = {})); +var AnnotatedTextEdit; +(function(AnnotatedTextEdit2) { + function replace(range, newText, annotation) { + return { range, newText, annotationId: annotation }; + } + AnnotatedTextEdit2.replace = replace; + function insert(position, newText, annotation) { + return { range: { start: position, end: position }, newText, annotationId: annotation }; + } + AnnotatedTextEdit2.insert = insert; + function del(range, annotation) { + return { range, newText: "", annotationId: annotation }; + } + AnnotatedTextEdit2.del = del; + function is(value) { + const candidate = value; + return TextEdit.is(candidate) && (ChangeAnnotation.is(candidate.annotationId) || ChangeAnnotationIdentifier.is(candidate.annotationId)); + } + AnnotatedTextEdit2.is = is; +})(AnnotatedTextEdit || (AnnotatedTextEdit = {})); +var TextDocumentEdit; +(function(TextDocumentEdit2) { + function create(textDocument, edits) { + return { textDocument, edits }; + } + TextDocumentEdit2.create = create; + function is(value) { + let candidate = value; + return Is.defined(candidate) && OptionalVersionedTextDocumentIdentifier.is(candidate.textDocument) && Array.isArray(candidate.edits); + } + TextDocumentEdit2.is = is; +})(TextDocumentEdit || (TextDocumentEdit = {})); +var CreateFile; +(function(CreateFile2) { + function create(uri, options, annotation) { + let result = { + kind: "create", + uri + }; + if (options !== void 0 && (options.overwrite !== void 0 || options.ignoreIfExists !== void 0)) { + result.options = options; + } + if (annotation !== void 0) { + result.annotationId = annotation; + } + return result; + } + CreateFile2.create = create; + function is(value) { + let candidate = value; + return candidate && candidate.kind === "create" && Is.string(candidate.uri) && (candidate.options === void 0 || (candidate.options.overwrite === void 0 || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === void 0 || Is.boolean(candidate.options.ignoreIfExists))) && (candidate.annotationId === void 0 || ChangeAnnotationIdentifier.is(candidate.annotationId)); + } + CreateFile2.is = is; +})(CreateFile || (CreateFile = {})); +var RenameFile; +(function(RenameFile2) { + function create(oldUri, newUri, options, annotation) { + let result = { + kind: "rename", + oldUri, + newUri + }; + if (options !== void 0 && (options.overwrite !== void 0 || options.ignoreIfExists !== void 0)) { + result.options = options; + } + if (annotation !== void 0) { + result.annotationId = annotation; + } + return result; + } + RenameFile2.create = create; + function is(value) { + let candidate = value; + return candidate && candidate.kind === "rename" && Is.string(candidate.oldUri) && Is.string(candidate.newUri) && (candidate.options === void 0 || (candidate.options.overwrite === void 0 || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === void 0 || Is.boolean(candidate.options.ignoreIfExists))) && (candidate.annotationId === void 0 || ChangeAnnotationIdentifier.is(candidate.annotationId)); + } + RenameFile2.is = is; +})(RenameFile || (RenameFile = {})); +var DeleteFile; +(function(DeleteFile2) { + function create(uri, options, annotation) { + let result = { + kind: "delete", + uri + }; + if (options !== void 0 && (options.recursive !== void 0 || options.ignoreIfNotExists !== void 0)) { + result.options = options; + } + if (annotation !== void 0) { + result.annotationId = annotation; + } + return result; + } + DeleteFile2.create = create; + function is(value) { + let candidate = value; + return candidate && candidate.kind === "delete" && Is.string(candidate.uri) && (candidate.options === void 0 || (candidate.options.recursive === void 0 || Is.boolean(candidate.options.recursive)) && (candidate.options.ignoreIfNotExists === void 0 || Is.boolean(candidate.options.ignoreIfNotExists))) && (candidate.annotationId === void 0 || ChangeAnnotationIdentifier.is(candidate.annotationId)); + } + DeleteFile2.is = is; +})(DeleteFile || (DeleteFile = {})); +var WorkspaceEdit; +(function(WorkspaceEdit2) { + function is(value) { + let candidate = value; + return candidate && (candidate.changes !== void 0 || candidate.documentChanges !== void 0) && (candidate.documentChanges === void 0 || candidate.documentChanges.every((change) => { + if (Is.string(change.kind)) { + return CreateFile.is(change) || RenameFile.is(change) || DeleteFile.is(change); + } else { + return TextDocumentEdit.is(change); + } + })); + } + WorkspaceEdit2.is = is; +})(WorkspaceEdit || (WorkspaceEdit = {})); +var TextDocumentIdentifier; +(function(TextDocumentIdentifier2) { + function create(uri) { + return { uri }; + } + TextDocumentIdentifier2.create = create; + function is(value) { + let candidate = value; + return Is.defined(candidate) && Is.string(candidate.uri); + } + TextDocumentIdentifier2.is = is; +})(TextDocumentIdentifier || (TextDocumentIdentifier = {})); +var VersionedTextDocumentIdentifier; +(function(VersionedTextDocumentIdentifier2) { + function create(uri, version) { + return { uri, version }; + } + VersionedTextDocumentIdentifier2.create = create; + function is(value) { + let candidate = value; + return Is.defined(candidate) && Is.string(candidate.uri) && Is.integer(candidate.version); + } + VersionedTextDocumentIdentifier2.is = is; +})(VersionedTextDocumentIdentifier || (VersionedTextDocumentIdentifier = {})); +var OptionalVersionedTextDocumentIdentifier; +(function(OptionalVersionedTextDocumentIdentifier2) { + function create(uri, version) { + return { uri, version }; + } + OptionalVersionedTextDocumentIdentifier2.create = create; + function is(value) { + let candidate = value; + return Is.defined(candidate) && Is.string(candidate.uri) && (candidate.version === null || Is.integer(candidate.version)); + } + OptionalVersionedTextDocumentIdentifier2.is = is; +})(OptionalVersionedTextDocumentIdentifier || (OptionalVersionedTextDocumentIdentifier = {})); +var TextDocumentItem; +(function(TextDocumentItem2) { + function create(uri, languageId, version, text) { + return { uri, languageId, version, text }; + } + TextDocumentItem2.create = create; + function is(value) { + let candidate = value; + return Is.defined(candidate) && Is.string(candidate.uri) && Is.string(candidate.languageId) && Is.integer(candidate.version) && Is.string(candidate.text); + } + TextDocumentItem2.is = is; +})(TextDocumentItem || (TextDocumentItem = {})); +var MarkupKind; +(function(MarkupKind2) { + MarkupKind2.PlainText = "plaintext"; + MarkupKind2.Markdown = "markdown"; + function is(value) { + const candidate = value; + return candidate === MarkupKind2.PlainText || candidate === MarkupKind2.Markdown; + } + MarkupKind2.is = is; +})(MarkupKind || (MarkupKind = {})); +var MarkupContent; +(function(MarkupContent2) { + function is(value) { + const candidate = value; + return Is.objectLiteral(value) && MarkupKind.is(candidate.kind) && Is.string(candidate.value); + } + MarkupContent2.is = is; +})(MarkupContent || (MarkupContent = {})); +var CompletionItemKind; +(function(CompletionItemKind2) { + CompletionItemKind2.Text = 1; + CompletionItemKind2.Method = 2; + CompletionItemKind2.Function = 3; + CompletionItemKind2.Constructor = 4; + CompletionItemKind2.Field = 5; + CompletionItemKind2.Variable = 6; + CompletionItemKind2.Class = 7; + CompletionItemKind2.Interface = 8; + CompletionItemKind2.Module = 9; + CompletionItemKind2.Property = 10; + CompletionItemKind2.Unit = 11; + CompletionItemKind2.Value = 12; + CompletionItemKind2.Enum = 13; + CompletionItemKind2.Keyword = 14; + CompletionItemKind2.Snippet = 15; + CompletionItemKind2.Color = 16; + CompletionItemKind2.File = 17; + CompletionItemKind2.Reference = 18; + CompletionItemKind2.Folder = 19; + CompletionItemKind2.EnumMember = 20; + CompletionItemKind2.Constant = 21; + CompletionItemKind2.Struct = 22; + CompletionItemKind2.Event = 23; + CompletionItemKind2.Operator = 24; + CompletionItemKind2.TypeParameter = 25; +})(CompletionItemKind || (CompletionItemKind = {})); +var InsertTextFormat; +(function(InsertTextFormat2) { + InsertTextFormat2.PlainText = 1; + InsertTextFormat2.Snippet = 2; +})(InsertTextFormat || (InsertTextFormat = {})); +var CompletionItemTag; +(function(CompletionItemTag2) { + CompletionItemTag2.Deprecated = 1; +})(CompletionItemTag || (CompletionItemTag = {})); +var InsertReplaceEdit; +(function(InsertReplaceEdit2) { + function create(newText, insert, replace) { + return { newText, insert, replace }; + } + InsertReplaceEdit2.create = create; + function is(value) { + const candidate = value; + return candidate && Is.string(candidate.newText) && Range.is(candidate.insert) && Range.is(candidate.replace); + } + InsertReplaceEdit2.is = is; +})(InsertReplaceEdit || (InsertReplaceEdit = {})); +var InsertTextMode; +(function(InsertTextMode2) { + InsertTextMode2.asIs = 1; + InsertTextMode2.adjustIndentation = 2; +})(InsertTextMode || (InsertTextMode = {})); +var CompletionItemLabelDetails; +(function(CompletionItemLabelDetails2) { + function is(value) { + const candidate = value; + return candidate && (Is.string(candidate.detail) || candidate.detail === void 0) && (Is.string(candidate.description) || candidate.description === void 0); + } + CompletionItemLabelDetails2.is = is; +})(CompletionItemLabelDetails || (CompletionItemLabelDetails = {})); +var CompletionItem; +(function(CompletionItem2) { + function create(label) { + return { label }; + } + CompletionItem2.create = create; +})(CompletionItem || (CompletionItem = {})); +var CompletionList; +(function(CompletionList2) { + function create(items, isIncomplete) { + return { items: items ? items : [], isIncomplete: !!isIncomplete }; + } + CompletionList2.create = create; +})(CompletionList || (CompletionList = {})); +var MarkedString; +(function(MarkedString2) { + function fromPlainText(plainText) { + return plainText.replace(/[\\`*_{}[\]()#+\-.!]/g, "\\$&"); + } + MarkedString2.fromPlainText = fromPlainText; + function is(value) { + const candidate = value; + return Is.string(candidate) || Is.objectLiteral(candidate) && Is.string(candidate.language) && Is.string(candidate.value); + } + MarkedString2.is = is; +})(MarkedString || (MarkedString = {})); +var Hover; +(function(Hover2) { + function is(value) { + let candidate = value; + return !!candidate && Is.objectLiteral(candidate) && (MarkupContent.is(candidate.contents) || MarkedString.is(candidate.contents) || Is.typedArray(candidate.contents, MarkedString.is)) && (value.range === void 0 || Range.is(value.range)); + } + Hover2.is = is; +})(Hover || (Hover = {})); +var ParameterInformation; +(function(ParameterInformation2) { + function create(label, documentation) { + return documentation ? { label, documentation } : { label }; + } + ParameterInformation2.create = create; +})(ParameterInformation || (ParameterInformation = {})); +var SignatureInformation; +(function(SignatureInformation2) { + function create(label, documentation, ...parameters) { + let result = { label }; + if (Is.defined(documentation)) { + result.documentation = documentation; + } + if (Is.defined(parameters)) { + result.parameters = parameters; + } else { + result.parameters = []; + } + return result; + } + SignatureInformation2.create = create; +})(SignatureInformation || (SignatureInformation = {})); +var DocumentHighlightKind; +(function(DocumentHighlightKind2) { + DocumentHighlightKind2.Text = 1; + DocumentHighlightKind2.Read = 2; + DocumentHighlightKind2.Write = 3; +})(DocumentHighlightKind || (DocumentHighlightKind = {})); +var DocumentHighlight; +(function(DocumentHighlight2) { + function create(range, kind) { + let result = { range }; + if (Is.number(kind)) { + result.kind = kind; + } + return result; + } + DocumentHighlight2.create = create; +})(DocumentHighlight || (DocumentHighlight = {})); +var SymbolKind; +(function(SymbolKind2) { + SymbolKind2.File = 1; + SymbolKind2.Module = 2; + SymbolKind2.Namespace = 3; + SymbolKind2.Package = 4; + SymbolKind2.Class = 5; + SymbolKind2.Method = 6; + SymbolKind2.Property = 7; + SymbolKind2.Field = 8; + SymbolKind2.Constructor = 9; + SymbolKind2.Enum = 10; + SymbolKind2.Interface = 11; + SymbolKind2.Function = 12; + SymbolKind2.Variable = 13; + SymbolKind2.Constant = 14; + SymbolKind2.String = 15; + SymbolKind2.Number = 16; + SymbolKind2.Boolean = 17; + SymbolKind2.Array = 18; + SymbolKind2.Object = 19; + SymbolKind2.Key = 20; + SymbolKind2.Null = 21; + SymbolKind2.EnumMember = 22; + SymbolKind2.Struct = 23; + SymbolKind2.Event = 24; + SymbolKind2.Operator = 25; + SymbolKind2.TypeParameter = 26; +})(SymbolKind || (SymbolKind = {})); +var SymbolTag; +(function(SymbolTag2) { + SymbolTag2.Deprecated = 1; +})(SymbolTag || (SymbolTag = {})); +var SymbolInformation; +(function(SymbolInformation2) { + function create(name, kind, range, uri, containerName) { + let result = { + name, + kind, + location: { uri, range } + }; + if (containerName) { + result.containerName = containerName; + } + return result; + } + SymbolInformation2.create = create; +})(SymbolInformation || (SymbolInformation = {})); +var WorkspaceSymbol; +(function(WorkspaceSymbol2) { + function create(name, kind, uri, range) { + return range !== void 0 ? { name, kind, location: { uri, range } } : { name, kind, location: { uri } }; + } + WorkspaceSymbol2.create = create; +})(WorkspaceSymbol || (WorkspaceSymbol = {})); +var DocumentSymbol; +(function(DocumentSymbol2) { + function create(name, detail, kind, range, selectionRange, children) { + let result = { + name, + detail, + kind, + range, + selectionRange + }; + if (children !== void 0) { + result.children = children; + } + return result; + } + DocumentSymbol2.create = create; + function is(value) { + let candidate = value; + return candidate && Is.string(candidate.name) && Is.number(candidate.kind) && Range.is(candidate.range) && Range.is(candidate.selectionRange) && (candidate.detail === void 0 || Is.string(candidate.detail)) && (candidate.deprecated === void 0 || Is.boolean(candidate.deprecated)) && (candidate.children === void 0 || Array.isArray(candidate.children)) && (candidate.tags === void 0 || Array.isArray(candidate.tags)); + } + DocumentSymbol2.is = is; +})(DocumentSymbol || (DocumentSymbol = {})); +var CodeActionKind; +(function(CodeActionKind2) { + CodeActionKind2.Empty = ""; + CodeActionKind2.QuickFix = "quickfix"; + CodeActionKind2.Refactor = "refactor"; + CodeActionKind2.RefactorExtract = "refactor.extract"; + CodeActionKind2.RefactorInline = "refactor.inline"; + CodeActionKind2.RefactorRewrite = "refactor.rewrite"; + CodeActionKind2.Source = "source"; + CodeActionKind2.SourceOrganizeImports = "source.organizeImports"; + CodeActionKind2.SourceFixAll = "source.fixAll"; +})(CodeActionKind || (CodeActionKind = {})); +var CodeActionTriggerKind; +(function(CodeActionTriggerKind2) { + CodeActionTriggerKind2.Invoked = 1; + CodeActionTriggerKind2.Automatic = 2; +})(CodeActionTriggerKind || (CodeActionTriggerKind = {})); +var CodeActionContext; +(function(CodeActionContext2) { + function create(diagnostics, only, triggerKind) { + let result = { diagnostics }; + if (only !== void 0 && only !== null) { + result.only = only; + } + if (triggerKind !== void 0 && triggerKind !== null) { + result.triggerKind = triggerKind; + } + return result; + } + CodeActionContext2.create = create; + function is(value) { + let candidate = value; + return Is.defined(candidate) && Is.typedArray(candidate.diagnostics, Diagnostic.is) && (candidate.only === void 0 || Is.typedArray(candidate.only, Is.string)) && (candidate.triggerKind === void 0 || candidate.triggerKind === CodeActionTriggerKind.Invoked || candidate.triggerKind === CodeActionTriggerKind.Automatic); + } + CodeActionContext2.is = is; +})(CodeActionContext || (CodeActionContext = {})); +var CodeAction; +(function(CodeAction2) { + function create(title, kindOrCommandOrEdit, kind) { + let result = { title }; + let checkKind = true; + if (typeof kindOrCommandOrEdit === "string") { + checkKind = false; + result.kind = kindOrCommandOrEdit; + } else if (Command.is(kindOrCommandOrEdit)) { + result.command = kindOrCommandOrEdit; + } else { + result.edit = kindOrCommandOrEdit; + } + if (checkKind && kind !== void 0) { + result.kind = kind; + } + return result; + } + CodeAction2.create = create; + function is(value) { + let candidate = value; + return candidate && Is.string(candidate.title) && (candidate.diagnostics === void 0 || Is.typedArray(candidate.diagnostics, Diagnostic.is)) && (candidate.kind === void 0 || Is.string(candidate.kind)) && (candidate.edit !== void 0 || candidate.command !== void 0) && (candidate.command === void 0 || Command.is(candidate.command)) && (candidate.isPreferred === void 0 || Is.boolean(candidate.isPreferred)) && (candidate.edit === void 0 || WorkspaceEdit.is(candidate.edit)); + } + CodeAction2.is = is; +})(CodeAction || (CodeAction = {})); +var CodeLens; +(function(CodeLens2) { + function create(range, data) { + let result = { range }; + if (Is.defined(data)) { + result.data = data; + } + return result; + } + CodeLens2.create = create; + function is(value) { + let candidate = value; + return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.command) || Command.is(candidate.command)); + } + CodeLens2.is = is; +})(CodeLens || (CodeLens = {})); +var FormattingOptions; +(function(FormattingOptions2) { + function create(tabSize, insertSpaces) { + return { tabSize, insertSpaces }; + } + FormattingOptions2.create = create; + function is(value) { + let candidate = value; + return Is.defined(candidate) && Is.uinteger(candidate.tabSize) && Is.boolean(candidate.insertSpaces); + } + FormattingOptions2.is = is; +})(FormattingOptions || (FormattingOptions = {})); +var DocumentLink; +(function(DocumentLink2) { + function create(range, target, data) { + return { range, target, data }; + } + DocumentLink2.create = create; + function is(value) { + let candidate = value; + return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.target) || Is.string(candidate.target)); + } + DocumentLink2.is = is; +})(DocumentLink || (DocumentLink = {})); +var SelectionRange; +(function(SelectionRange2) { + function create(range, parent) { + return { range, parent }; + } + SelectionRange2.create = create; + function is(value) { + let candidate = value; + return Is.objectLiteral(candidate) && Range.is(candidate.range) && (candidate.parent === void 0 || SelectionRange2.is(candidate.parent)); + } + SelectionRange2.is = is; +})(SelectionRange || (SelectionRange = {})); +var SemanticTokenTypes; +(function(SemanticTokenTypes2) { + SemanticTokenTypes2["namespace"] = "namespace"; + SemanticTokenTypes2["type"] = "type"; + SemanticTokenTypes2["class"] = "class"; + SemanticTokenTypes2["enum"] = "enum"; + SemanticTokenTypes2["interface"] = "interface"; + SemanticTokenTypes2["struct"] = "struct"; + SemanticTokenTypes2["typeParameter"] = "typeParameter"; + SemanticTokenTypes2["parameter"] = "parameter"; + SemanticTokenTypes2["variable"] = "variable"; + SemanticTokenTypes2["property"] = "property"; + SemanticTokenTypes2["enumMember"] = "enumMember"; + SemanticTokenTypes2["event"] = "event"; + SemanticTokenTypes2["function"] = "function"; + SemanticTokenTypes2["method"] = "method"; + SemanticTokenTypes2["macro"] = "macro"; + SemanticTokenTypes2["keyword"] = "keyword"; + SemanticTokenTypes2["modifier"] = "modifier"; + SemanticTokenTypes2["comment"] = "comment"; + SemanticTokenTypes2["string"] = "string"; + SemanticTokenTypes2["number"] = "number"; + SemanticTokenTypes2["regexp"] = "regexp"; + SemanticTokenTypes2["operator"] = "operator"; + SemanticTokenTypes2["decorator"] = "decorator"; +})(SemanticTokenTypes || (SemanticTokenTypes = {})); +var SemanticTokenModifiers; +(function(SemanticTokenModifiers2) { + SemanticTokenModifiers2["declaration"] = "declaration"; + SemanticTokenModifiers2["definition"] = "definition"; + SemanticTokenModifiers2["readonly"] = "readonly"; + SemanticTokenModifiers2["static"] = "static"; + SemanticTokenModifiers2["deprecated"] = "deprecated"; + SemanticTokenModifiers2["abstract"] = "abstract"; + SemanticTokenModifiers2["async"] = "async"; + SemanticTokenModifiers2["modification"] = "modification"; + SemanticTokenModifiers2["documentation"] = "documentation"; + SemanticTokenModifiers2["defaultLibrary"] = "defaultLibrary"; +})(SemanticTokenModifiers || (SemanticTokenModifiers = {})); +var SemanticTokens; +(function(SemanticTokens2) { + function is(value) { + const candidate = value; + return Is.objectLiteral(candidate) && (candidate.resultId === void 0 || typeof candidate.resultId === "string") && Array.isArray(candidate.data) && (candidate.data.length === 0 || typeof candidate.data[0] === "number"); + } + SemanticTokens2.is = is; +})(SemanticTokens || (SemanticTokens = {})); +var InlineValueText; +(function(InlineValueText2) { + function create(range, text) { + return { range, text }; + } + InlineValueText2.create = create; + function is(value) { + const candidate = value; + return candidate !== void 0 && candidate !== null && Range.is(candidate.range) && Is.string(candidate.text); + } + InlineValueText2.is = is; +})(InlineValueText || (InlineValueText = {})); +var InlineValueVariableLookup; +(function(InlineValueVariableLookup2) { + function create(range, variableName, caseSensitiveLookup) { + return { range, variableName, caseSensitiveLookup }; + } + InlineValueVariableLookup2.create = create; + function is(value) { + const candidate = value; + return candidate !== void 0 && candidate !== null && Range.is(candidate.range) && Is.boolean(candidate.caseSensitiveLookup) && (Is.string(candidate.variableName) || candidate.variableName === void 0); + } + InlineValueVariableLookup2.is = is; +})(InlineValueVariableLookup || (InlineValueVariableLookup = {})); +var InlineValueEvaluatableExpression; +(function(InlineValueEvaluatableExpression2) { + function create(range, expression) { + return { range, expression }; + } + InlineValueEvaluatableExpression2.create = create; + function is(value) { + const candidate = value; + return candidate !== void 0 && candidate !== null && Range.is(candidate.range) && (Is.string(candidate.expression) || candidate.expression === void 0); + } + InlineValueEvaluatableExpression2.is = is; +})(InlineValueEvaluatableExpression || (InlineValueEvaluatableExpression = {})); +var InlineValueContext; +(function(InlineValueContext2) { + function create(frameId, stoppedLocation) { + return { frameId, stoppedLocation }; + } + InlineValueContext2.create = create; + function is(value) { + const candidate = value; + return Is.defined(candidate) && Range.is(value.stoppedLocation); + } + InlineValueContext2.is = is; +})(InlineValueContext || (InlineValueContext = {})); +var InlayHintKind; +(function(InlayHintKind2) { + InlayHintKind2.Type = 1; + InlayHintKind2.Parameter = 2; + function is(value) { + return value === 1 || value === 2; + } + InlayHintKind2.is = is; +})(InlayHintKind || (InlayHintKind = {})); +var InlayHintLabelPart; +(function(InlayHintLabelPart2) { + function create(value) { + return { value }; + } + InlayHintLabelPart2.create = create; + function is(value) { + const candidate = value; + return Is.objectLiteral(candidate) && (candidate.tooltip === void 0 || Is.string(candidate.tooltip) || MarkupContent.is(candidate.tooltip)) && (candidate.location === void 0 || Location.is(candidate.location)) && (candidate.command === void 0 || Command.is(candidate.command)); + } + InlayHintLabelPart2.is = is; +})(InlayHintLabelPart || (InlayHintLabelPart = {})); +var InlayHint; +(function(InlayHint2) { + function create(position, label, kind) { + const result = { position, label }; + if (kind !== void 0) { + result.kind = kind; + } + return result; + } + InlayHint2.create = create; + function is(value) { + const candidate = value; + return Is.objectLiteral(candidate) && Position.is(candidate.position) && (Is.string(candidate.label) || Is.typedArray(candidate.label, InlayHintLabelPart.is)) && (candidate.kind === void 0 || InlayHintKind.is(candidate.kind)) && candidate.textEdits === void 0 || Is.typedArray(candidate.textEdits, TextEdit.is) && (candidate.tooltip === void 0 || Is.string(candidate.tooltip) || MarkupContent.is(candidate.tooltip)) && (candidate.paddingLeft === void 0 || Is.boolean(candidate.paddingLeft)) && (candidate.paddingRight === void 0 || Is.boolean(candidate.paddingRight)); + } + InlayHint2.is = is; +})(InlayHint || (InlayHint = {})); +var StringValue; +(function(StringValue2) { + function createSnippet(value) { + return { kind: "snippet", value }; + } + StringValue2.createSnippet = createSnippet; +})(StringValue || (StringValue = {})); +var InlineCompletionItem; +(function(InlineCompletionItem2) { + function create(insertText, filterText, range, command) { + return { insertText, filterText, range, command }; + } + InlineCompletionItem2.create = create; +})(InlineCompletionItem || (InlineCompletionItem = {})); +var InlineCompletionList; +(function(InlineCompletionList2) { + function create(items) { + return { items }; + } + InlineCompletionList2.create = create; +})(InlineCompletionList || (InlineCompletionList = {})); +var InlineCompletionTriggerKind; +(function(InlineCompletionTriggerKind2) { + InlineCompletionTriggerKind2.Invoked = 0; + InlineCompletionTriggerKind2.Automatic = 1; +})(InlineCompletionTriggerKind || (InlineCompletionTriggerKind = {})); +var SelectedCompletionInfo; +(function(SelectedCompletionInfo2) { + function create(range, text) { + return { range, text }; + } + SelectedCompletionInfo2.create = create; +})(SelectedCompletionInfo || (SelectedCompletionInfo = {})); +var InlineCompletionContext; +(function(InlineCompletionContext2) { + function create(triggerKind, selectedCompletionInfo) { + return { triggerKind, selectedCompletionInfo }; + } + InlineCompletionContext2.create = create; +})(InlineCompletionContext || (InlineCompletionContext = {})); +var WorkspaceFolder; +(function(WorkspaceFolder2) { + function is(value) { + const candidate = value; + return Is.objectLiteral(candidate) && URI.is(candidate.uri) && Is.string(candidate.name); + } + WorkspaceFolder2.is = is; +})(WorkspaceFolder || (WorkspaceFolder = {})); +var TextDocument; +(function(TextDocument2) { + function create(uri, languageId, version, content) { + return new FullTextDocument(uri, languageId, version, content); + } + TextDocument2.create = create; + function is(value) { + let candidate = value; + return Is.defined(candidate) && Is.string(candidate.uri) && (Is.undefined(candidate.languageId) || Is.string(candidate.languageId)) && Is.uinteger(candidate.lineCount) && Is.func(candidate.getText) && Is.func(candidate.positionAt) && Is.func(candidate.offsetAt) ? true : false; + } + TextDocument2.is = is; + function applyEdits(document, edits) { + let text = document.getText(); + let sortedEdits = mergeSort(edits, (a, b) => { + let diff = a.range.start.line - b.range.start.line; + if (diff === 0) { + return a.range.start.character - b.range.start.character; + } + return diff; + }); + let lastModifiedOffset = text.length; + for (let i = sortedEdits.length - 1; i >= 0; i--) { + let e = sortedEdits[i]; + let startOffset = document.offsetAt(e.range.start); + let endOffset = document.offsetAt(e.range.end); + if (endOffset <= lastModifiedOffset) { + text = text.substring(0, startOffset) + e.newText + text.substring(endOffset, text.length); + } else { + throw new Error("Overlapping edit"); + } + lastModifiedOffset = startOffset; + } + return text; + } + TextDocument2.applyEdits = applyEdits; + function mergeSort(data, compare) { + if (data.length <= 1) { + return data; + } + const p = data.length / 2 | 0; + const left = data.slice(0, p); + const right = data.slice(p); + mergeSort(left, compare); + mergeSort(right, compare); + let leftIdx = 0; + let rightIdx = 0; + let i = 0; + while (leftIdx < left.length && rightIdx < right.length) { + let ret = compare(left[leftIdx], right[rightIdx]); + if (ret <= 0) { + data[i++] = left[leftIdx++]; + } else { + data[i++] = right[rightIdx++]; + } + } + while (leftIdx < left.length) { + data[i++] = left[leftIdx++]; + } + while (rightIdx < right.length) { + data[i++] = right[rightIdx++]; + } + return data; + } +})(TextDocument || (TextDocument = {})); +var FullTextDocument = class { + constructor(uri, languageId, version, content) { + this._uri = uri; + this._languageId = languageId; + this._version = version; + this._content = content; + this._lineOffsets = void 0; + } + get uri() { + return this._uri; + } + get languageId() { + return this._languageId; + } + get version() { + return this._version; + } + getText(range) { + if (range) { + let start = this.offsetAt(range.start); + let end = this.offsetAt(range.end); + return this._content.substring(start, end); + } + return this._content; + } + update(event, version) { + this._content = event.text; + this._version = version; + this._lineOffsets = void 0; + } + getLineOffsets() { + if (this._lineOffsets === void 0) { + let lineOffsets = []; + let text = this._content; + let isLineStart = true; + for (let i = 0; i < text.length; i++) { + if (isLineStart) { + lineOffsets.push(i); + isLineStart = false; + } + let ch = text.charAt(i); + isLineStart = ch === "\r" || ch === "\n"; + if (ch === "\r" && i + 1 < text.length && text.charAt(i + 1) === "\n") { + i++; + } + } + if (isLineStart && text.length > 0) { + lineOffsets.push(text.length); + } + this._lineOffsets = lineOffsets; + } + return this._lineOffsets; + } + positionAt(offset) { + offset = Math.max(Math.min(offset, this._content.length), 0); + let lineOffsets = this.getLineOffsets(); + let low = 0, high = lineOffsets.length; + if (high === 0) { + return Position.create(0, offset); + } + while (low < high) { + let mid = Math.floor((low + high) / 2); + if (lineOffsets[mid] > offset) { + high = mid; + } else { + low = mid + 1; + } + } + let line = low - 1; + return Position.create(line, offset - lineOffsets[line]); + } + offsetAt(position) { + let lineOffsets = this.getLineOffsets(); + if (position.line >= lineOffsets.length) { + return this._content.length; + } else if (position.line < 0) { + return 0; + } + let lineOffset = lineOffsets[position.line]; + let nextLineOffset = position.line + 1 < lineOffsets.length ? lineOffsets[position.line + 1] : this._content.length; + return Math.max(Math.min(lineOffset + position.character, nextLineOffset), lineOffset); + } + get lineCount() { + return this.getLineOffsets().length; + } +}; +var Is; +(function(Is2) { + const toString = Object.prototype.toString; + function defined(value) { + return typeof value !== "undefined"; + } + Is2.defined = defined; + function undefined2(value) { + return typeof value === "undefined"; + } + Is2.undefined = undefined2; + function boolean(value) { + return value === true || value === false; + } + Is2.boolean = boolean; + function string(value) { + return toString.call(value) === "[object String]"; + } + Is2.string = string; + function number(value) { + return toString.call(value) === "[object Number]"; + } + Is2.number = number; + function numberRange(value, min, max) { + return toString.call(value) === "[object Number]" && min <= value && value <= max; + } + Is2.numberRange = numberRange; + function integer2(value) { + return toString.call(value) === "[object Number]" && -2147483648 <= value && value <= 2147483647; + } + Is2.integer = integer2; + function uinteger2(value) { + return toString.call(value) === "[object Number]" && 0 <= value && value <= 2147483647; + } + Is2.uinteger = uinteger2; + function func(value) { + return toString.call(value) === "[object Function]"; + } + Is2.func = func; + function objectLiteral(value) { + return value !== null && typeof value === "object"; + } + Is2.objectLiteral = objectLiteral; + function typedArray(value, check) { + return Array.isArray(value) && value.every(check); + } + Is2.typedArray = typedArray; +})(Is || (Is = {})); + +// src/lsp/client.ts +import { cache } from "../cache.mjs"; +var monaco; +function init(monacoNS) { + monaco = monacoNS; +} +function createHost(workspace) { + return workspace ? { + fs_readDirectory: (uri) => { + return workspace.fs.readDirectory(uri); + }, + fs_stat: (uri) => { + return workspace.fs.stat(uri); + }, + fs_getContent: (uri) => { + return workspace.fs.readTextFile(uri); + } + } : /* @__PURE__ */ Object.create(null); +} +async function walkFS(fs, dir = "/") { + const entries = []; + for (const [name, type] of await fs.readDirectory(dir || "/")) { + const path = (dir.endsWith("/") ? dir.slice(0, -1) : dir) + "/" + name; + if (type === 2) { + entries.push(...await walkFS(fs, path)); + } else { + entries.push(path); + } + } + return entries; +} +function lspRequest(req, token) { + return new Promise((resolve, reject) => { + if (token.isCancellationRequested) { + resolve(void 0); + return; + } + token.onCancellationRequested(() => { + resolve(void 0); + }); + const ret = req(); + if (ret) { + ret.then(resolve, reject); + } else { + resolve(void 0); + } + }); +} +var registry = /* @__PURE__ */ new Map(); +function registerBasicFeatures(languageId, worker, completionTriggerCharacters, workspace, diagnosticsOptions) { + const { editor, languages } = monaco; + const onDispose = async (model) => { + const workerProxy = await worker.withSyncedResources([]); + workerProxy.releaseDocument(model.uri.toString()); + }; + editor.onDidChangeModelLanguage(({ model, oldLanguage }) => { + if (oldLanguage === languageId) { + onDispose(model); + } + }); + editor.onWillDisposeModel((model) => { + if (model.getLanguageId() === languageId) { + onDispose(model); + } + }); + if (diagnosticsOptions?.validate ?? true) { + registerDiagnostics(languageId, worker, diagnosticsOptions); + } + languages.registerCompletionItemProvider(languageId, new CompletionAdapter(worker, completionTriggerCharacters)); + languages.registerHoverProvider(languageId, new HoverAdapter(worker)); + languages.registerDocumentSymbolProvider(languageId, new DocumentSymbolAdapter(worker)); + languages.registerDefinitionProvider(languageId, new DefinitionAdapter(worker)); + languages.registerReferenceProvider(languageId, new ReferenceAdapter(worker)); + languages.registerRenameProvider(languageId, new RenameAdapter(worker)); + languages.registerDocumentFormattingEditProvider(languageId, new DocumentFormattingEditProvider(worker)); + languages.registerDocumentRangeFormattingEditProvider(languageId, new DocumentRangeFormattingEditProvider(worker)); + languages.registerFoldingRangeProvider(languageId, new FoldingRangeAdapter(worker)); + languages.registerDocumentHighlightProvider(languageId, new DocumentHighlightAdapter(worker)); + languages.registerSelectionRangeProvider(languageId, new SelectionRangeAdapter(worker)); + registry.set(languageId, worker); + const embeddedExtname = getEmbeddedExtname(languageId); + monaco.editor.getModels().forEach((model) => { + const uri = model.uri.toString(true); + if (uri.endsWith(embeddedExtname)) { + const masterModel = monaco.editor.getModel(uri.slice(0, -embeddedExtname.length)); + if (masterModel) { + Reflect.get(masterModel, "refreshDiagnostics")?.(); + } + } + }); + if (workspace) { + workspace.fs.watch("/", { recursive: true }, (kind, path, type) => { + if (kind !== "modify") { + worker.getProxy().then((proxy) => proxy.fsNotify(kind, path, type)); + } + }); + } +} +function registerDiagnostics(languageId, worker, options) { + const { editor } = monaco; + const modelChangeListeners = /* @__PURE__ */ new Map(); + const doValidate = async (model) => { + const workerProxy = await worker.withSyncedResources([model.uri]); + const diagnostics = await workerProxy.doValidation(model.uri.toString()); + if (diagnostics && !model.isDisposed()) { + let markers = diagnostics.map(diagnosticToMarker); + if (options?.filter) { + markers = markers.filter(options.filter); + } + if (options?.codesToIgnore) { + markers = markers.filter((marker) => { + const code = typeof marker.code === "string" ? marker.code : marker.code?.value; + for (const codeToIgnore of options.codesToIgnore) { + if (code && code === String(codeToIgnore)) { + return false; + } + } + return true; + }); + } + monaco.editor.setModelMarkers(model, languageId, markers); + } + }; + const validateModel = (model) => { + const modelLanugageId = model.getLanguageId(); + const uri = model.uri.toString(); + if (modelLanugageId !== languageId || uri.includes(".(embedded).")) { + return; + } + let timer = null; + const validate = () => { + if (timer) { + clearTimeout(timer); + } + timer = setTimeout(() => { + timer = null; + doValidate(model); + }, 500); + }; + modelChangeListeners.set(uri, model.onDidChangeContent(validate)); + Reflect.set(model, "refreshDiagnostics", validate); + doValidate(model); + }; + const onModelDispose = (model) => { + const uri = model.uri.toString(); + if (modelChangeListeners.has(uri)) { + modelChangeListeners.get(uri).dispose(); + modelChangeListeners.delete(uri); + } + Reflect.deleteProperty(model, "refreshDiagnostics"); + editor.setModelMarkers(model, languageId, []); + }; + editor.onDidCreateModel(validateModel); + editor.onWillDisposeModel(onModelDispose); + editor.onDidChangeModelLanguage(({ model }) => { + onModelDispose(model); + validateModel(model); + }); + editor.getModels().forEach(validateModel); +} +function diagnosticToMarker(diag) { + const { range, severity, code, message, source, tags, relatedInformation } = diag; + const { start, end } = range; + return { + startLineNumber: start.line + 1, + startColumn: start.character + 1, + endLineNumber: end.line + 1, + endColumn: end.character + 1, + severity: convertSeverity(severity), + code: code?.toString(), + message, + source, + tags, + relatedInformation: relatedInformation?.map(convertRelatedInformation) + }; +} +function convertSeverity(lsSeverity) { + switch (lsSeverity) { + case DiagnosticSeverity.Error: + return monaco.MarkerSeverity.Error; + case DiagnosticSeverity.Warning: + return monaco.MarkerSeverity.Warning; + case DiagnosticSeverity.Information: + return monaco.MarkerSeverity.Info; + case DiagnosticSeverity.Hint: + default: + return monaco.MarkerSeverity.Hint; + } +} +function convertRelatedInformation(info) { + const { location: { uri, range }, message } = info; + const { start, end } = range; + return { + resource: monaco.Uri.parse(uri), + startLineNumber: start.line + 1, + startColumn: start.character + 1, + endLineNumber: end.line + 1, + endColumn: end.character + 1, + message + }; +} +var CompletionAdapter = class { + constructor(_worker, _triggerCharacters) { + this._worker = _worker; + this._triggerCharacters = _triggerCharacters; + } + get triggerCharacters() { + return this._triggerCharacters; + } + async provideCompletionItems(model, position, context, token) { + const worker = await lspRequest(() => this._worker.withSyncedResources([model.uri]), token); + const info = await lspRequest(() => worker?.doComplete(model.uri.toString(), fromPosition(position)), token); + if (!info) { + return; + } + const wordInfo = model.getWordUntilPosition(position); + const wordRange = new monaco.Range( + position.lineNumber, + wordInfo.startColumn, + position.lineNumber, + wordInfo.endColumn + ); + const items = info.items.map((entry) => { + const item = { + command: entry.command && convertCommand(entry.command), + data: entry.data, + detail: entry.detail, + documentation: entry.documentation, + filterText: entry.filterText, + insertText: entry.insertText || entry.label, + kind: convertCompletionItemKind(entry.kind), + label: entry.label, + range: wordRange, + sortText: entry.sortText, + tags: entry.tags + }; + if (entry.textEdit) { + if (isInsertReplaceEdit(entry.textEdit)) { + item.range = { + insert: convertRange(entry.textEdit.insert), + replace: convertRange(entry.textEdit.replace) + }; + } else { + item.range = convertRange(entry.textEdit.range); + } + item.insertText = entry.textEdit.newText; + } + if (entry.additionalTextEdits) { + item.additionalTextEdits = entry.additionalTextEdits.map(convertTextEdit); + } + if (entry.insertTextFormat === InsertTextFormat.Snippet) { + item.insertTextRules = monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet; + } + return item; + }); + return { + suggestions: items, + incomplete: info.isIncomplete + }; + } + async resolveCompletionItem(item, token) { + const workerProxy = await lspRequest(() => this._worker.withSyncedResources([]), token); + const details = await lspRequest(() => workerProxy?.doResolveCompletionItem?.(item), token); + if (details) { + item.detail = details.detail; + item.documentation = details.documentation; + item.additionalTextEdits = details.additionalTextEdits?.map(convertTextEdit); + } + return item; + } +}; +function fromPosition(position) { + return { character: position.column - 1, line: position.lineNumber - 1 }; +} +function fromRange(range) { + return { + start: { + line: range.startLineNumber - 1, + character: range.startColumn - 1 + }, + end: { line: range.endLineNumber - 1, character: range.endColumn - 1 } + }; +} +function convertRange(range) { + return new monaco.Range( + range.start.line + 1, + range.start.character + 1, + range.end.line + 1, + range.end.character + 1 + ); +} +function isInsertReplaceEdit(edit) { + return typeof edit.insert !== "undefined" && typeof edit.replace !== "undefined"; +} +function convertCompletionItemKind(kind) { + const CompletionItemKind2 = monaco.languages.CompletionItemKind; + switch (kind) { + case CompletionItemKind.Text: + return CompletionItemKind2.Text; + case CompletionItemKind.Method: + return CompletionItemKind2.Method; + case CompletionItemKind.Function: + return CompletionItemKind2.Function; + case CompletionItemKind.Constructor: + return CompletionItemKind2.Constructor; + case CompletionItemKind.Field: + return CompletionItemKind2.Field; + case CompletionItemKind.Variable: + return CompletionItemKind2.Variable; + case CompletionItemKind.Class: + return CompletionItemKind2.Class; + case CompletionItemKind.Interface: + return CompletionItemKind2.Interface; + case CompletionItemKind.Module: + return CompletionItemKind2.Module; + case CompletionItemKind.Property: + return CompletionItemKind2.Property; + case CompletionItemKind.Unit: + return CompletionItemKind2.Unit; + case CompletionItemKind.Value: + return CompletionItemKind2.Value; + case CompletionItemKind.Enum: + return CompletionItemKind2.Enum; + case CompletionItemKind.Keyword: + return CompletionItemKind2.Keyword; + case CompletionItemKind.Snippet: + return CompletionItemKind2.Snippet; + case CompletionItemKind.Color: + return CompletionItemKind2.Color; + case CompletionItemKind.File: + return CompletionItemKind2.File; + case CompletionItemKind.Reference: + return CompletionItemKind2.Reference; + case CompletionItemKind.Folder: + return CompletionItemKind2.Folder; + case CompletionItemKind.EnumMember: + return CompletionItemKind2.EnumMember; + case CompletionItemKind.Constant: + return CompletionItemKind2.Constant; + case CompletionItemKind.Struct: + return CompletionItemKind2.Struct; + case CompletionItemKind.Event: + return CompletionItemKind2.Event; + case CompletionItemKind.Operator: + return CompletionItemKind2.Operator; + case CompletionItemKind.TypeParameter: + return CompletionItemKind2.TypeParameter; + default: + return CompletionItemKind2.Property; + } +} +function convertTextEdit(textEdit) { + return { + range: convertRange(textEdit.range), + text: textEdit.newText + }; +} +function convertCommand(c) { + return c ? { id: c.command ?? Reflect.get(c, "id"), title: c.title, arguments: c.arguments } : void 0; +} +var HoverAdapter = class { + constructor(_worker) { + this._worker = _worker; + } + async provideHover(model, position, token) { + const worker = await lspRequest(() => this._worker.withSyncedResources([model.uri]), token); + const info = await lspRequest(() => worker?.doHover(model.uri.toString(), fromPosition(position)), token); + if (info) { + return { + range: info.range ? convertRange(info.range) : void 0, + contents: convertMarkedStringArray(info.contents) + }; + } + } +}; +function isMarkupContent(v) { + return v && typeof v === "object" && typeof v.kind === "string"; +} +function convertMarkdownString(entry) { + if (typeof entry === "string") { + return { value: entry }; + } + if (isMarkupContent(entry)) { + if (entry.kind === "plaintext") { + return { value: entry.value.replace(/[\\`*_{}[\]()#+\-.!]/g, "\\$&") }; + } + return { value: entry.value }; + } + return { value: "```" + entry.language + "\n" + entry.value + "\n```\n" }; +} +function convertMarkedStringArray(contents) { + if (Array.isArray(contents)) { + return contents.map(convertMarkdownString); + } + return [convertMarkdownString(contents)]; +} +function registerSignatureHelp(languageId, worker, triggerCharacters) { + monaco.languages.registerSignatureHelpProvider( + languageId, + new SignatureHelpAdapter(worker, triggerCharacters) + ); +} +var SignatureHelpAdapter = class { + constructor(_worker, _triggerCharacters) { + this._worker = _worker; + this._triggerCharacters = _triggerCharacters; + } + get signatureHelpTriggerCharacters() { + return this._triggerCharacters; + } + async provideSignatureHelp(model, position, token, context) { + const worker = await lspRequest(() => this._worker.withSyncedResources([model.uri]), token); + const helpInfo = await lspRequest(() => worker?.doSignatureHelp(model.uri.toString(), model.getOffsetAt(position), context), token); + if (!helpInfo || model.isDisposed()) { + return void 0; + } + helpInfo.signatures?.forEach((s) => { + if (typeof s.documentation === "string") { + s.documentation = { kind: "markdown", value: s.documentation }; + } + }); + return { + value: helpInfo, + dispose() { + } + }; + } +}; +function registerCodeAction(languageId, worker) { + monaco.languages.registerCodeActionProvider(languageId, new CodeActionAdaptor(worker)); +} +var CodeActionAdaptor = class { + constructor(_worker) { + this._worker = _worker; + } + async provideCodeActions(model, range, context, token) { + const worker = await lspRequest(() => this._worker.withSyncedResources([model.uri]), token); + const codeActions = await lspRequest( + () => { + const modelOptions = model.getOptions(); + const formatOptions = { + tabSize: modelOptions.tabSize, + insertSpaces: modelOptions.insertSpaces, + trimTrailingWhitespace: modelOptions.trimAutoWhitespace + }; + return worker?.doCodeAction(model.uri.toString(), fromRange(range), fromCodeActionContext(context), formatOptions); + }, + token + ); + if (codeActions) { + return { + actions: codeActions.map((action) => ({ + kind: action.kind ?? "quickfix", + title: action.title, + edit: action.edit && convertWorkspaceEdit(action.edit), + diagnostics: context.markers, + command: action.command && convertCommand(action.command) + })), + dispose: () => { + } + }; + } + } +}; +function fromCodeActionContext(context) { + return { + diagnostics: context.markers.map(fromMarkerToDiagnostic), + only: context.only ? [context.only] : void 0, + triggerKind: context.trigger + }; +} +function fromMarkerToDiagnostic(marker) { + return { + code: typeof marker.code === "string" ? marker.code : marker.code?.value, + message: marker.message, + range: fromRange(marker), + severity: fromDiagnosticSeverity(marker.severity), + source: marker.source, + tags: marker.tags + }; +} +function fromDiagnosticSeverity(severity) { + switch (severity) { + case monaco.MarkerSeverity.Error: + return DiagnosticSeverity.Error; + case monaco.MarkerSeverity.Warning: + return DiagnosticSeverity.Warning; + case monaco.MarkerSeverity.Hint: + return DiagnosticSeverity.Hint; + default: + return DiagnosticSeverity.Information; + } +} +var RenameAdapter = class { + constructor(_worker) { + this._worker = _worker; + } + async provideRenameEdits(model, position, newName, token) { + const worker = await lspRequest(() => this._worker.withSyncedResources([model.uri]), token); + const edit = await lspRequest(() => worker?.doRename(model.uri.toString(), fromPosition(position), newName), token); + if (edit) { + return convertWorkspaceEdit(edit); + } + } +}; +function convertWorkspaceEdit(edit) { + if (!edit.changes) { + return void 0; + } + let resourceEdits = []; + for (let uri in edit.changes) { + const resource = monaco.Uri.parse(uri); + for (let change of edit.changes[uri]) { + resourceEdits.push({ + resource, + versionId: void 0, + textEdit: { + range: convertRange(change.range), + text: change.newText + } + }); + } + } + return { edits: resourceEdits }; +} +var DocumentFormattingEditProvider = class { + constructor(_worker) { + this._worker = _worker; + } + async provideDocumentFormattingEdits(model, options, token) { + const worker = await lspRequest(() => this._worker.withSyncedResources([model.uri]), token); + const edits = await lspRequest(() => worker?.doFormat(model.uri.toString(), null, options), token); + if (edits) { + return edits.map(convertTextEdit); + } + } +}; +var DocumentRangeFormattingEditProvider = class { + constructor(_worker) { + this._worker = _worker; + } + async provideDocumentRangeFormattingEdits(model, range, options, token) { + const worker = await lspRequest(() => this._worker.withSyncedResources([model.uri]), token); + const edits = await lspRequest(() => worker?.doFormat(model.uri.toString(), fromRange(range), options), token); + if (edits) { + return edits.map(convertTextEdit); + } + } +}; +function registerAutoComplete(langaugeId, worker, triggerCharacters) { + const { editor } = monaco; + const listeners = /* @__PURE__ */ new Map(); + const validateModel = async (model) => { + if (model.getLanguageId() !== langaugeId) { + return; + } + const modelUri = model.uri.toString(); + listeners.set( + modelUri, + model.onDidChangeContent(async (e) => { + const lastChange = e.changes[e.changes.length - 1]; + const lastCharacter = lastChange.text[lastChange.text.length - 1]; + if (triggerCharacters.includes(lastCharacter)) { + const lastRange = lastChange.range; + const position = new monaco.Position(lastRange.endLineNumber, lastRange.endColumn + lastChange.text.length); + const workerProxy = await worker.withSyncedResources([model.uri]); + const snippet = await workerProxy.doAutoComplete(modelUri, fromPosition(position), lastCharacter); + if (snippet) { + const cursor = snippet.indexOf("$0"); + const insertText = cursor >= 0 ? snippet.replace("$0", "") : snippet; + const range = new monaco.Range(position.lineNumber, position.column, position.lineNumber, position.column); + model.pushEditOperations([], [{ range, text: insertText }], () => []); + if (cursor >= 0) { + const focusEditor = editor.getEditors().find((e2) => e2.hasTextFocus()); + focusEditor?.setPosition(position.delta(0, cursor)); + } + } + } + }) + ); + }; + editor.onDidCreateModel(validateModel); + editor.onDidChangeModelLanguage(({ model, oldLanguage }) => { + const modelUri = model.uri.toString(); + if (oldLanguage === langaugeId && listeners.has(modelUri)) { + listeners.get(modelUri)?.dispose(); + listeners.delete(modelUri); + } + validateModel(model); + }); + editor.onWillDisposeModel((model) => { + const modelUri = model.uri.toString(); + if (model.getLanguageId() === langaugeId && listeners.has(modelUri)) { + listeners.get(modelUri)?.dispose(); + listeners.delete(modelUri); + } + }); + editor.getModels().forEach(validateModel); +} +var DocumentSymbolAdapter = class { + constructor(_worker) { + this._worker = _worker; + } + async provideDocumentSymbols(model, token) { + const worker = await lspRequest(() => this._worker.withSyncedResources([model.uri]), token); + const items = await lspRequest(() => worker?.findDocumentSymbols(model.uri.toString()), token); + if (items) { + return items.map((item) => { + if (isDocumentSymbol(item)) { + return convertDocumentSymbol(item); + } + return { + name: item.name, + detail: "", + containerName: item.containerName, + kind: convertSymbolKind(item.kind), + range: convertRange(item.location.range), + selectionRange: convertRange(item.location.range), + tags: item.tags ?? [] + }; + }); + } + } +}; +function isDocumentSymbol(symbol) { + return "children" in symbol; +} +function convertDocumentSymbol(symbol) { + return { + name: symbol.name, + detail: symbol.detail ?? "", + kind: convertSymbolKind(symbol.kind), + range: convertRange(symbol.range), + selectionRange: convertRange(symbol.selectionRange), + tags: symbol.tags ?? [], + children: (symbol.children ?? []).map((item) => convertDocumentSymbol(item)), + containerName: Reflect.get(symbol, "containerName") + }; +} +function convertSymbolKind(kind) { + const mKind = monaco.languages.SymbolKind; + switch (kind) { + case SymbolKind.File: + return mKind.File; + case SymbolKind.Module: + return mKind.Module; + case SymbolKind.Namespace: + return mKind.Namespace; + case SymbolKind.Package: + return mKind.Package; + case SymbolKind.Class: + return mKind.Class; + case SymbolKind.Method: + return mKind.Method; + case SymbolKind.Property: + return mKind.Property; + case SymbolKind.Field: + return mKind.Field; + case SymbolKind.Constructor: + return mKind.Constructor; + case SymbolKind.Enum: + return mKind.Enum; + case SymbolKind.Interface: + return mKind.Interface; + case SymbolKind.Function: + return mKind.Function; + case SymbolKind.Variable: + return mKind.Variable; + case SymbolKind.Constant: + return mKind.Constant; + case SymbolKind.String: + return mKind.String; + case SymbolKind.Number: + return mKind.Number; + case SymbolKind.Boolean: + return mKind.Boolean; + case SymbolKind.Array: + return mKind.Array; + } + return mKind.Function; +} +var DefinitionAdapter = class { + constructor(_worker) { + this._worker = _worker; + } + async provideDefinition(model, position, token) { + const worker = await lspRequest(() => this._worker.withSyncedResources([model.uri]), token); + const definition = await lspRequest(() => worker?.findDefinition(model.uri.toString(), fromPosition(position)), token); + if (definition) { + const links = (Array.isArray(definition) ? definition : [definition]).map(convertLocationLink); + await ensureHttpModels(links); + return links; + } + } +}; +function isLocationLink(location) { + return "targetUri" in location && "targetRange" in location; +} +function convertLocationLink(location) { + let uri; + let range; + let targetSelectionRange; + let originSelectionRange; + if (isLocationLink(location)) { + uri = location.targetUri; + range = location.targetRange; + targetSelectionRange = location.targetSelectionRange; + originSelectionRange = location.originSelectionRange; + } else { + uri = location.uri; + range = location.range; + } + if (uri.includes(".(embedded).")) { + uri = uri.slice(0, uri.lastIndexOf(".(embedded).")); + } + return { + uri: monaco.Uri.parse(uri), + range: convertRange(range), + targetSelectionRange: targetSelectionRange ? convertRange(targetSelectionRange) : void 0, + originSelectionRange: originSelectionRange ? convertRange(originSelectionRange) : void 0 + }; +} +async function ensureHttpModels(links) { + const { editor, Uri } = monaco; + const httpUrls = new Set( + links.map((link) => link.uri).filter((uri) => !editor.getModel(uri) && (uri.scheme === "https" || uri.scheme === "http")).map((uri) => uri.toString()) + ); + await Promise.all( + [...httpUrls].map(async (url) => { + const text = await cache.fetch(url).then((res) => res.text()); + const uri = Uri.parse(url); + if (!editor.getModel(uri)) { + editor.createModel(text, void 0, uri); + } + }) + ); +} +var ReferenceAdapter = class { + constructor(_worker) { + this._worker = _worker; + } + async provideReferences(model, position, context, token) { + const worker = await lspRequest(() => this._worker.withSyncedResources([model.uri]), token); + const references = await lspRequest(() => worker?.findReferences(model.uri.toString(), fromPosition(position)), token); + if (references) { + const links = references.map(convertLocationLink); + await ensureHttpModels(links); + return links; + } + } +}; +function registerDocumentLinks(langaugeId, worker) { + monaco.languages.registerLinkProvider(langaugeId, new DocumentLinkAdapter(worker)); +} +var DocumentLinkAdapter = class { + constructor(_worker) { + this._worker = _worker; + } + async provideLinks(model, token) { + const worker = await lspRequest(() => this._worker.withSyncedResources([model.uri]), token); + const items = await lspRequest(() => worker?.findDocumentLinks(model.uri.toString()), token); + if (items) { + const links = items.map((item) => ({ + range: convertRange(item.range), + url: item.target + })); + return { links }; + } + } +}; +function registerColorPresentation(langaugeId, worker) { + monaco.languages.registerColorProvider(langaugeId, new DocumentColorAdapter(worker)); +} +var DocumentColorAdapter = class { + constructor(_worker) { + this._worker = _worker; + } + async provideDocumentColors(model, token) { + const worker = await lspRequest(() => this._worker.withSyncedResources([model.uri]), token); + const colors = await lspRequest(() => worker?.findDocumentColors(model.uri.toString()), token); + if (colors) { + return colors.map((item) => ({ + color: item.color, + range: convertRange(item.range) + })); + } + } + async provideColorPresentations(model, info, token) { + const worker = await lspRequest(() => this._worker.withSyncedResources([model.uri]), token); + const presentations = await lspRequest( + () => worker?.getColorPresentations(model.uri.toString(), info.color, fromRange(info.range)), + token + ); + if (presentations) { + return presentations.map((presentation) => ({ + label: presentation.label, + textEdit: presentation.textEdit ? convertTextEdit(presentation.textEdit) : void 0, + additionalTextEdits: presentation.additionalTextEdits?.map(convertTextEdit) + })); + } + } +}; +var DocumentHighlightAdapter = class { + constructor(_worker) { + this._worker = _worker; + } + async provideDocumentHighlights(model, position, token) { + const worker = await lspRequest(() => this._worker.withSyncedResources([model.uri]), token); + const entries = await lspRequest(() => worker?.findDocumentHighlights(model.uri.toString(), fromPosition(position)), token); + if (entries) { + return entries.map((entry) => { + return { + range: convertRange(entry.range), + kind: convertDocumentHighlightKind(entry.kind) + }; + }); + } + } +}; +function convertDocumentHighlightKind(kind) { + switch (kind) { + case DocumentHighlightKind.Read: + return monaco.languages.DocumentHighlightKind.Read; + case DocumentHighlightKind.Write: + return monaco.languages.DocumentHighlightKind.Write; + case DocumentHighlightKind.Text: + return monaco.languages.DocumentHighlightKind.Text; + } + return monaco.languages.DocumentHighlightKind.Text; +} +var FoldingRangeAdapter = class { + constructor(_worker) { + this._worker = _worker; + } + async provideFoldingRanges(model, context, token) { + const worker = await lspRequest(() => this._worker.withSyncedResources([model.uri]), token); + const ranges = await lspRequest(() => worker?.getFoldingRanges(model.uri.toString(), context), token); + if (ranges) { + return ranges.map((range) => { + const result = { + start: range.startLine + 1, + end: range.endLine + 1 + }; + if (typeof range.kind !== "undefined") { + result.kind = convertFoldingRangeKind(range.kind); + } + return result; + }); + } + } +}; +function convertFoldingRangeKind(kind) { + switch (kind) { + case FoldingRangeKind.Comment: + return monaco.languages.FoldingRangeKind.Comment; + case FoldingRangeKind.Imports: + return monaco.languages.FoldingRangeKind.Imports; + case FoldingRangeKind.Region: + return monaco.languages.FoldingRangeKind.Region; + } + return void 0; +} +var SelectionRangeAdapter = class { + constructor(_worker) { + this._worker = _worker; + } + async provideSelectionRanges(model, positions, token) { + const worker = await lspRequest(() => this._worker.withSyncedResources([model.uri]), token); + const selectionRanges = await lspRequest(() => worker?.getSelectionRanges(model.uri.toString(), positions.map(fromPosition)), token); + if (selectionRanges) { + return selectionRanges.map( + (selectionRange) => { + const result = []; + while (selectionRange) { + result.push({ range: convertRange(selectionRange.range) }); + selectionRange = selectionRange.parent; + } + return result; + } + ); + } + } +}; +var LinkedEditingRangeAdapter = class { + constructor(_worker) { + this._worker = _worker; + } + async provideLinkedEditingRanges(model, position, token) { + const worker = await lspRequest(() => this._worker.withSyncedResources([model.uri]), token); + const editingRange = await lspRequest( + () => worker?.getLinkedEditingRangeAtPosition(model.uri.toString(), fromPosition(position)), + token + ); + if (editingRange) { + const { wordPattern, ranges } = editingRange; + return { + ranges: ranges.map((range) => convertRange(range)), + wordPattern: wordPattern ? new RegExp(wordPattern) : void 0 + }; + } + } +}; +var InlayHintsAdapter = class { + constructor(_worker) { + this._worker = _worker; + } + async provideInlayHints(model, range, token) { + const worker = await lspRequest(() => this._worker.withSyncedResources([model.uri]), token); + const hints = await lspRequest(() => worker?.provideInlayHints(model.uri.toString(), fromRange(range)), token); + return { hints: hints?.map(convertInlayHint) ?? [], dispose: () => { + } }; + } +}; +function convertInlayHint(hint) { + return { + label: convertLabelText(hint.label), + tooltip: hint.tooltip, + textEdits: hint.textEdits?.map(convertTextEdit), + position: convertPosition(hint.position), + kind: hint.kind, + paddingLeft: hint.paddingLeft, + paddingRight: hint.paddingRight + }; +} +function convertLabelText(label) { + if (typeof label === "string") { + return label; + } + return label.map(convertInlayHintLabelPart); +} +function convertInlayHintLabelPart(part) { + return { + label: part.value, + tooltip: part.tooltip, + command: convertCommand(part.command), + location: part.location ? convertLocationLink(part.location) : void 0 + }; +} +function convertPosition(position) { + return new monaco.Position(position.line + 1, position.character + 1); +} +function registerEmbedded(languageId, mainWorker, languages) { + const { editor, Uri } = monaco; + const listeners = /* @__PURE__ */ new Map(); + const validateModel = async (model) => { + if (model.getLanguageId() !== languageId) { + return; + } + const modelUri = model.uri.toString(); + const getEmbeddedDocument = async (rsl) => { + const workerProxy = await mainWorker.withSyncedResources([model.uri]); + return workerProxy.getEmbeddedDocument(modelUri, rsl); + }; + const attachEmbeddedLanguage = async (languageId2) => { + const uri = Uri.parse(model.uri.path + getEmbeddedExtname(languageId2)); + const doc = await getEmbeddedDocument(languageId2); + if (doc) { + let embeddedModel = editor.getModel(uri); + if (!embeddedModel) { + embeddedModel = editor.createModel(doc.content, normalizeLanguageId(languageId2), uri); + Reflect.set(embeddedModel, "_versionId", model.getVersionId()); + } else { + embeddedModel.setValue(doc.content); + } + } else { + const embeddedModel = editor.getModel(uri); + if (embeddedModel) { + embeddedModel.dispose(); + } + } + }; + const attachAll = () => languages.forEach(attachEmbeddedLanguage); + listeners.set(modelUri, model.onDidChangeContent(attachAll)); + attachAll(); + }; + const cleanUp = (model) => { + const uri = model.uri.toString(); + if (listeners.has(uri)) { + listeners.get(uri).dispose(); + listeners.delete(uri); + } + languages.forEach((languageId2) => { + const uri2 = Uri.parse(model.uri.path + getEmbeddedExtname(languageId2)); + editor.getModel(uri2)?.dispose(); + }); + }; + editor.onDidCreateModel(validateModel); + editor.onWillDisposeModel((model) => { + if (model.getLanguageId() === languageId) { + cleanUp(model); + } + }); + editor.onDidChangeModelLanguage(({ model, oldLanguage }) => { + if (oldLanguage === languageId) { + cleanUp(model); + } + validateModel(model); + }); + editor.getModels().forEach(validateModel); +} +function createWorkerWithEmbeddedLanguages(mainWorker) { + const redirectLSPRequest = async (rsl, method, uri, ...args) => { + const langaugeId = normalizeLanguageId(rsl); + const worker = registry.get(langaugeId); + if (worker) { + const embeddedUri = monaco.Uri.parse(uri + getEmbeddedExtname(rsl)); + return worker.withSyncedResources([embeddedUri]).then((worker2) => worker2[method]?.(embeddedUri.toString(), ...args)); + } + return null; + }; + return { + withSyncedResources: async (resources) => { + const workerProxy = await mainWorker.withSyncedResources(resources); + return new Proxy(workerProxy, { + get(target, prop, receiver) { + const value = Reflect.get(target, prop, receiver); + if (typeof value === "function") { + return async (uri, ...args) => { + const ret = await value(uri, ...args); + if (typeof ret === "object" && ret != null && !Array.isArray(ret) && "$embedded" in ret) { + const embedded = ret.$embedded; + if (typeof embedded === "string") { + return redirectLSPRequest(embedded, prop, uri, ...args); + } else if (typeof embedded === "object" && embedded != null) { + const { languageIds, data, origin } = embedded; + const promises = languageIds.map( + (rsl, i) => redirectLSPRequest(rsl, prop, uri, ...args, data?.[i]) + ); + const results = await Promise.all(promises); + return origin.concat(...results.filter((r) => Array.isArray(r))); + } + return null; + } + return ret; + }; + } + return value; + } + }); + }, + dispose: () => mainWorker.dispose(), + getProxy: () => mainWorker.getProxy() + }; +} +function normalizeLanguageId(languageId) { + return languageId === "importmap" ? "json" : languageId; +} +function getEmbeddedExtname(rsl) { + return ".(embedded)." + (rsl === "javascript" ? "js" : rsl); +} +export { + CodeActionAdaptor, + CompletionAdapter, + DefinitionAdapter, + DocumentColorAdapter, + DocumentFormattingEditProvider, + DocumentHighlightAdapter, + DocumentLinkAdapter, + DocumentRangeFormattingEditProvider, + DocumentSymbolAdapter, + FoldingRangeAdapter, + HoverAdapter, + InlayHintsAdapter, + LinkedEditingRangeAdapter, + ReferenceAdapter, + RenameAdapter, + SelectionRangeAdapter, + SignatureHelpAdapter, + convertRange, + convertTextEdit, + createHost, + createWorkerWithEmbeddedLanguages, + fromPosition, + fromRange, + init, + registerAutoComplete, + registerBasicFeatures, + registerCodeAction, + registerColorPresentation, + registerDocumentLinks, + registerEmbedded, + registerSignatureHelp, + walkFS +}; diff --git a/web/public/hoisted-modern-monaco/modern-monaco/lsp/css/setup.mjs b/web/public/hoisted-modern-monaco/modern-monaco/lsp/css/setup.mjs new file mode 100644 index 0000000000..efef6646a0 --- /dev/null +++ b/web/public/hoisted-modern-monaco/modern-monaco/lsp/css/setup.mjs @@ -0,0 +1,58 @@ +// src/lsp/css/setup.ts +import * as client from "../client.mjs"; +async function setup(monaco, languageId, languageSettings, formattingOptions, workspace) { + const validProperties = languageSettings?.validProperties; + const dataProviders = { ...languageSettings?.dataProviders }; + if (validProperties) { + dataProviders["#valid-properties"] = { + version: 1.1, + properties: validProperties.map((property) => ({ name: property })) + }; + } + const { tabSize, insertSpaces, insertFinalNewline, trimFinalNewlines } = formattingOptions ?? {}; + const createData = { + language: languageId, + data: { + useDefaultDataProvider: languageSettings?.useDefaultDataProvider ?? true, + dataProviders + }, + format: { + tabSize, + insertFinalNewline, + insertSpaces, + preserveNewLines: !trimFinalNewlines, + newlineBetweenSelectors: true, + newlineBetweenRules: true, + spaceAroundSelectorSeparator: false, + braceStyle: "collapse" + }, + fs: workspace ? await client.walkFS(workspace.fs, "/") : void 0 + }; + const worker = monaco.editor.createWebWorker({ + worker: getWorker(createData), + host: client.createHost(workspace) + }); + client.init(monaco); + client.registerBasicFeatures(languageId, worker, ["/", "-", ":", "("], workspace, languageSettings?.diagnosticsOptions); + client.registerCodeAction(languageId, worker); + client.registerColorPresentation(languageId, worker); + client.registerDocumentLinks(languageId, worker); +} +function createWebWorker() { + const workerUrl = new URL("./worker.mjs", import.meta.url); + if (workerUrl.origin !== location.origin) { + return new Worker( + URL.createObjectURL(new Blob([`import "${workerUrl.href}"`], { type: "application/javascript" })), + { type: "module", name: "css-worker" } + ); + } + return new Worker(workerUrl, { type: "module", name: "css-worker" }); +} +function getWorker(createData) { + const worker = createWebWorker(); + worker.postMessage(createData); + return worker; +} +export { + setup +}; diff --git a/web/public/hoisted-modern-monaco/modern-monaco/lsp/css/worker.mjs b/web/public/hoisted-modern-monaco/modern-monaco/lsp/css/worker.mjs new file mode 100644 index 0000000000..347a990022 --- /dev/null +++ b/web/public/hoisted-modern-monaco/modern-monaco/lsp/css/worker.mjs @@ -0,0 +1,59415 @@ +// node_modules/vscode-css-languageservice/lib/esm/parser/cssScanner.js +var TokenType; +(function(TokenType2) { + TokenType2[TokenType2["Ident"] = 0] = "Ident"; + TokenType2[TokenType2["AtKeyword"] = 1] = "AtKeyword"; + TokenType2[TokenType2["String"] = 2] = "String"; + TokenType2[TokenType2["BadString"] = 3] = "BadString"; + TokenType2[TokenType2["UnquotedString"] = 4] = "UnquotedString"; + TokenType2[TokenType2["Hash"] = 5] = "Hash"; + TokenType2[TokenType2["Num"] = 6] = "Num"; + TokenType2[TokenType2["Percentage"] = 7] = "Percentage"; + TokenType2[TokenType2["Dimension"] = 8] = "Dimension"; + TokenType2[TokenType2["UnicodeRange"] = 9] = "UnicodeRange"; + TokenType2[TokenType2["CDO"] = 10] = "CDO"; + TokenType2[TokenType2["CDC"] = 11] = "CDC"; + TokenType2[TokenType2["Colon"] = 12] = "Colon"; + TokenType2[TokenType2["SemiColon"] = 13] = "SemiColon"; + TokenType2[TokenType2["CurlyL"] = 14] = "CurlyL"; + TokenType2[TokenType2["CurlyR"] = 15] = "CurlyR"; + TokenType2[TokenType2["ParenthesisL"] = 16] = "ParenthesisL"; + TokenType2[TokenType2["ParenthesisR"] = 17] = "ParenthesisR"; + TokenType2[TokenType2["BracketL"] = 18] = "BracketL"; + TokenType2[TokenType2["BracketR"] = 19] = "BracketR"; + TokenType2[TokenType2["Whitespace"] = 20] = "Whitespace"; + TokenType2[TokenType2["Includes"] = 21] = "Includes"; + TokenType2[TokenType2["Dashmatch"] = 22] = "Dashmatch"; + TokenType2[TokenType2["SubstringOperator"] = 23] = "SubstringOperator"; + TokenType2[TokenType2["PrefixOperator"] = 24] = "PrefixOperator"; + TokenType2[TokenType2["SuffixOperator"] = 25] = "SuffixOperator"; + TokenType2[TokenType2["Delim"] = 26] = "Delim"; + TokenType2[TokenType2["EMS"] = 27] = "EMS"; + TokenType2[TokenType2["EXS"] = 28] = "EXS"; + TokenType2[TokenType2["Length"] = 29] = "Length"; + TokenType2[TokenType2["Angle"] = 30] = "Angle"; + TokenType2[TokenType2["Time"] = 31] = "Time"; + TokenType2[TokenType2["Freq"] = 32] = "Freq"; + TokenType2[TokenType2["Exclamation"] = 33] = "Exclamation"; + TokenType2[TokenType2["Resolution"] = 34] = "Resolution"; + TokenType2[TokenType2["Comma"] = 35] = "Comma"; + TokenType2[TokenType2["Charset"] = 36] = "Charset"; + TokenType2[TokenType2["EscapedJavaScript"] = 37] = "EscapedJavaScript"; + TokenType2[TokenType2["BadEscapedJavaScript"] = 38] = "BadEscapedJavaScript"; + TokenType2[TokenType2["Comment"] = 39] = "Comment"; + TokenType2[TokenType2["SingleLineComment"] = 40] = "SingleLineComment"; + TokenType2[TokenType2["EOF"] = 41] = "EOF"; + TokenType2[TokenType2["ContainerQueryLength"] = 42] = "ContainerQueryLength"; + TokenType2[TokenType2["CustomToken"] = 43] = "CustomToken"; +})(TokenType || (TokenType = {})); +var MultiLineStream = class { + constructor(source) { + this.source = source; + this.len = source.length; + this.position = 0; + } + substring(from, to = this.position) { + return this.source.substring(from, to); + } + eos() { + return this.len <= this.position; + } + pos() { + return this.position; + } + goBackTo(pos) { + this.position = pos; + } + goBack(n) { + this.position -= n; + } + advance(n) { + this.position += n; + } + nextChar() { + return this.source.charCodeAt(this.position++) || 0; + } + peekChar(n = 0) { + return this.source.charCodeAt(this.position + n) || 0; + } + lookbackChar(n = 0) { + return this.source.charCodeAt(this.position - n) || 0; + } + advanceIfChar(ch) { + if (ch === this.source.charCodeAt(this.position)) { + this.position++; + return true; + } + return false; + } + advanceIfChars(ch) { + if (this.position + ch.length > this.source.length) { + return false; + } + let i = 0; + for (; i < ch.length; i++) { + if (this.source.charCodeAt(this.position + i) !== ch[i]) { + return false; + } + } + this.advance(i); + return true; + } + advanceWhileChar(condition) { + const posNow = this.position; + while (this.position < this.len && condition(this.source.charCodeAt(this.position))) { + this.position++; + } + return this.position - posNow; + } +}; +var _a = "a".charCodeAt(0); +var _f = "f".charCodeAt(0); +var _z = "z".charCodeAt(0); +var _u = "u".charCodeAt(0); +var _A = "A".charCodeAt(0); +var _F = "F".charCodeAt(0); +var _Z = "Z".charCodeAt(0); +var _0 = "0".charCodeAt(0); +var _9 = "9".charCodeAt(0); +var _TLD = "~".charCodeAt(0); +var _HAT = "^".charCodeAt(0); +var _EQS = "=".charCodeAt(0); +var _PIP = "|".charCodeAt(0); +var _MIN = "-".charCodeAt(0); +var _USC = "_".charCodeAt(0); +var _PRC = "%".charCodeAt(0); +var _MUL = "*".charCodeAt(0); +var _LPA = "(".charCodeAt(0); +var _RPA = ")".charCodeAt(0); +var _LAN = "<".charCodeAt(0); +var _RAN = ">".charCodeAt(0); +var _ATS = "@".charCodeAt(0); +var _HSH = "#".charCodeAt(0); +var _DLR = "$".charCodeAt(0); +var _BSL = "\\".charCodeAt(0); +var _FSL = "/".charCodeAt(0); +var _NWL = "\n".charCodeAt(0); +var _CAR = "\r".charCodeAt(0); +var _LFD = "\f".charCodeAt(0); +var _DQO = '"'.charCodeAt(0); +var _SQO = "'".charCodeAt(0); +var _WSP = " ".charCodeAt(0); +var _TAB = " ".charCodeAt(0); +var _SEM = ";".charCodeAt(0); +var _COL = ":".charCodeAt(0); +var _CUL = "{".charCodeAt(0); +var _CUR = "}".charCodeAt(0); +var _BRL = "[".charCodeAt(0); +var _BRR = "]".charCodeAt(0); +var _CMA = ",".charCodeAt(0); +var _DOT = ".".charCodeAt(0); +var _BNG = "!".charCodeAt(0); +var _QSM = "?".charCodeAt(0); +var _PLS = "+".charCodeAt(0); +var staticTokenTable = {}; +staticTokenTable[_SEM] = TokenType.SemiColon; +staticTokenTable[_COL] = TokenType.Colon; +staticTokenTable[_CUL] = TokenType.CurlyL; +staticTokenTable[_CUR] = TokenType.CurlyR; +staticTokenTable[_BRR] = TokenType.BracketR; +staticTokenTable[_BRL] = TokenType.BracketL; +staticTokenTable[_LPA] = TokenType.ParenthesisL; +staticTokenTable[_RPA] = TokenType.ParenthesisR; +staticTokenTable[_CMA] = TokenType.Comma; +var staticUnitTable = {}; +staticUnitTable["em"] = TokenType.EMS; +staticUnitTable["ex"] = TokenType.EXS; +staticUnitTable["px"] = TokenType.Length; +staticUnitTable["cm"] = TokenType.Length; +staticUnitTable["mm"] = TokenType.Length; +staticUnitTable["in"] = TokenType.Length; +staticUnitTable["pt"] = TokenType.Length; +staticUnitTable["pc"] = TokenType.Length; +staticUnitTable["deg"] = TokenType.Angle; +staticUnitTable["rad"] = TokenType.Angle; +staticUnitTable["grad"] = TokenType.Angle; +staticUnitTable["ms"] = TokenType.Time; +staticUnitTable["s"] = TokenType.Time; +staticUnitTable["hz"] = TokenType.Freq; +staticUnitTable["khz"] = TokenType.Freq; +staticUnitTable["%"] = TokenType.Percentage; +staticUnitTable["fr"] = TokenType.Percentage; +staticUnitTable["dpi"] = TokenType.Resolution; +staticUnitTable["dpcm"] = TokenType.Resolution; +staticUnitTable["cqw"] = TokenType.ContainerQueryLength; +staticUnitTable["cqh"] = TokenType.ContainerQueryLength; +staticUnitTable["cqi"] = TokenType.ContainerQueryLength; +staticUnitTable["cqb"] = TokenType.ContainerQueryLength; +staticUnitTable["cqmin"] = TokenType.ContainerQueryLength; +staticUnitTable["cqmax"] = TokenType.ContainerQueryLength; +var Scanner = class { + constructor() { + this.stream = new MultiLineStream(""); + this.ignoreComment = true; + this.ignoreWhitespace = true; + this.inURL = false; + } + setSource(input) { + this.stream = new MultiLineStream(input); + } + finishToken(offset, type, text) { + return { + offset, + len: this.stream.pos() - offset, + type, + text: text || this.stream.substring(offset) + }; + } + substring(offset, len) { + return this.stream.substring(offset, offset + len); + } + pos() { + return this.stream.pos(); + } + goBackTo(pos) { + this.stream.goBackTo(pos); + } + scanUnquotedString() { + const offset = this.stream.pos(); + const content = []; + if (this._unquotedString(content)) { + return this.finishToken(offset, TokenType.UnquotedString, content.join("")); + } + return null; + } + scan() { + const triviaToken = this.trivia(); + if (triviaToken !== null) { + return triviaToken; + } + const offset = this.stream.pos(); + if (this.stream.eos()) { + return this.finishToken(offset, TokenType.EOF); + } + return this.scanNext(offset); + } + /** + * Read the range as described in https://www.w3.org/TR/CSS21/syndata.html#tokenization + * Assume the `u` has aleady been consumed + * @returns if reading the unicode was successful + */ + tryScanUnicode() { + const offset = this.stream.pos(); + if (!this.stream.eos() && this._unicodeRange()) { + return this.finishToken(offset, TokenType.UnicodeRange); + } + this.stream.goBackTo(offset); + return void 0; + } + scanNext(offset) { + if (this.stream.advanceIfChars([_LAN, _BNG, _MIN, _MIN])) { + return this.finishToken(offset, TokenType.CDO); + } + if (this.stream.advanceIfChars([_MIN, _MIN, _RAN])) { + return this.finishToken(offset, TokenType.CDC); + } + let content = []; + if (this.ident(content)) { + return this.finishToken(offset, TokenType.Ident, content.join("")); + } + if (this.stream.advanceIfChar(_ATS)) { + content = ["@"]; + if (this._name(content)) { + const keywordText = content.join(""); + if (keywordText === "@charset") { + return this.finishToken(offset, TokenType.Charset, keywordText); + } + return this.finishToken(offset, TokenType.AtKeyword, keywordText); + } else { + return this.finishToken(offset, TokenType.Delim); + } + } + if (this.stream.advanceIfChar(_HSH)) { + content = ["#"]; + if (this._name(content)) { + return this.finishToken(offset, TokenType.Hash, content.join("")); + } else { + return this.finishToken(offset, TokenType.Delim); + } + } + if (this.stream.advanceIfChar(_BNG)) { + return this.finishToken(offset, TokenType.Exclamation); + } + if (this._number()) { + const pos = this.stream.pos(); + content = [this.stream.substring(offset, pos)]; + if (this.stream.advanceIfChar(_PRC)) { + return this.finishToken(offset, TokenType.Percentage); + } else if (this.ident(content)) { + const dim = this.stream.substring(pos).toLowerCase(); + const tokenType2 = staticUnitTable[dim]; + if (typeof tokenType2 !== "undefined") { + return this.finishToken(offset, tokenType2, content.join("")); + } else { + return this.finishToken(offset, TokenType.Dimension, content.join("")); + } + } + return this.finishToken(offset, TokenType.Num); + } + content = []; + let tokenType = this._string(content); + if (tokenType !== null) { + return this.finishToken(offset, tokenType, content.join("")); + } + tokenType = staticTokenTable[this.stream.peekChar()]; + if (typeof tokenType !== "undefined") { + this.stream.advance(1); + return this.finishToken(offset, tokenType); + } + if (this.stream.peekChar(0) === _TLD && this.stream.peekChar(1) === _EQS) { + this.stream.advance(2); + return this.finishToken(offset, TokenType.Includes); + } + if (this.stream.peekChar(0) === _PIP && this.stream.peekChar(1) === _EQS) { + this.stream.advance(2); + return this.finishToken(offset, TokenType.Dashmatch); + } + if (this.stream.peekChar(0) === _MUL && this.stream.peekChar(1) === _EQS) { + this.stream.advance(2); + return this.finishToken(offset, TokenType.SubstringOperator); + } + if (this.stream.peekChar(0) === _HAT && this.stream.peekChar(1) === _EQS) { + this.stream.advance(2); + return this.finishToken(offset, TokenType.PrefixOperator); + } + if (this.stream.peekChar(0) === _DLR && this.stream.peekChar(1) === _EQS) { + this.stream.advance(2); + return this.finishToken(offset, TokenType.SuffixOperator); + } + this.stream.nextChar(); + return this.finishToken(offset, TokenType.Delim); + } + trivia() { + while (true) { + const offset = this.stream.pos(); + if (this._whitespace()) { + if (!this.ignoreWhitespace) { + return this.finishToken(offset, TokenType.Whitespace); + } + } else if (this.comment()) { + if (!this.ignoreComment) { + return this.finishToken(offset, TokenType.Comment); + } + } else { + return null; + } + } + } + comment() { + if (this.stream.advanceIfChars([_FSL, _MUL])) { + let success = false, hot = false; + this.stream.advanceWhileChar((ch) => { + if (hot && ch === _FSL) { + success = true; + return false; + } + hot = ch === _MUL; + return true; + }); + if (success) { + this.stream.advance(1); + } + return true; + } + return false; + } + _number() { + let npeek = 0; + let hasDot = false; + const peekFirst = this.stream.peekChar(); + if (peekFirst === _PLS || peekFirst === _MIN) { + npeek++; + } + if (this.stream.peekChar(npeek) === _DOT) { + npeek++; + hasDot = true; + } + const ch = this.stream.peekChar(npeek); + if (ch >= _0 && ch <= _9) { + this.stream.advance(npeek + 1); + this.stream.advanceWhileChar((ch2) => { + return ch2 >= _0 && ch2 <= _9 || !hasDot && ch2 === _DOT; + }); + return true; + } + return false; + } + _newline(result) { + const ch = this.stream.peekChar(); + switch (ch) { + case _CAR: + case _LFD: + case _NWL: + this.stream.advance(1); + result.push(String.fromCharCode(ch)); + if (ch === _CAR && this.stream.advanceIfChar(_NWL)) { + result.push("\n"); + } + return true; + } + return false; + } + _escape(result, includeNewLines) { + let ch = this.stream.peekChar(); + if (ch === _BSL) { + this.stream.advance(1); + ch = this.stream.peekChar(); + let hexNumCount = 0; + while (hexNumCount < 6 && (ch >= _0 && ch <= _9 || ch >= _a && ch <= _f || ch >= _A && ch <= _F)) { + this.stream.advance(1); + ch = this.stream.peekChar(); + hexNumCount++; + } + if (hexNumCount > 0) { + try { + const hexVal = parseInt(this.stream.substring(this.stream.pos() - hexNumCount), 16); + if (hexVal) { + result.push(String.fromCharCode(hexVal)); + } + } catch (e) { + } + if (ch === _WSP || ch === _TAB) { + this.stream.advance(1); + } else { + this._newline([]); + } + return true; + } + if (ch !== _CAR && ch !== _LFD && ch !== _NWL) { + this.stream.advance(1); + result.push(String.fromCharCode(ch)); + return true; + } else if (includeNewLines) { + return this._newline(result); + } + } + return false; + } + _stringChar(closeQuote, result) { + const ch = this.stream.peekChar(); + if (ch !== 0 && ch !== closeQuote && ch !== _BSL && ch !== _CAR && ch !== _LFD && ch !== _NWL) { + this.stream.advance(1); + result.push(String.fromCharCode(ch)); + return true; + } + return false; + } + _string(result) { + if (this.stream.peekChar() === _SQO || this.stream.peekChar() === _DQO) { + const closeQuote = this.stream.nextChar(); + result.push(String.fromCharCode(closeQuote)); + while (this._stringChar(closeQuote, result) || this._escape(result, true)) { + } + if (this.stream.peekChar() === closeQuote) { + this.stream.nextChar(); + result.push(String.fromCharCode(closeQuote)); + return TokenType.String; + } else { + return TokenType.BadString; + } + } + return null; + } + _unquotedChar(result) { + const ch = this.stream.peekChar(); + if (ch !== 0 && ch !== _BSL && ch !== _SQO && ch !== _DQO && ch !== _LPA && ch !== _RPA && ch !== _WSP && ch !== _TAB && ch !== _NWL && ch !== _LFD && ch !== _CAR) { + this.stream.advance(1); + result.push(String.fromCharCode(ch)); + return true; + } + return false; + } + _unquotedString(result) { + let hasContent = false; + while (this._unquotedChar(result) || this._escape(result)) { + hasContent = true; + } + return hasContent; + } + _whitespace() { + const n = this.stream.advanceWhileChar((ch) => { + return ch === _WSP || ch === _TAB || ch === _NWL || ch === _LFD || ch === _CAR; + }); + return n > 0; + } + _name(result) { + let matched = false; + while (this._identChar(result) || this._escape(result)) { + matched = true; + } + return matched; + } + ident(result) { + const pos = this.stream.pos(); + const hasMinus = this._minus(result); + if (hasMinus) { + if (this._minus(result) || this._identFirstChar(result) || this._escape(result)) { + while (this._identChar(result) || this._escape(result)) { + } + return true; + } + } else if (this._identFirstChar(result) || this._escape(result)) { + while (this._identChar(result) || this._escape(result)) { + } + return true; + } + this.stream.goBackTo(pos); + return false; + } + _identFirstChar(result) { + const ch = this.stream.peekChar(); + if (ch === _USC || // _ + ch >= _a && ch <= _z || // a-z + ch >= _A && ch <= _Z || // A-Z + ch >= 128 && ch <= 65535) { + this.stream.advance(1); + result.push(String.fromCharCode(ch)); + return true; + } + return false; + } + _minus(result) { + const ch = this.stream.peekChar(); + if (ch === _MIN) { + this.stream.advance(1); + result.push(String.fromCharCode(ch)); + return true; + } + return false; + } + _identChar(result) { + const ch = this.stream.peekChar(); + if (ch === _USC || // _ + ch === _MIN || // - + ch >= _a && ch <= _z || // a-z + ch >= _A && ch <= _Z || // A-Z + ch >= _0 && ch <= _9 || // 0/9 + ch >= 128 && ch <= 65535) { + this.stream.advance(1); + result.push(String.fromCharCode(ch)); + return true; + } + return false; + } + _unicodeRange() { + if (this.stream.advanceIfChar(_PLS)) { + const isHexDigit = (ch) => ch >= _0 && ch <= _9 || ch >= _a && ch <= _f || ch >= _A && ch <= _F; + const codePoints = this.stream.advanceWhileChar(isHexDigit) + this.stream.advanceWhileChar((ch) => ch === _QSM); + if (codePoints >= 1 && codePoints <= 6) { + if (this.stream.advanceIfChar(_MIN)) { + const digits = this.stream.advanceWhileChar(isHexDigit); + if (digits >= 1 && digits <= 6) { + return true; + } + } else { + return true; + } + } + } + return false; + } +}; + +// node_modules/vscode-css-languageservice/lib/esm/utils/strings.js +function startsWith(haystack, needle) { + if (haystack.length < needle.length) { + return false; + } + for (let i = 0; i < needle.length; i++) { + if (haystack[i] !== needle[i]) { + return false; + } + } + return true; +} +function endsWith(haystack, needle) { + let diff = haystack.length - needle.length; + if (diff > 0) { + return haystack.lastIndexOf(needle) === diff; + } else if (diff === 0) { + return haystack === needle; + } else { + return false; + } +} +function difference(first, second, maxLenDelta = 4) { + let lengthDifference = Math.abs(first.length - second.length); + if (lengthDifference > maxLenDelta) { + return 0; + } + let LCS = []; + let zeroArray = []; + let i, j; + for (i = 0; i < second.length + 1; ++i) { + zeroArray.push(0); + } + for (i = 0; i < first.length + 1; ++i) { + LCS.push(zeroArray); + } + for (i = 1; i < first.length + 1; ++i) { + for (j = 1; j < second.length + 1; ++j) { + if (first[i - 1] === second[j - 1]) { + LCS[i][j] = LCS[i - 1][j - 1] + 1; + } else { + LCS[i][j] = Math.max(LCS[i - 1][j], LCS[i][j - 1]); + } + } + } + return LCS[first.length][second.length] - Math.sqrt(lengthDifference); +} +function getLimitedString(str, ellipsis = true) { + if (!str) { + return ""; + } + if (str.length < 140) { + return str; + } + return str.slice(0, 140) + (ellipsis ? "\u2026" : ""); +} +function trim(str, regexp) { + const m = regexp.exec(str); + if (m && m[0].length) { + return str.substr(0, str.length - m[0].length); + } + return str; +} +function repeat(value, count) { + let s = ""; + while (count > 0) { + if ((count & 1) === 1) { + s += value; + } + value += value; + count = count >>> 1; + } + return s; +} +function convertSimple2RegExpPattern(pattern) { + return pattern.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g, "\\$&").replace(/[\*]/g, ".*"); +} + +// node_modules/vscode-css-languageservice/lib/esm/parser/cssNodes.js +var NodeType; +(function(NodeType2) { + NodeType2[NodeType2["Undefined"] = 0] = "Undefined"; + NodeType2[NodeType2["Identifier"] = 1] = "Identifier"; + NodeType2[NodeType2["Stylesheet"] = 2] = "Stylesheet"; + NodeType2[NodeType2["Ruleset"] = 3] = "Ruleset"; + NodeType2[NodeType2["Selector"] = 4] = "Selector"; + NodeType2[NodeType2["SimpleSelector"] = 5] = "SimpleSelector"; + NodeType2[NodeType2["SelectorInterpolation"] = 6] = "SelectorInterpolation"; + NodeType2[NodeType2["SelectorCombinator"] = 7] = "SelectorCombinator"; + NodeType2[NodeType2["SelectorCombinatorParent"] = 8] = "SelectorCombinatorParent"; + NodeType2[NodeType2["SelectorCombinatorSibling"] = 9] = "SelectorCombinatorSibling"; + NodeType2[NodeType2["SelectorCombinatorAllSiblings"] = 10] = "SelectorCombinatorAllSiblings"; + NodeType2[NodeType2["SelectorCombinatorShadowPiercingDescendant"] = 11] = "SelectorCombinatorShadowPiercingDescendant"; + NodeType2[NodeType2["Page"] = 12] = "Page"; + NodeType2[NodeType2["PageBoxMarginBox"] = 13] = "PageBoxMarginBox"; + NodeType2[NodeType2["ClassSelector"] = 14] = "ClassSelector"; + NodeType2[NodeType2["IdentifierSelector"] = 15] = "IdentifierSelector"; + NodeType2[NodeType2["ElementNameSelector"] = 16] = "ElementNameSelector"; + NodeType2[NodeType2["PseudoSelector"] = 17] = "PseudoSelector"; + NodeType2[NodeType2["AttributeSelector"] = 18] = "AttributeSelector"; + NodeType2[NodeType2["Declaration"] = 19] = "Declaration"; + NodeType2[NodeType2["Declarations"] = 20] = "Declarations"; + NodeType2[NodeType2["Property"] = 21] = "Property"; + NodeType2[NodeType2["Expression"] = 22] = "Expression"; + NodeType2[NodeType2["BinaryExpression"] = 23] = "BinaryExpression"; + NodeType2[NodeType2["Term"] = 24] = "Term"; + NodeType2[NodeType2["Operator"] = 25] = "Operator"; + NodeType2[NodeType2["Value"] = 26] = "Value"; + NodeType2[NodeType2["StringLiteral"] = 27] = "StringLiteral"; + NodeType2[NodeType2["URILiteral"] = 28] = "URILiteral"; + NodeType2[NodeType2["EscapedValue"] = 29] = "EscapedValue"; + NodeType2[NodeType2["Function"] = 30] = "Function"; + NodeType2[NodeType2["NumericValue"] = 31] = "NumericValue"; + NodeType2[NodeType2["HexColorValue"] = 32] = "HexColorValue"; + NodeType2[NodeType2["RatioValue"] = 33] = "RatioValue"; + NodeType2[NodeType2["MixinDeclaration"] = 34] = "MixinDeclaration"; + NodeType2[NodeType2["MixinReference"] = 35] = "MixinReference"; + NodeType2[NodeType2["VariableName"] = 36] = "VariableName"; + NodeType2[NodeType2["VariableDeclaration"] = 37] = "VariableDeclaration"; + NodeType2[NodeType2["Prio"] = 38] = "Prio"; + NodeType2[NodeType2["Interpolation"] = 39] = "Interpolation"; + NodeType2[NodeType2["NestedProperties"] = 40] = "NestedProperties"; + NodeType2[NodeType2["ExtendsReference"] = 41] = "ExtendsReference"; + NodeType2[NodeType2["SelectorPlaceholder"] = 42] = "SelectorPlaceholder"; + NodeType2[NodeType2["Debug"] = 43] = "Debug"; + NodeType2[NodeType2["If"] = 44] = "If"; + NodeType2[NodeType2["Else"] = 45] = "Else"; + NodeType2[NodeType2["For"] = 46] = "For"; + NodeType2[NodeType2["Each"] = 47] = "Each"; + NodeType2[NodeType2["While"] = 48] = "While"; + NodeType2[NodeType2["MixinContentReference"] = 49] = "MixinContentReference"; + NodeType2[NodeType2["MixinContentDeclaration"] = 50] = "MixinContentDeclaration"; + NodeType2[NodeType2["Media"] = 51] = "Media"; + NodeType2[NodeType2["Scope"] = 52] = "Scope"; + NodeType2[NodeType2["Keyframe"] = 53] = "Keyframe"; + NodeType2[NodeType2["FontFace"] = 54] = "FontFace"; + NodeType2[NodeType2["Import"] = 55] = "Import"; + NodeType2[NodeType2["Namespace"] = 56] = "Namespace"; + NodeType2[NodeType2["Invocation"] = 57] = "Invocation"; + NodeType2[NodeType2["FunctionDeclaration"] = 58] = "FunctionDeclaration"; + NodeType2[NodeType2["ReturnStatement"] = 59] = "ReturnStatement"; + NodeType2[NodeType2["MediaQuery"] = 60] = "MediaQuery"; + NodeType2[NodeType2["MediaCondition"] = 61] = "MediaCondition"; + NodeType2[NodeType2["MediaFeature"] = 62] = "MediaFeature"; + NodeType2[NodeType2["FunctionParameter"] = 63] = "FunctionParameter"; + NodeType2[NodeType2["FunctionArgument"] = 64] = "FunctionArgument"; + NodeType2[NodeType2["KeyframeSelector"] = 65] = "KeyframeSelector"; + NodeType2[NodeType2["ViewPort"] = 66] = "ViewPort"; + NodeType2[NodeType2["Document"] = 67] = "Document"; + NodeType2[NodeType2["AtApplyRule"] = 68] = "AtApplyRule"; + NodeType2[NodeType2["CustomPropertyDeclaration"] = 69] = "CustomPropertyDeclaration"; + NodeType2[NodeType2["CustomPropertySet"] = 70] = "CustomPropertySet"; + NodeType2[NodeType2["ListEntry"] = 71] = "ListEntry"; + NodeType2[NodeType2["Supports"] = 72] = "Supports"; + NodeType2[NodeType2["SupportsCondition"] = 73] = "SupportsCondition"; + NodeType2[NodeType2["NamespacePrefix"] = 74] = "NamespacePrefix"; + NodeType2[NodeType2["GridLine"] = 75] = "GridLine"; + NodeType2[NodeType2["Plugin"] = 76] = "Plugin"; + NodeType2[NodeType2["UnknownAtRule"] = 77] = "UnknownAtRule"; + NodeType2[NodeType2["Use"] = 78] = "Use"; + NodeType2[NodeType2["ModuleConfiguration"] = 79] = "ModuleConfiguration"; + NodeType2[NodeType2["Forward"] = 80] = "Forward"; + NodeType2[NodeType2["ForwardVisibility"] = 81] = "ForwardVisibility"; + NodeType2[NodeType2["Module"] = 82] = "Module"; + NodeType2[NodeType2["UnicodeRange"] = 83] = "UnicodeRange"; + NodeType2[NodeType2["Layer"] = 84] = "Layer"; + NodeType2[NodeType2["LayerNameList"] = 85] = "LayerNameList"; + NodeType2[NodeType2["LayerName"] = 86] = "LayerName"; + NodeType2[NodeType2["PropertyAtRule"] = 87] = "PropertyAtRule"; + NodeType2[NodeType2["Container"] = 88] = "Container"; + NodeType2[NodeType2["ModuleConfig"] = 89] = "ModuleConfig"; + NodeType2[NodeType2["SelectorList"] = 90] = "SelectorList"; + NodeType2[NodeType2["StartingStyleAtRule"] = 91] = "StartingStyleAtRule"; +})(NodeType || (NodeType = {})); +var ReferenceType; +(function(ReferenceType2) { + ReferenceType2[ReferenceType2["Mixin"] = 0] = "Mixin"; + ReferenceType2[ReferenceType2["Rule"] = 1] = "Rule"; + ReferenceType2[ReferenceType2["Variable"] = 2] = "Variable"; + ReferenceType2[ReferenceType2["Function"] = 3] = "Function"; + ReferenceType2[ReferenceType2["Keyframe"] = 4] = "Keyframe"; + ReferenceType2[ReferenceType2["Unknown"] = 5] = "Unknown"; + ReferenceType2[ReferenceType2["Module"] = 6] = "Module"; + ReferenceType2[ReferenceType2["Forward"] = 7] = "Forward"; + ReferenceType2[ReferenceType2["ForwardVisibility"] = 8] = "ForwardVisibility"; + ReferenceType2[ReferenceType2["Property"] = 9] = "Property"; +})(ReferenceType || (ReferenceType = {})); +function getNodeAtOffset(node, offset) { + let candidate = null; + if (!node || offset < node.offset || offset > node.end) { + return null; + } + node.accept((node2) => { + if (node2.offset === -1 && node2.length === -1) { + return true; + } + if (node2.offset <= offset && node2.end >= offset) { + if (!candidate) { + candidate = node2; + } else if (node2.length <= candidate.length) { + candidate = node2; + } + return true; + } + return false; + }); + return candidate; +} +function getNodePath(node, offset) { + let candidate = getNodeAtOffset(node, offset); + const path = []; + while (candidate) { + path.unshift(candidate); + candidate = candidate.parent; + } + return path; +} +function getParentDeclaration(node) { + const decl = node.findParent(NodeType.Declaration); + const value = decl && decl.getValue(); + if (value && value.encloses(node)) { + return decl; + } + return null; +} +var Node = class { + get end() { + return this.offset + this.length; + } + constructor(offset = -1, len = -1, nodeType) { + this.parent = null; + this.offset = offset; + this.length = len; + if (nodeType) { + this.nodeType = nodeType; + } + } + set type(type) { + this.nodeType = type; + } + get type() { + return this.nodeType || NodeType.Undefined; + } + getTextProvider() { + let node = this; + while (node && !node.textProvider) { + node = node.parent; + } + if (node) { + return node.textProvider; + } + return () => { + return "unknown"; + }; + } + getText() { + return this.getTextProvider()(this.offset, this.length); + } + matches(str) { + return this.length === str.length && this.getTextProvider()(this.offset, this.length) === str; + } + startsWith(str) { + return this.length >= str.length && this.getTextProvider()(this.offset, str.length) === str; + } + endsWith(str) { + return this.length >= str.length && this.getTextProvider()(this.end - str.length, str.length) === str; + } + accept(visitor) { + if (visitor(this) && this.children) { + for (const child of this.children) { + child.accept(visitor); + } + } + } + acceptVisitor(visitor) { + this.accept(visitor.visitNode.bind(visitor)); + } + adoptChild(node, index = -1) { + if (node.parent && node.parent.children) { + const idx = node.parent.children.indexOf(node); + if (idx >= 0) { + node.parent.children.splice(idx, 1); + } + } + node.parent = this; + let children = this.children; + if (!children) { + children = this.children = []; + } + if (index !== -1) { + children.splice(index, 0, node); + } else { + children.push(node); + } + return node; + } + attachTo(parent, index = -1) { + if (parent) { + parent.adoptChild(this, index); + } + return this; + } + collectIssues(results) { + if (this.issues) { + results.push.apply(results, this.issues); + } + } + addIssue(issue) { + if (!this.issues) { + this.issues = []; + } + this.issues.push(issue); + } + hasIssue(rule) { + return Array.isArray(this.issues) && this.issues.some((i) => i.getRule() === rule); + } + isErroneous(recursive = false) { + if (this.issues && this.issues.length > 0) { + return true; + } + return recursive && Array.isArray(this.children) && this.children.some((c) => c.isErroneous(true)); + } + setNode(field, node, index = -1) { + if (node) { + node.attachTo(this, index); + this[field] = node; + return true; + } + return false; + } + addChild(node) { + if (node) { + if (!this.children) { + this.children = []; + } + node.attachTo(this); + this.updateOffsetAndLength(node); + return true; + } + return false; + } + updateOffsetAndLength(node) { + if (node.offset < this.offset || this.offset === -1) { + this.offset = node.offset; + } + const nodeEnd = node.end; + if (nodeEnd > this.end || this.length === -1) { + this.length = nodeEnd - this.offset; + } + } + hasChildren() { + return !!this.children && this.children.length > 0; + } + getChildren() { + return this.children ? this.children.slice(0) : []; + } + getChild(index) { + if (this.children && index < this.children.length) { + return this.children[index]; + } + return null; + } + addChildren(nodes) { + for (const node of nodes) { + this.addChild(node); + } + } + findFirstChildBeforeOffset(offset) { + if (this.children) { + let current = null; + for (let i = this.children.length - 1; i >= 0; i--) { + current = this.children[i]; + if (current.offset <= offset) { + return current; + } + } + } + return null; + } + findChildAtOffset(offset, goDeep) { + const current = this.findFirstChildBeforeOffset(offset); + if (current && current.end >= offset) { + if (goDeep) { + return current.findChildAtOffset(offset, true) || current; + } + return current; + } + return null; + } + encloses(candidate) { + return this.offset <= candidate.offset && this.offset + this.length >= candidate.offset + candidate.length; + } + getParent() { + let result = this.parent; + while (result instanceof Nodelist) { + result = result.parent; + } + return result; + } + findParent(type) { + let result = this; + while (result && result.type !== type) { + result = result.parent; + } + return result; + } + findAParent(...types) { + let result = this; + while (result && !types.some((t2) => result.type === t2)) { + result = result.parent; + } + return result; + } + setData(key, value) { + if (!this.options) { + this.options = {}; + } + this.options[key] = value; + } + getData(key) { + if (!this.options || !this.options.hasOwnProperty(key)) { + return null; + } + return this.options[key]; + } +}; +var Nodelist = class extends Node { + constructor(parent, index = -1) { + super(-1, -1); + this.attachTo(parent, index); + this.offset = -1; + this.length = -1; + } +}; +var UnicodeRange = class extends Node { + constructor(offset, length) { + super(offset, length); + } + get type() { + return NodeType.UnicodeRange; + } + setRangeStart(rangeStart) { + return this.setNode("rangeStart", rangeStart); + } + getRangeStart() { + return this.rangeStart; + } + setRangeEnd(rangeEnd) { + return this.setNode("rangeEnd", rangeEnd); + } + getRangeEnd() { + return this.rangeEnd; + } +}; +var Identifier = class extends Node { + constructor(offset, length) { + super(offset, length); + this.isCustomProperty = false; + } + get type() { + return NodeType.Identifier; + } + containsInterpolation() { + return this.hasChildren(); + } +}; +var Stylesheet = class extends Node { + constructor(offset, length) { + super(offset, length); + } + get type() { + return NodeType.Stylesheet; + } +}; +var Declarations = class extends Node { + constructor(offset, length) { + super(offset, length); + } + get type() { + return NodeType.Declarations; + } +}; +var BodyDeclaration = class extends Node { + constructor(offset, length) { + super(offset, length); + } + getDeclarations() { + return this.declarations; + } + setDeclarations(decls) { + return this.setNode("declarations", decls); + } +}; +var RuleSet = class extends BodyDeclaration { + constructor(offset, length) { + super(offset, length); + } + get type() { + return NodeType.Ruleset; + } + getSelectors() { + if (!this.selectors) { + this.selectors = new Nodelist(this); + } + return this.selectors; + } + isNested() { + return !!this.parent && this.parent.findParent(NodeType.Declarations) !== null; + } +}; +var Selector = class extends Node { + constructor(offset, length) { + super(offset, length); + } + get type() { + return NodeType.Selector; + } +}; +var SimpleSelector = class extends Node { + constructor(offset, length) { + super(offset, length); + } + get type() { + return NodeType.SimpleSelector; + } +}; +var AbstractDeclaration = class extends Node { + constructor(offset, length) { + super(offset, length); + } +}; +var CustomPropertySet = class extends BodyDeclaration { + constructor(offset, length) { + super(offset, length); + } + get type() { + return NodeType.CustomPropertySet; + } +}; +var Declaration = class _Declaration extends AbstractDeclaration { + constructor(offset, length) { + super(offset, length); + this.property = null; + } + get type() { + return NodeType.Declaration; + } + setProperty(node) { + return this.setNode("property", node); + } + getProperty() { + return this.property; + } + getFullPropertyName() { + const propertyName = this.property ? this.property.getName() : "unknown"; + if (this.parent instanceof Declarations && this.parent.getParent() instanceof NestedProperties) { + const parentDecl = this.parent.getParent().getParent(); + if (parentDecl instanceof _Declaration) { + return parentDecl.getFullPropertyName() + propertyName; + } + } + return propertyName; + } + getNonPrefixedPropertyName() { + const propertyName = this.getFullPropertyName(); + if (propertyName && propertyName.charAt(0) === "-") { + const vendorPrefixEnd = propertyName.indexOf("-", 1); + if (vendorPrefixEnd !== -1) { + return propertyName.substring(vendorPrefixEnd + 1); + } + } + return propertyName; + } + setValue(value) { + return this.setNode("value", value); + } + getValue() { + return this.value; + } + setNestedProperties(value) { + return this.setNode("nestedProperties", value); + } + getNestedProperties() { + return this.nestedProperties; + } +}; +var CustomPropertyDeclaration = class extends Declaration { + constructor(offset, length) { + super(offset, length); + } + get type() { + return NodeType.CustomPropertyDeclaration; + } + setPropertySet(value) { + return this.setNode("propertySet", value); + } + getPropertySet() { + return this.propertySet; + } +}; +var Property = class extends Node { + constructor(offset, length) { + super(offset, length); + } + get type() { + return NodeType.Property; + } + setIdentifier(value) { + return this.setNode("identifier", value); + } + getIdentifier() { + return this.identifier; + } + getName() { + return trim(this.getText(), /[_\+]+$/); + } + isCustomProperty() { + return !!this.identifier && this.identifier.isCustomProperty; + } +}; +var Invocation = class extends Node { + constructor(offset, length) { + super(offset, length); + } + get type() { + return NodeType.Invocation; + } + getArguments() { + if (!this.arguments) { + this.arguments = new Nodelist(this); + } + return this.arguments; + } +}; +var Function = class extends Invocation { + constructor(offset, length) { + super(offset, length); + } + get type() { + return NodeType.Function; + } + setIdentifier(node) { + return this.setNode("identifier", node, 0); + } + getIdentifier() { + return this.identifier; + } + getName() { + return this.identifier ? this.identifier.getText() : ""; + } +}; +var FunctionParameter = class extends Node { + constructor(offset, length) { + super(offset, length); + } + get type() { + return NodeType.FunctionParameter; + } + setIdentifier(node) { + return this.setNode("identifier", node, 0); + } + getIdentifier() { + return this.identifier; + } + getName() { + return this.identifier ? this.identifier.getText() : ""; + } + setDefaultValue(node) { + return this.setNode("defaultValue", node, 0); + } + getDefaultValue() { + return this.defaultValue; + } +}; +var FunctionArgument = class extends Node { + constructor(offset, length) { + super(offset, length); + } + get type() { + return NodeType.FunctionArgument; + } + setIdentifier(node) { + return this.setNode("identifier", node, 0); + } + getIdentifier() { + return this.identifier; + } + getName() { + return this.identifier ? this.identifier.getText() : ""; + } + setValue(node) { + return this.setNode("value", node, 0); + } + getValue() { + return this.value; + } +}; +var IfStatement = class extends BodyDeclaration { + constructor(offset, length) { + super(offset, length); + } + get type() { + return NodeType.If; + } + setExpression(node) { + return this.setNode("expression", node, 0); + } + setElseClause(elseClause) { + return this.setNode("elseClause", elseClause); + } +}; +var ForStatement = class extends BodyDeclaration { + constructor(offset, length) { + super(offset, length); + } + get type() { + return NodeType.For; + } + setVariable(node) { + return this.setNode("variable", node, 0); + } +}; +var EachStatement = class extends BodyDeclaration { + constructor(offset, length) { + super(offset, length); + } + get type() { + return NodeType.Each; + } + getVariables() { + if (!this.variables) { + this.variables = new Nodelist(this); + } + return this.variables; + } +}; +var WhileStatement = class extends BodyDeclaration { + constructor(offset, length) { + super(offset, length); + } + get type() { + return NodeType.While; + } +}; +var ElseStatement = class extends BodyDeclaration { + constructor(offset, length) { + super(offset, length); + } + get type() { + return NodeType.Else; + } +}; +var FunctionDeclaration = class extends BodyDeclaration { + constructor(offset, length) { + super(offset, length); + } + get type() { + return NodeType.FunctionDeclaration; + } + setIdentifier(node) { + return this.setNode("identifier", node, 0); + } + getIdentifier() { + return this.identifier; + } + getName() { + return this.identifier ? this.identifier.getText() : ""; + } + getParameters() { + if (!this.parameters) { + this.parameters = new Nodelist(this); + } + return this.parameters; + } +}; +var ViewPort = class extends BodyDeclaration { + constructor(offset, length) { + super(offset, length); + } + get type() { + return NodeType.ViewPort; + } +}; +var FontFace = class extends BodyDeclaration { + constructor(offset, length) { + super(offset, length); + } + get type() { + return NodeType.FontFace; + } +}; +var NestedProperties = class extends BodyDeclaration { + constructor(offset, length) { + super(offset, length); + } + get type() { + return NodeType.NestedProperties; + } +}; +var Keyframe = class extends BodyDeclaration { + constructor(offset, length) { + super(offset, length); + } + get type() { + return NodeType.Keyframe; + } + setKeyword(keyword) { + return this.setNode("keyword", keyword, 0); + } + getKeyword() { + return this.keyword; + } + setIdentifier(node) { + return this.setNode("identifier", node, 0); + } + getIdentifier() { + return this.identifier; + } + getName() { + return this.identifier ? this.identifier.getText() : ""; + } +}; +var KeyframeSelector = class extends BodyDeclaration { + constructor(offset, length) { + super(offset, length); + } + get type() { + return NodeType.KeyframeSelector; + } +}; +var Import = class extends Node { + constructor(offset, length) { + super(offset, length); + } + get type() { + return NodeType.Import; + } + setMedialist(node) { + if (node) { + node.attachTo(this); + return true; + } + return false; + } +}; +var Use = class extends Node { + get type() { + return NodeType.Use; + } + setParameters(value) { + return this.setNode("parameters", value); + } + getParameters() { + return this.parameters; + } + setIdentifier(node) { + return this.setNode("identifier", node, 0); + } + getIdentifier() { + return this.identifier; + } +}; +var ModuleConfiguration = class extends Node { + get type() { + return NodeType.ModuleConfiguration; + } + setIdentifier(node) { + return this.setNode("identifier", node, 0); + } + getIdentifier() { + return this.identifier; + } + getName() { + return this.identifier ? this.identifier.getText() : ""; + } + setValue(node) { + return this.setNode("value", node, 0); + } + getValue() { + return this.value; + } +}; +var Forward = class extends Node { + get type() { + return NodeType.Forward; + } + setIdentifier(node) { + return this.setNode("identifier", node, 0); + } + getIdentifier() { + return this.identifier; + } + setParameters(value) { + return this.setNode("parameters", value); + } + getParameters() { + return this.parameters; + } +}; +var ForwardVisibility = class extends Node { + get type() { + return NodeType.ForwardVisibility; + } + setIdentifier(node) { + return this.setNode("identifier", node, 0); + } + getIdentifier() { + return this.identifier; + } +}; +var Namespace = class extends Node { + constructor(offset, length) { + super(offset, length); + } + get type() { + return NodeType.Namespace; + } +}; +var Media = class extends BodyDeclaration { + constructor(offset, length) { + super(offset, length); + } + get type() { + return NodeType.Media; + } +}; +var Scope = class extends BodyDeclaration { + constructor(offset, length) { + super(offset, length); + } + get type() { + return NodeType.Scope; + } +}; +var ScopeLimits = class extends Node { + constructor(offset, length) { + super(offset, length); + } + get type() { + return NodeType.Scope; + } + getScopeStart() { + return this.scopeStart; + } + setScopeStart(right) { + return this.setNode("scopeStart", right); + } + getScopeEnd() { + return this.scopeEnd; + } + setScopeEnd(right) { + return this.setNode("scopeEnd", right); + } + getName() { + let name = ""; + if (this.scopeStart) { + name += this.scopeStart.getText(); + } + if (this.scopeEnd) { + name += `${this.scopeStart ? " " : ""}\u2192 ${this.scopeEnd.getText()}`; + } + return name; + } +}; +var Supports = class extends BodyDeclaration { + constructor(offset, length) { + super(offset, length); + } + get type() { + return NodeType.Supports; + } +}; +var Layer = class extends BodyDeclaration { + constructor(offset, length) { + super(offset, length); + } + get type() { + return NodeType.Layer; + } + setNames(names) { + return this.setNode("names", names); + } + getNames() { + return this.names; + } +}; +var PropertyAtRule = class extends BodyDeclaration { + constructor(offset, length) { + super(offset, length); + } + get type() { + return NodeType.PropertyAtRule; + } + setName(node) { + if (node) { + node.attachTo(this); + this.name = node; + return true; + } + return false; + } + getName() { + return this.name; + } +}; +var StartingStyleAtRule = class extends BodyDeclaration { + constructor(offset, length) { + super(offset, length); + } + get type() { + return NodeType.StartingStyleAtRule; + } +}; +var Document = class extends BodyDeclaration { + constructor(offset, length) { + super(offset, length); + } + get type() { + return NodeType.Document; + } +}; +var Container = class extends BodyDeclaration { + constructor(offset, length) { + super(offset, length); + } + get type() { + return NodeType.Container; + } +}; +var Medialist = class extends Node { + constructor(offset, length) { + super(offset, length); + } +}; +var MediaQuery = class extends Node { + constructor(offset, length) { + super(offset, length); + } + get type() { + return NodeType.MediaQuery; + } +}; +var MediaCondition = class extends Node { + constructor(offset, length) { + super(offset, length); + } + get type() { + return NodeType.MediaCondition; + } +}; +var MediaFeature = class extends Node { + constructor(offset, length) { + super(offset, length); + } + get type() { + return NodeType.MediaFeature; + } +}; +var SupportsCondition = class extends Node { + constructor(offset, length) { + super(offset, length); + } + get type() { + return NodeType.SupportsCondition; + } +}; +var Page = class extends BodyDeclaration { + constructor(offset, length) { + super(offset, length); + } + get type() { + return NodeType.Page; + } +}; +var PageBoxMarginBox = class extends BodyDeclaration { + constructor(offset, length) { + super(offset, length); + } + get type() { + return NodeType.PageBoxMarginBox; + } +}; +var Expression = class extends Node { + constructor(offset, length) { + super(offset, length); + } + get type() { + return NodeType.Expression; + } +}; +var BinaryExpression = class extends Node { + constructor(offset, length) { + super(offset, length); + } + get type() { + return NodeType.BinaryExpression; + } + setLeft(left) { + return this.setNode("left", left); + } + getLeft() { + return this.left; + } + setRight(right) { + return this.setNode("right", right); + } + getRight() { + return this.right; + } + setOperator(value) { + return this.setNode("operator", value); + } + getOperator() { + return this.operator; + } +}; +var Term = class extends Node { + constructor(offset, length) { + super(offset, length); + } + get type() { + return NodeType.Term; + } + setOperator(value) { + return this.setNode("operator", value); + } + getOperator() { + return this.operator; + } + setExpression(value) { + return this.setNode("expression", value); + } + getExpression() { + return this.expression; + } +}; +var AttributeSelector = class extends Node { + constructor(offset, length) { + super(offset, length); + } + get type() { + return NodeType.AttributeSelector; + } + setNamespacePrefix(value) { + return this.setNode("namespacePrefix", value); + } + getNamespacePrefix() { + return this.namespacePrefix; + } + setIdentifier(value) { + return this.setNode("identifier", value); + } + getIdentifier() { + return this.identifier; + } + setOperator(operator) { + return this.setNode("operator", operator); + } + getOperator() { + return this.operator; + } + setValue(value) { + return this.setNode("value", value); + } + getValue() { + return this.value; + } +}; +var HexColorValue = class extends Node { + constructor(offset, length) { + super(offset, length); + } + get type() { + return NodeType.HexColorValue; + } +}; +var RatioValue = class extends Node { + constructor(offset, length) { + super(offset, length); + } + get type() { + return NodeType.RatioValue; + } +}; +var _dot = ".".charCodeAt(0); +var _02 = "0".charCodeAt(0); +var _92 = "9".charCodeAt(0); +var NumericValue = class extends Node { + constructor(offset, length) { + super(offset, length); + } + get type() { + return NodeType.NumericValue; + } + getValue() { + const raw = this.getText(); + let unitIdx = 0; + let code; + for (let i = 0, len = raw.length; i < len; i++) { + code = raw.charCodeAt(i); + if (!(_02 <= code && code <= _92 || code === _dot)) { + break; + } + unitIdx += 1; + } + return { + value: raw.substring(0, unitIdx), + unit: unitIdx < raw.length ? raw.substring(unitIdx) : void 0 + }; + } +}; +var VariableDeclaration = class extends AbstractDeclaration { + constructor(offset, length) { + super(offset, length); + this.needsSemicolon = true; + } + get type() { + return NodeType.VariableDeclaration; + } + setVariable(node) { + if (node) { + node.attachTo(this); + this.variable = node; + return true; + } + return false; + } + getVariable() { + return this.variable; + } + getName() { + return this.variable ? this.variable.getName() : ""; + } + setValue(node) { + if (node) { + node.attachTo(this); + this.value = node; + return true; + } + return false; + } + getValue() { + return this.value; + } +}; +var Interpolation = class extends Node { + // private _interpolations: void; // workaround for https://github.com/Microsoft/TypeScript/issues/18276 + constructor(offset, length) { + super(offset, length); + } + get type() { + return NodeType.Interpolation; + } +}; +var Variable = class extends Node { + constructor(offset, length) { + super(offset, length); + } + get type() { + return NodeType.VariableName; + } + getName() { + return this.getText(); + } +}; +var ExtendsReference = class extends Node { + constructor(offset, length) { + super(offset, length); + } + get type() { + return NodeType.ExtendsReference; + } + getSelectors() { + if (!this.selectors) { + this.selectors = new Nodelist(this); + } + return this.selectors; + } +}; +var MixinContentReference = class extends Node { + constructor(offset, length) { + super(offset, length); + } + get type() { + return NodeType.MixinContentReference; + } + getArguments() { + if (!this.arguments) { + this.arguments = new Nodelist(this); + } + return this.arguments; + } +}; +var MixinContentDeclaration = class extends BodyDeclaration { + constructor(offset, length) { + super(offset, length); + } + get type() { + return NodeType.MixinContentDeclaration; + } + getParameters() { + if (!this.parameters) { + this.parameters = new Nodelist(this); + } + return this.parameters; + } +}; +var MixinReference = class extends Node { + constructor(offset, length) { + super(offset, length); + } + get type() { + return NodeType.MixinReference; + } + getNamespaces() { + if (!this.namespaces) { + this.namespaces = new Nodelist(this); + } + return this.namespaces; + } + setIdentifier(node) { + return this.setNode("identifier", node, 0); + } + getIdentifier() { + return this.identifier; + } + getName() { + return this.identifier ? this.identifier.getText() : ""; + } + getArguments() { + if (!this.arguments) { + this.arguments = new Nodelist(this); + } + return this.arguments; + } + setContent(node) { + return this.setNode("content", node); + } + getContent() { + return this.content; + } +}; +var MixinDeclaration = class extends BodyDeclaration { + constructor(offset, length) { + super(offset, length); + } + get type() { + return NodeType.MixinDeclaration; + } + setIdentifier(node) { + return this.setNode("identifier", node, 0); + } + getIdentifier() { + return this.identifier; + } + getName() { + return this.identifier ? this.identifier.getText() : ""; + } + getParameters() { + if (!this.parameters) { + this.parameters = new Nodelist(this); + } + return this.parameters; + } + setGuard(node) { + if (node) { + node.attachTo(this); + this.guard = node; + } + return false; + } +}; +var UnknownAtRule = class extends BodyDeclaration { + constructor(offset, length) { + super(offset, length); + } + get type() { + return NodeType.UnknownAtRule; + } + setAtRuleName(atRuleName) { + this.atRuleName = atRuleName; + } + getAtRuleName() { + return this.atRuleName; + } +}; +var ListEntry = class extends Node { + get type() { + return NodeType.ListEntry; + } + setKey(node) { + return this.setNode("key", node, 0); + } + setValue(node) { + return this.setNode("value", node, 1); + } +}; +var LessGuard = class extends Node { + getConditions() { + if (!this.conditions) { + this.conditions = new Nodelist(this); + } + return this.conditions; + } +}; +var GuardCondition = class extends Node { + setVariable(node) { + return this.setNode("variable", node); + } +}; +var Module = class extends Node { + get type() { + return NodeType.Module; + } + setIdentifier(node) { + return this.setNode("identifier", node, 0); + } + getIdentifier() { + return this.identifier; + } +}; +var Level; +(function(Level2) { + Level2[Level2["Ignore"] = 1] = "Ignore"; + Level2[Level2["Warning"] = 2] = "Warning"; + Level2[Level2["Error"] = 4] = "Error"; +})(Level || (Level = {})); +var Marker = class { + constructor(node, rule, level, message, offset = node.offset, length = node.length) { + this.node = node; + this.rule = rule; + this.level = level; + this.message = message || rule.message; + this.offset = offset; + this.length = length; + } + getRule() { + return this.rule; + } + getLevel() { + return this.level; + } + getOffset() { + return this.offset; + } + getLength() { + return this.length; + } + getNode() { + return this.node; + } + getMessage() { + return this.message; + } +}; +var ParseErrorCollector = class _ParseErrorCollector { + static entries(node) { + const visitor = new _ParseErrorCollector(); + node.acceptVisitor(visitor); + return visitor.entries; + } + constructor() { + this.entries = []; + } + visitNode(node) { + if (node.isErroneous()) { + node.collectIssues(this.entries); + } + return true; + } +}; + +// node_modules/@vscode/l10n/dist/browser.js +var bundle; +function t(...args) { + const firstArg = args[0]; + let key; + let message; + let formatArgs; + if (typeof firstArg === "string") { + key = firstArg; + message = firstArg; + args.splice(0, 1); + formatArgs = !args || typeof args[0] !== "object" ? args : args[0]; + } else if (firstArg instanceof Array) { + const replacements = args.slice(1); + if (firstArg.length !== replacements.length + 1) { + throw new Error("expected a string as the first argument to l10n.t"); + } + let str = firstArg[0]; + for (let i = 1; i < firstArg.length; i++) { + str += `{${i - 1}}` + firstArg[i]; + } + return t(str, ...replacements); + } else { + message = firstArg.message; + key = message; + if (firstArg.comment && firstArg.comment.length > 0) { + key += `/${Array.isArray(firstArg.comment) ? firstArg.comment.join("") : firstArg.comment}`; + } + formatArgs = firstArg.args ?? {}; + } + const messageFromBundle = bundle?.[key]; + if (!messageFromBundle) { + return format(message, formatArgs); + } + if (typeof messageFromBundle === "string") { + return format(messageFromBundle, formatArgs); + } + if (messageFromBundle.comment) { + return format(messageFromBundle.message, formatArgs); + } + return format(message, formatArgs); +} +var _format2Regexp = /{([^}]+)}/g; +function format(template, values2) { + if (Object.keys(values2).length === 0) { + return template; + } + return template.replace(_format2Regexp, (match, group) => values2[group] ?? match); +} + +// node_modules/vscode-css-languageservice/lib/esm/parser/cssErrors.js +var CSSIssueType = class { + constructor(id, message) { + this.id = id; + this.message = message; + } +}; +var ParseError = { + NumberExpected: new CSSIssueType("css-numberexpected", t("number expected")), + ConditionExpected: new CSSIssueType("css-conditionexpected", t("condition expected")), + RuleOrSelectorExpected: new CSSIssueType("css-ruleorselectorexpected", t("at-rule or selector expected")), + DotExpected: new CSSIssueType("css-dotexpected", t("dot expected")), + ColonExpected: new CSSIssueType("css-colonexpected", t("colon expected")), + SemiColonExpected: new CSSIssueType("css-semicolonexpected", t("semi-colon expected")), + TermExpected: new CSSIssueType("css-termexpected", t("term expected")), + ExpressionExpected: new CSSIssueType("css-expressionexpected", t("expression expected")), + OperatorExpected: new CSSIssueType("css-operatorexpected", t("operator expected")), + IdentifierExpected: new CSSIssueType("css-identifierexpected", t("identifier expected")), + PercentageExpected: new CSSIssueType("css-percentageexpected", t("percentage expected")), + URIOrStringExpected: new CSSIssueType("css-uriorstringexpected", t("uri or string expected")), + URIExpected: new CSSIssueType("css-uriexpected", t("URI expected")), + VariableNameExpected: new CSSIssueType("css-varnameexpected", t("variable name expected")), + VariableValueExpected: new CSSIssueType("css-varvalueexpected", t("variable value expected")), + PropertyValueExpected: new CSSIssueType("css-propertyvalueexpected", t("property value expected")), + LeftCurlyExpected: new CSSIssueType("css-lcurlyexpected", t("{ expected")), + RightCurlyExpected: new CSSIssueType("css-rcurlyexpected", t("} expected")), + LeftSquareBracketExpected: new CSSIssueType("css-rbracketexpected", t("[ expected")), + RightSquareBracketExpected: new CSSIssueType("css-lbracketexpected", t("] expected")), + LeftParenthesisExpected: new CSSIssueType("css-lparentexpected", t("( expected")), + RightParenthesisExpected: new CSSIssueType("css-rparentexpected", t(") expected")), + CommaExpected: new CSSIssueType("css-commaexpected", t("comma expected")), + PageDirectiveOrDeclarationExpected: new CSSIssueType("css-pagedirordeclexpected", t("page directive or declaraton expected")), + UnknownAtRule: new CSSIssueType("css-unknownatrule", t("at-rule unknown")), + UnknownKeyword: new CSSIssueType("css-unknownkeyword", t("unknown keyword")), + SelectorExpected: new CSSIssueType("css-selectorexpected", t("selector expected")), + StringLiteralExpected: new CSSIssueType("css-stringliteralexpected", t("string literal expected")), + WhitespaceExpected: new CSSIssueType("css-whitespaceexpected", t("whitespace expected")), + MediaQueryExpected: new CSSIssueType("css-mediaqueryexpected", t("media query expected")), + IdentifierOrWildcardExpected: new CSSIssueType("css-idorwildcardexpected", t("identifier or wildcard expected")), + WildcardExpected: new CSSIssueType("css-wildcardexpected", t("wildcard expected")), + IdentifierOrVariableExpected: new CSSIssueType("css-idorvarexpected", t("identifier or variable expected")), + IfConditionExpected: new CSSIssueType("css-ifconditionexpected", t("if condition expected")) +}; + +// node_modules/vscode-languageserver-types/lib/esm/main.js +var DocumentUri; +(function(DocumentUri2) { + function is(value) { + return typeof value === "string"; + } + DocumentUri2.is = is; +})(DocumentUri || (DocumentUri = {})); +var URI; +(function(URI3) { + function is(value) { + return typeof value === "string"; + } + URI3.is = is; +})(URI || (URI = {})); +var integer; +(function(integer2) { + integer2.MIN_VALUE = -2147483648; + integer2.MAX_VALUE = 2147483647; + function is(value) { + return typeof value === "number" && integer2.MIN_VALUE <= value && value <= integer2.MAX_VALUE; + } + integer2.is = is; +})(integer || (integer = {})); +var uinteger; +(function(uinteger2) { + uinteger2.MIN_VALUE = 0; + uinteger2.MAX_VALUE = 2147483647; + function is(value) { + return typeof value === "number" && uinteger2.MIN_VALUE <= value && value <= uinteger2.MAX_VALUE; + } + uinteger2.is = is; +})(uinteger || (uinteger = {})); +var Position; +(function(Position2) { + function create(line, character) { + if (line === Number.MAX_VALUE) { + line = uinteger.MAX_VALUE; + } + if (character === Number.MAX_VALUE) { + character = uinteger.MAX_VALUE; + } + return { line, character }; + } + Position2.create = create; + function is(value) { + let candidate = value; + return Is.objectLiteral(candidate) && Is.uinteger(candidate.line) && Is.uinteger(candidate.character); + } + Position2.is = is; +})(Position || (Position = {})); +var Range; +(function(Range2) { + function create(one, two, three, four) { + if (Is.uinteger(one) && Is.uinteger(two) && Is.uinteger(three) && Is.uinteger(four)) { + return { start: Position.create(one, two), end: Position.create(three, four) }; + } else if (Position.is(one) && Position.is(two)) { + return { start: one, end: two }; + } else { + throw new Error(`Range#create called with invalid arguments[${one}, ${two}, ${three}, ${four}]`); + } + } + Range2.create = create; + function is(value) { + let candidate = value; + return Is.objectLiteral(candidate) && Position.is(candidate.start) && Position.is(candidate.end); + } + Range2.is = is; +})(Range || (Range = {})); +var Location; +(function(Location2) { + function create(uri, range) { + return { uri, range }; + } + Location2.create = create; + function is(value) { + let candidate = value; + return Is.objectLiteral(candidate) && Range.is(candidate.range) && (Is.string(candidate.uri) || Is.undefined(candidate.uri)); + } + Location2.is = is; +})(Location || (Location = {})); +var LocationLink; +(function(LocationLink2) { + function create(targetUri, targetRange, targetSelectionRange, originSelectionRange) { + return { targetUri, targetRange, targetSelectionRange, originSelectionRange }; + } + LocationLink2.create = create; + function is(value) { + let candidate = value; + return Is.objectLiteral(candidate) && Range.is(candidate.targetRange) && Is.string(candidate.targetUri) && Range.is(candidate.targetSelectionRange) && (Range.is(candidate.originSelectionRange) || Is.undefined(candidate.originSelectionRange)); + } + LocationLink2.is = is; +})(LocationLink || (LocationLink = {})); +var Color; +(function(Color2) { + function create(red, green, blue, alpha) { + return { + red, + green, + blue, + alpha + }; + } + Color2.create = create; + function is(value) { + const candidate = value; + return Is.objectLiteral(candidate) && Is.numberRange(candidate.red, 0, 1) && Is.numberRange(candidate.green, 0, 1) && Is.numberRange(candidate.blue, 0, 1) && Is.numberRange(candidate.alpha, 0, 1); + } + Color2.is = is; +})(Color || (Color = {})); +var ColorInformation; +(function(ColorInformation2) { + function create(range, color) { + return { + range, + color + }; + } + ColorInformation2.create = create; + function is(value) { + const candidate = value; + return Is.objectLiteral(candidate) && Range.is(candidate.range) && Color.is(candidate.color); + } + ColorInformation2.is = is; +})(ColorInformation || (ColorInformation = {})); +var ColorPresentation; +(function(ColorPresentation2) { + function create(label, textEdit, additionalTextEdits) { + return { + label, + textEdit, + additionalTextEdits + }; + } + ColorPresentation2.create = create; + function is(value) { + const candidate = value; + return Is.objectLiteral(candidate) && Is.string(candidate.label) && (Is.undefined(candidate.textEdit) || TextEdit.is(candidate)) && (Is.undefined(candidate.additionalTextEdits) || Is.typedArray(candidate.additionalTextEdits, TextEdit.is)); + } + ColorPresentation2.is = is; +})(ColorPresentation || (ColorPresentation = {})); +var FoldingRangeKind; +(function(FoldingRangeKind2) { + FoldingRangeKind2.Comment = "comment"; + FoldingRangeKind2.Imports = "imports"; + FoldingRangeKind2.Region = "region"; +})(FoldingRangeKind || (FoldingRangeKind = {})); +var FoldingRange; +(function(FoldingRange2) { + function create(startLine, endLine, startCharacter, endCharacter, kind, collapsedText) { + const result = { + startLine, + endLine + }; + if (Is.defined(startCharacter)) { + result.startCharacter = startCharacter; + } + if (Is.defined(endCharacter)) { + result.endCharacter = endCharacter; + } + if (Is.defined(kind)) { + result.kind = kind; + } + if (Is.defined(collapsedText)) { + result.collapsedText = collapsedText; + } + return result; + } + FoldingRange2.create = create; + function is(value) { + const candidate = value; + return Is.objectLiteral(candidate) && Is.uinteger(candidate.startLine) && Is.uinteger(candidate.startLine) && (Is.undefined(candidate.startCharacter) || Is.uinteger(candidate.startCharacter)) && (Is.undefined(candidate.endCharacter) || Is.uinteger(candidate.endCharacter)) && (Is.undefined(candidate.kind) || Is.string(candidate.kind)); + } + FoldingRange2.is = is; +})(FoldingRange || (FoldingRange = {})); +var DiagnosticRelatedInformation; +(function(DiagnosticRelatedInformation2) { + function create(location, message) { + return { + location, + message + }; + } + DiagnosticRelatedInformation2.create = create; + function is(value) { + let candidate = value; + return Is.defined(candidate) && Location.is(candidate.location) && Is.string(candidate.message); + } + DiagnosticRelatedInformation2.is = is; +})(DiagnosticRelatedInformation || (DiagnosticRelatedInformation = {})); +var DiagnosticSeverity; +(function(DiagnosticSeverity2) { + DiagnosticSeverity2.Error = 1; + DiagnosticSeverity2.Warning = 2; + DiagnosticSeverity2.Information = 3; + DiagnosticSeverity2.Hint = 4; +})(DiagnosticSeverity || (DiagnosticSeverity = {})); +var DiagnosticTag; +(function(DiagnosticTag2) { + DiagnosticTag2.Unnecessary = 1; + DiagnosticTag2.Deprecated = 2; +})(DiagnosticTag || (DiagnosticTag = {})); +var CodeDescription; +(function(CodeDescription2) { + function is(value) { + const candidate = value; + return Is.objectLiteral(candidate) && Is.string(candidate.href); + } + CodeDescription2.is = is; +})(CodeDescription || (CodeDescription = {})); +var Diagnostic; +(function(Diagnostic2) { + function create(range, message, severity, code, source, relatedInformation) { + let result = { range, message }; + if (Is.defined(severity)) { + result.severity = severity; + } + if (Is.defined(code)) { + result.code = code; + } + if (Is.defined(source)) { + result.source = source; + } + if (Is.defined(relatedInformation)) { + result.relatedInformation = relatedInformation; + } + return result; + } + Diagnostic2.create = create; + function is(value) { + var _a2; + let candidate = value; + return Is.defined(candidate) && Range.is(candidate.range) && Is.string(candidate.message) && (Is.number(candidate.severity) || Is.undefined(candidate.severity)) && (Is.integer(candidate.code) || Is.string(candidate.code) || Is.undefined(candidate.code)) && (Is.undefined(candidate.codeDescription) || Is.string((_a2 = candidate.codeDescription) === null || _a2 === void 0 ? void 0 : _a2.href)) && (Is.string(candidate.source) || Is.undefined(candidate.source)) && (Is.undefined(candidate.relatedInformation) || Is.typedArray(candidate.relatedInformation, DiagnosticRelatedInformation.is)); + } + Diagnostic2.is = is; +})(Diagnostic || (Diagnostic = {})); +var Command; +(function(Command2) { + function create(title, command, ...args) { + let result = { title, command }; + if (Is.defined(args) && args.length > 0) { + result.arguments = args; + } + return result; + } + Command2.create = create; + function is(value) { + let candidate = value; + return Is.defined(candidate) && Is.string(candidate.title) && Is.string(candidate.command); + } + Command2.is = is; +})(Command || (Command = {})); +var TextEdit; +(function(TextEdit2) { + function replace(range, newText) { + return { range, newText }; + } + TextEdit2.replace = replace; + function insert(position, newText) { + return { range: { start: position, end: position }, newText }; + } + TextEdit2.insert = insert; + function del(range) { + return { range, newText: "" }; + } + TextEdit2.del = del; + function is(value) { + const candidate = value; + return Is.objectLiteral(candidate) && Is.string(candidate.newText) && Range.is(candidate.range); + } + TextEdit2.is = is; +})(TextEdit || (TextEdit = {})); +var ChangeAnnotation; +(function(ChangeAnnotation2) { + function create(label, needsConfirmation, description) { + const result = { label }; + if (needsConfirmation !== void 0) { + result.needsConfirmation = needsConfirmation; + } + if (description !== void 0) { + result.description = description; + } + return result; + } + ChangeAnnotation2.create = create; + function is(value) { + const candidate = value; + return Is.objectLiteral(candidate) && Is.string(candidate.label) && (Is.boolean(candidate.needsConfirmation) || candidate.needsConfirmation === void 0) && (Is.string(candidate.description) || candidate.description === void 0); + } + ChangeAnnotation2.is = is; +})(ChangeAnnotation || (ChangeAnnotation = {})); +var ChangeAnnotationIdentifier; +(function(ChangeAnnotationIdentifier2) { + function is(value) { + const candidate = value; + return Is.string(candidate); + } + ChangeAnnotationIdentifier2.is = is; +})(ChangeAnnotationIdentifier || (ChangeAnnotationIdentifier = {})); +var AnnotatedTextEdit; +(function(AnnotatedTextEdit2) { + function replace(range, newText, annotation) { + return { range, newText, annotationId: annotation }; + } + AnnotatedTextEdit2.replace = replace; + function insert(position, newText, annotation) { + return { range: { start: position, end: position }, newText, annotationId: annotation }; + } + AnnotatedTextEdit2.insert = insert; + function del(range, annotation) { + return { range, newText: "", annotationId: annotation }; + } + AnnotatedTextEdit2.del = del; + function is(value) { + const candidate = value; + return TextEdit.is(candidate) && (ChangeAnnotation.is(candidate.annotationId) || ChangeAnnotationIdentifier.is(candidate.annotationId)); + } + AnnotatedTextEdit2.is = is; +})(AnnotatedTextEdit || (AnnotatedTextEdit = {})); +var TextDocumentEdit; +(function(TextDocumentEdit2) { + function create(textDocument, edits) { + return { textDocument, edits }; + } + TextDocumentEdit2.create = create; + function is(value) { + let candidate = value; + return Is.defined(candidate) && OptionalVersionedTextDocumentIdentifier.is(candidate.textDocument) && Array.isArray(candidate.edits); + } + TextDocumentEdit2.is = is; +})(TextDocumentEdit || (TextDocumentEdit = {})); +var CreateFile; +(function(CreateFile2) { + function create(uri, options, annotation) { + let result = { + kind: "create", + uri + }; + if (options !== void 0 && (options.overwrite !== void 0 || options.ignoreIfExists !== void 0)) { + result.options = options; + } + if (annotation !== void 0) { + result.annotationId = annotation; + } + return result; + } + CreateFile2.create = create; + function is(value) { + let candidate = value; + return candidate && candidate.kind === "create" && Is.string(candidate.uri) && (candidate.options === void 0 || (candidate.options.overwrite === void 0 || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === void 0 || Is.boolean(candidate.options.ignoreIfExists))) && (candidate.annotationId === void 0 || ChangeAnnotationIdentifier.is(candidate.annotationId)); + } + CreateFile2.is = is; +})(CreateFile || (CreateFile = {})); +var RenameFile; +(function(RenameFile2) { + function create(oldUri, newUri, options, annotation) { + let result = { + kind: "rename", + oldUri, + newUri + }; + if (options !== void 0 && (options.overwrite !== void 0 || options.ignoreIfExists !== void 0)) { + result.options = options; + } + if (annotation !== void 0) { + result.annotationId = annotation; + } + return result; + } + RenameFile2.create = create; + function is(value) { + let candidate = value; + return candidate && candidate.kind === "rename" && Is.string(candidate.oldUri) && Is.string(candidate.newUri) && (candidate.options === void 0 || (candidate.options.overwrite === void 0 || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === void 0 || Is.boolean(candidate.options.ignoreIfExists))) && (candidate.annotationId === void 0 || ChangeAnnotationIdentifier.is(candidate.annotationId)); + } + RenameFile2.is = is; +})(RenameFile || (RenameFile = {})); +var DeleteFile; +(function(DeleteFile2) { + function create(uri, options, annotation) { + let result = { + kind: "delete", + uri + }; + if (options !== void 0 && (options.recursive !== void 0 || options.ignoreIfNotExists !== void 0)) { + result.options = options; + } + if (annotation !== void 0) { + result.annotationId = annotation; + } + return result; + } + DeleteFile2.create = create; + function is(value) { + let candidate = value; + return candidate && candidate.kind === "delete" && Is.string(candidate.uri) && (candidate.options === void 0 || (candidate.options.recursive === void 0 || Is.boolean(candidate.options.recursive)) && (candidate.options.ignoreIfNotExists === void 0 || Is.boolean(candidate.options.ignoreIfNotExists))) && (candidate.annotationId === void 0 || ChangeAnnotationIdentifier.is(candidate.annotationId)); + } + DeleteFile2.is = is; +})(DeleteFile || (DeleteFile = {})); +var WorkspaceEdit; +(function(WorkspaceEdit2) { + function is(value) { + let candidate = value; + return candidate && (candidate.changes !== void 0 || candidate.documentChanges !== void 0) && (candidate.documentChanges === void 0 || candidate.documentChanges.every((change) => { + if (Is.string(change.kind)) { + return CreateFile.is(change) || RenameFile.is(change) || DeleteFile.is(change); + } else { + return TextDocumentEdit.is(change); + } + })); + } + WorkspaceEdit2.is = is; +})(WorkspaceEdit || (WorkspaceEdit = {})); +var TextDocumentIdentifier; +(function(TextDocumentIdentifier2) { + function create(uri) { + return { uri }; + } + TextDocumentIdentifier2.create = create; + function is(value) { + let candidate = value; + return Is.defined(candidate) && Is.string(candidate.uri); + } + TextDocumentIdentifier2.is = is; +})(TextDocumentIdentifier || (TextDocumentIdentifier = {})); +var VersionedTextDocumentIdentifier; +(function(VersionedTextDocumentIdentifier2) { + function create(uri, version) { + return { uri, version }; + } + VersionedTextDocumentIdentifier2.create = create; + function is(value) { + let candidate = value; + return Is.defined(candidate) && Is.string(candidate.uri) && Is.integer(candidate.version); + } + VersionedTextDocumentIdentifier2.is = is; +})(VersionedTextDocumentIdentifier || (VersionedTextDocumentIdentifier = {})); +var OptionalVersionedTextDocumentIdentifier; +(function(OptionalVersionedTextDocumentIdentifier2) { + function create(uri, version) { + return { uri, version }; + } + OptionalVersionedTextDocumentIdentifier2.create = create; + function is(value) { + let candidate = value; + return Is.defined(candidate) && Is.string(candidate.uri) && (candidate.version === null || Is.integer(candidate.version)); + } + OptionalVersionedTextDocumentIdentifier2.is = is; +})(OptionalVersionedTextDocumentIdentifier || (OptionalVersionedTextDocumentIdentifier = {})); +var TextDocumentItem; +(function(TextDocumentItem2) { + function create(uri, languageId, version, text) { + return { uri, languageId, version, text }; + } + TextDocumentItem2.create = create; + function is(value) { + let candidate = value; + return Is.defined(candidate) && Is.string(candidate.uri) && Is.string(candidate.languageId) && Is.integer(candidate.version) && Is.string(candidate.text); + } + TextDocumentItem2.is = is; +})(TextDocumentItem || (TextDocumentItem = {})); +var MarkupKind; +(function(MarkupKind2) { + MarkupKind2.PlainText = "plaintext"; + MarkupKind2.Markdown = "markdown"; + function is(value) { + const candidate = value; + return candidate === MarkupKind2.PlainText || candidate === MarkupKind2.Markdown; + } + MarkupKind2.is = is; +})(MarkupKind || (MarkupKind = {})); +var MarkupContent; +(function(MarkupContent2) { + function is(value) { + const candidate = value; + return Is.objectLiteral(value) && MarkupKind.is(candidate.kind) && Is.string(candidate.value); + } + MarkupContent2.is = is; +})(MarkupContent || (MarkupContent = {})); +var CompletionItemKind; +(function(CompletionItemKind2) { + CompletionItemKind2.Text = 1; + CompletionItemKind2.Method = 2; + CompletionItemKind2.Function = 3; + CompletionItemKind2.Constructor = 4; + CompletionItemKind2.Field = 5; + CompletionItemKind2.Variable = 6; + CompletionItemKind2.Class = 7; + CompletionItemKind2.Interface = 8; + CompletionItemKind2.Module = 9; + CompletionItemKind2.Property = 10; + CompletionItemKind2.Unit = 11; + CompletionItemKind2.Value = 12; + CompletionItemKind2.Enum = 13; + CompletionItemKind2.Keyword = 14; + CompletionItemKind2.Snippet = 15; + CompletionItemKind2.Color = 16; + CompletionItemKind2.File = 17; + CompletionItemKind2.Reference = 18; + CompletionItemKind2.Folder = 19; + CompletionItemKind2.EnumMember = 20; + CompletionItemKind2.Constant = 21; + CompletionItemKind2.Struct = 22; + CompletionItemKind2.Event = 23; + CompletionItemKind2.Operator = 24; + CompletionItemKind2.TypeParameter = 25; +})(CompletionItemKind || (CompletionItemKind = {})); +var InsertTextFormat; +(function(InsertTextFormat2) { + InsertTextFormat2.PlainText = 1; + InsertTextFormat2.Snippet = 2; +})(InsertTextFormat || (InsertTextFormat = {})); +var CompletionItemTag; +(function(CompletionItemTag2) { + CompletionItemTag2.Deprecated = 1; +})(CompletionItemTag || (CompletionItemTag = {})); +var InsertReplaceEdit; +(function(InsertReplaceEdit2) { + function create(newText, insert, replace) { + return { newText, insert, replace }; + } + InsertReplaceEdit2.create = create; + function is(value) { + const candidate = value; + return candidate && Is.string(candidate.newText) && Range.is(candidate.insert) && Range.is(candidate.replace); + } + InsertReplaceEdit2.is = is; +})(InsertReplaceEdit || (InsertReplaceEdit = {})); +var InsertTextMode; +(function(InsertTextMode2) { + InsertTextMode2.asIs = 1; + InsertTextMode2.adjustIndentation = 2; +})(InsertTextMode || (InsertTextMode = {})); +var CompletionItemLabelDetails; +(function(CompletionItemLabelDetails2) { + function is(value) { + const candidate = value; + return candidate && (Is.string(candidate.detail) || candidate.detail === void 0) && (Is.string(candidate.description) || candidate.description === void 0); + } + CompletionItemLabelDetails2.is = is; +})(CompletionItemLabelDetails || (CompletionItemLabelDetails = {})); +var CompletionItem; +(function(CompletionItem2) { + function create(label) { + return { label }; + } + CompletionItem2.create = create; +})(CompletionItem || (CompletionItem = {})); +var CompletionList; +(function(CompletionList2) { + function create(items, isIncomplete) { + return { items: items ? items : [], isIncomplete: !!isIncomplete }; + } + CompletionList2.create = create; +})(CompletionList || (CompletionList = {})); +var MarkedString; +(function(MarkedString2) { + function fromPlainText(plainText) { + return plainText.replace(/[\\`*_{}[\]()#+\-.!]/g, "\\$&"); + } + MarkedString2.fromPlainText = fromPlainText; + function is(value) { + const candidate = value; + return Is.string(candidate) || Is.objectLiteral(candidate) && Is.string(candidate.language) && Is.string(candidate.value); + } + MarkedString2.is = is; +})(MarkedString || (MarkedString = {})); +var Hover; +(function(Hover2) { + function is(value) { + let candidate = value; + return !!candidate && Is.objectLiteral(candidate) && (MarkupContent.is(candidate.contents) || MarkedString.is(candidate.contents) || Is.typedArray(candidate.contents, MarkedString.is)) && (value.range === void 0 || Range.is(value.range)); + } + Hover2.is = is; +})(Hover || (Hover = {})); +var ParameterInformation; +(function(ParameterInformation2) { + function create(label, documentation) { + return documentation ? { label, documentation } : { label }; + } + ParameterInformation2.create = create; +})(ParameterInformation || (ParameterInformation = {})); +var SignatureInformation; +(function(SignatureInformation2) { + function create(label, documentation, ...parameters) { + let result = { label }; + if (Is.defined(documentation)) { + result.documentation = documentation; + } + if (Is.defined(parameters)) { + result.parameters = parameters; + } else { + result.parameters = []; + } + return result; + } + SignatureInformation2.create = create; +})(SignatureInformation || (SignatureInformation = {})); +var DocumentHighlightKind; +(function(DocumentHighlightKind2) { + DocumentHighlightKind2.Text = 1; + DocumentHighlightKind2.Read = 2; + DocumentHighlightKind2.Write = 3; +})(DocumentHighlightKind || (DocumentHighlightKind = {})); +var DocumentHighlight; +(function(DocumentHighlight2) { + function create(range, kind) { + let result = { range }; + if (Is.number(kind)) { + result.kind = kind; + } + return result; + } + DocumentHighlight2.create = create; +})(DocumentHighlight || (DocumentHighlight = {})); +var SymbolKind; +(function(SymbolKind2) { + SymbolKind2.File = 1; + SymbolKind2.Module = 2; + SymbolKind2.Namespace = 3; + SymbolKind2.Package = 4; + SymbolKind2.Class = 5; + SymbolKind2.Method = 6; + SymbolKind2.Property = 7; + SymbolKind2.Field = 8; + SymbolKind2.Constructor = 9; + SymbolKind2.Enum = 10; + SymbolKind2.Interface = 11; + SymbolKind2.Function = 12; + SymbolKind2.Variable = 13; + SymbolKind2.Constant = 14; + SymbolKind2.String = 15; + SymbolKind2.Number = 16; + SymbolKind2.Boolean = 17; + SymbolKind2.Array = 18; + SymbolKind2.Object = 19; + SymbolKind2.Key = 20; + SymbolKind2.Null = 21; + SymbolKind2.EnumMember = 22; + SymbolKind2.Struct = 23; + SymbolKind2.Event = 24; + SymbolKind2.Operator = 25; + SymbolKind2.TypeParameter = 26; +})(SymbolKind || (SymbolKind = {})); +var SymbolTag; +(function(SymbolTag2) { + SymbolTag2.Deprecated = 1; +})(SymbolTag || (SymbolTag = {})); +var SymbolInformation; +(function(SymbolInformation2) { + function create(name, kind, range, uri, containerName) { + let result = { + name, + kind, + location: { uri, range } + }; + if (containerName) { + result.containerName = containerName; + } + return result; + } + SymbolInformation2.create = create; +})(SymbolInformation || (SymbolInformation = {})); +var WorkspaceSymbol; +(function(WorkspaceSymbol2) { + function create(name, kind, uri, range) { + return range !== void 0 ? { name, kind, location: { uri, range } } : { name, kind, location: { uri } }; + } + WorkspaceSymbol2.create = create; +})(WorkspaceSymbol || (WorkspaceSymbol = {})); +var DocumentSymbol; +(function(DocumentSymbol2) { + function create(name, detail, kind, range, selectionRange, children) { + let result = { + name, + detail, + kind, + range, + selectionRange + }; + if (children !== void 0) { + result.children = children; + } + return result; + } + DocumentSymbol2.create = create; + function is(value) { + let candidate = value; + return candidate && Is.string(candidate.name) && Is.number(candidate.kind) && Range.is(candidate.range) && Range.is(candidate.selectionRange) && (candidate.detail === void 0 || Is.string(candidate.detail)) && (candidate.deprecated === void 0 || Is.boolean(candidate.deprecated)) && (candidate.children === void 0 || Array.isArray(candidate.children)) && (candidate.tags === void 0 || Array.isArray(candidate.tags)); + } + DocumentSymbol2.is = is; +})(DocumentSymbol || (DocumentSymbol = {})); +var CodeActionKind; +(function(CodeActionKind2) { + CodeActionKind2.Empty = ""; + CodeActionKind2.QuickFix = "quickfix"; + CodeActionKind2.Refactor = "refactor"; + CodeActionKind2.RefactorExtract = "refactor.extract"; + CodeActionKind2.RefactorInline = "refactor.inline"; + CodeActionKind2.RefactorRewrite = "refactor.rewrite"; + CodeActionKind2.Source = "source"; + CodeActionKind2.SourceOrganizeImports = "source.organizeImports"; + CodeActionKind2.SourceFixAll = "source.fixAll"; +})(CodeActionKind || (CodeActionKind = {})); +var CodeActionTriggerKind; +(function(CodeActionTriggerKind2) { + CodeActionTriggerKind2.Invoked = 1; + CodeActionTriggerKind2.Automatic = 2; +})(CodeActionTriggerKind || (CodeActionTriggerKind = {})); +var CodeActionContext; +(function(CodeActionContext2) { + function create(diagnostics, only, triggerKind) { + let result = { diagnostics }; + if (only !== void 0 && only !== null) { + result.only = only; + } + if (triggerKind !== void 0 && triggerKind !== null) { + result.triggerKind = triggerKind; + } + return result; + } + CodeActionContext2.create = create; + function is(value) { + let candidate = value; + return Is.defined(candidate) && Is.typedArray(candidate.diagnostics, Diagnostic.is) && (candidate.only === void 0 || Is.typedArray(candidate.only, Is.string)) && (candidate.triggerKind === void 0 || candidate.triggerKind === CodeActionTriggerKind.Invoked || candidate.triggerKind === CodeActionTriggerKind.Automatic); + } + CodeActionContext2.is = is; +})(CodeActionContext || (CodeActionContext = {})); +var CodeAction; +(function(CodeAction2) { + function create(title, kindOrCommandOrEdit, kind) { + let result = { title }; + let checkKind = true; + if (typeof kindOrCommandOrEdit === "string") { + checkKind = false; + result.kind = kindOrCommandOrEdit; + } else if (Command.is(kindOrCommandOrEdit)) { + result.command = kindOrCommandOrEdit; + } else { + result.edit = kindOrCommandOrEdit; + } + if (checkKind && kind !== void 0) { + result.kind = kind; + } + return result; + } + CodeAction2.create = create; + function is(value) { + let candidate = value; + return candidate && Is.string(candidate.title) && (candidate.diagnostics === void 0 || Is.typedArray(candidate.diagnostics, Diagnostic.is)) && (candidate.kind === void 0 || Is.string(candidate.kind)) && (candidate.edit !== void 0 || candidate.command !== void 0) && (candidate.command === void 0 || Command.is(candidate.command)) && (candidate.isPreferred === void 0 || Is.boolean(candidate.isPreferred)) && (candidate.edit === void 0 || WorkspaceEdit.is(candidate.edit)); + } + CodeAction2.is = is; +})(CodeAction || (CodeAction = {})); +var CodeLens; +(function(CodeLens2) { + function create(range, data) { + let result = { range }; + if (Is.defined(data)) { + result.data = data; + } + return result; + } + CodeLens2.create = create; + function is(value) { + let candidate = value; + return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.command) || Command.is(candidate.command)); + } + CodeLens2.is = is; +})(CodeLens || (CodeLens = {})); +var FormattingOptions; +(function(FormattingOptions2) { + function create(tabSize, insertSpaces) { + return { tabSize, insertSpaces }; + } + FormattingOptions2.create = create; + function is(value) { + let candidate = value; + return Is.defined(candidate) && Is.uinteger(candidate.tabSize) && Is.boolean(candidate.insertSpaces); + } + FormattingOptions2.is = is; +})(FormattingOptions || (FormattingOptions = {})); +var DocumentLink; +(function(DocumentLink2) { + function create(range, target, data) { + return { range, target, data }; + } + DocumentLink2.create = create; + function is(value) { + let candidate = value; + return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.target) || Is.string(candidate.target)); + } + DocumentLink2.is = is; +})(DocumentLink || (DocumentLink = {})); +var SelectionRange; +(function(SelectionRange2) { + function create(range, parent) { + return { range, parent }; + } + SelectionRange2.create = create; + function is(value) { + let candidate = value; + return Is.objectLiteral(candidate) && Range.is(candidate.range) && (candidate.parent === void 0 || SelectionRange2.is(candidate.parent)); + } + SelectionRange2.is = is; +})(SelectionRange || (SelectionRange = {})); +var SemanticTokenTypes; +(function(SemanticTokenTypes2) { + SemanticTokenTypes2["namespace"] = "namespace"; + SemanticTokenTypes2["type"] = "type"; + SemanticTokenTypes2["class"] = "class"; + SemanticTokenTypes2["enum"] = "enum"; + SemanticTokenTypes2["interface"] = "interface"; + SemanticTokenTypes2["struct"] = "struct"; + SemanticTokenTypes2["typeParameter"] = "typeParameter"; + SemanticTokenTypes2["parameter"] = "parameter"; + SemanticTokenTypes2["variable"] = "variable"; + SemanticTokenTypes2["property"] = "property"; + SemanticTokenTypes2["enumMember"] = "enumMember"; + SemanticTokenTypes2["event"] = "event"; + SemanticTokenTypes2["function"] = "function"; + SemanticTokenTypes2["method"] = "method"; + SemanticTokenTypes2["macro"] = "macro"; + SemanticTokenTypes2["keyword"] = "keyword"; + SemanticTokenTypes2["modifier"] = "modifier"; + SemanticTokenTypes2["comment"] = "comment"; + SemanticTokenTypes2["string"] = "string"; + SemanticTokenTypes2["number"] = "number"; + SemanticTokenTypes2["regexp"] = "regexp"; + SemanticTokenTypes2["operator"] = "operator"; + SemanticTokenTypes2["decorator"] = "decorator"; +})(SemanticTokenTypes || (SemanticTokenTypes = {})); +var SemanticTokenModifiers; +(function(SemanticTokenModifiers2) { + SemanticTokenModifiers2["declaration"] = "declaration"; + SemanticTokenModifiers2["definition"] = "definition"; + SemanticTokenModifiers2["readonly"] = "readonly"; + SemanticTokenModifiers2["static"] = "static"; + SemanticTokenModifiers2["deprecated"] = "deprecated"; + SemanticTokenModifiers2["abstract"] = "abstract"; + SemanticTokenModifiers2["async"] = "async"; + SemanticTokenModifiers2["modification"] = "modification"; + SemanticTokenModifiers2["documentation"] = "documentation"; + SemanticTokenModifiers2["defaultLibrary"] = "defaultLibrary"; +})(SemanticTokenModifiers || (SemanticTokenModifiers = {})); +var SemanticTokens; +(function(SemanticTokens2) { + function is(value) { + const candidate = value; + return Is.objectLiteral(candidate) && (candidate.resultId === void 0 || typeof candidate.resultId === "string") && Array.isArray(candidate.data) && (candidate.data.length === 0 || typeof candidate.data[0] === "number"); + } + SemanticTokens2.is = is; +})(SemanticTokens || (SemanticTokens = {})); +var InlineValueText; +(function(InlineValueText2) { + function create(range, text) { + return { range, text }; + } + InlineValueText2.create = create; + function is(value) { + const candidate = value; + return candidate !== void 0 && candidate !== null && Range.is(candidate.range) && Is.string(candidate.text); + } + InlineValueText2.is = is; +})(InlineValueText || (InlineValueText = {})); +var InlineValueVariableLookup; +(function(InlineValueVariableLookup2) { + function create(range, variableName, caseSensitiveLookup) { + return { range, variableName, caseSensitiveLookup }; + } + InlineValueVariableLookup2.create = create; + function is(value) { + const candidate = value; + return candidate !== void 0 && candidate !== null && Range.is(candidate.range) && Is.boolean(candidate.caseSensitiveLookup) && (Is.string(candidate.variableName) || candidate.variableName === void 0); + } + InlineValueVariableLookup2.is = is; +})(InlineValueVariableLookup || (InlineValueVariableLookup = {})); +var InlineValueEvaluatableExpression; +(function(InlineValueEvaluatableExpression2) { + function create(range, expression) { + return { range, expression }; + } + InlineValueEvaluatableExpression2.create = create; + function is(value) { + const candidate = value; + return candidate !== void 0 && candidate !== null && Range.is(candidate.range) && (Is.string(candidate.expression) || candidate.expression === void 0); + } + InlineValueEvaluatableExpression2.is = is; +})(InlineValueEvaluatableExpression || (InlineValueEvaluatableExpression = {})); +var InlineValueContext; +(function(InlineValueContext2) { + function create(frameId, stoppedLocation) { + return { frameId, stoppedLocation }; + } + InlineValueContext2.create = create; + function is(value) { + const candidate = value; + return Is.defined(candidate) && Range.is(value.stoppedLocation); + } + InlineValueContext2.is = is; +})(InlineValueContext || (InlineValueContext = {})); +var InlayHintKind; +(function(InlayHintKind2) { + InlayHintKind2.Type = 1; + InlayHintKind2.Parameter = 2; + function is(value) { + return value === 1 || value === 2; + } + InlayHintKind2.is = is; +})(InlayHintKind || (InlayHintKind = {})); +var InlayHintLabelPart; +(function(InlayHintLabelPart2) { + function create(value) { + return { value }; + } + InlayHintLabelPart2.create = create; + function is(value) { + const candidate = value; + return Is.objectLiteral(candidate) && (candidate.tooltip === void 0 || Is.string(candidate.tooltip) || MarkupContent.is(candidate.tooltip)) && (candidate.location === void 0 || Location.is(candidate.location)) && (candidate.command === void 0 || Command.is(candidate.command)); + } + InlayHintLabelPart2.is = is; +})(InlayHintLabelPart || (InlayHintLabelPart = {})); +var InlayHint; +(function(InlayHint2) { + function create(position, label, kind) { + const result = { position, label }; + if (kind !== void 0) { + result.kind = kind; + } + return result; + } + InlayHint2.create = create; + function is(value) { + const candidate = value; + return Is.objectLiteral(candidate) && Position.is(candidate.position) && (Is.string(candidate.label) || Is.typedArray(candidate.label, InlayHintLabelPart.is)) && (candidate.kind === void 0 || InlayHintKind.is(candidate.kind)) && candidate.textEdits === void 0 || Is.typedArray(candidate.textEdits, TextEdit.is) && (candidate.tooltip === void 0 || Is.string(candidate.tooltip) || MarkupContent.is(candidate.tooltip)) && (candidate.paddingLeft === void 0 || Is.boolean(candidate.paddingLeft)) && (candidate.paddingRight === void 0 || Is.boolean(candidate.paddingRight)); + } + InlayHint2.is = is; +})(InlayHint || (InlayHint = {})); +var StringValue; +(function(StringValue2) { + function createSnippet(value) { + return { kind: "snippet", value }; + } + StringValue2.createSnippet = createSnippet; +})(StringValue || (StringValue = {})); +var InlineCompletionItem; +(function(InlineCompletionItem2) { + function create(insertText, filterText, range, command) { + return { insertText, filterText, range, command }; + } + InlineCompletionItem2.create = create; +})(InlineCompletionItem || (InlineCompletionItem = {})); +var InlineCompletionList; +(function(InlineCompletionList2) { + function create(items) { + return { items }; + } + InlineCompletionList2.create = create; +})(InlineCompletionList || (InlineCompletionList = {})); +var InlineCompletionTriggerKind; +(function(InlineCompletionTriggerKind2) { + InlineCompletionTriggerKind2.Invoked = 0; + InlineCompletionTriggerKind2.Automatic = 1; +})(InlineCompletionTriggerKind || (InlineCompletionTriggerKind = {})); +var SelectedCompletionInfo; +(function(SelectedCompletionInfo2) { + function create(range, text) { + return { range, text }; + } + SelectedCompletionInfo2.create = create; +})(SelectedCompletionInfo || (SelectedCompletionInfo = {})); +var InlineCompletionContext; +(function(InlineCompletionContext2) { + function create(triggerKind, selectedCompletionInfo) { + return { triggerKind, selectedCompletionInfo }; + } + InlineCompletionContext2.create = create; +})(InlineCompletionContext || (InlineCompletionContext = {})); +var WorkspaceFolder; +(function(WorkspaceFolder2) { + function is(value) { + const candidate = value; + return Is.objectLiteral(candidate) && URI.is(candidate.uri) && Is.string(candidate.name); + } + WorkspaceFolder2.is = is; +})(WorkspaceFolder || (WorkspaceFolder = {})); +var TextDocument; +(function(TextDocument3) { + function create(uri, languageId, version, content) { + return new FullTextDocument(uri, languageId, version, content); + } + TextDocument3.create = create; + function is(value) { + let candidate = value; + return Is.defined(candidate) && Is.string(candidate.uri) && (Is.undefined(candidate.languageId) || Is.string(candidate.languageId)) && Is.uinteger(candidate.lineCount) && Is.func(candidate.getText) && Is.func(candidate.positionAt) && Is.func(candidate.offsetAt) ? true : false; + } + TextDocument3.is = is; + function applyEdits(document, edits) { + let text = document.getText(); + let sortedEdits = mergeSort2(edits, (a2, b) => { + let diff = a2.range.start.line - b.range.start.line; + if (diff === 0) { + return a2.range.start.character - b.range.start.character; + } + return diff; + }); + let lastModifiedOffset = text.length; + for (let i = sortedEdits.length - 1; i >= 0; i--) { + let e = sortedEdits[i]; + let startOffset = document.offsetAt(e.range.start); + let endOffset = document.offsetAt(e.range.end); + if (endOffset <= lastModifiedOffset) { + text = text.substring(0, startOffset) + e.newText + text.substring(endOffset, text.length); + } else { + throw new Error("Overlapping edit"); + } + lastModifiedOffset = startOffset; + } + return text; + } + TextDocument3.applyEdits = applyEdits; + function mergeSort2(data, compare) { + if (data.length <= 1) { + return data; + } + const p = data.length / 2 | 0; + const left = data.slice(0, p); + const right = data.slice(p); + mergeSort2(left, compare); + mergeSort2(right, compare); + let leftIdx = 0; + let rightIdx = 0; + let i = 0; + while (leftIdx < left.length && rightIdx < right.length) { + let ret = compare(left[leftIdx], right[rightIdx]); + if (ret <= 0) { + data[i++] = left[leftIdx++]; + } else { + data[i++] = right[rightIdx++]; + } + } + while (leftIdx < left.length) { + data[i++] = left[leftIdx++]; + } + while (rightIdx < right.length) { + data[i++] = right[rightIdx++]; + } + return data; + } +})(TextDocument || (TextDocument = {})); +var FullTextDocument = class { + constructor(uri, languageId, version, content) { + this._uri = uri; + this._languageId = languageId; + this._version = version; + this._content = content; + this._lineOffsets = void 0; + } + get uri() { + return this._uri; + } + get languageId() { + return this._languageId; + } + get version() { + return this._version; + } + getText(range) { + if (range) { + let start = this.offsetAt(range.start); + let end = this.offsetAt(range.end); + return this._content.substring(start, end); + } + return this._content; + } + update(event, version) { + this._content = event.text; + this._version = version; + this._lineOffsets = void 0; + } + getLineOffsets() { + if (this._lineOffsets === void 0) { + let lineOffsets = []; + let text = this._content; + let isLineStart = true; + for (let i = 0; i < text.length; i++) { + if (isLineStart) { + lineOffsets.push(i); + isLineStart = false; + } + let ch = text.charAt(i); + isLineStart = ch === "\r" || ch === "\n"; + if (ch === "\r" && i + 1 < text.length && text.charAt(i + 1) === "\n") { + i++; + } + } + if (isLineStart && text.length > 0) { + lineOffsets.push(text.length); + } + this._lineOffsets = lineOffsets; + } + return this._lineOffsets; + } + positionAt(offset) { + offset = Math.max(Math.min(offset, this._content.length), 0); + let lineOffsets = this.getLineOffsets(); + let low = 0, high = lineOffsets.length; + if (high === 0) { + return Position.create(0, offset); + } + while (low < high) { + let mid = Math.floor((low + high) / 2); + if (lineOffsets[mid] > offset) { + high = mid; + } else { + low = mid + 1; + } + } + let line = low - 1; + return Position.create(line, offset - lineOffsets[line]); + } + offsetAt(position) { + let lineOffsets = this.getLineOffsets(); + if (position.line >= lineOffsets.length) { + return this._content.length; + } else if (position.line < 0) { + return 0; + } + let lineOffset = lineOffsets[position.line]; + let nextLineOffset = position.line + 1 < lineOffsets.length ? lineOffsets[position.line + 1] : this._content.length; + return Math.max(Math.min(lineOffset + position.character, nextLineOffset), lineOffset); + } + get lineCount() { + return this.getLineOffsets().length; + } +}; +var Is; +(function(Is2) { + const toString = Object.prototype.toString; + function defined(value) { + return typeof value !== "undefined"; + } + Is2.defined = defined; + function undefined2(value) { + return typeof value === "undefined"; + } + Is2.undefined = undefined2; + function boolean(value) { + return value === true || value === false; + } + Is2.boolean = boolean; + function string(value) { + return toString.call(value) === "[object String]"; + } + Is2.string = string; + function number(value) { + return toString.call(value) === "[object Number]"; + } + Is2.number = number; + function numberRange(value, min, max) { + return toString.call(value) === "[object Number]" && min <= value && value <= max; + } + Is2.numberRange = numberRange; + function integer2(value) { + return toString.call(value) === "[object Number]" && -2147483648 <= value && value <= 2147483647; + } + Is2.integer = integer2; + function uinteger2(value) { + return toString.call(value) === "[object Number]" && 0 <= value && value <= 2147483647; + } + Is2.uinteger = uinteger2; + function func(value) { + return toString.call(value) === "[object Function]"; + } + Is2.func = func; + function objectLiteral(value) { + return value !== null && typeof value === "object"; + } + Is2.objectLiteral = objectLiteral; + function typedArray(value, check) { + return Array.isArray(value) && value.every(check); + } + Is2.typedArray = typedArray; +})(Is || (Is = {})); + +// node_modules/vscode-languageserver-textdocument/lib/esm/main.js +var FullTextDocument2 = class _FullTextDocument { + constructor(uri, languageId, version, content) { + this._uri = uri; + this._languageId = languageId; + this._version = version; + this._content = content; + this._lineOffsets = void 0; + } + get uri() { + return this._uri; + } + get languageId() { + return this._languageId; + } + get version() { + return this._version; + } + getText(range) { + if (range) { + const start = this.offsetAt(range.start); + const end = this.offsetAt(range.end); + return this._content.substring(start, end); + } + return this._content; + } + update(changes, version) { + for (const change of changes) { + if (_FullTextDocument.isIncremental(change)) { + const range = getWellformedRange(change.range); + const startOffset = this.offsetAt(range.start); + const endOffset = this.offsetAt(range.end); + this._content = this._content.substring(0, startOffset) + change.text + this._content.substring(endOffset, this._content.length); + const startLine = Math.max(range.start.line, 0); + const endLine = Math.max(range.end.line, 0); + let lineOffsets = this._lineOffsets; + const addedLineOffsets = computeLineOffsets(change.text, false, startOffset); + if (endLine - startLine === addedLineOffsets.length) { + for (let i = 0, len = addedLineOffsets.length; i < len; i++) { + lineOffsets[i + startLine + 1] = addedLineOffsets[i]; + } + } else { + if (addedLineOffsets.length < 1e4) { + lineOffsets.splice(startLine + 1, endLine - startLine, ...addedLineOffsets); + } else { + this._lineOffsets = lineOffsets = lineOffsets.slice(0, startLine + 1).concat(addedLineOffsets, lineOffsets.slice(endLine + 1)); + } + } + const diff = change.text.length - (endOffset - startOffset); + if (diff !== 0) { + for (let i = startLine + 1 + addedLineOffsets.length, len = lineOffsets.length; i < len; i++) { + lineOffsets[i] = lineOffsets[i] + diff; + } + } + } else if (_FullTextDocument.isFull(change)) { + this._content = change.text; + this._lineOffsets = void 0; + } else { + throw new Error("Unknown change event received"); + } + } + this._version = version; + } + getLineOffsets() { + if (this._lineOffsets === void 0) { + this._lineOffsets = computeLineOffsets(this._content, true); + } + return this._lineOffsets; + } + positionAt(offset) { + offset = Math.max(Math.min(offset, this._content.length), 0); + const lineOffsets = this.getLineOffsets(); + let low = 0, high = lineOffsets.length; + if (high === 0) { + return { line: 0, character: offset }; + } + while (low < high) { + const mid = Math.floor((low + high) / 2); + if (lineOffsets[mid] > offset) { + high = mid; + } else { + low = mid + 1; + } + } + const line = low - 1; + offset = this.ensureBeforeEOL(offset, lineOffsets[line]); + return { line, character: offset - lineOffsets[line] }; + } + offsetAt(position) { + const lineOffsets = this.getLineOffsets(); + if (position.line >= lineOffsets.length) { + return this._content.length; + } else if (position.line < 0) { + return 0; + } + const lineOffset = lineOffsets[position.line]; + if (position.character <= 0) { + return lineOffset; + } + const nextLineOffset = position.line + 1 < lineOffsets.length ? lineOffsets[position.line + 1] : this._content.length; + const offset = Math.min(lineOffset + position.character, nextLineOffset); + return this.ensureBeforeEOL(offset, lineOffset); + } + ensureBeforeEOL(offset, lineOffset) { + while (offset > lineOffset && isEOL(this._content.charCodeAt(offset - 1))) { + offset--; + } + return offset; + } + get lineCount() { + return this.getLineOffsets().length; + } + static isIncremental(event) { + const candidate = event; + return candidate !== void 0 && candidate !== null && typeof candidate.text === "string" && candidate.range !== void 0 && (candidate.rangeLength === void 0 || typeof candidate.rangeLength === "number"); + } + static isFull(event) { + const candidate = event; + return candidate !== void 0 && candidate !== null && typeof candidate.text === "string" && candidate.range === void 0 && candidate.rangeLength === void 0; + } +}; +var TextDocument2; +(function(TextDocument3) { + function create(uri, languageId, version, content) { + return new FullTextDocument2(uri, languageId, version, content); + } + TextDocument3.create = create; + function update(document, changes, version) { + if (document instanceof FullTextDocument2) { + document.update(changes, version); + return document; + } else { + throw new Error("TextDocument.update: document must be created by TextDocument.create"); + } + } + TextDocument3.update = update; + function applyEdits(document, edits) { + const text = document.getText(); + const sortedEdits = mergeSort(edits.map(getWellformedEdit), (a2, b) => { + const diff = a2.range.start.line - b.range.start.line; + if (diff === 0) { + return a2.range.start.character - b.range.start.character; + } + return diff; + }); + let lastModifiedOffset = 0; + const spans = []; + for (const e of sortedEdits) { + const startOffset = document.offsetAt(e.range.start); + if (startOffset < lastModifiedOffset) { + throw new Error("Overlapping edit"); + } else if (startOffset > lastModifiedOffset) { + spans.push(text.substring(lastModifiedOffset, startOffset)); + } + if (e.newText.length) { + spans.push(e.newText); + } + lastModifiedOffset = document.offsetAt(e.range.end); + } + spans.push(text.substr(lastModifiedOffset)); + return spans.join(""); + } + TextDocument3.applyEdits = applyEdits; +})(TextDocument2 || (TextDocument2 = {})); +function mergeSort(data, compare) { + if (data.length <= 1) { + return data; + } + const p = data.length / 2 | 0; + const left = data.slice(0, p); + const right = data.slice(p); + mergeSort(left, compare); + mergeSort(right, compare); + let leftIdx = 0; + let rightIdx = 0; + let i = 0; + while (leftIdx < left.length && rightIdx < right.length) { + const ret = compare(left[leftIdx], right[rightIdx]); + if (ret <= 0) { + data[i++] = left[leftIdx++]; + } else { + data[i++] = right[rightIdx++]; + } + } + while (leftIdx < left.length) { + data[i++] = left[leftIdx++]; + } + while (rightIdx < right.length) { + data[i++] = right[rightIdx++]; + } + return data; +} +function computeLineOffsets(text, isAtLineStart, textOffset = 0) { + const result = isAtLineStart ? [textOffset] : []; + for (let i = 0; i < text.length; i++) { + const ch = text.charCodeAt(i); + if (isEOL(ch)) { + if (ch === 13 && i + 1 < text.length && text.charCodeAt(i + 1) === 10) { + i++; + } + result.push(textOffset + i + 1); + } + } + return result; +} +function isEOL(char) { + return char === 13 || char === 10; +} +function getWellformedRange(range) { + const start = range.start; + const end = range.end; + if (start.line > end.line || start.line === end.line && start.character > end.character) { + return { start: end, end: start }; + } + return range; +} +function getWellformedEdit(textEdit) { + const range = getWellformedRange(textEdit.range); + if (range !== textEdit.range) { + return { newText: textEdit.newText, range }; + } + return textEdit; +} + +// node_modules/vscode-css-languageservice/lib/esm/cssLanguageTypes.js +var ClientCapabilities; +(function(ClientCapabilities2) { + ClientCapabilities2.LATEST = { + textDocument: { + completion: { + completionItem: { + documentationFormat: [MarkupKind.Markdown, MarkupKind.PlainText] + } + }, + hover: { + contentFormat: [MarkupKind.Markdown, MarkupKind.PlainText] + } + } + }; +})(ClientCapabilities || (ClientCapabilities = {})); +var FileType; +(function(FileType2) { + FileType2[FileType2["Unknown"] = 0] = "Unknown"; + FileType2[FileType2["File"] = 1] = "File"; + FileType2[FileType2["Directory"] = 2] = "Directory"; + FileType2[FileType2["SymbolicLink"] = 64] = "SymbolicLink"; +})(FileType || (FileType = {})); + +// node_modules/vscode-css-languageservice/lib/esm/languageFacts/entry.js +var browserNames = { + "C": { + name: "Chrome", + platform: "desktop" + }, + "CA": { + name: "Chrome", + platform: "Android" + }, + "E": { + name: "Edge", + platform: "desktop" + }, + "FF": { + name: "Firefox", + platform: "desktop" + }, + "FFA": { + name: "Firefox", + platform: "Android" + }, + "S": { + name: "Safari", + platform: "macOS" + }, + "SM": { + name: "Safari", + platform: "iOS" + } +}; +var shortCompatPattern = /(E|FFA|FF|SM|S|CA|C|IE|O)([\d|\.]+)?/; +var BaselineImages = { + BASELINE_LIMITED: "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTgiIGhlaWdodD0iMTAiIHZpZXdCb3g9IjAgMCA1NDAgMzAwIiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxzdHlsZT4KICAgIC5ncmF5LXNoYXBlIHsKICAgICAgZmlsbDogI0M2QzZDNjsgLyogTGlnaHQgbW9kZSAqLwogICAgfQoKICAgIEBtZWRpYSAocHJlZmVycy1jb2xvci1zY2hlbWU6IGRhcmspIHsKICAgICAgLmdyYXktc2hhcGUgewogICAgICAgIGZpbGw6ICM1NjU2NTY7IC8qIERhcmsgbW9kZSAqLwogICAgICB9CiAgICB9CiAgPC9zdHlsZT4KICA8cGF0aCBkPSJNMTUwIDBMMjQwIDkwTDIxMCAxMjBMMTIwIDMwTDE1MCAwWiIgZmlsbD0iI0YwOTQwOSIvPgogIDxwYXRoIGQ9Ik00MjAgMzBMNTQwIDE1MEw0MjAgMjcwTDM5MCAyNDBMNDgwIDE1MEwzOTAgNjBMNDIwIDMwWiIgY2xhc3M9ImdyYXktc2hhcGUiLz4KICA8cGF0aCBkPSJNMzMwIDE4MEwzMDAgMjEwTDM5MCAzMDBMNDIwIDI3MEwzMzAgMTgwWiIgZmlsbD0iI0YwOTQwOSIvPgogIDxwYXRoIGQ9Ik0xMjAgMzBMMTUwIDYwTDYwIDE1MEwxNTAgMjQwTDEyMCAyNzBMMCAxNTBMMTIwIDMwWiIgY2xhc3M9ImdyYXktc2hhcGUiLz4KICA8cGF0aCBkPSJNMzkwIDBMNDIwIDMwTDE1MCAzMDBMMTIwIDI3MEwzOTAgMFoiIGZpbGw9IiNGMDk0MDkiLz4KPC9zdmc+", + BASELINE_LOW: "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTgiIGhlaWdodD0iMTAiIHZpZXdCb3g9IjAgMCA1NDAgMzAwIiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxzdHlsZT4KICAgIC5ibHVlLXNoYXBlIHsKICAgICAgZmlsbDogI0E4QzdGQTsgLyogTGlnaHQgbW9kZSAqLwogICAgfQoKICAgIEBtZWRpYSAocHJlZmVycy1jb2xvci1zY2hlbWU6IGRhcmspIHsKICAgICAgLmJsdWUtc2hhcGUgewogICAgICAgIGZpbGw6ICMyRDUwOUU7IC8qIERhcmsgbW9kZSAqLwogICAgICB9CiAgICB9CgogICAgLmRhcmtlci1ibHVlLXNoYXBlIHsKICAgICAgICBmaWxsOiAjMUI2RUYzOwogICAgfQoKICAgIEBtZWRpYSAocHJlZmVycy1jb2xvci1zY2hlbWU6IGRhcmspIHsKICAgICAgICAuZGFya2VyLWJsdWUtc2hhcGUgewogICAgICAgICAgICBmaWxsOiAjNDE4NUZGOwogICAgICAgIH0KICAgIH0KCiAgPC9zdHlsZT4KICA8cGF0aCBkPSJNMTUwIDBMMTgwIDMwTDE1MCA2MEwxMjAgMzBMMTUwIDBaIiBjbGFzcz0iYmx1ZS1zaGFwZSIvPgogIDxwYXRoIGQ9Ik0yMTAgNjBMMjQwIDkwTDIxMCAxMjBMMTgwIDkwTDIxMCA2MFoiIGNsYXNzPSJibHVlLXNoYXBlIi8+CiAgPHBhdGggZD0iTTQ1MCA2MEw0ODAgOTBMNDUwIDEyMEw0MjAgOTBMNDUwIDYwWiIgY2xhc3M9ImJsdWUtc2hhcGUiLz4KICA8cGF0aCBkPSJNNTEwIDEyMEw1NDAgMTUwTDUxMCAxODBMNDgwIDE1MEw1MTAgMTIwWiIgY2xhc3M9ImJsdWUtc2hhcGUiLz4KICA8cGF0aCBkPSJNNDUwIDE4MEw0ODAgMjEwTDQ1MCAyNDBMNDIwIDIxMEw0NTAgMTgwWiIgY2xhc3M9ImJsdWUtc2hhcGUiLz4KICA8cGF0aCBkPSJNMzkwIDI0MEw0MjAgMjcwTDM5MCAzMDBMMzYwIDI3MEwzOTAgMjQwWiIgY2xhc3M9ImJsdWUtc2hhcGUiLz4KICA8cGF0aCBkPSJNMzMwIDE4MEwzNjAgMjEwTDMzMCAyNDBMMzAwIDIxMEwzMzAgMTgwWiIgY2xhc3M9ImJsdWUtc2hhcGUiLz4KICA8cGF0aCBkPSJNOTAgNjBMMTIwIDkwTDkwIDEyMEw2MCA5MEw5MCA2MFoiIGNsYXNzPSJibHVlLXNoYXBlIi8+CiAgPHBhdGggZD0iTTM5MCAwTDQyMCAzMEwxNTAgMzAwTDAgMTUwTDMwIDEyMEwxNTAgMjQwTDM5MCAwWiIgY2xhc3M9ImRhcmtlci1ibHVlLXNoYXBlIi8+Cjwvc3ZnPg==", + BASELINE_HIGH: "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTgiIGhlaWdodD0iMTAiIHZpZXdCb3g9IjAgMCA1NDAgMzAwIiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxzdHlsZT4KICAgIC5ncmVlbi1zaGFwZSB7CiAgICAgIGZpbGw6ICNDNEVFRDA7IC8qIExpZ2h0IG1vZGUgKi8KICAgIH0KCiAgICBAbWVkaWEgKHByZWZlcnMtY29sb3Itc2NoZW1lOiBkYXJrKSB7CiAgICAgIC5ncmVlbi1zaGFwZSB7CiAgICAgICAgZmlsbDogIzEyNTIyNTsgLyogRGFyayBtb2RlICovCiAgICAgIH0KICAgIH0KICA8L3N0eWxlPgogIDxwYXRoIGQ9Ik00MjAgMzBMMzkwIDYwTDQ4MCAxNTBMMzkwIDI0MEwzMzAgMTgwTDMwMCAyMTBMMzkwIDMwMEw1NDAgMTUwTDQyMCAzMFoiIGNsYXNzPSJncmVlbi1zaGFwZSIvPgogIDxwYXRoIGQ9Ik0xNTAgMEwzMCAxMjBMNjAgMTUwTDE1MCA2MEwyMTAgMTIwTDI0MCA5MEwxNTAgMFoiIGNsYXNzPSJncmVlbi1zaGFwZSIvPgogIDxwYXRoIGQ9Ik0zOTAgMEw0MjAgMzBMMTUwIDMwMEwwIDE1MEwzMCAxMjBMMTUwIDI0MEwzOTAgMFoiIGZpbGw9IiMxRUE0NDYiLz4KPC9zdmc+" +}; +function getEntryStatus(status) { + switch (status) { + case "nonstandard": + return "\u{1F6A8}\uFE0F Property is nonstandard. Avoid using it.\n\n"; + case "obsolete": + return "\u{1F6A8}\uFE0F\uFE0F\uFE0F Property is obsolete. Avoid using it.\n\n"; + default: + return ""; + } +} +function getEntryBaselineStatus(baseline, browsers) { + if (baseline.status === "false") { + const missingBrowsers = getMissingBaselineBrowsers(browsers); + let status = `Limited availability across major browsers`; + if (missingBrowsers) { + status += ` (Not fully implemented in ${missingBrowsers})`; + } + return status; + } + const baselineYear = baseline.baseline_low_date?.split("-")[0]; + return `${baseline.status === "low" ? "Newly" : "Widely"} available across major browsers (Baseline since ${baselineYear})`; +} +function getEntryBaselineImage(baseline) { + if (!baseline) { + return ""; + } + let baselineImg; + switch (baseline?.status) { + case "low": + baselineImg = BaselineImages.BASELINE_LOW; + break; + case "high": + baselineImg = BaselineImages.BASELINE_HIGH; + break; + default: + baselineImg = BaselineImages.BASELINE_LIMITED; + } + return `![Baseline icon](${baselineImg})`; +} +function getEntryDescription(entry, doesSupportMarkdown, settings) { + let result; + if (doesSupportMarkdown) { + result = { + kind: "markdown", + value: getEntryMarkdownDescription(entry, settings) + }; + } else { + result = { + kind: "plaintext", + value: getEntryStringDescription(entry, settings) + }; + } + if (result.value === "") { + return void 0; + } + return result; +} +function textToMarkedString(text) { + text = text.replace(/[\\`*_{}[\]()#+\-.!]/g, "\\$&"); + return text.replace(//g, ">"); +} +function getEntryStringDescription(entry, settings) { + if (!entry.description || entry.description === "") { + return ""; + } + if (typeof entry.description !== "string") { + return entry.description.value; + } + let result = ""; + if (settings?.documentation !== false) { + let status = ""; + if (entry.status) { + status = getEntryStatus(entry.status); + result += status; + } + result += entry.description; + if (entry.baseline && !status) { + result += ` + +${getEntryBaselineStatus(entry.baseline, entry.browsers)}`; + } + if ("syntax" in entry) { + result += ` + +Syntax: ${entry.syntax}`; + } + } + if (entry.references && entry.references.length > 0 && settings?.references !== false) { + if (result.length > 0) { + result += "\n\n"; + } + result += entry.references.map((r) => { + return `${r.name}: ${r.url}`; + }).join(" | "); + } + return result; +} +function getEntryMarkdownDescription(entry, settings) { + if (!entry.description || entry.description === "") { + return ""; + } + let result = ""; + if (settings?.documentation !== false) { + let status = ""; + if (entry.status) { + status = getEntryStatus(entry.status); + result += status; + } + if (typeof entry.description === "string") { + result += textToMarkedString(entry.description); + } else { + result += entry.description.kind === MarkupKind.Markdown ? entry.description.value : textToMarkedString(entry.description.value); + } + if (entry.baseline && !status) { + result += ` + +${getEntryBaselineImage(entry.baseline)} _${getEntryBaselineStatus(entry.baseline, entry.browsers)}_`; + } + if ("syntax" in entry && entry.syntax) { + result += ` + +Syntax: ${textToMarkedString(entry.syntax)}`; + } + } + if (entry.references && entry.references.length > 0 && settings?.references !== false) { + if (result.length > 0) { + result += "\n\n"; + } + result += entry.references.map((r) => { + return `[${r.name}](${r.url})`; + }).join(" | "); + } + return result; +} +var missingBaselineBrowserFormatter = new Intl.ListFormat("en", { + style: "long", + type: "disjunction" +}); +function getMissingBaselineBrowsers(browsers) { + if (!browsers) { + return ""; + } + const missingBrowsers = new Map(Object.entries(browserNames)); + for (const shortCompatString of browsers) { + const match = shortCompatPattern.exec(shortCompatString); + if (!match) { + continue; + } + const browser = match[1]; + missingBrowsers.delete(browser); + } + return missingBaselineBrowserFormatter.format(Object.values(Array.from(missingBrowsers.entries()).reduce((browsers2, [browserId, browser]) => { + if (browser.name in browsers2 || browserId === "E") { + browsers2[browser.name] = browser.name; + return browsers2; + } + browsers2[browser.name] = `${browser.name} on ${browser.platform}`; + return browsers2; + }, {}))); +} + +// node_modules/vscode-css-languageservice/lib/esm/languageFacts/colors.js +var hexColorRegExp = /(^#([0-9A-F]{3}){1,2}$)|(^#([0-9A-F]{4}){1,2}$)/i; +var colorFunctions = [ + { + label: "rgb", + func: "rgb($red, $green, $blue)", + insertText: "rgb(${1:red}, ${2:green}, ${3:blue})", + desc: t("Creates a Color from red, green, and blue values.") + }, + { + label: "rgba", + func: "rgba($red, $green, $blue, $alpha)", + insertText: "rgba(${1:red}, ${2:green}, ${3:blue}, ${4:alpha})", + desc: t("Creates a Color from red, green, blue, and alpha values.") + }, + { + label: "rgb relative", + func: "rgb(from $color $red $green $blue)", + insertText: "rgb(from ${1:color} ${2:r} ${3:g} ${4:b})", + desc: t("Creates a Color from the red, green, and blue values of another Color.") + }, + { + label: "hsl", + func: "hsl($hue, $saturation, $lightness)", + insertText: "hsl(${1:hue}, ${2:saturation}, ${3:lightness})", + desc: t("Creates a Color from hue, saturation, and lightness values.") + }, + { + label: "hsla", + func: "hsla($hue, $saturation, $lightness, $alpha)", + insertText: "hsla(${1:hue}, ${2:saturation}, ${3:lightness}, ${4:alpha})", + desc: t("Creates a Color from hue, saturation, lightness, and alpha values.") + }, + { + label: "hsl relative", + func: "hsl(from $color $hue $saturation $lightness)", + insertText: "hsl(from ${1:color} ${2:h} ${3:s} ${4:l})", + desc: t("Creates a Color from the hue, saturation, and lightness values of another Color.") + }, + { + label: "hwb", + func: "hwb($hue $white $black)", + insertText: "hwb(${1:hue} ${2:white} ${3:black})", + desc: t("Creates a Color from hue, white, and black values.") + }, + { + label: "hwb relative", + func: "hwb(from $color $hue $white $black)", + insertText: "hwb(from ${1:color} ${2:h} ${3:w} ${4:b})", + desc: t("Creates a Color from the hue, white, and black values of another Color.") + }, + { + label: "lab", + func: "lab($lightness $a $b)", + insertText: "lab(${1:lightness} ${2:a} ${3:b})", + desc: t("Creates a Color from lightness, a, and b values.") + }, + { + label: "lab relative", + func: "lab(from $color $lightness $a $b)", + insertText: "lab(from ${1:color} ${2:l} ${3:a} ${4:b})", + desc: t("Creates a Color from the lightness, a, and b values of another Color.") + }, + { + label: "oklab", + func: "oklab($lightness $a $b)", + insertText: "oklab(${1:lightness} ${2:a} ${3:b})", + desc: t("Creates a Color from lightness, a, and b values.") + }, + { + label: "oklab relative", + func: "oklab(from $color $lightness $a $b)", + insertText: "oklab(from ${1:color} ${2:l} ${3:a} ${4:b})", + desc: t("Creates a Color from the lightness, a, and b values of another Color.") + }, + { + label: "lch", + func: "lch($lightness $chroma $hue)", + insertText: "lch(${1:lightness} ${2:chroma} ${3:hue})", + desc: t("Creates a Color from lightness, chroma, and hue values.") + }, + { + label: "lch relative", + func: "lch(from $color $lightness $chroma $hue)", + insertText: "lch(from ${1:color} ${2:l} ${3:c} ${4:h})", + desc: t("Creates a Color from the lightness, chroma, and hue values of another Color.") + }, + { + label: "oklch", + func: "oklch($lightness $chroma $hue)", + insertText: "oklch(${1:lightness} ${2:chroma} ${3:hue})", + desc: t("Creates a Color from lightness, chroma, and hue values.") + }, + { + label: "oklch relative", + func: "oklch(from $color $lightness $chroma $hue)", + insertText: "oklch(from ${1:color} ${2:l} ${3:c} ${4:h})", + desc: t("Creates a Color from the lightness, chroma, and hue values of another Color.") + }, + { + label: "color", + func: "color($color-space $red $green $blue)", + insertText: "color(${1|srgb,srgb-linear,display-p3,a98-rgb,prophoto-rgb,rec2020,xyx,xyz-d50,xyz-d65|} ${2:red} ${3:green} ${4:blue})", + desc: t("Creates a Color in a specific color space from red, green, and blue values.") + }, + { + label: "color relative", + func: "color(from $color $color-space $red $green $blue)", + insertText: "color(from ${1:color} ${2|srgb,srgb-linear,display-p3,a98-rgb,prophoto-rgb,rec2020,xyx,xyz-d50,xyz-d65|} ${3:r} ${4:g} ${5:b})", + desc: t("Creates a Color in a specific color space from the red, green, and blue values of another Color.") + }, + { + label: "color-mix", + func: "color-mix(in $color-space, $color $percentage, $color $percentage)", + insertText: "color-mix(in ${1|srgb,srgb-linear,lab,oklab,xyz,xyz-d50,xyz-d65|}, ${3:color} ${4:percentage}, ${5:color} ${6:percentage})", + desc: t("Mix two colors together in a rectangular color space.") + }, + { + label: "color-mix hue", + func: "color-mix(in $color-space $interpolation-method hue, $color $percentage, $color $percentage)", + insertText: "color-mix(in ${1|hsl,hwb,lch,oklch|} ${2|shorter hue,longer hue,increasing hue,decreasing hue|}, ${3:color} ${4:percentage}, ${5:color} ${6:percentage})", + desc: t("Mix two colors together in a polar color space.") + }, + { + label: "lab", + func: "lab($lightness $channel_a $channel_b $alpha)", + insertText: "lab(${1:lightness} ${2:a} ${3:b} ${4:alpha})", + desc: t("css.builtin.lab", "Creates a Color from Lightness, Channel a, Channel b and alpha values.") + }, + { + label: "lab relative", + func: "lab(from $color $lightness $channel_a $channel_b $alpha)", + insertText: "lab(from ${1:color} ${2:lightness} ${3:channel_a} ${4:channel_b} ${5:alpha})", + desc: t("css.builtin.lab", "Creates a Color from Lightness, Channel a, Channel b and alpha values of another Color.") + }, + { + label: "lch", + func: "lch($lightness $chrome $hue $alpha)", + insertText: "lch(${1:lightness} ${2:chrome} ${3:hue} ${4:alpha})", + desc: t("css.builtin.lab", "Creates a Color from Lightness, Chroma, Hue and alpha values.") + }, + { + label: "lch relative", + func: "lch(from $color $lightness $chrome $hue $alpha)", + insertText: "lch(from ${1:color} ${2:lightness} ${3:chrome} ${4:hue} ${5:alpha})", + desc: t("css.builtin.lab", "Creates a Color from Lightness, Chroma, Hue and alpha values of another Color.") + } +]; +var colorFunctionNameRegExp = /^(?:rgba?|hsla?|hwb|lab|lch|oklab|oklch)$/iu; +var colors = { + aliceblue: "#f0f8ff", + antiquewhite: "#faebd7", + aqua: "#00ffff", + aquamarine: "#7fffd4", + azure: "#f0ffff", + beige: "#f5f5dc", + bisque: "#ffe4c4", + black: "#000000", + blanchedalmond: "#ffebcd", + blue: "#0000ff", + blueviolet: "#8a2be2", + brown: "#a52a2a", + burlywood: "#deb887", + cadetblue: "#5f9ea0", + chartreuse: "#7fff00", + chocolate: "#d2691e", + coral: "#ff7f50", + cornflowerblue: "#6495ed", + cornsilk: "#fff8dc", + crimson: "#dc143c", + cyan: "#00ffff", + darkblue: "#00008b", + darkcyan: "#008b8b", + darkgoldenrod: "#b8860b", + darkgray: "#a9a9a9", + darkgrey: "#a9a9a9", + darkgreen: "#006400", + darkkhaki: "#bdb76b", + darkmagenta: "#8b008b", + darkolivegreen: "#556b2f", + darkorange: "#ff8c00", + darkorchid: "#9932cc", + darkred: "#8b0000", + darksalmon: "#e9967a", + darkseagreen: "#8fbc8f", + darkslateblue: "#483d8b", + darkslategray: "#2f4f4f", + darkslategrey: "#2f4f4f", + darkturquoise: "#00ced1", + darkviolet: "#9400d3", + deeppink: "#ff1493", + deepskyblue: "#00bfff", + dimgray: "#696969", + dimgrey: "#696969", + dodgerblue: "#1e90ff", + firebrick: "#b22222", + floralwhite: "#fffaf0", + forestgreen: "#228b22", + fuchsia: "#ff00ff", + gainsboro: "#dcdcdc", + ghostwhite: "#f8f8ff", + gold: "#ffd700", + goldenrod: "#daa520", + gray: "#808080", + grey: "#808080", + green: "#008000", + greenyellow: "#adff2f", + honeydew: "#f0fff0", + hotpink: "#ff69b4", + indianred: "#cd5c5c", + indigo: "#4b0082", + ivory: "#fffff0", + khaki: "#f0e68c", + lavender: "#e6e6fa", + lavenderblush: "#fff0f5", + lawngreen: "#7cfc00", + lemonchiffon: "#fffacd", + lightblue: "#add8e6", + lightcoral: "#f08080", + lightcyan: "#e0ffff", + lightgoldenrodyellow: "#fafad2", + lightgray: "#d3d3d3", + lightgrey: "#d3d3d3", + lightgreen: "#90ee90", + lightpink: "#ffb6c1", + lightsalmon: "#ffa07a", + lightseagreen: "#20b2aa", + lightskyblue: "#87cefa", + lightslategray: "#778899", + lightslategrey: "#778899", + lightsteelblue: "#b0c4de", + lightyellow: "#ffffe0", + lime: "#00ff00", + limegreen: "#32cd32", + linen: "#faf0e6", + magenta: "#ff00ff", + maroon: "#800000", + mediumaquamarine: "#66cdaa", + mediumblue: "#0000cd", + mediumorchid: "#ba55d3", + mediumpurple: "#9370d8", + mediumseagreen: "#3cb371", + mediumslateblue: "#7b68ee", + mediumspringgreen: "#00fa9a", + mediumturquoise: "#48d1cc", + mediumvioletred: "#c71585", + midnightblue: "#191970", + mintcream: "#f5fffa", + mistyrose: "#ffe4e1", + moccasin: "#ffe4b5", + navajowhite: "#ffdead", + navy: "#000080", + oldlace: "#fdf5e6", + olive: "#808000", + olivedrab: "#6b8e23", + orange: "#ffa500", + orangered: "#ff4500", + orchid: "#da70d6", + palegoldenrod: "#eee8aa", + palegreen: "#98fb98", + paleturquoise: "#afeeee", + palevioletred: "#d87093", + papayawhip: "#ffefd5", + peachpuff: "#ffdab9", + peru: "#cd853f", + pink: "#ffc0cb", + plum: "#dda0dd", + powderblue: "#b0e0e6", + purple: "#800080", + red: "#ff0000", + rebeccapurple: "#663399", + rosybrown: "#bc8f8f", + royalblue: "#4169e1", + saddlebrown: "#8b4513", + salmon: "#fa8072", + sandybrown: "#f4a460", + seagreen: "#2e8b57", + seashell: "#fff5ee", + sienna: "#a0522d", + silver: "#c0c0c0", + skyblue: "#87ceeb", + slateblue: "#6a5acd", + slategray: "#708090", + slategrey: "#708090", + snow: "#fffafa", + springgreen: "#00ff7f", + steelblue: "#4682b4", + tan: "#d2b48c", + teal: "#008080", + thistle: "#d8bfd8", + tomato: "#ff6347", + turquoise: "#40e0d0", + violet: "#ee82ee", + wheat: "#f5deb3", + white: "#ffffff", + whitesmoke: "#f5f5f5", + yellow: "#ffff00", + yellowgreen: "#9acd32" +}; +var colorsRegExp = new RegExp(`^(${Object.keys(colors).join("|")})$`, "i"); +var colorKeywords = { + "currentColor": "The value of the 'color' property. The computed value of the 'currentColor' keyword is the computed value of the 'color' property. If the 'currentColor' keyword is set on the 'color' property itself, it is treated as 'color:inherit' at parse time.", + "transparent": "Fully transparent. This keyword can be considered a shorthand for rgba(0,0,0,0) which is its computed value." +}; +var colorKeywordsRegExp = new RegExp(`^(${Object.keys(colorKeywords).join("|")})$`, "i"); +function getNumericValue(node, factor, lowerLimit = 0, upperLimit = 1) { + const val = node.getText(); + const m = val.match(/^([-+]?[0-9]*\.?[0-9]+)(%?)$/); + if (m) { + if (m[2]) { + factor = 100; + } + const result = parseFloat(m[1]) / factor; + if (result >= lowerLimit && result <= upperLimit) { + return result; + } + } + throw new Error(); +} +var DEGREES_PER_CIRCLE = 360; +var GRAD_TO_DEGREE_FACTOR = 0.9; +var RADIANS_TO_DEGREES_FACTOR = DEGREES_PER_CIRCLE / 2 / Math.PI; +function getAngle(node) { + const textValue = node.getText(); + if (textValue === "none") { + return 0; + } + const m = /^(?[-+]?[0-9]*\.?[0-9]+)(?deg|rad|grad|turn)?$/iu.exec(textValue); + if (m?.groups?.["numberString"]) { + const value = Number.parseFloat(m.groups["numberString"]); + if (!Number.isNaN(value)) { + switch (m.groups["unit"]) { + case "deg": { + return value % DEGREES_PER_CIRCLE; + } + case "grad": { + return value * GRAD_TO_DEGREE_FACTOR % DEGREES_PER_CIRCLE; + } + case "rad": { + return value * RADIANS_TO_DEGREES_FACTOR % DEGREES_PER_CIRCLE; + } + case "turn": { + return value * DEGREES_PER_CIRCLE % DEGREES_PER_CIRCLE; + } + default: { + return value % DEGREES_PER_CIRCLE; + } + } + } + } + throw new Error(`Failed to parse '${textValue}' as angle`); +} +function isColorConstructor(node) { + const name = node.getName(); + if (!name) { + return false; + } + return colorFunctionNameRegExp.test(name); +} +function isColorString(s) { + return hexColorRegExp.test(s) || colorsRegExp.test(s) || colorKeywordsRegExp.test(s); +} +var Digit0 = 48; +var Digit9 = 57; +var A = 65; +var a = 97; +var f = 102; +function hexDigit(charCode) { + if (charCode < Digit0) { + return 0; + } + if (charCode <= Digit9) { + return charCode - Digit0; + } + if (charCode < a) { + charCode += a - A; + } + if (charCode >= a && charCode <= f) { + return charCode - a + 10; + } + return 0; +} +function colorFromHex(text) { + if (text[0] !== "#") { + return null; + } + switch (text.length) { + case 4: + return { + red: hexDigit(text.charCodeAt(1)) * 17 / 255, + green: hexDigit(text.charCodeAt(2)) * 17 / 255, + blue: hexDigit(text.charCodeAt(3)) * 17 / 255, + alpha: 1 + }; + case 5: + return { + red: hexDigit(text.charCodeAt(1)) * 17 / 255, + green: hexDigit(text.charCodeAt(2)) * 17 / 255, + blue: hexDigit(text.charCodeAt(3)) * 17 / 255, + alpha: hexDigit(text.charCodeAt(4)) * 17 / 255 + }; + case 7: + return { + red: (hexDigit(text.charCodeAt(1)) * 16 + hexDigit(text.charCodeAt(2))) / 255, + green: (hexDigit(text.charCodeAt(3)) * 16 + hexDigit(text.charCodeAt(4))) / 255, + blue: (hexDigit(text.charCodeAt(5)) * 16 + hexDigit(text.charCodeAt(6))) / 255, + alpha: 1 + }; + case 9: + return { + red: (hexDigit(text.charCodeAt(1)) * 16 + hexDigit(text.charCodeAt(2))) / 255, + green: (hexDigit(text.charCodeAt(3)) * 16 + hexDigit(text.charCodeAt(4))) / 255, + blue: (hexDigit(text.charCodeAt(5)) * 16 + hexDigit(text.charCodeAt(6))) / 255, + alpha: (hexDigit(text.charCodeAt(7)) * 16 + hexDigit(text.charCodeAt(8))) / 255 + }; + } + return null; +} +function colorFromHSL(hue, sat, light, alpha = 1) { + hue = hue / 60; + if (sat === 0) { + return { red: light, green: light, blue: light, alpha }; + } else { + const hueToRgb = (t12, t22, hue2) => { + while (hue2 < 0) { + hue2 += 6; + } + while (hue2 >= 6) { + hue2 -= 6; + } + if (hue2 < 1) { + return (t22 - t12) * hue2 + t12; + } + if (hue2 < 3) { + return t22; + } + if (hue2 < 4) { + return (t22 - t12) * (4 - hue2) + t12; + } + return t12; + }; + const t2 = light <= 0.5 ? light * (sat + 1) : light + sat - light * sat; + const t1 = light * 2 - t2; + return { red: hueToRgb(t1, t2, hue + 2), green: hueToRgb(t1, t2, hue), blue: hueToRgb(t1, t2, hue - 2), alpha }; + } +} +function hslFromColor(rgba) { + const r = rgba.red; + const g = rgba.green; + const b = rgba.blue; + const a2 = rgba.alpha; + const max = Math.max(r, g, b); + const min = Math.min(r, g, b); + let h = 0; + let s = 0; + const l = (min + max) / 2; + const chroma = max - min; + if (chroma > 0) { + s = Math.min(l <= 0.5 ? chroma / (2 * l) : chroma / (2 - 2 * l), 1); + switch (max) { + case r: + h = (g - b) / chroma + (g < b ? 6 : 0); + break; + case g: + h = (b - r) / chroma + 2; + break; + case b: + h = (r - g) / chroma + 4; + break; + } + h *= 60; + h = Math.round(h); + } + return { h, s, l, a: a2 }; +} +function colorFromHWB(hue, white, black, alpha = 1) { + if (white + black >= 1) { + const gray = white / (white + black); + return { red: gray, green: gray, blue: gray, alpha }; + } + const rgb = colorFromHSL(hue, 1, 0.5, alpha); + let red = rgb.red; + red *= 1 - white - black; + red += white; + let green = rgb.green; + green *= 1 - white - black; + green += white; + let blue = rgb.blue; + blue *= 1 - white - black; + blue += white; + return { + red, + green, + blue, + alpha + }; +} +function hwbFromColor(rgba) { + const hsl = hslFromColor(rgba); + const white = Math.min(rgba.red, rgba.green, rgba.blue); + const black = 1 - Math.max(rgba.red, rgba.green, rgba.blue); + return { + h: hsl.h, + w: white, + b: black, + a: hsl.a + }; +} +function xyzFromLAB(lab) { + const xyz = { + x: 0, + y: 0, + z: 0, + alpha: lab.alpha ?? 1 + }; + xyz.y = (lab.l + 16) / 116; + xyz.x = lab.a / 500 + xyz.y; + xyz.z = xyz.y - lab.b / 200; + let key; + for (key in xyz) { + let pow = xyz[key] * xyz[key] * xyz[key]; + if (pow > 8856e-6) { + xyz[key] = pow; + } else { + xyz[key] = (xyz[key] - 16 / 116) / 7.787; + } + } + xyz.x = xyz.x * 95.047; + xyz.y = xyz.y * 100; + xyz.z = xyz.z * 108.883; + return xyz; +} +function xyzFromOKLAB(lab) { + const l = lab.l + 0.3963377774 * lab.a + 0.2158037573 * lab.b; + const m = lab.l - 0.1055613458 * lab.a - 0.0638541728 * lab.b; + const s = lab.l - 0.0894841775 * lab.a - 1.291485548 * lab.b; + const l3 = l ** 3; + const m3 = m ** 3; + const s3 = s ** 3; + const x = 1.2270138511 * l3 - 0.5577999807 * m3 + 0.281256149 * s3; + const y = -0.0405801784 * l3 + 1.1122568696 * m3 - 0.0716766787 * s3; + const z = -0.0763812845 * l3 - 0.4214819784 * m3 + 1.5861632204 * s3; + return { + x: x * 100, + y: y * 100, + z: z * 100, + alpha: lab.alpha ?? 1 + }; +} +function xyzToRGB(xyz) { + const x = xyz.x / 100; + const y = xyz.y / 100; + const z = xyz.z / 100; + const r = 3.2406254773200533 * x - 1.5372079722103187 * y - 0.4986285986982479 * z; + const g = -0.9689307147293197 * x + 1.8757560608852415 * y + 0.041517523842953964 * z; + const b = 0.055710120445510616 * x + -0.2040210505984867 * y + 1.0569959422543882 * z; + const compand = (c) => { + return c <= 31308e-7 ? 12.92 * c : Math.min(1.055 * Math.pow(c, 1 / 2.4) - 0.055, 1); + }; + return { + red: Math.round(compand(r) * 255), + blue: Math.round(compand(b) * 255), + green: Math.round(compand(g) * 255), + alpha: xyz.alpha + }; +} +function RGBtoXYZ(rgba) { + let r = rgba.red, g = rgba.green, b = rgba.blue; + if (r > 0.04045) { + r = Math.pow((r + 0.055) / 1.055, 2.4); + } else { + r = r / 12.92; + } + if (g > 0.04045) { + g = Math.pow((g + 0.055) / 1.055, 2.4); + } else { + g = g / 12.92; + } + if (b > 0.04045) { + b = Math.pow((b + 0.055) / 1.055, 2.4); + } else { + b = b / 12.92; + } + r = r * 100; + g = g * 100; + b = b * 100; + const x = r * 0.4124 + g * 0.3576 + b * 0.1805; + const y = r * 0.2126 + g * 0.7152 + b * 0.0722; + const z = r * 0.0193 + g * 0.1192 + b * 0.9505; + return { x, y, z, alpha: rgba.alpha }; +} +function XYZtoLAB(xyz, round = true) { + const ref_X = 95.047, ref_Y = 100, ref_Z = 108.883; + let x = xyz.x / ref_X, y = xyz.y / ref_Y, z = xyz.z / ref_Z; + if (x > 8856e-6) { + x = Math.pow(x, 1 / 3); + } else { + x = 7.787 * x + 16 / 116; + } + if (y > 8856e-6) { + y = Math.pow(y, 1 / 3); + } else { + y = 7.787 * y + 16 / 116; + } + if (z > 8856e-6) { + z = Math.pow(z, 1 / 3); + } else { + z = 7.787 * z + 16 / 116; + } + const l = 116 * y - 16, a2 = 500 * (x - y), b = 200 * (y - z); + if (round) { + return { + l: Math.round((l + Number.EPSILON) * 100) / 100, + a: Math.round((a2 + Number.EPSILON) * 100) / 100, + b: Math.round((b + Number.EPSILON) * 100) / 100, + alpha: xyz.alpha + }; + } else { + return { + l, + a: a2, + b, + alpha: xyz.alpha + }; + } +} +function XYZtoOKLAB(xyz, round = true) { + const x = xyz.x / 100; + const y = xyz.y / 100; + const z = xyz.z / 100; + const l = 0.8189330101 * x + 0.3618667424 * y - 0.1288597137 * z; + const m = 0.0329845436 * x + 0.9293118715 * y + 0.0361456387 * z; + const s = 0.0482003018 * x + 0.2643662691 * y + 0.633851707 * z; + const l_ = Math.cbrt(l); + const m_ = Math.cbrt(m); + const s_ = Math.cbrt(s); + const L = 0.2104542553 * l_ + 0.793617785 * m_ - 0.0040720468 * s_; + const a2 = 1.9779984951 * l_ - 2.428592205 * m_ + 0.4505937099 * s_; + const b = 0.0259040371 * l_ + 0.7827717662 * m_ - 0.808675766 * s_; + return round ? { + l: Number(L.toFixed(5)), + a: Number(a2.toFixed(5)), + b: Number(b.toFixed(5)), + alpha: xyz.alpha + } : { + l: L, + a: a2, + b, + alpha: xyz.alpha + }; +} +function labFromColor(rgba, round = true) { + const xyz = RGBtoXYZ(rgba); + const lab = XYZtoLAB(xyz, round); + return lab; +} +function oklabFromColor(rgba, round = true) { + const xyz = RGBtoXYZ(rgba); + const lab = XYZtoOKLAB(xyz, round); + return { ...lab, l: lab.l * 100 }; +} +function labToLCH(lab) { + const c = Math.sqrt(Math.pow(lab.a, 2) + Math.pow(lab.b, 2)); + let h = Math.atan2(lab.b, lab.a) * RADIANS_TO_DEGREES_FACTOR; + while (h < 0) { + h = h + 360; + } + return { + l: lab.l, + c, + h, + alpha: lab.alpha + }; +} +function lchFromColor(rgba) { + const lab = labFromColor(rgba, false); + const lch = labToLCH(lab); + return { + l: Math.round((lch.l + Number.EPSILON) * 100) / 100, + c: Math.round((lch.c + Number.EPSILON) * 100) / 100, + h: Math.round((lch.h + Number.EPSILON) * 100) / 100, + alpha: lch.alpha + }; +} +function oklchFromColor(rgba) { + const lab = oklabFromColor(rgba, false); + const lch = labToLCH(lab); + return { + l: Number(lch.l.toFixed(3)), + c: Number(lch.c.toFixed(5)), + h: Number(lch.h.toFixed(3)), + alpha: lch.alpha + }; +} +function labToColor(lab, xyzConverter) { + const xyz = xyzConverter(lab); + const rgb = xyzToRGB(xyz); + return { + red: (rgb.red >= 0 ? Math.min(rgb.red, 255) : 0) / 255, + green: (rgb.green >= 0 ? Math.min(rgb.green, 255) : 0) / 255, + blue: (rgb.blue >= 0 ? Math.min(rgb.blue, 255) : 0) / 255, + alpha: lab.alpha ?? 1 + }; +} +function colorFromLAB(l, a2, b, alpha = 1) { + return labToColor({ l, a: a2, b, alpha }, xyzFromLAB); +} +function colorFromOKLAB(l, a2, b, alpha = 1) { + return labToColor({ l, a: a2, b, alpha }, xyzFromOKLAB); +} +var DEGREES_TO_RADIANS_FACTOR = Math.PI / 180; +function labFromLCH(l, c, h, alpha = 1) { + return { + l, + a: c * Math.cos(h * DEGREES_TO_RADIANS_FACTOR), + b: c * Math.sin(h * DEGREES_TO_RADIANS_FACTOR), + alpha + }; +} +function colorFromLCH(l, c, h, alpha = 1) { + const lab = labFromLCH(l, c, h, alpha); + return colorFromLAB(lab.l, lab.a, lab.b, alpha); +} +function colorFromOKLCH(l, c, h, alpha = 1) { + const lab = labFromLCH(l, c, h, alpha); + return colorFromOKLAB(lab.l, lab.a, lab.b, alpha); +} +function getColorValue(node) { + if (node.type === NodeType.HexColorValue) { + const text = node.getText(); + return colorFromHex(text); + } else if (node.type === NodeType.Function) { + const functionNode = node; + const name = functionNode.getName(); + let colorValues = functionNode.getArguments().getChildren(); + if (colorValues.length === 1) { + const functionArg = colorValues[0].getChildren(); + if (functionArg.length === 1 && functionArg[0].type === NodeType.Expression) { + colorValues = functionArg[0].getChildren(); + if (colorValues.length === 3) { + const lastValue = colorValues[2]; + if (lastValue instanceof BinaryExpression) { + const left = lastValue.getLeft(), right = lastValue.getRight(), operator = lastValue.getOperator(); + if (left && right && operator && operator.matches("/")) { + colorValues = [colorValues[0], colorValues[1], left, right]; + } + } + } + } + } + if (!name || colorValues.length < 3 || colorValues.length > 4) { + return null; + } + try { + const alpha = colorValues.length === 4 ? getNumericValue(colorValues[3], 1) : 1; + switch (name) { + case "rgb": + case "rgba": { + return { + red: getNumericValue(colorValues[0], 255), + green: getNumericValue(colorValues[1], 255), + blue: getNumericValue(colorValues[2], 255), + alpha + }; + } + case "hsl": + case "hsla": { + const h = getAngle(colorValues[0]); + const s = getNumericValue(colorValues[1], 100); + const l = getNumericValue(colorValues[2], 100); + return colorFromHSL(h, s, l, alpha); + } + case "hwb": { + const h = getAngle(colorValues[0]); + const w = getNumericValue(colorValues[1], 100); + const b = getNumericValue(colorValues[2], 100); + return colorFromHWB(h, w, b, alpha); + } + case "lab": { + const l = getNumericValue(colorValues[0], 100); + const a2 = getNumericValue(colorValues[1], 125, -1); + const b = getNumericValue(colorValues[2], 125, -1); + return colorFromLAB(l * 100, a2 * 125, b * 125, alpha); + } + case "lch": { + const l = getNumericValue(colorValues[0], 100); + const c = getNumericValue(colorValues[1], 230); + const h = getAngle(colorValues[2]); + return colorFromLCH(l * 100, c * 230, h, alpha); + } + case "oklab": { + const l = getNumericValue(colorValues[0], 1); + const a2 = getNumericValue(colorValues[1], 0.4, -1); + const b = getNumericValue(colorValues[2], 0.4, -1); + return colorFromOKLAB(l, a2 * 0.4, b * 0.4, alpha); + } + case "oklch": { + const l = getNumericValue(colorValues[0], 1); + const c = getNumericValue(colorValues[1], 0.4); + const h = getAngle(colorValues[2]); + return colorFromOKLCH(l, c * 0.4, h, alpha); + } + } + } catch { + return null; + } + } else if (node.type === NodeType.Identifier) { + if (node.parent && node.parent.type !== NodeType.Term) { + return null; + } + const term = node.parent; + if (term && term.parent && term.parent.type === NodeType.BinaryExpression) { + const expression = term.parent; + if (expression.parent && expression.parent.type === NodeType.ListEntry && expression.parent.key === expression) { + return null; + } + } + const candidateColor = node.getText().toLowerCase(); + if (candidateColor === "none") { + return null; + } + const colorHex = colors[candidateColor]; + if (colorHex) { + return colorFromHex(colorHex); + } + } + return null; +} + +// node_modules/vscode-css-languageservice/lib/esm/languageFacts/builtinData.js +var positionKeywords = { + "bottom": "Computes to \u2018100%\u2019 for the vertical position if one or two values are given, otherwise specifies the bottom edge as the origin for the next offset.", + "center": "Computes to \u201850%\u2019 (\u2018left 50%\u2019) for the horizontal position if the horizontal position is not otherwise specified, or \u201850%\u2019 (\u2018top 50%\u2019) for the vertical position if it is.", + "left": "Computes to \u20180%\u2019 for the horizontal position if one or two values are given, otherwise specifies the left edge as the origin for the next offset.", + "right": "Computes to \u2018100%\u2019 for the horizontal position if one or two values are given, otherwise specifies the right edge as the origin for the next offset.", + "top": "Computes to \u20180%\u2019 for the vertical position if one or two values are given, otherwise specifies the top edge as the origin for the next offset." +}; +var repeatStyleKeywords = { + "no-repeat": "Placed once and not repeated in this direction.", + "repeat": "Repeated in this direction as often as needed to cover the background painting area.", + "repeat-x": "Computes to \u2018repeat no-repeat\u2019.", + "repeat-y": "Computes to \u2018no-repeat repeat\u2019.", + "round": "Repeated as often as will fit within the background positioning area. If it doesn\u2019t fit a whole number of times, it is rescaled so that it does.", + "space": "Repeated as often as will fit within the background positioning area without being clipped and then the images are spaced out to fill the area." +}; +var lineStyleKeywords = { + "dashed": "A series of square-ended dashes.", + "dotted": "A series of round dots.", + "double": "Two parallel solid lines with some space between them.", + "groove": "Looks as if it were carved in the canvas.", + "hidden": "Same as \u2018none\u2019, but has different behavior in the border conflict resolution rules for border-collapsed tables.", + "inset": "Looks as if the content on the inside of the border is sunken into the canvas.", + "none": "No border. Color and width are ignored.", + "outset": "Looks as if the content on the inside of the border is coming out of the canvas.", + "ridge": "Looks as if it were coming out of the canvas.", + "solid": "A single line segment." +}; +var lineWidthKeywords = ["medium", "thick", "thin"]; +var boxKeywords = { + "border-box": "The background is painted within (clipped to) the border box.", + "content-box": "The background is painted within (clipped to) the content box.", + "padding-box": "The background is painted within (clipped to) the padding box." +}; +var geometryBoxKeywords = { + "margin-box": "Uses the margin box as reference box.", + "fill-box": "Uses the object bounding box as reference box.", + "stroke-box": "Uses the stroke bounding box as reference box.", + "view-box": "Uses the nearest SVG viewport as reference box." +}; +var cssWideKeywords = { + "initial": "Represents the value specified as the property\u2019s initial value.", + "inherit": "Represents the computed value of the property on the element\u2019s parent.", + "unset": "Acts as either `inherit` or `initial`, depending on whether the property is inherited or not." +}; +var cssWideFunctions = { + "var()": "Evaluates the value of a custom variable.", + "calc()": "Evaluates an mathematical expression. The following operators can be used: + - * /.", + "if()": "Evaluates a conditional expression." +}; +var imageFunctions = { + "url()": "Reference an image file by URL", + "image()": "Provide image fallbacks and annotations.", + "-webkit-image-set()": "Provide multiple resolutions. Remember to use unprefixed image-set() in addition.", + "image-set()": "Provide multiple resolutions of an image and const the UA decide which is most appropriate in a given situation.", + "-moz-element()": "Use an element in the document as an image. Remember to use unprefixed element() in addition.", + "element()": "Use an element in the document as an image.", + "cross-fade()": "Indicates the two images to be combined and how far along in the transition the combination is.", + "-webkit-gradient()": "Deprecated. Use modern linear-gradient() or radial-gradient() instead.", + "-webkit-linear-gradient()": "Linear gradient. Remember to use unprefixed version in addition.", + "-moz-linear-gradient()": "Linear gradient. Remember to use unprefixed version in addition.", + "-o-linear-gradient()": "Linear gradient. Remember to use unprefixed version in addition.", + "linear-gradient()": "A linear gradient is created by specifying a straight gradient line, and then several colors placed along that line.", + "-webkit-repeating-linear-gradient()": "Repeating Linear gradient. Remember to use unprefixed version in addition.", + "-moz-repeating-linear-gradient()": "Repeating Linear gradient. Remember to use unprefixed version in addition.", + "-o-repeating-linear-gradient()": "Repeating Linear gradient. Remember to use unprefixed version in addition.", + "repeating-linear-gradient()": "Same as linear-gradient, except the color-stops are repeated infinitely in both directions, with their positions shifted by multiples of the difference between the last specified color-stop\u2019s position and the first specified color-stop\u2019s position.", + "-webkit-radial-gradient()": "Radial gradient. Remember to use unprefixed version in addition.", + "-moz-radial-gradient()": "Radial gradient. Remember to use unprefixed version in addition.", + "radial-gradient()": "Colors emerge from a single point and smoothly spread outward in a circular or elliptical shape.", + "-webkit-repeating-radial-gradient()": "Repeating radial gradient. Remember to use unprefixed version in addition.", + "-moz-repeating-radial-gradient()": "Repeating radial gradient. Remember to use unprefixed version in addition.", + "repeating-radial-gradient()": "Same as radial-gradient, except the color-stops are repeated infinitely in both directions, with their positions shifted by multiples of the difference between the last specified color-stop\u2019s position and the first specified color-stop\u2019s position." +}; +var transitionTimingFunctions = { + "ease": "Equivalent to cubic-bezier(0.25, 0.1, 0.25, 1.0).", + "ease-in": "Equivalent to cubic-bezier(0.42, 0, 1.0, 1.0).", + "ease-in-out": "Equivalent to cubic-bezier(0.42, 0, 0.58, 1.0).", + "ease-out": "Equivalent to cubic-bezier(0, 0, 0.58, 1.0).", + "linear": "Equivalent to cubic-bezier(0.0, 0.0, 1.0, 1.0).", + "step-end": "Equivalent to steps(1, end).", + "step-start": "Equivalent to steps(1, start).", + "steps()": "The first parameter specifies the number of intervals in the function. The second parameter, which is optional, is either the value \u201Cstart\u201D or \u201Cend\u201D.", + "cubic-bezier()": "Specifies a cubic-bezier curve. The four values specify points P1 and P2 of the curve as (x1, y1, x2, y2).", + "cubic-bezier(0.6, -0.28, 0.735, 0.045)": "Ease-in Back. Overshoots.", + "cubic-bezier(0.68, -0.55, 0.265, 1.55)": "Ease-in-out Back. Overshoots.", + "cubic-bezier(0.175, 0.885, 0.32, 1.275)": "Ease-out Back. Overshoots.", + "cubic-bezier(0.6, 0.04, 0.98, 0.335)": "Ease-in Circular. Based on half circle.", + "cubic-bezier(0.785, 0.135, 0.15, 0.86)": "Ease-in-out Circular. Based on half circle.", + "cubic-bezier(0.075, 0.82, 0.165, 1)": "Ease-out Circular. Based on half circle.", + "cubic-bezier(0.55, 0.055, 0.675, 0.19)": "Ease-in Cubic. Based on power of three.", + "cubic-bezier(0.645, 0.045, 0.355, 1)": "Ease-in-out Cubic. Based on power of three.", + "cubic-bezier(0.215, 0.610, 0.355, 1)": "Ease-out Cubic. Based on power of three.", + "cubic-bezier(0.95, 0.05, 0.795, 0.035)": "Ease-in Exponential. Based on two to the power ten.", + "cubic-bezier(1, 0, 0, 1)": "Ease-in-out Exponential. Based on two to the power ten.", + "cubic-bezier(0.19, 1, 0.22, 1)": "Ease-out Exponential. Based on two to the power ten.", + "cubic-bezier(0.47, 0, 0.745, 0.715)": "Ease-in Sine.", + "cubic-bezier(0.445, 0.05, 0.55, 0.95)": "Ease-in-out Sine.", + "cubic-bezier(0.39, 0.575, 0.565, 1)": "Ease-out Sine.", + "cubic-bezier(0.55, 0.085, 0.68, 0.53)": "Ease-in Quadratic. Based on power of two.", + "cubic-bezier(0.455, 0.03, 0.515, 0.955)": "Ease-in-out Quadratic. Based on power of two.", + "cubic-bezier(0.25, 0.46, 0.45, 0.94)": "Ease-out Quadratic. Based on power of two.", + "cubic-bezier(0.895, 0.03, 0.685, 0.22)": "Ease-in Quartic. Based on power of four.", + "cubic-bezier(0.77, 0, 0.175, 1)": "Ease-in-out Quartic. Based on power of four.", + "cubic-bezier(0.165, 0.84, 0.44, 1)": "Ease-out Quartic. Based on power of four.", + "cubic-bezier(0.755, 0.05, 0.855, 0.06)": "Ease-in Quintic. Based on power of five.", + "cubic-bezier(0.86, 0, 0.07, 1)": "Ease-in-out Quintic. Based on power of five.", + "cubic-bezier(0.23, 1, 0.320, 1)": "Ease-out Quintic. Based on power of five." +}; +var basicShapeFunctions = { + "circle()": "Defines a circle.", + "ellipse()": "Defines an ellipse.", + "inset()": "Defines an inset rectangle.", + "polygon()": "Defines a polygon." +}; +var units = { + "length": ["cap", "ch", "cm", "cqb", "cqh", "cqi", "cqmax", "cqmin", "cqw", "dvb", "dvh", "dvi", "dvw", "em", "ex", "ic", "in", "lh", "lvb", "lvh", "lvi", "lvw", "mm", "pc", "pt", "px", "q", "rcap", "rch", "rem", "rex", "ric", "rlh", "svb", "svh", "svi", "svw", "vb", "vh", "vi", "vmax", "vmin", "vw"], + "angle": ["deg", "rad", "grad", "turn"], + "time": ["ms", "s"], + "frequency": ["Hz", "kHz"], + "resolution": ["dpi", "dpcm", "dppx"], + "percentage": ["%", "fr"] +}; +var html5Tags = [ + "a", + "abbr", + "address", + "area", + "article", + "aside", + "audio", + "b", + "base", + "bdi", + "bdo", + "blockquote", + "body", + "br", + "button", + "canvas", + "caption", + "cite", + "code", + "col", + "colgroup", + "data", + "datalist", + "dd", + "del", + "details", + "dfn", + "dialog", + "div", + "dl", + "dt", + "em", + "embed", + "fieldset", + "figcaption", + "figure", + "footer", + "form", + "h1", + "h2", + "h3", + "h4", + "h5", + "h6", + "head", + "header", + "hgroup", + "hr", + "html", + "i", + "iframe", + "img", + "input", + "ins", + "kbd", + "keygen", + "label", + "legend", + "li", + "link", + "main", + "map", + "mark", + "menu", + "menuitem", + "meta", + "meter", + "nav", + "noscript", + "object", + "ol", + "optgroup", + "option", + "output", + "p", + "param", + "picture", + "pre", + "progress", + "q", + "rb", + "rp", + "rt", + "rtc", + "ruby", + "s", + "samp", + "script", + "section", + "select", + "small", + "source", + "span", + "strong", + "style", + "sub", + "summary", + "sup", + "table", + "tbody", + "td", + "template", + "textarea", + "tfoot", + "th", + "thead", + "time", + "title", + "tr", + "track", + "u", + "ul", + "const", + "video", + "wbr" +]; +var svgElements = [ + "circle", + "clipPath", + "cursor", + "defs", + "desc", + "ellipse", + "feBlend", + "feColorMatrix", + "feComponentTransfer", + "feComposite", + "feConvolveMatrix", + "feDiffuseLighting", + "feDisplacementMap", + "feDistantLight", + "feDropShadow", + "feFlood", + "feFuncA", + "feFuncB", + "feFuncG", + "feFuncR", + "feGaussianBlur", + "feImage", + "feMerge", + "feMergeNode", + "feMorphology", + "feOffset", + "fePointLight", + "feSpecularLighting", + "feSpotLight", + "feTile", + "feTurbulence", + "filter", + "foreignObject", + "g", + "hatch", + "hatchpath", + "image", + "line", + "linearGradient", + "marker", + "mask", + "mesh", + "meshpatch", + "meshrow", + "metadata", + "mpath", + "path", + "pattern", + "polygon", + "polyline", + "radialGradient", + "rect", + "set", + "solidcolor", + "stop", + "svg", + "switch", + "symbol", + "text", + "textPath", + "tspan", + "use", + "view" +]; +var pageBoxDirectives = [ + "@bottom-center", + "@bottom-left", + "@bottom-left-corner", + "@bottom-right", + "@bottom-right-corner", + "@left-bottom", + "@left-middle", + "@left-top", + "@right-bottom", + "@right-middle", + "@right-top", + "@top-center", + "@top-left", + "@top-left-corner", + "@top-right", + "@top-right-corner" +]; + +// node_modules/vscode-css-languageservice/lib/esm/utils/objects.js +function values(obj) { + return Object.keys(obj).map((key) => obj[key]); +} +function isDefined(obj) { + return typeof obj !== "undefined"; +} + +// node_modules/vscode-css-languageservice/lib/esm/parser/cssParser.js +var Parser = class { + constructor(scnr = new Scanner()) { + this.keyframeRegex = /^@(\-(webkit|ms|moz|o)\-)?keyframes$/i; + this.scanner = scnr; + this.token = { type: TokenType.EOF, offset: -1, len: 0, text: "" }; + this.prevToken = void 0; + } + peekIdent(text) { + return TokenType.Ident === this.token.type && text.length === this.token.text.length && text === this.token.text.toLowerCase(); + } + peekKeyword(text) { + return TokenType.AtKeyword === this.token.type && text.length === this.token.text.length && text === this.token.text.toLowerCase(); + } + peekDelim(text) { + return TokenType.Delim === this.token.type && text === this.token.text; + } + peek(type) { + return type === this.token.type; + } + peekOne(...types) { + return types.indexOf(this.token.type) !== -1; + } + peekRegExp(type, regEx) { + if (type !== this.token.type) { + return false; + } + return regEx.test(this.token.text); + } + hasWhitespace() { + return !!this.prevToken && this.prevToken.offset + this.prevToken.len !== this.token.offset; + } + consumeToken() { + this.prevToken = this.token; + this.token = this.scanner.scan(); + } + acceptUnicodeRange() { + const token = this.scanner.tryScanUnicode(); + if (token) { + this.prevToken = token; + this.token = this.scanner.scan(); + return true; + } + return false; + } + mark() { + return { + prev: this.prevToken, + curr: this.token, + pos: this.scanner.pos() + }; + } + restoreAtMark(mark) { + this.prevToken = mark.prev; + this.token = mark.curr; + this.scanner.goBackTo(mark.pos); + } + try(func) { + const pos = this.mark(); + const node = func(); + if (!node) { + this.restoreAtMark(pos); + return null; + } + return node; + } + acceptOneKeyword(keywords) { + if (TokenType.AtKeyword === this.token.type) { + for (const keyword of keywords) { + if (keyword.length === this.token.text.length && keyword === this.token.text.toLowerCase()) { + this.consumeToken(); + return true; + } + } + } + return false; + } + accept(type) { + if (type === this.token.type) { + this.consumeToken(); + return true; + } + return false; + } + acceptIdent(text) { + if (this.peekIdent(text)) { + this.consumeToken(); + return true; + } + return false; + } + acceptKeyword(text) { + if (this.peekKeyword(text)) { + this.consumeToken(); + return true; + } + return false; + } + acceptDelim(text) { + if (this.peekDelim(text)) { + this.consumeToken(); + return true; + } + return false; + } + acceptRegexp(regEx) { + if (regEx.test(this.token.text)) { + this.consumeToken(); + return true; + } + return false; + } + _parseRegexp(regEx) { + let node = this.createNode(NodeType.Identifier); + do { + } while (this.acceptRegexp(regEx)); + return this.finish(node); + } + acceptUnquotedString() { + const pos = this.scanner.pos(); + this.scanner.goBackTo(this.token.offset); + const unquoted = this.scanner.scanUnquotedString(); + if (unquoted) { + this.token = unquoted; + this.consumeToken(); + return true; + } + this.scanner.goBackTo(pos); + return false; + } + resync(resyncTokens, resyncStopTokens) { + while (true) { + if (resyncTokens && resyncTokens.indexOf(this.token.type) !== -1) { + this.consumeToken(); + return true; + } else if (resyncStopTokens && resyncStopTokens.indexOf(this.token.type) !== -1) { + return true; + } else { + if (this.token.type === TokenType.EOF) { + return false; + } + this.token = this.scanner.scan(); + } + } + } + createNode(nodeType) { + return new Node(this.token.offset, this.token.len, nodeType); + } + create(ctor) { + return new ctor(this.token.offset, this.token.len); + } + finish(node, error, resyncTokens, resyncStopTokens) { + if (!(node instanceof Nodelist)) { + if (error) { + this.markError(node, error, resyncTokens, resyncStopTokens); + } + if (this.prevToken) { + const prevEnd = this.prevToken.offset + this.prevToken.len; + node.length = prevEnd > node.offset ? prevEnd - node.offset : 0; + } + } + return node; + } + markError(node, error, resyncTokens, resyncStopTokens) { + if (this.token !== this.lastErrorToken) { + node.addIssue(new Marker(node, error, Level.Error, void 0, this.token.offset, this.token.len)); + this.lastErrorToken = this.token; + } + if (resyncTokens || resyncStopTokens) { + this.resync(resyncTokens, resyncStopTokens); + } + } + parseStylesheet(textDocument) { + const versionId = textDocument.version; + const text = textDocument.getText(); + const textProvider = (offset, length) => { + if (textDocument.version !== versionId) { + throw new Error("Underlying model has changed, AST is no longer valid"); + } + return text.substr(offset, length); + }; + return this.internalParse(text, this._parseStylesheet, textProvider); + } + internalParse(input, parseFunc, textProvider) { + this.scanner.setSource(input); + this.token = this.scanner.scan(); + const node = parseFunc.bind(this)(); + if (node) { + if (textProvider) { + node.textProvider = textProvider; + } else { + node.textProvider = (offset, length) => { + return input.substr(offset, length); + }; + } + } + return node; + } + _parseStylesheet() { + const node = this.create(Stylesheet); + while (node.addChild(this._parseStylesheetStart())) { + } + let inRecovery = false; + do { + let hasMatch = false; + do { + hasMatch = false; + const statement = this._parseStylesheetStatement(); + if (statement) { + node.addChild(statement); + hasMatch = true; + inRecovery = false; + if (!this.peek(TokenType.EOF) && this._needsSemicolonAfter(statement) && !this.accept(TokenType.SemiColon)) { + this.markError(node, ParseError.SemiColonExpected); + } + } + while (this.accept(TokenType.SemiColon) || this.accept(TokenType.CDO) || this.accept(TokenType.CDC)) { + hasMatch = true; + inRecovery = false; + } + } while (hasMatch); + if (this.peek(TokenType.EOF)) { + break; + } + if (!inRecovery) { + if (this.peek(TokenType.AtKeyword)) { + this.markError(node, ParseError.UnknownAtRule); + } else { + this.markError(node, ParseError.RuleOrSelectorExpected); + } + inRecovery = true; + } + this.consumeToken(); + } while (!this.peek(TokenType.EOF)); + return this.finish(node); + } + _parseStylesheetStart() { + return this._parseCharset(); + } + _parseStylesheetStatement(isNested = false) { + if (this.peek(TokenType.AtKeyword)) { + return this._parseStylesheetAtStatement(isNested); + } + return this._parseRuleset(isNested); + } + _parseStylesheetAtStatement(isNested = false) { + return this._parseImport() || this._parseMedia(isNested) || this._parseScope() || this._parsePage() || this._parseFontFace() || this._parseKeyframe() || this._parseSupports(isNested) || this._parseLayer(isNested) || this._parsePropertyAtRule() || this._parseViewPort() || this._parseNamespace() || this._parseDocument() || this._parseContainer(isNested) || this._parseStartingStyleAtRule(isNested) || this._parseUnknownAtRule(); + } + _tryParseRuleset(isNested) { + const mark = this.mark(); + if (this._parseSelector(isNested)) { + while (this.accept(TokenType.Comma) && this._parseSelector(isNested)) { + } + if (this.accept(TokenType.CurlyL)) { + this.restoreAtMark(mark); + return this._parseRuleset(isNested); + } + } + this.restoreAtMark(mark); + return null; + } + _parseRuleset(isNested = false) { + const node = this.create(RuleSet); + const selectors = node.getSelectors(); + if (!selectors.addChild(this._parseSelector(isNested))) { + return null; + } + while (this.accept(TokenType.Comma)) { + if (!selectors.addChild(this._parseSelector(isNested))) { + return this.finish(node, ParseError.SelectorExpected); + } + } + return this._parseBody(node, this._parseRuleSetDeclaration.bind(this)); + } + _parseRuleSetDeclarationAtStatement() { + return this._parseMedia(true) || this._parseScope() || this._parseSupports(true) || this._parseLayer(true) || this._parseContainer(true) || this._parseStartingStyleAtRule(true) || this._parseUnknownAtRule(); + } + _parseRuleSetDeclaration() { + if (this.peek(TokenType.AtKeyword)) { + return this._parseRuleSetDeclarationAtStatement(); + } + if (!this.peek(TokenType.Ident)) { + return this._parseRuleset(true); + } + return this._tryParseRuleset(true) || this._parseDeclaration(); + } + _needsSemicolonAfter(node) { + switch (node.type) { + case NodeType.Keyframe: + case NodeType.ViewPort: + case NodeType.Media: + case NodeType.Ruleset: + case NodeType.Namespace: + case NodeType.If: + case NodeType.For: + case NodeType.Each: + case NodeType.While: + case NodeType.MixinDeclaration: + case NodeType.FunctionDeclaration: + case NodeType.MixinContentDeclaration: + case NodeType.Scope: + return false; + case NodeType.ExtendsReference: + case NodeType.MixinContentReference: + case NodeType.ReturnStatement: + case NodeType.MediaQuery: + case NodeType.Debug: + case NodeType.Import: + case NodeType.AtApplyRule: + case NodeType.CustomPropertyDeclaration: + return true; + case NodeType.VariableDeclaration: + return node.needsSemicolon; + case NodeType.MixinReference: + return !node.getContent(); + case NodeType.Declaration: + return !node.getNestedProperties(); + } + return false; + } + _parseDeclarations(parseDeclaration) { + const node = this.create(Declarations); + if (!this.accept(TokenType.CurlyL)) { + return null; + } + let decl = parseDeclaration(); + while (node.addChild(decl)) { + if (this.peek(TokenType.CurlyR)) { + break; + } + if (this._needsSemicolonAfter(decl) && !this.accept(TokenType.SemiColon)) { + return this.finish(node, ParseError.SemiColonExpected, [TokenType.SemiColon, TokenType.CurlyR]); + } + if (decl && this.prevToken && this.prevToken.type === TokenType.SemiColon) { + decl.semicolonPosition = this.prevToken.offset; + } + while (this.accept(TokenType.SemiColon)) { + } + decl = parseDeclaration(); + } + if (!this.accept(TokenType.CurlyR)) { + return this.finish(node, ParseError.RightCurlyExpected, [TokenType.CurlyR, TokenType.SemiColon]); + } + return this.finish(node); + } + _parseBody(node, parseDeclaration) { + if (!node.setDeclarations(this._parseDeclarations(parseDeclaration))) { + return this.finish(node, ParseError.LeftCurlyExpected, [TokenType.CurlyR, TokenType.SemiColon]); + } + return this.finish(node); + } + _parseSelector(isNested) { + const node = this.create(Selector); + let hasContent = false; + if (isNested) { + hasContent = node.addChild(this._parseCombinator()); + } + while (node.addChild(this._parseSimpleSelector())) { + hasContent = true; + node.addChild(this._parseCombinator()); + } + return hasContent ? this.finish(node) : null; + } + _parseDeclaration(stopTokens, standaloneCustomPropertyValid = false) { + const customProperty = this._tryParseCustomPropertyDeclaration(stopTokens, standaloneCustomPropertyValid); + if (customProperty) { + return customProperty; + } + const node = this.create(Declaration); + if (!node.setProperty(this._parseProperty())) { + return null; + } + if (!this.accept(TokenType.Colon)) { + return this.finish(node, ParseError.ColonExpected, [TokenType.Colon], stopTokens || [TokenType.SemiColon]); + } + if (this.prevToken) { + node.colonPosition = this.prevToken.offset; + } + if (!node.setValue(this._parseExpr())) { + return this.finish(node, ParseError.PropertyValueExpected); + } + node.addChild(this._parsePrio()); + if (this.peek(TokenType.SemiColon)) { + node.semicolonPosition = this.token.offset; + } + return this.finish(node); + } + _tryParseCustomPropertyDeclaration(stopTokens, standaloneCustomPropertyValid = false) { + if (!this.peekRegExp(TokenType.Ident, /^--/)) { + return null; + } + const node = this.create(CustomPropertyDeclaration); + if (!node.setProperty(this._parseProperty())) { + return null; + } + if (!this.accept(TokenType.Colon)) { + if (standaloneCustomPropertyValid) { + return this.finish(node); + } + return this.finish(node, ParseError.ColonExpected, [TokenType.Colon]); + } + if (this.prevToken) { + node.colonPosition = this.prevToken.offset; + } + const mark = this.mark(); + if (this.peek(TokenType.CurlyL)) { + const propertySet = this.create(CustomPropertySet); + const declarations = this._parseDeclarations(this._parseRuleSetDeclaration.bind(this)); + if (propertySet.setDeclarations(declarations) && !declarations.isErroneous(true)) { + propertySet.addChild(this._parsePrio()); + if (this.peek(TokenType.SemiColon)) { + this.finish(propertySet); + node.setPropertySet(propertySet); + node.semicolonPosition = this.token.offset; + return this.finish(node); + } + } + this.restoreAtMark(mark); + } + const expression = this._parseExpr(); + if (expression && !expression.isErroneous(true)) { + this._parsePrio(); + if (this.peekOne(...stopTokens || [], TokenType.SemiColon, TokenType.EOF)) { + node.setValue(expression); + if (this.peek(TokenType.SemiColon)) { + node.semicolonPosition = this.token.offset; + } + return this.finish(node); + } + } + this.restoreAtMark(mark); + node.addChild(this._parseCustomPropertyValue(stopTokens)); + node.addChild(this._parsePrio()); + if (isDefined(node.colonPosition) && this.token.offset === node.colonPosition + 1) { + return this.finish(node, ParseError.PropertyValueExpected); + } + return this.finish(node); + } + /** + * Parse custom property values. + * + * Based on https://www.w3.org/TR/css-variables/#syntax + * + * This code is somewhat unusual, as the allowed syntax is incredibly broad, + * parsing almost any sequence of tokens, save for a small set of exceptions. + * Unbalanced delimitors, invalid tokens, and declaration + * terminators like semicolons and !important directives (when not inside + * of delimitors). + */ + _parseCustomPropertyValue(stopTokens = [TokenType.CurlyR]) { + const node = this.create(Node); + const isTopLevel = () => curlyDepth === 0 && parensDepth === 0 && bracketsDepth === 0; + const onStopToken = () => stopTokens.indexOf(this.token.type) !== -1; + let curlyDepth = 0; + let parensDepth = 0; + let bracketsDepth = 0; + done: while (true) { + switch (this.token.type) { + case TokenType.SemiColon: + if (isTopLevel()) { + break done; + } + break; + case TokenType.Exclamation: + if (isTopLevel()) { + break done; + } + break; + case TokenType.CurlyL: + curlyDepth++; + break; + case TokenType.CurlyR: + curlyDepth--; + if (curlyDepth < 0) { + if (onStopToken() && parensDepth === 0 && bracketsDepth === 0) { + break done; + } + return this.finish(node, ParseError.LeftCurlyExpected); + } + break; + case TokenType.ParenthesisL: + parensDepth++; + break; + case TokenType.ParenthesisR: + parensDepth--; + if (parensDepth < 0) { + if (onStopToken() && bracketsDepth === 0 && curlyDepth === 0) { + break done; + } + return this.finish(node, ParseError.LeftParenthesisExpected); + } + break; + case TokenType.BracketL: + bracketsDepth++; + break; + case TokenType.BracketR: + bracketsDepth--; + if (bracketsDepth < 0) { + return this.finish(node, ParseError.LeftSquareBracketExpected); + } + break; + case TokenType.BadString: + break done; + case TokenType.EOF: + let error = ParseError.RightCurlyExpected; + if (bracketsDepth > 0) { + error = ParseError.RightSquareBracketExpected; + } else if (parensDepth > 0) { + error = ParseError.RightParenthesisExpected; + } + return this.finish(node, error); + } + this.consumeToken(); + } + return this.finish(node); + } + _tryToParseDeclaration(stopTokens) { + const mark = this.mark(); + if (this._parseProperty() && this.accept(TokenType.Colon)) { + this.restoreAtMark(mark); + return this._parseDeclaration(stopTokens); + } + this.restoreAtMark(mark); + return null; + } + _parseProperty() { + const node = this.create(Property); + const mark = this.mark(); + if (this.acceptDelim("*") || this.acceptDelim("_")) { + if (this.hasWhitespace()) { + this.restoreAtMark(mark); + return null; + } + } + if (node.setIdentifier(this._parsePropertyIdentifier())) { + return this.finish(node); + } + return null; + } + _parsePropertyIdentifier() { + return this._parseIdent(); + } + _parseCharset() { + if (!this.peek(TokenType.Charset)) { + return null; + } + const node = this.create(Node); + this.consumeToken(); + if (!this.accept(TokenType.String)) { + return this.finish(node, ParseError.IdentifierExpected); + } + if (!this.accept(TokenType.SemiColon)) { + return this.finish(node, ParseError.SemiColonExpected); + } + return this.finish(node); + } + _parseImport() { + if (!this.peekKeyword("@import")) { + return null; + } + const node = this.create(Import); + this.consumeToken(); + if (!node.addChild(this._parseURILiteral()) && !node.addChild(this._parseStringLiteral())) { + return this.finish(node, ParseError.URIOrStringExpected); + } + return this._completeParseImport(node); + } + _completeParseImport(node) { + if (this.acceptIdent("layer")) { + if (this.accept(TokenType.ParenthesisL)) { + if (!node.addChild(this._parseLayerName())) { + return this.finish(node, ParseError.IdentifierExpected, [TokenType.SemiColon]); + } + if (!this.accept(TokenType.ParenthesisR)) { + return this.finish(node, ParseError.RightParenthesisExpected, [TokenType.ParenthesisR], []); + } + } + } + if (this.acceptIdent("supports")) { + if (this.accept(TokenType.ParenthesisL)) { + node.addChild(this._tryToParseDeclaration() || this._parseSupportsCondition()); + if (!this.accept(TokenType.ParenthesisR)) { + return this.finish(node, ParseError.RightParenthesisExpected, [TokenType.ParenthesisR], []); + } + } + } + if (!this.peek(TokenType.SemiColon) && !this.peek(TokenType.EOF)) { + node.setMedialist(this._parseMediaQueryList()); + } + return this.finish(node); + } + _parseNamespace() { + if (!this.peekKeyword("@namespace")) { + return null; + } + const node = this.create(Namespace); + this.consumeToken(); + if (!node.addChild(this._parseURILiteral())) { + node.addChild(this._parseIdent()); + if (!node.addChild(this._parseURILiteral()) && !node.addChild(this._parseStringLiteral())) { + return this.finish(node, ParseError.URIExpected, [TokenType.SemiColon]); + } + } + if (!this.accept(TokenType.SemiColon)) { + return this.finish(node, ParseError.SemiColonExpected); + } + return this.finish(node); + } + _parseFontFace() { + if (!this.peekKeyword("@font-face")) { + return null; + } + const node = this.create(FontFace); + this.consumeToken(); + return this._parseBody(node, this._parseRuleSetDeclaration.bind(this)); + } + _parseViewPort() { + if (!this.peekKeyword("@-ms-viewport") && !this.peekKeyword("@-o-viewport") && !this.peekKeyword("@viewport")) { + return null; + } + const node = this.create(ViewPort); + this.consumeToken(); + return this._parseBody(node, this._parseRuleSetDeclaration.bind(this)); + } + _parseKeyframe() { + if (!this.peekRegExp(TokenType.AtKeyword, this.keyframeRegex)) { + return null; + } + const node = this.create(Keyframe); + const atNode = this.create(Node); + this.consumeToken(); + node.setKeyword(this.finish(atNode)); + if (atNode.matches("@-ms-keyframes")) { + this.markError(atNode, ParseError.UnknownKeyword); + } + if (!node.setIdentifier(this._parseKeyframeIdent())) { + return this.finish(node, ParseError.IdentifierExpected, [TokenType.CurlyR]); + } + return this._parseBody(node, this._parseKeyframeSelector.bind(this)); + } + _parseKeyframeIdent() { + return this._parseIdent([ReferenceType.Keyframe]); + } + _parseKeyframeSelector() { + const node = this.create(KeyframeSelector); + let hasContent = false; + if (node.addChild(this._parseIdent())) { + hasContent = true; + } + if (this.accept(TokenType.Percentage)) { + hasContent = true; + } + if (!hasContent) { + return null; + } + while (this.accept(TokenType.Comma)) { + hasContent = false; + if (node.addChild(this._parseIdent())) { + hasContent = true; + } + if (this.accept(TokenType.Percentage)) { + hasContent = true; + } + if (!hasContent) { + return this.finish(node, ParseError.PercentageExpected); + } + } + return this._parseBody(node, this._parseRuleSetDeclaration.bind(this)); + } + _tryParseKeyframeSelector() { + const node = this.create(KeyframeSelector); + const pos = this.mark(); + let hasContent = false; + if (node.addChild(this._parseIdent())) { + hasContent = true; + } + if (this.accept(TokenType.Percentage)) { + hasContent = true; + } + if (!hasContent) { + return null; + } + while (this.accept(TokenType.Comma)) { + hasContent = false; + if (node.addChild(this._parseIdent())) { + hasContent = true; + } + if (this.accept(TokenType.Percentage)) { + hasContent = true; + } + if (!hasContent) { + this.restoreAtMark(pos); + return null; + } + } + if (!this.peek(TokenType.CurlyL)) { + this.restoreAtMark(pos); + return null; + } + return this._parseBody(node, this._parseRuleSetDeclaration.bind(this)); + } + _parsePropertyAtRule() { + if (!this.peekKeyword("@property")) { + return null; + } + const node = this.create(PropertyAtRule); + this.consumeToken(); + if (!this.peekRegExp(TokenType.Ident, /^--/) || !node.setName(this._parseIdent([ReferenceType.Property]))) { + return this.finish(node, ParseError.IdentifierExpected); + } + return this._parseBody(node, this._parseDeclaration.bind(this)); + } + _parseStartingStyleAtRule(isNested = false) { + if (!this.peekKeyword("@starting-style")) { + return null; + } + const node = this.create(StartingStyleAtRule); + this.consumeToken(); + return this._parseBody(node, this._parseStartingStyleDeclaration.bind(this, isNested)); + } + // this method is the same as ._parseContainerDeclaration() + // which is the same as ._parseMediaDeclaration(), + // _parseSupportsDeclaration, and ._parseLayerDeclaration() + _parseStartingStyleDeclaration(isNested = false) { + if (isNested) { + return this._tryParseRuleset(true) || this._tryToParseDeclaration() || this._parseStylesheetStatement(true); + } + return this._parseStylesheetStatement(false); + } + _parseLayer(isNested = false) { + if (!this.peekKeyword("@layer")) { + return null; + } + const node = this.create(Layer); + this.consumeToken(); + const names = this._parseLayerNameList(); + if (names) { + node.setNames(names); + } + if ((!names || names.getChildren().length === 1) && this.peek(TokenType.CurlyL)) { + return this._parseBody(node, this._parseLayerDeclaration.bind(this, isNested)); + } + if (!this.accept(TokenType.SemiColon)) { + return this.finish(node, ParseError.SemiColonExpected); + } + return this.finish(node); + } + _parseLayerDeclaration(isNested = false) { + if (isNested) { + return this._tryParseRuleset(true) || this._tryToParseDeclaration() || this._parseStylesheetStatement(true); + } + return this._parseStylesheetStatement(false); + } + _parseLayerNameList() { + const node = this.createNode(NodeType.LayerNameList); + if (!node.addChild(this._parseLayerName())) { + return null; + } + while (this.accept(TokenType.Comma)) { + if (!node.addChild(this._parseLayerName())) { + return this.finish(node, ParseError.IdentifierExpected); + } + } + return this.finish(node); + } + _parseLayerName() { + const node = this.createNode(NodeType.LayerName); + if (!node.addChild(this._parseIdent())) { + return null; + } + while (!this.hasWhitespace() && this.acceptDelim(".")) { + if (this.hasWhitespace() || !node.addChild(this._parseIdent())) { + return this.finish(node, ParseError.IdentifierExpected); + } + } + return this.finish(node); + } + _parseSupports(isNested = false) { + if (!this.peekKeyword("@supports")) { + return null; + } + const node = this.create(Supports); + this.consumeToken(); + node.addChild(this._parseSupportsCondition()); + return this._parseBody(node, this._parseSupportsDeclaration.bind(this, isNested)); + } + _parseSupportsDeclaration(isNested = false) { + if (isNested) { + return this._tryParseRuleset(true) || this._tryToParseDeclaration() || this._parseStylesheetStatement(true); + } + return this._parseStylesheetStatement(false); + } + _parseSupportsCondition() { + const node = this.create(SupportsCondition); + if (this.acceptIdent("not")) { + node.addChild(this._parseSupportsConditionInParens()); + } else { + node.addChild(this._parseSupportsConditionInParens()); + if (this.peekRegExp(TokenType.Ident, /^(and|or)$/i)) { + const text = this.token.text.toLowerCase(); + while (this.acceptIdent(text)) { + node.addChild(this._parseSupportsConditionInParens()); + } + } + } + return this.finish(node); + } + _parseSupportsConditionInParens() { + const node = this.create(SupportsCondition); + if (this.accept(TokenType.ParenthesisL)) { + if (this.prevToken) { + node.lParent = this.prevToken.offset; + } + if (!node.addChild(this._tryToParseDeclaration([TokenType.ParenthesisR]))) { + if (!this._parseSupportsCondition()) { + return this.finish(node, ParseError.ConditionExpected); + } + } + if (!this.accept(TokenType.ParenthesisR)) { + return this.finish(node, ParseError.RightParenthesisExpected, [TokenType.ParenthesisR], []); + } + if (this.prevToken) { + node.rParent = this.prevToken.offset; + } + return this.finish(node); + } else if (this.peek(TokenType.Ident)) { + const pos = this.mark(); + this.consumeToken(); + if (!this.hasWhitespace() && this.accept(TokenType.ParenthesisL)) { + let openParentCount = 1; + while (this.token.type !== TokenType.EOF && openParentCount !== 0) { + if (this.token.type === TokenType.ParenthesisL) { + openParentCount++; + } else if (this.token.type === TokenType.ParenthesisR) { + openParentCount--; + } + this.consumeToken(); + } + return this.finish(node); + } else { + this.restoreAtMark(pos); + } + } + return this.finish(node, ParseError.LeftParenthesisExpected, [], [TokenType.ParenthesisL]); + } + _parseMediaDeclaration(isNested = false) { + if (isNested) { + return this._tryParseRuleset(true) || this._tryToParseDeclaration() || this._parseStylesheetStatement(true); + } + return this._parseStylesheetStatement(false); + } + _parseMedia(isNested = false) { + if (!this.peekKeyword("@media")) { + return null; + } + const node = this.create(Media); + this.consumeToken(); + if (!node.addChild(this._parseMediaQueryList())) { + return this.finish(node, ParseError.MediaQueryExpected); + } + return this._parseBody(node, this._parseMediaDeclaration.bind(this, isNested)); + } + _parseMediaQueryList() { + const node = this.create(Medialist); + if (!node.addChild(this._parseMediaQuery())) { + return this.finish(node, ParseError.MediaQueryExpected); + } + while (this.accept(TokenType.Comma)) { + if (!node.addChild(this._parseMediaQuery())) { + return this.finish(node, ParseError.MediaQueryExpected); + } + } + return this.finish(node); + } + _parseMediaQuery() { + const node = this.create(MediaQuery); + const pos = this.mark(); + this.acceptIdent("not"); + if (!this.peek(TokenType.ParenthesisL)) { + if (this.acceptIdent("only")) { + } + if (!node.addChild(this._parseIdent())) { + return null; + } + if (this.acceptIdent("and")) { + node.addChild(this._parseMediaCondition()); + } + } else { + this.restoreAtMark(pos); + node.addChild(this._parseMediaCondition()); + } + return this.finish(node); + } + _parseRatio() { + const pos = this.mark(); + const node = this.create(RatioValue); + if (!this._parseNumeric()) { + return null; + } + if (!this.acceptDelim("/")) { + this.restoreAtMark(pos); + return null; + } + if (!this._parseNumeric()) { + return this.finish(node, ParseError.NumberExpected); + } + return this.finish(node); + } + _parseBooleanExpression(parseTest) { + const node = this.create(Node); + if (this.acceptIdent("not")) { + if (!node.addChild(this._parseBooleanExpressionGroup(parseTest))) { + return null; + } + } else { + if (!node.addChild(this._parseBooleanExpressionGroup(parseTest))) { + return null; + } + if (this.peekIdent("and")) { + while (this.acceptIdent("and")) { + if (!node.addChild(this._parseBooleanExpressionGroup(parseTest))) { + return null; + } + } + } else if (this.peekIdent("or")) { + while (this.acceptIdent("or")) { + if (!node.addChild(this._parseBooleanExpressionGroup(parseTest))) { + return null; + } + } + } + } + return this.finish(node); + } + _parseBooleanExpressionGroup(parseTest) { + const node = this.create(Node); + const pos = this.mark(); + if (this.accept(TokenType.ParenthesisL)) { + if (node.addChild(this._parseBooleanExpression(parseTest))) { + if (!this.accept(TokenType.ParenthesisR)) { + return this.finish(node, ParseError.RightParenthesisExpected, [], [TokenType.CurlyL]); + } + return this.finish(node); + } + this.restoreAtMark(pos); + } + if (!node.addChild(parseTest())) { + return null; + } + ; + return this.finish(node); + } + _parseMediaCondition() { + const node = this.create(MediaCondition); + this.acceptIdent("not"); + let parseExpression = true; + while (parseExpression) { + if (!this.accept(TokenType.ParenthesisL)) { + return this.finish(node, ParseError.LeftParenthesisExpected, [], [TokenType.CurlyL]); + } + if (this.peek(TokenType.ParenthesisL) || this.peekIdent("not")) { + node.addChild(this._parseMediaCondition()); + } else { + node.addChild(this._parseMediaFeature()); + } + if (!this.accept(TokenType.ParenthesisR)) { + return this.finish(node, ParseError.RightParenthesisExpected, [], [TokenType.CurlyL]); + } + parseExpression = this.acceptIdent("and") || this.acceptIdent("or"); + } + return this.finish(node); + } + _parseMediaFeature() { + const resyncStopToken = [TokenType.ParenthesisR]; + const node = this.create(MediaFeature); + if (node.addChild(this._parseMediaFeatureName())) { + if (this.accept(TokenType.Colon)) { + if (!node.addChild(this._parseMediaFeatureValue())) { + return this.finish(node, ParseError.TermExpected, [], resyncStopToken); + } + } else if (this._parseMediaFeatureRangeOperator()) { + if (!node.addChild(this._parseMediaFeatureValue())) { + return this.finish(node, ParseError.TermExpected, [], resyncStopToken); + } + if (this._parseMediaFeatureRangeOperator()) { + if (!node.addChild(this._parseMediaFeatureValue())) { + return this.finish(node, ParseError.TermExpected, [], resyncStopToken); + } + } + } else { + } + } else if (node.addChild(this._parseMediaFeatureValue())) { + if (!this._parseMediaFeatureRangeOperator()) { + return this.finish(node, ParseError.OperatorExpected, [], resyncStopToken); + } + if (!node.addChild(this._parseMediaFeatureName())) { + return this.finish(node, ParseError.IdentifierExpected, [], resyncStopToken); + } + if (this._parseMediaFeatureRangeOperator()) { + if (!node.addChild(this._parseMediaFeatureValue())) { + return this.finish(node, ParseError.TermExpected, [], resyncStopToken); + } + } + } else { + return this.finish(node, ParseError.IdentifierExpected, [], resyncStopToken); + } + return this.finish(node); + } + _parseMediaFeatureRangeOperator() { + if (this.acceptDelim("<") || this.acceptDelim(">")) { + if (!this.hasWhitespace()) { + this.acceptDelim("="); + } + return true; + } else if (this.acceptDelim("=")) { + return true; + } + return false; + } + _parseMediaFeatureName() { + return this._parseIdent(); + } + _parseMediaFeatureValue() { + return this._parseRatio() || this._parseTermExpression(); + } + _parseScope() { + if (!this.peekKeyword("@scope")) { + return null; + } + const node = this.create(Scope); + this.consumeToken(); + node.addChild(this._parseScopeLimits()); + return this._parseBody(node, this._parseScopeDeclaration.bind(this)); + } + _parseScopeDeclaration() { + const isNested = true; + return this._tryParseRuleset(isNested) || this._tryToParseDeclaration() || this._parseStylesheetStatement(isNested); + } + _parseScopeLimits() { + const node = this.create(ScopeLimits); + if (this.accept(TokenType.ParenthesisL)) { + if (!node.setScopeStart(this._parseScopeSelectorList())) { + return this.finish(node, ParseError.SelectorExpected, [], [TokenType.ParenthesisR]); + } + if (!this.accept(TokenType.ParenthesisR)) { + return this.finish(node, ParseError.RightParenthesisExpected, [], [TokenType.CurlyL]); + } + } + if (this.acceptIdent("to")) { + if (!this.accept(TokenType.ParenthesisL)) { + return this.finish(node, ParseError.LeftParenthesisExpected, [], [TokenType.CurlyL]); + } + if (!node.setScopeEnd(this._parseScopeSelectorList())) { + return this.finish(node, ParseError.SelectorExpected, [], [TokenType.ParenthesisR]); + } + if (!this.accept(TokenType.ParenthesisR)) { + return this.finish(node, ParseError.RightParenthesisExpected, [], [TokenType.CurlyL]); + } + } + return this.finish(node); + } + _parseScopeSelectorList() { + const selectors = this.createNode(NodeType.SelectorList); + if (!selectors.addChild(this._parseSelector(true))) { + return null; + } + while (this.accept(TokenType.Comma) && selectors.addChild(this._parseSelector(true))) { + } + return this.finish(selectors); + } + _parseMedium() { + const node = this.create(Node); + if (node.addChild(this._parseIdent())) { + return this.finish(node); + } else { + return null; + } + } + _parsePageDeclaration() { + return this._parsePageMarginBox() || this._parseRuleSetDeclaration(); + } + _parsePage() { + if (!this.peekKeyword("@page")) { + return null; + } + const node = this.create(Page); + this.consumeToken(); + if (node.addChild(this._parsePageSelector())) { + while (this.accept(TokenType.Comma)) { + if (!node.addChild(this._parsePageSelector())) { + return this.finish(node, ParseError.IdentifierExpected); + } + } + } + return this._parseBody(node, this._parsePageDeclaration.bind(this)); + } + _parsePageMarginBox() { + if (!this.peek(TokenType.AtKeyword)) { + return null; + } + const node = this.create(PageBoxMarginBox); + if (!this.acceptOneKeyword(pageBoxDirectives)) { + this.markError(node, ParseError.UnknownAtRule, [], [TokenType.CurlyL]); + } + return this._parseBody(node, this._parseRuleSetDeclaration.bind(this)); + } + _parsePageSelector() { + if (!this.peek(TokenType.Ident) && !this.peek(TokenType.Colon)) { + return null; + } + const node = this.create(Node); + node.addChild(this._parseIdent()); + if (this.accept(TokenType.Colon)) { + if (!node.addChild(this._parseIdent())) { + return this.finish(node, ParseError.IdentifierExpected); + } + } + return this.finish(node); + } + _parseDocument() { + if (!this.peekKeyword("@-moz-document")) { + return null; + } + const node = this.create(Document); + this.consumeToken(); + this.resync([], [TokenType.CurlyL]); + return this._parseBody(node, this._parseStylesheetStatement.bind(this)); + } + _parseContainerDeclaration(isNested = false) { + if (isNested) { + return this._tryParseRuleset(true) || this._tryToParseDeclaration() || this._parseStylesheetStatement(true); + } + return this._parseStylesheetStatement(false); + } + _parseContainer(isNested = false) { + if (!this.peekKeyword("@container")) { + return null; + } + const node = this.create(Container); + this.consumeToken(); + node.addChild(this._parseIdent()); + if (node.addChild(this._parseContainerQuery())) { + while (this.accept(TokenType.Comma)) { + if (this.peek(TokenType.CurlyL)) { + break; + } + node.addChild(this._parseIdent()); + node.addChild(this._parseContainerQuery()); + } + } + return this._parseBody(node, this._parseContainerDeclaration.bind(this, isNested)); + } + _parseContainerQuery() { + const node = this.create(Node); + if (this.acceptIdent("not")) { + node.addChild(this._parseContainerQueryInParens()); + } else { + node.addChild(this._parseContainerQueryInParens(true)); + if (this.peekIdent("and")) { + while (this.acceptIdent("and")) { + node.addChild(this._parseContainerQueryInParens()); + } + } else if (this.peekIdent("or")) { + while (this.acceptIdent("or")) { + node.addChild(this._parseContainerQueryInParens()); + } + } + } + return this.finish(node); + } + _parseContainerQueryInParens(optional = false) { + const node = this.create(Node); + if (this.accept(TokenType.ParenthesisL)) { + if (this.peekIdent("not") || this.peek(TokenType.ParenthesisL)) { + node.addChild(this._parseContainerQuery()); + } else { + node.addChild(this._parseMediaFeature()); + } + if (!this.accept(TokenType.ParenthesisR)) { + return this.finish(node, ParseError.RightParenthesisExpected, [], [TokenType.CurlyL]); + } + } else if (this.acceptIdent("style")) { + if (this.hasWhitespace() || !this.accept(TokenType.ParenthesisL)) { + return this.finish(node, ParseError.LeftParenthesisExpected, [], [TokenType.CurlyL]); + } + node.addChild(this._parseStyleQuery()); + if (!this.accept(TokenType.ParenthesisR)) { + return this.finish(node, ParseError.RightParenthesisExpected, [], [TokenType.CurlyL]); + } + } else { + if (optional) { + return null; + } + return this.finish(node, ParseError.LeftParenthesisExpected, [], [TokenType.CurlyL]); + } + return this.finish(node); + } + _parseStyleQuery() { + const node = this.create(Node); + if (this.acceptIdent("not")) { + node.addChild(this._parseStyleInParens()); + } else if (this.peek(TokenType.ParenthesisL)) { + node.addChild(this._parseStyleInParens()); + if (this.peekIdent("and")) { + while (this.acceptIdent("and")) { + node.addChild(this._parseStyleInParens()); + } + } else if (this.peekIdent("or")) { + while (this.acceptIdent("or")) { + node.addChild(this._parseStyleInParens()); + } + } + } else { + node.addChild(this._parseDeclaration([TokenType.ParenthesisR], true)); + } + return this.finish(node); + } + _parseStyleInParens() { + const node = this.create(Node); + if (this.accept(TokenType.ParenthesisL)) { + node.addChild(this._parseStyleQuery()); + if (!this.accept(TokenType.ParenthesisR)) { + return this.finish(node, ParseError.RightParenthesisExpected, [], [TokenType.CurlyL]); + } + } else { + return this.finish(node, ParseError.LeftParenthesisExpected, [], [TokenType.CurlyL]); + } + return this.finish(node); + } + // https://www.w3.org/TR/css-syntax-3/#consume-an-at-rule + _parseUnknownAtRule() { + if (!this.peek(TokenType.AtKeyword)) { + return null; + } + const node = this.create(UnknownAtRule); + node.addChild(this._parseUnknownAtRuleName()); + const isTopLevel = () => curlyDepth === 0 && parensDepth === 0 && bracketsDepth === 0; + let curlyLCount = 0; + let curlyDepth = 0; + let parensDepth = 0; + let bracketsDepth = 0; + done: while (true) { + switch (this.token.type) { + case TokenType.SemiColon: + if (isTopLevel()) { + break done; + } + break; + case TokenType.EOF: + if (curlyDepth > 0) { + return this.finish(node, ParseError.RightCurlyExpected); + } else if (bracketsDepth > 0) { + return this.finish(node, ParseError.RightSquareBracketExpected); + } else if (parensDepth > 0) { + return this.finish(node, ParseError.RightParenthesisExpected); + } else { + return this.finish(node); + } + case TokenType.CurlyL: + curlyLCount++; + curlyDepth++; + break; + case TokenType.CurlyR: + curlyDepth--; + if (curlyLCount > 0 && curlyDepth === 0) { + this.consumeToken(); + if (bracketsDepth > 0) { + return this.finish(node, ParseError.RightSquareBracketExpected); + } else if (parensDepth > 0) { + return this.finish(node, ParseError.RightParenthesisExpected); + } + break done; + } + if (curlyDepth < 0) { + if (parensDepth === 0 && bracketsDepth === 0) { + break done; + } + return this.finish(node, ParseError.LeftCurlyExpected); + } + break; + case TokenType.ParenthesisL: + parensDepth++; + break; + case TokenType.ParenthesisR: + parensDepth--; + if (parensDepth < 0) { + return this.finish(node, ParseError.LeftParenthesisExpected); + } + break; + case TokenType.BracketL: + bracketsDepth++; + break; + case TokenType.BracketR: + bracketsDepth--; + if (bracketsDepth < 0) { + return this.finish(node, ParseError.LeftSquareBracketExpected); + } + break; + } + this.consumeToken(); + } + return node; + } + _parseUnknownAtRuleName() { + const node = this.create(Node); + if (this.accept(TokenType.AtKeyword)) { + return this.finish(node); + } + return node; + } + _parseOperator() { + if (this.peekDelim("/") || this.peekDelim("*") || this.peekDelim("+") || this.peekDelim("-") || this.peek(TokenType.Dashmatch) || this.peek(TokenType.Includes) || this.peek(TokenType.SubstringOperator) || this.peek(TokenType.PrefixOperator) || this.peek(TokenType.SuffixOperator) || this.peekDelim("=")) { + const node = this.createNode(NodeType.Operator); + this.consumeToken(); + return this.finish(node); + } else { + return null; + } + } + _parseUnaryOperator() { + if (!this.peekDelim("+") && !this.peekDelim("-")) { + return null; + } + const node = this.create(Node); + this.consumeToken(); + return this.finish(node); + } + _parseCombinator() { + if (this.peekDelim(">")) { + const node = this.create(Node); + this.consumeToken(); + const mark = this.mark(); + if (!this.hasWhitespace() && this.acceptDelim(">")) { + if (!this.hasWhitespace() && this.acceptDelim(">")) { + node.type = NodeType.SelectorCombinatorShadowPiercingDescendant; + return this.finish(node); + } + this.restoreAtMark(mark); + } + node.type = NodeType.SelectorCombinatorParent; + return this.finish(node); + } else if (this.peekDelim("+")) { + const node = this.create(Node); + this.consumeToken(); + node.type = NodeType.SelectorCombinatorSibling; + return this.finish(node); + } else if (this.peekDelim("~")) { + const node = this.create(Node); + this.consumeToken(); + node.type = NodeType.SelectorCombinatorAllSiblings; + return this.finish(node); + } else if (this.peekDelim("/")) { + const node = this.create(Node); + this.consumeToken(); + const mark = this.mark(); + if (!this.hasWhitespace() && this.acceptIdent("deep") && !this.hasWhitespace() && this.acceptDelim("/")) { + node.type = NodeType.SelectorCombinatorShadowPiercingDescendant; + return this.finish(node); + } + this.restoreAtMark(mark); + } + return null; + } + _parseSimpleSelector() { + const node = this.create(SimpleSelector); + let c = 0; + if (node.addChild(this._parseElementName() || this._parseNestingSelector())) { + c++; + } + while ((c === 0 || !this.hasWhitespace()) && node.addChild(this._parseSimpleSelectorBody())) { + c++; + } + return c > 0 ? this.finish(node) : null; + } + _parseNestingSelector() { + if (this.peekDelim("&")) { + const node = this.createNode(NodeType.SelectorCombinator); + this.consumeToken(); + return this.finish(node); + } + return null; + } + _parseSimpleSelectorBody() { + return this._parsePseudo() || this._parseHash() || this._parseClass() || this._parseAttrib(); + } + _parseSelectorIdent() { + return this._parseIdent(); + } + _parseHash() { + if (!this.peek(TokenType.Hash) && !this.peekDelim("#")) { + return null; + } + const node = this.createNode(NodeType.IdentifierSelector); + if (this.acceptDelim("#")) { + if (this.hasWhitespace() || !node.addChild(this._parseSelectorIdent())) { + return this.finish(node, ParseError.IdentifierExpected); + } + } else { + this.consumeToken(); + } + return this.finish(node); + } + _parseClass() { + if (!this.peekDelim(".")) { + return null; + } + const node = this.createNode(NodeType.ClassSelector); + this.consumeToken(); + if (this.hasWhitespace() || !node.addChild(this._parseSelectorIdent())) { + return this.finish(node, ParseError.IdentifierExpected); + } + return this.finish(node); + } + _parseElementName() { + const pos = this.mark(); + const node = this.createNode(NodeType.ElementNameSelector); + node.addChild(this._parseNamespacePrefix()); + if (!node.addChild(this._parseSelectorIdent()) && !this.acceptDelim("*")) { + this.restoreAtMark(pos); + return null; + } + return this.finish(node); + } + _parseNamespacePrefix() { + const pos = this.mark(); + const node = this.createNode(NodeType.NamespacePrefix); + if (!node.addChild(this._parseIdent()) && !this.acceptDelim("*")) { + } + if (!this.acceptDelim("|")) { + this.restoreAtMark(pos); + return null; + } + return this.finish(node); + } + _parseAttrib() { + if (!this.peek(TokenType.BracketL)) { + return null; + } + const node = this.create(AttributeSelector); + this.consumeToken(); + node.setNamespacePrefix(this._parseNamespacePrefix()); + if (!node.setIdentifier(this._parseIdent())) { + return this.finish(node, ParseError.IdentifierExpected); + } + if (node.setOperator(this._parseOperator())) { + node.setValue(this._parseBinaryExpr()); + this.acceptIdent("i"); + this.acceptIdent("s"); + } + if (!this.accept(TokenType.BracketR)) { + return this.finish(node, ParseError.RightSquareBracketExpected); + } + return this.finish(node); + } + _parsePseudo() { + const node = this._tryParsePseudoIdentifier(); + if (node) { + if (!this.hasWhitespace() && this.accept(TokenType.ParenthesisL)) { + const tryAsSelector = () => { + const selectors = this.createNode(NodeType.SelectorList); + if (!selectors.addChild(this._parseSelector(true))) { + return null; + } + while (this.accept(TokenType.Comma) && selectors.addChild(this._parseSelector(true))) { + } + if (this.peek(TokenType.ParenthesisR)) { + return this.finish(selectors); + } + return null; + }; + let hasSelector = node.addChild(this.try(tryAsSelector)); + if (!hasSelector) { + while (!this.peekIdent("of") && (node.addChild(this._parseTerm()) || node.addChild(this._parseOperator()))) { + } + if (this.acceptIdent("of") && !node.addChild(this.try(tryAsSelector))) { + return this.finish(node, ParseError.SelectorExpected); + } + } + if (!this.accept(TokenType.ParenthesisR)) { + return this.finish(node, ParseError.RightParenthesisExpected); + } + } + return this.finish(node); + } + return null; + } + _tryParsePseudoIdentifier() { + if (!this.peek(TokenType.Colon)) { + return null; + } + const pos = this.mark(); + const node = this.createNode(NodeType.PseudoSelector); + this.consumeToken(); + if (this.hasWhitespace()) { + this.restoreAtMark(pos); + return null; + } + this.accept(TokenType.Colon); + if (this.hasWhitespace() || !node.addChild(this._parseIdent())) { + return this.finish(node, ParseError.IdentifierExpected); + } + return this.finish(node); + } + _tryParsePrio() { + const mark = this.mark(); + const prio = this._parsePrio(); + if (prio) { + return prio; + } + this.restoreAtMark(mark); + return null; + } + _parsePrio() { + if (!this.peek(TokenType.Exclamation)) { + return null; + } + const node = this.createNode(NodeType.Prio); + if (this.accept(TokenType.Exclamation) && this.acceptIdent("important")) { + return this.finish(node); + } + return null; + } + _parseExpr(stopOnComma = false) { + const node = this.create(Expression); + if (!node.addChild(this._parseBinaryExpr())) { + return null; + } + while (true) { + if (this.peek(TokenType.Comma)) { + if (stopOnComma) { + return this.finish(node); + } + this.consumeToken(); + } + if (!node.addChild(this._parseBinaryExpr())) { + break; + } + } + return this.finish(node); + } + _parseUnicodeRange() { + if (!this.peekIdent("u")) { + return null; + } + const node = this.create(UnicodeRange); + if (!this.acceptUnicodeRange()) { + return null; + } + return this.finish(node); + } + _parseNamedLine() { + if (!this.peek(TokenType.BracketL)) { + return null; + } + const node = this.createNode(NodeType.GridLine); + this.consumeToken(); + while (node.addChild(this._parseIdent())) { + } + if (!this.accept(TokenType.BracketR)) { + return this.finish(node, ParseError.RightSquareBracketExpected); + } + return this.finish(node); + } + _parseBinaryExpr(preparsedLeft, preparsedOper) { + let node = this.create(BinaryExpression); + if (!node.setLeft(preparsedLeft || this._parseTerm())) { + return null; + } + if (!node.setOperator(preparsedOper || this._parseOperator())) { + return this.finish(node); + } + if (!node.setRight(this._parseTerm())) { + return this.finish(node, ParseError.TermExpected); + } + node = this.finish(node); + const operator = this._parseOperator(); + if (operator) { + node = this._parseBinaryExpr(node, operator); + } + return this.finish(node); + } + _parseTerm() { + let node = this.create(Term); + node.setOperator(this._parseUnaryOperator()); + if (node.setExpression(this._parseTermExpression())) { + return this.finish(node); + } + return null; + } + _parseTermExpression() { + return this._parseURILiteral() || // url before function + this._parseUnicodeRange() || this._parseFunction() || // function before ident + this._parseIdent() || this._parseStringLiteral() || this._parseNumeric() || this._parseHexColor() || this._parseOperation() || this._parseNamedLine(); + } + _parseOperation() { + if (!this.peek(TokenType.ParenthesisL)) { + return null; + } + const node = this.create(Node); + this.consumeToken(); + node.addChild(this._parseExpr()); + if (!this.accept(TokenType.ParenthesisR)) { + return this.finish(node, ParseError.RightParenthesisExpected); + } + return this.finish(node); + } + _parseNumeric() { + if (this.peek(TokenType.Num) || this.peek(TokenType.Percentage) || this.peek(TokenType.Resolution) || this.peek(TokenType.Length) || this.peek(TokenType.EMS) || this.peek(TokenType.EXS) || this.peek(TokenType.Angle) || this.peek(TokenType.Time) || this.peek(TokenType.Dimension) || this.peek(TokenType.ContainerQueryLength) || this.peek(TokenType.Freq)) { + const node = this.create(NumericValue); + this.consumeToken(); + return this.finish(node); + } + return null; + } + _parseStringLiteral() { + if (!this.peek(TokenType.String) && !this.peek(TokenType.BadString)) { + return null; + } + const node = this.createNode(NodeType.StringLiteral); + this.consumeToken(); + return this.finish(node); + } + _parseURILiteral() { + if (!this.peekRegExp(TokenType.Ident, /^url(-prefix)?$/i)) { + return null; + } + const pos = this.mark(); + const node = this.createNode(NodeType.URILiteral); + this.accept(TokenType.Ident); + if (this.hasWhitespace() || !this.peek(TokenType.ParenthesisL)) { + this.restoreAtMark(pos); + return null; + } + this.scanner.inURL = true; + this.consumeToken(); + node.addChild(this._parseURLArgument()); + this.scanner.inURL = false; + if (!this.accept(TokenType.ParenthesisR)) { + return this.finish(node, ParseError.RightParenthesisExpected); + } + return this.finish(node); + } + _parseURLArgument() { + const node = this.create(Node); + if (!this.accept(TokenType.String) && !this.accept(TokenType.BadString) && !this.acceptUnquotedString()) { + return null; + } + return this.finish(node); + } + _parseIdent(referenceTypes) { + if (!this.peek(TokenType.Ident)) { + return null; + } + const node = this.create(Identifier); + if (referenceTypes) { + node.referenceTypes = referenceTypes; + } + node.isCustomProperty = this.peekRegExp(TokenType.Ident, /^--/); + this.consumeToken(); + return this.finish(node); + } + _parseFunction() { + const pos = this.mark(); + const node = this.create(Function); + let parseArgument = this._parseFunctionArgument.bind(this); + let separator = TokenType.Comma; + if (this.peekIdent("if")) { + parseArgument = this._parseIfBranch.bind(this); + separator = TokenType.SemiColon; + } + if (!node.setIdentifier(this._parseFunctionIdentifier())) { + return null; + } + if (this.hasWhitespace() || !this.accept(TokenType.ParenthesisL)) { + this.restoreAtMark(pos); + return null; + } + if (node.getArguments().addChild(parseArgument())) { + while (this.accept(separator)) { + if (this.peek(TokenType.ParenthesisR)) { + break; + } + if (!node.getArguments().addChild(parseArgument())) { + this.markError(node, ParseError.ExpressionExpected); + } + } + } + if (!this.accept(TokenType.ParenthesisR)) { + return this.finish(node, ParseError.RightParenthesisExpected); + } + return this.finish(node); + } + _parseFunctionIdentifier() { + if (!this.peek(TokenType.Ident)) { + return null; + } + const node = this.create(Identifier); + node.referenceTypes = [ReferenceType.Function]; + if (this.acceptIdent("progid")) { + if (this.accept(TokenType.Colon)) { + while (this.accept(TokenType.Ident) && this.acceptDelim(".")) { + } + } + return this.finish(node); + } + this.consumeToken(); + return this.finish(node); + } + _parseFunctionArgument() { + const node = this.create(FunctionArgument); + if (node.setValue(this._parseExpr(true))) { + return this.finish(node); + } + return null; + } + _parseIfBranch() { + const node = this.create(Node); + if (!node.addChild(this._parseIfCondition())) { + return this.finish(node, ParseError.IfConditionExpected, [], [TokenType.SemiColon]); + } + if (!this.accept(TokenType.Colon)) { + return this.finish(node, ParseError.ColonExpected, [], [TokenType.SemiColon]); + } + node.addChild(this._parseExpr()); + return this.finish(node); + } + _parseIfCondition() { + const node = this.create(Node); + if (this.peekIdent("else")) { + node.addChild(this._parseIdent()); + return this.finish(node); + } + return this._parseBooleanExpression(this._parseIfTest.bind(this)); + } + _parseIfTest() { + const node = this.create(Node); + if (this.acceptIdent("supports")) { + if (this.hasWhitespace() || !this.accept(TokenType.ParenthesisL)) { + return this.finish(node, ParseError.LeftParenthesisExpected, [], [TokenType.Colon]); + } + node.addChild(this._tryToParseDeclaration() || this._parseSupportsCondition()); + if (!this.accept(TokenType.ParenthesisR)) { + return this.finish(node, ParseError.RightParenthesisExpected, [], [TokenType.Colon]); + } + return this.finish(node); + } + if (this.acceptIdent("media")) { + if (this.hasWhitespace() || !this.accept(TokenType.ParenthesisL)) { + return this.finish(node, ParseError.LeftParenthesisExpected, [], [TokenType.Colon]); + } + const pos = this.mark(); + const condition = this._parseMediaCondition(); + if (condition && !condition.isErroneous()) { + node.addChild(condition); + } else { + this.restoreAtMark(pos); + node.addChild(this._parseMediaFeature()); + } + if (!this.accept(TokenType.ParenthesisR)) { + return this.finish(node, ParseError.RightParenthesisExpected, [], [TokenType.Colon]); + } + return this.finish(node); + } + if (this.acceptIdent("style")) { + if (this.hasWhitespace() || !this.accept(TokenType.ParenthesisL)) { + return this.finish(node, ParseError.LeftParenthesisExpected, [], [TokenType.Colon]); + } + node.addChild(this._parseStyleQuery()); + if (!this.accept(TokenType.ParenthesisR)) { + return this.finish(node, ParseError.RightParenthesisExpected, [], [TokenType.Colon]); + } + return this.finish(node); + } + return null; + } + _parseHexColor() { + if (this.peekRegExp(TokenType.Hash, /^#([A-Fa-f0-9]{3}|[A-Fa-f0-9]{4}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{8})$/g)) { + const node = this.create(HexColorValue); + this.consumeToken(); + return this.finish(node); + } else { + return null; + } + } +}; + +// node_modules/vscode-css-languageservice/lib/esm/utils/arrays.js +function findFirst(array, p) { + let low = 0, high = array.length; + if (high === 0) { + return 0; + } + while (low < high) { + let mid = Math.floor((low + high) / 2); + if (p(array[mid])) { + high = mid; + } else { + low = mid + 1; + } + } + return low; +} +function includes(array, item) { + return array.indexOf(item) !== -1; +} +function union(...arrays) { + const result = []; + for (const array of arrays) { + for (const item of array) { + if (!includes(result, item)) { + result.push(item); + } + } + } + return result; +} + +// node_modules/vscode-css-languageservice/lib/esm/parser/cssSymbolScope.js +var Scope2 = class { + constructor(offset, length) { + this.offset = offset; + this.length = length; + this.symbols = []; + this.parent = null; + this.children = []; + } + addChild(scope) { + this.children.push(scope); + scope.setParent(this); + } + setParent(scope) { + this.parent = scope; + } + findScope(offset, length = 0) { + if (this.offset <= offset && this.offset + this.length > offset + length || this.offset === offset && this.length === length) { + return this.findInScope(offset, length); + } + return null; + } + findInScope(offset, length = 0) { + const end = offset + length; + const idx = findFirst(this.children, (s) => s.offset > end); + if (idx === 0) { + return this; + } + const res = this.children[idx - 1]; + if (res.offset <= offset && res.offset + res.length >= offset + length) { + return res.findInScope(offset, length); + } + return this; + } + addSymbol(symbol) { + this.symbols.push(symbol); + } + getSymbol(name, type) { + for (let index = 0; index < this.symbols.length; index++) { + const symbol = this.symbols[index]; + if (symbol.name === name && symbol.type === type) { + return symbol; + } + } + return null; + } + getSymbols() { + return this.symbols; + } +}; +var GlobalScope = class extends Scope2 { + constructor() { + super(0, Number.MAX_VALUE); + } +}; +var Symbol2 = class { + constructor(name, value, node, type) { + this.name = name; + this.value = value; + this.node = node; + this.type = type; + } +}; +var ScopeBuilder = class { + constructor(scope) { + this.scope = scope; + } + addSymbol(node, name, value, type) { + if (node.offset !== -1) { + const current = this.scope.findScope(node.offset, node.length); + if (current) { + current.addSymbol(new Symbol2(name, value, node, type)); + } + } + } + addScope(node) { + if (node.offset !== -1) { + const current = this.scope.findScope(node.offset, node.length); + if (current && (current.offset !== node.offset || current.length !== node.length)) { + const newScope = new Scope2(node.offset, node.length); + current.addChild(newScope); + return newScope; + } + return current; + } + return null; + } + addSymbolToChildScope(scopeNode, node, name, value, type) { + if (scopeNode && scopeNode.offset !== -1) { + const current = this.addScope(scopeNode); + if (current) { + current.addSymbol(new Symbol2(name, value, node, type)); + } + } + } + visitNode(node) { + switch (node.type) { + case NodeType.Keyframe: + this.addSymbol(node, node.getName(), void 0, ReferenceType.Keyframe); + return true; + case NodeType.CustomPropertyDeclaration: + return this.visitCustomPropertyDeclarationNode(node); + case NodeType.VariableDeclaration: + return this.visitVariableDeclarationNode(node); + case NodeType.Ruleset: + return this.visitRuleSet(node); + case NodeType.MixinDeclaration: + this.addSymbol(node, node.getName(), void 0, ReferenceType.Mixin); + return true; + case NodeType.FunctionDeclaration: + this.addSymbol(node, node.getName(), void 0, ReferenceType.Function); + return true; + case NodeType.FunctionParameter: { + return this.visitFunctionParameterNode(node); + } + case NodeType.Declarations: + this.addScope(node); + return true; + case NodeType.For: + const forNode = node; + const scopeNode = forNode.getDeclarations(); + if (scopeNode && forNode.variable) { + this.addSymbolToChildScope(scopeNode, forNode.variable, forNode.variable.getName(), void 0, ReferenceType.Variable); + } + return true; + case NodeType.Each: { + const eachNode = node; + const scopeNode2 = eachNode.getDeclarations(); + if (scopeNode2) { + const variables = eachNode.getVariables().getChildren(); + for (const variable of variables) { + this.addSymbolToChildScope(scopeNode2, variable, variable.getName(), void 0, ReferenceType.Variable); + } + } + return true; + } + } + return true; + } + visitRuleSet(node) { + const current = this.scope.findScope(node.offset, node.length); + if (current) { + for (const child of node.getSelectors().getChildren()) { + if (child instanceof Selector) { + if (child.getChildren().length === 1) { + current.addSymbol(new Symbol2(child.getChild(0).getText(), void 0, child, ReferenceType.Rule)); + } + } + } + } + return true; + } + visitVariableDeclarationNode(node) { + const value = node.getValue() ? node.getValue().getText() : void 0; + this.addSymbol(node, node.getName(), value, ReferenceType.Variable); + return true; + } + visitFunctionParameterNode(node) { + const scopeNode = node.getParent().getDeclarations(); + if (scopeNode) { + const valueNode = node.getDefaultValue(); + const value = valueNode ? valueNode.getText() : void 0; + this.addSymbolToChildScope(scopeNode, node, node.getName(), value, ReferenceType.Variable); + } + return true; + } + visitCustomPropertyDeclarationNode(node) { + const value = node.getValue() ? node.getValue().getText() : ""; + this.addCSSVariable(node.getProperty(), node.getProperty().getName(), value, ReferenceType.Variable); + return true; + } + addCSSVariable(node, name, value, type) { + if (node.offset !== -1) { + this.scope.addSymbol(new Symbol2(name, value, node, type)); + } + } +}; +var Symbols = class { + constructor(node) { + this.global = new GlobalScope(); + node.acceptVisitor(new ScopeBuilder(this.global)); + } + findSymbolsAtOffset(offset, referenceType) { + let scope = this.global.findScope(offset, 0); + const result = []; + const names = {}; + while (scope) { + const symbols = scope.getSymbols(); + for (let i = 0; i < symbols.length; i++) { + const symbol = symbols[i]; + if (symbol.type === referenceType && !names[symbol.name]) { + result.push(symbol); + names[symbol.name] = true; + } + } + scope = scope.parent; + } + return result; + } + internalFindSymbol(node, referenceTypes) { + let scopeNode = node; + if (node.parent instanceof FunctionParameter && node.parent.getParent() instanceof BodyDeclaration) { + scopeNode = node.parent.getParent().getDeclarations(); + } + if (node.parent instanceof FunctionArgument && node.parent.getParent() instanceof Function) { + const funcId = node.parent.getParent().getIdentifier(); + if (funcId) { + const functionSymbol = this.internalFindSymbol(funcId, [ReferenceType.Function]); + if (functionSymbol) { + scopeNode = functionSymbol.node.getDeclarations(); + } + } + } + if (!scopeNode) { + return null; + } + const name = node.getText(); + let scope = this.global.findScope(scopeNode.offset, scopeNode.length); + while (scope) { + for (let index = 0; index < referenceTypes.length; index++) { + const type = referenceTypes[index]; + const symbol = scope.getSymbol(name, type); + if (symbol) { + return symbol; + } + } + scope = scope.parent; + } + return null; + } + evaluateReferenceTypes(node) { + if (node instanceof Identifier) { + const referenceTypes = node.referenceTypes; + if (referenceTypes) { + return referenceTypes; + } else { + if (node.isCustomProperty) { + return [ReferenceType.Variable]; + } + const decl = getParentDeclaration(node); + if (decl) { + const propertyName = decl.getNonPrefixedPropertyName(); + if ((propertyName === "animation" || propertyName === "animation-name") && decl.getValue() && decl.getValue().offset === node.offset) { + return [ReferenceType.Keyframe]; + } + } + } + } else if (node instanceof Variable) { + return [ReferenceType.Variable]; + } + const selector = node.findAParent(NodeType.Selector, NodeType.ExtendsReference); + if (selector) { + return [ReferenceType.Rule]; + } + return null; + } + findSymbolFromNode(node) { + if (!node) { + return null; + } + while (node.type === NodeType.Interpolation) { + node = node.getParent(); + } + const referenceTypes = this.evaluateReferenceTypes(node); + if (referenceTypes) { + return this.internalFindSymbol(node, referenceTypes); + } + return null; + } + matchesSymbol(node, symbol) { + if (!node) { + return false; + } + while (node.type === NodeType.Interpolation) { + node = node.getParent(); + } + if (!node.matches(symbol.name)) { + return false; + } + const referenceTypes = this.evaluateReferenceTypes(node); + if (!referenceTypes || referenceTypes.indexOf(symbol.type) === -1) { + return false; + } + const nodeSymbol = this.internalFindSymbol(node, referenceTypes); + return nodeSymbol === symbol; + } + findSymbol(name, type, offset) { + let scope = this.global.findScope(offset); + while (scope) { + const symbol = scope.getSymbol(name, type); + if (symbol) { + return symbol; + } + scope = scope.parent; + } + return null; + } +}; + +// node_modules/vscode-uri/lib/esm/index.mjs +var LIB; +(() => { + "use strict"; + var t2 = { 975: (t3) => { + function e2(t4) { + if ("string" != typeof t4) throw new TypeError("Path must be a string. Received " + JSON.stringify(t4)); + } + function r2(t4, e3) { + for (var r3, n3 = "", i2 = 0, o2 = -1, s2 = 0, h2 = 0; h2 <= t4.length; ++h2) { + if (h2 < t4.length) r3 = t4.charCodeAt(h2); + else { + if (47 === r3) break; + r3 = 47; + } + if (47 === r3) { + if (o2 === h2 - 1 || 1 === s2) ; + else if (o2 !== h2 - 1 && 2 === s2) { + if (n3.length < 2 || 2 !== i2 || 46 !== n3.charCodeAt(n3.length - 1) || 46 !== n3.charCodeAt(n3.length - 2)) { + if (n3.length > 2) { + var a3 = n3.lastIndexOf("/"); + if (a3 !== n3.length - 1) { + -1 === a3 ? (n3 = "", i2 = 0) : i2 = (n3 = n3.slice(0, a3)).length - 1 - n3.lastIndexOf("/"), o2 = h2, s2 = 0; + continue; + } + } else if (2 === n3.length || 1 === n3.length) { + n3 = "", i2 = 0, o2 = h2, s2 = 0; + continue; + } + } + e3 && (n3.length > 0 ? n3 += "/.." : n3 = "..", i2 = 2); + } else n3.length > 0 ? n3 += "/" + t4.slice(o2 + 1, h2) : n3 = t4.slice(o2 + 1, h2), i2 = h2 - o2 - 1; + o2 = h2, s2 = 0; + } else 46 === r3 && -1 !== s2 ? ++s2 : s2 = -1; + } + return n3; + } + var n2 = { resolve: function() { + for (var t4, n3 = "", i2 = false, o2 = arguments.length - 1; o2 >= -1 && !i2; o2--) { + var s2; + o2 >= 0 ? s2 = arguments[o2] : (void 0 === t4 && (t4 = process.cwd()), s2 = t4), e2(s2), 0 !== s2.length && (n3 = s2 + "/" + n3, i2 = 47 === s2.charCodeAt(0)); + } + return n3 = r2(n3, !i2), i2 ? n3.length > 0 ? "/" + n3 : "/" : n3.length > 0 ? n3 : "."; + }, normalize: function(t4) { + if (e2(t4), 0 === t4.length) return "."; + var n3 = 47 === t4.charCodeAt(0), i2 = 47 === t4.charCodeAt(t4.length - 1); + return 0 !== (t4 = r2(t4, !n3)).length || n3 || (t4 = "."), t4.length > 0 && i2 && (t4 += "/"), n3 ? "/" + t4 : t4; + }, isAbsolute: function(t4) { + return e2(t4), t4.length > 0 && 47 === t4.charCodeAt(0); + }, join: function() { + if (0 === arguments.length) return "."; + for (var t4, r3 = 0; r3 < arguments.length; ++r3) { + var i2 = arguments[r3]; + e2(i2), i2.length > 0 && (void 0 === t4 ? t4 = i2 : t4 += "/" + i2); + } + return void 0 === t4 ? "." : n2.normalize(t4); + }, relative: function(t4, r3) { + if (e2(t4), e2(r3), t4 === r3) return ""; + if ((t4 = n2.resolve(t4)) === (r3 = n2.resolve(r3))) return ""; + for (var i2 = 1; i2 < t4.length && 47 === t4.charCodeAt(i2); ++i2) ; + for (var o2 = t4.length, s2 = o2 - i2, h2 = 1; h2 < r3.length && 47 === r3.charCodeAt(h2); ++h2) ; + for (var a3 = r3.length - h2, c2 = s2 < a3 ? s2 : a3, f3 = -1, u2 = 0; u2 <= c2; ++u2) { + if (u2 === c2) { + if (a3 > c2) { + if (47 === r3.charCodeAt(h2 + u2)) return r3.slice(h2 + u2 + 1); + if (0 === u2) return r3.slice(h2 + u2); + } else s2 > c2 && (47 === t4.charCodeAt(i2 + u2) ? f3 = u2 : 0 === u2 && (f3 = 0)); + break; + } + var l2 = t4.charCodeAt(i2 + u2); + if (l2 !== r3.charCodeAt(h2 + u2)) break; + 47 === l2 && (f3 = u2); + } + var g2 = ""; + for (u2 = i2 + f3 + 1; u2 <= o2; ++u2) u2 !== o2 && 47 !== t4.charCodeAt(u2) || (0 === g2.length ? g2 += ".." : g2 += "/.."); + return g2.length > 0 ? g2 + r3.slice(h2 + f3) : (h2 += f3, 47 === r3.charCodeAt(h2) && ++h2, r3.slice(h2)); + }, _makeLong: function(t4) { + return t4; + }, dirname: function(t4) { + if (e2(t4), 0 === t4.length) return "."; + for (var r3 = t4.charCodeAt(0), n3 = 47 === r3, i2 = -1, o2 = true, s2 = t4.length - 1; s2 >= 1; --s2) if (47 === (r3 = t4.charCodeAt(s2))) { + if (!o2) { + i2 = s2; + break; + } + } else o2 = false; + return -1 === i2 ? n3 ? "/" : "." : n3 && 1 === i2 ? "//" : t4.slice(0, i2); + }, basename: function(t4, r3) { + if (void 0 !== r3 && "string" != typeof r3) throw new TypeError('"ext" argument must be a string'); + e2(t4); + var n3, i2 = 0, o2 = -1, s2 = true; + if (void 0 !== r3 && r3.length > 0 && r3.length <= t4.length) { + if (r3.length === t4.length && r3 === t4) return ""; + var h2 = r3.length - 1, a3 = -1; + for (n3 = t4.length - 1; n3 >= 0; --n3) { + var c2 = t4.charCodeAt(n3); + if (47 === c2) { + if (!s2) { + i2 = n3 + 1; + break; + } + } else -1 === a3 && (s2 = false, a3 = n3 + 1), h2 >= 0 && (c2 === r3.charCodeAt(h2) ? -1 == --h2 && (o2 = n3) : (h2 = -1, o2 = a3)); + } + return i2 === o2 ? o2 = a3 : -1 === o2 && (o2 = t4.length), t4.slice(i2, o2); + } + for (n3 = t4.length - 1; n3 >= 0; --n3) if (47 === t4.charCodeAt(n3)) { + if (!s2) { + i2 = n3 + 1; + break; + } + } else -1 === o2 && (s2 = false, o2 = n3 + 1); + return -1 === o2 ? "" : t4.slice(i2, o2); + }, extname: function(t4) { + e2(t4); + for (var r3 = -1, n3 = 0, i2 = -1, o2 = true, s2 = 0, h2 = t4.length - 1; h2 >= 0; --h2) { + var a3 = t4.charCodeAt(h2); + if (47 !== a3) -1 === i2 && (o2 = false, i2 = h2 + 1), 46 === a3 ? -1 === r3 ? r3 = h2 : 1 !== s2 && (s2 = 1) : -1 !== r3 && (s2 = -1); + else if (!o2) { + n3 = h2 + 1; + break; + } + } + return -1 === r3 || -1 === i2 || 0 === s2 || 1 === s2 && r3 === i2 - 1 && r3 === n3 + 1 ? "" : t4.slice(r3, i2); + }, format: function(t4) { + if (null === t4 || "object" != typeof t4) throw new TypeError('The "pathObject" argument must be of type Object. Received type ' + typeof t4); + return (function(t5, e3) { + var r3 = e3.dir || e3.root, n3 = e3.base || (e3.name || "") + (e3.ext || ""); + return r3 ? r3 === e3.root ? r3 + n3 : r3 + "/" + n3 : n3; + })(0, t4); + }, parse: function(t4) { + e2(t4); + var r3 = { root: "", dir: "", base: "", ext: "", name: "" }; + if (0 === t4.length) return r3; + var n3, i2 = t4.charCodeAt(0), o2 = 47 === i2; + o2 ? (r3.root = "/", n3 = 1) : n3 = 0; + for (var s2 = -1, h2 = 0, a3 = -1, c2 = true, f3 = t4.length - 1, u2 = 0; f3 >= n3; --f3) if (47 !== (i2 = t4.charCodeAt(f3))) -1 === a3 && (c2 = false, a3 = f3 + 1), 46 === i2 ? -1 === s2 ? s2 = f3 : 1 !== u2 && (u2 = 1) : -1 !== s2 && (u2 = -1); + else if (!c2) { + h2 = f3 + 1; + break; + } + return -1 === s2 || -1 === a3 || 0 === u2 || 1 === u2 && s2 === a3 - 1 && s2 === h2 + 1 ? -1 !== a3 && (r3.base = r3.name = 0 === h2 && o2 ? t4.slice(1, a3) : t4.slice(h2, a3)) : (0 === h2 && o2 ? (r3.name = t4.slice(1, s2), r3.base = t4.slice(1, a3)) : (r3.name = t4.slice(h2, s2), r3.base = t4.slice(h2, a3)), r3.ext = t4.slice(s2, a3)), h2 > 0 ? r3.dir = t4.slice(0, h2 - 1) : o2 && (r3.dir = "/"), r3; + }, sep: "/", delimiter: ":", win32: null, posix: null }; + n2.posix = n2, t3.exports = n2; + } }, e = {}; + function r(n2) { + var i2 = e[n2]; + if (void 0 !== i2) return i2.exports; + var o2 = e[n2] = { exports: {} }; + return t2[n2](o2, o2.exports, r), o2.exports; + } + r.d = (t3, e2) => { + for (var n2 in e2) r.o(e2, n2) && !r.o(t3, n2) && Object.defineProperty(t3, n2, { enumerable: true, get: e2[n2] }); + }, r.o = (t3, e2) => Object.prototype.hasOwnProperty.call(t3, e2), r.r = (t3) => { + "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t3, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(t3, "__esModule", { value: true }); + }; + var n = {}; + let i; + if (r.r(n), r.d(n, { URI: () => l, Utils: () => I }), "object" == typeof process) i = "win32" === process.platform; + else if ("object" == typeof navigator) { + let t3 = navigator.userAgent; + i = t3.indexOf("Windows") >= 0; + } + const o = /^\w[\w\d+.-]*$/, s = /^\//, h = /^\/\//; + function a2(t3, e2) { + if (!t3.scheme && e2) throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${t3.authority}", path: "${t3.path}", query: "${t3.query}", fragment: "${t3.fragment}"}`); + if (t3.scheme && !o.test(t3.scheme)) throw new Error("[UriError]: Scheme contains illegal characters."); + if (t3.path) { + if (t3.authority) { + if (!s.test(t3.path)) throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character'); + } else if (h.test(t3.path)) throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")'); + } + } + const c = "", f2 = "/", u = /^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/; + class l { + static isUri(t3) { + return t3 instanceof l || !!t3 && "string" == typeof t3.authority && "string" == typeof t3.fragment && "string" == typeof t3.path && "string" == typeof t3.query && "string" == typeof t3.scheme && "string" == typeof t3.fsPath && "function" == typeof t3.with && "function" == typeof t3.toString; + } + scheme; + authority; + path; + query; + fragment; + constructor(t3, e2, r2, n2, i2, o2 = false) { + "object" == typeof t3 ? (this.scheme = t3.scheme || c, this.authority = t3.authority || c, this.path = t3.path || c, this.query = t3.query || c, this.fragment = t3.fragment || c) : (this.scheme = /* @__PURE__ */ (function(t4, e3) { + return t4 || e3 ? t4 : "file"; + })(t3, o2), this.authority = e2 || c, this.path = (function(t4, e3) { + switch (t4) { + case "https": + case "http": + case "file": + e3 ? e3[0] !== f2 && (e3 = f2 + e3) : e3 = f2; + } + return e3; + })(this.scheme, r2 || c), this.query = n2 || c, this.fragment = i2 || c, a2(this, o2)); + } + get fsPath() { + return v(this, false); + } + with(t3) { + if (!t3) return this; + let { scheme: e2, authority: r2, path: n2, query: i2, fragment: o2 } = t3; + return void 0 === e2 ? e2 = this.scheme : null === e2 && (e2 = c), void 0 === r2 ? r2 = this.authority : null === r2 && (r2 = c), void 0 === n2 ? n2 = this.path : null === n2 && (n2 = c), void 0 === i2 ? i2 = this.query : null === i2 && (i2 = c), void 0 === o2 ? o2 = this.fragment : null === o2 && (o2 = c), e2 === this.scheme && r2 === this.authority && n2 === this.path && i2 === this.query && o2 === this.fragment ? this : new d(e2, r2, n2, i2, o2); + } + static parse(t3, e2 = false) { + const r2 = u.exec(t3); + return r2 ? new d(r2[2] || c, w(r2[4] || c), w(r2[5] || c), w(r2[7] || c), w(r2[9] || c), e2) : new d(c, c, c, c, c); + } + static file(t3) { + let e2 = c; + if (i && (t3 = t3.replace(/\\/g, f2)), t3[0] === f2 && t3[1] === f2) { + const r2 = t3.indexOf(f2, 2); + -1 === r2 ? (e2 = t3.substring(2), t3 = f2) : (e2 = t3.substring(2, r2), t3 = t3.substring(r2) || f2); + } + return new d("file", e2, t3, c, c); + } + static from(t3) { + const e2 = new d(t3.scheme, t3.authority, t3.path, t3.query, t3.fragment); + return a2(e2, true), e2; + } + toString(t3 = false) { + return b(this, t3); + } + toJSON() { + return this; + } + static revive(t3) { + if (t3) { + if (t3 instanceof l) return t3; + { + const e2 = new d(t3); + return e2._formatted = t3.external, e2._fsPath = t3._sep === g ? t3.fsPath : null, e2; + } + } + return t3; + } + } + const g = i ? 1 : void 0; + class d extends l { + _formatted = null; + _fsPath = null; + get fsPath() { + return this._fsPath || (this._fsPath = v(this, false)), this._fsPath; + } + toString(t3 = false) { + return t3 ? b(this, true) : (this._formatted || (this._formatted = b(this, false)), this._formatted); + } + toJSON() { + const t3 = { $mid: 1 }; + return this._fsPath && (t3.fsPath = this._fsPath, t3._sep = g), this._formatted && (t3.external = this._formatted), this.path && (t3.path = this.path), this.scheme && (t3.scheme = this.scheme), this.authority && (t3.authority = this.authority), this.query && (t3.query = this.query), this.fragment && (t3.fragment = this.fragment), t3; + } + } + const p = { 58: "%3A", 47: "%2F", 63: "%3F", 35: "%23", 91: "%5B", 93: "%5D", 64: "%40", 33: "%21", 36: "%24", 38: "%26", 39: "%27", 40: "%28", 41: "%29", 42: "%2A", 43: "%2B", 44: "%2C", 59: "%3B", 61: "%3D", 32: "%20" }; + function m(t3, e2, r2) { + let n2, i2 = -1; + for (let o2 = 0; o2 < t3.length; o2++) { + const s2 = t3.charCodeAt(o2); + if (s2 >= 97 && s2 <= 122 || s2 >= 65 && s2 <= 90 || s2 >= 48 && s2 <= 57 || 45 === s2 || 46 === s2 || 95 === s2 || 126 === s2 || e2 && 47 === s2 || r2 && 91 === s2 || r2 && 93 === s2 || r2 && 58 === s2) -1 !== i2 && (n2 += encodeURIComponent(t3.substring(i2, o2)), i2 = -1), void 0 !== n2 && (n2 += t3.charAt(o2)); + else { + void 0 === n2 && (n2 = t3.substr(0, o2)); + const e3 = p[s2]; + void 0 !== e3 ? (-1 !== i2 && (n2 += encodeURIComponent(t3.substring(i2, o2)), i2 = -1), n2 += e3) : -1 === i2 && (i2 = o2); + } + } + return -1 !== i2 && (n2 += encodeURIComponent(t3.substring(i2))), void 0 !== n2 ? n2 : t3; + } + function y(t3) { + let e2; + for (let r2 = 0; r2 < t3.length; r2++) { + const n2 = t3.charCodeAt(r2); + 35 === n2 || 63 === n2 ? (void 0 === e2 && (e2 = t3.substr(0, r2)), e2 += p[n2]) : void 0 !== e2 && (e2 += t3[r2]); + } + return void 0 !== e2 ? e2 : t3; + } + function v(t3, e2) { + let r2; + return r2 = t3.authority && t3.path.length > 1 && "file" === t3.scheme ? `//${t3.authority}${t3.path}` : 47 === t3.path.charCodeAt(0) && (t3.path.charCodeAt(1) >= 65 && t3.path.charCodeAt(1) <= 90 || t3.path.charCodeAt(1) >= 97 && t3.path.charCodeAt(1) <= 122) && 58 === t3.path.charCodeAt(2) ? e2 ? t3.path.substr(1) : t3.path[1].toLowerCase() + t3.path.substr(2) : t3.path, i && (r2 = r2.replace(/\//g, "\\")), r2; + } + function b(t3, e2) { + const r2 = e2 ? y : m; + let n2 = "", { scheme: i2, authority: o2, path: s2, query: h2, fragment: a3 } = t3; + if (i2 && (n2 += i2, n2 += ":"), (o2 || "file" === i2) && (n2 += f2, n2 += f2), o2) { + let t4 = o2.indexOf("@"); + if (-1 !== t4) { + const e3 = o2.substr(0, t4); + o2 = o2.substr(t4 + 1), t4 = e3.lastIndexOf(":"), -1 === t4 ? n2 += r2(e3, false, false) : (n2 += r2(e3.substr(0, t4), false, false), n2 += ":", n2 += r2(e3.substr(t4 + 1), false, true)), n2 += "@"; + } + o2 = o2.toLowerCase(), t4 = o2.lastIndexOf(":"), -1 === t4 ? n2 += r2(o2, false, true) : (n2 += r2(o2.substr(0, t4), false, true), n2 += o2.substr(t4)); + } + if (s2) { + if (s2.length >= 3 && 47 === s2.charCodeAt(0) && 58 === s2.charCodeAt(2)) { + const t4 = s2.charCodeAt(1); + t4 >= 65 && t4 <= 90 && (s2 = `/${String.fromCharCode(t4 + 32)}:${s2.substr(3)}`); + } else if (s2.length >= 2 && 58 === s2.charCodeAt(1)) { + const t4 = s2.charCodeAt(0); + t4 >= 65 && t4 <= 90 && (s2 = `${String.fromCharCode(t4 + 32)}:${s2.substr(2)}`); + } + n2 += r2(s2, true, false); + } + return h2 && (n2 += "?", n2 += r2(h2, false, false)), a3 && (n2 += "#", n2 += e2 ? a3 : m(a3, false, false)), n2; + } + function C(t3) { + try { + return decodeURIComponent(t3); + } catch { + return t3.length > 3 ? t3.substr(0, 3) + C(t3.substr(3)) : t3; + } + } + const A2 = /(%[0-9A-Za-z][0-9A-Za-z])+/g; + function w(t3) { + return t3.match(A2) ? t3.replace(A2, ((t4) => C(t4))) : t3; + } + var x = r(975); + const P = x.posix || x, _ = "/"; + var I; + !(function(t3) { + t3.joinPath = function(t4, ...e2) { + return t4.with({ path: P.join(t4.path, ...e2) }); + }, t3.resolvePath = function(t4, ...e2) { + let r2 = t4.path, n2 = false; + r2[0] !== _ && (r2 = _ + r2, n2 = true); + let i2 = P.resolve(r2, ...e2); + return n2 && i2[0] === _ && !t4.authority && (i2 = i2.substring(1)), t4.with({ path: i2 }); + }, t3.dirname = function(t4) { + if (0 === t4.path.length || t4.path === _) return t4; + let e2 = P.dirname(t4.path); + return 1 === e2.length && 46 === e2.charCodeAt(0) && (e2 = ""), t4.with({ path: e2 }); + }, t3.basename = function(t4) { + return P.basename(t4.path); + }, t3.extname = function(t4) { + return P.extname(t4.path); + }; + })(I || (I = {})), LIB = n; +})(); +var { URI: URI2, Utils } = LIB; + +// node_modules/vscode-css-languageservice/lib/esm/utils/resources.js +function dirname(uriString) { + return Utils.dirname(URI2.parse(uriString)).toString(true); +} +function joinPath(uriString, ...paths) { + return Utils.joinPath(URI2.parse(uriString), ...paths).toString(true); +} + +// node_modules/vscode-css-languageservice/lib/esm/services/pathCompletion.js +var PathCompletionParticipant = class { + constructor(readDirectory) { + this.readDirectory = readDirectory; + this.literalCompletions = []; + this.importCompletions = []; + } + onCssURILiteralValue(context) { + this.literalCompletions.push(context); + } + onCssImportPath(context) { + this.importCompletions.push(context); + } + async computeCompletions(document, documentContext) { + const result = { items: [], isIncomplete: false }; + for (const literalCompletion of this.literalCompletions) { + const uriValue = literalCompletion.uriValue; + const fullValue = stripQuotes(uriValue); + if (fullValue === "." || fullValue === "..") { + result.isIncomplete = true; + } else { + const items = await this.providePathSuggestions(uriValue, literalCompletion.position, literalCompletion.range, document, documentContext); + for (let item of items) { + result.items.push(item); + } + } + } + for (const importCompletion of this.importCompletions) { + const pathValue = importCompletion.pathValue; + const fullValue = stripQuotes(pathValue); + if (fullValue === "." || fullValue === "..") { + result.isIncomplete = true; + } else { + let suggestions = await this.providePathSuggestions(pathValue, importCompletion.position, importCompletion.range, document, documentContext); + if (document.languageId === "scss") { + suggestions.forEach((s) => { + if (startsWith(s.label, "_") && endsWith(s.label, ".scss")) { + if (s.textEdit) { + s.textEdit.newText = s.label.slice(1, -5); + } else { + s.label = s.label.slice(1, -5); + } + } + }); + } + for (let item of suggestions) { + result.items.push(item); + } + } + } + return result; + } + async providePathSuggestions(pathValue, position, range, document, documentContext) { + const fullValue = stripQuotes(pathValue); + const isValueQuoted = startsWith(pathValue, `'`) || startsWith(pathValue, `"`); + const valueBeforeCursor = isValueQuoted ? fullValue.slice(0, position.character - (range.start.character + 1)) : fullValue.slice(0, position.character - range.start.character); + const currentDocUri = document.uri; + const fullValueRange = isValueQuoted ? shiftRange(range, 1, -1) : range; + const replaceRange = pathToReplaceRange(valueBeforeCursor, fullValue, fullValueRange); + const valueBeforeLastSlash = valueBeforeCursor.substring(0, valueBeforeCursor.lastIndexOf("/") + 1); + let parentDir = documentContext.resolveReference(valueBeforeLastSlash || ".", currentDocUri); + if (parentDir) { + try { + const result = []; + const infos = await this.readDirectory(parentDir); + for (const [name, type] of infos) { + if (name.charCodeAt(0) !== CharCode_dot && (type === FileType.Directory || joinPath(parentDir, name) !== currentDocUri)) { + result.push(createCompletionItem(name, type === FileType.Directory, replaceRange)); + } + } + return result; + } catch (e) { + } + } + return []; + } +}; +var CharCode_dot = ".".charCodeAt(0); +function stripQuotes(fullValue) { + if (startsWith(fullValue, `'`) || startsWith(fullValue, `"`)) { + return fullValue.slice(1, -1); + } else { + return fullValue; + } +} +function pathToReplaceRange(valueBeforeCursor, fullValue, fullValueRange) { + let replaceRange; + const lastIndexOfSlash = valueBeforeCursor.lastIndexOf("/"); + if (lastIndexOfSlash === -1) { + replaceRange = fullValueRange; + } else { + const valueAfterLastSlash = fullValue.slice(lastIndexOfSlash + 1); + const startPos = shiftPosition(fullValueRange.end, -valueAfterLastSlash.length); + const whitespaceIndex = valueAfterLastSlash.indexOf(" "); + let endPos; + if (whitespaceIndex !== -1) { + endPos = shiftPosition(startPos, whitespaceIndex); + } else { + endPos = fullValueRange.end; + } + replaceRange = Range.create(startPos, endPos); + } + return replaceRange; +} +function createCompletionItem(name, isDir, replaceRange) { + if (isDir) { + name = name + "/"; + return { + label: escapePath(name), + kind: CompletionItemKind.Folder, + textEdit: TextEdit.replace(replaceRange, escapePath(name)), + command: { + title: "Suggest", + command: "editor.action.triggerSuggest" + } + }; + } else { + return { + label: escapePath(name), + kind: CompletionItemKind.File, + textEdit: TextEdit.replace(replaceRange, escapePath(name)) + }; + } +} +function escapePath(p) { + return p.replace(/(\s|\(|\)|,|"|')/g, "\\$1"); +} +function shiftPosition(pos, offset) { + return Position.create(pos.line, pos.character + offset); +} +function shiftRange(range, startOffset, endOffset) { + const start = shiftPosition(range.start, startOffset); + const end = shiftPosition(range.end, endOffset); + return Range.create(start, end); +} + +// node_modules/vscode-css-languageservice/lib/esm/services/cssCompletion.js +var SnippetFormat = InsertTextFormat.Snippet; +var retriggerCommand = { + title: "Suggest", + command: "editor.action.triggerSuggest" +}; +var SortTexts; +(function(SortTexts2) { + SortTexts2["Enums"] = " "; + SortTexts2["Normal"] = "d"; + SortTexts2["VendorPrefixed"] = "x"; + SortTexts2["Term"] = "y"; + SortTexts2["Variable"] = "z"; +})(SortTexts || (SortTexts = {})); +var CSSCompletion = class { + constructor(variablePrefix = null, lsOptions, cssDataManager) { + this.variablePrefix = variablePrefix; + this.lsOptions = lsOptions; + this.cssDataManager = cssDataManager; + this.completionParticipants = []; + } + configure(settings) { + this.defaultSettings = settings; + } + getSymbolContext() { + if (!this.symbolContext) { + this.symbolContext = new Symbols(this.styleSheet); + } + return this.symbolContext; + } + setCompletionParticipants(registeredCompletionParticipants) { + this.completionParticipants = registeredCompletionParticipants || []; + } + async doComplete2(document, position, styleSheet, documentContext, completionSettings = this.defaultSettings) { + if (!this.lsOptions.fileSystemProvider || !this.lsOptions.fileSystemProvider.readDirectory) { + return this.doComplete(document, position, styleSheet, completionSettings); + } + const participant = new PathCompletionParticipant(this.lsOptions.fileSystemProvider.readDirectory); + const contributedParticipants = this.completionParticipants; + this.completionParticipants = [participant].concat(contributedParticipants); + const result = this.doComplete(document, position, styleSheet, completionSettings); + try { + const pathCompletionResult = await participant.computeCompletions(document, documentContext); + return { + isIncomplete: result.isIncomplete || pathCompletionResult.isIncomplete, + itemDefaults: result.itemDefaults, + items: pathCompletionResult.items.concat(result.items) + }; + } finally { + this.completionParticipants = contributedParticipants; + } + } + doComplete(document, position, styleSheet, documentSettings) { + this.offset = document.offsetAt(position); + this.position = position; + this.currentWord = getCurrentWord(document, this.offset); + this.defaultReplaceRange = Range.create(Position.create(this.position.line, this.position.character - this.currentWord.length), this.position); + this.textDocument = document; + this.styleSheet = styleSheet; + this.documentSettings = documentSettings; + try { + const result = { + isIncomplete: false, + itemDefaults: { + editRange: { + start: { line: position.line, character: position.character - this.currentWord.length }, + end: position + } + }, + items: [] + }; + this.nodePath = getNodePath(this.styleSheet, this.offset); + for (let i = this.nodePath.length - 1; i >= 0; i--) { + const node = this.nodePath[i]; + if (node instanceof Property) { + this.getCompletionsForDeclarationProperty(node.getParent(), result); + } else if (node instanceof Expression) { + if (node.parent instanceof Interpolation) { + this.getVariableProposals(null, result); + } else { + this.getCompletionsForExpression(node, result); + } + } else if (node instanceof SimpleSelector) { + const parentRef = node.findAParent(NodeType.ExtendsReference, NodeType.Ruleset); + if (parentRef) { + if (parentRef.type === NodeType.ExtendsReference) { + this.getCompletionsForExtendsReference(parentRef, node, result); + } else { + const parentRuleSet = parentRef; + this.getCompletionsForSelector(parentRuleSet, parentRuleSet && parentRuleSet.isNested(), result); + } + } + } else if (node instanceof FunctionArgument) { + this.getCompletionsForFunctionArgument(node, node.getParent(), result); + } else if (node instanceof Declarations) { + this.getCompletionsForDeclarations(node, result); + } else if (node instanceof VariableDeclaration) { + this.getCompletionsForVariableDeclaration(node, result); + } else if (node instanceof RuleSet) { + this.getCompletionsForRuleSet(node, result); + } else if (node instanceof Interpolation) { + this.getCompletionsForInterpolation(node, result); + } else if (node instanceof FunctionDeclaration) { + this.getCompletionsForFunctionDeclaration(node, result); + } else if (node instanceof MixinReference) { + this.getCompletionsForMixinReference(node, result); + } else if (node instanceof Function) { + this.getCompletionsForFunctionArgument(null, node, result); + } else if (node instanceof Supports) { + this.getCompletionsForSupports(node, result); + } else if (node instanceof SupportsCondition) { + this.getCompletionsForSupportsCondition(node, result); + } else if (node instanceof MediaCondition) { + this.getCompletionsForMediaCondition(node, result); + } else if (node instanceof ExtendsReference) { + this.getCompletionsForExtendsReference(node, null, result); + } else if (node.type === NodeType.URILiteral) { + this.getCompletionForUriLiteralValue(node, result); + } else if (node.parent === null) { + this.getCompletionForTopLevel(result); + } else if (node.type === NodeType.StringLiteral && this.isImportPathParent(node.parent.type)) { + this.getCompletionForImportPath(node, result); + } else { + continue; + } + if (result.items.length > 0 || this.offset > node.offset) { + return this.finalize(result); + } + } + this.getCompletionsForStylesheet(result); + if (result.items.length === 0) { + if (this.variablePrefix && this.currentWord.indexOf(this.variablePrefix) === 0) { + this.getVariableProposals(null, result); + } + } + return this.finalize(result); + } finally { + this.position = null; + this.currentWord = null; + this.textDocument = null; + this.styleSheet = null; + this.symbolContext = null; + this.defaultReplaceRange = null; + this.nodePath = null; + } + } + isImportPathParent(type) { + return type === NodeType.Import; + } + finalize(result) { + return result; + } + findInNodePath(...types) { + for (let i = this.nodePath.length - 1; i >= 0; i--) { + const node = this.nodePath[i]; + if (types.indexOf(node.type) !== -1) { + return node; + } + } + return null; + } + getCompletionsForDeclarationProperty(declaration, result) { + return this.getPropertyProposals(declaration, result); + } + getPropertyProposals(declaration, result) { + const triggerPropertyValueCompletion = this.isTriggerPropertyValueCompletionEnabled; + const completePropertyWithSemicolon = this.isCompletePropertyWithSemicolonEnabled; + const properties = this.cssDataManager.getProperties(); + properties.forEach((entry) => { + let range; + let insertText; + let retrigger = false; + if (declaration) { + range = this.getCompletionRange(declaration.getProperty()); + insertText = entry.name; + if (!isDefined(declaration.colonPosition)) { + insertText += ": "; + retrigger = true; + } + } else { + range = this.getCompletionRange(null); + insertText = entry.name + ": "; + retrigger = true; + } + if (!declaration && completePropertyWithSemicolon) { + insertText += "$0;"; + } + if (declaration && !declaration.semicolonPosition) { + if (completePropertyWithSemicolon && this.offset >= this.textDocument.offsetAt(range.end)) { + insertText += "$0;"; + } + } + const item = { + label: entry.name, + documentation: getEntryDescription(entry, this.doesSupportMarkdown()), + tags: isDeprecated(entry) ? [CompletionItemTag.Deprecated] : [], + textEdit: TextEdit.replace(range, insertText), + insertTextFormat: InsertTextFormat.Snippet, + kind: CompletionItemKind.Property + }; + if (triggerPropertyValueCompletion && retrigger) { + item.command = retriggerCommand; + } + const relevance = typeof entry.relevance === "number" ? Math.min(Math.max(entry.relevance, 0), 99) : 50; + const sortTextSuffix = (255 - relevance).toString(16); + const sortTextPrefix = startsWith(entry.name, "-") ? SortTexts.VendorPrefixed : SortTexts.Normal; + item.sortText = sortTextPrefix + "_" + sortTextSuffix; + result.items.push(item); + }); + this.completionParticipants.forEach((participant) => { + if (participant.onCssProperty) { + participant.onCssProperty({ + propertyName: this.currentWord, + range: this.defaultReplaceRange + }); + } + }); + return result; + } + get isTriggerPropertyValueCompletionEnabled() { + return this.documentSettings?.triggerPropertyValueCompletion ?? true; + } + get isCompletePropertyWithSemicolonEnabled() { + return this.documentSettings?.completePropertyWithSemicolon ?? true; + } + getCompletionsForDeclarationValue(node, result) { + const propertyName = node.getFullPropertyName(); + const entry = this.cssDataManager.getProperty(propertyName); + let existingNode = node.getValue() || null; + while (existingNode && existingNode.hasChildren()) { + existingNode = existingNode.findChildAtOffset(this.offset, false); + } + this.completionParticipants.forEach((participant) => { + if (participant.onCssPropertyValue) { + participant.onCssPropertyValue({ + propertyName, + propertyValue: this.currentWord, + range: this.getCompletionRange(existingNode) + }); + } + }); + if (entry) { + if (entry.restrictions) { + for (const restriction of entry.restrictions) { + switch (restriction) { + case "color": + this.getColorProposals(entry, existingNode, result); + break; + case "position": + this.getPositionProposals(entry, existingNode, result); + break; + case "repeat": + this.getRepeatStyleProposals(entry, existingNode, result); + break; + case "line-style": + this.getLineStyleProposals(entry, existingNode, result); + break; + case "line-width": + this.getLineWidthProposals(entry, existingNode, result); + break; + case "geometry-box": + this.getGeometryBoxProposals(entry, existingNode, result); + break; + case "box": + this.getBoxProposals(entry, existingNode, result); + break; + case "image": + this.getImageProposals(entry, existingNode, result); + break; + case "timing-function": + this.getTimingFunctionProposals(entry, existingNode, result); + break; + case "shape": + this.getBasicShapeProposals(entry, existingNode, result); + break; + } + } + } + this.getValueEnumProposals(entry, existingNode, result); + this.getCSSWideKeywordProposals(entry, existingNode, result); + this.getUnitProposals(entry, existingNode, result); + } else { + const existingValues = collectValues(this.styleSheet, node); + for (const existingValue of existingValues.getEntries()) { + result.items.push({ + label: existingValue, + textEdit: TextEdit.replace(this.getCompletionRange(existingNode), existingValue), + kind: CompletionItemKind.Value + }); + } + } + this.getVariableProposals(existingNode, result); + this.getTermProposals(entry, existingNode, result); + return result; + } + getValueEnumProposals(entry, existingNode, result) { + if (entry.values) { + for (const value of entry.values) { + let insertString = value.name; + let insertTextFormat; + if (endsWith(insertString, ")")) { + const from = insertString.lastIndexOf("("); + if (from !== -1) { + insertString = insertString.substring(0, from + 1) + "$1" + insertString.substring(from + 1); + insertTextFormat = SnippetFormat; + } + } + let sortText = SortTexts.Enums; + if (startsWith(value.name, "-")) { + sortText += SortTexts.VendorPrefixed; + } + const item = { + label: value.name, + documentation: getEntryDescription(value, this.doesSupportMarkdown()), + tags: isDeprecated(entry) ? [CompletionItemTag.Deprecated] : [], + textEdit: TextEdit.replace(this.getCompletionRange(existingNode), insertString), + sortText, + kind: CompletionItemKind.Value, + insertTextFormat + }; + result.items.push(item); + } + } + return result; + } + getCSSWideKeywordProposals(entry, existingNode, result) { + for (const keywords in cssWideKeywords) { + result.items.push({ + label: keywords, + documentation: cssWideKeywords[keywords], + textEdit: TextEdit.replace(this.getCompletionRange(existingNode), keywords), + kind: CompletionItemKind.Value + }); + } + for (const func in cssWideFunctions) { + const insertText = moveCursorInsideParenthesis(func); + result.items.push({ + label: func, + documentation: cssWideFunctions[func], + textEdit: TextEdit.replace(this.getCompletionRange(existingNode), insertText), + kind: CompletionItemKind.Function, + insertTextFormat: SnippetFormat, + command: startsWith(func, "var") ? retriggerCommand : void 0 + }); + } + return result; + } + getCompletionsForInterpolation(node, result) { + if (this.offset >= node.offset + 2) { + this.getVariableProposals(null, result); + } + return result; + } + getVariableProposals(existingNode, result) { + const symbols = this.getSymbolContext().findSymbolsAtOffset(this.offset, ReferenceType.Variable); + for (const symbol of symbols) { + const insertText = startsWith(symbol.name, "--") ? `var(${symbol.name})` : symbol.name; + const completionItem = { + label: symbol.name, + documentation: symbol.value ? getLimitedString(symbol.value) : symbol.value, + textEdit: TextEdit.replace(this.getCompletionRange(existingNode), insertText), + kind: CompletionItemKind.Variable, + sortText: SortTexts.Variable + }; + if (typeof completionItem.documentation === "string" && isColorString(completionItem.documentation)) { + completionItem.kind = CompletionItemKind.Color; + } + if (symbol.node.type === NodeType.FunctionParameter) { + const mixinNode = symbol.node.getParent(); + if (mixinNode.type === NodeType.MixinDeclaration) { + completionItem.detail = t("argument from '{0}'", mixinNode.getName()); + } + } + result.items.push(completionItem); + } + return result; + } + getVariableProposalsForCSSVarFunction(result) { + const allReferencedVariables = new Set2(); + this.styleSheet.acceptVisitor(new VariableCollector(allReferencedVariables, this.offset)); + let symbols = this.getSymbolContext().findSymbolsAtOffset(this.offset, ReferenceType.Variable); + for (const symbol of symbols) { + if (startsWith(symbol.name, "--")) { + const completionItem = { + label: symbol.name, + documentation: symbol.value ? getLimitedString(symbol.value) : symbol.value, + textEdit: TextEdit.replace(this.getCompletionRange(null), symbol.name), + kind: CompletionItemKind.Variable + }; + if (typeof completionItem.documentation === "string" && isColorString(completionItem.documentation)) { + completionItem.kind = CompletionItemKind.Color; + } + result.items.push(completionItem); + } + allReferencedVariables.remove(symbol.name); + } + for (const name of allReferencedVariables.getEntries()) { + if (startsWith(name, "--")) { + const completionItem = { + label: name, + textEdit: TextEdit.replace(this.getCompletionRange(null), name), + kind: CompletionItemKind.Variable + }; + result.items.push(completionItem); + } + } + return result; + } + getUnitProposals(entry, existingNode, result) { + let currentWord = "0"; + if (this.currentWord.length > 0) { + const numMatch = this.currentWord.match(/^-?\d[\.\d+]*/); + if (numMatch) { + currentWord = numMatch[0]; + result.isIncomplete = currentWord.length === this.currentWord.length; + } + } else if (this.currentWord.length === 0) { + result.isIncomplete = true; + } + if (existingNode && existingNode.parent && existingNode.parent.type === NodeType.Term) { + existingNode = existingNode.getParent(); + } + if (entry.restrictions) { + for (const restriction of entry.restrictions) { + const units2 = units[restriction]; + if (units2) { + for (const unit of units2) { + const insertText = currentWord + unit; + result.items.push({ + label: insertText, + textEdit: TextEdit.replace(this.getCompletionRange(existingNode), insertText), + kind: CompletionItemKind.Unit + }); + } + } + } + } + return result; + } + getCompletionRange(existingNode) { + if (existingNode && existingNode.offset <= this.offset && this.offset <= existingNode.end) { + const end = existingNode.end !== -1 ? this.textDocument.positionAt(existingNode.end) : this.position; + const start = this.textDocument.positionAt(existingNode.offset); + if (start.line === end.line) { + return Range.create(start, end); + } + } + return this.defaultReplaceRange; + } + getColorProposals(entry, existingNode, result) { + for (const color in colors) { + result.items.push({ + label: color, + documentation: colors[color], + textEdit: TextEdit.replace(this.getCompletionRange(existingNode), color), + kind: CompletionItemKind.Color + }); + } + for (const color in colorKeywords) { + result.items.push({ + label: color, + documentation: colorKeywords[color], + textEdit: TextEdit.replace(this.getCompletionRange(existingNode), color), + kind: CompletionItemKind.Value + }); + } + const colorValues = new Set2(); + this.styleSheet.acceptVisitor(new ColorValueCollector(colorValues, this.offset)); + for (const color of colorValues.getEntries()) { + result.items.push({ + label: color, + textEdit: TextEdit.replace(this.getCompletionRange(existingNode), color), + kind: CompletionItemKind.Color + }); + } + for (const p of colorFunctions) { + result.items.push({ + label: p.label, + detail: p.func, + documentation: p.desc, + textEdit: TextEdit.replace(this.getCompletionRange(existingNode), p.insertText), + insertTextFormat: SnippetFormat, + kind: CompletionItemKind.Function + }); + } + return result; + } + getPositionProposals(entry, existingNode, result) { + for (const position in positionKeywords) { + result.items.push({ + label: position, + documentation: positionKeywords[position], + textEdit: TextEdit.replace(this.getCompletionRange(existingNode), position), + kind: CompletionItemKind.Value + }); + } + return result; + } + getRepeatStyleProposals(entry, existingNode, result) { + for (const repeat2 in repeatStyleKeywords) { + result.items.push({ + label: repeat2, + documentation: repeatStyleKeywords[repeat2], + textEdit: TextEdit.replace(this.getCompletionRange(existingNode), repeat2), + kind: CompletionItemKind.Value + }); + } + return result; + } + getLineStyleProposals(entry, existingNode, result) { + for (const lineStyle in lineStyleKeywords) { + result.items.push({ + label: lineStyle, + documentation: lineStyleKeywords[lineStyle], + textEdit: TextEdit.replace(this.getCompletionRange(existingNode), lineStyle), + kind: CompletionItemKind.Value + }); + } + return result; + } + getLineWidthProposals(entry, existingNode, result) { + for (const lineWidth of lineWidthKeywords) { + result.items.push({ + label: lineWidth, + textEdit: TextEdit.replace(this.getCompletionRange(existingNode), lineWidth), + kind: CompletionItemKind.Value + }); + } + return result; + } + getGeometryBoxProposals(entry, existingNode, result) { + for (const box in geometryBoxKeywords) { + result.items.push({ + label: box, + documentation: geometryBoxKeywords[box], + textEdit: TextEdit.replace(this.getCompletionRange(existingNode), box), + kind: CompletionItemKind.Value + }); + } + return result; + } + getBoxProposals(entry, existingNode, result) { + for (const box in boxKeywords) { + result.items.push({ + label: box, + documentation: boxKeywords[box], + textEdit: TextEdit.replace(this.getCompletionRange(existingNode), box), + kind: CompletionItemKind.Value + }); + } + return result; + } + getImageProposals(entry, existingNode, result) { + for (const image in imageFunctions) { + const insertText = moveCursorInsideParenthesis(image); + result.items.push({ + label: image, + documentation: imageFunctions[image], + textEdit: TextEdit.replace(this.getCompletionRange(existingNode), insertText), + kind: CompletionItemKind.Function, + insertTextFormat: image !== insertText ? SnippetFormat : void 0 + }); + } + return result; + } + getTimingFunctionProposals(entry, existingNode, result) { + for (const timing in transitionTimingFunctions) { + const insertText = moveCursorInsideParenthesis(timing); + result.items.push({ + label: timing, + documentation: transitionTimingFunctions[timing], + textEdit: TextEdit.replace(this.getCompletionRange(existingNode), insertText), + kind: CompletionItemKind.Function, + insertTextFormat: timing !== insertText ? SnippetFormat : void 0 + }); + } + return result; + } + getBasicShapeProposals(entry, existingNode, result) { + for (const shape in basicShapeFunctions) { + const insertText = moveCursorInsideParenthesis(shape); + result.items.push({ + label: shape, + documentation: basicShapeFunctions[shape], + textEdit: TextEdit.replace(this.getCompletionRange(existingNode), insertText), + kind: CompletionItemKind.Function, + insertTextFormat: shape !== insertText ? SnippetFormat : void 0 + }); + } + return result; + } + getCompletionsForStylesheet(result) { + const node = this.styleSheet.findFirstChildBeforeOffset(this.offset); + if (!node) { + return this.getCompletionForTopLevel(result); + } + if (node instanceof RuleSet) { + return this.getCompletionsForRuleSet(node, result); + } + if (node instanceof Supports) { + return this.getCompletionsForSupports(node, result); + } + return result; + } + getCompletionForTopLevel(result) { + this.cssDataManager.getAtDirectives().forEach((entry) => { + result.items.push({ + label: entry.name, + textEdit: TextEdit.replace(this.getCompletionRange(null), entry.name), + documentation: getEntryDescription(entry, this.doesSupportMarkdown()), + tags: isDeprecated(entry) ? [CompletionItemTag.Deprecated] : [], + kind: CompletionItemKind.Keyword + }); + }); + this.getCompletionsForSelector(null, false, result); + return result; + } + getCompletionsForRuleSet(ruleSet, result) { + const declarations = ruleSet.getDeclarations(); + const isAfter = declarations && declarations.endsWith("}") && this.offset >= declarations.end; + if (isAfter) { + return this.getCompletionForTopLevel(result); + } + const isInSelectors = !declarations || this.offset <= declarations.offset; + if (isInSelectors) { + return this.getCompletionsForSelector(ruleSet, ruleSet.isNested(), result); + } + return this.getCompletionsForDeclarations(ruleSet.getDeclarations(), result); + } + getCompletionsForSelector(ruleSet, isNested, result) { + const existingNode = this.findInNodePath(NodeType.PseudoSelector, NodeType.IdentifierSelector, NodeType.ClassSelector, NodeType.ElementNameSelector); + if (!existingNode && this.hasCharacterAtPosition(this.offset - this.currentWord.length - 1, ":")) { + this.currentWord = ":" + this.currentWord; + if (this.hasCharacterAtPosition(this.offset - this.currentWord.length - 1, ":")) { + this.currentWord = ":" + this.currentWord; + } + this.defaultReplaceRange = Range.create(Position.create(this.position.line, this.position.character - this.currentWord.length), this.position); + } + const pseudoClasses = this.cssDataManager.getPseudoClasses(); + pseudoClasses.forEach((entry) => { + const insertText = moveCursorInsideParenthesis(entry.name); + const item = { + label: entry.name, + textEdit: TextEdit.replace(this.getCompletionRange(existingNode), insertText), + documentation: getEntryDescription(entry, this.doesSupportMarkdown()), + tags: isDeprecated(entry) ? [CompletionItemTag.Deprecated] : [], + kind: CompletionItemKind.Function, + insertTextFormat: entry.name !== insertText ? SnippetFormat : void 0 + }; + if (startsWith(entry.name, ":-")) { + item.sortText = SortTexts.VendorPrefixed; + } + result.items.push(item); + }); + const pseudoElements = this.cssDataManager.getPseudoElements(); + pseudoElements.forEach((entry) => { + const insertText = moveCursorInsideParenthesis(entry.name); + const item = { + label: entry.name, + textEdit: TextEdit.replace(this.getCompletionRange(existingNode), insertText), + documentation: getEntryDescription(entry, this.doesSupportMarkdown()), + tags: isDeprecated(entry) ? [CompletionItemTag.Deprecated] : [], + kind: CompletionItemKind.Function, + insertTextFormat: entry.name !== insertText ? SnippetFormat : void 0 + }; + if (startsWith(entry.name, "::-")) { + item.sortText = SortTexts.VendorPrefixed; + } + result.items.push(item); + }); + if (!isNested) { + for (const entry of html5Tags) { + result.items.push({ + label: entry, + textEdit: TextEdit.replace(this.getCompletionRange(existingNode), entry), + kind: CompletionItemKind.Keyword + }); + } + for (const entry of svgElements) { + result.items.push({ + label: entry, + textEdit: TextEdit.replace(this.getCompletionRange(existingNode), entry), + kind: CompletionItemKind.Keyword + }); + } + } + const visited = {}; + visited[this.currentWord] = true; + const docText = this.textDocument.getText(); + this.styleSheet.accept((n) => { + if (n.type === NodeType.SimpleSelector && n.length > 0) { + const selector = docText.substr(n.offset, n.length); + if (selector.charAt(0) === "." && !visited[selector]) { + visited[selector] = true; + result.items.push({ + label: selector, + textEdit: TextEdit.replace(this.getCompletionRange(existingNode), selector), + kind: CompletionItemKind.Keyword + }); + } + return false; + } + return true; + }); + if (ruleSet && ruleSet.isNested()) { + const selector = ruleSet.getSelectors().findFirstChildBeforeOffset(this.offset); + if (selector && ruleSet.getSelectors().getChildren().indexOf(selector) === 0) { + this.getPropertyProposals(null, result); + } + } + return result; + } + getCompletionsForDeclarations(declarations, result) { + if (!declarations || this.offset === declarations.offset) { + return result; + } + const node = declarations.findFirstChildBeforeOffset(this.offset); + if (!node) { + return this.getCompletionsForDeclarationProperty(null, result); + } + if (node instanceof AbstractDeclaration) { + const declaration = node; + if (!isDefined(declaration.colonPosition) || this.offset <= declaration.colonPosition) { + return this.getCompletionsForDeclarationProperty(declaration, result); + } else if (isDefined(declaration.semicolonPosition) && declaration.semicolonPosition < this.offset) { + if (this.offset === declaration.semicolonPosition + 1) { + return result; + } + return this.getCompletionsForDeclarationProperty(null, result); + } + if (declaration instanceof Declaration) { + return this.getCompletionsForDeclarationValue(declaration, result); + } + } else if (node instanceof ExtendsReference) { + this.getCompletionsForExtendsReference(node, null, result); + } else if (this.currentWord && this.currentWord[0] === "@") { + this.getCompletionsForDeclarationProperty(null, result); + } else if (node instanceof RuleSet) { + this.getCompletionsForDeclarationProperty(null, result); + } + return result; + } + getCompletionsForVariableDeclaration(declaration, result) { + if (this.offset && isDefined(declaration.colonPosition) && this.offset > declaration.colonPosition) { + this.getVariableProposals(declaration.getValue() || null, result); + } + return result; + } + getCompletionsForExpression(expression, result) { + const parent = expression.getParent(); + if (parent instanceof FunctionArgument) { + this.getCompletionsForFunctionArgument(parent, parent.getParent(), result); + return result; + } + const declaration = expression.findParent(NodeType.Declaration); + if (!declaration) { + this.getTermProposals(void 0, null, result); + return result; + } + const node = expression.findChildAtOffset(this.offset, true); + if (!node) { + return this.getCompletionsForDeclarationValue(declaration, result); + } + if (node instanceof NumericValue || node instanceof Identifier) { + return this.getCompletionsForDeclarationValue(declaration, result); + } + return result; + } + getCompletionsForFunctionArgument(arg, func, result) { + const identifier = func.getIdentifier(); + if (identifier && identifier.matches("var")) { + if (!func.getArguments().hasChildren() || func.getArguments().getChild(0) === arg) { + this.getVariableProposalsForCSSVarFunction(result); + } + } + return result; + } + getCompletionsForFunctionDeclaration(decl, result) { + const declarations = decl.getDeclarations(); + if (declarations && this.offset > declarations.offset && this.offset < declarations.end) { + this.getTermProposals(void 0, null, result); + } + return result; + } + getCompletionsForMixinReference(ref, result) { + const allMixins = this.getSymbolContext().findSymbolsAtOffset(this.offset, ReferenceType.Mixin); + for (const mixinSymbol of allMixins) { + if (mixinSymbol.node instanceof MixinDeclaration) { + result.items.push(this.makeTermProposal(mixinSymbol, mixinSymbol.node.getParameters(), null)); + } + } + const identifierNode = ref.getIdentifier() || null; + this.completionParticipants.forEach((participant) => { + if (participant.onCssMixinReference) { + participant.onCssMixinReference({ + mixinName: this.currentWord, + range: this.getCompletionRange(identifierNode) + }); + } + }); + return result; + } + getTermProposals(entry, existingNode, result) { + const allFunctions = this.getSymbolContext().findSymbolsAtOffset(this.offset, ReferenceType.Function); + for (const functionSymbol of allFunctions) { + if (functionSymbol.node instanceof FunctionDeclaration) { + result.items.push(this.makeTermProposal(functionSymbol, functionSymbol.node.getParameters(), existingNode)); + } + } + return result; + } + makeTermProposal(symbol, parameters, existingNode) { + const decl = symbol.node; + const params = parameters.getChildren().map((c) => { + return c instanceof FunctionParameter ? c.getName() : c.getText(); + }); + const insertText = symbol.name + "(" + params.map((p, index) => "${" + (index + 1) + ":" + p + "}").join(", ") + ")"; + return { + label: symbol.name, + detail: symbol.name + "(" + params.join(", ") + ")", + textEdit: TextEdit.replace(this.getCompletionRange(existingNode), insertText), + insertTextFormat: SnippetFormat, + kind: CompletionItemKind.Function, + sortText: SortTexts.Term + }; + } + getCompletionsForSupportsCondition(supportsCondition, result) { + const child = supportsCondition.findFirstChildBeforeOffset(this.offset); + if (child) { + if (child instanceof Declaration) { + if (!isDefined(child.colonPosition) || this.offset <= child.colonPosition) { + return this.getCompletionsForDeclarationProperty(child, result); + } else { + return this.getCompletionsForDeclarationValue(child, result); + } + } else if (child instanceof SupportsCondition) { + return this.getCompletionsForSupportsCondition(child, result); + } + } + if (isDefined(supportsCondition.lParent) && this.offset > supportsCondition.lParent && (!isDefined(supportsCondition.rParent) || this.offset <= supportsCondition.rParent)) { + return this.getCompletionsForDeclarationProperty(null, result); + } + return result; + } + getCompletionsForSupports(supports, result) { + const declarations = supports.getDeclarations(); + const inInCondition = !declarations || this.offset <= declarations.offset; + if (inInCondition) { + const child = supports.findFirstChildBeforeOffset(this.offset); + if (child instanceof SupportsCondition) { + return this.getCompletionsForSupportsCondition(child, result); + } + return result; + } + return this.getCompletionForTopLevel(result); + } + getCompletionsForMediaCondition(mediaCondition, result) { + const child = mediaCondition.findFirstChildBeforeOffset(this.offset); + if (child) { + if (child instanceof MediaFeature) { + const featureName = child.getChild(0); + if (featureName && this.offset > featureName.end) { + const name = featureName.getText(); + const media2 = this.cssDataManager.getAtDirective("@media")?.descriptors?.find((descriptor) => descriptor.name === name); + if (media2) { + return this.getValueEnumProposals(media2, null, result); + } + } + } else if (child instanceof MediaCondition) { + return this.getCompletionsForMediaCondition(child, result); + } + } + const media = this.cssDataManager.getAtDirective("@media"); + for (const descriptor of media?.descriptors || []) { + let command = void 0; + let text = descriptor.name; + if (descriptor.type === "discrete") { + if (descriptor.values) { + command = retriggerCommand; + } + text = `${descriptor.name}: `; + } + result.items.push({ + label: descriptor.name, + textEdit: TextEdit.replace(this.getCompletionRange(null), text), + documentation: getEntryDescription(descriptor, this.doesSupportMarkdown()), + tags: isDeprecated(descriptor) ? [CompletionItemTag.Deprecated] : [], + kind: CompletionItemKind.Keyword, + command + }); + } + return result; + } + getCompletionsForExtendsReference(extendsRef, existingNode, result) { + return result; + } + getCompletionForUriLiteralValue(uriLiteralNode, result) { + let uriValue; + let position; + let range; + if (!uriLiteralNode.hasChildren()) { + uriValue = ""; + position = this.position; + const emptyURIValuePosition = this.textDocument.positionAt(uriLiteralNode.offset + "url(".length); + range = Range.create(emptyURIValuePosition, emptyURIValuePosition); + } else { + const uriValueNode = uriLiteralNode.getChild(0); + uriValue = uriValueNode.getText(); + position = this.position; + range = this.getCompletionRange(uriValueNode); + } + this.completionParticipants.forEach((participant) => { + if (participant.onCssURILiteralValue) { + participant.onCssURILiteralValue({ + uriValue, + position, + range + }); + } + }); + return result; + } + getCompletionForImportPath(importPathNode, result) { + this.completionParticipants.forEach((participant) => { + if (participant.onCssImportPath) { + participant.onCssImportPath({ + pathValue: importPathNode.getText(), + position: this.position, + range: this.getCompletionRange(importPathNode) + }); + } + }); + return result; + } + hasCharacterAtPosition(offset, char) { + const text = this.textDocument.getText(); + return offset >= 0 && offset < text.length && text.charAt(offset) === char; + } + doesSupportMarkdown() { + if (!isDefined(this.supportsMarkdown)) { + if (!isDefined(this.lsOptions.clientCapabilities)) { + this.supportsMarkdown = true; + return this.supportsMarkdown; + } + const documentationFormat = this.lsOptions.clientCapabilities.textDocument?.completion?.completionItem?.documentationFormat; + this.supportsMarkdown = Array.isArray(documentationFormat) && documentationFormat.indexOf(MarkupKind.Markdown) !== -1; + } + return this.supportsMarkdown; + } +}; +function isDeprecated(entry) { + if (entry.status && (entry.status === "nonstandard" || entry.status === "obsolete")) { + return true; + } + return false; +} +var Set2 = class { + constructor() { + this.entries = {}; + } + add(entry) { + this.entries[entry] = true; + } + remove(entry) { + delete this.entries[entry]; + } + getEntries() { + return Object.keys(this.entries); + } +}; +function moveCursorInsideParenthesis(text) { + return text.replace(/\(\)$/, "($1)"); +} +function collectValues(styleSheet, declaration) { + const fullPropertyName = declaration.getFullPropertyName(); + const entries = new Set2(); + function visitValue(node) { + if (node instanceof Identifier || node instanceof NumericValue || node instanceof HexColorValue) { + entries.add(node.getText()); + } + return true; + } + function matchesProperty(decl) { + const propertyName = decl.getFullPropertyName(); + return fullPropertyName === propertyName; + } + function vistNode(node) { + if (node instanceof Declaration && node !== declaration) { + if (matchesProperty(node)) { + const value = node.getValue(); + if (value) { + value.accept(visitValue); + } + } + } + return true; + } + styleSheet.accept(vistNode); + return entries; +} +var ColorValueCollector = class { + constructor(entries, currentOffset) { + this.entries = entries; + this.currentOffset = currentOffset; + } + visitNode(node) { + if (node instanceof HexColorValue || node instanceof Function && isColorConstructor(node)) { + if (this.currentOffset < node.offset || node.end < this.currentOffset) { + this.entries.add(node.getText()); + } + } + return true; + } +}; +var VariableCollector = class { + constructor(entries, currentOffset) { + this.entries = entries; + this.currentOffset = currentOffset; + } + visitNode(node) { + if (node instanceof Identifier && node.isCustomProperty) { + if (this.currentOffset < node.offset || node.end < this.currentOffset) { + this.entries.add(node.getText()); + } + } + return true; + } +}; +function getCurrentWord(document, offset) { + let i = offset - 1; + const text = document.getText(); + while (i >= 0 && ' \n\r":{[()]},*>+'.indexOf(text.charAt(i)) === -1) { + i--; + } + return text.substring(i + 1, offset); +} + +// node_modules/vscode-css-languageservice/lib/esm/services/selectorPrinting.js +var Element = class _Element { + constructor() { + this.parent = null; + this.children = null; + this.attributes = null; + } + findAttribute(name) { + if (this.attributes) { + for (const attribute of this.attributes) { + if (attribute.name === name) { + return attribute.value; + } + } + } + return null; + } + addChild(child) { + if (child instanceof _Element) { + child.parent = this; + } + if (!this.children) { + this.children = []; + } + this.children.push(child); + } + append(text) { + if (this.attributes) { + const last = this.attributes[this.attributes.length - 1]; + last.value = last.value + text; + } + } + prepend(text) { + if (this.attributes) { + const first = this.attributes[0]; + first.value = text + first.value; + } + } + findRoot() { + let curr = this; + while (curr.parent && !(curr.parent instanceof RootElement)) { + curr = curr.parent; + } + return curr; + } + removeChild(child) { + if (this.children) { + const index = this.children.indexOf(child); + if (index !== -1) { + this.children.splice(index, 1); + return true; + } + } + return false; + } + addAttr(name, value) { + if (!this.attributes) { + this.attributes = []; + } + for (const attribute of this.attributes) { + if (attribute.name === name) { + attribute.value += " " + value; + return; + } + } + this.attributes.push({ name, value }); + } + clone(cloneChildren = true) { + const elem = new _Element(); + if (this.attributes) { + elem.attributes = []; + for (const attribute of this.attributes) { + elem.addAttr(attribute.name, attribute.value); + } + } + if (cloneChildren && this.children) { + elem.children = []; + for (let index = 0; index < this.children.length; index++) { + elem.addChild(this.children[index].clone()); + } + } + return elem; + } + cloneWithParent() { + const clone = this.clone(false); + if (this.parent && !(this.parent instanceof RootElement)) { + const parentClone = this.parent.cloneWithParent(); + parentClone.addChild(clone); + } + return clone; + } +}; +var RootElement = class extends Element { +}; +var LabelElement = class extends Element { + constructor(label) { + super(); + this.addAttr("name", label); + } +}; +var MarkedStringPrinter = class { + constructor(quote) { + this.quote = quote; + this.result = []; + } + print(element, selectorContexts) { + this.result = []; + if (element instanceof RootElement) { + if (element.children) { + this.doPrint(element.children, 0); + } + } else { + this.doPrint([element], 0); + } + let value; + if (selectorContexts) { + value = [...selectorContexts, ...this.result].join("\n"); + } else { + value = this.result.join("\n"); + } + return [{ language: "html", value }]; + } + doPrint(elements, indent) { + for (const element of elements) { + this.doPrintElement(element, indent); + if (element.children) { + this.doPrint(element.children, indent + 1); + } + } + } + writeLine(level, content) { + const indent = new Array(level + 1).join(" "); + this.result.push(indent + content); + } + doPrintElement(element, indent) { + const name = element.findAttribute("name"); + if (element instanceof LabelElement || name === "\u2026") { + this.writeLine(indent, name); + return; + } + const content = ["<"]; + if (name) { + content.push(name); + } else { + content.push("element"); + } + if (element.attributes) { + for (const attr of element.attributes) { + if (attr.name !== "name") { + content.push(" "); + content.push(attr.name); + const value = attr.value; + if (value) { + content.push("="); + content.push(quotes.ensure(value, this.quote)); + } + } + } + } + content.push(">"); + this.writeLine(indent, content.join("")); + } +}; +var quotes; +(function(quotes2) { + function ensure(value, which) { + return which + remove(value) + which; + } + quotes2.ensure = ensure; + function remove(value) { + const match = value.match(/^['"](.*)["']$/); + if (match) { + return match[1]; + } + return value; + } + quotes2.remove = remove; +})(quotes || (quotes = {})); +var Specificity = class { + constructor() { + this.id = 0; + this.attr = 0; + this.tag = 0; + } +}; +function toElement(node, parentElement) { + let result = new Element(); + for (const child of node.getChildren()) { + switch (child.type) { + case NodeType.SelectorCombinator: + if (parentElement) { + const segments = child.getText().split("&"); + if (segments.length === 1) { + result.addAttr("name", segments[0]); + break; + } + result = parentElement.cloneWithParent(); + if (segments[0]) { + const root = result.findRoot(); + root.prepend(segments[0]); + } + for (let i = 1; i < segments.length; i++) { + if (i > 1) { + const clone = parentElement.cloneWithParent(); + result.addChild(clone.findRoot()); + result = clone; + } + result.append(segments[i]); + } + } + break; + case NodeType.SelectorPlaceholder: + if (child.matches("@at-root")) { + return result; + } + // fall through + case NodeType.ElementNameSelector: + const text = child.getText(); + result.addAttr("name", text === "*" ? "element" : unescape(text)); + break; + case NodeType.ClassSelector: + result.addAttr("class", unescape(child.getText().substring(1))); + break; + case NodeType.IdentifierSelector: + result.addAttr("id", unescape(child.getText().substring(1))); + break; + case NodeType.MixinDeclaration: + result.addAttr("class", child.getName()); + break; + case NodeType.PseudoSelector: + result.addAttr(unescape(child.getText()), ""); + break; + case NodeType.AttributeSelector: + const selector = child; + const identifier = selector.getIdentifier(); + if (identifier) { + const expression = selector.getValue(); + const operator = selector.getOperator(); + let value; + if (expression && operator) { + switch (unescape(operator.getText())) { + case "|=": + value = `${quotes.remove(unescape(expression.getText()))}-\u2026`; + break; + case "^=": + value = `${quotes.remove(unescape(expression.getText()))}\u2026`; + break; + case "$=": + value = `\u2026${quotes.remove(unescape(expression.getText()))}`; + break; + case "~=": + value = ` \u2026 ${quotes.remove(unescape(expression.getText()))} \u2026 `; + break; + case "*=": + value = `\u2026${quotes.remove(unescape(expression.getText()))}\u2026`; + break; + default: + value = quotes.remove(unescape(expression.getText())); + break; + } + } + result.addAttr(unescape(identifier.getText()), value); + } + break; + } + } + return result; +} +function unescape(content) { + const scanner = new Scanner(); + scanner.setSource(content); + const token = scanner.scanUnquotedString(); + if (token) { + return token.text; + } + return content; +} +var SelectorPrinting = class { + constructor(cssDataManager) { + this.cssDataManager = cssDataManager; + } + selectorToMarkedString(node, selectorContexts) { + const root = selectorToElement(node); + if (root) { + const markedStrings = new MarkedStringPrinter('"').print(root, selectorContexts); + markedStrings.push(this.selectorToSpecificityMarkedString(node)); + return markedStrings; + } else { + return []; + } + } + simpleSelectorToMarkedString(node) { + const element = toElement(node); + const markedStrings = new MarkedStringPrinter('"').print(element); + markedStrings.push(this.selectorToSpecificityMarkedString(node)); + return markedStrings; + } + isPseudoElementIdentifier(text) { + const match = text.match(/^::?([\w-]+)/); + if (!match) { + return false; + } + return !!this.cssDataManager.getPseudoElement("::" + match[1]); + } + selectorToSpecificityMarkedString(node) { + const calculateMostSpecificListItem = (childElements) => { + const specificity2 = new Specificity(); + let mostSpecificListItem = new Specificity(); + for (const containerElement of childElements) { + for (const childElement of containerElement.getChildren()) { + const itemSpecificity = calculateScore(childElement); + if (itemSpecificity.id > mostSpecificListItem.id) { + mostSpecificListItem = itemSpecificity; + continue; + } else if (itemSpecificity.id < mostSpecificListItem.id) { + continue; + } + if (itemSpecificity.attr > mostSpecificListItem.attr) { + mostSpecificListItem = itemSpecificity; + continue; + } else if (itemSpecificity.attr < mostSpecificListItem.attr) { + continue; + } + if (itemSpecificity.tag > mostSpecificListItem.tag) { + mostSpecificListItem = itemSpecificity; + continue; + } + } + } + specificity2.id += mostSpecificListItem.id; + specificity2.attr += mostSpecificListItem.attr; + specificity2.tag += mostSpecificListItem.tag; + return specificity2; + }; + const calculateScore = (node2) => { + const specificity2 = new Specificity(); + elementLoop: for (const element of node2.getChildren()) { + switch (element.type) { + case NodeType.IdentifierSelector: + specificity2.id++; + break; + case NodeType.ClassSelector: + case NodeType.AttributeSelector: + specificity2.attr++; + break; + case NodeType.ElementNameSelector: + if (element.matches("*")) { + break; + } + specificity2.tag++; + break; + case NodeType.PseudoSelector: + const text = element.getText(); + const childElements = element.getChildren(); + if (this.isPseudoElementIdentifier(text)) { + if (text.match(/^::slotted/i) && childElements.length > 0) { + specificity2.tag++; + let mostSpecificListItem = calculateMostSpecificListItem(childElements); + specificity2.id += mostSpecificListItem.id; + specificity2.attr += mostSpecificListItem.attr; + specificity2.tag += mostSpecificListItem.tag; + continue elementLoop; + } + specificity2.tag++; + continue elementLoop; + } + if (text.match(/^:where/i)) { + continue elementLoop; + } + if (text.match(/^:(?:not|has|is)/i) && childElements.length > 0) { + let mostSpecificListItem = calculateMostSpecificListItem(childElements); + specificity2.id += mostSpecificListItem.id; + specificity2.attr += mostSpecificListItem.attr; + specificity2.tag += mostSpecificListItem.tag; + continue elementLoop; + } + if (text.match(/^:(?:host|host-context)/i) && childElements.length > 0) { + specificity2.attr++; + let mostSpecificListItem = calculateMostSpecificListItem(childElements); + specificity2.id += mostSpecificListItem.id; + specificity2.attr += mostSpecificListItem.attr; + specificity2.tag += mostSpecificListItem.tag; + continue elementLoop; + } + if (text.match(/^:(?:nth-child|nth-last-child)/i) && childElements.length > 0) { + specificity2.attr++; + const lastChild = childElements[childElements.length - 1]; + if (childElements.length > 2 && lastChild.type === NodeType.SelectorList) { + let mostSpecificListItem = calculateMostSpecificListItem(lastChild.getChildren()); + specificity2.id += mostSpecificListItem.id; + specificity2.attr += mostSpecificListItem.attr; + specificity2.tag += mostSpecificListItem.tag; + continue elementLoop; + } + const parser = new Parser(); + const pseudoSelectorText = childElements[1].getText(); + parser.scanner.setSource(pseudoSelectorText); + const firstToken = parser.scanner.scan(); + const secondToken = parser.scanner.scan(); + if (firstToken.text === "n" || firstToken.text === "-n" && secondToken.text === "of") { + const complexSelectorListNodes = []; + const complexSelectorText = pseudoSelectorText.slice(secondToken.offset + 2); + const complexSelectorArray = complexSelectorText.split(","); + for (const selector of complexSelectorArray) { + const node3 = parser.internalParse(selector, parser._parseSelector); + if (node3) { + complexSelectorListNodes.push(node3); + } + } + let mostSpecificListItem = calculateMostSpecificListItem(complexSelectorListNodes); + specificity2.id += mostSpecificListItem.id; + specificity2.attr += mostSpecificListItem.attr; + specificity2.tag += mostSpecificListItem.tag; + continue elementLoop; + } + continue elementLoop; + } + specificity2.attr++; + continue elementLoop; + } + if (element.getChildren().length > 0) { + const itemSpecificity = calculateScore(element); + specificity2.id += itemSpecificity.id; + specificity2.attr += itemSpecificity.attr; + specificity2.tag += itemSpecificity.tag; + } + } + return specificity2; + }; + const specificity = calculateScore(node); + return `[${t("Selector Specificity")}](https://developer.mozilla.org/docs/Web/CSS/Specificity): (${specificity.id}, ${specificity.attr}, ${specificity.tag})`; + } +}; +var SelectorElementBuilder = class { + constructor(element) { + this.prev = null; + this.element = element; + } + processSelector(selector) { + let parentElement = null; + if (!(this.element instanceof RootElement)) { + if (selector.getChildren().some((c) => c.hasChildren() && c.getChild(0).type === NodeType.SelectorCombinator)) { + const curr = this.element.findRoot(); + if (curr.parent instanceof RootElement) { + parentElement = this.element; + this.element = curr.parent; + this.element.removeChild(curr); + this.prev = null; + } + } + } + for (const selectorChild of selector.getChildren()) { + if (selectorChild instanceof SimpleSelector) { + if (this.prev instanceof SimpleSelector) { + const labelElement = new LabelElement("\u2026"); + this.element.addChild(labelElement); + this.element = labelElement; + } else if (this.prev && (this.prev.matches("+") || this.prev.matches("~")) && this.element.parent) { + this.element = this.element.parent; + } + if (this.prev && this.prev.matches("~")) { + this.element.addChild(new LabelElement("\u22EE")); + } + const thisElement = toElement(selectorChild, parentElement); + const root = thisElement.findRoot(); + this.element.addChild(root); + this.element = thisElement; + } + if (selectorChild instanceof SimpleSelector || selectorChild.type === NodeType.SelectorCombinatorParent || selectorChild.type === NodeType.SelectorCombinatorShadowPiercingDescendant || selectorChild.type === NodeType.SelectorCombinatorSibling || selectorChild.type === NodeType.SelectorCombinatorAllSiblings) { + this.prev = selectorChild; + } + } + } +}; +function isNewSelectorContext(node) { + switch (node.type) { + case NodeType.MixinDeclaration: + case NodeType.Stylesheet: + return true; + } + return false; +} +function selectorToElement(node) { + if (node.matches("@at-root")) { + return null; + } + const root = new RootElement(); + const parentRuleSets = []; + const ruleSet = node.getParent(); + if (ruleSet instanceof RuleSet) { + let parent = ruleSet.getParent(); + while (parent && !isNewSelectorContext(parent)) { + if (parent instanceof RuleSet) { + if (parent.getSelectors().matches("@at-root")) { + break; + } + parentRuleSets.push(parent); + } + parent = parent.getParent(); + } + } + const builder = new SelectorElementBuilder(root); + for (let i = parentRuleSets.length - 1; i >= 0; i--) { + const selector = parentRuleSets[i].getSelectors().getChild(0); + if (selector) { + builder.processSelector(selector); + } + } + builder.processSelector(node); + return root; +} + +// node_modules/vscode-css-languageservice/lib/esm/services/cssHover.js +var CSSHover = class { + constructor(clientCapabilities, cssDataManager) { + this.clientCapabilities = clientCapabilities; + this.cssDataManager = cssDataManager; + this.selectorPrinting = new SelectorPrinting(cssDataManager); + } + configure(settings) { + this.defaultSettings = settings; + } + doHover(document, position, stylesheet, settings = this.defaultSettings) { + function getRange2(node) { + return Range.create(document.positionAt(node.offset), document.positionAt(node.end)); + } + const offset = document.offsetAt(position); + const nodepath = getNodePath(stylesheet, offset); + let hover = null; + let selectorContexts = []; + for (let i = 0; i < nodepath.length; i++) { + const node = nodepath[i]; + if (node instanceof Scope) { + const scopeLimits = node.getChild(0); + if (scopeLimits instanceof ScopeLimits) { + const scopeName = `${scopeLimits.getName()}`; + selectorContexts.push(`@scope${scopeName ? ` ${scopeName}` : ""}`); + } + } + if (node instanceof Media) { + const mediaList = node.getChild(0); + if (mediaList instanceof Medialist) { + const name = "@media " + mediaList.getText(); + selectorContexts.push(name); + } + } + if (node instanceof Selector) { + hover = { + contents: this.selectorPrinting.selectorToMarkedString(node, selectorContexts), + range: getRange2(node) + }; + break; + } + if (node instanceof SimpleSelector) { + if (!startsWith(node.getText(), "@")) { + hover = { + contents: this.selectorPrinting.simpleSelectorToMarkedString(node), + range: getRange2(node) + }; + } + break; + } + if (node instanceof Declaration) { + const propertyName = node.getFullPropertyName(); + const entry = this.cssDataManager.getProperty(propertyName); + if (entry) { + const contents = getEntryDescription(entry, this.doesSupportMarkdown(), settings); + if (contents) { + hover = { + contents, + range: getRange2(node) + }; + } else { + hover = null; + } + } + continue; + } + if (node instanceof UnknownAtRule) { + const atRuleName = node.getText(); + const entry = this.cssDataManager.getAtDirective(atRuleName); + if (entry) { + const contents = getEntryDescription(entry, this.doesSupportMarkdown(), settings); + if (contents) { + hover = { + contents, + range: getRange2(node) + }; + } else { + hover = null; + } + } + continue; + } + if (node instanceof Node && node.type === NodeType.PseudoSelector) { + const selectorName = node.getText(); + const entry = selectorName.slice(0, 2) === "::" ? this.cssDataManager.getPseudoElement(selectorName) : this.cssDataManager.getPseudoClass(selectorName); + if (entry) { + const contents = getEntryDescription(entry, this.doesSupportMarkdown(), settings); + if (contents) { + hover = { + contents, + range: getRange2(node) + }; + } else { + hover = null; + } + } + continue; + } + } + if (hover) { + hover.contents = this.convertContents(hover.contents); + } + return hover; + } + convertContents(contents) { + if (!this.doesSupportMarkdown()) { + if (typeof contents === "string") { + return contents; + } else if ("kind" in contents) { + return { + kind: "plaintext", + value: contents.value + }; + } else if (Array.isArray(contents)) { + return contents.map((c) => { + return typeof c === "string" ? c : c.value; + }); + } else { + return contents.value; + } + } + return contents; + } + doesSupportMarkdown() { + if (!isDefined(this.supportsMarkdown)) { + if (!isDefined(this.clientCapabilities)) { + this.supportsMarkdown = true; + return this.supportsMarkdown; + } + const hover = this.clientCapabilities.textDocument && this.clientCapabilities.textDocument.hover; + this.supportsMarkdown = hover && hover.contentFormat && Array.isArray(hover.contentFormat) && hover.contentFormat.indexOf(MarkupKind.Markdown) !== -1; + } + return this.supportsMarkdown; + } +}; + +// node_modules/vscode-css-languageservice/lib/esm/services/cssNavigation.js +var startsWithSchemeRegex = /^\w+:\/\//; +var startsWithData = /^data:/; +var CSSNavigation = class { + constructor(fileSystemProvider, resolveModuleReferences) { + this.fileSystemProvider = fileSystemProvider; + this.resolveModuleReferences = resolveModuleReferences; + } + configure(settings) { + this.defaultSettings = settings; + } + findDefinition(document, position, stylesheet) { + const symbols = new Symbols(stylesheet); + const offset = document.offsetAt(position); + const node = getNodeAtOffset(stylesheet, offset); + if (!node) { + return null; + } + const symbol = symbols.findSymbolFromNode(node); + if (!symbol) { + return null; + } + return { + uri: document.uri, + range: getRange(symbol.node, document) + }; + } + findReferences(document, position, stylesheet) { + const highlights = this.findDocumentHighlights(document, position, stylesheet); + return highlights.map((h) => { + return { + uri: document.uri, + range: h.range + }; + }); + } + getHighlightNode(document, position, stylesheet) { + const offset = document.offsetAt(position); + let node = getNodeAtOffset(stylesheet, offset); + if (!node || node.type === NodeType.Stylesheet || node.type === NodeType.Declarations || node.type === NodeType.ModuleConfig) { + return; + } + if (node.type === NodeType.Identifier && node.parent && node.parent.type === NodeType.ClassSelector) { + node = node.parent; + } + return node; + } + findDocumentHighlights(document, position, stylesheet) { + const result = []; + const node = this.getHighlightNode(document, position, stylesheet); + if (!node) { + return result; + } + const symbols = new Symbols(stylesheet); + const symbol = symbols.findSymbolFromNode(node); + const name = node.getText(); + stylesheet.accept((candidate) => { + if (symbol) { + if (symbols.matchesSymbol(candidate, symbol)) { + result.push({ + kind: getHighlightKind(candidate), + range: getRange(candidate, document) + }); + return false; + } + } else if (node && node.type === candidate.type && candidate.matches(name)) { + result.push({ + kind: getHighlightKind(candidate), + range: getRange(candidate, document) + }); + } + return true; + }); + return result; + } + isRawStringDocumentLinkNode(node) { + return node.type === NodeType.Import; + } + findDocumentLinks(document, stylesheet, documentContext) { + const linkData = this.findUnresolvedLinks(document, stylesheet); + const resolvedLinks = []; + for (let data of linkData) { + const link = data.link; + const target = link.target; + if (!target || startsWithData.test(target)) { + } else if (startsWithSchemeRegex.test(target)) { + resolvedLinks.push(link); + } else { + const resolved = documentContext.resolveReference(target, document.uri); + if (resolved) { + link.target = resolved; + } + resolvedLinks.push(link); + } + } + return resolvedLinks; + } + async findDocumentLinks2(document, stylesheet, documentContext) { + const linkData = this.findUnresolvedLinks(document, stylesheet); + const resolvedLinks = []; + for (let data of linkData) { + const link = data.link; + const target = link.target; + if (!target || startsWithData.test(target)) { + } else if (startsWithSchemeRegex.test(target)) { + resolvedLinks.push(link); + } else { + const resolvedTarget = await this.resolveReference(target, document.uri, documentContext, data.isRawLink); + if (resolvedTarget !== void 0) { + link.target = resolvedTarget; + resolvedLinks.push(link); + } + } + } + return resolvedLinks; + } + findUnresolvedLinks(document, stylesheet) { + const result = []; + const collect = (uriStringNode) => { + let rawUri = uriStringNode.getText(); + const range = getRange(uriStringNode, document); + if (range.start.line === range.end.line && range.start.character === range.end.character) { + return; + } + if (startsWith(rawUri, `'`) || startsWith(rawUri, `"`)) { + rawUri = rawUri.slice(1, -1); + } + const isRawLink = uriStringNode.parent ? this.isRawStringDocumentLinkNode(uriStringNode.parent) : false; + result.push({ link: { target: rawUri, range }, isRawLink }); + }; + stylesheet.accept((candidate) => { + if (candidate.type === NodeType.URILiteral) { + const first = candidate.getChild(0); + if (first) { + collect(first); + } + return false; + } + if (candidate.parent && this.isRawStringDocumentLinkNode(candidate.parent)) { + const rawText = candidate.getText(); + if (startsWith(rawText, `'`) || startsWith(rawText, `"`)) { + collect(candidate); + } + return false; + } + return true; + }); + return result; + } + findSymbolInformations(document, stylesheet) { + const result = []; + const addSymbolInformation = (name, kind, symbolNodeOrRange) => { + const range = symbolNodeOrRange instanceof Node ? getRange(symbolNodeOrRange, document) : symbolNodeOrRange; + const entry = { + name: name || t(""), + kind, + location: Location.create(document.uri, range) + }; + result.push(entry); + }; + this.collectDocumentSymbols(document, stylesheet, addSymbolInformation); + return result; + } + findDocumentSymbols(document, stylesheet) { + const result = []; + const parents = []; + const addDocumentSymbol = (name, kind, symbolNodeOrRange, nameNodeOrRange, bodyNode) => { + const range = symbolNodeOrRange instanceof Node ? getRange(symbolNodeOrRange, document) : symbolNodeOrRange; + let selectionRange = nameNodeOrRange instanceof Node ? getRange(nameNodeOrRange, document) : nameNodeOrRange; + if (!selectionRange || !containsRange(range, selectionRange)) { + selectionRange = Range.create(range.start, range.start); + } + const entry = { + name: name || t(""), + kind, + range, + selectionRange + }; + let top = parents.pop(); + while (top && !containsRange(top[1], range)) { + top = parents.pop(); + } + if (top) { + const topSymbol = top[0]; + if (!topSymbol.children) { + topSymbol.children = []; + } + topSymbol.children.push(entry); + parents.push(top); + } else { + result.push(entry); + } + if (bodyNode) { + parents.push([entry, getRange(bodyNode, document)]); + } + }; + this.collectDocumentSymbols(document, stylesheet, addDocumentSymbol); + return result; + } + collectDocumentSymbols(document, stylesheet, collect) { + stylesheet.accept((node) => { + if (node instanceof RuleSet) { + for (const selector of node.getSelectors().getChildren()) { + if (selector instanceof Selector) { + const range = Range.create(document.positionAt(selector.offset), document.positionAt(node.end)); + collect(selector.getText(), SymbolKind.Class, range, selector, node.getDeclarations()); + } + } + } else if (node instanceof VariableDeclaration) { + collect(node.getName(), SymbolKind.Variable, node, node.getVariable(), void 0); + } else if (node instanceof MixinDeclaration) { + collect(node.getName(), SymbolKind.Method, node, node.getIdentifier(), node.getDeclarations()); + } else if (node instanceof FunctionDeclaration) { + collect(node.getName(), SymbolKind.Function, node, node.getIdentifier(), node.getDeclarations()); + } else if (node instanceof Keyframe) { + const name = t("@keyframes {0}", node.getName()); + collect(name, SymbolKind.Class, node, node.getIdentifier(), node.getDeclarations()); + } else if (node instanceof FontFace) { + const name = t("@font-face"); + collect(name, SymbolKind.Class, node, void 0, node.getDeclarations()); + } else if (node instanceof Media) { + const mediaList = node.getChild(0); + if (mediaList instanceof Medialist) { + const name = "@media " + mediaList.getText(); + collect(name, SymbolKind.Module, node, mediaList, node.getDeclarations()); + } + } else if (node instanceof Scope) { + let scopeName = ""; + const scopeLimits = node.getChild(0); + if (scopeLimits instanceof ScopeLimits) { + scopeName = `${scopeLimits.getName()}`; + } + collect(`@scope${scopeName ? ` ${scopeName}` : ""}`, SymbolKind.Module, node, scopeLimits ?? void 0, node.getDeclarations()); + } + return true; + }); + } + findDocumentColors(document, stylesheet) { + const result = []; + stylesheet.accept((node) => { + const colorInfo = getColorInformation(node, document); + if (colorInfo) { + result.push(colorInfo); + } + return true; + }); + return result; + } + getColorPresentations(document, stylesheet, color, range) { + const result = []; + const red256 = Math.round(color.red * 255), green256 = Math.round(color.green * 255), blue256 = Math.round(color.blue * 255); + let label; + if (color.alpha === 1) { + label = `rgb(${red256}, ${green256}, ${blue256})`; + } else { + label = `rgba(${red256}, ${green256}, ${blue256}, ${color.alpha})`; + } + result.push({ label, textEdit: TextEdit.replace(range, label) }); + if (color.alpha === 1) { + label = `#${toTwoDigitHex(red256)}${toTwoDigitHex(green256)}${toTwoDigitHex(blue256)}`; + } else { + label = `#${toTwoDigitHex(red256)}${toTwoDigitHex(green256)}${toTwoDigitHex(blue256)}${toTwoDigitHex(Math.round(color.alpha * 255))}`; + } + result.push({ label, textEdit: TextEdit.replace(range, label) }); + const hsl = hslFromColor(color); + if (hsl.a === 1) { + label = `hsl(${hsl.h}, ${Math.round(hsl.s * 100)}%, ${Math.round(hsl.l * 100)}%)`; + } else { + label = `hsla(${hsl.h}, ${Math.round(hsl.s * 100)}%, ${Math.round(hsl.l * 100)}%, ${hsl.a})`; + } + result.push({ label, textEdit: TextEdit.replace(range, label) }); + const hwb = hwbFromColor(color); + if (hwb.a === 1) { + label = `hwb(${hwb.h} ${Math.round(hwb.w * 100)}% ${Math.round(hwb.b * 100)}%)`; + } else { + label = `hwb(${hwb.h} ${Math.round(hwb.w * 100)}% ${Math.round(hwb.b * 100)}% / ${hwb.a})`; + } + result.push({ label, textEdit: TextEdit.replace(range, label) }); + const lab = labFromColor(color); + if (lab.alpha === 1) { + label = `lab(${lab.l}% ${lab.a} ${lab.b})`; + } else { + label = `lab(${lab.l}% ${lab.a} ${lab.b} / ${lab.alpha})`; + } + result.push({ label, textEdit: TextEdit.replace(range, label) }); + const lch = lchFromColor(color); + if (lch.alpha === 1) { + label = `lch(${lch.l}% ${lch.c} ${lch.h})`; + } else { + label = `lch(${lch.l}% ${lch.c} ${lch.h} / ${lch.alpha})`; + } + result.push({ label, textEdit: TextEdit.replace(range, label) }); + const oklab = oklabFromColor(color); + label = oklab.alpha === 1 ? `oklab(${oklab.l}% ${oklab.a} ${oklab.b})` : `oklab(${oklab.l}% ${oklab.a} ${oklab.b} / ${oklab.alpha})`; + result.push({ label, textEdit: TextEdit.replace(range, label) }); + const oklch = oklchFromColor(color); + label = oklch.alpha === 1 ? `oklch(${oklch.l}% ${oklch.c} ${oklch.h})` : `oklch(${oklch.l}% ${oklch.c} ${oklch.h} / ${oklch.alpha})`; + result.push({ label, textEdit: TextEdit.replace(range, label) }); + return result; + } + prepareRename(document, position, stylesheet) { + const node = this.getHighlightNode(document, position, stylesheet); + if (node) { + return Range.create(document.positionAt(node.offset), document.positionAt(node.end)); + } + } + doRename(document, position, newName, stylesheet) { + const highlights = this.findDocumentHighlights(document, position, stylesheet); + const edits = highlights.map((h) => TextEdit.replace(h.range, newName)); + return { + changes: { [document.uri]: edits } + }; + } + async resolveModuleReference(ref, documentUri, documentContext) { + if (startsWith(documentUri, "file://")) { + const moduleName = getModuleNameFromPath(ref); + if (moduleName && moduleName !== "." && moduleName !== "..") { + const rootFolderUri = documentContext.resolveReference("/", documentUri); + const documentFolderUri = dirname(documentUri); + const modulePath = await this.resolvePathToModule(moduleName, documentFolderUri, rootFolderUri); + if (modulePath) { + const pathWithinModule = ref.substring(moduleName.length + 1); + return joinPath(modulePath, pathWithinModule); + } + } + } + return void 0; + } + async mapReference(target, isRawLink) { + return target; + } + async resolveReference(target, documentUri, documentContext, isRawLink = false, settings = this.defaultSettings) { + if (target[0] === "~" && target[1] !== "/" && this.fileSystemProvider) { + target = target.substring(1); + return this.mapReference(await this.resolveModuleReference(target, documentUri, documentContext), isRawLink); + } + const ref = await this.mapReference(documentContext.resolveReference(target, documentUri), isRawLink); + if (this.resolveModuleReferences) { + if (ref && await this.fileExists(ref)) { + return ref; + } + const moduleReference = await this.mapReference(await this.resolveModuleReference(target, documentUri, documentContext), isRawLink); + if (moduleReference) { + return moduleReference; + } + } + if (ref && !await this.fileExists(ref)) { + const rootFolderUri = documentContext.resolveReference("/", documentUri); + if (settings && rootFolderUri) { + if (target in settings) { + return this.mapReference(joinPath(rootFolderUri, settings[target]), isRawLink); + } + const firstSlash = target.indexOf("/"); + const prefix = `${target.substring(0, firstSlash)}/`; + if (prefix in settings) { + const aliasPath = settings[prefix].slice(0, -1); + let newPath = joinPath(rootFolderUri, aliasPath); + return this.mapReference(newPath = joinPath(newPath, target.substring(prefix.length - 1)), isRawLink); + } + } + } + return ref; + } + async resolvePathToModule(_moduleName, documentFolderUri, rootFolderUri) { + const packPath = joinPath(documentFolderUri, "node_modules", _moduleName, "package.json"); + if (await this.fileExists(packPath)) { + return dirname(packPath); + } else if (rootFolderUri && documentFolderUri.startsWith(rootFolderUri) && documentFolderUri.length !== rootFolderUri.length) { + return this.resolvePathToModule(_moduleName, dirname(documentFolderUri), rootFolderUri); + } + return void 0; + } + async fileExists(uri) { + if (!this.fileSystemProvider) { + return false; + } + try { + const stat = await this.fileSystemProvider.stat(uri); + if (stat.type === FileType.Unknown && stat.size === -1) { + return false; + } + return true; + } catch (err) { + return false; + } + } + async getContent(uri) { + if (!this.fileSystemProvider || !this.fileSystemProvider.getContent) { + return null; + } + try { + return await this.fileSystemProvider.getContent(uri); + } catch (err) { + return null; + } + } +}; +function getColorInformation(node, document) { + const color = getColorValue(node); + if (color) { + const range = getRange(node, document); + return { color, range }; + } + return null; +} +function getRange(node, document) { + return Range.create(document.positionAt(node.offset), document.positionAt(node.end)); +} +function containsRange(range, otherRange) { + const otherStartLine = otherRange.start.line, otherEndLine = otherRange.end.line; + const rangeStartLine = range.start.line, rangeEndLine = range.end.line; + if (otherStartLine < rangeStartLine || otherEndLine < rangeStartLine) { + return false; + } + if (otherStartLine > rangeEndLine || otherEndLine > rangeEndLine) { + return false; + } + if (otherStartLine === rangeStartLine && otherRange.start.character < range.start.character) { + return false; + } + if (otherEndLine === rangeEndLine && otherRange.end.character > range.end.character) { + return false; + } + return true; +} +function getHighlightKind(node) { + if (node.type === NodeType.Selector) { + return DocumentHighlightKind.Write; + } + if (node instanceof Identifier) { + if (node.parent && node.parent instanceof Property) { + if (node.isCustomProperty) { + return DocumentHighlightKind.Write; + } + } + } + if (node.parent) { + switch (node.parent.type) { + case NodeType.FunctionDeclaration: + case NodeType.MixinDeclaration: + case NodeType.Keyframe: + case NodeType.VariableDeclaration: + case NodeType.FunctionParameter: + return DocumentHighlightKind.Write; + } + } + return DocumentHighlightKind.Read; +} +function toTwoDigitHex(n) { + const r = n.toString(16); + return r.length !== 2 ? "0" + r : r; +} +function getModuleNameFromPath(path) { + const firstSlash = path.indexOf("/"); + if (firstSlash === -1) { + return ""; + } + if (path[0] === "@") { + const secondSlash = path.indexOf("/", firstSlash + 1); + if (secondSlash === -1) { + return path; + } + return path.substring(0, secondSlash); + } + return path.substring(0, firstSlash); +} + +// node_modules/vscode-css-languageservice/lib/esm/services/lintRules.js +var Warning = Level.Warning; +var Error2 = Level.Error; +var Ignore = Level.Ignore; +var Rule = class { + constructor(id, message, defaultValue) { + this.id = id; + this.message = message; + this.defaultValue = defaultValue; + } +}; +var Setting = class { + constructor(id, message, defaultValue) { + this.id = id; + this.message = message; + this.defaultValue = defaultValue; + } +}; +var Rules = { + AllVendorPrefixes: new Rule("compatibleVendorPrefixes", t("When using a vendor-specific prefix make sure to also include all other vendor-specific properties"), Ignore), + IncludeStandardPropertyWhenUsingVendorPrefix: new Rule("vendorPrefix", t("When using a vendor-specific prefix also include the standard property"), Warning), + DuplicateDeclarations: new Rule("duplicateProperties", t("Do not use duplicate style definitions"), Ignore), + EmptyRuleSet: new Rule("emptyRules", t("Do not use empty rulesets"), Warning), + ImportStatemement: new Rule("importStatement", t("Import statements do not load in parallel"), Ignore), + BewareOfBoxModelSize: new Rule("boxModel", t("Do not use width or height when using padding or border"), Ignore), + UniversalSelector: new Rule("universalSelector", t("The universal selector (*) is known to be slow"), Ignore), + ZeroWithUnit: new Rule("zeroUnits", t("No unit for zero needed"), Ignore), + RequiredPropertiesForFontFace: new Rule("fontFaceProperties", t("@font-face rule must define 'src' and 'font-family' properties"), Warning), + HexColorLength: new Rule("hexColorLength", t("Hex colors must consist of three, four, six or eight hex numbers"), Error2), + ArgsInColorFunction: new Rule("argumentsInColorFunction", t("Invalid number of parameters"), Error2), + UnknownProperty: new Rule("unknownProperties", t("Unknown property."), Warning), + UnknownAtRules: new Rule("unknownAtRules", t("Unknown at-rule."), Warning), + IEStarHack: new Rule("ieHack", t("IE hacks are only necessary when supporting IE7 and older"), Ignore), + UnknownVendorSpecificProperty: new Rule("unknownVendorSpecificProperties", t("Unknown vendor specific property."), Ignore), + PropertyIgnoredDueToDisplay: new Rule("propertyIgnoredDueToDisplay", t("Property is ignored due to the display."), Warning), + AvoidImportant: new Rule("important", t("Avoid using !important. It is an indication that the specificity of the entire CSS has gotten out of control and needs to be refactored."), Ignore), + AvoidFloat: new Rule("float", t("Avoid using 'float'. Floats lead to fragile CSS that is easy to break if one aspect of the layout changes."), Ignore), + AvoidIdSelector: new Rule("idSelector", t("Selectors should not contain IDs because these rules are too tightly coupled with the HTML."), Ignore) +}; +var Settings = { + ValidProperties: new Setting("validProperties", t("A list of properties that are not validated against the `unknownProperties` rule."), []) +}; +var LintConfigurationSettings = class { + constructor(conf = {}) { + this.conf = conf; + } + getRule(rule) { + if (this.conf.hasOwnProperty(rule.id)) { + const level = toLevel(this.conf[rule.id]); + if (level) { + return level; + } + } + return rule.defaultValue; + } + getSetting(setting) { + return this.conf[setting.id]; + } +}; +function toLevel(level) { + switch (level) { + case "ignore": + return Level.Ignore; + case "warning": + return Level.Warning; + case "error": + return Level.Error; + } + return null; +} + +// node_modules/vscode-css-languageservice/lib/esm/services/cssCodeActions.js +var CSSCodeActions = class { + constructor(cssDataManager) { + this.cssDataManager = cssDataManager; + } + doCodeActions(document, range, context, stylesheet) { + return this.doCodeActions2(document, range, context, stylesheet).map((ca) => { + const textDocumentEdit = ca.edit && ca.edit.documentChanges && ca.edit.documentChanges[0]; + return Command.create(ca.title, "_css.applyCodeAction", document.uri, document.version, textDocumentEdit && textDocumentEdit.edits); + }); + } + doCodeActions2(document, range, context, stylesheet) { + const result = []; + if (context.diagnostics) { + for (const diagnostic of context.diagnostics) { + this.appendFixesForMarker(document, stylesheet, diagnostic, result); + } + } + return result; + } + getFixesForUnknownProperty(document, property, marker, result) { + const propertyName = property.getName(); + const candidates = []; + this.cssDataManager.getProperties().forEach((p) => { + const score = difference(propertyName, p.name); + if (score >= propertyName.length / 2) { + candidates.push({ property: p.name, score }); + } + }); + candidates.sort((a2, b) => { + return b.score - a2.score || a2.property.localeCompare(b.property); + }); + let maxActions = 3; + for (const candidate of candidates) { + const propertyName2 = candidate.property; + const title = t("Rename to '{0}'", propertyName2); + const edit = TextEdit.replace(marker.range, propertyName2); + const documentIdentifier = VersionedTextDocumentIdentifier.create(document.uri, document.version); + const workspaceEdit = { documentChanges: [TextDocumentEdit.create(documentIdentifier, [edit])] }; + const codeAction = CodeAction.create(title, workspaceEdit, CodeActionKind.QuickFix); + codeAction.diagnostics = [marker]; + result.push(codeAction); + if (--maxActions <= 0) { + return; + } + } + } + appendFixesForMarker(document, stylesheet, marker, result) { + if (marker.code !== Rules.UnknownProperty.id) { + return; + } + const offset = document.offsetAt(marker.range.start); + const end = document.offsetAt(marker.range.end); + const nodepath = getNodePath(stylesheet, offset); + for (let i = nodepath.length - 1; i >= 0; i--) { + const node = nodepath[i]; + if (node instanceof Declaration) { + const property = node.getProperty(); + if (property && property.offset === offset && property.end === end) { + this.getFixesForUnknownProperty(document, property, marker, result); + return; + } + } + } + } +}; + +// node_modules/vscode-css-languageservice/lib/esm/services/lintUtil.js +var Element2 = class { + constructor(decl) { + this.fullPropertyName = decl.getFullPropertyName().toLowerCase(); + this.node = decl; + } +}; +function setSide(model, side, value, property) { + const state = model[side]; + state.value = value; + if (value) { + if (!includes(state.properties, property)) { + state.properties.push(property); + } + } +} +function setAllSides(model, value, property) { + setSide(model, "top", value, property); + setSide(model, "right", value, property); + setSide(model, "bottom", value, property); + setSide(model, "left", value, property); +} +function updateModelWithValue(model, side, value, property) { + if (side === "top" || side === "right" || side === "bottom" || side === "left") { + setSide(model, side, value, property); + } else { + setAllSides(model, value, property); + } +} +function updateModelWithList(model, values2, property) { + switch (values2.length) { + case 1: + updateModelWithValue(model, void 0, values2[0], property); + break; + case 2: + updateModelWithValue(model, "top", values2[0], property); + updateModelWithValue(model, "bottom", values2[0], property); + updateModelWithValue(model, "right", values2[1], property); + updateModelWithValue(model, "left", values2[1], property); + break; + case 3: + updateModelWithValue(model, "top", values2[0], property); + updateModelWithValue(model, "right", values2[1], property); + updateModelWithValue(model, "left", values2[1], property); + updateModelWithValue(model, "bottom", values2[2], property); + break; + case 4: + updateModelWithValue(model, "top", values2[0], property); + updateModelWithValue(model, "right", values2[1], property); + updateModelWithValue(model, "bottom", values2[2], property); + updateModelWithValue(model, "left", values2[3], property); + break; + } +} +function matches(value, candidates) { + for (let candidate of candidates) { + if (value.matches(candidate)) { + return true; + } + } + return false; +} +function checkLineWidth(value, allowsKeywords = true) { + if (allowsKeywords && matches(value, ["initial", "unset"])) { + return false; + } + return parseFloat(value.getText()) !== 0; +} +function checkLineWidthList(nodes, allowsKeywords = true) { + return nodes.map((node) => checkLineWidth(node, allowsKeywords)); +} +function checkLineStyle(valueNode, allowsKeywords = true) { + if (matches(valueNode, ["none", "hidden"])) { + return false; + } + if (allowsKeywords && matches(valueNode, ["initial", "unset"])) { + return false; + } + return true; +} +function checkLineStyleList(nodes, allowsKeywords = true) { + return nodes.map((node) => checkLineStyle(node, allowsKeywords)); +} +function checkBorderShorthand(node) { + const children = node.getChildren(); + if (children.length === 1) { + const value = children[0]; + return checkLineWidth(value) && checkLineStyle(value); + } + for (const child of children) { + const value = child; + if (!checkLineWidth( + value, + /* allowsKeywords: */ + false + ) || !checkLineStyle( + value, + /* allowsKeywords: */ + false + )) { + return false; + } + } + return true; +} +function calculateBoxModel(propertyTable) { + const model = { + top: { value: false, properties: [] }, + right: { value: false, properties: [] }, + bottom: { value: false, properties: [] }, + left: { value: false, properties: [] } + }; + for (const property of propertyTable) { + const value = property.node.value; + if (typeof value === "undefined") { + continue; + } + switch (property.fullPropertyName) { + case "box-sizing": + return { + top: { value: false, properties: [] }, + right: { value: false, properties: [] }, + bottom: { value: false, properties: [] }, + left: { value: false, properties: [] } + }; + case "width": + model.width = property; + break; + case "height": + model.height = property; + break; + default: + const segments = property.fullPropertyName.split("-"); + switch (segments[0]) { + case "border": + switch (segments[1]) { + case void 0: + case "top": + case "right": + case "bottom": + case "left": + switch (segments[2]) { + case void 0: + updateModelWithValue(model, segments[1], checkBorderShorthand(value), property); + break; + case "width": + updateModelWithValue(model, segments[1], checkLineWidth(value, false), property); + break; + case "style": + updateModelWithValue(model, segments[1], checkLineStyle(value, true), property); + break; + } + break; + case "width": + updateModelWithList(model, checkLineWidthList(value.getChildren(), false), property); + break; + case "style": + updateModelWithList(model, checkLineStyleList(value.getChildren(), true), property); + break; + } + break; + case "padding": + if (segments.length === 1) { + updateModelWithList(model, checkLineWidthList(value.getChildren(), true), property); + } else { + updateModelWithValue(model, segments[1], checkLineWidth(value, true), property); + } + break; + } + break; + } + } + return model; +} + +// node_modules/vscode-css-languageservice/lib/esm/services/lint.js +var NodesByRootMap = class { + constructor() { + this.data = {}; + } + add(root, name, node) { + let entry = this.data[root]; + if (!entry) { + entry = { nodes: [], names: [] }; + this.data[root] = entry; + } + entry.names.push(name); + if (node) { + entry.nodes.push(node); + } + } +}; +var LintVisitor = class _LintVisitor { + static entries(node, document, settings, cssDataManager, entryFilter) { + const visitor = new _LintVisitor(document, settings, cssDataManager); + node.acceptVisitor(visitor); + visitor.completeValidations(); + return visitor.getEntries(entryFilter); + } + constructor(document, settings, cssDataManager) { + this.cssDataManager = cssDataManager; + this.warnings = []; + this.settings = settings; + this.documentText = document.getText(); + this.keyframes = new NodesByRootMap(); + this.validProperties = {}; + const properties = settings.getSetting(Settings.ValidProperties); + if (Array.isArray(properties)) { + properties.forEach((p) => { + if (typeof p === "string") { + const name = p.trim().toLowerCase(); + if (name.length) { + this.validProperties[name] = true; + } + } + }); + } + } + isValidPropertyDeclaration(element) { + const propertyName = element.fullPropertyName; + return this.validProperties[propertyName]; + } + fetch(input, s) { + const elements = []; + for (const curr of input) { + if (curr.fullPropertyName === s) { + elements.push(curr); + } + } + return elements; + } + fetchWithValue(input, s, v) { + const elements = []; + for (const inputElement of input) { + if (inputElement.fullPropertyName === s) { + const expression = inputElement.node.getValue(); + if (expression && this.findValueInExpression(expression, v)) { + elements.push(inputElement); + } + } + } + return elements; + } + findValueInExpression(expression, v) { + let found = false; + expression.accept((node) => { + if (node.type === NodeType.Identifier && node.matches(v)) { + found = true; + } + return !found; + }); + return found; + } + getEntries(filter = Level.Warning | Level.Error) { + return this.warnings.filter((entry) => { + return (entry.getLevel() & filter) !== 0; + }); + } + addEntry(node, rule, details) { + const entry = new Marker(node, rule, this.settings.getRule(rule), details); + this.warnings.push(entry); + } + getMissingNames(expected, actual) { + const expectedClone = expected.slice(0); + for (let i = 0; i < actual.length; i++) { + const k = expectedClone.indexOf(actual[i]); + if (k !== -1) { + expectedClone[k] = null; + } + } + let result = null; + for (let i = 0; i < expectedClone.length; i++) { + const curr = expectedClone[i]; + if (curr) { + if (result === null) { + result = t("'{0}'", curr); + } else { + result = t("{0}, '{1}'", result, curr); + } + } + } + return result; + } + visitNode(node) { + switch (node.type) { + case NodeType.UnknownAtRule: + return this.visitUnknownAtRule(node); + case NodeType.Keyframe: + return this.visitKeyframe(node); + case NodeType.FontFace: + return this.visitFontFace(node); + case NodeType.Ruleset: + return this.visitRuleSet(node); + case NodeType.SimpleSelector: + return this.visitSimpleSelector(node); + case NodeType.Function: + return this.visitFunction(node); + case NodeType.NumericValue: + return this.visitNumericValue(node); + case NodeType.Import: + return this.visitImport(node); + case NodeType.HexColorValue: + return this.visitHexColorValue(node); + case NodeType.Prio: + return this.visitPrio(node); + case NodeType.IdentifierSelector: + return this.visitIdentifierSelector(node); + } + return true; + } + completeValidations() { + this.validateKeyframes(); + } + visitUnknownAtRule(node) { + const atRuleName = node.getChild(0); + if (!atRuleName) { + return false; + } + const atDirective = this.cssDataManager.getAtDirective(atRuleName.getText()); + if (atDirective) { + return false; + } + this.addEntry(atRuleName, Rules.UnknownAtRules, `Unknown at rule ${atRuleName.getText()}`); + return true; + } + visitKeyframe(node) { + const keyword = node.getKeyword(); + if (!keyword) { + return false; + } + const text = keyword.getText(); + this.keyframes.add(node.getName(), text, text !== "@keyframes" ? keyword : null); + return true; + } + validateKeyframes() { + const expected = ["@-webkit-keyframes", "@-moz-keyframes", "@-o-keyframes"]; + for (const name in this.keyframes.data) { + const actual = this.keyframes.data[name].names; + const needsStandard = actual.indexOf("@keyframes") === -1; + if (!needsStandard && actual.length === 1) { + continue; + } + const missingVendorSpecific = this.getMissingNames(expected, actual); + if (missingVendorSpecific || needsStandard) { + for (const node of this.keyframes.data[name].nodes) { + if (needsStandard) { + const message = t("Always define standard rule '@keyframes' when defining keyframes."); + this.addEntry(node, Rules.IncludeStandardPropertyWhenUsingVendorPrefix, message); + } + if (missingVendorSpecific) { + const message = t("Always include all vendor specific rules: Missing: {0}", missingVendorSpecific); + this.addEntry(node, Rules.AllVendorPrefixes, message); + } + } + } + } + return true; + } + visitSimpleSelector(node) { + const firstChar = this.documentText.charAt(node.offset); + if (node.length === 1 && firstChar === "*") { + this.addEntry(node, Rules.UniversalSelector); + } + return true; + } + visitIdentifierSelector(node) { + this.addEntry(node, Rules.AvoidIdSelector); + return true; + } + visitImport(node) { + this.addEntry(node, Rules.ImportStatemement); + return true; + } + visitRuleSet(node) { + const declarations = node.getDeclarations(); + if (!declarations) { + return false; + } + if (!declarations.hasChildren()) { + this.addEntry(node.getSelectors(), Rules.EmptyRuleSet); + } + const propertyTable = []; + for (const element of declarations.getChildren()) { + if (element instanceof Declaration) { + propertyTable.push(new Element2(element)); + } + } + const boxModel = calculateBoxModel(propertyTable); + if (boxModel.width) { + let properties = []; + if (boxModel.right.value) { + properties = union(properties, boxModel.right.properties); + } + if (boxModel.left.value) { + properties = union(properties, boxModel.left.properties); + } + if (properties.length !== 0) { + for (const item of properties) { + this.addEntry(item.node, Rules.BewareOfBoxModelSize); + } + this.addEntry(boxModel.width.node, Rules.BewareOfBoxModelSize); + } + } + if (boxModel.height) { + let properties = []; + if (boxModel.top.value) { + properties = union(properties, boxModel.top.properties); + } + if (boxModel.bottom.value) { + properties = union(properties, boxModel.bottom.properties); + } + if (properties.length !== 0) { + for (const item of properties) { + this.addEntry(item.node, Rules.BewareOfBoxModelSize); + } + this.addEntry(boxModel.height.node, Rules.BewareOfBoxModelSize); + } + } + let displayElems = this.fetchWithValue(propertyTable, "display", "inline-block"); + if (displayElems.length > 0) { + const elem = this.fetch(propertyTable, "float"); + for (let index = 0; index < elem.length; index++) { + const node2 = elem[index].node; + const value = node2.getValue(); + if (value && !value.matches("none")) { + this.addEntry(node2, Rules.PropertyIgnoredDueToDisplay, t("inline-block is ignored due to the float. If 'float' has a value other than 'none', the box is floated and 'display' is treated as 'block'")); + } + } + } + displayElems = this.fetchWithValue(propertyTable, "display", "block"); + if (displayElems.length > 0) { + const elem = this.fetch(propertyTable, "vertical-align"); + for (let index = 0; index < elem.length; index++) { + this.addEntry(elem[index].node, Rules.PropertyIgnoredDueToDisplay, t("Property is ignored due to the display. With 'display: block', vertical-align should not be used.")); + } + } + const elements = this.fetch(propertyTable, "float"); + for (let index = 0; index < elements.length; index++) { + const element = elements[index]; + if (!this.isValidPropertyDeclaration(element)) { + this.addEntry(element.node, Rules.AvoidFloat); + } + } + for (let i = 0; i < propertyTable.length; i++) { + const element = propertyTable[i]; + if (element.fullPropertyName !== "background" && !this.validProperties[element.fullPropertyName]) { + const value = element.node.getValue(); + if (value && this.documentText.charAt(value.offset) !== "-") { + const elements2 = this.fetch(propertyTable, element.fullPropertyName); + if (elements2.length > 1) { + for (let k = 0; k < elements2.length; k++) { + const value2 = elements2[k].node.getValue(); + if (value2 && this.documentText.charAt(value2.offset) !== "-" && elements2[k] !== element) { + this.addEntry(element.node, Rules.DuplicateDeclarations); + } + } + } + } + } + } + const isExportBlock = node.getSelectors().matches(":export"); + if (!isExportBlock) { + const propertiesBySuffix = new NodesByRootMap(); + let containsUnknowns = false; + for (const element of propertyTable) { + const decl = element.node; + if (this.isCSSDeclaration(decl)) { + let name = element.fullPropertyName; + const firstChar = name.charAt(0); + if (firstChar === "-") { + if (name.charAt(1) !== "-") { + if (!this.cssDataManager.isKnownProperty(name) && !this.validProperties[name]) { + this.addEntry(decl.getProperty(), Rules.UnknownVendorSpecificProperty); + } + const nonPrefixedName = decl.getNonPrefixedPropertyName(); + propertiesBySuffix.add(nonPrefixedName, name, decl.getProperty()); + } + } else { + const fullName = name; + if (firstChar === "*" || firstChar === "_") { + this.addEntry(decl.getProperty(), Rules.IEStarHack); + name = name.substr(1); + } + if (!this.cssDataManager.isKnownProperty(fullName) && !this.cssDataManager.isKnownProperty(name)) { + if (!this.validProperties[name]) { + this.addEntry(decl.getProperty(), Rules.UnknownProperty, t("Unknown property: '{0}'", decl.getFullPropertyName())); + } + } + propertiesBySuffix.add(name, name, null); + } + } else { + containsUnknowns = true; + } + } + if (!containsUnknowns) { + for (const suffix in propertiesBySuffix.data) { + const entry = propertiesBySuffix.data[suffix]; + const actual = entry.names; + const needsStandard = this.cssDataManager.isStandardProperty(suffix) && actual.indexOf(suffix) === -1; + if (!needsStandard && actual.length === 1) { + continue; + } + const entriesThatNeedStandard = new Set(needsStandard ? entry.nodes : []); + if (needsStandard) { + const pseudoElements = this.getContextualVendorSpecificPseudoElements(node); + for (const node2 of entry.nodes) { + const propertyName = node2.getName(); + const prefix = propertyName.substring(0, propertyName.length - suffix.length); + if (pseudoElements.some((x) => x.startsWith(prefix))) { + entriesThatNeedStandard.delete(node2); + } + } + } + const expected = []; + for (let i = 0, len = _LintVisitor.prefixes.length; i < len; i++) { + const prefix = _LintVisitor.prefixes[i]; + if (this.cssDataManager.isStandardProperty(prefix + suffix)) { + expected.push(prefix + suffix); + } + } + const missingVendorSpecific = this.getMissingNames(expected, actual); + if (missingVendorSpecific || needsStandard) { + for (const node2 of entry.nodes) { + if (needsStandard && entriesThatNeedStandard.has(node2)) { + const message = t("Also define the standard property '{0}' for compatibility", suffix); + this.addEntry(node2, Rules.IncludeStandardPropertyWhenUsingVendorPrefix, message); + } + if (missingVendorSpecific) { + const message = t("Always include all vendor specific properties: Missing: {0}", missingVendorSpecific); + this.addEntry(node2, Rules.AllVendorPrefixes, message); + } + } + } + } + } + } + return true; + } + /** + * Walks up the syntax tree (starting from given `node`) and captures vendor + * specific pseudo-element selectors. + * @returns An array of vendor specific pseudo-elements; or empty if none + * was found. + */ + getContextualVendorSpecificPseudoElements(node) { + function walkDown(s, n) { + for (const child of n.getChildren()) { + if (child.type === NodeType.PseudoSelector) { + const pseudoElement = child.getChildren()[0]?.getText(); + if (pseudoElement) { + s.add(pseudoElement); + } + } + walkDown(s, child); + } + } + function walkUp(s, n) { + if (n.type === NodeType.Ruleset) { + for (const selector of n.getSelectors().getChildren()) { + walkDown(s, selector); + } + } + return n.parent ? walkUp(s, n.parent) : void 0; + } + const result = /* @__PURE__ */ new Set(); + walkUp(result, node); + return Array.from(result); + } + visitPrio(node) { + this.addEntry(node, Rules.AvoidImportant); + return true; + } + visitNumericValue(node) { + const funcDecl = node.findParent(NodeType.Function); + if (funcDecl && funcDecl.getName() === "calc") { + return true; + } + const decl = node.findParent(NodeType.Declaration); + if (decl) { + const declValue = decl.getValue(); + if (declValue) { + const value = node.getValue(); + if (!value.unit || units.length.indexOf(value.unit.toLowerCase()) === -1) { + return true; + } + if (parseFloat(value.value) === 0 && !!value.unit && !this.validProperties[decl.getFullPropertyName()]) { + this.addEntry(node, Rules.ZeroWithUnit); + } + } + } + return true; + } + visitFontFace(node) { + const declarations = node.getDeclarations(); + if (!declarations) { + return false; + } + let definesSrc = false, definesFontFamily = false; + let containsUnknowns = false; + for (const node2 of declarations.getChildren()) { + if (this.isCSSDeclaration(node2)) { + const name = node2.getProperty().getName().toLowerCase(); + if (name === "src") { + definesSrc = true; + } + if (name === "font-family") { + definesFontFamily = true; + } + } else { + containsUnknowns = true; + } + } + if (!containsUnknowns && (!definesSrc || !definesFontFamily)) { + this.addEntry(node, Rules.RequiredPropertiesForFontFace); + } + return true; + } + isCSSDeclaration(node) { + if (node instanceof Declaration) { + if (!node.getValue()) { + return false; + } + const property = node.getProperty(); + if (!property) { + return false; + } + const identifier = property.getIdentifier(); + if (!identifier || identifier.containsInterpolation()) { + return false; + } + return true; + } + return false; + } + visitHexColorValue(node) { + const length = node.length; + if (length !== 9 && length !== 7 && length !== 5 && length !== 4) { + this.addEntry(node, Rules.HexColorLength); + } + return false; + } + visitFunction(node) { + const fnName = node.getName().toLowerCase(); + let expectedAttrCount = -1; + let actualAttrCount = 0; + switch (fnName) { + case "rgb(": + case "hsl(": + expectedAttrCount = 3; + break; + case "rgba(": + case "hsla(": + expectedAttrCount = 4; + break; + } + if (expectedAttrCount !== -1) { + node.getArguments().accept((n) => { + if (n instanceof BinaryExpression) { + actualAttrCount += 1; + return false; + } + return true; + }); + if (actualAttrCount !== expectedAttrCount) { + this.addEntry(node, Rules.ArgsInColorFunction); + } + } + return true; + } +}; +LintVisitor.prefixes = [ + "-ms-", + "-moz-", + "-o-", + "-webkit-" + // Quite common + // '-xv-', '-atsc-', '-wap-', '-khtml-', 'mso-', 'prince-', '-ah-', '-hp-', '-ro-', '-rim-', '-tc-' // Quite un-common +]; + +// node_modules/vscode-css-languageservice/lib/esm/services/cssValidation.js +var CSSValidation = class { + constructor(cssDataManager) { + this.cssDataManager = cssDataManager; + } + configure(settings) { + this.settings = settings; + } + doValidation(document, stylesheet, settings = this.settings) { + if (settings && settings.validate === false) { + return []; + } + const entries = []; + entries.push.apply(entries, ParseErrorCollector.entries(stylesheet)); + entries.push.apply(entries, LintVisitor.entries(stylesheet, document, new LintConfigurationSettings(settings && settings.lint), this.cssDataManager)); + const ruleIds = []; + for (const r in Rules) { + ruleIds.push(Rules[r].id); + } + function toDiagnostic(marker) { + const range = Range.create(document.positionAt(marker.getOffset()), document.positionAt(marker.getOffset() + marker.getLength())); + const source = document.languageId; + return { + code: marker.getRule().id, + source, + message: marker.getMessage(), + severity: marker.getLevel() === Level.Warning ? DiagnosticSeverity.Warning : DiagnosticSeverity.Error, + range + }; + } + return entries.filter((entry) => entry.getLevel() !== Level.Ignore).map(toDiagnostic); + } +}; + +// node_modules/vscode-css-languageservice/lib/esm/parser/scssScanner.js +var _FSL2 = "/".charCodeAt(0); +var _NWL2 = "\n".charCodeAt(0); +var _CAR2 = "\r".charCodeAt(0); +var _LFD2 = "\f".charCodeAt(0); +var _DLR2 = "$".charCodeAt(0); +var _HSH2 = "#".charCodeAt(0); +var _CUL2 = "{".charCodeAt(0); +var _EQS2 = "=".charCodeAt(0); +var _BNG2 = "!".charCodeAt(0); +var _LAN2 = "<".charCodeAt(0); +var _RAN2 = ">".charCodeAt(0); +var _DOT2 = ".".charCodeAt(0); +var _ATS2 = "@".charCodeAt(0); +var customTokenValue = TokenType.CustomToken; +var VariableName = customTokenValue++; +var InterpolationFunction = customTokenValue++; +var Default = customTokenValue++; +var EqualsOperator = customTokenValue++; +var NotEqualsOperator = customTokenValue++; +var GreaterEqualsOperator = customTokenValue++; +var SmallerEqualsOperator = customTokenValue++; +var Ellipsis = customTokenValue++; +var Module2 = customTokenValue++; +var SCSSScanner = class extends Scanner { + scanNext(offset) { + if (this.stream.advanceIfChar(_DLR2)) { + const content = ["$"]; + if (this.ident(content)) { + return this.finishToken(offset, VariableName, content.join("")); + } else { + this.stream.goBackTo(offset); + } + } + if (this.stream.advanceIfChars([_HSH2, _CUL2])) { + return this.finishToken(offset, InterpolationFunction); + } + if (this.stream.advanceIfChars([_EQS2, _EQS2])) { + return this.finishToken(offset, EqualsOperator); + } + if (this.stream.advanceIfChars([_BNG2, _EQS2])) { + return this.finishToken(offset, NotEqualsOperator); + } + if (this.stream.advanceIfChar(_LAN2)) { + if (this.stream.advanceIfChar(_EQS2)) { + return this.finishToken(offset, SmallerEqualsOperator); + } + return this.finishToken(offset, TokenType.Delim); + } + if (this.stream.advanceIfChar(_RAN2)) { + if (this.stream.advanceIfChar(_EQS2)) { + return this.finishToken(offset, GreaterEqualsOperator); + } + return this.finishToken(offset, TokenType.Delim); + } + if (this.stream.advanceIfChars([_DOT2, _DOT2, _DOT2])) { + return this.finishToken(offset, Ellipsis); + } + return super.scanNext(offset); + } + comment() { + if (super.comment()) { + return true; + } + if (!this.inURL && this.stream.advanceIfChars([_FSL2, _FSL2])) { + this.stream.advanceWhileChar((ch) => { + switch (ch) { + case _NWL2: + case _CAR2: + case _LFD2: + return false; + default: + return true; + } + }); + return true; + } else { + return false; + } + } +}; + +// node_modules/vscode-css-languageservice/lib/esm/parser/scssErrors.js +var SCSSIssueType = class { + constructor(id, message) { + this.id = id; + this.message = message; + } +}; +var SCSSParseError = { + FromExpected: new SCSSIssueType("scss-fromexpected", t("'from' expected")), + ThroughOrToExpected: new SCSSIssueType("scss-throughexpected", t("'through' or 'to' expected")), + InExpected: new SCSSIssueType("scss-fromexpected", t("'in' expected")) +}; + +// node_modules/vscode-css-languageservice/lib/esm/parser/scssParser.js +var SCSSParser = class extends Parser { + constructor() { + super(new SCSSScanner()); + } + _parseStylesheetStatement(isNested = false) { + if (this.peek(TokenType.AtKeyword)) { + return this._parseWarnAndDebug() || this._parseControlStatement() || this._parseMixinDeclaration() || this._parseMixinContent() || this._parseMixinReference() || this._parseFunctionDeclaration() || this._parseForward() || this._parseUse() || this._parseRuleset(isNested) || super._parseStylesheetAtStatement(isNested); + } + return this._parseRuleset(true) || this._parseVariableDeclaration(); + } + _parseImport() { + if (!this.peekKeyword("@import")) { + return null; + } + const node = this.create(Import); + this.consumeToken(); + if (!node.addChild(this._parseURILiteral()) && !node.addChild(this._parseStringLiteral())) { + return this.finish(node, ParseError.URIOrStringExpected); + } + while (this.accept(TokenType.Comma)) { + if (!node.addChild(this._parseURILiteral()) && !node.addChild(this._parseStringLiteral())) { + return this.finish(node, ParseError.URIOrStringExpected); + } + } + return this._completeParseImport(node); + } + // scss variables: $font-size: 12px; + _parseVariableDeclaration(panic = []) { + if (!this.peek(VariableName)) { + return null; + } + const node = this.create(VariableDeclaration); + if (!node.setVariable(this._parseVariable())) { + return null; + } + if (!this.accept(TokenType.Colon)) { + return this.finish(node, ParseError.ColonExpected); + } + if (this.prevToken) { + node.colonPosition = this.prevToken.offset; + } + if (!node.setValue(this._parseExpr())) { + return this.finish(node, ParseError.VariableValueExpected, [], panic); + } + while (this.peek(TokenType.Exclamation)) { + if (node.addChild(this._tryParsePrio())) { + } else { + this.consumeToken(); + if (!this.peekRegExp(TokenType.Ident, /^(default|global)$/)) { + return this.finish(node, ParseError.UnknownKeyword); + } + this.consumeToken(); + } + } + if (this.peek(TokenType.SemiColon)) { + node.semicolonPosition = this.token.offset; + } + return this.finish(node); + } + _parseMediaCondition() { + return this._parseInterpolation() || super._parseMediaCondition(); + } + _parseMediaFeatureRangeOperator() { + return this.accept(SmallerEqualsOperator) || this.accept(GreaterEqualsOperator) || super._parseMediaFeatureRangeOperator(); + } + _parseMediaFeatureName() { + return this._parseModuleMember() || this._parseFunction() || this._parseIdent() || this._parseVariable(); + } + _parseKeyframeSelector() { + return this._tryParseKeyframeSelector() || this._parseControlStatement(this._parseKeyframeSelector.bind(this)) || this._parseWarnAndDebug() || this._parseMixinReference() || this._parseFunctionDeclaration() || this._parseVariableDeclaration() || this._parseMixinContent(); + } + _parseVariable() { + if (!this.peek(VariableName)) { + return null; + } + const node = this.create(Variable); + this.consumeToken(); + return node; + } + _parseModuleMember() { + const pos = this.mark(); + const node = this.create(Module); + if (!node.setIdentifier(this._parseIdent([ReferenceType.Module]))) { + return null; + } + if (this.hasWhitespace() || !this.acceptDelim(".") || this.hasWhitespace()) { + this.restoreAtMark(pos); + return null; + } + if (!node.addChild(this._parseVariable() || this._parseFunction())) { + return this.finish(node, ParseError.IdentifierOrVariableExpected); + } + return node; + } + _parseIdent(referenceTypes) { + if (!this.peek(TokenType.Ident) && !this.peek(InterpolationFunction) && !this.peekDelim("-")) { + return null; + } + const node = this.create(Identifier); + node.referenceTypes = referenceTypes; + node.isCustomProperty = this.peekRegExp(TokenType.Ident, /^--/); + let hasContent = false; + const indentInterpolation = () => { + const pos = this.mark(); + if (this.acceptDelim("-")) { + if (!this.hasWhitespace()) { + this.acceptDelim("-"); + } + if (this.hasWhitespace()) { + this.restoreAtMark(pos); + return null; + } + } + return this._parseInterpolation(); + }; + while (this.accept(TokenType.Ident) || node.addChild(indentInterpolation()) || hasContent && this.acceptRegexp(/^[\w-]/)) { + hasContent = true; + if (this.hasWhitespace()) { + break; + } + } + return hasContent ? this.finish(node) : null; + } + _parseTermExpression() { + return this._parseModuleMember() || this._parseVariable() || this._parseNestingSelector() || //this._tryParsePrio() || + super._parseTermExpression(); + } + _parseInterpolation() { + if (this.peek(InterpolationFunction)) { + const node = this.create(Interpolation); + this.consumeToken(); + if (!node.addChild(this._parseExpr()) && !this._parseNestingSelector()) { + if (this.accept(TokenType.CurlyR)) { + return this.finish(node); + } + return this.finish(node, ParseError.ExpressionExpected); + } + if (!this.accept(TokenType.CurlyR)) { + return this.finish(node, ParseError.RightCurlyExpected); + } + return this.finish(node); + } + return null; + } + _parseOperator() { + if (this.peek(EqualsOperator) || this.peek(NotEqualsOperator) || this.peek(GreaterEqualsOperator) || this.peek(SmallerEqualsOperator) || this.peekDelim(">") || this.peekDelim("<") || this.peekIdent("and") || this.peekIdent("or") || this.peekDelim("%")) { + const node = this.createNode(NodeType.Operator); + this.consumeToken(); + return this.finish(node); + } + return super._parseOperator(); + } + _parseUnaryOperator() { + if (this.peekIdent("not")) { + const node = this.create(Node); + this.consumeToken(); + return this.finish(node); + } + return super._parseUnaryOperator(); + } + _parseRuleSetDeclaration() { + if (this.peek(TokenType.AtKeyword)) { + return this._parseKeyframe() || this._parseImport() || this._parseMedia(true) || this._parseFontFace() || this._parseWarnAndDebug() || this._parseControlStatement() || this._parseFunctionDeclaration() || this._parseExtends() || this._parseMixinReference() || this._parseMixinContent() || this._parseMixinDeclaration() || this._parseRuleset(true) || this._parseSupports(true) || this._parseLayer() || this._parsePropertyAtRule() || this._parseContainer(true) || this._parseRuleSetDeclarationAtStatement(); + } + return this._parseVariableDeclaration() || this._tryParseRuleset(true) || this._parseDeclaration(); + } + _parseDeclaration(stopTokens) { + const custonProperty = this._tryParseCustomPropertyDeclaration(stopTokens); + if (custonProperty) { + return custonProperty; + } + const node = this.create(Declaration); + if (!node.setProperty(this._parseProperty())) { + return null; + } + if (!this.accept(TokenType.Colon)) { + return this.finish(node, ParseError.ColonExpected, [TokenType.Colon], stopTokens || [TokenType.SemiColon]); + } + if (this.prevToken) { + node.colonPosition = this.prevToken.offset; + } + let hasContent = false; + if (node.setValue(this._parseExpr())) { + hasContent = true; + node.addChild(this._parsePrio()); + } + if (this.peek(TokenType.CurlyL)) { + node.setNestedProperties(this._parseNestedProperties()); + } else { + if (!hasContent) { + return this.finish(node, ParseError.PropertyValueExpected); + } + } + if (this.peek(TokenType.SemiColon)) { + node.semicolonPosition = this.token.offset; + } + return this.finish(node); + } + _parseNestedProperties() { + const node = this.create(NestedProperties); + return this._parseBody(node, this._parseDeclaration.bind(this)); + } + _parseExtends() { + if (this.peekKeyword("@extend")) { + const node = this.create(ExtendsReference); + this.consumeToken(); + if (!node.getSelectors().addChild(this._parseSimpleSelector())) { + return this.finish(node, ParseError.SelectorExpected); + } + while (this.accept(TokenType.Comma)) { + node.getSelectors().addChild(this._parseSimpleSelector()); + } + if (this.accept(TokenType.Exclamation)) { + if (!this.acceptIdent("optional")) { + return this.finish(node, ParseError.UnknownKeyword); + } + } + return this.finish(node); + } + return null; + } + _parseSimpleSelectorBody() { + return this._parseSelectorPlaceholder() || super._parseSimpleSelectorBody(); + } + _parseNestingSelector() { + if (this.peekDelim("&")) { + const node = this.createNode(NodeType.SelectorCombinator); + this.consumeToken(); + while (!this.hasWhitespace() && (this.acceptDelim("-") || this.accept(TokenType.Num) || this.accept(TokenType.Dimension) || node.addChild(this._parseIdent()) || this.acceptDelim("&"))) { + } + return this.finish(node); + } + return null; + } + _parseSelectorPlaceholder() { + if (this.peekDelim("%")) { + const node = this.createNode(NodeType.SelectorPlaceholder); + this.consumeToken(); + this._parseIdent(); + return this.finish(node); + } else if (this.peekKeyword("@at-root")) { + const node = this.createNode(NodeType.SelectorPlaceholder); + this.consumeToken(); + if (this.accept(TokenType.ParenthesisL)) { + if (!this.acceptIdent("with") && !this.acceptIdent("without")) { + return this.finish(node, ParseError.IdentifierExpected); + } + if (!this.accept(TokenType.Colon)) { + return this.finish(node, ParseError.ColonExpected); + } + if (!node.addChild(this._parseIdent())) { + return this.finish(node, ParseError.IdentifierExpected); + } + if (!this.accept(TokenType.ParenthesisR)) { + return this.finish(node, ParseError.RightParenthesisExpected, [TokenType.CurlyR]); + } + } + return this.finish(node); + } + return null; + } + _parseElementName() { + const pos = this.mark(); + const node = super._parseElementName(); + if (node && !this.hasWhitespace() && this.peek(TokenType.ParenthesisL)) { + this.restoreAtMark(pos); + return null; + } + return node; + } + _tryParsePseudoIdentifier() { + return this._parseInterpolation() || super._tryParsePseudoIdentifier(); + } + _parseWarnAndDebug() { + if (!this.peekKeyword("@debug") && !this.peekKeyword("@warn") && !this.peekKeyword("@error")) { + return null; + } + const node = this.createNode(NodeType.Debug); + this.consumeToken(); + node.addChild(this._parseExpr()); + return this.finish(node); + } + _parseControlStatement(parseStatement = this._parseRuleSetDeclaration.bind(this)) { + if (!this.peek(TokenType.AtKeyword)) { + return null; + } + return this._parseIfStatement(parseStatement) || this._parseForStatement(parseStatement) || this._parseEachStatement(parseStatement) || this._parseWhileStatement(parseStatement); + } + _parseIfStatement(parseStatement) { + if (!this.peekKeyword("@if")) { + return null; + } + return this._internalParseIfStatement(parseStatement); + } + _internalParseIfStatement(parseStatement) { + const node = this.create(IfStatement); + this.consumeToken(); + if (!node.setExpression(this._parseExpr(true))) { + return this.finish(node, ParseError.ExpressionExpected); + } + this._parseBody(node, parseStatement); + if (this.acceptKeyword("@else")) { + if (this.peekIdent("if")) { + node.setElseClause(this._internalParseIfStatement(parseStatement)); + } else if (this.peek(TokenType.CurlyL)) { + const elseNode = this.create(ElseStatement); + this._parseBody(elseNode, parseStatement); + node.setElseClause(elseNode); + } + } + return this.finish(node); + } + _parseForStatement(parseStatement) { + if (!this.peekKeyword("@for")) { + return null; + } + const node = this.create(ForStatement); + this.consumeToken(); + if (!node.setVariable(this._parseVariable())) { + return this.finish(node, ParseError.VariableNameExpected, [TokenType.CurlyR]); + } + if (!this.acceptIdent("from")) { + return this.finish(node, SCSSParseError.FromExpected, [TokenType.CurlyR]); + } + if (!node.addChild(this._parseBinaryExpr())) { + return this.finish(node, ParseError.ExpressionExpected, [TokenType.CurlyR]); + } + if (!this.acceptIdent("to") && !this.acceptIdent("through")) { + return this.finish(node, SCSSParseError.ThroughOrToExpected, [TokenType.CurlyR]); + } + if (!node.addChild(this._parseBinaryExpr())) { + return this.finish(node, ParseError.ExpressionExpected, [TokenType.CurlyR]); + } + return this._parseBody(node, parseStatement); + } + _parseEachStatement(parseStatement) { + if (!this.peekKeyword("@each")) { + return null; + } + const node = this.create(EachStatement); + this.consumeToken(); + const variables = node.getVariables(); + if (!variables.addChild(this._parseVariable())) { + return this.finish(node, ParseError.VariableNameExpected, [TokenType.CurlyR]); + } + while (this.accept(TokenType.Comma)) { + if (!variables.addChild(this._parseVariable())) { + return this.finish(node, ParseError.VariableNameExpected, [TokenType.CurlyR]); + } + } + this.finish(variables); + if (!this.acceptIdent("in")) { + return this.finish(node, SCSSParseError.InExpected, [TokenType.CurlyR]); + } + if (!node.addChild(this._parseExpr())) { + return this.finish(node, ParseError.ExpressionExpected, [TokenType.CurlyR]); + } + return this._parseBody(node, parseStatement); + } + _parseWhileStatement(parseStatement) { + if (!this.peekKeyword("@while")) { + return null; + } + const node = this.create(WhileStatement); + this.consumeToken(); + if (!node.addChild(this._parseBinaryExpr())) { + return this.finish(node, ParseError.ExpressionExpected, [TokenType.CurlyR]); + } + return this._parseBody(node, parseStatement); + } + _parseFunctionBodyDeclaration() { + return this._parseVariableDeclaration() || this._parseReturnStatement() || this._parseWarnAndDebug() || this._parseControlStatement(this._parseFunctionBodyDeclaration.bind(this)); + } + _parseFunctionDeclaration() { + if (!this.peekKeyword("@function")) { + return null; + } + const node = this.create(FunctionDeclaration); + this.consumeToken(); + if (!node.setIdentifier(this._parseIdent([ReferenceType.Function]))) { + return this.finish(node, ParseError.IdentifierExpected, [TokenType.CurlyR]); + } + if (!this.accept(TokenType.ParenthesisL)) { + return this.finish(node, ParseError.LeftParenthesisExpected, [TokenType.CurlyR]); + } + if (node.getParameters().addChild(this._parseParameterDeclaration())) { + while (this.accept(TokenType.Comma)) { + if (this.peek(TokenType.ParenthesisR)) { + break; + } + if (!node.getParameters().addChild(this._parseParameterDeclaration())) { + return this.finish(node, ParseError.VariableNameExpected); + } + } + } + if (!this.accept(TokenType.ParenthesisR)) { + return this.finish(node, ParseError.RightParenthesisExpected, [TokenType.CurlyR]); + } + return this._parseBody(node, this._parseFunctionBodyDeclaration.bind(this)); + } + _parseReturnStatement() { + if (!this.peekKeyword("@return")) { + return null; + } + const node = this.createNode(NodeType.ReturnStatement); + this.consumeToken(); + if (!node.addChild(this._parseExpr())) { + return this.finish(node, ParseError.ExpressionExpected); + } + return this.finish(node); + } + _parseMixinDeclaration() { + if (!this.peekKeyword("@mixin")) { + return null; + } + const node = this.create(MixinDeclaration); + this.consumeToken(); + if (!node.setIdentifier(this._parseIdent([ReferenceType.Mixin]))) { + return this.finish(node, ParseError.IdentifierExpected, [TokenType.CurlyR]); + } + if (this.accept(TokenType.ParenthesisL)) { + if (node.getParameters().addChild(this._parseParameterDeclaration())) { + while (this.accept(TokenType.Comma)) { + if (this.peek(TokenType.ParenthesisR)) { + break; + } + if (!node.getParameters().addChild(this._parseParameterDeclaration())) { + return this.finish(node, ParseError.VariableNameExpected); + } + } + } + if (!this.accept(TokenType.ParenthesisR)) { + return this.finish(node, ParseError.RightParenthesisExpected, [TokenType.CurlyR]); + } + } + return this._parseBody(node, this._parseRuleSetDeclaration.bind(this)); + } + _parseParameterDeclaration() { + const node = this.create(FunctionParameter); + if (!node.setIdentifier(this._parseVariable())) { + return null; + } + if (this.accept(Ellipsis)) { + } + if (this.accept(TokenType.Colon)) { + if (!node.setDefaultValue(this._parseExpr(true))) { + return this.finish(node, ParseError.VariableValueExpected, [], [TokenType.Comma, TokenType.ParenthesisR]); + } + } + return this.finish(node); + } + _parseMixinContent() { + if (!this.peekKeyword("@content")) { + return null; + } + const node = this.create(MixinContentReference); + this.consumeToken(); + if (this.accept(TokenType.ParenthesisL)) { + if (node.getArguments().addChild(this._parseFunctionArgument())) { + while (this.accept(TokenType.Comma)) { + if (this.peek(TokenType.ParenthesisR)) { + break; + } + if (!node.getArguments().addChild(this._parseFunctionArgument())) { + return this.finish(node, ParseError.ExpressionExpected); + } + } + } + if (!this.accept(TokenType.ParenthesisR)) { + return this.finish(node, ParseError.RightParenthesisExpected); + } + } + return this.finish(node); + } + _parseMixinReference() { + if (!this.peekKeyword("@include")) { + return null; + } + const node = this.create(MixinReference); + this.consumeToken(); + const firstIdent = this._parseIdent([ReferenceType.Mixin]); + if (!node.setIdentifier(firstIdent)) { + return this.finish(node, ParseError.IdentifierExpected, [TokenType.CurlyR]); + } + if (!this.hasWhitespace() && this.acceptDelim(".") && !this.hasWhitespace()) { + const secondIdent = this._parseIdent([ReferenceType.Mixin]); + if (!secondIdent) { + return this.finish(node, ParseError.IdentifierExpected, [TokenType.CurlyR]); + } + const moduleToken = this.create(Module); + firstIdent.referenceTypes = [ReferenceType.Module]; + moduleToken.setIdentifier(firstIdent); + node.setIdentifier(secondIdent); + node.addChild(moduleToken); + } + if (this.accept(TokenType.ParenthesisL)) { + if (node.getArguments().addChild(this._parseFunctionArgument())) { + while (this.accept(TokenType.Comma)) { + if (this.peek(TokenType.ParenthesisR)) { + break; + } + if (!node.getArguments().addChild(this._parseFunctionArgument())) { + return this.finish(node, ParseError.ExpressionExpected); + } + } + } + if (!this.accept(TokenType.ParenthesisR)) { + return this.finish(node, ParseError.RightParenthesisExpected); + } + } + if (this.peekIdent("using") || this.peek(TokenType.CurlyL)) { + node.setContent(this._parseMixinContentDeclaration()); + } + return this.finish(node); + } + _parseMixinContentDeclaration() { + const node = this.create(MixinContentDeclaration); + if (this.acceptIdent("using")) { + if (!this.accept(TokenType.ParenthesisL)) { + return this.finish(node, ParseError.LeftParenthesisExpected, [TokenType.CurlyL]); + } + if (node.getParameters().addChild(this._parseParameterDeclaration())) { + while (this.accept(TokenType.Comma)) { + if (this.peek(TokenType.ParenthesisR)) { + break; + } + if (!node.getParameters().addChild(this._parseParameterDeclaration())) { + return this.finish(node, ParseError.VariableNameExpected); + } + } + } + if (!this.accept(TokenType.ParenthesisR)) { + return this.finish(node, ParseError.RightParenthesisExpected, [TokenType.CurlyL]); + } + } + if (this.peek(TokenType.CurlyL)) { + this._parseBody(node, this._parseMixinReferenceBodyStatement.bind(this)); + } + return this.finish(node); + } + _parseMixinReferenceBodyStatement() { + return this._tryParseKeyframeSelector() || this._parseRuleSetDeclaration(); + } + _parseIfTest() { + const node = this.create(Node); + if (this.acceptIdent("sass")) { + if (this.hasWhitespace() || !this.accept(TokenType.ParenthesisL)) { + return this.finish(node, ParseError.LeftParenthesisExpected, [], [TokenType.CurlyL]); + } + node.addChild(this._parseExpr()); + if (!this.accept(TokenType.ParenthesisR)) { + return this.finish(node, ParseError.RightParenthesisExpected, [], [TokenType.CurlyL]); + } + return this.finish(node); + } + return super._parseIfTest(); + } + _parseFunction() { + const pos = this.mark(); + const node = this.create(Function); + let isIf = this.peekIdent("if"); + if (!node.setIdentifier(this._parseFunctionIdentifier())) { + return null; + } + if (this.hasWhitespace() || !this.accept(TokenType.ParenthesisL)) { + this.restoreAtMark(pos); + return null; + } + let firstArgument; + let parseArgument = this._parseFunctionArgument.bind(this); + let separator = TokenType.Comma; + if (!isIf) { + firstArgument = this._parseFunctionArgument(); + } else { + const pos2 = this.mark(); + firstArgument = this._parseIfBranch(); + if (firstArgument && !firstArgument.isErroneous()) { + parseArgument = this._parseIfBranch.bind(this); + separator = TokenType.SemiColon; + } else { + this.restoreAtMark(pos2); + firstArgument = this._parseFunctionArgument(); + } + } + if (node.getArguments().addChild(firstArgument)) { + while (this.accept(separator)) { + if (this.peek(TokenType.ParenthesisR)) { + break; + } + if (!node.getArguments().addChild(parseArgument())) { + this.markError(node, ParseError.ExpressionExpected); + } + } + } + if (!this.accept(TokenType.ParenthesisR)) { + return this.finish(node, ParseError.RightParenthesisExpected); + } + return this.finish(node); + } + _parseFunctionArgument() { + const node = this.create(FunctionArgument); + const pos = this.mark(); + const argument = this._parseVariable(); + if (argument) { + if (!this.accept(TokenType.Colon)) { + if (this.accept(Ellipsis)) { + node.setValue(argument); + return this.finish(node); + } else { + this.restoreAtMark(pos); + } + } else { + node.setIdentifier(argument); + } + } + if (node.setValue(this._parseExpr(true))) { + this.accept(Ellipsis); + node.addChild(this._parsePrio()); + return this.finish(node); + } else if (node.setValue(this._tryParsePrio())) { + return this.finish(node); + } + return null; + } + _parseURLArgument() { + const pos = this.mark(); + const node = super._parseURLArgument(); + if (!node || !this.peek(TokenType.ParenthesisR)) { + this.restoreAtMark(pos); + const node2 = this.create(Node); + node2.addChild(this._parseBinaryExpr()); + return this.finish(node2); + } + return node; + } + _parseOperation() { + if (!this.peek(TokenType.ParenthesisL)) { + return null; + } + const node = this.create(Node); + this.consumeToken(); + while (node.addChild(this._parseListElement())) { + this.accept(TokenType.Comma); + } + if (!this.accept(TokenType.ParenthesisR)) { + return this.finish(node, ParseError.RightParenthesisExpected); + } + return this.finish(node); + } + _parseListElement() { + const node = this.create(ListEntry); + const child = this._parseBinaryExpr(); + if (!child) { + return null; + } + if (this.accept(TokenType.Colon)) { + node.setKey(child); + if (!node.setValue(this._parseBinaryExpr())) { + return this.finish(node, ParseError.ExpressionExpected); + } + } else { + node.setValue(child); + } + return this.finish(node); + } + _parseUse() { + if (!this.peekKeyword("@use")) { + return null; + } + const node = this.create(Use); + this.consumeToken(); + if (!node.addChild(this._parseStringLiteral())) { + return this.finish(node, ParseError.StringLiteralExpected); + } + if (!this.peek(TokenType.SemiColon) && !this.peek(TokenType.EOF)) { + if (!this.peekRegExp(TokenType.Ident, /as|with/)) { + return this.finish(node, ParseError.UnknownKeyword); + } + if (this.acceptIdent("as") && (!node.setIdentifier(this._parseIdent([ReferenceType.Module])) && !this.acceptDelim("*"))) { + return this.finish(node, ParseError.IdentifierOrWildcardExpected); + } + if (this.acceptIdent("with")) { + if (!node.setParameters(this._parseModuleConfig())) { + return this.finish(node, ParseError.LeftParenthesisExpected, [TokenType.ParenthesisR]); + } + } + } + if (!this.accept(TokenType.SemiColon) && !this.accept(TokenType.EOF)) { + return this.finish(node, ParseError.SemiColonExpected); + } + return this.finish(node); + } + _parseModuleConfig() { + const node = this.createNode(NodeType.ModuleConfig); + if (!this.accept(TokenType.ParenthesisL)) { + return null; + } + if (!node.addChild(this._parseModuleConfigDeclaration())) { + return this.finish(node, ParseError.VariableNameExpected); + } + while (this.accept(TokenType.Comma)) { + if (this.peek(TokenType.ParenthesisR)) { + break; + } + if (!node.addChild(this._parseModuleConfigDeclaration())) { + return this.finish(node, ParseError.VariableNameExpected); + } + } + if (!this.accept(TokenType.ParenthesisR)) { + return this.finish(node, ParseError.RightParenthesisExpected); + } + return this.finish(node); + } + _parseModuleConfigDeclaration() { + const node = this.create(ModuleConfiguration); + if (!node.setIdentifier(this._parseVariable())) { + return null; + } + if (!this.accept(TokenType.Colon) || !node.setValue(this._parseExpr(true))) { + return this.finish(node, ParseError.VariableValueExpected, [], [TokenType.Comma, TokenType.ParenthesisR]); + } + if (this.accept(TokenType.Exclamation)) { + if (this.hasWhitespace() || !this.acceptIdent("default")) { + return this.finish(node, ParseError.UnknownKeyword); + } + } + return this.finish(node); + } + _parseForward() { + if (!this.peekKeyword("@forward")) { + return null; + } + const node = this.create(Forward); + this.consumeToken(); + if (!node.addChild(this._parseStringLiteral())) { + return this.finish(node, ParseError.StringLiteralExpected); + } + if (this.acceptIdent("as")) { + const identifier = this._parseIdent([ReferenceType.Forward]); + if (!node.setIdentifier(identifier)) { + return this.finish(node, ParseError.IdentifierExpected); + } + if (this.hasWhitespace() || !this.acceptDelim("*")) { + return this.finish(node, ParseError.WildcardExpected); + } + } + if (this.acceptIdent("with")) { + if (!node.setParameters(this._parseModuleConfig())) { + return this.finish(node, ParseError.LeftParenthesisExpected, [TokenType.ParenthesisR]); + } + } else if (this.peekIdent("hide") || this.peekIdent("show")) { + if (!node.addChild(this._parseForwardVisibility())) { + return this.finish(node, ParseError.IdentifierOrVariableExpected); + } + } + if (!this.accept(TokenType.SemiColon) && !this.accept(TokenType.EOF)) { + return this.finish(node, ParseError.SemiColonExpected); + } + return this.finish(node); + } + _parseForwardVisibility() { + const node = this.create(ForwardVisibility); + node.setIdentifier(this._parseIdent()); + while (node.addChild(this._parseVariable() || this._parseIdent())) { + this.accept(TokenType.Comma); + } + return node.getChildren().length > 1 ? node : null; + } + _parseSupportsCondition() { + return this._parseInterpolation() || super._parseSupportsCondition(); + } +}; + +// node_modules/vscode-css-languageservice/lib/esm/services/scssCompletion.js +var sassDocumentationName = t("Sass documentation"); +var SCSSCompletion = class _SCSSCompletion extends CSSCompletion { + constructor(lsServiceOptions, cssDataManager) { + super("$", lsServiceOptions, cssDataManager); + addReferencesToDocumentation(_SCSSCompletion.scssModuleLoaders); + addReferencesToDocumentation(_SCSSCompletion.scssModuleBuiltIns); + } + isImportPathParent(type) { + return type === NodeType.Forward || type === NodeType.Use || super.isImportPathParent(type); + } + getCompletionForImportPath(importPathNode, result) { + const parentType = importPathNode.getParent().type; + if (parentType === NodeType.Forward || parentType === NodeType.Use) { + for (let p of _SCSSCompletion.scssModuleBuiltIns) { + const item = { + label: p.label, + documentation: p.documentation, + textEdit: TextEdit.replace(this.getCompletionRange(importPathNode), `'${p.label}'`), + kind: CompletionItemKind.Module + }; + result.items.push(item); + } + } + return super.getCompletionForImportPath(importPathNode, result); + } + createReplaceFunction() { + let tabStopCounter = 1; + return (_match, p1) => { + return "\\" + p1 + ": ${" + tabStopCounter++ + ":" + (_SCSSCompletion.variableDefaults[p1] || "") + "}"; + }; + } + createFunctionProposals(proposals, existingNode, sortToEnd, result) { + for (const p of proposals) { + const insertText = p.func.replace(/\[?(\$\w+)\]?/g, this.createReplaceFunction()); + const label = p.func.substr(0, p.func.indexOf("(")); + const item = { + label, + detail: p.func, + documentation: p.desc, + textEdit: TextEdit.replace(this.getCompletionRange(existingNode), insertText), + insertTextFormat: InsertTextFormat.Snippet, + kind: CompletionItemKind.Function + }; + if (sortToEnd) { + item.sortText = "z"; + } + result.items.push(item); + } + return result; + } + getCompletionsForSelector(ruleSet, isNested, result) { + this.createFunctionProposals(_SCSSCompletion.selectorFuncs, null, true, result); + return super.getCompletionsForSelector(ruleSet, isNested, result); + } + getTermProposals(entry, existingNode, result) { + let functions = _SCSSCompletion.builtInFuncs; + if (entry) { + functions = functions.filter((f2) => !f2.type || !entry.restrictions || entry.restrictions.indexOf(f2.type) !== -1); + } + this.createFunctionProposals(functions, existingNode, true, result); + return super.getTermProposals(entry, existingNode, result); + } + getColorProposals(entry, existingNode, result) { + this.createFunctionProposals(_SCSSCompletion.colorProposals, existingNode, false, result); + return super.getColorProposals(entry, existingNode, result); + } + getCompletionsForDeclarationProperty(declaration, result) { + this.getCompletionForAtDirectives(result); + this.getCompletionsForSelector(null, true, result); + return super.getCompletionsForDeclarationProperty(declaration, result); + } + getCompletionsForExtendsReference(_extendsRef, existingNode, result) { + const symbols = this.getSymbolContext().findSymbolsAtOffset(this.offset, ReferenceType.Rule); + for (const symbol of symbols) { + const suggest = { + label: symbol.name, + textEdit: TextEdit.replace(this.getCompletionRange(existingNode), symbol.name), + kind: CompletionItemKind.Function + }; + result.items.push(suggest); + } + return result; + } + getCompletionForAtDirectives(result) { + result.items.push(..._SCSSCompletion.scssAtDirectives); + return result; + } + getCompletionForTopLevel(result) { + this.getCompletionForAtDirectives(result); + this.getCompletionForModuleLoaders(result); + super.getCompletionForTopLevel(result); + return result; + } + getCompletionForModuleLoaders(result) { + result.items.push(..._SCSSCompletion.scssModuleLoaders); + return result; + } +}; +SCSSCompletion.variableDefaults = { + "$red": "1", + "$green": "2", + "$blue": "3", + "$alpha": "1.0", + "$color": "#000000", + "$weight": "0.5", + "$hue": "0", + "$saturation": "0%", + "$lightness": "0%", + "$degrees": "0", + "$amount": "0", + "$string": '""', + "$substring": '"s"', + "$number": "0", + "$limit": "1" +}; +SCSSCompletion.colorProposals = [ + { func: "red($color)", desc: t("Gets the red component of a color.") }, + { func: "green($color)", desc: t("Gets the green component of a color.") }, + { func: "blue($color)", desc: t("Gets the blue component of a color.") }, + { func: "mix($color, $color, [$weight])", desc: t("Mixes two colors together.") }, + { func: "hue($color)", desc: t("Gets the hue component of a color.") }, + { func: "saturation($color)", desc: t("Gets the saturation component of a color.") }, + { func: "lightness($color)", desc: t("Gets the lightness component of a color.") }, + { func: "adjust-hue($color, $degrees)", desc: t("Changes the hue of a color.") }, + { func: "lighten($color, $amount)", desc: t("Makes a color lighter.") }, + { func: "darken($color, $amount)", desc: t("Makes a color darker.") }, + { func: "saturate($color, $amount)", desc: t("Makes a color more saturated.") }, + { func: "desaturate($color, $amount)", desc: t("Makes a color less saturated.") }, + { func: "grayscale($color)", desc: t("Converts a color to grayscale.") }, + { func: "complement($color)", desc: t("Returns the complement of a color.") }, + { func: "invert($color)", desc: t("Returns the inverse of a color.") }, + { func: "alpha($color)", desc: t("Gets the opacity component of a color.") }, + { func: "opacity($color)", desc: "Gets the alpha component (opacity) of a color." }, + { func: "rgba($color, $alpha)", desc: t("Changes the alpha component for a color.") }, + { func: "opacify($color, $amount)", desc: t("Makes a color more opaque.") }, + { func: "fade-in($color, $amount)", desc: t("Makes a color more opaque.") }, + { func: "transparentize($color, $amount)", desc: t("Makes a color more transparent.") }, + { func: "fade-out($color, $amount)", desc: t("Makes a color more transparent.") }, + { func: "adjust-color($color, [$red], [$green], [$blue], [$hue], [$saturation], [$lightness], [$alpha])", desc: t("Increases or decreases one or more components of a color.") }, + { func: "scale-color($color, [$red], [$green], [$blue], [$saturation], [$lightness], [$alpha])", desc: t("Fluidly scales one or more properties of a color.") }, + { func: "change-color($color, [$red], [$green], [$blue], [$hue], [$saturation], [$lightness], [$alpha])", desc: t("Changes one or more properties of a color.") }, + { func: "ie-hex-str($color)", desc: t("Converts a color into the format understood by IE filters.") } +]; +SCSSCompletion.selectorFuncs = [ + { func: "selector-nest($selectors\u2026)", desc: t("Nests selector beneath one another like they would be nested in the stylesheet.") }, + { func: "selector-append($selectors\u2026)", desc: t("Appends selectors to one another without spaces in between.") }, + { func: "selector-extend($selector, $extendee, $extender)", desc: t("Extends $extendee with $extender within $selector.") }, + { func: "selector-replace($selector, $original, $replacement)", desc: t("Replaces $original with $replacement within $selector.") }, + { func: "selector-unify($selector1, $selector2)", desc: t("Unifies two selectors to produce a selector that matches elements matched by both.") }, + { func: "is-superselector($super, $sub)", desc: t("Returns whether $super matches all the elements $sub does, and possibly more.") }, + { func: "simple-selectors($selector)", desc: t("Returns the simple selectors that comprise a compound selector.") }, + { func: "selector-parse($selector)", desc: t("Parses a selector into the format returned by &.") } +]; +SCSSCompletion.builtInFuncs = [ + { func: "unquote($string)", desc: t("Removes quotes from a string.") }, + { func: "quote($string)", desc: t("Adds quotes to a string.") }, + { func: "str-length($string)", desc: t("Returns the number of characters in a string.") }, + { func: "str-insert($string, $insert, $index)", desc: t("Inserts $insert into $string at $index.") }, + { func: "str-index($string, $substring)", desc: t("Returns the index of the first occurance of $substring in $string.") }, + { func: "str-slice($string, $start-at, [$end-at])", desc: t("Extracts a substring from $string.") }, + { func: "to-upper-case($string)", desc: t("Converts a string to upper case.") }, + { func: "to-lower-case($string)", desc: t("Converts a string to lower case.") }, + { func: "percentage($number)", desc: t("Converts a unitless number to a percentage."), type: "percentage" }, + { func: "round($number)", desc: t("Rounds a number to the nearest whole number.") }, + { func: "ceil($number)", desc: t("Rounds a number up to the next whole number.") }, + { func: "floor($number)", desc: t("Rounds a number down to the previous whole number.") }, + { func: "abs($number)", desc: t("Returns the absolute value of a number.") }, + { func: "min($numbers)", desc: t("Finds the minimum of several numbers.") }, + { func: "max($numbers)", desc: t("Finds the maximum of several numbers.") }, + { func: "random([$limit])", desc: t("Returns a random number.") }, + { func: "length($list)", desc: t("Returns the length of a list.") }, + { func: "nth($list, $n)", desc: t("Returns a specific item in a list.") }, + { func: "set-nth($list, $n, $value)", desc: t("Replaces the nth item in a list.") }, + { func: "join($list1, $list2, [$separator])", desc: t("Joins together two lists into one.") }, + { func: "append($list1, $val, [$separator])", desc: t("Appends a single value onto the end of a list.") }, + { func: "zip($lists)", desc: t("Combines several lists into a single multidimensional list.") }, + { func: "index($list, $value)", desc: t("Returns the position of a value within a list.") }, + { func: "list-separator(#list)", desc: t("Returns the separator of a list.") }, + { func: "map-get($map, $key)", desc: t("Returns the value in a map associated with a given key.") }, + { func: "map-merge($map1, $map2)", desc: t("Merges two maps together into a new map.") }, + { func: "map-remove($map, $keys)", desc: t("Returns a new map with keys removed.") }, + { func: "map-keys($map)", desc: t("Returns a list of all keys in a map.") }, + { func: "map-values($map)", desc: t("Returns a list of all values in a map.") }, + { func: "map-has-key($map, $key)", desc: t("Returns whether a map has a value associated with a given key.") }, + { func: "keywords($args)", desc: t("Returns the keywords passed to a function that takes variable arguments.") }, + { func: "feature-exists($feature)", desc: t("Returns whether a feature exists in the current Sass runtime.") }, + { func: "variable-exists($name)", desc: t("Returns whether a variable with the given name exists in the current scope.") }, + { func: "global-variable-exists($name)", desc: t("Returns whether a variable with the given name exists in the global scope.") }, + { func: "function-exists($name)", desc: t("Returns whether a function with the given name exists.") }, + { func: "mixin-exists($name)", desc: t("Returns whether a mixin with the given name exists.") }, + { func: "inspect($value)", desc: t("Returns the string representation of a value as it would be represented in Sass.") }, + { func: "type-of($value)", desc: t("Returns the type of a value.") }, + { func: "unit($number)", desc: t("Returns the unit(s) associated with a number.") }, + { func: "unitless($number)", desc: t("Returns whether a number has units.") }, + { func: "comparable($number1, $number2)", desc: t("Returns whether two numbers can be added, subtracted, or compared.") }, + { func: "call($name, $args\u2026)", desc: t("Dynamically calls a Sass function.") } +]; +SCSSCompletion.scssAtDirectives = [ + { + label: "@extend", + documentation: t("Inherits the styles of another selector."), + kind: CompletionItemKind.Keyword + }, + { + label: "@at-root", + documentation: t("Causes one or more rules to be emitted at the root of the document."), + kind: CompletionItemKind.Keyword + }, + { + label: "@debug", + documentation: t("Prints the value of an expression to the standard error output stream. Useful for debugging complicated Sass files."), + kind: CompletionItemKind.Keyword + }, + { + label: "@warn", + documentation: t("Prints the value of an expression to the standard error output stream. Useful for libraries that need to warn users of deprecations or recovering from minor mixin usage mistakes. Warnings can be turned off with the `--quiet` command-line option or the `:quiet` Sass option."), + kind: CompletionItemKind.Keyword + }, + { + label: "@error", + documentation: t("Throws the value of an expression as a fatal error with stack trace. Useful for validating arguments to mixins and functions."), + kind: CompletionItemKind.Keyword + }, + { + label: "@if", + documentation: t("Includes the body if the expression does not evaluate to `false` or `null`."), + insertText: "@if ${1:expr} {\n $0\n}", + insertTextFormat: InsertTextFormat.Snippet, + kind: CompletionItemKind.Keyword + }, + { + label: "@for", + documentation: t("For loop that repeatedly outputs a set of styles for each `$var` in the `from/through` or `from/to` clause."), + insertText: "@for \\$${1:var} from ${2:start} ${3|to,through|} ${4:end} {\n $0\n}", + insertTextFormat: InsertTextFormat.Snippet, + kind: CompletionItemKind.Keyword + }, + { + label: "@each", + documentation: t("Each loop that sets `$var` to each item in the list or map, then outputs the styles it contains using that value of `$var`."), + insertText: "@each \\$${1:var} in ${2:list} {\n $0\n}", + insertTextFormat: InsertTextFormat.Snippet, + kind: CompletionItemKind.Keyword + }, + { + label: "@while", + documentation: t("While loop that takes an expression and repeatedly outputs the nested styles until the statement evaluates to `false`."), + insertText: "@while ${1:condition} {\n $0\n}", + insertTextFormat: InsertTextFormat.Snippet, + kind: CompletionItemKind.Keyword + }, + { + label: "@mixin", + documentation: t("Defines styles that can be re-used throughout the stylesheet with `@include`."), + insertText: "@mixin ${1:name} {\n $0\n}", + insertTextFormat: InsertTextFormat.Snippet, + kind: CompletionItemKind.Keyword + }, + { + label: "@include", + documentation: t("Includes the styles defined by another mixin into the current rule."), + kind: CompletionItemKind.Keyword + }, + { + label: "@function", + documentation: t("Defines complex operations that can be re-used throughout stylesheets."), + kind: CompletionItemKind.Keyword + } +]; +SCSSCompletion.scssModuleLoaders = [ + { + label: "@use", + documentation: t("Loads mixins, functions, and variables from other Sass stylesheets as 'modules', and combines CSS from multiple stylesheets together."), + references: [{ name: sassDocumentationName, url: "https://sass-lang.com/documentation/at-rules/use" }], + insertText: "@use $0;", + insertTextFormat: InsertTextFormat.Snippet, + kind: CompletionItemKind.Keyword + }, + { + label: "@forward", + documentation: t("Loads a Sass stylesheet and makes its mixins, functions, and variables available when this stylesheet is loaded with the @use rule."), + references: [{ name: sassDocumentationName, url: "https://sass-lang.com/documentation/at-rules/forward" }], + insertText: "@forward $0;", + insertTextFormat: InsertTextFormat.Snippet, + kind: CompletionItemKind.Keyword + } +]; +SCSSCompletion.scssModuleBuiltIns = [ + { + label: "sass:math", + documentation: t("Provides functions that operate on numbers."), + references: [{ name: sassDocumentationName, url: "https://sass-lang.com/documentation/modules/math" }] + }, + { + label: "sass:string", + documentation: t("Makes it easy to combine, search, or split apart strings."), + references: [{ name: sassDocumentationName, url: "https://sass-lang.com/documentation/modules/string" }] + }, + { + label: "sass:color", + documentation: t("Generates new colors based on existing ones, making it easy to build color themes."), + references: [{ name: sassDocumentationName, url: "https://sass-lang.com/documentation/modules/color" }] + }, + { + label: "sass:list", + documentation: t("Lets you access and modify values in lists."), + references: [{ name: sassDocumentationName, url: "https://sass-lang.com/documentation/modules/list" }] + }, + { + label: "sass:map", + documentation: t("Makes it possible to look up the value associated with a key in a map, and much more."), + references: [{ name: sassDocumentationName, url: "https://sass-lang.com/documentation/modules/map" }] + }, + { + label: "sass:selector", + documentation: t("Provides access to Sass\u2019s powerful selector engine."), + references: [{ name: sassDocumentationName, url: "https://sass-lang.com/documentation/modules/selector" }] + }, + { + label: "sass:meta", + documentation: t("Exposes the details of Sass\u2019s inner workings."), + references: [{ name: sassDocumentationName, url: "https://sass-lang.com/documentation/modules/meta" }] + } +]; +function addReferencesToDocumentation(items) { + items.forEach((i) => { + if (i.documentation && i.references && i.references.length > 0) { + const markdownDoc = typeof i.documentation === "string" ? { kind: "markdown", value: i.documentation } : { kind: "markdown", value: i.documentation.value }; + markdownDoc.value += "\n\n"; + markdownDoc.value += i.references.map((r) => { + return `[${r.name}](${r.url})`; + }).join(" | "); + i.documentation = markdownDoc; + } + }); +} + +// node_modules/vscode-css-languageservice/lib/esm/parser/lessScanner.js +var _FSL3 = "/".charCodeAt(0); +var _NWL3 = "\n".charCodeAt(0); +var _CAR3 = "\r".charCodeAt(0); +var _LFD3 = "\f".charCodeAt(0); +var _TIC = "`".charCodeAt(0); +var _DOT3 = ".".charCodeAt(0); +var customTokenValue2 = TokenType.CustomToken; +var Ellipsis2 = customTokenValue2++; +var LESSScanner = class extends Scanner { + scanNext(offset) { + const tokenType = this.escapedJavaScript(); + if (tokenType !== null) { + return this.finishToken(offset, tokenType); + } + if (this.stream.advanceIfChars([_DOT3, _DOT3, _DOT3])) { + return this.finishToken(offset, Ellipsis2); + } + return super.scanNext(offset); + } + comment() { + if (super.comment()) { + return true; + } + if (!this.inURL && this.stream.advanceIfChars([_FSL3, _FSL3])) { + this.stream.advanceWhileChar((ch) => { + switch (ch) { + case _NWL3: + case _CAR3: + case _LFD3: + return false; + default: + return true; + } + }); + return true; + } else { + return false; + } + } + escapedJavaScript() { + const ch = this.stream.peekChar(); + if (ch === _TIC) { + this.stream.advance(1); + this.stream.advanceWhileChar((ch2) => { + return ch2 !== _TIC; + }); + return this.stream.advanceIfChar(_TIC) ? TokenType.EscapedJavaScript : TokenType.BadEscapedJavaScript; + } + return null; + } +}; + +// node_modules/vscode-css-languageservice/lib/esm/parser/lessParser.js +var LESSParser = class extends Parser { + constructor() { + super(new LESSScanner()); + } + _parseStylesheetStatement(isNested = false) { + if (this.peek(TokenType.AtKeyword)) { + return this._parseVariableDeclaration() || this._parsePlugin() || super._parseStylesheetAtStatement(isNested); + } + return this._tryParseMixinDeclaration() || this._tryParseMixinReference() || this._parseFunction() || this._parseRuleset(true); + } + _parseImport() { + if (!this.peekKeyword("@import") && !this.peekKeyword("@import-once")) { + return null; + } + const node = this.create(Import); + this.consumeToken(); + if (this.accept(TokenType.ParenthesisL)) { + if (!this.accept(TokenType.Ident)) { + return this.finish(node, ParseError.IdentifierExpected, [TokenType.SemiColon]); + } + do { + if (!this.accept(TokenType.Comma)) { + break; + } + } while (this.accept(TokenType.Ident)); + if (!this.accept(TokenType.ParenthesisR)) { + return this.finish(node, ParseError.RightParenthesisExpected, [TokenType.SemiColon]); + } + } + if (!node.addChild(this._parseURILiteral()) && !node.addChild(this._parseStringLiteral())) { + return this.finish(node, ParseError.URIOrStringExpected, [TokenType.SemiColon]); + } + if (!this.peek(TokenType.SemiColon) && !this.peek(TokenType.EOF)) { + node.setMedialist(this._parseMediaQueryList()); + } + return this._completeParseImport(node); + } + _parsePlugin() { + if (!this.peekKeyword("@plugin")) { + return null; + } + const node = this.createNode(NodeType.Plugin); + this.consumeToken(); + if (!node.addChild(this._parseStringLiteral())) { + return this.finish(node, ParseError.StringLiteralExpected); + } + if (!this.accept(TokenType.SemiColon)) { + return this.finish(node, ParseError.SemiColonExpected); + } + return this.finish(node); + } + _parseMediaQuery() { + const node = super._parseMediaQuery(); + if (!node) { + const node2 = this.create(MediaQuery); + if (node2.addChild(this._parseVariable())) { + return this.finish(node2); + } + return null; + } + return node; + } + _parseMediaDeclaration(isNested = false) { + return this._tryParseRuleset(isNested) || this._tryToParseDeclaration() || this._tryParseMixinDeclaration() || this._tryParseMixinReference() || this._parseDetachedRuleSetMixin() || this._parseStylesheetStatement(isNested); + } + _parseMediaFeatureName() { + return this._parseIdent() || this._parseVariable(); + } + _parseVariableDeclaration(panic = []) { + const node = this.create(VariableDeclaration); + const mark = this.mark(); + if (!node.setVariable(this._parseVariable(true))) { + return null; + } + if (this.accept(TokenType.Colon)) { + if (this.prevToken) { + node.colonPosition = this.prevToken.offset; + } + if (node.setValue(this._parseDetachedRuleSet())) { + node.needsSemicolon = false; + } else if (!node.setValue(this._parseExpr())) { + return this.finish(node, ParseError.VariableValueExpected, [], panic); + } + node.addChild(this._parsePrio()); + } else { + this.restoreAtMark(mark); + return null; + } + if (this.peek(TokenType.SemiColon)) { + node.semicolonPosition = this.token.offset; + } + return this.finish(node); + } + _parseDetachedRuleSet() { + let mark = this.mark(); + if (this.peekDelim("#") || this.peekDelim(".")) { + this.consumeToken(); + if (!this.hasWhitespace() && this.accept(TokenType.ParenthesisL)) { + let node = this.create(MixinDeclaration); + if (node.getParameters().addChild(this._parseMixinParameter())) { + while (this.accept(TokenType.Comma) || this.accept(TokenType.SemiColon)) { + if (this.peek(TokenType.ParenthesisR)) { + break; + } + if (!node.getParameters().addChild(this._parseMixinParameter())) { + this.markError(node, ParseError.IdentifierExpected, [], [TokenType.ParenthesisR]); + } + } + } + if (!this.accept(TokenType.ParenthesisR)) { + this.restoreAtMark(mark); + return null; + } + } else { + this.restoreAtMark(mark); + return null; + } + } + if (!this.peek(TokenType.CurlyL)) { + return null; + } + const content = this.create(BodyDeclaration); + this._parseBody(content, this._parseDetachedRuleSetBody.bind(this)); + return this.finish(content); + } + _parseDetachedRuleSetBody() { + return this._tryParseKeyframeSelector() || this._parseRuleSetDeclaration(); + } + _addLookupChildren(node) { + if (!node.addChild(this._parseLookupValue())) { + return false; + } + let expectsValue = false; + while (true) { + if (this.peek(TokenType.BracketL)) { + expectsValue = true; + } + if (!node.addChild(this._parseLookupValue())) { + break; + } + expectsValue = false; + } + return !expectsValue; + } + _parseLookupValue() { + const node = this.create(Node); + const mark = this.mark(); + if (!this.accept(TokenType.BracketL)) { + this.restoreAtMark(mark); + return null; + } + if ((node.addChild(this._parseVariable(false, true)) || node.addChild(this._parsePropertyIdentifier())) && this.accept(TokenType.BracketR) || this.accept(TokenType.BracketR)) { + return node; + } + this.restoreAtMark(mark); + return null; + } + _parseVariable(declaration = false, insideLookup = false) { + const isPropertyReference = !declaration && this.peekDelim("$"); + if (!this.peekDelim("@") && !isPropertyReference && !this.peek(TokenType.AtKeyword)) { + return null; + } + const node = this.create(Variable); + const mark = this.mark(); + while (this.acceptDelim("@") || !declaration && this.acceptDelim("$")) { + if (this.hasWhitespace()) { + this.restoreAtMark(mark); + return null; + } + } + if (!this.accept(TokenType.AtKeyword) && !this.accept(TokenType.Ident)) { + this.restoreAtMark(mark); + return null; + } + if (!insideLookup && this.peek(TokenType.BracketL)) { + if (!this._addLookupChildren(node)) { + this.restoreAtMark(mark); + return null; + } + } + return node; + } + _parseTermExpression() { + return this._parseVariable() || this._parseEscaped() || super._parseTermExpression() || // preference for colors before mixin references + this._tryParseMixinReference(false); + } + _parseEscaped() { + if (this.peek(TokenType.EscapedJavaScript) || this.peek(TokenType.BadEscapedJavaScript)) { + const node = this.createNode(NodeType.EscapedValue); + this.consumeToken(); + return this.finish(node); + } + if (this.peekDelim("~")) { + const node = this.createNode(NodeType.EscapedValue); + this.consumeToken(); + if (this.accept(TokenType.String) || this.accept(TokenType.EscapedJavaScript)) { + return this.finish(node); + } else { + return this.finish(node, ParseError.TermExpected); + } + } + return null; + } + _parseOperator() { + const node = this._parseGuardOperator(); + if (node) { + return node; + } else { + return super._parseOperator(); + } + } + _parseGuardOperator() { + if (this.peekDelim(">")) { + const node = this.createNode(NodeType.Operator); + this.consumeToken(); + this.acceptDelim("="); + return node; + } else if (this.peekDelim("=")) { + const node = this.createNode(NodeType.Operator); + this.consumeToken(); + this.acceptDelim("<"); + return node; + } else if (this.peekDelim("<")) { + const node = this.createNode(NodeType.Operator); + this.consumeToken(); + this.acceptDelim("="); + return node; + } + return null; + } + _parseRuleSetDeclaration() { + if (this.peek(TokenType.AtKeyword)) { + return this._parseKeyframe() || this._parseMedia(true) || this._parseImport() || this._parseSupports(true) || this._parseLayer() || this._parsePropertyAtRule() || this._parseContainer(true) || this._parseDetachedRuleSetMixin() || this._parseVariableDeclaration() || this._parseRuleSetDeclarationAtStatement(); + } + return this._tryParseMixinDeclaration() || this._tryParseRuleset(true) || this._tryParseMixinReference() || this._parseFunction() || this._parseExtend() || this._parseDeclaration(); + } + _parseKeyframeIdent() { + return this._parseIdent([ReferenceType.Keyframe]) || this._parseVariable(); + } + _parseKeyframeSelector() { + return this._parseDetachedRuleSetMixin() || super._parseKeyframeSelector(); + } + // public _parseSimpleSelectorBody(): nodes.Node | null { + // return this._parseNestingSelector() || super._parseSimpleSelectorBody(); + // } + _parseSelector(isNested) { + const node = this.create(Selector); + let hasContent = false; + if (isNested) { + hasContent = node.addChild(this._parseCombinator()); + } + while (node.addChild(this._parseSimpleSelector())) { + hasContent = true; + const mark = this.mark(); + if (node.addChild(this._parseGuard()) && this.peek(TokenType.CurlyL)) { + break; + } + this.restoreAtMark(mark); + node.addChild(this._parseCombinator()); + } + return hasContent ? this.finish(node) : null; + } + _parseNestingSelector() { + if (this.peekDelim("&")) { + const node = this.createNode(NodeType.SelectorCombinator); + this.consumeToken(); + while (!this.hasWhitespace() && (this.acceptDelim("-") || this.accept(TokenType.Num) || this.accept(TokenType.Dimension) || node.addChild(this._parseIdent()) || this.acceptDelim("&"))) { + } + return this.finish(node); + } + return null; + } + _parseSelectorIdent() { + if (!this.peekInterpolatedIdent()) { + return null; + } + const node = this.createNode(NodeType.SelectorInterpolation); + const hasContent = this._acceptInterpolatedIdent(node); + return hasContent ? this.finish(node) : null; + } + _parsePropertyIdentifier(inLookup = false) { + const propertyRegex = /^[\w-]+/; + if (!this.peekInterpolatedIdent() && !this.peekRegExp(this.token.type, propertyRegex)) { + return null; + } + const mark = this.mark(); + const node = this.create(Identifier); + node.isCustomProperty = this.acceptDelim("-") && this.acceptDelim("-"); + let childAdded = false; + if (!inLookup) { + if (node.isCustomProperty) { + childAdded = this._acceptInterpolatedIdent(node); + } else { + childAdded = this._acceptInterpolatedIdent(node, propertyRegex); + } + } else { + if (node.isCustomProperty) { + childAdded = node.addChild(this._parseIdent()); + } else { + childAdded = node.addChild(this._parseRegexp(propertyRegex)); + } + } + if (!childAdded) { + this.restoreAtMark(mark); + return null; + } + if (!inLookup && !this.hasWhitespace()) { + this.acceptDelim("+"); + if (!this.hasWhitespace()) { + this.acceptIdent("_"); + } + } + return this.finish(node); + } + peekInterpolatedIdent() { + return this.peek(TokenType.Ident) || this.peekDelim("@") || this.peekDelim("$") || this.peekDelim("-"); + } + _acceptInterpolatedIdent(node, identRegex) { + let hasContent = false; + const indentInterpolation = () => { + const pos = this.mark(); + if (this.acceptDelim("-")) { + if (!this.hasWhitespace()) { + this.acceptDelim("-"); + } + if (this.hasWhitespace()) { + this.restoreAtMark(pos); + return null; + } + } + return this._parseInterpolation(); + }; + const accept = identRegex ? () => this.acceptRegexp(identRegex) : () => this.accept(TokenType.Ident); + while (accept() || node.addChild(this._parseInterpolation() || this.try(indentInterpolation))) { + hasContent = true; + if (this.hasWhitespace()) { + break; + } + } + return hasContent; + } + _parseInterpolation() { + const mark = this.mark(); + if (this.peekDelim("@") || this.peekDelim("$")) { + const node = this.createNode(NodeType.Interpolation); + this.consumeToken(); + if (this.hasWhitespace() || !this.accept(TokenType.CurlyL)) { + this.restoreAtMark(mark); + return null; + } + if (!node.addChild(this._parseIdent())) { + return this.finish(node, ParseError.IdentifierExpected); + } + if (!this.accept(TokenType.CurlyR)) { + return this.finish(node, ParseError.RightCurlyExpected); + } + return this.finish(node); + } + return null; + } + _tryParseMixinDeclaration() { + const mark = this.mark(); + const node = this.create(MixinDeclaration); + if (!node.setIdentifier(this._parseMixinDeclarationIdentifier()) || !this.accept(TokenType.ParenthesisL)) { + this.restoreAtMark(mark); + return null; + } + if (node.getParameters().addChild(this._parseMixinParameter())) { + while (this.accept(TokenType.Comma) || this.accept(TokenType.SemiColon)) { + if (this.peek(TokenType.ParenthesisR)) { + break; + } + if (!node.getParameters().addChild(this._parseMixinParameter())) { + this.markError(node, ParseError.IdentifierExpected, [], [TokenType.ParenthesisR]); + } + } + } + if (!this.accept(TokenType.ParenthesisR)) { + this.restoreAtMark(mark); + return null; + } + node.setGuard(this._parseGuard()); + if (!this.peek(TokenType.CurlyL)) { + this.restoreAtMark(mark); + return null; + } + return this._parseBody(node, this._parseMixInBodyDeclaration.bind(this)); + } + _parseMixInBodyDeclaration() { + return this._parseFontFace() || this._parseRuleSetDeclaration(); + } + _parseMixinDeclarationIdentifier() { + let identifier; + if (this.peekDelim("#") || this.peekDelim(".")) { + identifier = this.create(Identifier); + this.consumeToken(); + if (this.hasWhitespace() || !identifier.addChild(this._parseIdent())) { + return null; + } + } else if (this.peek(TokenType.Hash)) { + identifier = this.create(Identifier); + this.consumeToken(); + } else { + return null; + } + identifier.referenceTypes = [ReferenceType.Mixin]; + return this.finish(identifier); + } + _parsePseudo() { + if (!this.peek(TokenType.Colon)) { + return null; + } + const mark = this.mark(); + const node = this.create(ExtendsReference); + this.consumeToken(); + if (this.acceptIdent("extend")) { + return this._completeExtends(node); + } + this.restoreAtMark(mark); + return super._parsePseudo(); + } + _parseExtend() { + if (!this.peekDelim("&")) { + return null; + } + const mark = this.mark(); + const node = this.create(ExtendsReference); + this.consumeToken(); + if (this.hasWhitespace() || !this.accept(TokenType.Colon) || !this.acceptIdent("extend")) { + this.restoreAtMark(mark); + return null; + } + return this._completeExtends(node); + } + _completeExtends(node) { + if (!this.accept(TokenType.ParenthesisL)) { + return this.finish(node, ParseError.LeftParenthesisExpected); + } + const selectors = node.getSelectors(); + if (!selectors.addChild(this._parseSelector(true))) { + return this.finish(node, ParseError.SelectorExpected); + } + while (this.accept(TokenType.Comma)) { + if (!selectors.addChild(this._parseSelector(true))) { + return this.finish(node, ParseError.SelectorExpected); + } + } + if (!this.accept(TokenType.ParenthesisR)) { + return this.finish(node, ParseError.RightParenthesisExpected); + } + return this.finish(node); + } + _parseDetachedRuleSetMixin() { + if (!this.peek(TokenType.AtKeyword)) { + return null; + } + const mark = this.mark(); + const node = this.create(MixinReference); + if (node.addChild(this._parseVariable(true)) && (this.hasWhitespace() || !this.accept(TokenType.ParenthesisL))) { + this.restoreAtMark(mark); + return null; + } + if (!this.accept(TokenType.ParenthesisR)) { + return this.finish(node, ParseError.RightParenthesisExpected); + } + return this.finish(node); + } + _tryParseMixinReference(atRoot = true) { + const mark = this.mark(); + const node = this.create(MixinReference); + let identifier = this._parseMixinDeclarationIdentifier(); + while (identifier) { + this.acceptDelim(">"); + const nextId = this._parseMixinDeclarationIdentifier(); + if (nextId) { + node.getNamespaces().addChild(identifier); + identifier = nextId; + } else { + break; + } + } + if (!node.setIdentifier(identifier)) { + this.restoreAtMark(mark); + return null; + } + let hasArguments = false; + if (this.accept(TokenType.ParenthesisL)) { + hasArguments = true; + if (node.getArguments().addChild(this._parseMixinArgument())) { + while (this.accept(TokenType.Comma) || this.accept(TokenType.SemiColon)) { + if (this.peek(TokenType.ParenthesisR)) { + break; + } + if (!node.getArguments().addChild(this._parseMixinArgument())) { + return this.finish(node, ParseError.ExpressionExpected); + } + } + } + if (!this.accept(TokenType.ParenthesisR)) { + return this.finish(node, ParseError.RightParenthesisExpected); + } + identifier.referenceTypes = [ReferenceType.Mixin]; + } else { + identifier.referenceTypes = [ReferenceType.Mixin, ReferenceType.Rule]; + } + if (this.peek(TokenType.BracketL)) { + if (!atRoot) { + this._addLookupChildren(node); + } + } else { + node.addChild(this._parsePrio()); + } + if (!hasArguments && !this.peek(TokenType.SemiColon) && !this.peek(TokenType.CurlyR) && !this.peek(TokenType.EOF)) { + this.restoreAtMark(mark); + return null; + } + return this.finish(node); + } + _parseMixinArgument() { + const node = this.create(FunctionArgument); + const pos = this.mark(); + const argument = this._parseVariable(); + if (argument) { + if (!this.accept(TokenType.Colon)) { + this.restoreAtMark(pos); + } else { + node.setIdentifier(argument); + } + } + if (node.setValue(this._parseDetachedRuleSet() || this._parseExpr(true))) { + return this.finish(node); + } + this.restoreAtMark(pos); + return null; + } + _parseMixinParameter() { + const node = this.create(FunctionParameter); + if (this.peekKeyword("@rest")) { + const restNode = this.create(Node); + this.consumeToken(); + if (!this.accept(Ellipsis2)) { + return this.finish(node, ParseError.DotExpected, [], [TokenType.Comma, TokenType.ParenthesisR]); + } + node.setIdentifier(this.finish(restNode)); + return this.finish(node); + } + if (this.peek(Ellipsis2)) { + const varargsNode = this.create(Node); + this.consumeToken(); + node.setIdentifier(this.finish(varargsNode)); + return this.finish(node); + } + let hasContent = false; + if (node.setIdentifier(this._parseVariable())) { + this.accept(TokenType.Colon); + hasContent = true; + } + if (!node.setDefaultValue(this._parseDetachedRuleSet() || this._parseExpr(true)) && !hasContent) { + return null; + } + return this.finish(node); + } + _parseGuard() { + if (!this.peekIdent("when")) { + return null; + } + const node = this.create(LessGuard); + this.consumeToken(); + if (!node.getConditions().addChild(this._parseGuardCondition())) { + return this.finish(node, ParseError.ConditionExpected); + } + while (this.acceptIdent("and") || this.accept(TokenType.Comma)) { + if (!node.getConditions().addChild(this._parseGuardCondition())) { + return this.finish(node, ParseError.ConditionExpected); + } + } + return this.finish(node); + } + _parseGuardCondition() { + const node = this.create(GuardCondition); + node.isNegated = this.acceptIdent("not"); + if (!this.accept(TokenType.ParenthesisL)) { + if (node.isNegated) { + return this.finish(node, ParseError.LeftParenthesisExpected); + } + return null; + } + if (!node.addChild(this._parseExpr())) { + } + if (!this.accept(TokenType.ParenthesisR)) { + return this.finish(node, ParseError.RightParenthesisExpected); + } + return this.finish(node); + } + _parseFunction() { + const pos = this.mark(); + const node = this.create(Function); + if (!node.setIdentifier(this._parseFunctionIdentifier())) { + return null; + } + if (this.hasWhitespace() || !this.accept(TokenType.ParenthesisL)) { + this.restoreAtMark(pos); + return null; + } + if (node.getArguments().addChild(this._parseMixinArgument())) { + while (this.accept(TokenType.Comma) || this.accept(TokenType.SemiColon)) { + if (this.peek(TokenType.ParenthesisR)) { + break; + } + if (!node.getArguments().addChild(this._parseMixinArgument())) { + return this.finish(node, ParseError.ExpressionExpected); + } + } + } + if (!this.accept(TokenType.ParenthesisR)) { + return this.finish(node, ParseError.RightParenthesisExpected); + } + return this.finish(node); + } + _parseFunctionIdentifier() { + if (this.peekDelim("%")) { + const node = this.create(Identifier); + node.referenceTypes = [ReferenceType.Function]; + this.consumeToken(); + return this.finish(node); + } + return super._parseFunctionIdentifier(); + } + _parseURLArgument() { + const pos = this.mark(); + const node = super._parseURLArgument(); + if (!node || !this.peek(TokenType.ParenthesisR)) { + this.restoreAtMark(pos); + const node2 = this.create(Node); + node2.addChild(this._parseBinaryExpr()); + return this.finish(node2); + } + return node; + } +}; + +// node_modules/vscode-css-languageservice/lib/esm/services/lessCompletion.js +var LESSCompletion = class _LESSCompletion extends CSSCompletion { + constructor(lsOptions, cssDataManager) { + super("@", lsOptions, cssDataManager); + } + createFunctionProposals(proposals, existingNode, sortToEnd, result) { + for (const p of proposals) { + const item = { + label: p.name, + detail: p.example, + documentation: p.description, + textEdit: TextEdit.replace(this.getCompletionRange(existingNode), p.name + "($0)"), + insertTextFormat: InsertTextFormat.Snippet, + kind: CompletionItemKind.Function + }; + if (sortToEnd) { + item.sortText = "z"; + } + result.items.push(item); + } + return result; + } + getTermProposals(entry, existingNode, result) { + let functions = _LESSCompletion.builtInProposals; + if (entry) { + functions = functions.filter((f2) => !f2.type || !entry.restrictions || entry.restrictions.indexOf(f2.type) !== -1); + } + this.createFunctionProposals(functions, existingNode, true, result); + return super.getTermProposals(entry, existingNode, result); + } + getColorProposals(entry, existingNode, result) { + this.createFunctionProposals(_LESSCompletion.colorProposals, existingNode, false, result); + return super.getColorProposals(entry, existingNode, result); + } + getCompletionsForDeclarationProperty(declaration, result) { + this.getCompletionsForSelector(null, true, result); + return super.getCompletionsForDeclarationProperty(declaration, result); + } +}; +LESSCompletion.builtInProposals = [ + // Boolean functions + { + "name": "if", + "example": "if(condition, trueValue [, falseValue]);", + "description": t("returns one of two values depending on a condition.") + }, + { + "name": "boolean", + "example": "boolean(condition);", + "description": t('"store" a boolean test for later evaluation in a guard or if().') + }, + // List functions + { + "name": "length", + "example": "length(@list);", + "description": t("returns the number of elements in a value list") + }, + { + "name": "extract", + "example": "extract(@list, index);", + "description": t("returns a value at the specified position in the list") + }, + { + "name": "range", + "example": "range([start, ] end [, step]);", + "description": t("generate a list spanning a range of values") + }, + { + "name": "each", + "example": "each(@list, ruleset);", + "description": t("bind the evaluation of a ruleset to each member of a list.") + }, + // Other built-ins + { + "name": "escape", + "example": "escape(@string);", + "description": t("URL encodes a string") + }, + { + "name": "e", + "example": "e(@string);", + "description": t("escape string content") + }, + { + "name": "replace", + "example": "replace(@string, @pattern, @replacement[, @flags]);", + "description": t("string replace") + }, + { + "name": "unit", + "example": "unit(@dimension, [@unit: '']);", + "description": t("remove or change the unit of a dimension") + }, + { + "name": "color", + "example": "color(@string);", + "description": t("parses a string to a color"), + "type": "color" + }, + { + "name": "convert", + "example": "convert(@value, unit);", + "description": t("converts numbers from one type into another") + }, + { + "name": "data-uri", + "example": "data-uri([mimetype,] url);", + "description": t("inlines a resource and falls back to `url()`"), + "type": "url" + }, + { + "name": "abs", + "description": t("absolute value of a number"), + "example": "abs(number);" + }, + { + "name": "acos", + "description": t("arccosine - inverse of cosine function"), + "example": "acos(number);" + }, + { + "name": "asin", + "description": t("arcsine - inverse of sine function"), + "example": "asin(number);" + }, + { + "name": "ceil", + "example": "ceil(@number);", + "description": t("rounds up to an integer") + }, + { + "name": "cos", + "description": t("cosine function"), + "example": "cos(number);" + }, + { + "name": "floor", + "description": t("rounds down to an integer"), + "example": "floor(@number);" + }, + { + "name": "percentage", + "description": t("converts to a %, e.g. 0.5 > 50%"), + "example": "percentage(@number);", + "type": "percentage" + }, + { + "name": "round", + "description": t("rounds a number to a number of places"), + "example": "round(number, [places: 0]);" + }, + { + "name": "sqrt", + "description": t("calculates square root of a number"), + "example": "sqrt(number);" + }, + { + "name": "sin", + "description": t("sine function"), + "example": "sin(number);" + }, + { + "name": "tan", + "description": t("tangent function"), + "example": "tan(number);" + }, + { + "name": "atan", + "description": t("arctangent - inverse of tangent function"), + "example": "atan(number);" + }, + { + "name": "pi", + "description": t("returns pi"), + "example": "pi();" + }, + { + "name": "pow", + "description": t("first argument raised to the power of the second argument"), + "example": "pow(@base, @exponent);" + }, + { + "name": "mod", + "description": t("first argument modulus second argument"), + "example": "mod(number, number);" + }, + { + "name": "min", + "description": t("returns the lowest of one or more values"), + "example": "min(@x, @y);" + }, + { + "name": "max", + "description": t("returns the lowest of one or more values"), + "example": "max(@x, @y);" + } +]; +LESSCompletion.colorProposals = [ + { + "name": "argb", + "example": "argb(@color);", + "description": t("creates a #AARRGGBB") + }, + { + "name": "hsl", + "example": "hsl(@hue, @saturation, @lightness);", + "description": t("creates a color") + }, + { + "name": "hsla", + "example": "hsla(@hue, @saturation, @lightness, @alpha);", + "description": t("creates a color") + }, + { + "name": "hsv", + "example": "hsv(@hue, @saturation, @value);", + "description": t("creates a color") + }, + { + "name": "hsva", + "example": "hsva(@hue, @saturation, @value, @alpha);", + "description": t("creates a color") + }, + { + "name": "hue", + "example": "hue(@color);", + "description": t("returns the `hue` channel of `@color` in the HSL space") + }, + { + "name": "saturation", + "example": "saturation(@color);", + "description": t("returns the `saturation` channel of `@color` in the HSL space") + }, + { + "name": "lightness", + "example": "lightness(@color);", + "description": t("returns the `lightness` channel of `@color` in the HSL space") + }, + { + "name": "hsvhue", + "example": "hsvhue(@color);", + "description": t("returns the `hue` channel of `@color` in the HSV space") + }, + { + "name": "hsvsaturation", + "example": "hsvsaturation(@color);", + "description": t("returns the `saturation` channel of `@color` in the HSV space") + }, + { + "name": "hsvvalue", + "example": "hsvvalue(@color);", + "description": t("returns the `value` channel of `@color` in the HSV space") + }, + { + "name": "red", + "example": "red(@color);", + "description": t("returns the `red` channel of `@color`") + }, + { + "name": "green", + "example": "green(@color);", + "description": t("returns the `green` channel of `@color`") + }, + { + "name": "blue", + "example": "blue(@color);", + "description": t("returns the `blue` channel of `@color`") + }, + { + "name": "alpha", + "example": "alpha(@color);", + "description": t("returns the `alpha` channel of `@color`") + }, + { + "name": "luma", + "example": "luma(@color);", + "description": t("returns the `luma` value (perceptual brightness) of `@color`") + }, + { + "name": "saturate", + "example": "saturate(@color, 10%);", + "description": t("return `@color` 10% points more saturated") + }, + { + "name": "desaturate", + "example": "desaturate(@color, 10%);", + "description": t("return `@color` 10% points less saturated") + }, + { + "name": "lighten", + "example": "lighten(@color, 10%);", + "description": t("return `@color` 10% points lighter") + }, + { + "name": "darken", + "example": "darken(@color, 10%);", + "description": t("return `@color` 10% points darker") + }, + { + "name": "fadein", + "example": "fadein(@color, 10%);", + "description": t("return `@color` 10% points less transparent") + }, + { + "name": "fadeout", + "example": "fadeout(@color, 10%);", + "description": t("return `@color` 10% points more transparent") + }, + { + "name": "fade", + "example": "fade(@color, 50%);", + "description": t("return `@color` with 50% transparency") + }, + { + "name": "spin", + "example": "spin(@color, 10);", + "description": t("return `@color` with a 10 degree larger in hue") + }, + { + "name": "mix", + "example": "mix(@color1, @color2, [@weight: 50%]);", + "description": t("return a mix of `@color1` and `@color2`") + }, + { + "name": "greyscale", + "example": "greyscale(@color);", + "description": t("returns a grey, 100% desaturated color") + }, + { + "name": "contrast", + "example": "contrast(@color1, [@darkcolor: black], [@lightcolor: white], [@threshold: 43%]);", + "description": t("return `@darkcolor` if `@color1 is> 43% luma` otherwise return `@lightcolor`, see notes") + }, + { + "name": "multiply", + "example": "multiply(@color1, @color2);" + }, + { + "name": "screen", + "example": "screen(@color1, @color2);" + }, + { + "name": "overlay", + "example": "overlay(@color1, @color2);" + }, + { + "name": "softlight", + "example": "softlight(@color1, @color2);" + }, + { + "name": "hardlight", + "example": "hardlight(@color1, @color2);" + }, + { + "name": "difference", + "example": "difference(@color1, @color2);" + }, + { + "name": "exclusion", + "example": "exclusion(@color1, @color2);" + }, + { + "name": "average", + "example": "average(@color1, @color2);" + }, + { + "name": "negation", + "example": "negation(@color1, @color2);" + } +]; + +// node_modules/vscode-css-languageservice/lib/esm/services/cssFolding.js +function getFoldingRanges(document, context) { + const ranges = computeFoldingRanges(document); + return limitFoldingRanges(ranges, context); +} +function computeFoldingRanges(document) { + function getStartLine(t2) { + return document.positionAt(t2.offset).line; + } + function getEndLine(t2) { + return document.positionAt(t2.offset + t2.len).line; + } + function getScanner() { + switch (document.languageId) { + case "scss": + return new SCSSScanner(); + case "less": + return new LESSScanner(); + default: + return new Scanner(); + } + } + function tokenToRange(t2, kind) { + const startLine = getStartLine(t2); + const endLine = getEndLine(t2); + if (startLine !== endLine) { + return { + startLine, + endLine, + kind + }; + } else { + return null; + } + } + const ranges = []; + const delimiterStack = []; + const scanner = getScanner(); + scanner.ignoreComment = false; + scanner.setSource(document.getText()); + let token = scanner.scan(); + let prevToken = null; + while (token.type !== TokenType.EOF) { + switch (token.type) { + case TokenType.CurlyL: + case InterpolationFunction: { + delimiterStack.push({ line: getStartLine(token), type: "brace", isStart: true }); + break; + } + case TokenType.CurlyR: { + if (delimiterStack.length !== 0) { + const prevDelimiter = popPrevStartDelimiterOfType(delimiterStack, "brace"); + if (!prevDelimiter) { + break; + } + let endLine = getEndLine(token); + if (prevDelimiter.type === "brace") { + if (prevToken && getEndLine(prevToken) !== endLine) { + endLine--; + } + if (prevDelimiter.line !== endLine) { + ranges.push({ + startLine: prevDelimiter.line, + endLine, + kind: void 0 + }); + } + } + } + break; + } + /** + * In CSS, there is no single line comment prefixed with // + * All comments are marked as `Comment` + */ + case TokenType.Comment: { + const commentRegionMarkerToDelimiter = (marker) => { + if (marker === "#region") { + return { line: getStartLine(token), type: "comment", isStart: true }; + } else { + return { line: getEndLine(token), type: "comment", isStart: false }; + } + }; + const getCurrDelimiter = (token2) => { + const matches2 = token2.text.match(/^\s*\/\*\s*(#region|#endregion)\b\s*(.*?)\s*\*\//); + if (matches2) { + return commentRegionMarkerToDelimiter(matches2[1]); + } else if (document.languageId === "scss" || document.languageId === "less") { + const matches3 = token2.text.match(/^\s*\/\/\s*(#region|#endregion)\b\s*(.*?)\s*/); + if (matches3) { + return commentRegionMarkerToDelimiter(matches3[1]); + } + } + return null; + }; + const currDelimiter = getCurrDelimiter(token); + if (currDelimiter) { + if (currDelimiter.isStart) { + delimiterStack.push(currDelimiter); + } else { + const prevDelimiter = popPrevStartDelimiterOfType(delimiterStack, "comment"); + if (!prevDelimiter) { + break; + } + if (prevDelimiter.type === "comment") { + if (prevDelimiter.line !== currDelimiter.line) { + ranges.push({ + startLine: prevDelimiter.line, + endLine: currDelimiter.line, + kind: "region" + }); + } + } + } + } else { + const range = tokenToRange(token, "comment"); + if (range) { + ranges.push(range); + } + } + break; + } + } + prevToken = token; + token = scanner.scan(); + } + return ranges; +} +function popPrevStartDelimiterOfType(stack, type) { + if (stack.length === 0) { + return null; + } + for (let i = stack.length - 1; i >= 0; i--) { + if (stack[i].type === type && stack[i].isStart) { + return stack.splice(i, 1)[0]; + } + } + return null; +} +function limitFoldingRanges(ranges, context) { + const maxRanges = context && context.rangeLimit || Number.MAX_VALUE; + const sortedRanges = ranges.sort((r1, r2) => { + let diff = r1.startLine - r2.startLine; + if (diff === 0) { + diff = r1.endLine - r2.endLine; + } + return diff; + }); + const validRanges = []; + let prevEndLine = -1; + sortedRanges.forEach((r) => { + if (!(r.startLine < prevEndLine && prevEndLine < r.endLine)) { + validRanges.push(r); + prevEndLine = r.endLine; + } + }); + if (validRanges.length < maxRanges) { + return validRanges; + } else { + return validRanges.slice(0, maxRanges); + } +} + +// node_modules/vscode-css-languageservice/lib/esm/beautify/beautify-css.js +var legacy_beautify_css; +(function() { + "use strict"; + var __webpack_modules__ = [ + , + , + /* 2 */ + /***/ + (function(module) { + function OutputLine(parent) { + this.__parent = parent; + this.__character_count = 0; + this.__indent_count = -1; + this.__alignment_count = 0; + this.__wrap_point_index = 0; + this.__wrap_point_character_count = 0; + this.__wrap_point_indent_count = -1; + this.__wrap_point_alignment_count = 0; + this.__items = []; + } + OutputLine.prototype.clone_empty = function() { + var line = new OutputLine(this.__parent); + line.set_indent(this.__indent_count, this.__alignment_count); + return line; + }; + OutputLine.prototype.item = function(index) { + if (index < 0) { + return this.__items[this.__items.length + index]; + } else { + return this.__items[index]; + } + }; + OutputLine.prototype.has_match = function(pattern) { + for (var lastCheckedOutput = this.__items.length - 1; lastCheckedOutput >= 0; lastCheckedOutput--) { + if (this.__items[lastCheckedOutput].match(pattern)) { + return true; + } + } + return false; + }; + OutputLine.prototype.set_indent = function(indent, alignment) { + if (this.is_empty()) { + this.__indent_count = indent || 0; + this.__alignment_count = alignment || 0; + this.__character_count = this.__parent.get_indent_size(this.__indent_count, this.__alignment_count); + } + }; + OutputLine.prototype._set_wrap_point = function() { + if (this.__parent.wrap_line_length) { + this.__wrap_point_index = this.__items.length; + this.__wrap_point_character_count = this.__character_count; + this.__wrap_point_indent_count = this.__parent.next_line.__indent_count; + this.__wrap_point_alignment_count = this.__parent.next_line.__alignment_count; + } + }; + OutputLine.prototype._should_wrap = function() { + return this.__wrap_point_index && this.__character_count > this.__parent.wrap_line_length && this.__wrap_point_character_count > this.__parent.next_line.__character_count; + }; + OutputLine.prototype._allow_wrap = function() { + if (this._should_wrap()) { + this.__parent.add_new_line(); + var next = this.__parent.current_line; + next.set_indent(this.__wrap_point_indent_count, this.__wrap_point_alignment_count); + next.__items = this.__items.slice(this.__wrap_point_index); + this.__items = this.__items.slice(0, this.__wrap_point_index); + next.__character_count += this.__character_count - this.__wrap_point_character_count; + this.__character_count = this.__wrap_point_character_count; + if (next.__items[0] === " ") { + next.__items.splice(0, 1); + next.__character_count -= 1; + } + return true; + } + return false; + }; + OutputLine.prototype.is_empty = function() { + return this.__items.length === 0; + }; + OutputLine.prototype.last = function() { + if (!this.is_empty()) { + return this.__items[this.__items.length - 1]; + } else { + return null; + } + }; + OutputLine.prototype.push = function(item) { + this.__items.push(item); + var last_newline_index = item.lastIndexOf("\n"); + if (last_newline_index !== -1) { + this.__character_count = item.length - last_newline_index; + } else { + this.__character_count += item.length; + } + }; + OutputLine.prototype.pop = function() { + var item = null; + if (!this.is_empty()) { + item = this.__items.pop(); + this.__character_count -= item.length; + } + return item; + }; + OutputLine.prototype._remove_indent = function() { + if (this.__indent_count > 0) { + this.__indent_count -= 1; + this.__character_count -= this.__parent.indent_size; + } + }; + OutputLine.prototype._remove_wrap_indent = function() { + if (this.__wrap_point_indent_count > 0) { + this.__wrap_point_indent_count -= 1; + } + }; + OutputLine.prototype.trim = function() { + while (this.last() === " ") { + this.__items.pop(); + this.__character_count -= 1; + } + }; + OutputLine.prototype.toString = function() { + var result = ""; + if (this.is_empty()) { + if (this.__parent.indent_empty_lines) { + result = this.__parent.get_indent_string(this.__indent_count); + } + } else { + result = this.__parent.get_indent_string(this.__indent_count, this.__alignment_count); + result += this.__items.join(""); + } + return result; + }; + function IndentStringCache(options, baseIndentString) { + this.__cache = [""]; + this.__indent_size = options.indent_size; + this.__indent_string = options.indent_char; + if (!options.indent_with_tabs) { + this.__indent_string = new Array(options.indent_size + 1).join(options.indent_char); + } + baseIndentString = baseIndentString || ""; + if (options.indent_level > 0) { + baseIndentString = new Array(options.indent_level + 1).join(this.__indent_string); + } + this.__base_string = baseIndentString; + this.__base_string_length = baseIndentString.length; + } + IndentStringCache.prototype.get_indent_size = function(indent, column) { + var result = this.__base_string_length; + column = column || 0; + if (indent < 0) { + result = 0; + } + result += indent * this.__indent_size; + result += column; + return result; + }; + IndentStringCache.prototype.get_indent_string = function(indent_level, column) { + var result = this.__base_string; + column = column || 0; + if (indent_level < 0) { + indent_level = 0; + result = ""; + } + column += indent_level * this.__indent_size; + this.__ensure_cache(column); + result += this.__cache[column]; + return result; + }; + IndentStringCache.prototype.__ensure_cache = function(column) { + while (column >= this.__cache.length) { + this.__add_column(); + } + }; + IndentStringCache.prototype.__add_column = function() { + var column = this.__cache.length; + var indent = 0; + var result = ""; + if (this.__indent_size && column >= this.__indent_size) { + indent = Math.floor(column / this.__indent_size); + column -= indent * this.__indent_size; + result = new Array(indent + 1).join(this.__indent_string); + } + if (column) { + result += new Array(column + 1).join(" "); + } + this.__cache.push(result); + }; + function Output(options, baseIndentString) { + this.__indent_cache = new IndentStringCache(options, baseIndentString); + this.raw = false; + this._end_with_newline = options.end_with_newline; + this.indent_size = options.indent_size; + this.wrap_line_length = options.wrap_line_length; + this.indent_empty_lines = options.indent_empty_lines; + this.__lines = []; + this.previous_line = null; + this.current_line = null; + this.next_line = new OutputLine(this); + this.space_before_token = false; + this.non_breaking_space = false; + this.previous_token_wrapped = false; + this.__add_outputline(); + } + Output.prototype.__add_outputline = function() { + this.previous_line = this.current_line; + this.current_line = this.next_line.clone_empty(); + this.__lines.push(this.current_line); + }; + Output.prototype.get_line_number = function() { + return this.__lines.length; + }; + Output.prototype.get_indent_string = function(indent, column) { + return this.__indent_cache.get_indent_string(indent, column); + }; + Output.prototype.get_indent_size = function(indent, column) { + return this.__indent_cache.get_indent_size(indent, column); + }; + Output.prototype.is_empty = function() { + return !this.previous_line && this.current_line.is_empty(); + }; + Output.prototype.add_new_line = function(force_newline) { + if (this.is_empty() || !force_newline && this.just_added_newline()) { + return false; + } + if (!this.raw) { + this.__add_outputline(); + } + return true; + }; + Output.prototype.get_code = function(eol) { + this.trim(true); + var last_item = this.current_line.pop(); + if (last_item) { + if (last_item[last_item.length - 1] === "\n") { + last_item = last_item.replace(/\n+$/g, ""); + } + this.current_line.push(last_item); + } + if (this._end_with_newline) { + this.__add_outputline(); + } + var sweet_code = this.__lines.join("\n"); + if (eol !== "\n") { + sweet_code = sweet_code.replace(/[\n]/g, eol); + } + return sweet_code; + }; + Output.prototype.set_wrap_point = function() { + this.current_line._set_wrap_point(); + }; + Output.prototype.set_indent = function(indent, alignment) { + indent = indent || 0; + alignment = alignment || 0; + this.next_line.set_indent(indent, alignment); + if (this.__lines.length > 1) { + this.current_line.set_indent(indent, alignment); + return true; + } + this.current_line.set_indent(); + return false; + }; + Output.prototype.add_raw_token = function(token) { + for (var x = 0; x < token.newlines; x++) { + this.__add_outputline(); + } + this.current_line.set_indent(-1); + this.current_line.push(token.whitespace_before); + this.current_line.push(token.text); + this.space_before_token = false; + this.non_breaking_space = false; + this.previous_token_wrapped = false; + }; + Output.prototype.add_token = function(printable_token) { + this.__add_space_before_token(); + this.current_line.push(printable_token); + this.space_before_token = false; + this.non_breaking_space = false; + this.previous_token_wrapped = this.current_line._allow_wrap(); + }; + Output.prototype.__add_space_before_token = function() { + if (this.space_before_token && !this.just_added_newline()) { + if (!this.non_breaking_space) { + this.set_wrap_point(); + } + this.current_line.push(" "); + } + }; + Output.prototype.remove_indent = function(index) { + var output_length = this.__lines.length; + while (index < output_length) { + this.__lines[index]._remove_indent(); + index++; + } + this.current_line._remove_wrap_indent(); + }; + Output.prototype.trim = function(eat_newlines) { + eat_newlines = eat_newlines === void 0 ? false : eat_newlines; + this.current_line.trim(); + while (eat_newlines && this.__lines.length > 1 && this.current_line.is_empty()) { + this.__lines.pop(); + this.current_line = this.__lines[this.__lines.length - 1]; + this.current_line.trim(); + } + this.previous_line = this.__lines.length > 1 ? this.__lines[this.__lines.length - 2] : null; + }; + Output.prototype.just_added_newline = function() { + return this.current_line.is_empty(); + }; + Output.prototype.just_added_blankline = function() { + return this.is_empty() || this.current_line.is_empty() && this.previous_line.is_empty(); + }; + Output.prototype.ensure_empty_line_above = function(starts_with, ends_with) { + var index = this.__lines.length - 2; + while (index >= 0) { + var potentialEmptyLine = this.__lines[index]; + if (potentialEmptyLine.is_empty()) { + break; + } else if (potentialEmptyLine.item(0).indexOf(starts_with) !== 0 && potentialEmptyLine.item(-1) !== ends_with) { + this.__lines.splice(index + 1, 0, new OutputLine(this)); + this.previous_line = this.__lines[this.__lines.length - 2]; + break; + } + index--; + } + }; + module.exports.Output = Output; + }), + , + , + , + /* 6 */ + /***/ + (function(module) { + function Options(options, merge_child_field) { + this.raw_options = _mergeOpts(options, merge_child_field); + this.disabled = this._get_boolean("disabled"); + this.eol = this._get_characters("eol", "auto"); + this.end_with_newline = this._get_boolean("end_with_newline"); + this.indent_size = this._get_number("indent_size", 4); + this.indent_char = this._get_characters("indent_char", " "); + this.indent_level = this._get_number("indent_level"); + this.preserve_newlines = this._get_boolean("preserve_newlines", true); + this.max_preserve_newlines = this._get_number("max_preserve_newlines", 32786); + if (!this.preserve_newlines) { + this.max_preserve_newlines = 0; + } + this.indent_with_tabs = this._get_boolean("indent_with_tabs", this.indent_char === " "); + if (this.indent_with_tabs) { + this.indent_char = " "; + if (this.indent_size === 1) { + this.indent_size = 4; + } + } + this.wrap_line_length = this._get_number("wrap_line_length", this._get_number("max_char")); + this.indent_empty_lines = this._get_boolean("indent_empty_lines"); + this.templating = this._get_selection_list("templating", ["auto", "none", "angular", "django", "erb", "handlebars", "php", "smarty"], ["auto"]); + } + Options.prototype._get_array = function(name, default_value) { + var option_value = this.raw_options[name]; + var result = default_value || []; + if (typeof option_value === "object") { + if (option_value !== null && typeof option_value.concat === "function") { + result = option_value.concat(); + } + } else if (typeof option_value === "string") { + result = option_value.split(/[^a-zA-Z0-9_\/\-]+/); + } + return result; + }; + Options.prototype._get_boolean = function(name, default_value) { + var option_value = this.raw_options[name]; + var result = option_value === void 0 ? !!default_value : !!option_value; + return result; + }; + Options.prototype._get_characters = function(name, default_value) { + var option_value = this.raw_options[name]; + var result = default_value || ""; + if (typeof option_value === "string") { + result = option_value.replace(/\\r/, "\r").replace(/\\n/, "\n").replace(/\\t/, " "); + } + return result; + }; + Options.prototype._get_number = function(name, default_value) { + var option_value = this.raw_options[name]; + default_value = parseInt(default_value, 10); + if (isNaN(default_value)) { + default_value = 0; + } + var result = parseInt(option_value, 10); + if (isNaN(result)) { + result = default_value; + } + return result; + }; + Options.prototype._get_selection = function(name, selection_list, default_value) { + var result = this._get_selection_list(name, selection_list, default_value); + if (result.length !== 1) { + throw new Error( + "Invalid Option Value: The option '" + name + "' can only be one of the following values:\n" + selection_list + "\nYou passed in: '" + this.raw_options[name] + "'" + ); + } + return result[0]; + }; + Options.prototype._get_selection_list = function(name, selection_list, default_value) { + if (!selection_list || selection_list.length === 0) { + throw new Error("Selection list cannot be empty."); + } + default_value = default_value || [selection_list[0]]; + if (!this._is_valid_selection(default_value, selection_list)) { + throw new Error("Invalid Default Value!"); + } + var result = this._get_array(name, default_value); + if (!this._is_valid_selection(result, selection_list)) { + throw new Error( + "Invalid Option Value: The option '" + name + "' can contain only the following values:\n" + selection_list + "\nYou passed in: '" + this.raw_options[name] + "'" + ); + } + return result; + }; + Options.prototype._is_valid_selection = function(result, selection_list) { + return result.length && selection_list.length && !result.some(function(item) { + return selection_list.indexOf(item) === -1; + }); + }; + function _mergeOpts(allOptions, childFieldName) { + var finalOpts = {}; + allOptions = _normalizeOpts(allOptions); + var name; + for (name in allOptions) { + if (name !== childFieldName) { + finalOpts[name] = allOptions[name]; + } + } + if (childFieldName && allOptions[childFieldName]) { + for (name in allOptions[childFieldName]) { + finalOpts[name] = allOptions[childFieldName][name]; + } + } + return finalOpts; + } + function _normalizeOpts(options) { + var convertedOpts = {}; + var key; + for (key in options) { + var newKey = key.replace(/-/g, "_"); + convertedOpts[newKey] = options[key]; + } + return convertedOpts; + } + module.exports.Options = Options; + module.exports.normalizeOpts = _normalizeOpts; + module.exports.mergeOpts = _mergeOpts; + }), + , + /* 8 */ + /***/ + (function(module) { + var regexp_has_sticky = RegExp.prototype.hasOwnProperty("sticky"); + function InputScanner(input_string) { + this.__input = input_string || ""; + this.__input_length = this.__input.length; + this.__position = 0; + } + InputScanner.prototype.restart = function() { + this.__position = 0; + }; + InputScanner.prototype.back = function() { + if (this.__position > 0) { + this.__position -= 1; + } + }; + InputScanner.prototype.hasNext = function() { + return this.__position < this.__input_length; + }; + InputScanner.prototype.next = function() { + var val = null; + if (this.hasNext()) { + val = this.__input.charAt(this.__position); + this.__position += 1; + } + return val; + }; + InputScanner.prototype.peek = function(index) { + var val = null; + index = index || 0; + index += this.__position; + if (index >= 0 && index < this.__input_length) { + val = this.__input.charAt(index); + } + return val; + }; + InputScanner.prototype.__match = function(pattern, index) { + pattern.lastIndex = index; + var pattern_match = pattern.exec(this.__input); + if (pattern_match && !(regexp_has_sticky && pattern.sticky)) { + if (pattern_match.index !== index) { + pattern_match = null; + } + } + return pattern_match; + }; + InputScanner.prototype.test = function(pattern, index) { + index = index || 0; + index += this.__position; + if (index >= 0 && index < this.__input_length) { + return !!this.__match(pattern, index); + } else { + return false; + } + }; + InputScanner.prototype.testChar = function(pattern, index) { + var val = this.peek(index); + pattern.lastIndex = 0; + return val !== null && pattern.test(val); + }; + InputScanner.prototype.match = function(pattern) { + var pattern_match = this.__match(pattern, this.__position); + if (pattern_match) { + this.__position += pattern_match[0].length; + } else { + pattern_match = null; + } + return pattern_match; + }; + InputScanner.prototype.read = function(starting_pattern, until_pattern, until_after) { + var val = ""; + var match; + if (starting_pattern) { + match = this.match(starting_pattern); + if (match) { + val += match[0]; + } + } + if (until_pattern && (match || !starting_pattern)) { + val += this.readUntil(until_pattern, until_after); + } + return val; + }; + InputScanner.prototype.readUntil = function(pattern, until_after) { + var val = ""; + var match_index = this.__position; + pattern.lastIndex = this.__position; + var pattern_match = pattern.exec(this.__input); + if (pattern_match) { + match_index = pattern_match.index; + if (until_after) { + match_index += pattern_match[0].length; + } + } else { + match_index = this.__input_length; + } + val = this.__input.substring(this.__position, match_index); + this.__position = match_index; + return val; + }; + InputScanner.prototype.readUntilAfter = function(pattern) { + return this.readUntil(pattern, true); + }; + InputScanner.prototype.get_regexp = function(pattern, match_from) { + var result = null; + var flags = "g"; + if (match_from && regexp_has_sticky) { + flags = "y"; + } + if (typeof pattern === "string" && pattern !== "") { + result = new RegExp(pattern, flags); + } else if (pattern) { + result = new RegExp(pattern.source, flags); + } + return result; + }; + InputScanner.prototype.get_literal_regexp = function(literal_string) { + return RegExp(literal_string.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&")); + }; + InputScanner.prototype.peekUntilAfter = function(pattern) { + var start = this.__position; + var val = this.readUntilAfter(pattern); + this.__position = start; + return val; + }; + InputScanner.prototype.lookBack = function(testVal) { + var start = this.__position - 1; + return start >= testVal.length && this.__input.substring(start - testVal.length, start).toLowerCase() === testVal; + }; + module.exports.InputScanner = InputScanner; + }), + , + , + , + , + /* 13 */ + /***/ + (function(module) { + function Directives(start_block_pattern, end_block_pattern) { + start_block_pattern = typeof start_block_pattern === "string" ? start_block_pattern : start_block_pattern.source; + end_block_pattern = typeof end_block_pattern === "string" ? end_block_pattern : end_block_pattern.source; + this.__directives_block_pattern = new RegExp(start_block_pattern + / beautify( \w+[:]\w+)+ /.source + end_block_pattern, "g"); + this.__directive_pattern = / (\w+)[:](\w+)/g; + this.__directives_end_ignore_pattern = new RegExp(start_block_pattern + /\sbeautify\signore:end\s/.source + end_block_pattern, "g"); + } + Directives.prototype.get_directives = function(text) { + if (!text.match(this.__directives_block_pattern)) { + return null; + } + var directives = {}; + this.__directive_pattern.lastIndex = 0; + var directive_match = this.__directive_pattern.exec(text); + while (directive_match) { + directives[directive_match[1]] = directive_match[2]; + directive_match = this.__directive_pattern.exec(text); + } + return directives; + }; + Directives.prototype.readIgnored = function(input) { + return input.readUntilAfter(this.__directives_end_ignore_pattern); + }; + module.exports.Directives = Directives; + }), + , + /* 15 */ + /***/ + (function(module, __unused_webpack_exports, __webpack_require__2) { + var Beautifier = __webpack_require__2(16).Beautifier, Options = __webpack_require__2(17).Options; + function css_beautify2(source_text, options) { + var beautifier = new Beautifier(source_text, options); + return beautifier.beautify(); + } + module.exports = css_beautify2; + module.exports.defaultOptions = function() { + return new Options(); + }; + }), + /* 16 */ + /***/ + (function(module, __unused_webpack_exports, __webpack_require__2) { + var Options = __webpack_require__2(17).Options; + var Output = __webpack_require__2(2).Output; + var InputScanner = __webpack_require__2(8).InputScanner; + var Directives = __webpack_require__2(13).Directives; + var directives_core = new Directives(/\/\*/, /\*\//); + var lineBreak = /\r\n|[\r\n]/; + var allLineBreaks = /\r\n|[\r\n]/g; + var whitespaceChar = /\s/; + var whitespacePattern = /(?:\s|\n)+/g; + var block_comment_pattern = /\/\*(?:[\s\S]*?)((?:\*\/)|$)/g; + var comment_pattern = /\/\/(?:[^\n\r\u2028\u2029]*)/g; + function Beautifier(source_text, options) { + this._source_text = source_text || ""; + this._options = new Options(options); + this._ch = null; + this._input = null; + this.NESTED_AT_RULE = { + "page": true, + "font-face": true, + "keyframes": true, + // also in CONDITIONAL_GROUP_RULE below + "media": true, + "supports": true, + "document": true + }; + this.CONDITIONAL_GROUP_RULE = { + "media": true, + "supports": true, + "document": true + }; + this.NON_SEMICOLON_NEWLINE_PROPERTY = [ + "grid-template-areas", + "grid-template" + ]; + } + Beautifier.prototype.eatString = function(endChars) { + var result = ""; + this._ch = this._input.next(); + while (this._ch) { + result += this._ch; + if (this._ch === "\\") { + result += this._input.next(); + } else if (endChars.indexOf(this._ch) !== -1 || this._ch === "\n") { + break; + } + this._ch = this._input.next(); + } + return result; + }; + Beautifier.prototype.eatWhitespace = function(allowAtLeastOneNewLine) { + var result = whitespaceChar.test(this._input.peek()); + var newline_count = 0; + while (whitespaceChar.test(this._input.peek())) { + this._ch = this._input.next(); + if (allowAtLeastOneNewLine && this._ch === "\n") { + if (newline_count === 0 || newline_count < this._options.max_preserve_newlines) { + newline_count++; + this._output.add_new_line(true); + } + } + } + return result; + }; + Beautifier.prototype.foundNestedPseudoClass = function() { + var openParen = 0; + var i = 1; + var ch = this._input.peek(i); + while (ch) { + if (ch === "{") { + return true; + } else if (ch === "(") { + openParen += 1; + } else if (ch === ")") { + if (openParen === 0) { + return false; + } + openParen -= 1; + } else if (ch === ";" || ch === "}") { + return false; + } + i++; + ch = this._input.peek(i); + } + return false; + }; + Beautifier.prototype.print_string = function(output_string) { + this._output.set_indent(this._indentLevel); + this._output.non_breaking_space = true; + this._output.add_token(output_string); + }; + Beautifier.prototype.preserveSingleSpace = function(isAfterSpace) { + if (isAfterSpace) { + this._output.space_before_token = true; + } + }; + Beautifier.prototype.indent = function() { + this._indentLevel++; + }; + Beautifier.prototype.outdent = function() { + if (this._indentLevel > 0) { + this._indentLevel--; + } + }; + Beautifier.prototype.beautify = function() { + if (this._options.disabled) { + return this._source_text; + } + var source_text = this._source_text; + var eol = this._options.eol; + if (eol === "auto") { + eol = "\n"; + if (source_text && lineBreak.test(source_text || "")) { + eol = source_text.match(lineBreak)[0]; + } + } + source_text = source_text.replace(allLineBreaks, "\n"); + var baseIndentString = source_text.match(/^[\t ]*/)[0]; + this._output = new Output(this._options, baseIndentString); + this._input = new InputScanner(source_text); + this._indentLevel = 0; + this._nestedLevel = 0; + this._ch = null; + var parenLevel = 0; + var insideRule = false; + var insidePropertyValue = false; + var enteringConditionalGroup = false; + var insideNonNestedAtRule = false; + var insideScssMap = false; + var topCharacter = this._ch; + var insideNonSemiColonValues = false; + var whitespace; + var isAfterSpace; + var previous_ch; + while (true) { + whitespace = this._input.read(whitespacePattern); + isAfterSpace = whitespace !== ""; + previous_ch = topCharacter; + this._ch = this._input.next(); + if (this._ch === "\\" && this._input.hasNext()) { + this._ch += this._input.next(); + } + topCharacter = this._ch; + if (!this._ch) { + break; + } else if (this._ch === "/" && this._input.peek() === "*") { + this._output.add_new_line(); + this._input.back(); + var comment = this._input.read(block_comment_pattern); + var directives = directives_core.get_directives(comment); + if (directives && directives.ignore === "start") { + comment += directives_core.readIgnored(this._input); + } + this.print_string(comment); + this.eatWhitespace(true); + this._output.add_new_line(); + } else if (this._ch === "/" && this._input.peek() === "/") { + this._output.space_before_token = true; + this._input.back(); + this.print_string(this._input.read(comment_pattern)); + this.eatWhitespace(true); + } else if (this._ch === "$") { + this.preserveSingleSpace(isAfterSpace); + this.print_string(this._ch); + var variable = this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g); + if (variable.match(/[ :]$/)) { + variable = this.eatString(": ").replace(/\s+$/, ""); + this.print_string(variable); + this._output.space_before_token = true; + } + if (parenLevel === 0 && variable.indexOf(":") !== -1) { + insidePropertyValue = true; + this.indent(); + } + } else if (this._ch === "@") { + this.preserveSingleSpace(isAfterSpace); + if (this._input.peek() === "{") { + this.print_string(this._ch + this.eatString("}")); + } else { + this.print_string(this._ch); + var variableOrRule = this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g); + if (variableOrRule.match(/[ :]$/)) { + variableOrRule = this.eatString(": ").replace(/\s+$/, ""); + this.print_string(variableOrRule); + this._output.space_before_token = true; + } + if (parenLevel === 0 && variableOrRule.indexOf(":") !== -1) { + insidePropertyValue = true; + this.indent(); + } else if (variableOrRule in this.NESTED_AT_RULE) { + this._nestedLevel += 1; + if (variableOrRule in this.CONDITIONAL_GROUP_RULE) { + enteringConditionalGroup = true; + } + } else if (parenLevel === 0 && !insidePropertyValue) { + insideNonNestedAtRule = true; + } + } + } else if (this._ch === "#" && this._input.peek() === "{") { + this.preserveSingleSpace(isAfterSpace); + this.print_string(this._ch + this.eatString("}")); + } else if (this._ch === "{") { + if (insidePropertyValue) { + insidePropertyValue = false; + this.outdent(); + } + insideNonNestedAtRule = false; + if (enteringConditionalGroup) { + enteringConditionalGroup = false; + insideRule = this._indentLevel >= this._nestedLevel; + } else { + insideRule = this._indentLevel >= this._nestedLevel - 1; + } + if (this._options.newline_between_rules && insideRule) { + if (this._output.previous_line && this._output.previous_line.item(-1) !== "{") { + this._output.ensure_empty_line_above("/", ","); + } + } + this._output.space_before_token = true; + if (this._options.brace_style === "expand") { + this._output.add_new_line(); + this.print_string(this._ch); + this.indent(); + this._output.set_indent(this._indentLevel); + } else { + if (previous_ch === "(") { + this._output.space_before_token = false; + } else if (previous_ch !== ",") { + this.indent(); + } + this.print_string(this._ch); + } + this.eatWhitespace(true); + this._output.add_new_line(); + } else if (this._ch === "}") { + this.outdent(); + this._output.add_new_line(); + if (previous_ch === "{") { + this._output.trim(true); + } + if (insidePropertyValue) { + this.outdent(); + insidePropertyValue = false; + } + this.print_string(this._ch); + insideRule = false; + if (this._nestedLevel) { + this._nestedLevel--; + } + this.eatWhitespace(true); + this._output.add_new_line(); + if (this._options.newline_between_rules && !this._output.just_added_blankline()) { + if (this._input.peek() !== "}") { + this._output.add_new_line(true); + } + } + if (this._input.peek() === ")") { + this._output.trim(true); + if (this._options.brace_style === "expand") { + this._output.add_new_line(true); + } + } + } else if (this._ch === ":") { + for (var i = 0; i < this.NON_SEMICOLON_NEWLINE_PROPERTY.length; i++) { + if (this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[i])) { + insideNonSemiColonValues = true; + break; + } + } + if ((insideRule || enteringConditionalGroup) && !(this._input.lookBack("&") || this.foundNestedPseudoClass()) && !this._input.lookBack("(") && !insideNonNestedAtRule && parenLevel === 0) { + this.print_string(":"); + if (!insidePropertyValue) { + insidePropertyValue = true; + this._output.space_before_token = true; + this.eatWhitespace(true); + this.indent(); + } + } else { + if (this._input.lookBack(" ")) { + this._output.space_before_token = true; + } + if (this._input.peek() === ":") { + this._ch = this._input.next(); + this.print_string("::"); + } else { + this.print_string(":"); + } + } + } else if (this._ch === '"' || this._ch === "'") { + var preserveQuoteSpace = previous_ch === '"' || previous_ch === "'"; + this.preserveSingleSpace(preserveQuoteSpace || isAfterSpace); + this.print_string(this._ch + this.eatString(this._ch)); + this.eatWhitespace(true); + } else if (this._ch === ";") { + insideNonSemiColonValues = false; + if (parenLevel === 0) { + if (insidePropertyValue) { + this.outdent(); + insidePropertyValue = false; + } + insideNonNestedAtRule = false; + this.print_string(this._ch); + this.eatWhitespace(true); + if (this._input.peek() !== "/") { + this._output.add_new_line(); + } + } else { + this.print_string(this._ch); + this.eatWhitespace(true); + this._output.space_before_token = true; + } + } else if (this._ch === "(") { + if (this._input.lookBack("url")) { + this.print_string(this._ch); + this.eatWhitespace(); + parenLevel++; + this.indent(); + this._ch = this._input.next(); + if (this._ch === ")" || this._ch === '"' || this._ch === "'") { + this._input.back(); + } else if (this._ch) { + this.print_string(this._ch + this.eatString(")")); + if (parenLevel) { + parenLevel--; + this.outdent(); + } + } + } else { + var space_needed = false; + if (this._input.lookBack("with")) { + space_needed = true; + } + this.preserveSingleSpace(isAfterSpace || space_needed); + this.print_string(this._ch); + if (insidePropertyValue && previous_ch === "$" && this._options.selector_separator_newline) { + this._output.add_new_line(); + insideScssMap = true; + } else { + this.eatWhitespace(); + parenLevel++; + this.indent(); + } + } + } else if (this._ch === ")") { + if (parenLevel) { + parenLevel--; + this.outdent(); + } + if (insideScssMap && this._input.peek() === ";" && this._options.selector_separator_newline) { + insideScssMap = false; + this.outdent(); + this._output.add_new_line(); + } + this.print_string(this._ch); + } else if (this._ch === ",") { + this.print_string(this._ch); + this.eatWhitespace(true); + if (this._options.selector_separator_newline && (!insidePropertyValue || insideScssMap) && parenLevel === 0 && !insideNonNestedAtRule) { + this._output.add_new_line(); + } else { + this._output.space_before_token = true; + } + } else if ((this._ch === ">" || this._ch === "+" || this._ch === "~") && !insidePropertyValue && parenLevel === 0) { + if (this._options.space_around_combinator) { + this._output.space_before_token = true; + this.print_string(this._ch); + this._output.space_before_token = true; + } else { + this.print_string(this._ch); + this.eatWhitespace(); + if (this._ch && whitespaceChar.test(this._ch)) { + this._ch = ""; + } + } + } else if (this._ch === "]") { + this.print_string(this._ch); + } else if (this._ch === "[") { + this.preserveSingleSpace(isAfterSpace); + this.print_string(this._ch); + } else if (this._ch === "=") { + this.eatWhitespace(); + this.print_string("="); + if (whitespaceChar.test(this._ch)) { + this._ch = ""; + } + } else if (this._ch === "!" && !this._input.lookBack("\\")) { + this._output.space_before_token = true; + this.print_string(this._ch); + } else { + var preserveAfterSpace = previous_ch === '"' || previous_ch === "'"; + this.preserveSingleSpace(preserveAfterSpace || isAfterSpace); + this.print_string(this._ch); + if (!this._output.just_added_newline() && this._input.peek() === "\n" && insideNonSemiColonValues) { + this._output.add_new_line(); + } + } + } + var sweetCode = this._output.get_code(eol); + return sweetCode; + }; + module.exports.Beautifier = Beautifier; + }), + /* 17 */ + /***/ + (function(module, __unused_webpack_exports, __webpack_require__2) { + var BaseOptions = __webpack_require__2(6).Options; + function Options(options) { + BaseOptions.call(this, options, "css"); + this.selector_separator_newline = this._get_boolean("selector_separator_newline", true); + this.newline_between_rules = this._get_boolean("newline_between_rules", true); + var space_around_selector_separator = this._get_boolean("space_around_selector_separator"); + this.space_around_combinator = this._get_boolean("space_around_combinator") || space_around_selector_separator; + var brace_style_split = this._get_selection_list("brace_style", ["collapse", "expand", "end-expand", "none", "preserve-inline"]); + this.brace_style = "collapse"; + for (var bs = 0; bs < brace_style_split.length; bs++) { + if (brace_style_split[bs] !== "expand") { + this.brace_style = "collapse"; + } else { + this.brace_style = brace_style_split[bs]; + } + } + } + Options.prototype = new BaseOptions(); + module.exports.Options = Options; + }) + /******/ + ]; + var __webpack_module_cache__ = {}; + function __webpack_require__(moduleId) { + var cachedModule = __webpack_module_cache__[moduleId]; + if (cachedModule !== void 0) { + return cachedModule.exports; + } + var module = __webpack_module_cache__[moduleId] = { + /******/ + // no module.id needed + /******/ + // no module.loaded needed + /******/ + exports: {} + /******/ + }; + __webpack_modules__[moduleId](module, module.exports, __webpack_require__); + return module.exports; + } + var __webpack_exports__ = __webpack_require__(15); + legacy_beautify_css = __webpack_exports__; +})(); +var css_beautify = legacy_beautify_css; + +// node_modules/vscode-css-languageservice/lib/esm/services/cssFormatter.js +function format2(document, range, options) { + let value = document.getText(); + let includesEnd = true; + let initialIndentLevel = 0; + let inRule = false; + const tabSize = options.tabSize || 4; + if (range) { + let startOffset = document.offsetAt(range.start); + let extendedStart = startOffset; + while (extendedStart > 0 && isWhitespace(value, extendedStart - 1)) { + extendedStart--; + } + if (extendedStart === 0 || isEOL2(value, extendedStart - 1)) { + startOffset = extendedStart; + } else { + if (extendedStart < startOffset) { + startOffset = extendedStart + 1; + } + } + let endOffset = document.offsetAt(range.end); + let extendedEnd = endOffset; + while (extendedEnd < value.length && isWhitespace(value, extendedEnd)) { + extendedEnd++; + } + if (extendedEnd === value.length || isEOL2(value, extendedEnd)) { + endOffset = extendedEnd; + } + range = Range.create(document.positionAt(startOffset), document.positionAt(endOffset)); + inRule = isInRule(value, startOffset); + includesEnd = endOffset === value.length; + value = value.substring(startOffset, endOffset); + if (startOffset !== 0) { + const startOfLineOffset = document.offsetAt(Position.create(range.start.line, 0)); + initialIndentLevel = computeIndentLevel(document.getText(), startOfLineOffset, options); + } + if (inRule) { + value = `{ +${trimLeft(value)}`; + } + } else { + range = Range.create(Position.create(0, 0), document.positionAt(value.length)); + } + const cssOptions = { + indent_size: tabSize, + indent_char: options.insertSpaces ? " " : " ", + end_with_newline: includesEnd && getFormatOption(options, "insertFinalNewline", false), + selector_separator_newline: getFormatOption(options, "newlineBetweenSelectors", true), + newline_between_rules: getFormatOption(options, "newlineBetweenRules", true), + space_around_selector_separator: getFormatOption(options, "spaceAroundSelectorSeparator", false), + brace_style: getFormatOption(options, "braceStyle", "collapse"), + indent_empty_lines: getFormatOption(options, "indentEmptyLines", false), + max_preserve_newlines: getFormatOption(options, "maxPreserveNewLines", void 0), + preserve_newlines: getFormatOption(options, "preserveNewLines", true), + wrap_line_length: getFormatOption(options, "wrapLineLength", void 0), + eol: "\n" + }; + let result = css_beautify(value, cssOptions); + if (inRule) { + result = trimLeft(result.substring(2)); + } + if (initialIndentLevel > 0) { + const indent = options.insertSpaces ? repeat(" ", tabSize * initialIndentLevel) : repeat(" ", initialIndentLevel); + result = result.split("\n").join("\n" + indent); + if (range.start.character === 0) { + result = indent + result; + } + } + return [{ + range, + newText: result + }]; +} +function trimLeft(str) { + return str.replace(/^\s+/, ""); +} +var _CUL3 = "{".charCodeAt(0); +var _CUR2 = "}".charCodeAt(0); +function isInRule(str, offset) { + while (offset >= 0) { + const ch = str.charCodeAt(offset); + if (ch === _CUL3) { + return true; + } else if (ch === _CUR2) { + return false; + } + offset--; + } + return false; +} +function getFormatOption(options, key, dflt) { + if (options && options.hasOwnProperty(key)) { + const value = options[key]; + if (value !== null) { + return value; + } + } + return dflt; +} +function computeIndentLevel(content, offset, options) { + let i = offset; + let nChars = 0; + const tabSize = options.tabSize || 4; + while (i < content.length) { + const ch = content.charAt(i); + if (ch === " ") { + nChars++; + } else if (ch === " ") { + nChars += tabSize; + } else { + break; + } + i++; + } + return Math.floor(nChars / tabSize); +} +function isEOL2(text, offset) { + return "\r\n".indexOf(text.charAt(offset)) !== -1; +} +function isWhitespace(text, offset) { + return " ".indexOf(text.charAt(offset)) !== -1; +} + +// node_modules/vscode-css-languageservice/lib/esm/data/webCustomData.js +var cssData = { + "version": 1.1, + "properties": [ + { + "name": "additive-symbols", + "browsers": [ + "FF33" + ], + "atRule": "@counter-style", + "syntax": "[ && ]#", + "relevance": 50, + "description": "@counter-style descriptor. Specifies the symbols used by the marker-construction algorithm specified by the system descriptor. Needs to be specified if the counter system is 'additive'.", + "restrictions": [ + "integer", + "string", + "image", + "identifier" + ] + }, + { + "name": "align-content", + "browsers": [ + "E12", + "FF28", + "FFA28", + "S9", + "SM9", + "C29", + "CA29", + "IE11", + "O16" + ], + "values": [ + { + "name": "center", + "description": "Lines are packed toward the center of the flex container." + }, + { + "name": "flex-end", + "description": "Lines are packed toward the end of the flex container." + }, + { + "name": "flex-start", + "description": "Lines are packed toward the start of the flex container." + }, + { + "name": "space-around", + "description": "Lines are evenly distributed in the flex container, with half-size spaces on either end." + }, + { + "name": "space-between", + "description": "Lines are evenly distributed in the flex container." + }, + { + "name": "stretch", + "description": "Lines stretch to take up the remaining space." + }, + { + "name": "start" + }, + { + "name": "end" + }, + { + "name": "normal", + "browsers": [ + "E12", + "FF28", + "FFA28", + "S9", + "SM9", + "C29", + "CA29", + "IE11", + "O16" + ], + "baseline": { + "status": "high", + "baseline_low_date": "2015-09-30", + "baseline_high_date": "2018-03-30" + } + }, + { + "name": "baseline" + }, + { + "name": "first baseline" + }, + { + "name": "last baseline" + }, + { + "name": "space-around" + }, + { + "name": "space-between" + }, + { + "name": "space-evenly" + }, + { + "name": "stretch" + }, + { + "name": "safe" + }, + { + "name": "unsafe" + } + ], + "syntax": "normal | | | ? ", + "relevance": 68, + "references": [ + { + "name": "MDN Reference", + "url": "https://developer.mozilla.org/docs/Web/CSS/Reference/Properties/align-content" + } + ], + "baseline": { + "status": "high", + "baseline_low_date": "2015-09-30", + "baseline_high_date": "2018-03-30" + }, + "description": "Aligns a flex container's lines within the flex container when there is extra space in the cross-axis, similar to how 'justify-content' aligns individual items within the main-axis.", + "restrictions": [ + "enum" + ] + }, + { + "name": "align-items", + "browsers": [ + "E12", + "FF20", + "FFA20", + "S9", + "SM9", + "C29", + "CA29", + "IE11", + "O16" + ], + "values": [ + { + "name": "baseline", + "description": "If the flex item's inline axis is the same as the cross axis, this value is identical to 'flex-start'. Otherwise, it participates in baseline alignment." + }, + { + "name": "center", + "description": "The flex item's margin box is centered in the cross axis within the line." + }, + { + "name": "flex-end", + "description": "The cross-end margin edge of the flex item is placed flush with the cross-end edge of the line." + }, + { + "name": "flex-start", + "description": "The cross-start margin edge of the flex item is placed flush with the cross-start edge of the line." + }, + { + "name": "stretch", + "description": "If the cross size property of the flex item computes to auto, and neither of the cross-axis margins are auto, the flex item is stretched." + }, + { + "name": "normal" + }, + { + "name": "start" + }, + { + "name": "end" + }, + { + "name": "self-start" + }, + { + "name": "self-end" + }, + { + "name": "first baseline" + }, + { + "name": "last baseline" + }, + { + "name": "stretch" + }, + { + "name": "safe" + }, + { + "name": "unsafe" + } + ], + "syntax": "normal | stretch | | [ ? ] | anchor-center", + "relevance": 90, + "references": [ + { + "name": "MDN Reference", + "url": "https://developer.mozilla.org/docs/Web/CSS/Reference/Properties/align-items" + } + ], + "baseline": { + "status": "high", + "baseline_low_date": "2015-09-30", + "baseline_high_date": "2018-03-30" + }, + "description": "Aligns flex items along the cross axis of the current line of the flex container.", + "restrictions": [ + "enum" + ] + }, + { + "name": "justify-items", + "browsers": [ + "E12", + "FF20", + "FFA20", + "S9", + "SM9", + "C52", + "CA52", + "IE11", + "O12.1" + ], + "values": [ + { + "name": "auto" + }, + { + "name": "normal" + }, + { + "name": "end" + }, + { + "name": "start" + }, + { + "name": "flex-end", + "description": '"Flex items are packed toward the end of the line."' + }, + { + "name": "flex-start", + "description": '"Flex items are packed toward the start of the line."' + }, + { + "name": "self-end", + "description": "The item is packed flush to the edge of the alignment container of the end side of the item, in the appropriate axis." + }, + { + "name": "self-start", + "description": "The item is packed flush to the edge of the alignment container of the start side of the item, in the appropriate axis.." + }, + { + "name": "center", + "browsers": [ + "E79", + "FF20", + "FFA20", + "S9", + "SM9", + "C52", + "CA52", + "O39" + ], + "baseline": { + "status": "high", + "baseline_low_date": "2020-01-15", + "baseline_high_date": "2022-07-15" + }, + "description": "The items are packed flush to each other toward the center of the of the alignment container." + }, + { + "name": "left", + "browsers": [ + "E79", + "FF20", + "FFA20", + "S9", + "SM9", + "C52", + "CA52", + "O39" + ], + "baseline": { + "status": "high", + "baseline_low_date": "2020-01-15", + "baseline_high_date": "2022-07-15" + } + }, + { + "name": "right", + "browsers": [ + "E79", + "FF20", + "FFA20", + "S9", + "SM9", + "C52", + "CA52", + "O39" + ], + "baseline": { + "status": "high", + "baseline_low_date": "2020-01-15", + "baseline_high_date": "2022-07-15" + } + }, + { + "name": "baseline" + }, + { + "name": "first baseline" + }, + { + "name": "last baseline" + }, + { + "name": "stretch", + "description": "If the cross size property of the flex item computes to auto, and neither of the cross-axis margins are auto, the flex item is stretched." + }, + { + "name": "safe" + }, + { + "name": "unsafe" + }, + { + "name": "legacy", + "browsers": [ + "E79", + "FF20", + "FFA20", + "S9", + "SM9", + "C52", + "CA52", + "O39" + ], + "baseline": { + "status": "high", + "baseline_low_date": "2020-01-15", + "baseline_high_date": "2022-07-15" + } + } + ], + "syntax": "normal | stretch | | ? [ | left | right ] | legacy | legacy && [ left | right | center ] | anchor-center", + "relevance": 58, + "references": [ + { + "name": "MDN Reference", + "url": "https://developer.mozilla.org/docs/Web/CSS/Reference/Properties/justify-items" + } + ], + "baseline": { + "status": "high", + "baseline_low_date": "2016-07-27", + "baseline_high_date": "2019-01-27" + }, + "description": "Defines the default justify-self for all items of the box, giving them the default way of justifying each box along the appropriate axis", + "restrictions": [ + "enum" + ] + }, + { + "name": "justify-self", + "browsers": [ + "E16", + "FF45", + "FFA45", + "S10.1", + "SM10.3", + "C57", + "CA57", + "IE10", + "O44" + ], + "values": [ + { + "name": "auto", + "browsers": [ + "E79", + "FF45", + "FFA45", + "S10.1", + "SM10.3", + "C57", + "CA57", + "O44" + ], + "baseline": { + "status": "high", + "baseline_low_date": "2020-01-15", + "baseline_high_date": "2022-07-15" + } + }, + { + "name": "normal", + "browsers": [ + "E79", + "FF45", + "FFA45", + "S10.1", + "SM10.3", + "C57", + "CA57", + "O44" + ], + "baseline": { + "status": "high", + "baseline_low_date": "2020-01-15", + "baseline_high_date": "2022-07-15" + } + }, + { + "name": "end" + }, + { + "name": "start" + }, + { + "name": "flex-end", + "description": '"Flex items are packed toward the end of the line."' + }, + { + "name": "flex-start", + "description": '"Flex items are packed toward the start of the line."' + }, + { + "name": "self-end", + "description": "The item is packed flush to the edge of the alignment container of the end side of the item, in the appropriate axis." + }, + { + "name": "self-start", + "description": "The item is packed flush to the edge of the alignment container of the start side of the item, in the appropriate axis.." + }, + { + "name": "center", + "description": "The items are packed flush to each other toward the center of the of the alignment container." + }, + { + "name": "left", + "browsers": [ + "E79", + "FF45", + "FFA45", + "S10.1", + "SM10.3", + "C57", + "CA57", + "O44" + ], + "baseline": { + "status": "high", + "baseline_low_date": "2020-01-15", + "baseline_high_date": "2022-07-15" + } + }, + { + "name": "right", + "browsers": [ + "E79", + "FF45", + "FFA45", + "S10.1", + "SM10.3", + "C57", + "CA57", + "O44" + ], + "baseline": { + "status": "high", + "baseline_low_date": "2020-01-15", + "baseline_high_date": "2022-07-15" + } + }, + { + "name": "baseline" + }, + { + "name": "first baseline" + }, + { + "name": "last baseline" + }, + { + "name": "stretch", + "browsers": [ + "E79", + "FF45", + "FFA45", + "S10.1", + "SM10.3", + "C57", + "CA57", + "O44" + ], + "baseline": { + "status": "high", + "baseline_low_date": "2020-01-15", + "baseline_high_date": "2022-07-15" + }, + "description": "If the cross size property of the flex item computes to auto, and neither of the cross-axis margins are auto, the flex item is stretched." + }, + { + "name": "save" + }, + { + "name": "unsave" + } + ], + "syntax": "auto | normal | stretch | | ? [ | left | right ] | anchor-center", + "relevance": 59, + "references": [ + { + "name": "MDN Reference", + "url": "https://developer.mozilla.org/docs/Web/CSS/Reference/Properties/justify-self" + } + ], + "baseline": { + "status": "high", + "baseline_low_date": "2017-10-17", + "baseline_high_date": "2020-04-17" + }, + "description": "Defines the way of justifying a box inside its container along the appropriate axis.", + "restrictions": [ + "enum" + ] + }, + { + "name": "align-self", + "browsers": [ + "E12", + "FF20", + "FFA20", + "S9", + "SM9", + "C29", + "CA29", + "IE10", + "O12.1" + ], + "values": [ + { + "name": "auto", + "browsers": [ + "E79", + "FF28", + "FFA28", + "S7", + "SM7", + "C21", + "CA25", + "O15" + ], + "baseline": { + "status": "high", + "baseline_low_date": "2020-01-15", + "baseline_high_date": "2022-07-15" + }, + "description": "Computes to the value of 'align-items' on the element's parent, or 'stretch' if the element has no parent. On absolutely positioned elements, it computes to itself." + }, + { + "name": "normal", + "browsers": [ + "E79", + "FF28", + "FFA28", + "S7", + "SM7", + "C21", + "CA25", + "O15" + ], + "baseline": { + "status": "high", + "baseline_low_date": "2020-01-15", + "baseline_high_date": "2022-07-15" + } + }, + { + "name": "self-end" + }, + { + "name": "self-start" + }, + { + "name": "baseline", + "description": "If the flex item's inline axis is the same as the cross axis, this value is identical to 'flex-start'. Otherwise, it participates in baseline alignment." + }, + { + "name": "center", + "description": "The flex item's margin box is centered in the cross axis within the line." + }, + { + "name": "flex-end", + "description": "The cross-end margin edge of the flex item is placed flush with the cross-end edge of the line." + }, + { + "name": "flex-start", + "description": "The cross-start margin edge of the flex item is placed flush with the cross-start edge of the line." + }, + { + "name": "stretch", + "browsers": [ + "E79", + "FF28", + "FFA28", + "S7", + "SM7", + "C21", + "CA25", + "O15" + ], + "baseline": { + "status": "high", + "baseline_low_date": "2020-01-15", + "baseline_high_date": "2022-07-15" + }, + "description": "If the cross size property of the flex item computes to auto, and neither of the cross-axis margins are auto, the flex item is stretched." + }, + { + "name": "baseline" + }, + { + "name": "first baseline" + }, + { + "name": "last baseline" + }, + { + "name": "safe" + }, + { + "name": "unsafe" + } + ], + "syntax": "auto | normal | stretch | | ? | anchor-center", + "relevance": 76, + "references": [ + { + "name": "MDN Reference", + "url": "https://developer.mozilla.org/docs/Web/CSS/Reference/Properties/align-self" + } + ], + "baseline": { + "status": "high", + "baseline_low_date": "2015-09-30", + "baseline_high_date": "2018-03-30" + }, + "description": "Allows the default alignment along the cross axis to be overridden for individual flex items.", + "restrictions": [ + "enum" + ] + }, + { + "name": "all", + "browsers": [ + "E79", + "FF27", + "FFA27", + "S9.1", + "SM9.3", + "C37", + "CA37", + "O24" + ], + "values": [], + "syntax": "initial | inherit | unset | revert | revert-layer", + "relevance": 56, + "references": [ + { + "name": "MDN Reference", + "url": "https://developer.mozilla.org/docs/Web/CSS/Reference/Properties/all" + } + ], + "baseline": { + "status": "high", + "baseline_low_date": "2020-01-15", + "baseline_high_date": "2022-07-15" + }, + "description": "Shorthand that resets all properties except 'direction' and 'unicode-bidi'.", + "restrictions": [ + "enum" + ] + }, + { + "name": "alt", + "values": [], + "relevance": 50, + "baseline": { + "status": "false" + }, + "description": "Provides alternative text for assistive technology to replace the generated content of a ::before or ::after element.", + "restrictions": [ + "string", + "enum" + ] + }, + { + "name": "animation", + "browsers": [ + "E12", + "FF16", + "FFA16", + "S9", + "SM9", + "C43", + "CA43", + "IE10", + "O30" + ], + "values": [ + { + "name": "alternate", + "browsers": [ + "E12", + "FF5", + "FFA5", + "S4", + "SM3.2", + "C3", + "CA18", + "O15" + ], + "baseline": { + "status": "high", + "baseline_low_date": "2015-07-29", + "baseline_high_date": "2018-01-29" + }, + "description": "The animation cycle iterations that are odd counts are played in the normal direction, and the animation cycle iterations that are even counts are played in a reverse direction." + }, + { + "name": "alternate-reverse", + "browsers": [ + "E12", + "FF5", + "FFA5", + "S4", + "SM3.2", + "C3", + "CA18", + "O15" + ], + "baseline": { + "status": "high", + "baseline_low_date": "2015-07-29", + "baseline_high_date": "2018-01-29" + }, + "description": "The animation cycle iterations that are odd counts are played in the reverse direction, and the animation cycle iterations that are even counts are played in a normal direction." + }, + { + "name": "backwards", + "browsers": [ + "E12", + "FF5", + "FFA5", + "S4", + "SM3.2", + "C3", + "CA18", + "O15" + ], + "baseline": { + "status": "high", + "baseline_low_date": "2015-07-29", + "baseline_high_date": "2018-01-29" + }, + "description": "The beginning property value (as defined in the first @keyframes at-rule) is applied before the animation is displayed, during the period defined by 'animation-delay'." + }, + { + "name": "both", + "browsers": [ + "E12", + "FF5", + "FFA5", + "S4", + "SM3.2", + "C3", + "CA18", + "O15" + ], + "baseline": { + "status": "high", + "baseline_low_date": "2015-07-29", + "baseline_high_date": "2018-01-29" + }, + "description": "Both forwards and backwards fill modes are applied." + }, + { + "name": "forwards", + "browsers": [ + "E12", + "FF5", + "FFA5", + "S4", + "SM3.2", + "C3", + "CA18", + "O15" + ], + "baseline": { + "status": "high", + "baseline_low_date": "2015-07-29", + "baseline_high_date": "2018-01-29" + }, + "description": "The final property value (as defined in the last @keyframes at-rule) is maintained after the animation completes." + }, + { + "name": "infinite", + "browsers": [ + "E12", + "FF5", + "FFA5", + "S4", + "SM3.2", + "C3", + "CA18", + "O15" + ], + "baseline": { + "status": "high", + "baseline_low_date": "2015-07-29", + "baseline_high_date": "2018-01-29" + }, + "description": "Causes the animation to repeat forever." + }, + { + "name": "none", + "browsers": [ + "E12", + "FF5", + "FFA5", + "S4", + "SM3.2", + "C3", + "CA18", + "O15" + ], + "baseline": { + "status": "high", + "baseline_low_date": "2015-07-29", + "baseline_high_date": "2018-01-29" + }, + "description": "No animation is performed" + }, + { + "name": "normal", + "browsers": [ + "E12", + "FF5", + "FFA5", + "S4", + "SM3.2", + "C3", + "CA18", + "O15" + ], + "baseline": { + "status": "high", + "baseline_low_date": "2015-07-29", + "baseline_high_date": "2018-01-29" + }, + "description": "Normal playback." + }, + { + "name": "reverse", + "browsers": [ + "E12", + "FF5", + "FFA5", + "S4", + "SM3.2", + "C3", + "CA18", + "O15" + ], + "baseline": { + "status": "high", + "baseline_low_date": "2015-07-29", + "baseline_high_date": "2018-01-29" + }, + "description": "All iterations of the animation are played in the reverse direction from the way they were specified." + } + ], + "syntax": "#", + "relevance": 84, + "references": [ + { + "name": "MDN Reference", + "url": "https://developer.mozilla.org/docs/Web/CSS/Reference/Properties/animation" + } + ], + "baseline": { + "status": "high", + "baseline_low_date": "2015-09-30", + "baseline_high_date": "2018-03-30" + }, + "description": "Shorthand property combines six of the animation properties into a single property.", + "restrictions": [ + "time", + "timing-function", + "enum", + "identifier", + "number" + ] + }, + { + "name": "animation-delay", + "browsers": [ + "E12", + "FF16", + "FFA16", + "S9", + "SM9", + "C43", + "CA43", + "IE10", + "O30" + ], + "syntax": "